There are some extensionless files in current directory (there are not dot in their names).  I want to rename like so:  filename -> filename.md   I tried doing mv * *.md but that didn't help.  I am interested in a function that takes an argument for the extension and renames accordingly, and the another one for the files to perform operation on.

I would like to change a file extension from *.txt to *.text. I tried using the basename command, but I'm having trouble on changing more than one file.  Here's my code:  files=`ls -1 *.txt`  for x in $files do     mv $x "`basename $files .txt`.text" done   I'm getting this error:  basename: too many arguments Try basename --help' for more information


look at this equation:  101x + 103y = 1  how can i prove if there is a solution or not to this equation?  x and y must to be intergers  i really have no any idea how is possible to prove something like this, hope you can give me any direction.  Thanks!

I know that if $a$ and $b$ have a highest common factor $h$ then you can write $h=ax+by$ for some $x,y \in \mathbb{Z}$ but how about if you can write $h=ax+by$ for some $x,y \in \mathbb{Z}$ then can you write $h=\gcd(a,b)$?  I.e. Is $h=\gcd(a,b) \iff h=ax+by,~ x,y \in \mathbb{Z}$


Do we need a comma in the following sentence?   What encourages me more to do that [,] is that I am interested in science.

In the sentence     What’s funny is Cat’s dry humour.   Wouldn’t it be better to put a comma after “funny”:     What’s funny, is Cat’s dry humour.   This question entails a (at the time of writing) heated discussion in the .


Lets say I have this list of numbers:  1, 2, 3, 4, 7, 8, 10, 12, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 27, 29  And I want to create 5 even groups based on ascending order in the list:  group 1: 1, 2, 3, 4, 7  group 2: 8, 10, 12, 15, 16  group 3: 17, 18, 19, 20, 21  etc...  Can I use python to do this?   I know that I can group by 0:4; 5:9... but I have many lists of various lengths that I need to sort into 5 exact groups each.

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


How can I make sure that my bash history gets written to ~/.bash_history when I am disconnected abnormally?  I work on several remote Linux hosts, and my connection is frequently terminated abnormally. When that happens, my recent bash history is not available when I reconnect. I suspect that the abnormal termination is preventing the bash shell from writing to ~/.bash_history. I can't control the disconnects, and other than losing my history, the abnormal disconnects don't cause a problem.  I don't want to interfere with the normal history mechanism. In other words, I don't want a hack that messes up the history process. Thanks!  EDIT:  I am concerned about the ~/.bash_history on the remote machine.  The immediate write method may be the best way to go. The abnormal termination event may not allow a final dump to ~/.bash_history.  I have keep alive set up for ssh, but the remote hosts don't always allow that.

I often open lots and lots of Terminals [Right now I have 7 open on this workspace] and I often search history with grep to find a command I've just written recently, but I don't want to hunt down the terminal and then scroll up and hunt for it more, etc.. Sometimes my terminals close without 'exit,' and everything I've written is lost [Sometimes I've needed something I'd written in a terminal that was killed].  So is there a way to make it so each terminal writes to .bash_history immediately? or at least once a minute, or something like that?


I'm looking for the word(s) that describes my current dilemma:  I have begun a project that seemed, at its outset, quite simple - tedious, but simple. However, the further I get into the project, the more complex it becomes; the longer I work on it, the less likely it seems I will complete it.  Is there a word or idea that describes this? It's like running at a speed of 10 miles per hour after something that is moving at 11.

Is there a phrase or word for a problem that appears simple but is in fact full of complexities?  A few situations come to mind:   Painting a room Breaking up with a boyfriend or girlfriend Eating a pomegranate   ... and a million more. What to call these?


Please comment on the following code, I need to know if this is what you would consider a prepared statement.  My server will not accept question marks as placeholders, it gives me an error when I tried so I ended up doing it this way which does work but I am concerned about getting hacked.  Thank you in advance.  // // Insert data into database // $sql = "INSERT INTO users (username) VALUES (:username)";                                          $stmt = $link->prepare($sql);                                               $stmt->bindParam(':username', $Param_username); $Param_username = $username;               $stmt->execute();

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I have problems getting random numbers to stay within a certain range. I've tried a few different suggestions, but none of them worked so far. This is the latest one I tried. Using this code generates me numbers between 0-30. But I wanna stay within 50-20.  Suggestions?   void randomNumbersForEquation() {          Random randomNumbers = new Random();         int number1 = randomNumbers.nextInt(51 - 20);         int number2 = randomNumbers.nextInt(51 - 20);         textEasyNumber1.setText("" + number1);         textEasyNumber2.setText("" + number2);      }

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.


Give four groups of order 20 that are not isomorphic.    I know the integers under addition mod 20 is one group of order 20, but what would three other groups of order 20 that are not isomorphic to it?

Find four groups of order 20 not isomorphic to each other and prove why they aren't isomorphic.   So far I thought of $\mathbb Z_{20}$, $\mathbb Z_2 \oplus\mathbb Z_{10}$, and $D_{10}$ (dihedral group), but I can't find another one. Would $U(50)$ work? I know it has order 20 and is cyclic but I'm not exactly sure how to move from there. Can someone to point me on the right direction?


I want to know if is safe download programs by software center and ubuntu software.  Thank you very much.

I read in the news about all the malware that is infecting Android OS. The malware is in Google's App Store and people are unknowingly downloading and installing it.  As I understand, Ubuntu's Main repository is safe for me to download from (I won't be infected with malware from doing so) because Canonical engineers review the software. But what about other repos, most notably the Universe repository? Does the Universe repo receive any sort of review to protect from malware? Is it advisable to avoid the Universe repo for fear of unknowingly downloading malware from it?  I've read PPAs are particularly dangerous because they are not reviewed. I'm assuming it is perfectly safe to use the Google Chrome PPA however.  So if I use nothing but the Main & Universe repositories and Google Chrome PPA, will I be protected from unknowingly downloading malware?   If Ubuntu does gain hundreds of millions of users like Mark Shuttleworth predicts, won't Ubuntu PPAs become the malware problem for Ubuntu like Google's App Store is today for Android?


I have the following JSON array  var json = [  {       'albumTitle':'Title',     'leader':'Leader',     'trackList':'track1;track2;track3;track4'  }, etc... }]   I'm iterating through the array and displaying on page with a standard for loop.  for (var i = 0; i < json.length; i++) {     $("#albums").append(`      <div>          <p>`+json[i].albumTitle+` by ` +json[I].leader+`</p>           <h1>Track List</h1>          <p>`+json[i].trackList+`</p>      </div>      `);   How can I display json[i].trackList as separate list items? Like:

Track 1

Track 2

Track 3

   Thanks for any help.

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...


I can show vector layers from PostGIS using QGsMapCanvas and QGsVectorLayer in my standalone application. But now I need to show 3d models, for example 3dmax or sketchup, of some buildings over vector layers.   Is possible at all?   If it is possible, how can I do this?   Maybe there are any plugins for this?

Can I create a 3D model in QGIS or is there some model for 3D city models?


I have a problem with my Ubuntu 15.04, after installing Python 3.4.3 I couldn't run the Software Center and this message appears:  File "/usr/bin/software-center", line 140      print time.time() SyntaxError: invalid syntax

I have been fiddling with my Python installation on Ubuntu 12.04 (I was having trouble installing a python library), and at one point my python command wasn't working. It turned out the symlink was missing (I must have removed it by accident lol), so I  pointing to Python 3.2 (originally pointed to 2.7):  sudo rm /usr/bin/python sudo ln -s /usr/bin/python3.2 /usr/bin/python   Problem: the software center and update manager weren't working:  ~$ software-center   File "/usr/bin/software-center", line 152     print time.time()              ^ SyntaxError: invalid syntax   I guessed this was because I had changed the default python version (2.7->3.2), so I changed it back to 2.7. Now they work fine, but I'd still like to change the 'default' python version (i.e. the one called with python in the terminal).  Is it possible to do that in Ubuntu 12.04? Thanks!


I want to find a pattern " and b_start in (ANYTHING)" and replace it with an empty string. The following code of mine does not work; i'm afraid it's due to the brackets in the pattern. Can anyone help to point out what's wrong with it? Many thanks.   $a=" and b_start in (2,3,5,6...) and b_end in (4,5,3,4,5...)"; $b=preg_replace("/ and b_start in \(.*\)/", "", $a);   I expect $b to return " and b_end in (4,5,3,4,5...)";

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


I found the website http://stackoverflow.xluat.com/questions (edit: do not go there, the site is possibly malicious now) and it seems to be the  version of Stack Overflow.  But I cannot find any trace or information about it on SO or SE. Does anyone know anything about it?

of Stack Overflow, all content posted on Stack Exchange sites by their users (i.e. you wonderful people) has been provided to the whole universe under . For my fellow non-lawyers, that license basically means:   Anyone can use any Stack Exchange posts at any time without having to ask for permission Making money off of the copied content is permitted You don't even have to copy stuff from here verbatim; you can just use it as a starting point and make whatever edits you want There are just two rules you have to follow:   You have to provide . Simple links to the original post and author info are just fine. You have to  and allow other people to use your content, as long as they follow these very same rules. How meta!    (If you ever forget any of that, and want to refresh your memory, the license info is linked to in the footer of every page.)  There are, in fact, a lot of people who republish varying amounts of our content for assorted reasons. Unfortunately, there are some Stack Content Republishers Attributing Poorly and/or Excelling at Ranking (SCRAPERs, for short).  In this context, "attributing poorly" means any use that doesn't follow our attribution rules or make any other reasonable attempt at give credit. This can get pretty egregious; I've seen SCRAPERs that not only don't link back to SE originals, but also use fake author info and post dates to make it harder to find originals. By "excelling at ranking," I'm referring to copycat sites that end up higher in Google results than the original SE sites do for the same content. That's not necessarily wrong, but in some cases, it indicates inappropriate SEO hackery.  So, the question is: what can you do if you spot a SCRAPER?


Long story short, I'd like to search for question containing the text operator"".

We used to be able to , but that now appears to be broken.  I'd expect a  to return a result, but instead the search engine appears to put quotes around the whole request; the search box shows the search has been replaced with "[python] += list" and the  I was looking for doesn't appear among the returned questions.  Using quotes around the symbols do not seem to help here;  returns an empty result.


Here is my . I have 2x2 GB RAM installed. Specification says that it can support 8 GB, but there is a note saying "At the time of this publication HP has not qualified SO-DIMMs larger than 2.0 GB for use with this motherboard. Higher capacity modules may be qualified at a later date."  So I can't have more than 4 GB?

If I want to add more RAM to my computer, how can I buy something compatible? What kinds are there? How do I determine which kind my computer will accept and how much I can add?


I recently replaced my light fixture in the basement.  The second time I flipped it on, it made a buzzing noise and went out.  When I do a wire test, the light outlet wires are getting no power. At the light box switch the outlet is getting power but the switch isn't.  The black wire from one set goes to the switch and the other wire hooked to it is another black bridging wire to the plug in the outlet.  and hooks he the side white and all which ones are hooked to the the back side of the plugin.  No ground on the switch but there's one on the plugin outlet. No ground on light fixture as well.  How do I fix this?

I hope this explains it better: in this room there is a switch with one set of wires and only the black one went through the hole in it, and another black one in the other hole, and is hooked to the outlet by being wrapped around the screw terminals. The ground is cut short and not grounded.  Now on to the outlet: the wire from the switch is connected to the top screw - but it's on the side that says "white".   There are two more sets of wires that connect to the outlet as follows:   the two black ones are on the the other screw terminal on the bottom (one on the "white" side)  the grounds are grounded to the screw terminal below that  the white ones are connected by the one from the switch to the bottom (black side), with one of the white ones from the other set on the screw terminal, and the one from the other cable is on the top screw terminal on the "white" side.   Now to the light: there are the black and white that come out of the box, and that is the set that has the ground cut short.  The original light fixture was a single 660w/250v rated socket.  The one my friend put up was a fixture with two 660w /250v sockets.  At the light only black and white connected, not ground... It worked then made noise and this is where I'm at.  When I wire test them, the black one from the switch and the white ones from either sets nothing...  but all the other ones light up.....!


i have that simple PHP codes is it secure enough or needs some other workflow ? and to manage my web app (i use Reactjs) the update and delete and select of different rows of my database , dose its better to separate this statements codes in different PHP files or using an if() in one PHP file to check which operation to execute is a better idea ?  select :  <?php header('Access-Control-Allow-Origin: *'); header('Content-type: application/json'); $serverName = "localhost"; $userName = "root"; $userPassword = ""; $dataBase = "todosdbs"; $con = new mysqli($serverName,$userName,$userPassword,$dataBase); $stmt = $con->prepare("SELECT * FROM todostable"); $stmt->execute(); $result = $stmt->get_result(); $todosArray = $result->fetch_all(MYSQLI_ASSOC); $todosArrayJSON = json_encode($todosArray); echo $todosArrayJSON;     $stmt->close(); $con->close(); ?>   insert :  <?php header("Access-Control-Allow-Headers: *"); /*header('Content-type: application/json'); header('Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE  ');*/ $data = json_decode(file_get_contents('php://input'),false); $serverName = "localhost"; $userName = "root"; $userPassword = ""; $dataBase = "todosdbs"; $con = new mysqli($serverName,$userName,$userPassword,$dataBase); $stmt = $con->prepare("INSERT INTO todostable (text,isDoneChecked,isEDitable,isRemoved) VALUES(?,?,?,?)"); $stmt->bind_param("siii",$data->text,intval($data->isEditable),intval($data->isDoneChecked),intval($data->isRemoved)); $stmt->execute(); $stmt->close(); $con->close(); ?>

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Okay so I want remove duplicate lines but it's a bit more complicated than that..  I have a file named users.txt, example of file is:   users:email@email.com  users1:email@email.com   Now due to a bug in my system people were able to register with the same email as someone else, so I want to remove if lines have the same email more than once, example of issue:   user:display:email@email.com  user2:email@email.com  user3:email@email.com  user4:email@email.com   Notice how user, user2, user3, user4 all have the same email.. well I want to remove user2, user3, user4 but keep user.. or vice versa ( first one to be picked up by request ) remove any other lines containing same email..  so if   email@email.com is in 20 lines remove 19  spam@spam.com is in 555 lines remove 554  and so fourth..

I have large 3-column files (~10,000 lines) and I would like to remove lines when the contents of the third column of that line appear in the third column of another line. The files' sizes make sort a bit cumbersome, and I can't use something like the below code because the entire lines aren't identical; just the contents of column 3.  awk '!seen[$0]++' filename


I am going to ask a really stupid question here. It is a very well known fact that gravity is inversely proportional to the distance squared between two masses. I understand how he arrived at this idea using Kepler's law and centripetal acceleration. But I was wondering how he found out that gravity is proportional to the product of two masses. Is this something obvious that I am too dumb realize or is there other proof behind this?

In Newton's law of gravity $$F=\frac{G M_1 \cdot M_2}{r^2}$$ we do the product $M_1 \times M_2$ and not the sum $M_1 + M_2$. Why's that so?


Let $p \ge 5$ be prime. Prove $p^2 \equiv 1 \pmod {24}$. I'm having some trouble drawing anything useful from $p$ being prime. What can we say about p being prime that will help prove the statement?

Let $p>3$ be a prime. Prove that $24 \mid p^2-1$.   I know this is very basic and old hat to many, but I love this question and I am interested in seeing whether there are any proofs beyond the two I already know.


I know that $S_n$ is generated by a number of things, like all transpositions, all transpositions of the form $(1\,a)$, the transpositions $(1\,2),(2\,3),\dots,(n-1\, n)$, and  just the two elements $(123\dots n),(1\,2)$.      Suppose $n$ is prime. If you just have $(123\dots n)$ and some arbitrary transposition $(a\, b)$, how does this also generate $S_n$?    Can you somehow get to $(1\,2)$ or reduce it to some other previous case?

I have a homework question that asks     Find necessary and sufficient conditions on $1 \leq i < j \leq n$ so that $(i \, j)$ and $(1 \, 2 \, \dotsc \, n)$ generate $S_n$.   Here is what I have done so far.  Call $c = (1 \, 2 \, \dotsc \, n)$.  I made the observation that $$ \overbrace{c c \dotsb c}^{n - j + 1} (i \, j) \overbrace{c^{-1} c^{-1} \dotsb c^{-1}}^{n - j + 1} = (1 + i - j + n \, 1). $$ Thus, $\langle (i \, j), c \rangle = \langle (1 \, i - j + n + 1), c \rangle$, so it suffices to look at $\langle (1 \, k), c \rangle$ for positive integers $2 \leq k \leq n$.  I've checked that, for the value $k=2$, $\langle (1 \, 2), c \rangle = S_n$.  This immediately implies $\langle (1 \, n), c \rangle = S_n$.  I suspect that no other values of $k$ will work, but am not sure how to prove it.


I have deleted Ubuntu from my PC. When I restart my PC an error occurs that is Grub Rescue. I already run set command. Now I just want to install Windows 10. My PC does not allow me to start installation process. i already follow the instruction given in the reference link. My PC not start boot setup  even selection from boot setting. its give me grub rescue command screen. I have tried all possible solution from internet fro example setting of prefix and repair from boot setup  etc.....hop my comment will explain my problem.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I want to import CSV file data into MySql using PHP.I got the code to do this. The data in CSV may contain single quotes and commas within it.I used str_replace to fix the issue.It replaces only one of the characters.But I want to replace both.    example:  Broad Oak Road, Accrington, Lancashire, BB5 2AW United Kingdom.  Road King's College Aberdeen   I have used str_replace("'","\'",$csv_array[0]) to replace single quotes.Is there any way to replace both using a single PHP function? Please help me.Thanks in advance.


I'm working on this problem and am having some difficulties.  I know something important to keep in mind is that (as an example)  $1110001111$ is just one bit string despite it having two individual substrings with at least 3 consecutive ones.   I know there are $2^{10} = 1024$ total possible bit strings of length $n = 10$. We want to find the number of bit strings that contain at least $3$ consecutive ones.  I start by first counting the number of bit strings that contain $3$ consecutive ones.  There are ${10}\choose{3}$ possible ways to insert three ones in this bit string of length $10$, but that isn't what we want, we want to count the number of ways to have three consecutive ones in a bit string of length $10$. And this is where I'm getting stuck.   To solve this problem, I started with trying by exhaustively listing out the total possible strings, but quickly started to run into some problems and thought there was a more efficient way to do it. So then I was thinking about using the inclusion-exclusion principle, where my sets would be something like "$A_{1}$ is the set containing three consecutive ones; $A_{2}$ is the set containing four consecutive ones,..., $A_{10}$ is the set containing $10$ consecutive ones" but then I realized this would be a truly ginormous computation and that there must still be a better way to go about solving it.  So my question, is how to I count the number of bit strings of length $n = 10$ where I have at least $3 \leq k \leq 10$ consecutive ones?

I am trying to count the number of bit-strings of length 8 with 3 consecutive zeros or 4 consecutive ones. I was able to calculate it, but I am overcounting. The correct answer is $147$, I got $148$.  I calculated it as follows:  Number of strings with 3 consecutive zeros = $2^5+5\times2^4 = 112$, because the 3 zeros can start at bit number 1, 2, 3, .., 6  Number of strings with 4 consecutive ones = $2^4+4\times2^3 = 48$, I used the same reasoning.  Now I am trying to count the number of bit-strings that contain both 3 consecutive zeros and 4 consecutive 1s. I reasoned as follows:   the strings can be of the following forms: 0001111x, 000x1111, x0001111..thus there are $2+2+2 = 6$ possibilities for bit-strings where the 3 consecutive zeros come first. Symmetrically there are $6$ bit-strings where the 4 consecutive ones come first.  Thus the answer should be = $112+48-12 = 148$.  clearly there's something wrong with my reasoning, if someone could point it out, that would be awesome. Thanks


How I can I draw an arrow that originates from a circular node and goes east for a certain distance.

How do I draw a line of length l and at an angle of a from a circular node N in TikZ?


I read Feynman's book but this still unclear to me.

I'm writing a piece about the electron, and I'm having trouble finding evidence to back up the claim that the evidence is pointlike.   People  the observation of a single electron in a Penning trap shows the upper limit of the particle's radius to be 10-22 meters. But when you look at Hans Demelt’s  you read about an extrapolation from the measured g value, which relies upon "a plausible relation given by Brodsky and Drell (1980) for the simplest composite theoretical model of the electron". This extroplation yields an electron radius of R ≈ 10-20 cm, but it isn't a measurement. Especially when "the electron forms a 1 μm long wave packet, 30 nm in diameter".    It's similar when you look at  by Brodsky and Drell. You can read things like this: "If the electron or muon is in fact a composite system, it is very different from the familiar picture of a bound state formed of elementary constituents since it must be simultaneously light in mass and small in spatial extension". The conclusion effectively says if an electron is composite it must be small. But there's no actual evidence for a pointlike electron.   Can anybody point me at some evidence that the electron is pointlike?


I want to prove that $(\mathbb{P(N)},d)$ is a metric space where $\mathbb{P(N)}$ is the power set of $\mathbb{N}$.  And $d:\mathbb{P(N)}\times \mathbb{P(N)} \mapsto\mathbb{R}$ is defined by $d(A,B)=\begin{cases} 0, & \text{if A} \Delta \text{B=}\emptyset  \\ m^{-1}, & \text{where m is the smallest member of} A\Delta B \end{cases} $.  How to approach this problem?I saw the solution but it does not look much intuitive?Can someone suggest me some intuitive solution of this problem.

To prove that $(\mathbb{P(N)},d)$ is a metric space where $\mathbb{P(N)}$ is the power set of $\mathbb{N}$.  And $d:\mathbb{P(N)}\times \mathbb{P(N)} \mapsto\mathbb{R}$ is defined by $d(A,B)=\begin{cases} 0, & \text{if A} \Delta \text{B=}\emptyset  \\ m^{-1}, & \text{where m is the smallest member of} A\Delta B \end{cases} $.   Attempt: $x \in P\Delta Q=(P-Q)\cup(Q-P) \implies x\in (P-Q) \text{ or } x\in (Q-P) $. But $(P-Q)\cap(Q-P)= \emptyset \implies x \in P \text{ and} \notin Q \text{ or }x \in Q \text{ and} \notin P. \ \ \ $    (*)  To prove the triangle inequality:  Take any three sets $A,B,C \subset \mathbb{P(N)}$ such that none of them are equal to another. Now,  $\min A \Delta B  =m_1, \min B \Delta C  =m_2,  \min A \Delta C  =m_3   $. To prove $d(A,B) \leq d(A,C)+ d(B,C)$. By (*), $m_1 \in A$ or $m_1 \in B$ but not both.   Again,  $m_2 \leq m_1$  or $m_3 \leq m_1$. Either way, we are done. When $A \neq B$ and either $B =C $ or $A=C$ (not both), we have respectively $A=C$ , $B=C$ . Which satisfies the triangle inequality. When $A=B$ it is evident.   Symmetry: We know $A \Delta B =B \Delta A$. $d(A,B)= d(B,A)$  Non-negativity and $0 \iff A=B$:   $d(A,B)=0 \iff A \Delta B= \emptyset \iff A \subset B \text{ and } B \subset A \iff A=B$. By definition $d(A,B) \geq 0$  Is this okay? Please verify.


I came across one method which i couldn't understand.  1. Line number 5, a method add() is called through object prx and then it continues to define this method. Which concept is this?   2. Line 7. Here as method is overidden within method definition. As per my knowledge method can not be defined within method but in this example method addResp() (#7) is defined within prx.add() (#5) and this is defined in IntCall(). (#1) Then how it is possible here?  What concept should i study to understand above code?  1      public void IntCall() throws Exception {  2         NmbrCalc addres = new NmbrCalc();  3         for (int i = 0; i < 20; ++i) {  4            int v1 = i/50;  5            prx.add(v1, 200, new IListenResponse() {  6               @Override  7               public void addResp(int result) {  8                  addres.setValue(result);  9               } 10             }); 11          } 12       }

What is the use of anonymous classes in Java? Can we say that usage of anonymous class is one of the advantages of Java?


I have an issue with a virus that is located in System Volume Information. However, I can't even see the folder in order to give myself ownership / permissions, even though I do have the "Show hidden files and folders" option enabled. I also tried to enter it using WinRar, modifying the registries, using Command Prompt or Safe Mode, but it didn't work. So, is there any way to grant myself the permission to enter it?    Note: I used an old antivirus program (AVG2013) but it didn't work at all, and I can't get a newer one because installing it requires an internet connection. And I don't want to connect for multiple reasons. And I'm pretty sure that it still won't get removed because of the lack of permissions.    Edit: I'm not talking about usual virus removal here. I'm talking about virus removal in a super protected folder.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


Not sure how better to title this... But basically, I want to try to convert one of my old  into a wall plug.  I want to strip the guts of the battery, attach some components and a heavy duty cable to be able to plug the "battery" into the wall so I can have continuous power to a "cordless" tool.    In other words, I want to make a plug-in cord to make any of my cordless tools into a corded tool.    I know Ryobi has tools that have both battery and cord hookups.  I'm wondering if I could just take the guts from one of those and put it into the old battery casing, so everything plugs in just fine.    Question: Is it possible, and is it as simple as creating an

I have a dewalt 18V cordless drill. I am wondering if it is feasible to build an adapter that can power the drill from a standard US wall socket?  A typical DeWalt drill needs 2.6 amps with no-load. I am assuming this jumps significantly higher under load. Most DeWalt motors have a stall current over 250 amps...  Any insight would be greatly appreciated!!


Let $f(t)$ be a continuous function.  so-$$\frac{\pi}{2} \int_{0}^{\pi}f(\sin x)dx=\int_{0}^{\pi}xf(\sin x)dx$$  I tried many times Integration in parts but didn't succeed.

Show that   $$\int_{0}^{\pi} xf(\sin(x))\text{d}x = \frac{\pi}{2}\int_{0}^{\pi}f(\sin(x))\text{d}x$$  this is so confusing. i have no idea how to even start. im thinking integration by parts but that doesnt seem right.  hope you guys can help!!


I have a Lenovo Y510P laptop and managed to get Windows 8 and Ubuntu 13.10 dual booting. But then after grub was updated, I had to run boot-repair and now I can't boot into Windows.  When the computer starts and grub shows, I can boot into Ubuntu without a problem, but if I choose Windows from the boot menu, it just goes back to the menu.  I don't really know what kind of information I should provide, so please let me know if anything else besides what I posted bellow is needed.  My bios boot configuration is the following:   Boot type: UEFI  Secure boot: Disabled   Here is my grub.cfg file:   Here is my boot info from boot-repair:

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


I'm learning C++ and using CLion to build projects. I have the main.cpp file in the main directory. I also have a main/Objects directory, inside of which I have Vec3.h and Vec3.cpp files:  //Vec3.h template<typename T> class Vec3 { public:     // 3 most basic ways of initializing a vector     Vec3() : x(T(0)), y(T(0)), z(T(0)) {}     Vec3(const T &xx) : x(xx), y(xx), z(xx) {}     Vec3(T xx, T yy, T zz) : x(xx), y(yy), z(zz) {}     T x, y, z;      T length(); };   .  //Vec3.cpp #include "Vec3.h" #include <stdio.h> #include <math.h>  template <typename T> T Vec3<T>::length() {     return sqrt(x * x + y * y + z * z); }   .  //main.cpp #include <iostream> #include "Objects/Vec3.h"  int main() {     Vec3<double> vec(3, 4, 0);     std::cout << "Hello, World!" << std::endl;     std::cout << vec.length() << std::endl;     return 0; }   .  //CMakeLists.txt cmake_minimum_required(VERSION 3.13) project(Testing)  set(CMAKE_CXX_STANDARD 14)  set(SOURCE_FILES main.cpp Objects/Vec3.cpp)  add_executable(Testing ${SOURCE_FILES})   When I try to build and run, I get the following error:   undefined reference to "Vec3<double>::length()". ld returned 1 exit status   What info am I not giving to the linkeditor?

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


As can be seen in , it seems that spoiler and tag markdowns don't play well together - the tag markdown within a spoiler markdown is clearly visible:

Tags in spoilers are always visible, even if you don't put your mouse on the spoiler (on  for example). See the screenshot:      Looks a bit strange on this site too:        that needs !


What is the cumulative effect of following on anchor tag like below:    /**  * This function will create a popup iFrame (not a complete function)  */ function CreateIframe() {    // This is just a sample and not complete code    var iframe = document.createElement('iframe');    // Initialize and create iFrame and popup iFrame   } Click here!

The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?    function myJsFunc() {     alert("myJsFunc"); } Run JavaScript Code     or    function myJsFunc() {     alert("myJsFunc"); }  Run JavaScript Code


Hello I have been asked to find a formula of how many different Euler circuits or as it also called eulerian cycles are in $K_{2,n}$. when $n$ is an even number ofcourse otherwise there won't be any eulerian circuits.  for example in $K_{2,2}$ you have vertices $a$ $b$ $c$ $d$ so there is only one cycle possible, in other words $adbca$ is the same as $cbdac$.  thanks from advance :)

So I need to count how many Eulerian cycles exist in the complete graph $K_{n,2}$. Two cycles are considered identical if:  1) The order of the edges is identical in both cycles. For example: The cycles $cabc, bcab, abca$ are identical.  Or  2) If we get the first cycle by reversing the order of the edges in the second cycle. For example: $abca$ and $acba$ are the same cycle.  Note: The order of the edges is what matters, not the vertices. Also, of course if $n$ is odd, there's no such cycle.  So I tried this in different ways and arrived at different solutions:  I can think of this as all the permutations of the side with $n$ vertices, removing all the reverse permutations, so that's $\frac {n!}{2}$.  Or, I can think of it as permutations in a cycle, which means $\frac {(n-1)!}{2}$.  Then I manually counted the Eulerian cycles in $K_{2,4}$ and I got 6, which works well with $(n-1)!$. So either I counted incorrectly, or $(n-1)!$ is the answer, but I don't understand why.  Any help would be appreciated.


I recently noticed the following:  $$\sum_{i=1}^ni=\frac{n(n+1)}{2}$$ $$\sum_{i=1}^{n}i^2 = \dfrac{n(n+1)(2n+1)}{6} = \Bigg(\sum_{i=1}^ni\Bigg) \cdot \frac{2n+1}{3}$$ $$\sum\limits_{i = 1}^n i^3 = \Bigg( \frac{n(n+1)}{2}\Bigg)^2 = \Bigg(\sum_{i=1}^ni\Bigg)^2$$ $$\sum_{i=1}^ni^4=\frac{n(n+1)(2n+1)(3n^2+3n-1)}{30} = \Bigg(\sum_{i=1}^ni^2\Bigg) \cdot \frac{3 n^2 + 3 n - 1}{5}$$  It seems that the sums build on each other in some interesting way, and I'm interested in finding a general form. A cursory investigation found that $$\sum_{k=0}^n k^a = H_n^{(-a)}$$ where $H_n^{(-a)}$ is the $n$th hyperharmonic number of $r$th order. However, I doubt this would help because this (a) is sort of circular given the definition of $H_n$, (b) has no closed form, and (c) doesn't reveal the multiplicative connection among the terms.  Is it possible to derive a closed form for $\sum_{k=0}^n k^a$? Why or why not? And, of course, if one exists, what is it?

I have been wanting to understand how to find the sum of this series.   $$1^p + 2^p + 3^p +{\dots} + n^p$$  I am familiar with Gauss' diagonalised adding trick for the sum of the first $n$ natural numbers.  I can prove the formulas for  $$\begin{align}   \sum_{1}^{n} k^2 &= \frac{n(n+1)(2n+1)}{6}\\  \sum_{1}^{n} k^3 &= \frac{n^2(n+1)^2}{4}\\ \sum_{1}^{n} k^4 &= \frac{n(n+1)(2n+1)(3n^2+3n-1)}{30} \\ \end{align}$$  With mathematical induction. But, beyond that even proofs with mathematical induction are difficult.  I'm interested in learning the theory and the proof behind Faulhaber's formula. What is the knowledge required to understand this proof ?


I have using ubuntu 12.04LTS with all available updates installed. Some websites are not opening in any browser, i have tried many browsers(firefox,chrome,chromium,arora,xxxtrem browser,Midori).  But yesterday i have install the ubuntu 12.04(the first release of this version) in my pen drive and use it. In USB booted ubutu, all websites are open properly or we can say that in older version of browsers websites are opening(in usb booted ubuntu firefox version is 11.0) but now in updated   ubuntu 12.04LTS websites are not opening .  I have read some solution about this problem but they are says to change dns server but i think this is not dns server problem because with same dns settings websites are opening properly in the windows and usb booted ubutu.  Please tell what will be solution?  website which i tried to open are   yahoo.com, skydrive.live.com, indiarailinfo.com

I am presently running Ubuntu 12.04 and using Chrome/Firefox along with OpenDNS (have tried Google Public DNS as well as DNS of my ISP).   Suddenly, a lot of websites that I visit frequently don't load anymore. Some of them are imgur, yahoo, , microsoft and addons page of firefox. I am sure there are many more that won't load.  I have Windows 7 in Dual-Boot and there are no problems whatsoever in opening these pages on Windows.  Brief History  Two weeks ago I installed Ubuntu 12.10. I faced this issue right away. I thought something must have gone wrong with the installation, so I removed Ubuntu 12.10 and instead installed Lubuntu 12.10, but the issue persisted. So, I tried opening these webpages in Live Environments (of Ubuntu 12.10, Lubuntu 12.10 and Ubuntu 12.04.1) from USB. The issue was there for Ubuntu 12.10 and Lubuntu 12.10. However, I was able to access these webpages from Ubuntu 12.04.1. So, I installed 12.04.1 on my HardDisk. Everything on 12.04 was fine till yesterday; but suddenly, these sites don't load anymore. Windows 7 in Dual-Boot works flawlessly.  Updates  (1) In response to Zhang's Answer to check basic terminal commands - I have used both OpenDNS and GooglePublic DNS to test these commands (Restarted my PC in between). These are the terminal outputs while  and while .  (2) This is the result of ifconfig - .  (3) Thereafter I tried to use wget to check if the problem was with the Browser. However, it didn't work for webpages which are not loading in my browser. This is the  showing it for Google(works) and Yahoo(doesn't work).  (4) Then followed the instructions listed at  to disable IPV6. Also, restarted my PC. However, it didn't help either.  (5) Then, I edited my Wired Connection through Network-Manager to ignore IPV6. After that, I tried to open Yahoo in Browser -  it did load the first time. However, when I tried again, it didn't load. Other problem sites didn't load at all.  (6) Again tried wget. However, this time passed the argument -4 to it; ie; wget -4 www.yahoo.com. But once again, didn't get any response.  (7) Then, tried to fiddle with MTU. Followed  to check what is the maximum that I can set. For me, the maximum possible was 10324. Also tried other values like 1500, 1492, 1452 and 100. But this didn't help either.  (8) Re-installed Ubuntu 12.04.1, wiping out the previous installation and as such all other changes. Also installed all the available updates. For the first half-an-hour, I was able to load all the webpages - including the ones which had problem. But lateron, I have the same issue as earlier - not able to load pages like yahoo, imgur, microsoft, fed-sudoku, etc.   (9) Question by laurent     From wget pastebin info in the question, the problem is not DNS as the wget and dig commands reach Yahoo's IP. This said, I don't know why nothing downloads with wget! Have you set a firewall? (you can check with sudo iptables -L). In ifconfig results, there are 2 interfaces, ppp0 and eth0. Which one should be used to connect to internet? Could you post the result of route command? Obs: eth0 has no IPV4 address so I think it is not properly configured (how is /etc/network/interfaces?)   Here is the  for terminal outputs of sudo iptables -L ; route  and  cat /etc/network/interfaces. I am not running any firewall. It's a clean install of Ubuntu 12.04.1. ppp0 is used to connect to the internet (this takes username and password which was given by my ISP) and eth0 is the Intel's OnBoard LAN which connects the modem through ethernet port.  (10) Tried to append nameserver 208.67.222.222 line in /etc/resolv.conf (since, I am using OpenDNS). But this didn't help (even after restart). So reverted the changes back. This is also a part of answer provided by laurent - it's required if I want to use OpenDNS.  Other Info   I have an ADSL modem (not a router) connected to the PC with an Ethernet Port. To connect to the internet, I have a DSL Connection. So, I use PPPOE to connect. Terminal Output for System Information sudo lshw -C network ; cat /etc/resolv.conf ; ifconfig -a -


I am designing simple bank application using servlet and jdbc  so while inserting data into database I am getting null pointer exception at preparedStatement  my code for that is   Connection con=null;      PreparedStatement preparedStatement =null;       try      {      con = DBConnection.createConnection();      String query = "insert into cst_details(name,surname,aadhar_no,contact_no,address,balance) "             + "values (?,?,?,?,?,?)";      preparedStatement = con.prepareStatement(query);      preparedStatement.setString(1, name);      preparedStatement.setString(2, surname);      preparedStatement.setString(3, aadhar_no);      preparedStatement.setString(4, contact_no);      preparedStatement.setString(5, address);      preparedStatement.setString(6,initial_bal);

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


So, I'm supposed to write a program that takes a double value and returns the least amount of change. Everything seems to be okay but when I enter in double values such as "99.99" or "101.10" the answers are just a bit off.  public class Change {     public static void main(String[] args) {         Scanner scanner = new Scanner(System.in);         double amount;         double remainder;         int tens = 0;         int fives = 0;         int toonies = 0;         int loonies = 0;         int quarters = 0;         int dimes = 0;         int nickels = 0;         int pennies = 0;          System.out.println("Enter in a double value:");         amount = scanner.nextDouble();          tens = (int) amount / 10;         amount = amount % 10;          fives = (int) amount / 5;         amount = amount % 5;          toonies = (int) amount / 2;         amount = amount % 2;          loonies = (int) amount / 1;         amount = amount % 1;          quarters = (int) (amount / 0.25);         amount = amount % 0.25;          dimes = (int) (amount / 0.10);         amount = amount % 0.10;          nickels = (int) (amount / 0.05);         amount = amount % 0.05;          pennies = (int) (amount / 0.01);         amount = amount % 0.01;          System.out.println("tens:" + tens);         System.out.println("fives:" + fives);         System.out.println("toonies:" + toonies);         System.out.println("loonies:" + loonies);         System.out.println("quarters:" + quarters);         System.out.println("dimes: " + dimes);         System.out.println("nickels: " + nickels);         System.out.println("pennies: " + pennies);       } }   output for "99.99"  Enter in a double value: 99.99 tens:9 fives:1 toonies:2 loonies:0 quarters:3 dimes: 2 nickels: 0 pennies: 3   above, I am 1 penny short.  output for "101.10"  Enter in a double value: 101.10 tens:10 fives:0 toonies:0 loonies:1 quarters:0 dimes: 0 nickels: 1 pennies: 4   above, I am one penny short again

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


When responding to potential answers I sometimes like to include a code block to clarify what I'm talking about. Is it possible to have clean code-formatting in comments or only in questions and answers?


I am attempting to change the value of a cell in Google Sheets based on the value of an adjacent cell. This adjacent cell gets its value from the colour of the cell adjacent to it using the formula from  Quora answer. So the value of the cell should change based on the hex code which is obtained from the colour of the first cell. There are four possible hex values at the moment so I was trying to put four different IF statements in the same cell, so its value is changed based on this.   My first attempt led to a formula parse error:  =if((J2="#00ff00","Read"), if(j2="#ff0000", "Unread"), if(j2="#ff9900","In Progress"), if(j2="#000000", "Not Applicable"))   It is clear you cannot simply separate if statements with commas. Based on  Stack Overflow question I tried this code, with nested IF statements:  =if((J2="#00ff00","Read", if(j2="#ff0000", "Unread", if(j2="#ff9900","In Progress",if(j2="#000000", "Not Applicable")))))   This also leads to a formula parse error.   Is there any way I can simply include multiple IF statements in the same cell which will work for my code?


I am retrieving disk information via JavaScript with the wmic statement, wmic logicaldisk get freespace,name,size,volumename, which produces the following output, but in a single string.  "FreeSpace      Name  Size           VolumeName  " "560232755200   C:    999526756352   System      " "999369699328   D:    999558213632   SSD         " "1511570386944  E:    8001545039872  Get         " "4620751712256  F:    8001545039872  BR          " "788449492992   G:    4000650883072  Seen        " "2296009408512  H:    4000768323584  Seen 2      " "3594248679424  I:    8001545039872  2160        " "3507750227968  J:    8001545039872  1080        " "945300619264   K:    999625322496   Trailers    "   I parse the above output with the following JavaScript.  window.onload = function(){   const cp = require('child_process')   let drives   cp.exec('wmic logicaldisk get freespace,name,size,volumename', (error, stdout)=>{     drives = stdout.trim().split('\r\r\n')       .map(value => value.trim().split(/\s{2,0}/))       .slice(1)   }) }   That JavaScript already produces my desired output. It produces an array of nested arrays. Each row of information in the command prompt output corresponds to a nested array. Each nested array has four values that correspond to the originally queried data points.  [   ["560232439808",  "C:", "999526756352",  "System"  ]   ["999369699328",  "D:", "999558213632",  "SSD"     ]   ["1511570386944", "E:", "8001545039872", "Get"     ]   ["4620751712256", "F:", "8001545039872", "BR"      ]   ["788449492992",  "G:", "4000650883072", "Seen"    ]   ["2296009408512", "H:", "4000768323584", "Seen 2"  ]   ["3594248679424", "I:", "8001545039872", "2160"    ]   ["3507750227968", "J:", "8001545039872", "1080"    ]   ["945300619264",  "K:", "999625322496",  "Trailer" ] ]   I am wondering whether or not there is a way to similarly parse the information, but with command prompt instead?


I have tried to evaluate the following sum:  $$\sum_{n\geq1}\frac{1}{n^3 \sin^2 n}$$ to test whether it is a convergent series  using standard method like creterion test really I think that $ \sin^2 n$ Bounded sequence which is its multiplicative inverse multiplied by a convergent sequence , But my problem is about the Growth rate of :$\dfrac{1}{\sin^2 n}$ seems not clear to me , Now am not able to test the convergence of this series, anyway ?

I have this series given by $$\sum\limits_{n=1}^\infty \frac{1}{n^3 \sin^2n}.$$ I know that the terms are all nonnegative. Can I get a subsequence of $\frac{1}{n^3 \sin^2n}$ such that its sum diverges to $+\infty$?


Why am I getting this search description in Google search (on any browser):      "Your browser does not currently recognize any of the video formats   available. Click here to visit our frequently asked questions about   HTML5 ..."   It doesn't happen in other search engines like duckduckgo.com and the embed is just a simple iframe code for YouTube in a Wordpress site. Very annoying and is likely turning off users from clicking on links. Thanks for any help.

All of a sudden, without any change in the index.html, our site is showing up in Google search results (on multiple browsers and devices) with Google Preview text that, instead of giving a summary of our site, now says:     Your browser does not currently recognize any of the video formats available. Click here to visit our frequently asked questions about HTML5 video.     We have a YouTube embed on our homepage that does include an html5 parameter in the media URL link in the embed, but there are no issues playing the video with any browser and device we can find.  What would suddenly cause this text to appear in Google search results?   We are using the  tags as the metatags in the <head> of our webpage and do indeed have title and description tags.    To mimic the behavior of Googlebot, I installed Windows on a VM and got Chromium 41 running. I get the same Google Preview text with the html5 video message when the site comes up in Google search results using this browser.    When I view the site in Chromium 41, I see the YouTube embed and it renders on the page and plays with no issue, just as with all other browser and devices we've tested on. The only time we see this message is in the Google search results, not on our actual site.


I would like to ask you how to use the iPhone microphone when connected to a speaker? The speaker don't have its own microphone and I should disconnect the speaker every time when I have to talk  for example. Any ideas is this possible?

I connect my phone to a Bluetooth speaker to play music. When engage Siri or try to use dictation, the phone wants to use the microphone on the Bluetooth device, which is either too crappy or too far away for it to understand what I am saying.  So, I would like a way to restrict the iPhone to using its own microphone even when connected to a Bluetooth speaker.  I am open to doing this via a setting, buying an app, or jailbreaking or whatever.  Is there a way to do this?


I would like to know if there is a $\bbar$ command to produce the symbol    just as there is a $\hbar$ command for the symbol

I would like to be able to add the symbol "lambda-bar" (see below) into an equation. How can I do this?


I know that the minus sign of -r, where r is real, can never be moved under a radical sign. But there are no minus signs present when the sqrt of $i^4$ is taken in the following manner  $1 = i^4$  $\sqrt{1} = \sqrt{i^4}$  $+/-1  =  +/-i^2$  $+/-1  =  -/+1$  I realize it might be argued that i also can never be moved under the radical sign.  But $\sqrt{i}$ does have an open form solution which is $+/-[(1+i)/\sqrt2]$.  Repeating the above calculation with this open form I find that the associative law of multiplication no longer holds and all sorts of contradictions ensue. It might also be argued that $i^4$ factors into -1 x -1 and therefore cannot be placed under the radical sign. But that is also true of any positive real number. Any ideas for a consistent solution to the above derivation?  Thanks.

What is the $\sqrt{i^4}$?   $i^4$ = $(i^2)^2$ So is $\sqrt{i^4}$ = $\sqrt{(i^2)^2}$ = $i^2$ = $-1$?  Or is $\sqrt{i^4}$ = $\sqrt{1}$ = $1$?  When I plug it into my TI-89 Titanium, I get $1$.  Edit: I now see why $i^4 \neq -1$. $$\sqrt{x^2} = \left|{x}\right| $$ So$$\sqrt{(i^2)^2} = \left|i^2\right| = \left|-1\right| = 1$$


In classical electromagnetism, reflection is explained using the Maxwell equations and boundary conditions. How is reflection explained in quantum optics? What happens to photons during reflection?  For context, I've got this question while reading YH Kim's "A Delayed Choice Quantum Eraser" () and it says:      [...] photon 2 will follow the A path meeting BSA with 50% chance of being reflected or transmitted.   But what does it mean that a photon is reflected? does it gets absorbed and then reemitted? does the photon just changes it's momentum direction?

The "equal angles" law of refection on a flat mirror is a macroscopic phenomenon. To put it in anthropomorphic terms, how do individual photons know the orientation of the mirror so as to bounce off in the correct direction?


More than often I get a lot of itch when I see an answer which contains only a link. For example .  Check this link, it will solve your query..   This answer does not explain in any way why and how it solves the OP's concrete problem without the need to click the link. Also, if the link ever goes down, then the whole answer is completely useless. I am very tempted to flag this as "not an answer" and hope that the moderator understands the hint and converts it into a comment. Can I flag them as such? Related:

I think we can all agree, this sucks:  If you've been around a little while, you've probably encountered hundreds of answers like this in various forums, some of them even marked as "The Answer" by well-meaning1 forum admins looking to close a thread. We could try to enumerate the commonly-observed problems with it...  Link is probably broken If link isn't broken, it's spam If link isn't spam, it's to some broadly-related resource that the answerer found by pressing "I'm feeling lucky" when googling the question's title.  ...but the real issue here is that we don't know! Even if the link was originally pointing directly to the most awesomeest answer ever for exactly the question being asked, there's nothing in the answer itself to even hint at what direction we're being pointed in. Strip the markup, and this is what you're left with:  i think you should take The tutorial HERE! This will help you a lot  Is there even one tiny speck of information there? No. Even the title of the page being linked to would have provided something to go on, but that was entirely too much work. So let me be clear: this sort of response is not an answer. If you see this, flag it. Moderators, if you see it flagged, delete it. There's really only one valid exception to this rule, and that's when the question is:  Suggest me some tutorials where i can learn quick.  Don't get me wrong, it's still a bad answer - but when the question is kinda asking for bad answers this is to be expected. Close or flag the question and move on - this is much more efficient than hanging around to babysit it by deleting every crap answer that inevitably shows up. If you're still reading, you're probably getting really bored by now. "Gee, Shog - answers that contain ZERO information are terrible, horrible, very-bad things? What shocking revelations will you share next?" Yeah. It's really simple... Except, . See, the problem is that once you step away from black-and-white "answers / doesn't answer" decision-making, things get... Interesting. And all those other answers with links in them See, this is an answer:  And so is this:  Yes, they're both very short, and yes, they contain links. But strip the markup, and you still get at least a little bit of useful information. Does that mean these answers should forever hang around the site? No, not necessarily - if it turns out they're just not that useful, they should probably still be removed - or at very least, down-voted so that they rank below other answers. Just remember: if the text of the post contains an honest attempt at answering the question, then it is an answer - so don't flag it otherwise, and if you do, don't complain if your flag gets declined. Answers & Apples If you're still confused, forget about answers. Think about apples instead:  Answers are just like that, but less tasty in pies.  1 By which I mean to say, "criminally lazy"


The posterior distribution is proportional to the likelihood times the prior distribution $p(\theta|D) \propto p(D|\theta)p(\theta)$. Computing $p(D|\theta)p(\theta)$ would give the un-normalised posterior distribution and the normalising constant gives rise to a valid probability distribution of 1. However, the normalising constant is just a scaling factor for the height of the distribution and it does not in any way affect the density of the distribution because the height of the posterior are all scaled proportionately. What is the purpose of techniques like MCMC sampling to estimate the posterior distribution ?

Bayes theorem goes $$ P(\textrm{model}|\textrm{data}) = \frac{P(\textrm{model}) \times  P(\textrm{data}|\textrm{model})}{P(\textrm{data})} $$  This is all fine. But, I've read somewhere:     Basically, P(data) is nothing but a normalising constant, i.e., a constant that makes the posterior density integrate to one.   We know that $0 \leq P(\textrm{model}) \leq 1$ and $ 0 \leq P(\textrm{data}|\textrm{model}) \leq 1$.    Therefore, $P(\textrm{model}) \times P(\textrm{data}|\textrm{model})$ must be between 0 and 1 as well.  In such a case, why do we need a normalizing constant to make the posterior integrate to one?


$1, \log_yx, \log_zy, -15\log_xz$ are in arithmetic progression, then which of the following are correct:   $z^3 = x$ $x = y^{-1}$ $z^{-3} = y$ $x = y^{-1} = z^3$   I tried converting the logs into a common base and then equate the difference between successive terms. However, this accomplished nothing.  Can you give me a hint on how to approach this problem?

If $(1), (log_yx), (log_zy), (-15log_xz)$ are in AP then...   (A)$z^3=x$   (B)$x=y^{-1}$   (C)$z^{-3}=y$   (D)$x=y^{-1}=z^3$   (Multiple answers may be correct)   I tried many approaches, one of them being: $1+log_zy=2log_yx$ $log_zz+log_zy=log_yx^2$ $log_z(yz)=log_yx^2$ But the fact that the bases are different is causing the main problem as I don't know how to proceed further. It would be great if anybody could give me a hint for solving such questions.


Let $p$ and $q$ be distinct primes. Then the number of positive integer solutions of the equation $$\frac{1}{x}+\frac{1}{y}=\frac{1}{pq}$$ are:  I have no idea how to start. Any hints would be helpful.

For $x,y\in\mathbb{N}$ how many ordered pairs $\left(x,y\right)$ satisfy   $\dfrac{1}{x}+\dfrac{1}{y}=\dfrac{1}{pq}$ where $p,q$ are distinct primes?


Is $j_n(x)=\frac{x}{1+n^2x^2}$ uniformly continuous on $[0,1]$?    I have basically been working with the following theorem:  Let E be a non-empty subset of $\mathbb{R}$ Let $f_n, f: E \rightarrow \mathbb{R}$. Then the following are equivalent  i. $f_n\rightarrow f$ uniformly on E  ii. $\exists N$ s.t. $\forall n >N$, $m_n :=sup_{x\in E}|f_n(x)-f(x)|$ exists and $m_n \rightarrow 0$ as $n \rightarrow\infty$  I am not sure whether the given function is increasing or decreasing on the interval since  $j_n(x)=\frac{x}{1+n^2x^2}=\frac{1}{\frac{1}{x}+n^2x}$  The reason that I am concerned with the increasing/decreasing behavior of this function is because I am looking for a way to meaningful describe $m_n$. Another tool I was considering, but am less comfortable with is Cauchy's Criterion.

I want to show $$f_n(x):=\frac{x}{1+n^2x^2}$$ is uniformly convergent in $\mathbb R$ using $\epsilon-n_0$ argument.  So $|f_n-f|\leq\frac{|x|}{1+n^2|x|^2}$  I know $|f_n-f|\leq\frac1n$  since $\frac1n$ is the maximum of $f_n$. I can show this using the derivatives of $f_n$.  My question is: Can you show this or any other equation (independent of $x$) without using derivatives in any calculation?  I've tried $|f_n-f|\leq \frac1n \iff -\frac1n\leq\frac{x}{1+n^2x^2}\leq\frac1n \iff\ldots$ but I get no inequality which is obviously right.


I'm a bit confused with the meme "I'm tired of living through these historical events" referring to the traumatic experience living during a pandemic. Isn't it supposed to be "historic"?

I have read the previous topics but still don't know where I should use historic or historical in the following examples.  Athens is a historic/historical city. This chair is historic/historical. This building is historic/historical. This is a historic/historical winning for Manchester United.  Thank you so much.


Im still new to blender but I found this problem... Im using the latest version and I found out,  I had a small project with a TON of textures and was looking really good, but I came back online  the following day and I found that all my textures have turned purple??? I have no idea what happened  but all the original textures have disappeared. If anyone could help that would be awesome.   Thanks

I made a character, and its one of my first times texturing, and I saved my character into a new folder, and when I came back to the model ALL the textures were pink, I used to know what to do, but I stopped texturing, how do I bring my textures back?


What is the ideal version for this machine (Intel Atom Cpu D510 1.66GHz Dual Core 32 bits) I think the problem is that the minimum requirement is a 2GHz dual processor. What can be another option?

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


I shortened my bash prompt (using the code at line 120 in ):  PS1='\u:\W\$ '   Now I wanna add the colored git branch to the shortened prompt, so that when the branch has uncommitted changes, it's shown in red and if the working directory is clean (nothing to commit) then the branch is showed in green.  Thank you!

I am using  to show the branch name in gnome terminal (Ubuntu 15.10) when working in a git repository. Based on the above I now have the below in my ~/.bashrc file:  # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes    ...  # Add git branch if its present to PS1 parse_git_branch() {  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } if [ "$color_prompt" = yes ]; then  PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' else  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' fi unset color_prompt force_color_prompt   As a result I now get:    so it works. But why has the coloring of my user@host been removed? And I would also expect that the branch name should be colored. Before it looked like this:    UPDATE: I have now tried this guide instead:    adding this to .bashrc:  parse_git_branch() {      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "   and that works:    Notice in .bashrc I also have this (default):  # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes   I have yet to find the reason why that snippet gives the correct result and the other version does not. Any input on this?  Here is the version of my .bashrc that has the old snippet enabled that does not work:


What sounds better to a native/is more correct? I assume they all are correct, but still - what is the best way to say it?   If one wants to do something, one should do it. If one wants to do something, he or she should do it. If one wants to do something, they should do it.     As the question was marked as duplicate, I'd like to point out that the main thing asked was not whether there exists a gender-neutral pronoun, but rather how to end the sentence if I begin it with 'one'.

Is there a pronoun I can use as a gender-neutral pronoun when referring back to a singular noun phrase?  Each student should save his questions until the end. Each student should save her questions until the end.


I've already read two threads on this but the instructions given are not clear enough for me.  i would like to attach the ends of the highlighted mesh, so that animating this part isnt so tedious.

I am trying to make a pirate ship and am trying to attach rope to the sails. my rope is made using a path, and soft body physics. I can not find a way to attach my rope to the sail. and I can not use pinned vertices because this is not a cloth modifier.


First off I was trying to update my system. I got the error that some packages couldn't be updated/installed. The package was mesa-vdpau-drivers and corresponding i386 of the same.  I tried installing the driver manually using the command: sudo apt install mesa-vdpau-drivers  It gives me following on my terminal: Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  mesa-vdpau-drivers : Depends: libomxil-bellagio0 but it is not going to be installed E: Unable to correct problems, you have held broken packages.  Now I have tried installing the dependency manually, it installs smoothly but when I try the command to install mesa-vdpau, it again shows the same error. I purged everything of mesa and installed everything from scratch it is still on the same situation.  So, how do I solve this? mesa-vdpau-drivers are needed for a hard kick to my system.  My APU+GPU: AMD A8 with R5 graphics M230  Any help to solve or pointing me in right direction is appreciated.

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


I am used to install and remove various operating systems in my PCs, even having several at a time.  Usually, to install a new OS means:   Burn the ISO to a CD/DVD/USB. Insert it. Boot. (Maybe you have to tweak a bit the BIOS first).   The only difference between PCs is its CPU architecture: x86, x86_64, arm, etc. Depending on that, you have to download one ISO or another. But I never have to worry about which graphic card, mouse, keyboard, screen, network card, etc. it has. The install wizard automatically detects that and installs the corresponding drivers. Sometimes, if they are not bundled, the installer also downloads them. Anyway, the key point here is that the ISO is always the same.  Now, many mobile OS come out: Ubuntu, Tizen, Firefox OS, the omnipresent Android, and why not any Linux ARM distro out there!. Sadly I have a random chinese mobile, that surely will never get official support in any platform, and I will never be able to test them.  But... Are not today's phones just tiny ARM PCs? Why is installation that different? Why do I always need to have a precompiled monolithic ROM specific for my phone model? Why not just a single "ISO" per OS for any phone that detects and installs automatically the needed drivers, just like always has been in the PC market?  Note: I understand the problem with privative drivers, but I remember Debian asking me for those when there were no libre alternatives at installation, and I could install them then or later. I suppose that workaround could be used in those cases too. Correct me if I'm wrong.

I guess it's a silly question but i don't get it xD.  I've read it's about controllers, but they can be downloaded from manufacturers, right?


There is a problem on reviewing of flags.  My flags are waiting over 7 days.  Is this pointing to that my flags are useless or moderation doesn't take care flag queue?

I have flagged the following question as a duplicate.    Now I want to know: after how long time will it be stated as active?  I do not have problem with anything here. I just want to know after how long time the request (of a duplicate question) will automatically be rejected or approved.  OK, I got the things, so it will remain active until moderators will have a look at it...  But don't you think we should have a limit that after a certain number of days this kind of request will be dropped (or cancelled)?


Basically the title. And if so, is there a proportional relationship?

Is there any size of photon if so what is it?  And also which particle had smallest size / radius / volume considering all of the matter.


A younger student asked me:  What are accumulation points of the following set?  $$ \{x_n \in \mathbb{R}, n \in \mathbb{N} \ \ | \ x_n = n\sin(n) \}$$  I really can't answer this question, could anyone help me?

Is $\{n \sin n | n \in \mathbb{N}\}$ dense on the real line?  If so, is $\{n^p \sin n | n \in \mathbb{N}\}$ dense for all $p>0$?  This seems much harder than showing that $\sin n$ is dense on [-1,1], which is easy to show.  EDIT: This seems a bit harder than the following related problem, which might give some insight:  When is $\{n^p [ \sqrt{2} n ] | n \in \mathbb{N}\}$ dense on the real line, where $[\cdot]$ is the fractional part of the expression?  I am thinking that there should be some probabilistic argument for these things.  EDIT 2:  Ok, so plotting a histogram over $n \sin n$ is similar to plotting $n \sin(2\pi X)$ where $X$ is a uniform distribution on $[-1,1].$ This is not surprising, since $n$ mod $2\pi$ is distributed uniformly on  $[0,2\pi].$  Now, the pdf of $\sin(2\pi X)$ is given by $f(x)=\frac{2}{\pi \sqrt{1-x^2}}$ in $(-1,1)$ and 0 outside this set.  The pdf for $n \sin(2\pi X)$ is $g_n(x)=\sum_{k=1}^n \frac{1}{nk} f(x/k)$ so the limit density is what we get when $n \rightarrow \infty.$ (This integrates to 1 over the real line).  Now, it should be straightforward to show that for any interval $[a,b],$ $\int_a^b g_n(x) dx \rightarrow 0$ as $n \rightarrow \infty.$  Thus, the series $g_n$ is "too flat" to be able to accumulate positive probability anywhere. (The gaussian distribution on the other hand, has positive integral on every interval).


Ive got this script to narrow down which page number a release ID is it seems to work for the most part but when i enter 0013 as the number it should say its pageNum=311 but it always comes back with 261.  Have i done something wrong?  Here is the script:  $releaseNumber = sprintf('%04d', 0013);  if($releaseNumber < 6300 && $releaseNumber > 6000) {     $pageNum = 1; }elseif($releaseNumber < 6001 && $releaseNumber > 5800) {     $pageNum = 16; }elseif($releaseNumber < 5801 && $releaseNumber > 5600) {     $pageNum = 26; }elseif($releaseNumber < 5601 && $releaseNumber > 5200) {     $pageNum = 36; }elseif($releaseNumber < 5201 && $releaseNumber > 5000) {     $pageNum = 56; }elseif($releaseNumber < 5001 && $releaseNumber > 4700) {     $pageNum = 66; }elseif($releaseNumber < 4701 && $releaseNumber > 4300) {     $pageNum = 81; }elseif($releaseNumber < 4301 && $releaseNumber > 3900) {     $pageNum = 101; }elseif($releaseNumber < 3901 && $releaseNumber > 3500) {     $pageNum = 121; }elseif($releaseNumber < 3501 && $releaseNumber > 3100) {     $pageNum = 141; }elseif($releaseNumber < 3101 && $releaseNumber > 2700) {     $pageNum = 161; }elseif($releaseNumber < 2701 && $releaseNumber > 2300) {     $pageNum = 181; }elseif($releaseNumber < 2301 && $releaseNumber > 1900) {     $pageNum = 201; }elseif($releaseNumber < 1901 && $releaseNumber > 1500) {     $pageNum = 221; }elseif($releaseNumber < 1501 && $releaseNumber > 1100) {     $pageNum = 241; }elseif($releaseNumber < 1101 && $releaseNumber > 0900) {     $pageNum = 261; }elseif($releaseNumber < 0901 && $releaseNumber > 0700) {     $pageNum = 271; }elseif($releaseNumber < 0701 && $releaseNumber > 0500) {     $pageNum = 281; }elseif($releaseNumber < 0501 && $releaseNumber > 0301) {     $pageNum = 291; }elseif($releaseNumber < 0301 && $releaseNumber > 0100) {     $pageNum = 301; }elseif($releaseNumber < 0101 && $releaseNumber > 0000) {     $pageNum = 311; }

How do you debug PHP scripts?  I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful.  What is the best (in terms of fast and easy) way to debug in phpStorm or any other IDE?


An isolated box is partitioned into two compartments, each containing an ideal gas of different molecular species. Assume that each compartment has the same temperature, but different no. of moles, different pressure, and different volume. The partition is suddenly removed and the system is allowed to reach equilibrium. a) What are the final temperature and pressure? b)What is the change in entropy?  Attempt:  a) The temperature still remains the same. I assumed that energy of the system equals the energy of individual compartment. On equating, I got the same temperature. For pressure, I used  $PV=nRT$ where temperature is still the same. b) Since, initial and final temperature are same, I assumed that there is no change in entropy.  I would like to know if it correct or not? Thank you for any help :)

Entropy increases when two substances mix with each other.  For example, the entropy of mixing of two different gases are given by $$\Delta S= 2Nk\ln\frac{V_f}{V_i}\;.$$  But, the entropy doesn't increase when the two gases mixing are same.  This is pointed by Daniel V Schroeder:     It's important to note that this result applies only if the two gases are different like helium and argon. If you start with the same gas on both sides, the entropy doesn't increase at all when you remove the partition.   Now, why is this so? Both the gases, though the same, increase their individual entropies when they expand, don't they?  So, why did Schroeder say there is no entropy of mixing? What actually happens such that there is no change in entropy when the gases are the same?


I have below code which is not working.  var book_id = $('#indexBookSearch'); var tag_id  = $('#indexTagSearch');  if((book_id.val() == "") || (tag_id.val() == "")) {     $('#userMessages').html('
'+         '<button type="button" class="close" data-dismiss="alert">&times;'+         '</button>'+         'Information !  Please select search criteria first.'+     '
');     return false; }   if((book_id.val() == "") || (tag_id.val() == "")) this line is not working if even if either of the field has value inside of it.  Both Book and Tag is select box i have checked their value using console.log() and its coming perfectly.  I have also changed   if((book_id.val() == "") || (tag_id.val() == ""))   to   if(book_id.val() == "" || tag_id.val() == "")   EDIT  HTML FORM  <form id="indexSearchForm" action="books/listTags" method="POST">     <fieldset>         <legend>Search Criteria</legend>          Select Book         <select class="input-large" name="book_id" id="indexBookSearch">             <option value="">--Select--</option>             <option value="109">book 1</option>         </select>          Select Tag         <select class="input-large" name="tag_id" id="indexTagSearch">             <option value="">--Select--</option>             <option value="10">adding</option>             <option value="1">Apples</option>             <option value="39">article</option>             <option value="34">bhg</option>             <option value="40">boon</option>         </select>                <button class="btn btn-primary" type="submit">Submit</button>     </fieldset> </form>   jQuery Code  $('#indexSearchForm').submit(function(e) {     e.preventDefault();      var book_id = $('#indexBookSearch');     var tag_id  = $('#indexTagSearch');      if( !book_id.val() || !tag_id.val())     {         $('#userMessages').html('
'+             '<button type="button" class="close" data-dismiss="alert">&times;</button>'+             'Information !  Please select search criteria first.'+         '
');         return false;     }     // more process });   Thanks.

Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected.  (The select is generated with a maze of PHP functions in an app I just inherited, so this is a quick fix while I get my head around those :)


I am trying to follow . It has a line of commands as: open ~/.bash_profile. The tutorial is on Mac computers, but on the comments section it says that I can also do it on Ubuntu through VirtualBox But this command is not recognized on Ubuntu:  Is there any alternative on Ubuntu that I can use instead of open command?

In Nautilus, when you double click a file, it will open it with the default application associated with the file's extension. For instance, .html files will open in a web browser and .pdf will be opened with Document Viewer. Is there a way to reproduce the same behavior from within the command line (i.e. open path/filename)? I'm asking because I like to browse my file-system from the command line but sometimes don't remember which app. opens what.


I was messing around with $i$ and I (haha) noticed that certain progressions arise when I keep on raising $i$ to $i$ to $i$ and so forth. Though, I am not really quite sure what is going on (and I don't have time to explore further).  In other words, is there an interesting pattern in the sequence:  $i$ , $i^i$, $i^{\left(i^i\right)}$, $i^{\left(i^{\left(i^i\right)}\right)}$, etc.

For $x \in \Bbb C$, let $f(x)=i^x = \exp(i\pi x)$, where $i^2=-1$. Then find the fixed points for $f$.  EDIT: Let for all $n\geq 1$ $$\large a_n=\underbrace{i^{i^{\cdots i}}}_{\text{$n$ times}}$$  My question is, does the sequence of tetrations $\{a_n\}_{n\geq1}$ converge to some complex number? If yes, then what is it?


I noticed that the definite article is sometimes omitted with the word "legendary":  A collaboration between legendary game designer Richard Garfield and Valve, Artifact offers the deepest gameplay and the highest-fidelity experience ever seen in a trading card game. () The Bellezza Nera and its sister model, the all white Bellezza Blanco, are the result of a particularly unusual collaboration between legendary British guitarist Eric Clapton and Japanese trendsetter Hiroshi Fujiwara. (Robert Shaw. Hand Made, Hand Played: The Art & Craft of Contemporary Guitars.)  Furthermore, as user user150719 correctly indicated in a comment to  the indefinite article is sometimes dropped before nationalities, e.g. the seconds example above or:  The story would open in 1969, when Cobham met British guitarist John McLaughlin in the seminal fusion band of Miles Davis ()  Google agrees with this article-less use showing over 100 results for "met British guitarist" but only 4 for "met a British guitarist." I'd like to know why these omissions take place. Is there any grammar rule that covers these cases?

Is there a difference between these references to a specific person:     "The implication is clear: as the psychologist Jonathan Haidt said..."   and     "The implication is clear: as psychologist Jonathan Haidt said..."   The first one uses the definite article and is a quote from Daniel Kahneman's book 'Thinking, Fast and Slow', where the article is consistently used in such references. In the second one I've omitted the definite article. It seems more intuitive for me, a non-native speaker, and is something I would use in my own writing.  Are both expressions equally correct? Are there situations that require the article and vice versa?


I am a Cuban. I am traveling to London and acquired plane tickets from Air Europa, which goes through Madrid. Do I need a transit visa to switch planes at Madrid?

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


i want to know what is the difference between them and what is the posiible way to use them

In C#, I want to initialize a string value with an empty string.  How should I do this?  What is the right way, and why?  string willi = string.Empty;   or  string willi = String.Empty;   or  string willi = "";   or what?


I am adding more RAM memory to my 2011 21-inch iMac. It currently has two 2 GB memory cards. Can I leave those two cards in place and simply add two new 4 GB memory cards, or do I need to remove the existing cards? Is it OK to mix 2 GB and 4 GB memory cards, provided I stay under Apple's 16 GB limit?

I've been told it is important to use matching DIMMs when installing memory to take advantage of the 128 bit throughput. I'm looking to buy a new 27" iMac (mid 2011) which has 4 memory slots. If I put matching 2x2GB in 2 of the slots and matching 2x4GB in the other two slots, will that reduce its throughput or cause any problems?   Do all 4 have to match or do each set of 2 need to match?


Ubuntu One is not started automatically when my Mac OS X starts. Can I add it manually to the operating system start up?

Ubuntu One is installed on my MacBook, OS X Lion, and appears to be working fine, other than it does not appear to load automatically at startup.  Please note that Connect automatically when computer starts is selected.  Is there a way to set this up, other than including it as a Login item under the User & Groups in System Preferences? Which is what I have implemented in the interim. (I have Hide ticked so that one does not see the Ubuntu One gui pop up every time one logs in).  But I suspect that there may be a more elegant way of implementing the Ubuntu One start up.


Do I need to install Clam TK when using Clam AV?  Clam TK will not install.  Will Clam AV run automatically in the background?

What is the difference between Clamav and Clamtk? I know that both of them are antivirus.


Sometimes when I open files in LibreOffice, they open in minimized windows that I cannot find anywhere on my screen. How can I find the windows and resize them? The files still appear if I click on the LibreOffice icon in the dock (see attached screenshot; file names pixellated for privacy), but no thumbnail appears and clicking on the minimized file does not cause the file to appear or have any other apparent result.  Notes: (1) This started happening recently. I don't know if I made a change that caused it, if it was related to an update, or if it has some other cause. (2) It happens primarily when I open a file from the web in LibreOffice, by clicking on the "open in LibreOffice" button in the download popup in Firefox. I'm not sure whether it happens under other circumstances as well. (3) Restarting Ubuntu fixes the problem, in that I can then open the file in question to a visible window. But it is not a permanent solution, as the problem recurs with other files. Thanks for any suggestions.

I had an application (in case it matters: LibreOffice Calc] in full-size mode. I then clicked the middle of the three buttons of the top right to adjust the size. When I did that, the window became minimum size, literally a vertical line. I panicked and alt-tabbed, and now I can't even find the vertical line anymore. Opening new windows in that application opens all of them hidden to me, and closing/reopening or even restarting the OS doesn't help. I don't know how to resize my invisible windows anymore. Here's the preview of the windows in the application launcher: a vertical line (that I don't find on my screen anywhere if I click this).


I was reading the following puzzle:  There is a glass of juice and a glass of water with identical volumes. We take 1 full spoon of the juice and put it in the glass of water. After briefly stirring the mixture, we put a full spoon of the mixture back into the glass of juice. Question: which amount is greater? The amount of juice in the water or the amount of water in the juice?  I worked it out that the amounts are equal by calculating the ratio of juice in the water etc and assuming a prefect mixture. But although the solution  reported the same result, I don't understand really understand its logic and seems faulty to me. The solution states:  After the exchange the amount of juice in the water must be the same as the amount of water in the juice, since the volumes of the two glasses after the exchange are the same. The juice missing from the one glass was moved to the other having the missing volume replaced by water.  So I don't have a problem proving it algebraically. I am trying to understand the intuition behind ths stated answer. Isn't it based on the assumption that e.g. the juice poured in the water glass might be in lower parts and we just remove using the spoon, water from the surface? Otherwise why is the equal volume used here? It seems to me that we remove a volume of juice from the juice glass (e.g. x which is the volume of the spoon) and we put back in a volume of a mixture (not water).

There is a problem that appears in . The problem is also quoted .  You take a spoon of wine from a barrel of wine, and you put it into your cup of tea. Then you return a spoon of the (nonuniform!) mixture of tea from your cup to the barrel. Now you have some foreign substance (wine) in the cup and some foreign substance (tea) in the barrel. Which is larger: the quantity of wine in the cup or the quantity of tea in the barrel at the end of your manipulations?  Here's my solution: The key is to consider the proportions of wine and tea in the second spoonful (that is, the spoonful of the nonuniform mixture that is transported from the cup to the barrel). Let $s$ be the volume of a spoonful and $c$ be the volume of a cup. The quantity of wine in this second spoonful is $\frac{s}{s+c}\cdot s$ and the quantity of tea in this spoonful is $\frac{c}{s+c}\cdot s$. Then the quantity of wine left in the cup is $$s-\frac{s^2}{s+c}=\frac{sc}{s+c}$$ and the quantity of tea in the barrel now is also $\frac{cs}{s+c}.$ So the quantities that we are asked to compare are the same. However, Arnol'd also says  Children five to six years old like them very much and are able to solve them, but they may be too difficult for university graduates, who are spoiled by formal mathematical training.  Given the simple nature of the solution, I'm going to guess that there is a trick to it. How would a six year old solve this problem? My university education is interfering with my thinking.


We experienced a failure on one of our MS SQL servers this morning and we are currently investigating the cause.  One thing I have noticed is a massive jump in the size of the transaction log backups (.trn).  We backup the logs every 15 mins and the average size is around 8Mb.  This morning, at the time of the failure, the log file jumped in size to 5.8Gb.    I am assuming if I can read the contents of these TRN files it may give me some clue as to what was going on at the time everything failed.    Is there a way for me to read these files including a timestamp for each record?

I have a question regarding transaction log (let’s just call it LDF for short) contents. I am assuming a database with full recovery model.  I have read that LDF file contains (logs) each and every operation to the database (that is in full recovery mode). How is it different from logging during BEGIN TRAN; COMMAND(s); COMMIT? I am asking because apparently you can roll back transactions, but you cannot roll back standard commands (in full recovery mode).  I guess that during transaction the contents being logged into the LDF file are different than in regular full recovery logging. Is that right? How is it different? Is it only the inclusion of “undo” operations for each action?  On a related note, I have heard that there are commercial tools to "rollback/undo" standard queries using full recovery LDF file. How do they do it? Do they analyze the LDF contents and try to come-up with inverse/undo operations?


Let $f$ be an irreducible polynomial of degree 4 over $\Bbb Q$ and $Gal(f)=S_4$.  Prove that there isn't nontrivial intermediate field between $\Bbb Q(\alpha)$ and $\Bbb Q$ where $\alpha$ is a root of $f$.  Here is my attempt:  Let $E$ be a splitting field of $f$. Then, $[E:\Bbb Q]=24$.   If there is such intermediate field $K$, then clearly $[E:K]=12$, which means $Gal(E/K)=A_4$.  But it's impossible? Or should I do different way by using irreducibility of $f$?

Let $K$ be a field and $f \in K[X]$ of degree $n$ with Galois group $S_n$. Let $a$ be a root of $f$, $L = K(a)$, and let $E$ be a intermediate field of the extension $K \subset L$. Prove that $E = K$ or $E = L$.   Any suggestions on where to start? Thanks.


So, last night I saw a chat message from someone stating their reputation tab looked weird, and today I experienced the same thing myself, on Interpersonal Skills:  The graph displays a rep gain from 2015 onwards (note that this is on a beta site, so it should really have started nowhere before 2017). The post tab didn't show reputation today, instead, supposedly my last rep gain was from late January (on the first page) Going back to page 18 (there's only supposed to be 7), apparently, I started gaining reputation in 2008.  Refreshing the page didn't solve the issue immediately, but after visiting the time and graph tabs (and seeing they were okay), when returning to the post tab everything was fine again... Proof:   Update:  It happened again this morning, but now the time and graph tabs were wrong as well The 11 posts edited is wrong as well, this should be over a 100. Tried clearing my cache and reloading the page, the reputation tab looks normal again but the 'posts edited' count is still wrong.

I've stumbled across a user whose  mentions they've got two 'Famous Question' gold badges:    Upon clicking the 'Famous Question' link, we see this:    Even more curious, they appear to have bronze badges from before the site was .  As I was writing up this post, the badge counts appear to have been corrected.   Is this a case of an account merge gone wrong?


Normally, when we use a pipe, the operations on the left and right of the pipe are run in separate subprocesses. The outputs of the first command are transmitted as input to the second command. In this case, I thought that when I used the ampersand sign at the end of the pipeline, only the second operation would be started in the background. However, when I tested it, the entire command is launched in the background. In the following use, I expect the second command is started in the background, but the entire command is started in the background. I tested in bash. cmd | cmd2 & What exactly did I know wrong or missed? What happens when we use ampersand & at the end of the pipeline?

I have some conditions for some background job to run:  condition-command && condition-command && background-job &   The problem is: I want the conditions to block until the job runs, as if I had run:  condition-command; condition-command; background-job &   But it isn't a condition, if previous command fails I do not want the job to run.  I realised it is asynchronous, but it should not, in my mind the both following scripts should be the same, but they do not:  sleep 2; echo foo & sleep 1; echo bar; wait   # prints foo, then bar: correct sleep 2 && echo foo & sleep 1; echo bar; wait # prints bar, then foo: bug   I know if I test $? variable it would work, or if I put the last one inside a subshell (but then I would lost job controls, I want to avoid daemons), but I want to know why bash make it this way, where is it documented? Is there any way to prevent this behaviour?  Edit: Chained ifs is disgusting, that is why I will not accept it as a alternative way. Edit 2: I know a subshell is possible, but it will not work for me, let us imagine I want to run a bunch of commands then wait in the end. It will be possible if i check the existence of /proc/$PID directory, but it would be a pain in the neck if there are several jobs. Edit 3: The main question is WHY bash does it, where is it documented? Whether or not it has a solution is a bonus!


I'm confused between two kind of greetings in English, "How do you do ? And "How are you ?  I googled for it and found this:     How do you do?   This is not a question. It is another, very formal way of saying "Hello." It is also very British. The correct response is; "Pleased to meet you." or "How do you do." or just "Hello." We only really use it the first time we meet someone.  ----How are you?  This is a question, but the person asking it doesn't really want to know the truth about your aching back or hangover. A polite response is; "I'm fine thanks. And you?"    But I want to know are they really different in the meaning and use in our daily conversation, especially in terms of British and American English?

I'm a non native speaker of English. In our learning we were told that when we say hello to someone we use equivalent phrase:      How do you do?   In response we do say:     How do you do?   But I'm unsure about the usage in the USA or UK. I haven't heard from them. I'm an Indian.  Is this the correct way of introducing someone?