How do I adjudicate attempting to put manacles on an unwilling creature?

I have a player in my campaign who has recently wanted to use manacles. While the Player's Handbook entry for  describes in a pretty detailed way how difficult it is to escape from manacles, it  an unwilling creature, particularly in the chaos of lots of things happening at once that we call combat.  But that's okay: I'm a DM, and I can make something up. But I feel that I'm not really sure how to assess the difficulty of this, especially as I have no idea about how manacles actually worked in the medieval era that D&D is inspired by, beyond a general idea that "it's an old-fashioned form of handcuffs". Here are a few ideas I have:   Treat this as an improvised-weapon melee attack roll. While there really isn't a "called shot" mechanic in D&D 5e, this may be roughly the difficulty of trying to hit somebody with a stick, or maybe impose disadvantage due to the difficulty of needing to specifically get the manacles over the wrists. I'd probably require a separate attack for each wrist. That is, when a hit with manacles happens, one wrist gets enclosed in the manacles rather than it dealing damage. Treat this as a contest similar to a grapple. The rules specifically call out that  one can do. Using Strength for the character attempting to place the manacles makes some amount of sense as it's trying to "" to solve a problem, though allowing use of a proficiency in Athletics seems a little odd as it's not really a "wrestling" kind of move, and in fact the finesse needed to place the manacles where needed might almost make sense as a  check instead. For the creature attempting to avoid getting the manacles, opposing with their choice of Strength (Athletics) or Dexterity (Acrobatics) as in a grapple still seems to make sense to me. This probably would also require a separate contest per wrist. Maybe manacles aren't just "slap them on" like modern handcuffs might be. I should just disallow any attempt to put manacles on an unwilling or unrestrained creature.   How should I handle players attempting to put manacles on an unwilling creature during combat? I know that this may be a bit subjective, and I can ultimately do anything reasonable here without the world ending, but I'm hoping there are some  answers out there of people who can "back it up" with their experience of handling either manacles specifically (as I'm guessing this isn't the only group with a player who saw manacles on the equipment list and started getting ideas), or at least experience with creating new "contests" that inhibit opponents.


Solaris 9 - Word Count (wc) command gives wrong output with 'grep -v and ps'

When i use 'ps', 'egrep' and 'wc' command to count number of processes, it gives me wrong value. I am running the command in 'Solaris 9' machine.   MyServer $ ps -fu root | egrep -v 'bash|ksh|ssh|ef|mailx|nohup|defunct|ps|sh|FND'      UID   PID  PPID  C    STIME TTY      TIME CMD  root 16267 16171  0   Jan 28 ?        0:18 xyz  root 16269 16171  0   Jan 28 ?        0:07 abc  root 16268 16171  0   Jan 28 ?        0:07 ghi MyServer $   Only 4 (3 processes + header) lines shown in output. But when i use below command it returns the output as 5  MyServer $ ps -fu root | egrep -v 'bash|ksh|ssh|ef|mailx|nohup|defunct|ps|sh|FND' | wc -l        5   On the otherhand, when I echo the output to a file and count the number of lines, it works perfectly normal.  MyServer $ ps -fu root | egrep -v 'bash|ksh|ssh|ef|mailx|nohup|defunct|ps|sh|FND' >temp && cat temp | wc -l        4   More description related to 'egrep' and 'egrep -v':  Why does 'egrep' working properly without '-v' option? But not with '-v'?  MyServer$ ps -fu root | egrep '20755|13800'  root 20755 20751  0 12:14:29 pts/5    0:00 more -s /tmp/mpWGa4mO  root  1223 26407  0 12:57:28 pts/15   0:00 egrep 20755|13800 MyServer$ ps -fu root | egrep '20755|13800' | wc -l        2 MyServer$  MyServer$ ps -fu root | egrep -v 'usr|apps|sql|sh'      UID   PID  PPID  C    STIME TTY      TIME CMD  root  3448 26407  0 12:57:42 pts/15   0:00 ps -fu root  root 20755 20751  0 12:14:29 pts/5    0:00 more -s /tmp/mpWGa4mO MyServer$ ps -fu root | egrep -v 'usr|apps|sql|sh' | wc -l        4 MyServer$


I have got myself a dxf which is built with units in the wrong scale. How do I upscale that in QGIS?   Note it does open in QGIS, just in the wrong map units and location.


Does rolling friction increase speed of a wheel?

I know there are a lot of questions about rolling friction, but I couldn't find any that addressed my specific problem.  Note the following picture where the wheel rotates clockwise. The rolling friction force $\vec{F}_R$ points in the same direction as the rotation.   Normally, rolling friction inhibits the movement (speed $\vec{v}$) of the system. However, since the force is pointing in the "backward" direction, it looks like it is increasing the speed of the wheel. Therefore, it should accelerate the system. This seems unintuitive to me. Can someone please clarify this contradiction?   Thanks!    Update:  Based on the comments and answers, I have reconsidered the diagram and terminology. I mean rolling resistance and no static friction. The deceleration force caused by deformation (and other reasons). In the diagram above, this force is divided into its x- ($\vec{F}_r$) and y- ($\vec{N}$) components.  $\vec{v}$ is not independent of $\omega$ for pure rolling, since $v=R\cdot\omega$. To me, it looks like the resistance $\vec{F}_R$ that slows down the system accelerates $\omega$. And because of the kinematic connection between $\omega$ and $\vec{v}$, the latter must also increase. That's illogical, but I don't understand the reason. Maybe some comments or answers have already addressed that, but I don't understand :( This is really confusing.


Example of heavy-tailed distribution that is not long-tailed

From readings about heavy-, and long-tailed distributions, I understood that all long-tailed distributions are heavy-tailed, but not all heavy-tailed distributions are long-tailed.  Could somebody please provide an example of:   a continuous, symmetric, zero-mean density function that is long-tailed a continuous, symmetric, zero-mean density function that is heavy-tailed but not long-tailed   so I can better understand the meaning of their definitions?  It would be even better if both could have a unit variance.


What would happen to my Intelligence score if I am affected by Feeblemind and attuned to a Headband of Intellect?

The description of the  says:     Your Intelligence score is 19 while you wear this headband. It has no   effect on you if your Intelligence is already 19 or higher.   The  spell description says that my Intelligence score becomes 1 on a failed save:     [...] On a failed save, the creature's Intelligence and Charisma   scores become 1. The creature can't cast spells, activate magic items,   understand language, or communicate in any intelligible way. [...]   If I am affected by Feeblemind and I am wearing the Headband of Intellect, would I have an Intelligence score of 19 or 1?   Also, what about the other effects like not being able to cast, activate magic items, understand languages or communicate in any way? Those seem Intelligence-related, but are mentioned additionally to the reduction.   If the Intelligence score becomes 19, are the other effects still active?


I have a ton of music on my computer, but unfortunately it's in m4a, and steam only takes mp3.  Is there a program or a terminal command that will convert an entire folder?


Uncertainty principle implies the non-deterministic universe?

Does the uncertainty principle imply the non-deterministic universe, or just the fact that our model of the universe, the one based on observation, can be at most non-deterministic, since we will not be able to measure with perfect accuracy, even if such would exist (and therefore we will have to provide probability distributions rather than an event which should happen with overwhelming probability (term used by Terence Tao))?


Is there a more concise term for a long-term girlfriend/boyfriend than "significant other"?

I've been together with my boyfriend for around 9 years now. There are times when I want to communicate that I am referring to someone who plays a major role in my life, like that of a husband, and "boyfriend" does not seem adequate.  To me, "boyfriend" seems to signify a newer relationship, one that is still in the experimental phase.   I've tried out a couple of other words, but they don't seem to carry the meaning I want.   "Partner" seems too detached, and makes me think of business partners.  "Companion" makes me think of a dog.  "Lover" seems too casual and is not really something I'd want to use in the workplace or when I'm trying to appear professional.  "Significant other" is what I would like to say, but I dislike using the term because there are so many syllables and it seems so wordy.   Is there a shorter term to use to describe a long term boyfriend/girlfriend that fills the role of a husband/wife?


Is being a Cauchy sequence equivalent to $ \lim_{n\to+\infty}d(x_{n+k},x_n)=0$ for every $k$?

Is this statement true?      In a metric spase $(E,d)$, a sequence $(x_n)$ is Cauchy if and only if $  \forall k\in \mathbb{N}, \lim_{n\rightarrow+\infty}d(x_{n+k},x_n)=0$   I proved that $\Rightarrow$ is true,indeed if $(x_n)$ is Cauchy then for all $\varepsilon>0,\exists n_0\in\mathbb{N}, \forall p,q\geq n, d(x_p,x_q)<\varepsilon$ it still right for all $ n\geq n_0$ and $m=n+k>n\geq n_0$   But I don't know if $\Leftarrow$ is true ?


Cantor diagonalization and fundamental theorem

Can the Cantor diagonal argument be use to check countability of natural numbers? I know how it sounds, but anyway.  According to the fundamental theorem of arithmetic, any natural number can be expressed as an unique product of primes.  if we denote primes $2,3,5,\ldots$ as $P_1,P_2,P_3,\ldots$ and include $1$ as part of the system, we will get,  $$D = [1, P_1, P_2, P_3,\ldots]$$  we can write any natural number as series of $[d]$ that goes on forever, as we can keep on appending $1$ to any product of primes forever.  for example $6$ is $2 \cdot 3 \cdot 1 \cdot 1 \cdot 1 \cdot 1 \cdot 1.....$  Now, we use the Cantor diagonalization, and enumerate all possible combinations of D.  $$1 - D_{11}, D_{12}, D_{13}, D_{14}, ...$$ $$...$$ $$n - D_{n1}, D_{n2}, D_{n3}, D_{n4}, ...$$ $$...$$  Can we show that there is another number that is not in the list? If we assume that there is a function, $\operatorname{Next}(D)$, that gives as the next element in $[D]$.  $$P_1 = \operatorname{Next}(1)$$ $$P{n+1} = \operatorname{Next}(P_n)$$  since there is always the next prime, we can construct,   $$m = \operatorname{Next}(D_{11}) \cdot \operatorname{Next}(D_{22}) \cdot \operatorname{Next}(D_{33}) \cdot \operatorname{Next}(D_{44})...$$  This is analogous to adding $1$ to diagonal elements applied to real numbers.  From the same diagonalization argument this number, '$m$' cannot be in the list. It is a contradiction, and natural numbers aren't countable...  Can someone point on a rigurous discussion of such a reasoning?  Thanks!


Chapter without number has incorrect header

I am including a chapter without a number using \chapter*{...}. However, for some reason, when I do this it displays the wrong header on the next page. See the MWE below. On page 2 it should say 'Introduction' at the top right hand corner. But instead, it says 'List of Tables' currently. Is there a solution to this?    My code:  \documentclass[12pt,twoside,openright]{report} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage{microtype} \usepackage{blindtext} \usepackage{emptypage} \usepackage{newtxtext}  \usepackage[a4paper,top=30mm,bottom=30mm,inner=30mm,outer=20mm]{geometry} \usepackage{titlesec} \usepackage{sectsty}  \usepackage{fancyhdr} \usepackage{setspace} \setstretch{1.36} \usepackage{tocbibind} \usepackage[titles]{tocloft} \usepackage{hyperref}% load after the other packages  \renewcommand{\cftchapfont}               {\usefont{T1}{qhv}{b}{n}\selectfont}  \titleformat{\chapter}[display] {\normalfont\huge\bfseries\fontfamily{qhv}\selectfont}{\chaptertitlename\ \thechapter}{15pt}{\Huge}[\vspace{0.8ex}{\titlerule[2pt]}]  \allsectionsfont{\fontfamily{qhv}\selectfont}  \makeatletter % Removes the word 'Chapter' \renewcommand{\@chapapp}{} \makeatother   \pagestyle{fancy} \fancyhead[LE,RO]{\thepage} \fancyhead[RE]{\nouppercase{\leftmark}} \fancyhead[LO]{\nouppercase{\rightmark}} \fancyfoot[CE,CO]{} \fancyfoot[LE,RO]{} \setlength{\headheight}{30pt}  \begin{document} \pagenumbering{roman} \tableofcontents \listoftables  \cleardoublepage \pagenumbering{arabic}  \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction}   \blindtext[5]  \chapter{First Numbered Chapter} \section{Example section} \subsection{Example subsection} \blindtext[10] \end{document}


Is off-label prescribing completely prohibited? Can a drug be prescribed by doctors for a disease or condition for which FDA has not approved it and hence this condition is not listed on the label? It is presumed that this disease or condition is not explicitly listed as a contra-indication, i.e. when the drug is clearly stated to be avoided since it may be harmful.


How can I fix broken linked dupligroups when the source file/directory has changed?

(Using Blender 2.76) I have some object groups from one file (source) linked as dupligroups in another file (target). I had to change the name of the subdirectory containing the source file, and the name of the source file itself, so the links in the target file broke (as expected; even relative file paths wouldn't have helped with the renamed file/directory). So now when I open the target I get the error messages stating missing data, and all the dupligroups are just empties (empty empties that is) showing no mesh that they did before the name changes.  I think it will be easier to split this into two questions:   How do you fix a broken dupligroup link when the path to the source file (directory name/s) has changed? Like this: //directoryA/source.blend changed to //directoryB/source.blend How do you fix a broken dupligroup link when filename of the source .blend file has changed? Like this //directoryA/oldSource.blend changed to //directoryA/newSource.blend   But of course I have to fix both of these things.  The reason I split that into two questions is because I did some tests and had different results depending on whether the intermediate directories names had changed (changed path) or whether the actual source filename had changed (changed filename). I had two ideas that both failed:  Idea 1 (failed):   Go to file/External Data Find Missing Files   Changed Path: For the changed path this got the error message about missing data to stop displaying upon .blend file opening and when using File/External Data/Report Missing Files, but the dupligroups were still empty!  Changed Filename: For the changed source filename this did not get rid of the error messages or fix the dupligroups.  Idea 2 (failed):   Go to the outliner Select "Datablocks" in the pulldown Expand the "Libraries/lib" item Change the "File Path" field to reflect the new subdirectory/filename (For this selecting the file path input box in the menu does not open a file selector or anything, so I just typed in the new path/filename manually and hit enter. Maybe I'm doing that wrong?)   Changed Path/Changed Filename: It failed for both. The dupligroups were still empty. I did try restarting the file to see if they needed to be restarted to show the dupligroup mesh, but it didn't help.  However, it's interesting to note that when trying Idea 1 (Fix Missing Files) and then trying Idea 2 (Libraries/Lib) the Fix Missing Files option did fix the path in Libraries/Lib so it appeared correct, it just didn't fix the dupligroups.  I'm using Using 2.76b, but I know I had this same problem with an older version of Blender. That was a while ago and I just gave up and re-linked the dupligroup. That's okay for a couple dupligroups, but in a big scene with dozens of dupligroups that have all been moved/rotated to specific positions this becomes a big deal.  I get the feeling I must be missing something really obvious because I'm sure this is a common problem. Any ideas would be appreciated. Thank you.


I want my vote hover/popup back on the top bar!

I don't mind the new top bar, but when the new topbar was tested on meta.SO, it was widely requested to include the popup window that used to show up when you hovered over the username.  (In case it's not clear, I'm talking about the popup window that used to show day/month/year Votes cast, Reputation changes, etc.)  I particularly miss the daily vote count, it's a huge hassle for me to check how many times I've voted on a day, I have to go to my profile page and usually wait for some caching to catch up.  Even though I've been reading meta.SO every day, I haven't seen anything about adjustments being made to the new topbar based on feedback there, so I thought I'd post here.  If there's anything else you don't like about the new top bar, feel free to include it in an answer or a separate post.  I don't think SE staff will actually pay attention, but you never know...


Prove $(|x| + |y|)^p \le |x|^p + |y|^p$ for $x,y \in \mathbb R$ and $p \in (0,1]$.  A hint is given that for $0 \le \alpha \le \beta$ there exist a number $\xi \in (\beta, \alpha + \beta)$ s.t. $$(\alpha + \beta)^p - \beta^p = p \xi^{p-1}\alpha \le \alpha^{p}$$.  I see that by proving the above hint the result holds for positive numbers.  In order to prove the above hint I've considered the Intermediate value theorem, however I've not yet succeeded.


Is there a simpler or better way of saying "promises that hold no meaning"?

Is there a simpler or better way of saying "promises that hold no meaning" or "promises without meaning"?


How to find the sum of infinite series $\sum_{n=0}^{\infty}nx^n$? I have no clue where to begin with.


def f(x):     result = x**2+(x/2)     return(result)   for x in range(0.1, 0.10, 0.001):     print(f(x))     that's my code in python, but show this error:  TypeError: 'float' object cannot be interpreted as an integer


Proving $2^n<n!$ using simple induction.

I have this statement:  Which I represent using the predicate P(n).  In order to prove this I have to provide a 'first' case which satisfies this expression. Which in this example is 4. Because every value greater than or equal to 4 will indeed support the statement. Then prove the fact for n+1... but I am really confused about how is the proof structure.  I need to write a proof... and in proofs the steps have to be justified, and choosing a random value of n = 4 won't be ok without its respective justification, so what could I put there?


How do I turn down postdoc offer for an industry job?

So I am in a bit of an unusual situation. I will be graduating this summer and I have been in touch with a professor for a couple of months about postdoc positions in his research group. He encouraged me to write proposals for fellowships to fund my postdoc stint with him. Since these fellowships were very competitive and I stood a low chance of getting them, he promised me a year of funding if none of the fellowships came through. Unfortunately, none of them came through. We talked about the situation last week and he suggested that I join his group and write grant proposals during the first year to fund my second year. Now that seems like a very bad idea to me because I am also supposed to publish papers and plan for what comes after my postdoc. It's also problematic because I am an international student in the USA and I would go out of legal visa status pretty fast if things go bad and I become unemployed after my first year.   I haven't expressed any of these concerns to the professor yet [my fault, I was too shy]. However, I have been applying to industry jobs on the side and was recently made an exciting job offer. I have about a week to sign their papers which I intend to do. My question is, how do I communicate all of this to the professor? He is a very nice guy, seems super helpful and is a big name in the field but going the postdoc route seems risky and stressful at this point.


Let $V,W$ be subspaces of vector space $U$ where $U=V+W$. Now, my question is if it is true that if $X$ is a subspace of U, then $X=(X\cap V)+(X\cap W)$? I think this should be true since the direct sum $V\oplus W$ is a smaller set than $V+W$ which covers the space U. Could someone please help prove or counterexample for why this is or isn't always true? Thanks.


I wonder the condition of A to make the following statement true: $\det(e^{tA})=e^{t\cdot{tr} (A)}$, where A is an $n\times n$ matrix. If A is diagonalizable, then the statement can be proved. So, will the statement holds for A which isn't diagonalizable? I have tried using the Jordan form, but it is too complicated to obtain the result. Thank you!


How do I get back my Nautilus folder browser?

The Nautilus that I get on pressing Super-E is now missing the left-hand folder-browse panel. All I have is the right-hand  panel listing files and folders inside a given folder.  How do I get back  the left-hand panel?  (Ubuntu 18.04.1)


I've been using Javascript's Date for a project, but noticed today that my code that previously worked is no longer working correctly. Instead of producing Feb as expected, the code below produces March.   My code looks something like this:   current = new Date(); current.setMonth(current.getMonth()+1); //If today is Jan, expect it to be Feb now   This code worked everyday up until today. Is this a Javascript bug or am I going about this the wrong way?


Ho to upgrade Ubuntu 12.04 to Ubuntu 13.10?

I have to upgrade an Ubuntu 12.04 to the last stable Ubuntu 13.10 but I have some doubts about how do it:  1) The first doubt is related to the fact that reading online seems that is not a smart thing update directly from 12.04 to 13.10 but I read that is better do it by steps:  from 12.04 to 12.10, then from 12.10 to 13.04 and finally from 13.04 to 13.10  Is it true?  2) Trying to perform the previous operation (the update from 12.04 to 12.10) following this official tutorial:   I have followed the previous tutorial and I have activate the notification "For any new version" of the system but in the Update manager appear to me a strange thing, infact it say to me that is available the new 14.04 release  Reading online I see that 14.04 will be the new LTS and that this will be available in April of 2014, so what is this? is it a beta version or something like this?  I can't chose to upgrade to 12.10 or 13.10.   What can I do to upgrade my system to the last stable version?  Tnx  Andrea


Non-parametric test for repeated measures and post-hoc single comparisons in R?

Some attribute $x$ of 17 individuals was recorded repeatedly on 6 time points using a Likert scale with 7 distractors. Which statistical test(s) can I apply to check whether the changes along the 6 time points were significant?  set.seed( 123 ) x <- matrix( sample( 1:7, 17*6, repl=T ),    nrow = 17, byrow = TRUE,   dimnames = list(1:17, paste( 'T', 1:6, sep='' )) )   I found the Friedman test and the Quade test for testing the overall hypothesis.  friedman.test( x ) quade.test( x )   However, the R help files, my text books (Bortz, Lienert and Boehnke, 2008; Köhler, Schachtel and Voleske, 2007; both German), and the Wikipedia texts differ in what they propose as requirements for the tests. R says that data need to be unreplicated. I read 'unreplicated' as 'not-repeated', but is that right? If so, the example, in contrast, in friedman.test() appears to use indeed repeated measures. Yet, Wikipedia says the contrary that is to say the test is good especially if data represents repeated measures. The text books say either (in the same paragraph, which is very confusing). What is right?  In addition, what would be an appropriate test for post-hoc single comparisons for the indication which column differs from others significantly?  Bortz, Lienert, Boehnke (2008). Verteilungsfreie Methoden in der Biostatistik. Berlin: Springer Köhler, Schachtel, Voleske (2007). Biostatistik: Eine Einführung für Biologen und Agrarwissenschaftler. Berlin: Springer


Surjective endomorphism of abelian group is isomorphism

Let $A$ be a finitely generated abelian group and $f:A\rightarrow A$ a surjective homomorphism. How do I prove that $f$ is an isomorphism?  And if $f$ were injective instead of surjective would the statement still hold?


How to get field collection value in tpl file in drupal 7?

I have created a content type and take field collection for some field. Within field collection I have taken 4 select box. Now I need to get these select box value in content type tpl file. For this I am using this code : $wrapper = entity_metadata_wrapper('node', $node_data);  but its not giving me select box option value.


Both the ratio test and the root test define a number (via a limit).  If both limits exist (and shows that the series is convergent), what (if any) is the relation between the 2 numbers ? are they equal ?  What is the relation (if any) between them and the original series (other than the fact that they say the series is convergent) ?


How to detect CAPS-Lock and make sure it's always disabled

Well, you might be wondering why the use of having caps-lock always enabled no matter what. Well, for starters, I have a barcode scanning system that scans alphanumeric barcodes which includes small case and upper case letters, etc etc. When the barcode scans, the input captures the characters and verifies the barcode and does other stuff. This has caused me quite a few problems as some users have caps-lock on for x,y reason and of course, when they scan items, all the characters become capitalized and nothing works from there.  My question, is there a way to be able to "disable" (might be the wrong choice of words) the caps lock or perhaps turn it off if it's on. Essentially it would be ideal if it's detected as soon as there's an TextChanged event happening to make sure it's always off.      private void barcodeVal_TextChanged(object sender, EventArgs e)     {          //check if caps lock is on. if it is, turn off and evaluate barcode     }   Is where the it would need to happen.


The Projection Matrix is Equal to its Transpose

By inspecting its formula one can see easily that the matrix for projection onto a subspace is equal to its transpose.  But what is the underlying "geometric" reason for this equality?  I have hard time figuring out why it has to be so?  EDIT: After reviewing the suggested links, it became more clear, but the reasoning was still escaping my intuition.    However, I think that I can (based on the formal arguments in the links) put forward a rough argument.  Basically, for any operator $A$ and two vectors $x$, $y$ $$<Ax,y>=<x,A^Ty>$$  For a vector $y$ in the orthogonal complement to the subspace S we're projecting onto using the $P^S$ projection operator, $$<P^Sx,y>=0=<x,(P^S)^Ty>$$ Because we took any vector $x$, it means that $(P^S)^Ty=0$.  As $y$ is in the orthogonal complement, $P^Sy=0$ this means that $$(P^S)^Ty=0=P^Sy$$ (in plain English, for any vector in the orthogonal complement to $S$ the action of $P^S$ makes it 0, which is a symmetric action).  For $y$ in $S$ and any $x$, $<P^Sx,y>=<x,y>$ and $P^Sy=y$ (by the properties of the projection operation), but also $<P^Sx,y>=<x,(P^S)^Ty>$ (true for any operator). Putting these together that yields that:$$(P^S)^Ty=y=P^Sy$$.  (in plain English, for any vector in $S$ the action of $P^S$ is the identity, which is a symmetric action).  To sum it up, this shows that the operator $P^S$ acts symmetrically on both elements of S and on elements in its orthogonal complement.  Being that it is a linear operator, then it acts symmetrically on all vectors $x$.  A big thing why this works (I think) is that the concept of projection implies (finite) dimension inner product space and that is much more structured than a simple (finite) dimensional vector space.  LAST EDIT: Even more clear after digesting the answer of Trial and Error. Given a subspace M to project onto, any vector $z_1$ can be written as the sum of two orthogonal components:  $$z_1= (z_1-P_{\mathcal{M}}z_1) + P_{\mathcal{M}}z_1,$$  But the key geometric thing is that these two components belong to orthogonal subspaces, M and $\perp M$ (any vector from one subspace is perpendicular on any vector from the other subspace).  The projection operator will leave the  component in M unchanged and annihilate the component in $\perp M$.  Because of the fact that the subspaces themselves are orthogonal the product of ANY two arbitrary vectors $z_1, z_2$  $$<z_1,z_2>=<(z_1-P_{\mathcal{M}}z_1) + P_{\mathcal{M}}z_1,(z_2-P_{\mathcal{M}}z_2) + P_{\mathcal{M}}z_2>$$ becomes (by the orthogonality of M and $\perp M$: $$<z_1,z_2>=<(z_1-P_{\mathcal{M}}z_1),(z_2-P_{\mathcal{M}}z_2)>+<P_{\mathcal{M}}z_1,P_{\mathcal{M}}z_2>$$  But applying $P_M$ annihilates/zeroes the first bracket and leaves unchanged the second bracket.  This holds whether we apply it to $z_1$ or to $z_2$.   Ergo the effect of $P_M$ is the same whether applied to the first of second term of the scalar product.  So its matrix should be equal to its transpose.  The bolded text indicates key issues that I was not fully appreciating before. Thank you for your patience!


Since solution of a heat flow problem means to determine the temperature distribution in a medium.Likewise i want to know that what the solution of wave equation depict?


Problem with \par in argument of a macro defined with \NewDocumentCommand

In following MWE, \newcommand is used to create \myFoo macro which just forwards its unique argument, then \NewDocumentCommand is used to create \myBar with the same behavior. The former accepts \par in its argument but not the latter. \documentclass{minimal} \begin{document} \newcommand\myFoo[1] { #1 } \myFoo {\par\noindent Foo } \NewDocumentCommand\myBar { m } { #1 } \myBar {\par\noindent Bar } \end{document}  There is an error that I do not understand at line 6 Runaway argument? { ! Paragraph ended before \myBar  was complete. <to be read again>                     \par  l.6 \myBar {\par                 \noindent Bar }  What is wrong here?


Where is attribute table in ArcGIS Desktop when not visible?

I've just updated to ArcGIS 10.1 for Desktop and when I go to open an attribute table, I can not see it anywhere.   I'm wondering if it is off my screen somewhere or if its just super tiny that I can't see it.   I'm using dual monitors and it's not popping up on either.  Is there a way I can find my attribute table?


Now, looking around on Google shows me some ways in which to customise the settings of the Guest session. But, I would love a way to change the name of the Guest account.  Basically, I'm planning to take some laptops out to a school in Africa and want to rename the "Guest" account in 14.04 to "Student" so the students use that. They tend to store stuff on USB sticks and they're using the Guest account so they can't break anything. EDIT: I'll expand on this slightly. They're using the guest account simply for the reason it doesn't save anything after logoff. This was a specific thing the teachers have asked for.  I don't mind if the actual username remains guest behind the scenes, but as long as it shows up as Student to on Unity. Any way of going about this?


"See your profile" link doesn't go to profile

In my "achievements" menu on the top bar, I was told that I earned a badge for a question, and to see my profile.    Anyway, the link took me to the post in question, not to my profile.  Maybe we should have the post title link to the post and "your profile" link to the profile?


/dev/tcp is often mentioned in many sources, and I think I saw it in Ubuntu not so long ago. Now, in Debian Jessie, I can't find it. The same with /dev/udp.  tomasz@E4200:/dev$ ls agpgart          dm-1     hidraw3       network_latency     sda2      tty11  tty24  tty37  tty5   tty62    vcs2   vfio autofs           dm-2     hpet          network_throughput  sda5      tty12  tty25  tty38  tty50  tty63    vcs3   vga_arbiter block            dm-3     hugepages     null                sg0       tty13  tty26  tty39  tty51  tty7     vcs4   vhci bsg              dm-4     initctl       port                shm       tty14  tty27  tty4   tty52  tty8     vcs5   vhost-net btrfs-control    dm-5     input         ppp                 snapshot  tty15  tty28  tty40  tty53  tty9     vcs6   watchdog bus              dri      kmsg          psaux               snd       tty16  tty29  tty41  tty54  ttyS0    vcs7   watchdog0 char             fb0      kvm           ptmx                stderr    tty17  tty3   tty42  tty55  ttyS1    vcsa   xconsole console          fd       log           pts                 stdin     tty18  tty30  tty43  tty56  ttyS2    vcsa1  zero core             full     loop-control  random              stdout    tty19  tty31  tty44  tty57  ttyS3    vcsa2 cpu              fuse     mapper        rfkill              tomas-vg  tty2   tty32  tty45  tty58  uhid     vcsa3 cpu_dma_latency  fw0      mcelog        rtc                 tty       tty20  tty33  tty46  tty59  uinput   vcsa4 cuse             hidraw0  mem           rtc0                tty0      tty21  tty34  tty47  tty6   urandom  vcsa5 disk             hidraw1  mqueue        sda                 tty1      tty22  tty35  tty48  tty60  vcs      vcsa6 dm-0             hidraw2  net           sda1                tty10     tty23  tty36  tty49  tty61  vcs1     vcsa7   Has it moved somewhere? (And why?) Does this apply to all Linuxes?  To make it complete, I'm on:  Linux E4200 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux   UPDATE   doesn't answer my question.  This answer:     When you used /dev/tcp/74.125.225.19/80 in a pipe, bash attempted to   run a command named /dev/tcp/74.125.225.19/80 and reported an error   because that file didn't exist.   doesn't tell me much about /dev/tcp. Neither the  linked.  I gather from the first answer to my question that /dev/tcp is a "virtual" folder. Please post a link that explains this. And if you know, please answer if this has always been so.


Is it possible to edit layers from a FGDB - File Geodatabse in QGIS?

I think I've found the answer (you can't edit FGDB's) but there seem to be few reports around that it is possible to edit FGDB files in QGIS.  Can anyone advise if it's possible to setup QGIS (presently 1.8) to edit FGDB's, and how?  It seems like this lack of editing ability could either be a bug in OGR or something to do with having to compile with the FGDB API (I've only ever used OS4GEOW to install QGIS etc).


Dragging layer into new file changes its size

Let's say I have a file that's 4'x12' and represents a space on an actual wall. I want to open certain files (of different sizes) and drag each file into the large file in order to arrange the images correctly on the computer before physically hanging the framed finals.  When I drag a new image into the larger file, the new image's size and the size of its copy don't match. That is, Say I drag an 8x10 into the large file, well on the large file (trying to control size with guides and rulers) the new image is some other size, but not the right one.   What am I doing wrong? How do I make sure that when I click and drag the new image that it will be properly represented?


Using the field of an object as a generic Dictionary key

If I want to use objects as the keys for a Dictionary, what methods will I need to override to make them compare in a specific way?  Say I have a a class which has properties:  class Foo {     public string Name { get; set; }     public int FooID { get; set; }      // elided }    And I want to create a:  Dictionary<Foo, List<Stuff>>   I want Foo objects with the same FooID to be considered the same group.  Which methods will I need to override in the Foo class?  To summarize: I want to categorize Stuff objects into lists, grouped by Foo objects. Stuff objects will have a FooID to link them to their category.


Can multiple Blackjack Aces have value 1?

What will be the value of this hand?  2, 9, A, 4, A   May it be 17? Or it must be 27?  In this situation can every Ace count as 1, or there must be one Ace as 11?


Strange issue with the right side margin

I am not sure why the margin on the right side of my document is unusually larger than usual. I am presenting an MWE where I have (unsuccessfully) tried to resolve the issue:  \documentclass[a4paper,11pt]{article} %\usepackage[utf8]{inputenc} %\usepackage[T1]{fontenc} %\usepackage[latin9]{inputenc} \usepackage{amsthm} \usepackage{amsmath} \usepackage{graphicx} \usepackage{mathtools} \usepackage{cite} \usepackage{enumerate} \usepackage[colorlinks=true,             linkcolor=red,             urlcolor=blue,             citecolor=gray]{hyperref} \usepackage{xcolor,listings} \usepackage{url} \usepackage[english]{babel} \usepackage{blindtext} \newcommand{\todo}[1]{\textcolor{red}{[#1]}} \oddsidemargin 0in \evensidemargin 0in \title{Assignment1} \author{Joe Schmoe} \date{} \begin{document}  \maketitle  \section*{Question 1} \blindtext \end{document}


In OLS is the vector of residuals always 0?

I am trying to show that  $$\sum_{i=1}^ne_i = 0$$  I have two hints, so to speak:  $$ HX = X$$ where $H$ is the hat matrix, and that $$\sum_{i=1}^ne_i = e'1$$  My solution is as follows:  $$e'1 = Y'(I-H)1=[(X\beta)' - (X\beta)'H]1=(\beta'X' - \beta'X'X(X'X)^{-1}X')1 $$ $$=(\beta'X' - \beta'X')1 = 01 = 0 $$  Seems simple enough but this implies that $e'$ and by extension $e$ is always a vector of zeros, which seems counter-intuitive.


Not allowing to specify a user in comment

i tried to add the queries in the comment ,but i couldn't able to tag the username.Even i tried adding it with "@" Why its so.? Is there any reputation limit needed for it.?


Republishing Intentionally Expired Job Listings

I want to expire a job listing I have on Careers because we are very close to hiring a particular candidate.  But if I do expire the job listing, can I republish it without cost should the candidate we intend on hiring not end up actually taking on the position?  There are still about 15 days left on the job listing, so I don't want to just lose those 15 days should I republish it later.


How to go from this equation in terms of cosine and sine to this one in terms of only one.

$$x=A\cos(\omega t)+B\sin(\omega t )\equiv\mu \cos(\omega t+\phi)$$  I'm thinking it must have something to do with the double angle forumla. Any help?


Site Stats widget that links to "more info" on stack exchange

I don't know how it's supposed to work, but I think it doesn't work at all right now.  Try clicking the lowest link in this widget:    I just get the list of all sites and on top of the page despite the anchor link in the url.


Is there a way to set initial state with rigid bodies?

Let's say I set up a Rigid Body simulation in Blender (not in GE), and then run the simulation for a number of frames. Is there a way to tell Blender to use the current state and position as the initial state? So that when I go back to frame 1, the rigid bodies stay in the same place they did in frame X.  For instance, if I want a pile of bricks, I first place the bricks in the air and then let them drop down on the ground, coming to rest. When they have come to rest, I want to use that position as the starting position.


Inserting timestamps into stream in bash

I have a stream of data I'm receiving on stdin and I would like to add timestamps onto the steam. Ideally every line I would like to replace the new line with the current epoch seconds  ... | sed "s/$/$(date +' %s')"/ won't work because it will just evaluate the date command once on command.  What can I do?


Eclipse Optimize Imports to Include Static Imports

Is there anyway to get Eclipse to automatically look for static imports? For example, now that I've finally upgraded to Junit 4, I'd like to be able to write:  assertEquals(expectedValue, actualValue);   hit Ctrl + Shift + O and have Eclipse add:  import static org.junit.Assert.assertEquals;   Maybe I'm asking too much.


I'm getting some errors when I try to implement a generic datatype to my class

I've been trying to search, but I can't quite find the answer to my problem. I feel like I've implemented my generic datatype correctly but I'm still getting an error.  I'm doing an exercise where I'm given constructors/methods and variables (so I can't change the variable inputs for instance), and now I have to write the constructors/methods to make them work. The program creates an array (objects) that can grow by adding elements to it, and the comments above each method in the code explains what they do.  When I try to create the arrays in my two constructors, I get the error "Variable must provide either dimension expressions or an array initializer" for the empty array and "Type mismatch: cannot convert from T[] to int".  In my "add" method I get the error "Cannot invoke add(int, T) on the array type T[]" and finally in my "toArray" method I get the error "Type mismatch: cannot convert from Object[] to T[]".  The common theme seems to be that I haven't implemented the generic datatype correctly, but no matter how many times I try to search for similar questions, I can't see how what I've done have been different.  When searching, I see many people say that an array can't "grow" and to instead use an ArrayList, however there has to be a way to solve this with just an array, otherwise you can't solve this exercise.  import java.util.ArrayList; import java.util.Arrays;  public class GrowingArray<T> {     private Object[] objects;     private int pointer;      //empty array     public GrowingArray() {         objects = new Object[];     }      //array that contains ds     public GrowingArray(T[] ds) {         objects = new Object[ds];     }         // add element e and return true     public boolean add(T e) {         pointer = 0;         objects.add(pointer++, e);         return true;     }      // return true if value d is found in the array     public boolean contains(T d) {         for(int i = 0; i <= objects.length; i++) {             if(objects[i] == d) {             }         }         return true;     }      // return the element on index i     public T get(int index) {         int i = index;         return objects[i];     }      // return first index containing d, if not found return -1     public int indexOf(T d) {         for(int i = 0; i <= objects.length; i++) {               if(d == objects[i]) {                   return i;               }           }           return -1;     }      // return last index containing d, if not found return -1     public int lastIndexOf(T d) {         for(int i = objects.length; i >= 0; i--) {               if(d == objects[i]) {                   return i;               }           }           return -1;     }      // return length of array     public int size() {         return objects.length;     }      // return a trimmed version of the array     public T[] toArray() {         return Arrays.copyOf(objects, objects.length);     } }


facing issue while populating/referencing the variable in shell

I have an input file which has data as shown below: name,local_unit,region_unit AAAAA,hour,cell BBBBB,15min,cell  Here is my shell #!/bin/bash  file_path='/home/vikrant_singh_rana/test_bq_file.csv'   {     read     while IFS=, read -r name local_unit region_unit     do         echo $name         echo $local_unit         echo $region_unit          ingest_tablename=ABC_XYZ_$name         echo $ingest_tablename         aggr_tablename=ABC_XYZ_$name_$local_unit_$region_unit_aggregation         echo $aggr_tablename      done } < $file_path  It is able to populate the table name for variable ingest_tablename and not for aggr_tablename Output as shown below: AAAAA hour cell ABC_XYZ_AAAAA ABC_XYZ_ BBBBB 15min cell ABC_XYZ_BBBB ABC_XYZ_


Choosing right context for property in viewport panel

I have a simple panel that you can see in the viewport which is a shorter version of UI Panel Simple. Seeing from other panels, by using Edit Source, they all define a context where the property is added, but how do I decide which one to use to get it working? Using Blender 2.92. import bpy from bpy.props import BoolProperty  class HelloWorldPanel(bpy.types.Panel):     bl_label = "Hello World Panel"     bl_idname = "OBJECT_PT_hello"     bl_space_type = 'VIEW_3D'     bl_region_type = 'UI'     bl_category = "Tool"      def draw(self, context):         layout = self.layout         row = layout.row()         row.label(text="Hello world!", icon='WORLD_DATA')   class QuickRename_PT_Panel(bpy.types.Panel):     bl_space_type = 'VIEW_3D'     bl_region_type = 'UI'     bl_label = "Quick Rename"     bl_category = "Tool"     bl_parent_id = "OBJECT_PT_hello"      testBool: BoolProperty(         name = 'Test',         description = 'Test description',         default = True,)       def draw(self, context):         layout = self.layout         layout.use_property_split = True         layout.use_property_decorate = False          tool_settings = context.tool_settings          row = layout.row()         row.prop(tool_settings, 'testBool')    def register():     bpy.utils.register_class(HelloWorldPanel)     bpy.utils.register_class(QuickRename_PT_Panel)   def unregister():     bpy.utils.unregister_class(QuickRename_PT_Panel)     bpy.utils.unregister_class(HelloWorldPanel)   if __name__ == "__main__":     register()  I want to add the testBool property to the Hello World Panel.  But I think the tool_settings = context.tool_settings  is wrong.


Showing the annihilation of an electron-positron pair

How to show that the annihilation of an electron-positron pair under emission of one real photon (mass zero) is forbidden by energy-momentum conservation, the emission of two photons is allowed?


How to hide/remove left side dock in Ubuntu 18.04 LTS?

Please refer screenshot, I installed "Dash to Panel" gnome extension so that my dash and top panel appear in single unit. But the left side default dock is still there. How can I remove the left side dock? Thanks.


How can I generate large prime numbers for RSA?

What is the currently industry-standard algorithm used to generate large prime numbers to be used in RSA encryption?  I'm aware that I can find any number of articles on the Internet that explain how the RSA algorithm works to encrypt and decrypt messages, but I can't seem to find any article that explains the algorithm used to generate the p and q large and distinct prime numbers that are used in that algorithm.


How can I rewrite, the following triple integrals into different orders?: $$\int^1_0\int^{z^2}_0\int^y_0{f} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z$$ In the orders $\mathrm{d}z \, \mathrm{d}x \, \mathrm{d}y$ and $\mathrm{d}y\,\mathrm{d}z\,\mathrm{d}x$?  Currently the limits are: $$\begin{split} &0 \le x \le y \\ &0 \le y \le z^2 \\ &0 \le z \le 1 \end{split}$$


What is a periodic function that can calculate daylight hours of any given city at any given day?

I have tried many things using many different calculations, but unfortunately I can not figure out a periodic function that can calculate daylight hours of any given city at any given day.


$f:[a,b] \to [0, \infty)$ continuous , then $\lim_{n \to \infty} \Bigg(\int_a^b \big(f(x)\big)^ndx \Bigg)^{1/n}=\sup \{f(x):x \in [a,b]\}$ ?

Let $f:[a,b] \to [0, \infty)$ be continuous , then is it true that $\lim_{n \to \infty} \Bigg(\int_a^b \big(f(x)\big)^ndx \Bigg)^{1/n}=\sup \{f(x):x \in [a,b]\}$ ?


Help solve ${{z}^{3}}=\overline{z}$ ($z\in \mathbb{C}$)

Me and my friend try to solve   $${{z}^{3}}=\overline{z}$$  where $z \in \mathbb{C}$.  My way to solve it was:  $\operatorname{cin}(\theta )=\cos(\theta)+\sin(\theta)i$  \begin{align}   & z=r \operatorname{cin}(\theta ),\overline{z}=r\operatorname{cin}(-\theta +2\pi k) \\   & {{z}^{3}}={{r}^{3}}\operatorname{cin}(3\theta ) \\   & {{z}^{3}}=\overline{z} \\   & {{r}^{3}}\operatorname{cin}(3\theta )=r\operatorname{cin}(-\theta +2\pi k) \\   & {{r}^{3}}=r\Leftrightarrow {{r}^{3}}-r=0\Leftrightarrow r({{r}^{2}}-1)=0\Leftrightarrow r=\pm 1,r=0\Leftrightarrow r=1 \\   & 3\theta =-\theta +2\pi k\Leftrightarrow 4\theta =2\pi k\Leftrightarrow \theta =\frac{\pi k}{2} \\  \end{align}  So my solution for k=0,1,2 :  $\begin{align}   & {{z}_{1}}=\cos (0)+\sin (0)i=1+0i \\   & {{z}_{2}}=\cos (\frac{\pi }{2})+\sin (\frac{\pi }{2})i=0+1i \\   & {{z}_{3}}=\cos (\pi )+\sin (\pi )i=-1+0i \\  \end{align}$  My friend on the other hand solve it like this:  $\begin{align}   & {{z}^{3}}=\bar{z} \\   & {{z}^{3}}\cdot z=\bar{z}\cdot z \\   & {{z}^{4}}=|z{{|}^{2}} \\  \end{align}$   He got the same solutions expect he got one more solution than me  ${{z}_{4}}=\cos (\pi )+\sin (\pi )i=0-i \\$   What is the right solution and why?


Can I eliminate the dot after Theorem in amsthm?

Instead of 1 Theorem. I want to write 1 Theorem in front of the first theorem and analogously in front of succeeding theorems. How can I get rid of the dot?  Here is a MWE:  \documentclass{article} \usepackage{amsthm} \swapnumbers \newtheorem{theorem}{Theorem} \begin{document} \begin{theorem} \end{theorem} \end{document}


Cannot change save location for Gnome screenshot on Ubuntu 18.04

I am on Ubuntu 18.04 LTS and default screenshot save location is in Pictures.  I don't want my Pictures folder to be flooded by my screenshot so I changed it to a folder called 'Screenshots'.  But pressing Prtscr button always saves screenshots on Pictures even after I changed it using dconf-editor.    But when I manually launch gnome-screenshot and take a screenshot, it asks for save location and saves to that location properly.  I even tried appending file:// before path but not working  Is there a way to change location I didn't know or is it a bug?


I'm not sure if this is the right place to ask this kind of question but here it is.  I'm making a board game where there is a deck of monster cards and I'm interested - is there some tool/script that allows to make images for cards from some text file that contains all the needed information (.txt, .xml or something else)? What i would like is something like:   1) make a .psd with labels for name and defense values (also background and other images that can be anything)  2) have some file that lists all the monsters names and defense values (where i can quicly change them and regenerate images from that)  Also you can add somehing new later both in psd and this file (like I/II/III for monster difficulty). Optionally - not just change text, but also images (that would allow to change icons from the file, ect.) #dreams  Is there some tool that allows for this kind of fast iteration?


Integral closure of $\mathbb{Z}$ in $\mathbb{C}$ is not finitely generated as a $\mathbb{Z}$-module

Let  $ \mathbb{Z}^{'}_{\mathbb{C}}$ be the integral closure of $ \mathbb{Z} $ in $ \mathbb{C} $, i.e. $ \mathbb{Z}^{'}_{\mathbb{C}}$ contains all complex roots of polynomials with integer coefficients and $1$ as the leading coefficient.  Prove that $ \mathbb{Z}^{'}_{\mathbb{C}} $ is not finitely generated as a $ \mathbb{Z} $-module.  My attempt: Suppose $ \mathbb{Z}^{'}_{\mathbb{C}}=\mathbb{Z}\alpha_{1}+...+\mathbb{Z}\alpha_{n} $ for some $ \{ \alpha_{i}\}_{i=\overline{1,n}} \subset \mathbb{Z}^{'}_{\mathbb{C}} $.  Let's take $ \alpha , \beta \in \mathbb{Z}^{'}_{\mathbb{C}} $ with minimal polynomials of degrees $ m $ and $ n $ respectively. We can construct a monic polynomial with integral coefficients $ P(z)=\prod(z-(\alpha_{i}+\beta_{j})) $ where $ \alpha_{i},\beta_{j} $ are the conjugates of $\alpha $ , $\beta $ and therefore the minimal polynomial of $ \alpha + \beta $ has degree $ \leq mn $.   I was thinking that the degrees of the minimal polynomials of the elements of $ \mathbb{Z}\alpha_{1}+...+\mathbb{Z}\alpha_{n} $ could be somehow bounded by a certain constant, whereas $ \mathbb{Z}^{'}_{\mathbb{C}}$ contains elements whose degrees of the minimal polynomials are arbitrarily large. I think this works when we are asked to prove that the set of all algebraic numbers $ \overline{\mathbb{Q}} $ is not a finitely dimensional $\mathbb{Q}$-vector space, but I don't know how to proceed in my case.  I would really appreciate any ideas, hints or solutions. Thank you very much!


Gram matrix invertible iff set of vectors linearly independent

Given a set of vectors $v_1 \cdots v_n$, the $n\times n$ Gram matrix $G$ is defined as $G_{i,j}=v_i \cdot v_j$  Due to symmetry in the dot product, $G$ is Hermitian.  I'm trying to remember why $|G|=0$ iff the set of vectors are not linearly independent.


How to see reason for close votes in advance?

How the user can see the reason to close his/her question before it has enough votes to be closed? All I see is close(2/3/4), but if I would know the reason in advance I could improve a question.


How to prove by induction that $(n+1)^n < n^{n+1}$ for $n\ge 3$?

Here is an inequality (let's call it - "$A(n)$") that has to be proved: $$  (n+1)^n < n^{n+1} \text{ for } n\ge3. $$  I'll skip the first two steps of induction and move right to the induction step (step #3) in order not to waste time.   Assume that $n = k+1$. I get: $$ (k+2)^{k+1} < (k+1)^{k+2} $$ From here: $$ (k+2)^k(k+2) < (k+1)^k(k+1)^2 $$ and that is where i'm stuck.   I've found, that the inequality $A(n)$ (by dividing it by $n^n$) can be expressed as: $$ (1+1/n)^n < n. $$ Here again I substitute $n = k+1$ and get: $$ (1+1/(k+1))^{k+1} < k+1. $$ Stuck here as well...  On the forum I've found ways to prove the inequality by Binomial theorem and other approaches, but how to prove this with math induction ? It would be great if answers included comments on every step, that is done to find the solution...


Won't let me download apps on the app store help

It says "verification required before you make a purchase you must tap continue to verify your payment" but the apps are free i've tried taking off the card too but that wont work


I just wanna know what happens internally when we return a value. If we dont return a value what are the consequences?  #include <stdio.h> int main() {   printf("Hello world");   return 0; //what is use of this? }


When pressing Up+left + another key, the last key doesn't 'work'

I hope I'm right in thinking this is the site where you post general computer-related problems...  A problem I have when playing games (since you won't be pressing multiple keys simultaneously anytime else), is that when I press up/left and then another key, it fails to 'register' as if that last key is never pressed. This doesn't happen when I'm pressing any other two arrow keys, e.g. down/left or up/right. The weird thing is that when I'm playing with WASD instead of the arrow keys, i still have this problem! Meaning W+A+another button doesn't work.  If anyone knows what I should, I'd appreciate the help. (My reflexes are fast and I can always circumvent this problem, but it's quite annoying and shouldn't exist to begin with!)


When trying to add a repository/PPA, I'm getting the error      The repository  bionic Release does not have a Release file.


Is SQLite the most appropriate thing to use for an embedded database?

I need to build a Java application that I will install on a Linux server.  When people will install they just would need to install this application, launch it, and nothing more. But we have some data to save.   I said no to MySQL, because it needs a server.  I said no to XML because there will be really a lot of data to save and manipulate.   So I'm looking at SQLite which is the best I think. Indeed (stop me if i'm wrong), SQLite doesn't need any server? (just install the final application and SQLite works fine in my application?)  Then I checked at  and I'm really a little bit confused.    What is the difference between a Wrapper and a Driver? Plus I see there exists  a "pure java implementation": SQLJet is it more or less optimized? Finally what would you use in my situation?


What is Penny's full name before marriage?

In the Big Bang Theory, one of the main characters is "Penny". In the 12 seasons, does it get mentioned what's Penny's full name before she married to Leonard Hofstadter?


My code:  a = '2.3'   I wanted to display a as a floating point value.  Since a is a string, I tried:  float(a)   The result I got was :  2.2999999999999998   I want a solution for this problem. Please, kindly help me.  I was following .


Require duplicates to be imported in Shotwell

I have some drawings that I have imported and tagged by date. Now I want to take some of them that I have organized on my disk and put give them a new tag. Shotwell thinks they are duplicates and won't import them. Is there a way to require Shotwell to import these duplicates?


Let's say I have a character who has Booming Blade and is a level 3 Sorcerer, and level 2 Fighter, would that still count as having levelled Booming Blade? Or do I need the Sorcerer class to reach level 5?


What is the name of the default font in math mode?

I draw figures in Inkscape. When I label elements within the figures with variable names that I have used in the underlying TeX document, I would like them to look exactly the same as in the document. (e.g. l does not look the same as $l$)  What is the name of the math mode font so I can select it correctly in the Inkscape font list?  If the exact font should not be available, what is a similar looking font that is present on most systems?


Nonconstant polynomials do not generate maximal ideals in $\mathbb Z[x]$

Let $f$ be a nonconstant element of ring $\mathbb Z[x]$. Prove that $\langle f \rangle$ is not maximal in $\mathbb Z[x]$.   Let us assume $\langle f \rangle$ is maximal. Then $\mathbb Z[x] / \langle f \rangle$ would be a field. Let $a \in \mathbb{Z}$. Then $a + \langle f \rangle$ is a nonzero element of this field, hence a unit. Let $g + \langle f \rangle$ be its inverse. Then $a g - 1 \in \langle f \rangle$, hence $ag(x)-1 = f(x)h(x)$ for some $h \in Z[x]$, hence $ag(0) + f(0)h(0) = 1$, thus $(a,f(0))=1$ for all $a \in \Bbb Z$, contradiction, hence the proof.  Is my argument correct? Is there any other method?


I just installed Ubuntu 18.04, and there is now an annoying voice that announces everything that I click on. How to get rid of this voice? Thanks for all help.


Is it better to charge your battery above 50% or let it go down, technically speaking?

Following up on : Is it better, when the battery is at 40% to let it drop (use the phone until it's 30% for example) or to let it charge to 70%? As far as I understand 50% is the "ideal" situation, but is it better to be "overcharged" or "undercharged" (for maximum life of the battery)?


How to intuitively explain what a kernel is?

Many machine learning classifiers (e.g. support vector machines) allow one to specify a kernel. What would be an intuitive way of explaining what a kernel is?  One aspect I have been thinking of is the distinction between linear and non-linear kernels. In simple terms, I could speak of 'linear decision functions' an 'non-linear decision functions'. However, I am not sure if calling a kernel a 'decision function' is a good idea.  Suggestions?


stackoverflows.ga has popups and aggressive adverts

stackoverflows.ga is ripping off Stack Overflow. I visited by mistake and I sure did pay for it. I think you should get it shut down. Phrased in the form of a question because I can't submit it otherwise?


How do I get the current date and time in the local timezone? System.DateTime.Now returns the current date and time for what the local time zone was when the program was started, which does the wrong thing.  Duplicate of sum of:


how to set static ip for guest OS on VirtualBox

My host is Ubuntu 12.04 and I have installed Virtual Box on it. Network setting of Virtual Box is NAT.  Then I have Oracle Enterprise Linux as guest.  Now I want to set a static IP for my guest, because it's one of pre-requisites of oracle installation.  I tried setting static IP using "Applications menu -> System Settings -> Network" but oracle installer complains about dhcp IP again.  Any helps are appreciated. My Linux knowledge is so limited.  P.S: In /etc/sysconfig/network-scripts/ifcfg-eth0 I have   BOOTPROTO=none   Since I'm using Virtual Box I guess this is different from other questions about static/dhcp ip.


Creating shapefile from Excel file in QGIS?

I am using QGIS 2.6.1 and have worked in an Excel file database (which was actually converted from a Shapefile). I have managed to convert it as CSV file and load it into QGIS (displays data fine) but I have trouble to convert it to a shapefile.  I can view it but I can´t add or alter data in this file. I think I have to save it as a database.   Any clues how to convert the xlsl-data to a database and finally to a shapefile?


At the end of Lost in Translation (2003), Bill Murray whispers in Scarlett Johansson ear some inaudible words. What were those words if by any chance there was some kind of any speculation based on the movie plot and events breakdown.  Appreciate any help.


Attempted to put a delete button that works in a table into a modal, with a table and it's like the click event is not firing at all. Hit's not back end code, no console.log(s), or js break points. Am I missing something?  Modal's Table

       Role	       Delete

    @*--Table Body For Each to pull DB records--*@
     @foreach (var role in Model.Roles)     {
         @role	                    <button class="sqButton btnRed float-right zIndex"                    title="Delete" data-toggle="ajax-modal" data-target="#deleteRoleUser"                   data-url="@Url.Action("Delete", "Administration",                   new {Id = Model.Id , Type = "roleUser"})" >                        </button>
     }

   Controller that it's supposed to call  [HttpGet]   public async Task<IActionResult> Delete(string id, string type)   {              if (type == "user") {       ViewBag.Type = "user";       var user = await userManager.FindByIdAsync(id);       if (user == null)       {         ViewBag.ErrorMessage = $"User with Id = {id} cannot be found";         return View("NotFound");       }       var model = new EditUserViewModel       {         Id = user.Id,                   UserName = user.UserName,                  };       ViewBag.UN = user.UserName;       return PartialView("~/Views/Modals/_DeleteModalPartial.cshtml", model);     }     if (type == "roleUser")     {       ViewBag.Type = "roleUser";       var role = await roleManager.FindByIdAsync(id);       if (role == null)       {         ViewBag.ErrorMessage = $"Role with Id = {id} cannot be found";         return View("NotFound");       }       var model = new EditRoleViewModel       {         Id = role.Id,         RoleName = role.Name,       };       ViewBag.Role = role.Name;       return PartialView("~/Views/Modals/_DeleteModalPartial.cshtml", model);     }     else     {       ViewBag.ErrorMessage = $"cannot be found";       return View("NotFound");     }          }   I am not sure why the click event on the button is not working at all. I have tried removing random code and literally nothing is making it go over to the controller at the least.  EDIT added javascript  $(function () {     var placeholderElement = $('#modal-placeholder');      $('[data-toggle="ajax-modal"]').click(function (event) {         var url = $(this).data('url');         $.get(url).done(function (data) {             placeholderElement.html(data);             placeholderElement.find('.modal').modal('show');         });     }); });  $('.sqButton').click( function (event) {       event.stopPropagation(); });


how to view chrome notification history on a mac

Could anyone please explain how to view your chrome notification history on my mac? I have seen the thread that says in chrome go to chrome://flags/ but cannot find flags. Please excuse my ignorance, but a simpleprocedure would be greatly appreciated.


How to find the number of packages needing update from the command line?

I'm working on some system admin automation using fabric and I'd like to be able to monitor the number of packages that need upgrading on a given machine. This is the same information that I can see when I first log in to a machine, i.e. this part:  35 packages can be updated. 22 updates are security updates.   Is there a command that I can run (preferably without sudo) that gives just that information?  I've looked at the apt-python bindings, but they seem to have a high learning curve and they also appear to be changed around a lot -- I'd like something that will work at least as far back as lucid without needing to do different things on different Ubuntu versions.


Solving SDE: $dX(t) = udt + \sigma X(t)dB(t)$

Solve the SDE: $dX(t) = udt + \sigma X(t)dB(t)$  Provided Question  The SDE is $dX(t) = udt + \sigma X(t)dB(t)$. Find $X(t)$, where $X(t)$ is some stochastic process and $B(t)$ is a Wiener process. Both $u$ and $\sigma$ are constants.  Hint: Multiply both sides by the "integrating factor" $e^{-\sigma B(t) + \frac12 \sigma^2 t}$.  Current Progress  Multiplying both sides by the appropriate integrating factor:  $$ \exp{\big( -\sigma B(t) + \frac12 \sigma^2t\big)}dX(t) = \exp{\big(-\sigma B(t)+\frac12\sigma^2t\big)}(udt + \sigma X(t)dB(t)) $$  Then set $f(t,x,b):=\exp{\big( -\sigma B(t) + \frac12 \sigma^2t\big)}X(t)$ and apply Ito's formula. Some of the required results before actually applying Ito's formula:  $ \frac{df}{dt} = \frac12\sigma^2 X(t)e^{-\sigma B(t) + \frac12 \sigma^2t} \\ \frac{df}{dx} = e^{-\sigma B(t) + \frac12 \sigma^2t} \\ \frac{df}{db} = -\sigma X(t)e^{-\sigma B(t) + \frac12 \sigma^2t} \\ \frac{d^2f}{dx^2} = 0 \\ \frac{d^2f}{db^2} = \sigma^2 X(t) e^{-\sigma B(t) + \frac12 \sigma^2t} \\ \frac{d^2f}{dxdb} = -\sigma e^{-\sigma B(t) + \frac12 \sigma^2t}  $  Given this, we need to know the following derivatives of the quadratic variations and co-variations:  $ d\langle B\rangle_t = dt \\ d\langle X,B\rangle_t = ??? $  My Request  Please instruct me on what $d\langle X,B\rangle_t$ is equal to so that I may progress further with this problem.


Real $2\times 2$ matrix $X$ such that $X^2 + 2X= -5I$

Find a real $2\times 2$ matrix $X = \left(\begin{matrix} a& b\\ c & d\end{matrix}\right)$ such that $X^2 + 2X = -5I.$   With this question I'm kinda lost with the $2X$ part but a full explanation or a little bit of a lead would be greatly appreciated.


i is an imaginary number.  What is $i^i$?  I tried to use euler rule but the answer is strange.  For example $i =  e^{\frac{1}{2}i\pi}$.  Using $(a^b)^c = a^{b*c}$ we got  $i^i=e^{(\frac{1}{2}i\pi)*i} = e ^ {-\frac{1}{2}\pi}$  Doesn't seem right  The reason why it doesn't seem right is because of the following   Power by imaginary numbers do not change the size of the result. e^5, is bigger than e^1. However, |e^1000000i| is still just 1.   So that's why I feel it isn't right. So what's the right answer?


Mosh: Retain backscroll beyond terminal window height

I'm experimenting using Mosh instead of raw SSH for remote shell connections. So far I like it, but I've become used to being able to page-up or scroll through backscroll in my terminal window to see the results of older commands or commands that print too much info to fit in a single window. This works fine with normal SSH connections, but Mosh seems to be "eating" lines beyond the height of the window, so when I scroll back all I can see is stuff printed before I invoked Mosh. Is there a way I can get Mosh to behave like raw SSH and retain the backscroll?  If it matters, the client is running on OS X Mountain Lion (10.7) in the standard "Terminal" program, with tcsh.


Is it legal to drop share price through false statements?

Let's say the CEO of a multinational public company goes to an interview and says "we have hard times coming". Then, the share price drops. Later, the fiscal assets and report of the company is revealed. This reveals that the company is doing great and share price again rises. During this period the CEO manages to buy a large portion of stock at the expense of the trust of shareholders. Is this legal?


Difference in sign of correlation coefficient and regression slope

Can correlation coefficient and regression slope have different signs in case of absence of multicollinearity among independent variables?


MySQL Returning Incorrect Values using Group Bu

I am trying to select the most recent RowID from an activities table for each user in an Account.  But everytime i run the query, it returns the correct RowID but the other information seems to be selected at random as the Subject and Date are always from an earlier RowID.  Why does MySQL select the correct most recent RowID but then return random values for the the SubjectDate etc..  `  SELECT  MAX(activities.rowid) as RowID, contacts.firstname as First,  contacts.lastname as Last, activities.visiondescription as Subject, smsreceived as Date FROM activities, contacts  WHERE activities.contactid=contacts.contactid  AND activities.accountid=contacts.accountid AND activities.accountid = 'AAXA-S0BJ7I' group by activities.RowID;   Anyone see what i might be doing wrong? I have tried to use group by activities.ContactID, activities.SMSReceived and still no joy.  Thanks


This configuration was working on Apache version 2.3 however, when I updated to Apache/2.4.34 (Unix) PHP/7.2.11 its not longer working. Only the first and second directives are, but the third isn't, its only showing index of the root of the folder, when its supposed to add the folder in the DEFINE as defined. Has anything changed in Apache/2.4.34, can't find any thing to resolve the issue or maybe am missing something.  PS. I have checked other Q&A the had a similar issue but none of the solutions worked.  This question is different due to the following:   Its addressing dynamic vitual host and not static This is using apache version 2.4 not 2.2 as the indicated answer is. The entire configuration of this vhost file is different to the indicated answer   Thanks  Define USER currentUser Define PATH "/Users/${USER}/Sites" Define CRAFT2 public Define CRAFT3 web  <VirtualHost *:80>     ServerName localhost     DocumentRoot ${PATH} </VirtualHost>  <VirtualHost *:80>     ServerAlias *.dv     UseCanonicalName Off     VirtualDocumentRoot ${PATH}/%1 </VirtualHost>  <VirtualHost *:80>     ServerAlias *.dv     UseCanonicalName Off     VirtualDocumentRoot ${PATH}/%1/${CRAFT3} </VirtualHost>


I want to know how to create (CMY Cube) in Blender I tried hard but didn't know what was wrong Please share with me your project on Blender (.Bland) Who can get it done Thank you very much


I have installed the latest version of aircrack-ng, but when i run this code,  sudo airmon-ng start wlan0   I get this.  sudo airmon-ng start wlan0   Found 4 processes that could cause trouble. If airodump-ng, aireplay-ng or airtun-ng stops working after a short period of time, you may want to kill (some of) them! -e  PID Name 463 avahi-daemon 475 avahi-daemon 683 NetworkManager 756 wpa_supplicant   Interface   Chipset     Driver  wlan0       Broadcom    wl - [phy0]mon0: ERROR while getting interface flags: No such device                  (monitor mode enabled on mon0)   Is there anyone who could help me get this problem solved please.


Selenium + FF : How to fix error, Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms?

My script is not running even by using selenium 2.53.1 and firefox 47.0.1. Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. is the error returned.  The script that was tried is,  package SystemPackTest;  import org.openqa.selenium.WebDriver;  import org.openqa.selenium.firefox.FirefoxDriver;  public class TestCalass {      public static void main(String[] args) {          WebDriver driver ;         System.setProperty("webdriver.gecko.driver", "<geckodriver path>");         driver = new FirefoxDriver();          driver.get("google.com");          System.out.println("Successfully opened the website");          //driver.close();      }  }    Question - How to fix error, Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms?


Getting this error "System.JSONException: Malformed JSON: Expected '{' at the beginning of object" due to response body , pl help me if anyone knows

We are getting below Json format as response and storing into Respbody variable . But when we are deserializing that we are getting below error: error : System.JSONException: Malformed JSON: Expected '{' at the beginning of object [     {         "validOrder": 1,         "orderno": "W2424591",         "statusId": "4",         "statusDesc": "Order Despatched",         "connote": "POU281160",         "carrierCode": "ST",         "carrierDesc": "Star Track",         "carrierService": "NORMAL",         "carrierTrackPage": "https://startrack.com.au/"     },     {         "validOrder": 1,         "orderno": "W2424998",         "statusId": "4",         "statusDesc": "Order Despatched",         "connote": "PSG002080537",         "carrierCode": "TE",         "carrierDesc": "TNT Road Express",         "carrierService": "NORMAL",         "carrierTrackPage": "http://www.tntexpress.com.au/interaction/trackntrace.aspx"     } ]  Code: fromJSON n = (fromJSON)JSON.deserialize(respBody, fromJSON.class);  public class fromJSON {              public String validOrder;        public String orderno;       public String statusId;      public String statusDesc;     public String connote;       public String carrierCode;       public String carrierDesc;       public String carrierService;     public String carrierTrackPage;   }


Gimp installed via snap has missing fonts and theme

I installed gimp via snap install previously and even though window decorations were missing, I was still able to use it. Today however, I opened up gimp and it's completely unusable (fonts is missing it seems).  See the screenshot attached.


Adding PDF to backside printing for Data Driven Pages?

Is there an easy way to add a PDF to the backside of each map printed using data driven pages?   I know I could print one sided and then reinsert the printed pages upside down, and print the PDF on the reverse side. However, we may deliver this to our client digitally and would like it to be setup for them.  For example, I have data driven pages set up for 50 parcels. Each map printed will show a single parcel's data. I need a generic PDF to print on the backside of each of these 50 maps.


MSI Bigfoot gaming LAN Killer e2200 not working

I have done lspci -vnn and got this      02:00.0 Ethernet controller [0200]: Qualcomm Atheros Killer E2200 Gigabit Ethernet Controller [1969:e091] (rev 13)     Subsystem: Micro-Star International Co., Ltd. Device [1462:10be]     Flags: bus master, fast devsel, latency 0, IRQ 11     Memory at f7300000 (64-bit, non-prefetchable) [size=256K]     I/O ports at d000 [size=128]     Capabilities: <access denied>   Then I went  I Figured that the [1969:e091] (rev 13) is the same hardware. I typed in sudo apt-get install build-essential linux-headers. This gives and error because it needs a version.  I would like to know how to tell what version I will need? I'm using Ubuntu 13.04.


Integrating Floor Functions $\int_0^{1102} \lfloor{x^{1/2}}\rfloor \mathrm{d}x$

I want to find a general formula to calculate the integral of such function (x>0) Could someone kindly help me? $$\int_0^{1102} \lfloor{x^{1/2}}\rfloor \mathrm{d}x$$ Thank you!


Add colon to algorithm Caption after algorithm number

If I typeset a simple algorithm using the algorithmicx package, say  \documentclass{article} \usepackage{algpseudocode} \usepackage{algorithm}  \begin{document}  \begin{algorithm}[H]   \caption{Bisection}   \label{alg:1} \begin{algorithmic}   \Repeat     \State $t\gets \frac{a+b}{2}$     \State and so on...   \Until{$f(t)>\epsilon$} \end{algorithmic} \end{algorithm}  \end{document}   the result looks similar to:    How do I add a colon behind the number of the algorithm, i.e. i would like to get  Algorithm A.1: Bisection  My first idea was to redefine thealgorithm as  %\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}:}   However, in this case every time I reference an algorithm I also gain the colon. Bad idea. Of course I could redefine the command before and after the algorithm environment or create my own environment that encapsulates algorithm and makes the corresponding definitions. But is there a better way?


Letting W be the weighted graph created by taking a complete graph K5 on five vertices 1, 2, 3, 4, 5 with the weight of each edge {x,y} given by ({x,y})=x+y,   How would I find a minimum weight spanning tree for W?


Can we have *.stackexchange.com aliases for sites that have their own domain names?

I have a Chrome search engine of the form http://%s.stackexchange.com/ that I use to quickly move between various SE sites (I find this more efficient than bumbling my way through the multicollider).  It would be nice if we could get aliases (like e.g. http://so.stackexchange.com/ or http://stackoverflow.stackexchange.com/ as a redirect to ) for all the sites that have their own domain names. I believe that's just the Trilogy (SO, pt/ja/ru.SO, SU, SF) and Stack Apps (plus corresponding metas where they exist, plus Meta MathOverflow).  Note that Ubuntu already has  redirecting to .  EDIT: Either I forgot to check MathOverflow when I originally posted this, or it's been added since then -  redirects to  now. However,  does not go anywhere.


Evaluate $\lim_{x\rightarrow 0 } \frac{(1+x)^{\frac{1}{x}}-e}{x}$

I got this problem in my math.  Evaluate  $$\lim_{x\rightarrow 0} {\frac{(1+x)^{\frac{1}{x}}-e}{x}}$$  I tried applying the L'Hospital rule, to get $$\lim_{x\rightarrow 0} (1+x)^{\frac{1}{x}}\frac{1}{x^2}(\frac{x}{1+x}-ln(1+x))$$ I don't know how to proceed after this.


Locally Constant Functions on Connected Spaces are Constant

I am trying to show that a function that is locally constant on a connected space is, in fact, constant. I have looked at this  but my approach is a little different than the suggested approach and I'm unsure about the final step and would appreciate a tip. Here is what I have so far:  Let $f$ be a locally constant function on the connected space $U$. Assume that $f$ is not constant. Then, there are distinct points $x$ and $y$ such that $f(x) \neq f(y)$. Now, since $f$ is locally constant there are neighborhoods $V_x$ of $x$ and $V_y$ of $y$ such that  $$ f(V_x) = k_x, \;\; f(V_y) = k_y $$ for some constants $k_x \neq k_y$ .It follows that $V_x \cap V_y =\emptyset$  Now, let $A = U-V_x \cup V_y$ and $B = V_x \cup V_y$ so that $U = A \cup B$. With this, we have expressed $U$ as a union of disjoint sets. Since $V_x$ and $V_y$ are open $B$ is open. Note that if $A$ is empty we are done because $V_x$ and $V_y$ would comprise a separation of $U$ wich would imply that the assumption about f being not constant was faulty. So, assume $A$ is nonempty.  At this point, I want to show that $A$ itself is open. If I can do this, I believe the proof will be complete. One way I've thought about doing this is to choose a neigborhood of some point $a \in A$ and if it is not already disjoint from $B$, shrink it until it is. This would then demonstrate that $A$ is open.   Am I on the right track here?


How to add standard account access to Google Account?

I do have a Stack Exchange account that I log in using Google auth. I'd like to provide myself with alternative access to my account, i.e. without Google - a separate login/password, Google-independent, for the same account. I've been searching for that and found only merging accounts, but that's precisely not the case.  What can I do to add standard login/password access to my Google-dependent account?


Can you prove that magnetic monopoles don't exist? Can you disprove their existence or will they remain a hypothesis until/if discovered? Qiestions similar to this one don't focus on an actual proof and this question is asking about a proof.


Why did our kitchen faucet stop working?

No water comes out of my kitchen faucet when I turn it on. Every other water outlet in the house is working fine, and the kitchen faucet was working fine until the last time we used it (two days ago). There is no trickle, it just doesn't work. I turned to shut-off valves on and off completely but nothing happened.  It's a single handle faucet with a built in sprayer. I took off the handle and also looked under the sink to see if there is anything obviously wrong or broken but either there isn't or I don't understand enough to be able to tell.   I'm happy to take the faucet off to look deeper, but the problem is I don't know what to look for. I would love any advice about how to proceed before I call a plumber.


bash: how to save state on prompt evaluation

I want to put duration of last running command in command prompt, f.ex:  user@host$ sleep 360 6m user@host$    Also, I want duration to not show up if it is less than some minimum threshold (say 30 seconds).  To achieve this I could put function call into PS1:  print_duration() {     ... calculation and formatting code ...     echo -n $command_duration }  PS1='$(print_duration)\u@\h:\W\$ '   The problem is: print_duration() will be evaluated inside subprocess which will prevent changing the environment variables of main interactive bash.  Though I didn't realize the code from above I'll give a simpler example, cut & paste this to command prompt:  prompt_var=0  test_prompt() {     (( prompt_var++ ))     echo -n "I was evaluated at $(date) and look at this: ${prompt_var} " }  PS1='$(test_prompt)\$ '   And here is the result:  I was evaluated at Fri, Mar 27, 2015 16:27:48 and look at this: 1 $ I was evaluated at Fri, Mar 27, 2015 16:27:52 and look at this: 1 $ I was evaluated at Fri, Mar 27, 2015 16:27:53 and look at this: 1 $   Note, that actually test_prompt() did evaluated in main process context just one first time (I suppose to check validity of function). But for actual prompt display it does this in subprocess (which is not really neat).  Though if I set PROMPT_COMMAND as was suggested in commentary:  I was evaluated at Fri, Mar 27, 2015 16:38:02 and look at this: 1 $ PROMPT_COMMAND='(( prompt_var++ ))' I was evaluated at Fri, Mar 27, 2015 16:38:09 and look at this: 2 $ I was evaluated at Fri, Mar 27, 2015 16:38:11 and look at this: 3 $ I was evaluated at Fri, Mar 27, 2015 16:38:12 and look at this: 4 $   This means that PROMPT_COMMAND is evaluated in main process. But, using it is not desirable for me, because I often use it for another purposes and chaining it is not convenient (and just can be forgotten).


In Google Sheets, I'm trying to create a drop down that reads from 2 columns but returns from 1 column

Basically, I have store number and Store name. I want to be able to start typing a name and select the name, but only show the store number.   If that is not possible, then I thought I can combine store number "-" name and then upon selection i should be able to Lens to the before "-".   Any idea?


Why does the Y axis change in population density plot when changing from raw scores to z-scores (assuming normal distribution)

Why do values on the Y-axis change in a probability density plot when changing from raw values to z-scores?   The mean z-score aligns with 0.40 on the Y-axis, while the Y-value for the mean with respect to raw values is much lower. Why is that?    Here is some sample code in R:   x=seq(25,500,length=200) meanx = mean(x) sdx = sd(x)  y1 = dnorm(x, mean = meanx, sd = sdx )  plot(x,y1,type="l", col="red")  xz = (x - meanx)/sdx  y2 = dnorm(xz, mean = 0, sd = 1)  plot(xz, y2, type="l", col = "red")


Why does Mark use Hexadecimal to communicate?

In the movie Martian, why does Mark use Hexadecimal to communicate with NASA? Couldn't numerals from 0 to 9 sufficed for indicating the number corresponding to the alphabet?


Install macOS High Sierra as VirtualBox guest (on macOS High Sierra)?

I would like to install a VirtualBox guest of macOS High Sierra on my MacBook Pro that is also running macOS High Sierra so that I can experiment with MDMs, etc. without rendering my primary laptop unusable.  I've created an ISO of High Sierra by downloading the installer from the Mac AppStore and running the following commands:  hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J  hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build  asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase  hdiutil detach /Volumes/OS\ X\ Base\ System  hdiutil convert /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso  mv /tmp/HighSierra.iso.cdr ~/Desktop/HighSierra.iso   I've also created my VirtualBox guest on VirtualBox 5.2.0 r118431 with 8GB RAM and 2 processors.  However, when I attempt to boot from the ISO to start the install process, I'm met with a blank, black screen.  Is there something else I need to do in order to create my virtual macOS instance?


how to remove frost free outdoor faucet drain valve assembly

I've tried unscrewing the part outlined in red below. No dice. Do I just need to remove the whole rod (above the red outline) and replace it?) If so, can anyone point me to instructions for them.  I can't see in there. Worried that I'll pull it out and not be able to put it back in.  (The deeper I go in the plumbing the more things I find that there is no modern fitting-part :)  My new assembly  replaces the parts outlined in red. the new assembly has a female thread. I am HOPING that the thicker part of the pipe (just above the black "collar" stopper)  is screwed onto the pipe above.  However, I cannot unscrew it. There is nothing to get a hold of. It's perfectly round. I've tried dw40, and let it sit for 20 minutes. No love.  I'll try wacking it with a board in the direction along which it moves in when it screws (perpendicular to the threads per [this answer][2])


Rectangle inscribed in semicircle, find perimeter and more

Consider this image:   A rectangle is inscribed in a semicircle and the radius is 1. The bas of the rectangle is x. Write an expression for the rectangle perimeter and determine the value of x that gives the highest possible perimeter. Also, what is the highest perimeter? Well... I fooled around with the unit circle, but still no progress. I've found several instructions on how to find the area, but no luck with perimeter.  I've been trying to solve this one for days now, I have completely giving upp solving it by my self. If someone could provide me with both answers & solutions, I would be happier than a child in a candy store :)  Could any kind soul help me out? :)  EDIT:   Please read new update:


AJAX script error "SCRIPT5: Access is Denied"

So I'm new to AJAX and I have this code that I'm trying to run. I want it to change the paragraph text by using the content in my contact.txt file, but when I run the code it errors:     "SCRIPT5: Access is denied."   I'm using IE-11 to run the code.  My Code is as follows:  <!DOCTYPE html>
The XMLHttpRequest Object

Let AJAX change this text.
  <button type="button" onclick="loadDoc()">Change Content</button>


Can i put a rack for panniers on a Carbon road bike w/ Thru axle?

I was looking at getting a new Trek Domane SL 5 for commuting, but i don't see any way to mount a rack on it? I need to carry a laptop bag and a change of cloths. Is there any way to do this on that bike?


Is there a way to disable Windows shortcuts without installing third party software?

Specifically, I want to disable the Alt + Space shortcut because on my new Dell keyboard I find that I am frequently hitting this key combination by accident.  I've seen  answer, but I am hoping we can do better. It seems ridiculous to me that one should have to install third party software in order to disable a keyboard shortcut. Surely there must be a may to do this somewhere in the Windows settings or with a registry key.


I have a multiple entry Belgium Schengen tourist visa for 30 days, however my travel plans have changed.. can I now goto Italy on the same visa or shall I apply for a fresh Schengen visa for Italy.. what are the pros and cons of travelling to Italy on a Belgium Schengen visa? Regards, Tushar


Who's the manufacturer and what year was this tandem bike manufactured?

The previous owner said this could possibly be a Schwinn:


So I have this word problem and I’m a bit confused about it. I have the answer and explanation but I still don’t understand: The half-life of carbon-14 is approximately 5730 years, while the half-life of carbon-12 is essentially infinite. If the ratio of carbon-14 to carbon-12 in a certain sample is 25% less than the normal ratio in nature, how old is the sample?     A. Less than 5730 years      B. Approximately 5730 years      C. Significantly greater than 5730 years, but less than 11460 years      D. Approximately 11460 years  Correct Answer: A Explanation: Because the half-life of carbon-12 is essentially infinite, a 25 percent decrease in the ratio of carbon-14 to carbon-12 means the same as a 25 percent decrease in the amount of carbon-14. If less than half of the carbon-14 has deteriorated, then less than one half-life has elapsed. Therefore, the sample is less than 5730 years old. Be careful with the wording here—the question states that the ratio is 25% less than the ratio in nature, not 25% of the ratio in nature, which would correspond to choice (D). How is the ratio of the carbon isotopes relevant to half-lives? What is the purpose of saying the half-life of an isotope is infinite? What is meant by “the normal ratio in nature”? Just based on the answer, it seems like the question said “25% of a carbon sample decayed, how old is this sample?” Obviously it’s younger than 5,730 years (the time for its first half life) because if only 25% decayed that means half a half-life has passed. I don’t see how isotopes and ratios would change this problem at all. Edit: Every answer here was very informative and helpful. It was tough to pick a best answer. I picked Cosma’s because it clicked with me. If you’re reading this and want to understand radiocarbon dating, look at every answer because there is some useful information in every answer


I am setting up the layout for my bachelor thesis using scrbook as basis for a self-made documentclass with twosided print. I want a header containing the current part number and name on the outer side (left on even pages, right on odd pages), the current chapter number and name on the center of the head and the same for section on the inner side. I found this example in the KOMA-Script documentation:  \usepackage{scrlayer-scrpage} \pagestyle{scrheadings} \automark[chapter]{chapter} \automark*[section]{}   It puts the chapter on the outer side on even pages and the section on the outer side on odd pages. Sadly, I was not able to modify this to fit my needs because I do not really understand the way KOMA-Script works here. If a part starts but there is still no chapter in it, the place for the chapter shall remain empty (same for chapter and section). Can anyone help?  Furthermore, I would like to change all fonts that KOMA-Script changes (e.g. toc, section, chapter...) back to the default computer modern as I do not like the font KOMA-Script uses here. Is there a better way than changing all the fonts manually like this:  \addtokomafont{section}{\fontfamily{cmr}\selectfont}


I know that: $$P(c|o) = \frac{P(o|c)  P(c)}{P(o)}$$  My question is why can't one calculate $P(c|o)$ directly and not use this formula?


Unable to install software--Getting error code 1

I am unable to install any new software, and any apt-get command returns error code 1. In the Ubuntu Software Center, I get the error "New software can't be installed, because there is a problem with the software currently installed. Do you want to repair this problem now?" And if I click repair, nothing happens. I am afraid that it is related to Codeblocks, which was recently installed. I have restarted numerous times, as other threads related to the same problem suggested, and I have followed many of their commands. It seemed to work for them, but it does nothing for me. Ubuntu 14.04 64-bit.  sudo apt-get -f install returns:  Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required:   libbonoboui2-0 libbonoboui2-common libglade2-0 libgnomecanvas2-0   libgnomecanvas2-common libgnomeui-0 libgnomeui-common Use 'apt-get autoremove' to remove them. The following extra packages will be installed:   codeblocks-contrib codeblocks-dev gamin libcodeblocks0 libgamin0   libwxsmithlib-dev Recommended packages:   valgrind The following packages will be REMOVED:   codeblocks-headers The following NEW packages will be installed:   gamin libgamin0 libwxsmithlib-dev The following packages will be upgraded:   codeblocks-contrib codeblocks-dev libcodeblocks0 3 upgraded, 3 newly installed, 1 to remove and 81 not upgraded. 5 not fully installed or removed. Need to get 5,309 kB of archives. After this operation, 1,163 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks-dev amd64                               13.12-3 [350 kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libcodeblocks0 amd64 13.12-3 [1,807 kB] Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty/universe gamin amd64 0.1.10-4.1ubuntu1 [41.1 kB] Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libgamin0 amd64 0.1.10-4.1ubuntu1 [16.4 kB] Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks-contrib amd64 13.12-3 [3,018 kB] Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libwxsmithlib-dev amd64 13.12-3 [75.1 kB] Fetched 5,309 kB in 8s (643 kB/s)                                               (Reading database ... 338385 files and directories currently installed.) Preparing to unpack .../codeblocks-dev_13.12-3_amd64.deb ... Unpacking codeblocks-dev (13.12-3) over (13.12-1) ... dpkg: error processing archive /var/cache/apt/archives/codeblocks-dev_13.12-    3_amd64.deb (--unpack):  trying to overwrite '/usr/include/codeblocks/externaldepsdlg.h', which is also in     package codeblocks-headers 13.12-1 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing:  /var/cache/apt/archives/codeblocks-dev_13.12-3_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)


I am getting started using pmdarima and trying to resolve some confusion with m. I m appending to this related question and hoping you can clarify, I am having 5-minute intervals data. The seasonality is one day in that case, m = 24*12. When I try using auto_arima for 6 month of data with m=24x12, the process gets killed. How can I make this computationally feasible?


How do I get the Unitary matrix of this circuit without using 'unitary_simulator'?

I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator. i.e.: By just using matrix manipulation, how do I get the unitary matrix of the circuit below by just using numpy and normal matrix properties?  I have figured out how to get the unitary matrix of the circuit below:  By using this code: import numpy as np  swapcnot = np.array([[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]]) cnot = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])  layer1 = np.kron(np.eye(2),swapcnot)  layer2 = np.kron(swapcnot, np.eye(2))  print(layer2@layer1)  However when I try to add another qubit and another cnot gate, I do not get the correct result The result I should be getting:


Regular Expression: Match betwen a long string with unknown symbol too

I have string and it is more than 1000+ character.. my character like this.

d Paola all 👜💼👛👝🛍 joined the company after the war, and took oin 1966 to a young designer – the then-unknown, Paris-based Karl Lagerfeld – who took over the aesthetics of the family company and now works with Silvia Venturini Fendi, Anna’s daughter.
        ---- more 1000+ character  <div class="footer   My actual string too long then I showed an example, you may notice, in the string, there is some special character. and in entire string, too many special characters like these 👜💼👛👝🛍  I am trying to grab <div class='a-body__content to <div class="footer  I know I can grab that special character with .* but after an space, it cant match next character after space, but if I do like .*\s.*\s.*, my patter becomes too long and it will work only for this string and will not works other string of this type, so I need a solution to grab any character between <div class='a-body__content to <div class="footer and so that it works for any other string of this type.  Can anyone help me with this case?


Old sci-fi movie set in ship with murderous crew

This one I saw when I was very young on Cinemax (when they would show B-flicks like nobody else's business), so I will write the stuff I remember:   Story happened on a ship (colony or something), enroute to another planet. Captain died in cryo-sleep at the beginning, crew gets message that they are all that remains of mankind. Or Earth was already destroyed and they were coming out of cryo-don't recall. Crew turns on each other, start killing each other. One of crew members (a woman) is android, is last to be killed. Two crew members remaining (man and woman) try to arm escape pod to run away from ship self-destruct that android triggered, but are unable to. They open eyes after bracing to be blown up to discover that they are in a simulation in a bunker. They get message from unknown man in hologram that tells them about status of simulation (namely, that they "won"). Man ends his message by saying that "Darwin was right" or something. Both crew members leave bunker to find out that they are still on Earth… which has been destroyed.   Need help with, at the very least, the title.  I'll appreciate any help.


In Common Lisp, why do multi-expression bodies of (if) statements require (progn)?

Is this just a bit of historical cruft left over from the 1950s or is there some reason syntactically why multi-expression bodies of (if) forms require (progn)? Why can't you wrap the multiple expressions in a set of parentheses like with (let):     (if some-cond      ((exp1) (exp2) (exp3)) ; multi exp "then"      (exp4)) ; single exp "else"   It appears it would be trivial to write a macro to test each body to see first if it is a list and then if it is, if its first element is also a list (and thus not a function invocation) and then to wrap its subcomponents inside a (progn) accordingly.