Path issue

--I've been looking at this for some time, without a successful solution:
--Scenario 1 >> I have two TextEdit files on two different volumes. They have different names. They have been opened and appear on the desktop. I am seeking the path for each.
--Using this script:
set App_ to application "TextEdit"
set DOCS_ to documents of App_ --(yields a variety of info for each item, including the correct name and path for each)
set Doc_Name1 to name of item 1 of DOCS_ --(extracts correct name with no issue)
set Doc_Name2 to name of item 2 of DOCS_ --(extracts correct name with no issue)
tell application "System Events" --(necessary, and apparently works with any valid application name inserted)
set Doc_Path1 to path of item 1 of DOCS_ --(extracts correct path with no issue)
set Doc_Path2 to path of item 2 of DOCS_ --(extracts correct path with no issue)
end tell
*--Question 1:* What is the tell block accomplishing, considering that any application seems to work? Without it I get "TextEdit got an error: Can't make path of document 1 into type reference."
--*_Here's the issue for which I haven't found a workaround:*_
--Scenario 2 >> Exactly the same as Scenario 1, except that the two files have the +SAME NAME+. When the above script is used, the path for both items is set to the path of the last file opened, even though the path given in DOCS_ for each item is different (and correct).
*--Question 2:* Is there a way to extract the correct path information when the file names are identical. It would seem that using a window id approach might be the answer, but window id doesn't yield path information so far as I can tell.

I'll do my best to keep this response understandable.
1) Hiroto posted three codes, and I tried each using "TextEdit" and with two same-named TextEdit windows opened from two different volumes. The results:
CODE – 1
(using terms from application “System Events" retained in the script)
With AS Editor: works as expected
With Script Debugger: works as expected
(using terms from application “System Events" removed from script)
With AS Editor: works as expected
With Script Debugger: error: “TextEdit got an error: Can't make path of document 1 into type reference.”
CODE – 2
(no “using terms from” in original code)
With AS Editor: works as expected
With Script Debugger: “type reference error” at “set Doc_Path1 to” (Hiroto anticipated this, but thought it might not happen in current Script Editor – it didn’t, but evidently Script Debugger can’t handle it at this time).
CODE – 3
(no using terms from in original code)
Works as expected with both editors.
Using "Preview" in place of TextEdit with same-named Preview windows opened from two to four locations, CODE -1 fails to distinguish the paths properly and the other two throw errors. More on this later, as I'm pretty sure I've worked out a solution.
2) These results seem to confirm the response from dev_ sleidy (using TextEdit). Clearly, the fact that I was using Script Debugger necessitated the 'using terms from . . .' or 'tell app "System Events"', and was responsible for our different results. dev_ sleidy also appears to have been absolutely correct that (with TextEdit) the proper paths were given for same-named items from different locations. I must have mis-read some result earlier, and I apologize for the confusion.
3) _With regard to the "Preview" issue and same-named windows from different locations_, I said earlier that the script was returning the same path for each of the open windows -- the path of the last one opened. That is correct, but a better way of characterizing it is that it's the path of the frontmost window.
I added instructions to the code to sequentially bring each window to the front, getting path information for that window when it is frontmost -- and that seems to solve the issue completely (it also does not cause any problems with TextEdit, which previously worked properly without the extra code). I'll post the new code if anyone is interested.
3) Other applications: the code I now have appears to work well with TextEdit and Preview, but I'd like to make it as universal as possible. I've played around with Safari web archives, and other native apps, and they all seem to have their own peculiarities. I've also looked at MS Office apps; "Word" appears reasonably straightforward, but I haven't found my way with Excel and PowerPoint, mostly because of the different types of windows that may be open (I also expect that different MS versions might require different solutions). And I realize that there are apps (even native ones) for which I probably can't get the path, or at least easily.
I'm not asking for any response to this post (but I certainly wouldn't object); I'll just plug away on it as I have time. Thanks for the previous responses.

Similar Messages

  • Air Application URL Path Issue

    I am trying to invoke a  content of the file which is in shared folder from Air application.
    Version : Flash builder 4.5,Flex3.6 sdk and Air 2.7.
    for this am using the below code..
    var request:URLRequest = new URLRequest();
    //request.url = ('file:///c:/params.txt'); - This is working fine
    request.url = ('file:///172.20.188.25/Share/chk/Property/params.txt');  // its not working
    trace("Unable to load URL: " + request);
    var variables:URLLoader = new URLLoader();
    variables.dataFormat = URLLoaderDataFormat.VARIABLES;
    variables.addEventListener(Event.COMPLETE, completeHandler);
    try
    variables.load(request);
    The same part of code ,I tried in Flex application is working .but in Air application its not working.
    Its urgent requirement,If any one know the way to resolve this path issues.
    Kindly let us know.
    Thanks in Advance !!

    I tried in the following URL but no use ..
    its throwing ioError and textError and stream error.
    1.file:///172.20.188.25/Share/chk/Property/params.txt
    2.http://172.20.188.25/Share/chk/Property/params.txt
    3. //172.20.188.25/Share/chk/Property/params.txt
    Is there any other solution for this issue ?

  • Leopard + Numpy + Scipy: Path Issues Remain

    +This post has been cross-posted on the pythonmac-sig mailing list.+
    I've been reading about the python path issues with Leopard and have tried the different methods outlined for addressing this problem with no good result. Currently I am using a combination of .pth files and a modification to my ~/.profile. One nagging problem is that SUDO commands do not maintain these settings. When I install wxPython, these go into the /System folder, not my /Library/Python folder. Also, when installing scipy, numpy.distutils.core cannot be found.
    sudo python scipy_dir/setup.py install
    I've installed numpy 1.0.4 and this is placed in /Library/Python/2.5/site-packages. I've also installed the MacPython from python.org. When running python from a Terminal window, the correct version of numpy gets loaded (1.0.4). However, as has been documented before, sudo overrides these settings, so when I attempt to install scipy, the following error shows up:
    Traceback (most recent call last):
    File "setup.py", line 55, in <module>
    setup_package()
    File "setup.py", line 29, in setup_package
    from numpy.distutils.core import setup
    ImportError: No module named numpy.distutils.core
    Has anyone found a way around this?
    Just for good measure, I've included my current sys.path (after a sudo call):
    ['/code/libs/scipy-0.6.0', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-s criptpackages', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages' , '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ wx-2.8-mac-unicode']

    Hi, newbie730
    On my system, the numpy module is not found in
    /System/Library/Frameworks/Python.framework/Versions/2.5/lib
    but rather in
    /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python ...
    perhaps your sys.path is missing an element?
    To elaborate a bit more, the solution that worked for me was to either just use the default version of python (/usr/bin/python), in which case numpy works just fine with no further tweaking, or if I want readline support to use the interpreter from fink (/sw/bin/python), and set the environment using the PYTHONPATH variable:
    (all these should be exported)
    # for python:
    PYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/p ython/:$ROOTSYS/pyroot:$ROOTSYS/lib
    # 'base' files, including numpy and scipy installed by apple + ROOT stuff
    PYTHONPATH=$PYTHONPATH:/Documents/Code/python #add my own modules
    PYTHONSTARTUP=/Users/#####/.pystartup
    PYTHONDOC=/sw/share/doc/python25/html
    I'm not sure if that answers your question...
    Caleb

  • Pathing issues in Flash CC

    I believe I have some pathing issues and was wondering how I can change the pathing so that is can be view publicly. The problem is my videos are being played from my local folder and can't be access via web browser for other users.

    It's in the code area, and I tried pasting it (didn't show anything) and then executing the code, and it didn't do anything.
    I then tried creating a text area on the page, and went to the Edit menu - and "Paste Special" was the only available option. So I tried that, and it says "Source: Unknown Source" and the only option I have is to Cancel.
    I then went into Flash CS6, and copied a line of code from that. I tried pasting it into the Flash CC 2014 actions console, and it did nothing. I then went back to my text area (still in Flash CC 2014) and it pasted the code in there fine. 
    So, it looks like I still cannot copy from or paste into the actions panel Flash CC 2014, which is what I need. But, maybe this sparks another idea? Thanks for your help, I appreciate it.

  • %PATH% issue sending job

    11g grid control, 11g agent, 9i database
    installed agent, echo %PATH% and dont see the agent binaries there.
    created a job locally on machine for rman, runs ok from command line and scheduled tasks but fails from grid control when I created an OS task job. server has dbschedule as its preferred credentials
    Put some logging in, can see it logged on as dbschedule.
    however the %PATH% now has my 11g agent install path at the front of the path so is failing as the 11g binaries are incorrect for the 9i database.
    I can get round this by setting the paths and homes in the script. However.....
    If I send an RMAN specific job down from grid control it fails as well but this time it forces grid control to lose its configuration with the 9i database. Im pretty sure its related to the PATH issue above.
    anyone know why this is happening and how to fix? Im pretty sure its the logon interactive and logon as a batch job are the issues but dont know why the PATH would be different.

    answered this myself in case anyone else comes across it. If you call an OS job from grid control ,the agent on the server that your calling, prepends the path with the agent version binaries, so if your path on the agent server is d:\oracle\9i and youre using an 11g agent
    calling the OS job from GC means the PATH gets changed to d:\oracle\11gagent\bin;...more 11g paths;d:\oracle\9i so the wrong binary is used for sqlplus or RMAN or whatever tool you wanted to use
    Should always be putting paths in any OS script anyway but interesting to note the behaviour.

  • Replacement path issue

    Hello,
    Can anybody please help me with a replacement path issue which I have been struggling with for days, and I am completely lost
    now and close to despair!
    Here's what I am trying to do. I have a simple query with one key figure (let it be Presence) and three items in structure in rows: 0EMPLOYEE, 0PROFIT_CTR and variance. The idea is to show the result both for the person (0EMPLOYEE), and compare it with their overall profit centre result, and calculate variance.
    For example:
    John Doe: 50% (presence)
    Profit centre which John belongs to: 40% (presence)
    variance: 10%
    The only variable I want to input is John's name, and the query is supposed to find his current (time dependant) profit centre (0EMPLOYEE_0PROFIT_CTR) and use it to calculate the profit centre result. Is there any way that I can achieve this?
    Once the query is done, I want to set it up on the Broadcaster to run for all the people in the firm.
    Please please help me,
    Cheers,
    Agata

    Aglukas,
    You need two queries to achieve this
    Query 1 u2013 ( this gets Profit center of that employee to feed into Query 2)
    Column Presence(key figure)
    Row u2013 profit center
    Employee u2013 Employee variable that is user entry
    Query 2 u2013
    Column u2013 Presence
    Row Structure u2013 Selection 1- Title- Employee u2013Restriction should be employee with user entry variable
    Selecton 2 u2013 Title For entire profit center u2013 Restriction should be Profit center u2013 Variable should be-Replacment path Variable- fetching Profit center from Query 1
    Selection 3 u2013 Selection 1-Selection 2 this could be a cell defination.
    Hope this helps
    Regards

  • Cs5 "local disc" and .js path issues

    Trying to add what appears to be a simple .js script to my doc:
    I add the script to my <head>, which then shows next to my Source Code and other scripts. But it doesn't work, and when I click to open the file there, I get the message 'not on local disc', and 'Get' which doesn't work either, even though the file is in my local file view/f8. One would think when the script name pops up next to Source Code, the doc. path is correct, but that obviously isn't the case. So what is the deal with this 'local disc'?
    I added a clearbox last week after pulling my hair out over the similar path issues, and after much trial and trib it finally worked. Would rather just like to understand it. Can anyone help? Thank you.
    The .js' Column' script I'm trying to add is here if it helps: http://www.projectseven.com/tutorials/css/pvii_columns/index.htm

    I also would like to know how to do this!

  • Path issue leaving me unable to add blog post content in design view

    Hi guys,
    I am unable to add blog post content in design view when a template is applied to my blog. BC support have told me they fixed the problem by making minor changes to the paths of the css and javascript files and then told me to post on here for the solution.
    When I call the files using <link rel="stylesheet" href="/css/custom.css" /> everything displays perfectly but in BC I can't add blog post content in design view. I can edit in html but this isn't ideal for clients to update the blog.
    If I change the paths to <link rel="stylesheet" href="css/custom.css" /> it fixes the problem and I can then edit blog content in design view but all blog pages that are in folders display incorrectly. Only the main blog page display properly.
    I'm sure the answer is simple but I can't find it so any help would be greatly appreciated. Thanks
    Pete

    I took a look at your page URL and can't find any CSS issues or styles that would directly affect you editing/adding content to a blog post via the content editor.
    Make sure you either clear your cache or try in another browser to see if the problem is localized to your current browser.
    If you still have the problem can you link me to a screencast (you can use Jing if you don't have a screencast program: http://www.techsmith.com/jing.html) of what you are experiencing?

  • Possible 'Class Path' Issues

    Hi Guys,
    I have problems compiling a file and I suspect it could be something related to classpaths. I am using NetBeans 6.9.1 as my IDE. When I set JDK 1.6 as my platform and complile, there are no issues, the programs compiles fine.
    My 'classpath' and 'path' are as follows:
    classpath:
    .;C:\Program Files\Java\jre1.6.0_07\lib\ext.;c:\java\classes;
    path:
    \....\....\....C:\Program Files\Java\jdk1.6.0_21\
    If I were to set the JDK as in 1.5, I seem to get the follwing error:
    ' cannot access org.red5.server.api.IScope
    bad class file: C:\Program
    Files\Red5\red5.jar(org/red5/server/api/IScope.class)
    class file has wrong version 50.0, should be 49.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    import org.red5.server.api.IScope;
    1 error
    To rectify the problem I maded changes to my classpath and path, and yet the problem persists. The changes I made
    are as follows:
    classpath:
    .;C:\Program Files\Java\jre1.6.0_07\lib\ext.;C:\Program Files\Java\jre1.5.0_22\lib\ext.;c:\java\classes;
    path:
    \....\....\....C:\Program Files\Java\jdk1.6.0_21;C:\Program Files\Java\jdk1.5.0_22;C:\....\
    I hope someone can advise me on how I get rectify the problem and get the program to compile with JDK 1.5. Thanks.

    he wants to use JDK 1.5.Do read the thread before you post. He is* using JDK 1.5 when he gets the error message. He said so. This is the problem.* Not the solution. When he uses 1.6 he doesn't get the error.
    His environment is a bit messed up because he has PATH entries for both JDK versions.There is precisely zero evidence for that assertion.
    If he wants to compile and test with JDK 1.5, then removing 1.6 would make sense.No it wouldn't. He is using classes compiled for 1.6 with a 1.5 compiler. His problem is with red5.jar(org/red5/server/api/IScope.class) whose class version is 50.0. It's all written there above. If he wants to use that .jar file he has to use 1.6. Or else recompile that .jar file with 1.5, if he has the sources.

  • SWFLoader loded swf and relative path issue

    Hi,
    Before explaining the problem, let me describe the usecase.
    I have dashboard flex application hosted on Host1.
    I have another flex application which acts as plugin to dashboard and is hosted on Host2.
    I am using proxy to load plugin into dashboard using SWFLoader. With proxy SWFLoader in dashboard thinks that the plugin is coming from same host.
    For plugin to load I specify SWFLoader source something like - source="Proxy/Host2WebappDir/plugin.swf.
    Everything is fine upto this point. plugin.swf get loads successfully without any issue.
    Now the problem -
    If plugin.swf made some request - the url path of that requrest is expected to be relative - i.e. if it make request say getIndianStates.xml, I am expecting the request should look for resource at "Proxy/Host2WebappDir/getIndianStates.xml". Instead it tries to look for getIndianStates.xml into dashboard hosting directory on Host1.
    Can this issue be resolved without making any modification in source of plugin.swf.
    Thanks in advance,
    Prithveesingh Zankat.

    I don’t know if any way to fix this without changing the URL the plugin wants to load.  Now if the plugin stores that URL in a publicly accessible variable, you might be able to access it from the main SWF and change it.  But it would be better to have the plugin detect relative paths and make sure they are relative to the SWF.  The SWFLoader component uses a LoaderUtil class to do that for SWFs it loads, but loads that don’t use SWFLoader need similar fix ups.

  • PATH() issue - The Value 'Val123' has multiple values

    Im using PATH() to get a flattened hierarchy. I keep getting the following error:
    Calculation error in column 'Detail'[]: Each value in 'Detail'[UniqueID] must have the same value in 'Detail'[ParentTest]. The value 'A00012:A123' has multiple values.
    I know with 100% certainty that there are not multiple values for A00012:A123.
    I have also copied the data ( from the powerpivot Designer) to another workbook and cannot reproduce the issue. 
    Can anyone advise what might be going on here? Im using Excel 2010 32bit, if its any use. If i can supply any further information please let me know.
    Thanks

    I found the issue. In a seperate set of rows there was a duplicate. the rows had nothing to do with the rows that were actually mentioned in the error message. so a cause has been identified.
    Thanks

  • Remote Path Issue

    In <param name="movie" tag, if i specity like below it is
    working fine.
    <param name="movie" value="../swf/xyz.swf">
    Suppose my file xyz.swf is in some remote system name abc and
    in folder def. How to specify the
    path in that situation. I tried like following but it is not
    working
    <param name="movie" value="//abc/def/xyz.swf">
    Any help in this issue is highly appreciated and Thanks in
    advance.

    Here is the code and I modified at both places
    Thanks mercl for the earlier responses and Thanks in advance
    for next response
    In the code what does mysite.com represents.
    <object
    classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1"
    codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
    border="0" width="980" height="700">
    <param name="movie" value="
    http://www.mysite.com/system1/swf/1_lowoilpressure_switchindication_testing.swf">
    <param name="quality" value="High">
    <param name="wmode" value="transparent">
    <embed src="
    http://www.mysite.com/system1/swf/1_lowoilpressure_switchindication_testing.swf"
    pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" name="obj1" width="980"
    height="700" quality="High" wmode="transparent"
    swliveconnect="true"></embed></object>

  • RMI Server Class path issue

    hi ,
    i am facing classpath issue when try to run rmi server. i have a jar file
    (RmiServer.jar) for rmi server , which contain some other jar file .
    when i run this jar file it throws ClassNotFoundException
    the java classloader are not able to load class from jar(RmiServer.jar)
    file. pls. tell me what i did wrong .
    Regards
    Brajesh K

    Actully you dont understand my problem.
    i have 2 jar file RmiClient.jar and RmiServer.jar
    when i run RMIserver.jar it throws following exception.
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: RmiServer_Stub
    the RmiServer.jar contain all the class file (stub/skelton,remote,etc) whichever needed.
    even i set class path to that folder where RMIserver.jar is placed
    inspite of that it throws ClassNotFoundException : RmiServer_Stub
    i dont undersatand why classloder , not able to load class file from Rmiserver.jar.
    any idea.
    thanks in advance
    Regards
    Brajesh K

  • Shortest path issue

    Hey guys, first...Happy thanksgiving :)
    Ok, so I'm on my last assignment for my amazingly taught Data Structures class. I battled my way successfully through recursion, binary trees, redblack trees, 234 trees, B Trees, and heaps!...no issues at all!....but, now I have hit graphs. I understand the concept, but my latest assignment has me a bit frustrated..Im so close to finishing I can taste it!!....I just cant find the spoon..
    Here we go:
    We are given a graph on paper. It has circles (verteci) representing cities in the USA. These circles are connected by lines (edges) representing the distance between the cities. Also, the lines have arrows pointing the direction they may be traversed.
    We are to construct the graph in the computer, and then compute the shortest path from washington (Vertex 0) to every other city.
    I managed to construct the graph, and it will find the shortest path no problem. My only issue is that, it wants us to print the path it took, not just the destination and total distance....
    I have tried using a stack to push the verteci onto as theyre visited, but im not getting happy results.
    I should also mention, this code is taken out of the book with modifications by me so that it can add edges and verteci, and it now accepts String types for the vertex labels instead of characters.
    Here is my code
    PATH.JAVA (the important part)
    // path.java
    // demonstrates shortest path with weighted, directed graphs
    // to run this program: C>java PathApp
    import java.lang.*;
    import java.io.*;
    class DistPar               // distance and parent
    {                           // items stored in sPath array
        public int distance;    // distance from start to this vertex
        public int parentVert;  // current parent of this vertex
        public DistPar(int pv, int d)  // constructor
            distance = d;
            parentVert = pv;
    }  // end class DistPar
    class Vertex
        public String label;        // label (e.g. 'A')
        public boolean isInTree;
        public Vertex(String lab)   // constructor
            label = lab;
            isInTree = false;
    }  // end class Vertex
    class Graph
        private final int MAX_VERTS = 20;
        private final int INFINITY = 1000000;
        private Vertex vertexList[];    // list of vertices
        private int adjMat[][];         // adjacency matrix
        private int nVerts;             // current number of vertices
        private int nTree;              // number of verts in tree
        private DistPar sPath[];        // array for shortest-path data
        private int currentVert;        // current vertex
        private int startToCurrent;     // distance to currentVert
        private stack path_taken;       // stack to record path taken
        public Graph()                  // constructor
            vertexList = new Vertex[MAX_VERTS];
                                             // adjacency matrix
            adjMat = new int[MAX_VERTS][MAX_VERTS];
            nVerts = 0;
            nTree  = 0;
            for(int j=0; j<MAX_VERTS; j++)      // set adjacency
                for(int k=0; k<MAX_VERTS; k++)  //     matrix
                    adjMat[j][k] = INFINITY;    //     to infinity
            sPath = new DistPar[MAX_VERTS];     // shortest paths
            path_taken = new stack(MAX_VERTS);
        }  // end constructor
        public void addVertex(String lab)
            vertexList[nVerts++] = new Vertex(lab);
        public void addEdge(int start, int end, int weight)
            adjMat[start][end] = weight;  // (directed)
        public void path()                // find all shortest paths
            int startTree = 0;             // start at vertex 0
            vertexList[startTree].isInTree = true;
            nTree = 1;                     // put it in tree
          // transfer row of distances from adjMat to sPath
            for(int j=0; j<nVerts; j++)
                int tempDist = adjMat[startTree][j];
                sPath[j] = new DistPar(startTree, tempDist);
          // until all vertices are in the tree
            while(nTree < nVerts)
                int indexMin = getMin();    // get minimum from sPath
                int minDist = sPath[indexMin].distance;
                if(minDist == INFINITY)     // if all infinite
                {                        // or in tree,
                    System.out.println("There are unreachable vertices");
                    break;                   // sPath is complete
                else
                {                        // reset currentVert
                    currentVert = indexMin;  // to closest vert
                    startToCurrent = sPath[indexMin].distance;
                    // minimum distance from startTree is
                    // to currentVert, and is startToCurrent
                // put current vertex in tree
                vertexList[currentVert].isInTree = true;
                nTree++;
                path_taken.push(sPath[indexMin]);
                adjust_sPath();             // update sPath[] array
            }  // end while(nTree<nVerts)
            displayPaths();                // display sPath[] contents
            nTree = 0;                     // clear tree
            for(int j=0; j<nVerts; j++)
                vertexList[j].isInTree = false;
        }  // end path()
        public int getMin()               // get entry from sPath
        {                              //    with minimum distance
            int minDist = INFINITY;        // assume minimum
            int indexMin = 0;
            for(int j=1; j<nVerts; j++)    // for each vertex,
            {                           // if it's in tree and
                if( !vertexList[j].isInTree &&  // smaller than old one
                                   sPath[j].distance < minDist )
                    minDist = sPath[j].distance;
                    indexMin = j;            // update minimum
            }  // end for
            return indexMin;               // return index of minimum
         }  // end getMin()
        public void adjust_sPath()
          // adjust values in shortest-path array sPath
            int column = 1;                // skip starting vertex
            while(column < nVerts)         // go across columns
             // if this column's vertex already in tree, skip it
                if( vertexList[column].isInTree )
                    column++;
                    continue;
             // calculate distance for one sPath entry
                           // get edge from currentVert to column
                int currentToFringe = adjMat[currentVert][column];
                           // add distance from start
                int startToFringe = startToCurrent + currentToFringe;
                           // get distance of current sPath entry
                int sPathDist = sPath[column].distance;
             // compare distance from start with sPath entry
                if(startToFringe < sPathDist)   // if shorter,
                {                            // update sPath
                    sPath[column].parentVert = currentVert;
                    sPath[column].distance = startToFringe;
                column++;
             }  // end while(column < nVerts)
        }  // end adjust_sPath()
        public void displayPaths()
            for(int j=0; j<nVerts; j++) // display contents of sPath[]
                System.out.print(vertexList[j].label + "="); // B=
                if(sPath[j].distance == INFINITY)
                    System.out.print("inf");                  // inf
                else
                    System.out.print(sPath[j].distance);      // 50
                    String parent = vertexList[ sPath[j].parentVert ].label;
                    System.out.print(" (" + parent + ") ");       // (A)
            System.out.println("");
            System.out.println("PRINTING path_taken");
            DistPar thing = null;
            while((thing = path_taken.pop()) != null)
                System.out.println(" " + vertexList[thing.parentVert].label + " "+ thing.distance);
    }  // end class GraphSTACK.JAVA (my stack class)
    // stack.java
    // demonstrates stacks
    // to run this program: C>java StackApp
    class stack
        private int maxSize;        // size of stack array
        private DistPar[] stackArray;
        private int top;            // top of stack
        public stack(int s)         // constructor
            maxSize = s;             // set array size
            stackArray = new DistPar[maxSize];  // create array
            top = -1;                // no items yet
        public void push(DistPar j)    // put item on top of stack
            stackArray[++top] = j;     // increment top, insert item
        public DistPar pop()           // take item from top of stack
            return stackArray[top--];  // access item, decrement top
        public DistPar peek()          // peek at top of stack
            return stackArray[top];
        public boolean isEmpty()    // true if stack is empty
            return (top == -1);
        public boolean isFull()     // true if stack is full
            return (top == maxSize-1);
    }PATHAPP.JAVA (test program..builds the graph and calls path())
    class PathApp
        public static void main(String[] args)
            Graph theGraph = new Graph();
            theGraph.addVertex("Washington");
            theGraph.addVertex("Atlanta");
            theGraph.addVertex("Houston");
            theGraph.addVertex("Denver");
            theGraph.addVertex("Dallas");
            theGraph.addVertex("Chicago");
            theGraph.addVertex("Austin");
            theGraph.addEdge(0,1,600);
            theGraph.addEdge(1,0,600);
            theGraph.addEdge(0,4,1300);
            theGraph.addEdge(4,3,780);
            theGraph.addEdge(3,1,1400);
            theGraph.addEdge(1,2,800);
            theGraph.addEdge(2,1,800);
            theGraph.addEdge(4,5,900);
            theGraph.addEdge(4,6,200);
            theGraph.addEdge(6,4,200);
            theGraph.addEdge(6,2,160);
            theGraph.addEdge(3,5,1000);
            theGraph.addEdge(5,3,1000);
            System.out.println("Shortest Paths");
            theGraph.path();
            //theGraph.displayPaths();
            System.out.println();
    }Im mostly having trouble comprehending the Path.java file. A few friends and I stared at it for a few hours and couldnt get it to do what we wanted...
    path_taken is the stack I added in to try and push/pop the verteci as theyre traversed, but with what I stuck in right now, it still just prints the most recently visited vertex, and the sum of the distances.
    Any help is greatly appreciated!
    Thanks :)
    ----Arkhan

    If your graph is G(V, E), and you're trying to get to vertex v_end, then create a new graph G'(V', E') whereV' = (V x N) U {v_end'}
        (v_end' is a new object)
    E' = {((u, t), (v, t + f(u, v, t))) : (u, v) in E, t in N} U
         {((u, t), (u, t + 1)) : u in V, t in N} U
         {((v_end, t), v_end') : t in N}G' is infinite, so you'll need to use a lazy graph structure. Then just use Dijkstra from (v_start, 0) to v_end'.

  • Overlapping and intersecting paths issue

    I have a logo that I've made, however I'm trying to fix this overlapping issue solely in Illustrator instead of having to use Photoshop as well. My issue is a rope that goes under and over an anchor at various points. I'm quite new to Illustrator so I'm resorting to masking out the rope in Photoshop. Below is what I'd like to have:
    And this is the furthest I can seem to get in Illustrator:
    Any attempts to break the rope path up will change the path alignment which I can't seem to correct. I've tried clipping masks and that seems to make things worse. What would you suggest? I'm using CS6 and I'm fairly new with Illustrator.

    Take your original copy of the rope adn send it to back.
    Copy a duplicate and paste this in front
    Draw rough shapes filled with black for the area you want the rope to be on top of the anchor, and group these elemtns (this will be your mask)
    Select the top rope and your mask, in the transparency palette click make mask (Versions older than CS6 this can be found in the flyout menu)
    Enable clip and invert mask

Maybe you are looking for