I'm working on a project where I am porting Python Tools created for ArcMap Desktop into ArcMap Pro but I am encountering an issue when I get to lines of the original code that read:     insertLayer = arcpy.mapping.Layer(input), which aims to create a Layer object to manipulate/process.    Having presumed product compatibility, I tried insertLayer = arcpy.mp.Layer(input) but that didn't work - I get the error message module 'arcpy.mp' has no attribute 'Layer'  From the help pages, I can see there are two ways to access Layer object:   Using listLayers method of Map object, which is dependent on an existing project file (.aprx) with the map having the target layer Using MakeFeatureLayer_management, which creates a Layer from a feature class and let you to use of a string (i.e., the second argument) in place of a layer object but its use is generally limited to Select from Layer operations.   What is the best way to port the Layer object, which is created in ArcGIS Desktop, to Pro?
I want to add a feature class within a Geodatabase to a map in ArcGIS Pro (1.4.1) using arcpy. I am converting some python code from ArcGIS Desktop to ArcGIS Pro.   This issue is very similar to:    and      However, instead of adding a feature class (or layer) to a map using the Python Window I am doing this from a  Script within a Toolbox. I have included a code snippet below.  lyrTest = r"C:\data\test.gdb\Layer1"  aprx = arcpy.mp.ArcGISProject("CURRENT") aprxMap = aprx.listMaps("MainMap")[0]  lyrFile = arcpy.mp.LayerFile(lyrTest) aprxMap.addLayer(lyrFile)   I get the following error message:  Traceback (most recent call last): File "C:\data\AddLayers.py", line 5, in &lt;module&gt;     aprxMap.addLayer(lyrTest) File "c:\users\user\appdata\local\programs\arcgis\pro\Resources\arcpy\arcpy\utils.py", line 191, in fn_ return fn(*args, **kw) File "c:\users\user\appdata\local\programs\arcgis\pro\Resources\arcpy\arcpy\_mp.py", line 1048, in addLayer return convertArcObjectToPythonObject(self._arc_object.addLayer(*gp_fixargs((add_layer_or_layerfile, add_position), True))) ValueError: C:\data\test.gdb\Layer1 Failed to execute (AddLayers).
why can't I edit /proc/sys/kernel/perf_event_max_sample_rate with vi I'm root, running Centos8 on bare mental and permissions on /proc/sys/kernel/perf_event_max_sample_rate are as follows  -rw-r--r--. 1 root root 0 Oct  3 14:00 perf_event_max_sample_rate   I want to change the sample rate by opening this file with vi, making the change and then writing it with either w or w!. When I do so it comes back with  perf_event_max_sample_rate" E667: Fsync failed  When I try to quit, it tells me  E37: No write since last change (add ! to override)   So I can't change the value with vi.  However I can change the value with   echo 4000 &gt; /proc/sys/kernel/perf_event_max_sample_rate   Is this simply because /proc is not a real file system and that all changes to things in /proc would have to be made using echo with a redirect, or maybe sed?  Is this behavior documented somewhere? Downloading files using wget I am trying to download files from .  The URL is:   When I use this command:  wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&amp;format=file    I get only index.html?acc=GSE48191 which is some kind of binary format.  How can I download the files from this HTTP site? This might be a stupid question, but why exactly is work a path function?  In school, my teacher said it’s because it depends on the path. She gave an example of walking up a mountain, and said the work you expend depends on the path you take (straight path up or circling up around the mountain). But isn’t the work expended just equal to $E= mgh?$ How to calculate $\lim \limits_{n \to \infty}(1 +\frac{a}{n})^n$? Printer service not found on port 515 For services list on my Ubuntu, Printer service not found on port 515.  nmap -sT -O localhost  PORT     STATE SERVICE 23/tcp   open  telnet 139/tcp  open  netbios-ssn 445/tcp  open  microsoft-ds 631/tcp  open  ipp 9050/tcp open  tor-socks Device type: general purpose Running: Linux 3.X OS CPE: cpe:/o:linux:linux_kernel:3 OS details: Linux 3.12 - 3.19, Linux 3.8 - 3.19       There is no Printer service on port 515. How to add Printer service on port 515?     nmap -v -p 515 127.0.0.1  Starting Nmap 7.01 ( https://nmap.org ) at 2016-11-19 13:03 IRST Initiating SYN Stealth Scan at 13:03 Scanning localhost (127.0.0.1) [1 port] Completed SYN Stealth Scan at 13:03, 0.21s elapsed (1 total ports) Nmap scan report for localhost (127.0.0.1) Host is up (0.000065s latency). PORT    STATE  SERVICE 515/tcp closed printer Do parts of a hash carry the properties of the entire hash? When I need to generate unique id's based on some information hashing is typical choice. However, sometimes that id needs to be of a particular size.  I've seen a lot of schemes (HMAC-MD5-96 in SSH, CGA in SeND for IPv6) that use a portion of a hash, so I'm thinking it might be alright to use it that way.    Which properties of a hash are preserved and which do not apply anymore?  Obviously, with less bits, the chance of collision goes up, but can I still rely on the partial hash for uniform character distribution?  What about the ?  I'm guessing that if a hash modifies the entire hash upon the smallest change to the input, that would imply that a portion of that hash would be equally well changed.  Am I thinking about this correctly?  Also, would these behaviors be different for different hashing algorithms? Night's Watch deserters are sentenced to death, as we've seen in the very first episode of Game of Thrones. A man dressed all in black is apprehended by Stark men and brought before Lord Eddard Stark. Lord Stark sees him as a deserter and sentences him to die (and then executes that death penalty).  However, there are men of the Night's Watch south of the Wall, on a legitimate mission or on some kind of allowed leave. For instance, we have Benjen Stark visiting Winterfell when the king and his party is there. There is also Yoren, who travels around Westeros in search of new recruits.  I could imagine that the Warden of the North (and other lords in the northern part of Westeros) would have a good idea of who would be allowed further south and whose appearance would raise suspicion. But I reckon the southern lords don't have as many visits from the Night's Watch, so they might not know who would be allowed to be there and who wouldn't.  How would lords who are rather unfamiliar with the specific brothers of the Night's Watch discern deserters from brothers sent out for some reason?  That ends my question, but there is a spoiler from the season 5 finale that continues the question a bit more:      Sam is sent to Oldtown to become a Maester, so he can replace Maester Aemon at Castle Black.  But he is riding together with Gilly (a woman!) and her baby (a baby!), which might raise a lot of suspicion from people who don't know what he is sent out to do.  What prevents southern lords of sentencing Sam as a deserter from the Night's Watch? Easiest way to delete a column? I have a set of 10 tables and each has an extra column that I don't want. Specifically, these tables are descriptions of database tables exported by phpMyAdmin, and they all have a "MIME" column that I would like to remove. Is there a way to do this other than using string manipulation / find and replace?   I have tried setting the column to p{0in}, but the column title still remains. Why does Windows 7 ask for additional drivers when installing from a USB 3.0 drive? Reset or remove the BIOS password on my laptop How do I convert a Word file's references to .bib format How do I convert a Word file's references to .bib format? Is any tool available  to convert it to .bib format? Can't install any app, App Store asks for credit card I haven't been installing anything on my iPad Mini for the past few weeks. But previously, I just had to tap on "Install", enter my Apple ID password and go.  Now, for every new application, even those free ones, I have to confirm each time, that I'm 17 or over. And then App Store asks to enter my credit card information. If I disagree and hit "Cancel", installation process is interrupted and I can't install any application, even free one.  I don't trust Apple at all and I'm not willing to share my credit card information, especially that I'm installing only free applications.  I'm pretty sure that I haven't changed anything in the configuration of my iPad Mini for ages.   Am I missing some significant change to the App Store or this is some kind of bug or virus? Is there anything I can do in this situation? How can I install a free application from the App Store, without having to share my credit card information with Apple? Prove $\gcd(a+b, a-b) = 1$ or $2\,$ if $\,\gcd(a,b) = 1$ I want to show that for $\gcd(a,b) = 1$ $a,b \in Z$   $\gcd(a+b, a-b) = 1$ or $\gcd(a+b, a-b) = 2$ holds.      I think the first step should look something like this:      $d = \gcd(a+b, a-b) = \gcd(2a, a-b)$   From here I tried to proceed with two cases. 1: $a-b$ is even, which leads to $\gcd(a+b, a-b) = 2$ 2: $a-b$ is odd, which leads to $\gcd(a+b, a-b) = 1$  My main problem I think is, that I do not know how I should include $\gcd(a,b) = 1$ in the proof.  Any help is appreciated. Thx in advance. Cherio Woltan No cycle containing edges $e$ and $g$ implies there is a vertex $u$ so that every path sharing one end with $e$ and another with $g$ contains $u$ There is a proof in my textbook for the following claim, which doesn't make a whole lot of sense to me.  My annotations are in bold.  Could someone perhaps elaborate on what's going on?  Claim.  If there does not exist a cycle containing edges $e$ and $g$ then there exists a vertex $u \in V (G)$ such that every path in $G$ sharing one end with e and another with $g$ contains $u$.  Proof: The claim trivially holds if $e$ or $g$ is a loop OK, so we assume that neither is. Let $P$ with vertex set $v_1, v_2, . . . , v_k,$ in order, be a path with $e$ joining $v_1$ to $v_2$ and $g$ joining $v_{k−1}$ and $v_k$. Let $f_i \in E(P_i)$ be the edge with ends $v_i$ and $v_{i+1}$. Let $j$ be chosen minimum so that no cycle in $G$ contains $e$ and $f_j$ We can do this because we know that at least the edge $g$ will not create a cycle by assumption, right?. We will show that $u = v_j$ satisfies the claim.  Suppose not. Let $C$ be a cycle containing $e$ and $f_{j−1}$ What if $f_j = e$?  then what cycle? a single vertex? and let $P′$ be a path from an end of $e$ to an end of $f$ Not sure what the book meant by $f$ here, any guesses? avoiding $u$. Choose a subpath $Q$ of $P′$ with one end in $V (C)$ and another in ${v_{j+1}, v_{j+2}, . . . , v_k}$ as short as possible. Then $C \cup Q \cup P$ contains a cycle containing both $e$ and $f_j$, a contradiction. (The last statement requires some case checking.) This ending seems a bit abrupt and non-obvious to me  Thanks for the help I have made a command  \newcommand{\mysec}[2]{%  \textbf{#1} \\ #2 }   I use it with \mysec{A}{B}.  But sometimes I also want a third parameter. I could make a whole new command for those situations where I need 3 parameters. But I thought if I could handle it with an optional parameter in my original command?  So I have to check if the third parameter is set and how to print if it is set. How would I implement a realistic stock market? Richard Stallman states that Ubuntu "has installed surveillance code". See:   Is this true?   I agree with him that "Any excuse Canonical offers is inadequate....". Why does thermal radiation only occur at infrared and visible frequencies? The resources that I've checked out seem to say thermal radiation only occurs in the infrared and visible spectrum. For example my heat transfer textbook and the Wikipedia page on .  In my mind thermal radiation is just energy emitted as a result of internal collisions from temperature. So, since temperature can range from 0K to huge numbers, I would think you would have a similar range of emitted energies. So then thermal radiation could occur throughout the whole of the electromagnetic spectrum. What games save to the Steam Cloud? Learn Bayesian inference applied to astronomy / astrophysics? I'm looking for resources (books, articles, sites, etc.) to learn about Bayesian inference, but specifically applied to astronomy and astrophysics.