text:
/*
 * This is the global def file that is useful for including from the
 * target portion.
 */

#ifndef __QLA_TARGET_H
#define __QLA_TARGET_H

#include "qla_def.h"

/*
 * Must be changed on any change in any initiator visible interfaces or
 * data in the target add-on
 */
#define QLA2XXX_TARGET_MAGIC	269

/*
 * Must be changed on any change in any target visible interfaces or
 * data in the initiator
 */
#define QLA2XXX_INITIATOR_MAGIC   57222

#define QLA2XXX_INI_MODE_STR_EXCLUSIVE	"exclusive"
#define QLA2XXX_INI_MODE_STR_DISABLED	"disabled"
#define QLA2XXX_INI_MODE_STR_ENABLED	"enabled"

#define QLA2XXX_INI_MODE_EXCLUSIVE	0
#define QLA2XXX_INI_MODE_DISABLED	1
#define QLA2XXX_INI_MODE_ENABLED	2

#define QLA2XXX_COMMAND_COUNT_INIT	250
#define QLA2XXX_IMMED_NOTIFY_COUNT_INIT 250

/*
 * Used to mark which completion handles (for RIO Status's) are for CTIO's
 * vs. regular (non-target) info. This is checked for in
 * qla2x00_process_response_queue() to see if a handle coming back in a
 * multi-complete should come to the tgt driver or be handled there by qla2xxx
 */
#define CTIO_COMPLETION_HANDLE_MARK	BIT_29
#if (CTIO_COMPLETION_HANDLE_MARK <= DEFAULT_OUTSTANDING_COMMANDS)
#error "CTIO_COMPLETION_HANDLE_MARK not larger than "
	"DEFAULT_OUTSTANDING_COMMANDS"
#endif
#define HANDLE_IS_CTIO_COMP(h) (h & CTIO_COMPLETION_HANDLE_MARK)

/* Used to mark CTIO as intermediate */
#define CTIO_INTERMEDIATE_HANDLE_MARK	BIT_30

#ifndef OF_SS_MODE_0
/*
 * ISP target entries - Flags bit definitions.
 */
#define OF_SS_MODE_0        0
#define OF_SS_MODE_1        1
#define OF_SS_MODE_2        2
#define OF_SS_MODE_3        3

#define OF_EXPL_CONF        BIT_5       /* Explicit Confirmation Requested */
#define OF_DATA_IN          BIT_6       /* Data in to initiator */
					/*  (data from target to initiator) */
#define OF_DATA_OUT         BIT_7       /* Data out from initiator */
					/*  (data from initiator to target) */
#define OF_NO_DATA          (BIT_7 | BIT_6)
#define OF_INC_RC           BIT_8       /* Increment command resource count */
#define OF_FAST_POST        BIT_9       /* Enable mailbox fast posting. */
#define OF_CONF_REQ         BIT_13      /* Confirmation Requested */
#define OF_TERM_EXCH        BIT_14      /* Terminate exchange */
#define OF_SSTS             BIT_15      /* Send SCSI status */
#endif

#ifndef QLA_TGT_DATASEGS_PER_CMD32
#define QLA_TGT_DATASEGS_PER_CMD32	3
#define QLA_TGT_DATASEGS_PER_CONT32	7
#define QLA_TGT_MAX_SG32(ql) \
	(((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD32 + \
		QLA_TGT_DATASEGS_PER_CONT32*((ql) - 1)) : 0)

#define QLA_TGT_DATASEGS_PER_CMD64	2
#define QLA_TGT_DATASEGS_PER_CONT64	5
#define QLA_TGT_MAX_SG64(ql) \
	(((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD64 + \
		QLA_TGT_DATASEGS_PER_CONT64*((ql) - 1)) : 0)
#endif

#ifndef QLA_TGT_DATASEGS_PER_CMD_24XX
#define QLA_TGT_DATASEGS_PER_CMD_24XX	1
#define QLA_TGT_DATASEGS_PER_CONT_24XX	5
#define QLA_TGT_MAX_SG_24XX(ql) \
	(min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \
		QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))
#endif
#endif

#define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha))			\
			 ? le16_to_cpu((iocb)->u.isp2x.target.extended)	\
			 : (uint16_t)(iocb)->u.isp2x.target.id.standard)

#ifndef IMMED_NOTIFY_TYPE
#define IMMED_NOTIFY_TYPE 0x0D		/* Immediate notify entry. */
/*
 * ISP queue -	immediate notify entry structure definition.
 *		This is sent by the ISP to the Target driver.
 *		This IOCB would have report of events sent by the
 *		initiator, that needs to be handled by the target
 *		driver immediately.
 */
struct imm_ntfy_from_isp {
	uint8_t	 entry_type;		    /* Entry type. */
	uint8_t	 entry_count;		    /* Entry count. */
	uint8_t	 sys_define;		    /* System defined. */
	uint8_t	 entry_status;		    /* Entry Status. */
	union {
		struct {
			uint32_t sys_define_2; /* System defined. */
			target_id_t target;
			uint16_t lun;
			uint8_t  target_id;
			uint8_t  reserved_1;
			uint16_t status_modifier;
			uint16_t status;
			uint16_t task_flags;
			uint16_t seq_id;
			uint16_t srr_rx_id;
			uint32_t srr_rel_offs;
			uint16_t srr_ui;
#define SRR_IU_DATA_IN	0x1
#define SRR_IU_DATA_OUT	0x5
#define SRR_IU_STATUS	0x7
			uint16_t srr_ox_id;
			uint8_t reserved_2[28];
		} isp2x;
		struct {
			uint32_t reserved;
			uint16_t nport_handle;
			uint16_t reserved_2;
			uint16_t flags;
#define NOTIFY24XX_FLAGS_GLOBAL_TPRLO   BIT_1
#define NOTIFY24XX_FLAGS_PUREX_IOCB     BIT_0
			uint16_t srr_rx_id;
			uint16_t status;
			uint8_t  status_subcode;
			uint8_t  fw_handle;
			uint32_t exchange_address;
			uint32_t srr_rel_offs;
			uint16_t srr_ui;
			uint16_t srr_ox_id;
			uint8_t  reserved_4[19];
			uint8_t  vp_index;
			uint32_t reserved_5;
			uint8_t  port_id[3];
			uint8_t  reserved_6;
		} isp24;
	} u;
	uint16_t reserved_7;
	uint16_t ox_id;
} __packed;
#endif

#ifndef NOTIFY_ACK_TYPE
#define NOTIFY_ACK_TYPE 0x0E	  /* Notify acknowledge entry. */
/*
 * ISP queue -	notify acknowledge entry structure definition.
 *		This is sent to the ISP from the target driver.
 */
struct nack_to_isp {
	uint8_t	 entry_type;		    /* Entry type. */
	uint8_t	 entry_count;		    /* Entry count. */
	uint8_t	 sys_define;		    /* System defined. */
	uint8_t	 entry_status;		    /* Entry Status. */
	union {
		struct {
			uint32_t sys_define_2; /* System defined. */
			target_id_t target;
			uint8_t	 target_id;
			uint8_t	 reserved_1;
			uint16_t flags;
			uint16_t resp_code;
			uint16_t status;
			uint16_t task_flags;
			uint16_t seq_id;
			uint16_t srr_rx_id;
			uint32_t srr_rel_offs;
			uint16_t srr_ui;
			uint16_t srr_flags;
			uint16_t srr_reject_code;
			uint8_t  srr_reject_vendor_uniq;
			uint8_t  srr_reject_code_expl;
			uint8_t  reserved_2[24];
		} isp2x;
		struct {
			uint32_t handle;
			uint16_t nport_handle;
			uint16_t reserved_1;
			uint16_t flags;
			uint16_t srr_rx_id;
			uint16_t status;
			uint8_t  status_subcode;
			uint8_t  fw_handle;
			uint32_t exchange_address;
			uint32_t srr_rel_offs;
			uint16_t srr_ui;
			uint16_t srr_flags;
			uint8_t  reserved_4[19];
			uint8_t  vp_index;
			uint8_t  srr_reject_vendor_uniq;
			uint8_t  srr_reject_code_expl;
			uint8_t  srr_reject_code;
			uint8_t  reserved_5[5];
		} isp24;
	} u;
	uint8_t  reserved[2];
	uint16_t ox_id;
} __packed;
#define NOTIFY_ACK_SRR_FLAGS_ACCEPT	0
#define NOTIFY_ACK_SRR_FLAGS_REJECT	1

#define NOTIFY_ACK_SRR_REJECT_REASON_UNABLE_TO_PERFORM	0x9

#define NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_NO_EXPL		0
#define NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_UNABLE_TO_SUPPLY_DATA	0x2a

#define NOTIFY_ACK_SUCCESS      0x01
#endif

#ifndef ACCEPT_TGT_IO_TYPE
#define ACCEPT_TGT_IO_TYPE 0x16 /* Accept target I/O entry. */
#endif

#ifndef CONTINUE_TGT_IO_TYPE
#define CONTINUE_TGT_IO_TYPE 0x17
/*
 * ISP queue -	Continue Target I/O (CTIO) entry for status mode 0 structure.
 *		This structure is sent to the ISP 2xxx from target driver.
 */
struct ctio_to_2xxx {
	uint8_t	 entry_type;		/* Entry type. */
	uint8_t	 entry_count;		/* Entry count. */
	uint8_t	 sys_define;		/* System defined. */
	uint8_t	 entry_status;		/* Entry Status. */
	uint32_t handle;		/* System defined handle */
	target_id_t target;
	uint16_t rx_id;
	uint16_t flags;
	uint16_t status;
	uint16_t timeout;		/* 0 = 30 seconds, 0xFFFF = disable */
	uint16_t dseg_count;		/* Data segment count. */
	uint32_t relative_offset;
	uint32_t residual;
	uint16_t reserved_1[3];
	uint16_t scsi_status;
	uint32_t transfer_length;
	uint32_t dseg_0_address;	/* Data segment 0 address. */
	uint32_t dseg_0_length;		/* Data segment 0 length. */
	uint32_t dseg_1_address;	/* Data segment 1 address. */
	uint32_t dseg_1_length;		/* Data segment 1 length. */
	uint32_t dseg_2_address;	/* Data segment 2 address. */
	uint32_t dseg_2_length;		/* Data segment 2 length. */
} __packed;
#define ATIO_PATH_INVALID       0x07
#define ATIO_CANT_PROV_CAP      0x16
#define ATIO_CDB_VALID          0x3D

#define ATIO_EXEC_READ          BIT_1
#define ATIO_EXEC_WRITE         BIT_0
#endif

#ifndef CTIO_A64_TYPE
#define CTIO_A64_TYPE 0x1F
#define CTIO_SUCCESS			0x01
#define CTIO_ABORTED			0x02
#define CTIO_INVALID_RX_ID		0x08
#define CTIO_TIMEOUT			0x0B
#define CTIO_LIP_RESET			0x0E
#define CTIO_TARGET_RESET		0x17
#define CTIO_PORT_UNAVAILABLE		0x28
#define CTIO_PORT_LOGGED_OUT		0x29
#define CTIO_PORT_CONF_CHANGED		0x2A
#define CTIO_SRR_RECEIVED		0x45
#endif

#ifndef CTIO_RET_TYPE
#define CTIO_RET_TYPE	0x17		/* CTIO return entry */
#define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */

struct fcp_hdr {
	uint8_t  r_ctl;
	uint8_t  d_id[3];
	uint8_t  cs_ctl;
	uint8_t  s_id[3];
	uint8_t  type;
	uint8_t  f_ctl[3];
	uint8_t  seq_id;
	uint8_t  df_ctl;
	uint16_t seq_cnt;
	uint16_t ox_id;
	uint16_t rx_id;
	uint32_t parameter;
} __packed;

struct fcp_hdr_le {
	uint8_t  d_id[3];
	uint8_t  r_ctl;
	uint8_t  s_id[3];
	uint8_t  cs_ctl;
	uint8_t  f_ctl[3];
	uint8_t  type;
	uint16_t seq_cnt;
	uint8_t  df_ctl;
	uint8_t  seq_id;
	uint16_t rx_id;
	uint16_t ox_id;
	uint32_t parameter;
} __packed;

#define F_CTL_EXCH_CONTEXT_RESP	BIT_23
#define F_CTL_SEQ_CONTEXT_RESIP	BIT_22
#define F_CTL_LAST_SEQ		BIT_20
#define F_CTL_END_SEQ		BIT_19
#define F_CTL_SEQ_INITIATIVE	BIT_16

#define R_CTL_BASIC_LINK_SERV	0x80
#define R_CTL_B_ACC		0x4
#define R_CTL_B_RJT		0x5

struct atio7_fcp_cmnd {
	uint64_t lun;
	uint8_t  cmnd_ref;
	uint8_t  task_attr:3;
	uint8_t  reserved:5;
	uint8_t  task_mgmt_flags;
#define FCP_CMND_TASK_MGMT_CLEAR_ACA		6
#define FCP_CMND_TASK_MGMT_TARGET_RESET		5
#define FCP_CMND_TASK_MGMT_LU_RESET		4
#define FCP_CMND_TASK_MGMT_CLEAR_TASK_SET	2
#define FCP_CMND_TASK_MGMT_ABORT_TASK_SET	1
	uint8_t  wrdata:1;
	uint8_t  rddata:1;
	uint8_t  add_cdb_len:6;
	uint8_t  cdb[16];
	/*
	 * add_cdb is optional and can absent from struct atio7_fcp_cmnd. Size 4
	 * only to make sizeof(struct atio7_fcp_cmnd) be as expected by
	 * BUILD_BUG_ON in qlt_init().
	 */
	uint8_t  add_cdb[4];
	/* uint32_t data_length; */
} __packed;

/*
 * ISP queue -	Accept Target I/O (ATIO) type entry IOCB structure.
 *		This is sent from the ISP to the target driver.
 */
struct atio_from_isp {
	union {
		struct {
			uint16_t entry_hdr;
			uint8_t  sys_define;   /* System defined. */
			uint8_t  entry_status; /* Entry Status.   */
			uint32_t sys_define_2; /* System defined. */
			target_id_t target;
			uint16_t rx_id;
			uint16_t flags;
			uint16_t status;
			uint8_t  command_ref;
			uint8_t  task_codes;
			uint8_t  task_flags;
			uint8_t  execution_codes;
			uint8_t  cdb[MAX_CMDSZ];
			uint32_t data_length;
			uint16_t lun;
			uint8_t  initiator_port_name[WWN_SIZE]; /* on qla23xx */
			uint16_t reserved_32[6];
			uint16_t ox_id;
		} isp2x;
		struct {
			uint16_t entry_hdr;
			uint8_t  fcp_cmnd_len_low;
			uint8_t  fcp_cmnd_len_high:4;
			uint8_t  attr:4;
			uint32_t exchange_addr;
#define ATIO_EXCHANGE_ADDRESS_UNKNOWN	0xFFFFFFFF
			struct fcp_hdr fcp_hdr;
			struct atio7_fcp_cmnd fcp_cmnd;
		} isp24;
		struct {
			uint8_t  entry_type;	/* Entry type. */
			uint8_t  entry_count;	/* Entry count. */
			uint8_t  data[58];
			uint32_t signature;
#define ATIO_PROCESSED 0xDEADDEAD		/* Signature */
		} raw;
	} u;
} __packed;

#define CTIO_TYPE7 0x12 /* Continue target I/O entry (for 24xx) */

/*
 * ISP queue -	Continue Target I/O (ATIO) type 7 entry (for 24xx) structure.
 *		This structure is sent to the ISP 24xx from the target driver.
 */

struct ctio7_to_24xx {
	uint8_t	 entry_type;		    /* Entry type. */
	uint8_t	 entry_count;		    /* Entry count. */
	uint8_t	 sys_define;		    /* System defined. */
	uint8_t	 entry_status;		    /* Entry Status. */
	uint32_t handle;		    /* System defined handle */
	uint16_t nport_handle;
#define CTIO7_NHANDLE_UNRECOGNIZED	0xFFFF
	uint16_t timeout;
	uint16_t dseg_count;		    /* Data segment count. */
	uint8_t  vp_index;
	uint8_t  add_flags;
	uint8_t  initiator_id[3];
	uint8_t  reserved;
	uint32_t exchange_addr;
	union {
		struct {
			uint16_t reserved1;
			uint16_t flags;
			uint32_t residual;
			uint16_t ox_id;
			uint16_t scsi_status;
			uint32_t relative_offset;
			uint32_t reserved2;
			uint32_t transfer_length;
			uint32_t reserved3;
			/* Data segment 0 address. */
			uint32_t dseg_0_address[2];
			/* Data segment 0 length. */
			uint32_t dseg_0_length;
		} status0;
		struct {
			uint16_t sense_length;
			uint16_t flags;
			uint32_t residual;
			uint16_t ox_id;
			uint16_t scsi_status;
			uint16_t response_len;
			uint16_t reserved;
			uint8_t sense_data[24];
		} status1;
	} u;
} __packed;

/*
 * ISP queue - CTIO type 7 from ISP 24xx to target driver
 * returned entry structure.
 */
struct ctio7_from_24xx {
	uint8_t	 entry_type;		    /* Entry type. */
	uint8_t	 entry_count;		    /* Entry count. */
	uint8_t	 sys_define;		    /* System defined. */
	uint8_t	 entry_status;		    /* Entry Status. */
	uint32_t handle;		    /* System defined handle */
	uint16_t status;
	uint16_t timeout;
	uint16_t dseg_count;		    /* Data segment count. */
	uint8_t  vp_index;
	uint8_t  reserved1[5];
	uint32_t exchange_address;
	uint16_t reserved2;
	uint16_t flags;
	uint32_t residual;
	uint16_t ox_id;
	uint16_t reserved3;
	uint32_t relative_offset;
	uint8_t  reserved4[24];
} __packed;

/* CTIO7 flags values */
#define CTIO7_FLAGS_SEND_STATUS		BIT_15
#define CTIO7_FLAGS_TERMINATE		BIT_14
#define CTIO7_FLAGS_CONFORM_REQ		BIT_13
#define CTIO7_FLAGS_DONT_RET_CTIO	BIT_8
#define CTIO7_FLAGS_STATUS_MODE_0	0
#define CTIO7_FLAGS_STATUS_MODE_1	BIT_6
#define CTIO7_FLAGS_EXPLICIT_CONFORM	BIT_5
#define CTIO7_FLAGS_CONFIRM_SATISF	BIT_4
#define CTIO7_FLAGS_DSD_PTR		BIT_2
#define CTIO7_FLAGS_DATA_IN		BIT_1
#define CTIO7_FLAGS_DATA_OUT		BIT_0

#define ELS_PLOGI			0x3
#define ELS_FLOGI			0x4
#define ELS_LOGO			0x5
#define ELS_PRLI			0x20
#define ELS_PRLO			0x21
#define ELS_TPRLO			0x24
#define ELS_PDISC			0x50
#define ELS_ADISC			0x52

/*
 * ISP queue - ABTS received/response entries structure definition for 24xx.
 */
#define ABTS_RECV_24XX		0x54 /* ABTS received (for 24xx) */
#define ABTS_RESP_24XX		0x55 /* ABTS responce (for 24xx) */

/*
 * ISP queue -	ABTS received IOCB entry structure definition for 24xx.
 *		The ABTS BLS received from the wire is sent to the
 *		target driver by the ISP 24xx.
 *		The IOCB is placed on the response queue.
 */
struct abts_recv_from_24xx {
	uint8_t	 entry_type;		    /* Entry type. */
	uint8_t	 entry_count;		    /* Entry count. */
	uint8_t	 sys_define;		    /* System defined. */
	uint8_t	 entry_status;		    /* Entry Status. */
	uint8_t  reserved_1[6];
	uint16_t nport_handle;
	uint8_t  reserved_2[2];
	uint8_t  vp_index;
	uint8_t  reserved_3:4;
	uint8_t  sof_type:4;
	uint32_t exchange_address;
	struct fcp_hdr_le fcp_hdr_le;
	uint8_t  reserved_4[16];
	uint32_t exchange_addr_to_abort;
} __packed;

#define ABTS_PARAM_ABORT_SEQ		BIT_0

struct ba_acc_le {
	uint16_t reserved;
	uint8_t  seq_id_last;
	uint8_t  seq_id_valid;
#define SEQ_ID_VALID	0x80
#define SEQ_ID_INVALID	0x00
	uint16_t rx_id;
	uint16_t ox_id;
	uint16_t high_seq_cnt;
	uint16_t low_seq_cnt;
} __packed;

struct ba_rjt_le {
	uint8_t vendor_uniq;
	uint8_t reason_expl;
	uint8_t reason_code;
#define BA_RJT_REASON_CODE_INVALID_COMMAND	0x1
#define BA_RJT_REASON_CODE_UNABLE_TO_PERFORM	0x9
	uint8_t reserved;
} __packed;

/*
 * ISP queue -	ABTS Response IOCB entry structure definition for 24xx.
 *		The ABTS response to the ABTS received is sent by the
 *		target driver to the ISP 24xx.
 *		The IOCB is placed on the request queue.
 */
struct abts_resp_to_24xx {
	uint8_t	 entry_type;		    /* Entry type. */
	uint8_t	 entry_count;		    /* Entry count. */
	uint8_t	 sys_define;		    /* System defined. */
	uint8_t	 entry_status;		    /* Entry Status. */
	uint32_t handle;
	uint16_t reserved_1;
	uint16_t nport_handle;
	uint16_t control_flags;
#define ABTS_CONTR_FLG_TERM_EXCHG	BIT_0
	uint8_t  vp_index;
	uint8_t  reserved_3:4;
	uint8_t  sof_type:4;
	uint32_t exchange_address;
	struct fcp_hdr_le fcp_hdr_le;
	union {
		struct ba_acc_le ba_acct;
		struct ba_rjt_le ba_rjt;
	} __packed payload;
	uint32_t reserved_4;
	uint32_t exchange_addr_to_abort;
} __packed;

/*
 * ISP queue -	ABTS Response IOCB from ISP24xx Firmware entry structure.
 *		The ABTS response with completion status to the ABTS response
 *		(sent by the target driver to the ISP 24xx) is sent by the
 *		ISP24xx firmware to the target driver.
 *		The IOCB is placed on the response queue.
 */
struct abts_resp_from_24xx_fw {
	uint8_t	 entry_type;		    /* Entry type. */
	uint8_t	 entry_count;		    /* Entry count. */
	uint8_t	 sys_define;		    /* System defined. */
	uint8_t	 entry_status;		    /* Entry Status. */
	uint32_t handle;
	uint16_t compl_status;
#define ABTS_RESP_COMPL_SUCCESS		0
#define ABTS_RESP_COMPL_SUBCODE_ERROR	0x31
	uint16_t nport_handle;
	uint16_t reserved_1;
	uint8_t  reserved_2;
	uint8_t  reserved_3:4;
	uint8_t  sof_type:4;
	uint32_t exchange_address;
	struct fcp_hdr_le fcp_hdr_le;
	uint8_t reserved_4[8];
	uint32_t error_subcode1;
#define ABTS_RESP_SUBCODE_ERR_ABORTED_EXCH_NOT_TERM	0x1E
	uint32_t error_subcode2;
	uint32_t exchange_addr_to_abort;
} __packed;

/********************************************************************\
 * Type Definitions used by initiator & target halves
\********************************************************************/

struct qla_tgt_mgmt_cmd;
struct qla_tgt_sess;

/*
 * This structure provides a template of function calls that the
 * target driver (from within qla_target.c) can issue to the
 * target module (tcm_qla2xxx).
 */
struct qla_tgt_func_tmpl {

	int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *,
			unsigned char *, uint32_t, int, int, int);
	void (*handle_data)(struct qla_tgt_cmd *);
	int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint8_t,
			uint32_t);
	void (*free_cmd)(struct qla_tgt_cmd *);
	void (*free_mcmd)(struct qla_tgt_mgmt_cmd *);
	void (*free_session)(struct qla_tgt_sess *);

	int (*check_initiator_node_acl)(struct scsi_qla_host *, unsigned char *,
					void *, uint8_t *, uint16_t);
	void (*update_sess)(struct qla_tgt_sess *, port_id_t, uint16_t, bool);
	struct qla_tgt_sess *(*find_sess_by_loop_id)(struct scsi_qla_host *,
						const uint16_t);
	struct qla_tgt_sess *(*find_sess_by_s_id)(struct scsi_qla_host *,
						const uint8_t *);
	void (*clear_nacl_from_fcport_map)(struct qla_tgt_sess *);
	void (*put_sess)(struct qla_tgt_sess *);
	void (*shutdown_sess)(struct qla_tgt_sess *);
};

int qla2x00_wait_for_hba_online(struct scsi_qla_host *);

#include <target/target_core_base.h>

#define QLA_TGT_TIMEOUT			10	/* in seconds */

#define QLA_TGT_MAX_HW_PENDING_TIME	60 /* in seconds */

/* Immediate notify status constants */
#define IMM_NTFY_LIP_RESET          0x000E
#define IMM_NTFY_LIP_LINK_REINIT    0x000F
#define IMM_NTFY_IOCB_OVERFLOW      0x0016
#define IMM_NTFY_ABORT_TASK         0x0020
#define IMM_NTFY_PORT_LOGOUT        0x0029
#define IMM_NTFY_PORT_CONFIG        0x002A
#define IMM_NTFY_GLBL_TPRLO         0x002D
#define IMM_NTFY_GLBL_LOGO          0x002E
#define IMM_NTFY_RESOURCE           0x0034
#define IMM_NTFY_MSG_RX             0x0036
#define IMM_NTFY_SRR                0x0045
#define IMM_NTFY_ELS                0x0046

/* Immediate notify task flags */
#define IMM_NTFY_TASK_MGMT_SHIFT    8

#define QLA_TGT_CLEAR_ACA               0x40
#define QLA_TGT_TARGET_RESET            0x20
#define QLA_TGT_LUN_RESET               0x10
#define QLA_TGT_CLEAR_TS                0x04
#define QLA_TGT_ABORT_TS                0x02
#define QLA_TGT_ABORT_ALL_SESS          0xFFFF
#define QLA_TGT_ABORT_ALL               0xFFFE
#define QLA_TGT_NEXUS_LOSS_SESS         0xFFFD
#define QLA_TGT_NEXUS_LOSS              0xFFFC

/* Notify Acknowledge flags */
#define NOTIFY_ACK_RES_COUNT        BIT_8
#define NOTIFY_ACK_CLEAR_LIP_RESET  BIT_5
#define NOTIFY_ACK_TM_RESP_CODE_VALID BIT_4

/* Command's states */
#define QLA_TGT_STATE_NEW		0 /* New command + target processing */
#define QLA_TGT_STATE_NEED_DATA		1 /* target needs data to continue */
#define QLA_TGT_STATE_DATA_IN		2 /* Data arrived + target processing */
#define QLA_TGT_STATE_PROCESSED		3 /* target done processing */
#define QLA_TGT_STATE_ABORTED		4 /* Command aborted */

/* Special handles */
#define QLA_TGT_NULL_HANDLE	0
#define QLA_TGT_SKIP_HANDLE	(0xFFFFFFFF & ~CTIO_COMPLETION_HANDLE_MARK)

/* ATIO task_codes field */
#define ATIO_SIMPLE_QUEUE           0
#define ATIO_HEAD_OF_QUEUE          1
#define ATIO_ORDERED_QUEUE          2
#define ATIO_ACA_QUEUE              4
#define ATIO_UNTAGGED               5

/* TM failed response codes, see FCP (9.4.11 FCP_RSP_INFO) */
#define	FC_TM_SUCCESS               0
#define	FC_TM_BAD_FCP_DATA          1
#define	FC_TM_BAD_CMD               2
#define	FC_TM_FCP_DATA_MISMATCH     3
#define	FC_TM_REJECT                4
#define FC_TM_FAILED                5

/*
 * Error code of qlt_pre_xmit_response() meaning that cmd's exchange was
 * terminated, so no more actions is needed and success should be returned
 * to target.
 */
#define QLA_TGT_PRE_XMIT_RESP_CMD_ABORTED	0x1717

#if (BITS_PER_LONG > 32) || defined(CONFIG_HIGHMEM64G)
#define pci_dma_lo32(a) (a & 0xffffffff)
#define pci_dma_hi32(a) ((((a) >> 16)>>16) & 0xffffffff)
#else
#define pci_dma_lo32(a) (a & 0xffffffff)
#define pci_dma_hi32(a) 0
#endif

#define QLA_TGT_SENSE_VALID(sense)  ((sense != NULL) && \
				(((const uint8_t *)(sense))[0] & 0x70) == 0x70)

struct qla_port_24xx_data {
	uint8_t port_name[WWN_SIZE];
	uint16_t loop_id;
	uint16_t reserved;
};

struct qla_tgt {
	struct scsi_qla_host *vha;
	struct qla_hw_data *ha;

	/*
	 * To sync between IRQ handlers and qlt_target_release(). Needed,
	 * because req_pkt() can drop/reaquire HW lock inside. Protected by
	 * HW lock.
	 */
	int irq_cmd_count;

	int datasegs_per_cmd, datasegs_per_cont, sg_tablesize;

	/* Target's flags, serialized by pha->hardware_lock */
	unsigned int tgt_enable_64bit_addr:1; /* 64-bits PCI addr enabled */
	unsigned int link_reinit_iocb_pending:1;

	/*
	 * Protected by tgt_mutex AND hardware_lock for writing and tgt_mutex
	 * OR hardware_lock for reading.
	 */
	int tgt_stop; /* the target mode driver is being stopped */
	int tgt_stopped; /* the target mode driver has been stopped */

	/* Count of sessions refering qla_tgt. Protected by hardware_lock. */
	int sess_count;

	/* Protected by hardware_lock. Addition also protected by tgt_mutex. */
	struct list_head sess_list;

	/* Protected by hardware_lock */
	struct list_head del_sess_list;
	struct delayed_work sess_del_work;

	spinlock_t sess_work_lock;
	struct list_head sess_works_list;
	struct work_struct sess_work;

	struct imm_ntfy_from_isp link_reinit_iocb;
	wait_queue_head_t waitQ;
	int notify_ack_expected;
	int abts_resp_expected;
	int modify_lun_expected;

	int ctio_srr_id;
	int imm_srr_id;
	spinlock_t srr_lock;
	struct list_head srr_ctio_list;
	struct list_head srr_imm_list;
	struct work_struct srr_work;

	atomic_t tgt_global_resets_count;

	struct list_head tgt_list_entry;
};

/*
 * Equivilant to IT Nexus (Initiator-Target)
 */
struct qla_tgt_sess {
	uint16_t loop_id;
	port_id_t s_id;

	unsigned int conf_compl_supported:1;
	unsigned int deleted:1;
	unsigned int local:1;

	struct se_session *se_sess;
	struct scsi_qla_host *vha;
	struct qla_tgt *tgt;

	struct list_head sess_list_entry;
	unsigned long expires;
	struct list_head del_list_entry;

	uint8_t port_name[WWN_SIZE];
	struct work_struct free_work;
};

struct qla_tgt_cmd {
	struct qla_tgt_sess *sess;
	int state;
	struct se_cmd se_cmd;
	struct work_struct free_work;
	struct work_struct work;
	/* Sense buffer that will be mapped into outgoing status */
	unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER];

	/* to save extra sess dereferences */
	unsigned int conf_compl_supported:1;
	unsigned int sg_mapped:1;
	unsigned int free_sg:1;
	unsigned int aborted:1; /* Needed in case of SRR */
	unsigned int write_data_transferred:1;

	struct scatterlist *sg;	/* cmd data buffer SG vector */
	int sg_cnt;		/* SG segments count */
	int bufflen;		/* cmd buffer length */
	int offset;
	uint32_t tag;
	uint32_t unpacked_lun;
	enum dma_data_direction dma_data_direction;

	uint16_t loop_id;	/* to save extra sess dereferences */
	struct qla_tgt *tgt;	/* to save extra sess dereferences */
	struct scsi_qla_host *vha;
	struct list_head cmd_list;

	struct atio_from_isp atio;
};

struct qla_tgt_sess_work_param {
	struct list_head sess_works_list_entry;

#define QLA_TGT_SESS_WORK_ABORT	1
#define QLA_TGT_SESS_WORK_TM	2
	int type;

	union {
		struct abts_recv_from_24xx abts;
		struct imm_ntfy_from_isp tm_iocb;
		struct atio_from_isp tm_iocb2;
	};
};

struct qla_tgt_mgmt_cmd {
	uint8_t tmr_func;
	uint8_t fc_tm_rsp;
	struct qla_tgt_sess *sess;
	struct se_cmd se_cmd;
	struct work_struct free_work;
	unsigned int flags;
#define QLA24XX_MGMT_SEND_NACK	1
	union {
		struct atio_from_isp atio;
		struct imm_ntfy_from_isp imm_ntfy;
		struct abts_recv_from_24xx abts;
	} __packed orig_iocb;
};

struct qla_tgt_prm {
	struct qla_tgt_cmd *cmd;
	struct qla_tgt *tgt;
	void *pkt;
	struct scatterlist *sg;	/* cmd data buffer SG vector */
	int seg_cnt;
	int req_cnt;
	uint16_t rq_result;
	uint16_t scsi_status;
	unsigned char *sense_buffer;
	int sense_buffer_len;
	int residual;
	int add_status_pkt;
};

struct qla_tgt_srr_imm {
	struct list_head srr_list_entry;
	int srr_id;
	struct imm_ntfy_from_isp imm_ntfy;
};

struct qla_tgt_srr_ctio {
	struct list_head srr_list_entry;
	int srr_id;
	struct qla_tgt_cmd *cmd;
};

#define QLA_TGT_XMIT_DATA		1
#define QLA_TGT_XMIT_STATUS		2
#define QLA_TGT_XMIT_ALL		(QLA_TGT_XMIT_STATUS|QLA_TGT_XMIT_DATA)

extern struct qla_tgt_data qla_target;
/*
 * Internal function prototypes
 */
void qlt_disable_vha(struct scsi_qla_host *);

/*
 * Function prototypes for qla_target.c logic used by qla2xxx LLD code.
 */
extern int qlt_add_target(struct qla_hw_data *, struct scsi_qla_host *);
extern int qlt_remove_target(struct qla_hw_data *, struct scsi_qla_host *);
extern int qlt_lport_register(struct qla_tgt_func_tmpl *, u64,
			int (*callback)(struct scsi_qla_host *), void *);
extern void qlt_lport_deregister(struct scsi_qla_host *);
extern void qlt_unreg_sess(struct qla_tgt_sess *);
extern void qlt_fc_port_added(struct scsi_qla_host *, fc_port_t *);
extern void qlt_fc_port_deleted(struct scsi_qla_host *, fc_port_t *);
extern void qlt_set_mode(struct scsi_qla_host *ha);
extern void qlt_clear_mode(struct scsi_qla_host *ha);
extern int __init qlt_init(void);
extern void qlt_exit(void);
extern void qlt_update_vp_map(struct scsi_qla_host *, int);

/*
 * This macro is used during early initializations when host->active_mode
 * is not set. Right now, ha value is ignored.
 */
#define QLA_TGT_MODE_ENABLED() (ql2x_ini_mode != QLA2XXX_INI_MODE_ENABLED)
extern int ql2x_ini_mode;

static inline bool qla_tgt_mode_enabled(struct scsi_qla_host *ha)
{
	return ha->host->active_mode & MODE_TARGET;
}

static inline bool qla_ini_mode_enabled(struct scsi_qla_host *ha)
{
	return ha->host->active_mode & MODE_INITIATOR;
}

static inline void qla_reverse_ini_mode(struct scsi_qla_host *ha)
{
	if (ha->host->active_mode & MODE_INITIATOR)
		ha->host->active_mode &= ~MODE_INITIATOR;
	else
		ha->host->active_mode |= MODE_INITIATOR;
}

/*
 * Exported symbols from qla_target.c LLD logic used by qla2xxx code..
 */
extern void qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *,
	struct atio_from_isp *);
extern void qlt_response_pkt_all_vps(struct scsi_qla_host *, response_t *);
extern int qlt_rdy_to_xfer(struct qla_tgt_cmd *);
extern int qlt_xmit_response(struct qla_tgt_cmd *, int, uint8_t);
extern void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *);
extern void qlt_free_mcmd(struct qla_tgt_mgmt_cmd *);
extern void qlt_free_cmd(struct qla_tgt_cmd *cmd);
extern void qlt_async_event(uint16_t, struct scsi_qla_host *, uint16_t *);
extern void qlt_enable_vha(struct scsi_qla_host *);
extern void qlt_vport_create(struct scsi_qla_host *, struct qla_hw_data *);
extern void qlt_rff_id(struct scsi_qla_host *, struct ct_sns_req *);
extern void qlt_init_atio_q_entries(struct scsi_qla_host *);
extern void qlt_24xx_process_atio_queue(struct scsi_qla_host *);
extern void qlt_24xx_config_rings(struct scsi_qla_host *);
extern void qlt_24xx_config_nvram_stage1(struct scsi_qla_host *,
	struct nvram_24xx *);
extern void qlt_24xx_config_nvram_stage2(struct scsi_qla_host *,
	struct init_cb_24xx *);
extern void qlt_81xx_config_nvram_stage2(struct scsi_qla_host *,
	struct init_cb_81xx *);
extern void qlt_81xx_config_nvram_stage1(struct scsi_qla_host *,
	struct nvram_81xx *);
extern int qlt_24xx_process_response_error(struct scsi_qla_host *,
	struct sts_entry_24xx *);
extern void qlt_modify_vp_config(struct scsi_qla_host *,
	struct vp_config_entry_24xx *);
extern void qlt_probe_one_stage1(struct scsi_qla_host *, struct qla_hw_data *);
extern int qlt_mem_alloc(struct qla_hw_data *);
extern void qlt_mem_free(struct qla_hw_data *);
extern void qlt_stop_phase1(struct qla_tgt *);
extern void qlt_stop_phase2(struct qla_tgt *);
extern irqreturn_t qla83xx_msix_atio_q(int, void *);
extern void qlt_83xx_iospace_config(struct qla_hw_data *);

#endif /* __QLA_TARGET_H */


text:
[![Build Status](https://secure.travis-ci.org/keyvanakbary/slugifier.svg?branch=master)](http://travis-ci.org/keyvanakbary/slugifier)

A full-featured, simple, clean and pure functional implementation for creating [slugs](http://en.wikipedia.org/wiki/Semantic_URL#Slug). No third party libraries or extensions needed.

## Installation

``` bash
composer require keyvanakbary/slugifier
```

## Usage

```php
use slugifier as s;

s\slugify('JúST å fëw wørds'); // just-a-few-words

s\slugify('Αυτή είναι μια δοκιμή'); // ayti-einai-mia-dokimi

s\slugify('Wikipedia style', '_'); // wikipedia_style
```

### Modifiers

Sometimes the default character map is not accurate enough. Slugifier supports custom *modifiers*

```php
s\slugify('Pingüino', '-', ['ü' => 'u']); // pinguino
```

Some [language iso code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) modifiers are supported

```php
s\slugify('Estaĵo', '-', s\MOD['eo']); // estajxo

s\slugify('Örnektir', '-', s\MOD['tr']); // ornektir
```

redpajama_set_name: RedPajamaGithub


text:
package org.popper.fw.impl;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.popper.fw.annotations.DefaultConstructor;
import org.popper.fw.annotations.ElementFactory;
import org.popper.fw.annotations.Type;
import org.popper.fw.interfaces.IClassResolver;
import org.popper.fw.interfaces.IElementFactory;
import org.popper.fw.interfaces.IPoFactory;

/**
 * Class instantiating the framework and handling application start
 *
 * @author michael_bulla
 *
 */
public abstract class AbstractPopperContext implements IClassResolver {
	private IElementFactory defaultElementFactory;

	private IClassResolver classResolver;

	public abstract IPoFactory getFactory();

	public IElementFactory getDefaultElementFactory() {
		return defaultElementFactory;
	}

	/**
	 * Set the {@link IElementFactory} to be used by default to instantiate default elements
	 * @param defaultElementFactory
	 */
	public void setDefaultElementFactory(IElementFactory defaultElementFactory) {
		this.defaultElementFactory = defaultElementFactory;
	}

	public IClassResolver getClassResolver() {
		return classResolver;
	}

	/**
	 * Add a {@link IClassResolver} to the framework to tell popper which classes can be
	 * used to instantiate page objects and elements
	 */
	public void setClassResolver(IClassResolver classResolver) {
		this.classResolver = classResolver;
	}

	public Class<?> getImplementingClassFor(Method method, Class<?> clazz) {
		Type typeAnnoation = method.getAnnotation(Type.class);
		if (typeAnnoation != null) {
			return typeAnnoation.value();
		}

		ElementFactory elementFactory = method.getDeclaringClass().getAnnotation(ElementFactory.class);
		if (elementFactory != null) {
			try {
				return elementFactory.value().newInstance().getImplClassForElement(clazz);
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}

		if (defaultElementFactory != null) {
			Class<?> ret = defaultElementFactory.getImplClassForElement(clazz);
			if (ret != null) {
				return ret;
			}
		}

		if (!clazz.isInterface() && !Modifier.isAbstract(clazz.getModifiers())) {
			return clazz;
		}

		return null;
	}

	@Override
	public final <T> T resolveClass(Class<T> clazz) {
		T ret = resolveStaticClass(clazz);
		if (ret != null) {
			return ret;
		} else if (classResolver != null) {
			return classResolver.resolveClass(clazz);
		}

		return null;
	}

	protected abstract <T> T resolveStaticClass(Class<T> clazz);

	public final<T> T instantiateObject(Class<T> type, Map<Class<?>, Object> tempResolver) {
		return new ObjectInstantiator().instantiateObject(type, this, tempResolver);
	}

	public final<T> T instantiateObject(Class<T> type) {
		return instantiateObject(type, null);
	}

	public static String replaceVariables(String input, Object[] parameters) {
		if (parameters != null) {
			for (int i = 0; i < parameters.length; i++) {
				String replace = "";
				if (parameters[i] != null) {
					replace = parameters[i].toString();
				}
				input = input.replace("{" + i + "}", replace);
			}
		}
		return input;
	}

	public static class ObjectInstantiator {
		private static final Logger log = LogManager.getLogger(ObjectInstantiator.class);

		public final<T> T instantiateObject(Class<T> type, IClassResolver classResolver, Map<Class<?>, Object> tempResolver) {
			log.debug("Instantiating Object of class " + type.getName());
			Constructor<T> constructor = getConstructorToUse(type);
			constructor.setAccessible(true);
			Object[] parameters = getParameters(type, classResolver, tempResolver);

			try {
				T ret = constructor.newInstance(parameters);
				classResolver.postProcessInstantiatedOIbject(ret);
				return ret;
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}

		public<T> Object[] getParameters(Class<T> type, IClassResolver classResolver, Map<Class<?>, Object> tempResolver) {
			if (tempResolver == null) {
				tempResolver = new HashMap<Class<?>, Object>();
			}
			Class<?>[] parameterTypes = getConstructorDefinition(type);
			Object[] parameters = new Object[parameterTypes.length];
			for (int i = 0; i < parameterTypes.length; i++) {
				Object o = tempResolver.get(parameterTypes[i]);

				if (o == null) {
					o = classResolver.resolveClass(parameterTypes[i]);
				}

				if (o == null) {
					throw new RuntimeException("There is no Resolver defined to resolve class " + parameterTypes[i].getName() + " when instantiating object of type " + type.getName());
				}
				parameters[i] = o;
			}

			return parameters;

		}

		public Class<?>[] getConstructorDefinition(Class<?> clazz) {
			return getConstructorToUse(clazz).getParameterTypes();
		}

		@SuppressWarnings("unchecked")
		private static<T> Constructor<T> getConstructorToUse(Class<T> type) {
			Constructor<T>[] constructors = (Constructor<T>[]) type.getDeclaredConstructors();
			if (constructors.length == 1) {
				constructors[0].setAccessible(true);
				return constructors[0];
			}

			Constructor<T> ret = null;
			for (Constructor<T> constructor : constructors) {
				DefaultConstructor ec = constructor.getAnnotation(DefaultConstructor.class);
				if (ec != null) {
					if (ret != null) {
						throw new RuntimeException("There are at least 2 Constructors annotated with @ElementConstructor for class " + type.getName() + ": " + ret + ", " + constructor + ". There is only one such Annotation allowed.");
					}
					ret = constructor;
				}
			}

			if (ret == null) {
				throw new RuntimeException("There could be no Constructor determindened to instantiate " + type.getName() + ". Provide only one constructor or annotate the none to be used with @ElementConstructor.");
			}
			ret.setAccessible(true);
			return ret;
		}
	}
}


text:
"use strict";

function WS4Redis(options) {
  var ws;
  var timer;
  var attempts = 1;
  var heartbeatInterval = null;
  var missedHeartbeats = 0;

  function connect(uri) {
    console.log("Connecting to " + uri + " ...");
    ws = new WebSocket(uri);
    ws.onopen = onOpen;
    ws.onmessage = onMessage;
    ws.onerror = onError;
    ws.onclose = onClose;
    timer = null;
  }

  function sendHeartbeat() {
    missedHeartbeats += 1;
    if(missedHeartbeats > 3) {
      clearInterval(heartbeatInterval);
      heartbeatInterval = null;
      console.warn("Closing connection. Reason: Too many missed heartbeats.");
      ws.close();
    }
    ws.send(options.heartbeat);
  }

  function onOpen() {
    console.log('Connected!');
    // new connection, reset attemps counter
    attempts = 1;
    if(options.heartbeat && heartbeatInterval === null) {
      missedHeartbeats = 0;
      heartbeatInterval = setInterval(sendHeartbeat, 5000);
    }
    return options.onOpen();
  }

  function onClose() {
    console.log("Connection closed!");
    if(!timer) {
      if(attempts > 5) {
        return options.onClose();
      }
      else {
        // try to reconnect
        var interval = generateInteval(attempts);
        timer = setTimeout(function() {
          attempts += 1;
          connect(ws.url);
        }, interval);
      }
    }
  }

  function onError(evt) {
    console.error("Websocket connection is broken!");
    return options.onError(evt);
  }

  function onMessage(evt) {
    if(evt.data === options.heartbeat) {
      // reset the counter for missed heartbeats
      missedHeartbeats = 0;
    }
    else {
      return options.onMessage(JSON.parse(evt.data));
    }
  }

  // this code is borrowed from http://blog.johnryding.com/post/78544969349/
  //
  // Generate an interval that is randomly between 0 and 2^k - 1, where k is
  // the number of connection attmpts, with a maximum interval of 30 seconds,
  // so it starts at 0 - 1 seconds and maxes out at 0 - 30 seconds
  function generateInteval (k) {
    var maxInterval = (Math.pow(2, k) - 1) * 1000;

    // If the generated interval is more than 30 seconds, truncate it down to 30 seconds.
    if(maxInterval > 30 * 1000) {
      maxInterval = 30 * 1000;
    }

    // generate the interval to a random number between 0 and the maxInterval determined from above
    return Math.random() * maxInterval;
  }

  connect(options.uri);

  this.send_message = function(message) {
    ws.send(message);
  };

  this.close = function() {
    // Avoid reconnect
    ws.onclose = function() {};
    // Ignore errors cause of Chrome bad implementation...
    ws.onerror = function() {};
    if(timer) {
      clearInterval(timer);
    }
    if(heartbeatInterval) {
      clearInterval(heartbeatInterval);
    }
    ws.close();
  };
}


text:
namespace Alphaleonis.Win32.Network
{
   /// The <see cref="ShareInfo"/> information level.
   public enum ShareInfoLevel
   {
      /// No specific information level used.
      None = 0,

      /// Contains information about the shared resource, including the name and type of the resource, and a comment associated with the resource.
      Info1 = 1,

      /// Contains information about the shared resource, including the name, type, and permissions of the resource, comments associated with the resource,
      /// the maximum number of concurrent connections, the number of current connections, the local path for the resource, and a password for the current connection.
      ///
      Info2 = 2,

      /// Contains information about the shared resource, including the server name, name of the resource, type, and permissions,
      /// the number of connections, and other pertinent information.
      ///
      Info503 = 503,

      /// Contains information about the shared resource.
      Info1005 = 1005,
   }
}


text:
package org.bgp4j.netty.protocol;

import org.bgp4j.netty.BGPv4Constants;

/**
 * @author Rainer Bieniek (Rainer.Bieniek@web.de)
 *
 */
public class HoldTimerExpiredNotificationPacket extends NotificationPacket {

	/**
	 * @param errorCode
	 * @param errorSubcode
	 */
	public HoldTimerExpiredNotificationPacket() {
		super(BGPv4Constants.BGP_ERROR_CODE_HOLD_TIMER_EXPIRED, 0);
	}

}


text:
using UnityEngine;
using System.Collections;

/// <summary>
/// 牌类
/// </summary>
public class Card
{
    private readonly int cardId;
    private readonly Weight weight;
    private readonly Suits color;

    public Card(int id, Weight weight, Suits color)
    {
        cardId = id;
        this.weight = weight;
        this.color = color;
    }

    /// <summary>
    /// 返回牌Id
    /// </summary>
    public int ID
    {
        get { return cardId; }
    }

    /// <summary>
    /// 返回权值
    /// </summary>
    public Weight GetCardWeight
    {
        get { return weight; }
    }

    /// <summary>
    /// 返回花色
    /// </summary>
    public Suits GetCardSuit
    {
        get { return color; }
    }
}


text:
package com.normation.ldap.sdk

import com.unboundid.ldap.sdk.{RDN,DN,Modification}
import com.unboundid.ldif.LDIFRecord
import com.normation.ldap.ldif.{ToLDIFString,ToLDIFRecords}
import scala.collection.mutable.{Buffer, Map => MutMap, HashMap, ObservableMap, Subscriber, Publisher}
import scala.collection.script._
import net.liftweb.common._
import com.normation.exceptions.TechnicalException

import LDAPTree._
/*
 * An LDAP tree of entries.
 * It's composed of a root entry and
 * children.
 * Each children is itself a tree.
 * When a child is added to a tree, the parent DN
 * of the root's child is set to the dn of the
 * tree's root.
 */
trait LDAPTree extends Tree[LDAPEntry] with ToLDIFRecords with ToLDIFString  {
  selfTree =>
  lazy val parentDn = root.parentDn

  //validation on children
  private var _childrenValidation = new Subscriber[Message[(RDN,LDAPTree)],ObservableMap[RDN,LDAPTree]]() {
    override def notify(pub: ObservableMap[RDN,LDAPTree],event: Message[(RDN, LDAPTree)]): Unit = {
      event match {
        case Update(loc,(rdn,tree)) =>
          require(root.optDn == tree.root.parentDn,
            "Bad child/parent DN : try to add children %s to entry %s".
              format(tree.root.dn,selfTree.root.dn))
          require(Some(rdn) == tree.root.rdn)
        case _ => //nothing
      }
    }
  }

  var _children = new HashMap[RDN,LDAPTree]() /*with UpdateChildTree*/ with ObservableMap[RDN,LDAPTree]
  // { override lazy val parentDn = selfTree.root.parentDn }

  _children.subscribe(_childrenValidation)

  override def children() = Map() ++ _children

  def addChild(child:LDAPTree) : Unit = {
    child.root.rdn match {
      case Some(r) =>
        _children += ((r,child))
        () // unit is expected
      case None => {
        throw new TechnicalException("Try to add a child Tree but the RDN of the root of this child is not defined. Parent: %s , child root: %s".
            format(root.dn, child.root))
      }
    }
  }

  def addChild(child:LDAPEntry) : Unit = addChild(LDAPTree(child))

  def addChildren(children:Seq[LDAPTree]) : Unit = children.foreach { t => addChild(t) }
  def setChildren(children:Seq[LDAPTree]) : Unit = {
    _children.clear
    children.foreach { t => addChild(t) }
  }
  def deleteChildren(rdns:Seq[RDN]) = rdns.foreach { r => _children -= r }

  override def addChild(rdn:RDN, child:Tree[LDAPEntry]) : Unit = {
    addChild(LDAPTree(child))
  }

  override def toLDIFRecords() : Seq[LDIFRecord] = {
    Seq(root.toLDIFRecord) ++ _children.valuesIterator.toSeq.flatMap( _.toLDIFRecords)
  }

  override def toString() = "{%s, %s}".format(root.dn.toString,
      {
        if(_children.size > 0) "children:{%s}".format(_children.map{ case(k,v) => "%s -> %s".format(k.toString,v.toString) } )
        else "no child"
      })

  //not sure it's a really good idea. Hopefully, we won't mix LDAPTrees and LDAPEntries in HashSet...
  override def hashCode() = root.hashCode
  override def equals(that:Any) : Boolean = that match {
    case t:LDAPTree =>
      root == t.root &&
      _children.size == t._children.size &&
      _children.iterator.forall(e => e._2 == t._children(e._1))
    case _ => false
  }

  /*
   * Set opt on LDAPTree is forward to tree's root
   */
  def setOpt[A](a:Option[A], attributeName:String, f:A => String) : Unit =
     root.setOpt(a, attributeName, f)
}

//trait UpdateChildTree extends MutMap[RDN,LDAPTree] {
//  def parentDn : Option[DN]
//  abstract override def += (kv: (RDN,LDAPTree)): this.type = {
//    val (key, tree) = kv
//    if(tree.parentDn == this.parentDn) super.+=(kv)
//    else super.+=((key, LDAPTree(tree,this.parentDn)))
//  }
//}

object LDAPTree {
  //loggin
  val logger = org.slf4j.LoggerFactory.getLogger(classOf[LDAPTree])

  def apply(r:LDAPEntry,c:Traversable[(RDN,LDAPTree)]) : LDAPTree = new LDAPTree {
    require(null != r, "root of a tree can't be null")
    require(null != c, "children map of a tree can't be null")

    val root = r
    c foreach { x => _children += x }
  }

  def apply(r:LDAPEntry) : LDAPTree = apply(r, Map.empty[RDN,LDAPTree])

  /**
   * Copy an LDAPTree changing its parent dn
   *
   */
  def move(tree:LDAPTree, newRdn:Option[RDN] = None,newParentDn:Option[DN] = None) : LDAPTree = {
    val rdn = newRdn.orElse(tree.root.rdn)
    val parentDn = newParentDn.orElse(tree.root.parentDn)
    val newRoot = LDAPEntry(rdn,parentDn,tree.root.attributes.toSeq:_*)
    apply(newRoot,tree._children.map{ kv => (kv._1,LDAPTree.move(kv._2, newParentDn = newRoot.optDn))})
  }

  /*
   * copy children reference without any verification
   * from 'from' to 'to'
   */
  def overrideChildren(from:LDAPTree, to:LDAPTree) : Unit = {
    to._children = from._children
    to._children.subscribe(to._childrenValidation)
  }

  //transtype Tree[LDAPEntry] => LDAPTree
  def apply(tree:Tree[LDAPEntry]) : LDAPTree = apply(tree.root, tree.children.map( e => (e._1,apply(e._2))))

  import scala.collection.JavaConversions._

  /*
   * Build an LDAP tree from a list of entries.
   * If the list is empty, return None.
   * All entries in the list safe one (the one that will become the root of the tree)
   * must have a direct parent in other entries.
   */
  def apply(entries:Iterable[LDAPEntry]) : Box[LDAPTree] = {
    if(null == entries || entries.isEmpty) Empty
    //verify that there is no duplicates
    else if(entries.map(_.dn).toSet.size != entries.size) {
      Failure("Some entries have the same dn, what is forbiden: %s".format({val s = entries.map(_.dn).toSet; entries.map(_.dn).filter(x => ! s.contains(x))}))
    } else {
      val used = Buffer[DN]()
      /*
       * the iterable must be sorted on dn and only descendants of root.root.dn
       * - add the direct children of root
       * - return root with its children and not used entries
       */
      def recBuild(root:LDAPTree, possible:Seq[LDAPEntry]) : LDAPTree = {
        val directChildren = possible.filter(e => root.root.dn == e.dn.getParent)
        for(child <- directChildren) {
          used += child.dn
          root.addChild(recBuild(LDAPTree(child), possible.filter(e => child.dn.isAncestorOf(e.dn,false)) ))
        }
        root
      }

      val sorted = entries.toSeq.sortWith((x,y) => x.dn.compareTo( y.dn) < 0)
      val rootEntry = sorted.head
      val root = recBuild(LDAPTree(rootEntry), sorted.filter(e => rootEntry.dn.isAncestorOf(e.dn,false)))

      if(used.size < entries.size-1) {
        Failure("Some entries have no parents: %s".format(entries.map(_.dn).filter(x => !used.contains(x))))
      } else Full(root)
    }
  }
  /*
   * Compare two LDAP tree and return the list of modification to
   * apply to "old" to merge with "target".
   * The two roots HAVE to have the same DN, or None is returned.
   * The comparison is strict, so that:
   * - if
   */
  def diff(source:LDAPTree, target:LDAPTree, removeMissing:Boolean) :  Option[Tree[TreeModification]] = {
    if(source.root.dn != target.root.dn) {
      logger.debug("DN of the two LDAP tree's root are different: {} <> {}",source.root.dn,target.root.dn)
      None
    } else {
      //modification on root
      val rootDiff = LDAPEntry.merge(source.root, target.root, removeMissing = removeMissing)

      val mods:Tree[TreeModification] = if(rootDiff.isEmpty) Tree(NoMod) else Tree(Replace((source.root.dn,rootDiff)))

      val intersection = source.children.keySet intersect(target.children.keySet)

      //remove entries present in source but not in target
      for(k <- source.children.keySet -- intersection) {
        mods.addChild(k, Tree(Delete(source.children()(k).map(_.dn))))
      }

      //add entries present in target but not in source
      for(k <- target.children.keySet -- intersection) {
        mods.addChild(k, Tree(Add(target.children()(k))))
      }

      //diff all entries both in source and target
      for(k <- intersection) {
        diff(source.children()(k), target.children()(k), removeMissing) foreach { d =>
          mods.addChild(k, d)
        }
      }
      Some(mods)
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="9006a350-9f26-44f5-8fe9-94979c5813fb" name="Default" comment="" />
    <ignored path="string.js.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path=".idea/dataSources.local.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="FavoritesManager">
    <favorites_list name="string.js" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.04893964" vertical-offset="0" max-vertical-offset="3450">
              <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="3" selection-end-column="79" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="bower.json" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/bower.json">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-1.25" vertical-offset="0" max-vertical-offset="585">
              <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="component.json" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/component.json">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-1.25" vertical-offset="0" max-vertical-offset="555">
              <caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="string.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/lib/string.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-2.7777777" vertical-offset="0" max-vertical-offset="16485">
              <caret line="7" column="22" selection-start-line="7" selection-start-column="22" selection-end-line="7" selection-end-column="22" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="package.json" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/package.json">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-1.25" vertical-offset="0" max-vertical-offset="840">
              <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/node_modules/mochify/node_modules/min-wd/lib/request.js" />
        <option value="$PROJECT_DIR$/node_modules/mochify/node_modules/min-wd/lib/options.js" />
        <option value="$PROJECT_DIR$/node_modules/mochify/node_modules/min-wd/lib/sauceLabs.js" />
        <option value="$PROJECT_DIR$/node_modules/mochify/node_modules/min-wd/lib/saucelabs.js" />
        <option value="$PROJECT_DIR$/node_modules/mochify/node_modules/min-wd/lib/driver.js" />
        <option value="$PROJECT_DIR$/test/string.test.js" />
        <option value="$PROJECT_DIR$/.min-wd" />
        <option value="$PROJECT_DIR$/README.md" />
        <option value="$PROJECT_DIR$/gulpfile.js" />
        <option value="$PROJECT_DIR$/.travis.yml" />
        <option value="$PROJECT_DIR$/CHANGELOG.md" />
        <option value="$PROJECT_DIR$/bower.json" />
        <option value="$PROJECT_DIR$/component.json" />
        <option value="$PROJECT_DIR$/lib/string.js" />
        <option value="$PROJECT_DIR$/package.json" />
      </list>
    </option>
  </component>
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
  </component>
  <component name="ProjectFrameBounds">
    <option name="y" value="23" />
    <option name="width" value="1280" />
    <option name="height" value="709" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="string.js" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="string.js" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="string.js" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="string.js" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="string.js" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="test" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../min-webdriver" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="options.lastSelected" value="preferences.sourceCode.JavaScript" />
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="LayoutCode.rearrangeEntriesJavaScript 1.5" value="false" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
      <predefined_log_file id="RUBY_RSPEC" enabled="true" />
      <module name="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
      <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
      <module name="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <pass-parent-envs>true</pass-parent-envs>
      <envs />
      <method />
    </configuration>
    <list size="0" />
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="9006a350-9f26-44f5-8fe9-94979c5813fb" name="Default" comment="" />
      <created>1432893370556</created>
      <option name="number" value="Default" />
      <updated>1432893370556</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="23" width="1280" height="709" extended-state="0" />
    <editor active="true" />
    <layout>
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32882884" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
    </layout>
    <layout-to-restore>
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32882884" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" />
    </layout-to-restore>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="myTodoPanelSettings">
      <TodoPanelSettings />
    </option>
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="1" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="345" max-vertical-offset="16905">
          <caret line="23" column="32" selection-start-line="23" selection-start-column="32" selection-end-line="23" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.min-wd">
      <provider editor-type-id="com.intellij.database.editor.CsvTableFileEditorProvider">
        <state />
      </provider>
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="45" max-vertical-offset="435">
          <caret line="3" column="35" selection-start-line="3" selection-start-column="16" selection-end-line="3" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/string.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="16305">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/gulpfile.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="45" max-vertical-offset="765">
          <caret line="7" column="0" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="226" max-vertical-offset="840">
          <caret line="39" column="20" selection-start-line="39" selection-start-column="20" selection-end-line="39" selection-end-column="20" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.travis.yml">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="135" max-vertical-offset="285">
          <caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="100">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/component.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="30" max-vertical-offset="555">
          <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/string.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="75" max-vertical-offset="16305">
          <caret line="30" column="32" selection-start-line="30" selection-start-column="32" selection-end-line="30" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="825">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="30" max-vertical-offset="3375">
          <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="66" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bower.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="30" max-vertical-offset="585">
          <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/component.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="30" max-vertical-offset="555">
          <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/test/string.test.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="3270" max-vertical-offset="11790">
          <caret line="229" column="8" selection-start-line="229" selection-start-column="8" selection-end-line="229" selection-end-column="8" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.min-wd">
      <provider editor-type-id="com.intellij.database.editor.CsvTableFileEditorProvider">
        <state />
      </provider>
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.07401316" vertical-offset="0" max-vertical-offset="608">
          <caret line="3" column="35" selection-start-line="3" selection-start-column="16" selection-end-line="3" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/gulpfile.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.09404389" vertical-offset="45" max-vertical-offset="765">
          <caret line="7" column="0" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.travis.yml">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.21159874" vertical-offset="0" max-vertical-offset="638">
          <caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.3327645" vertical-offset="11730" max-vertical-offset="17190">
          <caret line="795" column="35" selection-start-line="795" selection-start-column="30" selection-end-line="795" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bower.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-1.25" vertical-offset="0" max-vertical-offset="585">
          <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/component.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-1.25" vertical-offset="0" max-vertical-offset="555">
          <caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/string.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-2.7777777" vertical-offset="0" max-vertical-offset="16485">
          <caret line="7" column="22" selection-start-line="7" selection-start-column="22" selection-end-line="7" selection-end-column="22" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-1.25" vertical-offset="0" max-vertical-offset="840">
          <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.04893964" vertical-offset="0" max-vertical-offset="3450">
          <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="3" selection-end-column="79" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
using System.Data.Entity;
using SQLite.CodeFirst.Console.Entity;

namespace SQLite.CodeFirst.Console
{
    public class ModelConfiguration
    {
        public static void Configure(DbModelBuilder modelBuilder)
        {
            ConfigureTeamEntity(modelBuilder);
            ConfigureStadionEntity(modelBuilder);
            ConfigureCoachEntity(modelBuilder);
            ConfigurePlayerEntity(modelBuilder);
            ConfigureSelfReferencingEntities(modelBuilder);
            ConfigureCompositeKeyEntities(modelBuilder);
        }

        private static void ConfigureTeamEntity(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Team>().ToTable("Base.MyTable")
                .HasRequired(t => t.Coach)
                .WithMany()
                .WillCascadeOnDelete(false);

            modelBuilder.Entity<Team>()
                .HasRequired(t => t.Stadion)
                .WithRequiredPrincipal()
                .WillCascadeOnDelete(true);
        }

        private static void ConfigureStadionEntity(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Stadion>();
        }

        private static void ConfigureCoachEntity(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Coach>()
                .HasRequired(p => p.Team)
                .WithRequiredPrincipal(t => t.Coach)
                .WillCascadeOnDelete(false);
        }

        private static void ConfigurePlayerEntity(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Player>()
                .HasRequired(p => p.Team)
                .WithMany(team => team.Players)
                .WillCascadeOnDelete(true);
        }

        private static void ConfigureSelfReferencingEntities(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Foo>();
            modelBuilder.Entity<FooSelf>();
            modelBuilder.Entity<FooStep>();
        }

        private static void ConfigureCompositeKeyEntities(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<FooCompositeKey>();
            modelBuilder.Entity<FooRelationshipA>();
            modelBuilder.Entity<FooRelationshipB>();
        }
    }
}


text:
import React, { Component } from 'react';
import Knob from '../Knob';
import './Moog_Filter.css';

class Moog_Filter extends Component {
	constructor(props) {
		super(props)
		this.state = {
			isToggleOn: false
		}
		this.handleClick = this.handleClick.bind(this)
	}

	handleClick() {
		this.setState(prevState => ({
			isToggleOn: !prevState.isToggleOn
		}));
	}

	render() {
		const efxProp = this.props.patch.effectBus;
		const findMoog = efx => efx.type === "moog";
		const moog = efxProp.find(findMoog);

		const moogComponent = (

					<Knob
						patchState={moog.bufferSize}
						sendDispatch={this.props.sendDispatch}
						type="moog_filter"
						property="bufferSize"
						min={256}
						max={16384}
						step={256}
						/>
					BUFFER

					<Knob
						patchState={moog.cutoff}
						sendDispatch={this.props.sendDispatch}
						type="moog_filter"
						property="cutoff"
						min={0}
						max={1}
						step={0.1}
						/>
					CUTOFF

					<Knob
						patchState={moog.resonance}
						sendDispatch={this.props.sendDispatch}
						type="moog_filter"
						property="res"
						min={0}
						max={4}
						step={0.5}
						/>
					RESONANCE

		);

		return(

MOOG FILTER

					{this.state.isToggleOn && moogComponent}

		);
	}
}

export default Moog_Filter;


text:
[![Build Status](https://travis-ci.org/ymyzk/YMNetworkActivityManager.png?branch=develop)](https://travis-ci.org/ymyzk/YMNetworkActivityManager)

**YMNetworkActivityManager** is a manager class of the network activity indicator in the status bar.

## Requirements

iOS 6.1+ with ARC (Automatic Reference Counting).
[For iOS 5.0-6.0.2 older version is available.](https://github.com/ymyzk/YMNetworkActivityManager/tree/1a8a2cefc580b5e29a8d1857ff07b2834a867591)

## Installation

Add `YMNetworkActivityManager.h` and `YMNetworkActivityManager.m` to your project.

## Usage

```objective-c```
// Increment
[[YMNetworkActivityManager sharedManager] increment];
// Decrement
[[YMNetworkActivityManager sharedManager] decrement];
```

## License

YMNetworkActivityManager is available under the MIT license. See the [LICENSE file](LICENSE) for more info.


text:
You can see below the API reference of this module.

### `elmSelect(elm, fn, args, parent)`
Select DOM elements and optionally call a function.

#### Params

- **String|Element|NodeList** `elm`: A stringified query selector, an element or a node list.
- **Function** `fn`: If this function is provided, it will be called with the current element and additional arguments passed in `args`.
- **Array** `args`: An array of arguments used in the `fn` function call (default: `[]`).
- **String|Element** `parent`: The parent element where to search the elements (default: `document`). This makes sense only when a query selector is used.

#### Return
- **NodeList** A node list containing the selected elements.


text:
using System;
using System.Runtime.InteropServices;

namespace TitaniumAS.Opc.Client.Interop.System
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
    internal struct COSERVERINFO
    {
        public uint dwReserved1;
        [MarshalAs(UnmanagedType.LPWStr)] public string pwszName;
        public IntPtr pAuthInfo;
        public uint dwReserved2;
    };
}


text:
from sklearn import datasets
import numpy as np
import pandas as pd
import sklearn_explain.explainer as expl

ds = datasets.load_iris();
print(ds.__dict__)

C1 = np.random.randint(3, size=ds.data.shape[0]).T.reshape(-1,1)
C2 = np.random.randint(5, size=ds.data.shape[0]).T.reshape(-1,1)
C2= C2 * 5

print(C1.shape, C2.shape, ds.data.shape)

X = np.concatenate((C1, C2, ds.data) , axis=1)
print(C1.shape, C2.shape, ds.data.shape , X.shape)
print(X[0:5,:])

from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomForestClassifier
clf = Pipeline([
    ('feature_selection', SelectKBest(chi2, k=2)),
    ('classification', RandomForestClassifier(n_estimators=12, random_state = 1960))])
clf.fit(X , ds.target)

lExplainer = expl.cModelScoreExplainer(clf)
lExplainer.mSettings.mFeatureNames = ["C1" , "C2"] + ds.feature_names
lExplainer.mSettings.mCategoricalFeatureNames = ["C1" , "C2"]
lExplainer.mSettings.mScoreBins = 10
lExplainer.mSettings.mFeatureBins = 10
lExplainer.mSettings.mMaxReasons = 2
lExplainer.mSettings.mExplanationOrder = 1
# lExplainer.mSettings.mClasses = ds.target_names # ['setosa', 'versicolor', 'virginica']
# lExplainer.mSettings.mMainClass = 'versicolor'
lExplainer.fit(X)
df_rc = lExplainer.explain(X)

cols = [col for col in df_rc.columns if col.startswith("C")]
print(df_rc[cols].head())

cols = [col for col in df_rc.columns if col.startswith("detailed_")]
print(df_rc[cols].head())


text:
using System.Web;

namespace React.Web
{
	/// <summary>
	/// Handles file system functionality, such as reading files. Maps all paths from
	/// application-relative (~/...) to full paths using ASP.NET's MapPath method.
	/// </summary>
	public class AspNetFileSystem : FileSystemBase
	{
		/// <summary>
		/// The ASP.NET server utilities
		/// </summary>
		private readonly HttpServerUtilityBase _serverUtility;

		/// <summary>
		/// Initializes a new instance of the <see cref="AspNetFileSystem"/> class.
		/// </summary>
		/// <param name="serverUtility">The server utility.</param>
		public AspNetFileSystem(HttpServerUtilityBase serverUtility)
		{
			_serverUtility = serverUtility;
		}

		/// <summary>
		/// Converts a path from an application relative path (~/...) to a full filesystem path
		/// </summary>
		/// <param name="relativePath">App-relative path of the file</param>
		/// <returns>Full path of the file</returns>
		public override string MapPath(string relativePath)
		{
			return _serverUtility.MapPath(relativePath);
		}
	}
}


text:
/*
See LICENSE folder for this sample's licensing information.

Abstract:
Mimics the Settings.app for displaying a dynamic list of available wi-fi access points
*/

using System;
using System.Collections.Generic;
using System.Linq;
using CoreGraphics;
using Foundation;
using UIKit;

namespace Conference_Diffable.Diffable {
	public class WiFiSettingsViewController : UIViewController {
		static readonly NSString key = new NSString (nameof (WiFiSettingsViewController));

		class Section : NSObject, IEquatable<Section> {
			public static Section Config { get; } = new Section (0);
			public static Section Networks { get; } = new Section (1);

			public int Value { get; private set; }

			Section (int value) => Value = value;

			public static Section [] AllSections { get; } = {
				Config, Networks
			};

			public static bool operator == (Section left, Section right)
			{
				if (ReferenceEquals (left, right))
					return true;

				if (ReferenceEquals (left, null))
					return false;

				if (ReferenceEquals (right, null))
					return false;

				return left.Equals (right);
			}

			public static bool operator != (Section left, Section right) => !(left == right);
			public override bool Equals (object obj) => this == (Section)obj;
			public bool Equals (Section other) => Value == other.Value;
			public override int GetHashCode () => HashCode.Combine (base.GetHashCode (), Value);
		}

		enum ItemType {
			WifiEnabled,
			CurrentNetwork,
			AvailableNetwork
		}

		class Item : NSObject, IEquatable<Item> {
			public string Id { get; private set; }
			public string Title { get; private set; }
			public ItemType Type { get; private set; }
			public WIFIController.Network Network { get; private set; }

			public Item (string title, ItemType type)
			{
				Title = title;
				Type = type;
				Id = new NSUuid ().ToString ();
			}

			public Item (WIFIController.Network network)
			{
				Title = network.Name;
				Type = ItemType.AvailableNetwork;
				Network = network;
				Id = network.Id;
			}

			public bool IsConfig {
				get {
					var configItems = new List<ItemType> (new [] { ItemType.CurrentNetwork, ItemType.WifiEnabled });
					return configItems.Contains (Type);
				}
			}

			public bool IsNetwork { get => Type == ItemType.AvailableNetwork; }

			public static bool operator == (Item left, Item right)
			{
				if (ReferenceEquals (left, right))
					return true;

				if (ReferenceEquals (left, null))
					return false;

				if (ReferenceEquals (right, null))
					return false;

				return left.Equals (right);
			}

			public static bool operator != (Item left, Item right) => !(left == right);
			public override bool Equals (object obj) => this == (Item)obj;
			public bool Equals (Item other) => Id == other.Id;
			public override int GetHashCode () => HashCode.Combine (base.GetHashCode (), Id);
		}

		UITableView tableView;
		UITableViewDiffableDataSource<Section, Item> dataSource;
		NSDiffableDataSourceSnapshot<Section, Item> currentSnapshot;
		WIFIController wifiController;
		Item [] configurationItems;

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			// Perform any additional setup after loading the view, typically from a nib.

			NavigationItem.Title = "Wi-Fi";
			ConfigureHierarchy ();
			ConfigureDataSource ();
			UpdateUI (false);
		}

		void ConfigureHierarchy ()
		{
			configurationItems = new [] {
				new Item ("Wi-Fi", ItemType.WifiEnabled),
				new Item ("breeno-net", ItemType.CurrentNetwork)
			};

			tableView = new UITableView (CGRect.Empty, UITableViewStyle.InsetGrouped) {
				TranslatesAutoresizingMaskIntoConstraints = false
			};
			View.AddSubview (tableView);
			tableView.RegisterClassForCellReuse (typeof (UITableViewCell), key);

			tableView.LeadingAnchor.ConstraintEqualTo (View.LeadingAnchor).Active = true;
			tableView.TrailingAnchor.ConstraintEqualTo (View.TrailingAnchor).Active = true;
			tableView.TopAnchor.ConstraintEqualTo (View.TopAnchor).Active = true;
			tableView.BottomAnchor.ConstraintEqualTo (View.BottomAnchor).Active = true;
		}

		void ConfigureDataSource ()
		{
			wifiController = new WIFIController (wifiController => UpdateUI ());
			dataSource = new UITableViewDiffableDataSource<Section, Item> (tableView, CellProviderHandler);
			dataSource.DefaultRowAnimation = UITableViewRowAnimation.Fade;
			wifiController.ScanForNetworks = true;

			UITableViewCell CellProviderHandler (UITableView tableView, NSIndexPath indexPath, NSObject obj)
			{
				var item = obj as Item;

				// Get a cell of the desired kind.
				var cell = tableView.DequeueReusableCell (key, indexPath);

				// network cell
				if (item.IsNetwork) {
					cell.TextLabel.Text = item.Title;
					cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton;
					cell.AccessoryView = null;
				} else if (item.IsConfig) {
					// configuration cells
					cell.TextLabel.Text = item.Title;

					if (item.Type == ItemType.WifiEnabled) {
						var enableWifiSwitch = new UISwitch { On = wifiController.WifiEnabled };
						enableWifiSwitch.ValueChanged += EnableWifiSwitch_ValueChanged;
						cell.AccessoryView = enableWifiSwitch;
					} else {
						cell.AccessoryView = null;
						cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton;
					}
				}

				// Return the cell.
				return cell;
			}
		}

		void UpdateUI (bool animated = true)
		{
			var configItems = configurationItems.Where (c => !(c.Type == ItemType.CurrentNetwork && !wifiController.WifiEnabled)).ToArray ();

			currentSnapshot = new NSDiffableDataSourceSnapshot<Section, Item> ();
			currentSnapshot.AppendSections (new [] { Section.Config });
			currentSnapshot.AppendItems (configItems, Section.Config);

			if (wifiController.WifiEnabled) {
				var sortedNetworks = wifiController.AvailableNetworks.OrderBy (w => w.Name).ToArray ();
				var networkItems = sortedNetworks.Select (n => new Item (n)).ToArray ();
				currentSnapshot.AppendSections (new [] { Section.Networks });
				currentSnapshot.AppendItems (networkItems);
			}

			dataSource.ApplySnapshot (currentSnapshot, animated);
		}

		private void EnableWifiSwitch_ValueChanged (object sender, EventArgs e)
		{
			wifiController.WifiEnabled = (sender as UISwitch).On;
			UpdateUI ();
		}
	}
}


text:
require "formula"
require "cask/cask_loader"

# Helper module for validating syntax in taps.
#
# @api private
module Readall
  class << self
    def valid_ruby_syntax?(ruby_files)
      failed = false
      ruby_files.each do |ruby_file|
        # As a side effect, print syntax errors/warnings to `$stderr`.
        failed = true if syntax_errors_or_warnings?(ruby_file)
      end
      !failed
    end

    def valid_aliases?(alias_dir, formula_dir)
      return true unless alias_dir.directory?

      failed = false
      alias_dir.each_child do |f|
        if !f.symlink?
          onoe "Non-symlink alias: #{f}"
          failed = true
        elsif !f.file?
          onoe "Non-file alias: #{f}"
          failed = true
        end

        if (formula_dir/"#{f.basename}.rb").exist?
          onoe "Formula duplicating alias: #{f}"
          failed = true
        end
      end
      !failed
    end

    def valid_formulae?(formulae)
      success = true
      formulae.each do |file|
        Formulary.factory(file)
      rescue Interrupt
        raise
      rescue Exception => e # rubocop:disable Lint/RescueException
        onoe "Invalid formula: #{file}"
        $stderr.puts e
        success = false
      end
      success
    end

    def valid_casks?(casks)
      success = true
      casks.each do |file|
        Cask::CaskLoader.load(file)
      rescue Interrupt
        raise
      rescue Exception => e # rubocop:disable Lint/RescueException
        onoe "Invalid cask: #{file}"
        $stderr.puts e
        success = false
      end
      success
    end

    def valid_tap?(tap, options = {})
      success = true
      if options[:aliases]
        valid_aliases = valid_aliases?(tap.alias_dir, tap.formula_dir)
        success = false unless valid_aliases
      end
      valid_formulae = valid_formulae?(tap.formula_files)
      valid_casks = valid_casks?(tap.cask_files)
      success = false if !valid_formulae || !valid_casks
      success
    end

    private

    def syntax_errors_or_warnings?(rb)
      # Retrieve messages about syntax errors/warnings printed to `$stderr`.
      _, err, status = system_command(RUBY_PATH, args: ["-c", "-w", rb], print_stderr: false)

      # Ignore unnecessary warning about named capture conflicts.
      # See https://bugs.ruby-lang.org/issues/12359.
      messages = err.lines
                    .grep_v(/named capture conflicts a local variable/)
                    .join

      $stderr.print messages

      # Only syntax errors result in a non-zero status code. To detect syntax
      # warnings we also need to inspect the output to `$stderr`.
      !status.success? || !messages.chomp.empty?
    end
  end
end

require "extend/os/readall"


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TinyInterceptor
{
    public interface IInterceptSupport
    {
        void BeforeExecute(object instance);

        void AfterExecute(object instance);

        void OnError(object instance, Exception ex);
    }
}