I am trying to populate a unique identifier field "STD_ID" using arcpy.da.UpdateCursor.  The identifier would be an iterative 1,2,3 and would reset the iteration based on region ID in which the polygon is located "RBSB_ID2"  My problem is I can't figure out how to reference the next row to restart the iteration. I updated the for loop to include cursor.next(), the error is now that I never started the iteration.   #call stands layer and define variables  stands = "F:/ArcGIS/Data/ForestPlanning.gdb/NYC_Stands" rbsb_std = ('RBSB_ID2', 'STD_ID')  #define iteration. iteration = 0  #create cursor for Stand IDs using arcpy.da.UpdateCursor  with arcpy.da.UpdateCursor(stands, rbsb_std) as cursor: for row in cursor:     try:         next_row = cursor.next()      except StopIteration:         next_row = row      if row[0] != next_row[0]:         row[1] = 1     else:         row[1] = iteration + 1         iteration = iteration + 1     cursor.updateRow(row)   Any ideas on how to fix this?      I just edited the code to reflect toslunds original answer.     In response to the desired output ... assume   RBSB_ID2 = [100023, 100023, 100023, 100144, 100144, 1000144, 1000144, 1001512, 1001512]  #The output for 'STD_ID' would be:   STD_ID = [1, 2, 3, 1, 2, 3, 4, 1, 2]  #The next step would be to convert to STD_ID to a string &amp; later convert to something like   #[001, 002, 003, 001 ...] and then later concatenate with the RBSB_ID to  #create a unique id for each row that links RBSB_ID2 with STD_ID.    #RBSB_STD_ID = [100023001, 100023002, 100023003, 100144001, ...]
I am needing to auto increment a field based on groups within a feature class. I have 8 plots within a given polygon and I need to assign them an ID from 1-8 for each set of plots within each polygon. The polygon would have its own unique ID number to be used to group the plots.  I assume it would be an alteration of this:  rec=0 def autoIncrement():  global rec  pStart = 1   pInterval = 1   if (rec == 0):    rec = pStart   else:    rec = rec + pInterval   return rec
In particular, when $x=y=z$ isn't the above expression equal to 1 and not -1? How do I divide a circle into equal parts like a pie chart with Adobe Illustrator? Is there a fairly simple way to divide a circle into equal parts using Adobe Illustrator CC? What is the best way to store ground coffee? I know it's better to use freshly ground beans and not store it ground at all, but if I have no other choice, how can I best preserve ground coffee?   sort of asks the same thing, but the answers focus on storing whole beans, and the answers addressing ground coffee make it pretty unclear whether a cool cabinet, the fridge, or the freezer is the best place. At the end of my animation, the animation pauses a bit then loops again, how can I stop the slow pause, and let the loop work fluently? Image Alpha Background Renders Black when using "Import Images as Planes" I must be missing something here.  I'm doing an extremely simple Import Image as Plane using the AddOn and the imported image has an alpha background but it renders (and even previews in the material preview) as black where the alpha background should be.  When I import, I select Emission &amp; Transparent so the material setup is automatic.  I've read similar issues but people are typically missing the transparent node and connecting the Alpha channel from the image into the Mix Node factor.  But this is all here.  I must be missing something really stupid but I've wasted so much time trying to fix this thing.  Any help would be greatly appreciated.  Not sure if it matters but I'm using 2.74 RC2.  Many thanks!  I created this dummy blend file to test outside my project but problem still exists.  Here is the simple .blend file: Is there even an automatic ban on meta? Somewhere I heard the automatic question ban on Meta is set lower than on the main site. But looking at the profile of  it looks like there is absolutely no automatic ban on meta.  Is this intended behaviour? Focus in night photography window-switching keyboard shortcuts interfere with emacs and cannot be changed in the main keyboard system preferences How to use GeoPandas buffer function to get buffer zones in kilometers? Let $a_n$ be a sequence of positive reals, such that the partial sums $S_n = \sum_{i = 1} ^ n a_i$ diverge to $\infty$. For given $\epsilon &gt; 0$ do we have $$\sum_{n = 1} ^ \infty \frac{a_n}{S_n^{1 + \epsilon}} &lt; \infty?$$  For $\epsilon \ge 1$ we can resolve this quickly by noting $$\frac{a_n}{S_n ^ 2} \le \frac 1 {S_{n - 1}} - \frac 1 {S_n}$$ so for sufficiently large $n$ we can bound $\frac{a_n}{S_n^{1 + \epsilon}}$ by $\frac 1 {S_{n - 1}} - \frac 1 {S_n}$ as well. I'm wondering if this is true for arbitrary $\epsilon &gt; 0$. I know that the series in question diverges for $ \epsilon = 0$, so all that is missing is what happens in $(0, 1)$. How to setup two completely separate partitions on one SSD I have a MacBook with 1TB SSD. I want to have two separate partitions with two independent macOS installations. I want to make sure that none of the partitions have any kind of possibility to interact with the other, I want them to be as separated as if they were physically separate. Is this achievable with, for example, FileVault for each of them? Edit: My question is neither &quot;how can I install two different macOS versions on two different partitions on one SDD&quot;, neither &quot;how do I use FileVault&quot;, etc. I know how to do all of that. I want to make sure that there is no interaction between the partitions possible. Can this be made sure with the above approach? Is it sufficient? Windows Active Directory naming best practices? This is a  about Active Directory domain naming.   After experimenting with Windows domains and domain controllers in a virtual environment, I've realized that having an active directory domain named identically to a DNS domain is bad idea (Meaning that having example.com as an Active Directory name is no good when we have the example.com domain name registered for use as our website).   , but I'm still not sure about what other rules there are around naming Active Directory domains.  Are there any best practices on what an Active Directory name should or shouldn't be? Disable password request from suspend - 18.04 How are the number of views in a question calculated? I saw it's not just a page views number, because, if I press F5 several times, it won't increase the number of views.  They could store my IP address in a table, but wouldn't that make it slow? They would need to query a database one more time for each request. Math mode accents In my long document I, sadly, have to use several accents to denote different kinds of symbols. Currently, I use primes ($x'$), hat, tilde, and overline. In addition I use two colored symbols (red colored tilde and blue $\prescript\ulcorner$), as I need further distinguishment.  Now I'd like to have no colors in my document, while I still have at least six different ways to differentiate certain symbols.  Which alternatives could I use that are easy to recognize and 'stand out', while they are different to prime/hat/tilde/overline?  EDIT: The reader should be able to see the kind of accent used even if the symbol in question is in a sub-script (possibly even a sub-sub-script). Should we have a subjective version of every Stack Exchange site? I have run into an issue with WPF and Commands that are bound to a Button inside the DataTemplate of an ItemsControl. The scenario is quite straight forward. The ItemsControl is bound to a list of objects, and I want to be able to remove each object in the list by clicking a Button. The Button executes a Command, and the Command takes care of the deletion. The CommandParameter is bound to the Object I want to delete. That way I know what the user clicked. A user should only be able to delete their "own" objects - so I need to do some checks in the "CanExecute" call of the Command to verify that the user has the right permissions.  The problem is that the parameter passed to CanExecute is NULL the first time it's called - so I can't run the logic to enable/disable the command. However, if I make it allways enabled, and then click the button to execute the command, the CommandParameter is passed in correctly. So that means that the binding against the CommandParameter is working.  The XAML for the ItemsControl and the DataTemplate looks like this:  &lt;ItemsControl      x:Name="commentsList"     ItemsSource="{Binding Path=SharedDataItemPM.Comments}"     Width="Auto" Height="Auto"&gt;     &lt;ItemsControl.ItemTemplate&gt;         &lt;DataTemplate&gt;             &lt;StackPanel Orientation="Horizontal"&gt;                 &lt;Button                                                  Content="Delete"                     FontSize="10"                     Command="{Binding Path=DataContext.DeleteCommentCommand, ElementName=commentsList}"                      CommandParameter="{Binding}" /&gt;             &lt;/StackPanel&gt;                                 &lt;/DataTemplate&gt;     &lt;/ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt;   So as you can see I have a list of Comments objects. I want the CommandParameter of the DeleteCommentCommand to be bound to the Command object.  So I guess my question is: have anyone experienced this problem before? CanExecute gets called on my Command, but the parameter is always NULL the first time - why is that?  Update: I was able to narrow the problem down a little. I added an empty Debug ValueConverter so that I could output a message when the CommandParameter is data bound. Turns out the problem is that the CanExecute method is executed before the CommandParameter is bound to the button. I have tried to set the CommandParameter before the Command (like suggested) - but it still doesn't work. Any tips on how to control it.  Update2: Is there any way to detect when the binding is "done", so that I can force re-evaluation of the command? Also - is it a problem that I have multiple Buttons (one for each item in the ItemsControl) that bind to the same instance of a Command-object?  Update3: I have uploaded a reproduction of the bug to my SkyDrive: Error in fontspec (my first question here) I'm using xelatex to compile this code:  \documentclass{book} \usepackage{fontspec}  \begin{document}  %This is a Greek text ``Ελλάδα'' text  \end{document}   and receive this error :  ("C:\Program Files\MiKTeX 2.9\tex\latex\fontspec\fontspec.cfg") ! Undefined control sequence. &lt;argument&gt; \LaTeX3 error:                             Erroneous variable \c__fontspec_shape_n_n_tl used! l.3806 \emfontdeclare{ \emshape, \eminnershape }   My aim is to make LaTeX compile greek letters properly in my pdf, but that's a different issue. For years I've been trying to find this movie I saw on TV once.  I only saw the end.  It featured a teenage boy (about 18 years old) and his family hiding out in a cabin.  The kid is making molotov cocktails and preparing for something.  Sure enough two bad guys show up and I think one of them had a golden pistol.  They start fighting and one of the guys turns into a werewolf type creature.  The kid wounds it and tracks it through the woods to finish it off with his lever action rifle.  Anyone know the name of this movie?  I saw this probably mid to late 90s.  I'm guessing it was an 80's American film. It was live action. Conditionals in English are usually formed by using if with normal word order; but for the three past (subjunctive) forms were, should, and had, it is also possible to express the conditional through subject–auxiliary inversion alone, with no if in the conditional clause.  Does forming conditionals in this manner differ semantically from if-conditionals? Is some aspect of the conditional statement or the conditionality emphasised more in one version than in the other? Or are there differences in how and when they are used? Or are they simply completely interchangeable?  For example:     If I were you, I would try it again   Were I you, I would try it again      If I had seen it, I would have told you   Had I seen it, I would have told you      If you should drink, don’t get behind the wheel   Should you drink, don’t get behind the wheel