Adding io.File array into DefaultListModel

I am creating what should be a simple slide show with images loaded using a JChooser and File Filter.
Here's my code:
Loading Images
     private void loadImages() {          
          JFileChooser chooser = new JFileChooser();
          chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
          int state = chooser.showOpenDialog(this);
          if (state == JFileChooser.APPROVE_OPTION) {
               File directory = chooser.getSelectedFile();
               imageFiles = directory.listFiles(new ImageFileFilter());
               listModel = new DefaultListModel();
               listModel.addElement(imageFiles);
          } else {
               close();
     }getListRendererComponent
     public Component getListCellRendererComponent(JList list, Object value,
               int row, boolean isSelected, boolean cellHasFocus) {
          setOpaque(isSelected);
          setBorder(cellHasFocus ? HAS_FOCUS_BORDER : null);
          if (value instanceof File) {
               File imageFile = (File) value;
               ImageIcon imageIcon = cachedImages.get(imageFile);
               if (imageIcon == null) {
                    try {
                         imageIcon = getScaledImageIcon(imageFile);
                         cachedImages.put(imageFile, imageIcon);
                    } catch (IOException e) {
                         setText("Exception!!");
                         setIcon(null);
               setText("");
               setIcon(imageIcon);
          } else {
               setText("No Images");
               setIcon(null);
          return this;
     }My problem here is that it's showing "No Images", even when there are images in the selected directory.
I think I have to change something from here:
               File directory = chooser.getSelectedFile();
               imageFiles = directory.listFiles(new ImageFileFilter());
               listModel = new DefaultListModel();
               listModel.addElement(imageFiles);But I don't know what.
Thanks in advance.

Wrong forum, but here you go anyway:
    listModel = new DefaultListModel();
    for(File file : imageFiles)
      listModel.addElement(file);
    }

Similar Messages

  • Add time stamp array into first column of text file

    I am writing daq output to a file by using array to spreadsheet string vi then write that to a file but I would like to add a time stamp array into the first column of the text file. How do I do this?

    When you use a DAQmx Read, you have the option of returning a waveform data type. This includes time data. If you were to use this and either Export Waveforms to Spreadsheet File or Write Measurement File, this would included. To stick with the regular Write to Spreadsheet File, you would have to create an array of timestamps yourself based on a start time and the sample rate of the DAQ. Then you would convert this and the data array to strings and use the string array type of Write to Spreadsheet instead of the DBL type.
    Message Edited by Dennis Knutson on 09-25-2007 01:12 PM
    Attachments:
    Write to Spreadsheet - Strings.PNG ‏1 KB

  • Write arrays into a text file in different columns at different times

    Hi,
              I have a problem write data into a text file. I want to write 4 1D arrays into a text file. The problem is that I need to write it at different time and in different column (in other word, not only append the arrays).
    Do you have an idea to solve my problem?
    Thank you

    A file is long a linear string of data (text). In order ro insert columns, you need to rewrite the entire file, because colums are interlaced over the entire lenght of the file.
    So:
    read file into 2D array
    insert columns using array operations
    write resulting 2D array to file again.
    (Only if your colums are guaranteed to be fixed width AND you know the final number of colums, you could write the missing columns as spaces and then overwrite later. Still, it will be painful and inefficient, because column data are not adjacent in the file.)
    LabVIEW Champion . Do more with less code and in less time .

  • Loading wave file data into array

    Greetings
    For starters, I'm still learning java, so forgive me if this is a trivial question. I've been using the documentation on the java sound api as a guide. What I am trying to do is to load a wav file data into a byte array and eventually I will need it to have it in an int array so I can pass the data into a demodulation algorithm to display as an image. This wave file is a recorded signal from a NOAA satellite. Here is my code thus far:
    public boolean loadFile(File soundFile) {
              int totalFramesRead = 0;
              boolean result=false;
              File fileIn = new File(soundFile.getPath());
              try {
                   AudioInputStream ais = AudioSystem.getAudioInputStream(soundFile);
                   int bytesPerFrame = ais.getFormat().getFrameSize();
                   // Set an arbitrary buffer size of frames.
                   int numBytes = 1024*bytesPerFrame;
                   byte[] audioByte= new byte[numBytes];
                   try {
                        int numBytesRead = 0;
                        int numFramesRead = 0;
                        // Try to read numBytes bytes from the file.
                        while ((numBytesRead = ais.read(audioByte)) != -1) {
                             // Calculate the number of frames actually read.
                             numFramesRead = numBytesRead / bytesPerFrame;
                             totalFramesRead += numFramesRead;
                             return(result= true);
                   } catch (Exception ex) {
                   JOptionPane.showMessageDialog(desk, " Error Loading File" ,"Error",
                             JOptionPane.WARNING_MESSAGE);
                   ais.close();
                   throw ex;}
              } catch (Exception ex) {
                   JOptionPane.showMessageDialog(desk, " Error Loading File" ,"Error",
                             JOptionPane.WARNING_MESSAGE);
              return result;
         }

    You can find oracle documentation for sqlldr (11g) here:
    http://docs.oracle.com/cd/B28359_01/server.111/b28319/ldr_concepts.htm#SUTIL003
    If you have questions on details you should post your question in the special sqlldr forum:
    Export/Import/SQL Loader & External Tables
    hm

  • Write string array into cfg file

    Hi, everybody.
    I faced the problem to write array into cfg file. I am trying to put many items in a key. It should look like
    [Section1]
    Key1=el_1, el_2,el_3,.............el_n.
    each element is string of 105 characters. Everything works fine when I save the only one el_1 or multiple for the  first time, however, when I am trying to update values in a key section some extra strings appear in a file. My VI is attached.
    Thanks in advance

    Do you realize that your spreadsheet string only writes the following:
    1111111111
      2222222222222222
     33333333333333333333
    The way you wrote your VI, it sends the entire string above to the value for Write Key.vi.
    Do you realize that value is for the data type only?  So I'm not sure what you want to do....
    Without describing the problem you are having, can you describe what you actually want to do?
    R
    Message Edited by JoeLabView on 07-22-2008 11:49 AM
    Attachments:
    confused.PNG ‏26 KB

  • Write array into txt file

    Hi Guys!
    I need a VI which writes the content of an array into a txt file.
    I have an array like this:
    Peti    Teri
    Zoli    Hajni
    Tomi    Heni
    Pali    Robi
    In the file the first line should be a full timestamp (date, time), and then would come the content of the array. The name of the file would also be a timestamp.
    Thank you for your help in advance!

    Hi Victronica and welcome to NI Forums!
    If you have some custom data, then it is up to ou to tell excel how to interpret said data (what information to put where, etc.) A simple solution would be to flatten your cluster elements into strings, and write those strings into an excel sheet using ActiveX. An example on how to write a table of strings is available in the example finder, and I also have it attached here in LabVIEW 2013.
    Kind regards:
    Andrew Valko
    National Instruments Hungary
    Attachments:
    Excel - Write Table.vi ‏17 KB

  • Adding PictureBox array into Controls

    I tried adding PictureBox array into controls but only one pictureBox is being added.When
    I do this, the labels are displaying correctly, but only one PictureBox is appearing. I tried changing X,Y positions, but it did not help. The debugger shows lists of array of PictureBox initialized. Is there anything that I am doing wrong or what is the better
    approach to add PictureBox with Label above it dynamically.
    This is what I did.
    Label[] l = new Label[15];
    PictureBox[] pic1 = new PictureBox[15];
    int y_value = 47;
    for (int i = 0; i < 6; ++i)
    l[i] = new Label();
    l[i].Text = "Test Text";
    l[i].Font = new System.Drawing.Font("Calibri", 8, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
    l[i].ForeColor = System.Drawing.Color.White;
    l[i].BackColor = System.Drawing.Color.FromArgb(1, 0, 64);
    l[i].Size = new System.Drawing.Size(145, 20);
    l[i].Location = new Point(30, y_value);
    l[i].Anchor = AnchorStyles.Left;
    l[i].Visible = true;
    //this.Controls.Add(l[i]);
    pic1[i] = new PictureBox();
    pic1[i].Image = Image.FromFile(STR_SETTING_PATH + "\\" + STR_IDEA_NO_XXXXX + "_01_nv.png");
    pic1[i].Size = new System.Drawing.Size(400, 332);
    pic1[i].Location = new Point(2, y_value - 10);
    pic1[i].Anchor = AnchorStyles.Left;
    pic1[i].Visible = true;
    //this.Controls.Add(pic1[i]);
    y_value += 37;
    this.Controls.AddRange(l);
    this.Controls.AddRange(pic1);
    Saugat K.C.

    Sougat, 
    Maybe better if you remove a question when there are not yet replies. Now an moderator has to do that. 
    Thanks
    Success
    Cor

  • Help with adding audio files to page

    I am using DW CS5.  I have had numerous troubles adding audio files to any page.  Please know that I am not at all computer savy when it comes to html codes etc.  But I have been working with DW CS5 and have a functional website and my pages validate.  That being said, please be patient with me if I am asking stupid questions or don't understand the solution.
    Now to the problem....I originally wanted to add mp3 files...but I am not sure how to work with plugins or which plugin to use.
    Therefore, I converted my mp3 files to swf and used the insert media file feature in DW CS5.  But when I look at the finished page...I only see a big white box.  Nothing happens when you click on it. 
    First question...which is the best method to add audio files?
    Second question...what steps do I need to follow achieve the desired result?
    Note:  there is one validation error on this page and I'm not sure why or how to fix it.  Any suggestions here would be greatly appreciated.
    Here is the code for the page (or you can go to this link:  http://02cada7.netsolhost.com//test2/cupotea.shtml):
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>cupotea</title>
    <style type="text/css">
        body {
            margin: 0;
            width: 100%;
            background-color: #000; /* change this to whatever the background color should be for the sides (and the bottom) */
        #wrapper {
            min-width: 960px; /* this is how wide the actual content area will be (the centered part) */
            max-width:    1260px;
            margin-left: auto;
            margin-right: auto;
            padding: 0 0 5 5; /* keep the first two values at 0, the others are for left and right space from the edge of the background */
            background-color: #000; /* this is the background color of the main content area */
            color: #FFF; /* this is the default font color */
        #top {
            height: 75px;
            font-size: 60px;
            font-style: italic;
            font-weight: bold;
            color: #FFFDE6;
            background-color:#750700;
            text-align: center;
        #left {
            width: 120px; /* this is the width of the side area. this will take some of the width of the wrapper, above */
            float: left;
            padding-top:10px;
        #main {
            min-width: 840px; /* this is the width of the main content area. This, plus the width of the side, should equal the width of the wrapper */
            max-width: 1340px;
        float:left;
        background-color:#000;
        color: #000;
    #body {
        width:853px;
        float:left;
        color: #fffde6;
        padding-right: 10px;
        padding-left: 10px;
    #bodyleft {
        width:425px;
        float:left;
        padding-top:70px;
    #bodyleft2 {
        width:425px;
        float:left;
        padding-top:70px;
    #bodyright {
        width:425px;
        float:left;
        padding-top:70px;
    #bodymiddle {
        width:853px;
        float:left;
        color: #fffde6;
        padding-right: 10px;
        padding-left: 10px;
    a img {border:none; }
    .standardparagraph {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12pt;
        color: #fffde6;
        text-align: justify;
        font-weight: normal;
    .standardparagraph2{
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12pt;
        color: #fffde6;
        text-align: justify;
        font-weight: normal;
        border-top:thin;
        border-color:#666;
        border-bottom-style:solid;
    .standardparagraph3{
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12pt;
        color: #fffde6;
        text-align:    center;
        font-weight: normal;
    .standardparagraph4{
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12pt;
        color: #fffde6;
        text-align: center;
        font-weight: normal;
        border-top:thin;
        border-color:#666;
        border-bottom-style:solid;
    .pagetitle {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 16pt;
        font-weight: bold;
        color: #fffde6;
        text-align: center;
    </style>
    //<![CDATA[
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    //]]>
    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryTooltip.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarVertical-2.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryTooltip.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="lightbox/js/prototype.js"></script>
    <script type="text/javascript" src="lightbox/js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="lightbox/js/lightbox.js"></script>
    <link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="screen" />
    <style type="text/css">
    a:link {
        color: #06F;
    a:visited {
        color: #06F;
    a:hover {
        color: #06F;
    a:active {
        color: #06F;
    </style>
    </head>
    <body onload="MM_preloadImages(''images/buttons/miscfamily2.jpg','images/buttons/home2.jpg','im ages/buttons/familytrees2.jpg','images/buttons/legacy2.jpg','images/buttons/polska2.jpg',' images/buttons/dziekuje2.jpg','images/buttons/calendar2.jpg','images/buttons/dziekuje2.jpg ','images/buttons/StasikEarly1800sto1870-2.jpg','images/buttons/JanikMid1800sto1866-2.jpg' ,'images/buttons/Stasik1857toPresent-2.jpg','images/buttons/1st-generation-2.jpg','images/ buttons/2nd-generation-2.jpg','images/buttons/3rd-generation-2.jpg','images/buttons/4th-ge neration-2.jpg','images/buttons/5th-generation-2.jpg','images/buttons/6th-generation-2.jpg ','images/buttons/7th-generation-2.jpg','images/buttons/january-2.jpg','images/buttons/feb ruary-2.jpg','images/buttons/march-2.jpg''images/buttons/april-2.jpg','images/buttons/may- 2.jpg','images/buttons/june-2.jpg','images/buttons/july-2.jpg','images/buttons/august-2.jp g','images/buttons/september-2.jpg','images/buttons/october-2.jpg','images/buttons/novembe r-2.jpg','images/buttons/december-2.jpg')">
    <div id="wrapper">
      <div id="top">
        <div align="center">THE STASIK FAMILY</div>
      </div>
      <div id="left">
    <!--#include virtual="includes/menu.html" -->
      </div>
      <div id="main">
       <div align="center">
        <br />
        <span class="pagetitle">CUP O' TEA</span><br />
        </div>
        <div id="body">
            <p class="standardparagraph2">When preserving family history, nothing can compare to sitting down with a Grandparent or Great Aunt or Uncle over a cup of tea; listening to them reminicse about the past.  Unlike handwritten accounts, there is opportunity to ask questions or delve further into the subject.  Even better, recording such conversations so they can be shared for generations to come.<br />
    <br />
    The following audio files were created by Virginia (Stasik) Zarow at the request of Laura (Stasik) Schmidt and Carrie (Stasik) Kot.  There were a total of five cassette tapes, ranging from 1 hour to a 1 1/2 halfs in length.  Scott Freeson converted each tape to digital format and then they were broken down into various segments for a total of 7 audio files.  It is recommended that you listen to each tape in the order presented to maintain the proper timeline and context.<br /><br /></p>
    <p class="standardparagraph">The first five audio files were recorded by Aunt Virginia in response to questions posed by Laura (Stasik) Schmidt and her sister Carrie (Stasik) Kot.  Aunt Virginia re-recorded her responses in August 2009 after noticing some mistakes in the original recording.<br />
    <br />
    Note:  Virginia refers to her father as "tata", which is the Polish word for dad.</p>
    <div id="bodyleft">
    <span class="standardparagraph">What are the recollections you have about your parents, in particular their interests, their hobbies, and their lives and faith?<br />
    What did your dad do around the house?<br />
    How did your mom relax?<br /><br /></span>
    <span class="standardparagraph">How did you celebrate holidays and birthdays? <br />
    Did you go on vacations?<br />
    What did you and your brothers do for fun?<br /><br /></span>
    <span class="standardparagraph">What do you know about Jacob Sikora and Catherine Dziwak, the extended family and their faith?<br />
      - Jacob Sikora and Catherine (Dziwak) Sikora<br />
      - Michael (aka Patsy)<br />
      - Magdeline (aka Chochi)<br />
      - Angeline (aka Nellie) - includes information about Frank &amp; their children<br />
      - Elizabeth (aka Diane)<br />
      - John<br />
      - Peter<br />
      - Walter<br /><br /></span>
    <span class="standardparagraph">  What was the house like?<br />
      - In the beginning<br />
      - The 1936 flood<br />
      - Renovations<br />
      - The final demise<br /><br /></span>
    <span class="standardparagraph2">Miscellaneous tidbits...<br />
      - Polish Proverbs<br />
      - Ancedotes<br /><br /></span>  </div>
    <div id="bodyright">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="50" height="25" id="FlashID" title="virginia1of5">
      <param name="movie" value="audiofiles/virginia1of5.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="15.0.0.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
      <param name="expressinstall" value="Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="audiofiles/virginia1of5.swf" width="50" height="250">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="15.0.0.0" />
        <param name="expressinstall" value="Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
    <span class="standardparagraph3">for the media file<br /><br /><br /><br /></span>
    <span class="standardparagraph3">for the media file<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></span> 
    <span class="standardparagraph3">for the media file<br /><br /><br /><br /><br /><br /></span>
    <span class="standardparagraph4">for the media file<br /><br /><br /><br /></span>
        </div>
        <div id="bodymiddle"><span class="standardparagraph">The second tape, also recorded in August 2009, consists of 2 clips and covers the years 1944 through 1947.</span></div>
    <div id="bodyleft2">
    <span class="standardparagraph">Summer of 1944 to December of 1945<br />
      - Meeting of Frank Zarow<br />
      - New Years Eve - 1944<br />
      - Prom Night - May 1945<br />
      - First boyfriend, Eddie Yesh<br />
      - First job as a hygienist<br />
      - Meeting of John Zarow<br />
      - Enrolled at Indiana State Teachers College<br />
      - Meeting of Ted Zaroff<br />
      - Thanksgiving - 1945<br />
      - Florian Stasik Airforce injury<br />
      - Christmas - 1945<br />
      - New Years Eve - 1945</span>
    <span class="standardparagraph">Note:  Per Virginia, Ted's name should be spelled Zarow, like most of his brothers.  There was a mixup with his birth certificate and his last name was mispelled (although it is phonetically correct).  He chose to keep this spelling as did one of his brothers.<br /><br /></span>
    <span class="standardparagraph">January 1946 to December 1947<br />
      - Takes job as cook/housekeeper<br />
      - Break-up with Eddie Yesh<br />
      - Frank Zarow passes away<br />
      - Christmas 1946<br />
      - Meets John Zarow again<br />
      - New Years Eve 1946<br />
      - John courts Virginia<br />
      - First date with John<br />
      - John's father passes away<br />
      - Christmas 1947</span>
    <span class="standardparagraph">Virginia mentions visiting cousin Helena in Poland.  She is referring to <a href="4-0-helenastasikguzik.shtml">Helena (Stasik) Guzik </a>and her trip to Poland in 1990.  </span></div>
    <div id="bodyright2">
    <span class="standardparagraph3">for the media file<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></span>
    <span class="standardparagraph3">for the media file<br /><br /><br /><br /></span></div>   
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </div>
    </div>
    <script type="text/javascript">
    swfobject.registerObject("FlashID");
      </script>
      </div>
    </body>
    </html>

    Woohoo! I was able to resolve the issue including the validation issue.  But I have a follow up question...
    Currently if you click on the play button another window pops up which has the play/control/stop buttons to control the audio file.  The attribute is set to new window.  If I change the attribute to parent window, then the page that has the control buttons overlays ontop of the page with the link.
    To get back to the original page, one must click on the back arrow near the address bar.
    Isn't there a way to not have a separate window appear?  In other words, the controls are embeded into the parent page?

  • Inadvertantly added music files to the wrong library

    I created a 2nd library in itunes and then inadvertantly added music files to it instead of to the original library. My original intent was to move files from the 1st library to the 2nd but I forgot we had added music that hadn't been scanned into itunes yet and when I hit "scan music" it started to add all those files to the new library, so now what?
    And how do I move the files I originally intended to move from the 1st library into the 2nd?

    Karen,
    There is not really such a thing as "move" in that context.  Get copies of any files that you wish to add to the 2nd library, and add them.  When you are sure that this has been correctly accomplished, then go into the 1st library and delete whatever you don't want to be there.

  • Inserting a associative array into a table

    Hi,
    I am working on a process where I want to store the temporary results in an associative array. At the end of the process I plan to write the contents of the array into a table that has the same structure. (the array is defined as a %rowtype of the table)
    Is it possible to execute ONE sql statement that transfers the array into the table? I am on 10g (10.2.0.4.0)
    Here's what I have now:
    declare
      type t_emp is table of emp%rowtype index by pls_integer;
      v_emp t_emp;
    begin
      -- a process that fills v_emp with lots of data
      for i in v_emp.first .. v_emp.last
      loop
        insert into emp values v_emp(i);
      end loop;  
    end;But it would be better if the loop could be replaced by sql one statement that inserts all of v_emp into emp. Is that possible?
    Thanks!
    PS: I'm not sure whether it's a good idea to use this approach... building a table in memory and inserting it into the database at the end of the process. Maybe it's better to insert every record directly into the table... but in any case I'm curious to see if it is possible in theory :)
    Edited: Added version info

    True, SQL cannot access the PL/SQL type.
    So you can not do something like this:
    insert into emp
    select * from table(v_emp)That is not possible.
    But FORALL is possible:
    FORALL i in v_emp.first .. v_emp.last
        insert into emp values v_emp(i);FORALL makes just one "round trip" to SQL bulk binding the entire contents of the array.
    It is much more efficient than the normal FOR loop, though it is mostly a PL/SQL optimization - even the FORALL actually inserts the rows "one at the time", it just hands the entire array to the SQL engine in one go.
    If the logic has to be done procedurally, FORALL is efficient.
    If the logic can be changed so arrays can be avoided completely and everything done in a single "insert into ... select ..." statement, that is the most efficient.

  • Load Source File Names into Recordset Object

    Hi,
    I have a folder with abc.txt, xyz.txt, pqr.txt etc files.
    My requirement is to load all the file names into a Record Set which I need to use in data flow.  I think I need to use For each loop container with Enumerator as 'Foreach File Enumerator' and in the variable mappings I have added a variable name
    to get the file name. But I have stuck how to add these file names to a Record Set target. Please help me.
    Thanks.

    Hi Amaya14,
    Go these this link Click Here
    Thanks

  • Refer to an object in Edge from an onclick="" in a .html file loaded into an iFrame in the animation

    HI, I am trying to figure out the Edge hierachies by stumbling my way through coding reference attempts. I've hit a wall...
    How can I refer to an object and a global function in my Edge animation from an onclick=""  located in an .html file loaded into an iFrame created within the master/parent Edge animation. Here's what I have...
    My main index.html is an Edge animation. One object <div> is a box created within Edge. I have added an iFrame with the Edge code:
    sym.$("MenuPanelScreen").html('<iframe src="list_images_cemetery.html" width="267" height="670" sandbox="allow-same-origin allow-scripts allow-top-navigation"></iframe>');
    That .html file which loads into the iframe within the animation contains thumbnails in <a> tags and contain onclick="" statements that should call a function within the Edge file.
    Eventually, I want the statements to read something like... onclick="changePic('Dragon.jpg', 'The Dragon', 'Saint and Worm')"
    However, I had no idea how to reference the changePic() function in the Edge animation. So, just to figure out how to reference the parent animation from an html in an iFrame, I change the onclick="" statements to...
    <a onclick="alert('Try to hide Nameplate'); sym.$('NamePlate_sym').hide();" >  <img src="gallery/TheyGaveUpTheirDead.jpg" width="80" alt="Angel and Worm" /></a>
    I first wanted to see if I could hide an Edge Symbol or div/element from the child html. I tried the following...
    onclick="alert('Try to hide Nameplate'); sym.$('NamePlate_sym', window.parent.document).hide();"
    I tried a few other variations that I won't bore you with. Can someone help me with the proper reference to effect an Edge element?
    Furthermore, I eventually wnat the onclick="" statement to reference a global function on attached to the Edge stage in the compositionReady event of the stage. The function is...
    window.changePic=function(myFileCurr, myLabelCurr, myDescriptionCurr) {
    alert("in changePick");
      document.getElementById("myImage").src="gallery/"+myFileCurr;
      document.getElementById("myImageLabel").innerHTML=myLabelCurr;
      document.getElementById("myImageDescr").innerHTML=myDescriptionCurr;
    I hope someone can point me in the right direction. Please forgive my ignorance. i am just getting back into coding and learning the intricacies of Jscript and jQuery. Thanks!

    Hi again Elaine,
    I actually had some success after many attempts with using your code. I can control the .stop() and .play() of the "NamePlate_sym" symbol. Yet, I am still having trouble doing anything else with it. I cannot .hide() it, nor use .html("Change text") on another element on the stage called"Rectangle". If I can accomplish that and all a global function on the stage, I'm in good shape.
    I placed the following script in the header of the .html file that gets loaded into the iFrame within the Edge composition:
      <script type="text/javascript">
       window.parent.AdobeEdge.bootstrapCallback(function(compId) {
       comp = window.parent.AdobeEdge.getComposition(compId).getStage();
       alert("CompID is "+compId);
       var symbol = document.createElement('div');
       symbol.innerHTML = 'Rotate';
       symbol.style.cssText = 'background-color:#fea; width: 50px; text-align: center;';
       symbol.style.cursor = 'pointer';
       symbol.onclick = function() {
        if (comp.getSymbol("NamePlate_sym").isPlaying()) {
         comp.getSymbol("NamePlate_sym").stop();
        else {
         comp.getSymbol("NamePlate_sym").play();
       window.parent.document.body.appendChild(symbol);
            </script>
    Once I put window.parent. in the first two lines of code and the last, my test worked. As I mentioned earlier though, I still can't get the syntax correct to .hide() an element (i.e. comp.getSymbol("NamePlate_sym").hide(); does not work), or more importantly, change the innerHTML value of an element on the stage. The code either does nothing or freezes.
    Thanks... Tommy

  • PSE 7 adding unmanaged files slow with video (.avi .mpg)

    I take mostly pictures (.jpg) with some video clips (.avi or .mpg) from my digicam. The files (pics and vids) are transfered from SD card into my managed folder structure. Then in PSE 7 i right click on the topmost folder of my managed folder structure and select Add Unmanaged Files to Orgainzer.  PSE then Searches for Files To Import by scaning through all of my files currently in the Organizer (i can tell by the displayed thumbs and paths). Pictures are processed very quickly but the import process REALLY bogs down on the video files. This process also generally crushes the responsiveness of my PC (i7, 6GB RAM, ATI 3450 128MB video card, Vista 64bit SP2) even when PSE isn't the active window. I have a CPU Usage sidebar gadget and none of the 8 'cores' are being taxed. In my collection I have according to PSE Organizer 231 video files out of 9359 total files (so 9128 are pics) and my last import took nearly an hour before I could tag the newly added files. In the interim my PC was unusable for other tasks. As the # of videos in my catalog has increased so has the time for the import because PSE for some reason has to deal with all the files already in the catalog on every import, including the troublesome video clips.
    What is going on with the Organizer when videos (.avi or .mpg) are being added? Why is it so slow on each video file and why does the adding of unmanaged files generally crush my system (its useless even when the import isn't dealing w/ a video)?
    For comparison Picasa 3 adds new files (both pics and vids) from my watched file structure automatically on startup very quickly and does not impact useability of my PC and I can even use Picasa while the files are being added. It all happens so fast and with no impact.

    I'm still curious if anyone has any insights on slow Adding of Unmanaged Files to Organizer.
    A new spin on this is after moving a number of files from my camera to disk folder system (via windows explorer) then starting PSE 7 some time later, PSE asked if I wanted to add files from watched folders to the organizer.  I selected No because I needed to do something else at that time and was afraid of the timeconsuming process i mentioned in my original post.  Now after subsequently exiting and restarting PSE with the intent of adding unmanaged files, PSE didn't ask if I wanted to perform this operation.  If No means no for this batch then there should also be an option that says 'Not Now' or 'Later'.

  • Divide an array into components

    Hello:
    I am developing a LV application that has, in some way, "two parts": One of them is the user interface and its associated block diagram, that receives values from controls and files. Then, this values are used for feeding the inputs of a "Call Library Function" node.
    Well, some of the values I use are components of an array. I thought that I could use a "Split array" block, but I cant connect the "1 component array" with the numerical input of the library node.
    How could I "convert" a "1 component array" into a "numerical value". I actually use a very improper method, I connect the "1 component" array to a "array max & min" block, and I use "max value" output (I could use min too, obviously).
    Another question that is related to this is the follwing: Is there any method in order to split an array into its numerical components? Because I have, for example, a 4 elements array, I wished to divide it (in an easy way, instead of having a "serial association" of 4 "split array" blocks) into 4 numerical values that are used for feeding a function node.
    Well, if you need any aditional info, please dont hesitate in ask for it. Thank you very much for your attention and please sorry for my bad english.
    Yours sincerely.
    Juan Crespo

    Juan,
    Apologies if I misunderstood, but is the 'Index Array' function the answer to both your questions?
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."
    Attachments:
    Index Array Elements.jpg ‏12 KB

  • 1-D Array into 2-D Array

    Hi: I need help on how to copy contents of a 1-D array into a 2-D array.
    For Example:
    int[] a = {0,1,2,3,4,5,6,7};
    into:
    int[][] b = {{0,1,2,3},{4,5,6,7}};
    Can someone please help me with ideas?
    Thanks

    So, how do I copy the content of an 1-d array ofsize
    say 8 into a 2-d array of size 2x4?By writing the appropriate code of course.
    (I know how to do it, but spoon-feeding it to youdoes you no good actually)
    If you already know how to do it, why re-inventing
    the wheel? If you do not want to suggest me, then
    don't say anything. It is not like I did not try
    anything; I tried it, but it did not work,So post what you tried and what results you saw. (As noted earlier, your previous code and output do NOT go together.)
    And why not try what I suggested--adding print statements so that you can actually unerstand what your code is doing?
    And/or step through the code manually as somebody else suggested?
    then only
    I posted the question on the forum to get some help
    from someone - not for telling me that someone knows
    the answer and he does not want to spoon-feed me.There's nothing to be gained by somebody handing you the answer. Most people come here to help others learn. Handing you the answer when you get stuck will simply stunt your education. You need to work through it yourself as much as possible, with a nudge here and there to get you going again when you get really stuck.

Maybe you are looking for