weird math

I'm working on a calculator application simple grade, but I can't do the math at work. If I input 100 to inPossible and 50 for augL, I get 2 for finalGrade... am I missing something here?

import bb.cascades 1.0

//-- create one page with a label and text

Page {
    Container {
        layout: StackLayout {
            leftPadding: 80
            rightPadding: leftPadding
        }
        layoutProperties: DockLayoutProperties {
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
        }

        // A one line TextField that captures total possible points
        TextField {
            id: inPossible
            inputMode: TextFieldInputMode.NumbersAndPunctuation
            hintText: "How many possible?"
            bottomMargin: 50
            textStyle {
                base: SystemDefaults.TextStyles.BodyText
            }
            layoutProperties: StackLayoutProperties {
                horizontalAlignment: HorizontalAlignment.Fill
            }

            // On text change the label text is updated.
            // onTextChanging: {
            //    finalGrade.text = text;
            // }
        }

        // A one line TextField that captures number of correct items
        TextField {
            id: inTotal
            inputMode: TextFieldInputMode.NumbersAndPunctuation
            hintText: "How many correct?"
            bottomMargin: 50
            textStyle {
                base: SystemDefaults.TextStyles.BodyText
            }
            layoutProperties: StackLayoutProperties {
                horizontalAlignment: HorizontalAlignment.Fill
            }

            // On text change the label text is updated.
            //onTextChanging: {
            //    finalGrade.text = text;
            //}
        }

        // Calculate Percentage
        Label {
            id: finalGrade
            text: (inPossible.text / inTotal.text);
            textStyle.alignment: TextAlignment.Center
            textStyle.justification: TextJustification.Default
            textStyle.fontWeight: FontWeight.Bold
            textStyle.size: 60.0
            layoutProperties: StackLayoutProperties {
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Center
            }
        }
    }
}

I don't see where alias properties (soaman response) in this, but maybe I skimmed the code question too quickly. It seems to me, however, you want to say 100 / 50 gives you 2... but this isn't what you wanted?

Tags: BlackBerry Developers

Similar Questions

  • really weird math in flash

    OK - I have a function that looks at some data grabs a variable which is an object, another variable that is a parameter and adds it to a third number, which is a variable... it looks like this...

    Item number [parameter] +=;

    This is all pretty standard stuff... but it's absolutely crazy! When I hard code a value in the number, it works fine. When I enter the number of a table of numbers, adding does not change the value of the parameter.

    UG.

    Any tips? I'm breaking the rules?

    Here's the code twice with the trace output in the comment blocks... Just look at the trace output and you'll see the problem.


    Hey - I'm beast... figured it out...
    Splice() returns a table, not a number. so I changed...

    ... _root._mcTempSwoosh._aSwooshData . movements.splice (0, 1);

    TO

    ... _root._mcTempSwoosh._aSwooshData. movements.splice (0, 1) [0];

    and it works.

    Thank you guys.

    (I feel like a retard)

  • VMFS UUID to mapping LUN number on vSphere

    Hello.

    I tried to find an easy way to map the VMFS UUID associated with a particular logic unit number, like the command esxcf-vmhbadevs - m on ESX 3.5. I noticed that, now that I've started using vSphere the equivalent command to what I was looking for, esxcfg-scsidevs - m, shows the mapping with the standard format of the T10 SCSI addresses:

    $ esxcfg-scsidevs - m

    NAA.50014ee201f892d3:6/dev/sda6 49004c 42-58df2efc-CBCA-001ec9fda71b 0 esx14_local_storage1

    NAA.50014ee2574e1d39:1/dev/sdb1 49004c 67-a56b8e58-d5e8-001ec9fda71b 0 esx14_local_storage2

    4ac66699-86d6eaaa-ec5d-001ec9ab75fb 0 T10.9454450000000000000000007900000064530000E0000000:1/dev/sdd1 winxp-lvm

    test/dev/sde1 T10.945445000000000000000000C8000000D0610000E0000000:1 4ad4f1aa-d4061fd2-7135-001ec9fda71b 0

    So if I want to get the LUN number for one of the volumes of data I have to run another command to map the T10 with the LUN ID. As esxcfg-mpath - m or get it from vml link virtual multichannel in this way on the service console:

    $ ls-l | grep vml

    lrwxrwxrwx 1 root root 52 Oct 13 15:45 vml.01008c000020202020564952545541 - & gt; T10.945445000000000000000000C8000000D0610000E0000000

    lrwxrwxrwx 1 root root 54 Oct 13 15:45 vml.01008c000020202020564952545541:1 - & gt; T10.945445000000000000000000C8000000D0610000E0000000:1

    lrwxrwxrwx 1 root root 52 Oct 13 15:45 vml.010097000020202020564952545541 - & gt; T10.9454450000000000000000007900000064530000E0000000

    lrwxrwxrwx 1 root root 54 Oct 13 15:45 vml.010097000020202020564952545541:1 - & gt; T10.9454450000000000000000007900000064530000E0000000:1

    lrwxrwxrwx 1 root root 20 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744 - & gt; NAA.50014ee201f892d3

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744:1 - & gt; NAA.50014ee201f892d3:1

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744:4 - & gt; NAA.50014ee201f892d3:4

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744:5 - & gt; NAA.50014ee201f892d3:5

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744:6 - & gt; NAA.50014ee201f892d3:6

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744:7 - & gt; NAA.50014ee201f892d3:7

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744:8 - & gt; NAA.50014ee201f892d3:8

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee201f892d3574443205744:9 - & gt; NAA.50014ee201f892d3:9

    lrwxrwxrwx 1 root root 20 Oct 13 15:45 vml.020000000050014ee2574e1d39574443205744 - & gt; NAA.50014ee2574e1d39

    lrwxrwxrwx 1 root root 22 Oct 13 15:45 vml.020000000050014ee2574e1d39574443205744:1 - & gt; NAA.50014ee2574e1d39:1

    7-10 bytes representing the LUN ID in hexadecimal on vml chain it was possible to get the serial number of T10.

    However, does anyone know how to decode the string T10 and get directly to the LUN ID him? I also noticed that the T10 string contains the LUN number in 29-30 bytes, but bytes are reversed; so it can be assumed, there is a way to do it.

    Any help is appreciated.

    Juan Aristizabal.

    Each seller encodes the serial no and the MONDAY in their series T10 numbers differently.  3Par is quite clearly (no weird math needed), Hitachi is a hexadecimal encoding, and EMC made a horrible mess of ASCII-> HEX-> BINARY-> HEX encoding.

    You must ask your seller to chart how they do.

    -Matt

    VCP, vExpert, Unix Geek

  • Hoping for 100% accuracy

    I use Pixel Bender to run a cellular automaton, as the game of life of Conway. The shader I created works on 99% of the time. But at a seemingly random time and location, a single pixel in the image I am processing may change to the wrong color, thus invalidating the entire image from this point on.

    This traditionally happen? Have I written the wrong shader, if it works 99% of the time? It seems too random to be the result of a bug in my code. A little help, please.

    a good way to check this kind of questions is to try both on GPU and CPU mode. If you see the same question in two places, then it is probably a bug in your kernel. If it's only on one, then it might be a bug in the graphics driver. Beware of some weird math than GPU...

    Kevin

  • Weird Photoshop PSD files sizes...

    I use CS6 in Mountain Lion (so do not know if this affects other versions / operating system platforms) and I noticed something weird, saving a file.

    I have a document which is 2048 x 1536 with two layers in it, one is one bitmap, the other a vector shape with 7 points (a circle with a symbol of play in).

    Save it creates a PSD of 18.3 MB.

    Delete the shape layer and saving give me a 9.2 MB file.

    Therefore, by my math, 9.1 for a form of vector with 7 points.

    How is that even possible?

    Remove the layer of the bitmap and save with just the vector shape and the file is 249 k.

    What is going on?

    Rob.

    If you have defined maximize compatibility setting in preferences, not only is the form saved as a metadata layer, but there is a flattened composite image created and saved with the PSD as well.  It could be that he is not able to compress this composite flattened particularly well.

    If you have other applications or older versions of Photoshop that need to read PSD files in your working environment, you may experience a significant saving, if you assign maximize compatibility Ask or never and save without maximum compatibility.

    Just to be clear, the older versions of Photoshop WILL read the files without maximum compatibility, if they contain no features available only in the second version (savings) of Photoshop.  When the process of "compatibility" is invoked, the old version (or external application) comes back to playback of the composite flattened, which isn't always useful anyway.

    -Christmas

  • Weird lines and do not wake

    My computer has been acting since weird transition to macOS Sierra. When you log in you get these weird lines. They do not always. Also, I noticed when disconnection and pushing the standby button it wake up and I have to stop it and start it up. I didn't want to reinstall sierra. Who took about two days.

    Retina 5K, 27-inch, late 2015 3.3 GHz Intel Core i5 16 GB 1867 MHz DDR macOS Sierra 10.12

    Material or something is very wrong and I would like to call or make a Service appointment as soon as POSSIBLE,

    help > desktop Mac Service response - Apple Support Center

    FWIW I've updated 2 old iMac and several other year of the Mac Mini to Sierra. Each of them updated in less than 30 minutes and no having problems or ill consequences.

  • iPhone 7 weird noise ticking after sending message sound

    Hello

    I use an iPhone 7 for 4 days now and yesterday, I, after I send a message (using iMessager, Wechat or Whatsup), I started noticing a sound weird/click tick immediately after application. That weird noise resembles a small distortion in the enclosure which happens after some noise is played.

    Did anyone encounter the same problem?

    Thank you in advance.

    Best regards

    Ricardo

    Same here, but also after taking a screenshot. Shortly after the sound of the camera.

  • Login screen of the MacBook is weird.

    Hello! Login screen of my computer is weird. The colors are darker and the cursor moves more slowly than usual. Everything started after I updated my MacBook (retina, 12 inch, early 2015) to OS X El Capitan 10.11.6. Everyone knows about this problem? Is it possible to fix it?

    If that had happened to me, I would try Safe Mode boot because that passes through a few additional system checks.

    Try safe mode if your Mac does not end commissioning - Apple Support

  • I lost my phone 2 weeks ago. Now, I received a message telling me to connect to find my iphone but the link is very weird

    I lost my phone 2 weeks ago. Now, I received a message telling me to connect to find my iphone, but the link is very weird.

    I entered my information it because I wanted to see where was my phone, but nothing has arrived. After that I connected to my laptop and I could go on my account, but it seems that my Iphone (that got stolen) are there any more and I can't locate. What do you think? would it be the thievs who send me this message on my news?

    This is because it is a phishing attempt to make you try to open a session, so that they get the powers they need to disable find my iPhone on your device. Do NOT click on anything and ignore it.

    Sorry, I see that you were already there and gave them the information. Your device, as well as your iCloud account have been compromised. You need to change your password immediately. Your device is finished now, you will never recover.

  • Finder of freezing and acting weird

    Hi I had a couple issues Finder weird recently any help would be much appreciated!

    The finder drawing seems to freeze - can I open a folder or a new window of finder and sometimes it will be fine, but then it will be half freeze - the content of the window is not displayed - it will just be white or the background (desktop etc) is drawn in the finder window. I screen shotted because it's a little hard to describe...

    It seems to go there I kill finder / restart for 2-5 minutes... then the problem comes back.

    I deleted finder prefs, doesn't seem to help. I did a reboot in recovery mode and ran the repair disc utilities and which seem to help for a few days, but now back!

    I can close the windows in the finder and open new, and the question seems to come and go a little... Any ideas?

    Thank you

    Stuart

    Hello

    Start Safe Mode removes the system caches that can help.

    Follow these steps to start in safe mode.

    1. Start or restart your Mac.
    2. As soon as you hear the startup tone, hold down the SHIFT key.
    3. Release the SHIFT key when you see the logo Apple appears on the screen.

    After the Apple logo appears, this may take longer than usual to reach the login screen or your office. This is because your Mac performs a check of directory of your drive to boot in safe mode.

    To leave safe mode, restart your computer without pressing any keys during startup.

    Then, try the Finder.

  • Weird behavior of Safari Dock icon

    For several months now, I noticed a weird behavior of the Safari icon on the dock.

    Note: I have the Safari Dock permanently icon in the dock if the application is running or not for quick access.

    With open Safari, after periods of inactivity or after the awakening of the mode standby, the icon will lose the small black dot on the bottom that indicates an active application.

    By clicking on the icon or a .webloc file reveals that Safari is still active, but because the icon does not animate as it does when it is launched.

    How can I fix and when Safari * is * open its Dock icon indicates that it * all the time *?

    Probably also related...

    All too often, after similar as scenarios above, Safari actually leave - all on its own.

    How can I fix this too?

    Safari has also been freezing quite often lately have to be re-launched or sometimes requiring a restart of the computer system.

    Something is not.

    Go step by step and test.

    1. Disable Extensions and test them.

    Safari > Preferences > Extensions

    Uncheck 'Enable the Extension' and test.

    Enable the Extensions one by one and test.

    To uninstall any extension, select it and click the "Uninstall" button

    2. Quit Safari if it is open.

    Hold down the option key and click on the "Go" menu in the Finder menu bar.

    Select 'Library', then 'Caches.

    Find the folder "com.apple.Safari".

    Right-click on "com.apple.Safari" and select "move to trash".

    Restart Safari.

    3 remove the test and com.apple.Safari.plist file.

    Empty the trash.

    Quit all applications.

    Hold down the option key and click on the "Go" menu in the Finder menu bar.

    Select 'Library' in the menu dropdown.

    Library > Preferences > com.apple.Safari.plist

    Right-click on it and select "place it in the trash.

    Close the Finder window.

    Turn it back on.    Restart Safari.

    If this does not help, "put back" the com.apple.Safari.plist

    Right click on the trash icon in the Dock, then select 'open '.

    Right-click on the com.apple.Safari.plist and select 'Put Back'.

  • How to change the tempo of the bass guitar? no weird noise.

    I clicked on the change of tempo to follow on a bass guitar recorded, but it appears totally artificial and strange, sped upwards or downwards.

    I'm doing something wrong?   why it sounds so weird!

    Please can someone answer this!  It's the same thing if I transpose the bass, sounds strange wobbly sounds.

  • iPhone 5 s acting weird from the hotmail interface has changed

    Hello

    My 5's mail app iPhone acted as weird as the hotmail Web site interface has changed a few weeks ago. The Junk folder disappeared and now, when I get an email, the phone rings and vibrates as before, but it is there no preview on the lock screen, or the notification Center.

    What is happening to someone else? How can I fix it?

    Thank you

    Hello

    It can help to check your email notification settings:

    • Go to settings > Notifications > mail > select an account to check the notification settings.

    You can also update your iPhone to the latest version of the software (your post indicates that it is not up-to-date):

  • Weird popup

    I get a weird pop up:

    "mcafee.loading - urls.com says: .

    Renew you license mcafee now to make sure that your data, identity and privacy are protected. »

    Does he know whats up with that? Thank you.

    ignore the best would be average.

  • Weird glitch transparent on my apps

    Hello community,

    I met a bit of an oddity. I got my dads, computer laptop, it's a Macbook Pro 10.1 mid 2012 with screen retina, the latest version of OS X El Capitan 10.11.6, i7 2.6 with a SSD of SD512 Apple and 16 GB 1600 MHz DDR3. Graphics card: NVIDIA GeForce GT 1024Mo of 650 M.

    It is immaculate and works perfectly apart from a glitch whenever I start an application while having another open on the same office space in these odd remnants of it, faded but noticeable. I have enabled transparency 'reduce' turning on and off to see if it is the question, but it changed nothing. I'm an advanced user, but I have no idea what this might be. The strange this is, when I wanted to do a screenshot to post here, it does not appear, that's why I resorted to cracks the screen with my phone and the display of those below (I can do more if the issue is not clearly visible for some).

    If anyone knows anything, please any suggestions are welcome. This is the first time I ever had to start my own thread, since normally any problem can be solved with browsing a bit, but this time I even found the corresponding number. I have this feeling, due to the screenshot not having is not the weird glitch on it, maybe it's a hardware problem with the screen, but I'm stumped.

    Thank you in advance.

    Peace,

    Raph

    sounds like the GPU and it had reported problems with the retina 2012

    https://www.Apple.com/support/MacBookPro-videoissues/

    the repair program ends in a few months, so if your computer qualifies do it as soon as POSSIBLE.

Maybe you are looking for

  • The image quality/size

    Need to reduce the quality of the picture and size on the Iphone 6 s more to take pictures of works that I can download in databases work. Current settings are to large.

  • OfficeJet 5745: cannot install drivers

    I can't install the printer drivers for my 5745 Officejet on my laptop Dell XPS 13 running 64-bit Windows 10.  I tried the following: -Downloaded driver installation package later. -Wireless connection, I see my printer, but always, the installation

  • Satellite - DVD drive disappeared

    Installed new software, the other day to 'catch' a video of my VCR - filled my Vista disk so I uninstalled after you put the video on my hard drive. Now my DVD drive does not appear on my computer. I tried microsoft automated troubleshooting - it ins

  • Installing WXP on Satellite L40 - 18Z

    Hello I recently bought a laptop: SATELLITE L40 - 18Z, MODEL No. PSL48E. One of their salesmen dim wit forgot to mention that the warranty expires once you remove the VISTA machine. I make music and need for XP as no software has caught with VISTA ye

  • sbRIO-9651 IO corresponding length

    We plan to interface high speed ADC (1gech/s x8bit) that uses a wide interface LVDS (two samples) from 16-bit to a sbRIO-9651.  Is there a resource that provides information about the sbRIO-9651 module layout details as worst case length offset serie