text:
#ifndef HPSA_H
#define HPSA_H

#include <scsi/scsicam.h>

#define IO_OK		0
#define IO_ERROR	1

struct ctlr_info;

struct access_method {
	void (*submit_command)(struct ctlr_info *h,
		struct CommandList *c);
	void (*set_intr_mask)(struct ctlr_info *h, unsigned long val);
	unsigned long (*fifo_full)(struct ctlr_info *h);
	bool (*intr_pending)(struct ctlr_info *h);
	unsigned long (*command_completed)(struct ctlr_info *h, u8 q);
};

struct hpsa_scsi_dev_t {
	int devtype;
	int bus, target, lun;		/* as presented to the OS */
	unsigned char scsi3addr[8];	/* as presented to the HW */
#define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0"
	unsigned char device_id[16];    /* from inquiry pg. 0x83 */
	unsigned char vendor[8];        /* bytes 8-15 of inquiry data */
	unsigned char model[16];        /* bytes 16-31 of inquiry data */
	unsigned char raid_level;	/* from inquiry page 0xC1 */
};

struct reply_pool {
	u64 *head;
	size_t size;
	u8 wraparound;
	u32 current_entry;
};

struct ctlr_info {
	int	ctlr;
	char	devname[8];
	char    *product_name;
	struct pci_dev *pdev;
	u32	board_id;
	void __iomem *vaddr;
	unsigned long paddr;
	int 	nr_cmds; /* Number of commands allowed on this controller */
	struct CfgTable __iomem *cfgtable;
	int	interrupts_enabled;
	int	major;
	int 	max_commands;
	int	commands_outstanding;
	int 	max_outstanding; /* Debug */
	int	usage_count;  /* number of opens all all minor devices */
#	define PERF_MODE_INT	0
#	define DOORBELL_INT	1
#	define SIMPLE_MODE_INT	2
#	define MEMQ_MODE_INT	3
	unsigned int intr[MAX_REPLY_QUEUES];
	unsigned int msix_vector;
	unsigned int msi_vector;
	int intr_mode; /* either PERF_MODE_INT or SIMPLE_MODE_INT */
	struct access_method access;

	/* queue and queue Info */
	struct list_head reqQ;
	struct list_head cmpQ;
	unsigned int Qdepth;
	unsigned int maxSG;
	spinlock_t lock;
	int maxsgentries;
	u8 max_cmd_sg_entries;
	int chainsize;
	struct SGDescriptor **cmd_sg_list;

	/* pointers to command and error info pool */
	struct CommandList 	*cmd_pool;
	dma_addr_t		cmd_pool_dhandle;
	struct ErrorInfo 	*errinfo_pool;
	dma_addr_t		errinfo_pool_dhandle;
	unsigned long  		*cmd_pool_bits;
	int			nr_allocs;
	int			nr_frees;
	int			scan_finished;
	spinlock_t		scan_lock;
	wait_queue_head_t	scan_wait_queue;

	struct Scsi_Host *scsi_host;
	spinlock_t devlock; /* to protect hba[ctlr]->dev[];  */
	int ndevices; /* number of used elements in .dev[] array. */
	struct hpsa_scsi_dev_t *dev[HPSA_MAX_DEVICES];
	/*
	 * Performant mode tables.
	 */
	u32 trans_support;
	u32 trans_offset;
	struct TransTable_struct *transtable;
	unsigned long transMethod;

	/*
	 * Performant mode completion buffers
	 */
	u64 *reply_pool;
	size_t reply_pool_size;
	struct reply_pool reply_queue[MAX_REPLY_QUEUES];
	u8 nreply_queues;
	dma_addr_t reply_pool_dhandle;
	u32 *blockFetchTable;
	unsigned char *hba_inquiry_data;
	u64 last_intr_timestamp;
	u32 last_heartbeat;
	u64 last_heartbeat_timestamp;
	u32 heartbeat_sample_interval;
	atomic_t firmware_flash_in_progress;
	u32 lockup_detected;
	struct list_head lockup_list;
	/* Address of h->q[x] is passed to intr handler to know which queue */
	u8 q[MAX_REPLY_QUEUES];
	u32 TMFSupportFlags; /* cache what task mgmt funcs are supported. */
#define HPSATMF_BITS_SUPPORTED  (1 << 0)
#define HPSATMF_PHYS_LUN_RESET  (1 << 1)
#define HPSATMF_PHYS_NEX_RESET  (1 << 2)
#define HPSATMF_PHYS_TASK_ABORT (1 << 3)
#define HPSATMF_PHYS_TSET_ABORT (1 << 4)
#define HPSATMF_PHYS_CLEAR_ACA  (1 << 5)
#define HPSATMF_PHYS_CLEAR_TSET (1 << 6)
#define HPSATMF_PHYS_QRY_TASK   (1 << 7)
#define HPSATMF_PHYS_QRY_TSET   (1 << 8)
#define HPSATMF_PHYS_QRY_ASYNC  (1 << 9)
#define HPSATMF_MASK_SUPPORTED  (1 << 16)
#define HPSATMF_LOG_LUN_RESET   (1 << 17)
#define HPSATMF_LOG_NEX_RESET   (1 << 18)
#define HPSATMF_LOG_TASK_ABORT  (1 << 19)
#define HPSATMF_LOG_TSET_ABORT  (1 << 20)
#define HPSATMF_LOG_CLEAR_ACA   (1 << 21)
#define HPSATMF_LOG_CLEAR_TSET  (1 << 22)
#define HPSATMF_LOG_QRY_TASK    (1 << 23)
#define HPSATMF_LOG_QRY_TSET    (1 << 24)
#define HPSATMF_LOG_QRY_ASYNC   (1 << 25)
};
#define HPSA_ABORT_MSG 0
#define HPSA_DEVICE_RESET_MSG 1
#define HPSA_RESET_TYPE_CONTROLLER 0x00
#define HPSA_RESET_TYPE_BUS 0x01
#define HPSA_RESET_TYPE_TARGET 0x03
#define HPSA_RESET_TYPE_LUN 0x04
#define HPSA_MSG_SEND_RETRY_LIMIT 10
#define HPSA_MSG_SEND_RETRY_INTERVAL_MSECS (10000)

/* Maximum time in seconds driver will wait for command completions
 * when polling before giving up.
 */
#define HPSA_MAX_POLL_TIME_SECS (20)

/* During SCSI error recovery, HPSA_TUR_RETRY_LIMIT defines
 * how many times to retry TEST UNIT READY on a device
 * while waiting for it to become ready before giving up.
 * HPSA_MAX_WAIT_INTERVAL_SECS is the max wait interval
 * between sending TURs while waiting for a device
 * to become ready.
 */
#define HPSA_TUR_RETRY_LIMIT (20)
#define HPSA_MAX_WAIT_INTERVAL_SECS (30)

/* HPSA_BOARD_READY_WAIT_SECS is how long to wait for a board
 * to become ready, in seconds, before giving up on it.
 * HPSA_BOARD_READY_POLL_INTERVAL_MSECS * is how long to wait
 * between polling the board to see if it is ready, in
 * milliseconds.  HPSA_BOARD_READY_POLL_INTERVAL and
 * HPSA_BOARD_READY_ITERATIONS are derived from those.
 */
#define HPSA_BOARD_READY_WAIT_SECS (120)
#define HPSA_BOARD_NOT_READY_WAIT_SECS (100)
#define HPSA_BOARD_READY_POLL_INTERVAL_MSECS (100)
#define HPSA_BOARD_READY_POLL_INTERVAL \
	((HPSA_BOARD_READY_POLL_INTERVAL_MSECS * HZ) / 1000)
#define HPSA_BOARD_READY_ITERATIONS \
	((HPSA_BOARD_READY_WAIT_SECS * 1000) / \
		HPSA_BOARD_READY_POLL_INTERVAL_MSECS)
#define HPSA_BOARD_NOT_READY_ITERATIONS \
	((HPSA_BOARD_NOT_READY_WAIT_SECS * 1000) / \
		HPSA_BOARD_READY_POLL_INTERVAL_MSECS)
#define HPSA_POST_RESET_PAUSE_MSECS (3000)
#define HPSA_POST_RESET_NOOP_RETRIES (12)

/*  Defining the diffent access_menthods */
/*
 * Memory mapped FIFO interface (SMART 53xx cards)
 */
#define SA5_DOORBELL	0x20
#define SA5_REQUEST_PORT_OFFSET	0x40
#define SA5_REPLY_INTR_MASK_OFFSET	0x34
#define SA5_REPLY_PORT_OFFSET		0x44
#define SA5_INTR_STATUS		0x30
#define SA5_SCRATCHPAD_OFFSET	0xB0

#define SA5_CTCFG_OFFSET	0xB4
#define SA5_CTMEM_OFFSET	0xB8

#define SA5_INTR_OFF		0x08
#define SA5B_INTR_OFF		0x04
#define SA5_INTR_PENDING	0x08
#define SA5B_INTR_PENDING	0x04
#define FIFO_EMPTY		0xffffffff
#define HPSA_FIRMWARE_READY	0xffff0000 /* value in scratchpad register */

#define HPSA_ERROR_BIT		0x02

/* Performant mode flags */
#define SA5_PERF_INTR_PENDING   0x04
#define SA5_PERF_INTR_OFF       0x05
#define SA5_OUTDB_STATUS_PERF_BIT       0x01
#define SA5_OUTDB_CLEAR_PERF_BIT        0x01
#define SA5_OUTDB_CLEAR         0xA0
#define SA5_OUTDB_CLEAR_PERF_BIT        0x01
#define SA5_OUTDB_STATUS        0x9C

#define HPSA_INTR_ON 	1
#define HPSA_INTR_OFF	0
/*
	Send the command to the hardware
*/
static void SA5_submit_command(struct ctlr_info *h,
	struct CommandList *c)
{
	dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
		c->Header.Tag.lower);
	writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
	(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
}

/*
 *  This card is the opposite of the other cards.
 *   0 turns interrupts on...
 *   0x08 turns them off...
 */
static void SA5_intr_mask(struct ctlr_info *h, unsigned long val)
{
	if (val) { /* Turn interrupts on */
		h->interrupts_enabled = 1;
		writel(0, h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
		(void) readl(h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
	} else { /* Turn them off */
		h->interrupts_enabled = 0;
		writel(SA5_INTR_OFF,
			h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
		(void) readl(h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
	}
}

static void SA5_performant_intr_mask(struct ctlr_info *h, unsigned long val)
{
	if (val) { /* turn on interrupts */
		h->interrupts_enabled = 1;
		writel(0, h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
		(void) readl(h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
	} else {
		h->interrupts_enabled = 0;
		writel(SA5_PERF_INTR_OFF,
			h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
		(void) readl(h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
	}
}

static unsigned long SA5_performant_completed(struct ctlr_info *h, u8 q)
{
	struct reply_pool *rq = &h->reply_queue[q];
	unsigned long flags, register_value = FIFO_EMPTY;

	/* msi auto clears the interrupt pending bit. */
	if (!(h->msi_vector || h->msix_vector)) {
		/* flush the controller write of the reply queue by reading
		 * outbound doorbell status register.
		 */
		register_value = readl(h->vaddr + SA5_OUTDB_STATUS);
		writel(SA5_OUTDB_CLEAR_PERF_BIT, h->vaddr + SA5_OUTDB_CLEAR);
		/* Do a read in order to flush the write to the controller
		 * (as per spec.)
		 */
		register_value = readl(h->vaddr + SA5_OUTDB_STATUS);
	}

	if ((rq->head[rq->current_entry] & 1) == rq->wraparound) {
		register_value = rq->head[rq->current_entry];
		rq->current_entry++;
		spin_lock_irqsave(&h->lock, flags);
		h->commands_outstanding--;
		spin_unlock_irqrestore(&h->lock, flags);
	} else {
		register_value = FIFO_EMPTY;
	}
	/* Check for wraparound */
	if (rq->current_entry == h->max_commands) {
		rq->current_entry = 0;
		rq->wraparound ^= 1;
	}
	return register_value;
}

/*
 *  Returns true if fifo is full.
 *
 */
static unsigned long SA5_fifo_full(struct ctlr_info *h)
{
	if (h->commands_outstanding >= h->max_commands)
		return 1;
	else
		return 0;

}
/*
 *   returns value read from hardware.
 *     returns FIFO_EMPTY if there is nothing to read
 */
static unsigned long SA5_completed(struct ctlr_info *h,
	__attribute__((unused)) u8 q)
{
	unsigned long register_value
		= readl(h->vaddr + SA5_REPLY_PORT_OFFSET);
	unsigned long flags;

	if (register_value != FIFO_EMPTY) {
		spin_lock_irqsave(&h->lock, flags);
		h->commands_outstanding--;
		spin_unlock_irqrestore(&h->lock, flags);
	}

#ifdef HPSA_DEBUG
	if (register_value != FIFO_EMPTY)
		dev_dbg(&h->pdev->dev, "Read %lx back from board\n",
			register_value);
	else
		dev_dbg(&h->pdev->dev, "FIFO Empty read\n");
#endif

	return register_value;
}
/*
 *	Returns true if an interrupt is pending..
 */
static bool SA5_intr_pending(struct ctlr_info *h)
{
	unsigned long register_value  =
		readl(h->vaddr + SA5_INTR_STATUS);
	dev_dbg(&h->pdev->dev, "intr_pending %lx\n", register_value);
	return register_value & SA5_INTR_PENDING;
}

static bool SA5_performant_intr_pending(struct ctlr_info *h)
{
	unsigned long register_value = readl(h->vaddr + SA5_INTR_STATUS);

	if (!register_value)
		return false;

	if (h->msi_vector || h->msix_vector)
		return true;

	/* Read outbound doorbell to flush */
	register_value = readl(h->vaddr + SA5_OUTDB_STATUS);
	return register_value & SA5_OUTDB_STATUS_PERF_BIT;
}

static struct access_method SA5_access = {
	SA5_submit_command,
	SA5_intr_mask,
	SA5_fifo_full,
	SA5_intr_pending,
	SA5_completed,
};

static struct access_method SA5_performant_access = {
	SA5_submit_command,
	SA5_performant_intr_mask,
	SA5_fifo_full,
	SA5_performant_intr_pending,
	SA5_performant_completed,
};

struct board_type {
	u32	board_id;
	char	*product_name;
	struct access_method *access;
};

#endif /* HPSA_H */


text:
package com.facebook.buck.android;

import com.facebook.buck.rules.RuleKeyAppendable;
import com.facebook.buck.rules.RuleKeyObjectSink;
import com.facebook.buck.util.immutables.BuckStyleTuple;
import org.immutables.value.Value;

@Value.Immutable
@BuckStyleTuple
abstract class AbstractAPKModule implements RuleKeyAppendable, Comparable<AbstractAPKModule> {
  public abstract String getName();

  @Value.Derived
  public boolean isRootModule() {
    return getName().equals(APKModuleGraph.ROOT_APKMODULE_NAME);
  }

  @Value.Derived
  public String getCanaryClassName() {
    if (isRootModule()) {
      return "secondary";
    } else {
      return String.format("store%04x", getName().hashCode() & 0xFFFF);
    }
  }

  @Override
  public void appendToRuleKey(RuleKeyObjectSink sink) {
    sink.setReflectively("name", getName());
  }

  @Override
  public int compareTo(AbstractAPKModule o) {
    if (this == o) {
      return 0;
    }

    return getName().compareTo(o.getName());
  }
}

redpajama_set_name: RedPajamaGithub


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

[SecuritySafeCritical]
/// <summary>
/// ReadInt64(System.IntPtr)
/// </summary>
public class MarshalReadInt641
{
    #region Private Fields
    private const uint c_SIZE_OF_LONG = 8;
    private const uint GPTR = 0x0040;
    #endregion

    #region Public Methods
    public bool RunTests()
    {
        bool retVal = true;

        TestLibrary.TestFramework.LogInformation("[Positive]");
        retVal = PosTest1() && retVal;

        TestLibrary.TestFramework.LogInformation("[Negative]");

        return retVal;
    }

    #region Positive Test Cases
    public unsafe bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest1: Call ReadInt64 to read a long from unmanaged memory to managed memory");

        try
        {
            IntPtr ptr = IntPtr.Zero;
            long expected = TestLibrary.Generator.GetInt64(-55);

            ptr = AllocWrapper((uint) c_SIZE_OF_LONG);
            long* pointer = (long*)ptr.ToPointer();
            *pointer = expected;

            long actual = Marshal.ReadInt64(ptr);
            FreeWrapper(ptr);
            if (actual != expected)
            {
                TestLibrary.TestFramework.LogError("001.1", "Calling ReadInt64 reads wrong data from unmanaged memory to managed memory");
                TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLES] expected = " + expected + ", actual = " + actual);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("001.0", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }
    #endregion

    #region Nagetive Test Cases

    #endregion
    #endregion

    public static int Main()
    {
        MarshalReadInt641 test = new MarshalReadInt641();

        TestLibrary.TestFramework.BeginTestCase("MarshalReadInt641");

        if (test.RunTests())
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("PASS");
            return 100;
        }
        else
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("FAIL");
            return 0;
        }
    }

    #region Private Methods
    #region Windows P/invoke Declarations
    [DllImport("kernel32.dll")]
    private static extern IntPtr GlobalAlloc(uint uFlags, uint dwBytes);

    [DllImport("kernel32.dll")]
    private static extern IntPtr GlobalFree(IntPtr hMem);
    #endregion

    #region Macintosh P/invoke Declarations
    [DllImport("libc.dylib")]
    private static extern IntPtr malloc(uint siz);

    [DllImport("libc.dylib")]
    private static extern void free(IntPtr ptr);
    #endregion

    // delegate unmanaged-memory allocation calls to either GlobalAlloc (Windows) or malloc (Mac)
    private IntPtr AllocWrapper(uint nBytes)
    {
        if (Utilities.IsWindows)
            return GlobalAlloc(GPTR, nBytes);
        else
            return malloc(nBytes);
    }

    // delegate unmanaged-memory release calls to either GlobalFree (Windows) or free (Mac)
    private void FreeWrapper(IntPtr ptr)
    {
        if (Utilities.IsWindows)
            GlobalFree(ptr);
        else
            free(ptr);
    }

    #endregion
}


text:
package main

import (
	"errors"
	"os"
	"testing"

	"github.com/spf13/cobra"
	"github.com/stretchr/testify/assert"
)

func Test_generate_notice(t *testing.T) {
	var argsOrig []string
	copy(argsOrig, os.Args)
	defer func() { os.Args = argsOrig }()
	os.Args = []string{"analice", "generate", "notice", "github.com/bpicode/fritzctl", "--tests=false"}
	assert.NotPanics(t, main)
}

func Test_generate_copyright(t *testing.T) {
	var argsOrig []string
	copy(argsOrig, os.Args)
	defer func() { os.Args = argsOrig }()
	os.Args = []string{"analice", "generate", "copyright", "github.com/bpicode/fritzctl"}
	assert.NotPanics(t, main)
}

func Test_generate_with_err(t *testing.T) {
	var argsOrig []string
	copy(argsOrig, os.Args)
	defer func() { os.Args = argsOrig }()

	var exOnErr = exitOnErr
	defer func() { exitOnErr = exOnErr }()
	exitOnErr = func(v ...interface{}) { panic(v) }

	rootCmdOrig := *rootCmd
	defer func() { rootCmd = &rootCmdOrig }()
	rootCmd = &cobra.Command{RunE: func(_ *cobra.Command, _ []string) error {
		return errors.New("an error")
	}}

	os.Args = []string{"analice", "generate", "notice", "./..."}
	assert.Panics(t, main)
}


text:
pyrus install pecl/redis && pyrus build pecl/redis
echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini


text:
package com.hackcaffebabe.mtg.gui.frame;

import static com.hackcaffebabe.mtg.gui.GUIUtils.STATUS_BAR_MAIN_FRAME;
import static com.hackcaffebabe.mtg.gui.GUIUtils.refreshMTGTable;
import it.hackcaffebabe.jx.statusbar.JXStatusBar;
import it.hackcaffebabe.logger.Logger;
import it.hackcaffebabe.logger.Tag;
import java.awt.BorderLayout;
import java.awt.Event;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JSeparator;
import javax.swing.KeyStroke;
import com.hackcaffebabe.mtg.Version;
import com.hackcaffebabe.mtg.controller.impoexpo.Exporter;
import com.hackcaffebabe.mtg.controller.impoexpo.Importer;
import com.hackcaffebabe.mtg.controller.impoexpo.WhatImpoExpo;
import com.hackcaffebabe.mtg.controller.statistics.Statistics;
import com.hackcaffebabe.mtg.gui.FramesDimensions;
import com.hackcaffebabe.mtg.gui.FramesTitles;
import com.hackcaffebabe.mtg.gui.frame.listener.AboutActionListener;
import com.hackcaffebabe.mtg.gui.frame.listener.DeckEditorActionListener;
import com.hackcaffebabe.mtg.gui.listener.DeleteCardActionListener;
import com.hackcaffebabe.mtg.gui.listener.NewCardActionListener;
import com.hackcaffebabe.mtg.gui.panel.mtg.MTGContent;

/**
 * The main frame of Project
 *
 * @author Andrea Ghizzoni. More info at andrea.ghz@gmail.com
 * @version 1.0
 */
public class MTG extends JFrame
{
	private static final long serialVersionUID = 1L;
	private MTGContent content;

	/**
	 * Create the frame.
	 */
	public MTG(){
		super( FramesTitles.TITLE_MAIN_FRAME );
		setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		setMinimumSize( FramesDimensions.DIMENSION_MAIN_FRAME );
		setLocation( FramesDimensions.getCenter( FramesDimensions.DIMENSION_MAIN_FRAME ) );
		addWindowListener( new WinListener() );
		this.initContent();
		this.initMenuBar();
	}

//===========================================================================================
// METHOD
//===========================================================================================
	/* initialize all components */
	private void initContent(){
		STATUS_BAR_MAIN_FRAME = new JXStatusBar( this, "Ready!", Version.VERSION, 10 );
		STATUS_BAR_MAIN_FRAME.setTextFont( new Font( Font.MONOSPACED, Font.PLAIN, 11 ) );
		this.content = new MTGContent();
		this.content.setOpaque( true );
		setContentPane( this.content );
		add( STATUS_BAR_MAIN_FRAME, BorderLayout.SOUTH );
	}

	/* initialize all menu bar */
	private void initMenuBar(){
		JMenuBar bar = new JMenuBar();

		JMenu file = new JMenu( "File" );
		JMenuItem fileImport = new JMenuItem( "Import..." );
		fileImport.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_I, Event.CTRL_MASK ) );
		fileImport.addActionListener( new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				new Importer( WhatImpoExpo.ALL_CARDS, new ImporterUI() ).execute();
			}
		} );
		file.add( fileImport );

		JMenuItem fileImportSelected = new JMenuItem( "Selected Import..." );
		fileImportSelected.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_U, Event.CTRL_MASK ) );
		fileImportSelected.addActionListener( new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				new Importer( WhatImpoExpo.SELECTIVE_CARDS, new ImporterUI() ).execute();
			}
		} );
		file.add( fileImportSelected );

		JMenuItem fileExport = new JMenuItem( "Export..." );
		fileExport.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_E, Event.CTRL_MASK ) );
		fileExport.addActionListener( new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				new Exporter( WhatImpoExpo.ALL_CARDS, new ExporterUI() ).execute();
			}
		} );
		file.add( fileExport );

		JMenuItem fileStatistocs = new JMenuItem( "Generate Statistics" );
		fileStatistocs.addActionListener( new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				new StatisticsUI().show( Statistics.getInstance() );
			}
		} );
		file.add( fileStatistocs );

		file.add( new JSeparator() );
		JMenuItem fileExit = new JMenuItem( "Exit" );
		fileExit.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_Q, Event.CTRL_MASK ) );
		fileExit.addActionListener( new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				close();
			}
		} );
		file.add( fileExit );

		JMenu edit = new JMenu( "Edit" );
		JMenuItem editDeckEditor = new JMenuItem( "Deck Editor" );
		editDeckEditor.addActionListener( DeckEditorActionListener.getInstance() );
		edit.add( editDeckEditor );
		edit.addSeparator();

		JMenuItem editNewCard = new JMenuItem( "New Card" );
		editNewCard.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_N, Event.CTRL_MASK ) );
		editNewCard.addActionListener( NewCardActionListener.getInstance() );
		edit.add( editNewCard );

		JMenuItem editDelCard = new JMenuItem( "Delete" );
		editDelCard.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_DELETE, Event.CTRL_MASK + Event.SHIFT_MASK ) );
		editDelCard.addActionListener( DeleteCardActionListener.getInstance() );
		edit.add( editDelCard );

		JMenuItem editRefresh = new JMenuItem( "Refresh" );
		editRefresh.setAccelerator( KeyStroke.getKeyStroke( "F5" ) );
		editRefresh.addActionListener( new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				refreshMTGTable();
			}
		} );
		edit.add( editRefresh );

		JMenu help = new JMenu( "Help" );
		JMenuItem helpAbout = new JMenuItem( "About" );
		helpAbout.setAccelerator( KeyStroke.getKeyStroke( "F1" ) );
		helpAbout.addActionListener( new AboutActionListener() );
		help.add( helpAbout );

		bar.add( file );
		bar.add( edit );
		bar.add( help );

		setJMenuBar( bar );
	}

	/* Close the frame */
	public void close(){
		dispose();
		Logger.getInstance().write( Tag.INFO, "Program will exit." );
		System.exit( 0 );
	}

//===========================================================================================
// INNER CLASS
//===========================================================================================
	/* windows closing listener */
	private class WinListener implements WindowListener
	{
		public void windowClosing(WindowEvent e){
			close();
		}

		public void windowOpened(WindowEvent e){}

		public void windowClosed(WindowEvent e){}

		public void windowIconified(WindowEvent e){}

		public void windowDeiconified(WindowEvent e){}

		public void windowActivated(WindowEvent e){}

		public void windowDeactivated(WindowEvent e){}
	}
}


text:
<?php

namespace Magento\Framework\Filesystem\Directory;

interface WriteInterface extends ReadInterface
{
    /**
     * Create directory if it does not exists
     *
     * @param string $path [optional]
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function create($path = null);

    /**
     * Delete given path
     *
     * @param string $path [optional]
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function delete($path = null);

    /**
     * Rename a file
     *
     * @param string $path
     * @param string $newPath
     * @param WriteInterface $targetDirectory [optional]
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function renameFile($path, $newPath, WriteInterface $targetDirectory = null);

    /**
     * Copy a file
     *
     * @param string $path
     * @param string $destination
     * @param WriteInterface $targetDirectory [optional]
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function copyFile($path, $destination, WriteInterface $targetDirectory = null);

    /**
     * Creates symlink on a file or directory and places it to destination
     *
     * @param string $path
     * @param string $destination
     * @param WriteInterface $targetDirectory [optional]
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function createSymlink($path, $destination, WriteInterface $targetDirectory = null);

    /**
     * Change permissions of given path
     *
     * @param string $path
     * @param int $permissions
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function changePermissions($path, $permissions);

    /**
     * Change permissions of given path
     *
     * @param string $path
     * @param int $dirPermissions
     * @param int $filePermissions
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function changePermissionsRecursively($path, $dirPermissions, $filePermissions);

    /**
     * Sets access and modification time of file.
     *
     * @param string $path
     * @param int $modificationTime [optional]
     * @return bool
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function touch($path, $modificationTime = null);

    /**
     * Check if given path is writable
     *
     * @param string $path [optional]
     * @return bool
     */
    public function isWritable($path = null);

    /**
     * Open file in given mode
     *
     * @param string $path
     * @param string $mode
     * @return \Magento\Framework\Filesystem\File\WriteInterface
     */
    public function openFile($path, $mode = 'w');

    /**
     * Open file in given path
     *
     * @param string $path
     * @param string $content
     * @param string $mode [optional]
     * @return int The number of bytes that were written.
     * @throws \Magento\Framework\Exception\FileSystemException
     */
    public function writeFile($path, $content, $mode = null);

    /**
     * Get driver
     *
     * @return \Magento\Framework\Filesystem\DriverInterface
     */
    public function getDriver();
}


text:
package model

import play.api.libs.json._

/**
  * Represents the Swagger definition for InputStepImpl.
  * @param additionalProperties Any additional properties this model may have.
  */
@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2022-06-04T08:11:54.386355Z[Etc/UTC]")
case class InputStepImpl(
  `class`: Option[String],
  links: Option[InputStepImpllinks],
  id: Option[String],
  message: Option[String],
  ok: Option[String],
  parameters: Option[List[StringParameterDefinition]],
  submitter: Option[String]
  additionalProperties:
)

object InputStepImpl {
  implicit lazy val inputStepImplJsonFormat: Format[InputStepImpl] = {
    val realJsonFormat = Json.format[InputStepImpl]
    val declaredPropNames = Set("`class`", "links", "id", "message", "ok", "parameters", "submitter")

    Format(
      Reads {
        case JsObject(xs) =>
          val declaredProps = xs.filterKeys(declaredPropNames)
          val additionalProps = JsObject(xs -- declaredPropNames)
          val restructuredProps = declaredProps + ("additionalProperties" -> additionalProps)
          val newObj = JsObject(restructuredProps)
          realJsonFormat.reads(newObj)
        case _ =>
          JsError("error.expected.jsobject")
      },
      Writes { inputStepImpl =>
        val jsObj = realJsonFormat.writes(inputStepImpl)
        val additionalProps = jsObj.value("additionalProperties").as[JsObject]
        val declaredProps = jsObj - "additionalProperties"
        val newObj = declaredProps ++ additionalProps
        newObj
      }
    )
  }
}


text:
// Copyright 2007 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.apache.tapestry5.ioc.internal;

import org.apache.tapestry5.ioc.ObjectCreator;
import org.apache.tapestry5.ioc.ServiceBuilderResources;

/**
 * An object which can, when passed a {@link ServiceBuilderResources}, create a corresponding {@link ObjectCreator}. A
 * secondary responsibility is to provide a description of the creator, which is usually based on the name of the method
 * or constructor to be invoked, and is ultimately used in some debugging or error output.
 */
public interface ObjectCreatorSource
{
    /**
     * Provides an ObjectCreator that can be used to ultimately instantiate the core service implementation.
     */
    ObjectCreator constructCreator(ServiceBuilderResources resources);

    /**
     * Returns a description of the method or constructor that creates the service.
     */
    String getDescription();
}


text:
- Updated the Docker image to: *demisto/python3:3.10.8.37233*.
##### AutoFocus Feed
- Updated the Docker image to: *demisto/python3:3.10.8.37233*.


text:
'use strict';

(function() {
    // News Controller Spec
    describe('startupwichita controllers', function() {
        describe('NewsController', function() {
            // The $resource service augments the response object with methods for updating and deleting the resource.
            // If we were to use the standard toEqual matcher, our tests would fail because the test values would not match
            // the responses exactly. To solve the problem, we use a newly-defined toEqualData Jasmine matcher.
            // When the toEqualData matcher compares two objects, it takes only object properties into
            // account and ignores methods.
            beforeEach(function() {
                this.addMatchers({
                    toEqualData: function(expected) {
                        return angular.equals(this.actual, expected);
                    }
                });
            });

            // Load the controllers module
            beforeEach(module('startupwichita'));

            // Initialize the controller and a mock scope
            var NewsController,
                scope,
                $httpBackend,
                $stateParams,
                $location;

            // The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).
            // This allows us to inject a service but then attach it to a variable
            // with the same name as the service.
            beforeEach(inject(function($controller, $rootScope, _$location_, _$stateParams_, _$httpBackend_) {

                scope = $rootScope.$new();

                NewsController = $controller('NewsController', {
                    $scope: scope
                });

                $stateParams = _$stateParams_;

                $httpBackend = _$httpBackend_;

                $location = _$location_;

            }));

            it('$scope.find() should create an array with at least one newsItem object ' +
                'fetched from XHR', function() {

                    // test expected GET request
                    $httpBackend.expectGET('/api/v1/news').respond([{
                        title: 'An NewsItem about MEAN',
                        content: 'MEAN rocks!'
                    }]);

                    // run controller
                    scope.find();
                    $httpBackend.flush();

                    // test scope value
                    expect(scope.news).toEqualData([{
                        title: 'An NewsItem about MEAN',
                        content: 'MEAN rocks!'
                    }]);

                });

            it('$scope.findOne() should create an array with one newsItem object fetched ' +
                'from XHR using a newsId URL parameter', function() {
                    var newsItemId = '525a8422f6d0f87f0e407a33';
                    // fixture URL parament
                    $stateParams.newsItemId = newsItemId;

                    // fixture response object
                    var testNewsData = function() {
                        return {
                            _id: newsItemId,
                            title: 'An News item about Start Up Wichita',
                            content: 'Start Up Wichita rocks!'
                        };
                    };

                    // test expected GET request with response object
                    $httpBackend.expectGET('/api/v1/news/' + newsItemId)
                                .respond(testNewsData());

                    // run controller
                    scope.findOne();
                    $httpBackend.flush();

                    // test scope value
                    expect(scope.newsItem).toEqualData(testNewsData());

                });

            it('$scope.create() with valid form data should send a POST request ' +
                'with the form input values and then ' +
                'locate to new object URL', function() {

                    // fixture expected POST data
                    var postNewsData = function() {
                        return {
                            title: 'An NewsItem about MEAN',
                            content: 'MEAN rocks!'
                        };
                    };

                    // fixture expected response data
                    var responseNewsData = function() {
                        return {
                            _id: '525cf20451979dea2c000001',
                            title: 'An NewsItem about MEAN',
                            content: 'MEAN rocks!'
                        };
                    };

                    // fixture mock form input values
                    scope.title = 'An NewsItem about MEAN';
                    scope.content = 'MEAN rocks!';

                    // test post request is sent
                    $httpBackend.expectPOST('/api/v1/news', postNewsData()).respond(responseNewsData());

                    // Run controller
                    scope.create();
                    $httpBackend.flush();

                    // test form input(s) are reset
                    expect(scope.title).toEqual('');
                    expect(scope.content).toEqual('');

                    // test URL location to new object
                    expect($location.path()).toBe('/news/' + responseNewsData()._id);
                });

            it('$scope.update() should update a valid newsItem', inject(function(News) {
                var newsItemId = '525a8422f6d0f87f0e407a33';

                // fixture news item
                var putNewsData = function() {
                    return {
                        _id: newsItemId,
                        title: 'An NewsItem about Start Up Wichita',
                        to: 'Start Up Wichita is great!'
                    };
                };

                // mock newsItem object from form
                var newsItem = new News(putNewsData());

                // mock newsItem in scope
                scope.newsItem = newsItem;

                // test PUT happens correctly
                $httpBackend.expectPUT('/api/v1/news/' + newsItemId).respond();

                // run controller
                scope.update();
                $httpBackend.flush();

                // test URL location to new object
                expect($location.path()).toBe('/news/' + putNewsData()._id);

            }));

            it('$scope.remove() should send a DELETE request with a valid _id' +
                'and remove the newsItem from the scope', inject(function(News) {
                    var newsItemId = '525a8422f6d0f87f0e407a33';

                    // fixture news item
                    var newsItem = new News({
                        _id: newsItemId
                    });

                    // mock news items in scope
                    scope.news = [];
                    scope.news.push(newsItem);

                    // test expected news item DELETE request
                    $httpBackend.expectDELETE('/api/v1/news/' + newsItemId).respond(204);

                    // run controller
                    scope.remove(newsItem);
                    $httpBackend.flush();

                    // test after successful delete URL location news lis
                    //expect($location.path()).toBe('/news');
                    expect(scope.news.length).toBe(0);

                }));
        });
    });
}());


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

	<modelVersion>4.0.0</modelVersion>

	<groupId>cz.znj.kvr.sw.exp.java.camel</groupId>
	<artifactId>camel-exp-base</artifactId>
	<packaging>pom</packaging>
	<version>0.0.1</version>
	<name>Camel experiments base</name>
	<description>Parent of camel experiments</description>

	<parent>
		<groupId>cz.znj.kvr.sw.exp.java</groupId>
		<artifactId>java-exp</artifactId>
		<version>0.0.1</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<properties>
	</properties>

	<modules>
		<module>camel-one</module>
	</modules>

</project>


text:
.class public Lcom/android/setupwizardlib/view/RichTextView;
.super Landroid/widget/TextView;
.source "RichTextView.java"

# instance fields
.field private mAccessibilityHelper:Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    invoke-direct {p0, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    invoke-direct {p0}, Lcom/android/setupwizardlib/view/RichTextView;->init()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0

    invoke-direct {p0, p1, p2}, Landroid/widget/TextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    invoke-direct {p0}, Lcom/android/setupwizardlib/view/RichTextView;->init()V

    return-void
.end method

.method public static getRichText(Landroid/content/Context;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
    .locals 13

    const/4 v8, 0x0

    instance-of v9, p1, Landroid/text/Spanned;

    if-eqz v9, :cond_4

    new-instance v3, Landroid/text/SpannableString;

    invoke-direct {v3, p1}, Landroid/text/SpannableString;-><init>(Ljava/lang/CharSequence;)V

    invoke-virtual {v3}, Landroid/text/SpannableString;->length()I

    move-result v9

    const-class v10, Landroid/text/Annotation;

    invoke-virtual {v3, v8, v9, v10}, Landroid/text/SpannableString;->getSpans(IILjava/lang/Class;)[Ljava/lang/Object;

    move-result-object v4

    check-cast v4, [Landroid/text/Annotation;

    array-length v9, v4

    :goto_0
    if-ge v8, v9, :cond_3

    aget-object v2, v4, v8

    invoke-virtual {v2}, Landroid/text/Annotation;->getKey()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v10, "textAppearance"

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

    move-result v10

    if-eqz v10, :cond_2

    invoke-virtual {v2}, Landroid/text/Annotation;->getValue()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v10

    const-string/jumbo v11, "style"

    invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v10, v6, v11, v12}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v5

    if-nez v5, :cond_0

    const-string/jumbo v10, "RichTextView"

    new-instance v11, Ljava/lang/StringBuilder;

    invoke-direct {v11}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v12, "Cannot find resource: "

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-static {v10, v11}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    new-instance v7, Landroid/text/style/TextAppearanceSpan;

    invoke-direct {v7, p0, v5}, Landroid/text/style/TextAppearanceSpan;-><init>(Landroid/content/Context;I)V

    invoke-static {v3, v2, v7}, Lcom/android/setupwizardlib/span/SpanHelper;->replaceSpan(Landroid/text/Spannable;Ljava/lang/Object;Ljava/lang/Object;)V

    :cond_1
    :goto_1
    add-int/lit8 v8, v8, 0x1

    goto :goto_0

    :cond_2
    const-string/jumbo v10, "link"

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

    move-result v10

    if-eqz v10, :cond_1

    new-instance v1, Lcom/android/setupwizardlib/span/LinkSpan;

    invoke-virtual {v2}, Landroid/text/Annotation;->getValue()Ljava/lang/String;

    move-result-object v10

    invoke-direct {v1, v10}, Lcom/android/setupwizardlib/span/LinkSpan;-><init>(Ljava/lang/String;)V

    invoke-static {v3, v2, v1}, Lcom/android/setupwizardlib/span/SpanHelper;->replaceSpan(Landroid/text/Spannable;Ljava/lang/Object;Ljava/lang/Object;)V

    goto :goto_1

    :cond_3
    return-object v3

    :cond_4
    return-object p1
.end method

.method private hasLinks(Ljava/lang/CharSequence;)Z
    .locals 5

    const/4 v2, 0x0

    instance-of v1, p1, Landroid/text/Spanned;

    if-eqz v1, :cond_1

    move-object v1, p1

    check-cast v1, Landroid/text/Spanned;

    invoke-interface {p1}, Ljava/lang/CharSequence;->length()I

    move-result v3

    const-class v4, Landroid/text/style/ClickableSpan;

    invoke-interface {v1, v2, v3, v4}, Landroid/text/Spanned;->getSpans(IILjava/lang/Class;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Landroid/text/style/ClickableSpan;

    array-length v1, v0

    if-lez v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_0
    move v1, v2

    goto :goto_0

    :cond_1
    return v2
.end method

.method private init()V
    .locals 1

    new-instance v0, Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;

    invoke-direct {v0, p0}, Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;-><init>(Landroid/widget/TextView;)V

    iput-object v0, p0, Lcom/android/setupwizardlib/view/RichTextView;->mAccessibilityHelper:Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;

    iget-object v0, p0, Lcom/android/setupwizardlib/view/RichTextView;->mAccessibilityHelper:Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;

    invoke-static {p0, v0}, Landroid/support/v4/view/ViewCompat;->setAccessibilityDelegate(Landroid/view/View;Landroid/support/v4/view/AccessibilityDelegateCompat;)V

    return-void
.end method

# virtual methods
.method protected dispatchHoverEvent(Landroid/view/MotionEvent;)Z
    .locals 1

    iget-object v0, p0, Lcom/android/setupwizardlib/view/RichTextView;->mAccessibilityHelper:Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/setupwizardlib/view/RichTextView;->mAccessibilityHelper:Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;

    invoke-virtual {v0, p1}, Lcom/android/setupwizardlib/util/LinkAccessibilityHelper;->dispatchHoverEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    return v0

    :cond_0
    invoke-super {p0, p1}, Landroid/widget/TextView;->dispatchHoverEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    return v0
.end method

.method protected drawableStateChanged()V
    .locals 6

    invoke-super {p0}, Landroid/widget/TextView;->drawableStateChanged()V

    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v3, 0x11

    if-lt v2, v3, :cond_1

    invoke-virtual {p0}, Lcom/android/setupwizardlib/view/RichTextView;->getDrawableState()[I

    move-result-object v1

    invoke-virtual {p0}, Lcom/android/setupwizardlib/view/RichTextView;->getCompoundDrawablesRelative()[Landroid/graphics/drawable/Drawable;

    move-result-object v3

    const/4 v2, 0x0

    array-length v4, v3

    :goto_0
    if-ge v2, v4, :cond_1

    aget-object v0, v3, v2

    if-eqz v0, :cond_0

    invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    move-result v5

    if-eqz v5, :cond_0

    invoke-virtual {p0, v0}, Lcom/android/setupwizardlib/view/RichTextView;->invalidateDrawable(Landroid/graphics/drawable/Drawable;)V

    :cond_0
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_1
    return-void
.end method

.method public setText(Ljava/lang/CharSequence;Landroid/widget/TextView$BufferType;)V
    .locals 2

    invoke-virtual {p0}, Lcom/android/setupwizardlib/view/RichTextView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1, p1}, Lcom/android/setupwizardlib/view/RichTextView;->getRichText(Landroid/content/Context;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;

    move-result-object p1

    invoke-super {p0, p1, p2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;Landroid/widget/TextView$BufferType;)V

    invoke-direct {p0, p1}, Lcom/android/setupwizardlib/view/RichTextView;->hasLinks(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {}, Landroid/text/method/LinkMovementMethod;->getInstance()Landroid/text/method/MovementMethod;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/android/setupwizardlib/view/RichTextView;->setMovementMethod(Landroid/text/method/MovementMethod;)V

    :goto_0
    invoke-virtual {p0, v0}, Lcom/android/setupwizardlib/view/RichTextView;->setFocusable(Z)V

    return-void

    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p0, v1}, Lcom/android/setupwizardlib/view/RichTextView;->setMovementMethod(Landroid/text/method/MovementMethod;)V

    goto :goto_0
.end method


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of csubj in UD_Spanish-PUD</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Spanish-PUD: Relations: csubj

This relation is universal.
There are 1 language-specific subtypes of csubj: <tt>csubj:pass</tt>.

40 nodes (0%) are attached to their parents as csubj.

29 instances of csubj (73%) are left-to-right (parent precedes child).
Average distance between parent and child is 4.925.

The following 5 pairs of parts of speech are connected with csubj: <tt>ADJ</tt>-<tt>VERB</tt> (20; 50% instances), <tt>VERB</tt>-<tt>VERB</tt> (10; 25% instances), <tt>NOUN</tt>-<tt>VERB</tt> (6; 15% instances), <tt>ADJ</tt>-<tt>NOUN</tt> (3; 8% instances), <tt>ADJ</tt>-<tt>ADJ</tt> (1; 3% instances).

# visual-style 9	bgColor:blue
# visual-style 9	fgColor:white
# visual-style 2	bgColor:blue
# visual-style 2	fgColor:white
# visual-style 2 9 csubj	color:blue
1	Es	ser	AUX	VBC	Aspect=Imp|Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin|Voice=Act	2	cop	_	_
2	posible	posible	ADJ	JJ	Gender=Masc|Number=Sing	0	root	_	_
3	que	que	SCONJ	IN	_	9	mark	_	_
4	el	el	DET	DT	Definite=Def|Gender=Masc|Number=Sing|PronType=Art	5	det	_	_
5	asunto	asunto	NOUN	NN	Gender=Masc|Number=Sing	9	nsubj	_	_
6	no	_	ADV	RB	Polarity=Neg	9	advmod	_	_
7	se	él	PRON	SE	Case=Acc,Dat|Person=3|PrepCase=Npr|PronType=Prs|Reflex=Yes	9	compound:prt	_	_
8	haya	haber	AUX	VBC	Aspect=Perf|Mood=Sub|Number=Sing|Person=3|Tense=Past|VerbForm=Fin|Voice=Act	9	aux	_	_
9	terminado	terminar	VERB	VBN	Gender=Masc|Number=Sing|Tense=Past|VerbForm=Part	2	csubj	_	_
10	para	para	ADP	IN	_	11	case	_	_
11	Barroso	Barroso	PROPN	NNP	Number=Sing	9	obl	_	SpaceAfter=No
12	.	.	PUNCT	.	_	2	punct	_	_

# visual-style 5	bgColor:blue
# visual-style 5	fgColor:white
# visual-style 10	bgColor:blue
# visual-style 10	fgColor:white
# visual-style 10 5 csubj	color:blue
1	En	en	ADP	IN	_	3	case	_	_
2	este	este	DET	DT	Gender=Masc|Number=Sing|PronType=Dem	3	det	_	_
3	contexto	contexto	NOUN	NN	Gender=Masc|Number=Sing	10	obl	_	SpaceAfter=No
4	,	,	PUNCT	,	_	3	punct	_	_
5	movilizar	movilizar	VERB	VB	VerbForm=Inf	10	csubj	_	_
6	se	él	PRON	SE	Case=Acc,Dat|Person=3|PrepCase=Npr|PronType=Prs|Reflex=Yes	5	compound:prt	_	_
7	contra	contra	ADP	IN	_	9	case	_	_
8	la	el	DET	DT	Definite=Def|Gender=Fem|Number=Sing|PronType=Art	9	det	_	_
9	industria	industria	NOUN	NN	Gender=Fem|Number=Sing	5	obl	_	_
10	tiene	_	VERB	VBC	Aspect=Imp|Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin|Voice=Act	0	root	_	_
11	sentido	sentido	NOUN	NN	Gender=Masc|Number=Sing	10	obj	_	SpaceAfter=No
12	.	.	PUNCT	.	_	10	punct	_	_

# visual-style 4	bgColor:blue
# visual-style 4	fgColor:white
# visual-style 2	bgColor:blue
# visual-style 2	fgColor:white
# visual-style 2 4 csubj	color:blue
1	Su	su	PRON	DTP$	Gender=Masc|Number=Sing|Person=3|Poss=Yes|PronType=Prs	2	det	_	_
2	sueño	sueño	NOUN	NN	Gender=Masc|Number=Sing	0	root	_	_
3	es	ser	AUX	VBC	Aspect=Imp|Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin|Voice=Act	2	cop	_	_
4	terminar	terminar	VERB	VB	VerbForm=Inf	2	csubj	_	_
5	aquí	aquí	ADV	RB	_	4	advmod	_	_
6	su	_	PRON	DTP$	Gender=Fem|Number=Sing|Person=3|Poss=Yes|PronType=Prs	7	det	_	_
7	carrera	carrera	NOUN	NN	Gender=Fem|Number=Sing	4	obj	_	SpaceAfter=No
8	.	.	PUNCT	.	_	2	punct	_	_

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
#include "config.h"

#if USE(3D_GRAPHICS)
#include "TemporaryOpenGLSetting.h"

#if USE(OPENGL_ES_2)
#include <GLES2/gl2.h>
#include "OpenGLESShims.h"
#elif PLATFORM(IOS)
#include <OpenGLES/ES2/gl.h>
#elif PLATFORM(MAC)
#include <OpenGL/gl.h>
#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
#include "OpenGLShims.h"
#endif

namespace WebCore {

TemporaryOpenGLSetting::TemporaryOpenGLSetting(GLenum capability, GLenum scopedState)
    : m_capability(capability)
    , m_scopedState(scopedState)
{
    m_originalState = ::glIsEnabled(m_capability);
    if (m_originalState == m_scopedState)
        return;

    if (GL_TRUE == m_scopedState)
        ::glEnable(m_capability);
    else
        ::glDisable(m_capability);
}

TemporaryOpenGLSetting::~TemporaryOpenGLSetting()
{
    if (m_originalState == m_scopedState)
        return;

    if (GL_TRUE == m_originalState)
        ::glEnable(m_capability);
    else
        ::glDisable(m_capability);
}

}

#endif


text:
require_relative '../../spec_helper'

class AuthSpec
  describe 'auth routes' do
    it 'should show a login page' do
      get '/'
      expect(last_response).to be_ok
      expect(last_response.body).to include 'login'
    end

    it 'should not login without an account' do
      post '/'
      expect(last_response).to be_redirect
      follow_redirect!
      expect(last_response.body).to include 'login'
    end

    it 'should have a signup page' do
      get '/signup'
      expect(last_response).to be_ok
      expect(last_response.body).to include 'name'
      expect(last_response.body).to include 'email'
      expect(last_response.body).to include 'password'
      expect(last_response.body).to include 'Register'
    end

    it 'should not create a new user if passwords dont match' do
      post '/signup', params = {name: "ivan", email: "ivan@ivan.com", password: "123", password_confirmation: "qwe"}
      expect(last_response).to be_redirect
      follow_redirect!
      expect(last_response.body).to include 'name'
      expect(last_response.body).to include 'email'
      expect(last_response.body).to include 'password'
      expect(last_response.body).to include 'Register'
    end

    it 'should redirect the new user to the home page after creating the account' do
      post '/signup', params = {name: "ivan", email: "ivan@ivan.com", password: "123", password_confirmation: "123"}
      expect(last_response).to be_redirect
      follow_redirect!
      expect(last_response.body).to include 'See my teams'
    end
  end
end


text:
__author__ = "philippe giraudeau <philippe@giraudeau.eu>"
__date__ = "01.10.13"
__usage__ = "Hopfield asynhrone"

"""
Etat poubelle. C'est parce que la partie croisé est plus importante que la partie principale.
"""
import numpy as np
import random
import pylab as pl

class Hopfield(object):
    """
    Classe créant un réseau de hopfield. L'apprentissage dans ce réseau fonctionne de manière bipolaire.
    TODO : Rajouter la possibilité de faire du binaire
    TODO : Rajouter une fonction calculant les points fixes de la matrice d'activation

    """

    def __init__(self, pattern, rate=1):
        self.pattern = pattern
        self.nb_neurones = len(self.pattern[0])
        self.nb_motifs = len(self.pattern)

        self.m = np.zeros((self.nb_neurones, self.nb_neurones)) # création matrice des poids
        self.matrix(rate)
        self.f = lambda x: self.active(x)

    def matrix(self, rate=1):
        """
        :param rate: ration d'apprentissage [1,-1]
        :return: None
        """

        for i in self.pattern:
            z = np.array(i, float).reshape(1, self.nb_neurones)
            print(self.m)
            self.m += z * z.T
        self.m /= self.nb_neurones #divise et réaffecte le résultat dans m
        # self.m -= self.m.diagonal() * np.eye(self.nb_neurones)
        print(self.m)

    def bruit(self, bruitage=0.1):
        """
        Bruite un pattern donné en entrée
        :param bruitage: pourcentage du bruit à installer dans le motif
        :return: le pattern bruité
        """
        assert isinstance
        bruitage = int(bruitage*10)
        while bruitage > 0:
            for i in range(len(self.pattern)):
                x = random.randrange(0,len(self.pattern[0]))
                if self.pattern[i][x] != 1 :
                    self.pattern[i][x] = 1
                else:
                    self.pattern[i][x] = -1
            bruitage -= 1

    def learn(self,pat,rate=1.):
        """
            m est la matrice courante, pat est le pattern a apprendre
            rate: facteur
            rate < 0 : oubli
        """
        assert -1 <= rate <= 1, "%s in [-1 .. 1]" % rate
        _sz = len(pat)
        _p = np.array(pat, float).reshape(1, _sz)# crée une matrice de float
        _mp = pat * pat.T

        _mp = _mp / _sz  # pour rester dans des petites valeurs
        _mp -= _mp.diagonal() * np.eye(_sz)
        _mp *= rate

        self.m += _mp

    def calcEnergie(self, matrice, pattern):
        """
        Calcul l'energie
        :param matrice: np.array, matrice d'activation de hopfield
        :param pattern: np.array, vecteur d'entré
        :return: energie: double, l'energie pour le pattern
        """

    def vecActiv(self,f, matrice):
        """
        Applique la fonction d'activation sur le vecteur
        :param f:
        :param matrice:
        :return:
        """
        o = matrice.flat
        return np.array(list(map(f, o))).reshape(matrice.shape)

    def asyn(self,m, y, i):
        """
        :param m: matrice de Hopfield
        :param y: donnee à traiter
        :param i: index a mettre à jour
        :return: x:
        """

        x = self.vecActiv(self.f, np.dot(y, m[..., i]))
        return x

    def active(self,x):
        """
        fonction de seuillage
        si > theta : 1
        si < theta : min
        sinon theta
        """
        if x > 0: return 1
        #if x == 0: return 0
        return -1

    def evoluer(self):
        """
        Methode asynchrone de restitution des données
        :return: None
        """
        for i in self.pattern:
            pattern = np.array(i, float)
            for j in range(self.nb_neurones):
                o = self.asyn(self.m, pattern, j)
                pattern[j] = o
            print("le pattern ", i, "=> ", self.stable(i, pattern))
            #_ = np.array(pattern,float).reshape(5,5)
            #pl.imshow(_, interpolation='nearest', cmap=pl.cm.binary)
            #pl.show()

    def stable(self,data,pat):
        """
        Détermine si la valeur de sortie correspond à la valeur stockée en mémoire
        :param data: valeur de sortie
        :param pat: valeur stockée
        :return:
        """

        if np.all(np.array(data, float) == pat):
           return "100.0"
        else:
            return self.matchTo(pat, data)

    def pas(self):
        """
        Fonction qui prend en argument une matrice d'activation du réseau de hopfield
        :return:
        """
        for _ in self.pattern:

            y = np.array(_)
            out = np.dot(y, self.m) #multiplication de matrice

            print("le pattern ", _, "=> ", self.stable(_, np.sign(out)))

    def matchTo(self,sortie, pat):
        """
        Renvoie le pourcentage de match d'un pattern entrée dans la matrice
        d'activation.
        :param sortie: le pattern de sortie
        :param pat: Le pattern entrée dans la matrice
        :return: pourcentage de reconnaissance. pat == 100, Stable. pat < 100, Non Stable
        """
        match = 0
        for i in range(len(pat)):
            if sortie[i] == pat[i]:
                match +=1
        match = (match/len(pat))*100
        return match


text:
module EventInventory
  module Catalog
    autoload :Base, 'event_inventory/catalog/base'
    autoload :Category, 'event_inventory/catalog/category'
    autoload :Configuration, 'event_inventory/catalog/configuration'
    autoload :Event, 'event_inventory/catalog/event'
    autoload :Performance, 'event_inventory/catalog/performance'
    autoload :Performer, 'event_inventory/catalog/performer'
    autoload :Ticket, 'event_inventory/catalog/ticket'
    autoload :Venue, 'event_inventory/catalog/venue'
  end
end


text:
module Slipway
  # Steps through the deployment process
  class DeployManager < Manager
    def deploy!
      run_welcome
      run_deploys
      run_finished
    end

    private

    def run_welcome
      super
      print_info('Starting Deploy')
    end

    def run_deploys
      app_envs.each { |ae| Deployer.new(ae).deploy! }
    end

    def run_finished
      super
      print_success('Deploy Successful!')
    end
  end
end


text:
/**
 * @module node-opcua-service-secure-channel
 */
// Symmetric algorithms are used to secure all messages other than the OpenSecureChannel messages
// OPC UA Secure Conversation Message Header Release 1.02 Part 6 page 39
import { decodeUInt32, encodeUInt32, UInt32 } from "node-opcua-basic-types";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
import {
    BaseUAObject,
    buildStructuredType,
    initialize_field, StructuredTypeSchema
} from "node-opcua-factory";

const schemaSymmetricAlgorithmSecurityHeader: StructuredTypeSchema = buildStructuredType({
    name: "SymmetricAlgorithmSecurityHeader",

    baseType: "BaseUAObject",

    fields: [
        // A unique identifier for the ClientSecureChannelLayer token used to secure the message
        // This identifier is returned by the server in an OpenSecureChannel response message. If a
        // Server receives a TokenId which it does not recognize it shall return an appropriate
        // transport layer error.
        {name: "tokenId", fieldType: "UInt32", defaultValue: 0xDEADBEEF}
    ]
});

export class SymmetricAlgorithmSecurityHeader extends BaseUAObject {

    public static possibleFields: string[] = ["tokenId"];

    public static schema = schemaSymmetricAlgorithmSecurityHeader;
    public tokenId: UInt32;

    constructor(options?: any) {
        options = options || {};
        super();

        const schema = schemaSymmetricAlgorithmSecurityHeader;

        this.tokenId = initialize_field(schema.fields[0], options.tokenId);
    }

    public encode(stream: OutputBinaryStream): void {
        // call base class implementation first
        super.encode(stream);
        encodeUInt32(this.tokenId, stream);
    }

    public decode(stream: BinaryStream): void {
        // call base class implementation first
        super.decode(stream);
        this.tokenId = decodeUInt32(stream);
    }
}

SymmetricAlgorithmSecurityHeader.prototype.schema = SymmetricAlgorithmSecurityHeader.schema;


text:
#include "SpuGatheringCollisionDispatcher.h"
#include "SpuCollisionTaskProcess.h"

#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
#include "SpuContactManifoldCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "LinearMath/btQuickprof.h"
#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h"

SpuGatheringCollisionDispatcher::SpuGatheringCollisionDispatcher(class	btThreadSupportInterface*	threadInterface, unsigned int	maxNumOutstandingTasks,btCollisionConfiguration* collisionConfiguration)
:btCollisionDispatcher(collisionConfiguration),
m_spuCollisionTaskProcess(0),
m_threadInterface(threadInterface),
m_maxNumOutstandingTasks(maxNumOutstandingTasks)
{

}

bool	SpuGatheringCollisionDispatcher::supportsDispatchPairOnSpu(int proxyType0,int proxyType1)
{
	bool supported0 = (
		(proxyType0 == BOX_SHAPE_PROXYTYPE) ||
		(proxyType0 == TRIANGLE_SHAPE_PROXYTYPE) ||
		(proxyType0 == SPHERE_SHAPE_PROXYTYPE) ||
		(proxyType0 == CAPSULE_SHAPE_PROXYTYPE) ||
		(proxyType0 == CYLINDER_SHAPE_PROXYTYPE) ||
//		(proxyType0 == CONE_SHAPE_PROXYTYPE) ||
		(proxyType0 == TRIANGLE_MESH_SHAPE_PROXYTYPE) ||
		(proxyType0 == CONVEX_HULL_SHAPE_PROXYTYPE)||
		(proxyType0 == STATIC_PLANE_PROXYTYPE)||
		(proxyType0 == COMPOUND_SHAPE_PROXYTYPE)
		);

	bool supported1 = (
		(proxyType1 == BOX_SHAPE_PROXYTYPE) ||
		(proxyType1 == TRIANGLE_SHAPE_PROXYTYPE) ||
		(proxyType1 == SPHERE_SHAPE_PROXYTYPE) ||
		(proxyType1 == CAPSULE_SHAPE_PROXYTYPE) ||
		(proxyType1 == CYLINDER_SHAPE_PROXYTYPE) ||
//		(proxyType1 == CONE_SHAPE_PROXYTYPE) ||
		(proxyType1 == TRIANGLE_MESH_SHAPE_PROXYTYPE) ||
		(proxyType1 == CONVEX_HULL_SHAPE_PROXYTYPE) ||
		(proxyType1 == STATIC_PLANE_PROXYTYPE) ||
		(proxyType1 == COMPOUND_SHAPE_PROXYTYPE)
		);

	return supported0 && supported1;
}

SpuGatheringCollisionDispatcher::~SpuGatheringCollisionDispatcher()
{
	if (m_spuCollisionTaskProcess)
		delete m_spuCollisionTaskProcess;

}

#include "stdio.h"

///interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array, set, map etc)
///this is useful for the collision dispatcher.
class btSpuCollisionPairCallback : public btOverlapCallback
{
	const btDispatcherInfo& m_dispatchInfo;
	SpuGatheringCollisionDispatcher*	m_dispatcher;

public:

	btSpuCollisionPairCallback(const btDispatcherInfo& dispatchInfo, SpuGatheringCollisionDispatcher*	dispatcher)
	:m_dispatchInfo(dispatchInfo),
	m_dispatcher(dispatcher)
	{
	}

	virtual bool	processOverlap(btBroadphasePair& collisionPair)
	{

		//PPU version
		//(*m_dispatcher->getNearCallback())(collisionPair,*m_dispatcher,m_dispatchInfo);

		//only support discrete collision detection for now, we could fallback on PPU/unoptimized version for TOI/CCD
		btAssert(m_dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE);

		//by default, Bullet will use this near callback
		{
			///userInfo is used to determine if the SPU has to handle this case or not (skip PPU tasks)
			if (!collisionPair.m_internalTmpValue)
			{
				collisionPair.m_internalTmpValue = 1;
			}
			if (!collisionPair.m_algorithm)
			{
				btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
				btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;

				btCollisionAlgorithmConstructionInfo ci;
				ci.m_dispatcher1 = m_dispatcher;
				ci.m_manifold = 0;

				if (m_dispatcher->needsCollision(colObj0,colObj1))
				{
					int	proxyType0 = colObj0->getCollisionShape()->getShapeType();
					int	proxyType1 = colObj1->getCollisionShape()->getShapeType();
					bool supportsSpuDispatch = m_dispatcher->supportsDispatchPairOnSpu(proxyType0,proxyType1)
						&& ((colObj0->getCollisionFlags() & btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) == 0)
						&& ((colObj1->getCollisionFlags() & btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) == 0);

					if (proxyType0 == COMPOUND_SHAPE_PROXYTYPE)
					{
						btCompoundShape* compound = (btCompoundShape*)colObj0->getCollisionShape();
						if (compound->getNumChildShapes()>MAX_SPU_COMPOUND_SUBSHAPES)
						{
							//printf("PPU fallback, compound->getNumChildShapes(%d)>%d\n",compound->getNumChildShapes(),MAX_SPU_COMPOUND_SUBSHAPES);
							supportsSpuDispatch = false;
						}
					}

					if (proxyType1 == COMPOUND_SHAPE_PROXYTYPE)
					{
						btCompoundShape* compound = (btCompoundShape*)colObj1->getCollisionShape();
						if (compound->getNumChildShapes()>MAX_SPU_COMPOUND_SUBSHAPES)
						{
							//printf("PPU fallback, compound->getNumChildShapes(%d)>%d\n",compound->getNumChildShapes(),MAX_SPU_COMPOUND_SUBSHAPES);
							supportsSpuDispatch = false;
						}
					}

					if (supportsSpuDispatch)
					{

						int so = sizeof(SpuContactManifoldCollisionAlgorithm);
#ifdef ALLOCATE_SEPARATELY
						void* mem = btAlignedAlloc(so,16);//m_dispatcher->allocateCollisionAlgorithm(so);
#else
						void* mem = m_dispatcher->allocateCollisionAlgorithm(so);
#endif
						collisionPair.m_algorithm = new(mem) SpuContactManifoldCollisionAlgorithm(ci,colObj0,colObj1);
						collisionPair.m_internalTmpValue =  2;
					} else
					{
						collisionPair.m_algorithm = m_dispatcher->findAlgorithm(colObj0,colObj1);
						collisionPair.m_internalTmpValue = 3;
					}
				}
			}
		}
		return false;
	}
};

void	SpuGatheringCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo, btDispatcher* dispatcher)
{

	if (dispatchInfo.m_enableSPU)
	{
		m_maxNumOutstandingTasks = m_threadInterface->getNumTasks();

		{
			BT_PROFILE("processAllOverlappingPairs");

			if (!m_spuCollisionTaskProcess)
				m_spuCollisionTaskProcess = new SpuCollisionTaskProcess(m_threadInterface,m_maxNumOutstandingTasks);

			m_spuCollisionTaskProcess->setNumTasks(m_maxNumOutstandingTasks);
	//		printf("m_maxNumOutstandingTasks =%d\n",m_maxNumOutstandingTasks);

			m_spuCollisionTaskProcess->initialize2(dispatchInfo.m_useEpa);

			///modified version of btCollisionDispatcher::dispatchAllCollisionPairs:
			{
				btSpuCollisionPairCallback	collisionCallback(dispatchInfo,this);

				pairCache->processAllOverlappingPairs(&collisionCallback,dispatcher);
			}
		}

		//send one big batch
		int numTotalPairs = pairCache->getNumOverlappingPairs();
		if (numTotalPairs)
		{
			btBroadphasePair* pairPtr = pairCache->getOverlappingPairArrayPtr();
			int i;
			{
				int pairRange =	SPU_BATCHSIZE_BROADPHASE_PAIRS;
				if (numTotalPairs < (m_spuCollisionTaskProcess->getNumTasks()*SPU_BATCHSIZE_BROADPHASE_PAIRS))
				{
					pairRange = (numTotalPairs/m_spuCollisionTaskProcess->getNumTasks())+1;
				}

				BT_PROFILE("addWorkToTask");
				for (i=0;i<numTotalPairs;)
				{
					//Performance Hint: tweak this number during benchmarking

					int endIndex = (i+pairRange) < numTotalPairs ? i+pairRange : numTotalPairs;
					m_spuCollisionTaskProcess->addWorkToTask(pairPtr,i,endIndex);
					i = endIndex;
				}
			}
			{
				BT_PROFILE("PPU fallback");
				//handle PPU fallback pairs
				for (i=0;i<numTotalPairs;i++)
				{
					btBroadphasePair& collisionPair = pairPtr[i];
					if (collisionPair.m_internalTmpValue == 3)
					{
						if (collisionPair.m_algorithm)
						{
							btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
							btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;

							if (dispatcher->needsCollision(colObj0,colObj1))
							{
								btManifoldResult contactPointResult(colObj0,colObj1);

								if (dispatchInfo.m_dispatchFunc == 		btDispatcherInfo::DISPATCH_DISCRETE)
								{
									//discrete collision detection query
									collisionPair.m_algorithm->processCollision(colObj0,colObj1,dispatchInfo,&contactPointResult);
								} else
								{
									//continuous collision detection query, time of impact (toi)
									btScalar toi = collisionPair.m_algorithm->calculateTimeOfImpact(colObj0,colObj1,dispatchInfo,&contactPointResult);
									if (dispatchInfo.m_timeOfImpact > toi)
										dispatchInfo.m_timeOfImpact = toi;

								}
							}
						}
					}
				}
			}
		}
		{
			BT_PROFILE("flush2");
			//make sure all SPU work is done
			m_spuCollisionTaskProcess->flush2();
		}

	} else
	{
		///PPU fallback
		///!Need to make sure to clear all 'algorithms' when switching between SPU and PPU
		btCollisionDispatcher::dispatchAllCollisionPairs(pairCache,dispatchInfo,dispatcher);
	}
}