I want to split a string with Tabstops. What is the correct char[] equivalent for usage with   Split.(char[] x, int i)
I'm building an application where I should capture several values and build a text with them: Name, Age, etc.   The output will be a plain text into a TextBox.  I am trying to make those information appear in kind of columns, therefore I am trying to separate them with tab to make it clearer.  For example, instead of having:  Ann 26 Sarah 29 Paul 45   I would like it to show as:  Ann tab 26 Sarah tab 29 Paul tab 45  Any tip on how to insert the tabs into my text?
Environment variable substitution in sed If I run these commands from a script:  #my.sh PWD=bla sed 's/xxx/'$PWD'/' ... $ ./my.sh xxx bla   it is fine.  But, if I run:  #my.sh sed 's/xxx/'$PWD'/' ... $ ./my.sh $ sed: -e expression #1, char 8: Unknown option to `s'    I read in tutorials that to substitute environment variables from shell you need to stop, and 'out quote' the $varname part so that it is not substituted directly, which is what I did, and which works only if the variable is defined immediately before.  How can I get sed to recognize a $var as an environment variable as it is defined in the shell? I read through all the related answers, but they do not apply to Ubuntu 14.04.  I have no .gnome2 folder and no Passwords and Encryption keys item in the system settings. I tried to crawl through every possible menu, but I could not find out how to do it.  The popup usually pops out when I start Chromium. How can I check the SMART status of a SSD or HDD on current versions of Ubuntu 14.04 through 20.04? How can I check the SMART status of a drive under 14.04 and beyond? I've seen  but it doesn't seem to apply under 14.04 and later. Self-explanatory title really! A student today asked me why they were called integral domains -- and I realised that the word "integral" seems to be being used in a way totally unlike any other way I hear it used in mathematics. The student suggested that "integral" was used because the integers were an example -- but I didn't buy this because by that logic they could have been called "rational domains" or "real domains".  Any ideas anyone? An irreducible $f\in \mathbb{Z}[x]$, whose image in every $(\mathbb{Z}/p\mathbb{Z})[x]$ has a root? Problem: Is there an irreducible $f\in \mathbb{Z}[x]$, whose image in every $(\mathbb{Z}/p\mathbb{Z})[x]$ has a root for $p$ prime? If there is, what is the minimal degree possible?   I can only prove that $x^2-c$ is impossible, by quadratic reciprocity and Chinese remainder theorem. Even the case of $a x^2 - c$ is unknown to me.  Meanwhile, if $f$ is not required  to be irreducible, but only have no root in $\mathbb{Z}$, then $(x^2-a)(x^2-b)(x^2-ab)$ is a solution for non-sqaure $a,b,ab$, since if both $a,b$ are not squares in $\mathbb{Z}/p\mathbb{Z}$, then $ab$ is a square. Yet I still don't know if this is of minimal degree.  Also, it is natural to pose generalizations   When $p$ is not necessarily prime (equivalently for all prime powers). When $p$ is odd prime. When $p$ represents sufficiently large primes (equivalently all but a finite number left). Why did Douglas Adams pick 42 as the ultimate answer? Star Trek often refers to 47 and Star Trek made a sport out of finding real or imagined references to 47. Why did Douglas Adams pick 42 as the ultimate answer in the Hitchhikers guide to the galaxy? Can I start and stop a tile floor job? Can you ready an action for "immediately before my next turn"? I have been assigned this problem for homework:     Show that, if $a &lt; b + \epsilon$ for every  $\epsilon \gt 0$, then $a\le b$.   I have tried to go about this using Induction, but I don't know what the base case would be. It is obvious to me in my mind, but I don't know how to put it into mathematical terms on paper. any hints? Where does matter go after reaching singularity in uncharged black holes? I am a layman in physics and just read about black holes on the internet. I read that matter encounters geodesic incompleteness in the singularity in an uncharged black hole.  I heard an analogy of geodesic incompleteness as a straight line on a paper reach a hole on the paper, so it cannot continue. But in this analogy, isn't the straight line possible to continue into 3D (continue down the paper)? So, if matter reaches the singularity, is it possible too (to reach another dimension)?   I also heard that the matter is annihilated when reaching the singularity, does it mean it disappear from this world, and violates conservation of energy? So this homework question is in the context of $\mathbb{R}$ only, and we are using Lebesgue measure.  The sum $A+B$ is defined to be $A+B=\{a+b|a\in A,b\in B\}$. The question is: If $m(A),m(B)&gt;0$, is it necessarily the case that $A+B$ contains an open interval?  This question is quite annoying, since it is quite difficult to calculate the sum even after you construct an example. However, it seems like no matter how I constructed a set of positive measure, there is a region that have a lot of point in it (yet this region is not necessarily dense). This suggest that when summed up, the holes should be covered up somehow and thus there would be an open interval, and so the answer is yes. Sorry for a rather vague idea, but I'm just not sure what to do with this problem. I have a feeling that somehow topology would have a way to capture precisely the idea above about a region with a lot of point.  (also, I think my middle school teacher mentioned this once, and I remembered the answer to be yes; but that is quite a while ago though)  Thank you. Any help will be appreciated.  EDIT2: So Camilo's answer is gone. I am looking at the convolution method right now. Because the convolution is continuous, if it is nonzero I am done. But then there is no guarantee that the convolution is nonzero even if $x\in A+B$. I still need help with this direction. Can someone give me some hints?  EDIT: Camilo's answer below essentially suggest the method of getting 2 open interval from regularity theorem, one cover a subset of A and one cover a subset of B such that the sum of the measure of these two subset is bigger than the measure of the larger interval. user99680's answer point to a wiki which show a method that essentially simply acquire an open set. After some thinking, I believe that these method simply can't be made to work. I constructed this example in the hope that it would convince you that it is the case:  Let $I_{0},I_{1},\ldots$ be disjoint open interval such that the distance between any 2 of them is nonzero and $m(I_{n})=9^{-n}$ and all of them are inside $[0,2]$. Let $J_{0},J_{1},\ldots$ be disjoint open interval such that the distance between any 2 of them is at least $3$ and $m(J_{3n})=m(J_{3n+1})=m(J_{3n+2})=\frac{m(I_{n})}{3}$. Let $O=\bigcup I_{n}$ and $H=\bigcup J_{n}$. Construct $A\subset O$ such that $m(A\bigcap I_{n})=\frac{3m(I_{n})}{4}$. Construct $B\subset H$ such that $m(B\bigcap J_{n})=\frac{3m(J_{n})}{4}$. Now if you apply Camilo's method, it is possible that your $I$ would be one of the $I_{n}$ above, and your $J$ is one of the $J_{m}$ above. No matter which $I_{n},J_{m}$ you have, the argument does not work. Rewrite $m=3q+r$ where $0\leq r\leq 2$. If $q&lt;n$ then $m(J_{m})&gt;m(I_{n})$ so the longer interval have length $\frac{m(I_{q})}{3}$; $m(A\bigcap I_{n})$ is at most $\frac{3m(I_{q+1})}{4}=\frac{m(I_{q})}{12}$ and $m(B\bigcap J_{m})=\frac{3m(J_{m})}{4}=\frac{m(I_{q})}{4}$. Thus $m(A\bigcap I_{n})+m(B\bigcap J_{m})$ is no larger than the larger interval. If $n\geq q$ then $m(I_{n})&gt;m(J_{m})$ so the larger interval is of length $m(I_{n})$; $m(A\bigcap I_{n})=\frac{3m(I_{n})}{4}$ and $m(B\bigcap J_{m})$ is at most $\frac{3m(J_{3n})}{4}=\frac{m(I_{n})}{4}$. Once again $m(A\bigcap I_{n})+m(B\bigcap J_{m})$ is no larger than the larger interval. Hence the Camilo's argument does not work. user99680's method does not work either, since you get $O$ and $H$ which is even bigger than any interval. Does the force of kinetic friction increase with the relative speed of the objects involved? If not, why not? How to know current name of the database in Django? Cannot determine size of graphic I'm trying to include graphics in my Latex-file, which I compiled with latex+dvipdf on OS X. Latex however returns this error: "Cannot determine size of graphic"  My graphic is exported from PowerPoint, so I have tried both .pdf and .png. I get the same errors for both.  Sample code that doesn't work:  \begin{figure}[htb] \begin{center} \leavevmode \includegraphics[width=0.8\textwidth]{graph.png} \end{center} \end{figure}   If I have to manually set some measurements of the image, please tell me how I can find out those measurements. I need the image to take up about 80% of text width and be centered. Thanks. Geometric proof that a Pythagorean triple has a number divisible by $3$? Can I infer from “If $a,b \in \mathbb{N}$ such that $(a,3)=(b,3)=1$ then $a^2+b^2\neq c^2$ for any $c\in\mathbb{N}$” that any pythagorean triple has a number which is divisible by $3$? If so, how can this relationship be proved geometrically? How align the qedsymbol after of a big formula in display mode? Can I change directory to a Windows drive in Ubuntu Bash on WSL? I am a super newbie for Ubuntu and basically need Ubuntu for a Python package.  I would like to run a Python file in say e:/username/folder1/folder2/python.py. I tried every method online and the only reply is bash: cd./e: No such file or directory. I am not sure whether it is because of the bash windows or virtualenv.  When I use bash on Ubuntu on Windows, ls, it says VIRTUALENV_DIR. cd, it says /home/username. The cd .. etc changes the directory a little, but not another drive, nor the folder I would like it to find. Why we don't use gamma rays, x-rays or ultraviolet to transmit data? Why is there this strange contradiction between the language of logic and that of set theory? In standard probability theory events are represented by sets consisting of elementary events. Consider two events for which (as sets) $A \subset B$. If an elementary event $x \in A$ takes places then we say that $B$ takes place as well. Since $A \subset B$, $x \in A$ implies that $B$ takes place too.  It seems that when for sets (representing events) $$A \subset B$$ $$then \ A \ implies \ B .$$  On the other hand, if we use the language of logic for the events then $$A \supset B$$ $$ \ means\  that \ A\  implies\ B .$$  Why is this strange virtual contradiction between the language of sets and the language of logic?  (In order to avoid down votes and unplesant comments I reveal that I happen to know that the true translation of the sentence $A \supset B$ of logic to the language of sets (representing events) is $\overline{A \cap \overline B}$.) Taking the * of these two large shapefiles   locally using ArcMap takes appr. 10 min.   Over the last few weeks, I've tried to obtain the same results using other, open-source approaches without success. I am curious why only ArcMap seems to generate results in a reasonable amount of time without errors.   The approaches I've tried so far:  QGIS  The most straight-forward alternative. There are two "union" functions available in QGIS. One default (part of vector overlay), one based on SAGA. Both functions create the desired results on smaller samples but fail to run (or take forever) on my shapefiles. I tried running union for 30 minutes after which the progress bar was at appr. 4%    PostGIS  I've ingested the shapefiles on an AWS RDS instance running postGreSQL with PostGIS enabled. The approach is not so straight forward and requires a hideous long SQL query to obtain the same result. Most importantly, the query did not create a meaningful result on the full datasets. It did run properly on a sample though.   See separate question   CREATE TABLE test.sqlislelijk AS  -- input data with polys1 AS (   SELECT      pfaf_id as df1,     geom as g   FROM hybas06_v04 ), polys2 AS (   SELECT      aqid as df2,     geom as g   FROM y2018m11d14_rh_whymap_to_rds_v01_v01 ), -- intersections intersections AS (   SELECT df1, df2, ST_INTERSECTION(a.g, b.g) i, a.g AS g1, b.g AS g2    FROM polys1 a, polys2 b WHERE ST_INTERSECTS(a.g, b.g) ), -- per-row union of intersections with this row diff1 AS (   SELECT df1, ST_UNION(i) i FROM intersections GROUP BY df1 ), diff2 AS (   SELECT df2, ST_UNION(i) i FROM intersections GROUP BY df2 ), -- various combinations of intersections pairs AS (   SELECT df1, df2, i AS g FROM intersections   UNION ALL   SELECT      p.df1,     NULL,     CASE       WHEN i IS NULL THEN g        ELSE ST_DIFFERENCE(g, i)     END   FROM polys1 p LEFT JOIN diff1 d ON p.df1 = d.df1   UNION ALL   SELECT     NULL,     p.df2,     CASE       WHEN i IS NULL THEN g       ELSE ST_DIFFERENCE(g, i)     END   FROM polys2 p LEFT JOIN diff2 d ON p.df2 = d.df2   ) SELECT    df1 as pfaf_id,   df2 as aqid,   g as geom FROM pairs WHERE NOT ST_IsEmpty(g);   Google BigQuery  Google's GIS extension for BQ looks promising but I experienced weird behavior and internal errors, probably due to mixing of GEOMETRY and GEOGRAPHY objects. Also, the syntax is similar to PostGIS and a command of 1 line in geopandas takes >20 lines in SQL.   GeoPandas  Probably my favorite approach. The out-of the box approach does't give any results after running it for several hours. My latest approach includes tiling the shapefiles, use multiprocessing on each tile and merge them. Not very straight forward and one 10x10 degree tile till takes 40+ minutes to calculate.   See   It is the first time in my career that I am impressed by the performance of ArcMap. It seems that ArcMap handles this use-case much, much better than anything else. The issue seems persistent over all solutions I've tried so far. Is there something wrong in the underlying libraries of the open-source/alternative solutions?    Note that Union in ArcMap means something different than in the Shapely / PostGIS world.