Find strings in a list using startsWith?

Hi I hope someone can help me with this problem. Before I start, my apologies as I am a student still trying to learn Java and have got to the murky ground of data structures.To help me better understand this I tried a sample program (which surprisingly was working fine til now ha). So I have a list of songs by various artists added to a tree which begins with the singers name. I want to be able to isolate songs by a particular artist but have tried loads of different ways of doing it to no avail. I tried creating a new list but couldn't add my songs to it. I then found the remove() method and thought why not just find what I want and remove the rest from the list I can always recreate my list again after. So I think I'm close with my code and that's it's maybe a casting issue??
String song = songTree.getElement(currentNode);
List<String> list = MyCollection.getSongs(song);
// List newList = new ArrayList();
String check = new String("Pearl Jam");
Iterator myIter = list.iterator();
while (myIter.hasNext()){
if (myIter.next().!startsWith(check)){
// newList.add();
else{
list.remove();
Edited by: jojololo on Nov 9, 2009 11:35 AM

jojololo wrote:
Before I start, my apologies as I am a student still trying to learn Java and have got to the murky ground of data structures.No need to apologize, as long as you are clear in your communication. Why would we be here except to help? (Well okay, to amuse ourselves...)
To help me better understand this I tried a sample program (which surprisingly was working fine til now ha). So I have a list of songs by various artists added to a tree which begins with the singers name. I want to be able to isolate songs by a particular artist but have tried loads of different ways of doing it to no avail. I tried creating a new list but couldn't add my songs to it. Why not? What happened when you tried? This is probably the right way and should definitely work, so let's isolate the problem there.
I then found the remove() method and thought why not just find what I want and remove the rest from the list I can always recreate my list again after.Nah that doesn't seem like a reasonable idea. Let's go back to creating a new collection to hold your isolated subset.
Post an SSCCE of your atte this stagempt at using a new list, and tell us where it goes wrong and what you expect it to do instead. Be sure to use the CODE button in the editor to format your code.
Sorry didn't really answer your questions very well with my post;
I've tried so much at this stage I don't even remember what went wrong. basically in the try I posted just now the startsWith method is not recognised. I'm aware that I'm trying to compare an object reference to a string but thought I had dealt with that with my casting? I think my subset would be saved here in the new collection but again I'm missing something in the comparisment. Oh sometimes I feel like packing in the java! We do far too much theory and nowhere near enough actual coding.
import java.util.*;
public class Test {
    public static void main(String[] args){
        List variousArtists = new ArrayList();
        // Some intentionally doubled to ensure only one gets put on the tree later           
        variousArtists.add("Pearl Jam - Even Flow");
        variousArtists.add("U2 - The End Of The World");
        variousArtists.add("The Smashing Pumpkins - Spaceboy");
        variousArtists.add("Pearl Jam - Alive");
        variousArtists.add("The Smashing Pumpkins - Quiet");
        variousArtists.add("Pearl Jam - Black");
        variousArtists.add("U2 - The End Of The World");
        variousArtists.add("Radiohead - Street Spirit");
        variousArtists.add("U2 - One");
        variousArtists.add("Radiohead - Street Spirit");
        variousArtists.add("Radiohead - Street Spirit");
        variousArtists.add("The Smashing Pumpkins - Mayonaise");
        variousArtists.add("U2 - Mysterious Ways");
        variousArtists.add("The Smashing Pumpkins - Hummer");
        variousArtists.add("Pearl Jam - Even Flow");
        variousArtists.add("The Smashing Pumpkins - Disarm");
        variousArtists.add("U2 - One");
        variousArtists.add("The Smashing Pumpkins - Quiet");
        variousArtists.add("The Smashing Pumpkins - Mayonaise");
        variousArtists.add("Pearl Jam - Black");
        variousArtists.add("The Smashing Pumpkins - Mayonaise");
        variousArtists.add("Pearl Jam - Even Flow");
        variousArtists.add("Radiohead - Street Spirit");
        variousArtists.add("U2 - The End Of The World");
        List newList = new ArrayList();
        String check = new String("Pearl Jam");
        String search;
        Iterator myIter = variousArtists.iterator();
              while (myIter.hasNext()){
     search = (String) myIter.next();
           if (myIter.next().startsWith(check)){
                 newList.add(myIter);
}   

Similar Messages

  • Linked list to string coercion doesn't use text item delimiters: bug?

    set AppleScript's text item delimiters to {"; "} -- well-known technique
    {1, -1, "c", "d"} as string -- curly braces specify a vector, delimiters work
    -- result: "1; -1; c; d"
    {1, -1, "c", "d"} as linked list as string -- if coerced to linked list, delimiters ignored
    -- result: "1-1cd"
    [1, -1, "c", "d"] as string -- square brackets specify a linked list, delimiters ignored
    -- result: "1-1cd"
    [1, -1, "c", "d"] as vector as string -- coercing linked list to vector first works
    -- result: "1; -1; c; d"

    Hello
    It appears that linked list to string coercion does not respect the AppleScript's text item delimiters which are set to list of Unicode text. (Unicode TIDs have no effects in coercion as if it were set to {""})
    I can confirm this behaviour in both AppleScript 1.8.3 (OS9) and 1.9.1 (OSX10.2.8) at hand.
    So it has been as such for a long time. Bug I'd call it.
    By the way, although this is not the point, linked list is a historical residue and of little use in real scripting. After all, it is much slower than vector with appropriate coding. So we may always coerce it to vector without losing anything.
    Regards,
    H
    Linked list to string coercion & AppleScript's text item delimiters (TIDs).
    When AppleScript's TIDs are set to list of Unicode text,
    the TIDs have no effect in coercion from linked list to string as if they were set to {""}.
    set aa to [1, 2, "a", "b"]
    --set aa to {1, 2, "a", "b"} as linked list
    set t1 to list2text(aa, ";") -- "1;2;a;b" -- in pre-AppleScript 2.0
    set t2 to list2text(aa, ";" as Unicode text) --"12ab"
    return {t1, t2}
    on list2text(aa, delim)
    list aa : source list
    string delim : a text item delimiter
    return string
    local astid, astid0, t
    set astid to a reference to AppleScript's text item delimiters
    set astid0 to astid's contents
    try
    set astid's contents to {delim}
    --set t to aa as string
    --set t to aa as Unicode text
    set t to "" & aa
    set astid's contents to astid0
    on error errs number errn
    set astid's contents to astid0
    error errs number errn
    end try
    return t
    end list2text

  • String convert to list

    Hello:
    I need to convert a string in a list, I mean:
    I have this
    text1="list1"
    text2="list2"
    Now I need to use like parameters.
    Showlist text1
    On Showlist vlist
    list1=[1,2,3]
    list2=[A,B,C]
    put vlist --I need to show the content on list1 or list2
    end
    Can you help me please?
    Thank you

    Hi Arielle,
    There are three of ways to do it
    1. Use a propList (probably the best approach is you have a
    reasonably large list of lists)
    On Showlist vlist
    lookupList = [:]
    lookupList [&quot;list1&quot;]=[1,2,3]
    lookupList [&quot;list2&quot;]=[A,B,C]
    put lookupList .getAProp(vlist)
    end
    2. Use a case statement (best for a small list of lists)
    On Showlist vlist
    case (vList) of
    &quot;list1&quot;: out = [1,2,3]
    &quot;list2&quot;: out =[A,B,C]
    otherwise
    put &quot;Cannot find list &quot; &amp; vList
    end case
    put out
    end
    3. Use Lingos &quot;value&quot; command
    on Showlist (vList)
    aList = value(vList)
    -- now do some error checking
    if listP(aList) then put aList
    else put &quot;Error evaluating vList&quot;
    end

  • Rename finder item withouth user to choose find string.

    Hi,
    I've built an automator workflow in wich I create a standard folder /w subfolders. Automator then renames the folders, by rename finder item with replace text.
    The new name is a projectname an user can give in. But I don't want the user to change the find string. Is there a way to work this out?
    I've tried to do an ask for text, but I don't know to how I can put the result into the replace field?
    Thx,
    Marlon
    Powerbook G4 (1Ghz)   Mac OS X (10.3)  

    I figured out a way to use variables in the Rename Finder Items.
    In my case I want to rename the files to a sequential name. I can't link the variable to the "New Name" box in the Automater GUI.
    But it helps to know that that the Automator is just creating an XML file and you can edit this directly.
    To do this, create the Automator workflow and save it. Give the variable some distinct name like "myVariable".
    In Finder, right click the Automator file and select Show Package Contents. Within this folder go to Contents and find the document.wflow file. This is the XML file, so open it with TextEdit or something.
    Search the file for your variable name. The first instance of it should be in a section that starts with <key>variables</key>. All the variables will be listed here. Each variable has several lines to define it. The first will be the UUID. The UUID will have a line that is something like: <string>BD464B7A-ACDE-4A63-B595-FAF1DA6DE26E</string>. The BD464B7A-ACDE-4A63-B595-FAF1DA6DE26E is how Automator refers to your variable. Search the file for this UUID string and you will see. Whenever Automator wants to insert the variable, it will enter $(BD464B7A-ACDE-4A63-B595-FAF1DA6DE26E).
    Copy this string, with the $() surrounding it. Close the wflow file. Now you can go back to Automator itself and paste it wherever you want your variable to appear, even if you can't normally insert the variable into that field.

  • How to find out the user list that created by someone?

    Hi all:
    Now I want to develop a program that can find out the user list created by someone.
    such as :
    John create 3 user in SAP ,they are u1,u2,u3.
    Susan create 2 user in SAP , they are s1,s2.
    I input the the parameter such as John , the program can give me the list :u1,u2,u3.
    Could you tell me which table should I use in this program?
    Thanks .
    Elisa.

    Hi Ling,
    As per my understanding, you are looking for listing down the number of Users created by a particular users of the System. Like a System Administrator has created some 30 users. If this is correct, then you can use the table
    USR02 - Logon Data (Kernel-Side Use). This table has 2 fields which are of importance - BNAME - User Name in User Master Record & ANAME - Creator of the User Master Record. You can query the ANAME with the username of the system and you will get the resultant users.
    But I would reccomend to search the Table for a standard class, function module or RFC or BAPI so that you can reuse the same and need not to develop from the scratch.
    Hope this will help.
    Thanks,
    Samantak.

  • I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record?

    I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record of the articles I intend to read?

    I'm currently dealing with this issue myself, except that my rMBP has NO articles in the reading list.  It's a brand new rMBP too, purchased just this week, with the 2.6 Ghz Processor & 16GB of RAM.
    Let's see what we can find.  I may just take it back to the Apple Store.

  • Exception [EJB - 10008]: Cannot find bean of type [SalesBean] using finder

    I'm trying to call an entity bean froma session bean i get the error :-
    7/02/27 14:35:25 javax.ejb.ObjectNotFoundException: Exception [EJB - 10008]: Cannot find bean of type [SalesBean] using finde
    [findByCustID].
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.EJBExceptionFactory.objectNotFound(EJBExceptionFactory.java:325)
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.finders.Finder.checkNullResult(Finder.java:224)
    My session bean looks like this :-
    public class HelloBean implements SessionBean
      public String helloWorld (String pzCustomerID) throws SQLException,RemoteException
         String lzRevenue=null;
         int liCustomerID=Integer.parseInt(pzCustomerID);
         try
              Context initial = new InitialContext();
              Object objref =   initial.lookup("SalesBean");
              SalesHome salesHome =(SalesHome) PortableRemoteObject.narrow(objref,SalesHome.class);
              Sales sales=salesHome.findByCustID(liCustomerID);
              lzRevenue=(String) sales.findByCustID(liCustomerID);
    My entity bean looks like this:-
    public class SalesBean implements EntityBean
      public String factPK;
      public int timeID;
      public int custID;
      public int locID;
      public int itemID;
      public int entityID;
      public String currency;
      public float qty;
      public float unitPrice;
      public float amount;
      public EntityContext context;
      private Connection con;
        private void makeConnection() {
            try {
                InitialContext ic = new InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource) ic.lookup("jdbc/DSource");
                con = ds.getConnection();
            } catch (Exception ex) {
                throw new EJBException("Unable to connect to database. " +
                    ex.getMessage());
      public SalesBean()
      public String ejbFindByCustID(int custID) throws SQLException,RemoteException,FinderException
         makeConnection();
         PreparedStatement pstmt = con.prepareStatement("select sum(amount) from sales where cust_id= ? ");
         pstmt.setInt(1, custID);
         ResultSet rset = pstmt.executeQuery();
         if (!rset.next())
              throw new RemoteException("no records present" );
         return rset.getString(1);
      }My entity bean's home interface looks like this:-
    public interface SalesHome extends EJBHome
    public Sales create() throws RemoteException, CreateException;
    public Sales findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    My entity bean's remote interface looks like this:-
    public interface Sales extends EJBObject
         public String findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    my ejb-jar.xml looks like this:-
    <enterprise-beans>
    <session>
    <description>Hello Bean</description>
    <ejb-name>HelloBean</ejb-name>
    <home>myEjb.HelloHome</home>
    <remote>myEjb.HelloRemote</remote>
    <ejb-class>myEjb.HelloBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
         <entity>
              <ejb-name>SalesBean</ejb-name>
              <home>myEjb.SalesHome</home>
              <remote>myEjb.Sales</remote>
              <ejb-class>myEjb.SalesBean</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              <reentrant>False</reentrant>
              <cmp-field>
              <field-name>factPK</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>timeID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>custID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>locID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>itemID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>entityID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>currency</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>qty</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>unitPrice</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>amount</field-name>
         </cmp-field>
              <primkey-field>factPK</primkey-field>
              <resource-ref>
              <res-ref-name>jdbc/DSource</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
         </resource-ref>
         </entity>
    </enterprise-beans>
    please help me out of this trouble.

    I'm trying to call an entity bean froma session bean i get the error :-
    7/02/27 14:35:25 javax.ejb.ObjectNotFoundException: Exception [EJB - 10008]: Cannot find bean of type [SalesBean] using finde
    [findByCustID].
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.EJBExceptionFactory.objectNotFound(EJBExceptionFactory.java:325)
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.finders.Finder.checkNullResult(Finder.java:224)
    My session bean looks like this :-
    public class HelloBean implements SessionBean
      public String helloWorld (String pzCustomerID) throws SQLException,RemoteException
         String lzRevenue=null;
         int liCustomerID=Integer.parseInt(pzCustomerID);
         try
              Context initial = new InitialContext();
              Object objref =   initial.lookup("SalesBean");
              SalesHome salesHome =(SalesHome) PortableRemoteObject.narrow(objref,SalesHome.class);
              Sales sales=salesHome.findByCustID(liCustomerID);
              lzRevenue=(String) sales.findByCustID(liCustomerID);
    My entity bean looks like this:-
    public class SalesBean implements EntityBean
      public String factPK;
      public int timeID;
      public int custID;
      public int locID;
      public int itemID;
      public int entityID;
      public String currency;
      public float qty;
      public float unitPrice;
      public float amount;
      public EntityContext context;
      private Connection con;
        private void makeConnection() {
            try {
                InitialContext ic = new InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource) ic.lookup("jdbc/DSource");
                con = ds.getConnection();
            } catch (Exception ex) {
                throw new EJBException("Unable to connect to database. " +
                    ex.getMessage());
      public SalesBean()
      public String ejbFindByCustID(int custID) throws SQLException,RemoteException,FinderException
         makeConnection();
         PreparedStatement pstmt = con.prepareStatement("select sum(amount) from sales where cust_id= ? ");
         pstmt.setInt(1, custID);
         ResultSet rset = pstmt.executeQuery();
         if (!rset.next())
              throw new RemoteException("no records present" );
         return rset.getString(1);
      }My entity bean's home interface looks like this:-
    public interface SalesHome extends EJBHome
    public Sales create() throws RemoteException, CreateException;
    public Sales findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    My entity bean's remote interface looks like this:-
    public interface Sales extends EJBObject
         public String findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    my ejb-jar.xml looks like this:-
    <enterprise-beans>
    <session>
    <description>Hello Bean</description>
    <ejb-name>HelloBean</ejb-name>
    <home>myEjb.HelloHome</home>
    <remote>myEjb.HelloRemote</remote>
    <ejb-class>myEjb.HelloBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
         <entity>
              <ejb-name>SalesBean</ejb-name>
              <home>myEjb.SalesHome</home>
              <remote>myEjb.Sales</remote>
              <ejb-class>myEjb.SalesBean</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              <reentrant>False</reentrant>
              <cmp-field>
              <field-name>factPK</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>timeID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>custID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>locID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>itemID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>entityID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>currency</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>qty</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>unitPrice</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>amount</field-name>
         </cmp-field>
              <primkey-field>factPK</primkey-field>
              <resource-ref>
              <res-ref-name>jdbc/DSource</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
         </resource-ref>
         </entity>
    </enterprise-beans>
    please help me out of this trouble.

  • How to find a program, which is using "Z" variant

    Hi All,
    I know only on custom devloped variant name, say "ZTEST". I do not know, which program is using it. Entry is there in TVARV table.
    Please let me know, how can I find the program, which is using that variant.
    Thanking you,
    Chetan Shah

    Hi Chetan,
    The variants for a report will be stored in the table <b>VARI</b>.
    Give your variant name to the field VARI-VARIANT and it will give the report name in the field VARI-REPORT.
    If you have same variant for the other reports, then it will shows the list of reports which the same variant name.
    I am working on ECC 5.0 and able to see this table.
    Thanks,
    Vinay

  • How can I find what apple ID I used to register my iMac when I first booted up? I am being told that by using this ID I will be able to go on to the App store and down load iPhoto at no cost. Is this true? My iMac does not have iPhoto resident on it now

    How can I find what apple ID I used to register my iMac when I first booted up? I am being told that by using this ID I will be able to go on to the App store and down load iPhoto at no cost. Is this true? My iMac does not have iPhoto resident on it now and I only purchased my new iMac in December 2012
    Thanks....

    Launch Keychain Access and click on Login in the left hand pane and then on Passwords.  Next do search for Apple in the search field at the top and click on Apple ID Authenicication in the list that comes up.  That will give you the ID no. and password.
    OT

  • How to create Exchange dynamic distribution list using multivalue extension custom attribute

    I am trying to create a dynamic distribution list using an ExtensionCustomAttribute.  I am in hybrid mode with Exchange 2013.  The syntax I have is this: 
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {(ExtensionCustomAttribute2 -eq 'NH')} 
    This works correctly on-prem.  But hosted always results in an empty list.  I can see in dirsync the attribute is in the hosted environment, but for whatever reason, the distribution group gets created but always come up null.
    If I create a group looking at the single valued attributes, such as CustomAttribute6 -eq 'Y', it works correctly on-prem and hosted.  
    If anyone has any suggestions I would appreciate it.

    I don't think I provided enough information about the problem.  Let me add some and see if it makes sense.
    I have an Exchange 2013 on-premise configured in hybrid mode with Office365.  For testing purposes, I have 2 users, Joe and Steve, one with the mailbox on-prem, and the other with the mailbox in the cloud.  Each of them has CustomAttribute6 = 'Y'
    and ExtensionCustomAttribute2 = 'NH'. Dirsync shows these users and these attributes are synced between on-prem and cloud.
    Using on-prem Exchange powershell, I run the following command:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')} 
    This correctly finds the 2 users when I query for them as follows:
    $DDG = Get-DynamicDistributionGroup DG_NH
    Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter | FT alias
    So I then delete this DG, and recreate it this time looking at the multi-value attribute ExtensionCustomAttribute2, as follows:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')} 
    Replaying the query above, I can see this also works fine and finds my two users.
    Next I open a new powershell and connect to Office 365 and repeat the process there.
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')} 
    This correctly finds the 2 users when I query for them.
    And then delete the group and recreate it using the multi-value attribute:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')} 
    When I run the query this time it produces no result.  Every test I try results in an empty group if I am using a multi-valued attribute in the search criteria in the cloud.  If I use single valued attribute, it works fine.
    I really need to be able to get multi-valued DDG's working in the cloud.  If anyone has done this and has any suggestions, I would appreciate seeing what you did.  And if this is the wrong forum to port this, if you can point me to a more suitable
    forum I will report there.
    Thanks,
    Richard

  • Where can I find the no-no list?

    As I am learning more and more about app development, it seems a lot of time can be wasted if you don't follow the rules Apple has set forth. I find post here and there about what not to do, such as using private API's, and tried searching in the Dev Center for something. As I learn I want to learn the, your app has more chance of not being rejected way, where can I find the "no-no" list Apple has?

    The obvious document would be the App Store Review Guidelines for iOS and OSX.
    iOS: https://developer.apple.com/app-store/review/guidelines/
    Mac (OSX): https://developer.apple.com/app-store/review/guidelines/mac/
    Note that iOS apps can only be distributed via the App Store while OSX apps can be distributed directly by the developer.
    Creating a non-App Store app in OSX has several advantages and disadvantages:
    The App Store handles a number of practical issues for you: like setting up a download page and processing payments. It also (supposedly) gives you access to a larger customer base and is the "default" location for getting apps that Apple pushes new users to. The App Store is also more convenient when re-downloading apps, safer and more convenient as users don't have to keep track of activation codes for purchased apps. 
    You don't need to sandbox your app, this is helpful for certain apps that need to access data from other apps or needed to call other apps e.g. via AppleScript.
    You can use private APIs, although this is generally not recommended as these classes are not documented and may change/disappear between OS releases. But poking around in private APIs and other internals may sometimes be the only way to access certain information or to get certain features.
    Not being a App Store app will also mean that you can't use certain APIs - I think that iCloud is one of these.

  • How do I query a SharePoint List using a url and filtering on date?

    I am reading a SharePoint list using jquery.  Everything is working fine
    except for the filter.  Each list item has an expiration date.  I want to retrieve JUST the items that have not expired (Expires > Today) but I can't figure out the url syntax and I've been searching all day for an example and
    can't find one.  Could someone please help?!?  See bold code below.
    Thanks,
    Glen
    $(document).ready(function ()
    <strong>var qryWCFUrl = "/sites/MMTP1/_vti_bin/listdata.svc/MMAlerts?$filter=(Expires gt '08/10/2011')&$orderby=Title";
    </strong> $.getJSON(qryWCFUrl, function (results)
    $.each(results.d.results, function (i, mmAlert)
    itemID = mmAlert.Id;
    mmTitle = mmAlert.Title;
    mmClass = mmAlert.ClassValue;
    //alert("Item="+itemID+" Title="+mmTitle+" Class="+mmClass);
    AddMMStatus(mmAlert.Id,mmAlert.Title,mmAlert.ClassValue);

    Fadi,
    Thanks for your response.  I actually have another version of the code that uses the SP client objects that works.  The problem is site boundries.  Let me give a more complete project explanation.
    I am creating a master page for a new intranet.  As part of this master page, I want to read from an SP list of alerts and post each alert (if not expired) in the SP status bar.  I've gotten this to work with SP client objects and jquery (except
    for the date filter part).  Both of these solutions work fine on the top site level.  BUT when trying it out at the sub-site level, the SP client objects version of my code fails. The jQuery version works except the date filtering.
    I looked at the example from your link and it looks like a bit of a hybrid to my approaches:  JQuery with CAML.  My question is; does this example permit me to access a list in the top-level site from the subsites?  Please excuse my ignorance,
    but I am an EXTREME newbie in this having spent the past 8 years as a VB.Net developer and a little bit of ASP.Net.
    Below are the two different versions of my code in different versions of my master page definition:
    SP Client Object Version
    <script type="text/javascript">
    // <![CDATA[
    ExecuteOrDelayUntilScriptLoaded(LoadAlerts, "sp.js");
    var ctx;
    var currAlerts;
    function LoadAlerts() {
    ctx = new SP.ClientContext.get_current();
    list = ctx.get_web().get_lists('/sites/MMTP1/Lists/').getByTitle('MMAlerts');
    var cmlQry = new SP.CamlQuery();
    var camlExp = '<query><Query><Where><Gt><FieldRef Name="Expires" /><Value IncludeTimeValue="FALSE" Type="DateTime"><Today /></Value></Gt></Where></Query></query>';
    cmlQry.set_viewXml(camlExp);
    currAlerts = list.getItems(cmlQry);
    ctx.load(currAlerts,'Include(ID,Title,Class)');
    ctx.executeQueryAsync(GetAlertsSuccess,GetAlertsFailed);
    function GetAlertsSuccess() {
    var lstEnum = currAlerts.getEnumerator();
    while(lstEnum.moveNext()) {
    var mmAlert = lstEnum.get_current();
    AddMMStatus(mmAlert.get_item('ID'),mmAlert.get_item('Title'),mmAlert.get_item('Class'));
    function GetAlertsFailed(sender,args) {
    alert('Alerts load failed: ' + args.tostring);
    function AddMMStatus(msgID, strTitle, strClass) {
    var statID;
    var statClass;
    var statTitle;
    statClass = "<a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strClass + ": </a>";
    statTitle = "<a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strTitle + "</a>";
    statID = SP.UI.Status.addStatus(statClass, statTitle, true);
    SP.UI.Status.setStatusPriColor(statID,"red");
    function DisplayAlert(msgID) {
    var options = {
    title: "Miller & Martin Alert!",
    url: "/sites/MMTP1/SitePages/ShowAlert02.aspx?ID="+msgID,
    allowMaximize: false,
    showClose: true
    SP.UI.ModalDialog.showModalDialog(options);
    // ]]>
    </script>
    JQuery Version (works except for filtering by date)
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" >
    // <![CDATA[
    var itemID;
    var mmTitle;
    var mmClass;
    $(document).ready(function ()
    var qryWCFUrl = "/sites/MMTP1/_vti_bin/listdata.svc/MMAlerts?$filter=(Expires gt '08/10/2011')&$orderby=Title";
    $.getJSON(qryWCFUrl, function (results)
    $.each(results.d.results, function (i, mmAlert)
    itemID = mmAlert.Id;
    mmTitle = mmAlert.Title;
    mmClass = mmAlert.ClassValue;
    AddMMStatus(mmAlert.Id,mmAlert.Title,mmAlert.ClassValue);
    function AddMMStatus(msgID, strTitle, strClass, strSeverity) {
    var statID;
    var statClass;
    var statTitle;
    statClass = "<div id=\"mmAlertTitle\" style=\"display:inline-block;\"><a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strClass + ": </a></div>";
    statTitle = "<div id=\"mmAlertDetail\" style=\"display:inline-block;\"><a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strTitle + "</a></div>";
    statID = SP.UI.Status.addStatus(statClass, statTitle, true);
    SP.UI.Status.setStatusPriColor(statID,"green");
    function DisplayAlert(msgID) {
    var options = {
    title: "Miller & Martin Alert!",
    url: "/sites/MMTP1/SitePages/ShowAlert02.aspx?ID="+msgID,
    allowMaximize: false,
    showClose: true
    SP.UI.ModalDialog.showModalDialog(options);
    // ]]>
    </script>

  • TS4062 I cannot find my IPOD touch listed on ITunes (there is no "Device" menu option - any advice?

    I cannot find my IPOD touch listed on ITunes (there is no "Device" menu option in iTunes- any advice?). Using IPOD touch (32gb) and connecting with a laptop using Windows Vista. Downloaded the latest ITunes and it wiped all my music. I was able to recover the music purchased on Itunes (but not my CD downloads). I am having difficulty syncing my IPOD now and all of the help guides tell me that I need to use the "device" options to fix it but there is no "Device" options in my ITunes ribbon.

    Just the old fashioned way, like if you lost your wallet.
    Apple will not help.
    If it is in your home and wifi is on and connected you can call it with FaceTime, Skype or other app that will play a notification sound and listen for it.
    Report to police and change the passwords for all account used on the iPod

  • How to find out which keywords were used to create a smart album?

    Hi,
    I actually have 2 questions;
    a) Short of scrolling down my very long list of password on the HUD - is there an elegant way to do it - How to find out which passwords were used to create an existing smart album? It's a recurring challenge for me.\ 'cause I like using smart albums, but once in a while need to check or chane the passwords.
    b) With annoying regularity when I try to get to this forum and choose Aperture, I get the following message - in pink, no less: It appears you're not allowed to view what you requested. You might contact your administrator if you think this is a mistake.
    Any clues?
    Thanks guys,
    Raphael
    <Edited by Host>

    b) With annoying regularity when I try to get to this forum and choose Aperture, I get the following message - in pink, no less: It appears you're not allowed to view what you requested. You might contact your administrator if you think this is a mistake.
    Any clues?
    Raphael,
    that message may occur for four reasons at least:
    Most frequently, when you are using an outdated link to a post that no longer exists, for example from an email notofication. Sometimes our community host will remove posts, that are in violation of the terms of use: see:
    Apple Support Communities Terms of Use
    Or you are using the edit button or a bookmark to an "Edit" window, after the fifteen minutes allowed for editing are up.
    Or you want to view a page in a restricted section of the ASC - soem perta are only open for members of level 6 or higher.
    Or it is one  of the unexplained problems with the forum software right now.
    a) Short of scrolling down my very long list of password on the HUD - is there an elegant way to do it - How to find out which passwords were used to create an existing smart album? It's a recurring challenge for me.\ 'cause I like using smart albums, but once in a while need to check or chane the passwords.
    I really like Kirby's suggestion with the IPTC rule Keyword is. This is very useful for smart albums global to the library.
    Frequently a different approach helps for my smart albums. Many of my smart albums are local to projects or folders.  In this case the smart HUD will only show those keywords that have been used for the images in the selection. So if I only have tagged the images with the keywords "birds" and "slideshow", the smart settings HUD will only show these two keywords and the list is very short.
    My Keywords HUD, is organized hierarchically; this way I can collapse large sections at once, and it is easier to focus on the keywords needed for a specific task.
    I use the search field in HUD a lot, to filter the set of keywords shown.

  • How to find out which BADIs are used

    Hi Experts,
    Is there any tcode where I can give the transaction or program name and find out which BADIs are used in that transaction.
    thanks
    sankar

    Dear Sankar,
    You can first check available BAdis and then go to SE19 to see what all have been implemented.
    Please check this sample program from other thread to find BADI and enhancement for a given transaction code. You just need to create a custom program in your system by cut and paste below codes.
    REPORT ZTEST.
    TABLES: TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA: JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA: FIELD1(30).
    DATA: V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS: P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA: WA_TADIR TYPE TADIR.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    ENDCASE.
    Alternatively, you can do the following:
    1. For what ever transaction u want the enhancement .. just check for the System-->status (menu) and find out the PROGRAM name....
    2. Double click on to the program name and go inside the program (Abap editor)
    3. Search for "Call Customer-function " ... and u'll get some search results .. If u get results then u have enhancement in that tcode .....
    4. Then it actually calls a Function module .... copy the Function module name .... go to SE80 (object navigator) click on "Repository Information system" then Customer Enhancements .... Give the Function module name in the "Components" field and click Execute ....
    ull get a list of Enhancements related to that Componene....
    5. Choose which ever enhancement will suit ur business need ..
    6. Go to CMOD... create a project .... assign ur enhancement ... and then code ur logic.... activate ur enhancement in CMOD ....... Ur Buisness need will be solved...
    For a user exit......
    Finding whether there is any User Exit or not for tcode VA42
    1. For what ever transaction u want the user exit .. just check for the System-->status (menu) and find out the PROGRAM name.... ( The program name would be for our scenario "SAPMV45A" )
    2. Double click on to the program name and go inside the program (Abap editor)
    3. Search for the word "USEREXIT" .... u ll find all the user exits in the search result .. and find ur's then ...
    Hope this will help.
    Regards,
    Naveen.

Maybe you are looking for

  • Problem in Selecting elements in XSLT

    Hi, I have the following XML. <asx:values> <Seg1 A="a" B="b> <Seg1 A="c" B="d"> <Seg2 X="a" Y="b> <Seg2 X="c" Y="d"> </asx:values> Now i have the following XSLT. <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sapxsl="http://www

  • Is it possible to create exception rule in Comparator sort order?

    I have been working on trying to learn how to use Comparators to sort Collections... In one of my recent experiments, I tried to order a PriorityQueue of String elements alphabetically, in ascending order, with one exception: any word beginning with

  • How to execute a "real" VBS command in DIAdem script?

    Hello, I've some troubles to execute specific "real" VBS command lines in DIAdem script:  e.g.:  Workbooks.OpenText filname, DataType:=xlDelimited, tab:=True, DecimalSeparator:=",", ThousandsSeparator:="."   Using other writings as Workbooks.OpenText

  • PDF performance question

    Hello all, I would like ask you if Preview is lagging a bit or it's just me. Open up a big PDF document (e.g., http://svnbook.red-bean.com/nightly/en/svn-book.pdf) and try dragging the scroll handle quickly from the begining to the end as fast as you

  • CS4, CS5, Scratch Disk and Prefs

    I am on OSX10.6.8 with CS4 and CS5 (some of my actions only run on CS4, so I quit and launch back and forth). I had my CS 4 and 5 Scratch Prefs set to a specific scratch partition on another local disk where I had a small partition dedicated towards