How can I specify infinity in java

i want to declare a variable as below. What do I specify for the infinity?
final static MAX_FIELD_SIZE = ?? infinity ??
Thanks.

Well, you didn't give a data type for MAX_FIELD_SIZE,
but the maximum value for an int is 2147483647,
a long is 9223372036854775807, a float
is 3.40282347e+38, and a double is
1.79769313486231570e+308. So, you could just use the
appropriate maximum value to serve as infinity, since
your program will blow up if you try to assign
anything higher.If this is what you wish to do then these maximum values are already stored for you in the primitive type wrapper classes. You should use them in preference to hard coding the values:
Integer.MAX_VALUE /* = pow(2,31) - 1 */
Float.MAX_VALUE // etc...

Similar Messages

  • How can I specify...

    How can I specify an exact location for a data file? The program that reads the file has this as a constructor:
    public VocabularyWordRW (String fileName) {
    fname = fileName;
    list = null;
    Whenever I call new VocabularyWordRW ("data1"); (which is the name of the file). I get a "File Not Found"
    message. It usually works on a Unix machine as long as I'm running it from the directory it's in.
    I tried putting the file in both c:\ and c:\englishDrill, which is the location of the program, but it still didn't work.
    Thanks for your help.
    -Chris

    The reason you need to use two backslashes, for exampe "C:\\blah\\datafile", is that the backslash character is a special escape character in Java - you use it to specify special characters. For example "\n" in a string in your source code means the newline character.

  • How can we specify the Mailbox for Notes?

    In Mail.app, how can we specify the Mailbox for Notes (where the new notes will be resided)? It is now 'On My Mac'. I wish to change to my IMAP Mailbox so it sync with my iPhone by just checking email (not by syncing on iTunes).
    Thanks in advance.
    Message was edited by: Ekapon

    You could use the DecimalFormat or NumberFormat to do the job.
    double number 1234.567;
    DecimalForamt df = new DecimalFormat("###.##");
    String s = df.format(number);or
    double number 1234.567;
    NumberFormat nf = NumberFormat.getNumberInstance();
    nf.setMaximumFractionDigits(2);
    /* if needed.
       nf.setMaximumIntegerDigits(value);
       nf.setMinimumFractionDigits(value);
       nf.setMinimumIntegerDigits(value); */
    String s = nf.format(number);I didn't test the codes but they should work. For more information, please consult the documentations.

  • How Can i specify multiple server names in rwservlet.properties  file?

    How Can i specify multiple server names in rwservlet.properties file without clustering?
    I am using oracle 10g Application server. we have 3 servers Repsvr1, RepSvr2 and RepSvr3. Now i need to configure rwservlet.properties file to point to these servers based on any running report. i got 3 keymap files with reports info.
    Sample entry in the key map file is:
    key1: server=Repsvr1 userid=xxx/yyy@dbname report=D:\Web\path1\path2\reports\Report1.rdf destype=cache desformat=PDF %*
    key2: server=Repsvr2 userid=xxx/yyy@dbname report=D:\Web\path1\path3\reports\Report2.rdf destype=cache desformat=PDF %*
    rwservlet.properties file letting me to enter only one servername. Even though i merged all 3 keymap files into 1, still i have the server name issue. If i leave the server to the default name still i am getting the below error.
    REP-51002: Bind to Reports Server Repsvr1 failed. However, i know the default rep_<servername> would be used incase we dont have SERVER=<value> parameter in the rwservlet.properties file.
    If i specify the servername in the rwservlet.properties file then only Repsvr1 reports are working fine and other 2 server reports are giving the same error like
    REP-51002: Bind to Reports Server <<Server Name>> failed.
    how can i configure the info which will work all 3 reports. 2 Port servers are invoking using oracle forms and report server is invoking using ASP pages.
    If i specify Server name & Key map file in rwservlet.properties one at a time, all the reports are working without any error, whenever i am trying to integrate all 3 to workable i am getting binding error. if i exclude the server from rwservlet.properties still i am getting the same error.

    My RELOAD_KEYMAP setting is YES only.As i said If i specify Server name & Key map file in rwservlet.properties one at a time, all the reports are working without any error.
    keymap file entries
    key1: server=Repsvr1 userid=xxx/yyy@dbname report=D:\Web\path1\path2\reports\Report1.rdf destype=cache desformat=PDF %*
    key2: server=Repsvr2 userid=xxx/yyy@dbname report=D:\Web\path1\path3\reports\Report2.rdf destype=cache desformat=PDF %*
    If i use http://server.domain:port/reports/rwservlet? cmdkey = key1 should bring the report from Repsvr1 and http://server.domain:port/reports/rwservlet? cmdkey = key2 should bring the report from Repsvr2, but i am getting an error from Repsvr2 saying that REP-51002: Bind to Reports Server repsvr2 failed.
    Only Servername Repsvr1 is in rwservlet.properties file. Now what is the best option to by pass the server from rwservlet.properties file and should be from keymap file. if i comment server name in rwservlet.properties file still i am getting REP-51002: Bind to Reports Server <<Server Name>> failed error for both keys.

  • How can I specify the default tab in a CHM Output?

    My company uses CHM-based help for some of its products. We build the CHM files from RoboHelp 9, and while these CHM files don't really have a full Index attached to them, the Index tab shows up in the output anyway. Unfortunately, we are suddenly seeing that when the CHM file is launched from our program, the Index tab is displayed by default. We'd rather have the Contents tab be the default look, especially considering that the Index does not exist.
    I have poked around into how you can specify a default tab for a CHM file, and the only information I have found suggests that using a CHM file creates a file (HH.dat) that specifies which tab should be displayed on a user-by-user basis, and that the last tab displayed when you close the CHM should be the first one displayed when you re-open it. While this is true if you open the CHM independent from the product, when you launch it from our program, it's all Index, all the time.
    So, my question is: How can I specify the default tab for a CHM file? Or, failing that, how can I excise the Index tab from my CHM output.

    Hi there
    This will be something up to your application developer to resolve. When s/he issues the call to open the CHM, there are parameters that may be used to always open with the desired tab "in front".
    Point your developer to the link below and advise that s/he is most likely interested in the section titled: Programming Tips.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • How can I specify an SFTP directory path that has spaces in it?

    The directory (path) on my SFTP server has spaces in some of the folder names: e.g. /data/Cisco Products/UC Applications/
    How can I specify this path in the directory field of a remote server definition if I want to upload files from my SFTP server to the CUCM?
    I've tried surrounding the whole path in quotes, %, *, backslash space, point, hash...running out of things to try. Must be possible...surely?!#
    Thank-you
    -Rob.

    I haven't tried this but when i hit tab to auto complete on a linux machine i notice a space and backslash between two words. I can see you tried backslash space. Try space backspace - <word><space><backslash><word>

  • How can I find out the java version Oracle has ?

    How can I find out the java version Oracle has built in?
    I've tried with ..
    SELECT comp_id, comp_name, version
    FROM dba_registry ;
    But I get.."table doesn't not exist".
    Thenks in advance!

    Pl post details of OS and database versions. Pl see this MOS Doc
    What Version of Java is Compatible With The Database JVM? [ID 438294.1]     
    and these Oracle docs
    11gR2 - http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_environments.htm#ADFNS654
    11gR1 - http://docs.oracle.com/cd/B28359_01/java.111/b31225/whatsnew.htm
    HTH
    Srini

  • How can I specify the path in Form Builder 9.0

    Hi, everyone,
    could anybody tell me how can I specify the path in Form Buidler 9.0? there is problems when I want to attach library in form builder. thanks to Kuldeep RAwat and Natalia Vidal, I know I should specify the path, but I still don't know how to specify, how can I do?
    besides, when I run a form, sometime there will be a warnig:
    Please acknowledge message
    what's that meaning?
    thank you very much for your great help

    Shay Shmeltzer thank you very much for your so quickly response. I have modified the file and my form can run now!
    but, when I open my form, it always suggest me:
    FRM-10102: Cannot attach PL/SQL library TalbotStandard. This library attachment will be lost if the module is saved.
    so everytime I open my form, I must attach the library manully. I don't know the reason. do you know that or anybody else knows that? thank you very much!
    have a good weekend :-)

  • How can user specify HAVING clause in Interactive Report

    How can user specify HAVING clause in Interactive Report after making the group by selection? Under Actions/Format, the user sees just the Group By-Sort and Group By options.

    Hi ,
    Thanks for your information.
    I am new to the APEX.*i need to show Progress bar while opening the each page* then user can know some process is happening from the backside and i don't know where i need to add and call the below function.could you please provide the steps for the progress bar.
    In my application there are almost 100 pages are there so, i need to show progress bar on each page while opening .could you please provide Global function to call on each page.
    function html_url_Progress(pThis){ 
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    //doSubmit('APPLY_CHANGES');
    redirect(pUrl);
    Regards
    Narender B

  • ... how can i use 'enter' in java (text) -.-

    Hi all,
    first the simple version;
    How can i use 'enter' in java. Like turn HELLO into
    H
    E
    L
    L
    O
    The not so simpler version IF needed;
    I have the following piece of code;'
    if (line.startsWith("Monday")) {
         String subjectsMonday = " math and philosophy";
         Calendar c = Calendar.getInstance();
              System.out.format("School begins at" +" 08:10", c, c, c);
              System.out.format(" school ends at " +" 15:55", c, c, c);
         System.out.println("We have the following subjects;" + subjectsMonday);the thing is ... i want the text "we have the following subject; math and philosophy" to start at a new line.
    HOW am i supposed to do that.

    %n may work for you:
            String subjectsMonday = " math and philosophy";
            Calendar c = Calendar.getInstance();
            System.out.format("School begins at" + " 08:10%n", c, c, c);
            System.out.format(" school ends at " + " 15:55", c, c, c);
            System.out.println("We have the following subjects;" + subjectsMonday);

  • Help--How can I open only one java program at one time?

    How can I open only one java program(same program) in Windows at one time?

    In Java 1.5, you can use the JVM's own monitoring APIs to examine what other JVMs are running on the system, and what applications they're running.
    It's general and powerful, but complex. The socket/file/whatever approach is cleaner, and probably more suited to your usage.
    Don't bother trying to use the Windows task manager for this sort of thing. You have to write messy native code, and it isn't reliable after all that anyway.

  • JDev TP3 / UML Class Diagram / How can I specify a derivative attribute?

    Hello,
    I'm trying to put derivatives (or calculated) attributes such as "age" or "price" in a class of UML diagram. In all of UML books that I've seen, a derivative attribute is represented with a "/" and the attribute's name. For example, "/age" or "/price". But in the class diagram of JDeveloper I can't put "/" in the name of attribute. So, how can I specify a derivative attribute?
    Thanks in advance,
    JVN

    Unfortunately, it is not possible to denote derived attributes in TP3. Bug 6915067 has been logged to address this in a future version.
    Thanks, Guus (JDev PM)

  • How can i specify username/password while creating a virtual directory

    Hi,
    i m trying to create a virtual directory in 9iAS on a mapped drive. How can i specify which username password to use to enable to connect to the network mapped drive. Is there any way where we can specify username / password ???
    thanks
    Unmesh

    9iAS R1
    Run the report service as a local account with administrator rights.
    On the target server, create a local account with the same user name and password.
    Now you can use the hidden shares ($) for example:
    &destype=file&desname=\\servername\d$\report_output\report.pdf
    9iAS R2 and 10g
    Pretty much the same thing except by default, the report server runs inline. I have not been able to get the entire service to run as a particular user. To get around this, I created a report server service and do not run the reports in process. It uses the separate service.
    rwserver -install rep90_name
    edit <ORACLE_HOME>\reports\conf\rwservlet.properties file.
    SERVER_IN_PROCESS=NO
    SERVER=rep90_name
    Edit service for rep90_name and change it to run as local administrator user you created on both servers and then start the service.

  • How can I specify SMTP Email Server userID and password when using Email VIs?

    How can I specify SMTP Email Server userID and password when using Email VIs included in Internet Toolkit?

    Hi,
    A similar question was posted on Discussion Forums soem time back. Please see the link below.
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000C7B00000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    You would find the last post in the above thread quite useful where it has a link to OpenG code. I am also copying that link for your reference.
    http://www.openg.org/tiki/tiki-index.php?page=OpenG+Internet+Connectivity+Tools
    Please feel free to respond to this post with any questions/comments you may have.
    Regards,
    Ankita A.
    National Instruments

  • How can I specify the attribute AU_SIZE in OUI

    Hello,
    How can I specify the AU_SIZE when i create the disk group for OCR and Voting disk when i install the GI home.
    Basically i want to create the Disk group with AU_SIZE as 4MB when i create it Via OUI.I know I can edit the attributes when i do using ASMCA.But not sure about OUI.
    Please can someone guide me ?
    Regards
    Joe

    Hi Joe,
    Did you mean that i will need to move the OCR/voting **** to another diskgroup -> drop the one created during installtion -> recrerate the diskgroup with AU_SIZE as desired Yes.. you must move OCR, VOTING and ASM SPFILE to another diskgroup and recreate the diskgroup.
    Doc said : Oracle recommends that the allocation unit (AU) size for a disk group be set to 4 megabytes (MB).
    I do not see benefits to configure the AU SIZE 4MBytes for diskgroup that will store only Clusterware Files.
    The voting files are stored directly on ASM Disk (i.e not use AU SIZE). The OCR File and ASM SPFILE use AU SIZE, but are not frequently accessed (low I/O) and files are too small to configure AU to 4MBytes.
    Set AU SIZE makes a difference when you do need high I/O throughput. i.e: Used to Diskgroup that will store Datafiles.
    I recommend you read my point of view how to store VOTING Files, OCR and ASM SPFILE on ASM.
    Re: 3rd voting disk on nfs share
    Regards,
    Levi Pereira

Maybe you are looking for