Detect a certain character and return it's index in the string

what's the function that detects a certain character e.g."X" in a string line and returns its index then continues to detect the next 'X" in the same line. do i also need to store them in an array?

You have to write one. Also, please stop starting new threads on this topic. This is all related to the same problem you're having, and posting so many threads makes it tough on everyone who wants to help you. It's rude, and wasteful of other people's time; namely, the folks that are actually trying to help you solve your problem.

Similar Messages

  • Hi thee.  As logical as I can be.  I export a file back into my folder as a PSD.  I then export that file to PS.  Work on it, save and return it to LR.  The file goes to the bottom of the folder from where I have to put it back in the original place, taki

    Hi thee.  As logical as I can be.  I export a file back into my folder as a PSD.  I then export that file to PS.  Work on it, save and return it to LR.  The file goes to the bottom of the folder from where I have to put it back in the original place, taking time and driving me slightly mad.  Why does the file not go back to where it came from please?  Thanks  Tim

    Umm, but this folder is an amalgam of two cameras and five cards, and I want them in capture order!  Thanks for trying though Jim.
    Cheers
    Tim

  • When I try to use the clone stamp another layer of my picture is copied on the photo I'm working on.  Is this a defect or is there a tool I can use to stop it and return to normal usage of the clone stamp?

    When I try to use the clone stamp another layer of my picture is copied on the photo I'm working on.  Is this a de@@@@fect or is there a tool I can use to stop it and return to normal usage of the clone stamp?

    The "Sample Field" letters are very dim.  After punching several times the right click revels "Clone stamp mode".  The next little circle has a line through it and after several right clicks, it says: "turn on to ignore adjustment layers when cloning,"  Despite this I cannot get any kind of a response to change any of the existing entries.  Bob
    Robert Mcdonough
    [email protected]

  • HT4623 I got the IOS 7.1 update and I don't like it. Is there any way that I can remove the update and return my software back to the way it was before I got the update?

    I got the IOS 7.1 update and I don't like it. Is there any way that I can remove the update and return my software back to the way it was before I got the update?
    Please, I really wnat to change my phone's sofeware back to IOS 7.0.6. I really don't like the IOS 7.1
    PLEASE HELP ME BEFORE THE IOS 7.1 DRIVES ME INSANE!

    Even though it wasn't me who started this thread i would like to say that i hate iOS 7.1 too
    They're back! The IOS haters.
    When you get a call it has some small icons of reminding and message and one white ugly "slide to answer" bar.*** seriously?
    People complained about the green bar in IOS 7.0.3. You can't please everyone with everything. Deal with it and move on. Or you can just get a Droid phone and suffer through the bizarre interface changes.
    A lot of people would really appreciate a release with the old interface back.
    People complained about every interface change that Apple has tried. As I said earlier, you can't please everyone with everything. The interface is what it is, learn it, deal with it, or move on to something more to your liking. I think they still make flip phones.

  • Apple tv2 stops streaming music and returns to menu page all the time

    why does my apple 2tv stop constantly while playing music and returns to the menu page. Sometimes i have to unplug it to make it work properly

    I'm having a similar problesm with Movies streamed from my Mac.

  • How can i change the method that get a Bitmap file and return 15 new Bitmaps so the new Bitmaps will be also PixelFormat Format8bppIndexed ?

    This is the method:
    public static Bitmap[] get_images_with_clouds(Bitmap radar_image)
    int e = 0;
    int f = 0;
    int image_clock_area_x = 0;
    int image_clock_area_y = 0;
    int image_clock_area_x1 = 140;
    int image_clock_area_y1 = 21;
    Bitmap[] localImages;
    localImages = new Bitmap[15];
    Bitmap image;
    image = new Bitmap(Properties.Resources.radar_without_clouds);
    BitmapData bmD = null;
    BitmapData bmD2 = null;
    try
    bmD = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
    bmD2 = radar_image.LockBits(new Rectangle(0, 0, radar_image.Width, radar_image.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
    IntPtr sc0 = bmD.Scan0;
    unsafe
    int* p = (int*)sc0.ToPointer();
    int* p2 = (int*)bmD2.Scan0.ToPointer();
    for (e = image_clock_area_x; e < image_clock_area_x + image_clock_area_x1; e++)
    for (f = image_clock_area_y; f < image_clock_area_y + image_clock_area_y1; f++)
    Color clock_color = Color.FromArgb(p2[e + f * bmD2.Width]);
    p[e + f * bmD.Width] = clock_color.ToArgb();
    image.UnlockBits(bmD);
    radar_image.UnlockBits(bmD2);
    catch
    try
    image.UnlockBits(bmD);
    catch
    try
    radar_image.UnlockBits(bmD2);
    catch
    int c;
    for (c = 0; c < localImages.Length; c++)
    localImages[c] = new Bitmap(image);
    Bitmap new_image = new Bitmap(Properties.Resources.radar_without_clouds);
    Bitmap new_image1 = new Bitmap(Properties.Resources.radar_without_clouds);
    Bitmap localbmptest = black_and_white(new_image, radar_image);
    Image image1 = black_and_white(new_image, radar_image);
    image1.Save(@"c:\temp\testclouds666.jpg");
    Bitmap clouds = new Bitmap(image1);
    int x;
    int y;
    int a;
    int b;
    int d = 0;
    Bitmap redImage;
    redImage = new Bitmap(512, 512);
    using (Graphics g = Graphics.FromImage(redImage))
    g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
    g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
    g.Clear(Color.Red);
    BitmapData bmData = null;
    BitmapData bmData2 = null;
    BitmapData bmDataArray = null;
    try
    bmData = clouds.LockBits(new Rectangle(0, 0, clouds.Width, clouds.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
    bmData2 = radar_image.LockBits(new Rectangle(0, 0, radar_image.Width, radar_image.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
    IntPtr scan0 = bmData.Scan0;
    IntPtr scan02 = bmData2.Scan0;
    unsafe
    int* p = (int*)scan0.ToPointer();
    int* p2 = (int*)scan02.ToPointer();
    double h, mm;
    for (d = 0; d < localImages.Length; d++)
    bmDataArray = localImages[d].LockBits(new Rectangle(0, 0, localImages[d].Width, localImages[d].Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
    IntPtr scan0Array = bmDataArray.Scan0;
    int* pArray = (int*)scan0Array.ToPointer();
    for (a = 0; a < new_image.Width; a++)
    for (b = 0; b < new_image.Height; b++)
    Color color1 = Color.FromArgb(p[a + b * bmData.Width]);
    Color color2 = Color.FromArgb(p2[a + b * bmData2.Width]);
    if (color1.R != 0 || color1.G != 0 || color1.B != 0)
    h = color2.GetHue();
    mm = RadarAnalysis.Hue2MMPerHour(h);
    if (mm >= treshhold_array[14 - d])
    pArray[a + b * bmDataArray.Width] = color2.ToArgb();
    localImages[d].UnlockBits(bmDataArray);
    clouds.UnlockBits(bmData);
    radar_image.UnlockBits(bmData2);
    catch (Exception error)
    try
    clouds.UnlockBits(bmData);
    catch
    try
    radar_image.UnlockBits(bmData2);
    catch
    try
    localImages[d].UnlockBits(bmDataArray);
    catch
    Logger.Write("Error Exception ==> " + error);
    MessageBox.Show("Error Exception ==> " + error);
    return localImages;
    In the end i'm getting 15 Bitmaps in localImages.
    localImages is Bitmap[]
    The method get a Bitmap and the Bitmap pixel format is: Format8bppIndexed
    I want that in the end the 15 Bitmaps in localImages will be also pixel format of Format8bppIndexed.
    The problem is that if i change everywhere in the method from: PixelFormat.Format32bppArgb to PixelFormat.Format8bppIndexed
    I'm getting exception on the line:
    pArray[a + b * bmDataArray.Width] = color2.ToArgb();
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt
    System.AccessViolationException was unhandled
      HResult=-2147467261
      Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
      Source=My Weather Station
      StackTrace:
           at mws.ImagesComparison.get_images_with_clouds(Bitmap radar_image) in d:\C-Sharp\Download File\Downloading-File-Project-Version-012\Downloading File\ImagesComparison.cs:line 469
           at mws.ScanningClouds.backgroundWorker1_DoWork(Object sender, DoWorkEventArgs e) in d:\C-Sharp\Download File\Downloading-File-Project-Version-012\Downloading File\ScanningClouds.cs:line 695
           at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
           at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
           at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
           at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
           at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
           at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
           at System.Threading.ThreadPoolWorkQueue.Dispatch()
           at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
      InnerException: 
    Line 469 is: pArray[a + b * bmDataArray.Width] = color2.ToArgb();

    Thorsten Hi,
    Too complicated for me i will try to look on it.
    Also if you will have time later maybe you could look at it too ? 
    For now what i tried was to get the returned 15 new Bitmaps to a local array:
    bitmaps = ImagesComparison.get_images_with_clouds(b1);
    for (int i = 0; i < bitmaps.Length; i++)
    ConvertTo1or8Bit.ColorToGrayscale(bitmaps[i]);
    break;
    Then make a convertion with a new class trying to convert the Bitmaps to 8 bit in the memory without saving them first to the hard disk. This is the new class:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Drawing.Imaging;
    using System.Drawing;
    using System.IO;
    namespace mws
    class ConvertTo1or8Bit
    public ConvertTo1or8Bit()
    public static Bitmap ColorToGrayscale(Bitmap bmp)
    int w = bmp.Width,
    h = bmp.Height,
    r, ic, oc, bmpStride, outputStride, bytesPerPixel;
    PixelFormat pfIn = bmp.PixelFormat;
    ColorPalette palette;
    Bitmap output;
    BitmapData bmpData, outputData;
    //Create the new bitmap
    output = new Bitmap(w, h, PixelFormat.Format8bppIndexed);
    //Build a grayscale color Palette
    palette = output.Palette;
    for (int i = 0; i < 256; i++)
    Color tmp = Color.FromArgb(255, i, i, i);
    palette.Entries[i] = Color.FromArgb(255, i, i, i);
    output.Palette = palette;
    //No need to convert formats if already in 8 bit
    if (pfIn == PixelFormat.Format8bppIndexed)
    output = (Bitmap)bmp.Clone();
    //Make sure the palette is a grayscale palette and not some other
    //8-bit indexed palette
    output.Palette = palette;
    return output;
    //Get the number of bytes per pixel
    switch (pfIn)
    case PixelFormat.Format24bppRgb: bytesPerPixel = 3; break;
    case PixelFormat.Format32bppArgb: bytesPerPixel = 4; break;
    case PixelFormat.Format32bppRgb: bytesPerPixel = 4; break;
    default: throw new InvalidOperationException("Image format not supported");
    //Lock the images
    bmpData = bmp.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadOnly,
    pfIn);
    outputData = output.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.WriteOnly,
    PixelFormat.Format8bppIndexed);
    bmpStride = bmpData.Stride;
    outputStride = outputData.Stride;
    //Traverse each pixel of the image
    unsafe
    byte* bmpPtr = (byte*)bmpData.Scan0.ToPointer(),
    outputPtr = (byte*)outputData.Scan0.ToPointer();
    if (bytesPerPixel == 3)
    //Convert the pixel to it's luminance using the formula:
    // L = .299*R + .587*G + .114*B
    //Note that ic is the input column and oc is the output column
    for (r = 0; r < h; r++)
    for (ic = oc = 0; oc < w; ic += 3, ++oc)
    outputPtr[r * outputStride + oc] = (byte)(int)
    (0.299f * bmpPtr[r * bmpStride + ic] +
    0.587f * bmpPtr[r * bmpStride + ic + 1] +
    0.114f * bmpPtr[r * bmpStride + ic + 2]);
    else //bytesPerPixel == 4
    //Convert the pixel to it's luminance using the formula:
    // L = alpha * (.299*R + .587*G + .114*B)
    //Note that ic is the input column and oc is the output column
    for (r = 0; r < h; r++)
    for (ic = oc = 0; oc < w; ic += 4, ++oc)
    outputPtr[r * outputStride + oc] = (byte)(int)
    ((bmpPtr[r * bmpStride + ic] / 255.0f) *
    (0.299f * bmpPtr[r * bmpStride + ic + 1] +
    0.587f * bmpPtr[r * bmpStride + ic + 2] +
    0.114f * bmpPtr[r * bmpStride + ic + 3]));
    //Unlock the images
    bmp.UnlockBits(bmpData);
    output.UnlockBits(outputData);
    return output;
    But they are still 32 bit. So i guess i didn't realy understand yet how to do it.

  • Is there parental controls you can place on this router to not allow activity on certain websites and times?  I know that the Netgear router does this.er

    Is it possible to restrict what sites(FB etc.)are accessed through this router and times certain devices can be allowed wifi access?

    Not directly on the router but you can setup parental controls through external/3rd party services.  For example OpenDNS allows you to setup parental controls which are managed from their site and a separate account.  Once you have OpenDNS configured you can tell your 4G LTE router and personal devices to use it as their main DNS service.
    More info:
    https://www.opendns.com/home-internet-security/parental-controls/

  • Itunes cannot play certain songs and will not add them to the library

    i have music files on both a hard drive connected to a router plus i have placed the specific files onto my mac to try to fix this issue to no avail.  while songbird, vox, and several other players will easily load correctly and do exactly what i want, itunes will not play these songs, will skip over them when i try to add to the library and will not play the file if i drag and drop, try to load it through the  "file, add to library" method.  the files are .ogg, .m4a, .mp3, .m4p, and they just will not show up. Any media players out there that will recognize an ipod so i can load these files up and get away from my mac for a while?

    @CPL_STEELE: can you try to post these specifications in your own topic? (http://discussions.apple.com/thread.jspa?threadID=985161&tstart=0)
    It's not very nice to take over someone else this topic, because the topic starter (Ganieda) could have another problem than you. It's also very confusing for everyone who is trying to help because there are now 2 problems in the same topic.
    Never the less, feel free to follow this topic if you think it could be interesting for you problem.
    Dell   Windows XP   iTunes 7.2

  • Foxfire will allow me to get on certain websites and not others. What is the problem?

    I cannot get on att.net for me email, but I can get on espn. I cannot get on Lowes.com, but can get on Walmart.com

    Not directly on the router but you can setup parental controls through external/3rd party services.  For example OpenDNS allows you to setup parental controls which are managed from their site and a separate account.  Once you have OpenDNS configured you can tell your 4G LTE router and personal devices to use it as their main DNS service.
    More info:
    https://www.opendns.com/home-internet-security/parental-controls/

  • Read from file, compare string and return a part

    Hello, is there a reasonable good way to read text file containing information, and if string comparison is successfull, return a nother part of the string.
    What i have done so far:
    set file_name to (path to desktop as text) & "filename.txt"
    set F to open for access tiedosto with write permission
    set file_information to (read F)
    close access F
    (i will be moving this to Application Support/Appname/ when i figure it out).
    The data in the file is in following format
    12234567890Name1
    98765432123Name2
    92347928347Name3
    What im stuck now is:
    I need to compare each line the 10 numbers with search string, if match is found, the name part should be returned.
    Any idea's?

    You already read in the text file, so you need to put the data thru a repeat loop:
    repeat with name_part in paragraphs of file_information
    -- ((character 1 thru 10 of name_part) as string) is the first 10 digits of name part
    if ((character 1 thru 10 of name_part) as string) is search_string then return name_part
    end

  • Void and return help

    whats the difference of using void and using the return?
    i used last time the void and return, but the outputs of the two are the same

    CodeSniffer wrote:
    raychen wrote:
    Using return within a method that returns void is just a quick way to go all the way to the end of the method. It is a goto in disguise, but sometimes it may make your code cleaner.yeah, thats what i saw when im trying to figure out whats the diff of the twoAsking about the difference between void and return is like asking about the difference between being bald and leaving your house. The two are not in any way related, and there's no context in which you can choose between one and the other.
    You're going to have to clarify your question.
    Do you know what void means?
    Do you know what return does?
    If you answered yes to both, then I really have no idea what you're confused about.

  • CRM 2007 Service Contract Determinatio and returns/complaints

    Hi gurus,
    I'm currently struggling to set up the contract determination for our CRM 2007 for complaints and returns. I have set the flag contract determination D or F (both did not work for my tests). as well in the transaction type customizing I have set und customizing header the determination to service contract.
    According to SAP help the copy control needs to be set up as well? I did not quite understand yet why, but I maintained a copy control between my contract and my return.  Any special settings needed between my source contract and target return?
    last step should be the copy control for item categories? I maintained both:
    - Define copy control for item categories
    - Define item category determination when copying
    From my contract item category to my return item category.
    But still I don't have any contract determination in my return.
    Any hints please?

    Hi Pepe,
    thanks for your answer (points rewared). I managed to get it running for complaints before you answered. Now struggling to get it for our returns running as well.
    I have a question for the copy control: What exactly has to be set up there? I guess I did for our complaints more then needed.
    1. Copy control from contract to complaint transaction type.
    2. copy control from contract item category to complaint item category
    3. Define item category while copying: done the same as in step 2.
    any special settings to consider for step 2?
    Torsten

  • Re  : Complaints and returns Management

    Hi,
    Any body could let me know about the Complaints and return Management scenario along with the customization steps involved in that.
    Best regards,
    Sathish Prabhu

    please check the following link
    http://72.14.235.132/search?q=cache:w40uqHFRpzQJ:help.sap.com/bp_crmv250/CRM_DE/documentation/C38_Scen_Overview_EN_US.pptComplaintsandreturnManagement&hl=en&ct=clnk&cd=1&gl=in
    http://help.sap.com/bp_logservicev1600/LSP_Global/Solution_Map/4EC2201A4FB44052AAE902804CB277E4.htm
    http://www50.sap.com/businessmaps/970AEE9438854CD68965805C9D7CA498.htm
    hope this helps and solves your query

  • Branch operation and return operation for routing in alternative sequence

    Hi all experts.
    I would like to ask which table and field store the value of branch operation and return operation for routing in the alternative sequence. I can only find them in structure (PLFLD-VORNR1 and PLFLD-VORNR2) but I want the table field of them. Would anyone please suggest a solution? Thank you.

    Hi,
    look in table AFFL, here the BKNT1 and BKNT2 refer to those vornr1 and vornr2 of the operation. For example in user-exit ZXCO1U01 you will find the values (BKNT1/2) in the sequence table, and when, for example, filling the LOIPRO01-Idoc, you can use the found VORNR for the E1AFFLL-segment.
    See coding for example on determining VORNR1/2 (sequence_table/operation_table as in user exit EXIT_SAPLCOBT_001):
    SORT operation_table BY vornr.
      LOOP AT sequence_table INTO l_sequence.
        MOVE-CORRESPONDING l_sequence TO l_affl.
    * Read the operation table to determine the vornr1 and vornr2
    *via the value of field BKNT1/2
        IF NOT l_sequence-bknt1 IS INITIAL.
          READ TABLE operation_table INTO l_operation
          WITH KEY aufpl = l_sequence-aufpl
                   aplzl = l_sequence-bknt1.
          IF sy-subrc = 0.
            l_affl-vornr1 = l_operation-vornr.
          ENDIF.
        ENDIF.
        IF NOT l_sequence-bknt2 IS INITIAL.
          READ TABLE operation_table INTO l_operation
          WITH KEY aufpl = l_sequence-aufpl
                   aplzl = l_sequence-bknt2.
          IF sy-subrc = 0.
            l_affl-vornr2 = l_operation-vornr.
          ENDIF.
        ENDIF.
    Cheers,
    S.

  • Making difference Messages between 'Enter' and 'Return' as in iOS

    In iOS 'Return' opens a new line; On a Mac 'Enter' and 'Return' are combined. 
    So the inputfacilities on the Mac is less than in iOS.

    "in iOS 'Return' opens a new line; On a Mac 'Enter' and 'Return' are combined.
    So the inputfacilities on the Mac is less than in iOS."
    And your question is what?

Maybe you are looking for

  • IWeb not showing templates???

    I need some help! iWeb, for some reason, isn't showing any templates. The only thing under the Site Organizer is "My Site", but nothing drops down from that. Can anyone help me find out what's going on and how to fix it? I was just on iWeb the other

  • Problems with spatial indexing

    Hi,folks, Thanks, first. When I try to build a function_based R-tree index on a table, I get the following error message. Is anyone has idea what I should look into to fix this problem. Thank you. ORA-29855: error occurred in the execution of ODCIIND

  • Previous Year Closing and current year opening Bal not matching in FS10N

    Hi for some GLs Previous year's Cumulative balance and current year's opening balance is not same. What could be the reason? For example The closing Balance for FY 2008 is Rs.125398 where as in the current year opening balance it is displayed as some

  • How do we compare two images in labview?

    I have created a back end code which is comparing two images using LABVIEW.i have used a comparator and put a tolerance factor which will help me filter out almost same images.the problem i am facing is that on subtraction of the given two images i a

  • Change document in Sales order ( VERKBELEG )

    Hi We added new feild in VBAP table & the in the data element change document checkbox is also choosen . In the Sales order the user presses a button - a popup comes & data is selected & populated in this new feild . But inspite of change document be