Divide and get the result with decimals exactly.

Hello. I've tried to
double d;
d=9/5;
this will give the result d=1.0
why dont i get 1.8???? thats the correct when i divide 9 with 5.
sincerely h

This problem came up earlier.
http://forum.java.sun.com/thread.jspa?threadID=5239481&tstart=0
Integer divided by Integer results in an integer.
Then, in turn, is casted to a double.

Similar Messages

  • How do I get iTunes 11 to work as the old iTunes did in this respect: after playing a song in one playlist, I click on another playlist, highlight a song, press play, and get the result of that song playing & that playlist continuing?

       How do I get iTunes 11 to work as the old iTunes did in this respect: after playing a song in one playlist, I click on another playlist, highlight a song, press play, and get the result of that song playing & that playlist continuing?  As it goes now, one clicks on the song in the new playlist where the arrow is and then chooses 'Play Song Next.'  So, it plays next, but then the song after that is back in the old playlist.  I want to use iTunes smoothly without the extra clicks I've had to do in order to get the playlist to continue.  This is music for background while I play the violin at restaurants, and extra clicks and hassle is quite unappreciated, especailly since it worked fine in the previous iTunes.
       Thanks.

    At the top of the playlist where it shows the playlist title and the number of songs, there are two icons. Click the "play" triangle to add the entire playlist to "Up Next", or the "shuffle" symbol to do the same thing but in random order. But the currently playing track will stop playing, and all the songs in "Up Next" will be removed (replaced by the ones from this playlist).
    If you hold down the "option" key while clicking those icons, the currently playing song will continue playing, and the new playlist will be added to "Up Next" (above the songs that were already there).

  • How to create the Vote Form and Get the Result

    I have an assignment to create a website for voting and show the result online.  Anyone can tell me the steps to build such website???

    This tutorial uses jQuery and PHP
    http://code.tutsplus.com/tutorials/creating-a-dynamic-poll-with-jquery-and-php--net-57
    Nancy O.

  • Compare 2 schemas and get the difference with .sql file.

    Hi,
    I am using ORACLE DATABASE 11g R2 and ORACLE Linux 5.
    I want to perform a very lengthy process and want to make it automated.
    I am having a software named as SVN. In which all the developers keep their updated scripts.
    We have 2 schema's one is used for developement and when all the development seems good we implement the scripts on the final schema which is used by testing people also.
    Now every day we need to check the modifications in the development schema, that we do by observing the updated scripts in the SVN software. Now we get the scripts which are modified.
    We will fire this scripts to a sample schema then we will compare the objects in this schema and the same objects in our final schema. If the objects in sample schema is different than the final schema it should give me the
    script to create the same type object in the final schema.
    Below is a proper example to explain :-
    Developement Schema :- 'DEV'
    SVN Script Schema :- 'SVNscript'
    Main Schema :- 'MAIN'
    1) On Monday developers modified/added 4 tables in the development schema names 'DEV' after working for a day they found that the changes are necessary and so checked-in in the SVN software.
    2) On tuesday morning we found 4 scripts which has been modified/added in the SVN.
    The Scripts were as follows :-
    1St table :- An extra column was added.
    2nd table :- An index was created on it.
    3rd table :- 2 Columns were dropped from it.
    4th table :- A new table is added in the schema.
    Now taking these 4 scripts i am going to execute it in a sample schema named :- SVNscript
    SVNscript schema will have now 4 tables with proper properties(columns,indexes,...). Now this is the final table structure as we want in our 'MAIN' schema .
    Coming to MAIN schema which is our most important schema and all the development work is finally posted here.Considering MAIN schema is having around 1000 tables,500 function/procedure/package and many more DB objects.
    I want to compare(one way compare) from SVNscript schema --> MAIN schema :- That the objects present in the SVNscripts schema is same or not in the MAIN schema. If its not same then this code should generate a .sql script for me which i should be able to fire on the MAIN schema.
    The output .sql scripts should be something like this :-
    1st Table :- Alter table add...
    2nd Table :- Create index on table...
    3rd Table :- Alter table drop...
    4th table :- Create table tablename...
    I found a link while trying this but it is not the perfect fit to my requirement
    http://www.dbspecialists.com/files/scripts/compare_schemas.sql
    Please let me know the best code to compare 2 schemas and get a .sql file as output of the difference.
    Thanks in advance.

    Yes I followed the tutorial properly this time. Still i have a few queries :-
    1) This is returning me the 'ALTER TABLE...' statement but how to make it more efficient to return all the DDL dependent on the table, Like index,trigger,view...
    2) I want to compare objects in a different schema on a different db. I have created an DBLINK but how to use it ... can i use it like
    DBMS_METADATA.OPEN('TABLE'," Network_link_name " );Can you please give me some clear about it.
    3) I created a table 'TAB1' with which i want to compare a 'TAB1' in other schema.I was not getting how to compare on remote dblink so,I created the same table with the following code in the same schema
    CREATE TABLE TAB1_OLD as select * from TAB1@DBLINK where 1=2;Now when i fire the below query to get the alter difference I get the following error :-
    SQL> SELECT get_table_alterddl('TAB1','TAB1_old') FROM dual;
    SELECT get_table_alterddl('TAB1','TAB1_old') FROM dual
    ORA-31603: object "TAB1_old" of type TABLE not found in schema "SVNCHECK"
    ORA-06512: at "SYS.DBMS_METADATA", line 5225
    ORA-06512: at "SYS.DBMS_METADATA", line 5189
    ORA-06512: at "SVNCHECK.GET_TABLE_SXML", line 17
    ORA-06512: at "SVNCHECK.COMPARE_TABLE_SXML", line 12
    ORA-06512: at "SVNCHECK.GET_TABLE_ALTERXML", line 11
    ORA-06512: at "SVNCHECK.GET_TABLE_ALTERDDL", line 11
    Can you please guide me why i am getting this error?
    I have made sure that TAB1_OLD table has been created and the entries are also present in the data dictionary tables.
    SQL> select * from tab1_old;
    EMPNO ENAME                  MGR DEPTNO
    ----- -------------------- ----- ------The only difference is that this table was created with CREATE TABLE AS SELECT statement ....
    Thanks.

  • Execute command on UNIX and get the result

    I want to write a Java program, which can execute a shell script in UNIX and get back the result. Any idea?

    Check these two tips:
    How to execute a command from code
    http://www.java-tips.org/java-se-tips/java.lang/how-to-execute-a-command-from-code.html
    How to read output from a Command execution
    http://www.java-tips.org/java-se-tips/java.lang/how-to-read-output-from-a-command-execution.html

  • How can I call the jFreeChart to plot graph and get the result in Servlet?

    I want to use jFreeChart to plot time series graph, and then output the result in Servlet. How can I call the jFreeChart to plot graph and get back the result? Any source code for example? Thanks a lot!!

    Dave,
    ServletDemo1 and others were not in the distribution that I got (jfreechart-0.9.4). I found them under the premium demos somewhere in com/refinery/chart/demo/premium, but could not compile. They're complaining, among other things, about missing classes/packages com.refinery.date.SerialDate and com.refinery.ui. Am I using a wrong version of jfreechart?
    Thanks,
    -Alla
    There is a very simple servlet demo in the JFreeChart
    distribution:
    src/com/jrefinery/chart/demo/ServletDemo1.java
    This simply sends back an image to the browser.
    A second demo, which embeds the chart in an HTML page
    is:
    src/com/jrefinery/chart/demo/ServletDemo2.java
    src/com/jrefinery/chart/demo/ServletDemo2ChartGenerator
    java
    ...includes a time series chart as one of three
    options.
    Regards,
    Dave Gilbert
    JFreeChart Project Leader
    http://www.object-refinery.com/jfreechart/index.html

  • How to suppy and get the results from a procedure dynamically.

    Hi all,
    I have a simple procedure, which should prompt five times for
    values and display the values dynamically. but it is not
    behaving like that. while compilation it is asking for the
    value, once i enter the value , it is prompted that procedure
    created. while executing, it is diplaying all five same values
    what i have entered at compilation time. Please check out. Here
    is the code.
    create or replace procedure test is
    t_var integer;
    t_count integer := 0;
    begin
    loop
    t_var := &r;
    dbms_output.put_line('The value is: ' || t_var);
    If t_count = 5 Then
         Exit;
    End If;
    t_count := t_count + 1;
    end loop;
    End;
    Regards,
    G. Rajakumar.

    See now what happens is
    When u use &variable in sql or plsql it tries to substitute with
    the value held by that variable. If it dosent find that value in
    that session then it prompts for one. (that is why ur proc asks
    for value only once)
    What happens in your proc is
    fisrt time it will ask for &r value, but subsequent i will not
    ask because when second time it tries to do &r in your prog it
    finds the value that u had entered above. Also as u said that
    prog takes the input and dosent show anything this is cos sql
    engine takes the value and compiles the proc it actucally shows
    when u run it. U can have look at the below executed program
    In this once u have eneterd say value 199 then it display 199
    for those many number of times. I hope this answers your
    question.
    SQL> ed
    Wrote file afiedt.buf
    1 create or replace procedure test is
    2 t_var integer;
    3 t_count integer := 0;
    4 begin
    5 loop
    6 t_var := &r;
    7 dbms_output.put_line('The value is: ' || t_var);
    8 If t_count = 5 Then
    9 Exit;
    10 End If;
    11 t_count := t_count + 1;
    12 end loop;
    13* End;
    SQL> /
    Enter value for r: 12
    old 6: t_var := &r;
    new 6: t_var := 12;
    Procedure created.
    SQL> exec test
    The value is: 12
    The value is: 12
    The value is: 12
    The value is: 12
    The value is: 12
    The value is: 12
    PL/SQL procedure successfully completed.
    SQL>

  • Using SUBMIT and getting the results back

    Hi,
    I need to call a BAPI on-line (not in the background) using a different User ID as the one that's logged in.  I read from the threads the use of SUBMIT ...VIA JOB. 
    CALL FUNTION 'OPEN JOB'...
    SUBMIT zsubmitted_program
           VIA JOB     l_jobname
               NUMBER  l_jobcount
               USER    i_user       ====> changed User ID
           TO SAP-SPOOL WITHOUT SPOOL DYNPRO
               SPOOL PARAMETERS ls_params
                  AND RETURN.
    CALL FUNTION 'JOB_CLOSE'...
    Questions:
    1. How would I know that the job is finished?
    2. How do I retrieve the messages returned by the BAPI so I can present it on the screen?
    Many thanks,
    Huntr

    Hi,
    I will be wrapping BAPI_MATERIAL_SAVEDATA into a Z program to run it and use the method mentioned above.  I need to know by that method when the batch job is done and how to retrieve the results.
    Is there a function module to retrieve the job status or log?
    Also I think if i write the bapi results in the spool, I should be able to retrieve the spool.  What is the function module to do so?
    Regards,
    Huntr

  • I want to put a number in a cell and tell it to times by 2 and get the result as a total further along. Sorry couldn't find the answer in any tutorial.

    I want to put a number in a cell and tell it to times by 2 to give the result i another cell?  Sorry couldn't find the answer in any tutorial.

    Hi Caakie,
    Sounds like tou need some basic information.
    The best advice I can give someone new to Numbers (and to spreadsheets in general) is to download and read at least the first four chapters of the Numbers '09 User Guide. You'll find a download link in the Help menu in Numbers '09.
    When you want to start using more complicated formulas, you'll also need the iWork Formulas and Functions User Guide, available from the same menu.
    Regarding your question: "Can you just give me the string for B which is just add and C which is *2."
    What is to be added in "B"? What is to be multiplied by 2 in "C"?
    =2+3 will return the result 5.
    =A+B will return the sum of the numbers in column A and column B in the same row as the cell containing the formula. If either A or B contains a non-numerical value, the formula will return an error message.
    =3*2 will return the result 6.
    =A*B will return the product of the numbers in column A and column B in the same row as the cell containing the formula. If either A or B contains a non-numerical value, the formula will return an error message.
    Regards,
    Barry

  • Can you create a test online and get the results filter in the report tab?

    Im brand new to this software and i had a big concern about it.
    This is a great tool to create surveys and forms to fill out but i was wondering if you can create a quiz.
    By a quiz i mean that instead of sending me back the data the user click in the multiple choice is it
    possible for me to get instead if they got it right or wrong.
    I want to retun if they got it right a boolean variable (true or false)
         logic ex)
         if (answer == true)
             return "correct"
         else
              return" "incorrect"

    Hi;
    You can certainly create a Quiz using FormsCentral but there is nothing built in to "grade" the quiz and no integration with any grading systems like flubaroo.
    You might be able to use "Formulas" on the "View Response" tab to identify correct/incorrect answers. 
    This describes a bit about how to use Formulas (they can be done in a column as well as a row): http://acrobatusers.com/tutorials/how-to-work-with-formulas-in-formscentral
    This is a list of the forumulas available in FormsCentral: http://helpx.adobe.com/acrobat-com/formscentral/help/formula-syntax-built-in-functions.htm l
    Thanks,
    Josh

  • How do I duplicate an image on the main screen so that I can edit it and compare the result with the original?

    In Elements 12 How do I duplicate an image on the main screen (as well as the photo bin) so that i can compare any editing with the original?

    In full Editor, go to Edit>Preferences>General and check "Allow Floating Documents in Full Edit Mode"
    Open the image so that you see it in the project bin
    Right click the image thumbnail in the project bin, and duplicate. It will come in as xxxcopy
    On the Arrange icon at the top, select 2-up. You should see the original and the duplicate in the work area

  • How to input data from labview to executable application and export the results back to labview

    I have a simple function written in m file under Matlab enviornment,
    function [c]=myadd2(a,b)
    c=a+b;
    I built it into a executable file (.exe), then I want to call it in labview and get the results.
    I followed this tutorial and some other information on line:
    http://digital.ni.com/public.nsf/allkb/5CF9526FF069EA8E862564C400579DBA
    But I didn't see any telling me how to get the Labview array data input to the EXE file and return the results data back to another indicator in labview.
    Any one have some idea?
    I appreciate the help very much.
    Arnold

    You probably need to include some command line arguments on your executable that would be the name of a file to get the data from. You could also include a command line argument telling that exe where to store the results.
    I am not familiar with Matllab to give you advice on how specifically to do that with your exe though.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to run commands like "ipconfig" and get the output in adobe AIR in windows?

    import flash.desktop.NativeProcess; 
    import flash.desktop.NativeProcessStartupInfo;   
    if (NativeProcess.isSupported) {     
         var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();     
         var processpath:File = File.applicationDirectory.resolvePath("MyApplication.whatever");     
         var process:NativeProcess = new NativeProcess();       
         npsi.executable = processpath;     
         process.start(npsi); 
    The above can only run a sub-application, but how to run an independent  application(command) like ipconfig and get the result?

    Hi,
    here is an example of running a net Use command line from AIR, unig the new NativeProcess. Hope it will help !
    function launchProcess()
      var file = air.File.applicationDirectory;
      // set command path
      file = file.resolvePath("C:/Windows/system32/net.exe");
      var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
      nativeProcessStartupInfo.executable = file;
      // prepare command parameters
      var args = new runtime.Vector["<String>"]();
      args.push('USE');
      args.push('W:');
      args.push('/delete');
      args.push('/y');
      // set arguments
      nativeProcessStartupInfo.arguments = args;
      // add listeners to catch command outputs
      process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
      process.addEventListener(air.ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
      process.addEventListener(air.NativeProcessExitEvent.EXIT, onExit);
      // create and run Native process
      process = new air.NativeProcess();
      process.start(nativeProcessStartupInfo);
    function onOutputData(ProgressEvent)
      var processResults = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable);
      air.trace("Results: \n" + processResults);
    function onErrorData(ProgressEvent)
      var processResults = process.standardError.readUTFBytes(process.standardError.bytesAvailable);
      if(processResults.search('password') > -1){
        window.alert('Bad password');
      air.trace("Errors: \n" + processResults);
    function onExit(NativeProcessExitEvent)
      air.trace("Process ended with code: " + NativeProcessExitEvent.exitCode);

  • How to use TextField to add two numbers and show the result.

    hi everybody
    i would like to use JTextField to get addtion of two Numbers,
    for example i am trying to type any integer numbers in JTextField like 7
    and press JButton, called( +) to add anthor number like 7 and press JButton called(=) to get addtion fo
    7 + 7 = 14, at same JTextField.
    so there will be two buttons, one for (+),other for (=).
    i have implement ActionListener in (+) button ,to get Text from JTextField (with getText() method),
    now how do i use same getText() method to get the next number that i will add it with previous number in
    (+) button and get the result whenever i press (=).
    1-type integer number like (4) in TextField.
    2-press addition button(+) to get text by using getText() method and clear TextField.
    3-type anthor integer number like(6).
    4-press (=) button to get the number (6) by using getText() method, calculate 4 + 6 and show the result at same TextField (10).
    i hope it is so clear
    thank u in advance for any advice and suggestion.

    Use your first button to
    String x = JTField.getText();
    int y = Integer.parseInt(x);
    this will get your first value on your + button. Make sure you initialise the int beforehand incase nothing is put in (ie error prevention) then clear the JTField prob using setText(""). Repeat the process for the = button using different variables and add them normally and output the result.
    If your putting more than 1 arithmetic button on the GUI then you'll need to distinguish between them!!!

  • Running report and get the report result with coding

    Hi all,
    In our R/3 system, there is a custom sales report.
    My question is: is there possibility to get data by running this report and grab it the result with code and store it in internal table?
    Sorry if my question too basic because I am not abaper
    I am just wondering to find new solution for my project.
    Regards,
    Steph

    My requirement is: I want to get the result from this report
    (rather than try to get the data from SAP original table, because this report is very complicated with a lot of selection data) and use it this result into my new program.
    The mechanism that I want is pull the result from the current report, not to add some code in current report to push into new program, to avoid changed the report.
    Btw, the output of this report not only the excel file, we can also run this report on foreground mode and see the result.
    The report is not ALV report.
    Regards,
    Steph

Maybe you are looking for

  • Migração: Tax Group in Access Sequences

    Boa Tarde experts! Algum de vocês já passou por um problema parecido? - Criei um novo Tax Group de MM para PIS e COFINS somente - Associei as Conditions Tables corretas para o Tax Group Quando vou fazer a migração desse Tax Group nas sequencias de ac

  • I just rented a movie on my ipad, and now want to watch it on my Apple Tv

    I just rented a movie on my iPad (which does not have sufficient space to download the movie) with hopes of being able to watch it on my Apple Tv when I got home. However, when i got home, the Apple TV is says that i need to re-rent it. If i 'purchas

  • Using fieldnames table in GUI_DOWNLOAD method

    Hi Experts, I need to download an itab data with field names as headers. I am using this but getting error 'Formal parameter "FIELDNAMES" does not exist. However, the parameter "FILENAME" has a similar name'. CALL METHOD cl_gui_frontend_services=>gui

  • Is a license key needed for SAP WAS 6.40 sp16  sneak preview edition

    Hello Guys, I have a basic question regarding license key. Do I have to request a license from http://service.sap.com/licensekey from sap for the sneak preview evaluation edition? I think it is nowhere mentioned in the downloads page for the WAS 6.40

  • MSS PCR ( Change In position)

    Hi all   i am using a one-step approval workflow process in MSS PCR (Request for Position Change).1st time when i am trying to initiate the position change for a particular employee its taking fine.but after the completion of approval process for tha