I can't get inline to work for this simple function.

I thought I understood [Inline] but my app says otherwise.
I've been using [Inline] with great success for a few months now; however, this quick snippet of code won't [Inline] properly. I know this because I've ran numerous tests with the function looped 100,000 times and I'll get around 400ms with [Inline] and 400ms without [Inline].
I could just be really sleepy and frustrated, but I thought I'd try and learn so that I wouldn't make the same mistake again. So here are the guts of the function in question:
var shared:int = 0;
var length:int = goodRegions[index].length;
for ( var i:int = 0; i < length; ++i ) {
     rect = goodRegions[index][i];
     mRect.x = rect.x + masterX;
     mRect.width = rect.width;
     if ( mRect.x + mRect.width > sRect.x ) {
          shared = i;
          break;
for ( var i:int = shared; i < length; ++i ) {
     rect = goodRegions[index][i];
     mRect.x = rect.x + masterX;
     mRect.y = rect.y + masterY;
     mRect.width = rect.width;
     mRect.height = rect.height;
     if ( sRect.x + sRect.width < mRect.x ) { break; }
There are outside variables I didn't include because they are passed through the function parameters.
I would greatly any help I can get understanding what I'm doing wrong.

Ah you know what, I left out a line:
for ( var i:int = shared; i < length; ++i ) {
     rect = goodRegions[index][i];
     mRect.x = rect.x + masterX;
     mRect.y = rect.y + masterY;
     mRect.width = rect.width;
     mRect.height = rect.height;
     if ( CheckForCollisions( mRect, sRect ) ) { <--------------------------- missing from original post
         if ( sRect.x + sRect.width < mRect.x ) { break; }
Since posting I've actually played around with the removal of the extra function and it started to work properly. I don't understand why my Collision check was making the function ineligible for [Inline]...
But maybe this would help:
[Inline]
private final function CheckForCollisions( rectA:Rectangle, rectB:Rectangle ):Boolean {
  return (( rectA.x < rectB.x + rectB.width - 2 && rectA.x + rectA.width > rectB.x + 2 ) &&
  ( rectA.y < rectB.y + rectB.height - 2 && rectA.y + rectA.height > rectB.y + 2 ));
Is it inappropriate to use an inline function within another inline function? Oh and I'm multi-threading my physics code, so this is being ran on a separate thread/worker.

Similar Messages

  • Can't get itunes to work for windows xp 64 bit

    I can't get itunes to work for windows xp 64 bit. It won't even download.

    These are the Windows requirements according to the iTunes dpownload site http://www.apple.com/uk/itunes/download/http://:
    Windows XP Service Pack 2 or later; 32-bit editions of Windows Vista, Windows 7 or Windows 8
    64-bit editions of Windows Vista, Windows 7 or Windows 8 require the iTunes 64-bit installer
    xp 64 bit is not mentioned but it doesn't seem to be supported for the latest ITunes so it seems that you're out of luck.

  • ...I just bought this and i can't get it o work for me, I had noticed chat windows right up until I

    ..I just bought this and i can't get it o work for me, I had noticed chat windows right up until I Paid for it now I am left alone I need help. or my Money back.  I knopw I am writing to no one.

    Good day,
    How can I help?
    Kind regards,
    David
    Adobe Systems

  • Where can I get a 2nd Tray for this HP 8600 PRO and how much? I am in Brisbane

    Where can I get a 2nd Tray for this HP 8600 PRO and how much? I am in Brisbane
    Thanks
    Ftcukoz

    Hi,
    The brochure says only available in the US or North America only:
       http://www.hp.com/hpinfo/newsroom/press_kits/2011/InnovationforImpact/OJ8600_Series_FeaturesGuide.pd...
    But you can order from the following shop:
       http://www.techbuy.com.au/p/186748/PRINT_ACCESSORIES_PAPER_TRAYS/HP/CN548A.asp
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Can't get Extreme to work for me

    I bought an Airport Extreme in May and just cannot get it to work for me. It most likely has to do with my settings as it seems complicated for me. My ISP refuses to help me other than providing me with some router/IP info. They claim they have had problems with Airport Extremes (anti-Mac) and do not know how to help me and I should contact Apple. My ISP also claims they have been successful with their few Mac clients using NetGear and they can help with that.
    This is depressing to me because I am loyal Mac user and have never had problems with any Mac product. But I can't figure this one out on my own. I do not see phone support for the Airport Extreme and I feel exhausted by this.
    Is anyone is willing to walk me (could be painful) through this or willing to buy my Extreme and I will concede to my pro-Windows ISP. In the end, all I want is one of my computers to be online wireless.
    Sigh.
    Jeanine
    PowerMac G5, dual-2.0 ghz Mac OS X (10.4)

    Hi Jeanine,
    Don't assume that it is just a question of anti-Macness. There are legitimate reasons why an ISP (or a business) decides not to support this weird device. It goes against most of what is considered reasonable by the leading manufacturers, but hey, it's Apple. They usually don't care about that as long as they have loyal customers who still trust Apple.
    I'd say that the critical settings are in the Internet tab. Assuming you have your computer connected to the airport using an Ethernet cable, and that you have the Admin Utility running, go to the Internet Tab and make sure that:
    1. Connect using: Ethernet
    2. Configure IP - It depends. You say that your ISP has given you some router/IP info. In that case, you need to choose "Manually" and enter all the fields following this setting. Otherwise, they might have told you that you will be assigned a DHCP address, and in this case choose "Using DHCP." The last two boxes ("Domain Name" and "DHCP ID") are usually not utilized.
    3. For "Ethernet WAN Port" Automatic should suffice, but in my case, I had to force it to 100 Full Duplex or otherwise wouldn't work. Go figure!
    4. For Connection Sharing, most probably you'll have "Share a public IP address" but if the ISP gives you a set of addresses, you may need to choose "Distribute a Range..." Not probable, though.
    Leave the other two tabs as default, but make sure that your computer has DHCP enabled.
    Following this steps won't give you a fully working wireless network (we have not configured anything yet) but at least should give you a working state for computers connected via Ethernet wire. We can take the next step then.
    Good luck. This router (and the iPhone for similar reasons) are going to make may Apple loyal customers rethink future purchases. It has certainly happened to me.
    Paco

  • Can't get Themes to work for movie using iMovie on ipad

    I finsished a trailer using iMovie on my iPad successfully and LOVED it! Sooo fun!
    Now I'm trying to make a movie for a friend's wedding, but I can't get it to work with the themes. When I select my theme and start a new project using a few pictures the theme music works when I replay, but no visual elements of the theme I selected show up (or available for selection). when I click on the gear wheel, it does show what theme I selected.... What am I missing???? The only place the theme shows up is on the tile in the "projects" section.
    Then I tried the same thing on my iphone 4S (iOS7) and the same thing happens.
    I looked at the tutuorials etc...and I think Im doing it right (after all, I got the trailer to work perfectly) and I think I'm not technologically challanged - but I just would like to have the theme visual elements to show up.
    Please help
    Mir

    Tap the Transition points and choose the star icon.  This is for theme associated transitions including their graphic elements.

  • Since i can't get Adobe to work for my games on ipad what do i do

    I can't get Adobe to work on my IPAD, i get something that says Adobe and apple are having problems. Is there anything else i can use other than Adobe flash?

    Flash is not supported on the iPad, and probably never will be.
    Depending on what sites you are trying to access, you might find that some of them (probably more so if they are news sites) have their own apps in the App Store which might let you get some of the content that you want (and there is the built-in YouTube app). Also there are browsers such as Skyfire, iSwifter, and Puffin which 'work' on some sites - but judging by the reviews not all sites. If you want to play flash games then you are probably out of luck if you want to play on-line though the iSwifter app might work on some of them, but again some flash games have app versions in the store.

  • TS4268 I can't get iMessage to work on this device.  Help

    I had an iPhone 4. Recently moved out of service area using iPad 2. Can't get iMessage to work. Keeps saying message not sent
    Help. This is my only contact with my boyfriend and I'm in a foreign country

    iMessage not sending - Settings>Messages>Show Subject Field. Make sure it's set to "Off".

  • I bought a magic mouse today, they told it would work with the new iPad, I can't get it to work for me, does anyone know how or if it works?

    I bought a magic mouse, was told it works with the iPad, how can I get it too?

    A mouse, which is a pointing device, will not work with an iPad...there is no cursor for the mouse to move around.  You must use the touch screen.

  • Can I possibly get Premiere to work for this project?

    Hi. I am working on a time lapse scanner photography project. I scan flowers a few times an hour and then make videos of them drying out. I'm currently making a movie of it all. The thing is, the scans can be thousands of pixels high/wide. The problem arises when I make sequences with 20 or more of these videos (scaled down to around 10% in Premiere) moving together. It becomes almost unusable on my older Macbook Pro. Doing the more complex parts of it is also very inconvenient on a new iMac. Because I'm working with so many files, I tried out After Effects. Its proxying feature excited me, but it soon became clear that AE is meant mostly for shorter projects, and not for clips that can get 40 GB + in size. For example, in trying to make tiny proxies of clips last night, only four succeeded. It seems that the rendering is centered on your available RAM, and when it runs out (a few seconds into the first clip) rendering becomes very slow. This might work for ads or something, but not for this project. Maybe I'm not using it correctly though.
    So I don't know what to do. I've tried a proxy workaround for Premiere, but that seems to involve working with clips at the resolution you made the proxy at, unlike AE where you can work with a now-more-blurry version of your main file. I tried making a tiny proxy manually, and then upscaling it in Quicktime Pro 7, but that seems to also be slow for Premiere, leading me to think that multiplying the one clip in my test sequence by 20 or more wouldn't be that different.
    Does anyone have any ideas as to how do edit a project like this with a reasonably responsive UI? I don't care if I have to spend hours rendering proxies, or rendering the final copy afterwards, I just want to be able to edit without waiting for minutes when I click on a 20 layer part of the movie. I understand that this is probably an abnormal way of using Premiere, as normally one only uses a few layers at a time.
    Another idea I had was to do the parts of the movie with 20+ layers in AE, and import them in Premiere to get around AE's focus on shorter lengths. But this doesn't get around the issue that its proxying feature, and rendering engine in general seems to be tailoured towards shorter projects. If you are confused, that's okay, I can elaborate more and provide pictures.
    Here's some single videos from the project:
    http://www.momentaryvitality.ca/
    Thanks!

    ATI cards will not work for GPU acceleration of the Mercury Playback Engine and only Nvidia cards with at least 1 GB or RAM and at least 96 CUDA cores will allow for a good experience when using the GPU enable Mercury Playback Engine.  I have a mediocre GT 240 with 1GB of RAM and it rocks. It is much better than using the software only mode. Software only mode is not bad but GPU enabled is so much better. You will have to trust me on that. A new Macbook Pro would not be wise. In fact $900.00 Dell or HP with at least 96 CUDA cores and 1 GB of RAM would be a much better option. You could in theory get a mediocre $600.00 Quad Core from Best Buy and then buy either a $70.00 Nvidia GT 240 graphics card or even a $135.00 GTX 550 graphics card to put in the system. That would work just as well.

  • Can't get audio to work for HD DVD

    Anyone have any insight into what audio enoding works for HD DVD? I've tried both aiff and ac-3 to go along with MPEG2 video and my Toshiba HD A2 won't play back sound from either type. Help!

    I have used both on the Toshiba A2. I assume the build file had sound when you tested it in the Apple DVD Player?
    I have not played with the audio settings much on the Toshiba, do not know if there is a setting there that can change things.
    I can take a look and run some tests to see if I can get it happening. Also if you like I can put together a small project to see if you can also get it to run.

  • Can't get printer to work for my life

    kernel 2.6.25
    printer: HP  laserjet 4
    usb
    CUPS
    Even if printer is on at boot, printer won't work.
    This has happened before, and I can usually get it working after fiddling with it for 10-15 minutes, then it stops working promptly.
    I had it working a few nights ago, now it has stopped again.
    dmesg
    input: Video Bus as /class/input/input6
    usblp0: USB Bidirectional printer dev 3 if 0 alt 1 proto 2 vid 0x0557 pid 0x2006
    usbcore: registered new interface driver usblp
    sdhci: Secure Digital Host Controller Interface driver
    What should the URI for a usb printer be?
    USB is not an option for "Device for PrinterName" in the CUPS web interface
    I can print from vbox on this machine, so this is slightly less urgent.
    Last edited by Raccoon1400 (2008-06-18 23:07:06)

    Raccoon1400 wrote:
    There is no hub. The laptop has 2 ports on the front, 2 on the back, with the printer plugged into the back.
    If it matters, this is a parallel printer, with a parallel to usb cable connecting it to the machine.
    Now that we know the usb port number the printer is plugged into, we should be able to figure out the uri.
    EDIT: lsubs shows the same whether printer is on or not.
    An adapter, my mistake.
    I had a parallel printer plugged into a USB port through an adapter for a while, and it exhibited the same behavior. My "solution" was to delete the printer and then recreate in CUPS. Sometimes the interface would reappear and sometimes it wouldn't.
    Dusty started a thread about this a while back, and I was the last one to answer. Maybe you can get a hold of him and see if he had any success.

  • Can not get JSP to work for the first time.

    This is my first attempt to write JSPs. When TOMCAT attempts to render my first java server page TOMCAT reports the following two errors:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: Invalid class file format in C:\j2sdk1.4.0_01\jre\lib\rt.jar(java/lang/Object.class). The major.minor version '48.0' is too recent for this tool to understand.
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\JobEntry\HeadingExample$jsp.java:0: Class java.lang.Object not found in class javax.servlet.GenericServlet.
    package org.apache.jsp;
    I am on an XP box, running jwsdp-1_0_01, j2sdk1.4.0_01, and TOMCAT 4.04.

    You might want to try downloading a newer Tomcat Version 4.1.18 works well. Follow the URL below. I have tried this version with the SDK 1.4 in the past, without problems. It might be that your older version of Tomcat just doesn't like the 1.4 SDK. Would take 5 minutes max on a decent http connection to DL and install.
    http://jakarta.apache.org/site/binindex.cgi

  • Can't get paypal to work?  This may help.

    Well, 24 hours after my 32 GB ipod touch purchase, I am not an apple fan. I had a very typical experience, I have windows 7 32bit on a Dell XPS laptop M1530, I downloaded a fresh version of iTunes (9.2.1.5), I upgraded the ipod to newest version (iOS4). Why did I spend so much time getting this stuff to work? I did get it to work, but support was useless and blamed microsoft (in fact I didn't do all the steps correctly).
    Anyway a few things I figured out. Before you begin, you need a valid paypal account. You also need internet explorer. This doesn't work on Chrome for whatever reason. You can go to start menu -> Default programs to change web requests to open up IE instead of chrome (then just change it back when you are done with paypal activation).
    Also, you need to have activated the computer for use with itunes. Why that's not done when you install is a mystery. From the menu bar at the very top of itunes, go to the store menu, and select 'activate my computer'. Note, you can only have 5 active computers, but you can deactivate all of them. The only way to deactivate individual computers is to have them connected to the network and with itunes, and just go store -> deactivate computer. If the computer is not activated the process will also fail when paypal redirects back to the itunes app.
    Next, create/update your itunes account. When you get to the payment options, you select paypal. That launches a web browser. Again, chrome didn't work for me. You go through the paypal logins. When you are done you should get two warning messages, one to display only secure or all content (hit 'no'). The other warning mentions that you are launching an app from a web browser. Click allow (or yes or whatever).
    The process should bring you back to itunes purchase setup. Scroll down to the bottom, hit 'done'. To verify, I log out and log back in again, and look up your account info. It should have paypal. Note, once you get this set up, you don't really have to screw with it again I think.
    The other tidbit I have is that once you download the apps (click the price tag on the app) you need to sync your ipod. If you click on your ipod on the left menu, then click on apps, select all and click apply on bottom right of screen. That should work.

    Also, you need to have activated the computer for use with itunes. Why that's not done when you install is a mystery.
    Because you don't need an iTunes account tio use or install iTunes.
    You cannot authorize the computer until you have an account because that's what you are authorizing.
    Note, you can only have 5 active computers, but you can deactivate all of them.
    You can have 5 computers authorized at any one time. You can only select Deauthorize all when you do hae 5 authorized and you can only do it one time per year.
    Next, create/update your itunes account.
    Again you cannot "activate" (which is authorize) unless you have an iTunes account. So you cannot authorize iTunes and then create an iTunes account.

  • Can't get breaks to work - Is this tool intuitive??

    I've got a fairly simple report that lists company data, 1 per line, and I need to have a page break when the state changes. The report already exists without the state grouping and I don't have a clue how to get this to work. I've added the new group to the data section but can't seem to get it into the layout. Tried frames but can't get one to encompass the other groups/frames. It's always is placed at the same level as the others. I've tried move/send back/front in every conceivable combination. Is there any good documentation to help on this? I've spent days on this and am getting nowhere - and very frustrated. Seems this kind of thing should be a no-brainer for a report writer.

    Hi Andy,
    It sounds like you may need to turn off confine mode in order to have the back to front work. If you have Tools->Preferences->Runtime Settings->Run Debug turned off, then any warnings that you might get trying to do this with confine mode turned on might be surpressed.
    In general, what I would try doing is turning on flex mode and using the frame select tool to grab the top most repeating frame and everything in it and move it a bit so you have some room to work in. You might also want to zoom in. Then create your new repeating frame so that it's bigger than the old repeating frame but smaller than whatever frame is enclosing it and move it to teh appropriate level. You'll probably have to turn confine mode off to do this. Once you have set at the right level according to the object navigator, you can still use flex mode while moving everything back to the correct place.
    For getting the page break, just put a maximum of one record per page in the property palette of the new repeating frame. Hope this helps and it's not just a rehash of the stuff you've tried. I've done this before and it worked for me, so hopefully it will work for you too!
    Cheers,Toby

Maybe you are looking for

  • Career Help Needed for me and my wife..your suggestion would surely help!

    Hi Guys, I would really appreciate if you can solve our mid career Dilemma. Me and my wife both want to get in to SAP..Kindly suggest which module should we pick.. My Wife's Profile: She is an Economics honors  graduate and an MBA too. she has got 7

  • Is it possible to record FaceTime HD video in 30 fps?

    I need to record in at least 1280 x 720, 30 fps, 44000hz 24 bit audio from the built-in camera in my iMac Retina. Is this possible to do in iMovie, and if so, how? I don't see where to adjust the audio/video settings for FaceTime HD recordings.

  • DataGrid itemrenderer with switch statement

    Hi, I have datagrid control with this columns <mx:DataGrid id="dgvParagraphs" >     <mx:columns>         <mx:DataGridColumn dataField="type" headerText="Type"/>         <mx:DataGridColumn dataField="title" headerText="Title"/>         <mx:DataGridCol

  • Call code from a web address

    Hi, I'm running Eclipse. I have been given a link from which to run some code, as in: "The code is called from: http://somewebsiteaddress.com/somejavafile.java" The Java code which I need to run is at the website address. But I don't know how to run

  • Adding stroke to text in Flash CS4?

    But I can't figure this out or find it anywhere. How do you add/edit stoke on text in Flash CS4?? Thanks.