Need help with locating a key using a value in a HashMap.

I am quite new to Java and programming, and am just learning this in High School (enjoying it thoroughly). Sorry if I don't respect the etiquette or formatting of this board (it's unintentional).
I am using the book, Objects First Wth Java A Practical Introduction Using Blue J and am working on extensively improving the "World of Zuul" project. Which is a text-based adventure game.
Here is a code sample;
public String getNameFromList(String name)
  boolean found = false;
  Set pairSet = xItemList.entrySet();
  for(Iterator iter = pairSet.iterator(); (found == false && iter.hasNext());){
  Item currentItem = (Item) iter.next().getValue();
  String currentKey = currentItem.getName();
  if(name.equals(currentKey)){
    String changedName = iter.next().getKey();
    return changedName;
error; cannot resolve symbol:
method: getValue()xItemList is a HashMap with String keys, and Item values.
The relevant field of Item is name, which is a string.
The currentKey local variable is a little misleading, it is the current name, but acts as the 'key' when looking for the actual key.
changedName (if the parameter name is found from the item.getNames()), is what the method returns, the key associated with a object (by looking at the object's field).
My objective for this method is for it to have a name as a parameter, which it searches for in the HashMap (by Iteration over the entrySet - or I suppose iteration over Set values(), but this loses which object value is tied to which key, doesn't it?), and returns the respective key.
Any help would be very much appreciated (even if it is telling me that this can't be done with HashMaps!).

It's not clear to me what your question is, or if indeed you even have a question.
You seem to be having a problem with types. Iterators return Objects.
So in this line:
  Item currentItem = (Item) iter.next().getValue();The iterator's next() method is returning an Object, and you're trying to call getValue() on that Object. But Object doesn't have a getValue() method. That would explain your error message. Map.Entry does; you apparently meant to call Map.Entry's getValue() method. You would cast the result of iter.next() to Map.Entry before you call getValue().
Also you're calling next() on your iterator twice in the body of the loop, which means you're getting two different values... this is probably not what you intend.
But you're making this more complicated than it needs to be anyway.
Why are you iterating through the set of entries in the HashMap?
The whole point of a Map is that you get an item using an object as the key. Just do xItemList.get(name). Right?

Similar Messages

  • Need help with a currently "in-use" form we want to switch to Adobes hosting service

    Hi, I am in desperate need of help with some issues concerning several forms which we currently use a paid third party (not Adobe) to host and "re-distribute through email"...Somehow I got charged $14.95 for YOUR service, (signed up for a trial, but never used it)..and now I am paying for a year of use of the similar service which Adobe is in control of.  I might want to port my form distribution through Adobe in the hopes of reducing the errors, problems and hassles my customers are experiencing when some of them push our  "submit button". (and I guess I am familiar with these somewhat from reading what IS available in here, and I also know that, Adobe is working to alleviate some of these " submit"  issues, so let's don't start by going backwards, here) I need solutions now for my issues or I can leave it as is, If Adobe's solution will be no better for my end users...
    We used FormsCentral to code these forms and it works for the most part (if the end-user can co-operate, and thats iffy, sometimes), but I need help with how to make it go through your servers (and not the third party folks we use now), Not being cruel or racist here, but your over the phone "support techs" are about horrible & I cannot understand them or work with any of them, so I would definitely need someone who speaks English and can understand the nuances of programming these forms, to please contact me back. (Sorry, but both those attributes will be required to be able to help me, so, no "newbie-interns" or first week trainees are gonna cut it).... If you have anyone who fits the bill on those items and would be willing to help us, please contact me back at your earliest convenience. If we have to communicate here, I will do that & I can submit whatever we need to & to whoever we need to.
    I need to get this right and working for the majority of my users and on any platform and OS.
    You may certainly call me to talk about this, and I have given my number numerous times to your (expletive deleted) time wasting - recording message thingy. So, If it's not available look it up under [email protected]
    (and you will probably get right to me, unlike my and I'm sure most other folks',  "Adobe phone-in experiences")
    Thank You,
    Michael Corman
    VinylCouture
    Phenix City, Alabama  36869

    Well, thanks for writing back...just so you know...I started using Adobe products in 1987, ...yeah...back then...like Illustrator 1 & 9" B&W Macs ...John Warnock's Helvetica's....stuff like that...8.5 x 11 LaserWriters...all that good stuff...I still have some of it working on a mac...much of it was stuff I bought. some stuff I did not...I'm not a big fan of this "cloud" thing Adobe has foisted upon the creatives of the world...which I'm sure you can tell...but the functionality and usefulness of your software can not be disputed, so feel free to do whatever we will continue to pay for, ...I am very impressed with CC PS on the 64 bit PC and perhaps I will end up paying you the stipend that you demand for the other services.
    So  I guess that brings us to our problem.. a few years back and at the height of the recession and near bankruptcy myself,  I was damn lucky and hit on something and began a small arts and crafts supply service to sell my products online to a very "niche market" ...I had a unique product and still sell that product (plus others) online...My website is www.vinylcouture.com...Strange? Yes...but there is a market it seems, for everything now, and this is the market I service...Catagorically, these are 99%+ women that use these "adhesive, sticky backed vinyl products"  to make different "craft items" that are just way too various and numerous to go into... generally older women, women who are computer illiterate for the most part...and all this is irrelevant to my problem, but I want you to have every bit of background on this and especially the demographic we are dealing with, so we can get right to the meat of the problem.
    OK...So about two years ago, I decided to offer a "plain sheet" product of a plain colored "stick back" vinyl... it is available in multiple quantities of packs ( like 5 pieces, 10 pieces, 15 pieces, in a packi  & so on)...and if you are still on my site.. go to any  "GO RIGHT TO OUR ORDER PAGE"  button, scroll down a little...and then to the "PLAIN VINYL" section...you will see the Weebly website order process.) You can back out from here, I think,..but, anyway this product is available in 63 colors + or - a few. So then the problem is,  how do they select their individual colors within that (whatever) pack?... .
    So my initial idea was to enable a "selection form" for these "colors" that would be transmitted to me via email as 'part" of the "order process".. We tried getting our customers to submit a  " a list" ( something my competitiors still do, lol, poor bastards)......but that..is just unbelievable..I can't even begin to tell you what a freakin' nightmare that was...these people cannot even count to 10, much less any higher... figuring out what colors to list and send me... well, lets just say, it wasn't working......I had to figure out a better way...Something had to be done.
    So after thinking this all out,  and yeah...due to my total ignorance, i figured that we could make a form with Live Cycle Designer (Now Forms Central)...(back then something that was bundled with Adobe Acrobat Pro), I believe, and thats what this thing was authored in... and it would be all good...LOL!
    Well not so simple...as you well know, Adobe Acrobat would NOT LET YOU EMAIL anything from itself.....it just wouldn't work (and I know why, and all that hooey), but not being one to take NO for answer,.I started looking for a way to make my little gizmo work.. So I found this company that said they can "hijack" (re-direct actually) the request to email, bypass the wah-wah, and re-transmit it to the proper parties.....for less than $100 a year,  I think...its called http://pdf-fillableforms.com/.
    A nice gentleman named Joseph Silva helped us program the thing to go to his servers and back out. Please dont hassle them...I need them...for now..it basically does work...try it...you should get back a copy of the form that you filled out...good luck however,  if you're on MAC OSX or similar...
    I have included a copy of both of our forms (and feel free to fill it out and play with it)...just put test somewhere on it...(and you must include YOUR email or it will balk)..they are supposed to be mostly identical, except one seems to be twice as large....generating a 1.7 meg file upon submission, while the other one only generates a 600K file or so...thats another issue for another day or maybe you can advise on that also...
    OK so far so good......In our shop, once Grandma buys a 10 pack (or whatever), Only then she gets to the link on her receipt page ro the relevant "selection form" ,(this prevents "Filling and Sending"  with "no order" and "no payment", another early problem we had)... which they can click on and it will usually download and open up on their device if all goes well...Then our little form is supposed to be fillable and is supposed to ADD UP all the quantities, so grandma knows how many she is buying and so forth right on the fly,  and even while she changes her mind..., and IT'S LARGE so grandma can see it, and then it TOTALS it all up for them, ( cause remember, they can NOT add)..,  except there is a programming bug (mouse-click should be a mouse-up probably or something..) which makes you click in the blank spaces to get to a correct TOTAL...about 70-80% of our customers can enable all these features and usually the process completes without problems for them especially on PC's running Windows OS and Acrobat Reader X or XI...at least for most... Unfortunately it is still not the "seamless process" I would like or had envisioned for the other folks out there that do have trouble using our form....  Many folks report to us the following issues that we know of.  First of all it takes too much time to load up...We know its HUGE...is there anyway that you can see, to streamline this thing? I would love for it to be more compact...this really helps on the phones and pads as I'm sure you well know.
    Some just tell us,"it WON'T work"....I believe this is because they are totally out of it and dont even have Adobe Reader on their machine, & don't know how to get it ( yes, we provide the links).....or it's some ancient version....no one can stop this one...
    It almost always generates some kind ( at least one time)  of "error message" which we do warn them about..., telling one,  basically that "Acrobat doesnt even like this happening at all, and it could be detrimental to ones computer files", blah-blah...(this freaks grandma out really bad)...& usually they end up not even trying to send it...  and then I get calls that even you wouldn't believe...& If they DO nut up and push the Red "Submit Form" button, it will usually send the thing to us (and also back to them at the "required email address" they furnished on the form, thats what the folks at the "fillable forms place" do) so, if it's performing it's functions, why it is having to complain?. What are we doing wrong?....and how can I fix it?...Will re-compiling it or saving it as a newer version of "FormsCentral" correct any of these problems ?
    Ok, so that should keep you busy for a minute and we can start out with those problems...but the next thing is, how can I take advantage of YOUR re-direct & hosting services?, And will it get rid of the error messages, and the slowness, and the iOS incompatibilities ? (amazingly,  the last iOS Reader version worked almost OK.. but the newest version doesnt seem to work with my form on my iphone4)  If it will enable any version of the iOS to send my form correctly and more transparently, then it might be worth the money...$14.95 a MONTH you say. hmmmmm...Better be good.
    Another problem is, that I really don't need 5000 forms a month submitted. I think its like 70-100 or less....Got any plans for that?  Maybe I'm just not BIG ENOUGH to use Adobe's services, however in this case, I really don't care whose I do use as long as the product works most correctly for my customers as well as us. Like I said, If I'm doing the best I can, I won't change anything, and still use the other third party, If Adobe has a better solution, then i'm all for that as well. In the meantime, Thanks for any help you can provide on this...
    Michael Corman
    VinylCouture.com
    (706) 326-7911

  • Need help with adding a Key flex field to a seeded OAF page

    We have a seeded OAF page on which we already have Account Key Flex Field.
    Properties of this flex field are:
    The ApplShortName - SQLGL
    Name - GL#
    Type - Key
    As per the client requirement, in the KFF screen, we have disabled the seeded structure for Accounting Flexfield and created a custom structure.
    Our custom structure for the KFF is displayed correctly on the OAF page.
    But now the requirement is to add a new KFF on the OAF page which is duplicate of the existing KFF, along with the existing KFF field; the structure and segments are same. Only difference being the display name of the existing KFF field is Account; the new one needs to be Tax structure.
    Using personalization we added a new flex item and added the properties same as the existing KFF.
    ApplShortName - SQLGL
    Name - GL#
    Type - Key
    But the page is giving following error:
    The data that defines the flexfield on this field may be inconsistent. Inform your system administrator that the function: KeyFlexfieldDefinitionFactory.getStructureNumber could not find the structure definition for the flexfield specified by Application = SQLGL, Code = GL# and Structure number =
    We tried options like compiling the flexfield definition, but the error persists.
    Any help in this regard is highly appreciated.
    Regards,
    Kiranmayi.

    Hi,
    Please check whether your key flex structure is frozen or not. If now please freeze it and re compile and try.
    This may helps too
    error while developing KFF in oaf
    Thanks
    Bharat
    Edited by: Bharat on May 10, 2013 4:51 AM

  • Need help with locating iPad with find my iPad app.. it was turned on this morning but won't show me the location.. why is this??

    Need help to find location of iPad using find my iPad app.. Sound was activated this morning but it won't give me the location.. How can I find it??

    Hello there Kylie,
    It sounds like your iPad is not showing in Find my iPad when you check it. Take a look at this info from the following article named:
    iCloud: Troubleshooting Find My iPhone, iPad, iPod touch, or Mac
    http://support.apple.com/kb/ts4006
    Device does not appear in Find My iPhone
    This can occur if:
    The date on your device (iPhone, iPad, or iPod Touch) is incorrect. Choose Settings > General > Date & Time to check and set the date.
    Your device is not up-to-date. It needs to be running iOS 5 or later.
    Your iCloud account is not configured on your device. Choose Settings > iCloud and enter your iCloud account information.
    You have multiple iCloud accounts entered on your iPhone, iPad, or iPod touch. Only one account can have Find My iPhone turned on at a given time. Log in to Find My iPhone with your other iCloud accounts until your device is listed.
    There's a scheduled maintenance or another issue affecting Find My iPhone. Check the System Status site to see if this is the case.
    Your device has lost network connectivity. If you have access to your device, and it appears to have an active Internet connection, enable and then disable Airplane mode. If you continue to have issues, turn the device off and back on.
    Find My Mac can only locate your Mac if it is connected to the Internet via a known Wi-Fi network. If your Mac is connected to the Internet only by an Ethernet cable, Find My Mac will not be able to locate your Mac.
    Device appears in Find My iPhone, but is offlineThis can occur if:
    Your device is powered off, such as when the battery has run out. Note that the remaining battery for the device, if it's connected to the Internet, displays in the upper-right corner of the information pane of the selected device. You can still play a sound on, send a message to, issue a lock request, or initiate an erase of your iPhone, iPad, or iPod touch. The command will be received after the device is turned on and regains its Internet connection.
    Your iPhone’s cellular service has been terminated by your wireless service provider. If you contacted your service provider to report your device lost or stolen before locating your phone, and they deactivated your SIM card or account, this would be expected. If this is the case, you may no longer be able to locate, display a message on, or erase your iPhone. For more information, read about what to do if your device is lost or stolen.
    Your iPad, iPod Touch, or Mac is asleep and not connected to a known Wi-Fi network. You will still be able to request an erase, send a message to display and lock your device, or request that a sound be played. The command will be processed when your device is awakened and connected to the Internet.
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Need help with Ipod/FM transmitter use in Europe !!!

    HELP! I need to know if I can use my ipod and my Griffin FM Transmitter to listen to tunes and charge the player with a car in Europe (Germany, Italy, etc.)
    HP   Windows XP  

    It appears that FM transmitters have been passed for use recently by Germany, Switzerland and Iceland. When or if the UK or any other European countries will allow them I don't know. This is a link to an announcement by Belkin on the subject: http://www.belkin.com/pressroom/releases/uploads/030906FMTranEurope.html

  • I need help with error ORA-06502: numeric or value error

    Hi, all, i need help finding the error here, im getting a numeric or value error when i add information to the variable vlcadena when vlcadena is a clob type, and i check the length of the vlcadena variable and sometimes makes the error at 8000 characters some other times 32k i have no idea whats happening, does anyone have a clue?
    PROCEDURE REGISTRO_551 (
    VPNUMPARTE IN PARTESC.NUMPARTE%TYPE,
    VPFRACCION IN IMPOMAT.FRACCIONMEXIMPO%TYPE,
    VPDESCRIPCION IN PARTESC.DESCESPANOL%TYPE,
    VPVALORDLS IN IMPOMAT.VALORDOLARES%TYPE,
    VPCANTIDAD IN IMPOMAT.CANTIDAD%TYPE,
    VPUNIMED IN PARTESC.UNIMEDPARTE%TYPE,
    VPCANTIDADTARIFA IN IMPOMAT.CANTIDAD%TYPE,
    VPVALORAGREGADO IN EXPOPT.VALORAGREGADO%TYPE,
    VPPAISORIGEN IN PARTESC.PAISORIGEN%TYPE,
    VPCOMPVEND IN PARTESC.PAISORIGEN%TYPE,
    VPTIPOFRACCION IN IMPOMAT.TIPOFRACCION%TYPE,
    VPPESONETO IN IMPOMAT.PESONETO%TYPE,
    VPTIPOMONEDA IN MIMPOMAT.TIPOMONEDAEXTRANJERA%TYPE
    ) AS
    BEGIN
        vgproceso := 207310;
        vllong2:=length(vlCadena);
        vlCadena:=vlCadena||'551'||'|'; --1. TIPO DE REGISTRO
        vgproceso := 207311;
        vllong2:=length(vlCadena);
        vlCadena:=vlCadena||VPFRACCION||'|'; --2. FRACCION
        vgproceso := 207312;
        vllong2:=length(vlCadena);
        QUITA_ENTERS(NVL(VPDESCRIPCION,' '),VLTEMP);
        IF LENGTH(VLTEMP)>80 THEN
            VLTEMP:=SUBSTR(VLTEMP,1,80);
        END IF;
        vgproceso := 207313;
        vllong2:=length(vlCadena);
        IF VLTEMP IS NULL THEN
            vlCadena:=vlCadena||'|'; --3. DESCRIPCION
        ELSE
            vlCadena:=vlCadena||VLTEMP||'|'; --3. DESCRIPCION
        END IF;
        vgproceso := 207314;
        vllong2:=length(vlCadena);
        IF VPNUMPARTE IS NULL THEN
            vlCadena:=vlCadena||'|';--4. NO. DE PARTE
        ELSE
            vlCadena:=vlCadena||VPNUMPARTE||'|';--4. NO. DE PARTE
        END IF;
        vgproceso := 207315;
        vllong2:=length(vlCadena);
        vlCadena:=vlCadena||VPVALORDLS||'|'; --5. VALOR MERCANCIA
        vgproceso := 207316;
        vllong2:=length(vlCadena);
        vlCadena:=vlCadena||VPCANTIDAD||'|'; --6. CANTIDAD COMERCIAL
        vgproceso := 207317;
        vllong2:=length(vlCadena);
        IF VPUNIMED IS NULL THEN
            VPDESCERROR:='ALGUNA PARTIDA CON FRACCION '||VPFRACCION||' NO TIENE UNIDAD DE MEDIDA';
        END IF;
        vgproceso := 207320;
        GET_CATGRAL('ADUANAS','UNIMED',NVL(VPUNIMED,' '),CL_D1,CL_D2,CL_D3,CL_D4,CL_V1,CL_V2,CL_V3,CL_CATG);
        IF CL_V2=0 THEN
           vlCadena:=vlCadena||VPUNIMED||'|'; --7. UNIDAD MEDIDA COMERCIAL
        ELSE
            SELECT TO_CHAR(TRUNC(CL_V2)) INTO VLUMCOMERCIAL FROM DUAL;
            IF LENGTH(VLUMCOMERCIAL)=1 THEN
                VLUMCOMERCIAL:='0'||VLUMCOMERCIAL;
            END IF;
            vlCadena:=vlCadena||VLUMCOMERCIAL||'|'; --7. UNIDAD MEDIDA COMERCIAL
        END IF;
        vlCadena:=vlCadena||VPCANTIDADTARIFA||'|';--8. CANTIDAD TARIFA
        vlCadena:=vlCadena||VPVALORAGREGADO||'|';--9. VALOR AGREGADO
        GET_CATGRAL('ADUANAS','CONFADU','IVIN-REG',CL_D1,CL_D2,CL_D3,CL_D4,CL_V1,CL_V2,CL_V3,CL_CATG);
        vlCadena:=vlCadena||CL_D1||'|'; --10. VINCULACION
        vlCadena:=vlCadena||CL_D2||'|'; --11. METODO DE VALORACION
        vlCadena:=vlCadena||'|'; --12. MARCA
        vlCadena:=vlCadena||'|'; --13. MODELO

    If the expected maximum length of the concatenated string is less than 32K, then use VARCHAR2 and at the end convert to CLOB if necesary.
    :p
    PS: At what line in the code does it give the error?
    Edited by: LKBrwn_DBA on Aug 20, 2009 2:49 PM

  • Need help with BC4J/Struts application using a Stored Procedure

    Hi,
    I am doing a proof of concept for a new project using JDeveloper, Struts and BC4J. We want to reuse our Business logic that is currently residing in Oracle Stored Procedures. I previously created a BC4J Entity Object based on a stored procedure Using Oracle Stored Procedures but this stored procedure is a bit different in that it returns a ref cursor as one of the paramters. http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html
    I tried the above method, but I am having some trouble with it. I keep getting the error ORA-01008: not all variables are bound when I test it using the AppModule tester.
    Here is the store procedure definition:
    CREATE OR REPLACE PACKAGE pprs_test_wrappers IS
    TYPE sn_srch_results IS REF CURSOR;
    PROCEDURE sn_srch_main_test
    (serial_num_in IN OUT VARCHAR2
    ,serial_coll_cd_in IN OUT NUMBER
    ,max_rows_allowed IN OUT NUMBER
    ,total_rows_selected IN OUT NUMBER
    ,message_cd_out IN OUT VARCHAR2
    ,query_results          OUT sn_srch_results
    END pprs_test_wrappers;
    And here is my code:
    package pprs;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class LienCheckImpl extends ViewObjectImpl
    * This is the PLSQL block that we will execute to retrieve the REF CURSOR
    private static final String SQL =
    "begin ? := pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
    public LienCheckImpl() {}
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will PRECEED the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params (for example due to a view link)
    * they will be in the 'params' array.
    * We assume that if some parameter is present, that it is a Deptno
    * value to pass as an argument to the stored procedure.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    String serialNumIn = null;
    BigDecimal serialCollCdIn = null;
    BigDecimal maxRowsAllowed = null;
    BigDecimal totalRowsSelected = null;
    String messageCdOut = null;
    if (params != null) {
    serialNumIn = (String)params[0];
    serialCollCdIn = (BigDecimal)params[1];
    maxRowsAllowed = (BigDecimal)params[2];
    totalRowsSelected = (BigDecimal)params[3];
    messageCdOut = (String)params[4];
    storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
    serialCollCdIn,
    maxRowsAllowed,
    totalRowsSelected,
    messageCdOut));
    super.executeQueryForCollection(qc, params, numUserParams);
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overridden framework method.
    * The role of this method is to "fetch", populate, and return a single row
    * from the datasource by calling createNewRowForCollection() and populating
    * its attributes using populateAttributeForRow().
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    populateAttributeForRow(r,2, rs.getString(3));
    populateAttributeForRow(r,3, rs.getString(4));
    populateAttributeForRow(r,4, rs.getString(5));
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    * Overridden framework method.
    * Return true if the datasource has at least one more record to fetch.
    protected boolean hasNextForCollection(Object qc) {
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    * Overridden framework method.
    * The framework gives us a chance to clean up any resources related
    * to the datasource when a query collection is done being used.
    protected void releaseUserDataForCollection(Object qc, Object rs) {
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,
    String serialNum,
    BigDecimal serialColCd,
    BigDecimal maxRows,
    BigDecimal totalRows,
    String messageCd ) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type CURSOR
    st.registerOutParameter(1,OracleTypes.CURSOR);
    * Set the value of the 2nd bind variable to pass id as argument
    if (serialNum == null) st.setNull(2,Types.CHAR);
    else st.setString(2,serialNum);
    if (serialColCd == null) st.setNull(3,Types.NUMERIC);
    else st.setBigDecimal(3,serialColCd);
    if (maxRows == null) st.setNull(4,Types.NUMERIC);
    else st.setBigDecimal(4,maxRows);
    if (totalRows == null) st.setNull(5,Types.NUMERIC);
    else st.setBigDecimal(5,totalRows);
    if (messageCd == null) st.setNull(6,Types.CHAR);
    else st.setString(6,messageCd);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Number
    private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new oracle.jbo.domain.Number(b) : null;
    catch (SQLException s) { }
    return null;
    I created the view object in expert mode so there is no entity object. Can someone help? I don't have much time left to finish this.
    Also, could I have done this from the Entity object instead of the view object by registering the ref cursor OUT parameter in handleStoredProcInsert()?
    Thanks
    Natalie

    I was able to get the input parameter by putting the following in my struts actions class
    vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
    The full code is:
    package mypackage2;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.html.BC4JContext;
    import oracle.jbo.ViewObject;
    import oracle.jbo.html.struts11.BC4JUtils;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class LienCheckView1QueryAction extends Action
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    BC4JContext context = BC4JContext.getContext(request);
    // Retrieve the view object instance to work with by name
    ViewObject vo = context.getApplicationModule().findViewObject("LienCheckView1");
    vo.setRangeSize(3);
    vo.setIterMode(ViewObject.ITER_MODE_LAST_PAGE_PARTIAL);
    // Do any additional VO setup here (e.g. setting bind parameter values)
    vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
    // default value for serialCollCd 1 is for Motor Vehicles
    vo.setWhereClauseParam(1,new oracle.jbo.domain.Number(1));
    // Default value for maxRows_allowed
    vo.setWhereClauseParam(2,new oracle.jbo.domain.Number(20));
    return BC4JUtils.getForwardFromContext(context, mapping);
    This doesn't always work properly though. The first time I press the query button, the SerialNum parameter is still null, however if I re-execute the query by pressing the query button again. It will work, and return the rows. I always have to query twice. Also the SerialNum attribute is set to a String in my view object, it is a varchar column in the database, but some serial number I enter give a "Error Message: oracle.jbo.domain.Number ". This happens even though the underlying BC4J is returning values for the query. I also get a "500 Internal Server Error java.lang.ClassCastException: java.lang.String on my View object's code at line 65 which is
    if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
    This is an input paramter to the oracle stored procedure that defaults to a Number value of 1.
    Any idea what the problem is? Here is the full code for my view object:
    package mypackage1;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class LienCheckViewImpl extends ViewObjectImpl
    * This is the PLSQL block that we will execute to retrieve the REF CURSOR
    private static final String SQL =
    "begin pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
    private BigDecimal totalRows = null;
    private String messageCd = null;
    private BigDecimal serialColCd = null;
    private BigDecimal maxRows = null;
    public LienCheckViewImpl() {}
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will *PRECEED* the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params (for example due to a view link)
    * they will be in the 'params' array.
    * We assume that if some parameter is present, that it is a Deptno
    * value to pass as an argument to the stored procedure.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    String serialNumIn = null;
    BigDecimal serialCollCdIn = null;
    BigDecimal maxRowsAllowed = null;
    BigDecimal totalRowsSelected = null;
    String messageCdOut = null;
    if (params != null) {
    if (params.length>0) serialNumIn = (String)params[0];
    if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
    if (params.length>2) maxRowsAllowed = (BigDecimal)params[2];
    storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
    serialCollCdIn,
    maxRowsAllowed));
    super.executeQueryForCollection(qc, params, numUserParams);
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overridden framework method.
    * The role of this method is to "fetch", populate, and return a single row
    * from the datasource by calling createNewRowForCollection() and populating
    * its attributes using populateAttributeForRow().
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    //AddedByRegisNum
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    System.out.println("AddedByRegisNum :" + rs.getBigDecimal(1));
    // OrigRegisNum
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    System.out.println("OrigRegisNum :" + rs.getBigDecimal(2));
    // SerialNum
    populateAttributeForRow(r,2, rs.getString(3));
    System.out.println("SerialNum :" + rs.getString(3));
    // SerialNumDesc
    populateAttributeForRow(r,3, rs.getString(4));
    System.out.println("SerialNumDesc :" + rs.getString(4));
    // FlagExactMatch
    populateAttributeForRow(r,4, rs.getString(5));
    System.out.println("FlagExactMatch :" + rs.getString(5));
    // MessageCd
    populateAttributeForRow(r,5, messageCd);
    // TotalRows
    populateAttributeForRow(r,6, totalRows);
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    * Overridden framework method.
    * Return true if the datasource has at least one more record to fetch.
    protected boolean hasNextForCollection(Object qc) {
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    * Overridden framework method.
    * The framework gives us a chance to clean up any resources related
    * to the datasource when a query collection is done being used.
    protected void releaseUserDataForCollection(Object qc, Object rs) {
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    * Overridden framework method
    * Return the number of rows that would be returned by executing
    * the query implied by the datasource. This gives the developer a
    * chance to perform a fast count of the rows that would be retrieved
    * if all rows were fetched from the database. In the default implementation
    * the framework will perform a SELECT COUNT(*) FROM (...) wrapper query
    * to let the database return the count. This count might only be an estimate
    * depending on how resource-intensive it would be to actually count the rows.
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    Object[] params = viewRowSet.getParameters(true);
    String serialNumIn = (String)params[0];
    BigDecimal serialCollCdIn = (BigDecimal)params[1];
    BigDecimal maxRowsAllowed = (BigDecimal)params[2];
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the fourth bind parameter as our return value of type NUMERIC
    st.registerOutParameter(4,Types.NUMERIC);
    * Set the value of the 3 bind variables to pass as arguments
    if (serialNumIn == null) st.setNull(1, Types.CHAR);
    else st.setString(1,serialNumIn);
    if (serialCollCdIn == null) st.setNull(2,Types.NUMERIC);
    else st.setBigDecimal(2,serialCollCdIn);
    if (maxRowsAllowed == null) st.setNull(3, Types.NUMERIC);
    else st.setBigDecimal(3, maxRowsAllowed);
    st.execute();
    System.out.println("returning value of :" + st.getLong(4));
    return st.getLong(4);
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,
    String serialNum,
    BigDecimal serialColCd,
    BigDecimal maxRows) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Set the value of the bind variables
    System.out.println("SerialNumIn :" + serialNum);
    if (serialNum == null) st.setNull(1,Types.CHAR);
    else st.setString(1,serialNum);
    if (serialColCd == null) st.setNull(2,Types.NUMERIC);
    else st.setBigDecimal(2,serialColCd);
    if (maxRows == null) st.setNull(3,Types.NUMERIC);
    else st.setBigDecimal(3,maxRows);
    st.registerOutParameter(1, Types.CHAR); // serialNum
    st.registerOutParameter(2, Types.NUMERIC); // serialColCd
    st.registerOutParameter(3, Types.NUMERIC); // maxRows
    st.registerOutParameter(4, Types.NUMERIC); // totalRows
    st.registerOutParameter(5, Types.CHAR); // messageCd
    * Register the 6th bind parameter as our return value of type CURSOR
    st.registerOutParameter(6,OracleTypes.CURSOR);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(6);
    serialColCd = st.getBigDecimal(2);
    System.out.println("SerialColCd= " + serialColCd);
    maxRows = st.getBigDecimal(3);
    System.out.println("maxRows= " + maxRows);
    totalRows = st.getBigDecimal(4);
    System.out.println("totalRows= " + totalRows);
    messageCd = st.getString(5);
    System.out.println("messageCd= " + messageCd);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Number
    private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new oracle.jbo.domain.Number(b) : null;
    catch (SQLException s) { }
    return null;
    Natalie

  • Really need help with this, can't use safari on my ipod

    I clicked on a link on a website for my school, and then it opened in another page. idk if i clicked something or this happened on its own, but then a video tried to open from the image. I've messed around with my settings, and i can't seem to be able to get a youtube video to open on my ipod if it's from a website, i always have to go directly from youtube to find anything. So it says "could not load video", the only option is to click okay, so I do, and then it gives me the main ipod youtube page, with history and search and all that stuff. I give up and decide to just look at something else, and click safari, except it goes straight to the image, which goes straight to the unloadable video on another program, and then i have to close the page. It goes in circles, but it means that safari is unusable, and my computer is broken, so i really need it for internet.
    Also, is there a way to make youtube videos viewable from a website link?
    And why, when I search up a popular song on youtube on my ipod, and type in that i want the lyric video, i only get live versions, and there is never any lyric videos, and i usually detest live versions of songs?? and then when i search the same thing on someone's computer, i get my lovely lyric videos? Is Youtube angry at Apple or something?
    aand why were the older ipods less crash-prone?
    answers are very helpful, especially for the first question, because i am clueless about technoloy. Honestly, it took me a year to learn how to turn on my computer....

    A lote of sitesuse the Flash version of YourTube. no iOS devices support flash. The you have to either use the YourTube app or Safari to go to YouTube since Safari tells the YouTube site to use HTML5.
    For other problems withwith Safari try going to Settins>Safari and clear Histor, Cookies and Data.
    Also reset the iPod. Nothing is lost.
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.

  • Need help with a filter to use in Photoshop CS5

    I am a novice so please be  patient.  Over the past 15 years or so I have been using a simple filter  that I created in Filter Factory to do some analysis on aerial  photographs.  I am way behind on updates (currently using Photoshop CS  (version 8)).  I want to upgrade and am using a trial of CS5.  After  talking with customer support I've found there is no way to use this  filter in CS5 and Filter Factory is no longer supported in the Photoshop  suite.  Can someone help me to create the same filter in Pixel Bender  to use in Photoshop CS5?  I will share the details of the filter if  someone responds.
    Thanks!

    Is the result a one channel image? The Pixel Bender language currently supports one and two channel images, in addition to three and four channel images, but unfortunately the tools do not. You should be able to fake the one channel output by marking only a single channel of a three or four channel image. In any case, give the filter, below, a try. It may not do exactly what you want but it should get you most of the way there. You'll want to duplicate it and modify the arithmetic to satisfy the second filter algorithm once you've got the filter tuned to fit your needs.
    <languageVersion: 1.0;>
    kernel RPlusGDivRMinusG
    <
        namespace: "pixelbender::forum::support";
           vendor: "aif";
          version: 1;
    >
        input  image4 src;
        output pixel4 dst;
        void
        evaluatePixel()
            float4 pointsample = sampleNearest(src, outCoord());
            float  graychannel = (pointsample.r + pointsample.g) /
                                 (pointsample.r - pointsample.g);
            dst = float4(graychannel, 0, 0, pointsample.a);

  • Need help with PC build for use with Photoshop CS4 Extended - Have I made the right choices?

    Hello,
    I'm very new to the inner workings of a PC...this will be first time building one from scratch.  I know enough to be dangerous but not enough to be confident.  I will use the PC primarily for editing, secondarily for iTunes management.  I've heard that I should have, at the very least, an SSD for PS, other apps and the O/S.  I'll also have a hard drive for data storage.  Do I need yet another SSD for scratch?  If so, any recs for one?  Also, my current build (which does not include any SSDs) is about $800.  What can I skinny down, without sacrificing a huge amount of speed/performance?  I am looking for major guidance here...I'm ready to order, but I keep second-guessing my choices.  I want to make sure I get this right the first time around.  I want this machine to last me a good long while.  Any help at all will be HUGELY appreciated! 
    Here are my current picks:
    Part list permalink: http://pcpartpicker.com/p/1bwi
    Part price breakdown by merchant: http://pcpartpicker.com/p/1bwi/by_merchant
    CPU: Intel Core i5-2500K 3.3GHz Quad-Core Processor  ($214.99 @ SuperBiiz)
    Motherboard: Gigabyte GA-P67A-D3-B3 ATX  LGA1155 Motherboard  ($104.99 @ Newegg)
    Memory: G.Skill Ripjaws Series 16GB (4 x 4GB) DDR3-1333 Memory  ($85.00 @ Newegg)
    Hard Drive: Samsung Spinpoint F3 1TB 3.5" 7200RPM Internal Hard Drive  ($49.99 @ Newegg)
    Video Card: XFX Radeon HD 6850 1GB Video Card  ($129.99 @ Newegg)
    Case: Cooler Master Elite ATX Mid Tower Case  ($60.00 @ Amazon)
    Power Supply: Corsair 500W ATX12V Power Supply  ($49.99 @ Newegg)
    Optical Drive: Lite-On iHAS124-04 DVD/CD Writer  ($19.99 @ SuperBiiz)
    Operating System: Microsoft Windows 7 Home Premium SP1 (64-bit)  ($91.98 @ Amazon)
    Total: $806.92
    (Prices include shipping and discounts when available.)
    (Generated 2011-09-19 18:29 EDT-0400)
    Thanks!
    Andrea

    Make sure the motherboard is the third revision as the earlier two had problems with the i5-2500K (Sandy Bridge)
    I prefer Asus motherboards but doesn't mean the Gigabyte is a problem. (I note that it scored 4 eggs...)
    May not make a difference in Photoshop but for Premiere the Geforce video cards with GDDR5 are preferred.
    The LiteOn iHas 224 does lightscribe which is a nice touch for clients/gifts.
    There is no room to save as I would consider your build minimum specs for a nice photoshop experience.
    As for SSD drives...my research of reviews and articles makes me feel the technology is not ready for mission critical work. So if you are running a business then I recommend not using SSD drives. Rather look at Raptor 10,000 rpm drive for Windows and Photoshop and use the Spinpoint for storage. If not business then I've read the intel x25 SSD drives are solid but I have no personal experience with them.
    Cheers,
    Steve

  • Need Help with Format/Partition.. using cmd

    Okay guys.. Im kinda sick of trying to get my Recovery to work. Seems like its about to finish and everything is perfect.. then suddenly I get an error message saying that Recovery didnt work, or something like that..
    I figured I might as well try starting with a fresh hard drive, then trying the recovery again..
    So someone told me that if I have the HP Recovery disks, then I would be able to try them, even on a brand new hard drive, or a formatted one or whatever..
    Is this true?
    If so, then what I am asking you guys, is, if there is anybody that would be able to help guide me thru the steps needed, in order for me to Format my hard drive, & then partition it or whatever…
    & I wanna be able to do all this, using cmd (command prompt)
    So Please.. anyone.. your help would be greatly appreciated..
    I have an HP Pavilion dv6653cl
    Thanks!!

    Hi,
    There's no need to pre-format a new Hard Drive - if you perform a 'Factory Reset' using your Recovery Discs, these will perform a quick format and also re-create all the original partitions on the new drive as part of the process.
    A complete guide to using Recovery Discs can be found on the relevant link below.
    Performing An HP System Recovery - Windows 7.
    Performing An HP System Recovery - Windows Vista.
    Performing An HP System Recovery - Windows XP.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • NEED HELP WITH WORD & CHAR COUNT USING HASHTABLE

    I have to use a hashtable to be able to count all the words and characters (#'s, punctuations, etc) from a file
    I have been able to get it to correctly count the words in the file but none of the characters and it also does not display the words alphabetically and just displays it in an odd way
    Here's the code: public static void main (String [] args)
          Hashtable table = new Hashtable();
          String input = JOptionPane.showInputDialog("Enter the filename:");
          try{
          BufferedReader br = new BufferedReader(new FileReader(input));
          String s = br.readLine();
          StringTokenizer words = new StringTokenizer( s, " \n\t\r" );
            while ( words.hasMoreTokens() ) {
             String word = words.nextToken().toLowerCase(); // get word
             // if the table contains the word
             if ( table.containsKey( word ) ) {
                Integer count = (Integer) table.get( word ); // get value
                // and increment it
                table.put( word, new Integer( count.intValue() + 1 ) );
             else // otherwise add the word with a value of 1
                table.put( word, new Integer( 1 ) );
           } // end while
             String output = "";
          Enumeration keys = table.keys();
          // iterate through the keys
          while ( keys.hasMoreElements() ) {
             Object currentKey = keys.nextElement();
             output += currentKey + "\t" + table.get( currentKey ) + "\n";
             System.out.println(output.toString());
          catch (IOException e)
            System.out.println(e);
          }The output that I get for a file containing the line " Hi this is my java program" is:
    this     1
    this     1
    program     1
    this     1
    program     1
    hi     1
    this     1
    program     1
    hi     1
    java     1
    this     1
    program     1
    hi     1
    java     1
    is     1
    this     1
    program     1
    hi     1
    java     1
    is     1
    my     1
    I'm not sure what I am doing wrong and help would be greatly appreciated.

    I have been able to get it to correctly count the
    words in the file but none of the characters and it
    also does not display the words alphabetically and
    just displays it in an odd way
    That's because hash tables are not ordered; to maintain order of insertion you could use LinkedHashMap and to maintain alphabetical order TreeMap.

  • Need help with Digital Certificates when used with Adobe Acrobat

    Hi,
    I need some urgent help for one of my project. Any help or
    guidence would be very much appreciated...
    I am using Digital Certificates with Adobe Reader 6.0 and
    above and currently if I want to install the process it requires
    around 2 steps. Below are the steps.
    Once the install now button is clicked.
    Step 1. Click on set contract set.
    Step2. Click on first un check box, Adobe 7.0 or Adobe 6.0
    Step3. Click OK,
    Now the Question or issue is, I want to make the above
    mentioned steps 1 to step2 automated, once a user downloads this
    Digital certificate over the Web. Else if I can pre-select the 2
    steps for the ease of the user.
    Any help to get this automated would be much
    appreciated......Do let me know if anybody has any further
    questions...
    Pls help...and thanks for helping in advance..much
    appreciated...
    Cheers
    Ashish

    Hi Ashish,
    Since the title of your post refers to Adobe Acrobat, and the
    mention of RoboHelp is conspicuously absent, I suspect you are in
    the wrong forum. You probably need the Acrobat forum instead.
    Regards,
    Anne

  • I need help with transferring my itunes using my ipod

    Hi, I wanted to move itunes to my new computer so backed everything on to my ipod (old 30GB video), did that part fine but now when I transfer to my new computer there is nothing in the itunes folder, and my ipod is still almost full with all the information I transferred, can anyone help? Is it becasue my old somputer was windows xp and this one is vista?
    Thanks

    Open a Windows Explorer window so that it shows the iTunes folder that you dragged from the iPod to the computer (the one that is now on your computer). Run iTunes and select the Music LIBRARY in the sidebar. Drag the iTunes folder and drop it onto the iTunes windows (onto the main pane). iTunes should add the songs to the iTunes library.
    However, you may want to review the article, because it should have worked without doing the above. Make sure you copied the iTunes folder to the correct location on the computer.

  • Need help with setting a variable using actionscript

    So I am trying to import in XML and this is working fine, But
    once in flash I need to reference this variable in a later script.
    Here is what I got.
    function loadXML(loaded) {
    if (loaded) {
    /////this is the variable, which is working, it pulls the
    info from the xml document properly.
    var node1 =
    this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
    ////another variable, etc...
    var node2 =
    this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
    /////when traced it outputs the proper value.
    trace(node1);
    ////////does not work here though.
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("co.xml");
    var latmin = 37;
    var latmax = 41;
    var lonmin = -109;
    var lonmax = -102;
    this.geoPlotter_gp.setRange(latmin, latmax, lonmin, lonmax);
    this.geoPlotter_gp.setNodeSymbol("geoPloterNodeSymbol");
    this.geoPlotter_gp.addNode(40.48, -107);
    ////////////////This is where I need to now use the variables
    defined above//////////////
    this.geoPlotter_gp.addNode(node1);// Boulder
    this.geoPlotter_gp.addNode(node2);// Denver
    /////any ideas all? I am sure this is something simple...I am
    just overlooking something.

    when you prefix a variable using var within a function,
    you're making it local to that function. ie, node1 and node2 are
    undefined outside loadXML().
    to remedy, don't prefix with var.

Maybe you are looking for

  • WebAccess problem with Windows Client 8

    Hi,  We have a problem, with external access with windows 8 client Only, with the following error  The user "user@domain", on client computer "IP:33050", has initiated an outbound connection. This connection may not be authenticated yet. There's Gate

  • Oracle + php take long time

    hello partners, in this last days i've been developing an application in php + oracle 10g like database engine. i'm using oci8 extension, it's been a headache for me because a simple database request take a long time, for example: SELECT e.SECUENCIA

  • C5: simply copying mp3-files via pc and usb-cable

    I used an USB-cable and copied _folders_ with mp3-files in the music folder. The files are not found, when I try to play them. Then I copied 1 mp3-file directly under the music folder and the mp3-file could be played, but the ID3-tags were not recogn

  • How to show a JPopupMenu on a JMenuItem?

    I am trying to add a RMB context menu to an existing JMenuItem. For example Firefox has bookmark popup menus that can be "edited" by right clicking on the popup menu to say delete an entry. The code below is a sample app that demonstraits the problem

  • Mac mini G4 won't mount music CD after installing Leopard

    My Mac mini G4 has some issues mounting music CDs after installing Leopard. I did an "archive and install", everything seems to be working fine, except the CD issue. I have also applied all the relevant updates. I didn't have any issue with CDs in Ti