Is a Virtual Terminal the terminal that you get when you type Ctrl+Alt+F#, and which is represented by the file /dev/tty#.  While a Pseudo Terminal is a terminal that actually runs "inside" a tty, for example: gnome-terminal, xterm, etc. And which is represented by the file /dev/pts/#.  Am I correct?
I think these terms almost refer to the same thing, when used loosely:   terminal shell tty console   What exactly does each of these terms refer to?
Are there any downsides to passing structs by value in C, rather than passing a pointer? Are there any downsides to passing structs by value in C, rather than passing a pointer?  If the struct is large, there is obviously the performancd aspect of copying lots of data, but for a smaller struct, it should basically be the same as passing several values to a function.  It is maybe even more interesting when used as return values. C only has single return values from functions, but you often need several. So a simple solution is to put them in a struct and return that.  Are there any reasons for or against this?  Since it might not be obvious to everyone what I'm talking about here, I'll give  a simple example.  If you're programming in C, you'll sooner or later start writing functions that look like this:  void examine_data(const char *ptr, size_t len) {     ... }  char *p = ...; size_t l = ...; examine_data(p, l);   This isn't a problem. The only issue is that you have to agree with your coworker in which the order the parameters should be so you use the same convention in all functions.  But what happens when you want to return the same kind of information? You typically get something like this:  char *get_data(size_t *len); {     ...     *len = ...datalen...;     return ...data...; } size_t len; char *p = get_data(&amp;len);   This works fine, but is much more problematic. A return value is a return value, except that in this implementation it isn't. There is no way to tell from the above that the function get_data isn't allowed to look at what len points to. And there is nothing that makes the compiler check that a value is actually returned through that pointer. So next month, when someone else modifies the code without understanding it properly (because he didn't read the documentation?) it gets broken without anyone noticing, or it starts crashing randomly.  So, the solution I propose is the simple struct  struct blob { char *ptr; size_t len; }   The examples can be rewritten like this:  void examine_data(const struct blob data) {     ... use data.tr and data.len ... }  struct blob = { .ptr = ..., .len = ... }; examine_data(blob);  struct blob get_data(void); {     ...     return (struct blob){ .ptr = ...data..., .len = ...len... }; } struct blob data = get_data();   For some reason, I think that most people would instinctively make examine_data take a pointer to a struct blob, but I don't see why. It still gets a pointer and an integer, it's just much  clearer that they go together. And in the get_data case it is impossible to mess up in the way I described before, since there is no input value for the length, and there must be a returned length. In a tic-tac-toe implementation I guess that the challenging part is to determine the best move to be played by the machine.  What are the algorithms that can pursued? I'm looking into implementations from simple to complex. How would I go about tackling this part of the problem? Which is more polite, "Would you" or "Could you"? Suppose you want to ask someone to do something, say to tell you the way to a station. Which is more polite, "Would you tell me the way to the station?" or "Could you tell me the way to the station?"? Merging folders with mv? I develop an application in which i constantly get samples of heart pulse.  I defined an interval of t seconds.  In each t seconds I have n samples.  In every interval, I want to calculate the tendency of those n samples. For example, lets say I have n = 5, and I have samples with values {70, 88, 95, 103, 115}. I want to recognize I have a growth in the heart pulse, and I want to have some measure for the rate of grows/decrease/almost no change.  I thought on two approaches for solving this problem.   I calculate the linear approximation for the n samples using linear regression by applying least squares implemented by the normal equations. (I treat each sample as two coordinates vector with x coordinate as time and y coordinate as heart pulse). I get from the normal equations a linear function of the form y = mx+b and my measure for the tendency is the slope, i.e. the m value. The second approach is to calculate the correlation (pearson's correlation) between vector x and vector y when x is the time and y is the heart pulse.   I'm asking which approach do you think is better for my problem (determining the tendency of heart pulses). Or, do you have a better algorithm for solving this problem? How can I correct a reviewer's opinion? My edit to an answer was accepted by two of the three reviewers, with the third rejecting with a claim that part of my edit was incorrect.  In fact, my proposed edit was entirely and demonstrably correct, and the reason given for rejecting is invalid.  How can I let that reviewer know about their error, and have them change their review to "Accept" - changing stats for both of us?  Please note:  This is not the same question as asking for an appeal of an edit that was rejected.  It's asking what I can do about one of the three reviewers, a dissenter who voted against my edit based on their incorrect information. Show that every group of prime order is cyclic Find objects between two dates MongoDB 'locate' command in terminal. Why is it so fast? Explicit norm on $\mathcal{C}^0(\mathbb{R},\mathbb{R})$ Do you know an explicit norm on $\mathcal{C}^0(\mathbb{R},\mathbb{R})$? Using the axiom of choice, every vector space admits a norm but have you an explicit formula on  $\mathcal{C}^0(\mathbb{R},\mathbb{R})$?  A related question is: Can we proved that $\mathcal{C}^0(\mathbb{R},\mathbb{R})$ has a norm without the axiom of choice? Is Adzerk safe / legitimate? I am considering buying my first DSLR.  How do I know whether I need a 18-200 lens, 17-85, or 18-55? Or something else? Valid US visa on expired passport. Can I travel to the US? My old passport is in my maiden name and has already expired. My B1/B2 visa to travel to United States is still valid but is stamped in my old passport with my maiden name.   My new passport has my new name (old name got changed after marriage) but has details (like old passport number, father and mother's name) related to my old passport.    Will I be allowed to travel to US as long as I carry the my old as well as new passport?  Or Do I need to again get the visa stamped on my new passport? Applications of complex numbers to solve non-complex problems Recently I asked a question regarding the diophantine equation $x^2+y^2=z^n$ for $x, y, z, n \in \mathbb{N}$, which to my surprise was answered with the help complex numbers. I find it fascinating that for a question which only concerns integers, and whose answers can only be integers, such an elegant solution comes from the seemingly unrelated complex numbers - looking only at the question and solution one would never suspect that complex numbers were lurking behind the curtain!  Can anyone give some more examples where a problem which seems to deal entirely with real numbers can be solved using complex numbers behind the scenes? One other example which springs to mind for me is solving a homogeneous second order differential equation whose coefficients form a quadratic with complex roots, which in some cases gives real solutions for real coefficients but requires complex arithmetic to calculate.  (If anyone is interested, the original question I asked can be found here: )  EDIT:  I just wanted to thank everyone for all the great answers! I'm working my way through all of them, although some are beyond me for now! Show that $a(-1) = (-1)a = -a $. Why is it that a sequence in a closed, bounded interval [a, b] is a bounded sequence? What is the formal proof of this proposition from the definition of a bounded sequence? How to limit current of an AC signal For my project, I'm trying to work with the principle of electrovibration. This principle is about simulating textures using low current electricity on an insulated conductive surface ().  In order to do this, I will be experimenting with generated AC signals of 80 to 160 Vpp at 60Hz to 400Hz. I will do this by using an DC - AC converter, usually used for EL lamp applications.  My only concern is how to limit the current coming from the converter. Are the techniques for limiting AC current the same as DC, by using a simple resistor? Or is it, as I expect, more complex?  I need to limit the current to 0.5mA, for safety reasons. This problem is quite easily solved by using logarithms and derivative and forming the function $f(x,y) = x^y - y^x$, however there are assertions that this problem can be solved without using either of the two. I can not see how one would proceed to solve this problem in the absence of logarithmic manipulation and differentiation. Can anyone shed some light on this? I have a Linux instance that I set up some time ago.  When I fire it up and log in as root there are some environment variables that I set up but I can't remember or find where they came from.     I've checked ~/.bash_profile, /etc/.bash_rc, and all the startup scripts.  I've run find and grep to no avail.   I feel like I must be forgetting to look in some place obvious. Is there a trick for figuring this out? Dump of my own Stack Exchange content Is there a way to quickly save all my Stack Exchange content across all Stack Exchange sites, as hundreds of HTML pages? (for me probably 15 or 20 sites: SO, dsp.SE, unix.SE, etc.)?  The ideal way would be one .HTML file for each question that I asked / answered / commented? What would be the ideal tool for that?    Remark: I've already read interesting questions like  but it doesn't exactly answer my concern here.