Finding all unique paths in graph

can anyone suggest an algorithm to find all unique paths between two nodes?
I have already implemented a variation of Dijkstra's shortest path algorithm to find ONE path, i'm just not sure how I can find ALL unique paths..
Any help much appreciated.
thanks :)

I'm not really sure about the english terminology to be used and most of inteligent discussions ends up with finding the proper words for definitions :)
Let me just say I wrote the algorhytm that found all 3 paths in the small example graph (I know, I know. Still testing. Besides I don't want to prove that the code is complete in mathemathical meaning). The limitations are like for every real life path finding algorhytms (let's go from a to b, 0 or more paths may exists, 2 nodes may have 0 or 1 connection, the connetions are not directed, i want unique paths, and I don't want circles in any of the paths).
In the iteration
- I check if the path is ends with ENDNODE
- I get all the neighbors of the last node and generate all the possible paths extending the current (exceptions: path never can include the same node twice) and add them into a queue
- I get the first from the queue and that is the current path now.
The iteration ends when I have no more paths to analyze.
If I undestood the term "unique path" as it can have any circles in it then I may agree with you, but thats another problem.
In that case (if I had a school homework or I was working for a science group which has no access downloading these kind of algorhytms and they must come up with one for some reason :) I think I'd try to find all the unique circles first then all the paths (without the circles) and then combined them in all the way...
I'll improve and test the algorhytm before publish it.

Similar Messages

  • Finding all mapped paths

    I am trying to find all paths/drives that are mapped on the computer. Currently I am using File.listRoots(); to find all of the letter drives ("P:", "Q:", etc...) but it misses mapped locations that do not have a drive letter ("\\comp123\files"). Anybody know how I could find these?

    How are those "mapped"? It looks to me like you're asking the JRE to find all possible file shares you could connect to on all possible machines in your network. If that's really what you want then jCIFS might do that for you.

  • Graph Theory Algorithm-All possible paths between 2 vertices w/ constraints

    Hi all,
    I have a project I'm working with. I need to find all possible paths between two vertices on a graph.
    I realize this will be NP-complete or worse, but right now i'm looking for a brute force method to do this via algorithm/pseudocode
    Given:
    connected, weighted edges, directed Graph G = (V,E) with no loops
    Given v1 and v2 are vertices in V, and C = constraint value,
    I would like a way to find all possible paths from v1 to v2 that have a length less than C. Length = adding up all the edges on a path
    Can anyone provide any help on this?
    Thanks!

    Sure, no problemo.
    Create a bucket of paths, initially empty. (Bucket is a technical term for a collection)
    Start at v1. Take all the edges that lead from v1 to any place else, like x.
    Each one of those paths consists of a single edge is a path from v1 to somewhere and furthermore it has a length. It is a partial path with a length Now do it again, grab any path out of the bucket, leave from its terminal point x and extend it by an edge and create a bunch more paths that are now two edges long, which you can throw back into that same bucket.
    If you ever get to v2, you have a path from v1 to p2. Add it to your solutions list. If you ever exceed C, well throw it out because it is too long. And if you can't extend from a particular vertex then toss it as well.
    All you ever do is pull a partial path from the bucket, create all its possible one edge extensions, keep the winners, toss out the impossible, and throw all new still valid partial paths back into the bucket.
    If there are loops and if there are edges with zero or negative weight, this would not necessarily terminate. But you say that is not a problem for you.
    Just for the record, nothing is worse than NP-complete.

  • Finding all cycles in a directed graph

    Hi all,
    I have a task I believe I will solve relatively easy if I manage to detect all cycles within a graph that I can build from the data given.
    I googled for a while but I couldn't find some explanation that I can use. I came upon refrerences to some publication referred as "Reingold, Nievergelt and Deo 1977", however I could not find some online resources from that ?book?.
    AFAIK I can detect whether thre is a cycle using DFS, but I need all cycles.
    Please guide me to some online resource that can help me find a suitable algorithm, or if you know such algorithm please post its name so I can find information about it.
    Thanks for your cooperation
    Mike

    Thanks for all those replies!
    I still haven't implemented a solution and I have some questions. I googled and skimmed through a book I have and I came up with the definition that topological sorted graph means that all 'paths' lead in one direction (such ordering of the vertices V that for each edge(i, j) in E vertex i is to the left of vertex j).
    If I understand correctly your idea, it is to first order the vertices by some criterion and then remove all edges leading in a direction opposite to the sorting direction.
    I am not quite sure I understand correctly how to choose the ordering of the vertices. In the beginning of the sorted vertex list we must have vertices with the most possible outgoing edges /as sum of weights/ and least incoming(because these are to be removed), did I understand the idea correctly?
    I thought about another solution but I cannot estimate how heavy it will be as processing time: to perform search(maybe DFS) and if I find a cycle - to remove the least heavy edge and continue the search from the position before passing this edge.
    I guess it is not applicable since it can escalate to a very time-heavy task, especially if each time we go back.
    So I think I will implement the Idea YATArchivist proposed - sorting vertices and removing back-edges, and we'll see what will happen. After all - it's only a contest, I can only win or not win, there are no losers ;)
    Thank you for giving your valuable time for sharing thoughts in this thread
    Mike

  • Finding unique paths : Follow up

    > function pathExists(shapeStart, shapeEnd):Boolean {
    > for (var node in shapeStart) {
    > for (var key in shapeStart[node].obj) {
    > if (key == shapeEnd) {
    > return true;
    > } else {
    > pathExists(key,shapeEnd);
    > }
    > }
    > }
    > return false;
    > }
    kglad...
    I implemented your solution this morning but came up with the
    same type
    of problem I was having before with my own recursive
    function.
    Here is the code (modified from what you posted) that I am
    using:
    function pathExists(shapeStart, shapeEnd):Boolean {
    for (var i:Number = 0; i <
    allConnections[shapeStart].length; i++) {
    if (allConnections[shapeStart]
    ._parent == shapeEnd) {
    trace("shapeEnd found in list");
    return true;
    } else if
    (checkedParents.indexOf(allConnections[shapeStart].
    _parent) == -1) {
    checkedParents.push(allConnections[shapeStart]
    ._parent)
    pathExists(allConnections[shapeStart]._parent,shapeEnd);
    return false;
    The problem is this... once the condition is met which
    returns true (I
    know this condition is met because my trace works) it does
    not actually
    return true to the initial caller. So, I end up with false
    being
    returned. It is as if the true is being returned to the
    recursive call
    and not to the original function call. Does that make sense?
    Thanks...

    Sean Berry wrote:
    >> function pathExists(shapeStart, shapeEnd):Boolean {
    >> for (var node in shapeStart) {
    >> for (var key in shapeStart[node].obj) {
    >> if (key == shapeEnd) {
    >> return true;
    >> } else {
    >> pathExists(key,shapeEnd);
    >> }
    >> }
    >> }
    >> return false;
    >> }
    >
    > kglad...
    >
    > I implemented your solution this morning but came up
    with the same type
    > of problem I was having before with my own recursive
    function.
    >
    > Here is the code (modified from what you posted) that I
    am using:
    > function pathExists(shapeStart, shapeEnd):Boolean {
    > for (var i:Number = 0; i <
    allConnections[shapeStart].length; i++) {
    > if (allConnections[shapeStart]
    ._parent == shapeEnd) {
    > trace("shapeEnd found in list");
    > return true;
    > } else if
    (checkedParents.indexOf(allConnections[shapeStart].
    > _parent) == -1) {
    > checkedParents.push(allConnections[shapeStart]
    ._parent)
    >
    pathExists(allConnections[shapeStart]._parent,shapeEnd);
    > }
    > }
    > return false;
    > }
    >
    > The problem is this... once the condition is met which
    returns true (I
    > know this condition is met because my trace works) it
    does not actually
    > return true to the initial caller. So, I end up with
    false being
    > returned. It is as if the true is being returned to the
    recursive call
    > and not to the original function call. Does that make
    sense?
    >
    > Thanks...
    kglad...
    I did what you suggested and it seems to do the trick.
    However, now I
    am wondering how I would go about finding the actual path.
    The goal
    here will be to ensure there are at least 2 unique paths from
    startShape
    to endShape. Specifically I will be evaluating the nodes for
    uniqueness.
    Thanks for any and all suggestions.

  • Finding all classes in a path

    I am writing a utility in which I want to find all classes with a specifed pattern, i.e. "com.ourcompany.ut.*_UT". I know that I could recursively go through the directory com/ourcompany/ut and find files named "*_UT.class", convert the path info to a package name, and use Class.forName to load the class. Is there a cleaner way to do this?

    Is there a cleaner way to do this?No. You have to search for the classes in the file system (or JARs or whatever) if the class isn't already loaded.
    - Marcus Sundman

  • How do I find all pictures with no (empty) keyword ?

    I have decided to import all my pictures into LightRoom.
    A lot of my older pictures are not registered with any keywords :(
    - only with IPTC location information.
    My plan is to systematic go through all my pictures and add relevant keywords to all pictures - so my old pictures become as searchable as my newest pictures.
    Some of my old pictures has keywords some has not.
    How do I in Lightroom - find all pictures with no keywords?
    I have tried to use the Find tool - but don't see any options to search for "Empty/missing" keywords.
    Also I would like to find all pictures with few keywords and in step II add additional keywords to these pictures.
    Any ideas on how to make a find all pictures where number of keywords is less than X inside or outside LightRoom.
    Henrik Bach
    Denmark

    > I also did think of the SQL idea.
    > If I find a way of doing this I will repost my findings.
    Well, being a tech geek, I found this challenge kind of irresistible,
    and I'm happy to report I have a solution for you.
    STEP 1
    First, make a copy of your "Lightroom Database.lrdb" file (we'll work
    off the copy to be safe)
    STEP 2
    Next, you need to be able to browse the database. The database is in
    SQLite3 format. I tried installiing an SQLite3 ODBC driver and accessing
    it through MS Access 2003. While Access was able to see all of the
    tables in the database, every time I tried to link to one I got:
    "Reserved error (-7748); there is no message for this error"
    I found a few tips for this but wasn't able to work around it and get it
    to work. Which is a shame, since Access would be the easiest way for
    browsing and querying tables.
    Instead I found an open source tool called SQLite Database Browser.
    http://sourceforge.net/project/showfiles.php?group_id=87946&package_id=91778&release_id=41 4746
    I used the Windows version. There appears to be a version for MacOSX on
    PowerPC. It doesn't look like there is a version for Intel based Macs
    (though if you know how, you could always try downloading the source and
    compiling it yourself).
    STEP 3
    After you install the browser, open it up, choose "Open Database" and
    select the COPY of the lightroom database we made in step 1
    STEP 4
    go to the Execute SQL tab and issue the following command
    SELECT A.idx_filename, count(C.name)
    FROM Adobe_imageFiles A, AGLibraryTagImage B, AGLibraryTag C
    WHERE A.image=B.image AND B.tag=C.id_local AND C.kindName='AgKeywordTagKind'
    GROUP BY A.idx_filename
    HAVING count(C.name) <= 3
    That will give you all images with 3 or fewer keywords applied.
    Of course, theres no guarantee that this wont break in future versions.
    Now an explanation of the data.
    Adobe_imageFiles - contains data about image files:
    1) idx_filename is the filename
    2) absolutePath is the full file path
    3) image is a unique ID for the image which you can cross reference in
    other image related tables
    AGLibraryTag - contains info about "tags" applied to images:
    1) id_local is a unique ID for this "tag", which you can use to cross
    reference in other tag tables
    2) kindName is the kind of tag you are looking at. Available values
    appear to be:
    AgCaptionTagKind
    AgCollectionTagKind
    AgCopyrightTagKind
    AgEnumeratedMetadataTagKind
    AgFolderTagKind
    AgImportTagKind
    AgKeywordTagKind
    AgMissingFileTagKind
    AgQuickCollectionTagKind
    AgSpecialContentOwningTagKind
    AgTempImagesTagKind
    3) name is the value for that tag (the collection name, the keyword, etc)
    AGLibraryTagImage - Use this to connect the images and tags tables

  • How do I compare two columns of data in Numbers to find the unique results?

    Hello all,
    I'm looking for a way to compare the data from two columns so I can find the unique results and display that data in a third column. To be specific, here's what I'm doing.
    Column A is a list of email addresses for people I have already written. Column B is a list of email addresses for people I would like to contact. I am not sure if there are email address from Column A in Column B, but there may be and if there are, I must find out so that I don't send a second email to these recipients. How can I have Numbers look at both columns and tell me which email addresses in Column B are not in Column A?
    Thanks for the help!!!

    gfmp123,
    Here's an alternate use of MATCH to find duplicates. I hope you find one of the two solutions, Wayne's or this one, useful for your case.
    The expression in Column C is:
    =IFERROR("Dup in Row "&MATCH(B, A,0), "")
    Regards,
    Jerry

  • Problem with Java keystore and certificates (unable to find valid cert path

    Our program is made so that when a certificate is not signed by a trusted Certification Authority, it will ask the user if he/her wishes to trust the certificate or not. If they decide to trust the certificate, it will accept the self signed certificate and import it into the keystore and then use that certificate to log the user in. This works fine. It will import the certificate into the keystore and use the specified ip address to establish a connection with the LDAP server (Active Directory in our case) and authenticate properly. However, the problem arises when we then try and connect to a different ip address (without restarting tomcat, if we restart tomcat, it works fine...). It imports the certificate into the keystore fine, but always gives the exception
    "Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
    and does not authenticate with our LDAP server (which is Active Directory). The problem seems to be that it is no longer looking at the System.setProperty("javax.net.ssl.trustStore", myTrustStore);
    I have tried multiple times to just reset this property and try and "force" it to read from my specified trust file when this error happens. I have also imported the certificates directly into the <java_home>/jre/lib/security/cacerts and <java_home>/jre/lib/security/jssecacerts directories as the java documentation says that it will look at those directories first to see if it can find a trusted certificate. However, this does not work either. The only way that I can get this to work is by restarting tomcat all together.
    If both of the certificates are already in the keystore before tomcat is started up, everything will work perfect. Again, the only problem is after first connecting to an IP address using TLS and importing the certificate, and then trying to connect to another IP address with a different certificate and import it into the keystore.
    One of the interesting features of this is that after the second IP address has failed, I can change the IP address back to the first one that authenticated successfully and authenticate successfully again (ie
    I use ip 1.1.1.1, import self signed certificate, authenticates successfully
    login with ip 2.2.2.2 import self signed certificate, FAILS
    login again with 1.1.1.1 (doesn't import certificate because it is already in keystore) successfully authenticates
    Also, I am using java 1.5.0_03.
    Any help is greatly appreciated as I've been trying to figure this out for over a week now.
    Thanks

    Please don't post in threads that are long dead and don't hijack other threads. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.

  • Caught "com.evermind.server.rmi.OrionRemoteException" while attempting to find all De

    I am getting the following error while running JSP. Can anyone guide me.
    Caught "com.evermind.server.rmi.OrionRemoteException" while attempting to find all DepartmentBean entries.
    com.evermind.server.rmi.OrionRemoteException: Database error: Io exception: The Network Adapter could not establish the connection; nested exception is: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    Add entry
    I have doubt in
    My rmi.xml file
    <?xml version="1.0" standalone='yes'?>
    <!DOCTYPE rmi-server PUBLIC "Orion RMI-server" "http://xmlns.oracle.com/ias/dtds/rmi-server.dtd">
    <rmi-server port="23791" >     
         <!-- A remote server connection example -->
         <!-- <server host="the.remote.server.com" username="adminUser" password="123abc" /> -->
    <!--     <server host="169.254.162.207" username="admin" password="welcome" /> -->
    <!--     <server host="prg-fg9s9g12dnz" username="admin" password="welcome" /> -->
         <!-- path to the log-file where RMI-events/errors are stored -->
         <log>
              <file path="../log/rmi.log" />
         </log>
    </rmi-server>
    If I give server host line My oc4j server is NOT initialized.
    In My Data Sources file :
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="jdbc/DBConnection"
              location="jdbc/OracleCoreDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/DBConnection"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="RajiveShukla"
              password="pujavrms1"
              url="jdbc:oracle:thin:@localhost:1521:wbs"
              inactivity-timeout="30"
         />
    And JSP which I run is :
    <%
    * list.jsp
    * Lists all the entries stored through EmployeeBean. This JSP is the only JSP
    * that will actually connect to the entity bean. On success, it will save a
    * reference to the entity bean in the session. So there will be one reference
    * to the bean per session.
    %>
    <%@ page import="com.webstore.*,java.io.*,java.net.*,java.util.*,javax.naming.*,javax.rmi.*" %>
    <%
    // Make sure this page will not be cached by the browser
    response.addHeader("Pragma", "no-cache");
    response.addHeader("Cache-Control", "no-store");
    // We will send error messages to System.err, for verbosity. In a real
    // application you will probably not want this.
    PrintStream errorStream = System.err;
    // If we find any fatal error, we will store it in the "error" variable. If
    // an exception is caught that corresponds with this error message, then we
    // will store it in the "exception" variable.
    String error = null;
    Exception exception = null;
    // First check if the reference to the EJB is already stored in the session.
    DepartmentHome home = (DepartmentHome) session.getAttribute("DepartmentHome");
    // If not, then attempt to get the initial JNDI context.
    if (home == null) {
    // When attempting to connect to JNDI, we store the reference to the
    // initial JNDI context in this variable. We will use it to lookup the
    // entity bean.
    Context context = null;
    try {
    context = new InitialContext();
    } catch (Exception e) {
    exception = e;
    error = "Caught \"" + exception.getClass().getName() + "\" while " +
    "attempting to create the initial JNDI context.";
    errorStream.println(error);
    exception.printStackTrace(errorStream);
    // We have specified "EmployeeBean" in the web.xml file as the name
    // by which we would like to contact the EmployeeBean home interface. We will
    // have to prepend "java:comp/env/", the root `directory' for enterprise
    // beans.
    //final String location = "java:comp/env/DepartmentBean";
    if (error == null) {
    try {
    // Attempt to lookup an object at the specified location in the JNDI
    // context.
    //Object boundObject = context.lookup(location);
    Object boundObject = context.lookup("Department");
    // Try to convert it to an instance of EmployeeBean, the home
    // interface for our bean.
    home = (DepartmentHome) PortableRemoteObject.narrow(boundObject,
    DepartmentHome.class);
    // If we got this far, we've done it, let's save the reference to the
    // Employee home interface in the session for future use by both
    // this page and the other JSP pages.
    session.setAttribute("DepartmentHome", home);
    } catch (Exception e) {
    exception = e;
    error = "Caught \"" + exception.getClass().getName() + "\" while " +
    "attempting to lookup the Department bean at \"" + "\".";
    //location + "\".";
    errorStream.println(error);
    exception.printStackTrace(errorStream);
    // This is the variable we will store all records in.
    Collection recs = null;
    if (error == null) {
    try {
    recs = home.findAll();
    } catch (Exception e) {
    exception = e;
    error = "Caught \"" + exception.getClass().getName() + "\" while " +
    "attempting to find all DepartmentBean entries.";
    errorStream.println(error);
    exception.printStackTrace(errorStream);
    // Decide what the title will be.
    String title;
    if (error != null) {
    title = "Error";
    } else {
    title = "com.webstore | List of entries";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <HTML>
    <HEAD>
    <TITLE><%= title %></TITLE>
    </HEAD>
    <BODY bgcolor="#FFFFFF">
    <H1><%= title %></H1>
    <%
    // Display the error message, if any.
    if (error != null) {
    %>
    <P><BLOCKQUOTE><%= error %></BLOCKQUOTE>
    <%
    // Display the exception message, if any.
    if (exception != null) {
    %>
    <P><BLOCKQUOTE><CODE><%= exception %></CODE></BLOCKQUOTE>
    <%
    } /* if */
    } else {
    // If there are no recs to be displayed, display a descriptive text.
    if (recs.size() == 0) {
    %>
    <P><BLOCKQUOTE>No entries found.</BLOCKQUOTE>
    <%
    // Otherwise display a table with all columns, and
    // display two extra choices: "Edit" and "Delete".
    } else {
    %>
    <P><TABLE border="1" width="100%">
    <TR>
    <TD><STRONG>DptNo (long)</STRONG></TD>
    <TD><STRONG>DptName (String)</STRONG></TD>
    <TD><STRONG>Actions</STRONG></TD>
    </TR>
    <%
    Iterator iterator = recs.iterator();
    while(iterator.hasNext()) {
         Department rec = (Department) PortableRemoteObject.narrow(iterator.next(),
    Department.class);
    long dptNo = rec.getDptno();
    String dptName= rec.getDptname();
    // put all pk columns in hashtable for URLEncoding
    Hashtable cols = new Hashtable();
    cols.put("DPTNO",Long.valueOf("dptNo"));
    // URLEncode columns as params to JSP
    StringBuffer buf = new StringBuffer();
    Enumeration params = cols.keys();
    while (params.hasMoreElements()) {
    String param = (String)params.nextElement();
    String value = (String)cols.get(param);
    buf.append(URLEncoder.encode(param) +
    "=" + URLEncoder.encode(value));
    if (params.hasMoreElements())
    buf.append("&");
    String editURL = "dptedit.jsp?" + buf;
    String deleteURL = "dptdelete.jsp?" + buf;
    %>
    <TR>
    <TD><%= dptNo %></TD>
    <TD><%= dptName %></TD>
    <TD><A href="<%= editURL %>">Edit</A> <A href="<%= deleteURL %>">Delete</A></TD>
    </TR>
    <%
    } /* for */
    %>
    </TABLE>
    <%
    } /* else */
    } /* else */
    // Finally display a link to the page that allows the user to add an entry
    // to the address book.
    %>
    <P><TABLE border="1">
    <TR><TD><A href="dptadd.jsp">Add entry</A></TD></TR>
    </TABLE>
    </BODY>
    </HTML>
    Please guide me..

    Hi Avi,
    Thanks,
    I have already used earlier..
    the data-sources file is as under.
         <data-source class="com.evermind.sql.DriverManagerDataSource" name="jdbc/DBConnection" location="jdbc/OracleCoreDS" xa-location="jdbc/xa/OracleXADS" ejb-location="com.webstore.Department" connection-driver="oracle.jdbc.driver.OracleDriver" username="RajiveShukla" password="pxujxa" url="jdbc:oracle:thin:@PRG-FG9S9G12DNZ:1521:wbs" inactivity-timeout="30"/>
    </data-sources>
    The username and password and sid, I can connect in the sqlPlus
    Do we have to give remote server name in rmi.xml.. It is not initilizing the J2EE server if we give that.??
    I am using thin driver , if any change or any settings please write me..
    Thanks in advance..
    Rajive

  • How to find the menu path ?

    Hi all,
    I have one doubt how do we find out the correct menupath if we know the t-code ?
    for example, SE11 -DDIC
    we can also obtain the same DDIC screen via menupath from SAP main screen.
    if I know only t-code.how can i find out the menupath ?
    thnks and rgds,
    raghul

    Hi Raghul,
      You can go to the transaction search_sap_menu
    for finding the menu path.
    check this link:
    http://www.sap-basis-abap.com/sapgeneral/system-path-and-transaction-code-mapping.htm
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • How to find out the path of current jsp

    Hi all.
    I was wondering if someone could help me figure this out: how can I programmatically find out what path a given jsp is in from within the jsp?
    if I use currentPath = new File("./"), it defaults to the /config folder (Iplanet WS).
    Any advice is appreciated.

    Try using a combination of javax.servlet.http.HttpServletRequest.getServletPath() and javax.servlet.ServletContext.getRealPath() in your JSP. Like...
    appplication.getRealPath(request.getServletPath());I haven't tested it though.

  • How can I find all documents encrypted by a certain application?

    I don't think Spotlight can help with this, so I am trying to use the ordinary Command-F(ind).
    I know there's a parameter option "Created by [application]" but that doesn't work, even though the Info window shows the Kind as this application.
    The specifics:
    Under System 9, I encrypted a lot of files (personal correspondence, mainly) using Sentinel 2.2. In other words, I used Sentinel to require a password to open those files.
    Now I can't open them, because that program doesn't work with Sys X.
    I could open them in Sys 9 and then resave them without the encryption. But I need to find them all.
    (I want to handle them all now, rather than over the next few decades when one might pop up now and then. I won't have Sys 9 forever.)
    I can't find any perameter option to use (in Find) that will locate these files. I have a suspicion that maybe the reason searching on the creator application doesn't work is because Sentinel didn't technically create the documents, it only encrypted existing documents—although in the Info window, Sentinel is shown as the Kind. If it's any help, also shown in the Info window is the version: "Sentinel 2.2, © 1987-89 Supermac Technology."
    Sentinel put it's own icon on all the locked files.
    Seems like it should be easy to do a search to find all these files, but I can't figure out how.
    Any suggestions?
    Thanks.
    Larry

    You should be able to do it, but first you'll need to get a unique piece of metadata for the files, and then you'll need to use the Raw Query format in the Find window. I have a handy little utility written by a cyber-friend I keep in the Dock for getting the metadata entries for a file, and I think there are other free ones on VersionTracker, but you can also use Terminal to get the relevant entries. Thus I have some old Excel files. To locate all of them, I would do this:
    1. Open Terminal (it is in your Utilities folder) and type
    mdls
    and a space. Then drag and drop one of your files into the Terminal window and hit the Return key. The result will look something like this:
    NoobiX:~ francine$ mdls /Volumes/Data/BackUp/8600drives/FastMac/Documents/Finances/Finances1995
    /Volumes/Data/BackUp/8600drives/FastMac/Documents/Finances/Finances1995
    kMDItemAttributeChangeDate = 2007-08-01 12:15:22 -0700
    kMDItemContentCreationDate = 1996-03-13 01:27:46 -0800
    kMDItemContentModificationDate = 1996-03-13 02:08:03 -0800
    kMDItemContentType = "com.microsoft.excel.xls"
    kMDItemContentTypeTree = ("com.microsoft.excel.xls", "public.data", "public.item")
    kMDItemDisplayName = "Finances1995"
    kMDItemFSContentChangeDate = 1996-03-13 02:08:03 -0800
    kMDItemFSCreationDate = 1996-03-13 01:27:46 -0800
    kMDItemFSCreatorCode = 1480803660
    kMDItemFSFinderFlags = 256
    kMDItemFSInvisible = 0
    kMDItemFSIsExtensionHidden = 0
    kMDItemFSLabel = 0
    kMDItemFSName = "Finances1995"
    kMDItemFSNodeCount = 0
    kMDItemFSOwnerGroupID = 501
    kMDItemFSOwnerUserID = 501
    kMDItemFSSize = 6954
    kMDItemFSTypeCode = 1481397044
    kMDItemID = 58528
    kMDItemKind = "Microsoft Excel 4.0 worksheet"
    kMDItemLastUsedDate = 2007-08-01 12:15:22 -0700
    kMDItemUsedDates = (1996-03-13 02:08:03 -0800, 2007-07-31 17:00:00 -0700)
    2. Since I want to find all the old Excel files, I chose the line
    kMDItemKind = "Microsoft Excel 4.0 worksheet"
    You can just drag to select that line with the Mouse, then select copy.
    3. In the Find window criterion drop down menu, select Other, then scroll down to Raw Query, select it, and then paste the kMDItemKind line you copied into the open field. That should do it.
    Francine
    Francine
    Schwieder

  • Finding the shortest path

    Hey guys,
    Im working on a solution to this problem below is a program to allow a user to draw straight line paths. What i'd like to do is allow the user to select two points on the path he has drawn and find the shortest path among all the interesecting lines.....im going crazy thinking of a solution for this.....im thinking bout steeping down a notch and just try to find just any path first.
    Will really appreciate any help.
    Thnx in advance,
    Vikhyat
    import java.applet.*;*
    *import java.awt.*;
    import java.awt.event.*;*
    *import javax.swing.*;
    import java.awt.geom.*;
    public class Lab11 extends Applet implements MouseListener, MouseMotionListener {
    int x0, y0, x1, y1;
    int mouseRelease=0;
    GeneralPath path = new GeneralPath();
    public Lab11()
    addMouseListener(this);
    addMouseMotionListener(this);
    public void mouseDragged(MouseEvent e)
    x1 = e.getX();
    y1 = e.getY();
    repaint();
    public void mouseMoved(MouseEvent e) { }
    public void mouseClicked(MouseEvent e) { }
    public void mouseEntered(MouseEvent e) { }
    public void mouseExited (MouseEvent e) { }
    public void mousePressed(MouseEvent e) {
    x0 = e.getX();
    y0 = e.getY();
    System.out.println("Mouse pressed at: (" +
    x0 + ", " + y0 + ")" );
    public void mouseReleased(MouseEvent e) {
    x1 = e.getX();
    y1 = e.getY();
    System.out.println("Mouse released at: (" +
    x1 + ", " + y1 + ")" );
    mouseRelease = 1;
    this.repaint();
    public void paint(Graphics g)
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);
    //just for show not concerned with saving paths
    if(mouseRelease==1)
    path.moveTo(x0,y0);
    path.lineTo(x1,y1);
    mouseRelease = 0;
    g2.setPaint(Color.RED);
    g2.draw(path);
    g.setColor(Color.BLACK);
    g.drawLine(x0, y0, x1, y1);
    public static void main(String[] argv)
    JFrame f = new JFrame("Test");
    f.getContentPane().add(new Lab11());
    f.setSize(600,600);
    f.setVisible(true);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }Pictorially this is what im trying to do:
    User draws a path like so and selects two points as shown in blue
    [http://i48.photobucket.com/albums/f236/theforrestgump/select.jpg]
    The program should then proceed to highlighting the shortest path
    [http://i48.photobucket.com/albums/f236/theforrestgump/sp.jpg]
    Edited by: cannonball on Apr 1, 2008 7:58 PM

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class ShortPath extends JPanel {
        Path2D.Double path;
        Path2D.Double shortPath = new Path2D.Double();
        Point p1 = new Point();
        Point p2 = new Point();
        final double PROXIMITY = 5.0;
        public ShortPath() {
            path = new Path2D.Double();
            path.moveTo(145,80);
            path.lineTo(125,170);
            path.lineTo(190,200);
            path.lineTo(240,340);
            path.lineTo(285,220);
            path.lineTo(145,80);
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(Color.blue);
            g2.draw(path);
            g2.setPaint(Color.green);
            g2.setStroke(new BasicStroke(2f));
            g2.draw(shortPath);
            g2.setPaint(Color.red);
            g2.fill(new Ellipse2D.Double(p1.x-2, p1.y-2, 4, 4));
            g2.setPaint(Color.orange);
            g2.fill(new Ellipse2D.Double(p2.x-2, p2.y-2, 4, 4));
        private void findShortPath() {
            if(!isPointOnLine(p1) || !isPointOnLine(p2)) {
                System.out.println("a point is not on the path");
                return;
            double d1 = getDistanceToPoint(p1);
            double d2 = getDistanceToPoint(p2);
            double pathLength = getDistanceToPoint(new Point());
            Point2D.Double start = new Point2D.Double();
            Point2D.Double end   = new Point2D.Double();
            if((d1 < d2 && d2 - d1 < pathLength - d2 + d1) ||
               (d1 > d2 && d1 - d2 > pathLength - d1 + d2)) {
                start.setLocation(p1);
                end.setLocation(p2);
            } else {
                start.setLocation(p2);
                end.setLocation(p1);
            generatePath(start, end);
        //                        145,80
        // leg distance = 92.2    125,170
        // leg distance = 71.6    190,200   163.8
        // leg distance = 148.7   240,340   312.5
        // leg distance = 128.2   285,220   440.7
        // leg distance = 198.0   145,80    638.7
        private double getDistanceToPoint(Point p) {
            PathIterator pit = path.getPathIterator(null);
            double[] coords = new double[2];
            double distance = 0;
            Point2D.Double start = new Point2D.Double();
            Point2D.Double end = new Point2D.Double();
            Line2D.Double line = new Line2D.Double();
            while(!pit.isDone()) {
                int type = pit.currentSegment(coords);
                switch(type) {
                    case PathIterator.SEG_MOVETO:
                        start.setLocation(coords[0], coords[1]);
                        pit.next();
                        continue;
                    case PathIterator.SEG_LINETO:
                        end.setLocation(coords[0], coords[1]);
                line.setLine(start, end);
                boolean onLine = line.ptSegDist(p) < PROXIMITY;
                if(onLine) {  // point is on this line
                    distance += start.distance(p);
                    break;
                } else {
                    distance += start.distance(end);
                start.setLocation(end);
                pit.next();
            return distance;
        private void generatePath(Point2D.Double first, Point2D.Double second) {
            Point2D.Double p = new Point2D.Double(first.x, first.y);
            Point2D.Double start = new Point2D.Double();
            Point2D.Double end = new Point2D.Double();
            Line2D.Double line = new Line2D.Double();
            boolean pathStarted = false;
            for(int j = 0; j < 2; j++) {
                PathIterator pit = path.getPathIterator(null);
                double[] coords = new double[2];
                while(!pit.isDone()) {
                    int type = pit.currentSegment(coords);
                    switch(type) {
                        case PathIterator.SEG_MOVETO:
                            start.setLocation(coords[0], coords[1]);
                            pit.next();
                            continue;
                        case PathIterator.SEG_LINETO:
                            end.setLocation(coords[0], coords[1]);
                            line.setLine(start, end);
                            boolean onLine = line.ptSegDist(p) < PROXIMITY;
                            if(onLine) {            // found point on line
                                Point2D.Double linePt = getClosestPoint(line, p);
                                Line2D.Double segment;
                                if(!pathStarted) {  // found first point
                                                    // both points on line
                                    if(line.ptSegDist(second) < PROXIMITY) {
                                        Point2D.Double secPt =
                                            getClosestPoint(line, second);
                                        segment = new Line2D.Double(linePt, secPt);
                                        shortPath.append(segment, false);
                                        return;
                                    } else {        // first point only
                                        segment = new Line2D.Double(linePt, end);
                                        shortPath.append(segment, false);
                                        p.setLocation(second);
                                        pathStarted = true;
                                } else {            // found second point
                                    segment = new Line2D.Double(start, linePt);
                                    shortPath.append(segment, false);
                                    return;
                            } else if(pathStarted) {
                                                    // add intermediate lines
                                Line2D.Double nextLine =
                                    new Line2D.Double(start, end);
                                shortPath.append(nextLine, false);
                    start.setLocation(end);
                    pit.next();
        private Point2D.Double getClosestPoint(Line2D.Double line,
                                               Point2D.Double p) {
            double minDist = Double.MAX_VALUE;
            Point2D.Double closePt = new Point2D.Double();
            double dy = line.getY2() - line.getY1();
            double dx = line.getX2() - line.getX1();
            double theta = Math.atan2(dy, dx);
            double length = line.getP2().distance(line.getP1());
            int limit = (int)(length+.05);
            for(int j = 0; j < limit; j++) {
                double x = line.getX1() + j*Math.cos(theta);
                double y = line.getY1() + j*Math.sin(theta);
                double distance = p.distance(x, y);
                if(distance < minDist) {
                    minDist = distance;
                    closePt.setLocation(x, y);
            return closePt;
        private boolean isPointOnLine(Point p) {
            Point2D.Double start = new Point2D.Double();
            Point2D.Double end = new Point2D.Double();
            Line2D.Double line = new Line2D.Double();
            PathIterator pit = path.getPathIterator(null);
            double[] coords = new double[2];
            while(!pit.isDone()) {
                int type = pit.currentSegment(coords);
                switch(type) {
                    case PathIterator.SEG_MOVETO:
                        start.setLocation(coords[0], coords[1]);
                        pit.next();
                        continue;
                    case PathIterator.SEG_LINETO:
                        end.setLocation(coords[0], coords[1]);
                        line.setLine(start, end);
                        if(line.ptSegDist(p) < PROXIMITY) {
                            return true;
                start.setLocation(end);
                pit.next();
            return false;
        public static void main(String[] args) {
            ShortPath test = new ShortPath();
            test.addMouseListener(test.ml);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
        private MouseListener ml = new MouseAdapter() {
            boolean oneSet = false;
            public void mousePressed(MouseEvent e) {
                Point p = e.getPoint();
                if(oneSet) {
                    p2 = p;
                    findShortPath();
                } else {
                    p1 = p;
                    shortPath.reset();
                oneSet = !oneSet;
                repaint();
    }

  • Link Checker not finding all errors

    Hi. I am running the link checker, but its not
    finding all my errors - does anyone know why? -- for example -
    links like "/products/index.html should be "../products/index.html
    -- but link checker is not flagging this as wrong.
    Also the opposite - if I have this "../../products/index.html
    - and it should be : "../products/index.html - it doesnt know its
    wrong.
    Help - I really wanted to implement my new site tomorrow -
    but I cant trust the results I am seeing right now.
    Shriley

    >
    Hi. I am running the link checker, but its not
    finding all my
    > errors -
    > does anyone know why? -- for example - links like
    "/products/index.html
    > should
    > be "../products/index.html -- but link checker is not
    flagging this as
    > wrong.
    Either link will work fine. Both point to EXACTLY THE SAME
    PLACE, assuming
    your file doing the linking is one folder level below the
    root. The former
    link is called a root relative link since it describes the
    path to the
    linked file from the root of the site no matter where the
    linking page is.
    The latter is called a document relative link because it
    describes the path
    to the linked file from the location of the current page.
    Neither will be
    flagged by the link checker, since both could be right.
    > Also the opposite - if I have this
    "../../products/index.html - and it
    > should be : "../products/index.html - it doesnt know its
    wrong.
    Is this a real or a made up example? If you have the former,
    and it should
    be the latter, then your site is not properly defined.
    > Help - I really wanted to implement my new site tomorrow
    - but I cant
    > trust
    > the results I am seeing right now.
    It's a cockpit error, I believe. To read more about
    root/document relative
    links, go here -
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_13129&sliceId=2
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15546&sliceId=2
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "sdunham" <[email protected]> wrote in
    message
    news:[email protected]...
    >
    Hi. I am running the link checker, but its not
    finding all my
    > errors -
    > does anyone know why? -- for example - links like
    "/products/index.html
    > should
    > be "../products/index.html -- but link checker is not
    flagging this as
    > wrong.
    >
    > Also the opposite - if I have this
    "../../products/index.html - and it
    > should be : "../products/index.html - it doesnt know its
    wrong.
    >
    > Help - I really wanted to implement my new site tomorrow
    - but I cant
    > trust
    > the results I am seeing right now.
    >
    > Shriley
    >

Maybe you are looking for

  • IPhone 4 GOES DARK RANDOMLY FOR NO PARTICULAR REASON PLEASE HELP

    I'm gonna try this. Because I'm super frustrated. Something scary is happening to my device, I got an unlocked iPhone 4 from the Beverly Center in Los Angeles 3 weeks ago. I'm now on a long business trip in Moscow Russia and all of a sudden my screen

  • My Data is not inserting in Ap standard table while interfacting

    Hi All I am new to Oracle apps and i trying to learn oracle interface in AP Module. I have inserted data manually in AP_invoices_interface and ap_invoice_lines_interface tables and then i ran the Payables Open Interface Import concurrent program but

  • Issue in XML Bursting

    Hi All, We have a requirement wherein we have to mail the output of a query as an Excel attachment. We are doing it through XML Bursting. This is the first time I am using XML Bursting. I can see that in the Data Template , we have to hardcode the sm

  • Material ledger activation in material master

    A material has been extended in plant xxxx and due to some reason material ledger could not get activated in accouting 1 view of a material master. As of now there is no transaction has been made in plant xxxx for tis material. Pls guide how we can a

  • Latest version install won't launch

    I've uninstalled and installed the lastest version of player.  Yet when I try to launch a utube video it pops up and tells me I need to download the latest flash player.  Not sure what to do next.