Help with building nested cursors

Hello all,
In one of our plsql procedures, we return a cursor of cursors that looks like this:
OPEN main_cursor FOR
  SELECT
    CURSOR (
      SELECT query1
    ) c1,
    CURSOR (
      SELECT query2
    ) c2
  FROM DUAL;Now, we need to add a new condition that changes query1 into either query1a or query1b (depending of the condition). An easy refactor was done to the code as follows:
IF (some_condition) THEN
  OPEN main_cursor FOR
    SELECT
      CURSOR (
        SELECT query1a
      ) c1,
      CURSOR (
        SELECT query2
      ) c2
    FROM DUAL;
ELSE
  OPEN main_cursor FOR
    SELECT
      CURSOR (
        SELECT query1b
      ) c1,
      CURSOR (
        SELECT query2
      ) c2
    FROM DUAL;However, as you can see, query2 is duplicated in the if and else clauses. I wasn't able to find a way to avoid this duplication. Any ideas someone?
Also, note that the difference between query1a and query1b is a table join.
Thanks in advance,
wf

OPEN FOR allows for dynamic SQL where statements are put together by concatenating strings.
http://www.morganslibrary.org/reference/ref_cursors.html
Look at the demo of a Weakly Typed REF CURSOR.

Similar Messages

  • Help with build

    Hi all,
    I need a little help with building a new comp and any help will be appericiated.
    My wife is a video editor and she needs a new CPU.
    She is editing HD films from various cameras (she have several clients).
    The budget is around 1500-2000$ for the CPU without screens and software which she already owns.
    She is working with CS5.5 and using windows 7 pro 64bit.
    I read quite a lot in the past few days and I ended up more confused then I was, this is the setup which I thought of:
    CPU:       I was thinking about the i7 960 3.2 (310$) or the i7 2600k (330$).
    MB:         Asus p6x8D 1366 ddr 1600
    Graphics: Gigabyte nVidia GTX460 1gb gddr5 (210$) or gtx560(230$) the 570 is way off the budget (440$)
    BLURAY: Pioneer BDR-206
    RAM:      I don't know really.. I was thinking about 12gb but I am cluless about it.
    Power:     AX 850W Gold Active PFC 12cm Fan Modular (No particular reason, when I'll know my final setup I'll check the power I need with http://www.extreme.outervision.com/psucalculatorlite.jsp).
    Case:      Antec / Thermaltake, No idea which model..
    OS HDD: I'm still puzzled weather to go for the small (60gb) ssd for the OS and programs or go for a 7200 rpm hd.
    HDD:       W.D Caviar black 1tb 7200 rpm, 64mb, Sata III * 4 with raid on board (Raid 0 or Raid 5?  - I'll save it for another thread).
    Coolers:   Help needed
    Any help will be more then welcomed.
    Regards,
    Eliran.

    While waiting for a specific answer, you might read these recent discussions
    http://forums.adobe.com/thread/910208
    http://forums.adobe.com/thread/907698
    http://forums.adobe.com/thread/762381
    http://forums.adobe.com/thread/906848
    http://forums.adobe.com/thread/912120
    http://forums.adobe.com/thread/912119
    And one specific... SSD is high $$ and there is a thread concerning problems... forum search for ssd will find at least 2 message threads about using ssd or not

  • Help with building flash files for streaming

    I filmed a product demonstration for a client who wanted to put it on his website.  I edited the footage in PremPro CS4 and exported to Media Encoder as F4V file format.  After encoding imported footage into CS4 Encore, created timeline, chose, Flash from Format and swf for output.  Progressive Download which allows video to begin playing as it is downloaded (I believe), chose destinations and settings.  After transcoding I had 1 file folder, Sources that contained the following files _PGC_Bpge_entryPoint_Bbp_1.f4v, and then 3 separate files, *not* in the file folder called Sources.  They are
    AuthoredContent.xml, FlashDVD.swf, and Index.html.
    I submitted all files to client who gave them to web designer.  Designer said these were the wrong files and he could not use them. I called designer and basically he said I didn't know what I was doing.  I told him he needed all files to put up the flash video.  Anyway, am I missing something, doing something wrong?  Are there other files he needs?  He said he only needed 1 file.  Or is it the designer?  I'm not thin skinned so if it's me please tell me so, so I don't make the same errors.  Thanks.  All suggestions/comments are appreciated!

    <The client wants a control player, i.e. play, stop, pause, etc., that's it, so the viewer can simply provide the function themselves.  This is similar to youtube, blogger, etc.
    The web designer can use what you provided, which does what you describe the client wanting.  But the web designer may need to integrate what Encore provided onto a web page, and the client may not have made the expectations clear and may not know what is needed.  As I said, the Encore to flash player gives almost no options for the player controls and colors etc may be problems.
    <Encore did encode the f4v file.  When I exported from PremPro what preset should I hve chosen -- mpeg2 DVD, flv/f4v.  So the only file he needs in addition to what I gave him is the original f4v file?
    I don't know whether the f4v you exported from Premiere was progressive.  The f4v from Encore might be fine, or you might need to export from Premiere again.
    The other issue is that some "player" with controls needs to be provided by you or the web designer (who may have an issue with the client not getting the designer to lay all this out to begin with).  There are several threads about "flv players" you might check out.  Does the client have video on his site already?  If so, you can figure out what they are using, and it will help with your process.
    should I have chosen "flash server" instead of "progressive".  i must admit i never did this before.  other clients just have me post it to youtube and provide them with embed code.
    It depends on what they want.

  • Help with corrupted nested sequences.

    First off, let me say that next project I'm going with Avid. 
    I have been using nested sequences as sparingly as possible on a long, complicated project, but the few that I have are prone to getting "corrupted" (this is the technical  term that Kevin Monahan from Adobe has used to describe what's happening).  So it's been recommended that I replace the corrupted sequence.  Sure I can just copy the material in the corrupted sequence and place it in a new sequence, but how can I do this without loosing my HOURS of edits with this nested sequence in my main timeline?
    Thanks,
    Steve Keller

    Have you got a backup of your original photos?  If so then you can
    recreate the catalogue very easily in less than 5 minutes.  PSE always
    leaves photos in their original location.  they are not moved at all. 
    One should always backup photos, videos, documents, emails etc
    separately from applications that created them in the first place. 
    Disasters happen and we can't always protect from them except to backup
    as taught in computing 101 class.

  • Help with build in cam

    i have msi pc with build in cam
    i dont remembar wath the taip m series somthing i have cure 2 duo cpu t5750 2 gb ram 320 gb
    giforce 8400
    now i dont find any driver for the cam and the pc dos'nt know the cam....
    i run vista 32bit
    any one can halp me pleas!!!:(:(:(

    You have some notebook or? Read >>Posting Guide<<

  • Need help with jdbc and cursor

    Hi all,
    I know I can specify a cursor to be scrollable with
    cs = conn.prepareCall("{call server.procedure(?,?)}",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    but my problem is that this cursor is returning 2 oracle cursors and I need to move inside those but I cannot find the way to do it.
    cs.registerOutParameter(2, OracleTypes.CURSOR);
    rs = (ResultSet) cs.getObject(2); //this is the first cursor and is scrollable
    rs1= (ResultSet) rs.getObject(1); //this is one of the cursors inside the cursor and I cannot make it scrollable
    Thanks for the help,
    A.

    well, I didn't really check if the first one was scrollable since I didn't need it to be, but it seems that Oracle does not support scrollable cursors as out parameter of a stored procedure...
    anybody has a workaround?

  • Help with building a JTree using tree node and node renderers

    Hi,
    I am having a few problems with JTree's. basically I want to build JTree from a web spider. The webspide searches a website checking links and stores the current url that is being processed as a string in the variable msg. I wan to use this variable to build a JTree in a new class and then add it to my GUI. I have created a tree node class and a renderer node class, these classes are built fine. can someone point me in the direction for actually using these to build my tree in a seperate class and then displaying it in a GUI class?
    *nodeRenderer.java
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.net.*;
    public class nodeRenderer extends DefaultTreeCellRenderer
                                       implements TreeCellRenderer
    public static Icon icon= null;
    public nodeRenderer() {
    icon = new ImageIcon(getClass().getResource("icon.gif"));
    public Component getTreeCellRendererComponent(
    JTree tree,
    Object value,
    boolean sel,
    boolean expanded,
    boolean leaf,
    int row,
    boolean hasFocus) {
    super.getTreeCellRendererComponent(
    tree, value, sel,
    expanded, leaf, row,
    hasFocus);
    treeNode node = (treeNode)(((DefaultMutableTreeNode)value).getUserObject());
    if(icon != null) // set a custom icon
    setOpenIcon(icon);
    setClosedIcon(icon);
    setLeafIcon(icon);
         return this;
    *treeNode.java
    *this is the class to represent a node
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.util.*;
    import java.net.*;
    * Class used to hold information about a web site that has
    * been searched by the spider class
    public class treeNode
    *Url from the WebSpiderController Class
    *that is currently being processed
    public String msg;
    treeNode(String urlText)
         msg = urlText;
    String getUrlText()
         return msg;
    //gui.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class gui extends JFrame implements Runnable
         *declare variable, boolean
         *thread, a object and a center
         *pane
         protected URL urlInput;
         protected Thread bgThread;
         protected boolean run = false;
         protected WebSpider webSpider;
         public gui()
              *create the gui here
              setTitle("Testing Tool");
         setSize(600,600);
         //add Buttons to the tool bar
         start.setText("Start");
         start.setActionCommand("Start");
         toolBar.add(start);
         ButtonListener startListener = new ButtonListener();
              start.addActionListener(startListener);
              cancel.setText("Cancel");
         cancel.setActionCommand("Cancel");
         toolBar.add(cancel);
         ButtonListener cancelListener = new ButtonListener();
              cancel.addActionListener(cancelListener);
              close.setText("Close");
         close.setActionCommand("Close");
         toolBar.add(close);
         ButtonListener closeListener = new ButtonListener();
              close.addActionListener(closeListener);
              //creat a simple form
              urlLabel.setText("Enter URL:");
              urlLabel.setBounds(100,36,288,24);
              formTab.add(urlLabel);
              url.setBounds(170,36,288,24);
              formTab.add(url);
              current.setText("Currently Processing: ");
              current.setBounds(100,80,288,24);
              formTab.add(current);
         //add scroll bars to the error messages screen and website structure
         errorPane.setAutoscrolls(true);
         errorPane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         errorPane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         errorPane.setOpaque(true);
         errorTab.add(errorPane);
         errorPane.setBounds(0,0,580,490);
         errorText.setEditable(false);
         errorPane.getViewport().add(errorText);
         errorText.setBounds(0,0,600,550);
         treePane.setAutoscrolls(true);
         treePane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         treePane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         treePane.setOpaque(true);
         treeTab.add(treePane);
         treePane.setBounds(0,0,580,490);
         treeText.setEditable(false);
         treePane.getViewport().add(treeText);
         treeText.setBounds(0,0,600,550);
         //create the tabbed window           
    centerPane.setBorder(new javax.swing.border.EtchedBorder());
    formTab.setLayout(null);
    errorTab.setLayout(null);
    treeTab.setLayout(null);
    centerPane.addTab("Search Parameters", formTab);
    centerPane.addTab("Error Messages", errorTab);
    centerPane.addTab("Website Structure", treeTab);
              //add the tool bar and tabbed pane
              getContentPane().add(toolBar, java.awt.BorderLayout.NORTH);
    getContentPane().add(centerPane, java.awt.BorderLayout.CENTER);                    
              *create the tool bar pane, a center pane, add the buttons,
              *labels, tabs, a text field for user input here
              javax.swing.JPanel toolBar = new javax.swing.JPanel();
              javax.swing.JButton start = new javax.swing.JButton();
              javax.swing.JButton cancel = new javax.swing.JButton();
              javax.swing.JButton close = new javax.swing.JButton();      
              javax.swing.JTabbedPane centerPane = new javax.swing.JTabbedPane();
              javax.swing.JPanel formTab = new javax.swing.JPanel();
              javax.swing.JLabel urlLabel = new javax.swing.JLabel();
              javax.swing.JLabel current = new javax.swing.JLabel();
              javax.swing.JTextField url = new javax.swing.JTextField();
              javax.swing.JPanel errorTab = new javax.swing.JPanel();
              javax.swing.JTextArea errorText = new javax.swing.JTextArea();
              javax.swing.JScrollPane errorPane = new javax.swing.JScrollPane();
              javax.swing.JPanel treeTab = new javax.swing.JPanel();
              javax.swing.JTextArea treeText = new javax.swing.JTextArea();
              javax.swing.JScrollPane treePane = new javax.swing.JScrollPane();
              javax.swing.JTree searchTree = new javax.swing.JTree();
              *show the gui
              public static void main(String args[])
              (new gui()).setVisible(true);
         *listen for the button presses and set the
         *boolean flag depending on which button is pressed
         class ButtonListener implements ActionListener
              public void actionPerformed(ActionEvent event)
                   Object object = event.getSource();
                   if (object == start)
                        run = true;
                        startActionPerformed(event);
                   if (object == cancel)
                        run = false;
                        startActionPerformed(event);
                   if (object == close)
                        System.exit(0);
         *this method is called when the start or
         *cancel button is pressed.
         void startActionPerformed (ActionEvent event)
              if (run == true && bgThread == null)
                   bgThread = new Thread(this);
                   bgThread.start();
              if (run == false && bgThread != null)
                   webSpider.cancel();
         *this mehtod will start the background thred.
         *the background thread is required so that the
         *GUI is still displayed
         public void run()
              try
                   webSpider = new WebSpider(this);
                   webSpider.clear();
                   urlInput = new URL(url.getText());
                   webSpider.addURL(urlInput);
                   webSpider.run();
                   bgThread=null;
              catch (MalformedURLException e)
                   addressError addErr = new addressError();
                   addErr.addMsg = "URL ERROR - PLEASE CHECK";
                   SwingUtilities.invokeLater(addErr);
              *this method is called by the web spider
              *once a url is found. Validation of navigation
              *happens here.
              public boolean urlFound(URL urlInput,URL url)
                   CurrentlyProcessing pro = new CurrentlyProcessing();
              pro.msg = url.toString();
              SwingUtilities.invokeLater(pro);
              if (!testLink(url))
                        navigationError navErr = new navigationError();
                        navErr.navMsg = "Broken Link "+url+" caused on "+urlInput+"\n";
                        return false;
              if (!url.getHost().equalsIgnoreCase(urlInput.getHost()))
                   return false;
              else
                   return true;
              *this method is called internally to check
         *that a link works
              protected boolean testLink(URL url)
              try
                   URLConnection connection = url.openConnection();
                   connection.connect();
                   return true;
              catch (IOException e)
                   return false;
         *this method is called when an error is
         *found.
              public void URLError(URL url)
              *this method is called when an email
              *address is found
              public void emailFound(String email)
              /*this method will update any errors found inc
              *address errors and broken links
              class addressError implements Runnable
                   public String addMsg;
                   public void run()
                        errorText.append(addMsg);
                        current.setText("Currently Processing: "+ addMsg);
              class navigationError implements Runnable
                   public String navMsg;
                   public void run()
                        errorText.append(navMsg);
              *this method will update the currently
              *processing field on the GUI
              class CurrentlyProcessing implements Runnable
              public String msg;
              public void run()
                   current.setText("Currently Processing: " + msg );
    //webspider.java
    import java.util.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.tree.*;
    import javax.swing.*;
    *this class implements the spider.
    public class WebSpider extends HTMLEditorKit
         *make a collection of the URL's
         protected Collection urlErrors = new ArrayList(3);
         protected Collection urlsWaiting = new ArrayList(3);
         protected Collection urlsProcessed = new ArrayList(3);
         //report URL's to this class
         protected gui report;
         *this flag will indicate whether the process
         *is to be cancelled
         protected boolean cancel = false;
         *The constructor
         *report the urls to the wui class
         public WebSpider(gui report)
         this.report = report;
         *get the urls from the above declared
         *collections
         public Collection getUrlErrors()
         return urlErrors;
         public Collection getUrlsWaiting()
         return urlsWaiting;
         public Collection getUrlsProcessed()
         return urlsProcessed;
         * Clear all of the collections.
         public void clear()
         getUrlErrors().clear();
         getUrlsWaiting().clear();
         getUrlsProcessed().clear();
         *Set a flag that will cause the begin
         *method to return before it is done.
         public void cancel()
         cancel = true;
         *add the entered url for porcessing
         public void addURL(URL url)
         if (getUrlsWaiting().contains(url))
              return;
         if (getUrlErrors().contains(url))
              return;
         if (getUrlsProcessed().contains(url))
              return;
         /*WRITE TO LOG FILE*/
         log("Adding to workload: " + url );
         getUrlsWaiting().add(url);
         *process a url
         public void processURL(URL url)
         try
              /*WRITE TO LOGFILE*/
              log("Processing: " + url );
              // get the URL's contents
              URLConnection connection = url.openConnection();
              if ((connection.getContentType()!=null) &&
         !connection.getContentType().toLowerCase().startsWith("text/"))
              getUrlsWaiting().remove(url);
              getUrlsProcessed().add(url);
              log("Not processing because content type is: " +
         connection.getContentType() );
                   return;
         // read the URL
         InputStream is = connection.getInputStream();
         Reader r = new InputStreamReader(is);
         // parse the URL
         HTMLEditorKit.Parser parse = new HTMLParse().getParser();
         parse.parse(r,new Parser(url),true);
    catch (IOException e)
         getUrlsWaiting().remove(url);
         getUrlErrors().add(url);
         log("Error: " + url );
         report.URLError(url);
         return;
    // mark URL as complete
    getUrlsWaiting().remove(url);
    getUrlsProcessed().add(url);
    log("Complete: " + url );
    *start the spider
    public void run()
    cancel = false;
    while (!getUrlsWaiting().isEmpty() && !cancel)
         Object list[] = getUrlsWaiting().toArray();
         for (int i=0;(i<list.length)&&!cancel;i++)
         processURL((URL)list);
    * A HTML parser callback used by this class to detect links
    protected class Parser extends HTMLEditorKit.ParserCallback
    protected URL urlInput;
    public Parser(URL urlInput)
    this.urlInput = urlInput;
    public void handleSimpleTag(HTML.Tag t,MutableAttributeSet a,int pos)
    String href = (String)a.getAttribute(HTML.Attribute.HREF);
    if((href==null) && (t==HTML.Tag.FRAME))
    href = (String)a.getAttribute(HTML.Attribute.SRC);
    if (href==null)
    return;
    int i = href.indexOf('#');
    if (i!=-1)
    href = href.substring(0,i);
    if (href.toLowerCase().startsWith("mailto:"))
    report.emailFound(href);
    return;
    handleLink(urlInput,href);
    public void handleStartTag(HTML.Tag t,MutableAttributeSet a,int pos)
    handleSimpleTag(t,a,pos); // handle the same way
    protected void handleLink(URL urlInput,String str)
    try
         URL url = new URL(urlInput,str);
    if (report.urlFound(urlInput,url))
    addURL(url);
    catch (MalformedURLException e)
    log("Found malformed URL: " + str);
    *log the information of the spider
    public void log(String entry)
    System.out.println( (new Date()) + ":" + entry );
    I have a seperate class for parseing the HTML. Any help would be greatly appreciated
    mrv

    Hi Sorry to be a pain again,
    I have re worked the gui class so it looks like this now:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class gui extends JFrame implements Runnable
         *declare variable, boolean
         *thread, a object and a center
         *pane
         protected URL urlInput;
         protected Thread bgThread;
         protected boolean run = false;
         protected WebSpider webSpider;
         public String msgInfo;
         public String brokenUrl;
         public String goodUrl;
         public String deadUrl;
         protected DefaultMutableTreeNode rootNode;
    protected DefaultTreeModel treeModel;
         public gui()
              *create the gui here
              setTitle("Testing Tool");
         setSize(600,600);
         //add Buttons to the tool bar
         start.setText("Start");
         start.setActionCommand("Start");
         toolBar.add(start);
         ButtonListener startListener = new ButtonListener();
              start.addActionListener(startListener);
              cancel.setText("Cancel");
         cancel.setActionCommand("Cancel");
         toolBar.add(cancel);
         ButtonListener cancelListener = new ButtonListener();
              cancel.addActionListener(cancelListener);
              close.setText("Close");
         close.setActionCommand("Close");
         toolBar.add(close);
         ButtonListener closeListener = new ButtonListener();
              close.addActionListener(closeListener);
              //creat a simple form
              urlLabel.setText("Enter URL:");
              urlLabel.setBounds(100,36,288,24);
              formTab.add(urlLabel);
              url.setBounds(170,36,288,24);
              formTab.add(url);
              current.setText("Currently Processing: ");
              current.setBounds(100,80,288,24);
              formTab.add(current);
         //add scroll bars to the error messages screen and website structure
         errorPane.setAutoscrolls(true);
         errorPane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         errorPane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         errorPane.setOpaque(true);
         errorTab.add(errorPane);
         errorPane.setBounds(0,0,580,490);
         errorText.setEditable(false);
         errorPane.getViewport().add(errorText);
         errorText.setBounds(0,0,600,550);
         treePane.setAutoscrolls(true);
         treePane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         treePane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         treePane.setOpaque(true);
         treeTab.add(treePane);
         treePane.setBounds(0,0,580,490);
         treeText.setEditable(false);
         treePane.getViewport().add(treeText);
         treeText.setBounds(0,0,600,550);
         //JTree
         // NEW CODE
         rootNode = new DefaultMutableTreeNode("Root Node");
         treeModel = new DefaultTreeModel(rootNode);
         treeModel.addTreeModelListener(new MyTreeModelListener());
         tree = new JTree(treeModel);
         tree.setEditable(true);
         tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setShowsRootHandles(true);
         treeText.add(tree);
         //create the tabbed window           
    centerPane.setBorder(new javax.swing.border.EtchedBorder());
    formTab.setLayout(null);
    errorTab.setLayout(null);
    treeTab.setLayout(null);
    centerPane.addTab("Search Parameters", formTab);
    centerPane.addTab("Error Messages", errorTab);
    centerPane.addTab("Website Structure", treeTab);
              //add the tool bar and tabbed pane
              getContentPane().add(toolBar, java.awt.BorderLayout.NORTH);
    getContentPane().add(centerPane, java.awt.BorderLayout.CENTER);     
              *create the tool bar pane, a center pane, add the buttons,
              *labels, tabs, a text field for user input here
              javax.swing.JPanel toolBar = new javax.swing.JPanel();
              javax.swing.JButton start = new javax.swing.JButton();
              javax.swing.JButton cancel = new javax.swing.JButton();
              javax.swing.JButton close = new javax.swing.JButton();      
              javax.swing.JTabbedPane centerPane = new javax.swing.JTabbedPane();
              javax.swing.JPanel formTab = new javax.swing.JPanel();
              javax.swing.JLabel urlLabel = new javax.swing.JLabel();
              javax.swing.JLabel current = new javax.swing.JLabel();
              javax.swing.JTextField url = new javax.swing.JTextField();
              javax.swing.JPanel errorTab = new javax.swing.JPanel();
              javax.swing.JTextArea errorText = new javax.swing.JTextArea();
              javax.swing.JScrollPane errorPane = new javax.swing.JScrollPane();
              javax.swing.JPanel treeTab = new javax.swing.JPanel();
              javax.swing.JTextArea treeText = new javax.swing.JTextArea();
              javax.swing.JScrollPane treePane = new javax.swing.JScrollPane();
              javax.swing.JTree tree = new javax.swing.JTree();
              *show the gui
              public static void main(String args[])
              (new gui()).setVisible(true);
         *listen for the button presses and set the
         *boolean flag depending on which button is pressed
         class ButtonListener implements ActionListener
              public void actionPerformed(ActionEvent event)
                   Object object = event.getSource();
                   if (object == start)
                        run = true;
                        startActionPerformed(event);
                   if (object == cancel)
                        run = false;
                        startActionPerformed(event);
                   if (object == close)
                        System.exit(0);
         *this method is called when the start or
         *cancel button is pressed.
         void startActionPerformed (ActionEvent event)
              if (run == true && bgThread == null)
                   bgThread = new Thread(this);
                   bgThread.start();
                   //new line of code
                   treeText.addObject(msgInfo);
              if (run == false && bgThread != null)
                   webSpider.cancel();
         *this mehtod will start the background thred.
         *the background thread is required so that the
         *GUI is still displayed
         public void run()
              try
                   webSpider = new WebSpider(this);
                   webSpider.clear();
                   urlInput = new URL(url.getText());
                   webSpider.addURL(urlInput);
                   webSpider.run();
                   bgThread = null;
              catch (MalformedURLException e)
                   addressError addErr = new addressError();
                   addErr.addMsg = "URL ERROR - PLEASE CHECK";
                   SwingUtilities.invokeLater(addErr);
              *this method is called by the web spider
              *once a url is found. Validation of navigation
              *happens here.
              public boolean urlFound(URL urlInput,URL url)
                   CurrentlyProcessing pro = new CurrentlyProcessing();
              pro.msg = url.toString();
              SwingUtilities.invokeLater(pro);
              if (!testLink(url))
                        navigationError navErr = new navigationError();
                        navErr.navMsg = "Broken Link "+url+" caused on "+urlInput+"\n";
                        brokenUrl = url.toString();
                        return false;
              if (!url.getHost().equalsIgnoreCase(urlInput.getHost()))
                   return false;
              else
                   return true;
              *this method is returned if there is no link
              *on a web page, e.g. there us a dead end
              public void urlNotFound(URL urlInput)
                        deadEnd dEnd = new deadEnd();
                        dEnd.dEMsg = "No links on "+urlInput+"\n";
                        deadUrl = urlInput.toString();               
              *this method is called internally to check
         *that a link works
              protected boolean testLink(URL url)
              try
                   URLConnection connection = url.openConnection();
                   connection.connect();
                   goodUrl = url.toString();
                   return true;
              catch (IOException e)
                   return false;
         *this method is called when an error is
         *found.
              public void urlError(URL url)
              *this method is called when an email
              *address is found
              public void emailFound(String email)
              /*this method will update any errors found inc
              *address errors and broken links
              class addressError implements Runnable
                   public String addMsg;
                   public void run()
                        current.setText("Currently Processing: "+ addMsg);
                        errorText.append(addMsg);
              class navigationError implements Runnable
                   public String navMsg;
                   public void run()
                        errorText.append(navMsg);
              class deadEnd implements Runnable
                   public String dEMsg;
                   public void run()
                        errorText.append(dEMsg);
              *this method will update the currently
              *processing field on the GUI
              public class CurrentlyProcessing implements Runnable
                   public String msg;
              //new line
              public String msgInfo = msg;
              public void run()
                   current.setText("Currently Processing: " + msg );
         * NEW CODE
         * NEED THIS CODE SOMEWHERE
         * treeText.addObject(msgInfo);
         public DefaultMutableTreeNode addObject(Object child)
         DefaultMutableTreeNode parentNode = null;
         TreePath parentPath = tree.getSelectionPath();
         if (parentPath == null)
         parentNode = rootNode;
         else
         parentNode = (DefaultMutableTreeNode)
    (parentPath.getLastPathComponent());
         return addObject(parentNode, child, true);
         public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
    Object child)
         return addObject(parent, child, false);
         public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
         Object child,boolean shouldBeVisible)
         DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(child);
         if (parent == null)
         parent = rootNode;
         treeModel.insertNodeInto(childNode, parent, parent.getChildCount());
         if (shouldBeVisible)
         tree.scrollPathToVisible(new TreePath(childNode.getPath()));
              return childNode;
         public class MyTreeModelListener implements TreeModelListener
              public void treeNodesChanged (TreeModelEvent e)
                   DefaultMutableTreeNode node;
                   node = (DefaultMutableTreeNode)
                   (e.getTreePath().getLastPathComponent());
                   try
                        int index = e.getChildIndices()[0];
                        node = (DefaultMutableTreeNode)
                        (node.getChildAt(index));
                   catch (NullPointerException exc)
              public void treeNodesInserted(TreeModelEvent e)
              public void treeStructureChanged(TreeModelEvent e)
              public void treeNodesRemoved(TreeModelEvent e)
    I beleive that this line of code is required:
    treeText.addObject(msgInfo);
    I have placed it where the action events start the spider, but i keep getting this error:
    cannot resolve symbol
    symbol : method addObject (java.lang.String)
    location: class javax.swing.JTextArea
    treeText.addObject(msgInfo);
    Also the jtree is not showing the window that I want it to and I am not too sure why. could you have a look to see why? i think it needs a fresh pair of eyes.
    Many thanks
    MrV

  • Help with building dynamic website using tutorial (was: I know this is a repost but I'm still stuck!)

    Perhaps this was missed by the group but here goes:
    I am slogging thru a dynamic PHP tutorial but  I cant continue without losing some understanding of the process due to ?
    I am trying to complete the following:
    Building your first dynamic website – Part 2: Developing the back end
    However,
    my Insert record form dialog (below) looks like this, and I need to change both 'title' and 'blog_entry' values (as shown above), but I cannot make that choice in my form.
    I am using DW CC with the Deprecated Server Behavior from DMX zone.
    I have made sure my results match the tutorial, but I cant get past the above inconsistency in functionality.
    Any help would be appreciated.
    Thanks folks!

    The Columns area indicates which form field is used to insert a value in each column. Although the post_id and updated columns are listed as getting no value, their values are generated automatically by the database.
    Check that the title and blog_entry columns are being assigned the correct values. If either is marked as getting no value, it means that you have spelled the names of the form fields differently from the column names. Correct this by selecting the column name in the Columns area and selecting the form field's name from the Value pop-up menu.
    Nancy O.

  • ABAP help with deeply nested items.

    Gurus,
    We have a requirement whence we need to sum up the key figures from one transformation layer going to the next.  The challenge is, its a deeply nested structure. something like :
    SalesOrderItem     Higher Level Item         KeyFig  
    1000                     0000                          30
    1010                     1000                          20
    1011                     1010                          10
    1015                     1010                          20
    1020                     1010                          20
    1021                     1020                          10
    1022                     1020                          50
    1023                     1020                          10
    1025                     1020                          20
    So now, in the next layer we will be rolling it upto the 1000 , 2000...levels- in this example 1000 level only.
    The round figure items(1010, 1020.....) are the individual kmats and the summation happens like this:
    1. Items 1021, 1022, 1023 and 1025 roll up to 1020; sum = 90.
    2. Now when 1020 rolls up to its higher level item which is 1010, the sum that rolls up from 1020 should be 90 + 20.
    3. Ultimately when all items roll up to item 1000, the total sum will be 190.
    Can someone please help me write this logic in ABAP?
    Thanks!
    Chris

    You can try this, but please put it through more examples. Assumption is that your highest level item will have higher item number as 0000 and that they are always sorted in the way it is given in your example.
    DATA: BEGIN OF itab OCCURS 0,
            posnr(6) TYPE n,
            uposn(6) TYPE n,
            qty TYPE p DECIMALS 2.
    DATA: END OF itab.
    DATA: itab2 LIKE itab OCCURS 0 WITH HEADER LINE.
    DATA: itab3 LIKE itab OCCURS 0 WITH HEADER LINE.
    DATA: v_total TYPE p DECIMALS 2,
          v_posnr(6) TYPE n.
    itab-posnr = '1000'.
    itab-uposn = '0000'.
    itab-qty   = 30.
    APPEND itab.
    itab-posnr = '1010'.
    itab-uposn = '1000'.
    itab-qty   = 20.
    APPEND itab.
    itab-posnr = '1011'.
    itab-uposn = '1010'.
    itab-qty   = 10.
    APPEND itab.
    itab-posnr = '1015'.
    itab-uposn = '1010'.
    itab-qty   = 20.
    APPEND itab.
    itab-posnr = '1020'.
    itab-uposn = '1010'.
    itab-qty   = 20.
    APPEND itab.
    itab-posnr = '1021'.
    itab-uposn = '1020'.
    itab-qty   = 10.
    APPEND itab.
    itab-posnr = '1022'.
    itab-uposn = '1020'.
    itab-qty   = 50.
    APPEND itab.
    itab-posnr = '1023'.
    itab-uposn = '1020'.
    itab-qty   = 10.
    APPEND itab.
    itab-posnr = '1025'.
    itab-uposn = '1020'.
    itab-qty   = 20.
    APPEND itab.
    itab2[] = itab[].
    *-- assumption is that if UPOSN = 000000, then there is no higher level
    *   item
    LOOP AT itab WHERE uposn = '000000'.
      itab3-posnr = v_posnr = itab-posnr.
      DO.
        LOOP AT itab2 WHERE uposn = v_posnr.
          v_total = v_total + itab2-qty.
        ENDLOOP.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
          v_posnr = itab2-posnr.
        ENDIF.
    *-- This item does not appear as a higher level item
      ENDDO.
      v_total = v_total + itab-qty.
      itab3-qty = v_total.
      APPEND itab3.
      CLEAR itab3.
    ENDLOOP.
    LOOP AT itab3.
      WRITE:/ itab3-posnr,
              itab3-qty.
    ENDLOOP.

  • Help with building a form

    Hello, I'm pretty new to LifeCycle and don't even know if this is the right program I should be using to do this but I thought I'd give it a shot.
    The branch I work for in my company has been doing media planning up in Saskatchewan for about a year now. We build and distribute ads through small towns across Saskatchewan for all types of people. We have been building up a list of newspapers that we can use including the contact information and prices of various sized ads.
    We don't have a way to reference all the newspapers quickly. We have to go back through prior folders and find each newspaper and their contact information before we can plan for the next ad run. What I would like to do is build a form that would be easy to just click on a drop down menu, find the newspaper that you want, and then all the information will pop up in a contact box below the drop down menu.
    I've already build a mini drop down menu with about 10 newspapers to see if this will work but I don't know how to link the drop down menu item with another box that will open up all the contact and pricing info.
    Can someone please help?
    Thanks!

    Hi,
    you can do what you want with LiveCycle, and it might help you to look at this reference as it shows how to work with data ( it does depend how your data is stored)
    http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000006.htmlhttp://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000006.html
    If you data does not change very often then I would recommend just using an XML file to store the data and then use thebinding ability with possible some JavaScript to create the solution you would like.
    Hope this helps
    Malcolm

  • Help with building a database portlet (reference_path) issues

    I'm attempting to create a Provider Portlet based on the Database Provider example. The goal of the portlet is to
    dynamically display a Portal Report based upon a session storage variable. The session storage variable is set in another portlet on the same page. My portlet is named DYNAMIC_RPT.
    I'm able to display the report from within my database portlet by calling the report's .show procedure.
    But, my problem is this: The reference_path is generated for my database portlet, for example 131_DYNAMIC_RPT_123123, so when I click the NEXT button on the report, the page is refreshed but the report is still on page 1.
    I think the problem is that my portlet needs to internally determine what the reference_path SHOULD BE for the report I'm trying to display, and use it in the associated provider API's.
    If I could call the API which is generating the reference_path I could then pass an appropriate reference_path. I would need to be able to dynamically regenerate the reference_path when ever the session variable changes. Is this possible ?
    Also, when I'm building the p_arg_names, and p_arg_values whould I ONLY extract the argument(parms) which are associated with the p_reference_path of the portlet report currenttly being displayed ?
    Also is there a session storage variable which contains the current PAGE ID and TAB ID. I'm extracting it form the PAGE_URL but it's very messy code.
    Thanks in advance for your help !!

    Hi,
    you can do what you want with LiveCycle, and it might help you to look at this reference as it shows how to work with data ( it does depend how your data is stored)
    http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000006.htmlhttp://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000006.html
    If you data does not change very often then I would recommend just using an XML file to store the data and then use thebinding ability with possible some JavaScript to create the solution you would like.
    Hope this helps
    Malcolm

  • Help with my nested loop...

    this application allows a user to enter two int values, rows(height) and columns(length), that are used to create a box of asterisks.
    my createBox() does not work correctly, only prints first line, loops infinitely, or doesnt loop. can someone help me out please?
    import java.io.*;
    public final class AsteriskBox
    /****InstanceVariables****/
    public static int row;
    public static int col;
    /****Constructor()****/
    public AsteriskBox()
    /****Access()'s****/
    public void createBox(int x, int y)
    if((x > 0) && (y > 0))
    for(int i = x; i > 0; i--)
    for(i = y; i > 0; i--)
    System.out.print("*");
    System.out.println();
    } // createBox()
    public void getInput() throws IOException
    BufferedReader input = new BufferedReader
    (new InputStreamReader(System.in));
    System.out.print("Enter a number of rows: ");
    String inputString = input.readLine();
    row = convertStringToInteger(inputString);
    System.out.print("Enter a number of columns: ");
    inputString = input.readLine();
    col = convertStringToInteger(inputString);
    } // getInput()
    /****Helper()****/
    private int convertStringToInteger(String s)
    Integer intObject = Integer.valueOf(s);
    return intObject.intValue();
    } // convertStringToInt()
    } // AsteriskBox class
    import java.io.*;
    public class AsteriskBoxUser
    public static void main(String args[]) throws IOException
    AsteriskBox box = new AsteriskBox();
    System.out.println("This program creates a box made of asterisks with values given by you!");
    System.out.println();
    box.getInput();
    box.createBox(AsteriskBox.row, AsteriskBox.col);
    }

    You will never break out of the first loop because you are using the same index variable i for both of your nested loops. Use a different variable, say j for your inner loop.
    Incidentally, your row and col variables are mislabeled. If you use the static modifier, they are class variables, not instance variables. This could cost you points on your assignment since it would imply that you don't know the difference.

  • Help with XML Nested sets

    I'm currently making a table similar to the Product Table on
    the Spry demo. I'm having some problems because I need to link
    videos and sounds from nested XML categories to a sidebar, similar
    to the features list on the demo site. The problem is, I dont want
    the full URL to show, but something else
    I managed to get the list to show what I wanted by doing
    something like this:
    <media>
    <video>2004/videos/x.mov <name>Great Video
    </name> </video>
    </media>
    By calling spry:region="media" and then
    <ul><li><a
    href={video}>{name}</a><li></ul>
    I got a full list with the names, but the links were
    apparently lost, and all pointed to the table's url.
    I also tried doing a <div spry:region="media"
    spry:region="name"> and list the <video> and <name>
    tags separately on the XML, but that didn't work.
    I'd be very greatful if someone could help me figure out how
    to do this.
    Thank you,
    Jose

    Just looking at your post, I noticed that when you put the ibar in your shelf and add applications the icons don't like to show up you have to
    1. right click on the application in the ibar
    2. select icon program-properties-icon
    3.click on the grey box
    4.navigate to /usr/share/icons/highcoler/64x64/apps  (you can select 48x48 as well)
    The icon should show up in ibar, as well as the applcation menu. It is hit and miss though. I hope this helps.
    Edit: I think I solved the hit and miss attribute, instead of selecting the file in the middle of the window manager select it to the right. And make sure that the file shows up in the bar at the bottom of the filemanager window.
    Last edited by mich04 (2012-11-25 13:40:36)

  • Help with building query

    Hi ALl,
    Below is a code sample. My question is how to build the query in the for loop of public procedure to call all the private proedures (private_1,private_2,private_3 etc.)
    PACKAGE SAMPLE AS
    procedure public(start IN integer, end IN integer)
    END;
    PACKAGE BODY SAMPLE IS
    procedure private_1()
    BEGIN
    END
    procedure private_2()
    BEGIN
    END
    procedure private_3()
    BEGIN
    END
    procedure public(start IN integer, end IN integer)
    BEGIN
    for num in start..end loop
    private_ || to_char(num); ?????????????????????????
    end loop
    END
    END;

    Actually, you can build dynamic PL/SQL and execute it via 'execute immediate':
    execute immediate 'begin private_' || to_char(num) || '; end;';But...it will not help in this case because the NDS is executed outside of the scope of the package - it cannot see the private procedures, and it cannot even see public procedures unless you preface the procedure with the package name.

  • Help with building AMD64 System

    Hi ppl
    I need some advice please  
    I am building an AMD64 system for my friend and want advice from anyone (especially those with 64s already)
    The motherboard I will build with is the MSI K8N Platinum nForce3 250 with a 3200+ AMD64  
    The questions are:
    1. What is the best cooler to use:  
    Thermaltake Silent Boost or Zalman 7000 Al/CU
    (I am thinking the silent boost as it is £12 cheaper and the performance is close isnt it. The silent boost is very good on my AMD XP and the Zalman is just as good on my P4)
    2. What PSU should I use with the AMD64:  
    Antec TruePower 480W (similar to mine plus seperate rails) or
    Enermax EG465AX-VE(W)FCA Diamond Blue 460W
    3. What RAM would be best for this motherboard out of these 3:
    (Will performance be hit hard if CAS 2.5 is used otherwise CAS 2 is over budget)
    Kingmax PC3500 SuperRAM 433Mhz http://overclock.co.uk/customer/product.php?productid=17006&cat=310
    Corsair 1GB DDR Value Select PC3200 Kit http://www.overclockers.co.uk/acatalog/Corsair_Value_Select.html
    GeIL 1GB (2x512MB) PC3200 Value Dual Channel Kit CAS2.5
    http://www.overclockers.co.uk/acatalog/GeIL_Value.html
    Cheers Guys for your help. Could ya answer ASAP  
    Cheers
    SAspaz  

    The Tagan will more than handle a 3200+ and 9800 Pro, are you serious? it will handle anything you can possibly throw at it and not even break a sweat. This PSU is a monster!
    Another review: http://www.hexus.net/content/reviews/review.php?dXJsX3Jldmlld19JRD02OTQ=
    "The results speak for themselves. Both PSU's were equally able to cope with the testing, each holding close to the target output voltage. The +3.3V and +5V results are the most interesting. The Tagan has discrete supply for each, while the Enermax derives each output voltage from a shared supply. Under load, heavy load on one rail may pull the other rail down too on the Enermax, while theoretically the Tagan should be able to do much better.
    The adjusted average figure is derived with peak and trough results removed, stopping them from skewing the results, however it's that peaking of output voltage that can cause a PSU the most problems in supplying clean output. The Tagan, with its return loop, also has an added advantage in high load situations, reducing ripple noise.
    While both PSUs seem very competent, indeed I'm proud my long term Enermax did so well, a PSU that takes a newer, refined approach to supplying clean output voltage, like the Tagan, should always win outright.
    While it's unscientific at best, the Tagan shines, holding steadfast to the desired voltages on each rail, regardless of load. "
    More reviews:
    http://www.casemodworld.com/article147.html
    "Conclusion
    We have all seen power supplies that claim to be 'silent' before. None that I have seen have yet proven to be as good as the Tagan. I had to double check that it was running when I first powered up. The only thing I could hear was the exhaust fan in my case, the PSU was inaudible.
    What we like about the Tagan -
        * Large Heatsinks
        * Excellent Silent Cooling system
        * Most silent PSU we have come across
        * Lots of molex connectors
        * Neater cables due to twisted wires
    What we don't like about the Tagan -
        * Large mainboard adapter needed
    Anyone notice the lack of dislikes? I could only think of one and even that is being picky.
    Overall this PSU is simply amazing, the voltages are perfect, is even more silent than I thought and its very reasonably priced. What more could you ask for?"
    http://www.themodfathers.jolt.co.uk/?page=&action=show&id=8062
    http://modtown.co.uk/mt/review2.php?id=taganpsu

Maybe you are looking for

  • Should I Buy a New iMac

    I was wondering if I need to upgrade my Mac to a newer model. I have an early 2006 iMac 1.83GHz Intel Core Duo 2GB of Ram its the 17 inch model. I have OSX 10.6.8 installed on a 250GB HDD. I was looking at the new Macs and none of them have a SuperDr

  • XML Validation using custom DTD file

    Well, I thought that my problem is about to be a trivial one, but now, I don't think so. I have to develop XML-based protocol over HTTP. XML Document doesn't contain any reference to DTD, but I have some DTDs. I want to validate my XML messages in re

  • ORA-27369 Exit-Code: 255 when executing sql script as job

    Dear all I'd like to find and compile all invalid objects in an instance. This should be done every day as a scheduled job with the use of DBMS_SCHEDULER. For this, I set up the following sql-script: ---------start script-------------- set heading of

  • The Project implementation

    Hi Everybody, I am working with Implementation project for the first time at client place so i have to handle all the things ... so let me know the procedure how to proceed .... first is Blue prints ..... if any body is having blue prints format pls

  • Help, please, with iphoto 9.4.3 crash

    Hi, On a recent month-long vacation I tried to transfer images from my camera to iPhoto via a cable, but my hard drive didn't have room. I haven't been able to get iPhoto 9.4.3. to launch again, even without my camera connected. I tried one recommend