How to properly declare an empty list as a default parameter
"Least Astonishment" and the Mutable Default Argument
Function with varying number of For Loops (python) When there is less than 5% battery left on a mac, the battery indicator goes red and system performance significantly drops - presumably in an attempt to make that remaining 5% last a little longer.   Is there a way to manually trigger this, so that the system performance is low (and battery life longer), even when there is plentiful battery?   This would theoretically be a way of extending the number of hours on a battery beyond the rated amount. Why are American-style options worth more than European-style options? Why are American-style options worth more than European-style options?   I realize I can exercise American-style options anytime before the  expire, but I can only exercise European-style options during their  "exercise period" (usually right when they expire, but no earlier).   So it makes sense that an American option is worth at least as much as  a European option.   But why is it worth more? If I exercise my American option early, I  may make more money than waiting until expiration, but I also may make  less. Mathematically, there's no advantage, since I'm equally likely  to make as much money by waiting for expiration.   Mathematically speaking, is there ever a good reason to exercise an  American option early?   I realize people don't always behave logically, but even the formulas  that valuate options show that American options are worth more.   EDIT (answering comments):    Many of the comments people made would apply to lookback options  (), but not to American  options.  American options can do everything European options can and more. I  understand that, and that means American options can't be worth any  LESS than European options, but I'm still not clear on how you would  mathematically calculate this extra value.  @Aaronaught: "The difference between an American and European  option is the difference between getting N chances to get it right (N  being the number of days 'til expiration) and getting just one  chance. It should be easy to see why you're more likely to profit  with the former, even if you can't accurately predict price  movement."    REPLY: I don't think you really get N chances. Once you exercise the  option, that's it, no more chances. And, if you decide not to exercise  the option today, and the underlying's price falls, you can't go back  in time and exercise it yesterday.    @jdsweet: Think of it this way, if you traveled back through time  one month - with perfect knowledge of AAPL's stock price over that  period - which happens to peak viciously then return to its old price  at the end of the period - wouldn't you pay more for an American  option?    REPLY: Well, no. I'd simply buy a cheaper European option that expires  right at the spike. Or, I'd buy a European option that expires later,  and sell it when the spike occurs. American options don't give you  precognition, so you're still guessing as to when to sell/exercise.    @jdsweet: "one of the more common reasons people exercise (as  opposed to sell) an American option before expiration is if an  unexpected dividend (larger than remaining time value of the option)  was just announced that's going to be paid before the option contract  expires"    REPLY: This makes sense. I'm actually trading FOREX options, so there  is no dividend. In that scenario, are European and American options  worth the same? Why isn't apt full-upgrade getting an updated software key signature for skype After a recent apt update &amp;&amp; apt full-upgrade I started getting the following error when running apt full-upgrade subsequently: Get:4 https://repo.skype.com/deb stable InRelease [4,502 B]                                         Err:4 https://repo.skype.com/deb stable InRelease   The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository &lt;se-um@microsoft.com&gt; W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://repo.skype.com/deb stable InRelease: The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository &lt;se-um@microsoft.com&gt; W: Failed to fetch https://repo.skype.com/deb/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository &lt;se-um@microsoft.com&gt; W: Some index files failed to download. They have been ignored, or old ones used instead.  Is there a way to correct this, or is it down to Microsoft/Canonical to produce/update the necessary key signatures? Why am I getting objects printed twice? Proving that the Hopf map $S^3 \to S^2$ is a submersion I need to show that the Hopf map $H : S^3 \to S^2$ is a submersion. There are many ways to define it, but for now I've gone with the restriction of the function $F : \mathbb{R}^4 \to \mathbb{R}^3$ mapping $$(x,y,u,v)\mapsto (2(xu+yv), 2(xv-yu), x^2+y^2-u^2-v^2).$$ It wasn't too bad to show that $F$ is a submersion, but is there a way to go from here to show that $H$ is a submersion? I can write down $H$ as the composition $$S^3 \overset{\iota}{\hookrightarrow} \mathbb{R}^4 \overset{F}{\to} \mathbb{R}^3 \overset{\pi}{\to} S^2,$$ and define $\pi(p) = p/\lVert p\rVert$, but I don't really know where to go after computing the Jacobian of $\pi$, and I don't know if this will even work for my purposes (I don't see how to argue that the composition of the corresponding differentials here isn't rank $1$ — I know $d\iota$ has trivial kernel but things seem to break down once I get to $d\pi$). I'm really just trying to avoid having to compute the Jacobian of $H$ with respect to the stereographic projections and show that that beast of a thing is full rank. Am I on the right track, or is there a better way? Almost surely convergence of the sequence Let ${X_n}$ be a sequence of independent and identically distributed, square integrable random variables.   Write $ u = E(X_n)$. Study the almost sure convergence, as $n \rightarrow \infty$, $$S_n = (X_1X_2 + X_2X_3 + ... + X_{n-1}X_{n})/n$$   Since $X_iX_{i+1}$ are not independent, it seems we cannot directly use law of large number for that, so anyone can give me some idea? On my system (Windows Vista Home Premium 64bit) Python files are associated with Python interpreter:  C:\Users\Piotr&gt;assoc .py .py=Python.File C:\Users\Piotr&gt;ftype Python.File Python.File=c:\python\2.7\python.exe "%1" %*   Nevertheless when I run any Python script from command line a window titled Open With pops up asking me to Choose the program you want to use to open this file. This bug was found on a couch in . The couch, and the two beds in the room show no signs of other bugs. Is this a bed bug that I should worry about or something harmless? It was slightly larger than a common tick. How to create a  tag with Javascript? I'm looking for a way to insert a &lt;style&gt; tag into an HTML page with JavaScript.  The best way I found so far:  var divNode = document.createElement("div"); divNode.innerHTML = "&lt;br&gt;&lt;style&gt;h1 { background: red; }&lt;/style&gt;"; document.body.appendChild(divNode);   This works in Firefox, Opera and Internet Explorer but not in Google Chrome. Also it's a bit ugly with the &lt;br&gt; in front for IE.  Does anyone know of a way to create a &lt;style&gt; tag that   Is nicer Works with Chrome?   Or maybe   This is a non-standard thing I should avoid Three working browsers are great and who uses Chrome anyway? Why is the folder size (in properties) different from the total file/folder sizes in the folder? Here's my problem  I'm trying to do a cleanup of my hard drive, and I'm constantly seeing this scenario:  (1) Aggregate folder size: I check the folder size viewing properties right clicking the folder  (2) Individual folder/file sizes: I check the individual file/folder sizes belonging to that folder viewing properties on the individual file/folder sizes, and then adding them up (with hidden and system files shown).   These two figures are always different, sometimes by a large margin.   For instance, my C drive now, by method (1), shows a consumed space of 42.4 GB.   However, by method (2), by inspecting the respective files/folders, the total consumed space adds up only to 33.1 GB. This is a 28% discrepancy (over the smaller file size) and I have no idea where the rest of the space is going.   My hard drive is constantly in danger of being full (it's bootcamp on a mac with 50 GB of partitioned space), and there's not much I've got installed in terms of software, nor do I have large media files like movies, downloads, temp files, application temp files, torrents, etc.   Most of it's just consumed by the files in C:/Windows, but last I checked, I don't know enough to know which files to delete, and I've heard that you really can't do anything about the space boggling winsxs and system32.   Can you guys recommend a starting point to free up disk space?  Thanks!!  Baggio. Why is $1$ not a prime number? Why is $1$ not considered a prime number?  Or, why is the definition of prime numbers given for integers greater than $1$? One page website - Effect on SEO I'm considering re-designing my personal website to promote my web services in my local area.  My issue is whether to do a one page website with a scroll-to navigation system. What effect does this have on SEO. As i understand it, you set stuff like h1's and meta description on specific page content. How does this work when all of your different content is on one page? How can I prevent Windows from prompting to restart my computer after an update? Is it possible to use JS to open an HTML select to show its option list? Is it possible to use JavaScript to open an HTML select to show its option list? tikz: Distribute evenly and randomly circles I want to fill a part of a picture with more or less evenly and randomly distributed circles which should not overlap. It would be okay if circles are only partly inside the shape.  The density should be like what you see on this page  with values 80-100. (But I do not need so many circles, 30 should be enough, I could repeat the pattern).   I cannot use a grid and "wobble" the circles a bit: The circles are too large and it simply does not look randomly.   Currently I am thinking about a random attempt: Get some random point, measure its distance to existing circles, either paint or throw the point away. Try 100 times and hope that you get the right number of circles (and that it does not take too long). But perhaps someone has a better idea.   The example draws the circles simply manually:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{backgrounds} \begin{document}   \begin{tikzpicture}[framed,gridded,radius=0.5cm]  \draw[red](0,0) rectangle (5,5);   \draw (1,1) circle;   \draw (2.3,1.1) circle ;   \draw (4.5,0.8) circle ;   \draw (5.1,1.8) circle ;   \draw (0.4,3.3) circle ;   \draw (2.1,2.8) circle ;   \draw (3.8,3.5) circle ;   \draw (4.8,4.2) circle ;   \draw (0.8,4.9) circle ;   \draw (2.1,4.1) circle ;   \draw (3.8,2.0) circle ;   \draw (3.5,0.6) circle ;   \draw (3.0,5.0) circle ;      \draw (4.1,5.1) circle ;             \draw (0.9,2.1) circle ;  \end{tikzpicture}  \end{document} A situation when two or more people speak at the same time The word or phrase I am looking for is quite opposite to that of the situation when people, such as students or sports players, sing their national anthem with the same tone and words.  I want a single word or even phrase that can describe the situation when two or more people speak at the same time with different tone and words . . . and at the end, the listener cannot get what they are saying. This situation can be found while debating, telling a news about any incident or even while complaining.     Due to _____ , the teacher could not get what they are saying.   If it's not feasible to find a noun or phrase for such situation, then here I request to have an adverb standing alone to describe how they are speaking, for instance, what is the adverb for "at the same time"?.  Here is how, I want to convert sentence 1 into sentence 2.        They spoke at the same time, and the teacher could not get what they are saying.   They spoke _____ , and the teacher could not get what they are saying. It is possible to find an efficient algorithm for constructing a provably hard to factor number $N$, together with a witness that shows that it is indeed hard to factor. EDIT, since it was not clear: I also want to be sure that even the person that constructed the number cannot factor it.  Of course, a random large enough integer is going to be hard to factor with high probability, but we might be unlucky.  There are also multi-party protocols for shared generation of RSA moduli (such as ), but I would like a non interactive technique.  Motivation: This was suggested by Poncho's answer to I'm unable to upgrade Xcode 11GM to 11.1 for some time on my Mid 2014 MacBook Pro running macOS Catalina. I've installed Xcode from Mac AppStore ages ago (IIRC circa 2014), and upgraded step by step since then. Currently, I'm experiencing the following loop:   AppStore reports that I have an update. I open AppStore, open updates, click "Update" on Xcode. Mac Downloads ~2.5GB first. Installs that patch. Continues to get the full package (~7.6GB). It starts to install. After some churning and install, it reports "Cannot download Xcode now, please try again later."   I have more than enough space on the disk, and nothing is modified in Xcode or in the OS (no homebrew or something similar).  Did anyone experience something similar? Are there solutions to this? Where is the default folder for Apps? I am relatively new to the linux world. I use OSX at home and Windows at work. In those worlds, there is a default folder for applications (C:\Program Files, /Applications). Is there any such directory in Ubuntu?   I understand that this is not very important and any location in the file system should be ok, but was just wondering whether there are such standard locations (I think there would be one). For instance where is Firefox or Libre Office (that are installed by default)?  Got this question when I was trying to install eclipse. Downloaded the zip, and was wondering...