Weird if statement behaviour

I am building a simple memory game - you know those card flip
things. I am testing if the value assigned to pic1 and pic2 are the
same and using trace statements to verify that they are the same
but still getting a false answer to the if statement. Pulling my
hair out!!
Any suggestions would be greatfully recieved
Thanks,
Leslie

I've done a bit more work and it seems to have something to
do with the process by which I am randomizing the numbers in the
array. If I work with a plane non randomized array the if statement
works and can figure out the difference between pairs that match
and pairs that don't but... once I randomize the numbers by
basically taking the value at a random index and putting it into a
new array - the if statement equality check no longer works.
It is almost like the number is not really an integer even
though I have tried forcing it with the int() statement.
Thoughts anyone?
Thanks,
Leslie

Similar Messages

  • Address Book - Weird text field behaviour

    In Address Book when I try to edit any text field weird things happen.
    When I start typing all the previous characters are repeated with each keystroke - for example typing "Thomas" would become TThThoThomThomaThomas". Pressing the backspace, delete or the ESC key repeats only the keystrokes made, i.e. "Thomas" would be added to the end of "TThThoThomThomaThomas".
    If I click into another field and start typing it still remembers all the previous keystrokes and puts all of them in front of the key I just pressed.
    Additionally, nothing can be typed in the notes field.
    I've tried deleting:
    ~/Library/Preferences/com.apple.AddressBook.abd.plist
    ~/Library/Preferences/com.apple.AddressBook.plist
    but that doesn't fix it.
    Anything in ~/Library/Application Support/Address Book be the problem?
    When I log in a a guest user this behaviour is not present.

    It's good that you tried this on a different account. That suggests that the problem exists somewhere in your user account directory. I don't think anything in ~/Library/Application Support/AddressBook/ would cause this. Do you have any input managers installed? These might be in ~/Library/Input Managers/ or something like that. I've never installed one myself, so I am not certain where they are. I think if you find one, you can just remove it from that folder by dragging it out, and then restarting Address Book might solve the issue.

  • Very weird af:forEach behaviour

    I've got a page with a table in it and some filter code so the user can specify a string and only rows that have that string in any of several fields will be displayed. To refine the search, it can be repeated with another word which gets added to any that are already in there. Behind it is an ArrayList in a backing bean containing the individual search terms. The ArrayList gets passed to a method in an application module which builds a predicate out of them all and calls .setWhereClause on the relevant VO. This all works OK.
    Then to indicate that the displayed list is filtered, I want an af:showDetail at the top which summarises the filter that's been applied and lets the user expand it to see the list of search terms. Something like this;
    <af:panelBox rendered="#{backing_UserManagement_UserManagement.resultsFiltered}"
    width="100%">
    <af:panelTip>
    <af:showDetail disclosed="false">
    <af:panelList binding="#{backing_UserManagement_UserManagement.filterList}">
    <af:forEach items="#{backing_UserManagement_UserManagement.criteria}"
    var="thisSearchCriterium">
    <af:outputText value="Username or real names contain '#{thisSearchCriterium}'"/>
    </af:forEach>
    </af:panelList>
    <f:facet name="prompt">
    <af:outputText value="#{backing_UserManagement_UserManagement.filterSummary}"/>
    </f:facet>
    </af:showDetail>
    </af:panelTip>
    </af:panelBox>
    This in itself works OK, however elsewhere on the page very odd things happen whenever there is anything non-trivial inside the af:forEach. Columns become duplicated inside the table, and panelBox elements elsewhere on the page- and their contents- also become duplicated. If I reduce this right down to the bare minimum, the odd behaviour occurs with
    <af:forEach items="#{backing_UserManagement_UserManagement.criteria}"
    var="thisSearchCriterium">
    <af:commandButton text="commandButton 1"/>
    </af:forEach>
    but not with
    <af:forEach items="#{backing_UserManagement_UserManagement.criteria}"
    var="thisSearchCriterium">
    <pre> Hello World </pre><hr>
    </af:forEach>
    Though the "Hello World" lines appear at the top of the page, outside any ADF elements (even when defined inside an af:panelBox or similar) so this doesn't give me a way of getting to the result I want.
    Has anyone seen this kind of thing before and solved it?

    Hi,
    put a print statement into your managed bean and see how often it gets executed. Usually this is 2 times the case. You can set a flag after the first run , or just set refresh as needed in the iterator binding with a refresh condition of prepareRender or prepareModel
    Frank

  • SQL Statement behaviour

    Hi,
    Check out this query...
    SELECT     *
    FROM     (SELECT     ROWNUM NUM
         ,CBD_CUSTOMER_CODE
         ,CBD_NAME
    FROM     (SELECT     DISTINCT CBD_CUSTOMER_CODE
              ,CBD_NAME
         FROM     SM_CUSTOMER_BASIC_DETAILS
              ,WB_PRODUCTS
         WHERE     PRD_CS_CODE = '460'
         AND     CBD_NUMBER=PRD_CBD_NUMBER
         ORDER BY
              CBD_CUSTOMER_CODE
    WHERE NUM BETWEEN 1 AND 10;
    It's supposed to return on 10 rows at any given time.
    But in different database on different platforms, there are different results.
    On a windows 2000 server with sp 4 and Database with the below version:
    Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
    PL/SQL Release 9.2.0.5.0 - Production
    CORE 9.2.0.6.0 Production
    TNS for 32-bit Windows: Version 9.2.0.5.0 - Production
    NLSRTL Version 9.2.0.5.0 - Production
    it works correctly !
    but on a windows 2000 server with sp 1 and Database with the below version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    it never considers the condition outside the 2nd inline view and always returns all the rows.
    but on a Red Hat Linus AS 2.1 server and Database with the below version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    the query returns the correct values
    What's the reason for this behaviour of the SQL Statement ?
    Thanks in advance
    Piyush

    Unless there is a copy-and-paste error, it appears that you have two open parens '(' and only one closing paren ')', so the SQL statement shouldn't compile...
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • X131e - weird browser tabs behaviour

    Hello all. Took delivery of an X131e a few days ago. OVer the past few days I have noticed an intermittent issue with the behaviour of tabs in both Explorer and the latest version of Firefox I installed. Essentially, what happens is that every time I click on a link it opens in a new browser window. This didn't happen to start with and it goes back to normal after I restart Windows. This 'fault' seems to start up randomly. It happens in both Explorer and Firefox (so does not appear to be a browser-specific setting).
    I am aware that some links are specifically set to open in a new tab/browser window by the page's designer, but this is every single link, even just Google search results. Select a link with left button above track pad and link opens in a new tab. Extremely frustrating. Restart computer, run exactly the same search and clicking the link works as it should. a day or two later and the tabbing thing has started again.
    Machine is running Windows 7 Home Premium. I don't shut it down when I have finished with it; I just close the lid.
    Can anybody suggest what might be causing it and how I might prevent it?
    Solved!
    Go to Solution.

    Hi there,
    From what I'm gathering, it's almost like you're clicking the link and even though you're not pressing Ctrl, a new tab opens like it would if you were holding that key, is that a correct assessment of the situation?
    If so, have you checked Sticky Keys in Control Panel?
    Ed
    Was this or another post on the forum helpful? Click the star on the left side of the screen to give kudos! Did someone solve a problem you encountered? Mark it as "solution provided" to help others with the same problem.

  • Weird import statement problem

    Hi
    I have a strange problem with an application I just developed. Once compiled, if I try to run it on another machine other than the one I developed on, I get a NoClassDefFoundError relating to a class that I did not use. I look at the class file (in a decompiled state) and there is an import statement in there that is not in the source file!! Can anyone tell me why this might have happened?
    the import is a symantec class/package I have never used to my knowledge at all and yet it shows up in the binary class file after compilation.
    Thanks for any suggestions.

    I did use Visual Cafe during parts of the development but I have never imported anything like what is in the class file. I assumed it was VC that was doing it but wasn't sure.
    Thanks.

  • X41 Weird Battery state

    Hi,
    I have an X41, running XP. The battery status on this is weird. Here's what's happening:
    The battery apparently has no charge - without the AC plugged in, the machine does not boot. When AC is removed when the machine is 'ON', it turns off. So far consistent with a dead battery.
    Next, when I do turn the machine on with the battery in the slot, the machine boots. The Power Manager guage shows a constant charge of 42%. It neither increases, nor decreases. The baloon when the mouse points to this guage says:
    (42%) remaining
    Then, I fire up the Power Manager, and go to the 'Battery Information' tab.
    Again, it shows:
    Remaining Battery: 42%
    Batteries installed: 1-main battery
    Condition: Good (with a green battery)
    The battery is in good condition.
    At this point, I'm totally confused. I have checked the battery contacts, and the slot itself. All seem OK. I dont know what to believe. Do I have a dead battery? Or does it somehow have  a disconnect internally?
    Thanks for looking, and thanks in advance for responses.
    lsiravi

    i reinstalled lenovo's battery utility and opened it up to battery.  i ran the reset which is supposed to charge to 100 then discharge to 0 then charge to 100.  well it discharged just fine but wouldn't charge from 0.  so i put the battery in an x40 and charged it to 93. i have the utility set to charge at 96.  it said it was charging but the percentage remained the same.  i then put the battery back in the x40 and charged it to 100.  put it back in the x41 and ran the utility until it discharged to 90.  then i turned off the utility and turned it back on and it said it was charging but it wasn't.  i then called the co. that i got it from and me an tech support determined that the charging system on the board was bad.  there are no resets, no fuses to change the only thing i can do is change the motherboard so we agreed to exchange it for an x40 which they had.  i guess i'll go back to the old tried and true x40.   the funny thing about this whole thing is the green light indicator showed a battery, the utility showed a battery, it showed the voltage of the battery, the voltage of the charging system, the only thing that didn't show on the utility was the  time it was to take to charge it up to 100. 
    T430u, x301, x200T, x61T, x61, x32, x41T, x40, U160, ThinkPad Tablet 1838-22R, Z500 touch, Yoga Tab 2 Windows 8.1, Yoga Tablet 3 Pro
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    If someone helped you today, pay it forward. Help Someone Else!
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • Weird OT font behaviour in InDesign and Illustrator

    Hi font experts.
    I've been directed here by someone at the InDesign forum, who thought you might be able to help.
    Can anyone explain what's happening here?
    I've loaded an OT version of Zapf Dingbats into Suitcase Fusion on my Mac Pro and it seems just fine. Font Doctor says its OK. Suitcase Fusion says its OK. The font characters display correctly in Fusion.
    I can use both the TT and OT versions of the font in Mail and Word. Both versions print OK, too.
    But when I apply the OT font in Adobe InDesign or Illustrator, all I get to see is boxes with a cross through them and that "missing font" pinkish hue.
    No other OT fonts pose this problem. And deleting the TrueType font of Zapf Dingbats makes no difference so it's not a duplicates problem.
    As a result of the above I've temporarily ditched Fusion today to try out FontExplorer (which I like). Comparing the two fonts in there, I can see that there are lots of "missing" characters in the OT version if I select "Show missing characters", but none in the TT version. Not sure if that's relevant.
    Also, each character in the OT version has a lot more information, including Character Code, Unicode, Glyph ID, HTML and Keystroke, whereas the TT version simply has the Glyph ID. Don't know if that's relevant either. Incidentally, the keystroke doesn't work in InDesign or Illustrator.
    Thanks for any suggestions or solutions to this annoying issue. It seems very weird but maybe there's a simple explanation. Cheers.

    Dang! It was so obvious. The OT version has the symbols in the correct place in the glyph palette. The letters and numbers that I used to type to get the bullets and scissors are empty characters in OT. Thanks to Carl over at Extensis for enlightening me. Boy was I being dim.

  • Weird Image Processor Behaviour

    The image processor has started acting really weird a couple of hours ago. I have been trying to figure the problem out since then, but to no avail. It all started when I tried to run batch processor from the Bridge with a really simple action that is just meant to save the images as a TIFF. This has worked before and I did not change the setup in any way. But this time many of the images just stayed open in Photoshop. They were neither saved nor closed - others were, though. I played around with the settings, repaired permissions, deleted cache files, etc. Then at one point, when I ran the image processor again, it suddenly started to open random raw files! These files are on the same hard drive as the .psd files I was trying to convert, but they are not even nearly in the same directory. In fact, these happened to be really old pictures that I hadn't seen in a while. That scared me. Also I am at the end of my wits. The only thing left to do would be to uninstall and then reinstall Photoshop, I guess. But that would mean, that I would have to go through all the settings again, import my actions, keyboard shortcuts, etc. I'd like to avoid that if possible.
    I am using Photoshop CS 5.0.1 on an iMac running MacOS 10.5.8.

    You mention Image Processor and Batch, which are two different things – which did you employ?
    Could you post a screenshot of the Actions Panel with that specific Action clicked open just to make sure which steps are included?
    And have you tried trashing prefs (after making sure your presets are saved)?

  • Weird flash plugin behaviour

    Hello guys and girls.
    Recently I switched back from catalyst to the opensource driver. Everything worked fine after that.
    Now I updated my system a week ago and for some reason my flash player behaves weirdly since then.
    When I got 2 or more tabs open and all of them having flash active, flash stops displaying correctly when I close one of them.
    Is this a known problem? I couldn't find any posts mentioning this, so I thought I should post a topic here.
    Thanks in advance,
    szt

    I've been having flash issues lately too, although different ones from yours. Flash videos on lots of sites refuse to go fullscreen. sometimes they will go fullscreen once, but if I unfullscreen and try again it will be broken until I restart firefox. youtube is the only site it works reliably on. I resolved my issues by using chromium and chromium-pepper-flash, which is far more up to date and less buggy than flash 11.2

  • Weird DocumentBuilderFactory.newInstance() behaviour

    problem summary
    ==============
    jvm breaks when I call DocumentBuilderFactory.newInstance(). I suspect its something to do with security but no exception is caught in the try...catch block where DocumentBuilderFactory.newInstance() is called.
    Other info about the problem
    ======================
    I'm working on an application that use 'presence service' and message queue service. When I use Sun's message queue service, jvm doesn't break. But when I use a SKype client (jskype) jvm always fail even though jskype doesn't reference DocumentBuilderFactory.newInstance() at all. Anyone?

    That's great thinking Fred.
    I've working on a much cut down and simplified version with just program changes to find out the cause of the behaviour.
    I tried your note off suggestion without success, but your comment on the original multi being "blocked" led me to route the final events to a second copy of the multi instrument rather than the original, and it works - the custom bank changes are correctly output!
    Maybe there's some kind of internal message validation or something, I'm not quite sure. But using a second copy of the multi instrument - though not ideal - is a perfectly acceptible workaround.
    So thanks for the pointer - you really helped me out..!

  • Weird Inspector hotkey behaviour

    The built in Firefox web developer tool inspector can be called with CTRL+SHIFT+I. which will show the web developer toolbar and you can also select a desired element on the page. Now, when I want to select another element and press CTRL+SHIFT+I again, it closes the toolbar. WHY ON EARTH? Is there any way to eliminate this overly annoying toggle behaviour?
    I don't want to click every time on an icon, to inspect an element. I want a shortcut which always brings up the toolbar and lets me inspect any element on the page. Like firebug's CTRL+SHIFT+C does it.
    Ideas?

    Ctrl+Shift+i works like Ctrl+Shift+k and other toggles that open/shut the relevant pane. I don't think it was ever intended to reactivate inspect mode. Someone needs to define a new keyboard shortcut for that.
    I looked into using [http://forums.mozillazine.org/viewtopic.php?f=48&t=72994 keyconfig 20110522] for that, but I don't know how to invoke the inspector.highlighter.unlockAndFocus() method from an object available to the extension. I'm sure someone does.

  • Weird window decoration behaviour

    Has anyone else experienced windows, particularly in Finder, though sometimes in Safari, that appear to be only "semi" active as in the screenshot linked below?
    http://dl.dropbox.com/u/2459380/weird.png

    Try selecting one of the Devices or Places in the Sidebar on the left.
    If that doesn't help, go to ~/Library/Preferences and move the com.apple.finder.plist file to the Trash.
    ~ (Tilde) represents your Home Folder.
    Restart your Mac.

  • Weird Quick Time Behaviour

    Hi,
    I have to translate a fla into DVD. The picture become soft
    and blurry when exported in AVI, but the export in .mov produce a
    very clean and crisp image. Re-exporting from QT Pro for import in
    a video editor program works perfectly well. The problem comes from
    randomly "sliding" frames. I'm not talking about flickering... It
    looks as the picture has been spilt in the middle and the 2 parts
    are sliding on top of each other.
    The Fla is a 15 minutes corporate film designed for
    projection with no action script involved. On these 15 minutes this
    weird effect appear 4 or 5 times, lasting approx. 1/3 of a second.
    Did anybody came accross this before? Is there an answer?
    Thanks in advance,
    Dominique

    Hi,
    I have to translate a fla into DVD. The picture become soft
    and blurry when exported in AVI, but the export in .mov produce a
    very clean and crisp image. Re-exporting from QT Pro for import in
    a video editor program works perfectly well. The problem comes from
    randomly "sliding" frames. I'm not talking about flickering... It
    looks as the picture has been spilt in the middle and the 2 parts
    are sliding on top of each other.
    The Fla is a 15 minutes corporate film designed for
    projection with no action script involved. On these 15 minutes this
    weird effect appear 4 or 5 times, lasting approx. 1/3 of a second.
    Did anybody came accross this before? Is there an answer?
    Thanks in advance,
    Dominique

  • Weird csv import behaviour...

    Hi guys!
    I was wondering if any of you encountered a werid csv import behaviour:
    If the csv file I'd like to import has columns shortened...I mean sometimes you have to click twice on a column to see its full content..and I'm talking about the situation where you don't see it in a full spectrum. Then if im trying to import it I receive an error...if immediately after that I click twice on every column of that csv file...the import works fine...
    Any ideas?
    With regards,
    PsmakR

    Hi guys!
    I was wondering if any of you encountered a werid csv import behaviour:
    If the csv file I'd like to import has columns shortened...I mean sometimes you have to click twice on a column to see its full content..and I'm talking about the situation where you don't see it in a full spectrum. Then if im trying to import it I receive an error...if immediately after that I click twice on every column of that csv file...the import works fine...
    Any ideas?
    With regards,
    PsmakR

Maybe you are looking for

  • Hyphens and spaces in contact numbers

    I Am in India I got my iphone 5 and 6 from USA . The contact numbers and dialled numbers are automatically getting hyphens and spaces. Tried changing region format to India  and also in icloud but no use. It is being a little annoying as I am not use

  • Why there are no /dev/mem, /dev/kmem on solaris10 non-global zones?

    Hi All, We have an application on SOLARIS10 that tries to open '/dev/kmem' using 'kvm_open' system call and after that it reads certain kernel virtual memory parameter values by using 'kvm_nlist' system call. In solaris 10 non-global zones these call

  • Does re-running a MDM Initial Load restart from the first record?

    Is there a way to restart an Initial load?  I was running a new initial materials load in my ECC system for MDM (MDM_CLNT_EXTR) which was running a very long time (5 days).  The background job hit a bad piece of data and crashed. My question is: when

  • Mvt Type 543

    Dear Friends, While we are receiving goods from subcontractor Mvt.Typ 101 (MIGO) ,material supplied to SC is consumed (Good Issue) by Mvt type 543 .When we perform migo ,qty automatically defualted which we can change.Is it possible to make all quant

  • KWin compositing only in XRender mode / unable to use OpenGL mode.

    Hi, somehow I am unable to activate kwin4 compositing in OpenGL mode. If I try to I get the following message: "Failed to activate desktop effects using the given configuration options. Settings will be reverted to their previous values. Check your X