Let $f$ be a continuous function on $[a, b]$. If $g$ is decreasing monotone and bounded in $[a, b]$ using the mean value theorem, prove that there exists $c \in [a, b]$ such that: $$\int_{a}^{b} f(x)g(x) dx   = g(a)\int_{a}^{c} f(x) dx +g(b)\int_{c}^{b} f(x) dx$$ I tried to do $h(x) = g(x)-g(a)$ but failed

Let $f,g,g´$ be continous on $[a,b]$ and $g$ monotone on $[a,b]$; then there exist $c\in (a,b)$ so that $$\int_{a}^{b}f(x)g(x)dx=g(a)\int_{a}^{c}f(x)dx+g(b)\int_{c}^{b}f(x)dx$$  Ineed to apply the first generalized mean value theorem for integrals i.e. $$\int_{a}^{b}f(x)g(x)dx=f(c)\int_{a}^{b}g(x)dx$$ to $g´$and $\int_{a}^{x}f(x)dx$ but I don´t know how please I would appreciate your help


I want to transfer money from my US saving/checking account to Indian NRE account. How can I do it? Will transferring directly from my US account to bank account will give me best rates? or Should I use third party transfer services like click2remit for such money transfer to get best rates?

I have a bank account in Germany in which I receive my salary in Euros. I want to deposit a part of it in my Indian bank account for personal savings. My Indian bank account is in INR. As I see it, I have two options:   To use a remittance service that converts my Euros into INR and deposits in my account. I am not sure how it works. The service (which I know is reliable) I signed up for asks me to deposit Euros in a certain account ("funding") which will be converted to INR and deposited in my account. How does that work exactly? Use my bank's service to make a international bank transfer to my account. Is that even possible, given that my Indian account is in INR? Will I incur higher conversion fees and lower exchange rate?   In general, what are the pros and cons of each of the above methods? And are there any other methods?


I have a table of values and I want the cells to range from green to red depending on their values. I tried the following function:  \newcommand{\cellc}[1]{     \pgfmathparse{#1 <= 256 ? #1 / 256 : 1}     \pgfmathsetmacro{\r}{\pgfmathresult}     \pgfmathsetmacro{\g}{1 - \pgfmathresult}     \cellcolor[rgb]{\r ,\g ,0}\r, \g,  #1 }   but it just turns every cell green (or red if i flip \r and \g) even when \r is close to one and \g close to 0.   Here's a list of my packages in case it's due to a conflict:  \usepackage{ragged2e} \usepackage[french]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{graphicx} \usepackage{enumitem} \usepackage{float} \usepackage[table]{xcolor} \usepackage{slashbox} \usepackage{diagbox} \usepackage{fontspec} \usepackage{tikz}   EDIT: The link with the triangular matrix was actually what I was looking for. Thanks I didn't find it while looking up my problem.

I am trying to give a table cell a grayscale color value based on it's numeric value. So far I have the following code  \documentclass{article} \usepackage{fp,xcolor,colortbl} \FPeval{\resb}{0.5}  \newcommand{\he}[1]{%     \FPeval{\resa}{2 * #1}%     \cellcolor[gray]{\resa}%     #1  }  \begin{document} \begin{tabular}{| c | c | c |}     \hline     \he{0.1} & \he{0.2} & \he{0.3} \\     \hline     \he{0.5} & \he{0.8} & \he{1.0} \\     \hline \end{tabular} \end{document}   The tables contain all floating point numbers. The error I get is :   Undefined control sequence. <argument> \resa    Is there a way I can use the result from the FPeval to color the cell?


I know how to prove this using a picture of a venn diagram but I am getting stuck solving it using letters.  This is what I've tried:  Let x $\in$ A $\setminus$(A$\setminus$B)  x $\in$ A such that x $\notin$ B  x $\in$ A such that x $\notin$ A  Therefore x $\in$ A $\cap$ B  I feel like there are some steps before the last one that I'm missing  Any help is appreciated

$A$ and $B$ are any sets, prove that $A \smallsetminus (A \smallsetminus B) = A \cap B.$ This formula makes sense when represented on a Venn diagram, but I am having trouble with proving it mathematically.  I have tried letting $x$ be an element of $A$ and continue from there, but it doesn't seem to work out as a valid proof anyways.   Could anyone please point me in the right direction?  Many thanks.


What command or program do I need to run in order to change the clock speed to a specific value I want? For example, I'm looking for something like <command name> 1.7, or something similar, to change the speed to a specified frequency in GHz or MHz. I would prefer a terminal application, but a desktop app would also suffice.  I am using Ubuntu 12.04 LTS.

I have been having an overheating issue which makes my laptop shutdown immediately. Is there anyway to monitor the temperature from the sensor and scale down the CPU frequency to avoid that problem? Is there any existing software or shell script that can handle that job?


Which one is constant BINDING ENERGY or BINDING ENERGY PER NEUCLEON? I GOT LOTS OF ANS. BUT I CAN`T UNDERSTAND. IS NEITHER OF THE IS CONSTANT?

Looking at the the binding energy per nucleon chart:   I observe peaks for N=4,8,12,16,20,24 while I expected to observe peaks for 2, 8, 20, 28, 50, 82, and 126 because I have heard that in correspondence of these numbers there is the completion of a nuclear orbital, so I expect a local maximum of the stability an so a peak of binding energy.  Is my reasoning wrong?


MWE:  \documentclass{scrbook}  \usepackage{xeCJK} \setCJKmainfont{SimSun}  \begin{document}  This is mainly an English document.  With a smattering of Chinese: 中文  \end{document}   Error:  The font "SimSun" cannot be found.   Am giving up on pdfTeX (was asking ).  Am making the jump to XeTeX. Which packages should be installed besides xeCJK? And what default fonts are installed with the packages you would recommend?

Can anyone describe how one can type Chinese in LaTeX? When I compile this:  \documentclass{article} \begin{document}  你好吗？ \end{document}   the resulting document shows nothing. For reference my IME is iBus 1.3.9 on Fedora 13.


I have received a refusal for a UK visit visa. Below is the relevant text of the refusal. What does this mean and what steps can I take to significantly increase my chances of success in a potential new attempt to apply?      The Decision      I have refused your application for a visit visa because I am not   satisfied that you met the requirements of paragraph(s) V4.2.of the   Appendix V: Immigration Rules for Visitors because:         In order to be able to make a decision on whether or not to grant you entry clearance in this category i have taken into account your   stated circumstances in Nigeria, the reason for your visit and your   proposed travel arrangements.   You state that you wish to travel to the UK for 4weeks to attend the interview and assessment stage in you application to join the British   Army. You have provided a letter from the British Army which states   that this event will be held 12th - 14th December, a period of 3 days.   Given this, your plans for the remainder of your time in the UK lack   clarity.   I note that you have stated that your cousin in the UK will provide the funds for your trip but in order to make a decision on your   application it is reasonable to assess your personal circumstances in   Ghana as part of my overall assessment of your application.   You have declared on your application form that you are employed by ABC Company and that you derive a net monthly income of 1,000ghs   (£198.76 OANDA rate of exchange on 17/11/2016) from this employment.   You have provided a bank statement in your name from Fidelity Bank   which shows a closing balance of 1,742.97ghs (£346.43) on 08 November 2016.   > Whilst this statement show payment with the reference of 'SafeDrive' these are deposited into the account in cash therefore the   fact that these transactions appear on your statement hold little   corroborative value in determining that your employment is as stated by   you.   You have provided a further account in your name from Barclays which shows a closing balance of 2,236.35ghs (£444.50) on 11 November 2016.   Again the funds  in this account are an accumulation of cash deposits   that are inconsistent with your stated income.   Given the statement you have made and the documentary evidence you have presented to support your application I am not satisfied that   your circumstances in Ghana, coupled with your reasons for wishing to   travel to the UK at the end of your proposed visit.   In light of all the above, I am not satisfied that you have demonstrated that you are a genuine visitor and will leave the United   Kingdom at the end of your visit. Your application has therefore been   refused under paragraph V4.2(a) and (c) of the immigration rules.         Further Applications      Any future UK visa application you make will be considered on their   individual merits; however you are likely to be refused unless the   circumstances of you application change.      In relation to this decision there is no right of appeal or right to   administrative review.   Please any advice on what to do because my application was assessed based on my circumstances in Nigeria but I am a Ghanaian and also the Army has given me another date for assessment in 2017.

The UK Visas and Immigration Directorate publishes  that provides helpful tips that can result in successful visa applications. Section 2 of this guidance opens is entitled "other documents you may want to provide" (emphasis mine).  Section 2: other documents you may want to provide – all visitors This section provides guidance on the types of documents that you may want to provide to help us consider your application against the Immigration Rules. Previous travel documents/passports, which show previous travel. Financial documents showing that you have sufficient funds available.  These must clearly show that you have access to the funds, such as:  bank statements building society book proof of earnings such as a letter from employer confirming employment details (start date of employment, salary, role, company contact details) where a third party (who is either in the UK or will be legally in the UK at the time of your visit) is providing financial support to you e.g. a business, a friend or a relative, documents to show that they have sufficient resources to support you in addition to themselves and any dependant family should be provided   The first item is "bank statements" and this ties in with the , which says...  evidence that you can support yourself during your trip, eg bank statements or payslips from the last 6 months  (Note 'eg' is a Latin abbreviation meaning "for example"; this appears to be optional rather than a fixed requirement.) Question: How should someone interpret this such that the chances of success are maximized? How many statements should I submit? What are they looking for and what do my bank statements tell about me?


Hi i am having issues with my code at the moment as i have been stuck for a while now, i am new to java programming. I want the code output to be from 0-9 not 1-10, my code and output is displayed below:  import java.util.Arrays;  public class RandNumGenerator {  public static int RandInt(){     double n = Math.random()*10;     return (int) n;     }  public static void randTest(int n){     int [] counts = new int [10];     int sampleSize = 10000;     int RandNum = RandInt();      System.out.println ("Sample Size: " + sampleSize);     String[] intArray = new String[] {"Value","Count","Expected","Abs Diff","Percent Diff"};     System.out.println(Arrays.toString(intArray));        for(int i=0;i<n;i++){         counts[ RandNum ] = counts[ RandNum ] + 1;         System.out.println(counts[RandNum]);         }      }  public static void main(String[] args) {     randTest(10);     } }   output is 1-10, not 0-9:  Sample Size: 10000 [Value, Count, Expected, Abs Diff, Percent Diff]  1  2  3  4  5  6  7  8  9  10

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


How can I prove that $F:\{0,1\}^n\to\{0,1\}^n$  is a length-preserving pseudorandom function, then $$G:G(s)= F_s(1)\mathbin\|F_s(2)\mathbin\|\cdots\mathbin\| F_s(l)$$ is a pseudorandom generator with expansion factor $l$. I want to understand how I can solve this type of problems

If $F$ a PRF, and we construct $G$ using $F$ in the following way:  $$G(s) = F_s(1)\|F_s(2)\|\cdots \|F_s(n+1)$$ where $|s|= n$.   Is $G$ then a PRG? If so how can I prove this? If not how can $G(s)$ be distinguished from a random $r$? And what if $n+1 <$ range of $F_s$? or it could be for any $n > |s|$.


I have already gone through the creating an empty folder and synced just that folder and when that didn't work I unselected the box to sync photos and that also did not resolve my issue.  I'm at a loss on how to remove the data from my iPhone5.  I currently have 250 photos/videos on my phone that are just over 2gb...I would really appreciate help clearing out such a large portion of my harddrive

I cannot do it in the phone itself, neither in iPhoto.  How can you delete all your photos in iPhone?


I've never gotten a duplicate item out of a Loot Box, but I'm wondering if it's even possible.  Does it automatically turn into gold depending on the rarity of the item?  How does the game handle duplicate items?

When you open a loot crate and receive a cosmetic you already own, it is automatically turned into coins. How much do you get, exactly? Is it a constant amount, a fraction of its unlock cost, or something else?


I need to create a dropdown to select various groups and most of them have very long titles.

Usually, dropdown menus are made as long as their longest value. However, that works well only for dropdowns with a predefined set of values. How can we deal with a dropdown that receives its values dynamically and displays user-generated values which don't have a reasonable size limit? For example a file name may be extremely long. I'm looking for a way to solve this which would still let me use the dropdown in a reasonable way (e.g. without having to always place it in its own row for fear that it might grow and mess with my layout).   Truncating values at a low cutoff point won't work well since the difference between the values might be at the last characters (again, the file extensions example is a good one). I can use it for the edge cases, but I'd like to get there as late as possible.


Sometimes, when I try to access my Gmail account from some other computer or country, an annoying security feature prevents me from doing so. I get the following message:  Verify it's you There's something unusual about how you're signing in. To show that it's really you, complete the task below.  Below this, an option is offered:  Enter a phone number to get a verification code by text message or phone call  But this doesn't help and doesn't even make any sense for me, because I didn't associate any phone number to my Gmail account and I don't intend to do so. So, when I manage to log in, how do I disable this "feature"? Is there any way to opt-out of additional verification and tell Google that I consider my password to be enough to log in my account (regardless of stuff like IP address and browser's user agent)?

Sometimes, I get this message:     There's something unusual about how you're signing in. To show that it's really you, complete the task below.   This usually happens when attempting to log in from another country, probably also happens when attempting to log in from another browser or device.  I only use my laptop (i.e. no mobile devices).  It offers phone verification (which I decline, as I don't connect my accounts to phone) and it also offers "Try another way to sign in.", which of course fails even if I enter all the correct answers.  I'm not asking , which is probably usually impossible in relevant cases. I'm asking, once you managed to log in from the "correct" location/browser/device:   How to disable this useless verification?


i asked a similar question yesterday , i think my way was not proper ,i received vague and confusing answers, so i asked it again clearly specifying what i actually want to ask  This is what i found  about symmetric distributions, written in notes that i have : The distribution of rv (random variable) $X$ is symmetric about $a$ if $$  P ( x \le a - x ) =P ( x \ge a + x )  \qquad \forall x  \in \mathbb{R} $$ I just want to confirm ,.,is this " if " correct ?  i think it must be " iff " i mean it is clear to me that if $x$ is symmetric about $a$ it will satisfy above equation, but the converse must  also true ? isn't it ?

This is what i know about symmetric distributions: The distribution of rv (random variable) $X$ is symmetric about $a$ iff $$  P ( X \le a - x ) = P ( X \ge a + x )  \qquad \forall x  \in \mathbb{R} $$ I just want to confirm ,.,is this " iff " correct ? i mean it is clear to me that if $x$ is symmetric about $a$ it will satisfy above equation, is the converse also true ?


A directory I have is filled by a lot of files. I want to discover of what kind they are and whose of them are so numerous.  Here are the events when I try some commands :  ls -l | wc -l 1514340  ls | head -n 4 2004112700001.htm 2004112700002.htm 2004112700003.htm 2004112700004.htm  ls *.xml | head -n 4 20041127.xml 20041225.xml 20050101.xml 20050108.xml  ls -l *.htm | wc -l bash: /bin/ls: Liste d'arguments trop longue 0  # Any other kind of ls command with *.htm, *.* is failing too.   I understand that wc -l has to wait that the output of the ls -l *.htm is entirely done before starting to analyze it. And because that output is too big, it fails.  Is it truly what is happening ?  What is the good way to make the ls command works in this case in conjunction with wc -l ? Is there a way to ask the wc command to start asynchronously, before the output is entirely completed ?

I get the following error when trying to ls *.txt | wc -l a directory that contains many files:  -bash: /bin/ls: Argument list too long   Does the threshold of this "Argument list" dependent on distro or computer's spec?  Usually, I'd pipe the result of such big result to some other commands (wc -l for example), so I'm not concerned with limits of the terminal.


Is there any option , that let a user record a video with a time stamp .  I use many web-cam recording and i didn't found this option .  Program i used Guvcview , Cheese .  Any Help ?

Which video capture programs exists with this option: time and date displayed inside the video? I checked , but I didn't find nothing in this sense.


I have seen the terms socking, sock puppet, sock puppeting, sock puppetry flying around in different questions here, but what do they actually mean? I know what a sock puppet is in the real world is a child's toy made from a sock, but what does it mean in this world?     Note: even though it's mentioned in , I would like to have a more detailed answer here, since this term has big impact.

What are the common phrases, words, abbreviations that are used on Stack Overflow, Server Fault, Super User, Meta Stack Overflow, and the other Stack Exchange sites? This is meant to be a very quick overview, not an in-depth tutorial. When considering whether a term ought to be included, please use this test:  New user comes in and posts on day 1. What terminology or jargon are they likely to run into (comments, support, system messages, etc.) that cannot be understood from the context without prior experience with the site (that is, clear only if known). For example: "This is a dupe. Flag a diamond mod to close or migrate to SU." Huh? Can these instruction be made clear from the glossary? Is it clear for those for whom English is a second language?  Please:  Edit the existing answer Insert relevant links to more detailed information on the term/phrase/abbreviation Add only factual information Keep it very, very brief, terse, and to the point Delete your own comments once they become irrelevant (integrated into the glossary) Use the Edit Summary box to note reasons for your edit, not comments  Please avoid:  Opinion Using abbreviations, terms, and phrases inside a description Unverified information Uncommon terms, abbreviations, phrases Long descriptions Unnecessary detail - link to the relevant FAQ instead Citations or examples of usage Inside jokes that are not common on all of the trilogy () Common Internet jargon (that is, , , , etc.) unless usage here differs significantly  Recurring discussion: While the experiment to keep meta-discussion in the comments is going well (that is, deleting them once consensus is reached) it is clear that some discussions will be recurring, and we'll have to keep a record around so people new to the glossary can understand the consensus already reached. Add a new answer if you believe a new issue is likely to come up repeatedly. For instance, discussion about what terms to include, whether the glossary should be broken up to make linking easier, or formatting issues might be best discussed in new answer/comment posts.


How to prove if $X_n$ converges in probability to $X$ then there exists at least one subsequences converge almost surely to $X$? I have no idea how to proceed.

Convergence in probability implies convergence on a subsequence almost surely.  But this means we fix a subsequence, such that $X_{n_k}$ converges for almost every $\omega$, right? The subsequence we pick does not depend on the $\omega$ right?


When wanting to connect to a server it says "Invalid name", however the world name appears the same. How do I get my daughter and son to connect?

I am having trouble getting onto a server in Minecraft PE on iOS. When I tap on the person's server it just says invalid name:    I have tried turning off and restarting the iPad, going to home screen and logging back into the server but I have had no luck and no change. Is there a reason why this is so?


As per , I'm trying optimise performance of a USB 3.0 attached SSD drive. I've been told that aligning to 4k boundaries should improve performance(?).  So how can I check that and fix it?  (Windows 7 Premium)

I cloned a non Advanced Format drive (W7 64bit) to a new hard drive (Seagate) that was AF, the software I used supposedly does not support 4k very well (Todo Backup Free 3.5).   Is there a Windows utility to check alignment? I know of the Western Digital tool but not sure if it works on Seagate brand drives. If the partitions are not aligned, Am I better to clean install W7 64bit or do the partition alignment procedure? If so, Why?   It seems to be running fine so far. From what I have read Seagate drives use  technology to help with misaligned partitions on the fly, might explain why it runs well for me, but would still like to have the partitions aligned properly.  EDIT: Here is the diskpart output for my disk partitions  DISKPART> list partition    Partition ###  Type              Size     Offset   -------------  ----------------  -------  -------   Partition 1    Primary            188 MB    31 KB    Partition 2    Primary            698 GB   188 MB


I want to make if comparisons not care about the capitals. I have tried to Google this but nothing shows up with the answer im looking for. Example Code: word = input() if word == 'banana':     print("Apples")

How can I do case insensitive string comparison in Python?  I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings.


As title says, does the following series converge? $$\sum_{1}^{\infty}\big[1 + n\ln\big(\frac{2n-1}{2n+1}\big) \big]$$ It is supposed to converge but I don't know how. My attempt: $$\sum_{1}^{\infty}\big[1 + n\ln\big(\frac{2n-1}{2n+1}\big) \big] = \sum_{1}^{\infty}a_n,$$ where \begin{align} a_n &= \big[1 + n\ln\big(\frac{2n-1}{2n+1}\big) \big] \\     &= 1 + n\big[\ln(2n-1) - \ln(2n+1)\big].  \end{align} I couldn't come up with any good convergence tests and started listing out a few terms: $a_1 = 1 + 1\ln(1) - 1\ln(3)$, $a_2 = 1 + 2\ln(3) - 2\ln(5)$, $a_3 = 1 + 3\ln(5) -3\ln(7)$, and so on. Since some terms cancel, I think for the $N$-th partial sum, we have: \begin{align} \sum_{1}^{N}a_n &= N + \ln(2N-1) - N\ln(2N+1) \\                 &= N + \ln\frac{2N-1}{(2N+1)^N} \end{align} At this point, I can only see divergence as $N \rightarrow \infty$. What am I doing wrong? How can I correctly test for convergence in this case?

I am investigating the convergence of  $$\sum _{n=1}^{\infty }\left\{ 1-n\log \frac {2n+1} {2n-1}\right\} $$ Now as per Cauchy's test for absolute convergence.  If $\overline {\lim _\limits{n\rightarrow \infty }}\left| u_{n}\right|^{{1}/{n}} < 1,\sum _\limits{n=1}^{\infty }u_{n}$ converges absolutely  Obviously, if $\overline {\lim \limits_{n\rightarrow \infty }}\left| u_{n}\right|^{{1}/{n}} > 1,\sum _\limits{n=1}^{\infty }u_{n}$ does not converge.  I observed $$\overline {\lim _{n\rightarrow \infty }}\left| \log \left( \dfrac {2n+1} {2n-1}\right) ^{-n}\right|  = \overline {\lim _{n\rightarrow \infty }}\left| \log \left( 1-\dfrac {1} {n-{1}/{2}}\right) ^{-n}\right|$$  Could I take the negative power of $n$ outside the absolute brackets here? I guess even if I could establish $\log$ part converges that would only show that the overall series diverges right. Is that the correct result ? Any alternative lines of attacking this problem would be much appreciated.


Einstein has suggested that light can behave as a waves as well as like a particle i.e, it has dual character. In 1924, Louis de Broglie suggested that just as light exhibits wave and particle properties, all microscopic material particles such as electrons, protons, atoms, molecules etc. have also dual character. They behave as a particle as well as wave. This means that an electron which has been regarded as a particle also behaves like a wave. Thus, according to de Broglie,       .      Although the dual nature of matter is applicable to all material objects but it is significant for microscopic bodies only. For large bodies, the wavelengths of associated waves are very small and cannot be measured by any of the avalable methods. Therefore, practically these bodies are said to have no wavelengths. Thus, any material body in motion can have wavelength but it is measurable or significant only for microscopic bodies such as electron, proton, atom or molecule. And it is to be noted that electrons won't orbit the nucleus in the sense planet orbits around the sun, but instead exist as STANDING WAVES.    I am finding difficulty in understanding electron or other material particles to behave as wave. In order to understand electron in the form of wave, I considered the following example of high racing car. See the picture below.   You can see that car is under very less speed compared to electron, it shows some what blur appearance, I considered this to be wave like in nature. And car has comparatively very very less wavelength, so that it can be considered as negligible, even though I considered it to understand. I assumed electron to be under similar position as the car, to understand what actually is called wave nature. Is it that as like car appears to be blur or some what wavy, electron also under immense speed show wave like appearance. But in reality car stays as material particle, even if it appears to be wavy. Is it the same thing what actually meant by wave nature of electron? i.e is it that electron seems to be wavy under high speed, but it will remain as particle during its motion?    This is what I have understood about wave nature of electron. I don't know whether I have misunderstood or not. If I have misunderstood the concept about wave nature, please explain what actually is meant by wave nature of material particles.

If an electron is a wave, what is waving?   So many answers on the internet say "the probability that a particle will be at a particular location"... so... the electron is a physical manifestation of probability? That doesn't sound right.   This page  seems to suggest that the spherical wave pair is what gives the electron the properties of a particle. I could be misinterpreting, but this answer makes more sense to me - if only I understood what was waving!


I have tried to get the current date, which works with the following code:            var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); today = yyyy+'-'+mm+'-'+dd; console.log(today);   Result:  2016-12-14   But now I want to add 14 days, which works and will display  2016-12-28   But when I want to add 21 days, the days will go up to 35 so the result will be:  2016-12-35   Which of course is not a correct date. So how do I get the date in yyyy/mm/dd format + 14 days but the yyyy/mm being correct?

How to add days to current Date using JavaScript. Does JavaScript have a built in function like .Net's AddDay?


I'm trying to find a .shp file that not only includes international land boundaries, but also the water boundaries, extending out to international waters.  Does such a thing exist?  I'm not even sure of what terms to search for.  Currently, I'm operating using a world borders map which is mostly good, but when our mobile users approach the ocean and their GPS flakes out a bit, our system can't place them within a country.  I figure the best way to fix this is to used a dataset that will always place the national border well away from dry land (and cell towers for their phone).  This project isn't making any money, so I'm hoping for free :-)

After learning about the  datasets I've working with the following layers, from the USA data   Country boundaries State boundaries County boundaries City boundaries ZipCode/Postcode boundaries   What I am trying to find is the equivalent (where appropriate) of the same data for various countries.  Is there any free administrative boundaries available as shapefiles for other countries?


In the below example what exactly is happening inside the function that is called inside of itself? What is being output at what point of the function? Is there something analogous to what is happening here that can be rewritten in a simple way? def mergeSort(myList):     if len(myList) > 1:         mid = len(myList) // 2         left = myList[:mid]         right = myList[mid:]          # Recursive call on each half         mergeSort(left)         mergeSort(right)          # Two iterators for traversing the two halves         i = 0         j = 0          # Iterator for the main list         k = 0          while i < len(left) and j < len(right):             if left[i] < right[j]:               # The value from the left half has been used               myList[k] = left[i]               # Move the iterator forward               i += 1             else:                 myList[k] = right[j]                 j += 1             # Move to the next slot             k += 1          # For all the remaining values         while i < len(left):             myList[k] = left[i]             i += 1             k += 1          while j < len(right):             myList[k]=right[j]             j += 1             k += 1  myList = [54,26,93,17,77,31,44,55,20] mergeSort(myList) print(myList)

One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion.  So the question is:   What is recursion? When would I use recursion? Why don't people use recursion?


I am new to Java and I tried the below practice code to understand the java objects and updates on them but it is not updating with the desired values. FYR the code is as follows: class Sample {     int id;     String name;     boolean isSold;      Sample() {}      Sample(int i, String n, boolean s) {         id =i;         name=n;         isSold=s;     }      public String toString() {         return id+" "+name+" "+isSold;     } }  public class Experiment {      static void updateSample(Sample s, int id, String n, boolean flag) {         s = new Sample(id, n, flag); // this code fails to update my object         // below code also fails to update my object         s.id = id;         s.name = n;         s.isSold = flag;     }      public static void main(String[] args) {         Sample s = new Sample();         System.out.println("At the creation time object = "+s.toString());          updateSample(s, 2, "soap", true);         System.out.println("After the update object = "+s.toString());     } }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I'm running Ubuntu 14.04, which seems unfortunate, as the instructions in the package are written for 12.04. So, like a trooper, I try to follow the instructions anyway. The first block I hit is in the fifth step, where it asks me to extract a driver... Now, it becomes clear that these instructions were pretty poorly made, as the line of code they give isn't the same as the image they provide:  tar vxf 2011_0427_RT3572_Linux_STA_v.2.5.0.0.DP.bz2   and then  tar vxzf rtl8812AU_8821AU_linux_v4.2.0_6952.20130315.tar.gz   Neither if these work. Also, the file name itself is rtl8812AU_8821AU_linux_v4.2.2_7502.20130517_fix_led.tar.gz Not sure how relevant that is, but I think it might be useful.

I have a USB wireless adapter EW-7822UAC from Edimax, and I used to be able to build/compile a Linux driver from the source that the vendor provided just by installing build-essential package on a fresh installation of Ubuntu, even without updating the system.   Now, I have installed Kubuntu 13.10 64-bit, and when I try to build the driver, I get a bunch of repeated errors and warnings and eventually the build process fails.    The kernel is 3.11.0-12-generic and I didn't need to install anything other than build-essential in (K)ubuntu 12.04.   The following are the block of repeated warning and error that I got after I invoked make command:    /home/xxx/build/rtl8812AU_8821AU_linux_v4.2.2_7502.20130517/os_dep/linux/os_intfs.c:601:8: warning: assignment makes pointer from integer without a cast [enabled by default] entry = create_proc_read_entry("bw_mode", S_IFREG | S_IRUGO,       ^ /home/xxx/build/rtl8812AU_8821AU_linux_v4.2.2_7502.20130517/os_dep/linux/os_intfs.c:607:7: error: dereferencing pointer to incomplete type entry->write_proc = proc_set_bw_mode;     Any help will be greatly appreciated, but please go easy on the jargon. Thanks.


The problem was to find  $$\lim_{n\to\infty}\sqrt[n]{4^n+9^n}$$  So after a couple tries what I did was to take the natural logarithm of the limit so  $$\lim_{n\to\infty}\sqrt[n]{4^n+9^n}=L$$ $$\downarrow$$ $$\lim_{n\to\infty}\ln(\sqrt[n]{4^n+9^n})=\ln L$$ $$\downarrow$$ $$\lim_{n\to\infty}\frac{\ln({4^n+9^n})}{n}=\ln L$$ $$\downarrow L'Hopital$$ $$\lim_{n\to\infty}\frac{4^n\ln 4+9^n\ln 9}{4^n+9^n}=\ln L$$  And there I'm stuck. I checked in Wolfram and $\lim_{n\to\infty}$ of both the initial function and the one after L'Hopital's rule is $9$. ($\ln L=\ln 9\rightarrow L=9$).  I'd like to know how to find the limit from the last step I made, and if there's a more elegant way of solving the problem (which I'm sure there is), maybe without using L'Hôpital's rule.  Thanks.

How can I prove the convergence of the sequence $b_n=\sqrt[n]{x^n+y^n}$ where $x, y > 0$?  Can I divide it in two cases?  Case 1: $x > y$.  $$ b_n=\sqrt[n]{x^n+y^n} < \sqrt[n]{x^n+x^n} = \sqrt[n]{2 \cdot x^n}=x \cdot \sqrt[n]{2} $$  Case 2: $x < y$.  $$ b_n=\sqrt[n]{x^n+y^n} < \sqrt[n]{y^n+y^n} = \sqrt[n]{2 \cdot y^n}=y \cdot \sqrt[n]{2}$$  Result: Does the sequence converges to $\max(x,y)$?


Here on MSE, there are two close reasons within "off-topic" that mean exactly the same thing. This:     This question does not appear to be about the software that powers the Stack Exchange network, within the scope defined in the help center.   and this:     Blatantly off-topic (this question has nothing to do with the software that powers the Stack Exchange network)   Should one of these be removed?

The flagging window currently has two different possible reasons to flag a question as offtopic (seen by selecting flag -> "should be closed..." -> "offtopic because"):   This question does not appear to be about the software that powers the Stack Exchange network, within the scope defined in the help center.  Blatantly off-topic (this question has nothing to do with the software that powers the Stack Exchange network)   I've seen these reasons on MSE and on Area 51 Discussion zone, but not on [M]SE or [M]SU, so I'm not sure if this is a SE-wide default or just a coincidence.  What is the difference between these two reason, and when should which be used?


On my Ubuntu 14.04.2 LTS network-manager isn't installed yet. Without this program I can't connect to WiFi network. But I can't install this package from Ubuntu without network connection. Here is my question. How to install this offline? or How to install from another computer?

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


I am a dual national with UK and US citizenship living in the UK. My US passport needed renewing and I sent it off. I apparently didn't enclose a picture, although I think it just fell out and missed the deadline to re-send the information. Mainly due to a medical condition, the approved courier company not arriving to collect the passport until 10.30pm (scheduled 7am-7pm) and I can't really justify the expense of paying again.   However, my aunt is unwell in the US and I'm wondering if I can apply for and travel on an ESTA using my UK passport?    It's not a confirmed trip, just more a question about the feasibility of visiting.

Suppose I am a naturalized citizen of the US, but also a citizen of another country, "XYZ". I then boarded a plane and left the US to another country (maybe not necessarily to XYZ), without first getting a US passport, but using my old, but valid XYZ passport.   In this case what would be the best documents to have for me to gain entry back into the US as a US Citizen without a passport?  Would I need to contact the US Embassy for help in order to be able return?  If the airline does let me aboard to return to the US, even without the US passport, what are the best documents could I show at the border to prove I am a US citizen but that I just don't have a passport, for whatever reason?


I am writing some technical documentation and I got confused when I saw the following paragraph title:     Steps to creating a new thing* in production   I think the correct title should be:     Steps to create a new thing* in production   But I'm not an English native speaker, the person who wrote it is, so I'm no sure.  * Replace thing with the real thing we do on production :)

Some verbs are followed by ing, e.g. I enjoy swimming. We can't say I enjoy to swim. Likewise, some verbs are followed by to, e.g. I decided to make a plan.   Which particular verbs are followed by ing and to? Can you please provide a list for that?  Moreover, which verbs can be followed by both without having the meaning changed?


How can I solve this? what's the problem causing it? here's a sample of the .bib file  Thanks!  here's my packages and document set up, any help would be appreciated  \documentclass[12pt,a4paper]{article} \usepackage{amsfonts, amsmath, amssymb, amsthm} \usepackage[none]{hyphenat} \usepackage{geometry} \newgeometry{left=2cm, right=2cm, top=2cm, bottom=2cm} \usepackage[version=4]{mhchem} \usepackage{mathtools, nccmath}  \newtheorem{defi}{Definition}[section] \newtheorem{thm}{Theorem}[section] \newtheorem{exm}{Example}[section] \newtheorem{rem}{Remark}[section] \newtheorem{prop}{Proposition}[section] \newtheorem{lem}{Lemma}[section] \newenvironment{Proof}{\begin{sloppypar}\noindent{\sf Proof.}}{\end{sloppypar}}  \numberwithin{equation}{section}  \begin{document}  \bibliographystyle{IEEEtran}     \nocite{*} \bibliography{References}  \end{document}

In my .bib file, I have two entries with exactly the same author names:  @article{Seshadrinathan2010A-Subjective-St,     Author = {K. Seshadrinathan and R. Soundararajan and A. C. Bovik and L. K. Cormack}, ....  @article{Seshadrinathan2009Study-of-Subjec,     Author = {K. Seshadrinathan and R. Soundararajan and A. C. Bovik and L. K. Cormack}, ....   When cited after each other, and typeset with the IEEEtran bibliography style, the .bbl file reads:  \bibitem{Seshadrinathan2010A-Subjective-St} K.~Seshadrinathan, R.~Soundararajan, A.~C. Bovik, and L.~K. Cormack, ``A   subjective study to evaluate video quality assessment algorithms,''   \emph{SPIE Proceedings Human Vision and Electronic Imaging}, 2010.  \bibitem{Seshadrinathan2009Study-of-Subjec} ------, ``Study of subjective and objective quality assessment of video,''   \emph{IEEE Transactions on Image Processing}, 2009.   As you can see, the author names have been replaced with ------. It looks like this in the final PDF:    Is this normal behavior?


There is an existing question  4 years old about a post a year prior, that focuses on a post containing the word(s) 'accept', 'accepted' and/or 'accepting' I do not believe this is the same.  I am a 10k+ user on a beta site, saw a new post that was not a good fit, down voted it, voted to close and left a comment while the view count was at 2.  I moved on.     The OP posted a comment and I came back when I got the notification.  The comment contained profanity and I flagged it as Rude, and the comment instantly disappeared (screen shot above is after it disappeared)  I looked at the  and it does not seem to be a documented feature.    How did a non-admin delete a comment with a single flag?

Caution: R-rated language  Some words, when present in a comment, make it eligible for instant, automatic one-flag deletion. Out of the , only      shit and fuck    appear to work this way. But then there are other, Stack Exchange-specific dirty phrases:    accept rate or accept-rate acceptance rate  what have you tried   whore    Are there other such words or phrases? Is there a complete list of them?     Some suspect words and phrases that do not suffice for automatic deletion:       accept an/the answer, thank you, voting to close, piss, bitch, idiot, cunt (often found on Stack Overflow as a misspelling of "count").


I have been looking for an answer about what could be a simple code example of the composition. I know the differences of composition and inheritance, but I am not able to figure it out using code.   Any comparison based example(using both approaches) about why I should use composition will be very helpful.  Thanks in advance

Why prefer composition over inheritance?  What trade-offs are there for each approach?  When should you choose inheritance over composition?


I copied node.tpl.php and I pasted it to node--my_content_type.tpl.php. My content type has a price. How can I get its value as a string?

I created file node--my_content_type.tpl.php, where I'd like to print the username as string. I tried the following code, but unfortunately it doesn't work. How can I do it?  <?php    print $name; ?>


I have a CT.txt with below input data. CT.txt:  test testing test 1   And with below script:  #!/bin/bash for CITY in $(cat /home/user/CT.txt) do  FILES=/mnt/dir1/dir2/$CITY/* echo $FILES   Giving me output as follow:  /mnt/dir1/dir2/test /mnt/dir1/dir2/testing /mnt/dir1/dir2/test/* /mnt/dir1/dir2/1/*   where output should be:  /mnt/dir1/dir2/test /mnt/dir1/dir2/testing /mnt/dir1/dir2/test 1   How to make CT.txt file to read having space in between test 1.

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


So I'm attempting to setup a mail server on my web server using this guide:    I've since completed it but after trying to go through the steps I am still getting caught in spam filters. Using mail-helper it shows that I'm still missing some errors which rates my emails at a 6.5/10 on their site.   Delivered-To: phlexplexico@gmail.com Received: by 10.31.184.13 with SMTP id i13csp1858421vkf;         Tue, 31 May 2016 00:47:50 -0700 (PDT) X-Received: by 10.140.96.67 with SMTP id j61mr28418706qge.74.1464680869983;         Tue, 31 May 2016 00:47:49 -0700 (PDT) Return-Path: <me@website.me> Received: from website.me (website.me. [0.0.0.0])         by mx.google.com with ESMTP id b129si30231541qkf.106.2016.05.31.00.47.49         for <phlexplexico@gmail.com>;         Tue, 31 May 2016 00:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of x@x.me designates 0.0.0.0 as permitted sender) client-ip=0.0.0.0; Authentication-Results: mx.google.com;        dkim=pass header.i=@x.me;        dkim=pass header.i=@x.me;        spf=pass (google.com: domain of me@website.me designates 0.0.0.0 as permitted sender) smtp.mailfrom=me@website.me;        dmarc=pass (p=NONE dis=NONE) header.from=website.me Received: by website.me (Postfix, from userid 1000)     id 5ACCC144672; Tue, 31 May 2016 03:47:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=x.me;     s=mail; t=1464680869;     bh=LAjdjLF5TLqUzQ9W6ajSnTWHw30oLlaB2WJ/DtN87Ns=;     h=Date:Subject:From:To:From;     b=SszwsO83h0XKdkD5JxPv43f4Tvt40L6tyu450u9LgRyl1RfHwiozl1kdtmtRENnqY      Zrsvs8FcY+ZKks3rla8pdJ/b1bbvsR8dca30wXMpXbnFrmVw4gzC0FKpP+Xf8nut9X      zUlBgx0nESOk1i8aScE+Xt9OGw4QwSfiWg8317rk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on website.me X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,     HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,MISSING_MID,MISSING_MIMEOLE,     T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.141] ()     by website.me (Postfix) with ESMTPSA id EB7A5144670     for <phlexplexico@gmail.com>; Tue, 31 May 2016 03:47:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=x.me;     s=mail; t=1464680869;     bh=LAjdjLF5TLqUzQ9W6ajSnTWHw30oLlaB2WJ/DtN87Ns=;     h=Date:Subject:From:To:From;     b=SszwsO83h0XKdkD5JxPv43f4Tvt40L6tyu450u9LgRyl1RfHwiozl1kdtmtRENnqY      Zrsvs8FcY+ZKks3rla8pdJ/b1bbvsR8dca30wXMpXbnFrmVw4gzC0FKpP+Xf8nut9X      zUlBgx0nESOk1i8aScE+Xt9OGw4QwSfiWg8317rk= Date: Tue, 31 May 2016 01:47:46 -0600 Subject: Tester From: Me <me@website.me> To: phlexplexico@gmail.com Importance: Normal X-Priority: 3 X-MSMail-Priority: Normal MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 Message-Id: <20160531074749.5ACCC144672@website.me>  PHAgZGlyPSJsdHIiPkhleSB0aGVyZSEgTGV0J3Mgc2VlIGlmIHRoaXMgaXMgbm90IGJsb2NrZWQu PC9wPgo=   I removed some info about my website as it is personal, but I know the DNS checks are correct and they all work. However, what mail-tester gives me an error about is certain headers, such as missing MIME-OLE and           Message only has text/html MIME parts You should also include a text version of your message (text/plain)   So what am asking mainly is where can I edit my headers to include or remove X-MSMail-Priority from the headers, and how can I send a text version of the email via postfix/dovecot? I'm also just using the gmail app to send these emails through my account. Thanks in advance for the help!

This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating?


I want to install Ubuntu on my Galaxy S5 with 16 GB and I had many things that are way over my head:      -Can It be dual booted? -Is it possible to boot from the micro-sd card slot?      -Is it possible to install ubuntustudio?      -How can the warranty be retained?      -What software is available for calling/texting through Verizon's network? -What would make more sense to install: Ubuntu Phone or Ubuntu Tablet? Answers to any of these questions are greatly appreciated  :)

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


I am trying to translate a piece of French material (in English) and here is my codes:  \documentclass[12pt]{article} \usepackage[english]{babel} \usepackage{amsmath,amsthm,amssymb,amsfonts} \usepackage{geometry}\geometry{margin=1in} \usepackage{paracol}   \begin{document}  \newpage \begin{sloppypar}  \begin{paracol}{2}    1. Il y a plus de 50 ans que l'ingénieur Heaviside introduisit  ses règles de calcul symbolique, dans un mémoire audacieux où des calculs mathématiques fort peu justifiés sont utilisés pour la solution de problèmes de physique.\\   \switchcolumn   \end{paracol} \end{sloppypar}  \end{document}   But when I run the codes in TeXStudio, the accented letters completely disappear. (For instance, "ingénieur" in the first sentence becomes "ingnieur".)    Is there a quicker way to fix this than manully typing the accented letters as in this ?

How to type these special letters from European languages in latex? ä, é, and L'?


When I try to set a footer, it appears above the 3 images that I positioned side by side in CSS. Does anyone know how I can solve the problem unique to my code?    .service{     top: 550px;     background-color: rgba(51,51,51,0.7);     font-size: 18px;     color: white;     width: 250px;     margin: 1%;     padding: 1%;     height: 150px;     position: absolute;     clear: both; } .service:nth-child(1){   left: 15%;       } .service:nth-child(2){     left: 39%; } .service:nth-child(3){     left: 63%; } .raining{     top: 724px;     width: 270px;     position: absolute;     clear: both; } .raining:nth-child(1){   left: 16%;       } .raining:nth-child(2){     left: 40%; } .raining:nth-child(3){     left: 64%; }

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case.


Presenter Here I called a method called "services.UpdateSelectedDeposit(deposit);". As you can see it calls a method in the below services, which calls a method in the repository to set deposit model based on the DepositID.  public void OnDoubleClicked(object sender, EventArgs e) {      if(addTipView.DataGridView.CurrentRow.Index != -1)     {         deposit.DepositID = Convert.ToInt32(addTipView.DataGridView.CurrentRow.Cells["DepositID"].Value);         Console.WriteLine(deposit.DepositID);         services.UpdateSelectedDeposit(deposit);         Console.WriteLine(deposit.DepositAmount);         addTipView.TxtTipAmount = deposit.DepositAmount.ToString();         addTipView.TxtDate = deposit.DepoistDate.ToString();         addTipView.TxtHoursWorked = deposit.HoursWorked.ToString();      } }   Services  public void UpdateSelectedDeposit(Deposit deposit) {     repo.GetSelectedDeposit(deposit); }   Repository  public void GetSelectedDeposit(Deposit deposit) {     using (var context = new TipManagerDBEntities())     {         deposit = context.Deposits.Where(x => x.DepositID == deposit.DepositID).FirstOrDefault();         Console.WriteLine(deposit.DepositAmount);     } }   When I print the deposit amount in the repository I get the correct value but when I print the deposit amount in the presenter it's not correct. The deposit class I pass as an argument are passed by reference, right? Why is my value not correct in the presenter.

If I am passing an object to a method, why should I use the ref keyword? Isn't this the default behaviour anyway?  For example:  class Program {     static void Main(string[] args)     {         TestRef t = new TestRef();         t.Something = "Foo";          DoSomething(t);         Console.WriteLine(t.Something);     }      static public void DoSomething(TestRef t)     {         t.Something = "Bar";     } }   public class TestRef {     public string Something { get; set; } }   The output is "Bar" which means that the object was passed as a reference.


I have a string that always contains 8 variable values that are separated with a hypen (-) like in the following example:   5-2-2-2-2-2-2-1  What is the best way to split this into 8 separate values so that I can use each of them in a variable if the values can be either an integer or the value 'n/a' ?  Many thanks for any help with this, Tim.

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


why current if flowing if there is no potential difference. if no potential difference then no work is being done on charge so there should be no net displacement of charge but we know that the current flows. current also flows from higher potential to lower potential but across two ends potential is same(potential difference zero) so no current should flow.

So I started off with electrostatics and everything seemed nice and mathematical and justified and then "DC circuits" happened!  I just cannot understand the model of electron flow in electrical circuits.  Here are my specific doubts-:  1) If potential difference across a tiny cross section of conducting wire is zero, then why on earth does electron flow across that cross section at all? Never mind potential difference across the whole circuit.   2) Is there a constant electric field across a wire connected to a battery? If yes then how is potential difference across a zero resistance wire constant?   Shouldnt it be increasing?  Doesnt it violate ohms law?  If no,  then why do electrons flow at all?  Please take time to consider these doubts and relieve me of my frustration.  I havs searched through the net for this but every answer seems like beating around the bush.  All of the 4 books I have consulted do not address these facts to my satisfaction.   Frankly I think nobody understands this.


Exercise from Lang.  I am trying to show that if $char K = p$ and $a \in K$ has no $p^{th}$ root (implying that K is an infinite field) then $X^{p^n} - a$ is irreducible for all positive integer $n.$ I am stumped.  First I tried $n = 1.$ If $X^p - a$ is reducible then $\prod f_i = X^p - a$ where $1 < deg(f_i) < p$ and $f_i$ irreducible. Clearly $deg(f_i) > 1 $ as otherwise it would mean $a$ has a $p^{th}$ root in $K.$ Now $X^p - a$ is not separable by the first derivative test. Yet each $f_i$ is separable by the first derivative test. Hence, two of these polynomials have a common zero which is a contradiction.   I cannot, however, generalize this method for $n > 1.$ Is there another way to approach this?

An exercise from Lang:  Let $k$ be a field. Let $n$ be a nonnegative integer. Consider the polynomial $x^{p^n}-a \in k[x]$. Assume that $\text{char}(k) = p > 0$. Prove that either the polynomial $x^{p^n}-a$ is irreducible over the field $k$ or there exists a $b\in k$ such that $a = b^p$.  How to prove this statement? I am a little bit confused with this statement.


We have a connected app which is android mobile app. We want the Users using that app to force logout of the app and re-login again. To do so, I have given the session time out value to 15 mins in connected app and session settings and set "force logout on session end" to true, even then, the User is logged in when I checked after 15 mins. even then, the User is logged in when I checked after 15 mins.   When I revoke the access for the user by manually revoking or immediately expiring the refresh token, when the app is opened, I am getting the error as "Check your internet connection" rather than user logout  Is there any way to force logout User from Connected App

NOTE: I am not interested in calling /secur/logout.jsp since it ends all the active salesforce sessions.  I am developing a web application that is registered on salesforce as a connected app, so I am using salesforce credentials to authorize the user.  Application is developed in REST API and the communication with salesforce is happening in restful manner.   Auth url:   Authorization:  Method 1: If there is no salesforce session active, The user is taken to salesforce login page, where he enters his salesforce details to be authorized and after which he is taken to home page of my web application.  Method 2: If there is already a salesforce session active in another tab, the user is directly authorized and is taken to home page of my web application.  Now I am trying to implement logout button for my application, such that the following scenarios are covered,  Scene 1: The user is authorized using method1, and the user press the logout. Upon trying to logback the user is prompted for credentials.  Scene 2:  The user is authorized using method2, and the user should use logout to logout of the web application (not from active sessions). Upon login, the user should be again able to login using method2.  Can someone help me on how to implement the logout button such that it covers scenario 1 & 2.  Thanks in advance.


I want to run several jobs in parallel using the a script that does serial calls to a parameterized script and submits it as a background job on each call. It's for a brute force script which on each call will run 1k of 10k total combinations.   The following is my first hack at it.      #!/bin/bash for i in $(seq 10) do     ./tmp/tmpsky/bd25Par.sh (i*1000-1000) (i*1000) & done   I want $1 to evaluate as 0,1000,2000 etc...and $2 to evaluate to 1000,2000,3000 etc.   The & is to submit the script as a background job. The called module will pass $1 and $2 to be used with seq as follows   #/bin/bash/ for n in $(seq $1 1 $2) do ...`   The first script fails with  unexpected token 'i*1000-1000'  What have I done wrong?

Using echo "20+5" literally produces the text "20+5".  What command can I use to get the numeric sum, 25 in this case?  Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.  I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line.


I'm using bibtex and in the reference part it automatically orders entries alphabetically in the author. This is what I want, the problem is that one of the entries has a compound name Joachim von zur Gathen. And its taking the von to order it, when it should be Gathen. How can I change it?

I'm writing a paper and I need a specific entry in the bibliography go first in the list. The rest of entries should be sorted as usual. I use plain bibliography style and an external .bib file.  For example: there are three authors: Jack Alien, John Bravo and Ally Complex and their papers will be sorted in references as [1] Alien, [2] Bravo, [3] Complex. But I'd like it to be: [1] Complex, [2] Alien, [3] Bravo.  I know, that I can do something like in , but the single .bib file is used in many projects and in those projects the references should be sorted in standard way.  So, how to accomplish, that a specific reference will be placed first in the bibliography?


Please explain where my logic is wrong.  a) Ignoring air, the same bowling ball will fall faster on Earth than on the Moon.  b) Now, for the feather and hammer on the Moon, reverse your point of view and consider the Moon to be a big ball, and the hammer and feather to each be planets.  c) The Moon ball will fall faster on Planet Hammer than it will on Planet Feather.  d) Ergo, returning to our familiar point of view, the hammer will fall faster than the feather on the Moon.  Of course, the difference may be beyond our current technological capabilities to measure, but that's a different issue.  We can get more complicated and say that the hammer and Moon are both falling towards their common center of gravity (as are the feather and Moon) and that this congruence towards the center of gravity will happen faster for the hammer/Moon combo than for the feather/Moon combo because there is more mass (=> gravity) involved in the former case.  The same logic can be conceptualized through GR because the hammer will bend its space-time just a tad more than the feather will, so the Moon will reach rendezvous point with a smaller transition on the time axis.

The common understanding is that, setting air resistance aside, all objects dropped to Earth fall at the same rate. This is often demonstrated through the thought experiment of cutting a large object in half. The halves clearly can't then fall more slowly just by being sliced in two.  However, I believe the answer is that when two objects fall together, attached or not, they do "fall" faster than an object of less mass alone does. This is because not only does the Earth accelerate the objects toward itself but the objects also accelerate the Earth toward themselves. Considering the formula: $$ F_{\text{g}} = \frac{G m_1 m_2}{d^2} $$  Given $F = ma$ thus $a = F/m$, we note that the mass of the small object doesn't seem to matter as when calculating acceleration the force is divided by the $m$ term, its mass. However, this overlooks that the force is actually applied to both objects, not just to the smaller one. The acceleration on the second, larger object is found by dividing $F$, in turn, by the larger object's mass. The two objects' acceleration vectors are exactly opposite, so closing acceleration is the sum of the two:  $$ a_{\text{closing}} = \frac{F}{m_1} + \frac{F}{m_2} $$  Since the Earth is extremely massive compared to everyday objects, the acceleration imparted on the object by the Earth will radically dominate the equation. As the Earth is $\sim 5.972 \times {10}^{24} \, \mathrm{kg} ,$ a falling object of $5.972 \, \mathrm{kg}$ (just over 13 pounds) would accelerate the Earth about $\frac{1}{{10}^{24}}$ as much, which is one part in a trillion trillion.  Of course in everyday situations, we can for all practical purposes treat objects as falling at the same rate because of this negligible difference—which our instruments probably couldn't even detect. But I'm hoping not for a discussion of practicality or what's measurable or observable, but what we think is actually happening.  Am I right or wrong?  What really clinched this for me was considering dropping a small Moon-massed object close to the Earth and a small Earth-massed object close to the Moon. This made me realize that falling isn't one object moving toward some fixed frame of reference, but that the Earth is just another object, and thus "falling" consists of multiple objects mutually attracting in space.


I can't install flash on Ubuntu 14.04 to play facebook games, videos or youtube videos.  I'm using firefox. I've installed Ubuntu restricted extras.

Even though I have the latest Adobe Flash player 11.2 for Linux in Firefox -   - a particular online flash game still requests that I update to the latest flash player.  I've tried this online game on my laptop (Windows 8 with Flash Player 11.8) and it has no problems.  Is there a way to trick Ubuntu or this game into thinking Flash Player 11.8 is "installed"?


Whenever I open Software Updater, it tries to download the repository information for updates and then it fails and shows Failed to download repository information, check your internet connection, even though my computer is connected to the internet. I tried changing the server location from the local server to the main server in the update managers setting. But then it shows, E:The repository 'http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu bionic Release' does not have a Release file., W:Updating from such a repository can't be done securely, and is therefore disabled by default., W:See apt-secure(8) manpage for repository creation and user configuration details., W:An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://pkg.jenkins.io/debian binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FCEF32E745F2C3D5, W:Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/sublime-text.list:1, W:Target Translations (en) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/sublime-text.list:1, E:Failed to fetch http://downloads-distro.mongodb.org/repo/ubuntu-upstart/dists/dist/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?), E:The repository 'http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist InRelease' is not signed.  Can someone tell me what is the issue here?

When updating, I get the following error message:   W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.   Here, I find another statement on this error:   This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need.    Is this what I should do?


I'm wondering, in which case would you use C#'s 'as' keyword, as opposed to casting and checking for an exception? Consider this example:  Parent obj = new Child();  // Method 1: try {     Child result1 = (Child)obj; } catch (InvalidCastException) {     // Handle failed cast }  // Method 2: if(obj is Child) {     Child result2 = obj as Child; } else {     // Handle failed cast }   Both Method 1 and Method 2 produce, as far as I'm aware, the exact same result. I know that, when they fail, the as keyword will produce null, while a cast will throw a ClassCastException, but to me, that doesn't seem like enough of a reason to have two nearly identical ways to cast an object. So I'm wondering, why did the C# language designers go trough the trouble of adding the 'as' keyword?

When programming interfaces, I've found I'm doing a lot of casting or object type conversion.  Is there a difference between these two methods of conversion?  If so, is there a cost difference or how does this affect my program?  public interface IMyInterface {     void AMethod(); }  public class MyClass : IMyInterface {     public void AMethod()     {        //Do work     }      // Other helper methods.... }  public class Implementation {     IMyInterface _MyObj;     MyClass _myCls1;     MyClass _myCls2;      public Implementation()     {         _MyObj = new MyClass();          // What is the difference here:         _myCls1 = (MyClass)_MyObj;         _myCls2 = (_MyObj as MyClass);     } }   Also, what is "in general" the preferred method?


I know that positive real numbers can be denoted in the following way: $$ \mathbb{R}^{+} = \{x \in \mathbb{R}: x>0\} $$  I also encounter this symbol: $$ \mathbb{R}^{>0} = \{x \in \mathbb{R}: x>0\} $$  My question is:   How can I denote nonnegative real numbers, theoretically it should be $\mathbb{R}^{\geq 0}$, but I think it is not elegant way. I have the same question about two dimensional case. I met the following notation. Is it correct? $$ \mathbb{R}_{+} = \{(x, y)\in \mathbb{R}^2: x, y \geq 0 \} $$

What is the "standard" way to denote all positive (or non-negative) real numbers? I'd think  $$ \mathbb R^+ $$  but I believe that that is usually used to denote "all real numbers including infinity".  So is there a standard way to denote the set  $$ \{x \in \mathbb R : x \geq 0\} \; ?$$


For example,  in  video from 2:00 onwards,  the Prime Minister of New Zealand says "woman/women" several times.   The context shows clearly that she means the word to be plural,  but she says "woman" every time - or to look at it another way,  she pronounces the plural the same way that "woman" would usually be pronounced.  My question is,  is it usual for the two words to sound indistinguishable in NZ English,  or is this perhaps just a particular local dialect?  Also,  do New Zealanders sometimes write "woman" when they're referring to the plural  (in the same way that "sheep" and "deer" are the written plurals),   or is this just a pronunciation characteristic that doesn't show up in writing?

I have read in a number of places that the NZ pronunciation of "women" must be rather peculiar. Quoting from :     For some years I've noted the tendency of Kiwis to pronounce "woman" and "women" identically (as "woman").   To which an Australian replies:     It appears there is a vowel shift going on in New Zealand (NZ) English [...] [T]he vowel in "women" which in Australian English is the same as the vowel in "hit", is often, in NZ, reduced to a schwa [...]. It makes the plural sound like our singular. I don't think the NZ pronunciation of the singular is the same as the NZ plural   A New Zealander begs to differ:     I've noticed this trend over the last few years also. To me as a kiwi it doesn't sound anything like a mispronounced plural -- it just sounds as if the speaker is using the one word for both singular and plural. [...] I see it as part of a much larger tendency to confuse singular and plurals. [Several examples follow.]   Who's right? Who's wrong? Wikipedia has :     In New Zealand English the short i of KIT is a central vowel not phonologically distinct from schwa /ə/, the vowel in unstressed "the". It thus contrasts sharply with the [i] vowel heard in Australia. Recent acoustic studies featuring both Australian and New Zealand voices show that the accents were more similar before the Second World War and that the KIT vowel has undergone rapid centralisation in New Zealand English. Because of this difference in pronunciation, some New Zealanders claim that Australians say "feesh and cheeps" for fish and chips while some Australians counter that New Zealanders say "fush and chups".   So, there appears to be a vowel shift going on; but I'm not sure if there might be some truth to the people-just-stop-caring-about-certain-plurals argument as well.  I hope we have enough New Zealanders on board to shed some light on this.   Can you provide a guide to how to pronounce "women" and "woman" in NZ English? (I've done some searching for audio files or YouTube videos, but haven't found anything yet.)  Would you say that it's just the vowel shift, "a much larger tendency to confuse singular and plurals", or both?  How recent is this trend? (E.g., if you are a native speaker of NZ English, is your pronunciation of "women" different from that of your parents/grandparents?)


Now that you can get great offers and deals on hotels or flight/train tickets on multiple websites and apps, is there any added advantage of going through a travel agent. Do they have any cheaper fares or promotions or any hidden benefits that is not commonly known?

I take quite a lot of flights for both business and pleasure, and although I typically book my business flights through a (corporate-mandated) travel agent, I always book my personal flights directly with the airline (I should add that I am fussy, and I normally fly only with full-service airlines; no budget ones for me).  From time to time, I read that booking flights through a travel agent, either online or physical, can lead to cheaper prices. At least for simple trips (one airline, maybe a simple return), I have a hard time believing this to be the case; the airline has most direct control over their tickets, travel agents add a layer of extra indirection that has to be paid for, etc.  So am I losing anything by not booking with a travel agent? Am I really likely to get better prices?  Edit: I should be clearer - let me restrict the scenario by imagining that I already know what I want - e.g. to get from LHR to ORD on date X/Y/Z, with no stops, ideally on American Airlines. Can a travel agent still offer me something in that scenario?


Let's say I want to search for "100-Coins Star" (with the speech marks to tell Google to search for that specific term).  Google comes up with results for 100 Coins Star. Ignoring the spaces and dash.  Is there a way to get Google to behave they way I want it to. Or is there a site that does allow this and has similar coverage to Google?

As I learnt from this , Google has no ability to search for special characters. Let's say I want to search for ss!. Are there any other search engines that can achieve this? Please do not propose any programming code search engines since this is a general search.


static void Main(string[] args)     {         int numberOfTheWords = 1;         string[] words = new string[numberOfTheWords];          Console.WriteLine("You can exit from program by writing EXIT ");         Console.WriteLine("Enter the word: ");         for(int i = 0; i < numberOfTheWords; i++)         {             words[i] = Console.ReadLine();               if (words[i] == "EXIT")                 break;             else                numberOfTheWords++;         }     }   Guys I am trying to expand the lengt of the array but "numberOfTheWords" variable is in the "for loop' scope" so it does not effect the global "numberOfTheWord" variable and i cannot expand the array length. What I am trying to achieve is to make dynamic array. I do not want to declare the length of the array. When the user input a word, the length of the array will be increased automatically. Can you help me about how to do this?

Is there any method for creating a dynamic array in C#?


Prove that the set $C$ of points in $\mathbb{R}^2$ such that at least a coordinate is irrational is connected set.  Ok, I know that the set of Irrational numbers isn't connected but how that helps me?  I tought in:   Let $A \subset C$ a nonempty a clopen, then we need to show that $A=C$, ok, how I can continue?

Here's a question that I share:  Show that if $D$ is a countable subset of $\mathbb R^2$ (provided with its usual topology) then $X=\mathbb R^2 \backslash D $ is arcwise connected.


In The Cursed Child, we see that Harry and Co. use Floo powder to come to Hogwarts and talk to McGonagall about Albus and Scorpius. This means that Floo Powder can be used to come in and out of Hogwarts. Even if The Cursed Child is not counted as one of the 'mainstream' books, in OOTP, we see that Sirius is able to use Floo Powder to talk to Harry. From the above lines, it is quite evident that students may be able to use Floo Powder to come to, or get out of Hogwarts. Is there any mention in the books of students using Floo Powder to come to school?

“Come on,” said Harry dully. “With Umbridge policing the fires and reading all our mail?”   Umbridge started policing the fires after Harry first talked to Sirius in Year 5.   Prior to Umbridge, could anyone simply floo to Hogwarts (the way Sirius did at the start of the book to Gryffindor common room)?   If not, what does the canon say about any security around Flooing to the castle?


I can't seem to be able to apply a texture to an extruded .SVG.  Note:  does not solve the question as it relates to an older version of Blender: there's nothing like a "grey dot icon on the right side of the Color selector" in my Blender version.   Here's what I do: 1) Import SVG and extrude  2) Transform to mesh (Mesh from Curve: Alt-C, 2)  3) Import texture file, and set texture coordinates as "View"  4) Set the viewport shading to Texture  5) Notice the the mesh does not get textured properly 6) Go to edit mode to check if something is weird 7) Notice that there IS something fishy   What am I doing wrong? Thanks AC  My materials look like this:       @cegaton:  This is how my blender looks like:   If I click on "New" this is what I get:   While this is what YOU see:   How can I do it with my GUI?

I am creating a model of a glass and I would like to put a drawing on it (a png picture).  I know how to do it using Blender Render, but not with Cycles Render. Help :)


I have a shapefile with table with area code (field areacode).  How can I export with ArcPy each unique area code so I get a SHP file for each one?  It takes too long to select the layer and query each area code and then export manually to SHP file.

I have a feature class with over 2,000 features, and I need to make them all individual feature classes based on a field.   Is there a way to do this?


I have this weird issue when i try to move a model made in blender to unity my model will get extra bits in unity.  Viewed in blender:   Viewed in unity:   Anybody had this issue before? If so how did you fix this?

When I make a 3d model in blender and import it to unity the model has an incorrect size and im thinking the problem has to do with the units but I don't know what units to use while modeling in blender (cycles).  Another problem is that when I import it into unity it imports itself without textures so im thinking it has something to do with how I save the model in blender, right know im saving it as .blend  And the final problem is that when I import the model from blender to unity the y,x,z axis are inverted or weird.  Thank's in advance.


I am new to unit test. One thing I am struggling with is to determine what type of test to write for my method. Using the code below as an example, what should I be testing here? what are the various test I can  write.   [HttpGet] [Route("GetPosts")] public async Task<IActionResult> GetPosts() {     try     {         var posts = await postRepository.GetPosts();         if (posts == null)         {             return NotFound();         }          return Ok(posts);     }     catch (Exception)     {         return BadRequest();     } }

Using C#, I need a class called User that has a username, password, active flag, first name, last name, full name, etc.    There should be methods to authenticate and save a user.  Do I just write a test for the methods? And do I even need to worry about testing the properties since they are .Net's getter and setters?


I have my house wired up with security cameras. When traveling others countries, I still can get phone alerts that there is movement in the house, and can access the security feeds on-line to see if there are burglars. But if I want to ring the police to go to my house, how can I call them? I can use a long distance phone card, but I think 9-1-1 won't work as usual in this situation.

I know this question sounds ridiculous but it's important and I need to know the answer. If I knew that somebody in Ireland was in trouble and needed help (say for example: an ambulance) but there was no one else around them that could help them, how would I go about calling emergency services for them?   For example: I am on the phone to a friend in Ireland every day and I worry about how would I be able to help them if something came on suddenly (like they starting having a fit or something) and they weren't able to hang up our call and dial emergency services themselves.  I've done my research and already know that 999 and 112 are the main numbers for emergency services in Ireland, but would my call even go through to them? I'm in the US and don't have international calling, so my calls won't even go through to any other numbers outside of the US (though I can receive them).   Would I have to dial an area code before dialling 999 or 112? If you dial 999 or 112 in the United States, will you be connected to something else entirely? (Like a 411 type of deal?) or what if I just dialled 911 and explained the situation, would THEY get in contact with emergency services in Ireland?


Recently, I have to work with some problems that require to draw table like below in LaTeX. I used to think about diagonal line inside a cell, but it's not a good choice for this problem since the texts are not in diagonal direction. Does anyone create something like this in LaTeX, can you suggest me any solution

I'm trying to create a table with a diagonal first row, like in   I've looked through the documentation for PGF-TiKZ, but am still unsure as to how to do the above.  From  I've managed to make diagonal entries on the top row, but what I would like is to add in the option of having it enclosed by cell borders like in excel, with an option to specify the length of each line of text within the top row. An option capability to close the top of the row with a border would be nice too. Is there any way to do this, preferably through the tabularx package?


On the Stack Exchange boardgames' domain I sadly was not able to submit my response, as the game I was posting about is not so popular (). So I just went on and put any random tag on it. I am really thinking something should be done to the reputation system, as it clearly benefits 'veterans' and removes all the 'simple' rights of newcomers (me :D). I think those people should be able (1) to create tags, which won't be created at first, only displayed and awaited for approval, (2) be able to upvote thankful answers in their topics (as it's obvious that new people will reply a 'thank you', while they shouldn't, as it seems like).  Also, I would strongly recommend (3) on any forum the special 'undefined' tag, which will be a ping for experienced people: They can later on help adding correct tags, and show which tags could be used. I mean, if you don't find the correct tag, most of you either create the one they need or use any tag randomly, since one is the minimum, right?  Well, personally, that's how I'd fix a problem. Believe me, no-one reads the terms, every accepts them. Same with new users: I think stack overflow should have something similar to an 'explanation modus', where every button may have a question mark, explaining what it does, how to avoid, etc. For example this meta site here. I only heard 'discussing the site itself here': I am completely sure that this topic gets bumped with off-topic marks, without anyone explaining me, where else? Right? Basically, where do you suggest things to the sites if not here (I made a topic about the site on the meta, it was off-topic, I mean, I just couldn't search/find for what to do in this hopeless situation)?  The last thing I'd suggest is basically not to display the amount of downvotes. Imagine the following scenario: Someone joins stack overflow, and maybe he has searched wrong and couldn't find anything, and maybe even had some spelling mistakes: 31 downvotes, 10 people mark the topic as off-topic, 5 as duplicate.. I clearly know how he would feel because I was in a similar situation: I asked for help and someone just hid my topic. I felt like in dictatorship, where there is no right for opinions. If stack overflow is such a dictatorship, then please redirect me to a nicer forum. Well, I hope it's not, so, no matter who is down there trying to prevent me from asking for help, please don't and remember when you just joined stack overflow. The way reputation currently works is ill for new users: being stuck in the endless circle of 'bad' questions, not becoming better, not having any ability to raise up.

Can someone please create the tag  on our site? We need to have it because        Foo is a recent/upcoming release / edition / model / episode of a popular, established OS / board game / bike brand / TV show   Foo is a hot new language / ingredient / game   we're currently using some other tag for questions about Foo, but it's causing ambiguity with a separate thing that's also named Foo      This is not a joke post. We get a lot of feature requests that ask for this or that tag to be created, and every time, a discussion ensues wherein people explain that there is no "tag creation department" and that community members create tags just by using them. I'm posting this "question" so that future requests of that type can be closed as a duplicate of this, saving time and eliminating redundant conversations for everyone involved.     See also:


A person, $A$, speaks the truth $4$ out of $5$ times. The person throws a die and reports that he obtained a $6$. What is the probability that he actually rolled a $6$?  I know there is a similar question like this  but my doubts are different from it and also I want to identify and solve total probability theorem questions so I posted a side doubt also. In my attempt, I defined the events  \begin{align*}  E_1&: \text{The person tells the truth.} \\  E_2&: \text{The person lies.} \\  E_3&: \text{The person reports that the die landed on a 6.}  \end{align*}  I noted that $P(E_1)=\frac{4}{5}$, $P(E_2)=\frac{1}{5}$, $P(E_3|E_1)=6^{-1}$ and $P(E_3|E_2)=0$ and obtained  \begin{align*}  P(E_3) = \frac{4}{5} \cdot \frac{1}{6} + \frac{1}{5} \cdot 0 = \frac{2}{15}. \end{align*} However, the correct answer is, $\frac{4}{9}$. What did I do wrong?  Side doubt: Even though the first experiment (truth and lying) is different from the second experiment, can we still apply total probability theorem? In my book the dependent experiment lies inside the sample space associated with the mutually and exhaustive events.

First, I apologise for the vague title. I couldn't think of a short way to represent the problem. Also, I am aware that a similar question exists, but I have a little bit more insight.  The problem is:      A man is known to speak the truth three out of four times. He throws a   die and reports that it is a six. Find the probability that it   actually is a six.   The answer in the book is $ \frac{3}{8} $, which sounds completely off to me, given the numbers, on first glance. I decided to try it on my own. After some contemplation, it indeed is true that $ \frac{3}{8} $ is correct. But, the question's vagueness makes it interesting. It's sort of a naive answer!  First, here's the book's solution:  Let $ E $ be the event that the man reports that a six occurs, $ S_1 $ be the event that six occurs and $ S_2 $ be the event that six does not occur.  $ P(S_1) $ = Probability that six occurs = $ \frac{1}{6} $  $ P(S_2) $ = Probability that six does not occur = $ \frac{5}{6} $  $ P(E~|S_1) $ = Probability that the man reports that a six occurred when it has actually occurred (truth) = $ \frac{3}{4} $  $ P(E~|S_2) $ = Probability that the man reports that a six occurred when it hasn't actually occurred = $ \frac{1}{4} $  $ P(S_1|E) $ = Probability that a six has actually occurred when the man claims so =  $$ \frac{P(S_1)~P(E~|S1)}{P(S_1)~P(E~|S_1)+P(S_2)~P(E~|S_2)} = \frac{3}{8} $$  Link to original: Page 25 of  (link updated 22/11/2015; tends to break often).  Here's the first of my two solutions:    The question is a little vague and it doesn't tell us what the man says when he doesn't get a six. Assuming he lies every time he doesn't get a six (which is not quite what the question says), would bring up $ P(E~|S_2) $ to $ 1 $, which skyrockets $ P(lie) $ to $ \frac{1}{6} + \frac{1}{6} + \frac{1}{6} + \frac{1}{6} + \frac{1}{6} + \frac{1}{6}.\frac{1}{4} = \frac{7}{8} $.  Also, $ P(E~|S_1) = \frac{3}{4} $ and $ P(E) = \frac{5}{6} + \frac{1}{6}.\frac{3}{4} = \frac{23}{24} $.  This brings us to, $$ P(S_1|E) = \frac{P(S_1)P(E~|S_1)}{P(E)} = \frac{3}{23} = 13.04\% $$  Please note that I don't care about the sixes rolled when he lies about it being a six, because that condition is not applicable to the question.  I'm very skeptical about my calculations! I decided to whip up a simple program and see what the probability distribution is for $$ \frac{Number~of~sixes~rolled~while ~saying~it's~a~six}{Number~of~dice~rolls} $$  Here's the result:    Considering the book says $ P(E~|S_2) = \frac{1}{4} $, which is in essence is contradictory to the question, let's also consider the other possibility:    It's even more vague in this scenario! If the man lies after any given roll, there is a $ \frac{1}{5} $ probability that he will lie about it being any other number. This creates a new branch at each lie, which splits into five. In this case,  $$ P(E) = \frac{1}{6}.\frac{1}{4}.\frac{1}{5}.\frac{5}{1}+\frac{1}{6}.\frac{3}{4} =  \frac{1}{6} $$  $ P(E~|S_1) $ still remains $ \frac{3}{4} $, but $ P(E~|S_2) = \frac{1}{4}.\frac{1}{5} = \frac{1}{20} $.  $$ P(S_1|E) = \frac{P(S_1)P(E~|S_1)}{P(E)} = \frac{3}{4} = 75\% $$  This seems like the more intuitive answer, and it is why I doubted the original answer in the first place. Given a truth probability of $ \frac{3}{4} $, there was no way that the probability of a six was $ 37.5\% $!    The ambiguity of the question is what makes $ \frac{3}{8} $ wrong to me. Entirely out of curiosity, which answer fits best with the question and are these calculations correct or baloney?


I don't know if it's a problem on all sites, but on  I see that often new users just want to add a comment, but they can't because there is a 50 rep requirement. So they post an answer instead. Then this answer is flagged. Then a mod converts the answer to a comment. Then we never see the user again.  An example just now is this post:   It's a very useful comment, but it's a comment on the answer above, not an answer.  Now I understand that there are very good reasons for the 50 reputation requirement for comments and I did notice the post   but I wonder if there can/should be any accommodations.  An option might be to allow users to make only 1 comment if they have less than 50 rep, and no more comments allowed until they achieve 50 rep.   It's not a perfect solution, far from it. I'm just trying to think of ways to stop this from happening because I feel like a lot of new users are lost because of the fact that they can't comment, or comment incorrectly. On beta sites trying to grow, it's important to do everything we can to retain new users.

While reviewing "First Posts" on Stack Overflow, I often come across new users posting comments as answers. It seems (at least to me) they are not doing this because they are unaware of how Stack Overflow works but because they can't comment on any question they are forced to put it as answer.  I have found duplicate questions for my request like:   ,  and    but the best explanation I have found is an  to .     I think the main reason this isn't supported is there's no way to   downvote comments, which would make them attractive to spammers. If   somebody comments on the top answer in a question the only way to get   rid of it is for six people to flag it. Comment flags don't show up on   10k tools, so it needs to be six people that happen to stumble across   the spam comment, or a moderator that checks the list manually. People   can comment every 15 seconds, so that can get out of hand pretty   quickly. Comments also aren't listed on the user's profile page, so   it's hard to see at a glance if a user has been spamming   So I am suggesting allowing new users (with less than 50 reputation points) to comment only 5 times every day or only 25 times times until they reach 50 reputation points or any other variation of it.


I've the below string, Now I want to match the string if it contains Continue? [Y/N]. I tried couple of ways but it didn't worked as expected. Any suggestions to match the complete string if contains Continue? [Y/N]  Input String:   Warning: do you want to proceed, some-more,text. Continue? [Y/N]

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


Is it possible to upgrade the old cmd.exe in Windows Server 2012 to the newer one that comes with Windows 10? I like the new one much better because it's easier to paste things into it.

I'm running a Windows 7 Machine and wish to use it with my Windows 10 Batch file, however the colored text it uses does not support the Windows 7 Console (see  ). Is there any way I can run the Windows 10 CMD on Windows 7?


How do you elegantly format a timespan to say example "1 hour 10 minutes" when you have declared it as :  TimeSpan t = new TimeSpan(0, 70, 0);   ?  I am of course aware that you could do some simple maths for this, but I was kinda hoping that there is something in .NET to handle this for me - for more complicated scenarios  Duplicate of

What is the recommended way of formatting TimeSpan objects into  a string with a custom format?


It is not uncommon, especially for narrow fields, that you review papers authored by people that you might, at some point, come to interact with more or less closely. This can range from meeting them at a conference to even start a collaboration together.  Some times, when discussing with these people a point directly related to one of their papers it could be relevant to make a comment based on a discussion that came up as part of the reviewing process.  I have recently felt tempted to tell someone "hey, I refereed you paper, by the way, so I am particularly familiar with this and that..." but refrained myself because peer review is supposed to be anonymous.  Is it appropriate to bring up that I refereed somebody's paper when having a discussion with this person, in particular if it adds constructively to the discussion? Would it become "more appropriate" as time goes by and the review becomes "a thing of the past"?

I am wondering if a referee can reveal the title of the papers he/she has refereed for a journal (either by talking about it in the pub, posting it on facebook or another mean) after the decision has been made.  The reason for my question is that I have seen some people revealing titles of the papers they referee but I have not found an authoritative reference for judging this behaviour.


Im new to ubuntu server , im using a personal home server and i want to install a download manager through terminal. On windows i have been using jdownloader on which i was able to use my accounts on "downloading" sites like rapidshare , easybytes etc..  I read that jdownloader can be installed on ubuntu but only via desktop/gui. Is there any download manager like jdownloader but with webinterface? so it will be easy to use?   Thank you

I currently run a headless server (Ubuntu server 12.10) with various applications running on the box accessed via web interfaces (transmission, plex etc). The box sits at a site with a quick and serves the purpose of being a central file repository, torrent box.   I was wondering if there was any application I could install on it which I could access via a web interface, password protected, which allowed me to punch in a file URL and it could download that file to a predetermined folder? Something similar to the transmission client for ubuntu server but for files off the web?