text:
'use strict';

import * as vscode from 'vscode';
import { ITypescriptServiceClient } from '../typescriptService';
import { loadMessageBundle } from 'vscode-nls';
import { dirname, join } from 'path';

const localize = loadMessageBundle();
const selector = ['javascript', 'javascriptreact'];

interface Option extends vscode.MessageItem {
	execute(): void;
}

interface Hint {
	message: string;
	options: Option[];
}

interface ProjectHintedMap {
	[k: string]: boolean;
}

const fileLimit = 500;

class ExcludeHintItem {
	private _item: vscode.StatusBarItem;
	private _client: ITypescriptServiceClient;
	private _currentHint: Hint;

	constructor(client: ITypescriptServiceClient) {
		this._client = client;
		this._item = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE);
		this._item.command = 'js.projectStatus.command';
	}

	public getCurrentHint(): Hint {
		return this._currentHint;
	}

	public hide() {
		this._item.hide();
	}

	public show(configFileName: string, largeRoots: string, onExecute: () => void) {
		this._currentHint = {
			message: largeRoots.length > 0
				? localize('hintExclude', "To enable project-wide JavaScript/TypeScript language features, exclude folders with many files, like: {0}", largeRoots)
				: localize('hintExclude.generic', "To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on."),
			options: [{
				title: localize('open', "Configure Excludes"),
				execute: () => {
					this._client.logTelemetry('js.hintProjectExcludes.accepted');
					onExecute();
					this._item.hide();

					let configFileUri: vscode.Uri;
					if (vscode.workspace.rootPath && dirname(configFileName).indexOf(vscode.workspace.rootPath) === 0) {
						configFileUri = vscode.Uri.file(configFileName);
					} else {
						configFileUri = vscode.Uri.parse('untitled://' + join(vscode.workspace.rootPath || '', 'jsconfig.json'));
					}

					return vscode.workspace.openTextDocument(configFileName)
						.then(vscode.window.showTextDocument);
				}
			}]
		};
		this._item.tooltip = this._currentHint.message;
		this._item.text = localize('large.label', "Configure Excludes");
		this._item.tooltip = localize('hintExclude.tooltip', "To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on.");
		this._item.color = '#A5DF3B';
		this._item.show();
		this._client.logTelemetry('js.hintProjectExcludes');
	}
}

function createLargeProjectMonitorForProject(item: ExcludeHintItem, client: ITypescriptServiceClient, isOpen: (path: string) => Promise<boolean>, memento: vscode.Memento): vscode.Disposable[] {
	const toDispose: vscode.Disposable[] = [];
	const projectHinted: ProjectHintedMap = Object.create(null);

	const projectHintIgnoreList = memento.get<string[]>('projectHintIgnoreList', []);
	for (let path of projectHintIgnoreList) {
		if (path === null) {
			path = 'undefined';
		}
		projectHinted[path] = true;
	}

	function onEditor(editor: vscode.TextEditor | undefined): void {
		if (!editor
			|| !vscode.languages.match(selector, editor.document)
			|| !client.normalizePath(editor.document.uri)) {

			item.hide();
			return;
		}

		const file = client.normalizePath(editor.document.uri);
		if (!file) {
			return;
		}
		isOpen(file).then(value => {
			if (!value) {
				return;
			}

			return client.execute('projectInfo', { file, needFileNameList: true } as protocol.ProjectInfoRequestArgs).then(res => {
				if (!res.body) {
					return;
				}
				let { configFileName, fileNames } = res.body;

				if (projectHinted[configFileName] === true || !fileNames) {
					return;
				}

				if (fileNames.length > fileLimit || res.body.languageServiceDisabled) {
					let largeRoots = computeLargeRoots(configFileName, fileNames).map(f => `'/${f}/'`).join(', ');
					item.show(configFileName, largeRoots, () => {
						projectHinted[configFileName] = true;
					});
				} else {
					item.hide();
				}
			});
		}).catch(err => {
			client.warn(err);
		});
	}

	toDispose.push(vscode.workspace.onDidChangeTextDocument(e => {
		delete projectHinted[e.document.fileName];
	}));

	toDispose.push(vscode.window.onDidChangeActiveTextEditor(onEditor));
	onEditor(vscode.window.activeTextEditor);

	return toDispose;
}

function createLargeProjectMonitorFromTypeScript(item: ExcludeHintItem, client: ITypescriptServiceClient): vscode.Disposable {
	return client.onProjectLanguageServiceStateChanged(body => {
		if (body.languageServiceEnabled) {
			item.hide();
		} else {
			item.show(body.projectName, '', () => { });
		}
	});
}

export function create(client: ITypescriptServiceClient, isOpen: (path: string) => Promise<boolean>, memento: vscode.Memento) {
	const toDispose: vscode.Disposable[] = [];

	let item = new ExcludeHintItem(client);
	toDispose.push(vscode.commands.registerCommand('js.projectStatus.command', () => {
		let { message, options } = item.getCurrentHint();
		return vscode.window.showInformationMessage(message, ...options).then(selection => {
			if (selection) {
				return selection.execute();
			}
		});
	}));

	if (client.apiVersion.has213Features()) {
		toDispose.push(createLargeProjectMonitorFromTypeScript(item, client));
	} else {
		toDispose.push(...createLargeProjectMonitorForProject(item, client, isOpen, memento));
	}

	return vscode.Disposable.from(...toDispose);
}

function computeLargeRoots(configFileName: string, fileNames: string[]): string[] {

	let roots: { [first: string]: number } = Object.create(null);
	let dir = dirname(configFileName);

	// console.log(dir, fileNames);

	for (let fileName of fileNames) {
		if (fileName.indexOf(dir) === 0) {
			let first = fileName.substring(dir.length + 1);
			first = first.substring(0, first.indexOf('/'));
			if (first) {
				roots[first] = (roots[first] || 0) + 1;
			}
		}
	}

	let data: { root: string; count: number }[] = [];
	for (let key in roots) {
		data.push({ root: key, count: roots[key] });
	}

	data
		.sort((a, b) => b.count - a.count)
		.filter(s => s.root === 'src' || s.root === 'test' || s.root === 'tests');

	let result: string[] = [];
	let sum = 0;
	for (let e of data) {
		sum += e.count;
		result.push(e.root);
		if (fileNames.length - sum < fileLimit) {
			break;
		}
	}

	return result;
}


text:
module Rpush
  module Client
    module ActiveRecord
      module Apns2
        class Notification < Rpush::Client::ActiveRecord::Apns::Notification
        end
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
/**
 * Created by bradadams on 2/4/2015.
 */
StartTest(function(t) {
    t.diag("CR Clinical Element View Buttons");
    var viewDetail = "[clinicalElementConfigurationId='a57ba2f0-e55d-4f4a-848e-9bd7d2c233de']";
    t.chain(

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] itemlistgrid [itemId=view] => table.x-grid-item:nth-child(1) .x-grid-cell:nth-child(4) .cellTextNowrap", offset : [87, 11] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] panel itemlistdetail [itemId=itemlistdetail-1046-viewInNewTab] => .x-btn-button", offset : [36, 15] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo tabbar tab[text=Pulse 1] => .x-tab-close-btn", offset : [7, 5] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] itemlistgrid button[text=Description] => .x-btn-button", offset : [43, 6] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] itemlistgrid button[text=Description] => .x-btn-button", offset : [43, 6] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] itemlistgrid button[text=Wrap] => .x-btn-button", offset : [24, 10] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] itemlistgrid button[text=Wrap] => .x-btn-button", offset : [24, 10] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] panel itemlistdetail button[text=Done] => .x-btn-button", offset : [36, 9] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] panel itemlistdetail button[text=Done] => .x-btn-button", offset : [36, 9] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] itemlistgrid [itemId=view] => table.x-grid-item:nth-child(1) .x-grid-cell:nth-child(6) .cellTextNowrap", offset : [114, 13] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] panel itemlistdetail button[text=Done] => .x-btn-button", offset : [30, 4] },

        { click : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] panel itemlistdetail button[text=Done] => .x-btn-button", offset : [30, 4] },

        { moveCursorTo : "#app-portal clinicalelementportlet[title=Public Health Lab1] iteminfo itemlist[title=List (48 of 48)] itemlistgrid [itemId=view] => table.x-grid-item:nth-child(1) .x-grid-cell:nth-child(5)", offset : [20, 17] }

    );
})


text:
/*
 * Digital Arts and Entertainment
 */
package dae.animation.rig;

import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import dae.animation.skeleton.RevoluteJoint;
import dae.io.XMLUtils;
import dae.util.MathUtil;
import java.io.IOException;
import java.io.StringWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

/**
 * This connector calculates the angle difference between two vectors, given an
 * axis of rotation.
 *
 * @author Koen.Samyn
 */
public class AngleOrientationConnector extends InputConnector {

    private Vector3f jointOrientationAxis = Vector3f.UNIT_Y.clone();
    private Vector3f targetOrientationAxis = Vector3f.UNIT_Y.clone();

    @Override
    public float getValue() {
        Vector3f axis = getJoint().getWorldRotationAxis();
        axis.normalizeLocal();

        Vector3f fromVector = getAttachment().getWorldRotation().mult(jointOrientationAxis);
        Vector3f toVector = getTarget().getWorldRotation().mult(targetOrientationAxis);

        MathUtil.project(fromVector, axis);
        MathUtil.project(toVector, axis);
        fromVector.normalizeLocal();
        toVector.normalizeLocal();
        float angle = fromVector.angleBetween(toVector) * FastMath.RAD_TO_DEG;
        if (fromVector.cross(toVector).dot(axis) < 0) {
            angle = -angle;
        }
        return angle;
    }

    @Override
    public InputConnector cloneConnector() {
        AngleOrientationConnector copy = new AngleOrientationConnector();
        copy.jointOrientationAxis = jointOrientationAxis.clone();
        copy.targetOrientationAxis = targetOrientationAxis.clone();

        copy.setJointName(getJointName());
        copy.setTargetName(getTargetName());
        copy.setAttachmentName(getAttachmentName());
        copy.setInitialized(false);
        return copy;
    }

    @Override
    public String toXML() {
        try {
            StringWriter sw = new StringWriter();
            sw.write("<input class='");
            sw.write(this.getClass().getCanonicalName());
            sw.write("' ");
            XMLUtils.writeAttribute(sw, "jointName", getJointName());
            XMLUtils.writeAttribute(sw, "attachmentName", getAttachmentName());
            XMLUtils.writeAttribute(sw, "targetName", getTargetName());
            XMLUtils.writeAttribute(sw, "jointOrientationAxis", this.jointOrientationAxis);
            XMLUtils.writeAttribute(sw, "targetOrientationAxis", this.targetOrientationAxis);
            sw.write("/>\n");
            return sw.toString();
        } catch (IOException ex) {
            Logger.getLogger("DArtE").log(Level.SEVERE, null, ex);
        }
        return "";
    }

    @Override
    public void fromXML(Node inputNode) {
        NamedNodeMap map = inputNode.getAttributes();
        setJointName(XMLUtils.getAttribute("jointName", map));
        setAttachmentName(XMLUtils.getAttribute("attachmentName", map));
        setTargetName(XMLUtils.getAttribute("targetName", map));

        String sjoAxis = XMLUtils.getAttribute("jointOrientationAxis", map);
        this.jointOrientationAxis = XMLUtils.parseFloat3(sjoAxis);

        String stoAxis = XMLUtils.getAttribute("targetOrientationAxis", map);
        this.targetOrientationAxis = XMLUtils.parseFloat3(stoAxis);
    }

    /**
     * @return the targetOrientationAxis
     */
    public Vector3f getTargetOrientationAxis() {
        return targetOrientationAxis;
    }

    /**
     * @param targetOrientationAxis the targetOrientationAxis to set
     */
    public void setTargetOrientationAxis(Vector3f targetOrientationAxis) {
        this.targetOrientationAxis = targetOrientationAxis;
    }

    @Override
    public ConnectorType getConnectorType() {
        return RevoluteJoint.ANGLE_ORIENTATION_TYPE;
    }

}


text:
<?php

namespace Magento\Setup\Module\I18n\Parser;

/**
 * Adapter Interface
 */
interface AdapterInterface
{
    /**
     * Parse file
     *
     * @param string $file
     * @return array
     */
    public function parse($file);

    /**
     * Get parsed phrases
     *
     * @return array
     */
    public function getPhrases();
}


text:
package akka.dispatch.verification

import akka.actor.{ActorCell, ActorRef, ActorSystem, Props}
import akka.dispatch.{ Envelope }

// ---------- External Events -----------

// External events used to specify a trace
abstract trait ExternalEvent {
  def label: String
}

// Attaches unique IDs to external events.
trait UniqueExternalEvent {
  var _id : Int = IDGenerator.get()

  def label: String = "e"+_id
  def toStringWithId: String = label+":"+toString()

  override def equals(other: Any): Boolean = {
    if (other.isInstanceOf[UniqueExternalEvent]) {
      return _id == other.asInstanceOf[UniqueExternalEvent]._id
    } else {
      return false
    }
  }

  override def hashCode: Int = {
    return _id
  }
}

/**
 * ExternalMessageConstructors are instance variables of Send() events.
 * They serve two purposes:
 *  - They allow the client to late-bind the construction of their message.
 *    apply() is invoked after the ActorSystem and all actors have been
 *    created.
 *  - Optionally: they provide an interface for `shrinking` the contents of
 *    the messages. This is achieved through `getComponents` and
 *    `maskComponents`.
 */
abstract class ExternalMessageConstructor extends Serializable {
  // Construct the message
  def apply() : Any
  // Optional, for `shrinking`:
  // Get the components that make up the content of the message we construct
  // in apply(). For now, only relevant to cluster membership messages.
  def getComponents() : Seq[ActorRef] = List.empty
  // Given a sequence of indices (pointing to elements in `getComponents()`),
  // create a new ExternalMessageConstructor that does not include those
  // components upon apply().
  // Default: no-op
  def maskComponents(indices: Set[Int]): ExternalMessageConstructor = this
}

case class BasicMessageConstructor(msg: Any) extends ExternalMessageConstructor {
  def apply(): Any = msg
}

// External Event types.
final case class Start (propCtor: () => Props, name: String) extends
    ExternalEvent with Event with UniqueExternalEvent
// Really: isolate the actor.
final case class Kill (name: String) extends
    ExternalEvent with Event with UniqueExternalEvent
// Actually kill the actor rather than just isolating it.
// TODO(cs): support killing of actors that aren't direct children of /user/
final case class HardKill (name: String) extends
    ExternalEvent with Event with UniqueExternalEvent
final case class Send (name: String, messageCtor: ExternalMessageConstructor) extends
    ExternalEvent with Event with UniqueExternalEvent
final case class WaitQuiescence() extends
    ExternalEvent with Event with UniqueExternalEvent
// Stronger than WaitQuiescence: schedule indefinitely until cond returns true.
// if quiescence has been reached but cond does
// not return true, wait indefinitely until scheduler.enqueue_message is
// invoked, schedule it, and again wait for quiescence. Repeat until cond
// returns true. (Useful for systems that use external threads to send
// messages indefinitely.
final case class WaitCondition(cond: () => Boolean) extends
    ExternalEvent with Event with UniqueExternalEvent
// Bidirectional partitions.
final case class Partition (a: String, b: String) extends
    ExternalEvent with Event with UniqueExternalEvent
final case class UnPartition (a: String, b: String) extends
    ExternalEvent with Event with UniqueExternalEvent
// Executed synchronously, i.e. by the scheduler itself. The code block must
// terminate (quickly)!
final case class CodeBlock (block: () => Any) extends
    ExternalEvent with Event with UniqueExternalEvent

// ---------- Failure Detector messages -----------

// Base class for failure detector messages
abstract class FDMessage

// Notification telling a node that it can query a failure detector by sending messages to fdNode.
case class FailureDetectorOnline(fdNode: String) extends FDMessage

// A node is unreachable, either due to node failure or partition.
case class NodeUnreachable(actor: String) extends FDMessage with Event
case class NodesUnreachable(actors: Set[String]) extends FDMessage with Event

// A new node is now reachable, either because a partition healed or an actor spawned.
case class NodeReachable(actor: String) extends FDMessage with Event
//
// A new node is now reachable, either because a partition healed or an actor spawned.
case class NodesReachable(actors: Set[String]) extends FDMessage with Event

// Query the failure detector for currently reachable actors.
case object QueryReachableGroup extends FDMessage

// Response to failure detector queries.
case class ReachableGroup(actors: Set[String]) extends FDMessage

// --------------- Utility functions ----------------

object MessageTypes {
  // Messages that the failure detector sends to actors.
  // Assumes that actors don't relay fd messages to eachother.
  def fromFailureDetector(m: Any) : Boolean = {
    m match {
      case _: FailureDetectorOnline | _: NodeUnreachable | _: NodeReachable |
           _: ReachableGroup => return true
      case _ => return false
    }
  }

  def fromCheckpointCollector(m: Any) : Boolean = {
    m match {
      case CheckpointRequest => return true
      case _ => return false
    }
  }

  def sanityCheckTrace(trace: Seq[ExternalEvent]) {
    trace foreach {
      case Send(_, msgCtor) =>
        val msg = msgCtor()
        if (MessageTypes.fromFailureDetector(msg) ||
            MessageTypes.fromCheckpointCollector(msg)) {
          throw new IllegalArgumentException(
            "trace contains system message: " + msg)
        }
      case _ => None
    }
  }
}

object ActorTypes {
  def systemActor(name: String) : Boolean = {
    return name == FailureDetector.fdName || name == CheckpointSink.name
  }
}

object EventTypes {
  // Should return true if the given message is an external message
  var externalMessageFilterHasBeenSet = false
  var externalMessageFilter: (Any) => Boolean = (_) => false
  // Should be set by applications during initialization.
  def setExternalMessageFilter(filter: (Any) => Boolean) {
    externalMessageFilterHasBeenSet = true
    externalMessageFilter = filter
  }

  def isMessageType(e: Event) : Boolean = {
    e match {
      case MsgEvent(_, _, m) =>
        return true
      case MsgSend(_, _, m) =>
        return true
      case UniqueMsgEvent(MsgEvent(_, _, m), _) =>
        return true
      case UniqueMsgSend(MsgSend(_, _, m), _) =>
        return true
      case _ =>
        return false
    }
  }

  // Internal events that correspond to ExternalEvents.
  def isExternal(e: Event) : Boolean = {
    if (e.isInstanceOf[ExternalEvent]) {
      return true
    }
    return e match {
      case _: KillEvent | _: SpawnEvent | _: PartitionEvent | _: UnPartitionEvent =>
        return true
      case MsgEvent(_, _, m) =>
        return externalMessageFilter(m)
      case MsgSend(_, _, m) =>
        return externalMessageFilter(m)
      case UniqueMsgEvent(MsgEvent(_, _, m), _) =>
        return externalMessageFilter(m)
      case UniqueMsgSend(MsgSend(_, _, m), _) =>
        return externalMessageFilter(m)
      case _ => return false
    }
  }
}


text:
def day1(filename)
  parens = File.readlines(filename).first.strip.split("")
  floor, first_basement_position = process_parens(parens)

  puts "Floor: #{floor}"
  puts "First basement paren: #{first_basement_position}"
end

def process_parens(parens)
  (0...parens.length).reduce([0, nil]) do |parts, i|
    counter = parts.first + (parens[i] == "(" ? 1 : -1)
    first_basement_position = parts.last || (counter == -1 ? i + 1 : nil)
    [counter, first_basement_position]
  end
end


text:
require "gates_of_moria/door"
require "gates_of_moria/quiz"
require "gates_of_moria/repl"
require "gates_of_moria/version"

require 'json'

module GatesOfMoria
end


text:
layout: post
date:	2011-08-01 07:24:00
title:  Troubling questions....
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
I'd like your reactions to this:

http://dailypicksandflicks.com/2011/07/30/chimp-bottle-feeds-tiger-cubs-video/

Is  it ethical to train animals in this way?

One may argue that we have domesticated cattle and horses and many pets, including the training of Cormorants to actually not eat fish but deliver them to the fishermen (which still amazes me)....but the question remains in my mind. What do you think?


text:
(function() {
	var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit;

	tinymce.create('tinymce.plugins.Safari', {
		init : function(ed) {
			var t = this, dom;

			// Ignore on non webkit
			if (!tinymce.isWebKit)
				return;

			t.editor = ed;
			t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
			t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];

			// Safari will crash if the build in createlink command is used
/*			ed.addCommand('CreateLink', function(u, v) {
				ed.execCommand("mceInsertContent", false, '' + ed.selection.getContent() + '');
			});*/

			// Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004
			ed.addCommand('FormatBlock', function(u, v) {
				var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock);

				if (e)
					dom.replace(dom.create(v), e, 1);
				else
					ed.getDoc().execCommand("FormatBlock", false, v);
			});

			// Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382
			ed.addCommand('mceInsertContent', function(u, v) {
				ed.getDoc().execCommand("InsertText", false, 'mce_marker');
				ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, v + 'XX');
				ed.selection.select(ed.dom.get('_mce_tmp'));
				ed.getDoc().execCommand("Delete", false, ' ');
			});

			// Workaround for List ID bug, http://bugs.webkit.org/show_bug.cgi?id=16004
/*			function addList(c) {
				var cb = Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) {
					e = e.target;

					if (e.nodeName == 'OL' || e.nodeName == 'UL')
						e.id = '';
				});

				ed.getDoc().execCommand(c, false, false);
				Event.remove(ed.getDoc(), 'DOMNodeInserted', cb);
			};

			ed.addCommand('InsertUnorderedList', function() {addList('InsertUnorderedList');});
			ed.addCommand('InsertOrderedList', function() {addList('InsertOrderedList');});*/

			// Safari returns incorrect values
			ed.addQueryValueHandler('FontSize', function(u, v) {
				var e, v;

				// Check for the real font size at the start of selection
				if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontSize))
					return tinymce.inArray(t.namedFontSizes, v) + 1;

				// Check for the real font size at the end of selection
				if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontSize))
					return tinymce.inArray(t.namedFontSizes, v) + 1;

				// Return default value it's better than nothing right!
				return ed.getDoc().queryCommandValue('FontSize');
			});

			// Safari returns incorrect values
			ed.addQueryValueHandler('FontName', function(u, v) {
				var e, v;

				// Check for the real font name at the start of selection
				if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontFamily))
					return v.replace(/, /g, ',');

				// Check for the real font name at the end of selection
				if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontFamily))
					return v.replace(/, /g, ',');

				// Return default value it's better than nothing right!
				return ed.getDoc().queryCommandValue('FontName');
			});

			// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
			ed.onClick.add(function(ed, e) {
				e = e.target;

				if (e.nodeName == 'IMG') {
					t.selElm = e;
					ed.selection.select(e);
				} else
					t.selElm = null;
			});

			ed.onBeforeExecCommand.add(function(ed, c, b) {
				var r = t.bookmarkRng;

				// Restore selection
				if (r) {
					ed.selection.setRng(r);
					t.bookmarkRng = null;
					//console.debug('restore', r.startContainer, r.startOffset, r.endContainer, r.endOffset);
				}
			});

			ed.onInit.add(function() {
				t._fixWebKitSpans();

				ed.windowManager.onOpen.add(function() {
					var r = ed.selection.getRng();

					// Store selection if valid
					if (r.startContainer != ed.getDoc()) {
						t.bookmarkRng = r.cloneRange();
						//console.debug('store', r.startContainer, r.startOffset, r.endContainer, r.endOffset);
					}
				});

				ed.windowManager.onClose.add(function() {
					t.bookmarkRng = null;
				});

				if (isOldWebKit)
					t._patchSafari2x(ed);
			});

			ed.onSetContent.add(function() {
				dom = ed.dom;

				// Convert strong,b,em,u,strike to spans
				each(['strong','b','em','u','strike','sub','sup','a'], function(v) {
					each(grep(dom.select(v)).reverse(), function(n) {
						var nn = n.nodeName.toLowerCase(), st;

						// Convert anchors into images
						if (nn == 'a') {
							if (n.name)
								dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n);

							return;
						}

						switch (nn) {
							case 'b':
							case 'strong':
								if (nn == 'b')
									nn = 'strong';

								st = 'font-weight: bold;';
								break;

							case 'em':
								st = 'font-style: italic;';
								break;

							case 'u':
								st = 'text-decoration: underline;';
								break;

							case 'sub':
								st = 'vertical-align: sub;';
								break;

							case 'sup':
								st = 'vertical-align: super;';
								break;

							case 'strike':
								st = 'text-decoration: line-through;';
								break;
						}

						dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1);
					});
				});
			});

			ed.onPreProcess.add(function(ed, o) {
				dom = ed.dom;

				each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) {
					var v, bg;

					if (o.get) {
						if (dom.hasClass(n, 'Apple-style-span')) {
							bg = n.style.backgroundColor;

							switch (dom.getAttrib(n, 'mce_name')) {
								case 'font':
									if (!ed.settings.convert_fonts_to_spans)
										dom.setAttrib(n, 'style', '');
									break;

								case 'strong':
								case 'em':
								case 'sub':
								case 'sup':
									dom.setAttrib(n, 'style', '');
									break;

								case 'strike':
								case 'u':
									if (!ed.settings.inline_styles)
										dom.setAttrib(n, 'style', '');
									else
										dom.setAttrib(n, 'mce_name', '');

									break;

								default:
									if (!ed.settings.inline_styles)
										dom.setAttrib(n, 'style', '');
							}

							if (bg)
								n.style.backgroundColor = bg;
						}
					}

					if (dom.hasClass(n, 'mceItemRemoved'))
						dom.remove(n, 1);
				});
			});

			ed.onPostProcess.add(function(ed, o) {
				// Safari adds BR at end of all block elements
				o.content = o.content.replace(/
<\/(h[1-6]|div|p|address|pre)>/g, '</$1>');

				// Safari adds id="undefined" to HR elements
				o.content = o.content.replace(/ id=\"undefined\"/g, '');
			});
		},

		_fixWebKitSpans : function() {
			var t = this, ed = t.editor;

			if (!isOldWebKit) {
				// Use mutator events on new WebKit
				Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) {
					e = e.target;

					if (e && e.nodeType == 1)
						t._fixAppleSpan(e);
				});
			} else {
				// Do post command processing in old WebKit since the browser crashes on Mutator events :(
				ed.onExecCommand.add(function() {
					each(ed.dom.select('span'), function(n) {
						t._fixAppleSpan(n);
					});

					ed.nodeChanged();
				});
			}
		},

		_fixAppleSpan : function(e) {
			var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p;

			if (dom.getAttrib(e, 'mce_fixed'))
				return;

			// Handle Apple style spans
			if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') {
				st = e.style;

				if (!s.convert_fonts_to_spans) {
					if (st.fontSize) {
						dom.setAttrib(e, 'mce_name', 'font');
						dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1);
					}

					if (st.fontFamily) {
						dom.setAttrib(e, 'mce_name', 'font');
						dom.setAttrib(e, 'face', st.fontFamily);
					}

					if (st.color) {
						dom.setAttrib(e, 'mce_name', 'font');
						dom.setAttrib(e, 'color', dom.toHex(st.color));
					}

					if (st.backgroundColor) {
						dom.setAttrib(e, 'mce_name', 'font');
						dom.setStyle(e, 'background-color', st.backgroundColor);
					}
				} else {
					if (st.fontSize)
						dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]);
				}

				if (st.fontWeight == 'bold')
					dom.setAttrib(e, 'mce_name', 'strong');

				if (st.fontStyle == 'italic')
					dom.setAttrib(e, 'mce_name', 'em');

				if (st.textDecoration == 'underline')
					dom.setAttrib(e, 'mce_name', 'u');

				if (st.textDecoration == 'line-through')
					dom.setAttrib(e, 'mce_name', 'strike');

				if (st.verticalAlign == 'super')
					dom.setAttrib(e, 'mce_name', 'sup');

				if (st.verticalAlign == 'sub')
					dom.setAttrib(e, 'mce_name', 'sub');

				dom.setAttrib(e, 'mce_fixed', '1');
			}
		},

		_patchSafari2x : function(ed) {
			var t = this, setContent, getNode, dom = ed.dom, lr;

			// Inline dialogs
			if (ed.windowManager.onBeforeOpen) {
				ed.windowManager.onBeforeOpen.add(function() {
					r = ed.selection.getRng();
				});
			}

			// Fake select on 2.x
			ed.selection.select = function(n) {
				this.getSel().setBaseAndExtent(n, 0, n, 1);
			};

			getNode = ed.selection.getNode;
			ed.selection.getNode = function() {
				return t.selElm || getNode.call(this);
			};

			// Fake range on Safari 2.x
			ed.selection.getRng = function() {
				var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di;

				// Fake range on Safari 2.x
				if (s.anchorNode) {
					r = d.createRange();

					try {
						// Setup before range
						rb = d.createRange();
						rb.setStart(s.anchorNode, s.anchorOffset);
						rb.collapse(1);

						// Setup after range
						ra = d.createRange();
						ra.setStart(s.focusNode, s.focusOffset);
						ra.collapse(1);

						// Setup start/end points by comparing locations
						di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;
						r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset);
						r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset);

						lr = r;
					} catch (ex) {
						// Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!!
					}
				}

				return r || lr;
			};

			// Fix setContent so it works
			setContent = ed.selection.setContent;
			ed.selection.setContent = function(h, s) {
				var r = this.getRng(), b;

				try {
					setContent.call(this, h, s);
				} catch (ex) {
					// Workaround for Safari 2.x
					b = dom.create('body');
					b.innerHTML = h;

					each(b.childNodes, function(n) {
						r.insertNode(n.cloneNode(true));
					});
				}
			};
		}
	});

	// Register plugin
	tinymce.PluginManager.add('safari', tinymce.plugins.Safari);
})();


text:
cask "tg-pro" do
  version "2.66,13197"
  sha256 "d29ff69b4b7520d738830c8f0e8b6c9e1d289c651043baa0540a123c622d7a71"

  url "https://www.tunabellysoftware.com/resources/TG%20Pro%20#{version.csv.first}.dmg"
  name "TG Pro"
  desc "Temperature monitoring, fan control and diagnostics"
  homepage "https://www.tunabellysoftware.com/tgpro/"

  livecheck do
    url "https://www.tunabellysoftware.com/resources/sparkle/tgpro.xml"
    strategy :sparkle
  end

  auto_updates true
  depends_on macos: ">= :el_capitan"

  app "TG Pro.app"

  zap trash: [
    "/Library/LaunchDaemons/com.tunabellysoftware.TGFanHelper.plist",
    "/Library/PrivilegedHelperTools/com.tunabellysoftware.TGFanHelper",
    "~/Library/Application Support/TG Pro",
    "~/Library/Caches/com.tunabellysoftware.tgpro",
    "~/Library/Cookies/com.tunabellysoftware.tgpro.binarycookies",
    "~/Library/Preferences/com.tunabellysoftware.tgpro.plist",
  ]
end


text:
extern alias PDB;

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Reflection.PortableExecutable;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.DiaSymReader;
using Microsoft.VisualStudio.Debugger.Evaluation;
using Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation;
using Roslyn.Test.Utilities;
using Xunit;
using PDB::Roslyn.Test.MetadataUtilities;
using PDB::Roslyn.Test.PdbUtilities;

namespace Microsoft.CodeAnalysis.ExpressionEvaluator.UnitTests
{
    internal sealed class Scope
    {
        internal readonly int StartOffset;
        internal readonly int EndOffset;
        internal readonly ImmutableArray<string> Locals;

        internal Scope(int startOffset, int endOffset, ImmutableArray<string> locals, bool isEndInclusive)
        {
            this.StartOffset = startOffset;
            this.EndOffset = endOffset + (isEndInclusive ? 1 : 0);
            this.Locals = locals;
        }

        internal int Length
        {
            get { return this.EndOffset - this.StartOffset + 1; }
        }

        internal bool Contains(int offset)
        {
            return (offset >= this.StartOffset) && (offset < this.EndOffset);
        }
    }

    internal static class ExpressionCompilerTestHelpers
    {
        internal static CompileResult CompileAssignment(
            this EvaluationContextBase context,
            string target,
            string expr,
            out string error,
            CompilationTestData testData = null,
            DiagnosticFormatter formatter = null)
        {
            ResultProperties resultProperties;
            ImmutableArray<AssemblyIdentity> missingAssemblyIdentities;
            var result = context.CompileAssignment(
                target,
                expr,
                ImmutableArray<Alias>.Empty,
                formatter ?? DebuggerDiagnosticFormatter.Instance,
                out resultProperties,
                out error,
                out missingAssemblyIdentities,
                EnsureEnglishUICulture.PreferredOrNull,
                testData);
            Assert.Empty(missingAssemblyIdentities);
            // This is a crude way to test the language, but it's convenient to share this test helper.
            var isCSharp = context.GetType().Namespace.IndexOf("csharp", StringComparison.OrdinalIgnoreCase) >= 0;
            var expectedFlags = error != null
                ? DkmClrCompilationResultFlags.None
                : isCSharp
                    ? DkmClrCompilationResultFlags.PotentialSideEffect
                    : DkmClrCompilationResultFlags.PotentialSideEffect | DkmClrCompilationResultFlags.ReadOnlyResult;
            Assert.Equal(expectedFlags, resultProperties.Flags);
            Assert.Equal(default(DkmEvaluationResultCategory), resultProperties.Category);
            Assert.Equal(default(DkmEvaluationResultAccessType), resultProperties.AccessType);
            Assert.Equal(default(DkmEvaluationResultStorageType), resultProperties.StorageType);
            Assert.Equal(default(DkmEvaluationResultTypeModifierFlags), resultProperties.ModifierFlags);
            return result;
        }

        internal static CompileResult CompileAssignment(
            this EvaluationContextBase context,
            string target,
            string expr,
            ImmutableArray<Alias> aliases,
            DiagnosticFormatter formatter,
            out ResultProperties resultProperties,
            out string error,
            out ImmutableArray<AssemblyIdentity> missingAssemblyIdentities,
            CultureInfo preferredUICulture,
            CompilationTestData testData)
        {
            var diagnostics = DiagnosticBag.GetInstance();
            var result = context.CompileAssignment(target, expr, aliases, diagnostics, out resultProperties, testData);
            if (diagnostics.HasAnyErrors())
            {
                bool useReferencedModulesOnly;
                error = context.GetErrorMessageAndMissingAssemblyIdentities(diagnostics, formatter, preferredUICulture, EvaluationContextBase.SystemCoreIdentity, out useReferencedModulesOnly, out missingAssemblyIdentities);
            }
            else
            {
                error = null;
                missingAssemblyIdentities = ImmutableArray<AssemblyIdentity>.Empty;
            }
            diagnostics.Free();
            return result;
        }

        internal static ReadOnlyCollection<byte> CompileGetLocals(
            this EvaluationContextBase context,
            ArrayBuilder<LocalAndMethod> locals,
            bool argumentsOnly,
            out string typeName,
            CompilationTestData testData,
            DiagnosticDescription[] expectedDiagnostics = null)
        {
            var diagnostics = DiagnosticBag.GetInstance();
            var result = context.CompileGetLocals(
                locals,
                argumentsOnly,
                ImmutableArray<Alias>.Empty,
                diagnostics,
                out typeName,
                testData);
            diagnostics.Verify(expectedDiagnostics ?? DiagnosticDescription.None);
            diagnostics.Free();
            return result;
        }

        internal static CompileResult CompileExpression(
            this EvaluationContextBase context,
            string expr,
            out string error,
            CompilationTestData testData = null,
            DiagnosticFormatter formatter = null)
        {
            ResultProperties resultProperties;
            return CompileExpression(context, expr, out resultProperties, out error, testData, formatter);
        }

        internal static CompileResult CompileExpression(
            this EvaluationContextBase context,
            string expr,
            out ResultProperties resultProperties,
            out string error,
            CompilationTestData testData = null,
            DiagnosticFormatter formatter = null)
        {
            ImmutableArray<AssemblyIdentity> missingAssemblyIdentities;
            var result = context.CompileExpression(
                expr,
                DkmEvaluationFlags.TreatAsExpression,
                ImmutableArray<Alias>.Empty,
                formatter ?? DebuggerDiagnosticFormatter.Instance,
                out resultProperties,
                out error,
                out missingAssemblyIdentities,
                EnsureEnglishUICulture.PreferredOrNull,
                testData);
            Assert.Empty(missingAssemblyIdentities);
            return result;
        }

        static internal CompileResult CompileExpression(
            this EvaluationContextBase evaluationContext,
            string expr,
            DkmEvaluationFlags compilationFlags,
            ImmutableArray<Alias> aliases,
            out string error,
            CompilationTestData testData = null,
            DiagnosticFormatter formatter = null)
        {
            ResultProperties resultProperties;
            ImmutableArray<AssemblyIdentity> missingAssemblyIdentities;
            var result = evaluationContext.CompileExpression(
                expr,
                compilationFlags,
                aliases,
                formatter ?? DebuggerDiagnosticFormatter.Instance,
                out resultProperties,
                out error,
                out missingAssemblyIdentities,
                EnsureEnglishUICulture.PreferredOrNull,
                testData);
            Assert.Empty(missingAssemblyIdentities);
            return result;
        }

        /// <summary>
        /// Compile C# expression and emit assembly with evaluation method.
        /// </summary>
        /// <returns>
        /// Result containing generated assembly, type and method names, and any format specifiers.
        /// </returns>
        static internal CompileResult CompileExpression(
            this EvaluationContextBase evaluationContext,
            string expr,
            DkmEvaluationFlags compilationFlags,
            ImmutableArray<Alias> aliases,
            DiagnosticFormatter formatter,
            out ResultProperties resultProperties,
            out string error,
            out ImmutableArray<AssemblyIdentity> missingAssemblyIdentities,
            CultureInfo preferredUICulture,
            CompilationTestData testData)
        {
            var diagnostics = DiagnosticBag.GetInstance();
            var result = evaluationContext.CompileExpression(expr, compilationFlags, aliases, diagnostics, out resultProperties, testData);
            if (diagnostics.HasAnyErrors())
            {
                bool useReferencedModulesOnly;
                error = evaluationContext.GetErrorMessageAndMissingAssemblyIdentities(diagnostics, formatter, preferredUICulture, EvaluationContextBase.SystemCoreIdentity, out useReferencedModulesOnly, out missingAssemblyIdentities);
            }
            else
            {
                error = null;
                missingAssemblyIdentities = ImmutableArray<AssemblyIdentity>.Empty;
            }
            diagnostics.Free();
            return result;
        }

        internal static CompileResult CompileExpressionWithRetry(
            ImmutableArray<MetadataBlock> metadataBlocks,
            EvaluationContextBase context,
            ExpressionCompiler.CompileDelegate<CompileResult> compile,
            DkmUtilities.GetMetadataBytesPtrFunction getMetaDataBytesPtr,
            out string errorMessage)
        {
            return ExpressionCompiler.CompileWithRetry(
                metadataBlocks,
                DebuggerDiagnosticFormatter.Instance,
                (blocks, useReferencedModulesOnly) => context,
                compile,
                getMetaDataBytesPtr,
                out errorMessage);
        }

        internal static CompileResult CompileExpressionWithRetry(
            ImmutableArray<MetadataBlock> metadataBlocks,
            string expr,
            ImmutableArray<Alias> aliases,
            ExpressionCompiler.CreateContextDelegate createContext,
            DkmUtilities.GetMetadataBytesPtrFunction getMetaDataBytesPtr,
            out string errorMessage,
            out CompilationTestData testData)
        {
            var r = ExpressionCompiler.CompileWithRetry(
                metadataBlocks,
                DebuggerDiagnosticFormatter.Instance,
                createContext,
                (context, diagnostics) =>
                {
                    var td = new CompilationTestData();
                    ResultProperties resultProperties;
                    var compileResult = context.CompileExpression(
                        expr,
                        DkmEvaluationFlags.TreatAsExpression,
                        aliases,
                        diagnostics,
                        out resultProperties,
                        td);
                    return new CompileExpressionResult(compileResult, td);
                },
                getMetaDataBytesPtr,
                out errorMessage);
            testData = r.TestData;
            return r.CompileResult;
        }

        private struct CompileExpressionResult
        {
            internal readonly CompileResult CompileResult;
            internal readonly CompilationTestData TestData;

            internal CompileExpressionResult(CompileResult compileResult, CompilationTestData testData)
            {
                this.CompileResult = compileResult;
                this.TestData = testData;
            }
        }

        internal static TypeDefinition GetTypeDef(this MetadataReader reader, string typeName)
        {
            return reader.TypeDefinitions.Select(reader.GetTypeDefinition).First(t => reader.StringComparer.Equals(t.Name, typeName));
        }

        internal static MethodDefinition GetMethodDef(this MetadataReader reader, TypeDefinition typeDef, string methodName)
        {
            return typeDef.GetMethods().Select(reader.GetMethodDefinition).First(m => reader.StringComparer.Equals(m.Name, methodName));
        }

        internal static MethodDefinitionHandle GetMethodDefHandle(this MetadataReader reader, TypeDefinition typeDef, string methodName)
        {
            return typeDef.GetMethods().First(h => reader.StringComparer.Equals(reader.GetMethodDefinition(h).Name, methodName));
        }

        internal static void CheckTypeParameters(this MetadataReader reader, GenericParameterHandleCollection genericParameters, params string[] expectedNames)
        {
            var actualNames = genericParameters.Select(reader.GetGenericParameter).Select(tp => reader.GetString(tp.Name)).ToArray();
            Assert.True(expectedNames.SequenceEqual(actualNames));
        }

        internal static AssemblyName GetAssemblyName(this byte[] exeBytes)
        {
            using (var reader = new PEReader(ImmutableArray.CreateRange(exeBytes)))
            {
                var metadataReader = reader.GetMetadataReader();
                var def = metadataReader.GetAssemblyDefinition();
                var name = metadataReader.GetString(def.Name);
                return new AssemblyName() { Name = name, Version = def.Version };
            }
        }

        internal static Guid GetModuleVersionId(this byte[] exeBytes)
        {
            using (var reader = new PEReader(ImmutableArray.CreateRange(exeBytes)))
            {
                return reader.GetMetadataReader().GetModuleVersionId();
            }
        }

        internal static ImmutableArray<string> GetLocalNames(this ISymUnmanagedReader symReader, int methodToken, int methodVersion = 1)
        {
            var method = symReader.GetMethodByVersion(methodToken, methodVersion);
            if (method == null)
            {
                return ImmutableArray<string>.Empty;
            }
            var scopes = ArrayBuilder<ISymUnmanagedScope>.GetInstance();
            method.GetAllScopes(scopes);
            var names = ArrayBuilder<string>.GetInstance();
            foreach (var scope in scopes)
            {
                var locals = scope.GetLocals();
                foreach (var local in locals)
                {
                    var name = local.GetName();
                    int slot;
                    local.GetAddressField1(out slot);
                    while (names.Count <= slot)
                    {
                        names.Add(null);
                    }
                    names[slot] = name;
                }
            }
            scopes.Free();
            return names.ToImmutableAndFree();
        }

        internal static void VerifyIL(
            this ImmutableArray<byte> assembly,
            string qualifiedName,
            string expectedIL,
            [CallerLineNumber]int expectedValueSourceLine = 0,
            [CallerFilePath]string expectedValueSourcePath = null)
        {
            var parts = qualifiedName.Split('.');
            if (parts.Length != 2)
            {
                throw new NotImplementedException();
            }

            using (var metadata = ModuleMetadata.CreateFromImage(assembly))
            {
                var module = metadata.Module;
                var reader = module.MetadataReader;
                var typeDef = reader.GetTypeDef(parts[0]);
                var methodName = parts[1];
                var methodHandle = reader.GetMethodDefHandle(typeDef, methodName);
                var methodBody = module.GetMethodBodyOrThrow(methodHandle);

                var pooled = PooledStringBuilder.GetInstance();
                var builder = pooled.Builder;
                var writer = new StringWriter(pooled.Builder);
                var visualizer = new MetadataVisualizer(reader, writer);
                visualizer.VisualizeMethodBody(methodBody, methodHandle, emitHeader: false);
                var actualIL = pooled.ToStringAndFree();

                AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes: true, expectedValueSourcePath: expectedValueSourcePath, expectedValueSourceLine: expectedValueSourceLine);
            }
        }

        internal static ImmutableArray<MetadataReference> GetEmittedReferences(Compilation compilation, MetadataReader mdReader)
        {
            // Determine the set of references that were actually used
            // and ignore any references that were dropped in emit.
            var referenceNames = new HashSet<string>(mdReader.AssemblyReferences.Select(h => GetAssemblyReferenceName(mdReader, h)));
            return ImmutableArray.CreateRange(compilation.References.Where(r => IsReferenced(r, referenceNames)));
        }

        internal static ImmutableArray<Scope> GetScopes(this ISymUnmanagedReader symReader, int methodToken, int methodVersion, bool isEndInclusive)
        {
            var method = symReader.GetMethodByVersion(methodToken, methodVersion);
            if (method == null)
            {
                return ImmutableArray<Scope>.Empty;
            }
            var scopes = ArrayBuilder<ISymUnmanagedScope>.GetInstance();
            method.GetAllScopes(scopes);
            var result = scopes.SelectAsArray(s => new Scope(s.GetStartOffset(), s.GetEndOffset(), s.GetLocals().SelectAsArray(l => l.GetName()), isEndInclusive));
            scopes.Free();
            return result;
        }

        internal static Scope GetInnermostScope(this ImmutableArray<Scope> scopes, int offset)
        {
            Scope result = null;
            foreach (var scope in scopes)
            {
                if (scope.Contains(offset))
                {
                    if ((result == null) || (result.Length > scope.Length))
                    {
                        result = scope;
                    }
                }
            }
            return result;
        }

        private static string GetAssemblyReferenceName(MetadataReader reader, AssemblyReferenceHandle handle)
        {
            var reference = reader.GetAssemblyReference(handle);
            return reader.GetString(reference.Name);
        }

        private static bool IsReferenced(MetadataReference reference, HashSet<string> referenceNames)
        {
            var assemblyMetadata = ((PortableExecutableReference)reference).GetMetadata() as AssemblyMetadata;
            if (assemblyMetadata == null)
            {
                // Netmodule. Assume it is referenced.
                return true;
            }
            var name = assemblyMetadata.GetAssembly().Identity.Name;
            return referenceNames.Contains(name);
        }

        internal static ModuleInstance ToModuleInstance(this MetadataReference reference)
        {
            return ModuleInstance.Create((PortableExecutableReference)reference);
        }

        internal static ModuleInstance ToModuleInstance(
            this Compilation compilation,
            DebugInformationFormat debugFormat = DebugInformationFormat.Pdb,
            bool includeLocalSignatures = true)
        {
            var pdbStream = (debugFormat != 0) ? new MemoryStream() : null;
            var peImage = compilation.EmitToArray(new EmitOptions(debugInformationFormat: debugFormat), pdbStream: pdbStream);
            var symReader = (debugFormat != 0) ? SymReaderFactory.CreateReader(pdbStream, new PEReader(peImage)) : null;

            return ModuleInstance.Create(peImage, symReader, includeLocalSignatures);
        }

        internal static ModuleInstance GetModuleInstanceForIL(string ilSource)
        {
            ImmutableArray<byte> peBytes;
            ImmutableArray<byte> pdbBytes;
            CommonTestBase.EmitILToArray(ilSource, appendDefaultHeader: true, includePdb: true, assemblyBytes: out peBytes, pdbBytes: out pdbBytes);
            return ModuleInstance.Create(peBytes, SymReaderFactory.CreateReader(pdbBytes), includeLocalSignatures: true);
        }

        internal static AssemblyIdentity GetAssemblyIdentity(this MetadataReference reference)
        {
            using (var moduleMetadata = GetManifestModuleMetadata(reference))
            {
                return moduleMetadata.MetadataReader.ReadAssemblyIdentityOrThrow();
            }
        }

        internal static Guid GetModuleVersionId(this MetadataReference reference)
        {
            using (var moduleMetadata = GetManifestModuleMetadata(reference))
            {
                return moduleMetadata.MetadataReader.GetModuleVersionIdOrThrow();
            }
        }

        private static ModuleMetadata GetManifestModuleMetadata(MetadataReference reference)
        {
            // make a copy to avoid disposing shared reference metadata:
            var metadata = ((MetadataImageReference)reference).GetMetadata().Copy();
            return (metadata as AssemblyMetadata)?.GetModules()[0] ?? (ModuleMetadata)metadata;
        }

        internal static void VerifyLocal<TMethodSymbol>(
            this CompilationTestData testData,
            string typeName,
            LocalAndMethod localAndMethod,
            string expectedMethodName,
            string expectedLocalName,
            string expectedLocalDisplayName,
            DkmClrCompilationResultFlags expectedFlags,
            Action<TMethodSymbol> verifyTypeParameters,
            string expectedILOpt,
            bool expectedGeneric,
            string expectedValueSourcePath,
            int expectedValueSourceLine)
            where TMethodSymbol : IMethodSymbol
        {
            Assert.Equal(expectedLocalName, localAndMethod.LocalName);
            Assert.Equal(expectedLocalDisplayName, localAndMethod.LocalDisplayName);
            Assert.True(expectedMethodName.StartsWith(localAndMethod.MethodName, StringComparison.Ordinal), expectedMethodName + " does not start with " + localAndMethod.MethodName); // Expected name may include type arguments and parameters.
            Assert.Equal(expectedFlags, localAndMethod.Flags);
            var methodData = testData.GetMethodData(typeName + "." + expectedMethodName);
            verifyTypeParameters((TMethodSymbol)methodData.Method);
            if (expectedILOpt != null)
            {
                string actualIL = methodData.GetMethodIL();
                AssertEx.AssertEqualToleratingWhitespaceDifferences(
                    expectedILOpt,
                    actualIL,
                    escapeQuotes: true,
                    expectedValueSourcePath: expectedValueSourcePath,
                    expectedValueSourceLine: expectedValueSourceLine);
            }

            Assert.Equal(((Cci.IMethodDefinition)methodData.Method).CallingConvention, expectedGeneric ? Cci.CallingConvention.Generic : Cci.CallingConvention.Default);
        }

        internal static ISymUnmanagedReader ConstructSymReaderWithImports(ImmutableArray<byte> peImage, string methodName, params string[] importStrings)
        {
            using (var peReader = new PEReader(peImage))
            {
                var metadataReader = peReader.GetMetadataReader();
                var methodHandle = metadataReader.MethodDefinitions.Single(h => metadataReader.StringComparer.Equals(metadataReader.GetMethodDefinition(h).Name, methodName));
                var methodToken = metadataReader.GetToken(methodHandle);

                return new MockSymUnmanagedReader(new Dictionary<int, MethodDebugInfoBytes>
                {
                    { methodToken, new MethodDebugInfoBytes.Builder(new [] { importStrings }).Build() },
                }.ToImmutableDictionary());
            }
        }

        internal const uint NoILOffset = 0xffffffff;

        internal static readonly MetadataReference IntrinsicAssemblyReference = GetIntrinsicAssemblyReference();

        internal static ImmutableArray<MetadataReference> AddIntrinsicAssembly(this ImmutableArray<MetadataReference> references)
        {
            var builder = ArrayBuilder<MetadataReference>.GetInstance();
            builder.AddRange(references);
            builder.Add(IntrinsicAssemblyReference);
            return builder.ToImmutableAndFree();
        }

        private static MetadataReference GetIntrinsicAssemblyReference()
        {
            var source =
@".assembly extern mscorlib { }
.class public Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods
{
  .method public static object GetObjectAtAddress(uint64 address)
  {
    ldnull
    throw
  }
  .method public static class [mscorlib]System.Exception GetException()
  {
    ldnull
    throw
  }
  .method public static class [mscorlib]System.Exception GetStowedException()
  {
    ldnull
    throw
  }
  .method public static object GetReturnValue(int32 index)
  {
    ldnull
    throw
  }
  .method public static void CreateVariable(class [mscorlib]System.Type 'type', string name, valuetype [mscorlib]System.Guid customTypeInfoPayloadTypeId, uint8[] customTypeInfoPayload)
  {
    ldnull
    throw
  }
  .method public static object GetObjectByAlias(string name)
  {
    ldnull
    throw
  }
  .method public static !!T& GetVariableAddress<T>(string name)
  {
    ldnull
    throw
  }
}";
            return CommonTestBase.CompileIL(source);
        }

        /// <summary>
        /// Return MetadataReferences to the .winmd assemblies
        /// for the given namespaces.
        /// </summary>
        internal static ImmutableArray<MetadataReference> GetRuntimeWinMds(params string[] namespaces)
        {
            var paths = new HashSet<string>();
            foreach (var @namespace in namespaces)
            {
                foreach (var path in WindowsRuntimeMetadata.ResolveNamespace(@namespace, null))
                {
                    paths.Add(path);
                }
            }
            return ImmutableArray.CreateRange(paths.Select(GetAssembly));
        }

        private const string Version1_3CLRString = "WindowsRuntime 1.3;CLR v4.0.30319";
        private const string Version1_3String = "WindowsRuntime 1.3";
        private const string Version1_4String = "WindowsRuntime 1.4";
        private static readonly int s_versionStringLength = Version1_3CLRString.Length;

        private static readonly byte[] s_version1_3CLRBytes = ToByteArray(Version1_3CLRString, s_versionStringLength);
        private static readonly byte[] s_version1_3Bytes = ToByteArray(Version1_3String, s_versionStringLength);
        private static readonly byte[] s_version1_4Bytes = ToByteArray(Version1_4String, s_versionStringLength);

        private static byte[] ToByteArray(string str, int length)
        {
            var bytes = new byte[length];
            for (int i = 0; i < str.Length; i++)
            {
                bytes[i] = (byte)str[i];
            }
            return bytes;
        }

        internal static byte[] ToVersion1_3(byte[] bytes)
        {
            return ToVersion(bytes, s_version1_3CLRBytes, s_version1_3Bytes);
        }

        internal static byte[] ToVersion1_4(byte[] bytes)
        {
            return ToVersion(bytes, s_version1_3CLRBytes, s_version1_4Bytes);
        }

        private static byte[] ToVersion(byte[] bytes, byte[] from, byte[] to)
        {
            int n = bytes.Length;
            var copy = new byte[n];
            Array.Copy(bytes, copy, n);
            int index = IndexOf(copy, from);
            Array.Copy(to, 0, copy, index, to.Length);
            return copy;
        }

        private static int IndexOf(byte[] a, byte[] b)
        {
            int m = b.Length;
            int n = a.Length - m;
            for (int x = 0; x < n; x++)
            {
                var matches = true;
                for (int y = 0; y < m; y++)
                {
                    if (a[x + y] != b[y])
                    {
                        matches = false;
                        break;
                    }
                }
                if (matches)
                {
                    return x;
                }
            }
            return -1;
        }

        private static MetadataReference GetAssembly(string path)
        {
            var bytes = File.ReadAllBytes(path);
            var metadata = ModuleMetadata.CreateFromImage(bytes);
            return metadata.GetReference(filePath: path);
        }

        internal static uint GetOffset(int methodToken, ISymUnmanagedReader symReader, int atLineNumber = -1)
        {
            int ilOffset;
            if (symReader == null)
            {
                ilOffset = 0;
            }
            else
            {
                var symMethod = symReader.GetMethod(methodToken);
                if (symMethod == null)
                {
                    ilOffset = 0;
                }
                else
                {
                    var sequencePoints = symMethod.GetSequencePoints();
                    ilOffset = atLineNumber < 0
                        ? sequencePoints.Where(sp => sp.StartLine != SequencePointList.HiddenSequencePointLine).Select(sp => sp.Offset).FirstOrDefault()
                        : sequencePoints.First(sp => sp.StartLine == atLineNumber).Offset;
                }
            }
            Assert.InRange(ilOffset, 0, int.MaxValue);
            return (uint)ilOffset;
        }

        internal static string GetMethodOrTypeSignatureParts(string signature, out string[] parameterTypeNames)
        {
            var parameterListStart = signature.IndexOf('(');
            if (parameterListStart < 0)
            {
                parameterTypeNames = null;
                return signature;
            }

            var parameters = signature.Substring(parameterListStart + 1, signature.Length - parameterListStart - 2);
            var methodName = signature.Substring(0, parameterListStart);
            parameterTypeNames = (parameters.Length == 0) ?
                new string[0] :
                parameters.Split(',');
            return methodName;
        }
    }
}


text:
<Address>
  <AddressLine1>123 KOSOVO ST</AddressLine1>
  <City>PRIZRENI</City>
  <StateProvinceCode></StateProvinceCode>
  <PostalCode></PostalCode>
  <CountryCode>XK</CountryCode>
</Address>


text:
package com.xu.easyweb.util.extjs;

/**
 * 记录查询数据总数
 * @author zht
 * Date: 12-8-28
 * Time: 上午8:33
 * To change this template use File | Settings | File Templates.
 */
public class Total {
    private boolean success = true;
    private long results;

    public long getResults() {
        return results;
    }

    public void setResults(long results) {
        this.results = results;
    }
}


text:
package com.koitoer.jax.ws.soap.service.random;

import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.soap.SOAPFaultException;

import com.koitoer.jax.ws.soap.service.random.client.RandomService;
import com.koitoer.jax.ws.soap.service.random.client.RandomServicePortType;

public class RandServiceClient {

	public static void main(String args[]) throws Exception{

		// Using code generated by wsimport
		RandomService randomService = new RandomService();
		RandomServicePortType port = randomService.getRandomServicePort();

		Binding binding = ((BindingProvider) port).getBinding();

		System.out.println(binding.getHandlerChain());

		((BindingProvider) port).getRequestContext().put(
		        BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8889/rs");

		System.out.println(((BindingProvider) port).getRequestContext().get(
		        BindingProvider.SOAPACTION_URI_PROPERTY));
		System.out.println(((BindingProvider) port).getRequestContext().get(
		        BindingProvider.SOAPACTION_USE_PROPERTY));
		System.out.println(((BindingProvider) port).getRequestContext().get(
		        BindingProvider.SESSION_MAINTAIN_PROPERTY));
		System.out.println(((BindingProvider) port).getRequestContext().get(
		        BindingProvider.PASSWORD_PROPERTY));
		System.out.println(((BindingProvider) port).getRequestContext().get(
		        BindingProvider.USERNAME_PROPERTY));

		System.out.println(((BindingProvider) port).getRequestContext());
		System.out.println(((BindingProvider) port).getResponseContext());

		System.out.println(((BindingProvider) port).getEndpointReference());

		try {
			System.out.println(port.next1());
		} catch (SOAPFaultException e) {
			System.out.println("SOAP FAULT > " + e.getFault().getFaultString());
			System.out.println(e.getMessage());
		}

	}
}


text:
<?php

namespace Proxies\__CG__\Application\UserBundle\Entity;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
 */
class User extends \Application\UserBundle\Entity\User implements \Doctrine\ORM\Proxy\Proxy
{
    private $_entityPersister;
    private $_identifier;
    public $__isInitialized__ = false;
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
    }
    /** @private */
    public function __load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;

            if (method_exists($this, "__wakeup")) {
                // call this after __isInitialized__to avoid infinite recursion
                // but before loading to emulate what ClassMetadata::newInstance()
                // provides.
                $this->__wakeup();
            }

            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                throw new \Doctrine\ORM\EntityNotFoundException();
            }
            unset($this->_entityPersister, $this->_identifier);
        }
    }

    /** @private */
    public function __isInitialized()
    {
        return $this->__isInitialized__;
    }

    public function getId()
    {
        if ($this->__isInitialized__ === false) {
            return (int) $this->_identifier["id"];
        }
        $this->__load();
        return parent::getId();
    }

    public function prePersist()
    {
        $this->__load();
        return parent::prePersist();
    }

    public function preUpdate()
    {
        $this->__load();
        return parent::preUpdate();
    }

    public function setCreatedAt(\DateTime $createdAt = NULL)
    {
        $this->__load();
        return parent::setCreatedAt($createdAt);
    }

    public function getCreatedAt()
    {
        $this->__load();
        return parent::getCreatedAt();
    }

    public function setUpdatedAt(\DateTime $updatedAt = NULL)
    {
        $this->__load();
        return parent::setUpdatedAt($updatedAt);
    }

    public function getUpdatedAt()
    {
        $this->__load();
        return parent::getUpdatedAt();
    }

    public function getExpiresAt()
    {
        $this->__load();
        return parent::getExpiresAt();
    }

    public function getCredentialsExpireAt()
    {
        $this->__load();
        return parent::getCredentialsExpireAt();
    }

    public function setCredentialsExpireAt(\DateTime $date = NULL)
    {
        $this->__load();
        return parent::setCredentialsExpireAt($date);
    }

    public function __toString()
    {
        $this->__load();
        return parent::__toString();
    }

    public function setGroups($groups)
    {
        $this->__load();
        return parent::setGroups($groups);
    }

    public function setTwoStepVerificationCode($twoStepVerificationCode)
    {
        $this->__load();
        return parent::setTwoStepVerificationCode($twoStepVerificationCode);
    }

    public function getTwoStepVerificationCode()
    {
        $this->__load();
        return parent::getTwoStepVerificationCode();
    }

    public function setBiography($biography)
    {
        $this->__load();
        return parent::setBiography($biography);
    }

    public function getBiography()
    {
        $this->__load();
        return parent::getBiography();
    }

    public function setDateOfBirth($dateOfBirth)
    {
        $this->__load();
        return parent::setDateOfBirth($dateOfBirth);
    }

    public function getDateOfBirth()
    {
        $this->__load();
        return parent::getDateOfBirth();
    }

    public function setFacebookData($facebookData)
    {
        $this->__load();
        return parent::setFacebookData($facebookData);
    }

    public function getFacebookData()
    {
        $this->__load();
        return parent::getFacebookData();
    }

    public function setFacebookName($facebookName)
    {
        $this->__load();
        return parent::setFacebookName($facebookName);
    }

    public function getFacebookName()
    {
        $this->__load();
        return parent::getFacebookName();
    }

    public function setFacebookUid($facebookUid)
    {
        $this->__load();
        return parent::setFacebookUid($facebookUid);
    }

    public function getFacebookUid()
    {
        $this->__load();
        return parent::getFacebookUid();
    }

    public function setFirstname($firstname)
    {
        $this->__load();
        return parent::setFirstname($firstname);
    }

    public function getFirstname()
    {
        $this->__load();
        return parent::getFirstname();
    }

    public function setGender($gender)
    {
        $this->__load();
        return parent::setGender($gender);
    }

    public function getGender()
    {
        $this->__load();
        return parent::getGender();
    }

    public function setGplusData($gplusData)
    {
        $this->__load();
        return parent::setGplusData($gplusData);
    }

    public function getGplusData()
    {
        $this->__load();
        return parent::getGplusData();
    }

    public function setGplusName($gplusName)
    {
        $this->__load();
        return parent::setGplusName($gplusName);
    }

    public function getGplusName()
    {
        $this->__load();
        return parent::getGplusName();
    }

    public function setGplusUid($gplusUid)
    {
        $this->__load();
        return parent::setGplusUid($gplusUid);
    }

    public function getGplusUid()
    {
        $this->__load();
        return parent::getGplusUid();
    }

    public function setLastname($lastname)
    {
        $this->__load();
        return parent::setLastname($lastname);
    }

    public function getLastname()
    {
        $this->__load();
        return parent::getLastname();
    }

    public function setLocale($locale)
    {
        $this->__load();
        return parent::setLocale($locale);
    }

    public function getLocale()
    {
        $this->__load();
        return parent::getLocale();
    }

    public function setPhone($phone)
    {
        $this->__load();
        return parent::setPhone($phone);
    }

    public function getPhone()
    {
        $this->__load();
        return parent::getPhone();
    }

    public function setTimezone($timezone)
    {
        $this->__load();
        return parent::setTimezone($timezone);
    }

    public function getTimezone()
    {
        $this->__load();
        return parent::getTimezone();
    }

    public function setTwitterData($twitterData)
    {
        $this->__load();
        return parent::setTwitterData($twitterData);
    }

    public function getTwitterData()
    {
        $this->__load();
        return parent::getTwitterData();
    }

    public function setTwitterName($twitterName)
    {
        $this->__load();
        return parent::setTwitterName($twitterName);
    }

    public function getTwitterName()
    {
        $this->__load();
        return parent::getTwitterName();
    }

    public function setTwitterUid($twitterUid)
    {
        $this->__load();
        return parent::setTwitterUid($twitterUid);
    }

    public function getTwitterUid()
    {
        $this->__load();
        return parent::getTwitterUid();
    }

    public function setWebsite($website)
    {
        $this->__load();
        return parent::setWebsite($website);
    }

    public function getWebsite()
    {
        $this->__load();
        return parent::getWebsite();
    }

    public function setToken($token)
    {
        $this->__load();
        return parent::setToken($token);
    }

    public function getToken()
    {
        $this->__load();
        return parent::getToken();
    }

    public function getFullname()
    {
        $this->__load();
        return parent::getFullname();
    }

    public function getRealRoles()
    {
        $this->__load();
        return parent::getRealRoles();
    }

    public function setRealRoles(array $roles)
    {
        $this->__load();
        return parent::setRealRoles($roles);
    }

    public function addRole($role)
    {
        $this->__load();
        return parent::addRole($role);
    }

    public function serialize()
    {
        $this->__load();
        return parent::serialize();
    }

    public function unserialize($serialized)
    {
        $this->__load();
        return parent::unserialize($serialized);
    }

    public function eraseCredentials()
    {
        $this->__load();
        return parent::eraseCredentials();
    }

    public function getUsername()
    {
        $this->__load();
        return parent::getUsername();
    }

    public function getUsernameCanonical()
    {
        $this->__load();
        return parent::getUsernameCanonical();
    }

    public function getSalt()
    {
        $this->__load();
        return parent::getSalt();
    }

    public function getEmail()
    {
        $this->__load();
        return parent::getEmail();
    }

    public function getEmailCanonical()
    {
        $this->__load();
        return parent::getEmailCanonical();
    }

    public function getPassword()
    {
        $this->__load();
        return parent::getPassword();
    }

    public function getPlainPassword()
    {
        $this->__load();
        return parent::getPlainPassword();
    }

    public function getLastLogin()
    {
        $this->__load();
        return parent::getLastLogin();
    }

    public function getConfirmationToken()
    {
        $this->__load();
        return parent::getConfirmationToken();
    }

    public function getRoles()
    {
        $this->__load();
        return parent::getRoles();
    }

    public function hasRole($role)
    {
        $this->__load();
        return parent::hasRole($role);
    }

    public function isAccountNonExpired()
    {
        $this->__load();
        return parent::isAccountNonExpired();
    }

    public function isAccountNonLocked()
    {
        $this->__load();
        return parent::isAccountNonLocked();
    }

    public function isCredentialsNonExpired()
    {
        $this->__load();
        return parent::isCredentialsNonExpired();
    }

    public function isCredentialsExpired()
    {
        $this->__load();
        return parent::isCredentialsExpired();
    }

    public function isEnabled()
    {
        $this->__load();
        return parent::isEnabled();
    }

    public function isExpired()
    {
        $this->__load();
        return parent::isExpired();
    }

    public function isLocked()
    {
        $this->__load();
        return parent::isLocked();
    }

    public function isSuperAdmin()
    {
        $this->__load();
        return parent::isSuperAdmin();
    }

    public function isUser(\FOS\UserBundle\Model\UserInterface $user = NULL)
    {
        $this->__load();
        return parent::isUser($user);
    }

    public function removeRole($role)
    {
        $this->__load();
        return parent::removeRole($role);
    }

    public function setUsername($username)
    {
        $this->__load();
        return parent::setUsername($username);
    }

    public function setUsernameCanonical($usernameCanonical)
    {
        $this->__load();
        return parent::setUsernameCanonical($usernameCanonical);
    }

    public function setCredentialsExpired($boolean)
    {
        $this->__load();
        return parent::setCredentialsExpired($boolean);
    }

    public function setEmail($email)
    {
        $this->__load();
        return parent::setEmail($email);
    }

    public function setEmailCanonical($emailCanonical)
    {
        $this->__load();
        return parent::setEmailCanonical($emailCanonical);
    }

    public function setEnabled($boolean)
    {
        $this->__load();
        return parent::setEnabled($boolean);
    }

    public function setExpired($boolean)
    {
        $this->__load();
        return parent::setExpired($boolean);
    }

    public function setExpiresAt(\DateTime $date)
    {
        $this->__load();
        return parent::setExpiresAt($date);
    }

    public function setPassword($password)
    {
        $this->__load();
        return parent::setPassword($password);
    }

    public function setSuperAdmin($boolean)
    {
        $this->__load();
        return parent::setSuperAdmin($boolean);
    }

    public function setPlainPassword($password)
    {
        $this->__load();
        return parent::setPlainPassword($password);
    }

    public function setLastLogin(\DateTime $time)
    {
        $this->__load();
        return parent::setLastLogin($time);
    }

    public function setLocked($boolean)
    {
        $this->__load();
        return parent::setLocked($boolean);
    }

    public function setConfirmationToken($confirmationToken)
    {
        $this->__load();
        return parent::setConfirmationToken($confirmationToken);
    }

    public function setPasswordRequestedAt(\DateTime $date = NULL)
    {
        $this->__load();
        return parent::setPasswordRequestedAt($date);
    }

    public function getPasswordRequestedAt()
    {
        $this->__load();
        return parent::getPasswordRequestedAt();
    }

    public function isPasswordRequestNonExpired($ttl)
    {
        $this->__load();
        return parent::isPasswordRequestNonExpired($ttl);
    }

    public function setRoles(array $roles)
    {
        $this->__load();
        return parent::setRoles($roles);
    }

    public function getGroups()
    {
        $this->__load();
        return parent::getGroups();
    }

    public function getGroupNames()
    {
        $this->__load();
        return parent::getGroupNames();
    }

    public function hasGroup($name)
    {
        $this->__load();
        return parent::hasGroup($name);
    }

    public function addGroup(\FOS\UserBundle\Model\GroupInterface $group)
    {
        $this->__load();
        return parent::addGroup($group);
    }

    public function removeGroup(\FOS\UserBundle\Model\GroupInterface $group)
    {
        $this->__load();
        return parent::removeGroup($group);
    }

    public function __sleep()
    {
        return array('__isInitialized__', 'username', 'usernameCanonical', 'email', 'emailCanonical', 'enabled', 'salt', 'password', 'lastLogin', 'locked', 'expired', 'expiresAt', 'confirmationToken', 'passwordRequestedAt', 'roles', 'credentialsExpired', 'credentialsExpireAt', 'createdAt', 'updatedAt', 'dateOfBirth', 'firstname', 'lastname', 'website', 'biography', 'gender', 'locale', 'timezone', 'phone', 'facebookUid', 'facebookName', 'facebookData', 'twitterUid', 'twitterName', 'twitterData', 'gplusUid', 'gplusName', 'gplusData', 'token', 'twoStepVerificationCode', 'id', 'groups');
    }

    public function __clone()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            $class = $this->_entityPersister->getClassMetadata();
            $original = $this->_entityPersister->load($this->_identifier);
            if ($original === null) {
                throw new \Doctrine\ORM\EntityNotFoundException();
            }
            foreach ($class->reflFields as $field => $reflProperty) {
                $reflProperty->setValue($this, $reflProperty->getValue($original));
            }
            unset($this->_entityPersister, $this->_identifier);
        }

    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using NMF.Collections.ObjectModel;
using NMF.Models.Meta;

namespace NMF.Models.Dynamic
{
    internal class DynamicOppositeList : ObservableOppositeList<IModelElement, IModelElement>
    {
        public IReference Reference { get; }

        public DynamicOppositeList(IModelElement parent, IReference reference) : base(parent)
        {
            Reference = reference;
        }

        protected override void SetOpposite(IModelElement item, IModelElement newParent)
        {
            if (Reference.Opposite.UpperBound == 1)
            {
                item.SetReferencedElement(Reference.Opposite, newParent);
                if (Reference.IsContainment)
                {
                    if (newParent == null)
                    {
                        item.ParentChanged -= OnItemParentChanged;
                    }
                    else
                    {
                        item.ParentChanged += OnItemParentChanged;
                    }
                }
                else
                {
                    if (newParent == null)
                    {
                        item.Deleted -= OnItemDeleted;
                    }
                    else
                    {
                        item.Deleted += OnItemDeleted;
                    }
                }
            }
            else
            {
                var collection = item.GetReferencedElements(Reference.Opposite);
                if (newParent == null)
                {
                    collection.Remove(Parent);
                    if (Reference.IsContainment)
                    {
                        item.ParentChanged -= OnItemParentChanged;
                    }
                    else
                    {
                        item.Deleted -= OnItemDeleted;
                    }
                }
                else
                {
                    collection.Add(Parent);
                    if (Reference.IsContainment)
                    {
                        item.ParentChanged += OnItemParentChanged;
                    }
                    else
                    {
                        item.Deleted += OnItemDeleted;
                    }
                }
            }
        }

        private void OnItemDeleted(object sender, UriChangedEventArgs e)
        {
            Remove((IModelElement)sender);
        }

        private void OnItemParentChanged(object sender, NMF.Expressions.ValueChangedEventArgs e)
        {
            if (e.NewValue != Parent)
            {
                Remove((IModelElement)sender);
            }
        }

        protected override void InsertItem(int index, IModelElement item)
        {
            if (!((IClass)Reference.ReferenceType).IsAssignableFrom(item.GetClass()))
            {
                throw new InvalidOperationException($"Item is of type {item.GetClass().Name} instead of expected type {Reference.ReferenceType.Name}");
            }
            base.InsertItem(index, item);
        }

        protected override void SetItem(int index, IModelElement item)
        {
            if (!((IClass)Reference.ReferenceType).IsAssignableFrom(item.GetClass()))
            {
                throw new InvalidOperationException($"Item is of type {item.GetClass().Name} instead of expected type {Reference.ReferenceType.Name}");
            }
            base.SetItem(index, item);
        }
    }

    internal class DynamicOppositeSet : ObservableOppositeSet<IModelElement, IModelElement>
    {
        public IReference Reference { get; }

        public DynamicOppositeSet(IModelElement parent, IReference reference) : base(parent)
        {
            Reference = reference;
        }

        protected override void SetOpposite(IModelElement item, IModelElement newParent)
        {
            if (Reference.Opposite.UpperBound == 1)
            {
                item.SetReferencedElement(Reference.Opposite, newParent);
                if (Reference.IsContainment)
                {
                    if (newParent == null)
                    {
                        item.ParentChanged -= OnItemParentChanged;
                    }
                    else
                    {
                        item.ParentChanged += OnItemParentChanged;
                    }
                }
                else
                {
                    if (newParent == null)
                    {
                        item.Deleted -= OnItemDeleted;
                    }
                    else
                    {
                        item.Deleted += OnItemDeleted;
                    }
                }
            }
            else
            {
                var collection = item.GetReferencedElements(Reference.Opposite);
                if (newParent == null)
                {
                    collection.Remove(Parent);
                    if (Reference.IsContainment)
                    {
                        item.ParentChanged -= OnItemParentChanged;
                    }
                    else
                    {
                        item.Deleted -= OnItemDeleted;
                    }
                }
                else
                {
                    collection.Add(Parent);
                    if (Reference.IsContainment)
                    {
                        item.ParentChanged += OnItemParentChanged;
                    }
                    else
                    {
                        item.Deleted += OnItemDeleted;
                    }
                }
            }
        }

        private void OnItemDeleted(object sender, UriChangedEventArgs e)
        {
            Remove((IModelElement)sender);
        }

        private void OnItemParentChanged(object sender, NMF.Expressions.ValueChangedEventArgs e)
        {
            if (e.NewValue != Parent)
            {
                Remove((IModelElement)sender);
            }
        }

        public override bool Add(IModelElement item)
        {
            if (!((IClass)Reference.ReferenceType).IsAssignableFrom(item.GetClass()))
            {
                throw new InvalidOperationException($"Item is of type {item.GetClass().Name} instead of expected type {Reference.ReferenceType.Name}");
            }
            return base.Add(item);
        }
    }

    internal class DynamicOppositeOrderedSet : ObservableOppositeOrderedSet<IModelElement, IModelElement>
    {

        public IReference Reference { get; }

        public DynamicOppositeOrderedSet(IModelElement parent, IReference reference) : base(parent)
        {
            Reference = reference;
        }

        protected override void SetOpposite(IModelElement item, IModelElement newParent)
        {
            if (Reference.Opposite.UpperBound == 1)
            {
                item.SetReferencedElement(Reference.Opposite, newParent);
                if (Reference.IsContainment)
                {
                    if (newParent == null)
                    {
                        item.ParentChanged -= OnItemParentChanged;
                    }
                    else
                    {
                        item.ParentChanged += OnItemParentChanged;
                    }
                }
                else
                {
                    if (newParent == null)
                    {
                        item.Deleted -= OnItemDeleted;
                    }
                    else
                    {
                        item.Deleted += OnItemDeleted;
                    }
                }
            }
            else
            {
                var collection = item.GetReferencedElements(Reference.Opposite);
                if (newParent == null)
                {
                    collection.Remove(Parent);
                    if (Reference.IsContainment)
                    {
                        item.ParentChanged -= OnItemParentChanged;
                    }
                    else
                    {
                        item.Deleted -= OnItemDeleted;
                    }
                }
                else
                {
                    collection.Add(Parent);
                    if (Reference.IsContainment)
                    {
                        item.ParentChanged += OnItemParentChanged;
                    }
                    else
                    {
                        item.Deleted += OnItemDeleted;
                    }
                }
            }
        }

        private void OnItemDeleted(object sender, UriChangedEventArgs e)
        {
            Remove((IModelElement)sender);
        }

        private void OnItemParentChanged(object sender, NMF.Expressions.ValueChangedEventArgs e)
        {
            if (e.NewValue != Parent)
            {
                Remove((IModelElement)sender);
            }
        }

        public override void Insert(int index, IModelElement item)
        {
            if (!((IClass)Reference.ReferenceType).IsAssignableFrom(item.GetClass()))
            {
                throw new InvalidOperationException($"Item is of type {item.GetClass().Name} instead of expected type {Reference.ReferenceType.Name}");
            }
            base.Insert(index, item);
        }

        protected override void Replace(int index, IModelElement oldValue, IModelElement newValue)
        {
            if (!((IClass)Reference.ReferenceType).IsAssignableFrom(newValue.GetClass()))
            {
                throw new InvalidOperationException($"Item is of type {newValue.GetClass().Name} instead of expected type {Reference.ReferenceType.Name}");
            }
            base.Replace(index, oldValue, newValue);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
	<meta content="2013-12-25 10:18:47 -0700" http-equiv="change-date" />
	<title>LV 18</title>

	<link rel="stylesheet" href='../css/bpi.css' >

Levítico 18

1Disse mais o Senhor a Moisés:

2Fala aos filhos de Israel, e dize-lhes: Eu sou o Senhor vosso Deus.

3Não fareis segundo as obras da terra do Egito, em que habitastes; nem fareis segundo as obras da terra de Canaã, para a qual eu vos levo; nem andareis segundo os seus estatutos.

4Os meus preceitos observareis, e os meus estatutos guardareis, para andardes neles. Eu sou o Senhor vosso Deus.

5Guardareis, pois, os meus estatutos e as minhas ordenanças, pelas quais o homem, observando-as, viverá. Eu sou o Senhor.

6Nenhum de vós se chegará àquela que lhe é próxima por sangue, para descobrir a sua nudez. Eu sou o Senhor.

7Não descobrirás a nudez de teu pai, nem tampouco a de tua mãe; ela é tua mãe, não descobrirás a sua nudez.

8Não descobrirás a nudez da mulher de teu pai; é nudez de teu pai.

9A nudez de tua irmã por parte de pai ou por parte de mãe, quer nascida em casa ou fora de casa, não a descobrirás.

10Nem tampouco descobrirás a nudez da filha de teu filho, ou da filha de tua filha; porque é tua nudez.

11A nudez da filha da mulher de teu pai, gerada de teu pai, a qual é tua irmã, não a descobrirás.

12Não descobrirás a nudez da irmã de teu pai; ela é parenta chegada de teu pai.

13Não descobrirás a nudez da irmã de tua mãe, pois ela é parenta chegada de tua mãe.

14Não descobrirás a nudez do irmão de teu pai; não te chegarás à sua mulher; ela é tua tia.

15Não descobrirás a nudez de tua nora; ,ela é mulher de teu filho; não descobrirás a sua nudez.

16Não descobrirás a nudez da mulher de teu irmão; é a nudez de teu irmão.

17Não descobrirás a nudez duma mulher e de sua filha. Não tomarás a filha de seu filho, nem a filha de sua filha, para descobrir a sua nudez; são parentas chegadas; é maldade.

18E não tomarás uma mulher juntamente com sua irmã, durante a vida desta, para tornar-lha rival, descobrindo a sua nudez ao lado da outra.

19Também não te chegarás a mulher enquanto for impura em virtude da sua imundícia, para lhe descobrir a nudez.

20Nem te deitarás com a mulher de teu próximo, contaminando-te com ela.

21Não oferecerás a Moloque nenhum dos teus filhos, fazendo-o passar pelo fogo; nem profanarás o nome de teu Deus. Eu sou o Senhor.

22Não te deitarás com varão, como se fosse mulher; é abominação.

23Nem te deitarás com animal algum, contaminando-te com ele; nem a mulher se porá perante um animal, para ajuntar-se com ele; é confusão.

24Não vos contamineis com nenhuma dessas coisas, porque com todas elas se contaminaram as nações que eu expulso de diante de vós;

25e, porquanto a terra está contaminada, eu visito sobre ela a sua iniqüidade, e a terra vomita os seus habitantes.

26Vós, pois, guardareis os meus estatutos e os meus preceitos, e nenhuma dessas abominações fareis, nem o natural, nem o estrangeiro que peregrina entre vós

27{porque todas essas abominações cometeram os homens da terra, que nela estavam antes de vós, e a terra ficou contaminada};

28para que a terra não seja contaminada por vós e não vos vomite também a vós, como vomitou a nação que nela estava antes de vós.

29Pois qualquer que cometer alguma dessas abominações, sim, aqueles que as cometerem serão extirpados do seu povo.

30Portanto guardareis o meu mandamento, de modo que não caiais em nenhum desses abomináveis costumes que antes de vós foram seguidos, e para que não vos contamineis com eles. Eu sou o Senhor vosso Deus.

Almeida Revista e Atualizada© Copyright © 1993 Sociedade Bíblica do Brasil. Todos os direitos reservados. Texto bíblico utilizado com autorização. Saiba mais sobre a Sociedade Bíblica do Brasil. A Sociedade Bíblica do Brasil trabalha para que a Bíblia esteja, efetivamente, ao alcance de todos e seja lida por todos. A SBB é uma entidade sem fins lucrativos, dedicada a promover o desenvolvimento integral do ser humano.