I saw this in someone's code: y = img_index // num_images  where img_index is a running index and num_images is 3. When I mess around with // in , it seems to act just like a division sign (i.e. one forward slash). I was just wondering if there is any reason for having double forward slashes?
Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:  &gt;&gt;&gt; 6/3 2 &gt;&gt;&gt; 6//3 2
How can I profile a multithread program in Python? I'm developing an inherently multithreaded module in Python, and I'd like to find out where it's spending its time. cProfile only seems to profile the main thread. Is there any way of profiling all threads involved in the calculation? Does removing the comma before 'which' etc in a non-restrictive clause change the meaning of the sentence? I am interested in determining the ages of all 70+ my servers. I would like to create a growth graph showing when servers and databases were added to the environment either/both monthly or annually. I executed the following query using the SSMS multi-query feature with only partial success.  SELECT [name], create_date FROM sys.databases   It's partial success because the master and model databases return with a date of 'April 8, 2003' when I know that I created some of these servers during the past couple years.  I refresh databases from one server to another several times a week, which appears to be causing issues with the database create date.   Is there a simple method to determine the actual create date for both servers and databases? Just posted a bug report, and found another one :p    (lame hand-drawn cursor coz windows doesn't capture the real cursor)  Oh yeah, I'm on Firefox. Which is the recommended way to plot: matplotlib or pylab? Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'xxx' doesn't support architecture 'i386' Getting below error message while issuing :  sudo apt-get update  Get:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease [95.8 kB] Ign:2 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 InRelease                                                                                                             Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                          Hit:4 http://ppa.launchpad.net/canonical-x/vulkan/ubuntu xenial InRelease                                                                                                 Hit:5 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 Release                                                                             Hit:6 http://us.archive.ubuntu.com/ubuntu xenial-security InRelease                                                   Ign:7 http://dl.google.com/linux/talkplugin/deb stable InRelease                                                      Hit:8 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease                                                    Ign:9 http://linux.dropbox.com/ubuntu wily InRelease                                            Hit:10 http://ppa.launchpad.net/numix/ppa/ubuntu xenial InRelease                               Get:12 http://dl.google.com/linux/chrome/deb stable Release [782 B]       Hit:13 http://dl.google.com/linux/talkplugin/deb stable Release                   Ign:14 https://apt.dockerproject.org/repo ubuntu-wily InRelease           Hit:15 https://apt.dockerproject.org/repo ubuntu-wily Release             Get:16 http://dl.google.com/linux/chrome/deb stable Release.gpg [181 B]   Hit:17 http://linux.dropbox.com/ubuntu wily Release                                   Get:20 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,191 B] Fetched 98.0 kB in 0s (118 kB/s)                                  Reading package lists... Done N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://dl.google.com/linux/chrome/deb stable InRelease' doesn't support architecture 'i386'   This cuts across various releases of ubuntu I wanted to tidy up a TeX document and was curious if you can use \lstinputlisting or a similar function to include a certain part of a source-code file.  Example, I have a 500 or so line source file and I want to include just lines 300-400.  Is there a way to do this? I am running Ubuntu 12.04.1 LTS i686 on VirtulBox. Every time I check the updates, there's a new Linux kernel. If I install the new kernel, I have to install the Virtulbox Guest Additions again and reboot the server. I don't want to do this every week. I know I can manually uncheck the kernel packages from update manager, but is there a way to skip the kernel update automatically? I found an answer here, but it's for Ubuntu 10. Thanks. How to convert Local time to UTC time in Delphi? and how to convert it back from UTC to local time? Polite or unrectified placement of the word please I'm starting on mono blue mill deck and I saw . I'm not sure about its ability.     {tap}: put a charge counter on Grindclock      {tap}: target player puts the top X cards of his or her library into his or her graveyard, where X is the number of charge counters on Grindclock.   If I just cast  and use its first ability, will the second ability take effect, or do I just put a charge counter on it? If there's already one charge counter on it and I use the first ability again, it will have two charge counters on it? Then the second ability will take effect with two cards being sent to graveyard?  If I use spells or ability to untap it after being used can I use its ability again on the same turn? Browse local copies of websites when possible (Firefox with slow internet connection) I am on a slow internet connection. I would like to use Firefox to load local copies of websites when it exists and is relatively recent (say one week).   An example usage would be browsing a lot of Wikipedia webpages, coming back to the same ones on a regular basis.  I would like to avoid having to manually specify to save single pages on each website I visit (which is what I guess I would need to do with a plugin like ). And I would also like to avoid having to switch between "work offline" or "work online".   Any suggestions? How can you prove that the square root of two is irrational? How do high traffic sites service more than 65535 TCP connections? What is "summoning sickness" and how does it affect my creatures? Note: this is intended to be a canonical question about summoning sickness.  "Summoning sickness", broadly, is the rule that stops you from attacking or paying {T} costs with a creature that you just played. But how exactly does it work? How does it interact with other rules and effects?  For example, if I'm trying to figure out how a creature is affected:   Does the status matter (tapped/untapped, face down/face up, etc.)? What if it came into play, but I didn't cast it? What if it's a token? What if it was on the battlefield when my turn started, but it wasn't a creature? What if it stops being a creature? What if it's a creature and also another card type? What if it's a double-faced card that just transformed? What if it changes control? What if it's a copy of another creature? Which of the creature's activated abilities can I use? Are any of its other abilities affected? Can I tap the creature to pay a cost that is not a {T} cost?   (These examples are primarily taken from questions about summoning sickness that have already been asked on the site) I have a windows forms app with a textbox control that I want to only accept integer values. In the past I've done this kind of validation by overloading the KeyPress event and just removing characters which didn't fit the specification. I've looked at the MaskedTextBox control but I'd like a more general solution that could work with perhaps a regular expression, or depend on the values of other controls.  Ideally this would behave such that pressing a non numeric character would either produce no result or immediately provide the user with feedback about the invalid character. Removing nodes from an XmlDocument A set $A \subset l_1$ is compact if and only if closed, bounded, and one other condition A set $A \subset \ell_1$ is compact if and only if $A$ is closed and bounded and given any $\epsilon &gt;0$, there exists $n_0$ such that $\sum_{k=n}^{\infty} |x_k| &lt; \epsilon$ for all $n&gt; n_0$ and $x \in A$.   It's easy to prove the part assuming that $A \subset l_1$ is compact, but I am finding difficulty to prove the other part. How to install the previous version of a .deb package and pin it? I am trying to install the latest version of subversion on Sid, and because it has a bug I receive a warning and I abort the installation. How do I get to locate the previous version version, install it and pin until the bug is resolved?  root@server01:~# apt-get install subversion   Reading package lists... Done                                                                                                                                                                                  Building dependency tree                                                                                                                                                                                       Reading state information... Done                                                                                                                                                                              Suggested packages:                                                                                                                                                                                              db5.3-util subversion-tools                                                                                                                                                                                  The following NEW packages will be installed:                                                                                                                                                                    subversion                                                                                                                                                                                                   0 upgraded, 1 newly installed, 0 to remove and 205 not upgraded.                                                                                                                                               Need to get 0 B/981 kB of archives.                                                                                                                                                                            After this operation, 4,844 kB of additional disk space will be used.                                                                                                                                          Retrieving bug reports... Done                                                                                                                                                                                 Parsing Found/Fixed information... Done                                                                                                                                                                        critical bugs of subversion (-&gt; 1.9.2-2) &lt;Outstanding&gt;                                                                                                                                                          b1 - #803725 - subversion: dump-load of a repository modifies verbose log output: M line lost serious bugs of subversion (-&gt; 1.9.2-2) &lt;Outstanding&gt;  b2 - #803589 - FTBFS with ruby2.2 (only) Summary:  subversion(2 bugs) Are you sure you want to install/upgrade the above packages? [Y/n/?/...] n ********************************************************************** ****** Exiting with an error in order to stop the installation. ****** ********************************************************************** E: Sub-process /usr/sbin/apt-listbugs apt returned an error code (10) E: Failure running script /usr/sbin/apt-listbugs apt On what criteria should I evaluate domain registrars? Though I've been a web developer for a fair amount of time, I am going for the first time to buy a few domain names.  I have looked into the domains I'm going to buy and know that they're available, and I've been looking into which sellers to use.  After doing a lot of research, the main ones I'm considering are 1&amp;1, Namecheap, and Gandi.  The problem is, when continuing to research, I'm not really sure what makes one domain seller distinct from another.  I don't need much in the way of services--definitely not hosting, since I plan to use Heroku for that.  I mainly only need the domain itself and DNS management, as well as possibly SSL certificates and WHOIS protection.  Question:  What makes one domain seller different from another?  How can I go about evaluating which one is the best for me?  Note:  This question is not which domain seller is the best, but rather, what criteria can I use to evaluate them and rank one over another.  I'm trying to find out what makes one domain seller different from another, since they all seem to be pretty similar to me right now.