I have different module like distance calculator,radius search and more. Each pages I need to show Legends div so that user can identify places by images on map(or identify the layers).
I am quite new to Javascript. I have made a html script that includes services I published to ArcGIS for server. It all does exactly what I want and I made it by copying working scripts together and getting help from more experienced scripters. I want to finetune my service by adding a legend. Unfortunately I am not able to create a working script. I have added the parts of my script I assume that are necessary to create my legend. Does anybody see what I am doing wrong?        &lt;script&gt;         var map;         var wmsLayer;         var URL;         var legend;         require(["dojo/query", "esri/map", "esri/layers/WMSLayer", "esri/dijit/Legend", "esri/config", "dojo/domReady!"],         function (query, Map, WMSLayer, Legend, esriConfig) {          esriConfig.defaults.io.proxyUrl = "/proxy/proxy_gcx.php";            map = new Map("map", {               basemap: "topo",               center: [5.5, 52.485],               minZoom: 8,               maxZoom: 13,               zoom: 8,               slider: true           });            wmsLayer = new WMSLayer("URL", {               format: "png",               visibleLayers: ["31", "30", "29", "28"]           });            map.on("layer-add", function (results) {               //add the legend               legend = new Legend({                   map: map,                   layerInfos: [{                       layer: results,                       title: "test"                   }]               }, "legendDiv");               legend.startup();           });             map.addLayer(wmsLayer);       });     &lt;/script&gt; &lt;/head&gt;  &lt;body&gt;     &lt;div id="map"&gt;     &lt;/div&gt;     &lt;div id="legendDiv"&gt;     &lt;/div&gt; &lt;/body&gt;   EDIT: I have edited the code. I am still not done. It does give me a legend on my browser but it says there is no content in there. On my arcgis server manager there is a legend.
Supposing to have something like this:  #include &lt;map&gt; int main(){     std::map&lt;int,int&gt; m;     m[1] = 2;     m[2] = 4;     return 0; }   I would like to be able to inspect the contents of the map running the program from gdb. If I try using the subscript operator I get:    (gdb) p m[1] Attempt to take address of value not located in memory.   Using the find method does not yield better results:  (gdb) p m.find(1) Cannot evaluate function -- may be inlined   Is there a way to accomplish this? JSP in /WEB-INF returns "HTTP Status 404 The requested resource is not available" Implementing auto correct/complete on Stack Overflow Why do adult insects have 6 legs? Apparently, there is an advantage to having 6 legs in the insect world. What is that advantage, if anything? Why would such an advantage exist for insects, but not for other, larger land animals?  What do those middle legs do that the front and hind legs cannot, if anything? Are they really essential, or do they just generate more muscle power? Are the various "Zelda" games supposed to take place in a common universe? I was hoping I would find some people in the industry that could help me decide what's the best price to charge to design (in this case) business cards.  What are standard prices for professional designers?  From a firm point of view? From a freelancer?  I don't want to overcharge clients but I don't want to ruin the industry by underselling my services. How to get rid of OTA software update notification? I upgraded my Nexus 4 to Lollipop a few days ago but I don't like it. I'll leave out my reasons because they're not relevant here. I wiped my phone and installed a clean stock 4.2.2 version instead. I'm happy with this.  Not long after, Android automatically downloaded the 4.3 upgrade and notifies me with the choices "Later" and "Install". I don't want to do this upgrade.  How do I:   get rid of the notification, and  remove the downloaded update (to free up precious storage space).     I have already tried choosing "Later" but the same notification immediately reappears.    Based on Google search results, I also tried going to Settings &gt; Apps &gt; All &gt; Google Services Framework and unticked "show notifications" but it still appears. Force stop or disable also doesn't seem to help, so I've re-enabled the service including notifications. I didn't see any other apps in this list that sounded relevant - did I just not see it? 'AND' vs '&&' as operator Proving that $\sum\limits_{n = 0}^{2013} a_n z^n \neq 0$ if $a_0 > a_1 > \dots > a_{2013} > 0$ and $|z| \leq 1$ I'm going to teach a preparation course for the complex analysis qualifying exam from my university (which basically consists of me doing some problems from past exams) and I'm trying to solve some questions from previous exams. One of the questions is the following:           Prove that $\displaystyle{\sum_{n = 0}^{2013} a_n z^n \neq 0}$ if the coefficients  satisfy $a_0 &gt; a_1 &gt; \dots &gt; a_{2013} &gt; 0$ and $|z| \leq 1$.      I tried to approach the problem by using the reverse triangle inequality to try to isolate the leading term, which I thought should be the constant coefficient, as follows:  \begin{array} . \left|  \sum_{n = 0}^{2013} a_n z^n \right| &amp;= \left| a_0 +  \sum_{n = 1}^{2013} a_n z^n \right| \\ &amp;\geq |a_0| - \left|  \sum_{n = 1}^{2013} a_n z^n \right|\\ &amp;\geq |a_0| -  \sum_{n = 1}^{2013} |a_n z^n|\\ &amp;\geq a_0 -  \sum_{n = 1}^{2013} a_n |z^n|\\ &amp;\geq a_0 -  \sum_{n = 1}^{2013} a_0 |z^n|\\ &amp;= a_0\left( 1  -  \sum_{n = 1}^{2013} |z^n| \right) \end{array}  Then for $|z| &lt; 1$, we have that this last expression is equal to  $$ a_0\left( 1  -  |z| \frac{|z|^{2013} - 1}{|z| - 1} \right) $$  and my hope was to prove that this was always positive, nevertheless, after failing to prove it, I plotted the expression inside the parenthesis as a function of $|z|$, and found out that it changes sign in the interval $(0, 1)$.  Question  Can my approach somehow be made to work? And if not, how can I prove that the sum $\displaystyle{\sum_{n = 0}^{2013} a_n z^n \neq 0}$ under the given conditions?  Thank you very much for any help. How do I change which mirror I get updates and software from? Using Android as network server I want to use my Android device as a network server. In the same kind of way you would make it a Wi-Fi hotspot, but I don't want to allow connected computers to access the internet, I would like them to be able to communicate together.  Possible uses:   Playing games via LAN (e.g., Quake) Allow computers to share files Bonjour (Macs) etc...   Is there any way to achieve this? Any apps out there that will set up a wireless network server? What is the relationship between MIME types and File .extensions? I may have the wrong idea here, but I thought that:    MIME types are identifying codes, embedded inside a file. File .extensions are idenifying codes, suffixed to the file's name.   I thought, from something I heard in the dim dark ages, that Linux was .extension agnostic... ( maybe it was in the early days, and things have changed since then...? )  I've recently come from the Windows world, where, at the Operating-System level, a file .extension is the only way (as far as I know) to associate it with its relevant Application program.    Because I don't know why, I find it a bit disconcerting that a file named  "fred" and a file named "fred.txt" both open up in a Text Editor.    Is there a clear-cut hierarchy at work here? How to fill a rectangular hole with an even amount of vertices on either side? I tried crating faces but it left missing edges. In the end I was left with all the right lines but there was no vertex in the center.    Here's a follow up image in case you're wondering what I mean. Notice how there's no vertex in the center. Prove the compactness of a set B We have $A=\left\lbrace 2019,1010,\ldots,(n+2018)/n,\ldots \right\rbrace$ and $B=A \cup \left\lbrace 1 \right\rbrace$  How can I show directly (that is, not using the compactness criterion in $\mathbb{R}$) that every open cover $G$ of $B$ admits a finite subcover?  moreover, I know that $A$ is not compact and I am aware that I would need a single example to prove it, any hint on how to find an open cover of $A$ that does not contain a finite subcover?  My first thought was to choose the set of all neighborhoods with radius r centered around each point of A but apparently this is wrong and I do not understand why. Removing duplicate rows from table in Oracle I'm testing something in Oracle and populated a table with some sample data, but in the process I accidentally loaded duplicate records, so now I can't create a primary key using some of the columns.  How can I delete all duplicate rows and leave only one of them? Inverse of sum of exponential random variables (mean and variance) Bump right-aligned text to next line iff no room Every Artinian ring is isomorphic to a direct product of Artinian local rings Proposition. Let $R$ be commutative ring with $1_R$. We assume that $R$ is an Artinian ring and $M_1,\dots,M_n$ its maximal ideals. Then         $R/\mathrm{Jac}(R)\cong (R/M_1)\times \dotsb \times (R/M_n)$.   The ring $R$ is isomorphic to the direct product of a finite number of Artinian local rings.      Proof. 1. It's obvious that $M_i+M_j=R,\ \forall 1\leq i \neq j \leq n$. So, from Chinese Remainder Theorem, we have  $$R/\bigcap_{i=1}^{n}M_i = R/\mathrm{Jac}(R) \cong (R/M_1)\times \dotsb \times (R/M_n),$$ as we wanted.    Since $R$ is an Artinian ring, we have $\mathrm{Jac}(R)^m=\{0_R\}$, for some $m\in \Bbb Z^+$. But,  $$\{0_R\}\subseteq M_1^m\dotsb M_n^m=(M_1\dotsb M_n)^m\subseteq (\bigcap_{i=1}^{n}M_i=\mathrm{Jac}(R))^m=\{0_R\}.$$ So, if we apply CRT we will take  $$R\cong R/\{0_R\}\cong R/M_1^m\dotsb M_n^m\cong (R/M_1^m)\times \dots \times (R/M_n^m).$$   Questions.   1) Are these thoughts complete and correct?  2) Why $R/M_i^m$ are artinian local rings?  3) Could you please elaborate some examples as an application? Compactness and axiomatisability Let $C$ be an axiomatisable class of structures for some given first-order signature, i.e. there is a set $T$ of sentences whose models are exactly the members of $C$.  Apparently it follows from the compactness theorem that: If $C$ contains arbitrarily large finite structures then it must contain an infinite structure.   Can someone explain this result? The compactness theorem tells me that $T$ has a model if each finite subset of $T$ has a model but I don't see how this relates to the size of structures in $C$. Bind a key for multiple units to use the same spell