QGIS button click run twice I developed a plugin in QGIS and I have attached a function on button clicked but it is calling the function two times and I don't know the reason why.  I am registering click function in plugin run event:      def run(self):          """Run method that performs all the real work"""         AttachBtnClicked(self)          # show the dialog         self.dlg.show()         # Run the dialog event loop         result = self.dlg.exec_()  def AttachBtnClicked(self):     self.dlg.btnDataSourceEncodingChangeAllLayers.clicked.connect(lambda: btnDataSourceEncodingChangeAllLayersClicked(self))   while the method is:     def btnDataSourceEncodingChangeAllLayersClicked(self):         print 'DataSourceEncodingChanageAllLayers : '# + encodingName         LayerDataSourceChange()   it runs two times.
Odd behavior in a QGIS plugin: my function is triggered twice I have a plugin with a function (triggered by a button) that selects a specific layer by name, then shows its attribute table. When I close the plugin and open it again, the attribute table pops up twice, and repeating this keeps adding another table popup. What's wrong?  Code:  def showTable(self):     for lyrs in QgsMapLayerRegistry.instance().mapLayers().values():         if lyrs.name() == "TestFeatures":             lyrTest = lyrs     self.iface.showAttributeTable(lyrTest)
Hi I can compute a Basic Loan Amortization Schedule, But now I'm trying to Calculate a Seasonal Loan Amortization Schedule . So for example A loan starts at January And Will go on for 3 years, with Monthly Payments. Interest is at 3% Annually and is compounded Annually. During the months of September, October, November, December It'll only accumulate Interest But no payments and principal. Principal is 100000. How Do I calculate Payments and interest. Transitivity check vs. Transitive Closure Is checking transitivity of a digraph not easier than (in terms of asymptotic complexity) taking the transitive closure of the digraph? Do we know any lower bound better than $\Omega(n^2)$ to determine if a digraph is transitive or not? Change object pivot point orientation For some reason the pivot point on my object has become rotated (other objects show normally oriented pivot points). I have to set the "transformation orientation" (see the bottom of my screenshot) to be able to see it though. Does anyone know how to change it back? That is, change it to be aligned with the "world orientation". Using a question mark mid-sentence May I use a question mark in the middle of a sentence? Examples:  Would you like the drapes to be white? or perhaps something off-white? Would you like the logo to be centered? at the bottom? left off entirely? How to wait in bash for several subprocesses to finish and return exit code !=0 when any subprocess ends with code !=0? What is the easiest way to superscript text outside of math mode?  For example, let's say I want to write the $n^{th}$ element, but without the math mode's automatic italicization of the th.  And what if I still want the n to be in math mode, but the th outside? How to get hardware specs of Android device? All of my Firefox add-ons have been disabled suddenly, how can I re-enable them? I performed principal component analysis (PCA) with R using two different functions (prcomp and princomp) and observed that the PCA scores differed in sign. How can it be?  Consider this:  set.seed(999) prcomp(data.frame(1:10,rnorm(10)))$x              PC1        PC2  [1,] -4.508620 -0.2567655  [2,] -3.373772 -1.1369417  [3,] -2.679669  1.0903445  [4,] -1.615837  0.7108631  [5,] -0.548879  0.3093389  [6,]  0.481756  0.1639112  [7,]  1.656178 -0.9952875  [8,]  2.560345 -0.2490548  [9,]  3.508442  0.1874520 [10,]  4.520055  0.1761397  set.seed(999) princomp(data.frame(1:10,rnorm(10)))$scores          Comp.1     Comp.2  [1,]  4.508620  0.2567655  [2,]  3.373772  1.1369417  [3,]  2.679669 -1.0903445  [4,]  1.615837 -0.7108631  [5,]  0.548879 -0.3093389  [6,] -0.481756 -0.1639112  [7,] -1.656178  0.9952875  [8,] -2.560345  0.2490548  [9,] -3.508442 -0.1874520 [10,] -4.520055 -0.1761397   Why do the signs (+/-) differ for the two analyses? If I was then using principal components PC1 and PC2 as predictors in a regression, i.e. lm(y ~ PC1 + PC2), this would completely change my understanding of the effect of the two variables on y depending on which method I used! How could I then say that PC1 has e.g. a positive effect on y and PC2 has e.g. a negative effect on y?    In addition: If the sign of PCA components is meaningless, is this true for factor analysis (FA) as well? Is it acceptable to flip (reverse) the sign of individual PCA/FA component scores (or of loadings, as a column of loading matrix)? Line breaking with hyperref href with an underline in itemize I have a simple itemized list like the following MWE:  \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{hyperref} \usepackage{lmodern} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{lipsum} \begin{document} \begin{itemize} \item \href{http://google.com}{[ID1]: \underline{\lipsum[1]}} \end{itemize} \end{document}   This unfortunately doesn't break the block of text as expected, as shown below:    How can I fix this item so it will line break properly? How to edit a file in vi editor (arrow keys prints letters)? I am open a file in vi:  vi index.php   Here the problem is: when I press the down arrow and it prints 'B'. Why it prints 'B'? What does this $\asymp$ symbol mean? (subject: analytic number theory) I'm reading a  by Andrew Granville on analytic number theory.  On page 22 of the paper, there appears a strange looking symbol, undefined.  I've circled it in red in the screenshot below.    Since it's not defined in the paper, I'm assuming it must be standard notation.   From the context, I'm assuming it means something like "as compared to", or "with reference to", but that's just a guess.  Can anyone identify the symbol, even better explain what it means and/or provide a reference?  Is there a name to speak the symbol?  Thanks in advance. How to create dummy webcam? I would like to join some videoconference, but I don't own a webcam and the conference software requires one.  So my question is, can I create a dummy one? I don't care what the cam will cast, I just need to appear to have one. Messed up my PATH environment variable and can't login to desktop To get an maven environment variable to run, I tried several options. Basically, I followed some options from , such as ~/.pam_environment, /etc/bash.bashrc and I don't really know anymore. Within them I exported sth like export PATH=/opt/apache-maven-3.6.0/bin:$PATH (I'm being so unconcrete because I cannot look it up).   Afterwards, I did run gnome-session-quit and my machine got stuck.   So after hard restart I try to login again, but I'm not able to do that: I see my username, enter the password, hit enter, screen turns black and after 2 seconds I'm back at the login screen.   So, that very strange and worrying. Next step: Login via tty (Strg + ALT + F3). Within there I can login, but can not do much. I thought about sth like . But whatever I do: The command could not be located because '\bin' is not included in the PATH environment variable. I think, altogether thats alarming and I'm getting really nervous.  Executing export PATH="/usr/bin:$PATH seems to work and echo $PATHgives an output starting with /usr/bin:/usr/bin:/usr/bin:/home/user/Documents/.../esper/examples/transaction/etc:/home/user/anaconda3/bin:/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin:/opt/apache-maven-3.6.0/bin:/opt/apache-maven-3.6.0/bin:/opt/apache-maven-3.6.0/bin but does not really help.  I'm running an Ubuntu 18.04 on an Lenovo G50-70.   Can you help me accessing my desktop again and/or fixing my PATH issue? Change icon on MATE main menu How can I change the default logo icon to a custom icon by the applications menu in Ubuntu MATE without changing the theme? Books automatically deletes my books when offline, and when there is enough space on device An inequality about Stirling numbers For all positive integers $n,r,k$ that $n=rk$, how to prove the inequality $$(r-1)!^k\le \frac{c(n,k)}{S(n,k)}\le (n-k)!$$ $c(n,k)$ is unsigned Stirling numbers of the first kind and $S(n,k)$ is Stirling numbers of the second kind.  Any help would be appreciated! ASP.NET MVC controller actions that return JSON or partial html I am trying to create controller actions which will return either JSON or partial html depending upon a parameter. What is the best way to get the result returned to an MVC page asynchronously? I've rooted my phone.  Now what?  What do I gain from rooting? This is a common question by those who have just rooted their phones.  What apps, ROMs, benefits, etc. do I get from rooting?  What should I be doing now? is a dove a "she"? how to use "he" and "she" for animals? In the song &quot;Blowing in the Wind&quot; by Bob Dylan, there's a verse that reads:  Yes, and how many seas must a white dove sail Before she sleeps in the sand?  My question is, why he used &quot;she&quot; for a dove? What about other animals and other non-humans? Is there a general rule?