Help with inserting a list element in a Web page

Hello,
I�m a newbie. I want to introduce an element list in a web page. I have source that creates a List as a standalone application (with a main procedure..) , through the JList class, but I want this list to appear integrated in the web page. How could I do it? Could anyone give me any idea, URL, etc...??
Thanks,

as writte above: if it as simple as you wrote use something like this:
* (c) Copyright 2002 B. Braun Melsungen AG
* All Rights Reserved.
package domainrequest;
import java.io.*;
import java.util.*;
* implements the <select> form html element providing easy methods to fill the list of options and print the html source code
* @version      1.0
* @author          Erik Itter
public class HtmlListBox {
     ArrayList options = new ArrayList();//HashMap does not guarantee an order
     String name;
     public HtmlListBox(String Name){
          name=Name;
     public ArrayList getOptions(){
          return options;
     public String getOtptionName(String Value){
          for(int i=0;i<options.size();i++){
               if((((ListBoxOption)(options.get(i))) ).getValue()==Value){
                    return ((ListBoxOption)(options.get(i))).getName();
          return null;
     public int addOption(String Value,String Name){
          options.add(new ListBoxOption(Value,Name));
          return options.size();
     public void print(PrintWriter out){
          out.println("<select name=\""+name+"\">");
          for(int i=0;i<options.size();i++){
               out.println("<option value=\""+( (ListBoxOption)options.get(i) ).getValue()+"\">"+( (ListBoxOption)options.get(i) ).getName()+"</option>");
          out.println("</select>");
using
* (c) Copyright 2002 B. Braun Melsungen AG
* All Rights Reserved.
package domainrequest;
* This class' only reason for existence is to be abused
* (look at that code and you will understand...) by HtmlListBox
* implementing a single option's data fields.
* This is similar to the points and complex numbers they have in
* all those tutorials...
* @version      1.0
* @author          Erik Itter
public class ListBoxOption{
     String value;
     String name;
     * Constructs an option allowing to differ between the elements value and
     * the displayed representation
     public ListBoxOption(String Value,String Name){
          value=Value;
          name=Name;
     * Constructs an option taking the displayed name as value, too. Actually
     * this is the most common use but less helpfull for complex applications.
     public ListBoxOption(String Name){
          value=name=Name;
     * returns the option's value (could you imagine that...?)
     public String getValue(){
          return value;
     * returns the option's name. (...oh so predictable!)
     public String getName(){
          return name;
it is sufficient for the three tier intranet application i am developing for our company, since the code is trivial feel free to use it if you like

Similar Messages

  • Help inserting a flash video into my web page

    Hello!
    I'd love some help inserting a flash video into my web page. My web page is hosted by Viviti, templated, and edited online. I can add html to it, and I have the html source for my flash video. I also have uploaded the flash file to the server. Since I am very html illiterate, though, I need some help rewriting the html script so it can be published. There are two problems- firstly, no 'headers' or 'body' allowed in the script- these are already a part of the template. Secondly, I don't know how to rewrite it to refer to the uploaded files. It's also imperative that the full screen mode functions. I've pasted the source code for the flash video here. Please help!!!
    Thanks!
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Drag and drop labelling</title>
    <script language="JavaScript" type="text/javascript">
    <!--
    //v1.7
    // Flash Player Version Detection
    // Detect Client Browser type
    // Copyright 2005-2008 Adobe Systems Incorporated.  All rights reserved.
    var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
    var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
    var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
    function ControlVersion()
         var version;
         var axo;
         var e;
         // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
         try {
              // version will be set for 7.X or greater players
              axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
              version = axo.GetVariable("$version");
         } catch (e) {
         if (!version)
              try {
                   // version will be set for 6.X players only
                   axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                   // installed player is some revision of 6.0
                   // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
                   // so we have to be careful.
                   // default to the first public version
                   version = "WIN 6,0,21,0";
                   // throws if AllowScripAccess does not exist (introduced in 6.0r47)          
                   axo.AllowScriptAccess = "always";
                   // safe to call for 6.0r47 or greater
                   version = axo.GetVariable("$version");
              } catch (e) {
         if (!version)
              try {
                   // version will be set for 4.X or 5.X player
                   axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
                   version = axo.GetVariable("$version");
              } catch (e) {
         if (!version)
              try {
                   // version will be set for 3.X player
                   axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
                   version = "WIN 3,0,18,0";
              } catch (e) {
         if (!version)
              try {
                   // version will be set for 2.X player
                   axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
                   version = "WIN 2,0,0,11";
              } catch (e) {
                   version = -1;
         return version;
    // JavaScript helper required to detect Flash Player PlugIn version information
    function GetSwfVer(){
         // NS/Opera version >= 3 check for Flash plugin in plugin array
         var flashVer = -1;
         if (navigator.plugins != null && navigator.plugins.length > 0) {
              if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
                   var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
                   var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
                   var descArray = flashDescription.split(" ");
                   var tempArrayMajor = descArray[2].split(".");               
                   var versionMajor = tempArrayMajor[0];
                   var versionMinor = tempArrayMajor[1];
                   var versionRevision = descArray[3];
                   if (versionRevision == "") {
                        versionRevision = descArray[4];
                   if (versionRevision[0] == "d") {
                        versionRevision = versionRevision.substring(1);
                   } else if (versionRevision[0] == "r") {
                        versionRevision = versionRevision.substring(1);
                        if (versionRevision.indexOf("d") > 0) {
                             versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
                   var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
         // MSN/WebTV 2.6 supports Flash 4
         else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
         // WebTV 2.5 supports Flash 3
         else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
         // older WebTV supports Flash 2
         else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
         else if ( isIE && isWin && !isOpera ) {
              flashVer = ControlVersion();
         return flashVer;
    // When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
    function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
         versionStr = GetSwfVer();
         if (versionStr == -1 ) {
              return false;
         } else if (versionStr != 0) {
              if(isIE && isWin && !isOpera) {
                   // Given "WIN 2,0,0,11"
                   tempArray         = versionStr.split(" ");      // ["WIN", "2,0,0,11"]
                   tempString        = tempArray[1];               // "2,0,0,11"
                   versionArray      = tempString.split(",");     // ['2', '0', '0', '11']
              } else {
                   versionArray      = versionStr.split(".");
              var versionMajor      = versionArray[0];
              var versionMinor      = versionArray[1];
              var versionRevision   = versionArray[2];
                 // is the major.revision >= requested major.revision AND the minor version >= requested minor
              if (versionMajor > parseFloat(reqMajorVer)) {
                   return true;
              } else if (versionMajor == parseFloat(reqMajorVer)) {
                   if (versionMinor > parseFloat(reqMinorVer))
                        return true;
                   else if (versionMinor == parseFloat(reqMinorVer)) {
                        if (versionRevision >= parseFloat(reqRevision))
                             return true;
              return false;
    function AC_AddExtension(src, ext)
      if (src.indexOf('?') != -1)
        return src.replace(/\?/, ext+'?');
      else
        return src + ext;
    function AC_Generateobj(objAttrs, params, embedAttrs)
      var str = '';
      if (isIE && isWin && !isOpera)
        str += '<object ';
        for (var i in objAttrs)
          str += i + '="' + objAttrs[i] + '" ';
        str += '>';
        for (var i in params)
          str += '<param name="' + i + '" value="' + params[i] + '" /> ';
        str += '</object>';
      else
        str += '<embed ';
        for (var i in embedAttrs)
          str += i + '="' + embedAttrs[i] + '" ';
        str += '> </embed>';
      document.write(str);
    function AC_FL_RunContent(){
      var ret =
        AC_GetArgs
        (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
         , "application/x-shockwave-flash"
      AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
    function AC_SW_RunContent(){
      var ret =
        AC_GetArgs
        (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
         , null
      AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
    function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
      var ret = new Object();
      ret.embedAttrs = new Object();
      ret.params = new Object();
      ret.objAttrs = new Object();
      for (var i=0; i < args.length; i=i+2){
        var currArg = args[i].toLowerCase();   
        switch (currArg){     
          case "classid":
            break;
          case "pluginspage":
            ret.embedAttrs[args[i]] = args[i+1];
            break;
          case "src":
          case "movie":     
            args[i+1] = AC_AddExtension(args[i+1], ext);
            ret.embedAttrs["src"] = args[i+1];
            ret.params[srcParamName] = args[i+1];
            break;
          case "onafterupdate":
          case "onbeforeupdate":
          case "onblur":
          case "oncellchange":
          case "onclick":
          case "ondblclick":
          case "ondrag":
          case "ondragend":
          case "ondragenter":
          case "ondragleave":
          case "ondragover":
          case "ondrop":
          case "onfinish":
          case "onfocus":
          case "onhelp":
          case "onmousedown":
          case "onmouseup":
          case "onmouseover":
          case "onmousemove":
          case "onmouseout":
          case "onkeypress":
          case "onkeydown":
          case "onkeyup":
          case "onload":
          case "onlosecapture":
          case "onpropertychange":
          case "onreadystatechange":
          case "onrowsdelete":
          case "onrowenter":
          case "onrowexit":
          case "onrowsinserted":
          case "onstart":
          case "onscroll":
          case "onbeforeeditfocus":
          case "onactivate":
          case "onbeforedeactivate":
          case "ondeactivate":
          case "type":
          case "codebase":
          case "id":
            ret.objAttrs[args[i]] = args[i+1];
            break;
          case "width":
          case "height":
          case "align":
          case "vspace":
          case "hspace":
          case "class":
          case "title":
          case "accesskey":
          case "name":
          case "tabindex":
            ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
            break;
          default:
            ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
      ret.objAttrs["classid"] = classid;
      if (mimeType) ret.embedAttrs["type"] = mimeType;
      return ret;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!-- saved from url=(0013)about:internet -->
    <script language="JavaScript" type="text/javascript">
         AC_FL_RunContent(
              'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
              'width', '720',
              'height', '440',
              'src', 'Drag and drop labelling',
              'quality', 'medium',
              'pluginspage', 'http://www.adobe.com/go/getflashplayer',
              'align', 'middle',
              'play', 'true',
              'loop', 'true',
              'scale', 'showall',
              'wmode', 'window',
              'devicefont', 'false',
              'id', 'Drag and drop labelling',
              'bgcolor', '#ffffff',
              'name', 'Drag and drop labelling',
              'menu', 'true',
              'allowFullScreen', 'true',
              'allowScriptAccess','sameDomain',
              'movie', 'Drag and drop labelling',
              'salign', ''
              ); //end AC code
    </script>
    <noscript>
         <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="720" height="440" id="Drag and drop labelling" align="middle">
         <param name="allowScriptAccess" value="sameDomain" />
         <param name="allowFullScreen" value="true" />
         <param name="movie" value="Drag and drop labelling.swf" /><param name="quality" value="medium" /><param name="bgcolor" value="#ffffff" />     <embed src="Drag and drop labelling.swf" quality="medium" bgcolor="#ffffff" width="720" height="440" name="Drag and drop labelling" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
         </object>
    </noscript>
    </body>
    </html>

    What you basically need to do is copy the sections of content from the code you show into the template (assuming the template already provides the <head> and <body> sections of the page.  So in the head section of what you show, take everything starting with...
    <script language="JavaScript" type="text/javascript">
    all the way down thru...
    </script>
    , inclusive (in the head section only), and paste that into the head section of your template.
    Similarly, take everything that lies between the <body> ... </body> tags (exclusive of the body tags) and paste it into the body section of your template wherever you plan to display the Flash file.

  • Automatic listing of 'title' on web page

    I want each page title listed elsewhere on the web page. The
    template used to create the page should have a title variable
    listed so when I give the new page a title, it automatically is
    listed in the desired location, with proper CSS formating.

    darrel wrote:
    >> Sorry (darrel & Murray *ACE*) I seem to be such
    a dunce, but my coding
    >> skills
    >> are obviously not up to par. I do understand the
    requirement that I
    >> declare a
    >> variable BEFORE I use it, but I obviously don't have
    the procedure to do
    >> this
    >> correctly. Here is a new DW page with what I
    understand to be your
    >> instructions...
    >>
    >> <!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=iso-8859-1" />
    >> <!-- TemplateParam name="title" type="text"
    value="whatever" -->
    >> <title>Sample</title>
    >> </head>
    >> <body>
    >> <p>The title of this page is
    @@(title)@@.</p>
    >> </body>
    >> </html>
    >>
    >> All I did was change the title from 'Untitled
    Document' to 'Sample' and
    >> then
    >> preview it in a browser.
    >
    > I don't use DW parameters, so you might have to wait for
    Murray to respond.
    > But, that said, looking at what you have, that seems
    like it should work to
    > me. However, I would do it as such:
    >
    > <!-- TemplateParam name="title" type="text"
    value="whatever" -->
    > <title>@@(title)@@</title>
    > </head>
    > <body>
    > <p>The title of this page is
    @@(title)@@.</p>
    >
    > That way you only have to physically write the parameter
    once. In your first
    > example, if you ever wanted to change the title, you'd
    have to change it
    > both in the parameter AND in the TITLE tag.
    >
    > -Darrel
    >
    >
    <!-- TemplateParam name="title" type="text"
    value="whatever" -->
    what the heck is that...
    Dreamweaver templates... ew!!!
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • Help with downloaded purchases PS Elements 10 and Premiere Elements 10

    Unable to find downloadable copies of these 2 programs. I have a list from Adobe dated 2012 with serial numbers for both downloaded versions. Thank you for your help.

    Majorie6090
    Thanks for the reply.
    Are you doing the Premiere Elements 10 download and install with the antivirus and firewall(s) disabled?
    If yes and you are continuing to have problems with that message, start again, but this time do the
    downloading and installing from the web site cited in my earlier post.
    http://prodesigntools.com/photoshop-elements-10-direct-download-links-pse-premiere-pre.htm l
    Just read and carry out carefully the "Note: Very Important Instructions" on the web page and all will
    go well. After you get beyond that "Note: Very Important Instructions" part, you will have the opportunity
    to click on the two needed files shown on that web page (File 1: the .exe and File 2: the 7z the actual program).
    I am suspecting you are missing the .exe file which is prone to problems with Firewall(s).
    If you are not already, be sure to be selecting files the files that correspond to your computer operating system
    including 32 or 64 bit.
    Bottom line: If you want, try again in what you are doing with antivirus and firewalls disabled. If that
    does not work, then use the web site mentioned to get tryout Premiere Elements 10 installation files
    into which you insert your purchased serial number.
    We will be watching for your progress.
    Best wishes
    ATR

  • Help with inserting/removing integer from a specific index

    I have an IntList that I am adding methods to and an IntListTest driver that allows me to add those options to test. I am having difficulty adding the two methods:
    public void removeAt() - removes the value at a specified location at given index with consideration of the size of the list when user enters a valid position
    public void insertAt(int index, int newValue) - inserts integer and puts it in the specified index of list however...i also have to take into consideration the size of the list as the user enters a valid position
    I started on the insertAt(int index, int newValue) method:
    // **Inserts an element to the list at a specified position
    public void insertAt(int index, int newValue)
    IntNode newnode = new IntNode(newValue, null);
    for (int index =0; index < count; index++)
    if(list[index] == newValue) //error occurs, brackets pertain to arrays, correct?
    //if list is empty, this will be the only node in it
    if (list == null)
    list = newnode;
    else
    //temp point directed to the last thing on list, but want to be
    //able to insert any where, specified location
    IntNode temp = list;
    while (temp.next != null)
    temp = temp.next;
    //link new node into list and insert
    temp.next = newnode;
    count++;
    }First off, how do I write the method so that the user specifies a value at a given index and is located...From what I understand, this portion of the insertAt method is stating that the temp point will go directly to the last index:
    //temp point directed to the last thing on list, but want to be
    //able to insert any where, specified location
    IntNode temp = list;
    while (temp.next != null)
    temp = temp.next;Here's where I am having complications, because I don't know where to go from here. I want the method to be able to insert at any specified index rather than just the last...I will use the insertAt method as an example for my removeAt method, so hopefully I can get input from anyone willing to help...Thanks - using textpad editor with java 1.5 compiler
    Onip28

    Thanks for the reply - this is an assignment and I'm dealing with linked structures, I apologize for not specifying that. I have to add a total of six methods to the IntList class (e.g...public int length, String toSting, void removeLast, void search(int input), and the two mentioned - void insertAt(int index, int newValue), and void removeAt(int index)). I figured out the first two, but have had no luck with the remaining one. Here is a sample of that code -
    // FILE:  IntList.java
    // Purpose: Defines a class that represents a list of integers
    //Assignment 3 - methods to fill in, declare any variables where necessary
    public class IntList
        private IntNode list;          //first node in list
        private int currentSize;
        public int count;
        String [] elements;
        //  Constructor.  Initially list is empty.
        public IntList()
         list = null;
        //   Adds given integer to list of list.
        public void addToFront(int val)
         list = new IntNode(val,list);
         count++;
        //   Adds given integer to end of list.
        public void addToEnd(int val)
         IntNode newnode = new IntNode(val,null);
         //if list is empty, this will be the only node in it
         if (list == null)
             list = newnode;
         else
              //make temp point to last thing in list
              IntNode temp = list;
              while (temp.next != null)
                  temp = temp.next;
              //link new node into list
              temp.next = newnode;
             count++;
        //   Removes the first node from the list.
        //   If the list is empty, does nothing.
        public void removeFirst()
         if (list != null)
             list = list.next;
             count--;
         // **returns the number of elements in the list
         public int length()
              return count;
        // **returns a String containing the print value of the list.
         public String toString()
         StringBuffer result = new StringBuffer("{ ");
                     for (int i=0; i < currentSize; i++) {
                                 if (i > 0)
                                     result.append(", ");
                         result.append(elements);
         result.append(" }");
              return result.toString();
         // **removes the last element of the list. If the list is empty, does nothing.
         //public void removeLast()
    //Come back to this...
         // **searches all occurrences of a value user enters in the list.
         //public void search(int input)
    //Come back to this...
         // **Inserts an element to the list at a specified position
         public void insertAt(int index, int newValue)
         IntNode newnode = new IntNode(newValue, null);
         for (int index =0; index < count; index++)
              if(list[index] == newValue)     //error occurs, brackets pertain to arrays, correct?
    //if list is empty, this will be the only node in it
         if (list == null)
         list = newnode;
         else
    //temp point directed to the last thing on list, but want to be
    //able to insert any where, specified location
         IntNode temp = list;
              while (temp.next != null)
              temp = temp.next;
    //link new node into list and insert
              temp.next = newnode;
              count++;
         // **Deletes an element from the list at a specified position
         public void removeAt(int index)
    //Come back to this...
    // Prints the list elements from first to last.
    public void print()
         System.out.println("---------------------");
         System.out.print("List elements: ");
         IntNode temp = list;
         while (temp != null)
              System.out.print(temp.val + " ");
              temp = temp.next;
         System.out.println("\n---------------------\n");
    // An inner class that represents a node in the integer list.
    // The public variables are accessed by the IntList class.
    private class IntNode
         public int val; //value stored in node
         public IntNode next; //link to next node in list
    // Constructor; sets up the node given a value and IntNode reference
         public IntNode(int val, IntNode next)
         this.val = val;
         this.next = next;
    But as stated, my problem is merely the portion where the the I make adjustments to the "next values" in the associated nodes...
    //temp point directed to the last thing on list, but want to be
    //able to insert any where, specified location
         IntNode temp = list;
              while (temp.next != null)
                  temp = temp.next;I apologize if I am not answering your question correctly but I'm trying to make sense of all this, but need some suggestions/input/advice...Thx.
    Regards, Onip28

  • Need Help with Inserting Timeline Markers

    Friends,
    I have not use my premiere element 3.2 since 2008 and forgot some of the procedures. now, I need help with the insertion of Timeline Markers. I did what the Help Page showed me. But the markers were not effective in the resulting DVD, or, even when viewing the video in the editing page as if thye were not there! Here is what I did:.
    1)  Click the Timeline button.
    2)  Click in an empty space in a video or audio track in the Timeline to make the Timeline active and deselect any clips.
    3)  Move the current-time indicator in the Timeline to the frame where I need the marker.
    4)  Click the Add Marker icon in the Timeline to place the Marker 5 times where I want them.
    5)  Verified that each Timeline Marker is present at the intended place.
    6)  Burned DVD
    7)  Can NOT jump to any of the intended Marker in the Resulting DVD during playback.
    The question is "What did I do wrong or didn't do?" It seems that I did the same before and worked! Please advise!
    Also, what are the significance of the Red line just below the Timeline and the yellow bars inside the video and audio frames. But after preforming Timeline/Render Work Area, they were all gone? What purposes do they serve and what is the significance of Rendering? Thank you for your help!
    I repeat the process and did a Rendering before making the DVD also. It did not help!
    Andy Lim

    Steve,
    Long time no talk! You used to help me out many times when the PE-1 through PE-3 came out. I was HOPING you would still be around and you are! You came through again this time! Many thanks to you.
    I use the Add DVD Scene button to insert the Markers. They are Green. Made a DVD and the markers work OK although ythey are "effective" during play back using the editing window.
    While that problem was solved, will you come back and answer the other two questions concerning Rendering and the Red/Yellow lines? I would appreciate it very much!
    Andy Lim
    ~~~~~~~~~~~~~~~~

  • I need help with circular linked list

    Hi,
    I need help with my code. when I run it I only get the 3 showing and this is what Im supposed to ouput
    -> 9 -> 3 -> 7
    empty false
    9
    empty false
    3
    -> 7
    empty false
    Can someone take a look at it and tell me what I'm doing wrong. I could nto figure it out.
    Thanks.This is my code
    / A circular linked list class with a dummy tail
    public class CLL{
         CLLNode tail;
         public CLL( ){
              tail = new CLLNode(0,null); // node to be dummy tail
              tail.next = tail;
         public String toString( ){
         // fill this in. It should print in a format like
         // -> 3 -> 5 -> 7
    if(tail==null)return "( )";
    CLLNode temp = tail.next;
    String retval = "-> ";
         for(int i = 0; i < -999; i++)
    do{
    retval = (retval + temp.toString() + " ");
    temp = temp.next;
    }while(temp!=tail.next);
    retval+= "";}
    return retval;
         public boolean isEmpty( ){
         // fill in here
         if(tail.next == null)
              return true;
         else{
         return false;
         // insert Token tok at end of list. Old dummy becomes last real node
         // and new dummy created
         public void addAtTail(int num){
         // fill in here
         if (tail == null)
                   tail.data = num;
              else
                   CLLNode n = new CLLNode(num, null);
                   n.next = tail.next;
                   tail.next = n;
                   tail = n;
         public void addAtHead(int num){
         // fill in here
         if(tail == null)
              CLLNode l = new CLLNode(num, null);
              l.next = tail;
              tail =l;
         if(tail!=null)
              CLLNode l = new CLLNode(num, null);
              tail.next = l;
              l.next = tail;
              tail = l;
         public int removeHead( ){
         // fill in here
         int num;
         if(tail.next!= null)
              tail = tail.next.next;
              //removeHead(tail.next);
              tail.next.next = tail.next;
         return tail.next.data;
         public static void main(String args[ ]){
              CLL cll = new CLL ( );
              cll.addAtTail(9);
              cll.addAtTail(3);
              cll.addAtTail(7);
              System.out.println(cll);          
              System.out.println("empty " + cll.isEmpty( ));
              System.out.println(cll.removeHead( ));          
              System.out.println("empty " + cll.isEmpty( ));
              System.out.println(cll.removeHead( ));          
              System.out.println(cll);          
              System.out.println("empty " + cll.isEmpty( ));
    class CLLNode{
         int data;
         CLLNode next;
         public CLLNode(int dta, CLLNode nxt){
              data = dta;
              next = nxt;
    }

    I'm not going thru all the code to just "fix it for you". But I do see one glaringly obvious mistake:
    for(int i = 0; i < -999; i++)That says:
    1) Initialize i to 0
    2) while i is less than -999, do something
    Since it is initially 0, it will never enter that loop body.

  • Need help with INSERT and WITH clause

    I wrote sql statement which correctly work, but how i use this statment with INSERT query? NEED HELP. when i wrote insert i see error "ORA 32034: unsupported use of with clause"
    with t1 as(
    select a.budat,a.monat as period,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    c.wrbtr,
    c.matnr,
    c.menge,
    a.monat,
    c.zuonr
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='D'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,t2 as(
    select a.BUKRS,a.BELNR, a.GJAHR,t1.vtweg,t1.budat,t1.monat from t1, ldw_v1.bkpf a
    where t1.zuonr=a.xblnr and a.blart='WL' and bukrs='8431'
    ,tcogs as (
    select t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    sum(bseg.wrbtr) as COGS,bseg.matnr,bseg.kunnr,sum(bseg.menge) as QUANTITY
    from t2, ldw_v1.bseg
    where t2.bukrs=bseg.bukrs and t2.belnr=bseg.BELNR and t2.gjahr=bseg.gjahr and BSEG.KOART='S'
    group by t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    bseg.matnr,bseg.kunnr
    ,t3 as
    select a.budat,a.monat,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    case when c.shkzg='S' then c.wrbtr*(-1)
    else c.wrbtr end as NTS,
    c.matnr,c.kunnr,
    c.menge*(-1) as Quantity
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='S'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,trevenue as (
    select t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,
    sum(t3.NTS) as NTS,t3.matnr,t3.kunnr,sum(t3.QUANTITY) as QUANTITY
    from t3
    group by t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,t3.matnr,t3.kunnr
    select NVL(tr.budat,tc.budat) as budat,
    NVL(tr.monat,tc.monat) as monat,
    NVL(tr.vtweg,tc.vtweg) as vtweg,
    NVL(tr.gjahr, tc.gjahr) as gjahr,
    tr.hkont as NTS_hkont,
    tc.hkont as COGS_hkont,
    NVL(tr.prctr,tc.prctr) as prctr,
    NVL(tr.MATNR, tc.MATNR) as matnr,
    NVL(tr.kunnr, tc.kunnr) as kunnr,
    NVL(tr.Quantity, tc.Quantity) as Quantity,
    tr.NTS as NTS,
    tc.COGS as COGS
    from trevenue TR full outer join tcogs TC
    on TR.BUDAT=TC.BUDAT and TR.MONAT=TC.MONAT and TR.GJAHR=TC.GJAHR
    and TR.MATNR=TC.MATNR and TR.KUNNR=TC.KUNNR and TR.QUANTITY=TC.QUANTITY
    and TR.VTWEG=TC.VTWEG and TR.PRCTR=TC.PRCTR
    Edited by: user13566113 on 25.03.2011 5:26

    Without seeing what you tried it is hard to say what you did wrong, but this is how it would work
    SQL> create table t ( n number );
    Table created.
    SQL> insert into t
      2  with test_data as
      3    (select 1 x from dual union all
      4     select 2 x from dual union all
      5     select 3 x from dual union all
      6     select 4 x from dual)
      7  select x from test_data;
    4 rows created.
    SQL>

  • Help with creating a list

    I query id values from one of my table.
    I need to come up with a list that looks like:
    id='123' OR id='234' OR id='002' OR id='345' OR id='435'
    I came up with 123,234,002,345,435 and '123' , '234' , '002' , '435' and also '123' OR '234' OR '002' OR '435'
    but very frustrated with putting id= on each list element to come up with id='123' OR id='234' OR id='002' OR id='345' OR id='435'
    Can anyone think of a technique to create such a list dynamically from a query result?
    Thanks!

    You could create a user defined function that converts a comma delimited list of values into one formatted with id's and OR's.
    Here is a quick sample which has NOT been tested.
    <cffunction name="customFormatOrList" returntype="string" output="no" hint="Converts comma delimited list to OR query string">
        <cfargument name="inputList" type="string" required="yes" hint="Comma delimited list" />
        <cfset var local=StructNew() />
        <cfset local.resultString="" />
        <cfloop list="#arguments.inputList#" index="local.idx">
            <!--- add 'OR' if this is not the first item --->
            <cfif Len(local.resultString) gt 0>
                <cfset local.resultString="#local.resultString# OR " />
            </cfif>
            <cfset local.resultString="#local.resultString#id='#local.idx#'" />
        </cfloop>
        <cfreturn local.resultString />
    </cffunction>

  • Help with UL navigation list

    Hello all, I need some help with a left navigation menu I
    have created, you can see the code below:
    the problem I have is when I am putting a link to the UL it
    doesn't work ( probably because I have a background image in my
    CSS) i was wondering if I can do it with another way..
    css code
    .treemenu {
    margin : 0px 20px;
    padding : 10px;
    list-style : none;
    width : 200px;
    .treemenu ul {
    list-style : none;
    margin : 0px 5px;
    padding : 0px 5px;
    .treemenu li {
    display : inline;
    .treemenu a {
    display : block;
    padding-left : 0px;
    text-decoration : none;
    .treemenu .treeopen {
    background-image : url('../img/open.gif');
    background-repeat : no-repeat;
    background-position : left;
    .treemenu .treeclosed {
    background-image : url('../img/closed.gif');
    background-repeat : no-repeat;
    background-position : left;
    UL

    Hello all, I need some help with a left navigation menu I
    have created, you can see the code below:
    the problem I have is when I am putting a link to the UL it
    doesn't work ( probably because I have a background image in my
    CSS) i was wondering if I can do it with another way..
    css code
    .treemenu {
    margin : 0px 20px;
    padding : 10px;
    list-style : none;
    width : 200px;
    .treemenu ul {
    list-style : none;
    margin : 0px 5px;
    padding : 0px 5px;
    .treemenu li {
    display : inline;
    .treemenu a {
    display : block;
    padding-left : 0px;
    text-decoration : none;
    .treemenu .treeopen {
    background-image : url('../img/open.gif');
    background-repeat : no-repeat;
    background-position : left;
    .treemenu .treeclosed {
    background-image : url('../img/closed.gif');
    background-repeat : no-repeat;
    background-position : left;
    UL

  • Help with XMLSEQUENCE and repeating elements

    I need help with the following XML extraction (note this is on Oracle9i). I have the following XML structure. There are multiple <Reading> elements
    <MeterReadings>
    <MeterReading>
    <Meter>
    <id>0004128190</id>
    <idType>METER_X_UNIVERSAL_ID</idType>
    </Meter>
    <Premise>
    <id>PREM4128190</id>
    <idType>X_CLIENT_PRMSE_ID</idType>
    </Premise>
    <Reading>
    <value>11111</value>
    <readingTypeId>CKWH</readingTypeId>
    </Reading>
    <Reading>
    <value>22222</value>
    <readingTypeId>KWHP</readingTypeId>
    </Reading>
    </MeterReading>
    </MeterReadings>
    I want to return one row for each <reading> element, including all its sub-elements - <value> and <readingTypeId>
    So, for the above data set, I would like to get back something like this. The parent elements can be repeated.
    <meter/id>,<Premise/id>,<Reading/value>,<Reading/readingTypeId>
    0004128190,PREM4128190,11111,CKWH
    0004128190,PREM4128190,22222,KWHP
    I have tried to use the XMLSequence function like this:
    select extractvalue(i.xml_message,'MeterReadings/MeterReading/Meter/id'),
    extractvalue(value(p),'value'), extractvalue(value(p),'readingTypeId')
    from myTable i,
    table(XMLSequence(
    extract(i._xml_message, '//Reading/*' ))) p
    But then I get results like this, where each sub-element results in a new row:
    0004128190     11111     null
    0004128190     null     CKWH
    0004128190     22222     null
    0004128190     null     KWHP
    What would be the proper XQuery?
    Thanks!

    This may help:
    http://www.dreamweaverresources.com/tutorials/pagebackgrounds/examplevert.htm
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    http://www.csstemplates.com.au
    http://www.perrelink.com.au
    CSS Tutorials for Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/css.html
    "teamkombat" <[email protected]> wrote in
    message
    news:ept196$d1g$[email protected]..
    > Hi I am trying to create a very simple effect where my
    page casts a
    > shadow. If
    > you take a look at
    http://www.timberland.com/home/index.jsp
    the left and
    > right
    > side of the page has a very light shadow. I would like
    to use a similar
    > effect. What I was thinking was to create 2 small .gifs
    with the shadow
    > effect
    > (1 for the left side and 1 for the right side) maybe
    10px long. Then
    > create 1
    > table with 3 columns: The middle collumn will be the
    main column for the
    > content and 2 thin/small columns on the left and right
    to attach the
    > shadow
    > .gifs.
    >
    > I was wondering how do I repeat this shadow .gif image
    for the length of
    > the
    > main column?
    >
    > Also if there is a better solution to the above problem
    please let me
    > know. I
    > have read about faux columns and using CSS for repeating
    images, but don't
    > really grasp the ideas yet. Thanks everyone for their
    time and help.
    >
    >

  • Help with sorting a list

    Hi,
    can anyone help me with sorting of a list by date?
    I have like 5 objects in the list, 4 are string and one is list.
    I want to sort them by Date..
    How can I do that?
    I don't know if I can use CompateTo?? I am new to programing, I would appreciate if anyone can explain with sample code.
    Your help is appreciated.

    ASH_2007 wrote:
    Hey thanks for your response, but there is a little problem with what I said earlier.
    Actually my List is a type of record (it's called Employee record)
    Here what exactly I have:
    for Iint i=0; i< employeeRecord.getList().size(); i++)
    EmployeeRecord emp = employeeRecord.getList().get(i);
    //so if I can not hold my date information in an object, coz it's says type mismatch
    //I am not sure how can I do this?
    }Can you please help with sample code?
    Thanks tonsEither cast or learn about generics. Also, use an Iterator or a foreach loop, NOT get(i).
    [Collections tutorial|http://java.sun.com/docs/books/tutorial/collections/]
    [Generics intro|http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html]
    [Generics tutorial|http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf]
    Foreach

  • Help with inserting SWF file into .html page

    I created a photo gallery in Flash CS5.5, using the advanced photo gallery template. It works fine as a standalone SWF file but it's not displaying properly when I try and insert it into the Gallery page of my website.
    The thumbnails are showing as blank white boxes and the main image holder isn't showing at all, though the controls beneath it are showing. The SWF file and all the images are stored in site/images/gallery/ and my Gallery page is in the root. What's going on here? Can anyone help please?
    Thanks

    If you are storing any of your Flash assets in sub-folders and having problems... it's most likely because of pathing problems. For review:
    Pathing issues
    Almost always when it works on the local machine and not the server, it's a pathing problem.
    You can put your Flash related files in whatever folders you want, they do NOT have to be in the root, they do NOT all have to be in the same folder. But if you have a problem and if sticking them all in the root folder works, then you know that the issue was a pathing problem.
    Just remember that paths used in the .swf become relative to the Web page on which the .swf is placed, NOT it’s physical location.  So for example, if your .swf is in the flash/data folder and you use that .swf on a Web page in the root folder, you are in effect, removing that .swf from flash/data and putting it in root. So if the .swf is loading any related files (xml, images, video, etc), the path used inside the .swf to load the .xml file has to be relative to it's new location in root and then back down into flash/data. This is true even though when testing the .swf by itself, it can be inside flash/data and work just fine, since relative to it's location, the path is just fine, they are in the same folder. But if that same path is used when the .swf is placed on a page two folder levels up, the relative path has changed, the old "same folder" path will not work.
    In fact if you are placing the .swf on a web page in a different folder than the .swf is stored in, and that .swf calls external assets, then direct clicking and opening of the .swf in it’s folder should NOT work! That’s because the paths to the external assets should be relative to the Web page and not the physical location of the .swf.
    So just be sure that you use addresses relative to the final Web page locations (not physical file locations) and you can put the Flash related files in what ever folders you want.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com
    What it boils down to is that you need to path the Flash assets from the Web page that you place the main .swf on... NOT the physical location of the .swf
    Best wishes,
    Adninjastrator

  • Help with inserting values -- ORA-00984 error

    Hello!
    This time we have a problem with inserting values and we really can't find what's wrong!
    The table was created as such
    CREATE TABLE PASSAGER
    (NO_PERSONNE INTEGER,
    NO_PASSAGER INTEGER NOT NULL,
    NO_PASSEPORT INTEGER NOT NULL,
    NATIONALITE VARCHAR2(30) NOT NULL,
    LIEU_EMISSION VARCHAR2(30) NOT NULL,
    DATE_EMISSION DATE NOT NULL,
    NO_TEL INTEGER,
    NO_CC INTEGER,
    NO_VENTE INTEGER NOT NULL,
    CONSTRAINT PK_PASSAGER PRIMARY KEY (NO_PERSONNE),
    CONSTRAINT FK_PASSAGER_PERSONNE FOREIGN KEY (NO_PERSONNE) REFERENCES PERSONNE (NO_PERSONNE),
    CONSTRAINT FK_PASSAGER_VENTE FOREIGN KEY (NO_VENTE) REFERENCES VENTE (NO_VENTE));
    We created a sequence..
    CREATE SEQUENCE NOPASS_SEQ
    START WITH 1
    INCREMENT BY 1
    NOCACHE
    NOCYCLE;
    for inserting the values, we did...
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, WT456789,'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);
    but it won't work, it's our last table and all the other worked perfectly!
    Thanks a ton!

    In your table creation, you got third column as
    NO_PASSEPORT INTEGER NOT NULL,
    where as you are passing varchar values (see bold)
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, WT456789,+'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);
    Should be like this I suppose
    INSERT INTO PASSAGER VALUES (500,NOPASS_SEQ.NEXTVAL, *456789*,'CANADIENNE', 'CANADA', to_date('2007/10/12','YYYY/MM/DD'),5142348756,5157981500126734,1);

  • Help with exporting Deski to text file via Web Intelligence

    We are currently converting from BO version 5 to BO XI rev2. I have a report that must be scheduled to a flie in plain text format. I am using a deski report. When I save as to text, the file is fine. When I schedule it in webi, the file seems to be missing the end of line character for each row in the table, so it cannot be used for an import to another program. Can anybody help with this?-

    well, in that case you need to determine if this issue only happens with a perticular report or all of them, if it happens only with reports imported from 5.x or with newly created reports as well.
    Looks like it is happening only when report is exported from Infoview, not in the Deski client. This might indicate a problem at the Web Apllication server (tomcat or one you use).
    If this issue is happening with any report - it might be a bug. In that case you have no options as there are no more patches for XIR2.
    On the other hand - if all you need is to extract data for consumption in another tool , why not use Data integrator instead ?
    Also, if this desn't work in Deski - does it work if you convert your reports to webi and export from those ?

Maybe you are looking for