text:
package net.lecousin.framework.io.buffering;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.function.Consumer;

import net.lecousin.framework.concurrent.async.Async;
import net.lecousin.framework.concurrent.async.AsyncSupplier;
import net.lecousin.framework.concurrent.async.IAsync;
import net.lecousin.framework.concurrent.threads.Task;
import net.lecousin.framework.concurrent.threads.Task.Priority;
import net.lecousin.framework.concurrent.threads.TaskManager;
import net.lecousin.framework.concurrent.threads.Threading;
import net.lecousin.framework.io.IO;
import net.lecousin.framework.io.IOUtil;
import net.lecousin.framework.util.ConcurrentCloseable;
import net.lecousin.framework.util.Pair;

/**
 * Simple implementation of a buffered writable using 2 buffers.

 * The first buffer is first filled with written data.
 * Once it is full, it is flushed to the underlying writable, and new data are written on the second buffer.

 * If the second buffer is full before the first one is flushed, operations are blocking.
 */
public class SimpleBufferedWritable extends ConcurrentCloseable<IOException> implements IO.Writable.Buffered {

	/** Constructor. */
	public SimpleBufferedWritable(Writable out, int bufferSize) {
		this.out = out;
		buffer = new byte[bufferSize];
		buffer2 = new byte[bufferSize];
		bb = ByteBuffer.wrap(buffer);
		bb2 = ByteBuffer.wrap(buffer2);
	}

	private Writable out;
	private byte[] buffer;
	private byte[] buffer2;
	private ByteBuffer bb;
	private ByteBuffer bb2;
	private int pos = 0;
	private AsyncSupplier<Integer,IOException> writing = null;

	@Override
	public IAsync<IOException> canStartWriting() {
		return new Async<>(true);
	}

	private void flushBuffer() throws IOException {
		do {
			AsyncSupplier<Integer,IOException> sp;
			synchronized (out) {
				if (writing != null && writing.isDone()) {
					if (writing.hasError()) {
						pos = 0;
						throw writing.getError();
					}
					writing = null;
				}
				if (writing == null) {
					byte[] tmp1 = buffer2;
					buffer2 = buffer;
					buffer = tmp1;
					ByteBuffer tmp2 = bb2;
					bb2 = bb;
					bb = tmp2;
					bb.clear();
					writing = out.writeAsync(bb2);
					pos = 0;
					return;
				}
				sp = writing;
			}
			sp.block(0);
		} while (true);
	}

	private AsyncSupplier<Integer,IOException> flushBufferAsync() throws IOException {
		synchronized (out) {
			if (writing != null && writing.isDone()) {
				if (writing.hasError()) {
					pos = 0;
					throw writing.getError();
				}
				writing = null;
			}
			if (writing == null) {
				byte[] tmp1 = buffer2;
				buffer2 = buffer;
				buffer = tmp1;
				ByteBuffer tmp2 = bb2;
				bb2 = bb;
				bb = tmp2;
				bb.clear();
				writing = out.writeAsync(bb2);
				pos = 0;
				return null;
			}
			return writing;
		}
	}

	@Override
	public IAsync<IOException> flush() {
		if (pos == 0) {
			if (writing == null)
				return new Async<>(true);
			return writing;
		}
		AsyncSupplier<Integer,IOException> w;
		synchronized (out) {
			if (writing != null && writing.isDone()) {
				if (writing.hasError())
					return writing;
				writing = null;
			}
			if (writing == null) {
				byte[] tmp1 = buffer2;
				buffer2 = buffer;
				buffer = tmp1;
				ByteBuffer tmp2 = bb2;
				bb2 = bb;
				bb = tmp2;
				bb.clear();
				bb2.limit(pos);
				writing = out.writeAsync(bb2);
				pos = 0;
				return writing;
			}
			w = writing;
		}
		Async<IOException> sp = new Async<>();
		w.onDone(() -> flush().onDone(sp), sp);
		return operation(sp);
	}

	@Override
	public void write(byte b) throws IOException {
		buffer[pos++] = b;
		if (pos == buffer.length)
			flushBuffer();
	}

	@Override
	public void write(byte[] buf, int offset, int length) throws IOException {
		do {
			int len = length > buffer.length - pos ? buffer.length - pos : length;
			System.arraycopy(buf, offset, buffer, pos, len);
			pos += len;
			if (pos == buffer.length)
				flushBuffer();
			if (len == length) return;
			length -= len;
			offset += len;
		} while (true);
	}

	@Override
	public int writeSync(ByteBuffer buf) throws IOException {
		int done = 0;
		do {
			int len = buf.remaining();
			if (len > buffer.length - pos) len = buffer.length - pos;
			buf.get(buffer, pos, len);
			pos += len;
			done += len;
			if (pos == buffer.length)
				flushBuffer();
			if (buf.remaining() == 0) return done;
		} while (true);
	}

	@Override
	public AsyncSupplier<Integer, IOException> writeAsync(ByteBuffer buf, Consumer<Pair<Integer,IOException>> ondone) {
		AsyncSupplier<Integer,IOException> result = new AsyncSupplier<>();
		writeAsync(buf, 0, result, ondone);
		return result;
	}

	private void writeAsync(
		ByteBuffer buf, int done, AsyncSupplier<Integer,IOException> result, Consumer<Pair<Integer,IOException>> ondone
	) {
		operation(Task.cpu("Write async to SimpleBufferedWritable", out.getPriority(), task -> {
			int d = done;
			do {
				int len = buf.remaining();
				if (len > buffer.length - pos) len = buffer.length - pos;
				buf.get(buffer, pos, len);
				pos += len;
				d += len;
				if (pos == buffer.length) {
					AsyncSupplier<Integer,IOException> flush;
					try { flush = flushBufferAsync(); }
					catch (IOException e) {
						IOUtil.error(e, result, ondone);
						return null;
					}
					if (flush != null) {
						int dd = d;
						flush.onDone(() -> {
							if (!flush.isSuccessful()) {
								IOUtil.error(flush.getError(), result , ondone);
								return;
							}
							writeAsync(buf, dd, result, ondone);
						});
						return null;
					}
				}
				if (buf.remaining() == 0) {
					if (ondone != null) ondone.accept(new Pair<>(Integer.valueOf(d), null));
					result.unblockSuccess(Integer.valueOf(d));
					return null;
				}
			} while (true);
		}).start());
	}

	@Override
	public String getSourceDescription() { return out.getSourceDescription(); }

	@Override
	public IO getWrappedIO() { return out; }

	@Override
	public Priority getPriority() { return out.getPriority(); }

	@Override
	public void setPriority(Priority priority) { out.setPriority(priority); }

	@Override
	public TaskManager getTaskManager() { return Threading.getCPUTaskManager(); }

	@Override
	protected IAsync<IOException> closeUnderlyingResources() {
		Async<IOException> sp = new Async<>();
		IAsync<IOException> flush = flush();
		flush.onDone(() -> {
			IAsync<IOException> close = out.closeAsync();
			if (flush.hasError())
				sp.error(flush.getError());
			else
				close.onDone(sp);
		});
		return sp;
	}

	@Override
	protected void closeResources(Async<IOException> ondone) {
		out = null;
		buffer = null;
		buffer2 = null;
		bb = null;
		bb2 = null;
		ondone.unblock();
	}

}


text:
package com.vaannila.domain;

public class User {

	private String name;
	private String password;
	private String gender;
	private String country;
	private String aboutYou;
	private String[] community;
	private Boolean mailingList;

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getGender() {
		return gender;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public String getAboutYou() {
		return aboutYou;
	}
	public void setAboutYou(String aboutYou) {
		this.aboutYou = aboutYou;
	}
	public String[] getCommunity() {
		return community;
	}
	public void setCommunity(String[] community) {
		this.community = community;
	}
	public Boolean getMailingList() {
		return mailingList;
	}
	public void setMailingList(Boolean mailingList) {
		this.mailingList = mailingList;
	}

}

redpajama_set_name: RedPajamaGithub


text:
@echo off

protoc.exe  -o protocol.pb protocol.proto
protoc.exe  -o login.pb login.proto
protoc.exe 	-o lobby.pb lobby.proto
protoc.exe  -o match.pb match.proto
protoc.exe 	-o private.pb private.proto

echo finished


text:
/**
 * Created by karachungen on 6/20/14.
 */

var map;

function displayMap(container, options, callback) {

	initialize(container, options, callback);

}

function initialize(container, options, callback) {

	getHtmlLocation(options, function (options) {

		options.center = new google.maps.LatLng(options.lat, options.lng);
		map = new google.maps.Map(document.getElementById(container),
			options);

		if (callback && typeof callback === "function") {
			callback();
		}
	})

}

function addMarker(options) {

	return showMarker(options);

}

function showMarker(options) {

	var dragMarker = new google.maps.Marker(options);

	map.setCenter(dragMarker.position);
	dragMarker.setMap(map);
	return dragMarker;

}

function handleNoGeolocation(errorFlag) {
	if (errorFlag) {
		var content = 'Error: The Geolocation service failed.';
	} else {
		var content = 'Error: Your browser doesn\'t support geolocation.';
	}

	alert(content);
}

function listenMarkerPosition(marker, calback) {
	google.maps.event.addListener(marker, 'dragend', function (evt) {

		position = {
			latitude: evt.latLng.lat(),
			longitude: evt.latLng.lng()
		}

		calback(position);

	});
}

function getHtmlLocation(defaultOptions, callback) {

	if (navigator.geolocation) {
		browserSupportFlag = true;
		navigator.geolocation.getCurrentPosition(function (position) {
			callback(position);
			callback({
				result: "success",
				lat: position.coords.latitude,
				lng: position.coords.longitude,
				zoom: defaultOptions.zoom
			});
		}, function () {

			callback({
				result: "error",
				type: "failed_to_get",
				lat: defaultOptions.lat,
				lng: defaultOptions.lng,
				zoom: defaultOptions.zoom
			});
		});
	}
	// Browser doesn't support Geolocation
	else {
		callback({
			result: "error",
			type: "not_supported",
			lat: defaultOptions.lat,
			lng: defaultOptions.lng,
			zoom: defaultOptions.zoom

		});
	}

}


text:
package facebook4j.internal.json;

import facebook4j.Category;
import facebook4j.Comment;
import facebook4j.FacebookException;
import facebook4j.Image;
import facebook4j.Like;
import facebook4j.PagableList;
import facebook4j.Photo;
import facebook4j.Place;
import facebook4j.ResponseList;
import facebook4j.Tag;
import facebook4j.conf.Configuration;
import facebook4j.internal.http.HttpResponse;
import facebook4j.internal.org.json.JSONArray;
import facebook4j.internal.org.json.JSONException;
import facebook4j.internal.org.json.JSONObject;

import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import static facebook4j.internal.util.z_F4JInternalParseUtil.*;

/**
 * @author Ryuji Yamashita - roundrop at gmail.com
 */
/*package*/ final class PhotoJSONImpl extends FacebookResponseImpl implements Photo, java.io.Serializable {
    private static final long serialVersionUID = 831715533023012050L;

    private String id;
    private Category from;
    private PagableList<Tag> tags;
    private String name;
    private URL icon;
    private URL picture;
    private URL source;
    private Integer height;
    private Integer width;
    private List<Image> images;
    private URL link;
    private Place place;
    private Date createdTime;
    private Date updatedTime;
    private Integer position;
    private PagableList<Comment> comments;
    private PagableList<Like> likes;
    private Category album;

    /*package*/PhotoJSONImpl(HttpResponse res, Configuration conf) throws FacebookException {
        super(res);
        JSONObject json = res.asJSONObject();
        init(json);
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.clearThreadLocalMap();
            DataObjectFactoryUtil.registerJSONObject(this, json);
        }
    }

    /*package*/PhotoJSONImpl(JSONObject json) throws FacebookException {
        super();
        init(json);
    }

    private void init(JSONObject json) throws FacebookException {
        try {
            id = getRawString("id", json);
            if (!json.isNull("from")) {
                JSONObject fromJSONObject = json.getJSONObject("from");
                from = new CategoryJSONImpl(fromJSONObject);
            }
            if (!json.isNull("tags")) {
                JSONObject tagsJSONObject = json.getJSONObject("tags");
                JSONArray list = tagsJSONObject.getJSONArray("data");
                final int size = list.length();
                tags = new PagableListImpl<Tag>(size, tagsJSONObject);
                for (int i = 0; i < size; i++) {
                    TagJSONImpl tag = new TagJSONImpl(list.getJSONObject(i));
                    tags.add(tag);
                }
            } else {
                tags = new PagableListImpl<Tag>();
            }
            name = getRawString("name", json);
            icon = getURL("icon", json);
            picture = getURL("picture", json);
            source = getURL("source", json);
            if (!json.isNull("height")) {
                height = getPrimitiveInt("height", json);
            }
            if (!json.isNull("width")) {
                width = getPrimitiveInt("width", json);
            }
            if (!json.isNull("images")) {
                images = new ArrayList<Image>();
                JSONArray imagesJSONArray = json.getJSONArray("images");
                for (int i = 0; i < imagesJSONArray.length(); i++) {
                    JSONObject imageJSONObject = imagesJSONArray.getJSONObject(i);
                    images.add(new ImageJSONImpl(imageJSONObject));
                }
            } else {
                images = Collections.emptyList();
            }
            link = getURL("link", json);
            if (!json.isNull("place")) {
                JSONObject placeJSONObject = json.getJSONObject("place");
                place = new PlaceJSONImpl(placeJSONObject);
            }
            createdTime = getISO8601Datetime("created_time", json);
            updatedTime = getISO8601Datetime("updated_time", json);
            if (!json.isNull("position")) {
                position = getPrimitiveInt("position", json);
            }
            if (!json.isNull("comments")) {
                JSONObject commentsJSONObject = json.getJSONObject("comments");
                if (!commentsJSONObject.isNull("data")) {
                    JSONArray list = commentsJSONObject.getJSONArray("data");
                    final int size = list.length();
                    comments = new PagableListImpl<Comment>(size, commentsJSONObject);
                    for (int i = 0; i < size; i++) {
                        CommentJSONImpl comment = new CommentJSONImpl(list.getJSONObject(i));
                        comments.add(comment);
                    }
                } else {
                    comments = new PagableListImpl<Comment>(1, commentsJSONObject);
                }
            } else {
                comments = new PagableListImpl<Comment>(0);
            }
            if (!json.isNull("likes")) {
                JSONObject likesJSONObject = json.getJSONObject("likes");
                if (!likesJSONObject.isNull("data")) {
                    JSONArray list = likesJSONObject.getJSONArray("data");
                    final int size = list.length();
                    likes = new PagableListImpl<Like>(size, likesJSONObject);
                    for (int i = 0; i < size; i++) {
                        LikeJSONImpl like = new LikeJSONImpl(list.getJSONObject(i));
                        likes.add(like);
                    }
                } else {
                    likes = new PagableListImpl<Like>(1, likesJSONObject);
                }
            } else {
                likes = new PagableListImpl<Like>(0);
            }
            if (!json.isNull("album")) {
                album = new CategoryJSONImpl(json.getJSONObject("album"));
            }
        } catch (JSONException jsone) {
            throw new FacebookException(jsone.getMessage(), jsone);
        }
    }

    public String getId() {
        return id;
    }

    public Category getFrom() {
        return from;
    }

    public PagableList<Tag> getTags() {
        return tags;
    }

    public String getName() {
        return name;
    }

    public URL getIcon() {
        return icon;
    }

    public URL getPicture() {
        return picture;
    }

    public URL getSource() {
        return source;
    }

    public Integer getHeight() {
        return height;
    }

    public Integer getWidth() {
        return width;
    }

    public List<Image> getImages() {
        return images;
    }

    public URL getLink() {
        return link;
    }

    public Place getPlace() {
        return place;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public Integer getPosition() {
        return position;
    }

    public PagableList<Comment> getComments() {
        return comments;
    }

    public PagableList<Like> getLikes() {
        return likes;
    }

    public Category getAlbum() {
        return album;
    }

    /*package*/
    static ResponseList<Photo> createPhotoList(HttpResponse res, Configuration conf) throws FacebookException {
        try {
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<Photo> photos = new ResponseListImpl<Photo>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject photoJSONObject = list.getJSONObject(i);
                Photo photo = new PhotoJSONImpl(photoJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(photo, photoJSONObject);
                }
                photos.add(photo);
            }
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.registerJSONObject(photos, list);
            }
            return photos;
        } catch (JSONException jsone) {
            throw new FacebookException(jsone);
        }
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        PhotoJSONImpl other = (PhotoJSONImpl) obj;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "PhotoJSONImpl{" +
                "id='" + id + '\'' +
                ", from=" + from +
                ", tags=" + tags +
                ", name='" + name + '\'' +
                ", icon=" + icon +
                ", picture=" + picture +
                ", source=" + source +
                ", height=" + height +
                ", width=" + width +
                ", images=" + images +
                ", link=" + link +
                ", place=" + place +
                ", createdTime=" + createdTime +
                ", updatedTime=" + updatedTime +
                ", position=" + position +
                ", comments=" + comments +
                ", likes=" + likes +
                ", album=" + album +
                '}';
    }

}


text:
namespace smt
{

Expr::SolverPtrs Expr::s_solver_ptrs;
unsigned Expr::s_counter = 0;

constexpr const char* const Logics::acronyms[24];

static constexpr size_t MAX_BV_SIZE = 1024;
static const Sort* bv_sorts[2][MAX_BV_SIZE] = { nullptr };

const Sort& bv_sort(bool is_signed, size_t size)
{
  assert(size < MAX_BV_SIZE);

  if (bv_sorts[is_signed][size] == nullptr) {
    bv_sorts[is_signed][size] = new Sort(
      false, false, false,
      true, is_signed, size);
  }

  return *bv_sorts[is_signed][size];
}

SharedExpr constant(const UnsafeDecl& decl)
{
  return make_shared_expr<ConstantExpr>(decl);
}

SharedExpr apply(
  const UnsafeDecl& func_decl,
  const SharedExpr& arg)
{
  constexpr size_t arity = 1;
  std::array<SharedExpr, arity> args = { arg };
  return make_shared_expr<FuncAppExpr<arity>>(
    func_decl, std::move(args));
}

SharedExpr apply(
  const UnsafeDecl& func_decl,
  const SharedExpr& larg,
  const SharedExpr& rarg)
{
  constexpr size_t arity = 2;
  std::array<SharedExpr, arity> args = { larg, rarg };
  return make_shared_expr<FuncAppExpr<arity>>(
    func_decl, std::move(args));
}

SharedExpr distinct(SharedExprs&& terms)
{
  return make_shared_expr<NaryExpr<NEQ>>(
    internal::sort<Bool>(), std::move(terms));
}

Bool conjunction(Terms<Bool>&& bools)
{
  return Bool(make_shared_expr<NaryExpr<LAND>>(
    internal::sort<Bool>(), std::move(bools.terms)));
}

Bool conjunction(const Terms<Bool>& bools)
{
  return Bool(make_shared_expr<NaryExpr<LAND>>(
    internal::sort<Bool>(), bools.terms));
}

Bool disjunction(Terms<Bool>&& bools)
{
  return Bool(make_shared_expr<NaryExpr<LOR>>(
    internal::sort<Bool>(), std::move(bools.terms)));
}

Bool disjunction(const Terms<Bool>& bools)
{
  return Bool(make_shared_expr<NaryExpr<LOR>>(
    internal::sort<Bool>(), bools.terms));
}

SharedExpr select(
  const SharedExpr& array,
  const SharedExpr& index)
{
  return make_shared_expr<ArraySelectExpr>(
    array, index);
}

SharedExpr implies(
  const SharedExpr& larg,
  const SharedExpr& rarg)
{
  return make_shared_expr<BinaryExpr<IMP>>(
    internal::sort<Bool>(), larg, rarg);
}

SharedExpr implies(
  const Bool& larg,
  const SharedExpr& rarg)
{
  return make_shared_expr<BinaryExpr<IMP>>(
    internal::sort<Bool>(), larg, rarg);
}

SharedExpr implies(
  const SharedExpr& larg,
  const Bool& rarg)
{
  return make_shared_expr<BinaryExpr<IMP>>(
    internal::sort<Bool>(), larg, rarg);
}

Bool implies(
  const Bool& larg,
  const Bool& rarg)
{
  return Bool(make_shared_expr<BinaryExpr<IMP>>(
    internal::sort<Bool>(), larg, rarg));
}

SharedExpr store(
  const SharedExpr& array,
  const SharedExpr& index,
  const SharedExpr& value)
{
  return make_shared_expr<ArrayStoreExpr>(
    array, index, value);
}

Solver::Solver()
: m_stats{0},
  m_is_timer_on(false),
  m_assertions(),
  m_assertion_stack()
{
  m_stats.encode_elapsed_time = ElapsedTime::zero();
  m_stats.check_elapsed_time = ElapsedTime::zero();

  Expr::register_solver(this);
}

Solver::Solver(Logic logic)
: m_stats{0},
  m_is_timer_on(false),
  m_assertions(),
  m_assertion_stack()
{
  m_stats.encode_elapsed_time = ElapsedTime::zero();
  m_stats.check_elapsed_time = ElapsedTime::zero();

  Expr::register_solver(this);
}

Solver::~Solver()
{
  Expr::unregister_solver(this);
}

Error Solver::encode_constant(
  const Expr* const expr,
  const UnsafeDecl& decl)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  m_stats.constants++;
  return __encode_constant(expr, decl);
}

Error Solver::encode_func_app(
  const Expr* const expr,
  const UnsafeDecl& func_decl,
  const size_t arity,
  const SharedExpr* const args)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(0 < arity);
  assert(args != nullptr);

  m_stats.func_apps++;
  return __encode_func_app(expr, func_decl, arity, args);
}

Error Solver::encode_const_array(
  const Expr* const expr,
  const SharedExpr& init)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(!init.is_null());

  return __encode_const_array(expr, init);
}

Error Solver::encode_array_select(
  const Expr* const expr,
  const SharedExpr& array,
  const SharedExpr& index)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(!array.is_null());
  assert(!index.is_null());

  m_stats.array_selects++;
  return __encode_array_select(expr, array, index);
}

Error Solver::encode_array_store(
  const Expr* const expr,
  const SharedExpr& array,
  const SharedExpr& index,
  const SharedExpr& value)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(!array.is_null());
  assert(!index.is_null());
  assert(!value.is_null());

  m_stats.array_stores++;
  return __encode_array_store(expr, array, index, value);
}

Error Solver::encode_nary(
  const Expr* const expr,
  Opcode opcode,
  const SharedExprs& args)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(!args.empty());

  switch (opcode) {
  case EQL:
    m_stats.equalities += args.size();
    break;
  case NEQ:
    m_stats.disequalities += args.size();
    break;
  case LAND:
    m_stats.conjunctions += args.size();
    break;
  case LOR:
    m_stats.disjunctions += args.size();
    break;
   default:
    ;
  }

  m_stats.nary_ops++;
  return __encode_nary(expr, opcode, args);
}

Error Solver::encode_bv_zero_extend(
  const Expr* const expr,
  const SharedExpr& bv,
  const unsigned ext)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(bv.sort().is_bv());
  return __encode_bv_zero_extend(expr, bv, ext);
}

Error Solver::encode_bv_sign_extend(
  const Expr* const expr,
  const SharedExpr& bv,
  const unsigned ext)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(bv.sort().is_bv());
  return __encode_bv_sign_extend(expr, bv, ext);
}

Error Solver::encode_bv_extract(
  const Expr* const expr,
  const SharedExpr& bv,
  const unsigned high,
  const unsigned low)
{
  ElapsedTimer timer(m_stats.encode_elapsed_time, m_is_timer_on);

  assert(bv.sort().is_bv());
  return __encode_bv_extract(expr, bv, high, low);
}

void Solver::reset()
{
  m_assertions.clear();
  m_assertion_stack.clear();

  __reset();
}

void Solver::push()
{
  m_assertion_stack.push_back(0);
  __push();
}

void Solver::pop()
{
  assert(!m_assertion_stack.empty());

  // copy value!
  unsigned n = m_assertion_stack.back();
  assert(n <= m_assertions.size());

  m_assertion_stack.pop_back();
  if (m_assertions.size() == n)
  {
    // not necessarily m_assertion_stack.empty()
    m_assertions.clear();
  }
  else
  {
    assert(m_assertions.size() - n != 0);
    m_assertions.resize(m_assertions.size() - n);
  }

  __pop();
}

void Solver::unsafe_add(const SharedExpr& condition)
{
  NonReentrantTimer<ElapsedTime> timer(m_stats.encode_elapsed_time);

  assert(condition.sort().is_bool());
  m_assertions.terms.push_back(condition);
  if (!m_assertion_stack.empty())
    ++m_assertion_stack.back();

  const Error err = __unsafe_add(condition);
  assert(err == OK);
}

void Solver::add(const Bool& condition)
{
  NonReentrantTimer<ElapsedTime> timer(m_stats.encode_elapsed_time);

  m_assertions.push_back(condition);
  if (!m_assertion_stack.empty())
    ++m_assertion_stack.back();

  const Error err = __unsafe_add(m_assertions.back());
  assert(err == OK);
}

void Solver::add(Bool&& condition)
{
  NonReentrantTimer<ElapsedTime> timer(m_stats.encode_elapsed_time);

  m_assertions.push_back(std::move(condition));
  if (!m_assertion_stack.empty())
    ++m_assertion_stack.back();

  const Error err = __unsafe_add(m_assertions.back());
  assert(err == OK);
}

CheckResult Solver::check()
{
  NonReentrantTimer<ElapsedTime> timer(m_stats.check_elapsed_time);

  if (m_assertions.empty())
    return sat;

  return __check();
}

std::pair<CheckResult, Bools::SizeType> Solver::check_assumptions(
  const Bools& assumptions,
  Bools& unsat_core)
{
  assert(m_assertion_stack.size() == 0);

  NonReentrantTimer<ElapsedTime> timer(m_stats.check_elapsed_time);
  return __check_assumptions(assumptions.terms, unsat_core.terms);
}

Bool Identity<LAND, Bool>::term(literal<Bool>(true));

}


text:
'use strict';

/**
 * Created by Indexyz on 2016/7/5.
 */

const fs = require('fs');
const lib = require('../Lib.js');
const assert = require('assert');
const launch = require('./Launch.js');

class Version {
    constructor(name, path, options, callback) {
        this.vName = name;
        this.pPath = path + name + "/";
        this.cOptions = options;

        this.loadObject(callback);
        return this
    }

    getLibraries() {
        return lib.transAllLib(JSON.stringify(this.thisObject["libraries"]));
    }

    toString() {
        return this.vName
    }

    loadObject(callback) {
        let self = this;
        fs.readFile(self.pPath + self.vName + ".json", {flag: "r"}, function (err, data) {
            if (err) {
                console.log(err)
            }
            let thisObject = JSON.parse(data.toString());
            assert.equal(self.vName, thisObject["id"]);
            self.thisObject = thisObject;

            //noinspection JSUnresolvedVariable
            let requireVersion = thisObject.inheritsFrom;
            (function (thisObject) {
                if (requireVersion != undefined){
                    new Version(requireVersion, self.cOptions.path + "/" + self.cOptions.version, self.cOptions, function (newVersion) {
                        process.nextTick(function () {
                            self.requireVersion = newVersion;
                            callback(thisObject)
                        })
                    })
                } else {
                    callback(thisObject)
                }
            })(self)
        });
    }

    isOK() {
        fs.exists(self.pPath + self.vName + ".json", function (err, state) {
            return state
        })
    }

    getLaunch(Options) {
        const launcher = new launch(this, Options);
        return launcher;
    }

    hasRequire(){
        return (this.thisObject.inheritsFrom != undefined)
    }

    getRequire(){
        return (this.hasRequire() ? this.version.thisObject.inheritsFrom : null)
    }
}

class ClassicVersion extends Version {
    loadObject(callback) {
        callback(this)
    }

    getLibraries() {
        return null
    }
}

module.exports = Version;
module.exports.ClassicVersion = ClassicVersion;


text:
package com.twitter.finagle.buoyant.h2

import com.twitter.conversions.storage._
import com.twitter.concurrent.AsyncQueue
import com.twitter.io.Buf
import com.twitter.util.StdBenchAnnotations
import io.buoyant.test.Awaits
import org.openjdk.jmh.annotations._

trait StreamBase {
  final val Iterations = 100
  final val StreamLength = 8
  final val FrameSize = 1.kilobyte
  final val BufferCapacity = FrameSize * StreamLength
  final val Data = Buf.ByteArray(Array.fill(FrameSize.bytes.toInt)(0.toByte): _*)
}

// ./sbt 'project finagle-benchmark' 'jmh:run -i 20 -prof gc .*StreamBaselineBenchmark.*'
@State(Scope.Benchmark)
class StreamBaselineBenchmark extends StdBenchAnnotations with Awaits with StreamBase {

  var q = new AsyncQueue[Frame]()
  var stream = Stream(q)

  @Benchmark
  @BenchmarkMode(Array(Mode.SingleShotTime))
  @Measurement(iterations = Iterations, batchSize = StreamLength)
  @Warmup(iterations = Iterations, batchSize = StreamLength)
  def baseline(): Frame = {
    val frame = Frame.Data(Data, eos = false)
    q.offer(frame)
    val result = await(stream.read())
    result.release()
    result
  }
}

// ./sbt 'project finagle-benchmark' 'jmh:run -i 20 -prof gc .*BufferedStreamBenchmark.*'
@State(Scope.Benchmark)
class BufferedStreamBenchmark extends StdBenchAnnotations with Awaits with StreamBase {

  var q = new AsyncQueue[Frame]()
  var stream = Stream(q)

  var bufferedStream = new BufferedStream(stream, BufferCapacity.bytes)
  var child = bufferedStream.fork().get

  @Setup(Level.Iteration)
  def setup(): Unit = {
    if (bufferedStream.bufferSize >= BufferCapacity.bytes) {
      q.fail(new Exception("discard"))
      q = new AsyncQueue[Frame]()
      stream = Stream(q)
      bufferedStream.discardBuffer()
      bufferedStream = new BufferedStream(stream, BufferCapacity.bytes)
      child = bufferedStream.fork().get()
    }
  }

  @Benchmark
  @BenchmarkMode(Array(Mode.SingleShotTime))
  @Measurement(iterations = Iterations, batchSize = StreamLength)
  @Warmup(iterations = Iterations, batchSize = StreamLength)
  def readFrame(): Frame = {
    val frame = Frame.Data(Data, eos = false)
    q.offer(frame)
    val result = await(child.read())
    result.release()
    result
  }

}

// ./sbt 'project finagle-benchmark' 'jmh:run -i 20 -prof gc .*BufferedStreamFanoutBenchmark.*'
@State(Scope.Benchmark)
class BufferedStreamFanoutBenchmark extends StdBenchAnnotations with Awaits with StreamBase {

  var q = new AsyncQueue[Frame]()
  var stream = Stream(q)

  @Param(Array("2", "3", "4", "5"))
  var Fanout: Int = _
  val FanoutMax = 5

  var bufferedStream = new BufferedStream(stream, BufferCapacity.bytes)
  var children: Array[Stream] = _
  var results: Array[Frame] = _

  @Setup(Level.Iteration)
  def setup(): Unit = {
    if (children == null) {
      children = new Array[Stream](FanoutMax)
      for (i <- 0 until Fanout) children(i) = bufferedStream.fork().get
      results = new Array[Frame](FanoutMax)
    }
    if (bufferedStream.bufferSize >= BufferCapacity.bytes) {
      q.fail(new Exception("discard"))
      q = new AsyncQueue[Frame]()
      stream = Stream(q)
      bufferedStream.discardBuffer()
      bufferedStream = new BufferedStream(stream, BufferCapacity.bytes)
      for (i <- 0 until Fanout) children(i) = bufferedStream.fork().get
    }
  }

  @Benchmark
  @BenchmarkMode(Array(Mode.SingleShotTime))
  @Measurement(iterations = Iterations, batchSize = StreamLength)
  @Warmup(iterations = Iterations, batchSize = StreamLength)
  def fanoutFrame(): Array[Frame] = {
    val frame = Frame.Data(Data, eos = false)
    q.offer(frame)
    var i = 0
    while (i < Fanout) {
      results(i) = await(children(i).read())
      results(i).release()
      i += 1
    }
    results
  }
}


text:
namespace PicnicOrm.TestModels
{
    public class OneToManyItem
    {
        public int Id { get; set; }

        public ParentItem Parent { get; set; }

        public int ParentId { get; set; }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>gp.e3.autheo</groupId>
	<artifactId>autheo</artifactId>
	<packaging>jar</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>autheo</name>
	<url>http://maven.apache.org</url>

	<dependencies>

		<dependency>
			<groupId>com.yammer.dropwizard</groupId>
			<artifactId>dropwizard-core</artifactId>
			<version>0.6.2</version>
		</dependency>

		<dependency>
			<groupId>com.yammer.dropwizard</groupId>
			<artifactId>dropwizard-testing</artifactId>
			<version>0.6.2</version>
		</dependency>

		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
			<version>2.3</version>
		</dependency>

		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.29</version>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-dbcp2</artifactId>
			<version>2.0</version>
		</dependency>

		<dependency>
			<groupId>redis.clients</groupId>
			<artifactId>jedis</artifactId>
			<version>2.7.0</version>
		</dependency>

		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-core</artifactId>
			<version>3.2.1</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.9.5</version>
		</dependency>

		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.3.175</version>
		</dependency>

		<dependency>
			<groupId>commons-validator</groupId>
			<artifactId>commons-validator</artifactId>
			<version>1.4.0</version>
		</dependency>

		<dependency>
			<groupId>commons-dbutils</groupId>
			<artifactId>commons-dbutils</artifactId>
			<version>1.6</version>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.3.3</version>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.3.2</version>
		</dependency>

		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.2.4</version>
		</dependency>

		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlets</artifactId>
			<version>8.1.10.v20130312</version>
		</dependency>

	</dependencies>

	<properties>
		<!-- use UTF-8 for everything -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<build>
		<plugins>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.3</version>
				<!-- compile for Java 1.7 -->
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>1.6</version>
				<configuration>
					<createDependencyReducedPom>true</createDependencyReducedPom>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
							</excludes>
						</filter>
					</filters>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<transformers>
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<mainClass>gp.e3.autheo.Autheo</mainClass>
								</transformer>
							</transformers>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.17</version>
				<configuration>
					<argLine>-Xms256m -Xmx256m -XX:MaxPermSize=50m</argLine>
				</configuration>
			</plugin>

		</plugins>
	</build>
</project>


text:
using System;

namespace De.Osthus.Ambeth.Cache.Collections
{
    public class DefaultCacheMapEntry : CacheMapEntry
    {
        private readonly Type entityType;
        private readonly sbyte idIndex;
        private Object id;

        public DefaultCacheMapEntry(Type entityType, sbyte idIndex, Object id, Object value, CacheMapEntry nextEntry)
            : base(entityType, idIndex, id, value, nextEntry)
        {
            this.entityType = entityType;
            this.idIndex = idIndex;
        }

        public override object Id
        {
            get
            {
                return id;
            }
            protected set
            {
                this.id = value;
            }
        }

        public override Type EntityType
        {
            get
            {
                return entityType;
            }
        }

        public override sbyte IdIndex
        {
            get
            {
                return idIndex;
            }
        }
    }
}


text:
@interface YMABaseResponse ()

@property (nonatomic, strong) NSData *data;
@property (nonatomic, copy) NSDictionary *headers;
@property (nonatomic, copy) YMAResponseHandler block;
@property (nonatomic, assign) YMAConnectHTTPStatusCodes statusCode;

@end

@implementation YMABaseResponse

#pragma mark - Object Lifecycle

- (instancetype)initWithData:(NSData *)data
                     headers:(NSDictionary *)headers
              httpStatusCode:(YMAConnectHTTPStatusCodes)httpStatusCode
                  completion:(YMAResponseHandler)block
{
    self = [self init];
    if (self != nil) {
        _data = [data yma_fixHtmlEscapeWithEncoding:NSUTF8StringEncoding];
        _block = [block copy];
        _headers = [headers copy];
        _statusCode = httpStatusCode;
    }
    return self;
}

- (instancetype)initWithData:(NSData *)data
                     headers:(NSDictionary *)headers
                  completion:(YMAResponseHandler)block
{
    return [self initWithData:data
                      headers:headers
               httpStatusCode:YMAStatusCodeUnkwownHTTP
                   completion:block];
}

#pragma mark - NSOperation

- (void)main
{
    @try {
        id responseModel = nil;
        NSError *error = NULL;

        if (self.data.length > 0) {
            responseModel = [NSJSONSerialization JSONObjectWithData:_data
                                                            options:(NSJSONReadingOptions)kNilOptions
                                                              error:&error];
        }

        if (error == NULL) {
            [self parseJSONModel:responseModel headers:self.headers error:&error];
        }

        if (self.block != NULL ) {
            self.block(self, error);
        }
    }
    @catch (NSException *exception) {
        self.block(self, [NSError errorWithDomain:exception.name code:0 userInfo:exception.userInfo]);
    }
}

#pragma mark - Public methods

- (BOOL)parseJSONModel:(id)responseModel headers:(NSDictionary *)headers error:(NSError * __autoreleasing *)error
{
    NSString *reason = [NSString stringWithFormat:@"%@ must be overridden", NSStringFromSelector(_cmd)];
    @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:reason userInfo:nil];
}

#pragma mark - Protected methods

+ (NSDate *)dateFromIsoTimeStamp:(NSString *)timeStamp
{
    NSDate *date = nil;

    static NSMutableArray<NSDateFormatter *> *dateFormatters = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        dateFormatters = [NSMutableArray array];
        for (NSString *format in @[@"yyyy-MM-dd'T'HH:mm:ssZ",
                                   @"yyyy-MM-dd'T'HH:mm:ss.SZ"]) {
            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
            formatter.dateFormat = format;
            [dateFormatters addObject:formatter];
        }
    });

    if (timeStamp != nil) {
        for (NSDateFormatter *dateFormatter in dateFormatters) {
            date = [dateFormatter dateFromString:timeStamp];
            if (date != nil) {
                break;
            }
        }
    }
    return date;
}

@end


text:
package cat.mobilejazz.utilities.debug;

import android.text.TextUtils;
import android.util.Log;
import cat.mobilejazz.utilities.BuildConfig;
import cat.mobilejazz.utilities.format.StringFormatter;

public class Debug {

	private static boolean disableLogOutputInReleaseMode = true;

	public static void enableLogOutputInReleaseMode() {
		disableLogOutputInReleaseMode = false;
	}

	private static boolean shouldLog() {
		return !disableLogOutputInReleaseMode || BuildConfig.DEBUG;
	}

	private static boolean internalMethod(StackTraceElement e) {
		return e.getClassName().startsWith("dalvik.") || e.getClassName().startsWith("java.lang.")
				|| e.getClassName().startsWith(Debug.class.getName());
	}

	protected static int getCurrentStackTraceElementIndex() {
		StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();

		int i = 0;
		while (internalMethod(stackTrace[i]) && i < stackTrace.length)
			++i;

		return i-1;
	}

	public static StackTraceElement getCurrentMethod() {
		return getCallingMethod(0);
	}

	public static StackTraceElement getParentMethod() {
		return getCallingMethod(1);
	}

	public static StackTraceElement getCallingMethod(int depth) {
		return Thread.currentThread().getStackTrace()[getCurrentStackTraceElementIndex() + depth];
	}

	public static String getCurrentClassName() {
		return getCurrentMethod().getClassName();
	}

	public static String getClassTag() {
		String className = getCurrentClassName();
		String simpleClassName = className.substring(className.lastIndexOf('.') + 1);
		int innerClassIndex = simpleClassName.indexOf('$');
		if (innerClassIndex >= 0) {
			return simpleClassName.substring(0, innerClassIndex);
		} else {
			return simpleClassName;
		}
	}

	public static String getClassMethodTag(String delim) {
		StackTraceElement elem = getCurrentMethod();
		return elem.getClassName() + delim + elem.getMethodName();
	}

	public static String getDefaultTag() {
		return getClassTag();
	}

	public static void log(int priority, String message, Object... args) {
		if (shouldLog()) {
			if (TextUtils.isEmpty(message)) {
				message = "<NO_MESSAGE>";
			}
			if (args.length > 0) {
				Log.println(priority, getDefaultTag(), String.format(message, args));
			} else {
				Log.println(priority, getDefaultTag(), message);
			}
		}
	}

	public static void debug(String message, Object... args) {
		log(Log.DEBUG, message, args);
	}

	public static void verbose(String message, Object... args) {
		log(Log.VERBOSE, message, args);
	}

	public static void info(String message, Object... args) {
		log(Log.INFO, message, args);
	}

	public static void warning(String message, Object... args) {
		log(Log.WARN, message, args);
	}

	public static void error(String message, Object... args) {
		log(Log.ERROR, message, args);
	}

	public static void logException(Throwable e) {
		if (shouldLog()) {
			e.printStackTrace();

			String message = e.getLocalizedMessage();
			if (message != null)
				error(message);
		}
	}

	public static void logMethod() {
		StackTraceElement elem = getCurrentMethod();
		verbose(elem.getMethodName());
	}

	public static void logMethodVerbose(Object... params) {
		if (shouldLog()) {
			Log.v("KDebug", "logMethodVerbose");
			StackTraceElement currentMethod = getCurrentMethod();
			try {

				StringBuilder verboseOutput = new StringBuilder();
				verboseOutput.append(currentMethod.getMethodName());
				verboseOutput.append("(");
				verboseOutput.append(StringFormatter.printIterable(params));
				verboseOutput.append(")");
				verboseOutput.append("  [");
				verboseOutput.append(currentMethod.getFileName());
				verboseOutput.append(":");
				verboseOutput.append(currentMethod.getLineNumber());
				verboseOutput.append("]");

				String className = currentMethod.getClassName();
				Log.v(className.substring(className.lastIndexOf('.') + 1), verboseOutput.toString());

			} catch (SecurityException e) {
				Log.v(currentMethod.getClassName(), currentMethod.getMethodName());
			}
		}
	}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LanguageExt;
using Moq;
using NUnit.Framework;
using SJP.Schematic.Core;
using SJP.Schematic.Lint.Rules;

namespace SJP.Schematic.Lint.Tests.Rules;

[TestFixture]
internal static class NoIndexesPresentOnTableRuleTests
{
    [Test]
    public static void Ctor_GivenInvalidLevel_ThrowsArgumentException()
    {
        const RuleLevel level = (RuleLevel)999;
        Assert.That(() => new NoIndexesPresentOnTableRule(level), Throws.ArgumentException);
    }

    [Test]
    public static void AnalyseTables_GivenNullTables_ThrowsArgumentNullException()
    {
        var rule = new NoIndexesPresentOnTableRule(RuleLevel.Error);
        Assert.That(() => rule.AnalyseTables(null), Throws.ArgumentNullException);
    }

    [Test]
    public static async Task AnalyseTables_GivenTableWithoutAnyIndexesOrCandidateKeys_ProducesMessages()
    {
        var rule = new NoIndexesPresentOnTableRule(RuleLevel.Error);

        var table = new RelationalDatabaseTable(
            "test",
            new List<IDatabaseColumn>(),
            null,
            Array.Empty<IDatabaseKey>(),
            Array.Empty<IDatabaseRelationalKey>(),
            Array.Empty<IDatabaseRelationalKey>(),
            Array.Empty<IDatabaseIndex>(),
            Array.Empty<IDatabaseCheckConstraint>(),
            Array.Empty<IDatabaseTrigger>()
        );
        var tables = new[] { table };

        var hasMessages = await rule.AnalyseTables(tables).AnyAsync().ConfigureAwait(false);

        Assert.That(hasMessages, Is.True);
    }

    [Test]
    public static async Task AnalyseTables_GivenTableWithOnlyPrimaryKey_ProducesNoMessages()
    {
        var rule = new NoIndexesPresentOnTableRule(RuleLevel.Error);

        var table = new RelationalDatabaseTable(
            "test",
            new List<IDatabaseColumn>(),
            Option<IDatabaseKey>.Some(Mock.Of<IDatabaseKey>()),
            Array.Empty<IDatabaseKey>(),
            Array.Empty<IDatabaseRelationalKey>(),
            Array.Empty<IDatabaseRelationalKey>(),
            Array.Empty<IDatabaseIndex>(),
            Array.Empty<IDatabaseCheckConstraint>(),
            Array.Empty<IDatabaseTrigger>()
        );
        var tables = new[] { table };

        var hasMessages = await rule.AnalyseTables(tables).AnyAsync().ConfigureAwait(false);

        Assert.That(hasMessages, Is.False);
    }

    [Test]
    public static async Task AnalyseTables_GivenTableWithOnlyUniqueKey_ProducesNoMessages()
    {
        var rule = new NoIndexesPresentOnTableRule(RuleLevel.Error);

        var testColumn = new DatabaseColumn(
            "test_column",
            Mock.Of<IDbType>(),
            false,
            null,
            null
        );
        var testUniqueKey = new DatabaseKey(
            Option<Identifier>.Some("test_unique_key"),
            DatabaseKeyType.Unique,
            new[] { testColumn },
            true
        );

        var table = new RelationalDatabaseTable(
            "test",
            new List<IDatabaseColumn>(),
            Option<IDatabaseKey>.None,
            new[] { testUniqueKey },
            Array.Empty<IDatabaseRelationalKey>(),
            Array.Empty<IDatabaseRelationalKey>(),
            Array.Empty<IDatabaseIndex>(),
            Array.Empty<IDatabaseCheckConstraint>(),
            Array.Empty<IDatabaseTrigger>()
        );
        var tables = new[] { table };

        var hasMessages = await rule.AnalyseTables(tables).AnyAsync().ConfigureAwait(false);

        Assert.That(hasMessages, Is.False);
    }

    [Test]
    public static async Task AnalyseTables_GivenTableWithOnlyIndex_ProducesNoMessages()
    {
        var rule = new NoIndexesPresentOnTableRule(RuleLevel.Error);

        var table = new RelationalDatabaseTable(
            "test",
            new List<IDatabaseColumn>(),
            Option<IDatabaseKey>.None,
            Array.Empty<IDatabaseKey>(),
            Array.Empty<IDatabaseRelationalKey>(),
            Array.Empty<IDatabaseRelationalKey>(),
            new[] { Mock.Of<IDatabaseIndex>() },
            Array.Empty<IDatabaseCheckConstraint>(),
            Array.Empty<IDatabaseTrigger>()
        );
        var tables = new[] { table };

        var hasMessages = await rule.AnalyseTables(tables).AnyAsync().ConfigureAwait(false);

        Assert.That(hasMessages, Is.False);
    }
}


text:
package tw.edu.kuas.wifiautologin.libs;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;

import java.util.Locale;

import tw.edu.kuas.wifiautologin.R;
import tw.edu.kuas.wifiautologin.models.UserModel;

@SuppressWarnings("unused") public class Utils {

	private static ConnectivityManager.NetworkCallback mCallback;
	private static ConnectivityManager mConnectivityManager;

	public static String getCurrentSSID(Context context) {
		WifiManager wifiManager = (WifiManager) context.getApplicationContext()
				.getSystemService(Context.WIFI_SERVICE);
		if (wifiManager == null) {
			return null;
		}
		WifiInfo wifiInfo = wifiManager.getConnectionInfo();
		if (wifiInfo != null && !TextUtils.isEmpty(wifiInfo.getSSID())) {
			String ssid = wifiInfo.getSSID();
			if (postVersion(Build.VERSION_CODES.JELLY_BEAN_MR1)) {
				if (ssid.startsWith("\"") && ssid.endsWith("\"")) {
					return ssid.substring(1, ssid.length() - 1);
				} else {
					return null;
				}
			} else {
				return ssid;
			}
		}
		return null;
	}

	public static boolean isExpectedSSID(String ssid) {
		return Constant.EXPECTED_SSIDS.contains(ssid);
	}

	public static UserModel tranUser(String user, String pwd) {
		UserModel model = new UserModel();

		model.userpwd = pwd;
		if (user.endsWith("@kuas.edu.tw")) {
			model.username = user;
			if (user.split("@")[0].length() == 5) {
				model.idtype = "";
				model.loginType = UserModel.LoginType.TEACHER;
			} else {
				model.idtype = "1";
				model.loginType = UserModel.LoginType.STUDENT;
			}
		} else if (user.endsWith("@gm.kuas.edu.tw")) {
			model.username = user;
			model.idtype = "@gm.kuas.edu.tw";
			model.loginType = UserModel.LoginType.STUDENT;
		} else if (user.length() == 10 && !user.substring(0, 2).equals("09")) {
			if (Integer.parseInt(user.substring(1, 4)) <= 102) {
				model.username = user + "@kuas.edu.tw";
				model.idtype = "1";
			} else {
				model.username = user + "@gm.kuas.edu.tw";
				model.idtype = "@gm.kuas.edu.tw";
			}
			model.loginType = UserModel.LoginType.STUDENT;
		} else if (user.length() == 5) {
			model.username = user + "@kuas.edu.tw";
			model.idtype = "";
			model.loginType = UserModel.LoginType.TEACHER;
		} else if (user.contains("@") && !user.contains("@guest")) {
			model.username = user;
			model.idtype = "";
			model.loginType = UserModel.LoginType.CYBER;
		} else {
			model.username = user + (user.contains("@guest") ? "" : "@guest");
			model.idtype = "";
			model.loginType = UserModel.LoginType.GUEST;
		}

		return model;
	}

	@SuppressWarnings("deprecation")
	@TargetApi(Build.VERSION_CODES.LOLLIPOP)
	public static void requestNetwork(Context context) {
		if (!Utils.postVersion(Build.VERSION_CODES.LOLLIPOP)) {
			return;
		}

		setUpConnectivityManager(context);
		NetworkRequest.Builder builder = new NetworkRequest.Builder();
		builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);
		builder.addTransportType(NetworkCapabilities.TRANSPORT_WIFI);

		if (mCallback != null) {
			try {
				mConnectivityManager.unregisterNetworkCallback(mCallback);
			} catch (IllegalArgumentException e) {
				e.printStackTrace();
			}
		}
		mCallback = new ConnectivityManager.NetworkCallback() {

			@Override
			public void onAvailable(Network network) {
				if (mCallback != null) {
					if (Utils.postVersion(Build.VERSION_CODES.M)) {
						mConnectivityManager.bindProcessToNetwork(network);
					} else {
						ConnectivityManager.setProcessDefaultNetwork(network);
					}
				}
			}
		};

		mConnectivityManager.requestNetwork(builder.build(), mCallback);
	}

	@SuppressWarnings("deprecation")
	@TargetApi(Build.VERSION_CODES.LOLLIPOP)
	public static void resetDefaultNetwork(Context context) {
		if (!Utils.postVersion(Build.VERSION_CODES.LOLLIPOP)) {
			return;
		}

		setUpConnectivityManager(context);
		if (Utils.postVersion(Build.VERSION_CODES.M)) {
			if (mConnectivityManager.getBoundNetworkForProcess() != null) {
				mConnectivityManager.bindProcessToNetwork(null);
			}
		} else {
			if (ConnectivityManager.getProcessDefaultNetwork() != null) {
				ConnectivityManager.setProcessDefaultNetwork(null);
			}
		}

		if (mCallback != null) {
			try {
				mConnectivityManager.unregisterNetworkCallback(mCallback);
			} catch (IllegalArgumentException e) {
				e.printStackTrace();
			}
		}
		mCallback = null;
	}

	private static void setUpConnectivityManager(Context context) {
		if (mConnectivityManager == null) {
			mConnectivityManager =
					(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
		}
	}

	public static boolean postVersion(int sdkInt) {
		return Build.VERSION.SDK_INT >= sdkInt;
	}

	public static boolean isPermissionGranted(Context context, String permission) {
		return ContextCompat.checkSelfPermission(context, permission) ==
				PackageManager.PERMISSION_GRANTED;
	}

	public static boolean isPermissionsGranted(Context context, String... permissions) {
		for (String permission : permissions) {
			if (!isPermissionGranted(context, permission)) {
				return false;
			}
		}
		return true;
	}

	public static boolean isPermissionAlwaysDenied(Activity activity, String permission) {
		return ContextCompat.checkSelfPermission(activity, permission) ==
				PackageManager.PERMISSION_DENIED &&
				!ActivityCompat.shouldShowRequestPermissionRationale(activity, permission);
	}

	public static boolean isPermissionsAlwaysDenied(Activity activity, String... permissions) {
		for (String permission : permissions) {
			if (!isPermissionAlwaysDenied(activity, permission)) {
				return false;
			}
		}
		return true;
	}

	public static boolean checkGoogleBug() {
		return postVersion(Build.VERSION_CODES.LOLLIPOP) && Build.VERSION.RELEASE.equals("6.0");
	}

	/**
	 * The above WRITE_SETTINGS checks are only required for 6.0
	 */
	@TargetApi(Build.VERSION_CODES.M)
	public static boolean checkSystemWritePermission(Context context) {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.RELEASE.equals("6.0")) {
			return Settings.System.canWrite(context);
		}
		// This is no longer needed in Android 6.0.1 or lower than Android 6.0 version
		return true;
	}

	@TargetApi(23)
	public static void showSystemWritePermissionDialog(final Activity activity,
	                                                   final int requestCode) {
		if (Utils.postVersion(Build.VERSION_CODES.M)) {
			new AlertDialog.Builder(activity).setTitle(R.string.permission_request_6_0_title)
					.setMessage(activity.getString(R.string.permission_request_6_0_message,
							"\uD83D\uDE09"))
					.setPositiveButton(R.string.setting, new DialogInterface.OnClickListener() {

						@Override
						public void onClick(DialogInterface dialog, int which) {
							Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
							intent.setData(Uri.parse("package:" + activity.getPackageName()));
							activity.startActivityForResult(intent, requestCode);
						}
					}).setNegativeButton(R.string.cancel, null).setCancelable(false).show();
		}
	}

	public static String getPhoneName() {
		return String.format(Locale.getDefault(), "%s %s %s", Build.MANUFACTURER, Build.MODEL,
				Build.VERSION.RELEASE);
	}

}


text:
title: React Transition component
components: Collapse, Fade, Grow, Slide, Zoom
githubLabel: 'component: Transition'
---

# Les transitions

Transitions help to make a UI expressive and easy to use.

Material-UI fournit un certain nombre de transitions qui peuvent être utilisées pour introduire [des transitions de base](https://material.io/design/motion/) dans votre applications.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

To better support server rendering, Material-UI provides a `style` prop to the children of some transition components, (Fade, Grow, Zoom, Slide). La propriété `style` doit être appliquée au DOM pour que l'animation fonctionne comme prévu.

```jsx
// L'objet `props` contient une propriété `style`.
// Vous devez le fournir à l'élément `div` comme indiqué ici.
function MyComponent(props) {
  return (
    <div {...props}>
      Fade
    </div>
  );
}

export default Main() {
  return (
    <Fade>
      <MyComponent />
    </Fade>
  );
}
```

## Collapse

Expand vertically from the top of the child element. Use the `orientation` prop if you need a horizontal collapse. The `collapsedHeight` property can be used to set the minimum height when not expanded.

{{"demo": "pages/components/transitions/SimpleCollapse.js", "bg": true}}

## Fade

Fondu de transparent à opaque.

{{"demo": "pages/components/transitions/SimpleFade.js", "bg": true}}

## Grow

Expand outwards from the center of the child element, while also fading in from transparent to opaque.

The second example demonstrates how to change the `transform-origin`, and conditionally applies the `timeout` prop to change the entry speed.

{{"demo": "pages/components/transitions/SimpleGrow.js", "bg": true}}

## Slide

Slide in from the edge of the screen. The `direction` property controls which edge of the screen the transition starts from.

The Transition component's `mountOnEnter` property prevents the child component from being mounted until `in` is `true`. This prevents the relatively positioned component from scrolling into view from it's off-screen position. Similarly the `unmountOnExit` property removes the component from the DOM after it has been transition off screen.

{{"demo": "pages/components/transitions/SimpleSlide.js", "bg": true}}

## Zoom

Expand outwards from the center of the child element.

Cet exemple montre également comment retarder la transition d'entrée.

{{"demo": "pages/components/transitions/SimpleZoom.js", "bg": true}}

## TransitionGroup

To animate a component when it is mounted or unmounted, you can use the [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group) component from _react-transition-group_. As components are added or removed, the `in` prop is toggled automatically by `TransitionGroup`.

{{"demo": "pages/components/transitions/TransitionGroupExample.js"}}

## TransitionComponent prop

Some Material-UI components use these transitions internally. These accept a `TransitionComponent` prop to customize the default transition. You can use any of the above components or your own. It should respect the following conditions:

- Accepts an `in` prop. This corresponds to the open/close state.
- Appeler la propriété de callback `onEnter` lorsque la transition d'entrée démarre.
- Appeler la propriété de callback `onExited` lorsque la transition de sortie est terminée. Appeler la propriété de callback `onExited` lorsque la transition de sortie est terminée.

For more information on creating a custom transition, visit the _react-transition-group_ [`Transition` documentation](http://reactcommunity.org/react-transition-group/transition). You can also visit the dedicated sections of some of the components:

- [Modal](/components/modal/#transitions)
- [Dialog](/components/dialogs/#transitions)
- [Popper](/components/popper/#transitions)
- [Snackbar](/components/snackbars/#transitions)
- [Tooltip](/components/tooltips/#transitions)


text:
'use strict';
const common = require('../common');
if (!common.hasCrypto)
  common.skip('missing crypto');

const fixtures = require('../common/fixtures');
const https = require('https');
const crypto = require('crypto');

const options = {
  key: fixtures.readKey('agent1-key.pem'),
  cert: fixtures.readKey('agent1-cert.pem'),
  ca: fixtures.readKey('ca1-cert.pem')
};

const server = https.createServer(options, function(req, res) {
  res.end('hello');
});

const aes = Buffer.alloc(16, 'S');
const hmac = Buffer.alloc(16, 'H');

server._sharedCreds.context.enableTicketKeyCallback();
server._sharedCreds.context.onticketkeycallback = function(name, iv, enc) {
  let newName, newIV;
  if (enc) {
    newName = Buffer.alloc(16, 'A');
    newIV = crypto.randomBytes(16);
  } else {
    // Renew
    return [ 2, hmac, aes ];
  }

  return [ 1, hmac, aes, newName, newIV ];
};

server.listen(0, function() {
  const addr = this.address();

  function doReq(callback) {
    https.request({
      method: 'GET',
      port: addr.port,
      servername: 'agent1',
      ca: options.ca
    }, function(res) {
      res.resume();
      res.once('end', callback);
    }).end();
  }

  doReq(function() {
    doReq(function() {
      server.close();
    });
  });
});


text:
'use strict';

var expect = require('chai').expect;
var plugins = require('../../lib/app/plugins');

var path = require('path');
var featurePath1 = path.join(__dirname, 'feature-path1');
var featurePath2 = path.join(__dirname, 'feature-path2');

describe('initFeatures', function () {

  describe('init single feature with just name and simple configuration', function () {
    var loadedFeature = null;
    beforeEach(function () {
      var app = {
        config: {
          features : [
            {
              feature : 'feature-in-path',
              config: {
                featureConfigParameter: true
              }
            }
          ],
          featurePaths: [ featurePath1 ],
          profile: 'testing'
        }
      };
      plugins.initFeatures(app);
      loadedFeature = app.feature('feature-in-path');
    });

    it('should load feature without $featureId given', function () {
      expect(loadedFeature.featureId).to.equal('feature-path1/feature-in-path');
    });

    it('should pass configuration to feature', function () {
      expect(loadedFeature.featureConfig.featureConfigParameter).to.be.ok;
    });
  });

  it('should fail if feature with same $featureId is initialized twice', function () {
    var app = {
      config: {
        features : [
          { feature : 'feature-in-path' },
          { feature : 'feature-in-path' }
        ],
        featurePaths: [ featurePath1 ],
        profile: 'testing'
      }
    };

    expect(function () {
      plugins.initFeatures(app);
    }).to.throw(/feature feature-in-path has already been initialized/);
  });

  it('should allow to load feature from single file feature', function () {
    var app = {
      config: {
        features : [
          { feature : 'single-file-feature' }
        ],
        featurePaths: [ featurePath1, featurePath2 ],
        profile: 'testing'
      }
    };

    plugins.initFeatures(app);
    expect(app.feature('single-file-feature').featureId)
      .to.equal('feature-path1/single-file-feature');
  });

  it('should not fail if config is not run as testing profile', function () {
    var app = {
      config: {
        features : [
          { feature : 'single-file-feature' }
        ],
        featurePaths: [ featurePath1, featurePath2 ]
      }
    };
    plugins.initFeatures(app);
    expect(app.feature('single-file-feature').featureId)
      .to.equal('feature-path1/single-file-feature');
  });

  it('should throw if feature directory / file is not found', function () {
    var app = {
      config: {
        features : [
          { feature : 'single-file-feature' }
        ],
        featurePaths: ['yoyo', 'bobo'],
        profile: 'testing'
      }
    };

    expect(function () {
      plugins.initFeatures(app);
    }).to.throw(/Cannot find feature.*single-file-feature.*yoyo.*bobo/);
  });

  it('should pass error if initialization of feature fail', function () {
    var app = {
      config: {
        features : [
          { feature : 'fail-on-init' }
        ],
        featurePaths: [featurePath1],
        profile: 'testing'
      }
    };

    expect(function () {
      plugins.initFeatures(app);
    }).to.throw(/Critical aborting failure error!/);
  });

  it('should load feature from first path if the same feature in multiple paths', function () {
    var app = {
      config: {
        features : [
          { feature : 'feature-in-path' }
        ],
        featurePaths: [ featurePath2, featurePath1 ],
        profile: 'testing'
      }
    };

    plugins.initFeatures(app);
    expect(app.feature('feature-in-path').featureId)
      .to.equal('feature-path2/feature-in-path');
  });

  it('should throw if unmet dependency', function () {
    var app = {
      config: {
        features : [
          { feature : 'depends-on-single-file-feature' }
        ],
        featurePaths: [ featurePath2, featurePath1 ],
        profile: 'testing'
      }
    };

    expect(function () {
      plugins.initFeatures(app);
    }).to.throw(/Feature.*depends-on-single-file-feature.*has unmet dependencies:.*single-file-feature/);
  });

  it('should throw if unmet dependency is initialized after dependent feature', function () {
    var app = {
      config: {
        features : [
          { feature : 'depends-on-single-file-feature' },
          { feature : 'single-file-feature' }
        ],
        featurePaths: [ featurePath2, featurePath1 ],
        profile: 'testing'
      }
    };

    expect(function () {
      plugins.initFeatures(app);
    }).to.throw(/Feature.*depends-on-single-file-feature.*has unmet dependencies:.*single-file-feature/);
  });

  it('should work if dependency is initialized before dependent feature', function () {
    var app = {
      config: {
        features : [
          { feature : 'single-file-feature' },
          { feature : 'depends-on-single-file-feature' }
        ],
        featurePaths: [ featurePath2, featurePath1 ],
        profile: 'testing'
      }
    };
    plugins.initFeatures(app);

    expect(app.feature('depends-on-single-file-feature').featureId)
      .to.equal('feature-path2/depends-on-single-file-feature');
    expect(app.feature('single-file-feature').featureId)
      .to.equal('feature-path1/single-file-feature');
  });

  describe('create 2 instances of the same feature with $featureId property', function () {
    var loadedApp = null;

    beforeEach(function () {
      var app = {
        config: {
          features : [
            { $featureId: 'feat1', feature : 'feature-in-path', config: { instance: 'feat1' } },
            { $featureId: 'feat2', feature : 'feature-in-path', config: { instance: 'feat2' } }
          ],
          featurePaths: [ featurePath1 ],
          profile: 'testing'
        }
      };

      loadedApp = plugins.initFeatures(app);
    });

    it('app.feature(featureId) should return feature', function () {
      expect(loadedApp.feature('feat1').featureConfig.instance).to.equal('feat1');
      expect(loadedApp.feature('feat2').featureConfig.instance).to.equal('feat2');
    });

    it('should not find feature with name if $featureId was given', function () {
      expect(function () {
        loadedApp.feature('feature-in-path');
      }).to.throw(/this service doesn't have the feature "feature-in-path"/);
    });
  });

  it('should allow to init feature once with just feature: given and second with additional $featureId', function () {
    var app = {
      config: {
        features : [
          { feature : 'feature-in-path', config: { instance: 'feat1' } },
          { $featureId: 'feat2', feature : 'feature-in-path', config: { instance: 'feat2' } }
        ],
        featurePaths: [ featurePath1 ],
        profile: 'testing'
      }
    };

    plugins.initFeatures(app);
    expect(app.feature('feature-in-path').featureConfig.instance).to.equal('feat1');
    expect(app.feature('feat2').featureConfig.instance).to.equal('feat2');
  });

});


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class ObjectUpdate extends DynamicData {
  public ObjectUpdateKind kind;
  public ManagedObjectReference obj;
  public PropertyChange[] changeSet;
  public MissingProperty[] missingSet;

  public ObjectUpdateKind getKind() {
    return this.kind;
  }

  public ManagedObjectReference getObj() {
    return this.obj;
  }

  public PropertyChange[] getChangeSet() {
    return this.changeSet;
  }

  public MissingProperty[] getMissingSet() {
    return this.missingSet;
  }

  public void setKind(ObjectUpdateKind kind) {
    this.kind=kind;
  }

  public void setObj(ManagedObjectReference obj) {
    this.obj=obj;
  }

  public void setChangeSet(PropertyChange[] changeSet) {
    this.changeSet=changeSet;
  }

  public void setMissingSet(MissingProperty[] missingSet) {
    this.missingSet=missingSet;
  }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using RosSharp.Message;
using RosSharp.Service;
using RosSharp.std_msgs;
namespace RosSharp.roscpp
{
    ///<exclude/>
    public class SetLoggerLevel : ServiceBase<SetLoggerLevel.Request,SetLoggerLevel.Response>
    {
        ///<exclude/>
        public SetLoggerLevel()
        {
        }
        ///<exclude/>
        public SetLoggerLevel(Func<Request,Response> action)
            :base(action)
        {
        }
        ///<exclude/>
        public override string ServiceType
        {
            get { return "roscpp/SetLoggerLevel"; }
        }
        ///<exclude/>
        public override string Md5Sum
        {
            get { return "51da076440d78ca1684d36c868df61ea"; }
        }
        ///<exclude/>
        public override string ServiceDefinition
        {
            get { return "string logger\nstring level---\n"; }
        }
    ///<exclude/>
    public class Request : IMessage
    {
        ///<exclude/>
        public Request()
        {
            logger = string.Empty;
            level = string.Empty;
        }
        ///<exclude/>
        public Request(BinaryReader br)
        {
            Deserialize(br);
        }
        ///<exclude/>
        public string logger { get; set; }
        ///<exclude/>
        public string level { get; set; }
        ///<exclude/>
        public string MessageType
        {
            get { return "SetLoggerLevelRequest"; }
        }
        ///<exclude/>
        public string Md5Sum
        {
            get { return "51da076440d78ca1684d36c868df61ea"; }
        }
        ///<exclude/>
        public string MessageDefinition
        {
            get { return "string logger\nstring level"; }
        }
        ///<exclude/>
        public bool HasHeader
        {
            get { return false; }
        }
        ///<exclude/>
        public void Serialize(BinaryWriter bw)
        {
            bw.WriteUtf8String(logger);
            bw.WriteUtf8String(level);
        }
        ///<exclude/>
        public void Deserialize(BinaryReader br)
        {
            logger = br.ReadUtf8String();
            level = br.ReadUtf8String();
        }
        ///<exclude/>
        public int SerializeLength
        {
            get { return 4 + logger.Length + 4 + level.Length; }
        }
        ///<exclude/>
        public bool Equals(Request other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other.logger.Equals(logger) && other.level.Equals(level);
        }
        ///<exclude/>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(Request)) return false;
            return Equals((Request)obj);
        }
        ///<exclude/>
        public override int GetHashCode()
        {
            unchecked
            {
                int result = 0;
                result = (result * 397) ^ logger.GetHashCode();
                result = (result * 397) ^ level.GetHashCode();
                return result;
            }
        }
    }
    ///<exclude/>
    public class Response : IMessage
    {
        ///<exclude/>
        public Response()
        {
        }
        ///<exclude/>
        public Response(BinaryReader br)
        {
            Deserialize(br);
        }
        ///<exclude/>
        public string MessageType
        {
            get { return "SetLoggerLevelResponse"; }
        }
        ///<exclude/>
        public string Md5Sum
        {
            get { return "d41d8cd98f00b204e9800998ecf8427e"; }
        }
        ///<exclude/>
        public string MessageDefinition
        {
            get { return ""; }
        }
        ///<exclude/>
        public bool HasHeader
        {
            get { return false; }
        }
        ///<exclude/>
        public void Serialize(BinaryWriter bw)
        {
        }
        ///<exclude/>
        public void Deserialize(BinaryReader br)
        {
        }
        ///<exclude/>
        public int SerializeLength
        {
            get { return 0; }
        }
        ///<exclude/>
        public bool Equals(Response other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return true;
        }
        ///<exclude/>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(Response)) return false;
            return Equals((Response)obj);
        }
        ///<exclude/>
        public override int GetHashCode()
        {
            unchecked
            {
                int result = 0;

                return result;
            }
        }
    }
    }
}


text:
/*
 * File:   Ident.h
 *
 */

#ifndef IDENT_H
#define	IDENT_H

#include "global.h"
#include <unordered_map>

namespace khe{

/**
 * Using the dummy template parameter T we simply count each object
 * type instead of all object types at once.
 * This decreases the IDs generally; as we do only compare objects of two equal
 * types, this does work (Note: all constraints are considered to be of type
 * "Constraint" in this case)
 *
 * Please note that as Ident is a template class, by definition of static member
 * variables there's _no_ need for definition (memory allocation) in a
 * translation unit. For an in-depth analysis, we refer to
 * http://stackoverflow.com/questions/1553854/template-static-variable
 */
using mapType = std::unordered_map<std::string, unsigned int>;

template <class T> class Ident {
public:

    static unsigned int getKey(const std::string &str){
        auto iter = entries.find(str);

        if(iter == entries.end()){
            unsigned int newID = counter++;
            entries.insert(std::make_pair(str, newID));
            return newID;
        }

        return iter->second;
    }

    static void setKey(const std::string &strId, unsigned int key){
        auto res = entries.find(strId);
        if(res != entries.end() && res->second != key)
            throw std::runtime_error("Trying to reassign another numIdKey; this may be dangerous");

        entries.insert(std::make_pair(strId, key));
    }

    static void resetCounter(){
        counter = 0;
    }

protected:
    static std::unordered_map<std::string, unsigned int> entries;
    static unsigned int counter;

};

template <class T> mapType Ident<T>::entries = mapType(1);
/**
 * @see resetCounter
 */
template <class T> unsigned int Ident<T>::counter = 0;

}

#endif	/* IDENT_H */


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/** @suppress {duplicate} */
var remoting = remoting || {};

(function() {

'use strict';

/**
 * A Dialog that is shown to the user when the connection is dropped.
 *
 * @constructor
 * @param {HTMLElement} rootElement
 * @param {remoting.WindowShape=} opt_windowShape
 * @implements {base.Disposable}
 */
remoting.ConnectionDroppedDialog = function(rootElement, opt_windowShape) {
  /** @private */
  this.dialog_ = new remoting.Html5ModalDialog({
    dialog: /** @type {HTMLDialogElement} */ (rootElement),
    primaryButton: rootElement.querySelector('.restart-button'),
    secondaryButton: rootElement.querySelector('.close-button'),
    closeOnEscape: false,
    windowShape: opt_windowShape
  });

  /** @private */
  this.disposables_ = new base.Disposables(this.dialog_);
};

remoting.ConnectionDroppedDialog.prototype.dispose = function() {
  base.dispose(this.disposables_);
  this.disposables_ = null;
};

/**
 * @return {Promise}  Promise that resolves if
 *     the user chooses to reconnect, or rejects if the user chooses to cancel.
 *     This class doesn't re-establish the connection.  The caller must
 *     implement the reconnect logic.
 */
remoting.ConnectionDroppedDialog.prototype.show = function() {
  var promise = this.dialog_.show();
  this.waitForOnline_().then(
    this.dialog_.close.bind(this.dialog_, remoting.MessageDialog.Result.PRIMARY)
  );
  return promise.then(function(/** remoting.MessageDialog.Result */ result) {
    if (result === remoting.MessageDialog.Result.PRIMARY) {
      return Promise.resolve();
    } else {
      return Promise.reject(new remoting.Error(remoting.Error.Tag.CANCELLED));
    }
  });
};

/**
 * @private
 * @return {Promise}
 */
remoting.ConnectionDroppedDialog.prototype.waitForOnline_ = function() {
  if (base.isOnline()) {
    return Promise.resolve();
  }

  var deferred = new base.Deferred();
  this.disposables_.add(new base.DomEventHook(
      window, 'online', deferred.resolve.bind(deferred), false));
  return deferred.promise();
};

})();


text:
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model app\models\LoginForm */

$this->title = 'Вход';
$this->params['breadcrumbs'][] = $this->title;
?>

Скажи пароль и войди

        <?php $form = ActiveForm::begin([
            'id' => 'login-form',
            'options' => ['class' => 'form-horizontal'],
            'fieldConfig' => [
                'inputOptions' => ['class' => 'form-control input-lg text-center'],
                'labelOptions' => ['class' => 'control-label font-size-25'],
            ],
        ]); ?>

        <?= $form->field($model, 'username') ?>

        <?= $form->field($model, 'password')->passwordInput() ?>

        <?= $form->field($model, 'rememberMe', [
            'template' => '

                    {label}
                    {input}

            ',
        ])->input('checkbox') ?>

            <?= Html::submitButton('Войти', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>

        <?php ActiveForm::end(); ?>


text:
#ifndef __INPUT_MANAGER_H__
#define __INPUT_MANAGER_H__

#include "Utility/Singleton.h"
#include "IInput.h"

class InputManager : public Singleton<InputManager>
{
public:

	void AddInput(IInput* input);
	s32 RemoveInput(s32 index);
	void ClearInputs();
	IInput* GetInput(s32 index);

	void PollEventStart();
	void PollEventUpdate();
	void PollEventFinish();
};

#endif // __INPUT_MANAGER_H__


text:
module Spontaneous::Plugins::Application
  module State
    extend Spontaneous::Concern

    module ClassMethods
      def init(options={})
        # return false if loaded?
        self.environment = (options.delete(:environment) || ENV["SPOT_ENV"] || :development)
        self.mode = options.delete(:mode) || ENV["SPOT_MODE"] || :back
        root = options.delete(:root) || ENV["SPOT_ROOT"] || Dir.pwd
        site = Spontaneous::Site.instantiate(root, environment, mode)
        lib = File.expand_path(File.join(root, "lib"))
        $:.push(lib) unless $:.include?(lib)
        Spontaneous::Logger.setup(:log_level => options[:log_level], :logfile => options[:logfile], :cli => options[:cli])
        site.initialize!
        site.schema.validate! if self.mode == :console
        logger.warn "Auto login is enabled and set to '#{site.config.auto_login}'. Please ensure this is disabled in production mode by removing the 'auto_login' setting from your environment file." if site.config.auto_login and mode == :back
        Thread.current[:spontaneous_loaded] = true
      end

      # This is called after definition of the Content model.
      #
      #   Site = Spontaneous.site(Content)
      #
      # It is a safe way to define the content model that should be used
      # globally as it checks for its existance before overwriting.
      #
      # I could do the assignment of Spontaneous::Content automatically
      # after creation of the first content model, but this method provides
      # a nice way to create the ::Site constant in the user/site code
      def site(content_model)
        site!(content_model) unless defined?(Spontaneous::Content)
        Spontaneous::Site
      end

      # This forces the assignment of Spontaneous::Content, overwriting any
      # previous value.
      #
      # Used in tests.
      #
      def site!(content_model)
        spot = ::Spontaneous
        Spontaneous.send :remove_const, :Content if defined?(Spontaneous::Content)
        Spontaneous.const_set(:Content, content_model)
        Spontaneous::Site
      end

      def loaded?
        Thread.current[:spontaneous_loaded]
      end

      def config
        Spontaneous::Site.instance.config
      end

      def db_settings
        YAML.load_file(root /  "config/database.yml")[environment]
      end

      def database
        Spontaneous::Site.instance.database
      end

      def database=(database)
        Spontaneous::Site.instance.database = database
      end

      def mode=(mode)
        @mode = mode.to_sym
      end

      def mode
        @mode
      end

      def front?
        mode == :front
      end

      def back?
        mode == :back
      end

      def environment=(env)
        @environment = env.to_sym rescue environment
      end

      alias_method :env=, :environment=

      def environment
        @environment ||= (ENV["SPOT_ENV"] || :development).to_sym
      end

      alias_method :env, :environment

      def development?
        environment == :development
      end

      def production?
        environment == :production
      end

      def test?
        environment == :test
      end
    end # ClassMethods
  end # State
end


text:
<footer>
    <script src="../../assets/js/scripts.js"></script>
</footer>


text:
require "google/cloud/video/transcoder/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Video::Transcoder::V1beta1::DeleteJobTemplateRequest.new

# Call the delete_job_template method.
result = client.delete_job_template request

# The returned object is of type Google::Protobuf::Empty.
p result
# [END transcoder_v1beta1_generated_TranscoderService_DeleteJobTemplate_sync]


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Pagamento extends Model
{
    protected $fillable = array('valor', 'dataPagamento');
}


text:
import {OnDestroy} from '@angular/core';
import {ISubscription} from 'rxjs/Subscription';
import {Config} from './shared/config';
import {ModelInterface} from './shared/model.interface';

export class Base implements OnDestroy {

  subscriptions:Array<ISubscription>;

  constructor() {
    this.subscriptions = [];
  }

  ngOnDestroy() {
    this.clearSubscriptions();
  }

  protected clearSubscriptions():void {
    this.subscriptions.map((subscription:ISubscription) => {
      subscription.unsubscribe();
    });
    this.subscriptions = [];
  }

  protected handleErrors(error: any): any {
    this.consoleLogMsg('ERROR', error);
  }

  protected consoleLogMsg(tag: string, msg: string): void {
    if (Config.isDev === true) {
      console.log(tag + ': ' + msg);
    }
  }

  protected consoleLogRecord(i, model: ModelInterface): void {
    if (Config.isDev === true) {
      console.log('record #' + i + ' = ' + model.toString());
    }
  }
  protected consoleLogArray(models: ModelInterface[]): void {
    let i: number = 0;
    if (Config.isDev === true) {
      models.map((model: ModelInterface) => {
        this.consoleLogRecord(i, model);
        i++;
      });
    }
  }

}


text:
namespace aliyun {
struct CdnDescribeOneMinuteDataRequestType {
  std::string owner_id;
  std::string resource_owner_account;
  std::string resource_owner_id;
  std::string domain_name;
  std::string data_time;
};
struct CdnDescribeOneMinuteDataResponseType {
  std::string bps;
  std::string qps;
};
} // end namespace
#endif


text:
//
//  FFWeekCalendarView.m
//  FFCalendar
//
//  Created by Fernanda G. Geraissate on 2/21/14.
//  Copyright (c) 2014 Fernanda G. Geraissate. All rights reserved.
//
//  http://fernandasportfolio.tumblr.com
//

#import "FFWeekCalendarView.h"

#import "FFWeekHeaderCollectionView.h"
#import "FFWeekScrollView.h"

@interface FFWeekCalendarView () <FFWeekCollectionViewProtocol, FFWeekHeaderCollectionViewProtocol>
@property (nonatomic, strong) FFWeekHeaderCollectionView *scrollViewHeaderWeek;
@property (nonatomic, strong) FFWeekScrollView *weekContainerScroll;
@end

@implementation FFWeekCalendarView

#pragma mark - Synthesize

@synthesize dictEvents;
@synthesize scrollViewHeaderWeek;
@synthesize weekContainerScroll;
@synthesize protocol;

#pragma mark - Lifecycle

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dateChanged:) name:DATE_MANAGER_DATE_CHANGED object:nil];
        [self setBackgroundColor:[UIColor whiteColor]];

        [self setAutoresizingMask: AR_WIDTH_HEIGHT];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

- (void)setDictEvents:(NSMutableDictionary *)_dictEvents {

    dictEvents = _dictEvents;

    if (!scrollViewHeaderWeek) {
        UIView *viewLeft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 80., HEADER_HEIGHT_SCROLL)];
        [viewLeft setBackgroundColor:[UIColor lighterGrayCustom]];
        [self addSubview:viewLeft];

        scrollViewHeaderWeek = [[FFWeekHeaderCollectionView alloc] initWithFrame:CGRectMake(viewLeft.frame.size.width, 0, self.frame.size.width-viewLeft.frame.size.width, HEADER_HEIGHT_SCROLL)];
        [scrollViewHeaderWeek setProtocol:self];
        [self scrollToPage:[NSDate componentsOfDate:[[FFDateManager sharedManager] currentDate]].weekOfMonth+1];
        [self addSubview:scrollViewHeaderWeek];

        weekContainerScroll = [[FFWeekScrollView alloc] initWithFrame:CGRectMake(0, HEADER_HEIGHT_SCROLL, self.frame.size.width, self.frame.size.height-HEADER_HEIGHT_SCROLL)];
        [self addSubview:weekContainerScroll];
    }
    [weekContainerScroll setDictEvents:dictEvents];
    [weekContainerScroll.collectionViewWeek setProtocol:self];
}

- (void)scrollToPage:(int)_intPage {
    NSInteger intIndex = 7*_intPage-1;
    [scrollViewHeaderWeek scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:intIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionRight animated:NO];
}

#pragma mark - Invalidate Layout

- (void)invalidateLayout {

    [scrollViewHeaderWeek.collectionViewLayout invalidateLayout];
    [weekContainerScroll.collectionViewWeek.collectionViewLayout invalidateLayout];
    [self dateChanged:nil];
}

#pragma mark - FFDateManager Notification

- (void)dateChanged:(NSNotification *)not {

    [scrollViewHeaderWeek reloadData];
    [self scrollToPage:[NSDate componentsOfDate:[[FFDateManager sharedManager] currentDate]].weekOfMonth+1];

    [weekContainerScroll.collectionViewWeek reloadData];
}

#pragma mark - FFWeekCollectionView Protocol

- (void)collectionViewDidScroll {

    CGPoint offset = scrollViewHeaderWeek.contentOffset;
    offset.x = weekContainerScroll.collectionViewWeek.contentOffset.x;
    [scrollViewHeaderWeek setContentOffset:offset];
}

- (void)showHourLine:(BOOL)show {

    [weekContainerScroll.labelWithActualHour setAlpha:show];
    [weekContainerScroll.labelGrayWithActualHour setAlpha:!show];

    if (show) {
        [weekContainerScroll scrollRectToVisible:CGRectMake(weekContainerScroll.frame.origin.x, weekContainerScroll.labelWithActualHour.frame.origin.y, weekContainerScroll.frame.size.width, weekContainerScroll.frame.size.height) animated:YES];
    }
}

- (void)setNewDictionary:(NSDictionary *)dict {

    if (protocol != nil && [protocol respondsToSelector:@selector(setNewDictionary:)]) {
        [protocol setNewDictionary:dictEvents];
    }
}

#pragma mark - FFWeekHeaderCollectionView Protocol

- (void)headerDidScroll {

    CGPoint offset = weekContainerScroll.collectionViewWeek.contentOffset;
    offset.x = scrollViewHeaderWeek.contentOffset.x;
    [weekContainerScroll.collectionViewWeek setContentOffset:offset];
}

@end


text:
// Child Of Controller Grab Attach|GrabAttachMechanics|50060
namespace VRTK.GrabAttachMechanics
{
    using UnityEngine;

    /// <summary>
    /// Sets the grabbed Interactable Object to be a child of the grabbing object.
    /// </summary>
    /// <remarks>
    ///   > The Interactable Object will have 1:1 tracking of the grabbing object, however it will also have reduced collision detection and will be able to pass through other colliders.
    ///
    /// **Script Usage:**
    ///  * Place the `VRTK_ChildOfControllerGrabAttach` script on either:
    ///    * The GameObject of the Interactable Object to detect interactions on.
    ///    * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
    /// </remarks>
    /// <example>
    /// `VRTK/Examples/023_Controller_ChildOfControllerOnGrab` uses this grab attach mechanic for the bow and the arrow.
    /// </example>
    [AddComponentMenu("VRTK/Scripts/Interactions/Interactables/Grab Attach Mechanics/VRTK_ChildOfControllerGrabAttach")]
    public class VRTK_ChildOfControllerGrabAttach : VRTK_BaseGrabAttach
    {
        /// <summary>
        /// The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed. It is also responsible for creating the joint on the grabbed object.
        /// </summary>
        /// <param name="grabbingObject">The GameObject that is doing the grabbing.</param>
        /// <param name="givenGrabbedObject">The GameObject that is being grabbed.</param>
        /// <param name="givenControllerAttachPoint">The point on the grabbing object that the grabbed object should be attached to after grab occurs.</param>
        /// <returns>Returns `true` if the grab is successful, `false` if the grab is unsuccessful.</returns>
        public override bool StartGrab(GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint)
        {
            if (base.StartGrab(grabbingObject, givenGrabbedObject, givenControllerAttachPoint))
            {
                SnapObjectToGrabToController(givenGrabbedObject);
                grabbedObjectScript.isKinematic = true;
                return true;
            }
            return false;
        }

        /// <summary>
        /// The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
        /// </summary>
        /// <param name="applyGrabbingObjectVelocity">If `true` will apply the current velocity of the grabbing object to the grabbed object on release.</param>
        public override void StopGrab(bool applyGrabbingObjectVelocity)
        {
            ReleaseObject(applyGrabbingObjectVelocity);
            base.StopGrab(applyGrabbingObjectVelocity);
        }

        protected override void Initialise()
        {
            tracked = false;
            climbable = false;
            kinematic = true;
        }

        protected virtual void SetSnappedObjectPosition(GameObject obj)
        {
            if (grabbedSnapHandle == null)
            {
                obj.transform.position = controllerAttachPoint.transform.position;
            }
            else
            {
                obj.transform.rotation = controllerAttachPoint.transform.rotation * Quaternion.Inverse(grabbedSnapHandle.transform.localRotation);
                obj.transform.position = controllerAttachPoint.transform.position - (grabbedSnapHandle.transform.position - obj.transform.position);
            }
        }

        protected virtual void SnapObjectToGrabToController(GameObject obj)
        {
            if (!precisionGrab)
            {
                SetSnappedObjectPosition(obj);
            }
            obj.transform.SetParent(controllerAttachPoint.transform);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>lateral</artifactId>
        <groupId>transgenic.lauterbrunnen</groupId>
        <version>2.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>lateral-aspects</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.8.9</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.8.9</version>
        </dependency>
        <dependency>
            <groupId>transgenic.lauterbrunnen</groupId>
            <artifactId>lateral-core</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
    </dependencies>

</project>