Giving input in runtime in defferent methods

Write a program to find the difference between sum of the squares and the square of the sums of n numbers?
If anyone can answer please answer it.

user13472923 wrote:
If anyone can answer please answer it.No one will answer it.
You should not ask questions like this.
Did you try your problem by yourself? If so, what have you tried and what were the problems you faced in that?

Similar Messages

  • Giving input to jtable from a database in runtime

    friends
    previously i have posted an query asking how to intilize the row size of jtable in run time for which i got good rewsponce to direct me to an page in sun/components,i read the jtable page in specifie link provided in sun,but i could not figure out how to give input to jtable from a database on runtime.In that page they have used by giving input in an array and then displaying it, by that they set the no of rows in the table ,but i want to set the row size based on number of records fetched from the oracle database.kindly guide me
    Arjun

    What you need is to develop a table model which uses a database as the data source.
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data

  • Giving input to the runtime process

    Hi Friends,
    I want to run the java debugger programatically through java. I started the debugger by creating a Runtime Process like:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import javax.swing.JPanel;
    public class RunDebug extends JPanel
    public static void main(String arg[])
    Runtime execEnv = Runtime.getRuntime();
    String command = "";
    try
    Runtime rt = Runtime.getRuntime ();
    command = "jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000";
    Process process = rt.exec (command);
    catch (Exception e)
    e.printStackTrace();
    The debugging process is started and it is ready for input, I have to give input the above same process. I searched for giving inputs to the Process class but I cannot. I tried this with batch file which contains all the commands but it is not running properly. Reply to me if you know the procedure. Thanks in advance.
    Thanks,
    Sangeetha.

    Thank you for your reply pa. But I tried this already like this:
    OutputStream fout= process.getOutputStream();
    OutputStream bout= new BufferedOutputStream(fout);
    OutputStreamWriter out = new OutputStreamWriter(bout);
    out.write("locals");
    I have given the next command to be supplied through OutputStream. But when I am reading the inputs in the Process like:
    InputStreamReader reader = new InputStreamReader ( process.getInputStream () );
    BufferedReader buf_reader = new BufferedReader ( reader );
    String line;
    while ((line = buf_reader.readLine ()) != null)
    System.out.println (line);
    But the output of the command that I gave through OutputStream is not printed. So I think the command which I gave through OutputStream is not properly recognized. If it is properly recongnized then I should get the output of that command when trying to read the input stream. Whether I am correct in writing the command through OutputStream??? Waiting for your reply...

  • Can I create a dynamic number of inputs during runtime?

    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID               NUMBER                (This will be the primary key)
    TBL_FILE_NAME          VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID               NUMBER               (This will be the primary key)
    TBL_FILE_ID               NUMBER                (This will be the forign key to the file table)
    TBL_META_COLUMN     VARCHAR2(30)     (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE          VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    Other things to note is that we would like this to be on a single page.
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.

    Welcome to the Oracle Forums !
    >
    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID NUMBER (This will be the primary key)
    TBL_FILE_NAME VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID NUMBER (This will be the primary key)
    TBL_FILE_ID NUMBER (This will be the forign key to the file table)
    TBL_META_COLUMN VARCHAR2(30) (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    >
    Creating Page Items dynamically is not available. You will have to create excess items and hide/show , etc. But you cannot change the Item Type. All in all, too many limitations in this approach.
    >
    Other things to note is that we would like this to be on a single page.
    >
    The 100 item limit will hit you if you go with extra item on page. With Tabular Form that should not be a limitation, unless you are exceeding the 50 item limit of APEX_APPLICATION.G_Fnn items, and the 60 column limitation of Report region with "Use Generic Column Names (parse query at runtime only)" of Dynamic region.
    >
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    >
    If the type if item is variable it only means you need a way to store the item type. Meta Data of the Meta Data.
    >
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    >
    Yes, you can do it. Updatable report/ Tabular Form query can be constructed from the Meta Data using PL/SQL Function Returning SQL Query . It will be a bit of coding in PL/SQL where you use the Meta Data and the Meta Data of the Meta Data to piece together your SELECT with the right APEX_ITEMs. It might have a performance penalty associated with it, but will not be a serious degradation.
    >
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.
    >
    I guess that is just a good TNF. It is the Master-Detail Design Pattern, that sound more modern ? ;)
    Regards,

  • Giving a new runtime a time to live

    Hi
    I am making a system which lets a user submit the source code to a program, the system takes the code, compiles it and then tests it.
    When i run the submitted program to run some tests on it i would like to give it a time to live, incase there are any errors in it which would mean it would run indefinately (eg never ending loops etc).
    At the moment i launch the program with the following code;
    String cmd = "./" + testprogram + " " + input + " " + output;
    Runtime ra = Runtime.getRuntime();
    try{
    ra.exec(cmd);
    catch(java.io.IOException ew) {
    System.out.println(ew);
    this is under linux
    many thanks for any help i get
    Rich

    When you call exec(string), a Process is returned. You should be able to use the destroy() method to end it.

  • WS Console: Med Rec: Runtime loading of methods incorrect

    WebLogic 8.1, Med Rec Tutorial 17, Step 7: Secure the findNewUsers() EJB method.
    Netscape 7.1 & IE 6.0
    Methods do not appear in list. A JavaScript dialog appears with the following
    text:
    Runtime loading of methods incorrect. MethLen: 27 resLeng: 27 express: 26
    Gary

    More than a year, since the original one was posted, later I came across the same issue. What a pity, BEA wasn't interested in looking into this. I spent a little time to find out that in the javascript the variable methodString contains semicolon separated methods signature has a method
    assignGroups(java.lang.String,[Ljava.lang.String;) - REMOTE
    with a semicolon embeddeb in it. The signature actually is
       assignGroups(java.lang.String,java.lang.String[])
    This extra semicolon makes the length (26) of the methods got one more than it suppose to be.
    - Michael

  • Planning Statistics giving Zero Average Runtime

    Hi,
    Issues regarding planning function statistics, we got Planning functions as Formulas(it contains Fox code),Delete,Bridge Variance,Delete locking data,Refill Interface cube ect,
    Runtime(%)     Executions     Avg. Runtime     Avg. Read Time     Avg. Logic Time     Avg. Records
    0.........                             200......                0 ......                      0.....                           0.63...                    2000
    0........                              70.........                 0......                      0.......                           0.01...                   10
    0........                               60....                 0......                       0....                           0.1....                  800
    0........                               60.....                 0.....                      0....                                  0.11...                   10..
    0........                                2...                 0.....                      0....                                 0.7...                   7000
    my question to evey one is on 25.10.2010     we got executed 200 planning function even though  the Avg, Runtime giving Zero can any one clarify wat is the problem and solution please.
    Edited by: shilpa432 on Nov 12, 2010 4:50 PM
    Edited by: shilpa432 on Nov 12, 2010 4:51 PM

    Hi Mark,
    Try out the following options.
    1) Run /SAPAPO/RTO_ORD_COMP and check any inconsitencies
    2) Check all the capacities (primary and secondary if any) are
    maintained in the work centre and recif and try
    3) Check the input-output relations in the bom/routing are defined
    properly alongwith activity relationship
    4) Check SAP note 1147324
    Regards
    R. Senthil Mareeswaran.

  • Giving input to running EXE & getting output from it

    Hi there,
    I want to invoke an EXE file using runtime.exec() & also want to give some input to it when it's in running state & also want to trace the output of that EXE.
    I tried it using PipedStream but failed to do this,
    please suggest something.
    Thanks In Advance,
    parag

    Here is my code.......
    //Pipe Writer class
    import java.io.*;
    public class Pipe_Writer extends Thread {
         PipedWriter pWriter = new PipedWriter();
         public Pipe_Writer() {}
         public PipedWriter getPipedWriter() {
              return pWriter;
         public void run() {
              Process p = null;
              try {
                   p = Runtime.getRuntime().exec("cmd");
              } catch (IOException e) {
                   e.printStackTrace();
              BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
              BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
              BufferedReader reader2 = new BufferedReader(new InputStreamReader(System.in));
              String line;
              String rd = "";          
              try {
                   rd = reader2.readLine();
                   System.out.println(rd);               
              } catch (IOException e1) {
                   e1.printStackTrace();
              try {
                   // writer.write("dir\n"); //writing to process
                   writer.write(rd + "\n");
                   writer.flush();          
                   while ((line = reader.readLine()) != null) {
                             System.out.println(line);
                             pWriter.write(line);  //writing to pipe
              } catch (IOException e) {
                   e.printStackTrace();
    }// Pipe reader class
    public class Pipe_Reader extends Thread{
         PipedReader pReader;
         public Pipe_Reader(Pipe_Writer writer)throws IOException{
              pReader = new PipedReader(writer.getPipedWriter());
         public void run(){
              try {               
                   while(true){
                        System.out.println((char)pReader.read());  //Reading from pipe
              } catch (Exception e) {
                   e.printStackTrace();
    }// main method
    public static void main(String[] args)throws IOException {
              Pipe_Writer writer = new Pipe_Writer();
              Pipe_Reader reader = new Pipe_Reader(writer);
              writer.start();
              reader.start();
         }

  • Displaying input from Runtime.exec()

    Hi there, after all my troubles, I'm finaly able to get all the input from the unix machine using Runtime.exec() and to have it come out pretty quick. My new problem now is that I need to take that input and display it onto a textPane. Anyone who can help me do that? here is the code I have written, along with the method I use called setPaneText():
    class StreamGobbler extends Thread
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type)
    this.is = is;
    this.type = type;
    public void run()
    try
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    while ( (line = br.readLine()) != null)
    System.out.println(type + ">" + line);
    } catch (Exception ioe)
    ioe.printStackTrace();
    private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {                                           
    Object source = evt.getSource();
    String serverComm;
    serverComm = "";
    serverComm = pp.getServerComm();
    if(source == jMenuItem13)
    try
    String osName = System.getProperty("os.name");
    Runtime rt = Runtime.getRuntime();
    Process commandReturn = rt.exec(serverComm + " /usr/local/bin/dlgexec pd_rm_cm trashcan");
    //StreamGobbler errorGobbler = new
    //StreamGobbler(commandReturn.getErrorStream(), "ERROR");
    StreamGobbler outputGobbler = new
    StreamGobbler(commandReturn.getInputStream(), "OUTPUT");
    //errorGobbler.start();
    outputGobbler.start();
    int exitVal = commandReturn.waitFor();
    System.out.println("exitVal = " + exitVal);
    if(exitVal == 0)
    System.out.println("inside the trashcan if");
    int cnt = 0;
    String outText []= new String [10000];
    BufferedReader buffy = new BufferedReader(new InputStreamReader(outputGobbler.is));
    while((outText[cnt]=buffy.readLine()) != null)
    cnt++;
    if(cnt == 9000)
    break;
    TextAreaPanel tp;
    tp = new TextAreaPanel();
    for(int cnt2 = 0; cnt2 < cnt; cnt2++)
    String temp;
    temp = outText[cnt2] + "\n";
    tp.setPaneText(temp);
    jPanel1.removeAll();
    jPanel1.add(tp, BorderLayout.CENTER);
    jPanel1.validate();
    this.repaint();
    catch(Throwable t)
    t.printStackTrace();
    and here is the method that I call
    public void setPaneText(String message)
    jTextArea1.setEnabled(true);
    //jTextArea1.setEditable(false);
    String outText = message;
    jTextArea1.setText(message);
    jScrollPane1.setViewportView(jTextArea1);
    //return outText;
    String message;

    @Op. Please learn how to use code formatting when you post code:
    http://forum.java.sun.com/help.jspa?sec=formatting

  • Create Dynamic Structure at Runtime via ALV-Methods!

    Hi Experts,
    i try to create at the ABAP Runtime a new Structure.
    FOR EXAMPLE: I have a internal Table "database" and i dont know their Structure or Typ.
    MY Question: How can i get the structuretype for this internal Table "database" ??
                                    I thought that it is possible with ALV-Methods, but i dont find the right way.
    First Step:       I must get the structure of this internal Table.
    Second Step: I must create a workarea/ line of this internal Table, that i can work row for row with the table.
    Have someone an code example for me, because iám very confused about this Problem.
    With kind regards.
    Ersin Tosun

    Hello,
    For this specific requirement, SAP has provided RTTI class.
    Below is a code snippet for your ready reference. In this example we're trying to get the structure of the dynamic table <ITAB> whose structure is not defined till run-time.
    TYPE-POOLS: abap.
    PARAMETERS: p_table TYPE tabname.
    DATA: dref TYPE REF TO data.
    FIELD-SYMBOLS <itab> TYPE STANDARD TABLE.
    CREATE DATA dref TYPE STANDARD TABLE OF (p_table).
    ASSIGN dref->* TO <itab>.
    DATA: go_tab_descr TYPE REF TO cl_abap_tabledescr,
          go_struc_descr TYPE REF TO cl_abap_structdescr,
          wa_comp TYPE abap_compdescr.
    go_tab_descr ?= cl_abap_tabledescr=>describe_by_data( <itab> ).
    CHECK sy-subrc = 0.
    go_struc_descr ?= go_tab_descr->get_table_line_type( ).
    LOOP AT go_struc_descr->components INTO wa_comp.
      WRITE: / wa_comp-name.
    ENDLOOP.
    I must create a workarea/ line of this internal Table, that i can work row for row with the table.
    Sorry i missed the Step 2:
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
                   <wa> TYPE ANY,
                   <val> TYPE ANY.
    LOOP AT <itab> ASSIGNING <wa>.
      LOOP AT go_struc_descr->components INTO wa_comp.
    *   To access the components of the structure dynamically
        ASSIGN COMPONENT wa_comp-name OF STRUCTURE <wa> TO <val>.
      ENDLOOP.
    ENDLOOP.
    BR,
    Suhas
    Edited by: Suhas Saha on Nov 18, 2010 7:26 PM

  • SOAP Runtime exception: 1023  method IF_SOAP_TRANSPORT_BINDING~receive

    SOAP:1.023 SRT: Processing error in Internet Communication Framework: ("ICF Error when receiving the response: HTTP COMMUNICATION FAILURE")
    SOAP Runtime exception: 1023 occured in  method  IF_SOAP_TRANSPORT_BINDING~receive of class CL_SOAP11_HTTP_TPBND at position 1
    Getting the error above when making a web service call to external web service. Used to work all the time. Getting the error all the time now.

    Hi.
    Check the response. Sometimes this error occurs due to an empty response.
    Regards.
    Rafael Rojas.

  • How to get event name in runtime in the method ?

    i  found that there is a &_WORKITEM.OBJECTTYPE.EVENTS.NAME& element in thw workflow contained. then i do a binding from this element to another element with the same type as &_WORKITEM.OBJECTTYPE.EVENTS.NAME&.
       then in the method i use swc_get_element container 'NAME'  name.
      to get the event name in runtime.
      but when i test it in SWUE, it gives error.  If i remove this statement, it is oK
    ANY advice?

    Hello Gang,
    _WORKITEM is a workitem object
    OBJECTTYPE is its type (WORKINGWI for dialog steps)
    EVENTS is a multiline attribute (all events for this type of object: processed, created and deleted in our case /events of WORKINGWI/)
    I don't think that is what you need.
    You got an error, cause you link a multiline element to a single one.
    If you need an access to the TRIGGERING event name, the best is to bind an event name when it is triggered (or e.g. check an event name in the check FM if it is sufficient for your requirement).
    Regards,
    Michal

  • I can't load 11.4.  Now I don't have Itunes at all.  keeps giving me a runtime error

    I keep getting I need to update itunes to the lastest one.  I did and after that, I keep getting this error R6034 that says an application has made an attempt to load the c runtime library incorrectly.  Please contact support.  What do I do?  I removed Itunes and tried to download it manually and when I get the finish window, it's over in the left corner with only 1/4 of the end of the message showing.  I can't even hit the finish button.  What do I do since now my Itunes won't work at all?

    Experimental advice ... but, plausibly, the preference files containing the parental control setting may be damaged. If so, removing the iTunes preference files may help.
    For the basic technique, see the "Remove iTunes preference files" section from the "User-specific troubleshooting" section of the following document:
    iTunes for Windows Vista or Windows 7: Troubleshooting unexpected quits, freezes, or launch issues
    To see those folders, you'll need to first set your PC to view hidden files and folders
    In your Start menu, open Computer.
    In your Organise menu, select Folder Options.
    In the View tab, make sure that "Show hidden files and folders" is selected, and Hide extensions for known file types is unchecked.
    Click OK.
    Prior to doing the preference file rebuilds: Best to make a note of any custom preferences you have set up for your iTunes. (Rebuilding pref files returns preferences to their defaults ... so you'll likely have to set some of those custom preferences up again from scratch.) Also make a note of any third-party plugins/add-ons you have installed. You may have to reinstall those after the rebuilds.
    Things to watch out for during the rebuilds
    Rebuilding the preference files in the \Local\ location causes the iTunes license agreement to run. So you'll need to agree to that again.
    Rebuilding the preference files in the \Roaming\ location causes the iTunes Setup Assistant to run. When prompted to do so, do not add files to your iTunes library. (Otherwise you'll end up with a library full of duplicates.)

  • I use IncrediMail and it keeps crashing and giving me a Runtime Error what can I do about this?

    The message is as follows:
    X Runtime Error!
    Program:c\Program Files (x86\Incred.Mail\Bin\ImApp.exe
    This application has requested the Runtime to terminte it in an unusual way.
    Please contact the application's support team for more information.

    Hi gergesmich,
    If you are having issues with iTunes after an attempted update, you may find the following article helpful:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Regards,
    - Brenden

  • Problem in giving input to crontab

    Hi,
      I am using the command
    crontab -e
    which asks for the input. I changed the editor to gedit using
    export VISUAL="gedit"
    so `crontab -e` is opened using gedit. I want to give input to crontab through a file. for eg :1.txt
    i tried
    crontab -e </root/1.txt
    but its not working. I need a way to give input to crontab using a file

    Just as additional info:
    Solaris:
    ========
    % crontab -l
    crontab: can't open your crontab file.
    % cat test.cron
    00 12 * * * /tmp/test.sh
    % crontab test.cron
    % crontab -l
    00 12 * * * /tmp/test.sh
    HP-UX:
    ======
    $ crontab -l
    crontab: can't open your crontab file.
    $ cat test.cron
    00 12 * * * /tmp/test.sh
    $ crontab test.cron
    warning: commands will be executed using /usr/bin/sh
    $  crontab -l
    00 12 * * * /tmp/test.sh
    Linux:
    ====
    $ crontab -l
    no crontab for bitadm
    $ cat test.cron
    00 12 * * * /tmp/test.sh
    $ crontab test.cron
    $ crontab -l
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (test.cron installed on Sun May 18 17:25:00 2008)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    00 12 * * * /tmp/test.sh

Maybe you are looking for

  • Photosmart C309a black ink cartridge will not print

    Hi. I am having problems with my Photosmart Premium C309a printer. It will not print using the black ink cartridge. I pulled this printer out of storage and the original cartridges had run out. I replaced these with brand new cartridges. When printin

  • Highlighting a PDF in Acrobat using standard colors

    I can't figure out how to highlight in standard colors in Acrobat Standard 9). I think I am supposed to use swatches or spot colors, but I can't figure it out. I am working on a project that requires me to highlight in colors such as "light orange' o

  • Not able to import canon raw CR2 photos direct from a camera into Lightroom 5.5

    I've just purchased Lightroom 5 and updated it with the latest version 5.5, and I am running windows 7.  Everything appears to be working fine, however I am not able to import Canon CR2 raw files directly from my camera.  Importing JPEG files directl

  • E66: Where are the themes located?

    Hi all, Want to delete a bunch of themes which I don't use, but cannot find them anywhere in one of the phone folders (memory & memory-card). Anybody knows how to get rid of them? There is no uninstall option either. Many thanks!

  • Do any of you know how to use NetBeans?

    I downloaded NetBeans 4.0 and tried to start a new project and entered my Hello World code in the code window but it said something like "No main class set". I was wondering if someone could post some step by step instructions of how to create a simp