I use this code in order to remove layers that are out of the data frame of the map:  import arcpy,os,sys,string import arcpy.mapping from arcpy import env  env.overwriteOutput = True   env.workspace = r"G:\PROJECTS\kohav_yair_west\gis\aa" for mxdname in arcpy.ListFiles('*.mxd'):         print '---' ,mxdname, '---'           mxd = arcpy.mapping.MapDocument(os.path.join(env.workspace, mxdname))           df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]         print 'REMOVED LYR'         for lyr in arcpy.mapping.ListLayers(mxd, "" ,df):                 if lyr.isGroupLayer == True: continue                 if lyr.isRasterLayer == True: continue                 arcpy.MakeFeatureLayer_management(lyr.dataSource, "lyr")                 frameLyr = r"G:\PROJECTS\kohav_yair_west\gis\layers\frame.shp"             arcpy.SelectLayerByLocation_management("lyr", "INTERSECT", frameLyr)                 if int(arcpy.GetCount_management("lyr").getOutput(0)) == 0:                         arcpy.mapping.RemoveLayer(df, lyr)                         print u'Removed '+unicode(lyr) + ' lyr'         print '---REMAIN LYR---'         for lyr in arcpy.mapping.ListLayers(mxd, "" , df):                 print lyr.name         mxd.save()         del mxd   but i get this error and i don't understand what is the problem?  --- ttl.mxd --- REMOVED LYR  Traceback (most recent call last):   File "G:\desktop\y\yaron\Private\shonot\software\---gis---\tools\YARON_SCRIPTS\SelectLayerByLocation3.py", line 21, in &lt;module&gt; arcpy.MakeFeatureLayer_management(lyr.dataSource, "lyr")   File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 6520, in MakeFeatureLayer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset F:\GIS\Updating_2014\ttl\arcview\ttl_all_blue_lines_07.05.shp does not exist or is not supported Failed to execute (MakeFeatureLayer).   This route : F:\GIS\Updating_2014\ttl\arcview\ttl_all_blue_lines_07.05.shp exist but the name of the layer is :"ttl_all_blue_lines_07.05.14.shp" and in the error it mention as ttl_all_blue_lines_07.05.shp
The only thing I need is an exact copy of an existing shapefile in the same directory with a different name.  I have tried:   arcpy.CopyFeatures_management (ORLinks, MyLinks) #ORLinks: old links, MyLinks: new links   but for some reason, I cant make it a feature layer using:  arcpy.MakeFeatureLayer_management(MyLinks, 'MyLinks')   Error Encountered:  Error: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset  M:\RAIL\Rail2.0.shp does not exist or is not supported Failed to execute (MakeFeatureLayer).
Starting with the episode "Crossroads Part II" the      final five Cylons begin to hear Bob Dylan's "All Along the Watchtower" in their heads.   Have the creators/writers ever stated why they picked that song in particular and what it might mean to the story? Why doesn't archive.ubuntu.com use HTTPS? I always see instructions for adding the Universe and Multiverse repositories that look something like the following:  sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"   Recently I tried editing this to use HTTPS instead and was dismayed to find that archive.ubuntu.com doesn't appear to respond to HTTPS. Now I wonder how feasible it would be, or what damage could be done, if an attacker were to successfully perform a man-in-the-middle attack here?  Am I being too paranoid, considering the role these repositories perform on a system? What can cause "Android OS" process to use high percentage of battery? How to write startup script for Systemd? I have 2 graphics cards on my laptop. One is IGP and another discrete.   I've written a shell script to to turn off the discrete graphics card.  How can I convert it to systemd script to run it at start-up? Why can two (or more) electric field lines never cross? The the title is self explanatory, I guess.  Why can two (or more) electric  never cross? I often see tutorials on the web or posts on this site which make heavy use of the following characters at the command line. Often it seems that they are used for pretty similar purposes. What are the differences between them when used on the command line or for shell programming? For what purpose do I use which of them?  " " double quotes  ' ' single quotes  ` ` backticks How do I install the latest stable version of Thunderbird? Windows INSERT key anti-functionality accidentally triggers; how to stop it permanently? Semicolon or dash? I have connected speakers to the back panel of my computer at work and I would like to have them always enabled (I can switch them off on the speaker casing). However when I connect headphones on the front panel system automatically says that the rear output is unplugged.  I found a solution to disable auto detection with Alsamixer and it works almost ok except the fact that after system restart I need to reconfigure the settings again... How can I set this once and forget about it? $\sin(n)$ subsequence limits set We were given a challenge by our calculus professor and I've been stuck on it for a while now.   Show that the set of subsequence limits of $A_n=\sin(n)$ is $[-1, 1]$ (another way to phrase this would be: $\forall r\in [-1,1]$ there exists a subsequence of $A_n=\sin(n)$ that converges to $r$).  What would be a good way to start? How can I retrieve \thepage (or detect a page change) from Lua in LuaTeX? I am writing (contributing to) a LuaLaTeX package where a Lua function is used to generate images that are inserted in the LaTeX document.   One piece of information we need is the current page number to determine if we're on an odd or even page (I know that this is not that trivial, and I know about some strategies beyond \thepage). We set a Lua variable when we're still in the LaTeX part, and so far this works pretty well.  However, now it turns out that the sequence of images we create may be distributed on several pages, and we would really like to reflect that because our images may behave differently on odd and even pages.  Basically what we have is a series of  tex.print('\\includegraphics{something}\\par')   statements, executed in a loop within one Lua function.  Now the question: is there any way to either directly detect a page change between two such graphics or repeatedly retrieve the current page within such a loop?  All the solutions I have found for determining current odd or even state are in LaTeX itself. I know how to use \directlua to retrieve a value for use in LaTeX, but is there a way to do the opposite - retrieve a LaTeX value from within LUa?  Edit: to respond to TeXnician's comment and answer: When I modify the example code so it produces repetitions of paragraphs it seems that the page counter won't get updated within one Lua chunk:  \documentclass{article}  \newcommand\printluapage{%     \directlua{for i = 1, 60 do tex.print(tex.count['c@page'])          tex.print([[\par]]) end} }  \begin{document} \printluapage  New command  \printluapage  New command  \printluapage \end{document}   The page number is only updated with each new call of \printluapage. There are many times when I'd like to jot a short note in my passport. For example, the business purpose of an entry into a country -- or for countries with automatic passport control and when I don't get a stamp, I'd like to notate my entry and departure.   Can one write in one's own passport? I wouldn't of course write over any stamps, but I might write near them. Or could I use a back page as entry and departure dates?  Yes, I could use a separate piece of paper or a computer file, but having them all in my passport would be handy -- especially when a border officer asks where I've been and why.   And if the laws vary by country, can you note this in your answer? Would it matter if my notations were in ink or pencil? These aren't doodles but business-like annotations and lists. I'm not sure if there's already an existing term for this, so I'm inventing my own. (tl;dr: I call them &quot;chameleon questions&quot; because they change every time you submit or edit an answer.  If you're already intimately familiar with the phenomenon, please skip past the first set of bullet points to where I ask for recommendations.)  I think many of us have experienced this on occasion:  You open up a narrow-looking question, usually dealing with some specific error message.  The question probably contains a snippet of sloppy but not quite awful code; code indicating that the author, typically a new/low-rep user, possibly a , doesn't really know what they're doing.  I'm not trying to be condescending here, they're probably very intelligent and hardworking, but in this specific case, they're clearly in way over their head.  However, as a question, it's not really too bad.  The goal and problem are both clearly stated.  The code is formatted (sort of).  Mort was polite and checked their spelling.  The question looks answerable, although from a rep perspective* it's an obvious dead-end, it's had maybe 3 views in the past 30 minutes.  So you decide, you know what, this person took the time to write up the question properly, they deserve an answer, put on your good citizen hat and throw them a bone.  You slog through the ugly code, find the offending line, direct their attention to it and explain why it's wrong and how it needs to be fixed.  Later, they leave a comment saying that yes, that was indeed the problem and your answer helped them fix it (great!).  Oh, but, now there's another problem (uh-oh...). Something else is broken.  After letting out a long sigh, you read the comment and/or edited question, roll up your sleeves, and write up Take 2, hoping that's the end of it.  And of course it's not the end.  Now maybe the error is gone, but it's not doing what it's supposed to.  If you're anything like me, your patience is now starting to wear thin. It's lousy code and you didn't volunteer to help them rewrite their whole app.  And of course, the question still only has 12 views, and nobody has upvoted either the question or your answer, including the person you're helping, so this is turning out to be a genuinely thankless task in all respects.  Welcome to &quot;Family Tech Support&quot;, Web 2.0 Edition.   * Which is of course just an arbitrary number that none of us care about. Not really, anyway. Not very much, at least.  So, here's where I get to my question.  At this point, do you:  Leave a comment, stating as politely as possible that you've done your best to help them answer the original question they asked, and if they have a new problem then they should start a new question?  (I did this once, and actually ended up with an accept, but I felt kind of guilty afterwards, I don't think anybody answered their 2nd question).  Bite the bullet and edit your answer a 3rd, 4th, 5th time, however many times it takes to resolve their issue, knowing full well that they may not even remember to accept the answer once you're done? (I may work for free on SO, but that doesn't mean my time is worthless.)  Just abandon the question, hoping that it will force Mort to start thinking for himself?  Something else?   I've tried all three of the above and none of them ever quite feel right. I do want to help, but at the same time there are a lot more &quot;lucrative&quot; questions I could be answering. And I don't mind spending a lot of time on an answer either, if the question is interesting or important to me, but debugging is dull work. I'd prefer not to reference specific questions here; I'm pretty sure that this is a shared experience, and my objective isn't to point fingers at &quot;misbehaving&quot; members.  I'm more looking for some practical advice on how to dig myself out of these pits of despair. Anybody have any other ideas? After the top bar changes in the , when a non logged-in user click the Sign Up button, instead of navigating to the corresponding page it displays the openid related code in the screen.  Screenshots for reference: Is the following just a matter of showing the 3 properties that make up a metric??  Define d on $\Bbb R\times\Bbb R$ by $d(x,y)=\min \{1,|x-y|\}$. Show that $d$ is a metric on $\Bbb R$     $d(x,y)=0$ if $x=y$   $d(x,y)=d(y,x)$ for every $x,y \in X$   $d(x,y)\le d(x,z)+d(z,y)$ for every $x,y,z \in X$ I would like to pause a render that I have started, with the intention of resuming it at a later time (but during the same Blender session).  How can I do this? Prove that the only automorphism of $\mathbb{Q}(\sqrt[3]{2})$ is the identity automorphism. I am having difficulty with this proof. I have previously proved that for an automorphism on the extension field $K$ of $F$ that when restricted to $F$ is the identity automorphism must take roots of $f(x)\in F[x]$ in $E$ to roots of $f(x)$ in $E$. I was thinking of using the minimal polynomial $x^{3}-2\in\mathbb{Q}[x]$ and the result of previous problem I solved, but I suspect there are automorphisms that don't fix the subfield, so the result can't be used or I need to prove that any automorphism of an extension field must fix the subfield that is being extended or always sends roots in $E$ to roots in $E$.  I am not asking for a solution to this, but maybe a hint or pointer in the right direction. This problem is introduced in the text prior to Galois theory, so please keep that in consideration. I was surfing the internet the other day when I found this phrase: Instead your precious time and attention is wasted. To my ears, it sounds wrong. But I'm not a native English speaker, so I consulted with a number of them, and some of them said that it was "is" because the adjective modifies only the noun "time" and not "attention". Others said it "is" because that's just how it is. But I still believe it should be "are". Any help is appreciated. How can a CPU deliver more than one instruction per cycle?