"return" problem

Hi, I've a problem with the return statement inside a recursive method, this is the code:
public int indexOf( String s)
smallstring = s;
int counter = 0;
if (text.length() < smallstring.length())
counter = -1;
return counter;
else
if (text.length() == smallstring.length() && text.equals(s))
counter = 1;
return counter;
else
if (text.length() > smallstring.length())
if (text.substring(0,smallstring.length()).equals(smallstring))
counter++;
return counter;
else
String t_one = (text.substring(1));
Index one = new Index (t_one);
one.indexOf(smallstring);
return counter;
I know that I have to give the return statement, but, if I put a return (return counter;) at the end of the method, the method will give me the value "0" forever at the runtime, whatever the case.
How can I solve this problem?
I'll wait for HELP!!!
Thank you

you should think about how recursion wrks. The idea is to solve some simple case, and then somehow revert all cases to the simple case. You're not doing that.
String t_one = (text.substring(1));
Index one = new Index (t_one);int index = one.indexOf(smallstring);
now "index" is the index of the small string in the substring, or -1 if the small string is not found. Knowing this, can you somehow calculate the index of the small string in the longer text?
about the return statements, if you've really considered all the cases, the control won't ever get past the if statement, so it doesn't matter what you write there. You could just aswell put "return -341;", doesn't matter the least bit. But if the control does go there, you should print an error message or raise an exception or something, because it tells you not all cases were considered and the recursion is broken.

Similar Messages

  • Ugent help with return problem

    Hello everyone,
    please can someone help me with this return problem? I'm getting a retrun error problem with this code
    public static float getVitaminPrice()
              for(int j=0;j<Vitamins.length;j++)
                        if(Vitamins[j].getCode().equals(s))
                             return Vitamins[j].getPriceByBox();               
         }

    OK thanks every one but there are things that I don't fully understand yet, just some exprience but not alot, however I'll take all the advise into consideration. I'm a person who most times only learn from examples. I have some classes called VitaminInfo, and one for Customer apart from the one that contains the main method.
    the following code is all that main contains, what I'll like to accomplish is getting back the vitamin price which was already stored in an array based on the vitamin code the user typed in.
    can you help me with that?
    public static void main(String args[])
              for(int j=0;j<Vitamins.length;j++)
                   String vitaminCode = new String(JOptionPane.showInputDialog("Please Enter the Vitamin Code"));
                   String vitaminDesc = new String(JOptionPane.showInputDialog("Please Enter the Vitamin Description"));
                   int vitaminWeight = Integer.parseInt(JOptionPane.showInputDialog("Please Enter the Vitamin Weight"+"/n" + "Vitamin Weight must be between 50 to 500 grams"));     
                   while(vitaminWeight >500 || vitaminWeight< 50){
                        vitaminWeight = Integer.parseInt(JOptionPane.showInputDialog("Please Enter the Vitamin Weight"+"/n" + "Vitamin Weight must be between 50 to 500 grams"));          
                   int vitaminPrice = Integer.parseInt(JOptionPane.showInputDialog("Please Enter the Vitamin Price"));
                   VitaminInfo vita = new VitaminInfo(vitaminCode , vitaminDesc, vitaminWeight, vitaminPrice);
                   Vitamins[j] = vita;           
              for(int j=0;j<Customers.length;j++)
                   String customerName = new String(JOptionPane.showInputDialog("Please Enter a Customer Name"));
                   String customerAddress = new String(JOptionPane.showInputDialog("Please Enter the Customer's Address"));
                   String postalCode = new String(JOptionPane.showInputDialog("Please Enter the Customer's Postal Code"));
                   Customer cust = new Customer(customerName, customerAddress, postalCode);
                   Customers[j] = cust;
              float  vprice = getVitaminPrice();
              String vcode = getVitaminOrderCode();
              int vamount = getVitaminCount(vcode);
              JOptionPane.showMessageDialog(null,"You have ordered " + vamount + " Vitamin (" + vcode + ")."+ " VitaminPrice (" + vprice + ").","Your Order",JOptionPane.INFORMATION_MESSAGE);
              showCatalog();
              showCustomers();
              System.exit(0);
         }

  • Carrier return problems within calculations

    Hi everyone
    Carrier return problems.
    I work with Numbers with Excel users, so I'm a victim of Excel.
    In my calculations I'd like to make carrier returns.
    As I understand it:
    Numbers understands: CHAR(8232)
    Exel understands: CHAR(10)
    Does anyone know of a CHAR() which both applications understand?
    Or
    Does anyone know of a calculation, so I can save it in Excel format troublelfree.
    The problem is, if I use the CHAR(8232) in an export of Excel the whole calculation is gone and only the product is left.
    Any input would be helpfull.
    Thanks.
    Jakob

    Numbers' CHAR function accepts numbers 32 and higher, except 127
    Excel's accepts the numbers 1-127
    The only solution I can think of is an error check.  In Numbers, 8232 will be used. In Excel, 13 will be used:
    IFERROR(CHAR(8232),CHAR(13))
    Note: I used 13 instead of 10 because 10 didn't seem to do anything for me in Excel.

  • Zend AMF Data Service Return Problem

    Hi Folks,
    I am working with FB4 and Zend AMF/PHP and MySQL.  I began integrating the PHP stuff using the great article by Mihai Corlan called 'Working in Flash Builder 4 with Flex and PHP.  I followed all the steps exactly, aside from creating my own app-specific PHP classes and functions, etc...  I 'hooked up' the Zend stuff just like the article, created a text datagrid, just like the article, and viola!, it worked.  I then tweaked it a bit and interwove it into my 'real' component.  So far, so good.
    Then I created a second PHP class with a different 'get data' type of function.  It queries a different table in MySQL, but is essentially the 'same' as the query/function in the initial PHP class.
    In FB, in the Data Services window, I choose the 'Connect to Data/Services' function, just like the first time.  I then find/select my PHP class file and FB 'interrogates it' enough to show me the function that exists in the class.  I 'finish' the operation and it adds a new 'service' to the list of services in that window.  Again, so far, so good.
    The problem comes when I try to 'test' the service or 'configure return types' (which basically requires a 'test' operation anyway).  I can enter the 'input' params just fine, but when I try to execute the call, I get the following error:
    InvocationTargetException:There was an error while invoking the operation. Check your operation inputs or server code and try invoking the operation again.
    Reason: An error occured while reading response sent by server. Try encoding the response suitably before sending it. e.g. If a database column contains UTF-8 characters then use utf8_encode() to encode its value before returning it from the operation.
    I don't know where to go after this.  Again - the 2nd PHP class is essentially identical to the 1st.  The function in it is essentially identical, differing only by the input params, the name of the function and the actual SQL it sends to MySQL.  There is no special text, no special characters, no image stuff, nothing.  I do not 'encode' the results of the function in the first class - in fact the code in the second class is practically identical to the first.  I do not know what the error is talking about.  My guess is that it's more of a generic message.
    I can debug the PHP code just fine from within a seperate instance of Eclipse.  The function runs/returns just fine - an array of PHP-defined objects (simple strings).
    Any insights or advice would be welcomed.   Thank you,
    -David Baron

    Thank Jorge, but that was not the issue, though, it may be related.
    I checked the mySQL my.ini file, and there was already an entry for:
    [mysql]
    default-character-set=utf8
    I added the 'default-collation=utf8_unicode_ci', like you suggested, but that didn't do anything.
    I checked the Apache httpd.conf file, and added the following line 'under' the "DefaultType text/plain" line:
    AddDefaultCharset UTF-8    but that did not do anything.
    I checked my mySQL database, all the tables involved.  They were already at UTF-8 (default).  However, some of the 'varchar' columns were defined as 'latin 1-default collation'.   I changed them all to utf-8 (default table collation), but that did not help either.
    Finally, I found the problem, though I don't really know if it is "my" problem, or ZendAMF's problem, or Adobe's problem.
    It turned out that 'some' of my data had a 'bad' character in it.  Specifically, I had 'copied and pasted' some data from MS Word into mySQL Workbench.  Some of the data included the 'elipsis' character - you know, when you type "..." (dot dot dot) in MS Word, it replaces the three periods with a single elipsis character.  Although PHP could easily query and assemble this data into a nice object array, I noticed that that character showed up (in PHP's debugger) as a 'box' character, meaning "bad character".  Thus, I guess, Zend AMF and/or FlashBuilder could not 'bring over' and/or deal with this type of character.  As soon as I replace the few instances of that character with three periods, everything began to work perfectly.
    So... what to do about this?  I thought I was through with silly encoding/decoding of data when I left JavaScript and HTML behind in moving to FlashBuilder technology.  Am I really going to have to worry about this kind of thing?  Or might this be a bug/deficiency somewhere in the stack?
    Thanks for your help,
    -David

  • XSL and carriage return problem

    I'm using an HTML form to get the input text from the user.
    The text is stored in an XML file and after that I use XSL transformation
    to show the text as HTML file.
    The problem is with carriage returns that user has entered.
    In HTML file I see &#13;
    In my java code I tried to replace all &#13; with <br> but It sounds there is no &#13; when I
    look in my XML content in a java string variable.
    Any Idea?
    Thanks,
    Payam

    Store the user-entered portion in a <![CDATA[Data goes here]]> tag to preserve whitespace and carriage returns.
    - Jesse

  • Method return problem

    Hi, please help me to see the problem I facing for my assignment.
    I need to do a few of non-duplicate random number and store them into an array. Then assign a KEY and search the array to get the index number of the array. I'm doing a linear search in a different method(not main).
    Here is the algorithm for the linear search and I need to do exactly like it.
    ALGORITHM SearchSorted(A[0..n &#8722; 1], K)
    // Searches for a given value K in a given array A of n numbers which
    // is sorted into nondecreasing order. The index of the first item in A that
    // matches K is returned, or &#8722;1 if there are no such items.
    i �� 0
    while i < n do
    if K < A[i]
    return &#8722;1
    else
    if K = A[i]
    return i
    else
    i �� i + 1
    return &#8722;1
    And here is my coding.
    public static int Linear(int A[], int K) // method called, array and key
         int i = 0;
              while(i<A.length)
              if(K<A) // will stop when array's element is greater than the key and return -1
                   return -1;
              else
                   if(K==A[i]) // will return index number of the array is key found
                        return i;
                   else
                        i = i + 1;
              return -1; // will return -1 if no match of element
         return -1; // method ask for return value, any way to get rid of this?
    The problem I facing is, each time I run it, it will only return one -1 instead of many -1 until the Key is been found.
    If I delete the last "return -1", the program can't run. If I change the last second "return -1" to "System.out.println("-1", the program can run smoothly but it will extra one more -1 at the output and i think it cause by the last return.
    What should I do to make it better? Thank you very much for helping.

    I think you should delete this line:
    return -1; // will return -1 if no match of elementWith this line the cycle will run only once.

  • SD Return problem

    Hi sap sd experts, i have a little problem where im really confused what went wrong, well i think i know what went wrong but now i have no idea how could i solve it
    The document flow is as next
                    SO->deliver->Billing....all status say complete
    then we have a return, here is where something went wrong
    The return order is just fine, but once outbound delivery start we have the following doc. flow:
                                                                     document                                                       status
                                                                   Outbound deliver       23421                             complete
                                                                         returns            23450                                  complete
                                                                                outbound delivery 302                         being processed
                                                                                    credit memo  202                           complete
                                                                                    confirmation service  200              complete
                                                                                    confirmation of service    201        complete
                                                                                    GD returns blocked      283            complete
    further information , i display document which is being processed, went to status overview and i get : Billing status (Not yet processed)
    But there is a VF already created, i go to VF03 , display doc flow of the sales order we are making the return and i get:
            document                                          status
    Credit memo 23421                               complete
                 returns  23450                          complete
                    outobund delivery  302           being processed
                            credit memo   202             completed
    The whole document flow from start to end forn the return we got
    Returns--> complete
        outbound delivery  302--> being processed
                       GD returns  Blocked 283 --> complete
    How could i process outbound delivery 302 so its complete and not being processed? I wanna do it cause the return isnt reflected in the PA, we assume its cause outbound delivery 302 is being processed ( Billing status not yet processed)
    Thanks for your time reading the post

    Your problem is after creating returns order, you created outbound delivery 302. You should use returns DO type "LR". LR has no dependency on creating credit memo.
    Outbound deliver 23421 complete
    returns 23450 complete
    outbound delivery 302 being processed
    credit memo 202 complete
    confirmation service 200 complete
    confirmation of service 201 complete
    GD returns blocked 283 complete
    further information , i display document which is being processed, went to status overview and i get : Billing status (Not yet processed)
    But there is a VF already created, -
    Here's what you should do.
    1. First DO created
    2. first Billing created
    3. Create returns order - RE
    4. Create Returns Delivery with reference to returns order. - LR
    5. Post Goods Receipt the DO
    6. Create Credit for Returns Billing - RE.
    And you will have your returns completed.

  • SQL dynamic query returning (problem with list of value)

    Hi, I'm having trouble with my query. I want to make where statement based on my selectlist, but the problem is that I couldnt write the correct string in my where condition.
    :P61_STATUS has this following display, return value
    Bewerber     Bewerber     
    PRA_Kandidat     PRA_Kandidat          
    abgelehnt     abgelehnt          
    angenommen     angenommen          
    Thema     Thema     
    angemeldet     angemeldet          
    abgegeben     abgegeben          
    abgeschlossen     abgeschlossen          
    bestätigt     bestätigt
    DECLARE
      q varchar2(4000);
      list_betreuer htmldb_application_global.vc_arr2;
      list_semester htmldb_application_global.vc_arr2;
      list_status htmldb_application_global.vc_arr2;
    BEGIN
    -- variable to store the list
    list_betreuer := HTMLDB_UTIL.STRING_TO_TABLE(:P61_BETREUER);
    list_semester := HTMLDB_UTIL.STRING_TO_TABLE(:P61_SEMESTER);
    list_status := HTMLDB_UTIL.STRING_TO_TABLE(:P61_STATUS);
    -- Query begins
    q:= 'select p1.name, p1.vorname , a1.tel, a2.tel, ';
    q:= q||'ab.thema, ab.status, ab.typ, s.bezeichnung, p2.name ';
    q:= q||'from person p1, person p2, adresse a1, adresse a2, ';
    q:= q||'zuordnungp_a zpa1,zuordnungp_a zpa2, ';
    q:= q||'abschlussarbeit ab, semester s ';
    q:= q||'WHERE ab.SEMESTER = s.OBJECTID (+) ';
    q:= q||'AND ab.STUDENT = p1.OBJECTID (+) ';
    q:= q||'AND ab.BETREUER = p2.OBJECTID (+) ';
    q:= q||'and p1.objectid = zpa1.person (+) ';
    q:= q||'and zpa1.adresse  = a1.objectid (+) ';
    q:= q||'and zpa1.art (+)= ''Privat'' ';
    q:= q||'and p1.objectid = zpa2.person (+) ';
    q:= q||'and zpa2.adresse  = a2.objectid (+) ';
    q:= q||'and zpa2.art (+)= ''Geschäft'' ';
    -- Loop for betreuer list
    FOR i in 1..list_betreuer.count
    LOOP
        IF i = 1 THEN
        q:= q||'AND (ab.betreuer = '||list_betreuer(i);
        ELSE
        q:= q||' OR ab.betreuer  = '||list_betreuer(i);
        END IF;
    END LOOP; if (list_betreuer.count>0)THEN q:= q||')'; END IF;
      -- Loop for semester list
    FOR i in 1..list_semester.count
    LOOP
        IF i = 1 THEN
        q:= q||'AND (ab.semester = '||list_semester(i);
        ELSE
        q:= q||'OR ab.semester = '||list_semester(i);
        END IF;
    END LOOP; if (list_semester.count>0)THEN q:= q||')'; END IF;
    -- Loop for status list
    FOR i in 1..list_status.count
    LOOP
        IF i = 1 THEN
        q:= q||'AND (ab.status = '||list_status(i)||'';
        ELSE
        q:= q||'OR ab.status = '||list_status(i)||'';
        END IF;
    END LOOP; if (list_status.count>0)THEN q:= q||')'; END IF;
      htp.p(q);
    return q;
    END;result
    select p1.name, p1.vorname , a1.tel, a2.tel, ab.thema, ab.status, ab.typ, s.bezeichnung, p2.name from person p1, person p2, adresse a1, adresse a2, zuordnungp_a zpa1,zuordnungp_a zpa2, abschlussarbeit ab, semester s WHERE ab.SEMESTER = s.OBJECTID (+) AND ab.STUDENT = p1.OBJECTID (+) AND ab.BETREUER = p2.OBJECTID (+) and p1.objectid = zpa1.person (+) and zpa1.adresse = a1.objectid (+) and zpa1.art (+)= 'Privat' and p1.objectid = zpa2.person (+) and zpa2.adresse = a2.objectid (+) and zpa2.art (+)= 'Geschäft' AND (ab.status = abgegeben) the problem is in this statement
    q:= q||'AND (ab.status = '||list_status(i)||'';that statement produce this following statement
    ab.status = abgegebenbut what I need is this statement
    ab.status = 'abgegeben';how can I achieve this statement?
    thank you very much

    raitodn wrote:
    ah ok , I was confused with this q:= q||'AND (ab.status = '''||list_status(i)||'''';I think I get it now
    basically stop the string and write double quotes before the variable
    'AND (ab.status = ' + ''||list_status(i)||'' + ''No, more like "wherever I want a single quote within a string, I put two single quotes instead and that tells oracle it's a quote and not the end of the string".
    q:= q||'AND (ab.status = '''||list_status(i)||'''';
           ^                 ^^^                  ^^^^
           |                 |/|                  ||/|
           |                 | |                  || \-- single quote indicates end of string
           |                 | |                  ||
           |                 | |                  |\-- two quotes indicate a single quote required
           |                 | |                  |
           |                 | |                  \-- single quote to open a new string
           |                 | |
           |                 | \-- single quote indicates end of string
           |                 |
           |                 \-- two quotes indicate single quote required
           \-- Open String

  • MIX sale return problem(query not giving required result)

    i have written following query which is running sucessfully.the concept behind this query is to get a exact quantity of sold items after subtracting the sale return from the sale.now the problem is that when user take sale return against invoice then this query providing ok result but when user take sale return against MIX items not knowing exactly the invoice then query is not showing result means not subtracting MIX sale from sale.please help me to get required result from this query.
    i m using oracle 9i with developer 6i
    select s.price,s.item_code,S.DESCR,
    sum(decode(d.MONno,01,NVL(S.QTY,0),0)) JAN,
    sum(decode(d.MONno,02,NVL(S.QTY,0),0)) FEB,
    sum(decode(d.MONno,03,NVL(S.QTY,0),0)) MAR,
    sum(decode(d.MONno,04,NVL(S.QTY,0),0)) APR,
    sum(decode(d.MONno,05,NVL(S.QTY,0),0)) MAY,
    sum(decode(d.MONno,06,NVL(S.QTY,0),0)) JUN,
    sum(decode(d.MONno,07,NVL(S.QTY,0),0)) JULY,
    sum(decode(d.MONno,08,NVL(S.QTY,0),0)) AUG,
    sum(decode(d.MONno,09,NVL(S.QTY,0),0)) SEP,
    sum(decode(d.MONno,10,NVL(S.QTY,0),0)) OCT,
    sum(decode(d.MONno,11,NVL(S.QTY,0),0)) NOV,
    sum(decode(d.MONno,12,NVL(S.QTY,0),0)) DEC,
    sum(S.qty) TU
    FROM
    (select nvl(sales_detail.qty,0)+NVL(sales_detail.bonus,0) as qty,
    sales_detail.item_code AS ITEM_CODE,stock_reg.price price,
    stock_reg.descr AS descr,
    s_date as sale_date FROM
    SALES_DETAIL,SALES_HEADER,STOCK_REG
    WHERE SALES_DETAIL.S_ID = SALES_HEADER.S_ID AND
    SALES_DETAIL.STOCKCODE = STOCK_REG.STOCKCODE AND
    STOCK_REG.COMCODE=:COM AND
    STOCK_REG.GROUPID = :GID
    UNION ALL
    SELECT -1*QTY,ITEM_CODE,PRICE,DESCR,SALE_DATE FROM
    (select nvl(sales_detailR.qty,0)+NVL(sales_detailR.bonus,0) as qty,
    sales_detailR.item_code AS ITEM_CODE,stock_reg.price as price,
    stock_reg.descr AS descr,
    RETURN_date as sale_date FROM
    SALES_DETAILR,SALES_HEADERR,STOCK_REG
    WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
    SALES_DETAILR.STOCKCODE = STOCK_REG.STOCKCODE AND
    STOCK_REG.COMCODE=:COM AND
    STOCK_REG.GROUPID = :GID
    UNION ALL
    select  -1nvl(sales_detailR.qty,0)+NVL(sales_detailR.bonus,0) as qty,*
    sales_detailR.item_code AS ITEM_CODE,stock_reg.price as price,
    stock_reg.descr AS descr,
    RETURN_date as sale_date  FROM
    SALES_DETAILR,SALES_HEADERR,STOCK_REG
    WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
    SALES_DETAILR.STOCKCODE = STOCK_REG.STOCKCODE AND
    SALES_HEADERR.S_ID = 'MIX' AND
    STOCK_REG.COMCODE=:COM AND
    STOCK_REG.GROUPID = :GID)) S,
    (select level as MONno
    from dual
    connect by level <= 12) d
    where d.MONno = to_char(s.sALE_date, 'MM') AND trunc(S.SALE_DATE,'MONTH') BETWEEN TO_DATE(:FDATE,'MMYY') AND TO_DATE(:TDATE,'MMYY')
    GROUP BY S.ITEM_CODE,S.DESCR,S.PRICE
    ORDER BY S.DESCR ASC

    Gaurav,
    Can you print all the binding variables and update the ouput here.
    And I didn't get this date format 'dd-mon-rrrr', normally it will be like 'dd-mon-yyyy' right?
    Thanks,
    With regards,m
    Kali.
    OSSI.

  • Market Place is a scam! Ridiculous return problems! I feel betrayed an tricked by Best Buy!!!!

    I didn't even know there was a Market Place!  Until I just tried to return something I purchased online to Best Buy local Store.  Imagine my surprise as an Elite PLus Member when they told me I had to contact each vendor individually to return something I purchased from BestBuy.com.  Thats when they showed me the teeny tiny little bitty blurb of text on the item page that said sold by xyz company.  I'm busy ordering a bunch of stuff online for Xmas.  How am I suppose to stop and read every blurp of text on a Bestbuy.com website to see if they changed how they sell stuff they apparently don't offer at Best Buy but is instead sold by shady third persons.  I shop at Best Buy because I know Best Buy policy and return procedures.  I like their customer service in the local store.
    If I wanted to buy crap from third party vendors, then have to pay to send it back to them, I'd buy from a catalog sold at the corner magazine rack.  I shouldn't have to endure this sort of process from Best Buy.  (removed per forum guidelines) who blatantly shows you that your not buying from (removed per forum guidelines) will handle your problem like you did buy it from (removed per forum guidelines) and even ship it back to (removed per forum guidelines) on their dime!!!!!
    I feel what Best Buy did was sneaky, deceptive, and in no way what I'd expect as a long time customer.  That fact that I have to find each indiviually seller I purchased from, call or email them to ask for a return request, assuming I don't have to call or email several times to get ahold of them.  Then to make me have to pay to return the item???  Becuase I can't take it to a Best Buy store to return it as I have always been able to do?!!!
    This is the last time I buy anything online from Best Buy.  At least if I buy it in the store I know I can return it if I need to.  Not sure I even want shop again with Best Buy after this!!!  I already warned all my Friends on Facebook an twitter about what has happened.
    I should write a article an post to (removed per forum guidelines) an see if they will run the article so others won't have to endure what I'm going through.
    Listen up Best Buy!!!  If I wanted to purchase from shady third parties I would!!!  But I don't want to.  I shop Best Buy because I can return it to the store!  If I have a problem or I can call Best Buy customer service an they take care of it.  I don't want to deal with some third party shady shop in NY running a business in the subway station on his cellphone.
    NOT a happy customer!!!  The fact I have so much run around to return two items I purchased from what I thought was my normal Best Buy dot com store an instead was some third party yahoo people who make me pay to return it after three days of trying to get a hold of one of them pisses me off.  The fact I still haven't heard from the second vendor after emails and phone calls really annoys me.  Even your own customer service can't get ahold of the business.  Just a message machine where no one calls you back.
    You just lost an Elite Plus Member!!!

    Hello Mav2u,
    I was very disappointed to read about your experience in attempting to return your Marketplace purchases from BestBuy.com. I apologize for any confusion about Best Buy Marketplace purchases and our approved third-party retailers who make their products available on our website.
    We do our best to inform you on our website which products are sold by Marketplace partners and who those partners are. All you have to do is roll your pointer over the word "Marketplace" for a description of what that means. For even more details, you can visit our What is Best Buy Marketplace? page.
    I'm disheartened to read that this experience may influence your future shopping destination. It's my hope that you will give BestBuy.com another chance to win you over one day soon.
    Thank you for writing to us and for your feedback on Marketplace.
    Sincerely,
    John|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Fibonacchi/ return problems

    No matter how I try to rearrange things the output always comes to 0.0
    import java.awt.*;
    import javax.swing.*;
    * Class Fibonacchi - write a description of the class here
    * @author (your name)
    * @version (a version number)
    public class Fibonacchi extends JApplet
        // instance variables - replace the example below with your own
        double n, answer, equation;
         * Called by the browser or applet viewer to inform this JApplet that it
         * has been loaded into the system. It is always called before the first
         * time that the start method is called.
        public void init()
            // this is a workaround for a security conflict with some browsers
            // including some versions of Netscape & Internet Explorer which do
            // not allow access to the AWT system event queue which JApplets do
            // on startup to check access. May not be necessary with your browser.
            JRootPane rootPane = this.getRootPane();   
            rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
            // provide any initialisation necessary for your JApplet
        public double equation (double n) {
            n = 7;
            if (n < 1)
                return 0;
                else if (n == 1)
                    return 1;
                        else
                            return ((n-1) + (n-2));
         * Paint method for applet.
         * @param  g   the Graphics object for this applet
        public void paint(Graphics g)
            g.drawString("Sample Applet " + equation, 20, 20);  //Option 1 I was hoping would work with variable 'equation'
            g.drawString("Sample Applet2 " + n, 20, 40);    //Option 2 I was hoping would work with variable 'n'
    }

    I think I am having a problem understanding how the overall structure of this applet is supposed to be organized. I am trying to write a recursive function to calculate the Fibonacchi number from a number where if:
    f(n) = 0, if n < 1
    f(n) = 1, if n = 1
    f(n) = f(n-1) + f(n-2), if n > 1
    It seems like it should be a very simple process for me but I could use some pointing in the right direction. I've been going through the java tutorials looking for some clues, hopefully something in my mind starts clicking.

  • Carriage Return Problem

    Hello,
    I have written some code which extracts data from a MySQL
    database and stores it in a CSV file using CFFILE.
    However, the database includes data inserted from an HTML
    textarea form element which is stored in a MySQL text field. The
    textarea data includes carriage returns which, when written to a
    CSV file, force a new line which makes the data messy.
    Is there a way of removing the carriage returns?
    Many thanks,
    Simon

    I recently had to deal with a similar situation. The
    differences are:
    1. My file is pipe delimited.
    2. My source data comes from a vendor application, not an
    html form.
    The following code worked for me.
    <cffile action="write" nameconflict="overwrite"
    addnewline="no" output=""
    file="d:\dw\dwweb\work\#CaseFileName#">
    <cfoutput query="casedata">
    <cffile action="append"
    file="d:\dw\dwweb\work\#CaseFileName#"
    output="#caseid#|strip a bunch of
    fields|#theatre_mcase#|#Replace(pre_op_diag, chr(10), ' ',
    'all')##chr(13)#">
    </cfoutput>

  • Exisable Purchase Item Return problem

    Hello
    I have Item that only Purchase item & Inventory Item
    I raised the AP Invoce for that Exisable Item but all material will return so i create goods return then copy to outgoing Exise invoice that time i have a error that the item is not a sale item
    my item is not a sale item it only purchase item
    so how i return exisable purchase item to reverse all exisable effect?

    HI
    You have raised AP Invoice so post the AP Credit memo to return the goods.
    AP Credit memo will automatically post Out Going Excise invoice..
    Return document will come into picture only when post the target document as GRPO....
    Edited by: kambadasan on Oct 11, 2011 2:26 PM

  • Batch return problem

    Suppose for production order no. 123 of qty 1000 EA i had issued material for 800 EA but when production had started i had used only 500 EA & now i wish to transfer 300 EA again in unrestected stock .From where i will come to know about records against that production order . How to do this setting ?

    thnx for your promptly reply, but my problem is not solved. I shall explain you the exact situation.
    Thru MIGO i am issuing material (Raw Mat , Packing Mat, etc...) to prdn order. Now after prdn I might get remaining matrial from prdn dept.
    Now I want that material should go in my unresticted stcok. So for that, which transaction should be used ???
    Secong Issue - While issuing material to prdn order, in the detail screen tab, I hv to enter batch number, in help screen (F4) i get all the batches which are already consumed. Here i want only pending batched which are having stock.
    I am expecting the early reply from your side.

  • Carrier return problem, how to remove CR

    Hi, I just created a BSP page that should upload a CSV file in its original state to the application server.
    for example, there are 3 columns in my original .CSV file separated with ; ->
    12412,22;2342,32;1000,40
    1000,32;3444,31;4500,11
    right now, it is uploaded in the following format instead of the one above
    12412,22;2342,32;1000,40#
    1000,32;3444,31;4500,11#
    The problem is, that when I use this file from the application server, it gives errors on the last fields, because it thinkgs it should take 1000,40# instead of 1000,40 as an amount.
    This problem would be solved, if data was loaded without adding the # after every row.
    Data is loaded from my pc to the application server using a BSP with the following code:
    write file to server
    fname = '/usr/sap/CBD/DVEBMGS03/data/RU_BRA_PRO.CSV'.
    OPEN DATASET fname FOR OUTPUT in BINARY MODE.
    if sy-subrc gt 0.
    WRITE: / 'Error opening file'.
    endif.
    TRANSFER file TO FNAME.
    CLOSE DATASET FNAME.
    What do I have to do (sorry, ABAP&BSP newbie) to upload the file in its original state, to avoid the # being added...
    thanks

    Thanks to Eddy, this issue has been solved. The solution, when writing in TEXT MODE, was to define the input file as type STRING and reading it using get_Cdata instead of get_data.
    here is the full code, so that people that are not programming guru's can get something out of this too! Eddy, thanks a 1000 !
        data: entity         type ref to if_http_entity,
              file           type string,
              content_type   type string,
          content_length        type string,
              num_multiparts type i,
              i              type i value 1,
              doEcho         type string,
              value          type string.
      find multipart containing file
        num_multiparts = request->num_multiparts( ).
        while i <= num_multiparts.
          entity = request->get_multipart( i ).
          value = entity->get_header_field( '~content_filename' ).
          if not value is initial.
          found a file!
            navigation->set_parameter( name  = 'content_filename'
                                       value = value ).
            content_type = entity->get_header_field( 'Content-Type' ).
            navigation->set_parameter( name  = 'content_type'
                value = content_type ).
          get file content
            file = entity->get_cdata( ).
          get file size
           content_length = xstrlen( file ).
            navigation->set_parameter( name  = 'content_length'
                value = content_length ).
    data: data_TAB type table of string, LIN TYPE LINE,fname type string.
    split file at CL_ABAP_CHAR_UTILITIES=>CR_LF into table data_TAB.
    fname = '/usr/sap/CBD/DVEBMGS03/data/FILENAME.CSV'.
    OPEN DATASET fname FOR OUTPUT in TEXT MODE encoding default.
    if sy-subrc gt 0.
    WRITE: / 'Error opening file'.
    endif.
    LOOP AT data_TAB INTO LIN.
    TRANSFER LIN TO FNAME.
    ENDLOOP.
    CLOSE DATASET FNAME.

Maybe you are looking for

  • Session management problems with SSO

    Hi all- I've been getting an Apex app tied to SSO as a partner app (per http://www.oracle.com/technology/products/database/application_express/howtos/sso_partner_app.html). So far, it sort of works. If I go to my apex app, it redirects me to SSO, whe

  • MBP and 30" ACD

    I have a new 15" MBP that I use with a 30" Apple Cinema Display. Every few days, while I'm working, the monitor goes black. If I unplug EITHER of the two inputs from the MBP - the display plug or the USB plug - the display comes right back on and wor

  • Is workflow reporting available in SharePoint 2013?

    Is there any reporting around workflows for SharePoint 2013? It appears (based on various posts) that there was a link called "View Workflow Reports" available in 2010 but that it was removed for 2013. My customer would like to see statistics on acti

  • Cannot open attachments ipad

    Only the first attachment of an incoming mail can be stored. Any idea

  • 9iasR2 install infra on Windows and rest on Lixux

    I would like to install the infrastructure into pre-existing Windows database, and the app server itself onto Linux. My quetions are... 1. Can I install infrastructure into a pre-existing database rather than create a new one? 2. I have the Linux 9ia