How can i remove Ubuntu? (delete/uninstall)
Removing Ubuntu from a dual-boot setup with Windows
Best way to return multiple values from a function? The canonical way to return multiple values in languages that support it is often . Option: Using a tuple Consider this trivial example: def f(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return (y0, y1, y2)  However, this quickly gets problematic as the number of values returned increases. What if you want to return four or five values? Sure, you could keep tupling them, but it gets easy to forget which value is where. It's also rather ugly to unpack them wherever you want to receive them. Option: Using a dictionary The next logical step seems to be to introduce some sort of 'record notation'. In Python, the obvious way to do this is by means of a dict. Consider the following: def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return {'y0': y0, 'y1': y1 ,'y2': y2}  (Just to be clear, y0, y1, and y2 are just meant as abstract identifiers. As pointed out, in practice you'd use meaningful identifiers.) Now, we have a mechanism whereby we can project out a particular member of the returned object. For example, result['y0']  Option: Using a class However, there is another option. We could instead return a specialized structure. I've framed this in the context of Python, but I'm sure it applies to other languages as well. Indeed, if you were working in C this might very well be your only option. Here goes: class ReturnValue:   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return ReturnValue(y0, y1, y2)  In Python the previous two are perhaps very similar in terms of plumbing - after all { y0, y1, y2 } just end up being entries in the internal __dict__ of the ReturnValue. There is one additional feature provided by Python though for tiny objects, the __slots__ attribute. The class could be expressed as: class ReturnValue(object):   __slots__ = [&quot;y0&quot;, &quot;y1&quot;, &quot;y2&quot;]   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  From the :  The __slots__ declaration takes a sequence of instance variables and reserves just enough space in each instance to hold a value for each variable. Space is saved because __dict__ is not created for each instance.  Option: Using a  (Python 3.7+) Using Python 3.7's new dataclasses, return a class with automatically added special methods, typing and other useful tools: @dataclass class Returnvalue:     y0: int     y1: float     y3: int  def total_cost(x):     y0 = x + 1     y1 = x * 3     y2 = y0 ** y3     return ReturnValue(y0, y1, y2)  Option: Using a list Another suggestion which I'd overlooked comes from Bill the Lizard: def h(x):   result = [x + 1]   result.append(x * 3)   result.append(y0 ** y3)   return result  This is my least favorite method though. I suppose I'm tainted by exposure to Haskell, but the idea of mixed-type lists has always felt uncomfortable to me. In this particular example the list is -not- mixed type, but it conceivably could be. A list used in this way really doesn't gain anything with respect to the tuple as far as I can tell. The only real difference between lists and tuples in Python is that lists are , whereas tuples are not. I personally tend to carry over the conventions from functional programming: use lists for any number of elements of the same type, and tuples for a fixed number of elements of predetermined types. Question After the lengthy preamble, comes the inevitable question. Which method (do you think) is best? What happens if I unsubscribe from Apple Music, then resubscribe at a later date? I want to cancel my apple music subscription for now, but may want to bring it back this summer. Will all the music I added be permanently removed when I unsubscribe, or will re-subscribing retrieve all my previous music? What are WPF Preview Events? How to copy the filename quickly in windows I have start point and end point of a polyline. How can I get a point on that polyline from end points specified by the given distance.    How can I get this by using arcpy provided that this script should work on ArcView without importing any modules (). I'm trying not to hard code values.  Related Question: I was improving some of my old posts on Stack&nbsp;Overflow when I ended up encountering this:     You have already edited 5 of your own post today; futher edits are not   allowed until tomorrow   I know this it is not a major deal, but what's the logic underneath to this restriction? If $A,B,C$ are matrices I am thinking how to show that $$ A(B + C) = AB + AC$$  Is possible to show without sums like $\sum_i a_i, ..., \sum_j b_j$? It seems if I do the proof with many indexes then is tedious and I don't learn much from it. Performance evaluation of auto.arima in R and UCM on one dataset I started evaluating and comparing some methods in forecasting. I used Price of dozen eggs in US, 1900–1993, in constant dollars in the R software FMA package. I held out the last 10 years for assessment of forecast. Below are the results:  I used auto arima method in the R software. Obviously the results are way off. Am I doing something incorrect ? Below is the forecast. It does not recognize the declining trend.     I also used an unobserved components model (UCM) and obtained a good forecast,  as below.   Without outliers/level shifts there are very large standard errors and therefore wide confidence bands.  After some iterative work, below is the output with outliers/level shifts (I know I'm overfitting here) but it did a pretty good job in forecasting; there are also narrow confidence bands.    In looking at just this example the UCM seems to predict the hold-out sample more accurately than auto.arima.  Why is auto.arima not providing a reasonable forecast?  Are state space models/UCMs better for forecasting long range?  Are there any benefits of using one method over other? Choosing Geographical Coordinate System and Projected Coordinate System for India? I want to create spatial data for entire India.  Usually I use WGS84 as GCS and UTM zones for PCS in the places in India, but when I have to create the spatial data for entire India, I get confused which geographical coordinate systems and projected coordinate system will be suitable.  What are suitable ones? Notation of the second derivative - Where does the d go? In school I was taught that we use $\frac{du}{dx}$ as a notation for the first derivative of a function $u(x)$. I was also told that we could use the $d$ just like any variable. After some time we were given the notation for the second derivative and it was explained as follows: $$ \frac{d(\frac{du}{dx})}{dx} = \frac{d^2 u}{dx^2} $$ What I do not get here is, if we can use the $d$ as any variable, I would get the following result: $$ \frac{d(\frac{du}{dx})}{dx} =\frac{ddu}{dx\,dx} = \frac{d^2 u}{d^2 x^2} $$ Apparently it is not the same as the notation we were given. A $d$ is missing. I have done some research on this and found some vague comments about &quot;There are reasons for that, but you do not need to know...&quot; or &quot;That is mainly a  notation issue, but you do not need to know further.&quot; So what I am asking for is: Is this really just a notation thing? If so, does this mean we can actually NOT use d like a variable? If not, where does the $d$ go? I found  related question, but it does not really answer my specific question. So I would not see it as a duplicate, but correct me if my search has not been sufficient and there indeed is a similar question out there already. Mail vs. mail what is the difference A method for evaluating sums/discrete functions by assuming they can be made continuous and differentiable? Integrating $\int_0^1 \frac {\log(1-x)\log^2(1+x)}x \mathrm{d}x$ Question: Integrate$$\int\limits_0^1dx\,\frac {\log(1-x)\log^2(1+x)}x=-\frac {\pi^4}{240}$$   I'm curious as to if there is a way to integrate this. I've tried using integration by parts to get$$I=-\frac {\pi^2}6\log^22+2\int\limits_0^1dx\,\frac {\operatorname{Li}_2(x)\log(1+x)}{1+x}$$However, I'm not sure how to continue even further. The polylog in the second integrand seems a bit intimidating and I don't see how the first term even helps. How do I watch a file for changes? Embedding $S_n$ into $A_{n+2}$ Blocking comment spam without using captcha How to delineate watersheds in QGIS? I am using qgis 2.14.17 with ubuntu16. Having as input data a DEM of the region and a river network. In the manual of qgis they suggest to use a toll of qgis: Catchment area (Parallel); I dont have this in my toolbox, anybody made the same experience and could tell me the reason for it and how to get it. It seems to offer the best solution for me.  Tools which are available are from GRASS7 and TauDEM, the latter need much more data it seems. And I am not sure if I am able to create these just out of a DEM? The GRASS7 has one tool r.water.outlet: but here one has to put the outlet coordinates, which clearly I could get out of the river network, but the idea is that they are generated by delineating the watersheds.  Somebody has an idea how to solve it?  I managed now to get SAGA run in the toolbox, nevertheless would be great if somebody could help me with the qgis tool, since it should appear?! Multi-OS Portable TeX system I'm looking to treat myself to a totally portable TeX system and was wondering: is it possible to devise an installation scheme that would run on Windows, Linux and MacOS at the "same" time?  I think TeXLive is the best choice here, but I'd much rather avoid having to maintain three separate TeXLive installations. I'd like the three installations to share the package databases for instance.  I'll be using a 32Gb USB stick, in case it matters.  PS: I think I'm onto something here... will post back when I have a working prototype.  Edit: after reading  I managed to format a USB stick with UDF and have it read and written in Linux and Windows (need to perform some tests on Mac yet). This is the first step towards interoperability.  Edit 2: well, as it turns out, the previous note was useless (the partition table breaks under Windows), I've found  and it works like a charm. The only remaining step is writing a couple of scripts to set the environmental variables and we're done ;) I am having a problem running the CDC change capture job against some of my test databases.  The error message I'm getting is the following:     Executed as user: NT AUTHORITY\NETWORK SERVICE. Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission. [SQLSTATE 42000] (Error 15517).   How can I fix this? Simple logic problem: Finding largest and smallest number among 3 numbers