Failed to put two functions in one graph I was trying to put two plots of different functions in one graph, but the second one didn't show up in the graph. Does somebody see the mistake? Here is the code:  \documentclass{article}  \usepackage{pgfplots}% This uses tikz \pgfplotsset{compat=newest}% use newest version  \pgfmathdeclarefunction{FunctionA}{1}{%   \pgfmathparse{300 + 1000/x + 2.5*x}% }  \pgfmathdeclarefunction{FunctionB}{1}{%   \pgfmathparse{290 + 1000/x + 2.45*x}% }  \tikzset{My Line Style/.style={smooth, thick, samples=400}}  \begin{document} \begin{tikzpicture} \begin{axis}[     xmin=0, xmax=750,     ymin=300, ymax=600,     axis x line=bottom,     axis y line=left,      xlabel= $y$     ylabel=Cost,]     \addplot[My Line Style, color=black, domain=0:250] (\x,{FunctionA(\x)});     \addplot[My Line Style, color=black, domain=250:500] (\x,{FunctionB(\x)}); \end{axis} \end{tikzpicture} \end{document} \documentclass{article}
Tikz won't plot the function properly I tried to plot the following function but it didn't work:  y = 300 + 1000/x + 2.5x.  This is the document, but instead of the plot it only shows the axis.  \documentclass{article}  \usepackage{pgfplots}% This uses tikz \pgfplotsset{compat=newest}% use newest version  \pgfmathdeclarefunction{Function}{1}{%   \pgfmathparse{300 + 1000/x + 2.5}% }  \tikzset{My Line Style/.style={smooth, thick, samples=400}}  \begin{document} \begin{tikzpicture} \begin{axis}[     xmin=0.0,     xmax=250,     ymin=0,     ymax=50,     axis x line=bottom,     axis y line=left,      xlabel= $y$,     ylabel=Cost,      xtick={250},     xticklabels={250},         restrict x to domain=0:250,     ]        \addplot+[My Line Style, color=black, samples at={1,2,3,4,...,249,250}] (\x,{Function(\x)});   \end{axis}  \end{tikzpicture} \end{document} \documentclass{article}
Unexpected voltage with switch turned off What is this shell/Bash syntax: someVariable=someValue someCommand What counter balances gravity here? Lets consider a stone tied to one end of a massless and unstretchable string... Now if i'll start rotating, it will form a conical pendulum &amp; then the equilibrium is achived when the pendulum attains horizontal circular motion.... Now to maintain that state we give a constant force to string.... Here, which force counterbalances gravity? Is it the torque due to applied force cancels out the torque due to gravity?  The angle θ changes from 0 to 90° How to install Epson Perfection V600 Photo Scanner drivers How do I get a list of obsolete packages? I'm trying to figure out a way to get a list of the packages that are no longer available in the repositories that I have enabled. This workstation has been through quite a few versions of Ubuntu and has had many 3rd party repositories added and removed. I'd like to get a list of software that I have from these removed repositories, so I can clean it up or add back the appropriate repositories. How do I remove the space between inline/inline-block elements? reason for exec in wrapper scripts I have seen wrapper script examples which in a nutshell are following:  #!/bin/bash  myprog=sleep echo "This is the wrapper script, it will exec "$myprog""  exec "$myprog" "$@"   As seen above, they use exec to replace the newly created shell almost immediately with the $myprog. One could achieve the same without exec:  #!/bin/bash  myprog=sleep echo "This is the wrapper script, it will exec "$myprog""  "$myprog" "$@"   In this last example, a new bash instance is started and then $myprog is started as a child process of the bash instance.  What are the benefits of the first approach? I've been reading the  and it mentions about virtual terminals which, if I understood it correctly, it is a Linux-specific feature (not in Unix) to allow multiple login consoles in a non X11 system. You create virtual terminals by pressing ALT-F2. I'm running Linux Mint and in my /dev folder though I see many tty devices and I don't know what they are for. Here is the grepped output:  crw-rw-rw-  1 root tty       5,   0 Jan  2 19:45 tty crw--w----  1 root tty       4,   0 Jan  2 19:10 tty0 crw-rw----  1 root tty       4,   1 Jan  2 19:10 tty1 crw--w----  1 root tty       4,  10 Jan  2 19:10 tty10 crw--w----  1 root tty       4,  11 Jan  2 19:10 tty11 crw--w----  1 root tty       4,  12 Jan  2 19:10 tty12 crw--w----  1 root tty       4,  13 Jan  2 19:10 tty13 crw--w----  1 root tty       4,  14 Jan  2 19:10 tty14 crw--w----  1 root tty       4,  15 Jan  2 19:10 tty15 crw--w----  1 root tty       4,  16 Jan  2 19:10 tty16 crw--w----  1 root tty       4,  17 Jan  2 19:10 tty17 crw--w----  1 root tty       4,  18 Jan  2 19:10 tty18 crw--w----  1 root tty       4,  19 Jan  2 19:10 tty19 crw-rw----  1 root tty       4,   2 Jan  2 19:10 tty2 crw--w----  1 root tty       4,  20 Jan  2 19:10 tty20 crw--w----  1 root tty       4,  21 Jan  2 19:10 tty21 crw--w----  1 root tty       4,  22 Jan  2 19:10 tty22 crw--w----  1 root tty       4,  23 Jan  2 19:10 tty23 crw--w----  1 root tty       4,  24 Jan  2 19:10 tty24 crw--w----  1 root tty       4,  25 Jan  2 19:10 tty25 crw--w----  1 root tty       4,  26 Jan  2 19:10 tty26 crw--w----  1 root tty       4,  27 Jan  2 19:10 tty27 crw--w----  1 root tty       4,  28 Jan  2 19:10 tty28 crw--w----  1 root tty       4,  29 Jan  2 19:10 tty29 crw-rw----  1 root tty       4,   3 Jan  2 19:10 tty3 crw--w----  1 root tty       4,  30 Jan  2 19:10 tty30 crw--w----  1 root tty       4,  31 Jan  2 19:10 tty31 crw--w----  1 root tty       4,  32 Jan  2 19:10 tty32 crw--w----  1 root tty       4,  33 Jan  2 19:10 tty33 crw--w----  1 root tty       4,  34 Jan  2 19:10 tty34 crw--w----  1 root tty       4,  35 Jan  2 19:10 tty35 crw--w----  1 root tty       4,  36 Jan  2 19:10 tty36 crw--w----  1 root tty       4,  37 Jan  2 19:10 tty37 crw--w----  1 root tty       4,  38 Jan  2 19:10 tty38 crw--w----  1 root tty       4,  39 Jan  2 19:10 tty39 crw-rw----  1 root tty       4,   4 Jan  2 19:10 tty4 crw--w----  1 root tty       4,  40 Jan  2 19:10 tty40 crw--w----  1 root tty       4,  41 Jan  2 19:10 tty41 crw--w----  1 root tty       4,  42 Jan  2 19:10 tty42 crw--w----  1 root tty       4,  43 Jan  2 19:10 tty43 crw--w----  1 root tty       4,  44 Jan  2 19:10 tty44 crw--w----  1 root tty       4,  45 Jan  2 19:10 tty45 crw--w----  1 root tty       4,  46 Jan  2 19:10 tty46 crw--w----  1 root tty       4,  47 Jan  2 19:10 tty47 crw--w----  1 root tty       4,  48 Jan  2 19:10 tty48 crw--w----  1 root tty       4,  49 Jan  2 19:10 tty49 crw-rw----  1 root tty       4,   5 Jan  2 19:10 tty5 crw--w----  1 root tty       4,  50 Jan  2 19:10 tty50 crw--w----  1 root tty       4,  51 Jan  2 19:10 tty51 crw--w----  1 root tty       4,  52 Jan  2 19:10 tty52 crw--w----  1 root tty       4,  53 Jan  2 19:10 tty53 crw--w----  1 root tty       4,  54 Jan  2 19:10 tty54 crw--w----  1 root tty       4,  55 Jan  2 19:10 tty55 crw--w----  1 root tty       4,  56 Jan  2 19:10 tty56 crw--w----  1 root tty       4,  57 Jan  2 19:10 tty57 crw--w----  1 root tty       4,  58 Jan  2 19:10 tty58 crw--w----  1 root tty       4,  59 Jan  2 19:10 tty59 crw-rw----  1 root tty       4,   6 Jan  2 19:10 tty6 crw--w----  1 root tty       4,  60 Jan  2 19:10 tty60 crw--w----  1 root tty       4,  61 Jan  2 19:10 tty61 crw--w----  1 root tty       4,  62 Jan  2 19:10 tty62 crw--w----  1 root tty       4,  63 Jan  2 19:10 tty63 crw--w----  1 root tty       4,   7 Jan  2 19:10 tty7 crw--w----  1 root tty       4,   8 Jan  2 19:10 tty8 crw--w----  1 root tty       4,   9 Jan  2 19:10 tty9 Producing doc/docx from LaTeX Is there any way to produce doc/docx files from LaTeX? Finding the sum of the series $\frac{1}{1!}+\frac{1+2}{2!}+\frac{1+2+3}{3!}+ \ldots$ Deteremine the sum of the series $$\frac{1}{1!}+\frac{1+2}{2!}+\frac{1+2+3}{3!}+ \ldots$$  So I first write down the $n^{th}$ term $a_n=\frac{\frac{n(n+1)}{2}}{n!}=\frac{n+1}{2(n-1)!}$.  So from there I can write the series as $$1+\frac{3}{2}+\frac{4}{2\times 2!}+\ldots +\frac{n+1}{2(n-1)!}+\ldots $$  I am quite sure I can do some sort of term by term integration or differentiation of some standard power series and crack this. Any leads? Deploy Community Builder audience page assignments with ant migration tool? In Community Builder, if you create audiences and assign them to page variations, you cannot deploy these using change sets, according to .  In fact, Audience doesn't even appear in the list of change set components.  On the other hand, Audience metadata can be deployed using the ant migration tool, so I was hopeful that the audience assignments would also be deployable.  Unfortunately, I haven't had success in deploying any audience assignments, either for entire pages or for components on a page.  Has anyone found a workaround for deploying audience assignments for Community Builder pages?  I should say that I'm using the Build Your Own template.  If it can't be deployed, is there at least a way to get a list of audience assignments so I don't have to open every single page in the Community Builder to check?  Here's what I'm using in my package.xml manifest.  All the community builder page variations and all the audiences are created correctly, but the assignments are not.  &lt;types&gt;     &lt;members&gt;*&lt;/members&gt;     &lt;name&gt;Audience&lt;/name&gt; &lt;/types&gt; &lt;types&gt;     &lt;members&gt;*&lt;/members&gt;     &lt;name&gt;CustomSite&lt;/name&gt; &lt;/types&gt; &lt;types&gt;     &lt;members&gt;*&lt;/members&gt;     &lt;name&gt;SiteDotCom&lt;/name&gt; &lt;/types&gt; Using round function in QGIS expression? I created a grid of rectangular polygons with the Create Grid function, from the Vector Creation group of the Processing Toolbox in QGIS 3.4.2. The rectangles measure half a degree of longitude by half a degree of latitude.    When I want to label the polygons, I write an expression that rounds the values of latitude and longitude attributes to 2 decimal places, since the attributes created in the grid brings many decimal places.    But the round function rounds the values badly.    I know that I can create new attributes that express the coordinates with fewer decimal places and label the entities based on those attributes, but I was struck by the behavior of the function. I expected it to round to the nearest value.    Does anyone know what the problem is that the round function wrongly rounds off the decimal number?    Attached screenshots of Source Fields and the Attribute Table. Let $a$ and $b$ be two integers such that $\left(a,b\right) = 1$. Prove that $\left(a+b, ab\right) = 1$.   $(a,b)=1$ means $a$ and $b$ have no prime factors in common  $ab$ is simply the product of factors of $a$ and factors of $b$.  Let's say $k\mid a+b$ where $k$ is some factor of $a$.  Then $ka=a+b$ and $ka-a=b$ and $a(k-l)=b$.  So $a(k-l)=b, \  a\mid a(k-1)$ [$a$ divides the left hand side] therefore $a\mid b$ [the right hand side].  But $(a,b)=1$ so $a$ cannot divide $b$.  We have a similar argument for $b$.  So $a+b$ is not divisible by any factors of $ab$.  Therefore, $(a+b, ab)=1$.  Would this be correct? Am I missing anything? Suppose we have two functions, $f:X\rightarrow Y$ and $g:Y\rightarrow Z$. If both of these functions are onto, how can we show that $g\circ f:X\rightarrow Z$ is also onto? The Python docs say:     re.MULTILINE: When specified, the pattern character '^' matches at the beginning of the string and at the beginning of each line (immediately following each newline)... By default, '^' matches only at the beginning of the string...   So what's going on when I get the following unexpected result?  &gt;&gt;&gt; import re &gt;&gt;&gt; s = """// The quick brown fox. ... // Jumped over the lazy dog.""" &gt;&gt;&gt; re.sub('^//', '', s, re.MULTILINE) ' The quick brown fox.\n// Jumped over the lazy dog.' How do I use jpnevulator to capture and log the serial traffic between an application and hardware serial port? OK, I've been googling for hours so I obviously have not been able to understand the answers to the various questions that have already been asked about this subject.  I am hoping that, by asking the question again in a more specific way, I will be able to get an answer I can understand.  I have some application running in linux that communicates with an external device attached to a serial port.  I want be able to capture and log the data sent in both directions between the application and the device, with timestamps at the beginning of each line in the file.  As a test case, I am using minicom as the application I want to monitor, connected via a null modem cable to another computer also running minicom.  I have already confirmed that, if I type characters on either of the computers, characters appear in the other computer's terminal.  So far, so good.  I then found this question:    In the answer to this question, the program jpnevulator is suggested.  However, when reviewing the man page, I could not figure out the right way to use jpnevulator to get what I want.  Here is what I tried to do:  First, I opened a terminal window and typed the following command:  $jpnevulator --tty=/dev/ttyS0 --pty --pass --read --ascii --timing-print --file=serial.log   I saw the output:     jpnevulator: slave pts device is /dev/pts/18  I then opened another terminal window and typed the following command:  minicom -D/dev/pts/18 -b115200   Minicom opened without complaint.  However, when I typed characters in either terminal (local and remote), nothing appeared in either terminal.  jpnevulator only logged the data written to /dev/pts/18.  My expectation is that jpnevulator :   reads data from /dev/pts/18 and "passes" this data on to /dev/ttyS0 while also writing this data to the specified file. reads data from /dev/ttyS0 and "passes" this data on to /dev/pts/18 while also writing this data to the specified file.   I am aware of the remark in the faq that says "Jpnevulator was never built to sit in between the kernel and your application. I'm sorry."  However the very same faq states in the second paragraph down: "Now with a little bit of luck some good news: A little while ago Eric Shattow suggested to use pseudo-terminal devices to sit in between the kernel and your application."  That is the approach I am trying to take but I am having no success.  What am I missing?  Thanks to all in advance.  Cheers, Allan  p.s. I was successfully able to capture the back and forth traffic using the socat method mentioned in the existing question I referenced but this method did not offer any way of timestamping the traffic.  I was hoping that jpnevulator would have provided this for me. How to make 7-zip do a whole bunch of folders Why did $id disappear after the EOF I came across this strange limit whilst showing convergence of a series: $$\lim_{n \to \infty}\sqrt[n]{\frac{2^n+3^n}{3^n+4^n}}$$ How can I calculate this limit? Who created the veil in the death chamber, and why? Was the veil created by someone or was it always there in HP? What is its purpose? If one can't communicate with the dead through the veil, then what/how do unspeakables learn from the the veil? (except investigating how does it flutter,I suppose,,,,)