SOMEBODY can give me a hint !!!

If we have the input string "i am waiting for you."
and if we want to follow the following rule ie: for->4 ait->8 you->u
the input string should be changed to "i am w8ing 4 u."
(You are not allowed to use subString method)
somebody can tell me how to do it?
i am a little bit confusing.
THANKS!

  char[] buf    = new char[3];
  StringBuffer out = new StringBuffer();
    // prefill the buffer
  buf[0] = yourString.charAt(0);
  buf[1] = yourString.charAt(1);
  for ( int x = 2; x < record.length; x++ )
      // get the next character
    buf[2] = record[x];
      // do we have a string (in buffer) to replace ?
    boolean match = true;
    String test = new String( buf );
    if      ( test.equals( "for" ) )  buf[0] = '4';
    else if ( test.equals( "ait" ) )  buf[0] = '8';
    else if ( test.equals( "you" ) )  buf[0] = 'u';
    else match = false;
      // output the first character in buffer
    out.append( buf[0] );
      // if matched, then discard last two buffers
    if ( match )
      buf[1] = yourString.charAt( ++x );
      buf[2] = yourString.charAt( ++x );
      // now shuffle the buffer by one character
    buf[0] = buf[1];
    buf[1] = buf[2];
    // don't forget the last two characters in buf !
  out.append( buf[1] );
  out.append( buf[2] );The above code isn't totally correct - treat it as pseudo code and you should see the algorithm I'm suggesting.

Similar Messages

  • Somebody can give me some manual about tuxedo! thanks

    I need the tuxedo manual about its functions and atmi , api!
    so somebody can help me !
    Please give a link or post them to me mailbox !
    [email protected]
    thanks!

    http://edocs.beasys.com/more_tux.html
    "redtomy" <[email protected]> wrote:
    >
    I need the tuxedo manual about its functions and atmi , api!
    so somebody can help me !
    Please give a link or post them to me mailbox !
    [email protected]
    thanks!

  • Somebody can give me some instructions

    How should I download the products I was buy ing and pay ing

    Hi Stef Demol,
    Please quit Creative Cloud desktop application and rename the Opm.Db file within the mentioned location :
    Windows : : "Users\ {User Name} \AppData\Local\Adobe\OOBE "
    Mac: :" ~/Library/Application Support/Adobe/OOBE "
    Once done you can launch your Creative Cloud desktop application once again and it will give you the option to download. Let us know for further query.
    Regards,
    Ratandeep Arora

  • Has somebody can give me an example of LON.DLL functions program in LabView.

    thank you in advance.

    You must have the interface documentation of the DLL to create VIs interfacing that DLL.
    Go in help to "VI and Function Reference>>Advanced VIs and functions>>Call Library functions".
    Look in an answer for an example for a VI interfacing a function in shell32.dll. That's the way LV will interface to a DLL.
    I don't now the lon.dll, but if the interface will have functions which will have callback functions or pointer to structs as parameter you are forced to write a special interface DLL of your own.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Anybody can give me hand

    Big headache bother me 3 days, I run the function from SQL
    2005 even just take 0.1s, but when I try to call the function from
    the CF scripts, it loops forever, the server host CF 6.1MX, anybody
    can give me a hint how to solve it?

    Hmm, I'm not sure what to tell you than. The best you can do
    is enable as much debug/logging as possible, and start sniffing
    around on both the CF server and the DB server to identify the
    source of the problem.
    You may need to temporarily add some break points in your
    query, or in the UDF itself to try and narrow down the source of
    the problem.
    Unfortunately this is one of those things that is going to be
    difficult for anyone to remotely diagnose with the little tidbit of
    information that you provided.
    Best of luck with it, and feel free to come back and reply
    again if you think you've discovered some additional info that
    could help point us to the root cause of the issue.

  • I have made many purchase on app but when i want to made an in-app purchase of a game, it appears "your purchase could not be completed". i have disabled the restriction already but it still doesn't work. anyone can give a hint or a hand here?  cheers~~~

    i have made many purchase on app but when i want to made an in-app purchase of a game, it appears "your purchase could not be completed". i have disabled the restriction already but it still doesn't work. anyone can give a hint or a hand here?  cheers~~~

    http://www.apple.com/support/itunes/contact/

  • Moving itunes to a new pc, can somebody please give me the simple?

    just purchased a new laptop, went from XP to 7. I have read multiple postings and am comp literate, but I cannot get anything I purchased from itunes over to the new laptop. The titles, art and info go over, but I keep getting "original not found...." when I try to play the song. I can't be the first to go thru this, so if someone can give me the simple explanation I am missing it would be much appreciated.

    I am an iTunes novice myself so I won't be able to help you fully but I do know that somewhere in the iTunes app there is an option for you to "authorise" your notebook as a second valid access point to your account. You can still only sync from one computer or so I am told and I am not sure how to go about executing a complete move but I suspect loading iTunes onto the notebook and authorising the notebook might be a good place to start. I think I would then use a stick to copy all the itunes files over to the new machine just to make sure they are both the same. Take a look at the old machine to see how the directory structure and file placement system is laid out and mimic that. You may need to "import" the new directory (folder) even still. Perhaps then you would "de-authorize" the other machine but I'm not sure. I'm sure someone will have better info on the second half of the operation.

  • I'm seeking for a song in itunes. Somebody can help me?

    I'm seeking for a song in itunes. Somebody can help me?
    Name of the song: Wonderful winter day
    I think it was an itunes christmas Hit in 2010 or 2011 or 2012... I can't remember.
    I had been serching this song of a female singer for years but i can't find it.

    ''jayelbe [[#answer-670970|said]]''
    <blockquote>
    Hi FCAtrains,
    Firefox can open SVG graphics straight away - no plugins needed at all. Give it a try!
    It's best not to install plugins which are no longer supported. They can be a threat to your employer's network security.
    Have a go at opening some SVG graphics in Firefox and let us know if ypu need further help. :)
    Jayelbe
    </blockquote>
    Hi jayelbe,
    thanks for your idea but the environment I'm working in is designed to support IE and is optimized for the use of the Adobe feature. By using the IE the SVG graphics can be saved as *.svg in a dedicated folder but not so by using Firefox. The graphic window area shows no content. The file can not be downloaded.
    An additional issue is - may be - that I'm working on my home device with LINUX instead of Windows (where everything works).

  • A need to get photos of my baby from Adobe Photoshop Album Starter Edition 3.2 but I don't have a code so I cannot access in it. Somebody can help me, please?

    Two days ago I introduced photos of my baby into my PC and automatically went into the programm Adobe Photoshop Album Starter Edition 3.2. Then they were deleted of my photo camera. Then I wanted to access to the photos in the Adobe Photoshop Album Starter Edition 3.2 but I read that since the end of Juny we need a decodification code and that now it is not availabel. So I don't have this code and I need to access to the photos. Please, somebody can help me?. Thank you.

    Thank you for your help, Gunjan, but I have already tried to contact adobe tech support and I cannot get a code still now. I just find fixed issues where there is not shown my problem and I cannot find the way to write my question about my need of a code for Adobe Photoshop Album Starter Edition 3.2. Could you or somebody tell me the way to get the code through adobe.
    Thank you
    Mona05

  • My Mail programme appears to have locked up. It's showing as open in my doc but in reality I can't open it and it won't quite. If I try to shut the machine down it tells me that I need to quite mail but I can't! Any hints please?

    My Mail programme appears to have locked up. It's showing as open in my doc but in reality I can't open it and it won't quit. If I try to shut the machine down it tells me that I need to quit Mail but I can't! Any hints please?

    Open  > Force Quit and press Mail

  • Can anybody can give me an apple ID and Password for free app. only. Pleaseee

    Can anybody can give me an apple ID and Password for free app. only. Pleaseee

    http://support.apple.com/kb/ht2534
    Create an Apple ID as above.

  • Who can give me a clear picture on getCalllerPrincipal in EJB

    We keep on encountering some problems which are related with security issues. So
    I hope can get a clear picture on how it is handled inside WebLogic.
    Currently what we did is we create a common login function. Inside this function,
    we declare a local InitialContext variable and initiate the variable by passing
    in userid and password. After this program finished, the InitialContext object
    will be removed by java garbage collection.
    Our login function (JSP or Servlet) will trigger this common function to login
    a particular user. Then the function will create other InitialContext object without
    passing in any parameter. This InitialContext object will be cached in a class’
    static variable. The rest of function will use this object to look EJBs. For getting
    the best performance, we also cache the remote home interface for stateless Session
    EJB and catch home interface for Entity EJB.
    In one of our EJB function, we want to get current login user id. We use sessionContext.getCallerPrincipal()
    to get current login user id from WebLogic Realm. This is working fine in our
    in-house environment. But when we deploy our product into other project environment,
    it doesn’t work. The error scenario is
    User A login first, everything working fine. After that user A logout and User
    B login using the same browser. Then the getCallerPrincipal always return UserA.
    We try a lot of different way, but still cannot resolve this problem.
    Is it because we cached InitialContext or EJB interface? I hope some body can
    give me a clear picture on how the Web tier and EJB tier is linked by WebLogic;
    Why EJB can share the same user principal with JSP or Servlet and never confuse
    between other Web session.

    Yes, it's because you cache the InitialContext. You need to refresh the context with
    the current user's principal+credentials on each HTTP request.
    regards,
    -Ade
    "James Zhang" <[email protected]> wrote in message news:3d36975b$[email protected]..
    >
    We keep on encountering some problems which are related with security issues. So
    I hope can get a clear picture on how it is handled inside WebLogic.
    Currently what we did is we create a common login function. Inside this function,
    we declare a local InitialContext variable and initiate the variable by passing
    in userid and password. After this program finished, the InitialContext object
    will be removed by java garbage collection.
    Our login function (JSP or Servlet) will trigger this common function to login
    a particular user. Then the function will create other InitialContext object without
    passing in any parameter. This InitialContext object will be cached in a class'
    static variable. The rest of function will use this object to look EJBs. For getting
    the best performance, we also cache the remote home interface for stateless Session
    EJB and catch home interface for Entity EJB.
    In one of our EJB function, we want to get current login user id. We use sessionContext.getCallerPrincipal()
    to get current login user id from WebLogic Realm. This is working fine in our
    in-house environment. But when we deploy our product into other project environment,
    it doesn't work. The error scenario is
    User A login first, everything working fine. After that user A logout and User
    B login using the same browser. Then the getCallerPrincipal always return UserA.
    We try a lot of different way, but still cannot resolve this problem.
    Is it because we cached InitialContext or EJB interface? I hope some body can
    give me a clear picture on how the Web tier and EJB tier is linked by WebLogic;
    Why EJB can share the same user principal with JSP or Servlet and never confuse
    between other Web session.

  • Who can give me a solution about the following requirment?

    Dear All,
    The requirment is very hard for me, Perhaps you can give me a detail solution about it. I will list my confusion....thank you very much.
    (1)
    On the SRM puchase order the payment terms (BBP_PDHGP-PMNTTRMS) shall be defaulted to the supplier’s payment term.
    Where I can find BBP_PDHGP-PMNTTRMS?
    (2)
    Create an implementation of the BADI definition BBP_DOC_CHANGE_BADI and name it ZQF_PO_FLDS_DEFAULT.  This implementation will have a filter type BUS2201 for purchase order processing.
    done
    (3)
    The vendor (business partner) for a purchase order can be found in importing table parameter it_partner.  Read the table where the field  partner_fct = 00000019  (i.e. vendor).  The field PARTNER_NO contains the data for the next step.
    the table? which table? I don't know. I can't find this table.
    I check BBP_PO_CHANGE, It_partner is a Parameter only, How to find the table on requirment mentioned?
    (4)
    Use standard SAP function module BBP_PARTNER_GET_PURCH_DATA_NEW to return the purchasing information for the vendor.  Pass in the following parameter to this function:
         PARTNER_GUID = IT_PARTNER-PARTNER_NO (from previous step)
    The terms for this vendor can be found in field PAYMENT_TERMS of return parameter ET_PURCH_ORG_SET.
    Change field PMNTTRMS in exporting stucture ES_HEADER to the value returned from previous step (ET_PURCH_ORG_SET- PAYMENT_TERMS)
    (5)If no payment terms can be round for a vendor, issue an error message as detailed in the component requirement section above. (see existing shopping cart code for technical details on issuing error messages)

    Hi
    Here are the suggestions.
    <b>Every information is available in BBP_DOC_CHANGE_BADI in SE18. Create an implementation of the same in SE19 transaction.</b>
    Move the changed data in the Shopping cart, back to your internal tables, like et_item, et_partner , et_orgdata... etc.. inside the BADI Implemenataion.
      et_item[]     = it_item[].
      et_partner[] = it_partner[].
      et_orgdata[] = it_orgdata[].
    <b>1) Inside BBP_DOC_CHANGE_BADI, the payment terms will also be present in et_item [] table. Populate the required payment terms from reading the same based on the vendor number into every line item.</b>
    <b>3) et_partner [ ] table in BBP_DOC_CHANGE_BADI holds the partner details, like paetner number, partner function, partner type, once the Shopping cart is filled with atleast one line item in the et_item[] table.</b>
    4) et_orgdata[] can be changed accordingly.
    <b>5) for issuing Error message, create an implementation of BBP_DOC_CHECK_BADI and use the message as per your requirements.</b>
    Hope this will help.
    Please reward suitable points.
    Regards
    - Atul

  • Who can give me a suggestion about java crash with Internal Error ID?

    I running my server performance test, but after 7 hours, the jvm crashed and give a java internal error ID with "*53484152454432554E54494D450E43505001A8*",
    and I can not query any valuable information from Google by this internal Error ID. Who can give me a light?
    I have run the performance test on the other machine with the same service logic, the other environment not crash, It's very strange!
    h5. some content of The hs_err_xxx.log file:
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # Internal Error (53484152454432554E54494D450E43505001A8), pid=16908, tid=1060293520
    # Java VM: Java HotSpot(TM) Server VM (1.5.0_19-b02 mixed mode)
    --------------- T H R E A D ---------------
    Current thread (0x425782e8): JavaThread "11d1def534ea1be0:656f6049:124caa54ac8:49c0,EventTypeID[com.telware.protocol.cid.eve
    nt.CIDContinueEvent#telware#1.0], #14" [_thread_in_Java, id=17068]
    Stack: [0x3f2ac000,0x3f32d000), sp=0x3f32b2a0, free space=508k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [libjvm.so+0x516863]
    V [libjvm.so+0x1ca6cc]
    V [libjvm.so+0x4a3c5f]
    V [libjvm.so+0x43ceb6]
    V [libjvm.so+0x43a0c4]
    Other Threads:
    0x08e0d850 VMThread [id=16914]
    0x08e20e20 WatcherThread [id=16923]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    h6. Heap
    par new generation total 98304K, used 36214K [0x49360000, 0x51360000, 0x51360000)
    eden space 65536K, 29% used [0x49360000, 0x4a667c10, 0x4d360000)
    from space 32768K, 51% used [0x4d360000, 0x4e3b5e58, 0x4f360000)
    to space 32768K, 0% used [0x4f360000, 0x4f360000, 0x51360000)
    concurrent mark-sweep generation total 1507328K, used 974545K [0x51360000, 0xad360000, 0xad360000)
    concurrent-mark-sweep perm gen total 40152K, used 24021K [0xad360000, 0xafa96000, 0xb1360000)
    h6. VM Arguments:
    jvm_args: -Dfile.encoding=utf-8 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationConcurrentTime
    -XX:+PrintGCApplicationStoppedTime -Xloggc:/home/sepcs/sep/oper/gc.log -Xms1600m -Xmx1600m -Xmn128m -XX:SurvivorRatio=2 -XX:+
    UseFastAccessorMethods -XX:-UseFastEmptyMethods -XX:+UseFastJNIAccessors -XX:ParallelGCThreads=2 -XX:+UseConcMarkSweepGC -XX:
    UseParNewGC -XX:CMSFullGCsBeforeCompaction=1 -XX:GCTimeRatio=19 -Xnoclassgc -XX:DisableExplicitGC -XX:CMSInitiatingOccupanc
    yFraction=70 -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -Dsep.home.dir=/home/sepcs/sep
    java_command: com.telware.sep.system.SysAdmin -r -gc
    Launcher Type: SUN_STANDARD
    h6. Environment Variables:
    JAVA_HOME=/usr/jdk/jdk1.5.0_19
    PATH=/home/sepcs/sep/bin::/usr/jdk/jdk1.5.0_19/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
    LD_LIBRARY_PATH=/usr/jdk/jdk1.5.0_19/jre/lib/i386/server:/usr/jdk/jdk1.5.0_19/jre/lib/i386:/usr/jdk/jdk1.5.0_19/jre/../lib/i3
    86
    SHELL=/bin/csh
    DISPLAY=localhost:10.0
    HOSTTYPE=i386-linux
    OSTYPE=linux
    MACHTYPE=i386
    --------------- S Y S T E M ---------------
    OS:Red Hat Enterprise Linux Server release 5.1 (Tikanga)
    uname:Linux 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686
    libc:glibc 2.5 NPTL 2.5
    rlimit: STACK 10240k, CORE infinity, NPROC 31726, NOFILE 1024, AS infinity
    load average:2.05 2.35 2.23
    CPU:total 2 (cores per cpu 2, threads per core 1) family 15 model 6 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, sse3
    Memory: 4k page, physical 2009524k(54132k free), swap 1049k(1048k free)
    vm_info: Java HotSpot(TM) Server VM (1.5.0_19-b02) for linux-x86, built on May 4 2009 01:43:34 by java_re with gcc 3.2.1-7a
    (J2SE release)
    time: Sat Nov 7 02:44:28 2009

    Thank you very much first.
    I have noted that the link [t-739313] but I can not found any valuable info for my exception :(
    Yesterday night this crash has been rised again after my server running 1hours, I have analysis the core file, it's stack like this:
    {color:#008080}(gdb) bt
    #0 0xb7f4e402 in __kernel_vsyscall ()
    #1 0x00488c10 in raise () from /lib/libc.so.6
    #2 0x0048a521 in abort () from /lib/libc.so.6
    #3 0xb7990f75 in os::abort () from /usr/jdk/jdk1.5.0_19/jre/lib/i386/server/libjvm.so
    #4 0xb7a6f914 in VMError::report_and_die () from /usr/jdk/jdk1.5.0_19/jre/lib/i386/server/libjvm.so
    #5 0xb77236cc in report_fatal () from /usr/jdk/jdk1.5.0_19/jre/lib/i386/server/libjvm.so
    #6 0xb79fcc5f in SharedRuntime::continuation_for_implicit_exception ()
    from /usr/jdk/jdk1.5.0_19/jre/lib/i386/server/libjvm.so
    #7 0xb7995eb6 in JVM_handle_linux_signal () from /usr/jdk/jdk1.5.0_19/jre/lib/i386/server/libjvm.so
    #8 0xb79930c4 in signalHandler () from /usr/jdk/jdk1.5.0_19/jre/lib/i386/server/libjvm.so
    #9 <signal handler called>
    #10 0x0960527c in ?? ()
    #11 0x429f2160 in ?? ()
    #12 0x429f2158 in ?? ()
    #13 0x4cb72e48 in ?? ()
    #14 0x4cb72f28 in ?? ()
    #15 0x4cb72fe8 in ?? ()
    #16 0x00000000 in ?? (){color}
    I have print the stack from the core file, I found the crashed thread's state which indicted by hs_err_xxx.log is IN_JAVA and no stack information.
    {color:#008080}Thread 12536: (state = IN_JAVA){color}
    (no stack info.)
    {color:#008080}{color:#000000}And from the gc.log, I found that the crash occured in the CMS phase, the last gc log is :
    {color}5814.574: [GC [1 {color:#0000ff}CMS-initial-mark{color}: 829142K(1507328K)] 839697K(1622016K), 0.0281480 secs]
    Total time for which application threads were stopped: 0.0284280 seconds
    5814.602: [{color:#0000ff}CMS-concurrent-mark-start{color}]
    Application time: 1.7093670 seconds
    5816.312: [GC 5816.312: [ParNew: 108858K->8866K(114688K), 0.1133760 secs] 938001K->842222K(1622016K), 0.1135920 secs]
    Total time for which application threads were stopped: 0.1141250 seconds
    Application time: 1.4597160 seconds
    5817.886: [GC 5817.886: [ParNew: 107170K->8372K(114688K), 0.0900130 secs] 940526K->844407K(1622016K), 0.0902690 secs]
    Total time for which application threads were stopped: 0.0907340 seconds
    Application time: 1.4513060 seconds
    5819.428: [GC 5819.428: [ParNew: 106676K->8189K(114688K), 0.0871610 secs] 942711K->846695K(1622016K), 0.0873750 secs]
    Total time for which application threads were stopped: 0.0878680 seconds
    {color:#000000}All above is my found, but I am a newbie in JVM crash, so anybody can help me ?
    and I am very interesting in the Internal Error ID ({color}{color}{color:#ff0000}*53484152454432554E54494D450E43505001A8*{color}{color:#008080}{color:#000000}), I think this ID hide a lot of valuable information for SUN JDK developer, who can interpret it? Thanks very much!
    {color}{color}

  • I heard that you can give back your i pod shuffle and get a new one for free

    I heard that you can give back your i pod shuffle and get a new one for free
    but how do i do it

    Critters222 wrote:
    Yes I realize that it was a simple mistake, which is why I checked it out and apologized
    no apology needed.

Maybe you are looking for

  • Overheatin​g Qosmio x505 - Fixed!

    My Nividia GT 250m GPU on my x505 q850 was idling at 84'C.  I was worried that it could be a costly repair but found a simple cheap solution.  Simply reverse the airflow and remove the dust.  The dust got in there from one direction to reverse it.  N

  • Query data on an XML table CLOB

    Hi I'd like to query an Oracle table to extract xml attributes on xml CLOB column's please see below table structure and how can i improve performance on this table we've already created Index. Can you please assist on how to improve performance when

  • Insider/FourthElephant extension context menu not visible?

    I've deployed the extensions in the <sqldeveloper>/jdev/extensions dir, I see them listed in the extensions list, but I don't see any context menu related to the extension. I connect to a database, right click from the connections tab, and only see c

  • Site Studio Designer

    Hi, I designed a website in SiteStudio Designer.But when I try to open any of the pages in browser,it is giving error as "Page not Found".Even in the Home page,under websites,though my sitename appears,I am not able to view it.Please guide. Thanks in

  • Uploading databases created by Dreamweaver

    I have been studying a Dreamweaver book on PHP that also involves databases created in, and included with, Dreamweaver. But... where do I upload a Dreamweaver database file too... so that Dreamweaver can find it on my remote linux server? Is there a