Easiest way to...

...find a given sequence of characters in a String(ie, a word in a sentance) to use String.indexOf() iteratively?
Or is there a simple method to call for this purpose?
I seem to remember someone tellingme about a contains() method, but i cant find it in the api.
Thanks

well, String.contains() is not in the apiIt's available in 1.5.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#contains(java.lang.CharSequence)

Similar Messages

  • Web - What is easiest way to implement User Security and User Profiles

    Hi, I am new to these forums and kind of new to Java. Sorry if this is in the wrong forum!
    Bit of background to my experience with java
    I have been playing about with java for a number of years and have created a few basic programs such as a screen shot tool that allows you to capture to default locations and look at previews first etc. I am now venturing into web related stuff. I work in IT doing systems testing and have done bits of basic development on various things.
    What I've done so far
    I am using Netbeans IDE 6.7 and MySQL 5.0
    I am trying to learn more complex java and have decided to try build a basic web / database system that basically implements adding / amending / deleting data from a MySQL database through web pages. I am now trying to implement basic user access and profiles. I have so far got the following:
    - MySQL table with user info - username / password
    - JSP page with usual login stuff
    - Servlet that validates the username and password - if correct forwards to main menu page.
    Its as simple as that - there is nothing stopping you just typing in the URL of the main menu page and going from there.
    What I want
    I am wanting to eventually get the following:
    - User authentication so that you have to logon before you can access anything else
    - User profiles that determine what each user can or can't do, restricting the pages / services / options available (i.e. normal user can't delete etc)
    - Would it need some sort of session manager to allow multiple users etc?
    I appreciate this is a fairly open question but what is the easiest way to start implementing this? Not after specific code as I would prefer to try figger things out myself, but a point in the right direction would be great. It doesn't have to be extremely secure as this is just for me at the minute.
    I have spent all day looking at things like session data / url rewriting / security settings in web.xml / bespoke servlets and am now in java overload!

    Hi everyone,
    I've now actually gone back to the tutorial that I linked to above and implemented that using form login and j_security_check.
    Agree with Saish, and although I don't know enough about the other options to give a good reason, using realms and j_security_check just seems to be a bit cluncky and messy. I would also prefer something a bit more generic, that doesn't rely on setting users in glassfish, hence why I started with my own user table.
    Anyway, I will leave it as is for now and maybe come back and try one of the other options.
    The only problem I can see now is that to add users i will need to go through all the steps of adding users in glassfish and web.xml... Is there a way to do this through a servlet or something so I can have a jsp page to add users that also creats all the other bits for it to work?
    Thanks everyone for your help

  • I am using Iphoto 11 ver 9.4.3 on mac using oxs 10.8.5 i want to export calendar projects to an external hard drive. what is the easiest way to do this? i have tried export and import but it didn't seem to work.

    I am using Iphoto 11 ver 9.4.3 on mac using oxs 10.8.5 i want to export calendar projects to an external hard drive. my goal is to store them in an external hard drive so it doesn't use up memory on the mac hard drive. is it possible to copy the specific projects without copying the entire library? what is the easiest way to do this? i have tried export and import but it didn't seem to work.

    What do you not understand?
    You can duplicate the iPhoto library (command - D ) and delete everything except the project and its photos from the copy and move that
    Or
    However the calendar takes very little space - it is simpy database entries - it is the photos in the calendar that take space - and for most people you would wnat to keep those photos in your library
    you can use a photo in 50 calendars and it still is only one photo in your library - as I explained calenders do not exist as such - they are simply database entries telling iPhotop how to display the calendar - they take almost no space at all
    LN

  • What is the easiest way to check for internet connection in C#?

    Hi!
    I searched a lot but I didn't get my answer. I'm looking for the easiest way to check for internet connection. Can you help me?
    Thanks a lot.

    Hi Pouya Ebrahimzadeh,
    I suggest you could connect a site to check if it can be opened.
    Public Shared Function CheckForInternetConnection() As Boolean
    Try
    Using client = New WebClient()
    Using stream = client.OpenRead("https://msdn.microsoft.com/")
    Return True
    End Using
    End Using
    Catch
    Return False
    End Try
    End Function
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What is the easiest way to create and manage very big forms?

    I need to create a form that will contain few hundred questions. Could you please give me some advise on what is the easiest way to do that? I mean for example is it easier to create everything in Word (since it is easier to manage) and than create a form based on that?
    My concern is that when I will have a very big form, containing different kinds of questions and with many scripts, managing it during work will be slow and difficult, for example adding a question in the middle of the form which would require moving half of the questions down which could smash the layout etc.
    What is the best practise for that?
    Thanks in advance

    Try using Table and Rows for this kind of forms. These forms will have the same look throught with a question and and answer section..
    In the future if you want to add a new section, you can simply add rows in between..
    Thanks
    Srini

  • What is the easiest way to open an application from Labview?

    I need to open an application from labview and depending on a user's selection, load one out of a group of files for the application that is opened. I need to know what is the best or easiest way to open an application and load a file that is used by the application based on a selection.

    Here is the response that I got from Cognex when I asked them about how to do this. Do you understand what they are talking about?
    In order to do something like this you will probably want to look into the Display Control/SDK for In-Sight. The Display Control gets installed along with In-Sight Explorer and includes a control that can be used in an environment like Labview to communicate with In-Sight sensors while the SDK is an enhanced version of the Display Control that gives you more control and functionality. I am not very familiar with the Labview environment so I will give some code snippets in VB.Net and hopefully you can adjust them as necessary. Specifically I see 3 possible avenues to do this:
     1) Using the Display Control you have access to many of the dialog boxes that are used in In-Sight Explorer including the Load Job dialog box. You can spawn this dialog box through a line of code similar to cvsInSightDisplay1.Edit.OpenJob.Execute(). I am not certain if the Labview environment will be able to spawn and display this dialog though. 2) With the addition of the SDK (additional purchase) you can directly access sensor properties including the job. There is a method called LoadJobFile to load jobs from on the sensor and LoadJobFileLocally to load jobs from the host machine. A typical line of code might be cvsInSightDisplay1.InSight.File.LoadJobFile("myjob1.job").3) If Labview cannot handle the dialogs and the SDK is not an option for you then you may still be able to do this using Native Mode commands. Native Mode commands are sent through a socket on the telnet port (typically port 23). Keep in mind that you will need to handle the username/password prompt and response when you first open the socket before issuing any Native Mode commands. The command to load a job file from the sensor would be the Load File command which would be a string similar to "LF myjob1.job". The Native Mode commands are documented in the In-Sight Explorer help file. 

  • I want to use 1 itunes account but with 3 different iphones 2 for the kids and one for me, what is the easiest way to do that?

    I want to use 1 itunes account but sync 3 different iphones, 2 for the kids and 1 for me.  So I would like to have different programs, songs, apps etc for each phone.  What is the easiest way to do that

    Agreed heather. Also, if you have three users on the same account how do you keep phone calls and messages from going to all three phones?

  • I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    Following up on this thread,
    I have a new iMac on the way and my current is from 2008, never had a problem but I am sure there are internal issues that I would prefer not to transfer.
    I have no issues other then the slowness in certain programs and that is the main reason to buy a new one.
    Programs like numbers and pages seem to take a longer time to open after I update to Yosemite.
    I only use 272GB of 500 GB, my memory is 4GB and I am upgrading to 8Gb and bought the 4.0 processor.
    Question:
    Is there a way to manually transfer items or would that be a waste of time in that if there are issues they could be anywhere and would transfer anyway?

  • What is the easiest way to burn imovies onto DVD's.   I want to burn more than one movie onto DVD as I create.    Can I continue to burn onto the same DVD as the movies are created?

    What is the easiest way to burn my imovies onto DVD's?    I want to burn movies as I create them and then continue to add more movies to the same DVD as the years go by -- until the DVD is full!    Is this possible?

    You might also want to post this in the iMovie forum https://discussions.apple.com/community/ilife/imovie

  • What is the easiest way to transfer a large imovie project from one computer to another in a different location.

    What is the easiest way to transfer an faairly large HD imovie project from one computer to another in a different location. Can you export to drop box? Will the other computer need the exact imovie version?

    OK it depends.
    If you have a finished movie, you can SHARE/EXPORT MOVIE and create your final movie. Then, depending on the size of the finished movie, you can transfer via dropbox or similar service. Ninety minutes is a very long movie for iMovie, but it may work for you. I would suggest 720P to keep the size down.
    If you need to transfer the entire iMovie Project so it can be edited in iMovie at the other end, then you need to transfer the project and event assets to an external hard drive and get the hard drive to the other location.
    Directions are here. Follow the directions for 1) Moving or copying Project to external drive. Then 2) Consolidate Media.
    https://discussions.apple.com/docs/DOC-4141

  • Easiest Way to Copy many Files, Songs, Photos, ... From One Mac to Another?

    My daughter is about to buy a MacBook for school.
    What is the easiest way to copy files from my computer to her new one (while leaving originals in place)?
    There are three kinds of files -- documents, photos and music.
    I have a pile of cables -- USB, Firewire, Ethernet, ... -- and an external hard drive with copies of everything on my internal HD.
    Any advice?
    Thanks

    Two methods for the same result.
    Your way:
    Using the external the OP would need to connect it to the computer with all the files, then copy the files onto the external. Once the copy was finished the OP would then need to connect the external to the other computer and copy the files off.
    If the OP already has a complete back up of the original computer than the files just need to be copied off the external, so your way would be easier. But I find that I usually don't have a completely up to date backup so I assume at least a few files would need to be copied off the original computer first, anyway.
    My way:
    Connect the computers with a firewire cable. Start one in Target Disk Mode. Copy the files across. When the copy is done, restart the TDM computer. No worries about missing any files that may not be on the external backup yet.
    Which is better is simply a matter of preference and perception.

  • Easiest Way to Move Media from One External Drive to Another?

    My MacBook Pro only has a 500GB hard drive and I currently have all my movies on a 1TB external hard drive.  Everything works fine through iTunes, but now since the 1TB is maxed out, I'd like to use my new 2TB external hard drive going forward.  I understand that I need to re-route where iTunes finds the movies, but what is the easiest way to make the conversion from the 1TB to the 2TB?
    I have copied all movies from the 1TB to the 2TB.  Is the only thing left to do is re-route the location to the 2TB?  Or do I need to drag and drop all movies into iTunes (they're all already in there)?  Just didn't know if I needed to add them into iTunes again so they know to point to the 2TB drive. (sorry if I didn't explain that good!)
    Thanks in advance for your help!

    Thanks Limnos!  Really appreciate the help!
    To clarify:
    - I currently have only movies on the external 1TB drive (which iTunes points too).  The downside is that I ALWAYS have to have my external drive plugged in, in order to play on Apple TV (or view on MacBook).  I have appx. over 500GBs of movies on my external 1TB.
    - All music (appx. 200GBs) is currently on my internal hard disk, but with a 500GB internal hard drive, that's going to fill up quickly (just so you know - I already have about 125GBs of pics in iPhoto AND work in Photoshop regularly so PSDs lessen my internal 500GB space quickly).
    Eventhough I HATE having to keep an external drive plugged into my MacBook, I'm just going to have to suck it up and get used to it so I will have more space and my MacBook will run faster.
    With that in mind, I was thinking about moving my music (200GBs) onto my 2TB external drive (along with the movies).  So that would leave roughly the photos and Photoshop files (and random other things that are small in size) on my internal drive.
    I could start all over and delete all movies that are in iTunes (the application - not the folders) and then drag and drop them into iTunes from the new 2TB, but I wasn't sure all the metadata (really the cover artwork) would be attached when I did that?  Going that route really doesn't bother me since I've already copied all movies files from my 1TB to my 2TB.  Basically, I would be starting over from scratch as if the old 1TB never existed.
    Trying to run this through my mind and come up with the best/easiest way.  What I don't want to do is try and find cover artwork for the almost 300 movies I have (and all the cover artwork for the CDs I have too if I decide to keep my music on the 2TB external drive).
    Hope that helps and makes sense?  Thanks again!

  • What is the easiest way to create alias email addresses in exchange 2013?

    For example my official domain is [email protected]
    Within my company i want to make it look like certain departments are sending from bicycles.com skateboards.com
    and skooters.com and receive to those addresses even though the emails are really going through the
    [email protected] domain. but it appears to be coming from three other domains.
    appearance is everything. What is the easiest way to accomplish this.
    Step by step with examples if possible. I am not well versed in exchange server 2013 yet.
    Droid Hacker

    In Exchange 2013 you can use the ECP to add additional email addresses to mailboxes. In order for a mailbox to send using an address, that address needs to be set as the reply address. One mailbox cannot send as multiple addresses. Doing that would require
    a mailbox for each address. To set a new primary address on a mailbox log into the ECP and choose mailboxes under the recipients option on the left. Then search for the mailbox you want to add the address to and click the edit symbol. Navigate to the
    Email Address tab on the left. To set a new primary address you will likely need uncheck the box for "Automatically update email addresses based on the email address policy applied to this recipient". Then click the plus button, enter the new address,
    and check the box for "Make this the reply address"
    Before you do this you should ensure that the proper MS records exist for these other domains, and that they are properly configured for mail flow. Once you set this as the reply address for a mailbox, that is the address external users will use for replies.

  • Whats the easiest way to put a thin line around an image?

    Can anyone tell me the easiest way to put a thin line around
    an image? I'm also interested in the use of thin lines as part of
    the graphic design on a page, how are they generated?
    Thanks

    .oO(cdeatherage)
    >In Dreamweaver, you can set a border for each image but
    be aware that some
    >versions of some browsers may not display it.
    This shouldn't be an issue in any used browser today.
    >If it is a consistent look you're
    >after, I'd say the most permanent thing to do would be to
    edit the image in
    >Photoshop or Fireworks. In Photoshop, e.g, I'd create a
    background fill with
    >the color I wanted the border, then add the image,
    centered, in a new layer on
    >top of that. Merge the layers, then save optimized for
    the web.
    Way too complicated. If you want to change the color or style
    of the
    border, you have to modify the image. With CSS you can
    directly change
    the line style in a much easier and faster way.
    Micha

  • What's the easiest way to add storage to a mac mini. (1TB hard drive but only 32G of real storage). External device, internal or partitioning?

    What's the easiest way to add storage to a mac mini. (1TB hard drive but only 32G of real storage). External device, internal or is there some way to partition? I tried doing so but received a message that there wasn't enough free space to partition. Seems like a 1TB drive should have more storage than my Ipad

    Its worth confirming what free space you have on your drive: 
    go to:   Apple Menu > About this Mac >  More Info > Storage
    The bar chart shows how much free space there is on the drive:
    Please realise that partitioning does not create extra space so this wont help you.
    If your free space is less than 20 % you should get extra storage with an external USB or Firewire drive, any make or model will work.

  • What's the easiest way to move app data and data structures to a server?

    Hi guys,
    I've been developing my app locally with Apex 4.2 and Oracle 11g XE on Windows 7. It's getting close to the time to move the app to an Oracle Apex server. I imagine Export/Import is the way to move the app. But what about the app tables and data (those tables/data like "customer" and "account" created specifically for the app)? I've been using a data modeling tool, so I can run a DDL script to create the data structures on the server. What is the easiest way to move the app data to the server? Is there a way to move both structures and data in one process?
    Thanks,
    Kim

    There's probably another way to get here, but, in SQL Developer, on the tree navigation, expand the objects down to your table, right click, then click EXPORT.. there you will see all the options. This is a tedious process and it sucks IMO, but yeah, it works. It sucks mostly because 1) it's one table at a time, 2) if your data model is robust and has constraints, and sequences and triggers, then you'll have to disable them all for the insert, and hope that you can re-enable constraints, etc without a glitch (good luck, unless you have only a handful of tables)
    I prefer using the oracle command line EXP to export an entire schema, then on the target server I use IMP to import the schema. That way, it's near exact. This makes life messy if you develop more than one application in a single schema, and I've felt that pain -- however -- it's a whole lot easier to drop tables and other objects than it is to create them! (thus, even if the process of EXP/IMP moved more than you wanted to "move".. just blow away what you don't want on the target after the fact..)
    You could use oracle's datapump method too.
    Alternatively, what can be done, IF you have access to both servers from your SQL developer instance (or if you can tnsping them both already from the command line, you can use SQL*PLUS), is run a script that will identify your apex apps' objects (usually by prefix to object names, like EBA_PROJ_%, etc) and do all the manual work for you. I've created a script that does exactly this so that I can move data from dev to prod servers over a dblink. It's tricky because of the order that must be executed to disable constraints and then re-enable them, and of course, trickier if you don't consistently prefix ALL of your "application objects"... (tables, views, triggers, sequences, functions, procs, indexes, etc)

Maybe you are looking for

  • Can't be iMessages.. Maybe... Sort of...

    So I've had several iPhones and recently purchased and iPhone Six and moved from O2 to vodafone. My pac code experienced serious problems being moved but that has appeared To be resolved. However tonight I noticed that my partner (who has an iPhone 5

  • Ads intruding on my browsers

    I'm being bombarded by ads. When surfing the Internet, I constantly find myself forwarded to commercial/spam sites that I had no intention of visiting. I just discovered that when I view a web page, certain key words (e.g. "save," "computer," etc.) i

  • Using Palm III with Vista

    smkranz I am a volunteer, and not an HP employee. Palm OS ∙ webOS ∙ Android

  • ** Is it possible to run a windows .bat script job from ODI between server?

    Hello Friends, We have ODI 10.1.3.5 on a Win2003 Server. Have a windows Batch script job .bat(this is a related to a different program - DRM) on a different Windows 2003 server...is it possible to execute .bat job thru ODI between servers? Appreciate

  • Captivate 4 modify the display layer in Default.htm

    In Captivate 1, 2 and 3 I was able to modify this file: \Program Files\Adobe\Adobe Captivate 3\Templates\Publish SCORM.htm In doing so I could totally eliminate any blank areas bordering a published project. (The project flash files were wrapped in a