text:
/**
 * File : broker.cc
 * Author : Tuan Anh Nguyen
 * Description : Implementation of parallel object broker: general part
 * Creation date : -
 *
 * Modifications :
 * Authors		Date			Comment
 */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <strings.h>
#include <assert.h>
#include <signal.h>
#include "paroc_broker.h"
#include "paroc_interface.h"
#include "paroc_event.h"
#include "paroc_buffer_factory_finder.h"
#include "paroc_buffer_raw.h"

#include "objectmonitor.ph"
#include "paroc_thread.h"
#include "appservice.ph"

#define TIMEOUT 1800

#define MINMETHODID 2
paroc_request::paroc_request()
{
	from=NULL;
	data=NULL;
	userdata=NULL;
}

paroc_request::paroc_request(const paroc_request &r)
{
	from=r.from;
	memcpy(methodId,r.methodId,3*sizeof(unsigned));
	data=r.data;
	userdata=r.userdata;
}

void paroc_request::operator =(const paroc_request &r)
{
	from=r.from;
	memcpy(methodId,r.methodId,3*sizeof(unsigned));
	data=r.data;
	userdata=r.userdata;
}

void broker_interupt(int sig)
{
	printf("Interrupt on thread id %lu\n",(unsigned long)pthread_self());
}

class paroc_receivethread: public paroc_thread
{
public:
	paroc_receivethread(paroc_broker *br, paroc_combox *com);
	~paroc_receivethread();
	virtual void start();
protected:
	paroc_broker *broker;
	paroc_combox *comm;
};

paroc_receivethread::paroc_receivethread(paroc_broker *br, paroc_combox *combox): paroc_thread(true)
{
	broker=br;
	comm=combox;
}
paroc_receivethread::~paroc_receivethread()
{
}

void paroc_receivethread::start()
{
	signal(SIGHUP,broker_interupt);
	broker->ReceiveThread(comm);
}

//===paroc_object: base class for all parallel object-server side

//===paroc_broker: the base class for server object broker

//char paroc_broker::myContact[256];

paroc_accesspoint paroc_broker::accesspoint;
paroc_string paroc_broker::classname;

void broker_killed(int sig)
{
	rprintf("FATAL: SIGNAL %d on %s@%s\n",sig, (const char *)paroc_broker::classname,paroc_broker::accesspoint.GetAccessString());
	exit(1);
}

paroc_broker::paroc_broker()
{
	obj=NULL;
	state=POPC_STATE_RUNNING;

	instanceCount=0;
	mutexCount=0;
	concPendings=0;
}

paroc_broker::~paroc_broker()
{
	int n=comboxArray.GetSize();
	for (int i=0;i<n;i++) comboxArray[i]->Destroy();
	if (obj!=NULL)
	{
		delete obj;
	}
}

void paroc_broker::AddMethodInfo(unsigned cid, paroc_method_info *methods, int sz)
{
	if (sz<=0 || methods==NULL) return;
	paroc_class_info &t=methodnames.AddHeadNew();
	t.cid=cid;
	t.methods=methods;
	t.sz=sz;
}

const char *paroc_broker::FindMethodName(unsigned classID, unsigned methodID)
{
	POSITION pos=methodnames.GetHeadPosition();
	while (pos!=NULL)
	{
		paroc_class_info &t=methodnames.GetNext(pos);
		if (t.cid==classID)
		{
			paroc_method_info *m=t.methods;
			int n=t.sz;
			for (int i=0;i<n;i++, m++) if (m->mid==methodID) return m->name;
		}
	}
	return NULL;
}

bool paroc_broker::FindMethodInfo(const char *name, unsigned &classID, unsigned &methodID)
{
	if (name==NULL) return false;

	POSITION pos=methodnames.GetHeadPosition();
	while (pos!=NULL)
	{
		paroc_class_info &t=methodnames.GetNext(pos);
		paroc_method_info *m=t.methods;
		int n=t.sz;
		for (int i=0;i<n;i++, m++) if (paroc_utils::isEqual(name,m->name))
			{
				methodID=m->mid;
				classID=t.cid;
				return true;
			}
	}
	return false;
}

int paroc_broker::Run()
{

	//Create threads for each protocols for receiving requests....

	paroc_array<paroc_receivethread *> ptArray;
	int comboxCount = comboxArray.GetSize();
	if (comboxCount<=0) return -1;

	state=POPC_STATE_RUNNING;

	ptArray.SetSize(comboxCount);
	int i;

	for (i=0; i<comboxCount; i++) {
		ptArray[i] =new paroc_receivethread(this,comboxArray[i]);
		int ret=ptArray[i]->create();
		if (ret!=0) return errno;
	}

	if (obj==NULL) alarm(TIMEOUT);

	while (state==POPC_STATE_RUNNING)
	{
		try {
			paroc_request req;

			if (!GetRequest(req)) break;

			//	DEBUG("Serve request: class %s, MethodID=(%d,%d,%d)",classname,req.methodId[0],req.methodId[1],req.methodId[2]);
			ServeRequest(req);
			if (req.methodId[2] & INVOKE_CONSTRUCTOR)
			{
				alarm(0);
				if (obj==NULL) break;
			}
		}

		catch (...)
		{
			UnhandledException();
		}
	}

	if (obj!=NULL && state==POPC_STATE_RUNNING)
	{
		paroc_mutex_locker test(execCond);

		//Wait for all invocations terminated....
		while (instanceCount>0 || !request_fifo.IsEmpty())
		{
			execCond.wait();
		}
	}

	state=POPC_STATE_EXIT;
	for (i=0; i<comboxCount; i++)
	{
		if (WakeupReceiveThread(comboxArray[i])) delete ptArray[i];
		else
		{
			ptArray[i]->cancel();
		}
	}

	return 0;
}

bool paroc_broker::Initialize(int *argc, char ***argv)
{
	if (paroc_utils::checkremove(argc,argv,"-runlocal"))  paroc_od::defaultLocalJob=true;

	paroc_combox_factory  *ff=paroc_combox_factory::GetInstance();
	int comboxCount = ff->GetCount();
	comboxArray.SetSize(comboxCount);
	paroc_string protocolName;
	paroc_string url;

	int count=0;
	for (int i=0;i<comboxCount;i++)
	{
		comboxArray[count]=ff->Create(i);
		if (comboxArray[count]==NULL)
		{
			DEBUG("Fail to create combox #%d",i);
		}
		else count++;
	}
	if (comboxCount!=count)
	{
		comboxCount=count;
		comboxArray.SetSize(comboxCount);
	}
	if (comboxCount<=0) return false;

	for (int i=0; i<comboxCount; i++)
	{
		paroc_combox * pc = comboxArray[i];
		pc->GetProtocol(protocolName);
		char argument[1024];
		sprintf(argument, "-%s_port=", (const char *)protocolName);

		char *portstr=paroc_utils::checkremove(argc,argv,argument);
		if (portstr!=NULL)
		{
			int port;
			if (sscanf(portstr,"%d",&port)!=1) return false;
			if (!pc->Create(port, true))
			{
				paroc_system::perror("Broker");
				return false;
			}
		}
		else
		{
			if (!pc->Create(0, true))
			{
				paroc_system::perror("Broker");
				return false;
			}
		}
		paroc_string ap;
		pc->GetUrl(ap);
		url+=ap;
		if (i<comboxCount-1) url+=PROTO_DELIMIT_CHAR;
	}
	accesspoint.SetAccessString(url.GetString());

	char *tmp=paroc_utils::checkremove(argc,argv,"-constructor");
	if (tmp!=NULL && classname!=NULL)
	{
		paroc_request r;
		paroc_buffer_raw tmp;
		r.data=&tmp;
		if (!FindMethodInfo(classname,r.methodId[0],r.methodId[1]) || r.methodId[1]!=10)
		{
			DEBUG("Can not find default constructor");
			return false;
		}
		r.methodId[2]=INVOKE_CONSTRUCTOR;
		if (!DoInvoke(r)) return false;
	}

	paroc_object::argc=*argc;
	paroc_object::argv=*argv;

	signal(SIGTERM,broker_killed);
	signal(SIGINT,broker_killed);
	signal(SIGQUIT,broker_killed);
	signal(SIGILL,broker_killed);
	signal(SIGABRT,broker_killed);

	signal(SIGPIPE,SIG_IGN);

	return true;
}

bool paroc_broker::WakeupReceiveThread(paroc_combox  *mycombox)
{
	paroc_combox_factory *fact=paroc_combox_factory::GetInstance();
	paroc_string url, prot;

	bool ok=false;
	mycombox->GetProtocol(prot);
	mycombox->GetUrl(url);

	char *str=url.GetString();
	if (str==NULL) return false;

	char *ptr;
	char *tok=strtok_r(str," \t\n\r",&ptr);
	while (tok!=NULL && !ok)
	{
		paroc_combox *tmp=fact->Create(prot);
		tmp->SetTimeout(100000);
		if (tmp->Create(0,false) && tmp->Connect(tok))
		{
			try
			{
				paroc_interface test(tmp, NULL);
				test.ObjectActive();
				ok=true;
			}
			catch (...)
			{
				DEBUG("Exception on waking up %s", tok);
			}
		}
		else tmp->Destroy();

		tok=strtok_r(NULL," \t\n\r",&ptr);
	}
	return ok;
}


text:
require 'bundler/setup'
Bundler.setup

require "rails/all"

require 'see_more'
require "nokogiri"
require 'sequel'
require 'sqlite3'

include ActionView::Helpers::UrlHelper

RSpec.configure do |config|

end

redpajama_set_name: RedPajamaGithub


text:
h.forum
=======

Lean clean modern forum for Tor


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.09.30 at 06:15:10 PM PDT
//

package org.w3._1999.xhtml;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{http://www.w3.org/1999/xhtml}option" maxOccurs="unbounded"/>
 *       </sequence>
 *       <attGroup ref="{http://www.w3.org/1999/xhtml}attrs"/>
 *       <attribute name="disabled">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}token">
 *             <enumeration value="disabled"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *       <attribute name="label" use="required" type="{http://www.w3.org/1999/xhtml}Text" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "option"
})
@XmlRootElement(name = "optgroup")
public class Optgroup {

    @XmlElement(required = true)
    protected List<Option> option;
    @XmlAttribute(name = "disabled")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected String disabled;
    @XmlAttribute(name = "label", required = true)
    protected String label;
    @XmlAttribute(name = "onclick")
    protected String onclick;
    @XmlAttribute(name = "ondblclick")
    protected String ondblclick;
    @XmlAttribute(name = "onmousedown")
    protected String onmousedown;
    @XmlAttribute(name = "onmouseup")
    protected String onmouseup;
    @XmlAttribute(name = "onmouseover")
    protected String onmouseover;
    @XmlAttribute(name = "onmousemove")
    protected String onmousemove;
    @XmlAttribute(name = "onmouseout")
    protected String onmouseout;
    @XmlAttribute(name = "onkeypress")
    protected String onkeypress;
    @XmlAttribute(name = "onkeydown")
    protected String onkeydown;
    @XmlAttribute(name = "onkeyup")
    protected String onkeyup;
    @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace")
    protected String lang;
    @XmlAttribute(name = "dir")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected String dir;
    @XmlAttribute(name = "id")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlID
    @XmlSchemaType(name = "ID")
    protected String id;
    @XmlAttribute(name = "class")
    @XmlSchemaType(name = "NMTOKENS")
    protected List<String> clazz;
    @XmlAttribute(name = "style")
    protected String style;
    @XmlAttribute(name = "title")
    protected String title;

    /**
     * Gets the value of the option property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the option property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getOption().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link Option }
     *
     *
     */
    public List<Option> getOption() {
        if (option == null) {
            option = new ArrayList<Option>();
        }
        return this.option;
    }

    /**
     * Gets the value of the disabled property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDisabled() {
        return disabled;
    }

    /**
     * Sets the value of the disabled property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDisabled(String value) {
        this.disabled = value;
    }

    /**
     * Gets the value of the label property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLabel() {
        return label;
    }

    /**
     * Sets the value of the label property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLabel(String value) {
        this.label = value;
    }

    /**
     * Gets the value of the onclick property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnclick() {
        return onclick;
    }

    /**
     * Sets the value of the onclick property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnclick(String value) {
        this.onclick = value;
    }

    /**
     * Gets the value of the ondblclick property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOndblclick() {
        return ondblclick;
    }

    /**
     * Sets the value of the ondblclick property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOndblclick(String value) {
        this.ondblclick = value;
    }

    /**
     * Gets the value of the onmousedown property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnmousedown() {
        return onmousedown;
    }

    /**
     * Sets the value of the onmousedown property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnmousedown(String value) {
        this.onmousedown = value;
    }

    /**
     * Gets the value of the onmouseup property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnmouseup() {
        return onmouseup;
    }

    /**
     * Sets the value of the onmouseup property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnmouseup(String value) {
        this.onmouseup = value;
    }

    /**
     * Gets the value of the onmouseover property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnmouseover() {
        return onmouseover;
    }

    /**
     * Sets the value of the onmouseover property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnmouseover(String value) {
        this.onmouseover = value;
    }

    /**
     * Gets the value of the onmousemove property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnmousemove() {
        return onmousemove;
    }

    /**
     * Sets the value of the onmousemove property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnmousemove(String value) {
        this.onmousemove = value;
    }

    /**
     * Gets the value of the onmouseout property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnmouseout() {
        return onmouseout;
    }

    /**
     * Sets the value of the onmouseout property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnmouseout(String value) {
        this.onmouseout = value;
    }

    /**
     * Gets the value of the onkeypress property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnkeypress() {
        return onkeypress;
    }

    /**
     * Sets the value of the onkeypress property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnkeypress(String value) {
        this.onkeypress = value;
    }

    /**
     * Gets the value of the onkeydown property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnkeydown() {
        return onkeydown;
    }

    /**
     * Sets the value of the onkeydown property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnkeydown(String value) {
        this.onkeydown = value;
    }

    /**
     * Gets the value of the onkeyup property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOnkeyup() {
        return onkeyup;
    }

    /**
     * Sets the value of the onkeyup property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOnkeyup(String value) {
        this.onkeyup = value;
    }

    /**
     * Gets the value of the lang property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLang() {
        return lang;
    }

    /**
     * Sets the value of the lang property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLang(String value) {
        this.lang = value;
    }

    /**
     * Gets the value of the dir property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDir() {
        return dir;
    }

    /**
     * Sets the value of the dir property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDir(String value) {
        this.dir = value;
    }

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setId(String value) {
        this.id = value;
    }

    /**
     * Gets the value of the clazz property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the clazz property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getClazz().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getClazz() {
        if (clazz == null) {
            clazz = new ArrayList<String>();
        }
        return this.clazz;
    }

    /**
     * Gets the value of the style property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getStyle() {
        return style;
    }

    /**
     * Sets the value of the style property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setStyle(String value) {
        this.style = value;
    }

    /**
     * Gets the value of the title property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getTitle() {
        return title;
    }

    /**
     * Sets the value of the title property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setTitle(String value) {
        this.title = value;
    }

}


text:
using System.Collections.Generic;
using System.Linq;

namespace Folke.Elm
{
    /// <summary>
    /// A command that returns values mapped to a type
    /// </summary>
    /// <typeparam name="T">The return type</typeparam>
    public interface IQueryableCommand<out T> : IQueryableCommand
    {
        MappedClass MappedClass { get; }

        IEnumerator<T> GetEnumerator();
    }

    /// <summary>
    /// A command that returns values
    /// </summary>
    public interface IQueryableCommand : IBaseCommand
    {
    }
}


text:
<!DOCTYPE html>

<meta charset="UTF-8">
<link href="style.css" type="text/css" rel="stylesheet">
<title>EXTRACTPS—Extract Packed Floating-Point Values </title>

EXTRACTPS—Extract Packed Floating-Point Values

Opcode/Instruction
Op /En
64/32 bit Mode Support
CPUID Feature Flag
Description

66 0F 3A 17 /r ib EXTRACTPS reg/m32, xmm1, imm8
RMI
VV
SSE4_1
Extract one single-precision floating-point value from xmm1 at the offset specified by imm8 and store the result in reg or m32. Zero extend the results in 64-bit register if applicable.

VEX.128.66.0F3A.WIG 17 /r ib VEXTRACTPS reg/m32, xmm1, imm8
RMI
V/V
AVX
Extract one single-precision floating-point value from xmm1 at the offset specified by imm8 and store the result in reg or m32. Zero extend the results in 64-bit register if applicable.

EVEX.128.66.0F3A.WIG 17 /r ib VEXTRACTPS reg/m32, xmm1, imm8
T1S
V/V
AVX512F
Extract one single-precision floating-point value from xmm1 at the offset specified by imm8 and store the result in reg or m32. Zero extend the results in 64-bit register if applicable.

Instruction Operand Encoding

Op/En
Operand 1
Operand 2
Operand 3
Operand 4

RMI
ModRM:r/m (w)
ModRM:reg (r)
Imm8
NA

T1S
ModRM:r/m (w)
ModRM:reg (r)
Imm8
NA

Description

Extracts a single-precision floating-point value from the source operand (second operand) at the 32-bit offset spec-ified from imm8. Immediate bits higher than the most significant offset for the vector length are ignored.

The extracted single-precision floating-point value is stored in the low 32-bits of the destination operand

In 64-bit mode, destination register operand has default operand size of 64 bits. The upper 32-bits of the register are filled with zero. REX.W is ignored.

VEX.128 and EVEX encoded version: When VEX.W1 or EVEX.W1 form is used in 64-bit mode with a general purpose register (GPR) as a destination operand, the packed single quantity is zero extended to 64 bits.

VEX.vvvv/EVEX.vvvv is reserved and must be 1111b otherwise instructions will #UD.

128-bit Legacy SSE version: When a REX.W prefix is used in 64-bit mode with a general purpose register (GPR) as a destination operand, the packed single quantity is zero extended to 64 bits.

The source register is an XMM register. Imm8[1:0] determine the starting DWORD offset from which to extract the 32-bit floating-point value.

If VEXTRACTPS is encoded with VEX.L= 1, an attempt to execute the instruction encoded with VEX.L= 1 will cause an #UD exception.

Operation

VEXTRACTPS (EVEX and VEX.128 encoded version)

SRC_OFFSET (cid:197) IMM8[1:0]
IF (64-Bit Mode and DEST is register)
    DEST[31:0] (cid:197) (SRC[127:0] >> (SRC_OFFSET*32)) AND 0FFFFFFFFh
    DEST[63:32] (cid:197) 0
ELSE
    DEST[31:0] (cid:197) (SRC[127:0] >> (SRC_OFFSET*32)) AND 0FFFFFFFFh
FI

EXTRACTPS (128-bit Legacy SSE version)

SRC_OFFSET (cid:197)IMM8[1:0]
IF (64-Bit Mode and DEST is register)
    DEST[31:0] (cid:197)(SRC[127:0] >> (SRC_OFFSET*32)) AND 0FFFFFFFFh
    DEST[63:32] (cid:197)0
ELSE
    DEST[31:0] (cid:197)(SRC[127:0] >> (SRC_OFFSET*32)) AND 0FFFFFFFFh
FI

Intel C/C++ Compiler Intrinsic Equivalent

EXTRACTPS int _mm_extract_ps (__m128 a, const int nidx);

SIMD Floating-Point Exceptions

None

Other Exceptions

VEX-encoded instructions, see Exceptions Type 5; Additionally

EVEX-encoded instructions, see Exceptions Type E9NF.

IF VEX.L = 0.

If VEX.vvvv != 1111B or EVEX.vvvv != 1111B.


text:
package org.jetbrains.debugger;

import com.intellij.util.ThreeState;
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator;
import com.intellij.xdebugger.frame.XCompositeNode;
import com.intellij.xdebugger.frame.XInlineDebuggerDataCallback;
import com.intellij.xdebugger.frame.XNavigatable;
import com.intellij.xdebugger.frame.XValueNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.concurrency.Promise;
import org.jetbrains.debugger.frame.CallFrameView;
import org.jetbrains.debugger.values.ObjectValue;
import org.jetbrains.debugger.values.Value;

import javax.swing.*;
import java.util.List;

public interface DebuggerViewSupport {
  @Nullable
  SourceInfo getSourceInfo(@Nullable Script script, @NotNull CallFrame frame);

  @Nullable
  SourceInfo getSourceInfo(@Nullable String functionName, @NotNull String scriptUrl, int line, int column);

  @Nullable
  SourceInfo getSourceInfo(@Nullable String functionName, @NotNull Script script, int line, int column);

  Vm getVm();

  @NotNull
  String propertyNamesToString(@NotNull List<String> list, boolean quotedAware);

  // Please, don't hesitate to ask to share some generic implementations. Don't reinvent the wheel and keep in mind - user expects the same UI across all IDEA-based IDEs.
  void computeObjectPresentation(@NotNull ObjectValue value, @NotNull Variable variable, @NotNull VariableContext context, @NotNull XValueNode node, @NotNull Icon icon);

  void computeArrayPresentation(@NotNull Value value, @NotNull Variable variable, @NotNull VariableContext context, @NotNull XValueNode node, @NotNull Icon icon);

  @NotNull
  XDebuggerEvaluator createFrameEvaluator(@NotNull CallFrameView frame);

  /**
   * {@link org.jetbrains.debugger.values.FunctionValue} is special case and handled by SDK
   */
  boolean canNavigateToSource(@NotNull Variable variable, @NotNull VariableContext context);

  void computeSourcePosition(@NotNull String name, @NotNull Variable variable, @NotNull VariableContext context, @NotNull XNavigatable navigatable);

  @NotNull
  ThreeState computeInlineDebuggerData(@NotNull String name, @NotNull Variable variable, @NotNull VariableContext context, @NotNull XInlineDebuggerDataCallback callback);

  // return null if you don't need to add additional properties
  @Nullable
  Promise<Void> computeAdditionalObjectProperties(@NotNull ObjectValue value, @NotNull Variable variable, @NotNull VariableContext context, @NotNull XCompositeNode node);

  @NotNull
  Promise<MemberFilter> getMemberFilter(@NotNull VariableContext context);

  @Nullable
  Value transformErrorOnGetUsedReferenceValue(@Nullable Value value, @Nullable String error);

  boolean isInLibraryContent(@NotNull SourceInfo sourceInfo, @Nullable Script script);
}


text:
package api

import (
	"bytes"
	"compress/gzip"
	"fmt"
)

// ChunksService handles communication with the chunk related methods of the
// Buildkite Agent API.
type ChunksService struct {
	client *Client
}

// Chunk represents a Buildkite Agent API Chunk
type Chunk struct {
	Data     string
	Sequence int
	Offset   int
	Size     int
}

// Uploads the chunk to the Buildkite Agent API. This request sends the
// compressed log directly as a request body.
func (cs *ChunksService) Upload(jobId string, chunk *Chunk) (*Response, error) {
	// Create a compressed buffer of the log content
	body := &bytes.Buffer{}
	gzipper := gzip.NewWriter(body)
	gzipper.Write([]byte(chunk.Data))
	if err := gzipper.Close(); err != nil {
		return nil, err
	}

	// Pass most params as query
	u := fmt.Sprintf("jobs/%s/chunks?sequence=%d&offset=%d&size=%d", jobId, chunk.Sequence, chunk.Offset, chunk.Size)
	req, err := cs.client.NewFormRequest("POST", u, body)
	if err != nil {
		return nil, err
	}

	// Mark the request as a direct compressed log chunk
	req.Header.Add("Content-Type", "text/plain")
	req.Header.Add("Content-Encoding", "gzip")

	return cs.client.Do(req, nil)
}


text:
package com.demo.infinispan.model;
import java.io.Serializable;

public class Item implements Serializable{

	private String key;

	private String value;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

}


text:
require 'spec_helper'

describe "lists_of_parameters/edit" do
  before(:each) do
    @lists_of_parameter = assign(:lists_of_parameter, stub_model(ListsOfParameter))
  end

  it "renders the edit lists_of_parameter form" do
    render

    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "form[action=?][method=?]", lists_of_parameter_path(@lists_of_parameter), "post" do
    end
  end
end


text:
let sha256 = require('js-sha256')
let Block = require('./block')

class Blockchain {

  constructor(genesisBlock) {

    this.blocks = []
    this.addBlock(genesisBlock)
  }

  addBlock(block) {

    if(this.blocks.length == 0) {
      block.previousHash = "0000000000000000"
      block.hash = this.generateHash(block)
    }

    this.blocks.push(block)

  }

  getNextBlock(transactions) {

      let block = new Block()

      transactions.forEach(function(transaction){
        block.addTransaction(transaction)
      })

      let previousBlock = this.getPreviousBlock()
      block.index = this.blocks.length
      block.previousHash = previousBlock.hash
      block.hash = this.generateHash(block)

      return block
  }

  getPreviousBlock() {
    return this.blocks[this.blocks.length - 1]
  }

  generateHash(block) {

      let hash = sha256(block.key)

      while(!hash.startsWith("000")) {
        block.nonce += 1
        hash = sha256(block.key)
        console.log(hash)
      }

      return hash
  }

}

module.exports = Blockchain


text:
package org.wso2.siddhi.query.api.execution.query.selection;

import org.wso2.siddhi.query.api.exception.DuplicateAttributeException;
import org.wso2.siddhi.query.api.expression.Expression;
import org.wso2.siddhi.query.api.expression.Variable;

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

/**
 * Selector selecting query output stream attributes
 */
public class Selector {

    private List<OutputAttribute> selectionList = new ArrayList<OutputAttribute>();
    private List<Variable> groupByList = new ArrayList<Variable>();
    private Expression havingExpression;

    public static Selector selector() {
        return new Selector();
    }

    public Selector select(String rename, Expression expression) {
        OutputAttribute outputAttribute = new OutputAttribute(rename, expression);
        checkSelection(outputAttribute);
        selectionList.add(outputAttribute);
        return this;
    }

    public Selector select(Variable variable) {
        OutputAttribute outputAttribute = new OutputAttribute(variable);
        checkSelection(outputAttribute);
        selectionList.add(outputAttribute);
        return this;
    }

    private void checkSelection(OutputAttribute newAttribute) {
        for (OutputAttribute attribute : selectionList) {
            if (attribute.getRename().equals(newAttribute.getRename())) {
                throw new DuplicateAttributeException(attribute.getRename() + " is already defined as an output " +
                        "attribute ");
            }
        }
    }

    public Selector having(Expression havingExpression) {
        this.havingExpression = havingExpression;
        return this;
    }

    public Selector groupBy(Variable variable) {
        groupByList.add(variable);
        return this;
    }

    public Selector addGroupByList(List<Variable> list) {
        if (list != null) {
            groupByList.addAll(list);
        }
        return this;
    }

    public List<OutputAttribute> getSelectionList() {
        return selectionList;
    }

    public List<Variable> getGroupByList() {
        return groupByList;
    }

    public Expression getHavingExpression() {
        return havingExpression;
    }

    public Selector addSelectionList(List<OutputAttribute> projectionList) {
        for (OutputAttribute outputAttribute : projectionList) {
            checkSelection(outputAttribute);
            this.selectionList.add(outputAttribute);
        }
        return this;
    }

    @Override
    public String toString() {
        return "Selector{" +
                "selectionList=" + selectionList +
                ", groupByList=" + groupByList +
                ", havingExpression=" + havingExpression +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Selector)) {
            return false;
        }

        Selector selector = (Selector) o;

        if (groupByList != null ? !groupByList.equals(selector.groupByList) : selector.groupByList != null) {
            return false;
        }
        if (havingExpression != null ? !havingExpression.equals(selector.havingExpression) : selector
                .havingExpression != null) {
            return false;
        }
        if (selectionList != null ? !selectionList.equals(selector.selectionList) : selector.selectionList != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = selectionList != null ? selectionList.hashCode() : 0;
        result = 31 * result + (groupByList != null ? groupByList.hashCode() : 0);
        result = 31 * result + (havingExpression != null ? havingExpression.hashCode() : 0);
        return result;
    }
}


text:
```
npm completion >> ~/.bashrc
```

## Define defaults for `npm init`

```
npm config set init.author.name <name>
npm config set init.author.email <email>
```

## Lockdown dependencies

Pin to major version (default):
```
npm config set save-prefix="^"
```

Pin to minor version:
```
npm config set save-prefix="~"
```

Pin to exact version:
```
npm config set save-exact true
```

Or use:

```
npm shrinkwrap
```

## List outdated packages

```
npm outdated
```


text:
class CreateNotifications < ActiveRecord::Migration
  def self.up

    create_table :notification_limits do |t|
      t.column :user_id, :integer, :null => false
      t.column :assignment_id, :integer, :null => true
      t.column :questionnaire_id, :integer, :null => true
      t.column :limit, :integer, :null => false, :default => 15
    end

    User.find_by_sql("select * from users where role_id in (select id from roles where not (parent_id is null))").each{
      |user|
      execute "INSERT INTO `notification_limits` (`user_id`, `limit`) VALUES
            (#{user.id}, 15);"
    }
  end

  def self.down
    drop_table :notification_limits
  end
end


text:
<?php

namespace Etu;

use Etu\Interfaces\ContainerInterface;
use Etu\Traits\ArrayPropertyAllAccess;
use Closure;
use InvalidArgumentException;

class Container implements ContainerInterface
{
    use ArrayPropertyAllAccess;

    protected $container = [];

    protected $maintain = [];

    protected $calls = [];

    public function __construct(array $items = [])
    {
        $this->registerPropertyAccess('container', true);

        $this->registerPropertyAccess('maintain', true);

        $this->registerPropertyAccess('calls', true);

        foreach ($items as $item) {
            if (!is_array($item) || count($item) < 2) {
                throw new InvalidArgumentException(
                    'Container construct each item of array argument must be an array type and more than two element'
                );
            }
            call_user_func_array([$this, 'add'], $item);
        }
    }

    public function get($id, $arguments = [])
    {
        if (!$this->has($id)) {
            throw new InvalidArgumentException(sprintf('Identifier %s is not found', $id));
        }

        $value = $this->getProperty('container', $id);

        if (is_callable($value) && !$this->hasProperty('calls', $id)) {
            $call = $value;
            array_unshift($arguments, $this);
            $value = call_user_func_array($value, $arguments);
            if (!$this->hasProperty('maintain', $id)) {
                $this->setProperty('calls', $id, $call);
                $this->setProperty('container', $id, $value);
            }
        }

        return $value;
    }

    public function has($id)
    {
        return $this->hasProperty('container', $id);
    }

    public function add($id, $value, $bindThis = false)
    {
        if ($this->has($id)) {
            $this->remove($id);
        }

        if ($bindThis && is_callable($value) && ($value instanceof Closure)) {
            $value = $value->bindTo($this);
        }

        return $this->setProperty('container', $id, $value);
    }

    public function update($id, $value)
    {
        if (!$this->has($id)) {
            throw new InvalidArgumentException(sprintf('Identifier %s is not found', $id));
        }

        return $this->setProperty('container', $id, $value);
    }

    public function remove($id)
    {
        $this->unsetProperty('container', $id);
        $this->unsetProperty('maintain', $id);
        $this->unsetProperty('calls', $id);
    }

    public function getCalledCall($id)
    {
        if (!$this->hasProperty('calls', $id)) {
            throw new InvalidArgumentException(
                sprintf('Identifier %s is not found or not called', $id)
            );
        }

        return $this->getProperty('calls', $id);
    }

    public function maintain($id)
    {
        if (!$this->has($id)) {
            throw new InvalidArgumentException(sprintf('Identifier %s is not found', $id));
        }

        if ($this->hasProperty('calls', $id)) {
            throw new InvalidArgumentException('service has been called, can not maintain');
        }

        $value = $this->getProperty('container', $id);
        if (!is_callable($value)) {
            throw new InvalidArgumentException('maintain service must be a callable function or object');
        }

        $this->setProperty('maintain', $id, true);
    }
}


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

namespace core\log;

defined('MOODLE_INTERNAL') || die();

/**
 * Interface describing log readers.
 *
 * This is intended for reports, use get_log_manager() to get
 * the configured instance.
 *
 * @package core
 */
interface manager {
    /**
     * Return list of available log readers.
     *
     * @param string $interface All returned readers must implement this interface.
     *
     * @return \core\log\reader[]
     */
    public function get_readers($interface = null);

    /**
     * Dispose all initialised stores.
     * @return void
     */
    public function dispose();

    /**
     * For a given report, returns a list of log stores that are supported.
     *
     * @param string $component component.
     *
     * @return false|array list of logstores that support the given report. It returns false if the given $component doesn't
     *      require logstores.
     */
    public function get_supported_logstores($component);
}


text:
package task

import (
	flatbuffers "github.com/google/flatbuffers/go"
)
type Query struct {
	_tab flatbuffers.Table
}

func (rcv *Query) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *Query) Attr() []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.ByteVector(o + rcv._tab.Pos)
	}
	return nil
}

func (rcv *Query) Uids(j int) uint64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		a := rcv._tab.Vector(o)
		return rcv._tab.GetUint64(a + flatbuffers.UOffsetT(j * 8))
	}
	return 0
}

func (rcv *Query) UidsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func (rcv *Query) Count() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Query) Offset() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func QueryStart(builder *flatbuffers.Builder) { builder.StartObject(4) }
func QueryAddAttr(builder *flatbuffers.Builder, attr flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(attr), 0) }
func QueryAddUids(builder *flatbuffers.Builder, uids flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(uids), 0) }
func QueryStartUidsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(8, numElems, 8)
}
func QueryAddCount(builder *flatbuffers.Builder, count int32) { builder.PrependInt32Slot(2, count, 0) }
func QueryAddOffset(builder *flatbuffers.Builder, offset int32) { builder.PrependInt32Slot(3, offset, 0) }
func QueryEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }


text:
<?php
namespace Chamilo\Core\Repository\ContentObject\Assignment\Common\Rendition\Html;

use Chamilo\Core\Repository\Common\Rendition\ContentObjectRendition;
use Chamilo\Core\Repository\ContentObject\Assignment\Common\Rendition\HtmlRenditionImplementation;
use Chamilo\Libraries\Platform\Translation;
use Chamilo\Libraries\Utilities\DatetimeUtilities;
use Chamilo\Libraries\Utilities\Utilities;

class HtmlDescriptionRenditionImplementation extends HtmlRenditionImplementation
{

    public function render()
    {
        return ContentObjectRendition::launch($this);
    }

    public function get_description()
    {
        $html = array();

        $html[] = '' . Translation::get('StartTime') . ': ';
        $html[] = DatetimeUtilities::format_locale_date(
            Translation::get('DateTimeFormatLong', null, Utilities::COMMON_LIBRARIES),
            $this->get_content_object()->get_start_time());
        $html[] = '
';

        $html[] = '' . Translation::get('EndTime') . ': ';
        $html[] = DatetimeUtilities::format_locale_date(
            Translation::get('DateTimeFormatLong', null, Utilities::COMMON_LIBRARIES),
            $this->get_content_object()->get_end_time());
        $html[] = '
';

        return implode(PHP_EOL, $html);
    }
}


text:
<?php

namespace Fuel\Core;

class Cache_Handler_String implements \Cache_Handler_Driver {
	public function readable($contents) {
		return ( string ) $contents;
	}
	public function writable($contents) {
		return ( string ) $contents;
	}
}


text:
class Admin {

public:
	Admin() {}
	Admin(unsigned inAdminId, string inAdminName, string inAdminPasswd) : adminId(inAdminId), adminName(inAdminName), password(inAdminPasswd) {}
	unsigned getAdminId();
	string getAdminName();
	string getPassword();
	void setAdminName(string inName);
	void setAdminId(unsigned);
	void setAdminPassword(string);
	friend ostream& operator<<(ostream&, Admin&);
	friend ofstream& operator<<(ofstream&, Admin&);
	friend ifstream& operator>>(ifstream&, Admin&);
	bool operator==(const Admin);

private:
	unsigned adminId;
	string adminName;
	string password;
};


text:
<?php

namespace crisu83\yii_caviar\generators;

use crisu83\yii_caviar\components\Config;
use crisu83\yii_caviar\Exception;
use crisu83\yii_caviar\components\File;
use crisu83\yii_caviar\helpers\Line;

abstract class Generator extends \CModel
{
    // Constants for built in generators.
    const COMPONENT = 'component';
    const CONFIG = 'config';
    const CONTROLLER = 'controller';
    const CRUD = 'crud';
    const LAYOUT = 'layout';
    const MODEL = 'model';
    const VIEW = 'view';
    const WEBAPP = 'webapp';

    /**
     * @var string name for the item that will be generated.
     */
    public $subject;

    /**
     * @var string name of this generator.
     */
    protected $name = 'base';

    /**
     * @var string short description of what this generator does.
     */
    protected $description = 'Abstract base class for code generation.';

    /**
     * @var string name of the application in which the item will generated.
     */
    protected $context = 'app';

    /**
     * @var Config
     */
    protected static $config;

    /**
     * Generates all necessary files.
     *
     * @return File[] list of files to generate.
     */
    abstract public function generate();

    /**
     * Initializes this generator.
     */
    public function init()
    {
    }

    /**
     * @inheritDoc
     */
    public function rules()
    {
        return array(
            array('subject', 'required'),
            array(
                'subject',
                'match',
                'pattern' => '/^[a-zA-Z_]\w*$/',
                'message' => '{attribute} should only contain word characters.'
            ),
        );
    }

    /**
     * Returns short descriptions for the attributes in this generator.
     *
     * @return array attribute descriptions.
     */
    public function attributeHelp()
    {
        return array(
            'subject' => "Name for the item that will be generated.",
        );
    }

    /**
     * @inheritDoc
     */
    public function attributeNames()
    {
        $names = array();

        $class = new \ReflectionClass($this);
        foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
            $names[] = $property->name;
        }

        return $names;
    }

    /**
     * Displays the help for this generator.
     */
    public function renderHelp()
    {
        $this->renderHeader();

        echo Line::begin('Usage:', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text($this->getUsage())
            ->nl(2);

        // Options
        echo Line::begin('Options:', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text('--help', Line::MAGENTA)
            ->to(21)
            ->text('-h', Line::MAGENTA)
            ->text('Display this help message.')
            ->nl(1);

        $attributes = $this->attributeNames();
        $help = $this->attributeHelp();

        sort($attributes);

        foreach ($attributes as $name) {
            echo Line::begin()
                ->indent(2)
                ->text("--$name", Line::MAGENTA)
                ->to(24)
                ->text(isset($help[$name]) ? $help[$name] : '')
                ->nl();
        }

        exit(0);
    }

    /**
     *
     */
    public function renderHeader()
    {
        echo Line::begin(ucfirst($this->name) . ' generator', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text($this->description)
            ->nl(2);
    }

    /**
     *
     */
    public function renderErrors()
    {
        echo Line::begin('Errors:', 'red')->nl();

        foreach ($this->getErrors() as $error) {
            echo Line::begin()
                ->indent(2)
                ->text('- ' . $error[0])
                ->nl();
        }

        exit(1);
    }

    /**
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * @return string
     */
    public function getUsage()
    {
        return "{$this->name} [context:]subject [options]";
    }

    /**
     * @param string $context
     */
    public function setContext($context)
    {
        $this->context = $context;
    }

    /**
     * Creates a new generator.
     *
     * @param string $name name of the generator.
     * @param array $config generator configuration.
     * @return Generator the created generator.
     * @throws Exception if the generator is not found.
     */
    public static function create($name, array $config = array())
    {
        if (!isset(self::$config->generators[$name])) {
            throw new Exception("Unknown generator '$name'.");
        }

        $generator = \Yii::createComponent(\CMap::mergeArray(self::$config->generators[$name], $config));
        $generator->init();

        foreach (self::$config->attributes as $attribute => $value) {
            if (property_exists($generator, $attribute)) {
                $generator->$attribute = $value;
            }
        }

        return $generator;
    }

    /**
     * Creates a generator and renders its help.
     *
     * @param string $name name of the generator.
     */
    public static function help($name)
    {
        self::create($name)->renderHelp();
    }

    /**
     * Creates and runs a specific generator.
     *
     * @param string $name name of the generator.
     * @param array $config generator configuration.
     * @return File[] list of files to generate.
     */
    public static function run($name, array $config = array())
    {
        $generator = self::create($name, $config);

        if (!$generator->validate()) {
            $generator->renderErrors();
        }

        return $generator->generate();
    }

    /**
     * @return Config
     */
    public static function getConfig()
    {
        return self::$config;
    }

    /**
     * @param Config $config
     */
    public static function setConfig(Config $config)
    {
        self::$config = $config;
    }
}


text:
using System;
using Xunit;

namespace SampleDynamicTests
{
    public class ForEachTest
    {
        [Fact]
        public static void ForEachTest_RunTest()
        {
            var numbers = new double[] { 1.0, 2.0, 3.0 };
            double sum = 0;
            foreach (int i in (dynamic)numbers)
            {
                sum += i;
            }

            Assert.Equal(6, sum);
        }
    }
}


text:
using System;
using System.IO;
using System.Reflection;

namespace schemav
{
    public class AssemblyResolver : MarshalByRefObject
    {
        private readonly AppDomain _appDomain;
        private readonly string _targetDirectory;

        public AssemblyResolver(AppDomain appDomain, string targetDirectory)
        {
            _appDomain = appDomain;
            _targetDirectory = targetDirectory;
            _appDomain.AssemblyResolve += AppDomain_AssemblyResolve;
        }

        private Assembly AppDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        {
            var assemblyName = new AssemblyName(args.Name).Name;
            var assemblyFileName = Path.Combine(_targetDirectory, assemblyName + ".dll");
            if (File.Exists(assemblyFileName))
                return Assembly.LoadFrom(assemblyFileName);

            return null;
        }

        public void Detach()
        {
            _appDomain.AssemblyResolve -= AppDomain_AssemblyResolve;
        }
    }
}


text:
using System;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;

namespace WebApiAngularJsSeed.Models
{
    public class ApplicationUser : IUser
    {
        public ApplicationUser()
        {
            Id = Guid.NewGuid().ToString();
        }

        public ApplicationUser(string userName) : this()
        {
            UserName = userName;
        }

        public ApplicationUser(string userName, string passwordHash) : this(userName)
        {
            PasswordHash = passwordHash;
        }

        public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager, string authenticationType)
        {
            // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
            var userIdentity = await manager.CreateIdentityAsync(this, authenticationType);
            // Add custom user claims here
            return userIdentity;
        }

        public string Id { get; }
        public string UserName { get; set; }
        public virtual string PasswordHash { get; set; }
    }
}


text:
package won.bot.framework.eventbot.event.impl.command.replace;

import java.net.URI;

/**
 * Indicates that replacing the atom content was aborted before sending a
 * message to a WoN node.
 */
public class ReplaceAbortedEvent extends ReplaceCommandFailureEvent {
    public ReplaceAbortedEvent(URI atomURI, ReplaceCommandEvent replaceCommandEvent, String message) {
        super(atomURI, replaceCommandEvent, message);
    }

    public ReplaceAbortedEvent(URI atomURI, ReplaceCommandEvent replaceCommandEvent) {
        super(atomURI, replaceCommandEvent);
    }
}