Question about converting objects in number

This may sound a little silly, but I have a function that converts an object into a number and then checks if it is NaN to make sure that it is indeed a number, it returns true if it is a valid number, or false if it is not a number

Now I have a TextInput and when I type for example 'HELLO' and call the function will return false (since it is not a number), if I type 23 it returns true (it is a number), if I hit 20 'a', it returns false. Everything works well except for a combination, if I type any number and the letter 'e', for example, 2nd, 9th, 5th, etc., it returns true, which means that it is a valid why number, is it?

You can validate the number against a regular expression:

/\d+(\.\d*)?/

I think I have this right,
Tim

Tags: Flex

Similar Questions

  • Questions about adding a Skype number

    First timer here, here are my questions, I live in Thailand, former U.S. citizen, have for years had major problems with government agencies to reach me by phone. My billing address is in CA, my verified phone number is thai. I believe that with a Skype CA phone number I can eliminate these problems, correct? As the Government agencies and US automated banking systems cannot recognize a 11 digit number.

    OK, so I did not have a first core of Galaxy attached to any diet, talk with a slot for sim card available. My intention is to buy a prepay sim for the available location local, and then add a Skype number. This Skype number wouldn't be usable wifi connected. A one year subscription is $52.25, but the site says nothing about other calling some how fees, or I've missed?

    With the second sim with a Skype number, dedicated to the United States calls only, and I was able to differentiate between the two by which the sim was used to receive the call. I receive a message if a call was made for me if it is not connected to wifi?

    Could I have the call transferred to my Thai number, if I were to buy call forwarding also?

    I intend to wait until I have answers from the community before I do anything.

    Thanks in advance for those who add their comments.

    Hi, what you're trying to do is possible in principle, but you do not add the number of Skype to a SIM.

    What happens, is that you install the Skype app on Google Store on your base premium Galaxy then receive calls and outgoing calls via the Skype in wifi or mobile data, if you add a local SIM card.

    Check Skype calling subscriptions and distribution rates to the United States and the Thailand (subscriptions especially if you make a lot of calls or transfer calls to a number of Thai). If you buy a subscription or even 2 subscriptions (1 USA and 1 Thai) then you get a 50% discount when you buy a Skype number for 12 months, which is a good deal.

    The application on your Galaxy will inform you of all the missed calls. I suggest you only install Skype on a PC too to see the full selection of purchase options in Tools/Options. You must configure the voicemail here and select this option to allow anyone to call your Skype number. Spend some time looking at all the options that are available to you.

    You can transfer your Skype CA number to a number of Thai, if you wish and have a subscription or a credit to pay for it.

    Perhaps start by installing Skype on your base premium Galaxy from the game store, sign in with your account and take a look at all the parameters available on the app. Setting most are in the app now except setting up voicemail that can be made on the program Skype on a PC.

  • Question about oracle objects

    Hi people

    I came across the below example on the oracle documentation.

    I'm not quite sure why "emp is NULL #2' always get printed even if the Member attribute is assigned a value that should be non-NULL and" ""emp is NULL #3"isn't even after printing has been assigned to the object with a NULL value."

    Can one of you you please explain about it. or give the overview of the conditions of the NULLable object. Thank you!!

    DECLARE

    EMP employee_typ; -emp is atomically null

    BEGIN

    If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #1"); END IF;

    IF emp.employee_id IS NULL THEN

    DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #1");

    END IF;

    EMP.employee_id: = 330;

    If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #2"); END IF;

    IF emp.employee_id IS NULL THEN

    DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #2");

    END IF;

    EMP: = employee_typ (NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    address_typ (NULL, NULL, NULL, NULL));

    -emp: = NULL; -It would have made the following statement of the TRUE IF

    If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #3"); END IF;

    IF emp.employee_id IS NULL THEN

    DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #3");

    END IF;

    EXCEPTION

    WHEN ACCESS_INTO_NULL THEN

    DBMS_OUTPUT. Put_line ('impossible to assign object NULL value');

    END;

    /

    The result is:


    EMP is NULL #1
    EMP.employee_id is NULL #1
    EMP is NULL #2
    EMP.employee_id is NULL #3

    I came across the below example on the oracle documentation.

    I'm not very sure why 'emp is NULL #2' always get printed even if the Member attribute is assigned a value that should be non-NULL and ' emp is NULL #3 "is not get printed even though the object is assigned to null."

    Can one of you you please explain about it. or give the overview of the conditions of the NULLable object.

    Have you actually tried this example? Why not?

    The best and often faster, learn is to DO - not just read.

    If you tried this example, you would see that you have been "bitten" by a documentation bug.

    EMP.employee_id: = 330;

    That the line of code won't work - it will trigger an exception is the output you get really

    PEM is NULL #1

    EMP.employee_id is NULL #1

    Can't assign value to the NULL object

    PL/SQL procedure successfully completed.

    SQL >

    The 'emp' instance has the value NULL as shows it the first message. If you cannot assign the 330 value him.

    For others, the example seems to be the Oracle documentation

    http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14261/objects.htm#CIHEJIBA

  • Question about on VM consolidation number and percentage of CPU Ready

    Hi people,

    I'm trying to consolidate as many VM in simple ESXi servers on HP on AMD Opteron blades with 32 CPU available logic (based on the number on the vSphere console)

    Can anyone here please share some thoughts and comments about what is the best indication to avoid adding more VMS that ESXi hosts can treat?

    I must ensure that the number of vCPU altogether exceed is not 32 logic processor available, or it can be more than that?

    Running a script powershell LucD to collect CPU ready percentage shows that some virtual machines had prepared more than 10% CPU (for the most part 2 x vCPU) up to 22% (this one with 8 x vCPU)

    Hello

    I had the same situation on HP Blade and DL serer with two different CPU vendors.

    Intel CPU based on my experiences, has better performance compared to AMD CPU when the CPU is too committed on ESXi server.

    I have HP BL460c G6 and G7 on one of our sites, the server has 12 physical and 24 cores logic core.

    I assigned four cores to each customers (to fix the voice problem) and virtual machines are working properly, RDY CPU is less than 5% in general and there is no performance problem.

    Each blade server hosts 20 VMs and total virtual cores are 80 cores, so we attribute 1:3 (Physics: virtual) core.

    On the other hand, I DL585 G7 on our sites some server has 64 physical cores (4 Sockets and each catches have 16 cores). Servers host 50 active VMs usually but RDY CPU is greater than 10% or 7% on them. Total virtual cores are 200 and CPU assignment ratio is 3.

    I think that, if you want to optimize performance on AMD CPU, 1:1 or 1:2 CPU assignment report is the best choice.

  • Hello everyone, Vmware newbee here. You have a question about converter

    Hi everyone, my name is Marvio and I'm just starting with VMware (I see guys roll your eyes!)

    I must say that I am completely confused about the part converter, not the process real P2V, who seems straight forward enough, but if I need to buy...

    I just bought the vSphere with OperationsManager Enterprise more edition, which comes with the converter itself? Whenever I search on how to use people just download the stand alone install and use it, but just above the download button, there is a big button BUY, what is the difference? I need P2V 2 servers in vSphere, ESXI 5, what I have to buy, can I just download or does with the package I purchased?

    Help, please!

    Thank you

    Marvio Botticelli

    Welcome to the community.

    the converter is a free tool that you can download from https://my.vmware.com/group/vmware/evalcenter?p=converter once logged into your account.

    André

  • PLSQL question about printing the line number when an exception occurs

    Hi all

    My database: oracle 10G

    Here's my question:

    Explain my problem using a simple procedure, such as:

    create or replace procedure p_hello_world
    as
    [a few variables declared]
    Start
    [a lot of code here]
    exception
    while others
    dbms_output.put_line ('Exception occurred for the p_hello_world procedure');
    dbms_output.put_line ('sqlerrm' |) SQLERRM);
    dbms_output.put_line ('sqlcode' |) SQLCODE);
    -Suppose I want to print the line number where the exception occurred, pourrais I do, if so please help me with this
    end;

    Now it's the same construction that I use for my use, I have a comment in the above exception block where I need to print the line number where the exception is produced, now since I'm on so that any other article, my procedure is always succeed even if an exception occurs, but using this technique I am not able to quickly debug my code but print line number would help me a lot Please help me with this as its rescue me great distress.

    Concerning
    Rahul

    Try something like:

    dbms_output.put_line(sqlerrm || chr(10) || dbms_utility.format_error_backtrace);
    

    (Hoping that this is a simplified example and you are not actually using dbms_output as an exception handler...)

  • Re: Question about the warranty contract number / decompressor "Vid.iv32."

    Hello

    1. I have this message when I try to play a dvd: video not available, cannot find decompressor "Vid.iv32."

    2. in the extended warranty, I wonder for "Contract number", where I get this.

    (1) possibly, you use a DVD player software that doesn t supports the video file or you have not installed a necessary codex.

    (2) use this page www.toshiba-tro.de/unitdetails/

    Also check this thread:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?MessageID=117176𜦸

  • Question about the warranty contract number

    I've been recording my toshiba L10 and the basic warranty, but I have not received agree security number to save extention of warranty.
    What should I do to receive the warranty contract number?

    Hello

    AFAIK that should be given the right address if you save your standard warranty. I guess that you will receive an email from Toshiba with good security agreement number. It takes a few times. But if you want, you can ask Toshiba authorized service provider for this number.

    Check this box:
    http://EU.computers.Toshiba-Europe.com/cgi-bin/ToshibaCSG/generic_content.jsp?service=EU&ID=000000147b

    Good bye

  • Question about l ' object net.rim.device.api.ui.Screen

    Hello world

    I have a class that accepts an object of type "Screen" (net.rim.device.api.ui.Screen) in its constructor. When I instantiate this class, I include a class that extends the screen as a parameter. For example:

    public ClassA extends MainScreen {
         public void tester(){
              ClassB classB = new ClassB(this);
         }
              public void sampleMethod(){        ...     }}
    
    public ClassB {
    
         Screen screen;
    
         public ClassB(Screen screen) {
              this.screen = screen;
         }
         public doStuff(){          screen.sampleMethod();     }}
    

    My problem is that ClassB calls methods that are placed, but unless I change type "Screen" in the "class A", I receive the error: "the sampleMethod() method is not defined for the type of screen.

    How can I me ClassB to accept different classes that extend screen?

    Thank you!

    "each screen implements a SampleMethod() interface.

    Then could ClassB looks like this?

    public ClassB {}

    SampleMethodInterface screen;

    public ClassB (form SampleMethodInterface) {}
    This.screen = screen;
    }

    public doStuff() {}
    screen.sampleMethod ();
    }
    }

  • A question about conservation of a number

    Hey guys...

    Is there a way where if I have a number in an image (for example) and I go to the next section... If I go back to the original frame to keep this number?

    As:

    Frame 1 I have a score and it maintains.

    Box 2 shows me something, and after a while, it goes back to frame 1

    How can I keep this score rather than start all over?

    Thank you!!!

    In the first picture, you can use a conditional to check if the variable exists.  If this isn't the case, declare it and assign the starting value.

    {if (!) Count)}

    var number = 0;

    }

  • Question about clicking object behind a mask effect

    First of all, sorry for the title of indescriptive, couldn't really think of anything.

    Okay, so I want an effect to my Flash project. Basically, I have a black background and a simple mask effect that follows the mouse, if you move the mouse and it shows you the layer behind the black background... The script looks like this:

    color_mc. Mask = mask_mc;

    mask_mc.cacheAsBitmap = true;

    color_mc.cacheAsBitmap = true;

    mask_mc.addEventListener (Event.ENTER_FRAME, moveMask);

    function moveMask(e:Event):void

    {

    mask_mc.x = mouseX;

    mask_mc.y = mouseY;

    }

    And it works very well, but it's not all that I intend to do. In short, the user must move the mask using the mouse and find several colorful objects hidden behind it (it works very well), so I want to do all the clickable object and I want the object to change forms when they are clicked on. I'm pretty new to Flash, but I fiddled around with it and could not get to a solution that worked.

    I tried labeling different frames on the timeline. "color1", "Color2" and then by a

    color_mc.Color1.buttonMode = true

    color_mc.Color1.addEventListener (MouseEvent.CLICK, COLOR1);

    function {(e:MouseEvent) COLOR1}

    gotoAndPlay ("color1");

    }

    So go to this image, but this probably isn't the right way to do it, because the mask effect no longer works (I even tried to copy the action on the framework "color1" script), and I think that if you had clicked on the "color1" first object, and then the "Color2" object after

    I think that he would turn the "color1" action (but I'm not sure)

    * Note * color_mc is the background with objects on I want clickable and objects are called "color1", "Color2" etc.

    Oh and one thing I would also like to recognize when all objects are clicked and then move on to a new frame/scene.

    Sorry, if I could not explain it correctly; as I said I'm not experienced in Flash and I would be really grateful if someone could help me. If there is anything you want to know or if you want to see my flash file, let me know.

    use:

    Import fl.transitions.Tween;

    Import fl.transitions.easing.None;

    color_mc. Mask = mask_mc;

    mask_mc.cacheAsBitmap = true;

    color_mc.cacheAsBitmap = true;

    mask_mc.addEventListener (Event.ENTER_FRAME, moveMask);

    function moveMask(e:Event):void {}

    mask_mc.x = mouseX;

    mask_mc.y = mouseY;

    }

    var t1:Tween;

    var t2:Tween;

    var colorNum:int = 5;

    var numClicked:int = 0;

    for (var i: int = 1; i<>

    color_mc ['color' + i] .buttonMode = true;

    color_mc ["Color" + i] .addEventListener (MouseEvent.Click, tweenF);

    }

    function tweenF(e:MouseEvent):void {}

    T1 = new Tween(e.currentTarget,"scaleX",None.easeNone,1,1.5,.5,true);

    T2 = new Tween(e.currentTarget,"scaleY",None.easeNone,1,1.5,.5,true);

    e.currentTarget.mouseEnabled = false;

    addChild (MovieClip (e.currentTarget));

    e.currentTarget.x += color_mc.x;

    e.currentTarget.y += color_mc.y;

    numClicked ++;

    {if(numClicked==colorNum)}

    Stop ("framework");

    }

    }

  • Question about the object

    public class Testing{
    public void status(Object d){
    System.out.println("object is called " + d);
    }
    
    public  void status(String s){
    System.out.println("String is called " + s);
    }
    
    public static void main(String[] args){
    Testing a = new Testing();
    a.status(null);
    }
    }
    Output : String is called null

    No doubt: I can't understand how including compiler to call status method with the String argument and not the one with the Object.Even argument if he did then why NullPointerException was not thrown during execution, since printing System.out.println ("the string is called" + s), it will call the method toString() on s and since it is null it should throw a NullPointerException.

    Any clarification on this is much appreciated.

    isocdev_mb wrote:
    I'm not clear on the method resolution (perhaps something on the more specific signature)

    NULL is considered as to be more precise in the hierarchy, so if you have overloaded methods where first one takes object, the second takes Foo (a subclass of object) and third takes the Bar (subclass of Foo), then one with the setting Bar would be called.

    But if you have a parameter Object and two methods with the subclasses of object as parameters, you will get a compilation error because specific to one can not be chosen.

    does not imply an invocation of toString(). s is a string already

    Nothing implies a call toString(). The method that is called is String.valueOf (param Object), which returns "null" when given null. No NPE, no problem.

  • A question about script objects

    I placed a script object in my form to control the color of the field and it works very well in Adobe Reader X but not in earlier versions of the reader and not in Acrobat pro 9.

    Can someone tell me what is the problem?

    The script object looks like this:

    form1. #variables [0]. RGA_format - (JavaScript, client)

    function RGA_colorOld()

    xfa.resolveNode("this.ui.#textEdit.border.fill.color").value = '220,220,220';

    function RGA_color()

    xfa.resolveNode("this.ui.#textEdit.border.fill.color").value = "255,255,255";

    And name fields on the docReady event and the event of modification of this script:

    Form1.blanketB.moder.EftNvnMor::docReady - (JavaScript, client)

    RGA_format. RGA_colorOld (the);

    Form1.blanketB.moder.EftNvnMor::change - (JavaScript, client)

    RGA_format. RGA_color (the);

    Kind regards

    Kirstine

    Hi Kirstine,

    When you call the function, you pass through the object as a parameter. However the function in the script object doesn't have a setting to receive this.

    You can probably get through the object as a reference:

    RGA_format.RGA_color(this);
    

    However I prefer to declare a variable first and pass through:

    var fieldObj = this.somExpression; // declare a variable to be passed into the function
    colourControls.fieldGetsFocus(fieldObj); // calls the function "fieldGetsFocus" in the script object "colourControls"
    

    Notice in the example, I have, when you declare the function, I have a 'fieldObj' parameter, to receive the information that is passed through.

    function fieldGetsFocus(fieldObj) // first function
    {
         ...
    }
    

    A small point on the function in the script object. I know that the function is a single line, but I'd rather see this wrapped in braces.

    Finally changing the fill requires access to the properties of the user interface. They are different for each type of object. For example, the script that you have is for a textfield. This does not work on a numericfield.

    I have an example here of a function that does what you are looking for: https://acrobat.com/#d=XGj9UEk4lSbDSoArnQU8dQ. Note how to check what is the object and then resolve the correct ui property. What makes the more reusable must function.

    Hope that helps,

    Niall

    Ensure the dynamics

  • Question about the BOROUGH a number to the nearest quarter

    Hi all

    Please forgive me if I am not posting this at the appropriate place, but I do not know what area he could enter (script, Javascript, Designer...) and the Acrobat Scripting forum seemed as good one place as any.

    I have the field that allows a user to enter a number with 2 decimal places 2-digit. (i.e. 12.30 or 9.78 until 24.00.) This field corresponds to the hours in a day). What I would like is to "round" the quarter of an hour. As an example, if a person enters:

    22.15 - the field would round up to 22.25

    9.78 - the field would round down to 9.75

    12.10 - the field would round down to 12:00

    .15 - would round up a.25

    .96 - would turn to 1.00

    .01 a.24 - would round up a.25

    Essentially, any number that they take place in this field (until 24:00) would be around in an appropriate manner.

    I looked at the ROUNDING FormCalc function and DATE / hour, but it doesn't look like one of those that would allow me to do what I have to do. I guess, that it should be in JavaScript, but yet again, I'm not sure.

    If someone can point me in the right direction, it would be greatly appreciated, and if all goes well, I explained to him what I want to do it properly.

    Jon

    Here is an example of code that I wrote to round a number (x) to the nearest quarter (nouveaux_x):

    var x = 22.15;
    var rounded_x = Math.floor (x);
    var x_nouveaux;

    If (x-rounded_x<=0.125) new_x="rounded_x;" 0="" -="" 0.125="" round="" down="" to="">
    ElseIf (x-rounded_x<=0.375) new_x="rounded_x+0.25;" 0.125="" -="" 0.375="" round="" to="">
    ElseIf (x-rounded_x<=0.625) new_x="rounded_x+0.5;" 0.375="" -="" 0.625="" round="" to="">
    ElseIf (x-rounded_x<=0.875) new_x="rounded_x+0.75;" 0.625="" -="" 0.875="" round="" to="">
    else x_nouveaux = rounded_x + 1; 0,875 - 1,00 round up to 1

    Edit: improved code...

  • question about an object in java

    If I have
    1.class Fizz { 
    2.    int x = 5;
    3.    public static void main(String[] args) {       
    4.        Fizz f2 = new Fizz(); 
    5.        System.out.println("f2 is " + f2);    
    6.    }
    After printing, the result is
    f2 is Fizz@3e25a5
    Should it be
    f2 is Null
    My logic is when line 4 is executed, the manufacturer (super) will be invoked and it initialize f2 with a NULL value. If my logic is not sacred, correct me please. Thank you.

    The Java API for the toString method:

     The toString method for class Object returns a string consisting of the name
    of the class of which the object is an instance, the at-sign character `@',
    and the unsigned hexadecimal representation of the hash code of the object.
    In other words, this method returns a string equal to the value of:
    
         getClass().getName() + '@' + Integer.toHexString(hashCode())
         
    

    Published by: Darryl Burke - divide a long line within the tags of code in 4 lines

Maybe you are looking for

  • I have almost 40 000 emails! Help!

    Hello Yes! I have a big problem that I can't solve everything. On my PC, it says I have no unread emails but on my Iphone 5, it says that I have almost 40 000! I use gmail and I had this problem for 2 years and it really does not use a lot of space o

  • Windows 8 error Oxc0000225 ssd

    I have a hp envy 15-j022el. I also bought a Samsung SSD 840 Evo to replace the internal hard drive 1 TB. I cloned the SSD HD with Aomei Partition Wizard 5.5 standard edition. Everything went well and the HD has been cloned to SSD. Then I replaced the

  • Cannot see Vista SP2 to windows update? (I tried a lot of methods)

    Since SP2 was released a few months, but whenever I click on the Windows update of the control and audit for the update panel. It shows there is still no update for my computer. I tried methods, such as,. 1. update all the drivers on my computer and

  • Import certificates

    Hello I have two problems the two I think about SSL/TLS somehow. I came as a much creating Points of trust for the respective cases certificates of signature in question. (1) I want to configure LDAP with SSL connection to our announcement Yet, choos

  • Automatick on 11 G R2 memory management

    Hi allI am confused with a weird behavior of the AMM.I'm using Oracle 11.2.0.3 64bits SE1 on Windows 2008 R2 64 bit.ConfiguredMemory_target = 60 gigsSGA_target = 0PGA_Aggregete_target = 0Get the slow complain about the user and when I check the Manag