Help needed with passing data between classes, graph building application?

Good afternoon please could you help me with a problem with my application, my head is starting to hurt?
I have run into some difficulties when trying to build an application that generates a linegraph?
Firstly i have a gui that the client will enter the data into a text area call jta; this data is tokenised and placed into a format the application can use, and past to a seperate class that draws the graph?
I think the problem lies with the way i am trying to put the data into co-ordinate form (x,y) as no line is being generated.
The following code is from the GUI:
+public void actionPerformed(ActionEvent e) {+
+// Takes data and provides program with CoOrdinates+
int[][]data = createData();
+// Set the data data to graph for display+
grph.showGrph(data);
+// Show the frame+
grphFrame.setVisible(true);
+}+
+/** set the data given to the application */+
+private int[][] createData() {+
+     //return data;+
+     String rawData = jta.getText();+
+     StringTokenizer tokens = new StringTokenizer(rawData);+
+     List list = new LinkedList();+
+     while (tokens.hasMoreElements()){+
+          String number = "";+
+          String token = tokens.nextToken();+
+          for (int i=0; i<token.length(); i++){+
+               if (Character.isDigit(token.charAt(i))){+
+                    number += token.substring(i, i+1);+
+               }+
+          }     +
+     }+
+     int [][]data = new int[list.size()/2][2];+
+     int index = -2;+
+     for (int i=0; i<data.length;i++){+
+               index += 2;+
+               data[0] = Integer.parseInt(+
+                         (list.get(index).toString()));+
+               data[i][1] = Integer.parseInt(+
+                         (list.get(index +1).toString()));+
+          }+
+     return data;+
The follwing is the coding for drawing the graph?
+public void showGrph(int[][] data)  {+
this.data = data;
repaint();
+}     +
+/** Paint the graph */+
+protected void paintComponent(Graphics g) {+
+//if (data == null)+
+     //return; // No display if data is null+
super.paintComponent(g);
+// x is the start position for the first point+
int x = 30;
int y = 30;
for (int i = 0; i < data.length; i+) {+
+g.drawLine(data[i][0],data[i][1],data[i+1][0],data[i+1][1]);+
+}+
+}+

Thanks for that tip!
package LineGraph;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.util.List;
public class GUI extends JFrame
  implements ActionListener {
  private JTextArea Filejta;
  private JTextArea jta;
  private JButton jbtShowGrph = new JButton("Show Chromatogram");
  public JButton jbtExit = new JButton("Exit");
  public JButton jbtGetFile = new JButton("Search File");
  private Grph grph = new Grph();
  private JFrame grphFrame = new JFrame();   // Create a new frame to hold the Graph panel
  public GUI() {
     JScrollPane pane = new JScrollPane(Filejta = new JTextArea("Default file location: - "));
     pane.setPreferredSize(new Dimension(350, 20));
     Filejta.setWrapStyleWord(true);
     Filejta.setLineWrap(true);     
    // Store text area in a scroll pane 
    JScrollPane scrollPane = new JScrollPane(jta = new JTextArea("\n\n Type in file location and name and press 'Search File' button: - "
              + "\n\n\n Data contained in the file will be diplayed in this Scrollpane "));
    scrollPane.setPreferredSize(new Dimension(425, 300));
    jta.setWrapStyleWord(true);
    jta.setLineWrap(true);
    // Place scroll pane and button in the frame
    JPanel jpButtons = new JPanel();
    jpButtons.setLayout(new FlowLayout());
    jpButtons.add(jbtShowGrph);
    jpButtons.add(jbtExit);
    JPanel searchFile = new JPanel();
    searchFile.setLayout(new FlowLayout());
    searchFile.add(pane);
    searchFile.add(jbtGetFile);
    add (searchFile, BorderLayout.NORTH);
    add(scrollPane, BorderLayout.CENTER);
    add(jpButtons, BorderLayout.SOUTH);
    // Exit Program
    jbtExit.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
         System.exit(0);
    // Read Files data contents
     jbtGetFile.addActionListener(new ActionListener(){
     public void actionPerformed( ActionEvent e) {
               String FileLoc = Filejta.getText();
               LocateFile clientsFile;
               clientsFile = new LocateFile(FileLoc);
                    if (FileLoc != null){
                         String filePath = clientsFile.getFilePath();
                         String filename = clientsFile.getFilename();
                         String DocumentType = clientsFile.getDocumentType();
     public String getFilecontents(){
          String fileString = "\t\tThe file contains the following data:";
     return fileString;
       // Register listener     // Create a new frame to hold the Graph panel
    jbtShowGrph.addActionListener(this);
    grphFrame.add(grph);
    grphFrame.pack();
    grphFrame.setTitle("Chromatogram showing data contained in file \\filename");
  /** Handle the button action */
  public void actionPerformed(ActionEvent e) {
    // Takes data and provides program with CoOrdinates
    int[][]data = createData();
    // Set the data data to graph for display
    grph.showGrph(data);
    // Show the frame
    grphFrame.setVisible(true);
  /** set the data given to the application */
  private int[][] createData() {
       String rawData = jta.getText();
       StringTokenizer tokens = new StringTokenizer(rawData);
       List list = new LinkedList();
       while (tokens.hasMoreElements()){
            String number = "";
            String token = tokens.nextToken();
            for (int i=0; i<token.length(); i++){
                 if (Character.isDigit(token.charAt(i))){
                      number += token.substring(i, i+1);
       int [][]data = new int[list.size()/2][2];
       int index = -2;
       for (int i=0; i<data.length;i++){
                 index += 2;
                 data[0] = Integer.parseInt(
                         (list.get(index).toString()));
               data[i][1] = Integer.parseInt(
                         (list.get(index +1).toString()));
     return data;
public static void main(String[] args) {
GUI frame = new GUI();
frame.setLocationRelativeTo(null); // Center the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("Clients Data Retrival GUI");
frame.pack();
frame.setVisible(true);
package LineGraph;
import javax.swing.*;
import java.awt.*;
public class Grph extends JPanel {
     private int[][] data;
/** Set the data and display Graph */
public void showGrph(int[][] data) {
this.data = data;
repaint();
/** Paint the graph */
protected void paintComponent(Graphics g) {
//if (data == null)
     //return; // No display if data is null
super.paintComponent(g);
//Find the panel size and bar width and interval dynamically
int width = getWidth();
int height = getHeight();
//int intervalw = (width - 40) / data.length;
//int intervalh = (height - 20) / data.length;
//int individualWidth = (int)(((width - 40) / 24) * 0.60);
////int individualHeight = (int)(((height - 40) / 24) * 0.60);
// Find the maximum data. The maximum data
//int maxdata = 0;
//for (int i = 0; i < data.length; i++) {
//if (maxdata < data[i][0])
//maxdata = data[i][1];
// x is the start position for the first point
int x = 30;
int y = 30;
//draw a vertical axis
g.drawLine(20, height - 45, 20, (height)* -1);
// Draw a horizontal base line4
g.drawLine(20, height - 45, width - 20, height - 45);
for (int i = 0; i < data.length; i++) {
//int Value = i;      
// Display a line
//g.drawLine(x, height - 45 - Value, individualWidth, height - 45);
g.drawLine(data[i][0],data[i][1],data[i+1][0],data[i+1][1]);
// Display a number under the x axis
g.drawString((int)(0 + i) + "", (x), height - 30);
// Display a number beside the y axis
g.drawString((int)(0 + i) + "", width - 1277, (y) + 900);
// Move x for displaying the next character
//x += (intervalw);
//y -= (intervalh);
/** Override getPreferredSize */
public Dimension getPreferredSize() {
return new Dimension(1200, 900);

Similar Messages

  • Help needed in passing parameters between custom pages

    Hi,
    Thanks in advance for your help gurus. I am developing 2 new pages and both should have link between them. WHen I click a button on page A it will navigate to page B, I am passing 2 parameters to page B. Page B is rendered with the help of values passed. Page B has 2 OAMessageLovInput Bean for which I am setting their values based on the values passed using
    OAMessageTextInputBean custBean = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("CustID");
    custBean.setText(pageContext.getParameter("customerid"));
    Everything works great till now. Now I want to change the customer id on page B using the LOV ie I select a new customer and I tab out of the field, still the customer id is not changed, it is set to the old one only to which the bean is set to.
    What should I do get the new selected customer id to be populated on the LOV fields.
    Thanks,
    newbie

    newbie,
    You really do not need to explicitly set the customer Id through code. Just create a new LOV Mapping and make its return value to the MessageTextInputBean i.e CustID on base page and Lov Region Item would be the CustomerID of the Lov Table region.
    Create Custome ID in LOV Table region and set its render property to false. I am assuming that the custId is present in the LOV VO query.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help needed with missing data problem in CRVS2010

    We recently upgraded the reporting engine in our product to use Crystal Reports for Visual Studio 2010 (previously engine was CR9). Our quote report, which has numerous subreports and lots of conditional formatting, started losing data when a quote took more than a single page to be printed. We knew the SQL results included the data, but the report was not printing those lines at all or sometimes printing a partial line. In addition, the running total on the report would exclude the lines that were being missed on the next page. In one example submitted by a customer, 3 lines were skipped between pages.
    I think I have identified two potential issues that document the possibility of data not being included in the report.
    The first potential issue is an issue with the "suppress blank section" option being checked. This issue is supposedly fixed with ADAPT01483793, being released someday with service pack 2 for CRVS2010.
    The second potential issue is using shared variables. This issue is supposedly fixed with ADAPT01484308, also targeted for SP2.
    Our quote report does not explicitly use shared variables with any of the subreports, but it does have several subreports, each in its own section that has the "supress blank section" option checked. We have other reports that use this feature, as well, and they are not exhibiting the problem.
    One different thing about the quote report is that it has a section with multiple suppression options selected. The section has a conditional suppression formula, which controls whether the section is included at all within the report. The section also has the suppress blank section option selected. There are multiple fields within the report that are each conditionally suppressed. In theory, the section's suppress formula could evaluate to true, yet all of the fields within the section are suppressed (due to null values), and then the "suppress blank section" option would kick in.
    The missing data only seems to happen when the section is not being suppressed, and at least one of the fields is being included in the report. If I clear the "suppress blank section" check box, and change the section formula to also include the rules applied to the fields in the section, the missing data problem seems to be resolved.
    Is this related to ADAPT01483793? Will it be fixed in service pack 2?
    If more details are needed, I would be happy to provide a sample report with stored data.

    Hi Don,
    Have a look at the Record Selection formula in CR Designer ( stand alone ) and when exported to RPT format opening that report in the Designer also. 
    There's been a few issues with => logic in the record selection formula. It could be you are running into this problem. Look for NOT inserted into your selection formula.
    Oh and SP2 is coming out shortly so it may resolve the issue. But if you want you could purchase a support, or if you have a support contract then create a case in SMP and get a rep to work with you to debug the issue.
    If you have not try the Trial Version of CR 2011, put it on a VM-ware image or Test PC so you don't corrupt anything for production and have a look at and test it in that designer also. If you purchase a case and it is a bug then you'll get a credit back for the case.
    Don
    Edited by: Don Williams on Oct 26, 2011 7:40 AM

  • Help needed with refreshing data

    hello OTN!!
    i am having a problem in refreshing the data each time i update it.
    the problem is that i have a tabular layout of my forms . i have made them all display items and whenever a user wants to update the data and he can click on a link on any row and a small pop up window comes up displaying the data in text boxes user can update an individual row of data but after updating the data when user come back on the tabulary laypout form the data does not refreshes it self and same old(not updated) row of data is displayed.
    i have passed parameters between the popup and tabular forms.plz help me urgently and tell me what should i do to refresh my data or behind what trigger i should write the code for refreshing the data. plus so far i have managed to make a button refresh which refreshes the things gaian by execute_query.but i wana do it automatically without pressing button and such .

    Well - you could reformat your drive to FAT32 using Disk Utility. Probably not the ideal solution, but it could work if you save the data first. I'd recommend using a different external drive formatted in FAT32, or maybe a large USB flash drive (or memory cards) if you've got one.
    I have several external drives and a drive enclosure. One (from SimpleTech) was automatically formatted as an NTFS drive (didn't see that notice before I plugged it into my PC at work). It wouldn't read on my iBook G4 but is OK on my MacBook. I think now that it mounts, I could probably reformat it if necessary. Another Western Digital drive came FAT32 formatted.

  • Help needed with binary data in xml (dtd,xml inside)

    I am using the java xml sql utility. I am trying to load some info into a table.
    my.dtd:
    <!ELEMENT ROWSET (ROW*)>
    <!ELEMENT ROW (ID,JPEGS?)>
    <!ELEMENT ID (#PCDATA)>
    <!ELEMENT DESCRIPTION EMPTY>
    <!ATTLIST DESCRIPTION file ENTITY #REQUIRED>
    <!NOTATION INFOFILE SYSTEM "Files with binary data inside">
    <!ENTITY file1 SYSTEM "abc.jpg" NDATA INFOFILE>
    xml file:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE ROWSET SYSTEM "MY.DTD">
    <ROWSET>
    <ROW>
    <ID>1272</ID>
    <DESCRIPTION file="file1"/>
    </ROW>
    </ROWSET>
    I am using the insertXML method to do this. However, the only value that gets loaded is the ID. abc.jpg is in the same directory where I ran the java program.
    Thanks in advance.

    Sorry! wrong dtd. It should read this instead:
    my.dtd:
    <!ELEMENT ROWSET (ROW*)>
    <!ELEMENT ROW (ID,DESCRIPTION?)>
    <!ELEMENT ID (#PCDATA)>
    <!ELEMENT DESCRIPTION EMPTY>
    <!ATTLIST DESCRIPTION file ENTITY #REQUIRED>
    <!NOTATION INFOFILE SYSTEM "Files with binary data inside">
    <!ENTITY file1 SYSTEM "abc.jpg" NDATA INFOFILE>
    null

  • Hide values in URL, passing data between two webdynpro(ABAP) applications.

    Hi
       When transferring the data between two webdynpro applications,  How to hide the values in URL.
    Example : First application is using for login
                    Second application is for some transactional screens.
    Based on first application login data second application should trigger. When passing the user id and password thru URL every one can see the user name and password at internet explorer, so how to hide that user name and password in URL.
    Thanks
    Murali Papana.

    Hi Lekha,
        Thanks for your reply, but I could not find parameter like visibility, andi found HAS_TOOLBAR but no use.
    I set it like
    CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
      EXPORTING
        URL            = 'http://*****:8000/sap/bc/webdynpro/sap/Y1app1/?sap-language=EN&sap-client=200&sap-user=1104&sap-password=abcd'
        MODAL          = ABAP_FALSE
        HAS_MENUBAR    = ABAP_TRUE
        IS_RESIZABLE   = ABAP_TRUE
        HAS_SCROLLBARS = ABAP_TRUE
        HAS_STATUSBAR  = ABAP_TRUE
        HAS_TOOLBAR    = ABAP_FALSE
        HAS_LOCATION   = ABAP_TRUE
      RECEIVING
        WINDOW         = lo_window.
    Thanks
    Murali Papana.

  • Help needed with Export Data Pump using API

    Hi All,
    Am trying to do an export data pump feature using the API.
    while the export as well as import works fine from the command line, its failing with the API.
    This is the command line program:
    expdp pxperf/dba@APPN QUERY=dev_pool_data:\"WHERE TIME_NUM > 1204884480100\" DUMPFILE=EXP_DEV.dmp tables=PXPERF.dev_pool_data
    Could you help me how should i achieve the same as above in Oracle Data Pump API
    DECLARE
    h1 NUMBER;
    h1 := dbms_datapump.open('EXPORT','TABLE',NULL,'DP_EXAMPLE10','LATEST');
    dbms_datapump.add_file(h1,'example3.dmp','DATA_PUMP_TEST',NULL,1);
    dbms_datapump.add_file(h1,'example3_dump.log','DATA_PUMP_TEST',NULL,3);
    dbms_datapump.metadata_filter(h1,'NAME_LIST','(''DEV_POOL_DATA'')');
    END;
    Also in the API i want to know how to export and import multiple tables (selective tables only) using one single criteria like "WHERE TIME_NUM > 1204884480100\"

    Yes, I have read the Oracle doc.
    I was able to proceed as below: but it gives error.
    ============================================================
    SQL> SET SERVEROUTPUT ON SIZE 1000000
    SQL> DECLARE
    2 l_dp_handle NUMBER;
    3 l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    4 l_job_state VARCHAR2(30) := 'UNDEFINED';
    5 l_sts KU$_STATUS;
    6 BEGIN
    7 l_dp_handle := DBMS_DATAPUMP.open(
    8 operation => 'EXPORT',
    9 job_mode => 'TABLE',
    10 remote_link => NULL,
    11 job_name => '1835_XP_EXPORT',
    12 version => 'LATEST');
    13
    14 DBMS_DATAPUMP.add_file(
    15 handle => l_dp_handle,
    16 filename => 'x1835_XP_EXPORT.dmp',
    17 directory => 'DATA_PUMP_DIR');
    18
    19 DBMS_DATAPUMP.add_file(
    20 handle => l_dp_handle,
    21 filename => 'x1835_XP_EXPORT.log',
    22 directory => 'DATA_PUMP_DIR',
    23 filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    24
    25 DBMS_DATAPUMP.data_filter(
    26 handle => l_dp_handle,
    27 name => 'SUBQUERY',
    28 value => '(where "XP_TIME_NUM > 1204884480100")',
    29 table_name => 'ldev_perf_data',
    30 schema_name => 'XPSLPERF'
    31 );
    32
    33 DBMS_DATAPUMP.start_job(l_dp_handle);
    34
    35 DBMS_DATAPUMP.detach(l_dp_handle);
    36 END;
    37 /
    DECLARE
    ERROR at line 1:
    ORA-39001: invalid argument value
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3043
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3688
    ORA-06512: at line 25
    ============================================================
    i have a table called LDEV_PERF_DATA and its in schema XPSLPERF.
    value => '(where "XP_TIME_NUM > 1204884480100")',above is the condition i want to filter the data.
    However, the below snippet works fine.
    ============================================================
    SET SERVEROUTPUT ON SIZE 1000000
    DECLARE
    l_dp_handle NUMBER;
    l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    l_job_state VARCHAR2(30) := 'UNDEFINED';
    l_sts KU$_STATUS;
    BEGIN
    l_dp_handle := DBMS_DATAPUMP.open(
    operation => 'EXPORT',
    job_mode => 'SCHEMA',
    remote_link => NULL,
    job_name => 'ldev_may20',
    version => 'LATEST');
    DBMS_DATAPUMP.add_file(
    handle => l_dp_handle,
    filename => 'ldev_may20.dmp',
    directory => 'DATA_PUMP_DIR');
    DBMS_DATAPUMP.add_file(
    handle => l_dp_handle,
    filename => 'ldev_may20.log',
    directory => 'DATA_PUMP_DIR',
    filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    DBMS_DATAPUMP.start_job(l_dp_handle);
    DBMS_DATAPUMP.detach(l_dp_handle);
    END;
    ============================================================
    I dont want to export all contents as the above, but want to export data based on some conditions and only on selective tables.
    Any help is highly appreciated.

  • Urgent help needed with reading data from Cube

    Hi Gurus,
    Can anyone tell me how to read a value from a record in the CUBE with a key (combination of fields).
    Please provide if you have any custome Function Module or piece of code.
    Any ideas are highly appreciated.
    Thanks,
    Regards,
    aarthi

    Due to the nature of the cube design, that would be difficult, that's why there are API's, FMs, and MDX capabilities - to eliminate the need to navigate the physical structure.  Otherwise you would have to concern yourself with:
    - that there are two fact tables E and F that would need to be read.  The Factview could take of this one.
    - you would want to be able to read aggregates if they were available.
    - the fact table only as DIM IDs or SIDs (for line item dims) to identify the data, not characteristic values.  A Dim ID represents a specific combination of characteristic values.

  • Pros help needed with post data code

    i needed to change the code below to post the userAnswer from radio button group,  to an ASPX page so i can read the data in and post it to a database. can anyone help. thanks
    btnCheck.addEventListener(MouseEvent.CLICK, checkAnswer);
    function checkAnswer(evt:MouseEvent):void {
    userAnswer = String(rbg.selectedData);
        messageBox.text =  userAnswer + " has been clicked";

    //Create the loader object
    var prodloader:URLLoader = new URLLoader ();
    //Create a URLVariables object to store the details
    var variables: URLVariables = new URLVariables();
    //Createthe URLRequest object to specify the file to be loaded and the method ie post
    var url:String = "url here";
    var prodreq:URLRequest = new URLRequest (url);
    prodreq.method = URLRequestMethod.POST;
    prodreq.data = variables;
    function submitHandler(event:Event):void {
        variables.productId = whatever;
        prodloader.load(prodreq);
        btnSubmit.addEventListener(MouseEvent.CLICK, submitHandler);
        function contentLoaded(event:Event):void {
           //Stuff here
            prodloader.addEventListener(Event.COMPLETE, contentLoaded);

  • Please Help~Need to swap data between two 2010 MacBook Pros

    Ok I have a 13" mid-2010 MacBook Pro and my wife has a 15" i7 2010 MacBook Pro. I need her MacBook's processing power to start doing some short videos for our church (After Effects, Premiere). She prefers the lighter 13" anyways so we've decided to swap. I've made two "complete" backups onto a partioned external hard drive using the software, Carbon Copy Cloner. My objective is to swap all data AND settings from one to another and vice versa. She has very important settings on her MBP that cannot be lost. What is the best route to take from here?
    Thanks in advance for your advice!
    Message was edited by: Muzik74

    Pretty easy, using the original Install Disc that came with each computer restart the computer while holding down the Option key. Choose the Install Disc to boot from. Then choose the language and next choose the Utilities Menu-Disk Utility. Once you are in Disk Utility choose the internal HD of the computer-Erase tab (ensure it's set to Mac OS Extended (Journaled)-Erase. Once the erase has been done then exit Disk Utility and continue with the installation. At the end of the installation it will ask if you want to restore from a Volume connected to the computer. Choose that option and choose all the options and within a couple of hours the machine will look and act like your old machine. Do the same with the other computer and you're done with the swap.

  • Help needed with passing an array to a method

    here is a small class i'm working on. it's supposed to take each address on an array, and check it for an iis machine, then check a couple of known malformed urls to see if the machine has been patched. my problem is that i can't get the method that does the probing to accept input from the array. it won't even compile, and i'm sure my problem's pretty simple, it's just that i don't quite have afull grasp on java yet. btw, the get/set methods are mandatory, as my instructor refuses to even look at code without them.
    import java.net.*;
    import java.io.*;
    public class PortProbe
         * attribute(s)
         private String[] addressesToBeScanned;
         * accessor methods
         public String[] getAddressesToBeScanned()
              return addressesToBeScanned;
         public void setAddressesToBeScanned(String[] addressesToBeScanned)
              this.addressesToBeScanned = addressesToBeScanned;
         public String getAddressesToBeScanned(int index)
              return addressesToBeScanned[index];
         public void setAddressesToBeScanned(int index, String value)
              addressesToBeScanned[index] = value;
         * helping method to determine the software running on the server
         public void probe80()
              URL myurl = null;
    URLConnection urlConnection = null;
              try
                   myurl = new URL(getAddressesToBeScanned());
              catch (MalformedURLException mal)
                   System.out.println("Exception caught: " + mal);
              try
                   urlConnection = myurl.openConnection();
    catch (IOException ioe)
                   System.out.println("Exception caught: " + ioe);
              System.out.println(urlConnection.getURL());
              System.out.println(urlConnection.getHeaderField("Server"));
         * constructor method(s)
         public PortProbe() //this constructor will initialize each array element individually
              setAddressesToBeScanned(new String[3]);
              setAddressesToBeScanned(0, "http://216.18.80.142/scripts/..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?/c+dir");
              setAddressesToBeScanned(1, "http://216.18.84.152/scripts/..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?/c+dir");
              setAddressesToBeScanned(2, "http://216.18.84.161/scripts/..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?/c+dir");
         * main method
         public static void main(String[] args)
              PortProbe myProbe = new PortProbe();
              for (int i = 0; i < myProbe.addressesToBeScanned.length; i++)
                   myProbe.probe80();
                   i++;
    that's it. can anyone help me out.
    thanks

    thank you all for your responses. the program now compiles and runs successfully. but the results i'm getting aren't the same as what i'm expecting.
    here is the revised code that compiles and runs:
    import java.net.*;
    import java.io.*;
    public class PortProbe
         * attribute(s)
         private String[] addressesToBeScanned;
         * accessor methods
         public String[] getAddressesToBeScanned()
              return addressesToBeScanned;
         public void setAddressesToBeScanned(String[] addressesToBeScanned)
              this.addressesToBeScanned = addressesToBeScanned;
         public String getAddressesToBeScanned(int index)
              return addressesToBeScanned[index];
         public void setAddressesToBeScanned(int index, String value)
              addressesToBeScanned[index] = value;
         * helping method to determine the software running on the server
         public void probe80()
              URL myurl = null;
    URLConnection urlConnection = null;
              try
                   for (int i = 0; i < getAddressesToBeScanned().length; i++)
                        myurl = new URL(getAddressesToBeScanned());
              catch (MalformedURLException mal)
                   System.out.println("Exception caught: " + mal);
              try
                   urlConnection = myurl.openConnection();
    catch (IOException ioe)
                   System.out.println("Exception caught: " + ioe);
              System.out.println(urlConnection.getURL());
              System.out.println(urlConnection.getHeaderField("Server"));
         * constructor method(s)
         public PortProbe() //this constructor will initialize each array element individually
              setAddressesToBeScanned(new String[3]);
              setAddressesToBeScanned(0, "http://216.18.80.142");
              setAddressesToBeScanned(1, "http://137.113.192.101");
              setAddressesToBeScanned(2, "http://216.18.84.161");
         * main method
         public static void main(String[] args)
              PortProbe myProbe = new PortProbe();
              for (int i = 0; i < myProbe.addressesToBeScanned.length; i++)
                   myProbe.probe80();
                   i++;
    please pardon the formatting. there is a constructor that sets the elements in the array. but when i execute the program, this is the output i get:
    http://216.18.84.161
    null
    http://216.18.84.161
    null
    there is nothing else. and it appears that only one of the elements is being called. i don't know where the nulls are coming from. what the program should do (and did do fine before i started with the arrays) is determine the server software running on the machine being probed. there's got to be a mistake in my logic here somewhere, but i'm not experienced enough yet to find where it is.
    thanks again.

  • Help needed with loading data from ODS to cube

    Hi
    I am loading data from an ODS to a cube in QA. The update rules are active and definition seems right. I am getting the following error, in the update rules.
    "Error in the unit conversion. Error 110 occurred"
    Help.
    Thanks.

    Hi Chintai,
    You can see the record number where the error occured in the monitor (RSMO) for this data load > goto the details tab and open up the Processing area (+ sign). Try it out...
    Also about ignoring the error record and uploading the rest, this is done if you have set Error Handling in your InfoPackage (Update tab), but this would have to be done before the load starts, not after the error happens.
    Hope this helps...
    And since you thanked me twice, also please see here:-) https://www.sdn.sap.com/irj/sdn?rid=/webcontent/uuid/7201c12f-0701-0010-f2a6-de5f8ea81a9e [original link is broken]

  • Help needed with excess Data consumption on Osprey mobile broadband.

    Moved to Mobile Network as more appropriate.

    Hey Sirdal,
    I understand that your pre-paid Wi-Fi 4G service seems to be using up a lot of your data allowance from the time that you recharge your in the last 2 recharges.
    This is definitely worth investigating but please also bear in mind that the rates of your data iis dependent on the previous data plan you've recharged on.
    So if you've changed from a $20 recharge to $30 recharge, you need to disconnect from the internet before reconnecting in order to reset the rate of your data charge to what is equivalent for the $30 recharge because if you've not refreshed your connection since the $20 recharge, you will be charged the same rate as if you were on the $20 rechage rather than the $30 recharge which means that your allowance will be used up more than what it should be. I hope this makes sense Sirdal.

  • Help needed with passing parameters

    Hi,
    I'm using a PL/SQL API to insert values into the base tables. When i press the button 'Create Task' this API should be invoked. But i should be passing table type as parameters to the API. How do i write a code to implement this?
    Is there any wrapper that i have to write?
    Thanks

    Hi,
    Follow the steps in order
    1) Create a global type of the table type in oracle which you would pass to oracle
    Ex : Create type <typename> as object (field1 datatype,..... )
    say you have given typename as ROWTYPE
    Create type <typename> as table of <above Object>
    say you have given typename as TABTYPE
    2) Check this
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.server.OADBTransactionImpl;
    import java.sql.Connection;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    OADBTransactionImpl dbtranst = (OADBTransactionImpl)am.getOADBTransaction();
    Connection conn = dbtranst.getJdbcConnection();
    try
    //Declaring the structure and table type
    StructDescriptor voRowStruct = StructDescriptor.createDescriptor("ROWTYPE",conn);
    ArrayDescriptor arrydesc = ArrayDescriptor.createDescriptor("TABTYPE",conn);
    //Filling the rowtype and table type with values
    if((vo != null) && (vo.isExecuted()))
    Row row[] = vo.getFilteredRows("SelectBox","Y");
    Object[] attrib = new Object[7];
    String empNum = null;
    String firstName = null;
    String lastName = null;
    String fullName = null;
    String emailAddress = null;
    String managerId = null;
    String positionCode = null;
    String salary = null;
    String startdate = null;
    String endDate = null;
    String createdBy = null;
    String creationDate = null;
    String lastUpdateDate = null;
    String lastUpdateLogin = null;
    STRUCT[] loadedStruct = new STRUCT[row.length];
    if(row.length > 0)
    // throw new OAException("More the one check box selected", OAException.INFORMATION);
    // String [] empName = new String[row.length];
    for (int i = 0; i < row.length; i++)
    // empName[i] = row.getAttribute("EmployeeName").toString();
    empNum = row[i].getAttribute("EmployeeId").toString();
    firstName = row[i].getAttribute("EmployeeName").toString();
    lastName = (String)row[i].getAttribute("EmployeeEmail");
    managerId = row[i].getAttribute("ManagerId").toString();
    positionCode = (String)row[i].getAttribute("PositionDisplay");
    attrib[0] = empNum;
    attrib[1] = firstName;
    attrib[2] = lastName;
    attrib[3] = fullName;
    attrib[4] = emailAddress;
    attrib[5] = managerId;
    attrib[6] = positionCode;
    /* attrib[7] = salary;
    attrib[8] = startdate;
    attrib[9] = endDate;
    attrib[10] = createdBy;
    attrib[11] = creationDate;
    attrib[12] = lastUpdateDate;
    attrib[13] = lastUpdateLogin; */
    loadedStruct[i] = new STRUCT(voRowStruct, conn, attrib);
    3) Here is the code to call package.procedure with the above arrays
    ARRAY myarray = new ARRAY(arrydesc,conn, loadedStruct);
    StringBuffer sqlstmt = new StringBuffer(200);
    sqlstmt.append("BEGIN");
    sqlstmt.append(" myproc( ");
    sqlstmt.append("p_mytab => :1 );");
    sqlstmt.append(" END;");
    OracleCallableStatement callStmt = (OracleCallableStatement)dbtranst.createCallableStatement(sqlstmt.toString(),0);
    callStmt.setARRAY(1,myarray);
    callStmt.execute();
    } catch(Exception e)
    System.out.println("Exception "+e.getMessage());
    throw new OAException(e.getMessage());
    My code may be very raw as its early days for me in jDev... but i think it shall give you some idea ...
    Thanks
    Tom...

  • Help needed with transferring data.

    Hi. I store about 30GB of music on a Western Digital External Hard Drive, connect this to a Packard Bell laptop and transfer it to a Creative Zen Vision M. Recently I bought a MacBook and have created a lot of music on it. I am trying to get the music from my MacBook onto the hard drive (or alternatively the Packard Bell laptop). I have tried moving the music from my Macbook directly onto the external hard drive, but apparently it is 'read-only' and I cannot change this. I've tried copying the files onto DVD-Rs but as I do not have a DVD burner, the MacBook immediately ejects any DVD-Rs I place in it. Any ideas???

    Well - you could reformat your drive to FAT32 using Disk Utility. Probably not the ideal solution, but it could work if you save the data first. I'd recommend using a different external drive formatted in FAT32, or maybe a large USB flash drive (or memory cards) if you've got one.
    I have several external drives and a drive enclosure. One (from SimpleTech) was automatically formatted as an NTFS drive (didn't see that notice before I plugged it into my PC at work). It wouldn't read on my iBook G4 but is OK on my MacBook. I think now that it mounts, I could probably reformat it if necessary. Another Western Digital drive came FAT32 formatted.

Maybe you are looking for