Let's say a=(1,2) and b=(3,4) What should print(a+b) give?  I expect the output (4,6), but the actual output is(1,2,3,4)
Is there anyway to get tuple operations in Python to work like this:  &gt;&gt;&gt; a = (1,2,3) &gt;&gt;&gt; b = (3,2,1) &gt;&gt;&gt; a + b (4,4,4)   instead of:  &gt;&gt;&gt; a = (1,2,3) &gt;&gt;&gt; b = (3,2,1) &gt;&gt;&gt; a + b (1,2,3,3,2,1)   I know it works like that because the __add__ and __mul__ methods are defined to work like that. So the only way would be to redefine them?
Series convergence or divergence how to test I have the following series defined.   $$\displaystyle\sum_{k=1}^{n} \cos \left( {\frac{\pi}{2}} k \right) \frac{k}{k+1000} \frac{1}{\sqrt{k}}$$ where $n = 1,2...$  How to test whether this series converges or diverges ? Is $f(x,y)=(xy)^{2/3}$ differentiable at $(0,0)$? I looked at the graph of $f(x,y)=(xy)^{2/3}$ at the origin, and no matter how far I zoom in it has four corners along $x=\pm y$, so it doesn't look like it is differentiable as $z=0$ doesn't look like a tangent plane.  I also found that its partial derivatives are not continuous at $(0,0)$, e.g.  $$ \lim_{(ky^2,y) \to (0,0)} \frac{\partial f}{\partial x} = \lim_{(ky^2,y) \to (0,0)} \frac{2}{3}x^{-\frac{1}{3}}y^{\frac{2}{3}} = \frac{2}{3}k^{-\frac{1}{3}} $$ (although $\frac{\partial f}{\partial x}(0,0) = \frac{\partial f}{\partial y}(0,0) = 0$)  I also tried to prove/disprove its differentiability by definition, and for it to be differentiable I need $$ \lim_{(x,y) \to (0,0)} \frac{f(x,y)-0}{\sqrt{x^2+y^2}} =0 $$ but then I got stuck. Am I even on the right track?  [UPDATE] I need to do the same thing for $f(x,y)=(xy)^{\frac{1}{3}}$... I think the answer is that $(xy)^{2/3}$ is differentiable but $(xy)^{1/3}$ is not, according to my professor but I'm not sure No newline after (sub)section? I want my text to appear right after the call to \subsection{Name} but  I can't find how to do it. I'm using the article class.  An example of command:  \subsection{a)} Blah blah bla...   produces:     a)      Blah blah bla...   instead of what I want:     a) Blah blah bla...   Anything I could do? The  asks about functions $f \colon \mathbb R \to \mathbb R$ such that $$f(x+y)=f(x)+f(y).$$ It is a very well-known functional equation, which appears in various areas of mathematics ranging from exercises in freshman classes to constructing useful counterexamples for some advanced questions. Solutions of this equation are often called . Also a few other equations related to this equation are often studied. (Equations which can be easily transformed to Cauchy functional equation or can be solved by using similar methods.) Is there some overview of basic facts about Cauchy equation and related functional equations - preferably available online? I get a long list of such arrays  {     "id": "byu6g6c4cjys5mdkg5znh8ju8c",     "create_at": 1511875272294,     "update_at": 1511875272294,     "delete_at": 0,     "display_name": "BMA",     "name": "BMA",     "description": "",     "email": "aleksandar.ivanov@random.com",     "type": "O",     "company_name": "",     "allowed_domains": "",     "invite_id": "gdgz1tbxuinntx1fbr1ax7kehy",     "allow_open_invite": false,     "scheme_id": null   }   I want to get by JQ only the ID where the name is BMA. At the moment I parse " jq -r '.[]["name"]" and I can filter the output from curl by name and I will get "BMA" and also 100 other names, but I need to filter only the ID where name is =BMA. Any ideas? Foreword  This question was inspired by initial mistakes in . I wanted to explore the strange circle with $A&gt;\pi r^2$ and got lost into geometrical jungle.  A  is usually described by it's height $h$, radius of the base $a$ and radius of the sphere $r$. Besides we have a relation $a^2+(r-h)^2=r^2$ so the cap actually only has two degrees of freedom.  When considering a case of circle on a sphere (like the Earth), it's the surface of a spherical cap, but we can't see the height or other classic parameters of this spherical cap. Instead we encounter parameters like area $A$, perimeter $C$ and diameter $d$. I will try to write formulae for these: $$A=2\pi rh$$ $$C=2\pi a$$ $$d=2r\theta$$  Where $\theta$ is introduced with $\sin\theta=\frac{a}{r}$ or $\cos\theta=(1-\frac{h}{r})$.  As the cap only has two degrees of freedom, it should be a good problem with unique solution if only two values are known.  A-C Problem  The simple example: $A$ and $C$ are given. I show this only as example before the other tasks.  We can easily find $a=\frac{C}{2\pi}$ and then solve:  $$A=2\pi rh = 2\pi r (r-\sqrt{r^2-a^2})$$  to obtain  $$r=\frac{A}{2\sqrt{\pi(A-\pi a^2)}}$$  Parameters $a$ and $r$ are now known and it is straightforward to find $h$, $d$, $\theta$ and anything else.  C-d Problem  $C$ and $d$ are given.  First step once again is easy: $a=\frac{C}{2\pi}$. The knowing of $a$ suggests that we might prefer the $\theta$ definition with the sine. We obtain: $$d=2r\theta=2r\arcsin\frac{a}{r}$$  That's where I got stuck. Is there an easy way to solve this? Is there a hard way to solve this?  I tried solving numerically with Wolfram Mathematica and it went into complex numbers. When solving the geometrically equivalent $\sin\frac{d}{2r}=\frac{a}{r}$ I got some roots, but the search seemed very unstable and not finding the root closest to initial value. Besides it was finding a lot of different roots while I am pretty sure that there should only be one $r$ for each pair of $d$ and $a$. What would be the right formulation to solve this problem numerically?  A-d problem  $A$ and $d$ are given. This seems the hardest one. We obtain a system of equations:  $$A=2\pi r h$$ $$d=2r\arccos\left(1-\frac{h}{r}\right)$$  (The first equation suggested solving the problem in $h$ and $r$).  Is this system solvable analytically? Or numerically? My experiments with Wolfram Mathematica never converged.   Of course, I could express $h$ or $r$ from the first equation and leave only the second in one of these forms: $$d = 2r\arccos\left(1-\frac{A}{2\pi r^2}\right)$$ $$d = \frac{A}{\pi h}\arccos\left(1-\frac{2\pi h^2}{A}\right)$$  But I have no idea how to solve these either. How To Create A 'Two-Sided' Unique Index On Two Fields? How can I efficiently create a unique index on two fields in a table like this: create table t (a integer, b integer);  where any unique combination of two different numbers cannot appear more than once on the same row in the table.  In order words if a row exists such that a=1 and b=2, another row cannot exist where a=2 and b=1 or a=1 and b=2.  In other words two numbers cannot appear together more than once in any order.  I have no idea what such a constraint is called, hence the 'two-sided unique index' name in the title.  Update: If I have a composite key on columns (a,b), and a row (1,2) exists in the database, it is possible to insert another row (2,1) without an error.  What I'm looking for is a way to prevent the same pair of numbers from being used more than once in any order... How to create a generic array in Java? Due to the implementation of Java generics, you can't have code like this:   public class GenSet&lt;E&gt; {     private E a[];      public GenSet() {         a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation     } }   How can I implement this while maintaining type safety?  I saw a solution on the Java forums that goes like this:  import java.lang.reflect.Array;  class Stack&lt;T&gt; {     public Stack(Class&lt;T&gt; clazz, int capacity) {         array = (T[])Array.newInstance(clazz, capacity);     }      private final T[] array; }   But I really don't get what's going on. Intuitive meaning of Globally Hyperbolic I am been studying differential geometry and spacetime and I keep coming across the term . I am having a hard time coming up with an intuitive understanding of this idea. What is an intuitive meaning of globally hyperbolic.  My background is mostly mathematics at a higher undergraduate level. What are the different ways that a message can be displayed to a bash shell after a user logs in? I have a CentOS 5.7 VPS using bash as its shell that displays a branded greeting immediately after logging in via SSH. I've been trying to modify it, but can't seem to find where it is in the usual places. So far I've looked in the motd file and checked sshd_config for banner file settings. A banner file is not set.  Where else can I look for where the login message might be? How do I disable search-as-you-type text in Ubuntu 17.10 and later? I cannot find enable-interactive-search in    gsettings set org.gnome.nautilus.preferences enable-interactive-search true.     I searched using    gsettings list-recursively | grep search     and    gsettings list-recursively | grep interactive     but no such option.  Can you help me disable this in Ubuntu 17.10 and later? How is pressure an intensive coordinate? Wulfgar won't teach me Unrelenting Force's final word after Arngeir accepts the Horn of Jurgen Windcaller Drawing different tikz shapes parameterized by data from a file I have a file with three columns of data, x, y, r.  # x y r 1 1 0.1 2 2 0.5 3 3 1.2   and so on. I'd like to loop over the rows, and draw a circle at x,y with radius r for each row.  I first thought I'd use pgfplots with customized marks, but I couldn't figure out how to pass the radius parameter into the pgfplot mark handler. Then I thought I'd use tikz and pgf directly, but I couldn't figure out how to reference the values for r inside a draw command sequence.   Any thoughts ? I'd be very grateful for some help. Java error: Implicit super constructor is undefined for default constructor Global Inbox -> Global RSS feed for all my questions across all the sites? Does the plastic cap on a Presta valve serve any purpose once fitted to a rim? I can see the use of the valve cap on a Presta valve when the tube is still packaged (it obviously stops the valve puncturing the tube), but does it do anything except look pretty (or not) once you've fitted the tube to a rim?  I've kept them on out of habit, because I've had problems with sticking Schrader valves in the past when I've lost the caps and dirt/grime has got in there - but the design of Presta valves suggests to me that they wouldn't suffer this fate.  Given that I really need to , is replacing this cap something I can leave out of my daily chores? How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)? I have Ubuntu 18.04 LTS installed.  I installed Arduino IDE v1.8.5 as a snap with  snap install arduino-mhall119   I have added my user to dial-out group and rebooted:  sudo usermod -a -G dialout $USER  $ groups  username adm dialout cdrom sudo dip plugdev lpadmin sambashare   I connected my Arduino Nano to the laptop, it is detected on port /dev/ttyUSB0 (ch341-uart).  $ ls /dev/ttyUSB0 -al crw-rw---- 1 root dialout 188, 0 авг 13 11:59 /dev/ttyUSB0   I tried to upload the simpliest Blink sketch and get the following errors in the terminal:  $ arduino-mhall119.arduino    avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied   Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.**   Also I have installed arduino 1.8.5 with umake - it can access serial port in usual way.  Note: we already have  here, but the solution was to use , not fix for the Snap.  So my question is: How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)?  Update: connecting serial-port to the snap fails with the following message  $ snap connect arduino-mhall119:serial-port  error: snap "core" has no "serial-port" interface slots   Current interfaces are:  $ snap interfaces | grep arduino :home                            arduino-mhall119,gedit,organize-my-files,vlc :network                         arduino-mhall119,gedit,organize-my-files,pulsemixer,vlc :unity7                          arduino-mhall119,gedit,organize-my-files,vlc :x11                             arduino-mhall119,organize-my-files,pulsemixer,vlc -                                arduino-mhall119:serial-port   Changing permissions of serial port to 777 with sudo chmod 777 /dev/ttyUSB0 does not help.  The following do not work too (because of syntax errors):  $ sudo snap connect arduino-mhall119:arduino error: snap "arduino-mhall119" has no plug named "arduino"  $ snap connect arduino-mhall119:/dev/ttyUSB0 error: snap "arduino-mhall119" has no plug named "/dev/ttyUSB0"  $ snap connect arduino-mhall119 error: cannot resolve connection, plug snap name is empty   Information about YAML-manifest:  $ ls -l /snap/arduino-mhall119/current/meta/snap.yaml -rw-r--r-- 1 root root 353 июл 28 00:20 /snap/arduino-mhall119/current/meta/snap.yaml  $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 12 slots  $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 5 plug     plugs:     - x11     - unity7     - home     - network     - serial-port Light clock with mirrors on a moving train Windows 7 USB install error I am trying to install Windows 7 Professional x64 from a bootable USB stick. I have used the Windows 7 USB DVD Download Tool to create the media from an ISO.  The machine boots from USB fine, and enters the Windows installation wizard but then I get an error stating:     A required CD/DVD drive device driver is missing. If you have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now.   I have tried setting the SATA controller in the BIOS to both AHCI and ATA but neither appear make any difference.  I've also tried both the USB 3 and USB 2 ports with no difference.  I've also tried to use the files from an official Dell recovery CD as this is a Dell laptop but again, no dice.  All this because there's no optical drive in the machine!  Dell Vostro V131 / i5-2450M / BIOS A04  Can anyone offer any advice please?