Okay here is the current situation. I am entering my second year in my PhD program and most of my options of joining the Theoretical astrophysics groups are closed ( no professors working in that field and two of them who were working are leaving the university). Right now the only open option for me is to work in computational condensed matter theory which I am not sure I am interested in (But I do know that given a option between this and theoretical astro I would choose the latter) ie.. interest in Astro theory >> Interest in CMT. okay given this background the questions are,  1) what are the cons of doing another PhD in astro after completing my PhD in CMT (let us say it would take me 5 years here to complete my PhD and if I am applying to an university in UK for my second PhD I would complete it in 3 years so in total i would have spent around 8 years with 2 PhD's in my hand) cons ?  2) I know most of you would ask me to just reapply to other schools, But I am not sure how certain I am in getting an admission again and I dont want this entire two years here to go waste ( just 3 of more years I would have my PhD). So my second question is it even possible to get a PhD position in Europe after having PhD in US ?  So basically my reason for second PhD is not for a better career path, but instead to shift to my area of interest but as well as to not let these 2 years of my life go waste. Is it a good choice to make ?  Edit 1- I did read all the answers for double PhD questions but all the questions were in the line of "I want a better job/career, should I do double PhD?" mine is, "Let us say I complete my current PhD, is there any disadvantage of doing another one just because I would love to work in that field?"  PS: Yes I am working in US university right now, and yup as I am in my second year I have completed few course work and started the project. Rather than saying I "have to complete this PhD", I would put it this way - "I don't hate the work I am doing here, it is just that I would like working in the other field much more than this"  Edit 2- Thanks for the helpful answers. Let me explain my personal bias towards astrophysics. I am a math person by nature, and previously had my undergraduate in engineering.I wanted to move to physics mainly because of the rigorous mathematical structure of it compared to engineering, I self studied several physics stuff and hence wanted to do theoretical physics. But later (now) my views about theoretical physics is changing. On the whole this is what I think is the timeline chart in theoretical physics area apart from Astro) -  Experimentalists collect data of physical world  Theorists build model to explain the data   The new theory might lead experimentalists to further prob the physical world to test the theory   If it does, verify that theory, if not inform the theorist   Theorist then builds a new (or modify the old model) to explain the existing results.    So at the end of the day theorists keep on modifying their model until it agrees with all the experiments. At the end of the day, this is just model building/modifying till my theory fits the data(this creates a bound purpose to building the theory unlike mathematics). But in Astro, since there are very few experiments to verify, the set of all possible theories is large and theorists in this field actually have the freedom to keep on building theories(or models) to explain. And it is this abstract nature of this field (which is analogous to mathematics) where one needs no reason to build theory other than building it just for the fun of it interests me. These are my personal thoughts about general theoretical physics and the reason I want to move to Astro.

I am studying a combined bachelor of engineering (electrical) and bachelor of mathematics; I just started this year and will graduate in 2018. The reason why I am doing double degrees and not a single degree is because I love both electrical engineering and mathematics and I could not ignore any of them. So with this in mind, I am thinking of doing two PhDs when I graduate (one in electrical engineering and one in mathematics). Is this a good path or I should concentrate on only one of them?


I launched a UK wide furniture business, which I can appreciate is a very difficult industry to break into but none the less I have implemented the basics by ensuring I have:   Good meta data (titles, description, and keywords - eventhough it is ignored by Google) Adequate H1 and H2 tags Sitemap submission Good quality content trying to keep the keywords within a certain percentage of all the text (~4%?).    This has resulted in being within the top 10 SERP on Google for about 30 different keyword combinations as shown by GWT (Not the best of keywords but still giving me an online presence)  My question is what can I do to further improve my position? Any general advice which I and others can implement to take it to the next level?  Home page:  sample product page:

What are the best ways to improve a site's position in the Google search results?


I just got the new 5th edition of D&D and I started reading the new mechanics. One puzzles me. I'm trying to understand the Hit Damage. I'll use the Aarakocra from the monster manual. It says for the Talon attack Hit: 4 (1d4+2). Where does the 4 come in? Is it actually damage like  4 damage plus 1d4+2 or is it like says +4 to hit and damage is (1d4+2). I know it's probably a very stupid question but like I said, confused.

My friends and I are very new to D&D, played like 3 times. In a monster's stats next to weapon damage it says stuff like "+11 to hit" and "Hit: 5 (1d8+1)". For the premade characters it just says things like "+4, 2d6 + 2 slashing", though. Why are there two "hit" numbers for monsters? Which do I use for the d20 roll to hit against a target's AC?  I mean for example like in the Ogre entry in the "" article on monsters.


I have studied in school that the speed of light is always a constant, my question is what is happening when it reflect from a surface? when it hit a surface weather the velocity reached to zero and again increase to speed of light?  I only have high school knowledge of Physics. Please explain me in layman's terms.

When a photon of light hits a mirror does the exact same photon of light bounce back or is it absorbed then one with the same properties emitted? If the same one is bounced back does it's velocity take all values on $[-c,c]$ or does it just jump from $c$ to $-c$ when it hits the mirror?  Or, is the phenomenon of a mirror better explained using a wave analogy? If so, what is this explanation?


I asked a friend to install Ubuntu 14 and Windows 8 installed on my laptop. The partitioning was done as follows:  NAME   FSTYPE   SIZE MOUNTPOINT            LABEL sda           931.5G ├─sda1 ntfs     300M                       Recovery  ├─sda2 vfat     100M /boot/efi ├─sda3          128M ├─sda4 ntfs   126.4G ├─sda5 ntfs   341.8G /mnt/C6E4BB0FE4BB00AB   ├─sda6 ntfs   443.2G ├─sda7 swap     1.9G [SWAP] └─sda8 ext4    17.6G /                       Ubuntu is installed on sda8, with size 17.6 GB. I need more space on my ubuntu as I now carry out most of my work there.  Is there a way to alter the size of the partitions, or should I reinstall?

I have a dual-boot laptop with both Windows 10 and Ubuntu 16.04.  Currently, the Windows side has too much disk space, and I want to resize things so that the Ubuntu side has more.  Firstly, I went into the Windows disk management and shrunk the Windows partition by 20GB. I then wanted to expand the Ubuntu partition, but it seemed like this option was greyed out.  Can I expand the Linux partition from Windows or do I need to be in Ubuntu or do I need to create a boot disk and do it that way?  Or do I need third party software?  Any help gratefully received.


How to get current element of list by javascript. The element clicked by three dots. Please help. From the Sharepoint list called "Stuff".  And after click on three dots i want to get a ID of element. Please help.

I want to ask how to get id of element which was clicked by right clicking in open menu. I must know ID of this element to show only that history the element what was clicked fom open menu:


I've been trying to set up a tor relay, but I ended up deleting the /etc/tor/torrc configuration file after messing it up too much and figuring that tor would create a new unmodified config file after failing to locate it. This didn't turn out to be the case, and reinstalling the tor package didn't restore the config file either. So in general, what can be done to reset a software package, restoring its configuration state back to when it was first installed? This problem has plagued me before but I haven't come across the solution yet. Thanks! Edit: I'm running Ubuntu 18.04

I would like to restore LightDM to its default state, because for some reason /etc/lightdm/unity-greeter.conf is now an empty file.  Deleting /etc/lightdm/unity-greeter.conf and then running sudo apt-get install --reinstall unity-greeter doesn't create a new config file as you might expect.   How can I restore a missing config file?


I am trying to make a titlepage for my Thesis. I am using this titlepage as a draft  but I want to add a third Logo in the upper right corner and I am having trouble with minipage because this logo appear in the middle instead of the top of the page.  Do you know a solution for this?  Here is my MWE  \begin{titlepage}     % if you want the titlepage to be centered, uncomment and fine-tune the line below (KOMA classes environment)     \begin{addmargin}[0cm]{-3cm} \begin{minipage}{.15\textwidth}   \flushleft   \center{\includegraphics[width=\textwidth]{gfx/Logo1}}    \vspace{20pt}    \center{     \rule{.5pt}{.6\textheight}     \hspace{7pt}     \rule{2pt}{.6\textheight}     \hspace{7pt}     \rule{.5pt}{.6\textheight}   } \\    \center{\includegraphics[width=\textwidth]{gfx/Logo2}} \end{minipage} \begin{minipage}{.7\textwidth}  \center{  \spacedallcaps{TECNOLÓGICO NACIONAL DE MÉXICO} \\   \rule{\textwidth}{2pt}   \\   \hrulefill\\[1cm]   \spacedallcaps{INSTITUTO TECNOLÓGICO DE CELAYA}\\[2cm]         \begingroup             \color{Maroon}\spacedallcaps{Título} \\[2cm]         \endgroup   \huge{T \hspace{1cm} E \hspace{1cm} S \hspace{1cm} I \hspace{1cm} S  }\\[1cm]   \large{QUE PARA OBTENER EL TÍTULO DE:}\\[1cm]   \large{Ingeniero Mecánico}\\[1cm]   \large{PRESENTA:}\\[1cm]   \large{\spacedlowsmallcaps{Yo}}\\[1cm]   \large{TUTOR:}\\[1cm]     \large{\spacedlowsmallcaps{Tutor}}\\[1cm]   \large{Departamento} }         \vfill          Fecha         \vfill                       \end{minipage} \begin{minipage}{.15\textwidth}     \flushright     \center{\includegraphics[width=\textwidth]{gfx/Logo3}} \vfill   \end{minipage}    \end{addmargin}        \end{titlepage}

I would like to be able to align two minipage at the top, without worrying about what is in the minipage.  I am aware of the optional [t] parameter, but still have some confusion as to how this all works.  I tend to think of a minipage as a regular page in that whatever is placed on it starts at the top and fills the page going across and then down the page, but this does not appear to be the case.  In the MWE example below, I have color coded the sections for reference purposes.   The first case (black) works just as I would expect. The two minipages are aligned exactly as I want with the [t] specifier.  No question here.  The next case (red) only works if the inner minipage also has the [t] specifier. Why is that necessary?  I would have thought that any content would be placed at the top of this page, and since both the outer minipage had a [t] things should have aligned at the top. I would like to place a graphic in the second mini page, and still have the two aligned at the top.   The simple case (blue) of using \includegraphics directly does not result in the content being aligned at the top.  So, then I attempt to put this in a \parbox (green) and this too does not yield the desired results.  I also try to place the graphic inside an inner minipage (brown) and specify the [t] alignment, and even though this worked in the red section, it does not here.  The only difference between the red and brown being that the red section had text, whereas the brown section has a graphic.  I am aware of question regarding  which suggests to place \vspace{0pt} at the top of the minipage, and that does provide the desired alignment (cyan), but adds vertical space at the top.  So, my second question is why is the \vspace{0pt} necessary when a graphic is included, but not when it is text.  This appears to be a hack and wondering if there is a replacement for minipage that works better without having to worry about exactly what is in the minipage?  Also, why did wrapping the figure in a parbox (green) or another minipage (brown) not solve this problem?   Here is the MWE:  \documentclass{article} \usepackage[demo]{graphicx} \usepackage{lipsum} \usepackage{xcolor}  \begin{document} \section{This Works - Aligned at top as desired} \begin{minipage}[t]{0.6\linewidth}     \lipsum[1] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \lipsum[2] \end{minipage}  \color{red} \section{Why does inner mini page required the [t]?} \label{Minipage-in-minipage} \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \begin{minipage}[t]{\linewidth}% Why is [t] required here         \lipsum[4]     \end{minipage} \end{minipage}  \color{blue} \section{Why are These not aligned at top?} \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \includegraphics[width=\linewidth]{foo} \end{minipage}  \color{green} \section{Why are These not aligned at top?} \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \parbox{\linewidth}{\includegraphics[width=\linewidth]{foo}} \end{minipage}  \newpage \color{brown} \section{Why does this not work with the [t] as it did in red section?} This worked fine in Section \ref{Minipage-in-minipage}  \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \begin{minipage}[t]{\linewidth}% Even with [t] here, this does not work         \parbox{\linewidth}{\includegraphics[width=\linewidth]{foo}}     \end{minipage} \end{minipage}   \color{cyan} \section{Adding a \textbackslash{}vspace\{0pt\} works} \begin{minipage}[t]{0.6\linewidth}     \vspace{0pt}% Hack!! But does do the job     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \vspace{0pt}% Hack!! But does do the job     \begin{minipage}[t]{\linewidth}% Why is [t] required here         \parbox{\linewidth}{\includegraphics[width=\linewidth]{foo}}     \end{minipage} \end{minipage} \end{document}


What made scientists believe that we should calculate probability $P$ as the $P = \left|\psi\right|^2$ in quantum mechanics? Was it the double slit experiment? How? Is there anywhere in the statistical mathematics a similar equation where we calculate probability like $P=\left|x\right|^2$ where $x$ is whatever?

The equation:  $$P = |A|^2$$  appears in many books and lectures, where $P$ is a "probability" and $A$ is an "amplitude" or "probability amplitude". What led physicists to believe that the square of modulus connects them in this way?   How can we show that this relation really holds? In a  by J. J. Binney at Oxford University (minute 12:00) he states that this equation holds but doesn't explain why or where it comes from.


I really like the , where certain questions from the Stack Exchange Network are presented, along with a hotness rating that is described as "arbitrary" in its tooltip. Such questions also appear randomly on the sidebar on sites across the network, under the heading "Hot Network Questions". How do these arbitrary hotness points work, and how are they used to select questions to appear in those lists?

Right now  is fairly broken -- it's a simple descending sort by views. As Joel said , it is "a self-fulfilling prophecy." But this is not intentional, it's only because we haven't had time to improve it yet! As I sit down to write a better algorithm, I thought you guys might have some insight into what would make a good formula to determine the "hot" questions -- over the last 24 hours, the last week, the last month, and all time. Here are the variables we have to work with:  Votes [aka Score] Views Answers Answer Votes [aka Score] Whether the question has an accepted answer or not Time question was originally asked Time of last activity on question Reputation of asker Reputation(s) of answerers  Joel cited the reddit formula as an example, but I think our site is a little different than just a basic link submission site. Plus, we have more variables and data to work with. I found a  describing a few formulas: Y Combinator Hacker News  (p - 1) / (t + 2)^1.5 p = votes (points) from users t = time since submission in hours  Reddit  t = (time of entry post) - (Dec 8, 2005) x = upvotes - downvotes y = {1 if x > 0, 0 if x = 0, -1 if x < 0) z = {1 if x < 0, otherwise x} log(z) + (y * t)/45000  Thoughts? Ideas? I don't want to overthink this; I just want the "hot" questions to be relevant and useful to us. So the simpler the algorithm the better! Based on my analysis of the above and the comments so far, here's the second version of what I have implemented so far. This might suck. I don't know:  (log(Qviews)*4) + ((Qanswers * Qscore)/5) + sum(Ascores) -------------------------------------------------------- ((QageInHours+1) - ((QageInHours - Qupdated)/2)) ^ 1.5  Note that accepted answers weight not at all in hotness. This is intentional, as I feel accepted answers are a fine social contract, but not a good data point for question or answer quality. This algorithm will heavily favor questions with LOTS of answers, as the sum(Ascores) are now included -- one assumes if there are lots of answers, there will be a lot more voting on the answers, too. Update: Note that this formula is what is used on the  linked from the homepage of each site. It is not the formula used to determine the  list. See .


Photons are the force carrier of the electromagnetic force. I do not see how this could result in a transfer of momentum that attracts objects together.

Since Newton's law of gravitation can be gotten out of Einstein's field equatons as an approximation, I was wondering whether the same applies for the electromagnetic force being the exchange of photons. Is there an equation governing the force from the exchange of photons? Are there any links which would show how the Coulomb force comes out of the equations for photon exchange? I know that my question is somewhat similar to the one posted here , but it doesn't really have an answer to my question specifically.


In plank position, the body is not moving, but it still burns calories. Work is defined as force multiplied by distance ($Fd$). There is force, but no distance, so the energy should be $0$ ($F \times 0 = 0$), as anything multiplied by $0$ is $0$. Someone please explain how planking burns any calories.

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


I do not understand what option to install on this instruction  "Tor" or "Tor from source" , what's the difference?

In Ubuntu 13.04 I used to use the ppa:upubuntu-com/tor64  PPA to install the 64-bit Tor Browser Bundle. However, in Ubuntu 13.10 it doesn't work anymore. How do I install the Tor Browser Bundle in Ubuntu?


I'm currently working on some discrete mathematics work and I've encountered a question I'm not sure how to answer exactly. Precisely, I'm trying to prove that two power, intersected sets statements are equal to each other and my understanding of how to do that doesn't seem to be enough. The statements in question go as follows:  Determine whether, for any sets A and B, through proof, it is true that                           ℘(A ∩ B)=℘(A) ∩ ℘(B) where ℘ denotes a power set.   Should I make some form of example set to better understand how these statements are equivalent? Or even a venn diagram? Any help is appreciated.

I'm currently working on some discrete mathematics work and I've encountered a question I'm not sure how to answer exactly. Precisely, I'm trying to prove that two power, intersected sets statements are equal to each other and my understanding of how to do that doesn't seem to be enough. The statements in question go as follows:     Determine whether, for any sets $A$ and $B$, through proof, it is true that   $$\wp(A \cap B) = \wp(A) \cap \wp(B)$$   where $\wp$ denotes a power set.   Should I make some form of example set to better understand how these statements are equivalent? Or even a venn diagram? Any help is appreciated.


I have posted  here before.  A similar thing happened this morning. I received a Low Disk Space warning      The volume "InternalHDD" has only 873.8 MB disk space remaining   I clicked the button "Examine...", and up comes Disk Usage Analyzer which (unfortunately) says      Could not scan folder "/mnt/InternalHDD" or some of the folders it   contains   So I start the Disks utility to have a look, and the Disks utility reports that my disk "InternalHDD" has 52 GB free.  There's no immediate problem, because I was able to free up 256GB immediately on my "InternalHDD".  What I want to know is:   Why does this happen? What is being measured to give the 873.8 MB free disk space number? What is being measured to give the 52 GB free disk space number? Why are these numbers different, when they are supposedly for the exact same disk at the same moment?   Here are screenshots of each of these:

I'm trying to identify why, suddenly, 100% of our disk space is in use. I have already rebooted but the issue persists.  Here are the outputs of some commands that are showing some strange (for me) results:  danny@hydrogen:~$ df -h  Filesystem            Size  Used Avail Use% Mounted on /dev/cciss/c0d0p1     130G  122G  949M 100% / none                  1.9G  196K  1.9G   1% /dev none                  2.0G     0  2.0G   0% /dev/shm none                  2.0G   40K  2.0G   1% /var/run none                  2.0G     0  2.0G   0% /var/lock none                  2.0G     0  2.0G   0% /lib/init/rw   danny@hydrogen:/$ sudo du -chs /  du: cannot access `/proc/1662/task/1662/fd/4': No such file or directory du: cannot access `/proc/1662/task/1662/fdinfo/4': No such file or directory du: cannot access `/proc/1662/fd/4': No such file or directory du: cannot access `/proc/1662/fdinfo/4': No such file or directory   danny@hydrogen:/$ df  Filesystem           1K-blocks      Used Available Use% Mounted on /dev/cciss/c0d0p1    135342296 128144108    323104 100% / none                   1991336       196   1991140   1% /dev none                   1995788         0   1995788   0% /dev/shm none                   1995788        40   1995748   1% /var/run none                   1995788         0   1995788   0% /var/lock none                   1995788         0   1995788   0% /lib/init/rw   danny@hydrogen:/$ mount  /dev/cciss/c0d0p1 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) none on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) none on /dev type devtmpfs (rw,mode=0755) none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev) none on /var/run type tmpfs (rw,nosuid,mode=0755) none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)   danny@hydrogen:/$ sudo du -h --max-depth=1  634M    ./premvet_sync 5.6M    ./etc 4.0K    ./opt 16K ./lost+found 7.4M    ./bin 623M    ./lib 196K    ./dev 0   ./sys 4.0K    ./srv 4.0K    ./cdrom 8.0K    ./media 52K ./tmp ... it hangs for ages here.....   The server is running Ubuntu 10.04.4 LTS.  System load:  2.85                Temperature:         8 C Usage of /:   94.7% of 129.07GB   Processes:           132 Memory usage: 39%                 Users logged in:     0 Swap usage:   0%                  IP address for eth0: 192.168.1.124  => / is using 94.7% of 129.07GB   I'm struggling to comprehend why this is happening! Any pointers would be appreciated.


After making two div elements inline-block, and then vertical-align: top, I'm left with an image which was originally centered both vertically and horizontally within the div, at the top left-hand side. Here is the code:    .soundscapeImgDiv {   /* background-color: white; */   background-image: url('../images/testImg.png');   background-size: 100%;   background-repeat: no-repeat;   width: 260px;   height: 85%;   margin-left: 10px;   margin-top: 12px;   border-radius: 12px;   /* text-align: center; */   display: flex;   align-items: center;   justify-content: center;   display: inline-block;   vertical-align: top; }  .portalInfoDiv {   background-color: White;   margin-left: 10px;   height: 71px;   width: 56%;   display: inline-block;   vertical-align: top; }

Shanghai, China night lols

somethingsGuy • 5 days ago

     How can I center it like before?  Current Vs intended:

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


I just cannot prove that $$\frac {d}{dx} {x^n} = n x^{n-1}$$ for $ n  \in \Bbb R$.  For $n \in \Bbb{N}$, I can use the definition of a derivative :  $$\frac {d}{dx}x^n = \lim_{h \rightarrow 0} \frac{(x+h)^n - x^n}{h}$$  Now applying "Binomial Expansion" for $\displaystyle (x+h)^n=\sum_{i=0}^{n}{n \choose i }x^{n-i}h^i$ and expanding, the $x^n$ term in the numerator cancels out and the $h$ from denominator divides the entire remaining expression . Taking limit $h$ tending to $0$ gives the required result.  I have been taught that the derivative result holds for all real $n$. But I am not aware of any "formula" which can allow me to expand a binomial expression with real index. I do know about the Taylor Expansion, but if I remember correctly, it utilises the very derivative that I am trying to find.  How can I proceed ?

Can anyone give a proof of the derivative of this type of function? Specifically showing that  $\dfrac{d(x^w)}{dx} = wx^{w-1}$ for a real $w$?  I tried to use the Taylor series expansion for $(x+dx)^w$ and got the correct result. However, the proof of the Taylor series requires knowledge of the derivative of these functions. So this is essentially circular reasoning. I know that the same series is also given by the binomial expansion, but that's not entirely satisfactory either, because where's the proof that the binomial expansion works for all reals (isn't it only apparent for integers)? So far all of the arguments I've come across involve circular reasoning. I was thinking of showing that the binomial expansion is true for all reals using some form of proof by induction e.g. something like this.  I'm really not sure.


I would like to do an neat scheme of my database to pin down ideas, particularly I would like to do something like in the attached picture. Even though I have looked in internet thoroughly, I have not been able to find something similar that serves me as template in latex.  Any help, specially that regarding templates, tutorials and manuals in order of importance, would be much appreciated.  KR

I found  post about how to do Crow's Foot ERM Diagrams with Tikz, but it looks strange because the entity is outside the frame. However, it worked.  Then I found  even nicer version and tried to combine it, but sadly I'm not able to find out why it doesn't work. I'm not able to print two entities side by side and connect them with a crow's foot wire. They always print over each other...  How can I have both the lines and the style?  \documentclass{article}  \usepackage{tikz} \usetikzlibrary{shapes.multipart} \usetikzlibrary{matrix} \usetikzlibrary{positioning} \usetikzlibrary{shadows} \usetikzlibrary{calc}  \tikzset{     entity/.code={         \tikzset{             rounded corners,                          name=#1,             inner sep=2pt,             every entity/.try,         }%         \def\entityname{#1}%     },     entity anchor/.style={matrix anchor=#1},     every entity/.style={             draw,     },     every property/.style={         inner xsep=0.20cm, inner ysep=0.075cm, anchor=west, text width=1.75in     } } \def\property#1{\node[name=\entityname-#1, every property/.try]{\propertysplit#1;};} \def\properties{\begingroup\catcode`\_=11\relax\processproperties} \def\processproperties#1{\endgroup%     \gdef\propertycode{}%     \foreach \p in {#1}{%     \expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter\propertycode%             \expandafter\expandafter\expandafter{\expandafter\propertycode\expandafter\property\expandafter{\p}\\}%     }%     \propertycode% } \def\propertysplit#1:#2;{#1:\hfill#2}  \def\entitynamenode{% \node[every entity name/.try] (\entityname-name) {\entityname}; \draw (\entityname-name.south west) -- (\entityname-name.south east); \\[1ex] } \tikzset{   every entity name/.style={every property/.try, align=center} } \begin{document} \begin{tikzpicture}[every node/.style={font=\ttfamily}, node distance=0.5in] \matrix (m1) [entity=Employee] {     \entitynamenode     \properties{         Username:,         Password :  varchar(255),                 Name :  varchar(255),         LastName :  varchar(255)     } }; \matrix (m2) [entity=Student] {     \entitynamenode     \properties{         Username:,         Password :  varchar(255),                 Name :  varchar(255),         LastName :  varchar(255)     } }; \draw [->] (m1) -- (m2); % <-- it break's here... %\draw [one to omany] (Employee-Username:) to node[above]{label} (Student-Username:); \end{tikzpicture} \end{document}      Edit: this is a Crow's Foot Notation for visualizing IT Database structures:


Our six month old daughter cant sleep on her own , a loud scream is an indicator that she wants to sleep , if all other things are ruled out.We need to take her to the swing and sing to make her sleep or at times if this does not work then we need to take her on the chest and roam around in the room.  Hence my question is how to train an infant() to sleep on her own?

Our son is about to turn 3 months but he is yet to sleep on his own (as in we put him to sleep, put him down on the crib then he sleeps for few hours). He only sleeps when he is carried during the day, the moment we put him down he wakes up crying. At night, he sleeps with us on the bed where he is right next to his mommy. We blame ourselves for letting this happen but now my wife can't do anything during the day but carry him.  What can we do to break him out of this habit? Any pointers would be great appreciated.


I am working on a project with an energy friendly MCU from Silicon Labs. The EFR32BG1B132F256GM32 to be exact. My goal is to use as little power as possible to maximize the lifespan of the CR2032 battery I am using to power the application. The consumption in idle and the lowest energy mode possible for what I am doing turns out to be like 4uA which is to be expected according to the datasheet. Now the problem:   I have a reed switch, one side is hooked up to the VDD rail and the other side to a GPIO pin. The GPIO features pull up or pull down and button debouncing internally. In my case I have button debouncing and the pull down enabled. If the reed switch is open, the current draw remains at 4uA, but if it closes, the current goes up to 80uA and remains there until the switch is open again. I assume since there is a path from VDD to GND via the pull down resistor power gets dissipated according to its resistance (unknown - could not find it in the datasheet..). But the problem is, that the application I want to use the reed switch in, holds it closed like 50% of the time and I cannot afford the high current draw during this time. I also tested it with pull up and the other side of the reed connected to GND - obviously same result. What could I do to resolve this? I thought about letting the pin floating and use a very high pull down like 10M externally but I also do not want the switch to trigger if it gets touched or something. Any comments are appreciated!

The usual way to wire up a SPST switch to a MCU is by means of a pull-up resistor. However, this wastes current when the switch is closed. If this switch is used to wake up the MCU from sleep, then this current (100-500 µA) is significant compared to the sleep current (< 0.1 µA). I imagine increasing the resistor value up to megaohms wouldn't be practical for a number of reasons. So is there a better way to interface a SPST in general? I have a couple of pins on the MCU to spare (but keep in mind the MCU has to be put in sleep most of the time - it should wake up and do its stuff only when the switch state changes).  The only solution that comes to my mind is to basically use the pull-up scheme, but buffer it through a P-MOSFET/N-MOSFET pair for increased input impedance.  And yes, I realize the solution is trivial if we were dealing with a SPDT or a push-button.


Just picked up a new laptop and found an extra terrabyte partition on it that wasn't on the original listing ( bought on ebay ).  Was just curious if there was any reason not to use this extra partition for storage?  When I mounted the partition and attempted to add a random test file it expected me to be root , so thought I would double check before making any other changes.

I'm very new to this and I've been at trying to fix this problem for about two hours to no avail.  I just finished getting my new computer put together and installed a new 2TB Seagate hard drive as a secondary drive (my boot drive has no problems at all). I have it formatted into two petitions, one in ext4 through GParted. I want to use this partition to store extra files and programs (specifically games and CAD stuff). I went to make a steam library folder in it and found that it's read only. It is at /dev/sda1  I first attempted to reformat it to no avail. I looked around for some help (most of what I found related to external storage) and tried a few things through the terminal to change the owner.  mount /dev/sda3 /mnt/   Returned "only root can do that."  I'm stuck past here, I've tried a couple other things I can't hunt down now, but every attempt gives an access problem to me. How can I change this and regain access? Are there more effective ways to map/install this drive for this purpose to avoid this problem in the future? Thank you!


I just installed newer versions of grep and vim to my local ~/bin directory.  I have the path added via PATH=$PATH:$HOME/bin in my .bash_profile.  When I try to run either, the version installed in /usr/local/bin launches. How do I override this?

I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this.  This way:  export PATH=~/opt/bin:$PATH   or this?    export PATH=$PATH:~/opt/bin


On a surface embedded in Euclidian space, where the metric signature is all positive, it is possible for a particle traveling along a geodesic to encounter a curved bit and then get turned around so that it heads in the opposite direction.  Could there be a manifold that did the same turning-around trick, but in a timelike direction? Would this create particles for which increasing proper time corresponded to decreasing coordinate time?

What exactly are . In a metric in which they would exist, what would they look like. What would it be like travelling through them? It obviously wouldn't look like a door. Would it be a region of space that if you wonder into, it can happen that see your past self?


I have just approved a  but realized I should have in fact reject it. I am able to click back to the aprroval page but am not sure how I can amend my approval of the edit. Does anyone have experience in this?  (excluding tests)

I goofed and rejected a suggested edit, a vote that was actually directed at the previous edit that I was reviewing. As this is unfair to the user who posted the suggested edit in question, is there any way in which to change/cancel my reject?


first time on this side of the StackExchange.  Quick question:     My dream is to code a chess game, and then have the AI I developed   checkmate me legitimately.   vs.      My dream is to code a chess game, and then have the AI I developed   legitimately checkmate me.   Also, is that comma okay to add pacing to the sentence?

For example:     Ever wish you could share information broadly   Could it be rewritten to:     Ever wish you could broadly share information   Are there any rules for the position of the adverbs.


I found the following sentence in Longman Dictionary of Contemporary English (5th Edition):   You can’t expect them to sit still for that long, children being what they are.   For me it sounds weirdly and ungrammatically because it seems that the noun 'children' leaves with no verb. I wish to use 'being' in the following way:   Being what they are, children can't sit for that long.   Or:   When children are being fidgety, they can't sit for that long.   Is this correct use of 'being' in the first example? If this is correct use, what I miss?

Which is correct, and why?     some days we went on adventures — him maneuvering our scooter, me resting my chin …   or     some days we went on adventures — he maneuvering our scooter, I resting my chin …


I am not sure if this question fits this stack exchange, but I could not any other that seemed more appropriate. Here it goes.  Say person A is a U.S citizen with 3 years of credit history. Person B is an international (neither citizen nor permanent resident) and has 5+ years of credit history and has lived in the U.S for the past decade on student/job visas. Then my question is, can one determine their citizenship/immigration status correctly by  looking at only their credit reports?

I have a good friend in USA who is a permanent resident and is married to a US citizen.  They have only one income (although his income is a bit over $100K per year) and his wife (who is the citizen) has not had any income for over a decade. She also does not have any debt. They have common budget and he had paid off the little bit of debt she had (less than $4K) last year.  His own debts are moderate (less than $10K total on revolving credit + two car loans totaling about $38K). Neither one of them has any bad credit markings on their credit report. They have been married for over 20+ years but moved back to USA about 4 years ago (they lived abroad because of his work and kept filing the international tax returns to IRS).  Anyway, he told me that her FICO score is about 50 points higher than his.  Could this be caused by that he is a permanent resident instead of a citizen?


First off, I'm new to C#, and this is the first program I've written that uses threads. Sorry if it's a bit basic.  Here's my app:      class Program {     static void AddNumbers()     {         int count = 0;           for (int counter = 0; counter < 90000000; counter++)         {             count += counter;         }     }      static void Main()     {         Stopwatch stopwatch = new Stopwatch();         stopwatch.Start();          for (int i = 0; i < 50; i++)         {             // Non-threaded             //AddNumbers();             //Console.WriteLine((i + 1).ToString());              // Threaded             new Thread(() =>             {                 //Thread.CurrentThread.IsBackground = true;                  AddNumbers();                 Thread.Sleep(1000);                  Console.WriteLine((i + 1).ToString());             }).Start();         }          stopwatch.Stop();         Console.WriteLine("Time elapsed: {0:hh\\:mm\\:ss}", stopwatch.Elapsed);          Console.ReadLine();     } }   It simply loops i times and adds a bunch of numbers each time. When I run the AddNumbers() version non-multithreaded, it correctly displays 1, 2, 3... etc, but when I run it multithreaded, it returns the same indexes 2-3 times, skips some, and returns the stopwatch value before all the threads have executed.  Can someone please help spot where my error is and most of all clarify my thinking about how threads work in C#? Thanks!

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


I have a source point table in SRID:4326, and to make it look geographically accurate, I project my project file to SRID:2877 (State Plane CO) (layer still reports source CRS of SRID:4326).  In order to use the Prolong Line feature in Easy Custom Labeling, the project and layer CRS's must match.  But when I set the point layer CRS to SRID:2877 (overriding SRID:4326) the layer moves way over to the middle of Arizona (should be in Denver).  This happens with any of the State Plane CRS's for Colorado Central in the list.  In addition to drawing in the wrong place, it also greatly affects the 'map unit' size I'm using for the symbols and points in my map.  I've tried various datasets from my database and from the City of Denver, with all the same results.  Is there a setting I'm missing to do this accurately?

I have a series of layers of lines (shapefiles) in My Project. The CRS of some are different and to merge them they all must have same CRS.  When I use Processing/Toolbox/Qgis_algorithims/Reproject_layer the reprojection only works if it is allowed to save to temporary file somewhere (it will not change the CRS when I reproject if I try to save and replace it in My Project directory);   I must remove the original from the layer list and reproject the temp file (without changing the CRS) to get it into my project and name it appropriately.  Is there a better way to reproject a layer in Qgis?


How can I calculate 3D surface area base on slope in GIS for each morphological units in watershed?

I've got a polygon feature class with Z values enabled. The polygon entities represent billboards. I'm looking for a way to measure the front surface area of this entities - i.e the area of the billboards from one side.  Can I do this using a Geoprocessing tool?  Some snapshots    Polygon in ArcMap    Polygon in ArcScene


I have upgraded from Ubuntu 17.10 to 18.04 using the Software Updater, vbut after the reboot, the boot is stuck at a black screen with some text and each line starting with a  green [OK]. I don't want to clean install the OS again as I have some important files on the hard drive.  Here is an image of the black screen.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I'm unable to get my Ubuntu Desktop GUI. I tried from recovery mode but able to accessing GRUB and file system mounting in root mode. How do I backup data?

When I login, nothing happens.   I am presented with my desktop wallpaper.    No Dash, no Launcher, nothing.


When you subscribe to a tag you get mail about new questions for that tag. If you yourself write a question with a tag you are subscribed to this question will be included in mail updates about that tag. This seems unnecessary since you already know about questions you have written yourself. It is not that bad if you get mail updates about a tag where your question is one of several but it is annoying for tags with less traffic where it can happen that you get mail updates for a tag where your question is the only listed one.  I suggest to either simply not include own questions for in mails from subscribed tags or to provide an option to not include them.

I subscribed to the tag "ecm", so I often receive such emails:    PROBLEM: Many of these email are about questions written by me. (I am quite active in that field, usually answering but also often asking)  Would it be possible to not send me emails about questions written by me?


The below command works in command line  rsync -avh -r /Source/09_03_2016/ /Destination/ echo $(basename !:3)      Output 09_03_2016   But when I do this in shell script it does not work  #! /bin/bash  /usr/bin/rsync -avh -r /Source/09_03_2016 /Destination/; echo $(basename !:3)      Output  !:3

I understand the following error is due to ! used for history expansion:  $ echo "Hello!Tim" bash: !Tim: event not found   However if I put the command into a script and run the script, there is no problem:  $ cat myscript echo "Hello!Tim" $ bash myscript  Hello!Tim   Why is that? Does the bash manual mention the reason?


We consider  a quantum circuit that takes as input two vectors $\vert x \rangle$  and $\vert y \rangle$. The output of this quantum circuit must contain the reflected vector of   $\vert y \rangle$  with respect to  $\vert x \rangle$  (and whatever else that is irrelevant to the purpose ).  that this operator is nonlinear in the first argument, and in general is not unitary.  So no chances of implementing this operator with a quantum circuit, in complete generality.  However, In the reference linked in my question  it is proved that a deterministic programmable gate array must have as many Hilbert dimensions in the program register as programs are implemented (consequence of the orthogonality requirement of the program states). If each program is given as input on n qubits, then n programs would require the array to have $n^2$ qubits in the program register, but in principle possible. In our case $\vert x \rangle$ is the program, the reflection axis. So we can implement all the operators $U_{\xi_k}$ described below  for $k=1.2.3......n$  And that means that these operators allow an implementation (with one quantum circuit with $n^2$  input "program" qubits ) as long as the program states are orthogonal (as explained above ).   And that means that the  can be implemented. This consists in the following $n$ steps: $$|\xi_1\rangle = U_s U_\omega |s\rangle, \quad \vert \xi_2 \rangle = U_{\xi_1} U_\omega \vert s \rangle, \quad \cdots \quad  \vert \xi_n \rangle = U_{\xi_{n-1}} U_\omega \vert  s \rangle, $$ where $U_\omega\equiv I - 2  (\vert\omega\rangle\langle\omega \vert )$ and $U_s \equiv 2\vert s \rangle \langle s \vert - I$.  This algorithm finds a solution exponentially faster than Grover's. In other words, for a fixed large $n$ we can actually build this complex quantum circuit that would solve problems of practical interest efficiently.  The difference between this and the original Grover algorithm is that we perform an inversion about the previous state vector of the algorithm, rather than about the mean, at each step.  Note that the optimality proof in Grover 's original paper doesn't include operators with "program"  registers as input.   Question  1. Is this algorithm  possible to implement,  in principle?  Question 2. Is this algorithm exponentially faster that Grover, for a fixed, chosen n?  The way "exponentially faster" is defined implies considering arbitrarily large values of n,  but the meaning of this question is clear from the context.   My calculations indicate that both questions allow "yes" answers, but I could be wrong.   Another related question I asked previously can be found .

This question was inspired by the following reference:    We use the usual notation.  $N = 2^n$ ,  the number of all possible n-bit strings . The oracle  $U_\omega$ can be put in the form    $U_\omega=I - 2  (\vert\omega\rangle\langle\omega \vert )$  $U_\omega$ is a reflection of any vector on the hyperplane orthogonal to $\vert\omega\rangle$  The vector $\vert s \rangle $ and operator $U_s$ are introduced.   $\vert s \rangle = H^{\otimes n} \vert 0 \rangle^{\otimes n}$ , where $H^{\otimes n}$  is the n-qubit Hadamard transform.   Operator $U_s$ reflects any vector with respect to $\vert s \rangle$  $U_s = 2\vert s \rangle \langle s \vert - I$      The Grover iteration is $U_{Grover} = U_s U_\omega$  $U_{Grover}$ rotates (at every iteration) the initial vector $\vert s \rangle$ towards the desired vector $\vert\omega\rangle$ by the angle $2\theta$, where $sin\theta =  \frac{1}{\sqrt{N}}$  We note that a reflection is expressed by a unitary matrix. That means that the operator defined below is represented by a unitary matrix, therefore a quantum circuit can be designed in order to implement this operator (Edit. This statement was proven false by the answer to this question).    We define the operator:  $U(\vert x \rangle , \vert y \rangle  ) = ( \vert x \rangle , U_x \vert y \rangle) $  , where  $U_x \vert y \rangle$ represents the reflection of $\vert y \rangle$  with respect to $\vert x \rangle$  In the following relations the vectors  $\vert \xi_i \rangle$ are implicitly defined based on the action of the operator U.  We consider the following sequence of transformations (based on the definition of the operator  U):  $U(\vert s \rangle ,  U_\omega\vert  s \rangle  ) = (\vert s \rangle ,  U_sU_\omega \vert s \rangle) = (\vert s \rangle , \vert \xi_1 \rangle )$  $U(\vert \xi_1 \rangle ,  U_\omega\vert  s \rangle  ) = (\vert \xi_1 \rangle ,  U_{\xi_1}U_\omega \vert s \rangle) = (\vert \xi_1 \rangle , \vert \xi_2 \rangle )$  $U(\vert \xi_2 \rangle ,  U_\omega\vert  s \rangle  ) = (\vert \xi_2 \rangle ,  U_{\xi_2}U_\omega \vert s \rangle) = (\vert \xi_2 \rangle , \vert \xi_3 \rangle )$  .......................and so on..........................  $U(\vert \xi_{n-1} \rangle ,  U_\omega\vert  s \rangle  ) = (\vert \xi_{n-1} \rangle ,  U_{\xi_{n-1}}U_\omega \vert s \rangle) = (\vert \xi_{n-1} \rangle , \vert \xi_n \rangle )$  In other words, the vector to be reflected is fixed but the reflection axis is variable (in the original Grover algorithm it's the other way around ).  At every step  K of the algorithm above  the initial vector $\vert s \rangle$ is rotated towards the desired vector $\vert\omega\rangle$ by an angle which is at about $2^K\theta$ (as order of magnitude ), where $sin\theta =  \frac{1}{\sqrt{N}}$.  That means that this algorithm will only need about  $log_2 N$ (as order of magnitude ) steps  to reach the target.  Question 1. Can a quantum circuit be designed, that implements this algorithm, in principle ?  Question 2. Does this algorithm present an exponential speedup,  when compared to Grover's algorithm?  Edit. Unfortunately nothing from what  I tried seems to work. You need a quantum circuit that takes as input the vector to be reflected and the vector that represents the reflection axis. The output of the quantum circuit must contain the reflected vector. That does not seem possible,  as far as I understand. This reflection implementation problem,  if ever solved,   would lead to an exponential speedup of Grover's algorithm.


I'm trying to find out how many monospace characters fit in an element (e.g. div), knowing the size and the font-size.  For instance I expected the result being:  {    x: Math.floor(divWidth / fontSize)  , y: Math.floor(divHeight / lineHeight) }   But it seems that they are not right: for a font size 50px and width: 100px, the expected answer would be 2, but it is 3:    div {     font-family: monospace;     background: black;     color: lightgreen;     font-weight: bold;     width: 100px;     height: 100px;     font-size: 50px; } <div> 123 123 </div>     For the example above the answer should be:  {    x: 3 // 3 chars horizontally  , y: 1 // 1 char vertically }   How to compute these values automatically?  var $div = $("div"); var divSize = {     w: $div.width()   , h: $div.height() }; var fontSize = parseInt($div.css("font-size"));

I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface?  If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting  and different type sizes (and all browsers for that matter).


All who came to possess the One Ring after Sauron, who possessed ambition for great deeds (basically not hobbits) have sought to master the Ring and use its power to serve their cause. Few, such as Galadriel, have successfully resisted the Ring's overpowering will and temptation.  Considering the Ring's description above, what will happen if a Nazgûl successfully retrieves the One Ring? Will he truly return it to Sauron obediently? Or will he, like all who possess a greed for power, be driven to keep, master and control the One Ring, his already-feeble will utterly unable to resist such temptation?

We are told that Sauron achieved control over the nine men because they wore the nine rings of power and the ruling ring controls the other rings and their wearers.So, if a Nazgul would find the One Ring and find the will to use it, shouldn't they be able to break free of Sauron's influence?


When TeXstudio completes a command like \label{key} that requires an argument a placeholder is positioned between curly brackets. The placeholder is surrounded by a red frame. When jumping forward through the document using CTRL+Leftarrow or CTRL+Rightarrow jumping to the placeholder takes precedence over jumping to next/last words and even takes you across multiple lines.  While I want this behaviour I also want to be able to jump single words in the direction of the last placeholder after it is set to the wanted content. To do this I need to somehow finalize the placeholder indicated by the removal of the red frame. I can do this by a number of combinations of moving the cursor into the red frame, pressing Enter and then undoing the Enter press.  However, that doesn't feel like a forward way to composing a document and I suspect there is a right way to make a placeholder lose its jump point property. So, what is the correct way to finalize a placeholder?

In using TeXStudio to edit my text file under Debian, I have a problem in locating the cursor while using the auto-completer to complete a pair of braces. There is a little box frame holding the place of the right brace, and the edges of the box cover the shining cursor when the cursor moves to one of the edges of the box frame. Therefore, I cannot distinguish whether the cursor is on the left or right side of the box frame. It is especially annoying when I want to delete a brace because I don't know where the cursor is at that moment. How can I solve this?


What is the Linux command to check the server OS and its version?  I am connected to the server using shell.

Often times I will ssh into a new client's box to make changes to their website configuration without knowing much about the server configuration. I have seen a few ways to get information about the system you're using, but are there some standard commands to tell me what version of Unix/Linux I'm on and basic system information (like if it is a 64-bit system or not), and that sort of thing?  Basically, if you just logged into a box and didn't know anything about it, what things would you check out and what commands would you use to do it?


I wrote the following very simple program as I'm trying to make an animation using pstricks and multido, but I get "undefined control sequence" on the end pspicture line. Can anyone just tell me what's wrong with my code? I've been trying for a few hours to read documentation on multido and the pspicture environment. I can't see where I've used any wrong syntax.  % growingCircle.tex % xelatex growingCircle % convert -delay 4 -loop 0 -density 200 -alpha remove growingCircle.pdf growingCircle.gif  \documentclass[border=0pt,pstricks]{standalone} \usepackage{pstricks-add}  \newcommand\FPS{25} %25 frames per second  \newcommand\Period{5} %Length of clip  \newcommand\TotalFrames{\FPS*\Period}  \begin{document}  \multido{\n=0.00+0.01}{\TotalFrames}{   \begin{pspicture}(-3,-3)(3,3)     \pscircle{\n}   \end{pspicture}}  \end{document}


I'm learning Java by trying to make a simple Rock-Paper-Scissors game in Eclipse:  package com;   import java.util.Random; import java.util.Scanner;   public class Game {      public static void main(String[] args) {         Game game = new Game();         game.playerChoice();         game.aiChoice();         game.playGame();     }  public void playGame() {      if (playerChoice() == "Rock") {         if (aiChoice() == "Rock") {                 System.out.println("Tie!");             } else if (aiChoice() == "Paper") {                 System.out.println("AI wins!");                 } else {                 System.out.println("You win!");                 }          } else if (playerChoice() == "Paper") {             if (aiChoice() == "Rock") {                 System.out.println("You win!");             } else if (aiChoice() == "Paper") {                 System.out.println("Tie!");             } else {                 System.out.println("AI wins!");             }          } else {             if (aiChoice() == "Rock") {                 System.out.println("AI wins!");             } else if (aiChoice() == "Paper") {                 System.out.println("You win!");             } else {                 System.out.println("Tie!");             }         }     }      public String playerChoice() {          Scanner scanner = new Scanner(System.in);         String word = null;          try {             System.out.println("Type Rock, Paper, or Scissors");             word = scanner.next();             System.out.println(word + " is saved as your choice");         } finally {             scanner.close();         }         return word;     }      public String aiChoice() {          String[] wordlist = {"Rock", "Paper", "Scissors"};         String word = wordlist [new Random().nextInt(wordlist.length)];         System.out.println("AI has randomly picked " + word);         return word;     } }   When I input "Rock", "Paper", or "Scissors" in the scanner input I get the following in the console:  Type Rock, Paper, or Scissors Rock <--- This is what I input into the console Rock is saved as your choice AI has randomly picked Scissors Type Rock, Paper, or Scissors <--- This unintentionally repeats Exception in thread "main" java.util.NoSuchElementException     at java.base/java.util.Scanner.throwFor(Unknown Source)     at java.base/java.util.Scanner.next(Unknown Source)     at com.Game.playerChoice(Game.java:53)     at com.Game.playGame(Game.java:17)     at com.Game.main(Game.java:12)   What am I doing wrong that causes this exception and why does the System.out.println("Type Rock, Paper, or Scissors"); repeat itself? Thank you.

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I wanted to change some things in Unity. So how to download and compile the code?

I'd like to know how I would build Unity from source code in the current development release. Please cover the following topics:   Which packages are needed to compile Unity? Where would I get the current source code? What are the steps to actually configure and compile Unity? Is it possible to safely run the latest version alongside the version from the repositories?


I am asking for a specific modern opengl tutorial.  I need a tutorial that does not skip to explain any lines of code. It should also include different independent objects moving/rotating (most tutorials use only one object), as well as imported 3d objects and collision detection for them. Maybe not collision detection, but I want to see how to use OpenGL with a real project. It is important for me to know how in a good way I can combine modern opengl and a virtual environment structure.  It should also avoid stuff that won't be used. Arcysnthesis for example gives a new concept, and after teaching it, in the next tutorial, it explains how bad it is for performance and introduces another method.  Do you know any?

I stumble upon the search of a good resource to start with OpenGL (3.0 or later) . Well, I found a lot of books but none of them can be considered a good resource!   Here two examples:   OpenGL Programming Guide (7th edition)  This is FULL of deprecated material! Almost every chapters begin with a note about that.  OpenGL Superbible (5th Edition)  This book uses a library created by the author to explain the main arguments, hiding  what you want to learn! I don't want to learn how to use your library! I want to learn OpenGL!   I hope that you understand this is not the same question like "hey I'm not able to use Google... tell me how to learn OpenGL". I've just finished a full and deep search but I can't find a good and complete resource to learn the "new" OpenGL avoiding deprecated topics.  Can someone heading me in the right direction? I know C++ and I have 10 years of experience in development... where I can find a good resource?! I want to spend time on it and I want to learn deeply.


For grabbing a value from a li tag and putting into an input filed  i use the data-value. My list tags look like this:
grab value
   The js:  $(".set-value").click(function(){                   var s = this.dataset.value;                                 $(".set-input").val(s); });   My input field looks like this:  <input class="set-input" type="text" value="" />   When click on grab value it puts test in to the input.! That works  fine!  When i do submit the value, i use an ajax call. After the ajax call, all li tags are dynamically reloaded. Problem is: when i click again on test, sending the value to the input field does not work anymore. After a hard refresh, it DOES work again. I checked the following after the ajax:   jquery core file is still loaded the js is still in the DOM    So why it does not work anymore for the second time?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I'm pretty sure the answer is "no," but there's more to this question.  If dist-upgrade often downloads kernel upgrades, will my Ubuntu server always be stuck at a certain kernel if I always just do sudo apt-get upgrade? Or do I not really need the kernel upgrades? I assume I'll still receive security patches and other software updates?

I've got an Ubuntu 8.04 LTS server.  There are several packages which are "kept back" ("the following updates have been kept back") when I do an apt-get upgrade.  It's my understanding that I can do an apt-get dist-upgrade to upgrade these packages, but I have a few concerns:   If I do a dist-upgrade, will I be upgrading from 8.04 to higher version (8.10 I guess)?  If so, what's the point of 8.04 being "Long Term Support" (LTS)? Is this a "dangerous" process?  I'm assuming that packages are kept back because there are new packages that they depend on.  Does dist-upgrade simply pull the new packages and do a fairly straightforward upgrade, or are there caveats to look into?


Python 3.6:  >>> x = [0, 1] >>> y = [[]]*2 >>> z = dict(zip(x, y)) >>> z {0: [], 1: []} >>> z[0].append(0) >>> z {0: [0], 1: [0]} >>>   Why did it append to both? I tried without zip and it worked fine. Please explain this behavior

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


A product is defined for $n\in\mathbb{N},$ as  $$a_n=\left(1-\frac{1}{2^2}\right)\left(1-\frac{1}{3^2}\right)\cdot...\cdot\left(1-\frac{1}{n^2}\right).$$  a) Show that the limit $\lim_{x\rightarrow \infty}a_n$ exists.  b) Compute the limit $\lim_{x\rightarrow \infty}a_n$.    a) For the limit to exist, we have to show that the decreasing sequence is bounded below. We have that $a_n>0$ and  $$\frac{a_{n+1}}{a_n}=\left(1-\frac{1}{n^2}\right)<1\Longleftrightarrow a_{n+1}=a_n\left(1-\frac{1}{n^2}\right)<a_n,$$  This shows that the limit exists.  Is this line of thought correct?  b) Here I'm stuck. I'm not sure what to do next. I tried to express $\ln(a_n)$ as a sum but to no avail.  NOTE: No expansions of any sort is to be used. Only elementary calculus.

Evaluate the infinite product $$\lim_{ n\rightarrow\infty }\prod_{k=2}^{n}\left ( 1-\frac{1}{k^2} \right ).$$  I can't see anything in this limit , so help me please.


I desiged P-MOSFET for reverse voltage protection, without gate resistor. The reason that I tend to use it is protect from reverse DC voltage when someone connects the battery.  Do I need a gate resistor? (When someone connects the battery correctly it will be in the ON state, otherwise the PMOS will be OFF.) Second question: How does a gate resistor reduce ringing?

I have n mosfet gate connected to  logic and Id is about 100mA. Both 4043 and mosfet has +5v. I have plan to use  mosfet  Questions are: How large gate resistor i need between 4043 and mosfet? Logic output is sometimes put on rapidly. How fast? Motherboard hdd led controls that. Do i need to place pull down resistor from logic to -0v, between 4043 and mosfet?


$f$ is a non constant entire function such that $\mathbb{C}\setminus f(\mathbb{C})$ contains a disk of radius 1, then $f$ is constant. My thoughts: if we can show $f$ is bounded then by Liouville's theorem we are done. I'm not sure how the given condition implies that.

Let $f$ be an entire function s.t $f(\mathbb{C}) \cap B_R(z_0) = \varnothing$ for some $z_0$ and some $R$. Then $f$ is constant.  I guess since the image of the whole plane isn't dense then $f$ doesn't have an essential singularity at infinity. Now I have to exclude it has a polar singularity at infinity..


According to  (2017/4/15, p. 3)     The space between columns is controlled by the length parameter \columnsep.   Unfortunately, there is no example showing how to use this parameter.  How can the space between columns be set?    Attempted solution  I tried , as follows:  \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} \begin{multicols}{2} \setlength{\columnsep}{0cm} \lipsum[1-4] \end{multicols} \end{document}   but the resulting pdf file is the same whether or not the line \setlength{\columnsep}{0cm} is commented out, namely

I have a document that uses twocolumn with scrbook. How can I set the width of the space between the two columns?


If one student received A, another B, and the other C,  Can I use the following expression?  The students received A, B and C, respectively.

C# Textreader and TextWriter are the another way to read and write file respectively...      I added a text box and button I called tbUpdate and btUpdate respectively...      In the right hand column, we’ll use three TextBlocks; the first and third as fixed labels (with the values Likeability: and % respectively)...      WorkerSupportsProgress and WorkerSupportsCancellation which hold true/false values that let the backgroundworker report progress or cancel an async progress respectively...   While learning many the many different aspects of development, I have not come across a book or series where the word respectively is not used in explaining an example. Honestly I guess it's implied that we know what it means. To me I always kind of skim over it because I can usually figure out what they're saying through the surrounding context. Can anyone explain this?


Here is a simple example given to illustrate overriding an operator in C++. I don't understand the meaning of the & in 'CVector&' in lines 9 and 12. It doesn't look like they are passing the address of a CVector, it seems like the & can be ommitted, since the operator is just taking in a CVector as a parameter.   #include <iostream> using namespace std;  class CVector {   public:   int x,y; CVector () {}; CVector (int a,int b) : x(a), y(b) {} CVector operator + (const CVector&); };  CVector CVector::operator+ (const CVector& param) { CVector temp; temp.x = x + param.x; temp.y = y + param.y; return temp; }  int main ()   {    CVector foo (3,1);    CVector bar (1,2);    CVector result;    result = foo + bar;    cout << result.x << ',' << result.y << '\n';    return 0;   }

I know references are syntactic sugar, so code is easier to read and write. But what is the difference between a pointer variable and a reference variable?


How can we prove that if $a_1\sqrt{n_1}+a_2\sqrt{n_2}+\dots+a_k\sqrt{n_k}\in\mathbb{Q}$ with $a_1,a_2\dots, a_k\in\mathbb{Q}^{*}_{+}$, then the natural numbers $n_1,n_2,\dots, n_k$ are perfect squares?  I have proved it for $k=1,2,3$ but for $k\geq 4$ I don't find anything. I couldn't show even that $\sqrt{2}+\sqrt{3}+\sqrt{5}+\sqrt{7}\notin\mathbb{Q}$.

My question looks quite obvious, but I'm looking for a strict proof for this:     Why can't the sum of two square roots of non-perfect squares be an integer?   For example: $\sqrt8+\sqrt{15}$ isn't an integer. Well, I know this looks obvious, but I can't prove it...


Five sentences with slight adjustment in the position of the adverb:  Gladly I would've come. I would have come gladly. I would gladly have come. I gladly would have come. I would have gladly come.  Do these sentences convey the exact same meaning or is there a subtle distinction? Further Edit Background: I read a claim in a  that (2) is a response to a hypothetical question about a situation in the past with the current mindset of the speaker, while (4) is a response with the mindset the speaker actually had at that point in the past. But I am not completely convinced. So, I'd like to specifically ask if it is just a matter of emphasis, or there are indeed these subtle distinctions that can get overlooked in everyday speech. p.s. I understand the question might be trivial from a native speaker's point of view. I am a bit confounded, though, and I do not think the other posts on the website address my doubt. Therefore, if you must downvote, kindly do so after reading the entire question. Thank you.

For example:     Ever wish you could share information broadly   Could it be rewritten to:     Ever wish you could broadly share information   Are there any rules for the position of the adverbs.


A script is executed from the shell as ./oximeter. The script, oximeter, has 5 commands: python3 ~/Documents/oximeter/3211ipod.py ls -l pwd cd ~/Documents/oximeter/ pwd  The python script runs as expected.  I would like the script to change the directory as shown in command #4.  When control is returned to the user, the directory remains unchanged. The second pwd returns the desired directory, however when control is returned to the user, pwd indicates that the directory is not ~/Documents/oximeter. Why is this and is there a 'stronger' command that changes the target directory for the user? This is in Ubuntu 20.04.

I just want to write a script which changes my directory.  I put the below commands in the file /home/alex/pathABC  #!/bin/sh cd /home/alex/Documents/A/B/C echo HelloWorld   I did   chmod +x pathABC   In the Terminal, while in /home/alex, I ran ./pathABC, but the output is just HelloWorld and the current directory is not changed.  So what is wrong?


We will look at how this is used.   My question is this:   Is the word how a subordinator in this sentence? If not, what is it?   Are "We will look at" and "this is used" two independent clauses?   Are these independent clauses connected by a word "how"?

I am not familiar with the idea that an adverb can function as a conjunction at the same time. Here are a couple of sentences that are confusing me.     This is the reason why she left him.   ...and     He was transferred to New York, where he was promoted to a higher level.   The  why, where, when, and how seem to introduce a clause. Therefore, can they also be called conjunctions? If yes, would I be right in assuming that relative adverbs can function as conjunctions at the same time?


$$\int_0^{\frac \pi 2} \log(\sin x)dx$$ I tried to use the following substitution, where $I(1)$ is the target integral: $$I(b) = \int_0^{\frac \pi 2} \log(b\sin x)dx \implies I'(b) = \frac \pi {2b}$$ Doing a definite integral on $I'(b)$, I get $$I(1)-I(l) = -\frac \pi 2 \log(l) \implies I(1) = I(l) - \frac \pi 2 \log(l)$$ where $l$ is the lower limit of the integral. I am unable to find a suitable value of $I(l)$ to carry out this substitution. Any help is appreciated!

How to compute the following integral?  $$\int\log(\sin x)\,dx$$    Motivation: Since $\log(\sin x)'=\cot x$, the antiderivative $\int\log(\sin x)\,dx$ has the nice property $F''(x)=\cot x$. Can we find $F$ explicitly? Failing that, can we find the definite integral over one of intervals where $\log (\sin x)$ is defined?


I am an Insider on the Fast pace for Active Development of Windows. 5 days ago, I had installed the latest Insider update released on 13th December, 2017 (Build:17063.rs_prerelease.171213-1610). After updating to that, Windows has been saying that my product license is not valid and is asking me to buy a genuine copy form the Store.  The error code is:     0x803F7001   Before this, everything was fine and Windows was activated. I bought this machine with Windows 10 pre-installed. Previously, this same problem had occurred in which Windows was not activated after installing an Insider patch, but it resolved itself in 2 days. How do I fix this?

I had genuine Windows 7 and Windows 8, from some of which I have physical DVD boxes. Later it was upgraded automatically to Windows 10.  Recently I tried to make ISO with Media Creation tool, made ISO and install it into virtual machine within the same computer, I have original Windows 10. During installation it asked me for product key which I had none and answered "I have none".   Now inside Virtual Box I have activation problem. It says it can't activate and suggests to do something, including change product key. Inside properties of My PC of activated computer I see product ID which has different format and I can enter it into virtual machine.  Is it possible to overcome?


I've got an image and a text/border that would like to position in the center of the image. However, even though I am using text-align and I've tried to use vertical-align, the text/border is at the top-left of the background image and not in the center. This is the code I have so far   .banner-background {   background-image: url('https://res.cloudinary.com/practicaldev/image/fetch/s--eXgVdE2K--/c_imagga_scale,f_auto,fl_progressive,h_900,q_auto,w_1600/https://dev-to-uploads.s3.amazonaws.com/i/ux6uf870i7esod0sx4sw.png');   background-size: cover;   height: 40%;   background-position: center;   background-repeat: no-repeat; }  .banner-background .background-text {   background-color: rgb(0, 0, 0);   background-color: rgba(0, 0, 0, 0.4);   margin: 0;   border: solid #f1f1f1;   border-radius: 10%;   text-align: center;   font-size: 200%;   color: #f1f1f1;   font-family: myFont1;   font-weight: bold;   width: 25%; }

Hello, world!
I am a developer!

    So far, it is displaying like this:

I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support.
Div to be aligned vertically
   How can I center a div vertically in all major browsers, including Internet Explorer 6?


A tank of 425 litres capacity has been filled with water through two   pipes, the first pipe having been opened five hours longer than the   second. If the first pipe were open as long as the second, and the   second pipe was open as long as the first pipe was open, then the   first pipe would deliver half the amount of water delivered by the   second pipe; if the two pipes were open simultaneously, the tank would   be filled up in 17 hours. How long was the second pipe open?   I have solved this problem. But I need a shortcut method to solve this problem, the way which people would do in GMAT, CAT or other competitive exams where time is limited.  Attempt:  $$a(t+5)+bt=425 \tag 1$$  $$2at=b.(t+5) \tag 2$$  $$(a+b)*17=425$$  $$(a+b)=25 \tag 3$$  Solving these I got a quadratic equation:  $$15t^2-205t-300=0$$  $$t=15$$  Possible duplicate: How my question is different: I want a shortcut method to solve the problem. The answer to the previously asked question is not shortcut.

A tank of 425 liters capacity has been filled with water through two pipes, the first pipe having been opened 5 hours longer than the second. If the first pipe were open as long as the second pipe, the first pipe deliver half the amount of water delivered by second pipe; if the two pipes were open simultaneously, the tank would be filled up in 17 hours. How long was the second pipe open?    a. 10 b. 12 c. 15 d. 18


In simplex method,  is it possible that entering and leaving variables are same? When can this happen?. If it cannot happen, what stops it from happening.

Could someone give me a hint on this question, which is a past exam question:     Under what circumstances will an entering variable in the network simplex method be the same as the leaving variable?   Thank you for your help.


The Apocalypse World and the derived games usually state that if the player can describe that he's doing something, he does that.   Unless there is a move for that. If there is a move, and the move is localized in one playbook, the logic gets fuzzy.  But if, for example, the character tries to bend bars or lift gates in Dungeon World? Can he do that? There is a move for that in the Fighter's playbook, but what if the character in question is a Barbarian? What if that Barbarian has a bigger Str score than the party's Fighter? Will that depend on whether there is a Fighter in the party?  How to handle characters attempting to do something others have specialized moves for?

So in Dungeon World, everything breaks down to 'moves'.  What about situations where a move is not available, but a check of some sort is called for, such as in the case of a non-fighter who wants to kick down the door?  What mechanism do you use to resolve that situation? Is there the equivalent of a skill check?


It seems that the Group Policy Editor (gpedit) is missing for Windows 10 Home. If you do WindowsKey+R and enter "gpedit.msc" you get the following message:     Windows cannot find 'gpedit.msc'   What are the steps required to install gpedit on Windows 10 Home? Is there a Microsoft sanctioned download of gpedit from the Microsoft domain?

I want to make some changes to Windows that require using the Group Policy Editor (gpedit.msc).  Unfortunately the Group Policy Editor is not included with the Starter Edition, Home and Home Premium editions of Windows.  How can I install it?


Does anyone know a way to rename the getter and setter of a variable when I change the name of it?  The renaming function in eclipse is very useful, but, when I need to rename some variable, after that I need to manually fix the name of the getter and setter.

Is there any way to automatically rename accessor/mutator when a variable they get/set gets refactored -> renamed (Eclipse 3.4)?


I have the following interfaces/routes :   # ip route show 192.168.101.0/24 dev eth0  proto kernel  scope link  src 192.168.101.10 192.168.8.0/24 dev tun0  proto kernel  scope link  src 192.168.8.1 default via 192.168.101.251 dev eth0   Device eth0 is connected to a network with a gateway (192.168.101.251).  My clients are behind an access point (with some hotspot software) which is connected to tun0:  clients -> tun0 -> gateway -> eth0 -> internet   I can ping an internet host from eth0 but my clients behind the hotspot can't access internet through tun0. How do I route packets from tun0 to internet (and back) ?

We have a simple router which has NAT of symmetric type, but because this router doesn't provide us with any debugging interface, we cannot figure out if a specific packet reaches the NAT or not.     Thus we want to setup a LINUX computer making it be a router with symmetric NAT, in this way we can capture all packets to this "NAT" and get the information we want. How can we do this on linux (Fedora system, kernel 2.6.xx)?


I got a hotel card now. My smart gf says I do not need to check out.  She said just throw away the card that the hotel will automatically check me out.  The card is cheap and replaceable.  I fear that if I don't check out, debt collector will come to my home and says hello, you have stayed in our hotel for 5 years and you owe use these bills.  My gf says it won't happen.  Which one is right?

Every time I check out of a hotel, they ask me if my stay went fine, let me review my incidental charges and ask if they should charge the credit card used to check in.   But what if I simply walk out of the hotel without formally "checking out"? They have my credit card on file and these days you don't even have to return your room key if you want to keep a souvenir. Would it be rude and create more work for hotel employees?  The question arose after spending 15 minutes in the check out queue at a major US hotel.


Hi I am under 12 years of age and I found out lately that my mom and dad want a divorce what do I do? I want to stop it but I don’t know how.

I am a young teenager, younger than 16. (I do not want to give my age online)    My dad told me he wants a divorce, but I don't want my parents divorced. My dad says he can't stand my mom anymore.  My dad is older than 45 and my mom is older than 40.    If it happens, I would choose to stay with my mom. My dad can cook and drive, but my mom can't. There's a school bus in high school though.    What can I do to prevent this divorce?


We start with an arbitrary length string say 'n'. Now we follow a binary tree which has following property:   At first level:  (i). Starting character from the string is selected (and removed) and it represents the left branch of the binary tree.  (ii). Ending character from the string is selected (and removed) and it represents the right branch of the binary tree. At second level:  (i). Starting character from the string is discarded (and removed) and it represents the left branch of the binary tree.  (ii). Ending character from the string is discarded (and removed) and it represents the right branch of the binary tree.   Above two steps alternate until the string becomes completely empty. So from root to every leaf node, we'll have a path where some characters are selected or discarded. All selected characters in the path, appear in the output at leaf.  We need to calculate the probability of every character with which it'll appear in the output.  My approach:  First character will be selected on the root as left subtree, so all the children below it will have the first character which makes its probability 1/2 for left subtree, whereas when we proceed in right subtree, it'll not be discarded in the right subtree of it. Now again this will be selected as the next left subtree but since we have come down by 2 levels, number of times of appearance in output has reduced by 4 folds. And from here the probability will be $1/8$ and so on...   At the end I'm adding all those probabilities so it comes as:  $1/2 + 1/8 + 1/32 + ... $   But I'm stuck after finding the first character's probability. How to go about the second character and so on. I think I'm in wrong direction.  Please help me with this approach or any new approach which would work in this case.

Given: A list of integers is there.Now there are 2 buckets -bucket A and bucket B.This step is repeated as  long as there are numbers left in the list.Integers from start or end of the list are removed from the list and added to bucket A. The probability of picking a number from the start or the end is equal to 0.20 . Then similarly,the next number picked from start or the end is added to B. Then to A and so on.  Required: Expected values in Bucket A and Bucket B.  Eg  1 ,2m3   1 or 8 can be added to bucket A. 1) 1-> 4 or 8 can be added to B.    a)B picks 4 -> A picks 8    b)B picks 8->  A picks 4 2) 8-> 1 or 4 can be added to B.    a)B picks 1 ->A picks 4    b)B picks 4 ->A picks 1 So E(A)=(((8+4)/2+1)+((4+1)/2+8))/2=8.25    I tried to get a general formula for E(A) and E(B) .I was getting a tree structure with 2^n-1 nodes but I wasn't able to derive a specific formula. Can anyone derive this? I tried for a general list a,b,c,d  having 4 integers.  E(A)=1/4((c+d)/2+b)+((b+c)/2+d))+a/2+1/4((b+c)/2+a+c+(b+a)/2)+d/2   Also,clearly the problem is symmetrical from both ends of the list.That is coefficient of a and d is same, b and c is same in E(A) Can anyone simplify this for any general list having m numbers?


I have just begun with special relativity so pardon me if my question seems too obvious.  In the books I am following, there is an example of time dilation which says:     The half life of muons is $\tau$(in the proper frame of muon). We have muon beam moving with a speed of $0.999 c$ and so the time taken for the beam intensity to reduce to half ,in the lab frame, would be $\tau \gamma$ where $\gamma$ is the Lorentz factor for this beam.   However we can also say, that the people in the lab frame would have aged only $\frac{\tau}{\gamma}$ with respect to the muon frame, because the muons feel that the people in the lab frame are going backwards at the same speed.  Correct me if I am wrong, but I feel that it is a contradiction, that on seeing one way the observers in the lab have aged $\tau \gamma$, and in the other $\frac{\tau}{\gamma}$.  Where I am going wrong?

Suppose we have two twins travelling away from each other, each twin moving at some speed $v$:    Twin $A$ observes twin $B$’s time to be dilated so his clock runs faster than twin $B$’s clock. But twin $B$ observes twin $A$’s time to be dilated so his clock runs faster than twin $A$’s clock. Each twin thinks their clock is running faster. How can this be? Isn’t this a paradox?


I presume this is an odd question but I have to ask..  If I have a js object that looks like this:  $scope.obj1 = {     "name":"John",     "number":"Eleven",     "color":"Red" }   Is there a way to remove an entire property? without re-assigning values to a new object..  So if I want to get rid of "number":"Eleven", I would like the object to look like this...  $scope.obj1 = {     "name":"John",     "color":"Red" }   Thanks!

Say I create an object as follows: let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI",   "regex": "^http://.*" };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI" };


I looked and can't seem to find my question so here it is.  I have a 7th level rogue trickster, who has prepared 2nd level spells and 1st level spells. These of course are all spells known so he can cast them at any time. Now he took up a 1st level wizard class. He found some new spells from a spell book.  Can he learn and prepare 2nd level spells because his casting level is high enough or can he only prepare 1st level spells because his wizards highest level casting is level 1. If so he could prepare in addition to his spell known of 2nd level. Same goes for 3rd level and so on.  DND 5E  Characters levels Int 19 +4 Rogue trickster 7th level Wizard 1st level  Rogue has Spell slots 3 cantrips, 4 first level, and 2 second level spells. Spells known 5 Wizard has Spell Slots 3 cantrips, 2 first level spells, Prepared 5 spells unlimited spell can be transcribed.  Combined they have a spell caster level of 3rd level 3rd level 4-first level spells and 2 second level spells.  Can a rogue 7, wizard 1 transcribe spells of second level into his or her spellbook and prepare them to cast even though his wizard level is not high enough to prepare them his overall caster level is.

The "Your Spellbook" sidebar for the wizard includes the following line:  Copying a Spell into the Book. When you find a wizard spell of 1st level or higher, you can add it to your spellbook if it is of a level for which you have spell slots and if you can spare the time to decipher and copy it.  Does this mean that a Wizard 1/Cleric 19 can copy any wizard spell they find into their spellbook? Is there anything preventing them from casting these spells?


My character was incapacitated (0 HP, passed my death saving throws). My party went on head to the next room without me after failing to revive me. Little did they know the next room was the boss room and they all are now rolling death saves. The boss searches the area for more invaders and is using detect magic to look around. Would the boss see my magic aura from my body since I'm a wizard or would me being incapacitated prevent any magic from being seen so he thinks I'm dead?  Me and my D&D group thank you for your help on solving this.

Inspired by a recent question about discerning divine and arcane spellcasters, of like to hear the case for and against detecting spellcasters of either style with .  I think you can detect whether someone has prepared spells, based on this language:     For the duration, you sense the presence of magic within 30 feet of you. If you sense magic in this way, you can use your action to see a faint aura around any visible creature or object in the area that bears magic, and you learn its school of magic, if any. (emphasis mine)   Preparing spells is described as having the spell "fixed in mind" (). I'd argue that qualifies as bearing magic, and opens the door to using detect magic to identify spellcasters with currently prepared spells. What do you think?


I create a class Node which contains an int variable val When I try to get the val after I pop it from stack, the compiler throw a NullPointerException.  Does anyone knows how to fix this?  public class Node{   int val;   Node left;   Node right;   Node(int x) {val = x;} }   Node root = new Node(6); Stack s = new Stack(); s.push(root); Node node = (Node)s.pop(); System.out.println(node.val);

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I would like to do something like this:  declare @a int set @a = 10  select top @a * from tbl   (Basically the @a is going to come from a system setting table)  Can I do this without dynamic sql string?

How can I have a dynamic variable setting the amount of rows to return in SQL Server? Below is not valid syntax in SQL Server 2005+:  DECLARE @count int SET @count = 20  SELECT TOP @count * FROM SomeTable


I want to use this command:  sed 's/account.db/$PATH/' file1 > file2   and   sed 's/account.db/$PATH.account.db/' file3 > file4   But I dont know how to use it.

I tried the following code to replace QQ with ZZ, but it doesn't do what I want:  var1=QQ sed -i 's/$var1/ZZ/g' $file   However, this code does what I want:  sed -i 's/QQ/ZZ/g' $file   How do I use variables in sed?


Suppose $\sin \frac{\theta}{2} \neq 0$ . Prove that  $$\frac{1}{2}+ \sum_{k=1}^n \cos (k\theta) = \frac{\sin[(n+ \frac{1}{2})\theta]}{2\sin\frac{\theta}{2}}$$  The question also give the hint, $$z=\cos\theta + i\sin\theta = e^{i\theta}$$ $$\sum_{k=1}^n z^k = z + z^2 + \cdots + z^n = \frac{z(z^n-1)}{z-1}$$  What I did was to change z into polar form and applied double angle formula to remove $\cos\theta$, but I have no idea what to do after that and it is still $\sum_{k=1}^n z^k = \sum_{k=1}^n \cos(k\theta)+i\sin(k\theta)$, not exactly $\sum_{k=1}^n \cos(k\theta)$ that I am supposed to prove

So I have this result  $1 + z + z^2 + ... + z^n = \frac{z^{n+1}-1}{z-1}$  which I proved already. Now I am supposed to use that result and De Moivre's formula to establish this identity     $1 + \cos\theta + \cos2\theta +... + \cos n\theta = \frac{1}{2} + \frac{\sin[(n+\frac{1}{2})\theta]}{2\sin(\frac{\theta}{2})}$   Can anyone help me?


I want to apply the SQL IN clause in my query for a names column. I know there is an option 'like' but, in the UI the user selects the names of customer from a multi-select dropdown, so I have a comma-separated list of names like 'rocky,joni,david' and to use SQL IN the list needs to be like 'rocky','joni','david'. Let me know if something is not clear in my question.

How do I parameterize a query containing an IN clause with a variable number of arguments, like this one?  SELECT * FROM Tags  WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count DESC   In this query, the number of arguments could be anywhere from 1 to 5.  I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to , I am open to that.


mayank@mayank-Compaq-15-Notebook-PC:~$ apt-get install android-tools-adb E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I get this error whenever I try to install programs using the terminal:  home@ubuntu:~$ apt-get install myunity E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   Also I'm unable to install updates using the terminal.


There are certain clothes in Skyrim you can get a bounty for if worn, this is why I try to be rather neutrally clothed. I know that if you enter a Stormcloak city in Imperial armor, or an Empire-controlled city in Stormcloak armor, you can be charged by the guards (you'd get a bounty of 40 gold, I think). I'd like to know:  Does this also apply to specific city guard armor such as Whiterun armor or Haafingar armor? Are there other clothes you could be punished for, such as vampire clothes in all cities, or Thalmor clothes and Elven armor in Stormcloak cities?  All in all, which clothes exactly in what cities are punishable? Does anyone know? Thank you.

So I've killed off some well equipped Imperials, looted their bodies and want to equip their armor.  Does the game take into consideration that I look like an Imperial when I interact with pro-Imperial or anti-Imperial characters going forward?


I am interested in following a few people who have a huge reputation in a particular field (for example Unix), so that I can get informed everytime they contribute to Stack[Overflow/Exchange] sites, so that I can go get enlightened. In short, I want to be an official follower of such experts.

Is there a way to follow a particular person (or List<Person>) easily? Some people answer the questions in a very educative way, and I don't want to miss them.


In a few weeks, I'll be helping with the technical aspects of a conference. One of the things that participants will need is access to to documents, via a laptop as a document server (set up with MAMP and a PHP/MYSQL site). People will access the documents through an internal wireless network.  My question is how many wireless access points will I need in order to accommodate about 350 devices?

How many users can a single Wi-Fi access point handle at one time? For example, can a single AP handle 100 concurrent users?


It is often the case that other people greet me with "What's up?" and I don't know how to answer, so I usually say "hello" or "hi". It's embarrassing...  As a person whose first language is not English, I am not really sure "What's up" means. Does it mean "what are you doing", or "hello"? How should I answer "What's up"?  Thanks!

When somebody ask me What's up? I answer I am well, thank you.  Is that the expected answer, or should I answer something else? What does a native speaker understand when I reply like that?


On a QA server I need to give access to specific login  from  just one IP to log to this server.    I wrote This login  trigger    Create   TRIGGER tr_CheckIP ON ALL SERVER FOR LOGON AS BEGIN     DECLARE @IPAddress NVARCHAR(50) ;     If ORIGINAL_LOGIN()='test'       --print ORIGINAL_LOGIN()      begin       SET @IPAddress = convert(NVARCHAR(50),ConnectionProperty('client_net_address'))     --print @IPAddress     IF NOT EXISTS ( SELECT  IP                     FROM    master..IPAddress                     WHERE   IP = @IPAddress )         BEGIN               ROLLBACK          END     End END   However the trigger is preventing  the user from log although the IP exists in the IPAddress table.  Any idea where in the problem in the trigger

I have an app to deploy in production that uses 'honor system' security. That is, all users connect to the DB using a SQL user/passwd credential and the app manages permissions itself. The latter part doesn't bother me as much as the fact that the connection object contains embedded credentials and can be copied around freely. I'm try to find some way to limit connections to a more limited set of clients. I can create firewall rules to limit by IP, of course. Is there any way to 'prequalify' SQL logins either by Machine account or domain membership?


After running ubuntu gnome for some years, I was happy to hear that mainline ubuntu was returning to gnome as the default. So I was eager to upgrade my trusty ubuntu gnome 16.04 desktop to ubuntu 18.04. Yikes. My impression is that they simply tried to implement the unity desktop using gnome 3 libraries. I'm not seeing a gnome 3 desktop here.   Disappointed, I reinstalled with ubuntu mate 18.04, and find it fairly nice. But what I really wanted was an up to date gnome 3 desktop running on ubuntu 18.04. Any hope of ever resurrecting the ubuntu gnome flavor?

Some people (me) would prefer the straight GNOME experience as opposed to the Unity style desktop offered in Ubuntu 17.10.  How can I get the standard GNOME desktop and interface?