Help with a ramdom word selection

Hello everyone.
I'm trying to write a ramdom word program using a arraylist.
I'm NOT a student, I'm doing this as a fun project and to learn how to use ramdom method..
code is below.
class WordClass1 {
    private String wd_id;
    private String word_name;
    public WordClass1(String id) {
          wd_id = id;
    public WordClass1(String id, String Wd) {
         this.wd_id = id;
         this.word_name = Wd;
    // accessors
    public String getWd_id() {return wd_id;}
    public String getWord() {return word_name;}
public String toString() {
    return "(" + wd_id  + word_name + ")";
}//close class Person class
public class HangmanWords {
    static ArrayList<WordClass1> arlist;
    static Scanner kbd;
    public static WordClass1 makePerson() {
        WordClass1 temp = null;
        // prompt for data
        String id;
        String Wd;
System.out.print("Enter ID Number ==>");
id = kbd.next();
        System.out.print("Enter Last Name ==>");
        Wd = kbd.next();
        // make an object
        temp = new WordClass1(id, Wd);
        return temp;
    public static void main(String[] args) {
         // make array list object
          List < WordClass1 > arlist = new ArrayList < WordClass1 > ();
          arlist.add(new WordClass1("A1", "STRING"));
          arlist.add(new WordClass1("A2", "PERSON"));
          arlist.add(new WordClass1("B1", "CLASS"));
          arlist.add(new WordClass1("B2", "JAVA"));
         System.out.println(arlist);
        // make a scanner
        kbd = new Scanner(System.in);
        int choice;
          System.out.println("Make a Section: ");
          System.out.println("1. Enter Word ");
          System.out.println("2. Get the word ");
          System.out.println("3. Exit this Program ");
          System.out.print("\nPlease press Enter afer each response");
          System.out.println("\nEnter your choose please: ");
          choice = kbd.nextInt();
          kbd.nextLine();
          if (choice == 1) { // if 1 is select
        }// close while loop
        if (choice == 2) { // if 2 is select go to find
             int randomIndex = Math.abs(((Iterator<String>) arlist).next()getWord.length());
          if (choice == 3) {
               System.out.printf("Good bye");
          }// close the choice == 3
        // print out all elements of array list
        for (WordClass1 idx : arlist) {
             System.out.printf("Employee here are the list of all Employees Empoyeed");
             System.out.printf("Employee Id is %s%n", idx.getWd_id());
                System.out.printf("Name is %s  %s%n", idx.getWord());
                System.out.println("--------------------");
        }//close for loop
}//close main
}//close public classmy problem lies here in which I'm trying to get the word selected.
int randomIndex = Math.abs(((Iterator<String>) arlist).next()getWord.length());Any help would be great.
PS this code is for a hangman game.
nomad

A couple of suggestions:
1) You've got a nice WordClass1. Good to see some OOP going on. Why not do the same for HangmanWords class? Why not change the arraylist from a static variable to an instance variable? You can initialize it in the constructor. You then could create a third class: HangmanDriver that has your main. Think encapsulation.
2) arlist I hate to say it is a terrible name for a variable. It tells you what kind of data structure the data is in, something that could easily change in the future, but doesn't tell anything about what kind of data is contained in it. It would be better to call it something else, perhaps hangmanWords or wordList or somesuch thing.
3) try to encapsulate your user interface (I/O) routines into their own class. If you really get this program going, you're going to want to translate it from console to Swing GUI. Why not build it from the ground up in a way that would make this transition easy.
Here's one way the HangmanWords could look:
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
* encapsulates my hangman word list
* If I make this class implement the Iterable
* interface, I can loop through it more readily.
* @author petes1234
public class HangmanWords implements Iterable<WordClass1>
    private List<WordClass1> wordList;
    private Random rand;
    public HangmanWords()
        wordList = new ArrayList<WordClass1>();
        rand = new Random();
    public boolean add(WordClass1 word)
        return wordList.add(word);
    public boolean remove(WordClass1 word)
        return wordList.remove(word);
    public WordClass1 get(int i)
        return wordList.get(i);
    public WordClass1 getRandom()
        int randomIndex = rand.nextInt(wordList.size());
        return get(randomIndex);
    // this is all we need to implement the Iterable interface
    public Iterator<WordClass1> iterator()
        return wordList.iterator();
}

Similar Messages

  • IOS Cangjie input method can not be used. Original with Space Bar word selection function is invalid, as soon as possible to solve, it will affect the most users in Taiwan and Hong Kong.

    iOS Cangjie input method can not be used. Original with Space Bar word selection function is invalid, as soon as possible to solve, it will affect the most users in Taiwan and Hong Kong.

    No PR1.2 Firmware update, No update for Nokia Messaging, No updates for Ovi Maps .... Why is the N900 the forgotten stepchild ?
    "PR1.2 is still being tested - http://twitter.com/luovanto/statuses/13087245356"
    Hong Kong Launch http://www.youtube.com/watch?v=pY8zCBzvQLo

  • HELP WITH PDF TO WORD DOC

    pLEASE HELP WITH CONVERTING A PDF REPORT TO A WORD DOC WHERE i CAN MAKE CHANGES AND PRINT A NEW REPORT.

    Hi Christine,
    It looks like you have a subscription to our ExportPDF service. Follow the steps in our Getting Started Guide to convert your PDF to Word: http://forums.adobe.com/docs/DOC-2412
    You should be able to edit your file in Word after the conversion.
    -David

  • Help with a tabel word wrap

    Hi
    Any one help me please below is the html I have. its reading
    a .js file from an external source. The problem is word wrapping
    the content I need to make the conten wrap with in this table as i
    have no control of how the external content is constructed.
    Any help please.
    <table width="100%" border="0" cellpadding="0"
    cellspacing="0" id="PARA2">
    <tr>
    <td><script language="JavaScript"
    type="text/javascript" src="
    http://www.domain.net/p2.js"></script></td>
    </tr>
    </table>

    anyone not help with this please

  • Newbie: help with join in a select query

    Hi: I need some help with creating a select statement.
    I have two tables t1 (fields: id, time, cost, t2id) and t2 (fields: id, time, cost). t2id from t1 is the primary key in t2. I want a single select statement to list all time and cost from both t1 and t2. I think I need to use join but can't seem to figure it out even after going through some tutorials.
    Thanks in advance.
    Ray

    t1 has following records
    pkid, time, cost,product
    1,123456,34,801
    2,123457,20,802
    3,345678,40,801
    t2 has the following records
    id,productid,time,cost
    1,801,4356789,12
    2,801,4356790,1
    3,802,9845679,100
    4,801,9345614,12
    I want a query that will print following from t1 (time and cost for records that have product=801)
    123456,34
    345678,40
    followed by following from t2 (time and cost for records that have productid=801)
    4356789,12
    4356790,1
    9345614,12
    Is this possible?
    Thanks
    ray

  • Help with working on Word files that were created in Framemaker and saved as PDF

    Please help. I was given a pdf from a vendor that they created in Framemaker. The pdf was 2+MB. I saved it as a Word doc so I could delete sections that I don't need for our folks but the file is saving at over 20MB (after I deleted a lot of pages from it). It is so large that I cannot even email it. I've tried to zip it and also convert it back to a pdf and in both cases the file only decreases by a few hundred KB while still leaving it over 20+MB. Any idea how I can work this file to take the sections I need without it creating such a large file size? Thank you. Brian

    The contractual requirements between the vendor and your company may be the key. The contract may or may not discuss whether the vendor's permission to modify the material includes an obligation to make the documents usable. "Usable" may be construed to mean providing original files. If the vendor is required to provide originals, they may or may not be required to provide them in a common format, like MS Word, rather than the proprietary FrameMaker format they use. Their providing a PDF may completely satisfy their obligation; your lawyers may be helpful here.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    bmr0330 wrote:
    I did ask them for the source file but they haven't been forthcoming with that. I may look into the evaluation copy of FM anyway but considering the price ($868 USD through our catalogue supplier) I doubt I would be able to get a licensed copy once the evaluation runs out. I do appreciate the suggestion though. Thank you. Brian

  • Creating F4 help with customized values in selection screen

    Hi  Dear friends
             In my report  i have two input flds at selection screen i.e. sales order no and date description.Now based on sales order no the F4 help in the fld date description should change dynamically.eg. if there are two sales document number 001 and 002 and the corresponding date description for 001 are 123 and 234 and for 002 are 987 and 876 .Then if i select 001 the F4 help in date description should contain 123,234 and for 002 it should contain 987,876 before pressing the execute button.How to achieve this. Plz help me. i tried to use AT-SELECTION SCREEN ON VALUE REQUEST event but its not giving any out put as in the SELECT query i putted a WHERE condition where sales document of the database table equals to the sales order inserted in the selection screen. But when i debugg the input sales order parameter shows blank.

    Try this way
    REPORT ZVENKAT_F4_FOR_PARAMETERS MESSAGE-ID zmsg .
    TYPES:
       BEGIN OF t_t001w,
         werks       TYPE t001w-werks,
         name1       TYPE t001w-name1,
       END OF t_t001w,
       t_return_tab  TYPE ddshretval.
    DATA:
        w_t001w      TYPE t_t001w,
        w_return_tab TYPE t_return_tab.
    DATA:
        i_t001w      TYPE STANDARD TABLE OF t_t001w,
        i_return_tab TYPE STANDARD TABLE OF t_return_tab.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS :p_werks TYPE t001w-werks,
                p_name1 TYPE t001w-name1.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
      PERFORM f4_help_for_palant.
    *&      Form  f4_help_for_palant
    FORM f4_help_for_palant.
      DATA:
          w_dynpfields TYPE dynpread,
          i_dynpfields LIKE STANDARD TABLE OF dynpread.
      IF i_t001w[] IS INITIAL.
        SELECT werks name1
        FROM t001w
        INTO TABLE i_t001w.
      ENDIF.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
        retfield               = 'WERKS'
        dynpprog               = sy-repid
        dynpnr                 = sy-dynnr
        dynprofield            = 'P_WERKS'
       value_org              = 'S'
        TABLES
          value_tab              = i_t001w
        return_tab             = i_return_tab.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE i_return_tab INTO w_return_tab INDEX 1.
      p_werks = w_return_tab-fieldval.
      READ TABLE i_t001w INTO w_t001w WITH KEY werks = p_werks.
      IF sy-subrc = 0.
        w_dynpfields-fieldname    = 'P_NAME1'.
        w_dynpfields-fieldvalue   = w_t001w-name1.
        APPEND w_dynpfields TO i_dynpfields.
        CLEAR w_dynpfields.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = sy-repid
            dynumb               = sy-dynnr
          TABLES
            dynpfields           = i_dynpfields.
      ENDIF.
    ENDFORM.                    " f4_help_for_palant
    Thanks
    Venkat.O

  • [SOLVED :)] Need help with adf table row selection

    Hi,
    In my application I am displaying results in a table. The DisplayRow property of table is set to Selected
    There are Next and Back buttons which help user to view details associated to the next/previous rows.
    I am using ADF 11g
    When user clicks Next or Previous button, then the selection of the row should also gets updated
    To achieve this i wrote below piece of code:
    this.tblS.getSelectedRowKeys().clear();+
    this.tblS.setRowIndex(count);+
    RowKeySet rks =  tblS.getSelectedRowKeys();+
    rks.add(tblS.getRowKey());+
    rks =  tblS.getSelectedRowKeys();+
    ISSUE:_
    When i run application and click Next/Previous Button, all functionalities do take place properly, but a null pointer exception is also thrown._+
    If i remove DisplayRow property of table from Selected to Default, every thing works good and no Exception is thrown_+       
    But as records in my table are going to be around 50-60 everytime, i need to set DisplayRow property of table to Selected.
    Is there any way to achieve this? Solve this problem?
    Some more details:_
    I am using a POJO class to create DataController. This DataController is having a view Object which is used to create results table.
    I have defined Primary key for my POJO Data Controller.
    Here is code of xml file:*
    +<?xml version="1.0" encoding="UTF-8" ?>+
    +<JavaBean xmlns="http://xmlns.oracle.com/adfm/beanmodel" version="11.1.1.52.5"+
    id="ProductListBean" Package="xxadf.mm.resources"
    BeanClass="xxadf.mm.resources.ProductListBean"
    isJavaBased="true">
    +<Attribute Name="Product" Type="java.lang.String" PrimaryKey="true"/>+
    +<Attribute Name="Stock" Type="java.lang.String"/>+
    +<Attribute Name="Rate" Type="java.lang.String"/>+
    +<Attribute Name="Accuracy" Type="java.lang.String"/>+
    +<Attribute Name="Details" Type="java.lang.String"/>+
    +<ConstructorMethod IsCollection="true"+
    Type="xxadf.mm.resources.ProductListBean"
    BeanClass="xxadf.mm.resources.ProductListBean"
    id="ProductListBean"/>
    +</JavaBean>+
    Error Log:*
    SEVERE: Server Exception during PPR, #1
    java.lang.NullPointerException
    at oracle.adfinternal.view.faces.model.binding.RowDataManager.getRowIndex(RowDataManager.java:200)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.getRowIndex(FacesCtrlHierBinding.java:506)
    at org.apache.myfaces.trinidad.component.UIXIterator._fixupFirst(UIXIterator.java:414)
    at org.apache.myfaces.trinidad.component.UIXIterator.__encodeBegin(UIXIterator.java:392)
    at org.apache.myfaces.trinidad.component.UIXTable.__encodeBegin(UIXTable.java:168)
    at org.apache.myfaces.trinidad.component.UIXCollection.encodeBegin(UIXCollection.java:517)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeHorizontalChild(PanelGroupLayoutRenderer.java:458)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$100(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:618)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:392)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:641)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.access$100(ShowDetailItemRenderer.java:31)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:491)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:464)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer._encodeChildren(ShowDetailItemRenderer.java:406)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.encodeAll(ShowDetailItemRenderer.java:114)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:1523)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.access$500(PanelTabbedRenderer.java:38)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:969)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:920)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer._renderTabBody(PanelTabbedRenderer.java:519)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.encodeAll(PanelTabbedRenderer.java:233)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:221)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:820)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1494)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:685)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:261)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:193)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Please Help I have been struggling with this issue for long.
    Thanks and Regards
    Manav Ratra
    Edited by: user11255144 on Feb 8, 2010 5:33 AM

    Hi Arun,
    Thanks for replying.
    Actually in my application there is one result table and a section that is displaying complete details of the product selectd in result table.
    The next/previous buttons are not binded with result table.
    What I am doing is, I am puuliing data from VO and displaying it on form, whenever any of these buttons is clicked.
    As soon as these buttons are clicked data is coming up, but selection state of table is not getting updated.
    So to update selection state i wrote piece of code described in my previous post.
    Everything works fine if displayRow property of table is not set to selected.
    If i set display row property of table to selected, then i get a null pointer exception with message log defined in previous post.
    Although NPE is thrown, yet all data is properly fetched and table selection is also updated. But am not able to get how this NPE is coming and hpw to fix it .
    (I need to keep displayRow = selected, for all other cases NPE is not thrown)
    Please help..
    Thanks and Regards
    Manav Ratra

  • Need help with union of two selects

    select 1 selects items for a timespan.
    But if there is nothing found at one date,
    the date is not returned so I want a union with a calendar table
    Both selects work but how to make the union?
    Thanks for any help!
    select 1:
    SELECT COUNT(*) COUNT,
    fb_operation prodstep,
    kalenderwoche datum
    FROM stoerung,
    kalender
    WHERE str_kommenzeit > to_date('13.06.2006', 'dd.mm.yyyy')
    AND str_kommenzeit < to_date('11.07.2006', 'dd.mm.yyyy')
    AND to_char(str_kommenzeit,'dd.mm.yyyy') = to_char(fulldate,'dd.mm.yyyy')
    GROUP BY fb_operation,
    kalenderwoche
    ORDER BY fb_operation,
    kalenderwoche
    select 2:
    SELECT kalenderwoche datum
    from kalender
    WHERE fulldate > to_date('13.06.2006', 'dd.mm.yyyy')
    AND fulldate < to_date('11.07.2006', 'dd.mm.yyyy')

    THANKS A LOT!
    I tested it and it gave me good results
    the problem I still have is that then I expand the Date to
    to_date('11.12.2006') I just get the weeks
    that contain data. But I need all weeks that are selected, if there is
    no data the other fields shall be null or 0.
    This is much too difficult for me perhaps you can also help me with this!
    select * from
    (SELECT COUNT(*) COUNT,
    fb_operation prodstep,
    kalenderwoche datum
    FROM stoerung,
    kalender
    WHERE str_kommenzeit > to_date('13.06.2006', 'dd.mm.yyyy')
    AND str_kommenzeit < to_date('11.12.2006', 'dd.mm.yyyy')
    AND to_char(str_kommenzeit,'dd.mm.yyyy') = to_char(fulldate,'dd.mm.yyyy')
    GROUP BY fb_operation,
    kalenderwoche
    ORDER BY fb_operation,
    kalenderwoche) A,
    (SELECT kalenderwoche datum
    from kalender
    WHERE fulldate > to_date('13.06.2006', 'dd.mm.yyyy')
    AND fulldate < to_date('11.12.2006', 'dd.mm.yyyy') ) B
    where A.datum = B.datum (+)

  • Help with this sql. Select only employees from a distinct Org??

    Hi guys, simple query.
    create table balancetest(emp_id number, balance_id number, balance number, org number);
    insert into balancetest values (111, 1, 1, 0);
    insert into balancetest values (111, 1, 1, 0);
    insert into balancetest values (111, 2, 1, 1);
    insert into balancetest values (222, 1, 2, 1);
    insert into balancetest values (333, 3, 4, 3);
    insert into balancetest values (333, 3, 4, 2);
    commit;
    SQL> select * from balancetest;
        EMP_ID BALANCE_ID    BALANCE        ORG
           111          1          1          0
           111          1          1          0
           111          2          1          1
           222          1          2          1
           333          3          4          3
           333          3          4          2
    6 rows selected.As you can see, emp_id 111 appears on different Org (0 and 1). I need to calculate the balance but the requirement says that I need to retrieve employees appearing only in 1 org.. It won't matter which org is selected (the business rules ensure balance will be the same), as long as if an employee is in multiple org, this employee is selected only once for an org. So, my result will be something like:
        EMP_ID BALANCE_ID    BALANCE        ORG
           111          1          1          0
           111          1          1          0
           222          1          2          1
           333          3          4          3
           333          3          4          2or,
        EMP_ID BALANCE_ID    BALANCE        ORG
           111          2          1          1
           222          1          2          1
           333          3          4          3
           333          3          4          2In other words, an employee must appear only in 1 org in my result.
    any ideas? I tried:
    select * from balancetest bal1
    where not exists ( select bal2.emp_id from
                               balancetest bal2
                               where bal2.emp_id = bal1.emp_id
                               and bal2.org <> bal1.org
                               );But I guess it won't be that simple!!

    Hi,
    You can find the lowest-numbered org for each employee like this:
    SELECT    emp_id
    ,         MIN (org)  AS min_org
    FROM      balancetest
    GROUP BY  emp_id;You can get the results you want by selecting only rows from balancetest that match a row in this the result set above. There are many ways to do that, such as a join:
    WITH  g  AS
        SELECT    emp_id
        ,         MIN (org)  AS min_org
        FROM      balancetest
        GROUP BY  emp_id
    SELECT  b.*
    FROM    balancetest  b
    JOIN                 g  ON  b.emp_id = g.emp_id
                            AND b.org    = g.min_org;

  • Need Help With Script Skipping Word Before Variable

    I borrowed and modified a skip I found here: http://forums.adobe.com/message/4808804 with code borrowed from elsewhere.
    I noticed that it seems to run fine, but it skips any word that appears right before a variable. The point of the script is to find any text using an italic override or bold override, and replace the override with the appropriate character format from the catalog.
    Can someone tell me why the code below skips words before a variable? I am sure it is a simple thing, but I am teaching myself Extendscript, and only recently started the attempt/
    Thanks,
    Marc
    var doc = app.ActiveDoc;
    removeOverrides (doc)
    function removeOverrides (pDoc)
        var vDocStart = pDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
        var vBoldFmt=pDoc.GetNamedCharFmt ('bold')
        var vItalicFmt=pDoc.GetNamedCharFmt ('italic')
        initFA_errno ();
        var vTextLoc = new TextLoc(vDocStart,0);
        var vFindParams=findOverrideParams (pDoc);
        while (FA_errno==Constants.FE_Success)
            var vTextRange=pDoc.Find(vTextLoc,vFindParams);
            if (vTextRange.beg.obj.ObjectValid())
                var vTextItems=pDoc.GetTextForRange (vTextRange, Constants.FTI_CharPropsChange)
                if (vTextItems.length==!0 )
                    $.writeln(vTextItems.String)
                    if (vTextItems[0].idata==Constants.FTF_WEIGHT)
                       pDoc.SetTextProps (vTextRange, vBoldFmt.GetProps())
                    if (vTextItems[0].idata==Constants.FTF_ANGLE)
                       pDoc.SetTextProps (vTextRange, vItalicFmt.GetProps())
                    }// else (Log (vLogFileName, '\nERROR: No items were found in the text format array but format override was found: '+pDoc.Name))
            vTextLoc = vTextRange.end
            vDocStart=vDocStart.NextPgfInFlow;
    function findOverrideParams (pDoc)
        var vFindParams = AllocatePropVals(1);
        vFindParams[0].propIdent.num = Constants.FS_FindObject;
        vFindParams[0].propVal.valType = Constants.FT_Integer;
        vFindParams[0].propVal.ival = Constants.FV_FindCharacterFormatOverride;
       return vFindParams;
      function initFA_errno()
             app.GetNamedMenu("!MakerMainMenu"); //If this fails, you've got bigger problems
             return;

    It looks like home assignment. Home assignment are not very welcome here. I can help you only a little. It's very simple application, but if you dont know basics in OO, you are in trouble.
    Create these three files, even empty with all points you need to accomplish in them as comments.
    Think about gui you need. If you do not know how to make menus and other fancy gui you can do only with one main panel with a few buttons and JOptionPanes appearing for every input.
    Buttons for each task:
    1. get available rooms; press and see JOptionPane telling what rooms are empty (information message)
    2. book: JOptionPane asking how many guests, you input, it checks for availability, if available rooms are not enough (or beds) another OP tells that it's impossible, if enough - offer to input room number, you input, check if the room is booked, then offer to input name, then offer quit.
    3. unbook.
    4.get report
    Once you design how it looks, every step becomes very simple. All methods you need to implement are simple array manipulations. Make report last, because it's just collection of printouts from methods you've already done.
    In book, you need to look for definitions of constructor, passing arguments to methods, returning results from methods, creating object with "new" operator, simple event handling, JOptionPane documentation and examples, which are in every decent textbook.
    Do not panic, it's really simple but rather tiresome application, if you do it by yourself you learn almost everything necessary to start programming in java.

  • Help with Trigger - looping through SELECT results

    How do I loop through a SELECT query within a Custom Trigger? I can
    execute the query fine, but the PHP mysql_xxx_xxx() functions don't
    appear to work inside a custom trigger. For example:
    This ends up empty:
    $totalRows_rsRecordset = mysql_num_rows($rsRecordset);
    While this returns the correct # of records:
    $totalRows_rsRecordset = $rsRecordset->recordCount();
    I need to loop through the records like I would with
    mysql_fetch_assoc(), but those mysql_xxx_xxx() don't seem to work.
    This works great outside a custom trigger, but fails inside a custom
    trigger:
    do {
    array_push($myArray,$row_Recordset['id_usr']);
    while ($row_Recordset= mysql_fetch_assoc($Recordset));
    What am I missing?
    Alec
    Adobe Community Expert

    Although the create trigger documentation does use the word "must", you are quite free to let the trigger fire during a refresh of the materialized view. Generally, you don't want the trigger to fire during a materialized view refresh-- in a multi-master replication environment, for example, you can easily end up with a situation where a change made in A gets replicated to B, the change fired by the trigger in B gets replicated back to A, the change made by the trigger in A gets replicated back to B, in an infinite loop that quickly brings both systems to their knees. But there is nothing that prevents you from letting it run assuming you are confident that you're not going to create any problems for yourself.
    You do need to be aware, however, that there is no guarantee that your trigger will fire only for new rows. For example, it is very likely that at some point in the future, you'll need to do a full refresh of the materialized view in which case all the rows will be deleted and re-inserted (thus causing your trigger to fire for every row). And if your materialized view does anything other than a simple "SELECT * FROM table@db_link", it is possible that an incremental refresh will update a row that actually didn't change because Oracle couldn't guarantee that the row would be unchanged.
    Justin

  • New to Dreamweaver and need help with PDF and Word

    I'm trying to put forms on my web page http://www.troop4084.org and I cannot get them to show up on the internet. I have them in the folder. If there is a step-by-step process to do this?

    johnnyc54 wrote:
    I think so, that may be the issue. I'm still looking at that one to figure it out.  My pictures work fine
    and I followed the same procedure for the Word/PDF documents...
    Your images are in the 'images' folder:
    http://www.troop4084.org/Images/Anacortes%20Sign.jpg
    The pdfs are neither in the images folder or where the links says they are in the site folder itself.
    See the link below - It says the FOS.pdf is in the site folder itself. Not in any other folders.
    http://www.troop4084.org/FOS.pdf
    If you upload the FOS.pdf to the site folder on your server the link will be correct.
    or you can put the FOS.pdf in the 'images' folder and change the link to as below:
    http://www.troop4084.org/images/FOS.pdf
    or you may want to create a 'pdf' folder on your server and upload the 'pdfs' into that with the link below:
    http://www.troop4084.org/pdfs/FOS.pdf

  • Help with creating a cursor select form

    Hey guys i need some help, I have a client who would like a menu on her website that allows users to select differnt cursors, I have never done anything like this before hand, Can anyone help out or point me in the direction of a tutorial for this sort of thing, thanks

    Hi,
    as I know, you can change your cursors by system software or/and browser. On the other hand you can use programs "outside" of your DW. I suggest to "Google" for them, as I did, and found for example this:
    http://www.google.de/#hl=de&xhr=t&q=create+cursor&cp=13&pf=p&sclient=psy&site=&source=hp&a q=0&aqi=g2&aql=&oq=create+cursor&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=e8c6fad3e718b799&biw=1280 &bih=785
    or http://www.cursors-4u.com/ and while examining this website my cursor changed immediately.
    Hans-Günter

  • Help with a Custom JSP - Select Box (entry view definition).

    I'm in no way an expert in HTML so please bear with me. We have quite a large list of Job Titles that we use on multiple forms and I wanted to use a custom jsp so I only have to update our title list once if we add/remove titles at our organization. I created a simple select box with all our titles and put them on the Vibe server under the custom jsp folder. The select box shows up on the entry form definition no problem... I just don't know how to make it show up on the entry view definition. The code is obviously pretty basic:
    <html>
    <select name ="Title">
    <option value ="Title1">Title1</option>
    <option value ="Title2">Title2</option>
    <option value ="Title3">Title3</option>
    <option value="Title4">Title4</option>
    </select>
    </html>
    What do I need to do in order for it to show up on the entry view definition side of things? Could anyone with html and/or Vibe knowledge please chime in? I'd really appreciate it.

    Try the following custom JSP, it works fine in my environment.
    Construction is a s I said before: while in edit mode (add or modify) it appears as Select Box, otherwise gives the value only.
    Regards, Darek
    <%@ include file="/WEB-INF/jsp/definition_elements/init.jsp" %>
    <c:choose>
    <c:when test='${ssOperation == "add_folder_entry" || ssOperation=="modify_folder_entry"}'>
    ${property_caption}<br>
    <select name="${property_name}">
    <option value="opt1">title1 1</option>
    <option value="opt2">title 2</option>
    <option value="opt3">title 3</option>
    <option value="opt4">title 4</option>
    </select>
    </c:when>
    <c:otherwise>
    ${ssDefinitionEntry.customAttributes[property_name]}
    </c:otherwise>
    </c:choose>

Maybe you are looking for

  • SOLMAN EHP1 - anyone can create support message in Satellite System's Help?

    Hi, I just curios that why everyone can create support message in satellite system-> help -> create support message? I tested with restricted profile user and without role SAP_SUPPDESK_CREATE, NO BP created but he still manage to create support messa

  • Export in multiple excel sheets

    Hi, I am using crystal XI and need to export in multiple excel sheets from crystal. How can I do that, please help me. Thanks, Sagarika.

  • I bought a new song and the song won't play in itunes

    here's the thing: I'm trying to desperately finish my homework and I need to download a song so the teacher can play it in class. So all the songs on my nano aren't good. Don't get me wrong, I'm not new and I love iTunes! The problem is is that I bou

  • If I paid for app for iphone do i have to pay again for same app for ipad?

    Hi just curious if anyone could tell me if I have purchased an app for an iphone for example My Movies pro do I have to pay again if I want My Movies pro for Ipad? Does this depend on specfic apps or is everything free once you paid for it on either

  • MapViewer mouse wheel support?

    Hi all, I'd like to know whether MapViewer has javascript support for mouse wheel events. I would like to implement mouse wheel zooming however the api does not have an "onMouseWheel" event for a MVMapView component. Another way to do this would be t