I'm trying to calculate the total number of counts a raster contains using python script. When I ran the script, I didn't get any error. However, I also didn't get the number of counts for each row in the attribute table.  Code:  import arcpy  #To overwrite output arcpy.env.overwriteOutput = True  #Set environment settings arcpy.env.workspace = "C:/Subhasis/Test/raster-read"  #Build Raster Attribute Table arcpy.BuildRasterAttributeTable_management("sti-9", "Overwrite")  # loop through attribute table Rows = arcpy.SearchCursor( "sti-9" )   for row in Rows:     count = row.getValue( "COUNT" )      print count
I am a beginner to python coding in GIS. I want to calculate the total number of counts in raster attribute table. In order to do that:   I would like to build a attribute table of raster data use a loop through attribute table using ARCPY.SearchCursor()   Therefore, I wrote a code to build an attribute table. However, I am getting an error while running the code and not able to figure out the error in the code.  Code:  import arcpy # Create the geoprocessing object  import arcgisscripting gp = arcgisscripting.create()  #To overwrite output arcpy.env.overwriteOutput = True  #Set environment settings gp.workspace = "C:/Subhasis/Test/raster-read"  #Build Raster Attribute Table gp.BuildRasterAttributeTable_management("sti-9", "Overwrite")  Error Message: Traceback (most recent call last):   File "C:/Subhasis/Test/raster-read/test.py", line 15, in &lt;module&gt;     gp.BuildRasterAttributeTable_management("sti-9", "Overwrite") ExecuteError: ERROR 000049: Failed to build attribute table Failed to execute (BuildRasterAttributeTable).
Editing photo dimensions in large batches If I had the time, I would go through each and every photo to make sure that the dimensions and quality are pixel perfect. However, I'm in a time crunch, and need to make the couple hundred photos that are 4320 x 3240 into 950x630.   now I could- 1. Upload them into WordPress, uses native image reducing components and J query go from there. 2. Go through each and every photo, reduce file size, and proportion and bring it to Yahoo's PNG processing script.  However, maybe I'm missing a choice or alternative workflow that would allow for processing all of these photos in a clear manner without losing quality or perspectives. Any workflow suggestions? I have this below code where i am trying to first search an account name and on hit button it displays the result set.  On the button click i am also loading an child component which is displaying the id of the record.  I need the child component should get displayed once i click on the record.  How can i achieve this -   Parent Component -   &lt;aura:component controller="SimpleAccountController"&gt;     &lt;aura:attribute name="account" type="account[]"/&gt;     &lt;ui:outputText aura:id="outName" value="" class="text"/&gt;     &lt;ui:inputText aura:id="name" label="Enter Name:" placeholder="Your Name" /&gt;     &lt;ui:button aura:id="button" buttonTitle="Click to see what you put into the field" class="button" label="Click me" press="{!c.getInput}"/&gt;     &lt;aura:iteration var="acc" items="{!v.account}"&gt;             &lt;a onclick="{!c.accountselected}" data-recId="{!acc.Id}"&gt;         &lt;p&gt;{!acc.Name} : {!acc.Type} : {!acc.Industry} : {!acc.Rating}&lt;/p&gt;             &lt;/a&gt;         &lt;c:HelloWorkdChildCmp selectedaccount="{!acc.Id}" /&gt;     &lt;/aura:iteration&gt; &lt;/aura:component&gt;   COntroller -   ({     getInput : function(cmp, evt) {         var myName = cmp.find("name").get("v.value");         var myText = cmp.find("outName");         var greet = "Hi, " + myName;         myText.set("v.value", greet);         var action = cmp.get("c.seaAcc");         action.setParams({ "s" : myName });         action.setCallback(this, function(response) {             var state = response.getState();             if (state === "SUCCESS") {                 cmp.set("v.account", response.getReturnValue());                 //alert("From server: " + response.getReturnValue());             }         });         $A.enqueueAction(action);     },      accountselected : function(cmp, evt) {        console.log(evt.currentTarget.getAttribute("data-recId")) ;     }  })   Child component -   &lt;aura:component &gt;     &lt;aura:attribute name="selectedaccount" type="String"/&gt;     &lt;div&gt;Id: {!v.selectedaccount}&lt;/div&gt; &lt;/aura:component&gt; Javascript Closures and 'this' I have a problem with an object I have created that looks something like this:  var myObject = {      AddChildRowEvents: function(row, p2) {         if(document.attachEvent) {             row.attachEvent('onclick', function(){this.DoSomething();});         } else {             row.addEventListener('click', function(){this.DoSomething();}, false);         }     },      DoSomething: function() {         this.SomethingElse(); //&lt;-- Error here, object 'this' does not support this method.     } }   The problem is that when I am inside the 'DoSomething' function, 'this' does not refer to 'myObject' what am I doing wrong? Should I submit bank statements when applying for a UK Visa? What do they say about me? The UK Visas and Immigration Directorate publishes  that provides helpful tips that can result in successful visa applications. Section 2 of this guidance opens is entitled &quot;other documents you may want to provide&quot; (emphasis mine).  Section 2: other documents you may want to provide – all visitors This section provides guidance on the types of documents that you may want to provide to help us consider your application against the Immigration Rules. Previous travel documents/passports, which show previous travel. Financial documents showing that you have sufficient funds available.  These must clearly show that you have access to the funds, such as:  bank statements building society book proof of earnings such as a letter from employer confirming employment details (start date of employment, salary, role, company contact details) where a third party (who is either in the UK or will be legally in the UK at the time of your visit) is providing financial support to you e.g. a business, a friend or a relative, documents to show that they have sufficient resources to support you in addition to themselves and any dependant family should be provided   The first item is &quot;bank statements&quot; and this ties in with the , which says...  evidence that you can support yourself during your trip, eg bank statements or payslips from the last 6 months  (Note 'eg' is a Latin abbreviation meaning &quot;for example&quot;; this appears to be optional rather than a fixed requirement.) Question: How should someone interpret this such that the chances of success are maximized? How many statements should I submit? What are they looking for and what do my bank statements tell about me? overbrace/underbrace but with an arrow instead Is there a similar command to \overbrace{foo}^{bar} but instead of braces, an arrow pointing up/down?  EDIT: Here's a little demonstration of how I'd expect something like this to work:    And possible syntax would be \overarrow{a=b}^{\text{theorem X}} What's the name for the relativistic paradox with the train/car travelling over a gap? There is a relativistic paradox I was introduced by a friend in Ithaca (Courtenay Footman). It involves a vehicle travelling over a ravine relativistically, so it's in the general family of ladder paradoxes. There are many ways to phrase it, but here's a simple one.   A three-car train with each car of length $L$ is travelling over a bridge across a ravine. (Assume that the couplings between cars are stiff: this train does not bend.) Unfortunately, some evil genius has precisely removed a length $6L$ of the track. The train however is relativistic, travelling at a speed such that $\gamma \approx 12$.  In the reference frame of the ground, the train should appear to be 1/24th the size of the gap, which suggests that it will fall a little and should crash into the bridge opposite. But in the reference frame of the train, each car of the train is at least twice as long as the gap and aside from the very front wheel and the very back wheel, which need to be supported by rigidity, everything is constantly well-supported. This suggests that the train makes it. Who is right?  I vaguely remember that as an undergraduate knowing only a little relativity, I trusted the train's perspective because it's at rest in that perspective, and Courtenay said that this was ultimately correct after a lot of details got resolved. But I do not remember all of these details such that I could work it out for myself. So I'm looking for some discussion that's a little more well-sourced or authoritative.  What is this paradox called, and what literature has addressed the issue? How can I stand on the ground? EM or/and Pauli? Now that I have Firefox 49 or higher, how do I watch Netflix? How do I submit .jar file to the ubuntu software center I am writing an app using JAVA Swing for all platforms. After that I want to add this app to Ubuntu Software Center for free Is it possible?   My app is just one *.jar file, its helping to play card games.  I dont know Python language and saying the truth - dont want to learn it now.  What should I do to be able to submit my app? How should I parse the sentence "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo." came in Low Quality Posts review which was  as "This is commentary on another post, not an answer" by *. But the comment was added 5 times automatically on behalf of that user.        First four comments' time is 2013-07-15 10:23:18Z while the last one's time is 2013-07-15 10:23:19Z. Those comments are still exist. 10K+ users can see that.  Is this a bug or something else?  * Because the comment is added on behalf of that user. Difference in number of communities on main site Increase partition size on which Ubuntu is installed? I have Ubuntu installed on a drive. The problem is it is running low on disk space. This is installed on vmware. I expanded the virtual drive and booted into ubuntu. But when I opened gparted(sudo gparted), the move/resize option is unavailable. This is the partition Ubuntu is installed on, but I need to resize it. Any ideas? I am comfortable using command line How to show $a,b$ coprime to $n\Rightarrow ab$ coprime to $n$? Let $a,b,n$ be integers such that  $\gcd(a,n)=\gcd(b,n)=1$. How to show that $\gcd(ab,n)=1$?   In other words, how to show that if two integers $a$ and $b$ each have no non-trivial common divisor with and integer $n$, then their product does no have a non-trivial common divisor with $n$ either.     This is a problem that is an exercise in my course.   Intuitively it seems plausible and it is easy to check in specific cases but how to  give an actual proof is not obvious. Turning separate lines into a comma separated list with quoted entries I have the following data (a list of R packages parsed from a Rmarkdown file), that I want to turn into a list I can pass to R to install:  d3heatmap data.table ggplot2 htmltools htmlwidgets metricsgraphics networkD3 plotly reshape2 scales stringr   I want to turn the list into a list of the form:  'd3heatmap', 'data.table', 'ggplot2', 'htmltools', 'htmlwidgets', 'metricsgraphics', 'networkD3', 'plotly', 'reshape2', 'scales', 'stringr'   I currently have a bash pipeline that goes from the raw file to the list above:  grep 'library(' Presentation.Rmd \ | grep -v '#' \ | cut -f2 -d\( \ | tr -d ')'  \ | sort | uniq   I want to add a step on to turn the new lines into the comma separated list. I've tried adding tr '\n' '","', which fails. I've also tried a number of the following Stack Overflow answers, which also fail:      This produces library(stringr)))phics) as the result.      This produces ,% as the result.      This answer (with the -i flag removed), produces output identical to the input. How can I change the class of an HTML element in response to an onclick or any other events using JavaScript? Does deleting iCloud photos affect them on devices? If I delete a photo from my iCloud will it also be removed from my devices that are connected to my account? I have a set of Photoshop files which consist of a base image with a series of layers with colored overlays. The overlays are labeled using the layer names.  My task is to get these overlays as SVG paths, somehow preserving the labels. (If I can preserve the fill colors as well, that would be cool, but we can define arbitrary fill colors if needed.)  So far we have tried exporting the layers as Illustrator paths, and then exporting to SVG from Illustrator. This gets us reasonable SVG paths, but (a) we lose the labels, and (b) if a layer has more than one discrete section in its overlay, it is separated into several paths.  Is there a way to get these layers into SVG while retaining the labels? Or should we do our Export > Illustrator > SVG  route on a layer-by-layer basis?  We're working with CS5, if that's important.  ETA to answerers: We've long since finished this project and delivered the job, so I can't accept an answer, but feel free to pitch in your potential solutions for others. Fill cylinder cap with quads Is there any way of converting the triangle fan found on a cylinder cap into quads. Tikz /.style with two parameters How do I pass two parameters to a tikz style?  I would like to do something like this:  \begin{tikzpicture}[     transformer/.style={draw, cylinder, gray!80, rotate=90, minimum height=#1, minimum width=#2},   And then, I want to use this style in a node:  \node [transformer{2.3cm}{1cm}] () at (0,0.6) {};