text:
package org.apache.geode.management.internal.cli.converters;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.when;

import java.util.Arrays;
import java.util.stream.Collectors;

import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.management.cli.ConverterHint;
import org.apache.geode.test.junit.categories.UnitTest;
import org.apache.geode.test.junit.rules.GfshParserRule;
import org.apache.geode.test.junit.rules.GfshParserRule.CommandCandidate;

@Category(UnitTest.class)
public class RegionPathConverterJUnitTest {
  @ClassRule
  public static GfshParserRule parser = new GfshParserRule();
  private static RegionPathConverter converter;

  private static String[] allRegionPaths = {"/region1", "/region2", "/rg3"};

  @BeforeClass
  public static void before() {
    // this will let the parser use the spied converter instead of creating its own
    converter = parser.spyConverter(RegionPathConverter.class);
    when(converter.getAllRegionPaths())
        .thenReturn(Arrays.stream(allRegionPaths).collect(Collectors.toSet()));
  }

  @Test
  public void testSupports() throws Exception {
    assertThat(converter.supports(String.class, ConverterHint.REGION_PATH)).isTrue();
  }

  @Test
  public void convert() throws Exception {
    assertThatThrownBy(() -> converter.convertFromText("/", String.class, ""))
        .isInstanceOf(IllegalArgumentException.class).hasMessage("invalid region path: /");

    assertThat(converter.convertFromText("region", String.class, "")).isEqualTo("/region");
    assertThat(converter.convertFromText("/region/t", String.class, "")).isEqualTo("/region/t");
  }

  @Test
  public void complete() throws Exception {
    CommandCandidate candidate = parser.complete("destroy region --name=");
    assertThat(candidate.size()).isEqualTo(allRegionPaths.length);
    assertThat(candidate.getFirstCandidate()).isEqualTo("destroy region --name=/region1");

    candidate = parser.complete("destroy region --name=/");
    assertThat(candidate.size()).isEqualTo(allRegionPaths.length);
    assertThat(candidate.getFirstCandidate()).isEqualTo("destroy region --name=/region1");

    candidate = parser.complete("destroy region --name=/region");
    assertThat(candidate.size()).isEqualTo(2);
    assertThat(candidate.getFirstCandidate()).isEqualTo("destroy region --name=/region1");
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

?>

 Integra Rx - Accounts

Complete Patient Account management.
Statements, Payments, Debits & Credits

Aged Debtors reports - see who owes money over 30, 60, 90 days at the touch of a button

View full account history at any Till point

Full Statement run, with all purchased products & prices listed


text:
sapui5-easyfunctionmodules
===============================
A Module to easily call an sap function module from javascript code

This small module allows you to call an SAP function module from javascript.
It also supports a very simple interface to mock these function calls.

Usage is very simple:
-------------------

```
// instantiate the caller
var caller = new FunctionModuleCaller('/path/to/sicf/node/in/your/backend/');

// Call function Z_MY_FUNCTION on the backend giving it some parameters
caller.call('Z_MY_FUNCTION', {	IM_PARAM: 'value1',
								TA_PARAM: [{PROP1:'VAL1'},
								           {PROP1:'VAL2'}
											]
},
function(oBeData){
	//this function is called with the data returned from the backend
});
```

How does it work?
-------------------
The library makes an http call to the url given. In order for this to work with an
sap system, you need to install a custom sicf handler.

The handler will handle the http calls and call the corresponding function module on the system.

This library was designed to work with the json adapter from Cesar Martin:

http://scn.sap.com/community/abap/connectivity/blog/2013/03/05/json-adapter-for-abap-function-modules

https://github.com/cesar-sap/abap_fm_json/blob/master/README.md

Why?
-------------------
Some systems have a lot of function modules already developed and wrapping them in Odata services would
be a prohibitive amount of work. On the other hand, it is also common that the gateway is the backend server (and not a separate instance).
On these systems, it makes a lot of sense to call the function modules directly.

How to use ?
-------------------
Get the code either by cloning this repo or downloading the zip file.

Create an ui5 project with this code under WebContent and upload it to your backend sap server. Suppose it is called Z_EASY_FMS

In the project you want to use this library, you should first .require the file:

```
jQuery.sap.registerModulePath('easyfunctionmodules','/sap/bc/ui5_ui5/sap/Z_EASY_FMS/js/');
jQuery.sap.require('easyfunctionmodules.FunctionModuleCaller');
```

Now you can easily call the function. Check index.html for a complete example

Mocking calls
-------------------
Sometimes it is very usefull to mock a function call altogether: automated testing, complete independence between frontend/backend development.

This library also makes it very simple to mock a function call. Check index.html for an example.


text:
Collection of simple examples and drivers for peripherals for Xilinx processors (Microblaze and ARM Cortex A9 in Zynq). Languages used: C and C++.

Guide on how to use C++ for bare metal apps on Zynq (Zedboard) can be found here:
http://www.vision.put.poznan.pl/?p=182

Guide on how to write drivers for bare metal Xilinx Zynq (Zedboard) in C and C++ can be found here:
http://www.vision.put.poznan.pl/?p=246

# Desciption

* /app_hello_world/ - simple hello world application for Zedboard
* /app_zynq_ps7_timer/ - example app that uses hardware timer through C and C++ style driver
* /linker_scripts/zynq_ddr_10MB_10MB/ - example linker script for Zedboard with 10 MB sections sizes
* /platform/ - code for cache and UART initializaion (copied from example C project in Xilinx SDK)
* /zynq_ps7_timer/ - C and C++ drivers for Zynq PS timer


text:
__author__ = 'mcxiaoke'

from SocketServer import TCPServer, StreamRequestHandler

class Handler(StreamRequestHandler):
    def handle(self):
        addr = self.request.getpeername()
        print 'got connection from', addr
        self.wfile.write('welcome for connecting')
        print self.rfile.read(1024)

ADDRESS = ('', 1234)
server = TCPServer(ADDRESS, Handler)
server.serve_forever()


text:
"use strict";

/**
 * @ngdoc function
 * @name myTestApp.controller:AppController
 * @description
 * # AppController
 * Common application controller
 */
angular
  .module("myTestApp")
  .controller("AppController", function(
    $scope,
    $location,
    $anchorScroll,
    $rootScope,
    $translate,
    $interval,
    VERSION_TAG
  ) {
    /**
     * Cache busting
     */
    $rootScope.VERSION_TAG = VERSION_TAG;

    /**
     * Translations for the view
     */
    var pageTitleTranslationId = "PAGE_TITLE";
    var pageContentTranslationId = "PAGE_CONTENT";

    $translate(pageTitleTranslationId, pageContentTranslationId).then(function(
      translatedPageTitle,
      translatedPageContent
    ) {
      $rootScope.pageTitle = translatedPageTitle;
      $rootScope.pageContent = translatedPageContent;
    });

    /**
     * $scope.locale
     */
    $scope.locale = $translate.use();

    /**
     * Provides info about current route path
     */
    $rootScope.$on("$routeChangeSuccess", function(event, current) {
      $scope.currentPath = current.$$route.originalPath;
    });

    /**
     * Current time
     */
    $scope.currentTime = Date.now();
    $interval(function() {
      $scope.currentTime = Date.now();
    }, 1000);

    /**
     * EVENTS
     */
    $rootScope.$on("$translateChangeSuccess", function(event, data) {
      $scope.locale = data.language;
      $rootScope.pageTitle = $translate.instant(pageTitleTranslationId);
      $rootScope.pageContent = $translate.instant(pageContentTranslationId);
    });

    /**
     * SCROLL TO TOP
     */
    $scope.scrollTo = function(id) {
      $location.hash(id);
      $anchorScroll();
    };
  });


text:
package lscc_test

import (
	"errors"

	"github.com/golang/protobuf/proto"
	"github.com/hyperledger/fabric/bccsp/sw"
	"github.com/hyperledger/fabric/core/chaincode/lifecycle"
	"github.com/hyperledger/fabric/core/common/ccprovider"
	"github.com/hyperledger/fabric/core/scc/lscc"
	"github.com/hyperledger/fabric/core/scc/lscc/mock"
	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"
)

var _ = Describe("LSCC", func() {
	var (
		l                 *lscc.SCC
		fakeSupport       *mock.FileSystemSupport
		fakeCCPackage     *mock.CCPackage
		fakeSCCProvider   *mock.SystemChaincodeProvider
		fakeQueryExecutor *mock.QueryExecutor
		ccData            *ccprovider.ChaincodeData
		ccDataBytes       []byte
		err               error
	)

	BeforeEach(func() {
		fakeCCPackage = &mock.CCPackage{}
		fakeCCPackage.GetChaincodeDataReturns(&ccprovider.ChaincodeData{
			InstantiationPolicy: []byte("instantiation-policy"),
		})

		fakeSupport = &mock.FileSystemSupport{}
		fakeSupport.GetChaincodeFromLocalStorageReturns(fakeCCPackage, nil)

		fakeSCCProvider = &mock.SystemChaincodeProvider{}
		fakeQueryExecutor = &mock.QueryExecutor{}
		cryptoProvider, _ := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore())

		l = &lscc.SCC{
			Support:     fakeSupport,
			SCCProvider: fakeSCCProvider,
			BCCSP:       cryptoProvider,
		}

		ccData = &ccprovider.ChaincodeData{
			Name:                "chaincode-data-name",
			Version:             "version",
			Escc:                "escc",
			Vscc:                "vscc",
			Policy:              []byte("policy"),
			Data:                []byte("data"),
			Id:                  []byte("id"),
			InstantiationPolicy: []byte("instantiation-policy"),
		}

		ccDataBytes, err = proto.Marshal(ccData)
		Expect(err).NotTo(HaveOccurred())

		fakeQueryExecutor = &mock.QueryExecutor{}
		fakeQueryExecutor.GetStateReturns(ccDataBytes, nil)
	})

	Describe("LegacySecurity", func() {
		var (
			fakeCCPackage  *mock.CCPackage
			legacySecurity *lscc.LegacySecurity
			packageCache   *lscc.PackageCache
		)

		BeforeEach(func() {
			fakeCCPackage = &mock.CCPackage{}
			fakeCCPackage.GetChaincodeDataReturns(&ccprovider.ChaincodeData{
				InstantiationPolicy: []byte("instantiation-policy"),
			})

			fakeSupport.GetChaincodeFromLocalStorageReturns(fakeCCPackage, nil)

			packageCache = &lscc.PackageCache{}

			legacySecurity = &lscc.LegacySecurity{
				Support:      fakeSupport,
				PackageCache: packageCache,
			}
		})

		It("returns nil if security checks are passed", func() {
			err := legacySecurity.SecurityCheckLegacyChaincode(ccData)
			Expect(err).NotTo(HaveOccurred())

			Expect(fakeCCPackage.ValidateCCCallCount()).To(Equal(1))
			Expect(fakeCCPackage.ValidateCCArgsForCall(0)).To(Equal(ccData))
		})

		It("caches the result of the package validation", func() {
			err := legacySecurity.SecurityCheckLegacyChaincode(ccData)
			Expect(err).NotTo(HaveOccurred())

			Expect(packageCache.ValidatedPackages).To(HaveKey("chaincode-data-name:version"))
		})

		Context("when cc package validation fails", func() {
			BeforeEach(func() {
				fakeCCPackage.ValidateCCReturns(errors.New("fake-validation-error"))
			})

			It("returns an error", func() {
				err := legacySecurity.SecurityCheckLegacyChaincode(ccData)
				Expect(err).To(MatchError(lscc.InvalidCCOnFSError("fake-validation-error")))
			})

			It("does not cache the result of the package validation", func() {
				legacySecurity.SecurityCheckLegacyChaincode(ccData)

				Expect(packageCache.ValidatedPackages).NotTo(HaveKey("chaincode-data-name:version"))
			})
		})

		Context("when the instantiation policy doesn't match", func() {
			BeforeEach(func() {
				fakeCCPackage.GetChaincodeDataReturns(&ccprovider.ChaincodeData{
					InstantiationPolicy: []byte("bad-instantiation-policy"),
				})
			})

			It("returns an error", func() {
				err := legacySecurity.SecurityCheckLegacyChaincode(ccData)
				Expect(err).To(MatchError("Instantiation policy mismatch for cc chaincode-data-name:version"))
			})
		})
	})

	Describe("ChaincodeEndorsementInfo", func() {
		It("retrieves the chaincode data from the state", func() {
			chaincodeEndorsementInfo, err := l.ChaincodeEndorsementInfo("", "cc-name", fakeQueryExecutor)
			Expect(err).NotTo(HaveOccurred())
			Expect(chaincodeEndorsementInfo).To(Equal(&lifecycle.ChaincodeEndorsementInfo{
				ChaincodeID:       "chaincode-data-name:version",
				Version:           "version",
				EndorsementPlugin: "escc",
			}))

			Expect(fakeQueryExecutor.GetStateCallCount()).To(Equal(1))
			namespace, key := fakeQueryExecutor.GetStateArgsForCall(0)
			Expect(namespace).To(Equal("lscc"))
			Expect(key).To(Equal("cc-name"))
		})

		Context("when the state getter fails", func() {
			BeforeEach(func() {
				fakeQueryExecutor.GetStateReturns(nil, errors.New("fake-error"))
			})

			It("returns the wrapped error", func() {
				_, err := l.ChaincodeEndorsementInfo("", "cc-name", fakeQueryExecutor)
				Expect(err).To(MatchError("could not retrieve state for chaincode cc-name: fake-error"))
			})
		})

		Context("when the state getter does not find the key", func() {
			BeforeEach(func() {
				fakeQueryExecutor.GetStateReturns(nil, nil)
			})

			It("returns an error", func() {
				_, err := l.ChaincodeEndorsementInfo("", "cc-name", fakeQueryExecutor)
				Expect(err).To(MatchError("chaincode cc-name not found"))
			})
		})

		Context("when the state getter returns invalid data", func() {
			BeforeEach(func() {
				fakeQueryExecutor.GetStateReturns([]byte("garbage"), nil)
			})

			It("wraps and returns the error", func() {
				_, err := l.ChaincodeEndorsementInfo("", "cc-name", fakeQueryExecutor)
				Expect(err).To(MatchError(MatchRegexp("chaincode cc-name has bad definition: proto:.*")))
			})
		})
	})

	Describe("ChaincodeDefinitionForValidation", func() {
		BeforeEach(func() {
		})

		It("retrieves the chaincode data from the state", func() {
			vscc, policy, unexpectedErr, validationErr := l.ValidationInfo("", "cc-name", fakeQueryExecutor)
			Expect(validationErr).NotTo(HaveOccurred())
			Expect(unexpectedErr).NotTo(HaveOccurred())
			Expect(vscc).To(Equal(ccData.Vscc))
			Expect(policy).To(Equal(ccData.Policy))

			Expect(fakeQueryExecutor.GetStateCallCount()).To(Equal(1))
			namespace, key := fakeQueryExecutor.GetStateArgsForCall(0)
			Expect(namespace).To(Equal("lscc"))
			Expect(key).To(Equal("cc-name"))
		})

		Context("when the state getter fails", func() {
			BeforeEach(func() {
				fakeQueryExecutor.GetStateReturns(nil, errors.New("fake-error"))
			})

			It("returns the wrapped error", func() {
				_, _, unexpectedErr, validationErr := l.ValidationInfo("", "cc-name", fakeQueryExecutor)
				Expect(unexpectedErr).To(MatchError("could not retrieve state for chaincode cc-name: fake-error"))
				Expect(validationErr).NotTo(HaveOccurred())
			})
		})

		Context("when the state getter does not find the key", func() {
			BeforeEach(func() {
				fakeQueryExecutor.GetStateReturns(nil, nil)
			})

			It("returns an error", func() {
				_, _, unexpectedErr, validationErr := l.ValidationInfo("", "cc-name", fakeQueryExecutor)
				Expect(unexpectedErr).NotTo(HaveOccurred())
				Expect(validationErr).To(MatchError("chaincode cc-name not found"))
			})
		})

		Context("when the state getter returns invalid data", func() {
			BeforeEach(func() {
				fakeQueryExecutor.GetStateReturns([]byte("garbage"), nil)
			})

			It("wraps and returns the error", func() {
				_, _, unexpectedErr, validationErr := l.ValidationInfo("", "cc-name", fakeQueryExecutor)
				Expect(validationErr).NotTo(HaveOccurred())
				Expect(unexpectedErr).To(MatchError(MatchRegexp("chaincode cc-name has bad definition: proto:.*")))
			})
		})
	})
})


text:
'use strict'

function inherit(proto) {
    function F() {}
    F.prototype = proto;
    return new F;
}

function extend(Child, Parent) {
    Child.prototype = inherit(Parent.prototype);
    Child.prototype.cunstructor = Child;
    Child.parent = Parent.prototype;
}

module.exports.extend = extend;


text:
typedef NS_ENUM(NSInteger, InfoViewType) {
    InfoViewTypeDashboard = 0,
    InfoViewTypeBlogPosts,
};

@interface InfoView : UIView

@property (assign, nonatomic) InfoViewType infoType;
@property (strong, nonatomic) BaseButton * iconView;
@property (strong, nonatomic) BaseButton * nameButton;
@property (strong, nonatomic) ReblogNameButton * reblogNameButton;
@property (strong, nonatomic) BaseButton * followButton;

@property (strong, nonatomic) NSLayoutConstraint * InfoViewHeightConstraint;

@end


text:
class OrderItem < ApplicationRecord
  belongs_to :order
  belongs_to :item
end


text:
// Copyright (c) 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/*---
es6id: 22.1.3.1_3
description: Array.prototype.concat Symbol.isConcatSpreadable sparse object
includes: [compareArray.js]
---*/
var obj = { length: 5 };
obj[Symbol.isConcatSpreadable] = true;
assert(compareArray([void 0, void 0, void 0, void 0, void 0], [].concat(obj)));

obj.length = 4000;
assert(compareArray(new Array(4000), [].concat(obj)));


text:
import watchtipstest
import importlib
import unittest

g_module_names = ['appcontrollers', 'auth', 'wtpep8']

def get_suite_from_module_names(module_names):
    suite = unittest.TestSuite()
    for module_name in module_names:
        module = importlib.import_module(module_name)
        module_suite = unittest.TestLoader().loadTestsFromModule(module)
        suite.addTest(module_suite)
    return suite

if __name__ == '__main__':
    suite = get_suite_from_module_names(g_module_names)
    watchtipstest.main(suite)


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of StageController
 *
 * @author Sirojan-T
 */

namespace SettingsBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Login\LoginBundle\Entity\Users;
use Symfony\Component\HttpFoundation\Response;
use SettingsBundle\Entity\Accounttypes;
use SettingsBundle\Entity\Stages;

class StageController extends Controller {

    public function addstageAction(Request $request) {
        $token = $request->getSession()->get('token');
        $em = $this->getDoctrine()->getManager();
        if ($token) {
            $repository = $em->getRepository("LoginLoginBundle:Users");
            $currentUser = $repository->findOneBy(array('username' => $token->getUsername()));
            $fullname = $currentUser->getFirstname() . " " . $currentUser->getLastname();
            return $this->render('SettingsBundle:Default:addStage.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'fullname' => $fullname));
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function addstageV2Action(Request $request) {
        $token = $request->getSession()->get('token');
        $em = $this->getDoctrine()->getManager();
        if ($token) {
            $repository = $em->getRepository("LoginLoginBundle:Users");
            $currentUser = $repository->findOneBy(array('username' => $token->getUsername()));
            $fullname = $currentUser->getFirstname() . " " . $currentUser->getLastname();
            return $this->render('SettingsBundle:Stages:addStageV2.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'fullname' => $fullname));
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function managestagesAction(Request $request) {
        $token = $request->getSession()->get('token');
        if ($token) {
            $em = $this->getDoctrine()->getManager();
            $repository = $em->getRepository("LoginLoginBundle:Users");
            $user = $repository->findOneBy(array('username' => $token->getUsername()));
            $fullname = $user->getFirstname() . " " . $user->getLastname();
            $repository1 = $em->getRepository("SettingsBundle:Stages");
            $stages = $repository1->findBy(array('companyname' => $user->getCompanyname()));
            return $this->render('SettingsBundle:Default:manageStages.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'stages' => $stages, 'fullname' => $fullname));
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function managestagesV2Action(Request $request) {
        $token = $request->getSession()->get('token');
        if ($token) {
            $em = $this->getDoctrine()->getManager();
            $repository = $em->getRepository("LoginLoginBundle:Users");
            $user = $repository->findOneBy(array('username' => $token->getUsername()));
            $fullname = $user->getFirstname() . " " . $user->getLastname();

            $stagesArray = $this->getTableData($token);

            return $this->render('SettingsBundle:Stages:manageStagesV2.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(),
                        'fullname' => $fullname, 'stagesArray' => $stagesArray));
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function tableDataAction(Request $request) {
        $token = $request->getSession()->get('token');
        if ($token) {
            $stagesArray = $this->getTableData($token);
            return new Response($stagesArray);
        } else {
            return new Response(false);
        }
    }

    private function getTableData($token) {
        $em = $this->getDoctrine()->getManager();
        $repository = $em->getRepository("LoginLoginBundle:Users");
        $user = $repository->findOneBy(array('username' => $token->getUsername()));

        $repository1 = $em->getRepository("SettingsBundle:Stages");
        $stages = $repository1->findBy(array('companyname' => $user->getCompanyname()));

        $stagesArray = array();
        foreach ($stages as $stage) {
            //serialize obects to array
            $arrElement["id"] = $stage->getId();
            $arrElement["username"] = $stage->getUsername();
            $arrElement["stage"] = $stage->getName();
            $arrElement["saleChange"] = $stage->getSalechance();
            $arrElement["notes"] = $stage->getNotes();
            $arrElement["status"] = $stage->getStatus();

            array_push($stagesArray, $arrElement);
        }
        $response = array('stages' => $stagesArray);
        return json_encode($response);
    }

    public function validatestageAction(Request $request) {

        $token = $request->getSession()->get('token');
        $em = $this->getDoctrine()->getManager();
        $repository = $em->getRepository("LoginLoginBundle:Users");
        $user = $repository->findOneBy(array('username' => $token->getUsername()));

        $name = $request->get('name');

        if(strtolower($name) == "won" || strtolower($name) == "lost"){
            return new Response("true");
        }

        $repository1 = $em->getRepository("SettingsBundle:Stages");

        $stage = $repository1->findOneBy(array('name' => $name,'companyname' => $user->getCompanyname(),'status'=>"Active"));

        if ($stage) {
            return new Response("true");
        } else {
            return new Response("false");
        }
    }

    public function savestageAction(Request $request) {
        $token = $request->getSession()->get('token');
        $em = $this->getDoctrine()->getManager();
        $repository = $em->getRepository("LoginLoginBundle:Users");
        $repository1 = $em->getRepository("SettingsBundle:Stages");
        if ($token && $request->getMethod() == 'POST' && ($token->getRole() == 'Admin')) {
            $user = $repository->findOneBy(array('username' => $token->getUsername()));
            $fullname = $user->getFirstname() . " " . $user->getLastname();
            $name = $request->get('name');
            $salechance = $request->get('salechance');
            $notes = $request->get('notes');

            $stage = new Stages();
            $stage->setName($name);
            $stage->setSalechance($salechance);
            $stage->setNotes($notes);
            $stage->setStatus("Active");
            $stage->setUsername($token->getUsername());
            $stage->setCompanyname($user->getCompanyname());
            try {
                $em->persist($stage);
                $em->flush();

                $stagesArray = $this->getTableData($token);

                return $this->render('SettingsBundle:Stages:manageStagesV2.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(),
                            'fullname' => $fullname, 'stagesArray' => $stagesArray, 'successmsg' => "Well done ! You successfully add the stage"));
            } catch (Doctrine\ORM\ORMInvalidArgumentException $e) {

                return $this->render('SettingsBundle:Default:addStage.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'fullname' => $fullname, 'errormsg' => 'Invalid Arguments. Try Again'));
            }
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'You need admin login to proceed.'));
        }
    }

    public function editstageAction(Request $request, $id) {
        $token = $request->getSession()->get('token');
        if ($token) {
            $em = $this->getDoctrine()->getManager();

            $repository1 = $em->getRepository("SettingsBundle:Stages");

            $stage = $repository1->findOneBy(array('id' => $id));
            $repository = $em->getRepository("LoginLoginBundle:Users");
            $currentUser = $repository->findOneBy(array('username' => $token->getUsername()));
            $fullname = $currentUser->getFirstname() . " " . $currentUser->getLastname();

            return $this->render('SettingsBundle:Default:editStage.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'stage' => $stage, 'fullname' => $fullname));
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function editstageV2Action(Request $request, $id) {
        $token = $request->getSession()->get('token');
        if ($token) {
            $em = $this->getDoctrine()->getManager();

            $repository1 = $em->getRepository("SettingsBundle:Stages");

            $stage = $repository1->findOneBy(array('id' => $id));
            $repository = $em->getRepository("LoginLoginBundle:Users");
            $currentUser = $repository->findOneBy(array('username' => $token->getUsername()));
            $fullname = $currentUser->getFirstname() . " " . $currentUser->getLastname();

            return $this->render('SettingsBundle:Stages:editStageV2.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'stage' => $stage, 'fullname' => $fullname));
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function deletestageAction(Request $request, $id) {
        $token = $request->getSession()->get('token');
        if ($token) {
            $em = $this->getDoctrine()->getManager();

            $repository1 = $em->getRepository("SettingsBundle:Stages");
            $stage = $repository1->findOneBy(array('id' => $id));
            $stage->setStatus("Inactive");
            try {

                $em->flush();
                $repository = $em->getRepository("LoginLoginBundle:Users");
                $user = $repository->findOneBy(array('username' => $token->getUsername()));
                $fullname = $user->getFirstname() . " " . $user->getLastname();
                $stages = $repository1->findBy(array('companyname' => $user->getCompanyname()));
                $stagesArray = $this->getTableData($token);

                return $this->render('SettingsBundle:Stages:manageStagesV2.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(),
                            'fullname' => $fullname, 'stagesArray' => $stagesArray, 'successmsg' => "Well done ! You successfully delete the stage"));
            } catch (Doctrine\ORM\ORMInvalidArgumentException $e) {
                $repository = $em->getRepository("LoginLoginBundle:Users");
                $user = $repository->findOneBy(array('username' => $token->getUsername()));
                $fullname = $user->getFirstname() . " " . $user->getLastname();
                return $this->render('SettingsBundle:Default:editStage.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'fullname' => $fullname, 'errormsg' => 'Something went wrong. Try Again', 'stage' => $stage));
            }
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function activatestageAction(Request $request, $id) {
        $token = $request->getSession()->get('token');
        if ($token) {
            $em = $this->getDoctrine()->getManager();

            $repository1 = $em->getRepository("SettingsBundle:Stages");
            $stage = $repository1->findOneBy(array('id' => $id));
            $stage->setStatus("Active");
            try {

                $em->flush();
                $repository = $em->getRepository("LoginLoginBundle:Users");
                $user = $repository->findOneBy(array('username' => $token->getUsername()));
                $fullname = $user->getFirstname() . " " . $user->getLastname();

                $stagesArray = $this->getTableData($token);

                return $this->render('SettingsBundle:Stages:manageStagesV2.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(),
                            'fullname' => $fullname, 'stagesArray' => $stagesArray, 'successmsg' => "Well done ! You successfully activate the stage"));

            } catch (Doctrine\ORM\ORMInvalidArgumentException $e) {
                $repository = $em->getRepository("LoginLoginBundle:Users");
                $user = $repository->findOneBy(array('username' => $token->getUsername()));
                $fullname = $user->getFirstname() . " " . $user->getLastname();
                return $this->render('SettingsBundle:Default:editStage.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'fullname' => $fullname, 'errormsg' => 'Something went wrong. Try Again', 'stage' => $stage));
            }
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'Please Login your account before you proceed.'));
        }
    }

    public function updatestageAction(Request $request) {
        $token = $request->getSession()->get('token');
        if ($token && $request->getMethod() == 'POST' && ($token->getRole() == 'Admin')) {
            $em = $this->getDoctrine()->getManager();

            $repository1 = $em->getRepository("SettingsBundle:Stages");
            $id = $request->get('id');
            $stage = $repository1->findOneBy(array('id' => $id));
            $stage->setName($request->get('name'));
            $stage->setSalechance($request->get('salechance'));
            $stage->setNotes($request->get('notes'));
            try {
                $em->flush();
                $repository = $em->getRepository("LoginLoginBundle:Users");
                $user = $repository->findOneBy(array('username' => $token->getUsername()));
                $fullname = $user->getFirstname() . " " . $user->getLastname();
                $stages = $repository1->findBy(array('companyname' => $user->getCompanyname()));
                $stagesArray = $this->getTableData($token);

                return $this->render('SettingsBundle:Stages:manageStagesV2.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(),
                        'fullname' => $fullname, 'stagesArray' => $stagesArray, 'successmsg' => "Well done ! You successfully update the stage"));

                //return $this->render('SettingsBundle:Default:manageStages.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'stages' => $stages, 'fullname' => $fullname, 'successmsg' => "Well done ! You successfully update the stage"));
            } catch (Doctrine\ORM\ORMInvalidArgumentException $e) {
                $repository = $em->getRepository("LoginLoginBundle:Users");
                $user = $repository->findOneBy(array('username' => $token->getUsername()));
                $fullname = $user->getFirstname() . " " . $user->getLastname();
                return $this->render('SettingsBundle:Default:editStage.html.twig', array('name' => $token->getUsername(), 'role' => $token->getRole(), 'stage' => $stage, 'fullname' => $fullname, 'errormsg' => 'Something went wrong. Try Again'));
            }
        } else {

            return $this->render('LoginLoginBundle:Default:signinV2.html.twig', array('errormsg' => 'You need admin login to proceed.'));
        }
    }

    public function getsaleAction(Request $request) {
        $id = $request->get('id');

        $em = $this->getDoctrine()->getManager();
        $repository = $em->getRepository("SettingsBundle:Stages");
        if ($id == 'won') {
            $salechance = '100';
        } else if ($id == 'lost') {
            $salechance = '0';
        } else {
            $stage = $repository->findOneBy(array('id' => $id));
            if ($stage) {
                $salechance = $stage->getSalechance();
            }
        }

        if (intval($salechance) >= 0) {
            return new Response($salechance);
        } else {
            return new Response("false");
        }
    }

}


text:
package jgame;
import gameauthoringenvironment.leveleditor.LevelEditor;
import jgame.impl.JGEngineInterface;
import jgame.impl.Animation;
//import java.awt.*;
//import java.awt.image.ImageObserver;
//import java.io.Serializable;
//import java.net.*;

/** Superclass for game objects, override to define animated game objects.
 * When an object is created, it is automatically registered with the
 * currently running engine.  The object will become active only after the
 * frame ends.  The object is managed by the engine, which will display it and
 * call the move and hit methods when appropriate.  Call remove() to remove
 * the object.  It will be removed after the frame ends.  Use isAlive()
 * to see if the object has been removed or not.

 * <p> Each object corresponds to one image.  The object's appearance can be
 * changed using setImage or any of the animation functions.  If you want
 * multi-image objects, use multiple objects and co-reference them using
 * regular references or using JGEngine's getObject().  You can also define
 * your own paint() method to generate any appearance you want.

 * <p>
 * Objects have a pointer to the engine by which they are managed (eng).  This
 * can be used to call the various useful methods in the engine.
 * Alternatively, the objects can be made inner classes of your JGEngine
 * class, so that they have direct access to all JGEngine methods.

 * <p> The object remembers some of the state of the previous frame (in
 * particular the previous position and bounding boxes), so that corrective
 * action can be taken after something special happened (such as bumping into
 * a wall).

 * <P> Objects have a direction and speed built in.  After their move() method
 * finishes, their x and y position are incremented with the given
 * speed/direction.  Speed may be used as absolute value (leave the direction
 * at 1), or as a value relative to the direction (the movement is speed*dir).
 * The object speed is automatically multiplied by the game speed (which has
 * default 1.0).

 * <P> Objects can be suspended, which may be useful for having them sleep
 * until they come into view.  When suspended, they are invisible, and their
 * move, hit, and paint methods are not called.  Also, they will not expire.
 * They can still be counted by countObjects and removed by removeObjects, if
 * you choose to do so.  By default, objects resume operation when they enter
 * the view.  This can be disabled by means of the resume_in_view setting.  An
 * object that has suspend_off_view enabled will be suspended immediately at
 * creation when it is off view.

 */
public class JGObject {
	protected static int next_id = 0;
	/** global which might be accessed concurrently */
	protected static JGEngineInterface default_engine=null;

	protected static LevelEditor editor_engine=null;
	/** The engine's viewWidth and viewHeight, stored in a local variable
	* for extra speed.*/
	public static int viewwidth,viewheight;
	/** The engine's tileWidth and tileHeight, stored in a local variable
	* for extra speed.*/
	public static int tilewidth,tileheight;
	/** The engine's pfWrap settings, stored in a local variable
	* for extra speed. */
	public static boolean pfwrapx,pfwrapy;
	/** The engine's gamespeed setting, stored in a local variable
	* for extra speed. */
	public static double gamespeed;
	/** The engine's pfWidth/pfHeight, stored in a local variable
	* for extra speed. */
	public static int pfwidth,pfheight;
	/** The engine's viewX/YOfs, stored in a local variable
	* for extra speed. */
	public static int viewxofs,viewyofs;

	/** Set the engine to connect to when a new object is created.  This
	* should be called only by the JGEngine implementation.
	* @param engine  pass null to indicate the engine has exited.
	* @return true if success; false if other engine already running. */
	public static boolean setEngine(JGEngineInterface engine) {
		if (engine==null) {
			default_engine=null;
			return true;
		}
		if (default_engine!=null) return false;
		default_engine=engine;
		if(default_engine instanceof LevelEditor)
		editor_engine=(LevelEditor) engine;
		// copy some constants from engine for fast access
		viewwidth=engine.viewWidth();
		viewheight=engine.viewHeight();
		tilewidth=engine.tileWidth();
		tileheight=engine.tileHeight();
		updateEngineSettings();
		return true;
	}
	public static void resetIDCount(){
		next_id=0;
	}
	/** Called automatically by the engine to signal changes to pfWrap,
	* gameSpeed, pfWidth/Height, viewX/YOfs.  The current values of these
	* settings are stored in the JGObject local variables. */
	public static void updateEngineSettings() {
		pfwrapx = default_engine.pfWrapX();
		pfwrapy = default_engine.pfWrapY();
		gamespeed = default_engine.getGameSpeed();
		pfwidth = default_engine.pfWidth();
		pfheight = default_engine.pfHeight();
		viewxofs = default_engine.viewXOfs();
		viewyofs = default_engine.viewYOfs();
	}

	// remove object creation when changing anim

	/** Print a message to the debug channel, using the object ID as source */
	public void dbgPrint(String msg) { eng.dbgPrint(name,msg); }

	/** Expiry value: never expire. */
	public static final int expire_never=-1;
	/** Expiry value: expire when off playfield. */
	public static final int expire_off_pf=-2;
	/** Expiry value: expire when out of view. */
	public static final int expire_off_view=-3;
	/** Expiry value: suspend when out of view. */
	public static final int suspend_off_view=-4;
	/** Expiry value: suspend when out of view and expire when out of
	* playfield.*/
	public static final int suspend_off_view_expire_off_pf=-5;

	/** Object position */
	public double x=0, y=0;
	/** Object speed; default=0 */
	public double xspeed=0, yspeed=0;
	/** Object direction, is multiplied with speed; default=1 */
	public int xdir=1,ydir=1;
	/** Collision ID */
	public int colid;
	/** Object's global identifier; may not change during the lifetime of the
	 * object. */
	protected String name;
	/** Number of move() steps before object removes itself, -1 (default)
	 * is never; -2 means expire when off-playfield, -3 means expire when
	 * off-view, -4 means suspend when off-view, -5 means suspend when
	 * off-view and expire when off-playfield.  See also the expire_ and
	 * suspend_ constants. */
	public double expiry=-1;
	/** If true, object will automatically start() when it is suspended and in
	 * view.  Default is true. */
	public boolean resume_in_view=true;

	private boolean is_alive=true;
	/** Indicates if object is suspended. */
	public boolean is_suspended=false;

	/** Get object's ID */
	public String getName() { return name; }

	/** Get name of current image. */
	public String getImageName() { return imgname; }

	String imgname=null;
	Animation anim=null; /* will update imgname if set */
	String animid=null;
	/** cached value: has to be recomputed when image changes; simply set to
	 * null to do this. */
	JGRectangle imgbbox=null;
	/** tile bbox is the bbox with offset 0; we have to add the current
	 * coordinate to obtain the actual tile bbox.  Set to null to use regular
	 * bbox instead. */
	JGRectangle tilebbox=null;
	/** The bbox that should override the image bbox if not null. */
	protected JGRectangle bbox=null;

	/** You can use this to call methods in the object's engine.  Even handier
	 * is to have the objects as inner class of the engine. */
	public transient JGEngineInterface eng;

	/* dimensions of last time drawn  */
	double lastx, lasty;
	/* bbox/tilebbox is copied into these variables each time */
	JGRectangle lastbbox_copy=new JGRectangle();
	JGRectangle lasttilebbox_copy=new JGRectangle();
	/* These are equal to lastbbox_copy if bbox was defined, or null
	 * otherwise. */
	JGRectangle lastbbox=null;
	JGRectangle lasttilebbox=null; /* actual coordinates */

	private void initObject(JGEngineInterface engine,
	String name,int collisionid) {
		this.eng=engine;
		this.name=name;
		colid=collisionid;
		// XXX the test on suspend should really be done after the
		// constructor of the subclass is finished, in case the position is
		// changed later in the constructor.

		if ((int)expiry==suspend_off_view
		||  (int)expiry==suspend_off_view_expire_off_pf) {
			if (!isInView(eng.getOffscreenMarginX(),eng.getOffscreenMarginY()))
				suspend();
		}

		eng.markAddObject(this);
	}

	/** Clear tile bbox definition so that we use the regular bbox again. */
	public void clearTileBBox() { tilebbox=null; }

	public void setTileBBox(int x,int y, int width,int height) {
		tilebbox = new JGRectangle(x,y,width,height);
	}

	/** Set bbox definition to override the image bbox.  */
	public void setBBox(int x,int y, int width,int height) {
		bbox = new JGRectangle(x,y,width,height);

	}
	/** Clear bbox definition so that we use the image bbox again. */
	public void clearBBox() { bbox=null; }

	///** Set object's tile span by defining the number of tiles and the margin
	// * by which the object's position is snapped for determining the object's
	// * top left position.  */
	//public void setTiles(int xtiles,int ytiles,int gridsnapx,int gridsnapy){
	//	this.xtiles=xtiles;
	//	this.ytiles=ytiles;
	//	this.gridsnapx=gridsnapx;
	//	this.gridsnapy=gridsnapy;
	//}

	public void setPos(double x,double y) {
		this.x=x;
		this.y=y;
	}

	/** Set absolute speed.  Set xdir, ydir to the sign of the supplied speed,
	 * and xspeed and yspeed to the absolute value of the supplied speed.
	 * Passing a value of exactly 0.0 sets the dir to 0. */
	public void setSpeedAbs(double xspeed, double yspeed) {
		if (xspeed < 0.0) {
			xdir = -1;
			this.xspeed = -xspeed;
		} else if (xspeed == 0.0) {
			xdir = 0;
			this.xspeed = 0;
		} else {
			xdir = 1;
			this.xspeed = xspeed;
		}
		if (yspeed < 0.0) {
			ydir = -1;
			this.yspeed = -yspeed;
		} else if (yspeed == 0.0) {
			ydir = 0;
			this.yspeed = 0;
		} else {
			ydir = 1;
			this.yspeed = yspeed;
		}
	}

	/** Set speed and direction in one go. */
	public void setDirSpeed(int xdir,int ydir, double xspeed, double yspeed) {
		this.xdir=xdir;
		this.ydir=ydir;
		this.xspeed=xspeed;
		this.yspeed=yspeed;
	}

	/** Set speed and direction in one go. */
	public void setDirSpeed(int xdir,int ydir, double speed) {
		this.xdir=xdir;
		this.ydir=ydir;
		this.xspeed=speed;
		this.yspeed=speed;
	}

	/** Set relative speed; the values are copied into xspeed,yspeed. */
	public void setSpeed(double xspeed, double yspeed) {
		this.xspeed=xspeed;
		this.yspeed=yspeed;
	}

	/** Set relative speed; the value is copied into xspeed,yspeed. */
	public void setSpeed(double speed) {
		this.xspeed=speed;
		this.yspeed=speed;
	}

	/** Set direction. */
	public void setDir(int xdir, int ydir) {
		this.xdir=xdir;
		this.ydir=ydir;
	}

	/** Set ID of animation or image to display.  First, look for an animation
	 * with the given ID, and setAnim if found.  Otherwise, look for an image
	 * with the given ID, and setImage if found.  Passing null clears the
	 * image and stops the animation.  */
	public void setGraphic(String gfxname) {
		if (gfxname==null) {
			setImage(gfxname);
		} else {
			Animation newanim = eng.getAnimation(gfxname);
			if (newanim!=null) {
				setAnim(gfxname);
			} else {
				setImage(gfxname);
			}
		}
	}

	/** Set ID of image to display; clear animation. Passing null clears
	* the image. */
	public void setImage(String imgname) {
		this.imgname=imgname;
		imgbbox=null;
		anim=null;
		animid=null;
		//stopAnim();
	}
	/** Get object's current animation ID, or image ID if not defined. */
	public String getGraphic() {
		if (animid!=null) return animid;
		return imgname;
	}

	/* animation */

	/** Set the animation to the given default animation definition, or leave
	 * it as it was if the anim_id is unchanged.  Subsequent changes made in
	 * the animation's parameters do not change the default animation
	 * definition. The changes will be preserved if another call to
	 * setAnimation is made with the same anim_id.  If you want to reset the
	 * animation to the original settings, use resetAnimation().
	 */
	public void setAnim(String anim_id) {
		if (animid==null || !animid.equals(anim_id)) {
			anim = eng.getAnimation(anim_id);
			if (anim==null) {
				eng.dbgPrint(name,"Warning: animation "+anim_id+" not found.");
				return;
			}
			anim = anim.copy();
			animid = anim_id;
			imgname = anim.getCurrentFrame();
		}
	}

	/** Always set the animation to the given default animation definition,
	 * resetting any changes or updates made to the animation. Subsequent
	 * changes made in the animation's parameters do not change the default
	 * animation definition.
	 */
	public void resetAnim(String anim_id) {
		anim = eng.getAnimation(anim_id).copy();
		animid = anim_id;
	}

	/** Clear the animation, the object's current image will remain. */
	public void clearAnim() { anim=null; animid=null; }

	/** Get the ID of the currently running animation. */
	public String getAnimId() { return animid; }

	//public void setAnimIncrement(int increment) {
	//	if (anim!=null) anim.increment=increment;
	//}
	/** Set animation speed; speed may be less than 0, indicating that
	 * animation should go backwards. */
	public void setAnimSpeed(double speed) {
		if (anim!=null) {
			if (speed >= 0) {
				anim.speed=speed;
				anim.increment=1;
			} else {
				anim.speed=-speed;
				anim.increment=-1;
			}
		}
	}
	public void setAnimPingpong(boolean pingpong) {
		if (anim!=null) anim.pingpong=pingpong;
	}
	public void startAnim() { if (anim!=null) anim.start(); }
	public void stopAnim() { if (anim!=null) anim.stop(); }

	/** Reset the animation's state to the start state. */
	public void resetAnim() { if (anim!=null) anim.reset(); }

	/** Create object.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname) {
		if(!unique_id)
			next_id--;
		initObject(default_engine,
				name + (/*unique_id ?*/ ""+(next_id++) /*: ""*/ ), collisionid );

		setPos(x,y);
		lastx = x;
		lasty = y;
		setGraphic(gfxname);
	}

	/** Create object with given expiry.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,int expiry) {
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setPos(x,y);
		lastx = x;
		lasty = y;
		setGraphic(gfxname);
		this.expiry=expiry;
	}

	/** Create object with given tile bbox.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	int tilebbox_x,int tilebbox_y, int tilebbox_width,int tilebbox_height) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setTileBBox(tilebbox_x,tilebbox_y,tilebbox_width,tilebbox_height);
	}

	/** Create object with given tile bbox and expiry.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	int tilebbox_x,int tilebbox_y, int tilebbox_width,int tilebbox_height,
	int expiry) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setTileBBox(tilebbox_x,tilebbox_y,tilebbox_width,tilebbox_height);
		this.expiry=expiry;
	}

	/** Create object with given absolute speed.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	double xspeed, double yspeed) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setSpeedAbs(xspeed,yspeed);
	}

	/** Create object with given absolute speed and expiry.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	double xspeed, double yspeed, int expiry) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setSpeedAbs(xspeed,yspeed);
		this.expiry = expiry;
	}

	/** Create object with given tile bbox and absolute speed.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	int tilebbox_x,int tilebbox_y, int tilebbox_width,int tilebbox_height,
	double xspeed, double yspeed) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setTileBBox(tilebbox_x,tilebbox_y,tilebbox_width,tilebbox_height);
		setSpeedAbs(xspeed,yspeed);
	}

	/** Create object with given tile bbox, absolute speed, expiry.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	int tilebbox_x,int tilebbox_y, int tilebbox_width,int tilebbox_height,
	double xspeed, double yspeed, int expiry) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setTileBBox(tilebbox_x,tilebbox_y,tilebbox_width,tilebbox_height);
		setSpeedAbs(xspeed,yspeed);
		this.expiry = expiry;
	}

	/** Create object with given direction/speed, expiry.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	int xdir, int ydir, double xspeed, double yspeed, int expiry) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setDirSpeed(xdir,ydir,xspeed,yspeed);
		this.expiry = expiry;
	}

	/** Create object with given tile bbox, direction/speed, expiry.
	* @param unique_id  append name with unique ID if unique_id set
	* @param gfxname  id of animation or image, null = no image */
	public JGObject (String name, boolean unique_id,
	double x,double y,int collisionid,String gfxname,
	int tilebbox_x,int tilebbox_y, int tilebbox_width,int tilebbox_height,
	int xdir, int ydir, double xspeed, double yspeed, int expiry) {
		setPos(x,y);
		lastx = x;
		lasty = y;
		initObject(default_engine,
				name + (unique_id ? ""+(next_id++) : "" ), collisionid );
		setGraphic(gfxname);
		setTileBBox(tilebbox_x,tilebbox_y,tilebbox_width,tilebbox_height);
		setDirSpeed(xdir,ydir,xspeed,yspeed);
		this.expiry = expiry;
	}

	/* Bounding box functions.  Return copies. May return null if
	 * image is not defined. */

	/** Copy object collision bounding box in pixels into bbox_copy. Has actual
	* coordinate offset.  If bounding box is not defined, bbox_copy is
	* unchanged.
	* @return false if bbox is null, true if not null  */
	public boolean getBBox(JGRectangle bbox_copy) {
		if (bbox!=null) {
			bbox_copy.x = bbox.x+(int)x;
			bbox_copy.y = bbox.y+(int)y;
			bbox_copy.width = bbox.width;
			bbox_copy.height= bbox.height;
			return true;
		}
		//updateImageBBox();
		// inlined updateImageBBox
		if (imgbbox==null && imgname!=null) {
			imgbbox = eng.getImageBBox(imgname);
		}
		if (imgbbox!=null) {
			bbox_copy.x = imgbbox.x+(int)x;
			bbox_copy.y = imgbbox.y+(int)y;
			bbox_copy.width=imgbbox.width;
			bbox_copy.height=imgbbox.height;
			return true;
		}
		return false;
	}

	/** Get object collision bounding box in pixels.
	* Has actual coordinate offset.
	* @return copy of bbox in pixel coordinates, null if no bbox
	*/
	public JGRectangle getBBox() {
		if (bbox!=null) return new JGRectangle(bbox.x+(int)x, bbox.y+(int)y,
				bbox.width, bbox.height);
		updateImageBBox();
		if (imgbbox!=null) {
			return new JGRectangle(imgbbox.x+(int)x, imgbbox.y+(int)y,
				imgbbox.width, imgbbox.height );
		}
		return null;
	}

	/** Get object collision bounding box for next frame in pixels using speed.
	* Has actual coordinate offset.
	* @return copy of bbox in pixel coordinates, null if no bbox
	*/
	public JGRectangle getNextBBox() {
		if (bbox != null)
			return new JGRectangle(
					bbox.x + (int) x + (int) xspeed,
					bbox.y + (int) y + (int) yspeed,
					bbox.width,
					bbox.height);
		if (imgbbox!=null) {
			return new JGRectangle(
					imgbbox.x + (int) x + (int) xspeed,
					imgbbox.y + (int) y + (int) yspeed,
					imgbbox.width,
					imgbbox.height);
		}
		return null;
	}
	//JGRectangle bbox_const = new JGRectangle(0,0,0,0);

	/** Get object collision bounding box in pixels.
	* Has actual coordinate offset.  Uses a fixed temp variable to store the
	* bbox, so no object is created.  The returned object may not be modified,
	* nor its contents used after the method is re-entered.
	* @return bbox in pixel coordinates, null if no bbox
	*/
	//public JGRectangle getBBoxConst() {
	//	if (!getBBox(bbox_const)) return null;
	//	return bbox_const;
	//}

	/** Get object collision bounding box in pixels of previous frame.
	* @return pixel coordinates, null if no bbox */
//	public JGRectangle getLastBBox() {
//		if (lastbbox==null) return null;
//		return new JGRectangle(lastbbox);
//	}

	/** Get tile collision bounding box in pixels and store it in bbox_copy.
	* Bounding box has actual coordinate offset.  If bounding box is not
	* defined, bbox_copy is unchanged.
	* @return  false when bounding box is not defined, true otherwise */
	public boolean getTileBBox(JGRectangle bbox_copy) {
		if (tilebbox==null) {
			return getBBox(bbox_copy);
		}
		bbox_copy.x = (int)x+tilebbox.x;
		bbox_copy.y = (int)y+tilebbox.y;
		bbox_copy.width = tilebbox.width;
		bbox_copy.height= tilebbox.height;
		return true;
	}

	/** Get tile collision bounding box in pixels.
	* Bounding box has actual coordinate offset.
	* @return  copy of bbox in pixel coordinates, null if no bbox */
	public JGRectangle getTileBBox() {
		if (tilebbox==null) return getBBox();
		return new JGRectangle((int)x+tilebbox.x,(int)y+tilebbox.y,
			tilebbox.width,tilebbox.height);
	}

	//JGRectangle tilebbox_const = new JGRectangle(0,0,0,0);
	/** Get tile collision bounding box in pixels.
	* Bounding box has actual coordinate offset.   Returns reference to a
	* fixed internal variable.  Do not change the object returned, avoid
	* re-entering this method and then using the previous value returned.
	* @return  pixel coordinates, null if no bbox */
	//public JGRectangle getTileBBoxConst() {
	//	if (tilebbox==null) {
	//		JGRectangle bbox = getBBoxConst();
	//		if (bbox==null) return null;
	//		tilebbox_const.copyFrom(bbox);
	//		return tilebbox_const;
	//	}
	//	tilebbox_const.x = (int)x+tilebbox.x;
	//	tilebbox_const.y = (int)y+tilebbox.y;
	//	tilebbox_const.width = tilebbox.width;
	//	tilebbox_const.height= tilebbox.height;
	//	return tilebbox_const;
	//}

	/** Get tile collision bounding box of previous frame.
	* @return  pixel coordinates, null if no bbox */
//	public JGRectangle getLastTileBBox() {
//		if (lasttilebbox==null) return null;
//		return new JGRectangle(lasttilebbox);
//	}

	/** Get collision bounding box of object's image (same as object's default
	* bbox, note that the offset is (0,0) here).
	* @return  copy of bbox's pixel coordinates, null if no bbox */
	public JGRectangle getImageBBox() {
		updateImageBBox();
		if (imgbbox==null) return null;
		return new JGRectangle(imgbbox);
	}

	/** Get collision bounding box of object's image (same as object's default
	* bbox, note that the offset is (0,0) here). Optimised version of
	* getImageBBox().  Do not change the value of the object!
	* @return  *original* bbox's pixel coordinates, null if no bbox */
	public JGRectangle getImageBBoxConst() {
		updateImageBBox();
		return imgbbox;
	}

	/** Update the imgbbox variable. */
	protected void updateImageBBox() {
	//	System.out.println(imgname);
		if (imgbbox==null && imgname!=null) {
			imgbbox = eng.getImageBBox(imgname);
		}
	}

	/** Get x position of previous frame. */
	public double getLastX() { return lastx; }
	/** Get y position of previous frame. */
	public double getLastY() { return lasty; }

	/* snap functions */

	/** Snap object to grid using the default gridsnap margin of
	 * (xspeed*gamespeed-epsilon, yspeed*gamespeed-epsilon),
	 * corresponding to the default is...Aligned margin. */
	public void snapToGrid() {
		x = eng.snapToGridX(x,Math.abs(xspeed*gamespeed-0.001));
		y = eng.snapToGridY(y,Math.abs(yspeed*gamespeed-0.001));
	}

	/** Snap object to grid.
	* @param gridsnapx margin below which to snap, 0.0 is no snap
	* @param gridsnapy margin below which to snap, 0.0 is no snap */
	public void snapToGrid(double gridsnapx,double gridsnapy) {
		x = eng.snapToGridX(x,gridsnapx);
		y = eng.snapToGridY(y,gridsnapy);
	}
	///** Snap object to grid. */
	//public void snapToGrid(int gridsnapx, int gridsnapy) {
	//	JGPoint p = new JGPoint((int)x,(int)y);
	//	eng.snapToGrid(p,gridsnapx,gridsnapy);
	//	x = p.x;
	//	y = p.y;
	//}
	/** Snap an object's tile bbox corner to grid; floats are rounded down.
	* Snaps to bottom or right of object instead of top and left if the resp.
	* flags are set. Note that bottom and right alignment means that the
	* object's bounding box is one pixel away from crossing the tile border.
	* @param snap_right snap the right hand side of the tile bbox
	* @param snap_bottom snap the bottom of the tile bbox */
	public void snapBBoxToGrid(double gridsnapx,double gridsnapy,
	boolean snap_right, boolean snap_bottom) {
		JGRectangle bbox = getTileBBox();
		double bx = x + bbox.x;
		double by = y + bbox.y;
		if (snap_right)  bx += bbox.width;
		if (snap_bottom) by += bbox.height;
		double bxs = eng.snapToGridX(bx,gridsnapx);
		double bys = eng.snapToGridY(by,gridsnapy);
		bxs -= bbox.x;
		bys -= bbox.y;
		if (snap_right)  bxs -= bbox.width;
		if (snap_bottom) bys -= bbox.height;
		x = bxs;
		y = bys;
	}

	/* bg interaction */

	// temp variables used by get*Tiles and isOnScreen/PF
	JGRectangle temp_bbox_copy = new JGRectangle();

	// variables returned by get*Tiles
	JGRectangle tiles_copy = null;
	JGRectangle last_tiles_copy = null;
	JGRectangle center_tiles_copy = new JGRectangle();
	JGRectangle last_center_tiles_copy = null;
	JGPoint center_tile_copy = null;
	JGPoint tl_tile_copy = null;
	/** Get the tile index coordinates of all the tiles that the object's
	* tile bbox overlaps with.  Always returns the same temp object, so no
	* object creation is necessary.
	* @return tile index coordinates, null if no bbox */
	public JGRectangle getTiles() {
		//orig: return eng.getTiles(getTileBBox());
		if (!getTileBBox(temp_bbox_copy)) return null;
		if (tiles_copy==null) tiles_copy = new JGRectangle();
		if (eng.getTiles(tiles_copy,temp_bbox_copy))
			return tiles_copy;
		return null;
	}

	/** Get the tile index coordinates of the object's previous tile bbox.
	* Always returns the same temp object, so no object creation is necessary.
	* @return tile index coordinates, null if no tile bbox */
//	public JGRectangle getLastTiles() {
//		//orig: return eng.getTiles(getLastTileBBox());
//		// XXX object creation in getLastTileBBox
//		JGRectangle bbox = getLastTileBBox();
//		if (bbox==null) return null;
//		if (last_tiles_copy==null) last_tiles_copy = new JGRectangle();
//		if (eng.getTiles(last_tiles_copy,bbox))
//			return last_tiles_copy;
//		return null;
//	}

	/** get center tiles from bbox and store them in tiles_copy */
	private JGRectangle getCenterTiles(JGRectangle bbox,JGRectangle tiles_copy){
		// XXX create a getTileIndexX and Y?
		//JGPoint p =
		//	eng.getTileIndex(bbox.x+(bbox.width/2),bbox.y+(bbox.height/2) );
		int px,py;
		if (bbox.x >= 0) {
			px=((bbox.x+(bbox.width/2))
							/ tilewidth)*tilewidth + tilewidth/2;
			bbox.x = tilewidth * ( (px-(bbox.width /2)) / tilewidth);
		} else {
			px=((bbox.x+(bbox.width/2) - tilewidth+1)
							/ tilewidth)*tilewidth + tilewidth/2;
			bbox.x = tilewidth * ( (px-(bbox.width /2) - tilewidth+1)
														/ tilewidth);
		}
		if (bbox.y >= 0) {
			py=((bbox.y+(bbox.height/2))
							/ tileheight)*tileheight+ tileheight/2;
			bbox.y = tileheight* ( (py-(bbox.height/2)) / tileheight);
		} else {
			py=((bbox.y+(bbox.height/2) - tileheight+1)
							/ tileheight)*tileheight + tileheight/2;
			bbox.y = tileheight * ( (py-(bbox.height /2) - tileheight+1)
														/ tileheight);
		}
		eng.getTiles(tiles_copy, bbox);
		return tiles_copy;
	}

	/** Get the tile indices spanning the tiles that the object has the
	* most overlap with.  The size of the span is
	* always the same as size of the tile bbox in tiles. For example, if the
	* tile bbox is 48x32 pixels and the tile size is 32x32 pixels, the size
	* in tiles is always 1.5x1 tiles, which is rounded up to 2x1 tiles.
	* Always returns the same temp object, so no object creation is necessary.
	*
	* @return  tile index coordinates, null if no tile bbox is defined */
	public JGRectangle getCenterTiles() {
		if (!getTileBBox(temp_bbox_copy)) return null;
		/* find the tile on which the center of the bounding box is located,
		 * that will be the center of our tile span. */
		return getCenterTiles(temp_bbox_copy,center_tiles_copy);
	}

	/** Get the tile indices spanning the tiles that the object's last
	 * bounding box had the most overlap with.
	* Always returns the same temp object, so no object creation is necessary.
	*@return tile index coordinates, null if no tile bbox */
//	public JGRectangle getLastCenterTiles() {
//		// XXX object creation in getLastTileBBox
//		JGRectangle bbox=getLastTileBBox();
//		if (bbox==null) return null;
//		if (last_center_tiles_copy==null)
//			last_center_tiles_copy = new JGRectangle();
//		return getCenterTiles(bbox,last_center_tiles_copy);
//	}

	/** Get the top left center tile of the object (that is, the x and y of
	* getCenterTiles()).  If the object is 1x1 tile in size, you get the
	* center tile.  If the object is larger, you get the top left tile of the
	* center tiles.
	* Always returns the same temp object, so no object creation is necessary.
	* @return tile index coordinate, null if no tile bbox */
	public JGPoint getCenterTile() {
		if (!getTileBBox(temp_bbox_copy)) return null;
		if (center_tile_copy==null) center_tile_copy = new JGPoint();
		// XXX center_tiles_copy is used also
		getCenterTiles(temp_bbox_copy,center_tiles_copy);
		center_tile_copy.x = center_tiles_copy.x;
		center_tile_copy.y = center_tiles_copy.y;
		return center_tile_copy;
	}

	/** Get the topleftmost tile of the object.
	* Always returns the same temp object, so no object creation is necessary.
	* @return tile index coordinate, null if no bbox */
	public JGPoint getTopLeftTile() {
		// XXX this global is used also
		JGRectangle r = getTiles();
		if (r==null) return null;
		if (tl_tile_copy==null) tl_tile_copy = new JGPoint();
		tl_tile_copy.x = r.x;
		tl_tile_copy.y = r.y;
		return tl_tile_copy;
	}

	/** Returns true if both isXAligned() and isYAligned() are true.
	* @see #isXAligned()
	* @see #isYAligned() */
	public boolean isAligned() {
		return isXAligned() && isYAligned();
	}

	/** Returns true if x is distance xspeed-epsilon away from being grid
	* aligned. If an object moves at its current xspeed, this method will
	* always return true when the object crosses the tile alignment line, and
	* return false when the object is snapped to grid, and then
	* moves xspeed*gamespeed away from its aligned position. */
	public boolean isXAligned() {
		return eng.isXAligned(x,Math.abs(xspeed*gamespeed-0.001));
	}

	/** Returns true if y is distance yspeed-epsilon away from being grid
	* aligned. If an object moves at its current yspeed, this method will
	* always return true when the object crosses the tile alignment line, and
	* return false when the object is snapped to grid, and then
	* moves yspeed*gamespeed away from its aligned position. */
	public boolean isYAligned() {
		return eng.isYAligned(y,Math.abs(yspeed*gamespeed-0.001));
	}

	/** Returns true if x is within margin of being tile grid aligned. Epsilon
	 * is added to the margin, so that isXAligned(1.0000, 1.0000)
	 * always returns true. */
	public boolean isXAligned(double margin) {
		return eng.isXAligned(x,margin);
	}

	/** Returns true if y is within margin of being tile grid aligned. Epsilon
	 * is added to the margin, so that isXAligned(1.0000, 1.0000)
	 * always returns true. */
	public boolean isYAligned(double margin) {
		return eng.isYAligned(y,margin);
	}

	/** Returns true if the left of the object's tile bbox is within margin of
	* being tile grid aligned. */
	public boolean isLeftAligned(double margin) {
		JGRectangle bbox = getTileBBox();
		if (bbox!=null) {
			return eng.isXAligned(bbox.x,margin);
		} else {
			return eng.isXAligned(x,margin);
		}
	}

	/** Returns true if the top of the object's tile bbox is within margin of
	* being tile grid aligned. */
	public boolean isTopAligned(double margin) {
		JGRectangle bbox = getTileBBox();
		if (bbox!=null) {
			return eng.isYAligned(bbox.y,margin);
		} else {
			return eng.isYAligned(y,margin);
		}
	}

	/** Returns true if the right of the object's tile bbox is within margin of
	* being tile grid aligned. Note that right aligned means that the bbox is
	* one pixel away from crossing the tile border. */
	public boolean isRightAligned(double margin) {
		JGRectangle bbox = getTileBBox();
		if (bbox!=null) {
			return eng.isXAligned(bbox.x+bbox.width,margin);
		} else {
			return eng.isXAligned(x,margin);
		}
	}

	/** Returns true if the bottom of the object's tile bbox is within margin of
	* being tile grid aligned. Note that right aligned means that the bbox is
	* one pixel away from crossing the tile border. */
	public boolean isBottomAligned(double margin) {
		JGRectangle bbox = getTileBBox();
		if (bbox!=null) {
			return eng.isYAligned(bbox.y+bbox.height,margin);
		} else {
			return eng.isYAligned(y,margin);
		}
	}

	/** Check collision of this object with other objects, when the object
	 * position would be offset by xofs,yofs.  Returns 0 when object's bbox is
	 * not defined.
	 * @param cid  cid mask of objects to consider, 0=any */
	public int checkCollision(int cid, double xofs, double yofs) {
		double oldx=x, oldy=y;
		x += xofs;
		y += yofs;
		int retcid =  eng.checkCollision(cid,this);
		x = oldx;
		y = oldy;
		return retcid;
	}

	/* something odd going on here: it fails to find the checkBGCollision in
	 * Engine when I define this one in Object
	public int checkBGCollision() {
		return eng.checkBGCollision(getTileBBox());
	}*/

	/** Check collision of tiles within given rectangle, return the OR of all
	* cids found.  This method just calls eng.checkBGCollision; it's here
	* because JGEngine.checkBGCollision(JGRectangle) is masked when the object
	* is an inner class of JGEngine.
	*/
	public int checkBGCollision(JGRectangle r) {
		return eng.checkBGCollision(r);
	}

	/** Get OR of Tile Cids of the object's current tile bbox at the current
	* position, when offset by the given offset. Returns 0 if tile bbox is not
	* defined. */
	public int checkBGCollision(double xofs,double yofs) {
		double oldx=x, oldy=y;
		x += xofs;
		y += yofs;
		JGRectangle bbox = getTileBBox();
		x = oldx;
		y = oldy;
		if (bbox==null) return 0;
		return checkBGCollision(bbox);
	}

	/** Margin is the margin beyond which the object is considered offscreen.
	* The tile bounding box is used as the object's size, if there is none, we
	* use a zero-size bounding box.  isOnScreen is equal to isOnPF, but is
	* deprecated because the name is ambiguous.
	* @deprecated Use isOnPF and isInView according to your situation.
	* @param marginx pixel margin, may be negative
	* @param marginy pixel margin, may be negative
	*/
	public boolean isOnScreen(int marginx,int marginy) {
		return isOnPF(marginx,marginy);
	}

	/** Margin is the margin beyond which the object is considered off-view.
	* The tile bounding box is used as the object's size, if there is none, we
	* use a zero-size bounding box.
	* @param marginx pixel margin, may be negative
	* @param marginy pixel margin, may be negative
	*/
	public boolean isInView(int marginx,int marginy) {
		if (!getTileBBox(temp_bbox_copy)) {
			temp_bbox_copy.x = (int)x;
			temp_bbox_copy.y = (int)y;
			temp_bbox_copy.width = 0;
			temp_bbox_copy.height = 0;
		}
		if (temp_bbox_copy.x + temp_bbox_copy.width  < viewxofs-marginx)
			return false;
		if (temp_bbox_copy.y + temp_bbox_copy.height < viewyofs-marginy)
			return false;
		if (temp_bbox_copy.x > viewxofs+viewwidth + marginx)
			return false;
		if (temp_bbox_copy.y > viewyofs+viewheight + marginy)
			return false;
		return true;
	}

	/** Margin is the margin beyond which the object is considered off the
	* playfield.
	* The tile bounding box is used as the object's size, if there is none, we
	* use a zero-size bounding box.
	* @param marginx pixel margin, may be negative
	* @param marginy pixel margin, may be negative
	*/
	public boolean isOnPF(int marginx,int marginy) {
		if (!getTileBBox(temp_bbox_copy)) {
			temp_bbox_copy.x = (int)x;
			temp_bbox_copy.y = (int)y;
			temp_bbox_copy.width = 0;
			temp_bbox_copy.height = 0;
		}
		if (!pfwrapx) {
			if (temp_bbox_copy.x+temp_bbox_copy.width  < -marginx) return false;
			if (temp_bbox_copy.x >pfwidth + marginx) return false;
		}
		if (!pfwrapy) {
			if (temp_bbox_copy.y+temp_bbox_copy.height < -marginy) return false;
			if (temp_bbox_copy.y > pfheight + marginy) return false;
		}
		return true;
	}

	/** A Boolean AND shorthand to use for collision;
	* returns (value&mask) != 0. */
	public static boolean and(int value, int mask) {
		return (value&mask) != 0;
	}

	/** Do automatic animation.  Is automatically called by the JGEngine
	 * implementation once for every
	 * moveObjects; normally it is not necessary to call this.  */
	public void updateAnimation(double gamespeed) {
		if (anim!=null) {// && eng.canvas.anim_running) {
			imgname = anim.animate(gamespeed);
			imgbbox=null;
		}
	}
	/** Signal that a new frame has just been updated; make
	* snapshot of object state.  Should only be called by the JGEngine
	* implementation. */
	public void frameFinished() {
		lastx=x;
		lasty=y;
//		if (getBBox(lastbbox_copy)) {
//			lastbbox = lastbbox_copy;
//		} else {
//			lastbbox=null;
//		}
//		if (getTileBBox(lasttilebbox_copy)) {
//			lasttilebbox = lasttilebbox_copy;
//		} else {
//			lasttilebbox=null;
//		}
	}

	/** Modulo x/y position according to wrap settings. Is automatically
	* performed by the JGEngine implementation
	* after each moveObjects.  Normally it is not necessary to call this, but
	* it may be in special cases.  */
	public void moduloPos() {
		// note: there is an inlined version of this code in EngineLogic
		if (pfwrapx) x = eng.moduloXPos(x);
		if (pfwrapy) y = eng.moduloYPos(y);
	}

	/** Suspend object until either resume is called or, if
	 * resume_in_view is true, when it comes into view.  A suspended object
	 * does not participate in any move, hit, or paint. */
	public void suspend() { is_suspended=true; }
	/** Resume from suspended state, if suspended. */
	public void resume() { is_suspended=false; }

	/** Check if object is suspended. */
	public boolean isSuspended() { return is_suspended; }

	/** Set resume condition.
	* @param resume_in_view resume when in view */
	public void setResumeMode(boolean resume_in_view) {
		this.resume_in_view=resume_in_view;
	}

	/** Check if object is still active, or has already been removed.  Also
	 * returns false if the object is still pending to be removed.  */
	public boolean isAlive() { return is_alive; }

	/** Signal to object that remove is done, don't call directly.  This is
	 * used by the engine to signal that the object should be finalised. */
	public final void removeDone() {
		destroy();
		is_alive=false;
	}

	/** Mark object for removal, ignore if already removed.
	* The object will be removed at the end of this
	* moveObjects, checkCollision, or checkBGCollision action, or immediately
	* if not inside either of these actions.
	*/
	public void remove() {
		if (isAlive()) eng.removeObject(this);
		is_alive=false;
	}

	/** Override to implement object disposal code.  This method is called at
	 * the actual moment of removal. */
	public void destroy() {}

	/** Override to implement automatic move; default is do nothing.
	*/
	public void move() {}

	/** Override to handle collision; default is do nothing.
	*/
	public void hit(JGObject obj) {}

	/** Override to handle tile collision; default is do nothing.
	*/
	public void hit_bg(int tilecid) {}

	/** Override to handle tile collision; default is do nothing.
	* This method is always called when hit_bg(int) is also called, only, extra
	* information is passed that may be useful.
	*/
	public void hit_bg(int tilecid,int tx,int ty, int txsize,int tysize) {}

	/** Override to handle tile collision; default is do nothing.
	* This method is always called when hit_bg(int) is also called, only it may
	* be called multiple times, namely once for each tile the object collides
	* with.  The arguments pass the tile cid and position of that tile.  It is
	* always called after hit_bg(int) and hit_bg(int,int,int,int,int) have
	* been called. */
	public void hit_bg(int tilecid,int tx,int ty) {}

	/** Override to define custom paint actions. */
	public void paint() {}

}


text:
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, UndecidableInstances,
             ScopedTypeVariables #-}

---------------------------------------------------------------------------
-- |
-- Module      :  Control.Concurrent.MState
-- Copyright   :  (c) Nils Schweinsberg 2010
-- License     :  BSD3-style (see LICENSE)
--
-- Maintainer  :  mail@n-sch.de
-- Stability   :  unstable
-- Portability :  portable
--
-- MState: A consistent state monad for concurrent applications.
--
---------------------------------------------------------------------------

module Control.Concurrent.MState
    (
      -- * The MState Monad
      MState
    , module Control.Monad.State.Class
    , runMState
    , evalMState
    , execMState
    , mapMState
    , mapMState_
    -- , withMState
    , modifyM
    , modifyM_

      -- * Concurrency
    , forkM
    , forkM_
    , killMState
    , waitM

      -- * Example
      -- $example
    ) where

import Control.Applicative
import Control.Monad.State.Class
import Control.Monad.Cont
import Control.Monad.Except
import qualified Control.Monad.Fail as Fail
import Control.Monad.Reader
import Control.Monad.Writer

import Control.Concurrent
import Control.Concurrent.STM

import Control.Monad.IO.Peel
import Control.Exception.Peel
import Control.Monad.Trans.Peel

-- | The MState monad is a state monad for concurrent applications. To create a
-- new thread sharing the same (modifiable) state use the `forkM` function.
newtype MState t m a = MState { runMState' :: (TVar t, TVar [(ThreadId, TMVar ())]) -> m a }

-- | Wait for all `TMVars` to get filled by their processes.
waitForTermination :: MonadIO m
                   => TVar [(ThreadId, TMVar ())]
                   -> m ()
waitForTermination = liftIO . atomically . (mapM_ (takeTMVar . snd) <=< readTVar)

-- | Run a `MState` application, returning both, the function value and the
-- final state. Note that this function has to wait for all threads to finish
-- before it can return the final state.
runMState :: MonadPeelIO m
          => MState t m a      -- ^ Action to run
          -> t                 -- ^ Initial state value
          -> m (a,t)
runMState m t = do
  (a, t') <- runAndWaitMaybe True m t
  case t' of
      Just t'' -> return (a, t'')
      _ -> undefined  -- impossible

runAndWaitMaybe :: MonadPeelIO m
                => Bool
                -> MState t m a
                -> t
                -> m (a, Maybe t)
runAndWaitMaybe b m t = do

    myI <- liftIO myThreadId
    myM <- liftIO newEmptyTMVarIO
    ref <- liftIO $ newTVarIO t
    c   <- liftIO $ newTVarIO [(myI, myM)]
    a   <- runMState' m (ref, c) `finally` liftIO (atomically $ putTMVar myM ())
    if b then do
      -- wait before getting the final state
      waitForTermination c
      t'  <- liftIO $ readTVarIO ref
      return (a, Just t')
     else
      -- don't wait for other threads
      return (a, Nothing)

-- | Run a `MState` application, ignoring the final state. If the first
-- argument is `True` this function will wait for all threads to finish before
-- returning the final result, otherwise it will return the function value as
-- soon as its acquired.
evalMState :: MonadPeelIO m
           => Bool              -- ^ Wait for all threads to finish?
           -> MState t m a      -- ^ Action to evaluate
           -> t                 -- ^ Initial state value
           -> m a
evalMState b m t = runAndWaitMaybe b m t >>= return . fst

-- | Run a `MState` application, ignoring the function value. This function
-- will wait for all threads to finish before returning the final state.
execMState :: MonadPeelIO m
           => MState t m a      -- ^ Action to execute
           -> t                 -- ^ Initial state value
           -> m t
execMState m t = runMState m t >>= return . snd

-- | Map a stateful computation from one @(return value, state)@ pair to
-- another. See "Control.Monad.State.Lazy" for more information. Be aware that
-- both MStates still share the same state.
mapMState :: (MonadIO m, MonadIO n)
          => (m (a,t) -> n (b,t))
          -> MState t m a
          -> MState t n b
mapMState f m = MState $ \s@(r,_) -> do
    ~(b,v') <- f $ do
        a <- runMState' m s
        v <- liftIO $ readTVarIO r
        return (a,v)
    liftIO . atomically $ writeTVar r v'
    return b

mapMState_ :: (MonadIO n)
           => (m a -> n b)
           -> MState t m a
           -> MState t n b
mapMState_ f m = MState $ \s -> do
    b <- f $ runMState' m s
    return b

{- TODO: What's the point of this function? Does it make sense for MStates?

-- | Apply a function to the state before running the `MState`
withMState :: (MonadIO m)
           => (t -> t)
           -> MState t m a
           -> MState t m a
withMState f m = MState $ \s@(r,_) -> do
    liftIO . atomically $ do
        v <- readTVar r
        writeTVar r (f v)
    runMState' m s

-}

-- | Modify the `MState`, block all other threads from accessing the state in
-- the meantime (using `atomically` from the "Control.Concurrent.STM" library).
modifyM :: MonadIO m => (t -> (a,t)) -> MState t m a
modifyM f = MState $ \(t,_) ->
    liftIO . atomically $ do
        v <- readTVar t
        let (a,v') = f v
        writeTVar t v'
        return a

modifyM_ :: MonadIO m => (t -> t) -> MState t m ()
modifyM_ f = modifyM (\t -> ((), f t))

fork :: MonadPeelIO m => m () -> m ThreadId
fork m = do
  k <- peelIO
  liftIO . forkIO $ k m >> return ()

-- | Start a new stateful thread.
forkM :: MonadPeelIO m
      => MState t m ()
      -> MState t m ThreadId
forkM m = MState $ \s@(_,c) -> do

    w <- liftIO newEmptyTMVarIO

    tid <- fork $
      -- Use `finally` to make sure our TMVar gets filled
      runMState' m s `finally` liftIO (atomically $ putTMVar w ())

    -- Add the new thread to our waiting TVar
    liftIO . atomically $ do
        r <- readTVar c
        writeTVar c ((tid,w):r)

    return tid

forkM_ :: MonadPeelIO m
       => MState t m ()
       -> MState t m ()
forkM_ m = do
  _ <- forkM m
  return ()

-- | Kill all threads in the current `MState` application.
killMState :: MonadPeelIO m => MState t m ()
killMState = MState $ \(_,tv) -> do
    tms <- liftIO $ readTVarIO tv
    -- run this in a new thread so it doesn't kill itself
    _ <- liftIO . forkIO $
      mapM_ (killThread . fst) tms
    return ()

-- | Wait for a thread to finish
waitM :: MonadPeelIO m => ThreadId -> MState t m ()
waitM tid = MState $ \(_,c) -> do
    mw <- liftIO . atomically $ do
        lookup tid `fmap` readTVar c
    maybe (return ()) wait' mw
  where
    wait' w = liftIO . atomically $ do
        () <- takeTMVar w
        putTMVar w () -- clean up again for "waitForTermination"

--------------------------------------------------------------------------------
-- Monad instances
--------------------------------------------------------------------------------

instance (Fail.MonadFail m) => Fail.MonadFail (MState t m) where
    fail str = MState $ \_ -> Fail.fail str

instance (Monad m) => Monad (MState t m) where
    return a = MState $ \_ -> return a
    m >>= k  = MState $ \t -> do
        a <- runMState' m t
        runMState' (k a) t

instance (Functor f) => Functor (MState t f) where
    fmap f m = MState $ \t -> fmap f (runMState' m t)

instance (Applicative m, Monad m) => Applicative (MState t m) where
    pure  = return
    (<*>) = ap

instance (Alternative m, Monad m) => Alternative (MState t m) where
    empty   = MState $ \_ -> empty
    m <|> n = MState $ \t -> runMState' m t <|> runMState' n t

instance (MonadPlus m) => MonadPlus (MState t m) where
    mzero       = MState $ \_       -> mzero
    m `mplus` n = MState $ \t -> runMState' m t `mplus` runMState' n t

instance (MonadIO m) => MonadState t (MState t m) where
    get     = MState $ \(r,_) -> liftIO $ readTVarIO r
    put val = MState $ \(r,_) -> liftIO . atomically $ writeTVar r val

instance (MonadFix m) => MonadFix (MState t m) where
    mfix f = MState $ \s -> mfix $ \a -> runMState' (f a) s

--------------------------------------------------------------------------------
-- mtl instances
--------------------------------------------------------------------------------

instance MonadTrans (MState t) where
    lift m = MState $ \_ -> m

instance (MonadIO m) => MonadIO (MState t m) where
    liftIO = lift . liftIO

instance (MonadCont m) => MonadCont (MState t m) where
    callCC f = MState $ \s ->
        callCC $ \c ->
            runMState' (f (\a -> MState $ \_ -> c a)) s

instance (MonadError e m) => MonadError e (MState t m) where
    throwError       = lift . throwError
    m `catchError` h = MState $ \s ->
        runMState' m s `catchError` \e -> runMState' (h e) s

instance (MonadReader r m) => MonadReader r (MState t m) where
    ask       = lift ask
    local f m = MState $ \s -> local f (runMState' m s)

instance (MonadWriter w m) => MonadWriter w (MState t m) where
    tell     = lift . tell
    listen m = MState $ listen . runMState' m
    pass   m = MState $ pass   . runMState' m

--------------------------------------------------------------------------------
-- MonadPeel instances
--------------------------------------------------------------------------------

instance MonadTransPeel (MState t) where
    peel = MState $ \t -> return $ \m -> do
        a <- runMState' m t
        return $ return a

instance MonadPeelIO m => MonadPeelIO (MState t m) where
    peelIO = liftPeel peelIO

{- $example

Example usage:

> import Control.Concurrent
> import Control.Concurrent.MState
> import Control.Monad.State
>
> type MyState a = MState Int IO a
>
> -- Expected state value: 2
> main :: IO ()
> main = print =<< execMState incTwice 0
>
> incTwice :: MyState ()
> incTwice = do
>     -- increase in the current thread
>     inc
>     -- This thread should get killed before it can "inc" our state:
>     t_id <- forkM $ do
>         delay 2
>         inc
>     -- Second increase with a small delay in a forked thread, killing the
>     -- thread above
>     forkM $ do
>         delay 1
>         inc
>         kill t_id
>     return ()
>   where
>     inc   = modifyM (+1)
>     kill  = liftIO . killThread
>     delay = liftIO . threadDelay . (*1000000) -- in seconds

-}


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

namespace CloudCompare.Web.FluentSecurity.Policy.ViolationHandlers.Conventions
{
    public interface IPolicyViolationHandlerConvention : IConvention
    {
        IPolicyViolationHandler GetHandlerFor(PolicyViolationException exception);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<params>

	<section name="submit_forms">

		<param name="submit_forms" type="spacer" label="submit_forms"/>

		<param name="submit_forms_list_order_by" type="select" default="title" label="submit_forms_list_order_by" tip="tip_submit_forms_list_order_by">

			<option value="title">title</option>
			<option value="alias">alias</option>
			<option value="create_datetime">create_datetime</option>
			<option value="mod_datetime">mod_datetime</option>

		</param>

		<param name="submit_forms_list_order_by_direction" type="select" default="ASC" label="submit_forms_list_order_by_direction" tip="tip_submit_forms_list_order_by_direction">

			<option value="ASC">ascendant</option>
			<option value="DESC">decrescent</option>

		</param>

	</section>

</params>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using Microsoft.Azure.WebJobs.Description;

namespace Microsoft.Azure.WebJobs.Extensions.SignalRService
{
    /// <summary>
    /// Attribute used to bind necessary information for a SignalR client to connect to SignalR Service.
    /// </summary>
    [AttributeUsage(AttributeTargets.ReturnValue | AttributeTargets.Parameter)]
    [Binding]
    public class SignalRConnectionInfoAttribute : NegotiationBaseAttribute
    {
    }
}


text:
package scrape

import (
	"context"
	"github.com/prometheus/prometheus/pkg/labels"
	"github.com/prometheus/prometheus/storage"
)

type nopAppendable struct{}

func (a nopAppendable) Appender(_ context.Context) storage.Appender {
	return nopAppender{}
}

type nopAppender struct{}

func (a nopAppender) Add(labels.Labels, int64, float64) (uint64, error) { return 0, nil }
func (a nopAppender) AddFast(uint64, int64, float64) error              { return nil }
func (a nopAppender) Commit() error                                     { return nil }
func (a nopAppender) Rollback() error                                   { return nil }

type sample struct {
	metric labels.Labels
	t      int64
	v      float64
}

// collectResultAppender records all samples that were added through the appender.
// It can be used as its zero value or be backed by another appender it writes samples through.
type collectResultAppender struct {
	next             storage.Appender
	result           []sample
	pendingResult    []sample
	rolledbackResult []sample

	mapper map[uint64]labels.Labels
}

func (a *collectResultAppender) AddFast(ref uint64, t int64, v float64) error {
	if a.next == nil {
		return storage.ErrNotFound
	}

	err := a.next.AddFast(ref, t, v)
	if err != nil {
		return err
	}
	a.pendingResult = append(a.pendingResult, sample{
		metric: a.mapper[ref],
		t:      t,
		v:      v,
	})
	return err
}

func (a *collectResultAppender) Add(m labels.Labels, t int64, v float64) (uint64, error) {
	a.pendingResult = append(a.pendingResult, sample{
		metric: m,
		t:      t,
		v:      v,
	})
	if a.next == nil {
		return 0, nil
	}

	if a.mapper == nil {
		a.mapper = map[uint64]labels.Labels{}
	}

	ref, err := a.next.Add(m, t, v)
	if err != nil {
		return 0, err
	}
	a.mapper[ref] = m
	return ref, nil
}

func (a *collectResultAppender) Commit() error {
	a.result = append(a.result, a.pendingResult...)
	a.pendingResult = nil
	if a.next == nil {
		return nil
	}
	return a.next.Commit()
}

func (a *collectResultAppender) Rollback() error {
	a.rolledbackResult = a.pendingResult
	a.pendingResult = nil
	if a.next == nil {
		return nil
	}
	return a.next.Rollback()
}


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterClientsTableAddNewAddressColmuns extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        Schema::table('clients', function (Blueprint $table)
        {

            $table->string('cpf');
            $table->string('shipping_address');
            $table->string('shipping_number');
            $table->string('shipping_neighborhood');
            $table->string('shipping_postalcode');
            $table->string('shipping_city');
            $table->string('shipping_state');
            $table->string('shipping_country');
            $table->string('shipping_complement');
            $table->string('billing_address');
            $table->string('billing_number');
            $table->string('billing_neighborhood');
            $table->string('billing_postalcode');
            $table->string('billing_city');
            $table->string('billing_state');
            $table->string('billing_country');
            $table->string('billing_complement');

        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}


text:
"use strict";

// 串行
function series(callbackList, onfinish, onerror) {
	var index = 0;
	var length = callbackList.length;
	var isFinished = false;

	function next(error, result) {
		if (isFinished) {
			return;
		}

		if (error) {
			isFinished = true;
			onerror(error);
		} else if (index < length) {
			callbackList[index++](next, result);
		} else {
			isFinished = true;
			onfinish(result);
		}
	}

	callbackList[index++](next);
}

// 并行
function parallel(callbackList, onfinish) {
	var count = callbackList.length;
	var index = count;
	var errors = [];
	var results = [];
	var isFinished = false;

	function done(error, result) {
		if (isFinished) {
			return;
		}

		if (error) {
			errors.push(error);
		} else {
			results.push(result);
		}

		if (0 === --index) {
			isFinished = true;
			onfinish(errors, results);
		}
	}

	while (count--) {
		callbackList[count](done);
	}
}

var Callback = {
	__name__ : "Callback",

	series : series,
	parallel : parallel
};

module.exports = Callback;


text:
<?php

namespace Triagens\ArangodbBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class TriagensArangodbBundle extends Bundle
{
}


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>mne.setup_volume_source_space — MNE 0.13.1 documentation</title>

    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/gallery.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootswatch-3.3.6/flatly/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../_static/style.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="top" title="MNE 0.13.1 documentation" href="../index.html" />
    <link rel="up" title="Python API Reference" href="../python_reference.html" />
    <link rel="next" title="mne.bem.make_watershed_bem" href="mne.bem.make_watershed_bem.html" />
    <link rel="prev" title="mne.setup_source_space" href="mne.setup_source_space.html" />

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>

  <link rel="canonical" href="https://mne.tools/stable/index.html" />

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">

        </button>

        0.13.1

Get started

Tutorials

Gallery

API

Manual

FAQ

  Site

Getting started

Tutorials

Examples Gallery

Frequently Asked Questions

Contribute to MNE

Python API Reference

User Manual

What’s new

How to cite MNE

Related publications

Publications from MNE users

  Page

mne.setup_volume_source_space

Examples using mne.setup_volume_source_space

<form class="navbar-form navbar-right" action="../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

mne.setup_volume_source_space

Examples using mne.setup_volume_source_space

    « mne.setup_sou...

    mne.bem.make_... »

<form action="../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

mne.setup_volume_source_space¶

mne.setup_volume_source_space(subject, fname=None, pos=5.0, mri=None, sphere=(0.0, 0.0, 0.0, 90.0), bem=None, surface=None, mindist=5.0, exclude=0.0, overwrite=False, subjects_dir=None, volume_label=None, add_interpolator=True, verbose=None)¶

Setup a volume source space with grid spacing or discrete source space

<col class="field-name" />
<col class="field-body" />

Parameters:
subject : str

Subject to process.

fname : str | None

Filename to use. If None, the source space will not be saved
(only returned).

pos : float | dict

Positions to use for sources. If float, a grid will be constructed
with the spacing given by pos in mm, generating a volume source
space. If dict, pos[‘rr’] and pos[‘nn’] will be used as the source
space locations (in meters) and normals, respectively, creating a
discrete source space. NOTE: For a discrete source space (pos is
a dict), mri must be None.

mri : str | None

The filename of an MRI volume (mgh or mgz) to create the
interpolation matrix over. Source estimates obtained in the
volume source space can then be morphed onto the MRI volume
using this interpolator. If pos is a dict, this can be None.

sphere : array_like (length 4)

Define spherical source space bounds using origin and radius given
by (ox, oy, oz, rad) in mm. Only used if bem and surface are
both None.

bem : str | None

Define source space bounds using a BEM file (specifically the inner
skull surface).

surface : str | dict | None

Define source space bounds using a FreeSurfer surface file. Can
also be a dictionary with entries ‘rr’ and ‘tris’, such as
those returned by mne.read_surface().

mindist : float

Exclude points closer than this distance (mm) to the bounding surface.

exclude : float

Exclude points closer than this distance (mm) from the center of mass
of the bounding surface.

overwrite: bool

If True, overwrite output file (if it exists).

subjects_dir : string, or None

Path to SUBJECTS_DIR if it is not set in the environment.

volume_label : str | None

Region of interest corresponding with freesurfer lookup table.

add_interpolator : bool

If True and mri is not None, then an interpolation matrix
will be produced.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose).

Returns:
src : list

The source space. Note that this list will have length 1 for
compatibility reasons, as most functions expect source spaces
to be provided as lists).

See also

setup_source_space

Notes

To create a discrete source space, pos must be a dict, ‘mri’ must be
None, and ‘volume_label’ must be None. To create a whole brain volume
source space, pos must be a float and ‘mri’ must be provided. To create
a volume source space from label, ‘pos’ must be a float, ‘volume_label’
must be provided, and ‘mri’ must refer to a .mgh or .mgz file with values
corresponding to the freesurfer lookup-table (typically aseg.mgz).

Examples using mne.setup_volume_source_space¶

Generate a left cerebellum volume source space

      Back to top

        © Copyright 2012-2016, MNE Developers. Last updated on 2016-11-21.