I'm currently reading and learning PHP from a book that offers this as the proper way to sanitize input from forms:  function mysql_entities_fix_string($connection, $string)  { return htmlentities(mysql_fix_string($connection, $string)); }  function mysql_fix_string($connection, $string) {   if (get_magic_quotes_gpc()) $string = stripslashes($string);   return $connection->real_escape_string($string); }   Which is great, except I know that get_magic_quotes_gpc() is deprecated in the current version of PHP. From looking at a few different resources I learned that instead of using get_magic_quotes_gpc() I should just use an sql prepared statement. That confuses me though because I would presume that we still need to do some functional cleaning of the string.   Unless I'm wrong(it happens, I'm relatively new at this) this is a big no-no, regardless of the prepared statement:  $username = $_POST['username']; $stmt = $conn->prepare("SELECT password FROM users WHERE username=?"); $stmt->bind_param("s", $username"); $stmt->execute(); ...   but if that's the case, is this an acceptable sanitation process:  function get_post($conn, $var) { return $conn->real_escape_string($_POST[$var]); } ... $username = get_post($conn, 'username'); $stmt = $conn->prepare("SELECT password FROM users WHERE username=?"); $stmt->bind_param("s", $username); $stmt->execute(); ...   or do I need to add some other escaping function on top of it?

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?


Hej guys. Our institute has some special format requirements, and I'm wondering if one of these can be automated by some clever LaTex wizardry:  A caption (also sections and subsections) is set ragged-right. However, the line-breaking is in such a way, that the subsequent line is longer than the preceding line (with the exception of the last line, if not possible to maintain). However, it is not intended to have the last line completely \textwith but rather find the first breakpoint which somehow makes the next line a bit longer.  So here are some examples:  This:  This is an example of a very long caption of a figure which might be too long to stay in one line so that it will automatically jump to a new line.  Should become this:  This is an example of a very long caption of a figure which might be too long to stay in one line so that it will automatically jump to a new line instead.  This is an example of a very long caption of a figure which might be too long to stay in  one line so that it will automatically jump to a new line instead but now it is even more text.  I am really curious if this kind of formatting can be automated.   All the best, Bernte

using \raggedright roughly speaking will result in linebreaking when ever there is not enough space on the line to put the next word. This in turn results in all lines, except the last, being mostly full.  I want to achieve the opposite. I wish for the last line to be full, and the first line to be partially empty.  In the example below I have achieved this for the second heading using manual line breaking.  \documentclass{article} \begin{document}      \newcommand{\myheading}[1]{{\textbf{\raggedright #1}}\\} \begin{minipage}{3cm}     \myheading{This is the first heading}     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi.\\     \bigskip      \myheading{This is\\ the last heading}     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi. \end{minipage} \end{document}


I’m trying to show this by showing that $\mathbb Z[x]/I$ is a field. Since in this ring $x=-1$ and so $x^2=1$, but also $x^2=-1$ from which it follows that $1=-1$ and so it is probably isomorphic to $\mathbb F_2$? But I can’t find a homomorphism from $\mathbb Z[x]\ \longrightarrow\ \mathbb F_2$ with kernel $I$.

For a principal ideal, I have a good understanding of what it will look like in terms of making all multiples of the ideal $0$ (gluing them with zero). I don't on the other hand have any intuition of what $$\mathbb{Z}[x]/(x+1,x^{2}+1)$$ will look like, I believe it contains $\mathbb{Z}/(x+1)$ and $\mathbb{Z}/(x^{2}+1)$ but apart from that I don't know. I believe it’s $\mathbb{F}_{2}$.


I have a lot of files that I need to rename in numerical order. So what I have is this  Getting Started 1.jpg Getting Started 10.jpg Getting Started 100.jpg Getting Started 101.jpg Getting Started 102.jpg   and what I want to do is rename them so that they are ordered like  Getting Started 001.jpg Getting Started 002.jpg Getting Started 003.jpg Getting Started 004.jpg   is there a simple way to do this?

I have a ton of files, all named stuff like 1.jpg, 2.jpg, 3.jpg, and so on up to 1439.jpg, however, I have a problem with one of my projects and alphabetizing. It will usually go in the order 1.jpg, 10.jpg, 11.jpg and so on.  What I need is some way to name the files so they are in the format such as 00001.jpg all the way up to 01439.jpg.  How would I be able to do this quickly and efficiently?


Suppose you have $n$ points that you will connect with $m$ edges.   There must be a path from each point to every other point (not   directly, but it must be possible to get there somehow), and there   should not be more than one edge for any pair of points.       How many connections can be formed with $n$ points and $m$ edges   given these constraints?      $m$ will always be at least $n-1$ and no greater than $\frac{n\cdot (n-1)}{2}$.      Example:      Suppose $n$ is $3$ (points $a$, $b$, and $c$, and $m$ is $2$). Then   there would be $3$ possible graphs:      $a$ -- $b$ -- $c$      $a$ -- $c$ -- $b$      $c$ -- $a$ -- $b$   I've yet to find a mathematical formula that will let me generalize this for $n$ and $m$, but intuitively, after solving for all cases of $n = 3$ and $n = 4$, it seems like there should be one. Is it possible?

Is there a way to calculate the number of simple connected graphs possible over given edges and vertices?   Eg: 3 vertices and 2 edges will have 3 connected graphs But 3 vertices and 3 edges will have 1 connected graph  Then 4 edges and 3 will have 4 connected graphs  Till such values...it is easy to see its  V choose E  But what about when the number of vertices are less than number of edges...how to calculate then?  I am not able to visualize that  Can it be a variation of the Stars and Bars problem  Like...number of ways 7 edges(balls) can be connected to (kept in) 5 vertices(bags) such that no vertex(bag) is isolated (is empty)  Here maybe we might have to consider the number of edges twice as each edge needs two vertices...


What is the reason behind ticket reservation for schengen Visa?  I'm confused because I want to book tickets directly from air line , everyone knows those booking are cancelled after 24-48 hours so mostly likely will be cancelled a day or so after I submit my document. Travel agencies are asking for money to book ticket that will last about 3 weeks, how true is this . And is that what the embassy needs to confirm, that I have a reservation Is it to confirm the price of ticket and compare with my bank statement to determine if I can afford it.

Many consulates around the world require all applicants to purchase a flight ticket as part of their visa documentation requirements. For example, the French consulate in the US mentions the following as part of their :  Purpose of travel/stay  Pre-booked round-trip ticket   But why does this requirement exist in the first place? If the visa is not issued, the applicant would have to cancel their ticket (which incurs fees) or forfeit their journey altogether. Furthermore, its possible that the visa processing would take so long that the dates of travel would be long past by the time the visa is issued. This conundrum has caused  to pop-up which offer fake (or semi-fake) flight reservations, as well as airlines  in case of visa refusals.  Is it so that the consulate knows the applicant is financially secure? This doesn't make sense as one would presumably need to buy a ticket anyway once their visa is issued or they wouldn't be able to travel. Is it so that the itinerary can be sanity checked? This likewise doesn't make sense as the consulate could simply ask for a list of possible flights instead of a ticket. Perhaps its designed to make the application more difficult and deter people from applying? Or maybe its a case of "we've always done it this way" and no rational explanation exists?  The purpose of this question is to understand the motivation behind the requirement to pre-purchase a ticket, which would help travellers decide how much importance to place on this part of the visa application checklist.


Can someone please verify this?     Show that if $B \subseteq C$, then $\mathcal{P}(B) \subseteq \mathcal{P}(C)$   let $x \in \mathcal{P}(B)$.  Then, $x \subseteq B$  This implies that $$\forall a \in x, a \in B$$  This further implies that $$\forall a \in x, a \in C$$  Therefore, $$x \subseteq C$$  This implies that $$x \in \mathcal{P}(C)$$

Here is my proof, I would appreciate it if someone could critique it for me:  To prove this statement true, we must proof that the two conditional statements ("If $\mathcal{P}(A)⊆ \mathcal{P}(B)$, then $A⊆B$," and, If $A⊆B$, then $\mathcal{P}(A)⊆ \mathcal{P}(B)$) are true.    Contrapositive of the first statement: If $A \nsubseteq B$, then $\mathcal{P}(A) \nsubseteq \mathcal{P}(B)$  If $A \nsubseteq B$, then there must be some element in $A$, call it $x$, that is not in $B$: $x \in A$, and $x \notin B$. Since $x \in A$, then $\{x\} \in \mathcal{P}(A)$; moreover, since $x \notin B$, then $\{x\} \notin \mathcal{P}(B)$, which proves that, if $A \nsubseteq B$, then $\mathcal{P}(A) \nsubseteq \mathcal{P}(B)$. By proving the contrapositive true, the original proposition must be true.    To prove the second statement true, I would implement nearly the same argument, so that isn't necessary to write. So, does this proof seem correct? Also, was the contrapositive necessary? Or is there another way to prove the initial statement?


I know that photons have no electric charge and that they are stable, but is it possible to give them a positive or negative charge? If so how?

As I understand these two statements:   An electromagnetic field gives particles charge A photon is a quantum of electromagnetic field   It must mean that a photon carries charge. But I guess it isn't true. Why not?


I am trying to install Wine in Ubuntu 18.10 and I get this error :"E: Malformed entry 58 in list file /etc/apt/sources.list (Component) E: Lista surselor nu poate fi citită."Can anybody help me?Thanks in advance

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.


I am using Ubuntu 15.04 and when I try update for Software updater I always get this error:     I also tried to not download some packages and download the main ones but the error always stays there.

It didn't fixed the error. So, how do I fix my GUI update?  For every software I have to install it from command line because I got same error when install software from Ubuntu Software Center.


I am from Singapore and I am about the graduated from PhD. My field is in software engineering, computer science.  I plan to further my study as postdoc in US, looking at my friends, it seems that although some of them have 1-2 top ranked publications in  conference, but they are hard to secure a desired postdoc position in US.   I wish to get a postdoc position in US, hopefully in some top research labs, is there anyone has some general recommendations on how to improve one's chance in getting those labs in US?

First of all, I know that your work speaks for you, and if you have really good papers, you have better chances, but just bear with me, and for the sake of argument lets assume that your research is only one of the points to consider.  I did my undergrad in what could be considered the best University in my Country (Mexico)and got a Magna Cum Laude.  And then, I did my Graduate studies in the University of Tokyo publishing a couple of Journal Papers (I'm really pushing for that 3rd one!)  This question is directed to people in the US, since I'm looking to find a permanent position.  What is the perception Universities in the US have of foreign Universities? I happen to know that UK Universities like Cambridge and Oxford have no problem (for obvious reasons), but a professor friend of mine told me that other Universities are just not that well known. And having a degree from the Hawaii University was better than having a degree from Tokyo University. (As a side note, he is a professor at Haw Univ, and he wanted me to apply over there)  I just want to know how true or false this is, and realistically speaking how hard/easy is to get a position as a postdoc and eventually a full time professor if you are not from a US univ.  For example, do I have the same chances as someone who graduated from a top University (your Ivy leagues, Public Ivy League, MIT, Stanford, etc) or do I least have the same chances as middle range Universities?  As a side note, I have a postdoc in the UCLA lined up, so I guess that'll boost my chances a bit.


I've created an executable jar and using commons-cli to give the user the ability to specify command line parameters when he launches the client.  Everything works fine.  However, when I print the usage statement for the jar, I would like to show the following:  usage: java -jar myprog.jar <options> <file> --help Display the help message --debug Enable debugging ....   Printing of all the options is easily done with commons-cli.  However, the "usage" line is the head scratcher.  I cannot seem to figure out a way to get the "myprog.jar" name from the args[] that are passed to the application.  Is there any easy way of doing this?  I could use a pretty convoluted method to back trace from my class' classloader and figure out if it is contained within a jar, but that seems like a fairly ugly answer to what should be a pretty simple question.  private String getPath(Class cls) {     String cn = cls.getName();     String rn = cn.replace('.', '/') + ".class";     String path =             getClass().getClassLoader().getResource(rn).getPath();     int ix = path.indexOf("!");     if(ix >= 0) {         return path.substring(0, ix);     } else {         return path;     } }

My code runs inside a JAR file, say foo.jar, and I need to know, in the code, in which folder the running foo.jar is.  So, if foo.jar is in C:\FOO\, I want to get that path no matter what my current working directory is.


I made a website that went online 3 months ago. Wen it went online i've added it to webmaster and added the url to google on . Every page  has a unique title and the following meta tags.   Keywords Description   I removed the robots.txt to be 100% sure there wasn't an error in there. I've checked my logs on the server and can't find any errors that points to downtime or other errors. From websmaster i've crawled the website successfully and there are no errors given. The website has a 'unique' name and there aren't many related titles. the only way I find the website on google is by googling the full url. Why isn't the website in the results and what can I do about it?   when searching in google with site:mydomain.com i can see it's indexed.  There are no crawl errors and i checked all the options on the answer from the question that is marked as duplicated.

This is a general, community wiki  question and answer pair intended to address any questions   concerning the reasons a site or specific site contents do not appear   in search engine results.      If your question was closed as a duplicate of this question and you   feel that the information provided here does not provide a sufficient   answer, please open a discussion on .   My site (or specific pages on my site) is not appearing in search engine results.  Why isn't my content indexed and what can I do about it?


As the header says, I was tipped by some people that if I wanted to print the sum of everything in an array of numbers, I should use the above-mentioned parameter for a for-loop (code will follow if further explanation is needed). But what is the exact definiton of what that does? The :-part I mean. Is it; for every number i in the array tall?  import java.util.*;  class Uke36{     public static void main(String[]args){      Scanner input=new Scanner(System.in);     int[] tall=new int[5];      for (int i=0; i<=4; i++){         System.out.println("Vennligst oppgi det " + (i+1) + ". tallet: ");         tall[i]=input.nextInt();     }     int sum = 0;     for(int i : tall){         sum+=;     }     } }

Consider:  List<String> someList = new ArrayList<String>(); // add "monkey", "donkey", "skeleton key" to someList     for (String item : someList) {     System.out.println(item); }   What would the equivalent for loop look like without using the for each syntax?


I've come across different questions at different networks that get closed, the reopened, then closed again...  It's often about questions that represent an edge-case for what's on/off-topic on the corresponding site, or "maybe-opinion-based" questions.   What often happens is that a few people don't think the question is fine and vote to close it while people who think it is can do nothing. Then, when enough "close" votes are reached, the opposite happens (reopen votes until the threshold is met)  I don't know if you think this is fine but for me it's chaotic. A question is either on topic or not, but it can't be on-topic on Tuesday and off-topic by next Friday only to be on-topic again in the weekend. I can think of a few alternatives.   Closing a question becomes definitive - This appears to me as way too harsh and losing value for the sites (maybe a good edit could save the day). Creating a "do-not-close" vote - Questions wouldn't get closed until the "close vs do-not-close count" reaches a certain point (5 more votes for closing, or maybe at least 3 and 66% of total, or any other criterion). Then, questions shall only be reopened by a moderator after an approppriate edit is made. Put the "closers" on trial (i.e. make us reputation-responsible for what we decide to flag and close). This means that sound close-requests should be awarded reputation while unsound ones should imply a loss in reputation   NOTE: This is my recent experience:  I present you  while this post is being made.  will probably be closed and reopened as well. Meanwhile,  has gone through the entire process. I was writing an answer when it suddenly got closed for a few days. Now it's reopened but it's really painful to take the time to rewrite the entire thing  EDIT: This question was closed as duplicate, but the linked question is more than 10 years old. A large majority there agreed with the second proposal but nothing has been done since! I would like to understand the reasons why. By the way, if this question gets reopened, it would be the most-meta question ever!

My request is simple: Many times, there will be a question where some people feel like it should be closed. At the same time, I'll feel like it's a perfectly legit question, and it should therefore NOT be closed. Right now, I have to wait till it gets enough close votes (which it always does for some reason, as soon as 1 or 2 people vote to close, e/o else decides to vote as well) and then vote to re-open. How about, as soon as there's one vote to close, there should be an option to counter the close vote, something like "vote not to close" or whatever. This would then bring the "Vote to close" number down by one. Only when the vote to close outnumbers the vote not to close by 5, that's when a question is indeed closed. Any thoughts?


The speed of light, c, is the same for all inertial observers but no one has ever actually measured it in one direction. So taking an normal emitter, reflector, detector setup, can we do the following? Make the first measurement, and log the time. Put a medium that allows light through but "slows" it down slightly, put in front of the emitter side, take another measurement. Then take that same medium and put it in front of the detector side, take the last measurement, and compare. Test a should give us the same we always get. If light moves the same velocity in every direction, test b and c should give the same result, if not then they will be different, meaning light changes velocity depending on the direction it is going. If I am wrong, please tell me what is wrong and why. What are your thoughts on trying to measure the one-way speed of light, and do you think it is possible at all?

Is there any way (practical or theoretical) to measure the one-way speed of light?    The two methods that come to mind are:   Stellar aberration, and Using adiabatic clocks: synchronize clocks, then slowly move them apart   I think 2 is not really measuring one-way speed, although I can't work out exactly why.    Is 1 measuring one-way speed?  In particular, if the one-way speed was not isotropic, would there be a different amount of stellar aberration if the telescope is pointed at stars that lie in exactly opposite directions?


I`ve been looking for this for some time now: I have two thin shells (S1 and S2) of radii R1 and R2, charged negatively C1 and C2 respectively, separated in space by a distance D. What is the force exerted by S1 on S2? (For my purposes, the charge can remain constantly distributed on the shell. Non-conductor, I'm guessing.)  What do I have to read to learn this? I know Coulomb's equation (F=kQ1Q2/d^2).  (If relevant, I need this to emulate repulsion in a very crude ion simulation, where the attraction is emulated by considering the ions point charges. Considering the electron shells as points would be great, but obviously doesn't work... that's when the sphere approximation should do the trick.) Thank you in advance.

Consider spherical symmetric$^1$ masses of radii $R_1$ and $R_2$, with spherical symmetric density distributions $\rho_1(r_1)$ and $\rho_2(r_2)$, and with a distance between the centers of the spheres $d$. What is the exact force between them? I know point masses are a good approximation, but I'm looking for an exact formula. This would be useful for a gravity-simulation toy software.  --  $^1$ Assume for simplicity the idealization where  or centrifugal forces do not deform the spherical symmetric, i.e., the various mass parts are held in place by infinitely strong and rigid bonds.


Very simple question:   It could be observed that in electromagnetic waves we can see points when Electric and Magnetic fields waves are both in ZERO position.   Is it right?   Because of Conservation of energy I want to say that:  When one of the wave reaches its maximum other should be in minumum. Like in swings with potential and kinetic energy...   But here we can see that energy is forming from Nowhere...explain me please...    Thanks

In Representation of electromagnetic waves we show both electric and magnetic fields perpendicular to each other and having zero magnitude at one point and maximum at other point. This representation and understanding of EM waves violating law of conservation of energy...


I have read that light is an electromagnetic wave. Every ray of light has a specific wavelength. The colour perceived by any observer is dependent upon the wavelength of the incident light.  What I don't understand is that how do electromagnetic waves of different wavelengths combine to form a single wave of another wavelength? Simply put, I have the following two related questions to ask:    When we look upon a, say, completely white object, what is the composition of the individual rays that strike our eyes? Are those rays waves formed by the addition of waves corresponding to individual wavelengths that constitute white colour? I get that white light is composed of all wavelengths of visible light, but how are those wavelengths combined into a single unit which we call white light? If it is so, then how are prisms able to disperse light into its constituent colours?   Also, as a side question, how does all of this relate to light being composed of photons?

Does a photon having superimposed frequencies exist?  (wrt frequency detected by prism or other detectors, not wrt human eye as only rod-cells can detect one photon falling in the detectable (visible) frequency band and the single photon is perceived by eye+brain as grey irrespective of frequency).  Also, with white here, I do not wish to restrict the question implying all VIBGYOR frequencies or only RGB as each color is also a range of frequencies and white to trichromatic-sensor human eye is just output from three frequencies RGB.  Or can it be that materials which slow light down cause a photon of some single frequency and higher energy to split into VIBGYOR? || and the entire spectrum of human eye's detection range is VIBGYOR+W (as monochromatic light of high intensity can also be perceived white by human eye and it is not related to individual color sensors of human eye at all but that above a certain energy per unit volume (referring to detector area of eye cells), we perceive it white, (somewhat but not exactly) similar to combination of red and green which human eye+brain calls yellow.  I have added the additional description to make the question more precise. If my description causes confusion, please stay with the original question and use description just to get an idea of the intent of the question.


I know how to /give a Named Item & How to Only have it Placed on a Specific Block.  but how/is there a way to Merge these 2 Commands?  {display:{Name:"[\"ITEMNAME\"]"}}   &   {CanPlaceOn:["minecraft:lime_wool"]}

I have two commands I'd like to combine into one, but I'm not sure how to go about combining them. Is this possible?   Here are the commands. They work individually, I just can't seem to get them to work together:  /give @p jukebox 1 0 {CanPlaceOn:["minecraft:melon_block"]}     /give @p jukebox 1 0 {display:{Name:"Box"}}   Can you help me to add one of the commands to the other one?


The following is given: $$X,Y\ \textit{are independent}$$ $$X∼exp(1),Y∼exp(2)$$ $$Z=e^{−X}+e^{−2Y}$$ And I want to find: $$f_Z(1)=?$$ As a part of my solution I do the following: $$Z=U+V$$ where $$U=e^{−X},V=e^{−2Y}$$ Using one dimensional transformation we get: $$U∼Uni(0,1),V∼Uni(0,1)$$ Since we know that X,Y are independent we can assume the same for U,V. In order to calculate $f_Z$ im using a convolution integral : $$\int_{-\infty}^{\infty} f_U(u) \cdot f_V(z-u)du = \int_{0}^{1} 1 \cdot 1du = 1$$ According to the solution this is not $f_Z$, could you point out where I was wrong?

I am trying to understand an example from my textbook.  Let's say $Z = X + Y$, where $X$ and $Y$ are independent uniform random variables with range $[0,1]$. Then the PDF is $$f(z) = \begin{cases} z & \text{for $0 < z < 1$} \\ 2-z & \text{for $1 \le z < 2$} \\ 0 & \text{otherwise.} \end{cases}$$  How was this PDF obtained?   Thanks


Let $u$ be a weak solution to the conservation law:  $$ \begin{cases} u_t + F(u)_x = 0 & (x,t) \in \mathbb{R}\times(0, \infty) \\ u = g & \mathbb{R} \times \{0\}  \end{cases} $$ Let us assume that $u$ is compactly supported in $\mathbb{R}\times [0,T]$ for all $T$, and that $F(0) = 0$. Prove then that for any fixed $t >0$ we have that: $$ \int_\mathbb{R}u(x,t) \mathrm{d}x = \int_\mathbb{R} g(x) \mathrm{d}x $$ My attempt: I know that for $u$ to be a continuous integral solution/weak solution, it must satisfy : $$ \int_0^\infty\int_{-\infty}^\infty u  \phi_t + F(u) \phi_x \mathrm{d}x\mathrm{d}t + \int_{-\infty}^\infty g\phi  \mathrm{d}x = 0 $$ For any $C^1$, compactly supported test function. How can I prove this identity?

This is an exercise in Evans, Partial Differential Equations (1st edition), page 164, problem 13:     Assume $F(0) = 0, u$ is a continuous integral solution of the conservation law   $$ \left\{ \begin{array}{rl}  u_t + F(u)_x = 0 &\mbox{ in $\mathbb{R} \times (0,\infty)$} \\   u=g &\mbox{ on $\mathbb{R} \times \left\{t=0\right\} $} \, ,        \end{array} \right. $$   and $u$ has compact support in $\mathbb{R} \times [0,\infty]$. Prove    $$ \int_{-\infty}^{\infty} u(\cdot,t)\,dx = \int_{-\infty}^{\infty}g \,dx $$   for all $t>0$.   How to solve it?


I have a shapefile of a whole region. Since every change I do require a lot of loading time, I would like to cut out one small section which I actually need and create a new shapefile - the rest I could delete. Is it possible to cut out a square and save it as a new, smaller shapefile?   I have seen the “Clipper” – Tool, but for that  I thought that I need another shapefile or a map so that I can lay them together… I need something very simple (like for example the same principle of the drawing program “Paint” – I hope you know what I mean).  I am using the QGIS 2.12.3 - Lyon Version.

I have a line layer and a polygon layer. Both files have the same SRS. I want in a new shape file only the lines covered by the polygons.   I tried in QGIS the Vector -> Geoprocessing -> Clip tool but I only get an empty shapefile.  How do I do this with QGIS?


First of all, Apologies if this is a silly question. I've never really had to manage servers and databases, on a "large-scale", that is.   ANYWAY, on to the question. I am trying to figure out if our current server can handle 12,000 database requests per minute. (once again, I don't know if this a lot. I assume it's mid-range). I am estimating that 2/3 of the 12,000 requests will be simple SELECT queries from super small tables. No more than 20,000 rows in a table-  I've made a point to prune them on a regular basis. LAMP Stack.  Below are the server hardware and software specs:  Processors- Intel Haswell 2095.050 MHz  Memory -  7.45gb useable   Storage - 80GB SSD  OS- Ubuntu, CentOS 7  DB  MySQL  V5.7.25  PHP - 7.2.7  The database is stored on the same server as where files are being served.  If this server is capable of this, how much further can the server be pushed?   Thank you in advance (And sorry if this seems to be a dumb question)

This is a  about capacity planning for databases. Related:      I'm looking to create a canonical question of tools and methods of capacity planning for databases. This is intended to be a canonical question. Obviously, the general workflow is:  Put your scenario in place Add monitoring Add traffic Evaluate results Remediate based on results Rinse, repeat until reasonably happy  Please feel free to describe different tools and techniques for different web-servers, frameworks, etc., as well as best-practices.


I am running Drupal 7.23 and drush 5.9  I can clear all caches in Drupal without an error but get "memory exhausted" if I try using drush cc all. I get "memory exhausted" when using "drush up", after it has downloaded and updated modules but was able to download and update the modules from within Drupal.  Is there anything that might be leading to a greater need for memory when using drush?

I've made a drush install of drupal 7.28 on my AWS server. I can confirm that the memory is set to 128M, all green on the reports -> site status page. The website will function normally and sporadically return no data, looking at the logs a tremendous amount of memory is trying to be allocated (assuming an infinite loop somewhere). Given that this is a basic install, no modules have yet been added what might be causing this?  PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 140008587493184 bytes) in Unknown on line 0


I want to check a valid contact number:-   The number may or may not start with a + sign. The number may contain space and hyphen (-) sign. There should be no consecutive hyphen (-) sign. There should be no other alphabets, special characters, etc.   An example of valid contact number is + 91-8341239834 or +91 033 2664 3271  The number must not exceed 20 characters.  How can I do this?  here is my code till now:-  preg_match('/^[0-9 .\-]+$/i', $number)

I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.


How to get application id of an installed application? I want to find app id of Notes 2.0, so maybe later I will have a change to find extensions to that product.

I am using Android 4.0.3 and I can no longer find package name for some app. If I recall, I used to go to Applications and has been able to see it there.   So, how can I see full package name of some app? Like, the app's name is "Test" and I need to see its package com.test.mytest.


NOTE: This is not actually a duplicate of the "" question that folks had thought previously, but it is more or less answered there.  This "Tri-tone" audio file is not in /System/Library/Sounds, but it is located here:  /System/Library/PrivateFrameworks/ToneLibrary.framework/Versions/A/Resources/AlertTones/sms-received1.caf  Been hunting for a bit, but not finding it.  I'd like to find Tri-tone which also serves as the Notification Center sound for all general notifications that come into the system.  I'm not seeing an AIFF file that matches it in /System so I'm kinda shooting blanks.  .

In what directory on OS X are the sound files located for the alert tones in Messages and in FaceTime? I'm not talking about the alert sounds in System Preferences; I mean the ones that are also on iOS—like Aurora, Bamboo, Chord, etc.—in the list in this screenshot:


I tried to load dynamic elements based upon ajax server response, then I need measure how long will take to render dynamic element after server response, If any tools is there like chrome extension or javascript code, please tell me, thanks advance

I need to get execution time in milliseconds.  I originally asked this question back in 2008. The accepted answer then was to use  However, we can all agree now  that using the standard  API is more appropriate. I am therefore changing the accepted answer to this one.


How to derive the formula   $$\sum_{n=1}^{\infty}\tan^{-1}\left(\frac{x^{2}}{n^{2}}\right)=\tan^{-1}\left[\frac{\tan\left(\frac{x\pi}{\sqrt{2}}\right)-\tanh\left(\frac{x\pi}{\sqrt{2}}\right)}{\tan\left(\frac{x\pi}{\sqrt{2}}\right)+\tanh\left(\frac{x\pi}{\sqrt{2}}\right)}\right]$$   Is the formula correct? How do I derive the above formula? I tried to apply the formula integral as the limit of sum formula.

Here is an interesting topic.  It comes from evaluating $$\sum_{k=1}^{\infty}tan^{-1}\left(\frac{1}{k^{2}}\right)$$  I managed to dig up an old paper I have on the sum of arctans by Boros and Moll.  It is called the Method of Zeros.  It is located here:   on page 6-7   I will post, verbatim, what it says.  Perhaps someone can figure out how they arrive at the solution.  They skip over the details and I do not know how they arrived at the general form they establish in [2].  "Based on the factorization of the product  $$p_{n}:=\prod_{k=1}^{n}(a_{k}+ib_{k}), \;\ a_{k},b_{k}\in R$$  The argument of $p_{n}$ is given by $$\text{arg}(p_{n})=\sum_{k=1}^{n}\tan^{-1}\left(\frac{b_{k}}{a_{k}}\right)$$  up to an integral multiple of $\pi$.  This can be applied to the case of a polynomial with real coefficients given by  $$p_{n}(z)=\prod_{k=1}^{n}(z-z_{k})$$  Then,  $$\text{arg}(p_{n}(z))=\sum_{k=1}^{n}\tan^{-1}\left(\frac{x-x_{k}}{y-y_{k}}\right)$$  up to an integral multiple of $\pi$.  The special case $$p_{n}(z)=z^{n}-1$$ has roots at   $$z_{k}=\cos(\frac{2\pi k}{n})+i\sin\left(\frac{2\pi k}{n}\right)$$,  so we get:  $$\text{arg}(z^{n}-1)=\sum_{k=1}^{n}\tan^{-1}\left(\frac{x-\cos\left(\frac{2\pi k}{n}\right)}{y-\sin\left(\frac{2\pi k}{n}\right)}\right)$$  The classical factorization  $$\sin(\pi z)=\pi z\prod_{k=1}^{\infty}\left(1-\frac{z^{2}}{k^{2}}\right)....[1]$$  shows that one can think of $\sin(\pi z)$ as a polynomial in z of infinite degree.  Euler than derived $$\sum_{k=1}^{\infty}\frac{1}{k^{2}}=\frac{{\pi}^{2}}{6}$$ by comparing the cubic terms of [1].  This now yields $$\sum_{k=1}^{\infty}\tan^{-1}\left(\frac{2xy}{k^{2}-x^{2}+y^{2}}\right)=\tan^{-1}(y/x)-\tan^{-1}\left(\frac{\tanh(\pi y)}{\tan(\pi x)}\right)....[2]$$"  That is it.  They mention Euler's famous sum of reciprocal of squares then just skip to "this then yields...."  Does anyone see how?.   Besides that, didn't Euler compare the square terms and not the cubic ones?.  So, for the problem at hand, we would let $x=y=\frac{1}{\sqrt{2}}$ and arrive at:  $$\sum_{k=1}^{\infty}\tan^{-1}\left(\frac{1}{k^{2}}\right)=\frac{\pi}{4}-\tan^{-1}\left(\frac{\tanh\left(\frac{\pi}{\sqrt{2}}\right)}{\tan\left(\frac{\pi}{\sqrt{2}}\right)}\right)\approx 1.42474......$$


I've been having problems on Windows 10: periodically I get a "low memory" warning. A lot of the Super User questions on this topic talk about driver memory leaks, but as I'll explain below mine doesn't fit the criteria found with those. What normally happens for me is my page file gets to about 70-80 GB in size as my "System and Compressed" memory grows. Eventually I start getting low memory warnings until I reboot, and then I'm good again for 5-8 days.  There are a lot of people who complain about System & Compressed memory growing to the point where it causes problems, but unfortunately the common cause (driver memory leak) in those doesn't appear to be immediately the problem for me.  Firstly,  covers a common problem. However, note that a key indicator in that scenario is a high "Non-Paged" memory usage. In my scenario, non-paged memory is not being used that much; I have 16 GB of memory, and I can have 8-9 GB of "System and Compressed Memory" and less than 1 GB of non-paged memory.  The question I linked to suggested utilizing the PoolMon tool. I have done that. The high Nonp processes I've observed have been those with the tag "Thre" and "Py28" and from what I can tell these are not drivers (most Q&A on high system memory usage in Windows 10 will point you to a driver leak).  Another symptom of my issue is that the longer the system is left on, the larger the pagefile gets. For example, before the last reboot the pagefile got to be about 60 GB in size. Also note that I see on my Task Manager screen "Committed" values regularly in the "12.3/50-60 GB range." I have no idea if that is normal or not. But it would at least seem "weird" to me for my page file to get so large.  Edit: Let me make clear what I'm asking here. I am asking, "How can I tell what application is using so much of my system's memory when it appears that System & compressed memory is obscuring the root memory hog from me." Note that again, I have a pagefile that gets up to 80 GB or so in size and NO single application has high memory usage, only the "System and compressed memory" system process. Under older versions of Windows I knew how to tell what applications were using so much memory, but NONE show abnormal memory use now. I don't know if this is because System and compressed memory is "being helpful" and helping manage the memory so the system can run for much longer without running out of it, or what, but I know that I'm running out of memory on my system and no application EVER shows abnormal memory usage in task manager. I'm asking how to find out what is causing this. The closest I've found to an answer for this suggests using PoolMon and looking for an offending driver using large amounts of non-paged memory, but unlike people who have had driver memory leaks, my non-paged memory usage is never very high at all, and no drivers are listed as high memory users when I ran PoolMon.

Since I upgraded to Windows 10, my system has been consuming RAM excessively    I've been reading a bit and determined it's likely a driver leaking memory. So I got myself the Windows Driver Kit and tracked memory usage with poolmon:    However, I don't really know how to proceed from here. Is the item tagged "smNp" the culprit in this issue? How do I go from there to actually identifying the driver?  I tried some stuff like "C:\Windows\System32\drivers>findstr /s smnp ." but it returned no results. I also took a look at the pooltag.txt file and this is the description I found for it:      So yeah, any help would be appreciated. Thanks in advance.


I need a server monitoring tool that does the following  - Notifications when services or sites go down  - SLA Reports  - Inventory Managment  - Centralized Logs  - Monitor local and remote servers  I have looked into using Groundwork Opensource, Splunk, Spiceworks which seperatly seem to do some of these tasks, but I would prefer not to have so many tools, anybody know any one tools that can do this all?  BTW My servers are not in a domain environment so tools that require that will not work for me.

For a more comprehensive list of monitoring tools and their features, check out .   As the question states, what are the most commonly used tools used for this task and what are their strengths and weaknesses?


In airplane mode, both SIM(s) and wi-fi are disconnected. Is there a way to just disconnect the SIM(s) and keep wi-fi connected without root privilege?

I know the definition of Airplane mode is all communications and radio signals are blocked. But is it possible to turn off the "calling/receiving" part of the phone so your phone is not connecting to a cell tower and only allow Wifi? I've looked into a couple of apps in Google Play but they're either not working or out of date with newer versions of Android.   I know there is strong opinions on both sides of the issue but I'm worried about radiation from my phone since i use it a lot in bed and I hold the phone close to my head and face. At night I'm not worried about receiving calls, so I just want to turn off the phone part and  use WiFi. Is there a way? Or am i just crazy and paranoid?


I am trying to check if the user typed in the correct password if they did then I want to make a bool true but for some reason it's just declaring a new bool with the same name I have tried looking for other questions but none of them are in my situation  Correct = False  def SubmitPassword():         if e6.get() == password:                 Correct = True```

How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?


I want to know if it is correct to treat AF as a proper name and thus write "AF's concept" or if I must take the words of the initialism into consideration and write "AFs' (as I would write "Armed Forces' concept of protection" if I didn't use the initialism).  The link provided gave me conflicting answers about which way is right, and the main issue in the argumentation seemed to me to be the dubble s-es.

I work with a company whose name is frequently reduced to an initialism (acronym).  Let's say the name is "Cool Computer Systems" (CCS).  I am engaged in an ongoing, bloody battle with the marketing department, wherein they insist the following apostrophe use is correct:  Buy CCS' New Product.  Reading that line brings visions of crying 4th grade teachers and librarians to mind.  I am quite certain that it should be written:  Buy CCS's New Product.   UPDATE: The examples are in title case because the sentence is the subject line of an e-mail.  UPDATE: Their argument is that "Systems" is plural.  I say that plurality doesn't matter, because "Systems" is part of the name.  The name as a whole should be handled as a singular entity, because the company is, in fact, a single, legal entity.  Thus, the possessive form should be written:  The Emperor's clothes Cool Computer Systems's clothes CSS's clothes


I have added a table and after the table a graph.   I am using \begin{table}[H]  (i tried with !h but it doesn't fix the problem) to control position of tables and similar code for figures. But although I put explicitly the table before the graph, the graph appears before. Is there any way to control it? Is there any way to order all floats in one shot?  What i have in my file looks like this:  \begin{center} \begin{table}[h] \centering \caption{Convergencia pm6} \label{convergencia_cluster_pm6_table} \begin{tabular}{|l|l|l|} \hline \textbf{nºconf} & \textbf{$\Delta G^0$-SS} & \textbf{$\Delta G^0$-Packmol} \\ \hline 5 & -64.6 & -64.7 \\ \hline 10 & -65.5 & -64.1 \\ \hline 15 & -63.7 & -66.5 \\ \hline 20 & -64.3 & -65.0 \\ \hline 30 & -65.9 & -66.3 \\ \hline 40 & -67.2 & -65.6 \\ \hline \end{tabular} \end{table} \end{center} and for images:  \begin{figure} \caption{Convergencia pm6 cluster} \label{Convergencia_cluser_pm6_figure}     \includegraphics[page=1,trim=0 140 0 360, clip, width=\linewidth]{imagenes/all_results_thesis.pdf} \end{figure}

How to influence the position of float environments like figure and table in LaTeX?   This is a general question and should collect useful answers for all users. I hope we can use this as a reference


I am using the following sed command(with word boundary):  sed "7 s/\<<Filevalue=.*/>\>/<Filevalue="true"/>/" < config.xml   And I am getting this error:  sed: command garbled: 7 s/\<<Filevalue=.*/>\>/<Filevalue="true"/>/   I tried escaping special characters but still getting same error:  sed "7 s/\<\<Filevalue=.*\/\/\>\>/\<Filevalue=\"true\"\/\>/" < config.xml   What have I done wrong?  EDIT:  This is a dummy XML. Values of Filevalue may vary.  XML Content:  <Filevalue="false"> <Filevalue="false"> <Filevalue="false"> <Filevalue="false"> <Filevalue="false"> <Filevalue="false"> <Filevalue="false">

I have a script that reads a text stream and generates a file of sed commands that is later run with sed -f. The generated sed commands are like:  s/cid:image002\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1922/g s/cid:image003\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1923/g s/cid:image004\.jpg@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1924/g   Assume the script which generates the sed commands is something like:  while read cid fileid do     cidpat="$(echo $cid | sed -e s/\\./\\\\./g)"     echo 's/'"$cidpat"'/https:\/\/mysite.com\/files\/'"$fileid"'/g' >> sedscr done   How can I improve the script to ensure all regex metacharacters in the cid string are escaped and interpolated properly?


I have a yakkety system running and would like to do a dist upgrade.  I followed the procedure at  however, it did not help.  Apparently, some files are not found. It looks like the packages at  (and all the other directories) are not available.  Is there a new procedure to upgrade or a manual way to force the system to simply do an upgrade? I basically do not care whether I have to do two upgrades first to zesty and then to artful or to artful directly. However, currently I only have the choice to go to artful directly.

The old-releases.ubuntu.com mirror hosts the repositories for EOL Ubuntu releases. The  currently lists up to 11.10 (or 12.04.3 if you count point upgrades), but the  lists up to 13.04. Why the discrepancy? When will the main page be updated? When will the newest EOL release (13.10) be shifted here?


I am new to .net application development. I have made small application. If I take only one application.exe file to another folder from my project file and try to launch, it does not launch. But If I take all .dlls and config file with it, it launces fine. Now I want to launch Applicaiton with only .exe file. So what should I do? Do I have to package them all in one? If yes, then how?

Is it possible to embed a pre-existing DLL into a compiled C# executable (so that you only have one file to distribute)? If it is possible, how would one go about doing it?  Normally, I'm cool with just leaving the DLLs outside and having the setup program handle everything, but there have been a couple of people at work who have asked me this and I honestly don't know.


I accidentally deleted the /usr/bin directory. Using a bootable usb, is it possible to rescue my machine?

I deleted an important directory with rm -R command. This is an very populer host data. It was located /var/zpanel/hostdata/ayrintilih After remove ayrintilih directory has gone everything.  I tried to undelete with ext4magic program. But it need to another hdd volume for recovery.  Error message:   ERROR: can not use "/root/recoveried" for recover directory. It's the same filesystem : "/dev/dm-0"   My ISP just replied my request:  Unfortunately there is no way to add another Volume to a virtual Instance.  If it would be a dedicated Server, we could do it, but not in a Cloudserver.  You could try to minimize the partition and create another one, that would  count as another Volume. We also recommend to have allways a  Backup for your Important files.


I am getting the error:     SQLSTATE[42000]: Syntax error or access violation: 1064 You have an   error in your SQL syntax; check the manual that corresponds to your   MySQL server version for the right syntax to use near "mytable"  at   line 1   When I call the below function using  $fields = Table::getFieldsForTable('mytable');   If I hard-code :t to my table name, then the code executes fine.   public static function getFieldsForTable ($table ) {             $sql = 'DESCRIBE :t';              try {                 /**                  * @var $db \PDO                  */                 $db = static::getDB();                 $stmt = $db->prepare($sql);                  $stmt->bindValue(':t', $table, PDO::PARAM_STR);                  $stmt->execute();                  return $stmt->fetchAll(PDO::FETCH_ASSOC);             } catch (\PDOException $e){                 echo "PDO ERROR" . $e->getMessage();             }         }   I have used the same code snippet over and over in other parts of the project, but I am failing to see what I have done wrong here.  Any help?

Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) {     var_dump($stmt->fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"


Any reasons or steps to reproduce for Lightning Salesforce Internal error with gack id "-1079455898"?  Please note: this is not duplicate of  since gack id is different and reason is different.

Why   Salesforce Internal Error in Lightning is generated with Gack Id 1747963889?  How to reproduce it?


Let z be a complex number such that $\frac{z-i}{z-1}$ is purely imaginary. Then the minimum value of $|z-(2+2 i)|$ is ? My approach:- $$ \begin{array}{l}  \\ \left|z-z^{\prime}\right| \geqslant| \ |z|-\left|z^{\prime}\right|| \end{array} $$ where, $z^{\prime}=2+2 i$ $$ \left|z^{\prime}\right|=\sqrt{8}=2 \sqrt{2} $$ $Let, \quad z=x+i y$ $$ \begin{array}{l} \frac{z-i}{z-1} \\ =\frac{\{x+i(y-1)\}\{(x-1)-i y\}}{(x-1)^{2}+(i y)^{2}} \\ =\frac{x(x-1)+y(y-1)+i(x-1)(y-1)-x y}{(x-1)^{2}-(i y)^{2}} \end{array} $$ ${}{} \frac{z-i}{z-1}$ is purely imagivery $$ \begin{array}{c} \text { Hence, } x(x-1)+y(y-1)=0 \\ x(x-1)=-y(y-1) \\ x^{2}+y^{2}=x+y \end{array} $$ What to do next?

From an entrance examination.  Let $z$ be a complex number such that $\dfrac{z-i}{z-1}$ is purely imaginary. Find the minimum value of $|z-(2+2i)|$.  $$$$ Attempt:$$$$Since $\dfrac{z-i}{z-1}$ is purely imaginary, $$$$$$\dfrac{z-i}{z-1}+\overline{\left(\dfrac{z-i}{z-1}\right)}=0$$ This reduces to $$|z|^2=\Re(z)+\Im(z)$$ This represents the locus of $z$ on the Argand Plane. The minimum value of $|z-(2+2i)|$ will be the shortest distance between any point $z$ lying on $|z|^2=\Re(z)+\Im(z)$ and the point $(2,2)$ on the Argand Plane. $$$$Unable to recognize the locus represented by $|z|^2=\Re(z)+\Im(z)$. How to identify locus represented by $|z|^2=\Re(z)+\Im(z)$  without reducing to Cartesian Coordinates?


The propagation of light in medium is sometimes interpreted as the photons moving with $c_0$ (the speed of light in vacuum), occasionally absorbed by particles and released again by transition, causing a time lag.   Is this the generally accepted explanation of why the light appears to travel with a speed $c<c_0$ in medium, or is it just a way to make students understand the interaction between photon and medium? Will the speed of photon be affected by external fields ($E$, $M$, $G$) in a medium?

So light travels slower in glass (for example) than in a vacuum. What causes light to slow down? Or: How does it slow down? If light passes through the medium, is it not essentially traveling in the "vacuum" between the atoms?


Would it be possible that someone from Ilvermorny comes to study at Hogwarts or vice versa? Like an exchange program?

Are there either examples, or a mention of this having happened, of students permanently transferring from one magical school to another in Potterverse?  Canon only please (books/JKR/Pottermore).  Please note that I am only asking about transfers, e.g. you must already be studying in one school. Therefore an example of Malfoys considering sending Draco to Durmstrang is not in scope, since that happened before he attended Hogwarts. Also, guest-studying during Tri-Wizard doesn't count as it wasn't permanent.  Also, if the answer is a "no", please provide evidence (other than "well I read the books before and I don't remember a single case like that", unless you have eidetic memory) from entire canon.


Currently, I started doing some research to understand what type of notifications the app I'm designing need and also how frequently and so on, and I was wondering if there were any data on this. So far I found 1 medium article that doesn't have a "marketing" POV, so this is why I'm here A bit of context about this app:  Is not a commercial app whatsoever This is app goal is 100% informative about a worker and her/his paperwork on a company Its being build using React Native I'm aiming to cover just basic stuff since this is for an MVP  Things I'm doing right now: Inventory of possible notifications without any criteria in mind but the app content Thanks in advance

I'm currently building a the base notification system for a startup I'm working at, and am having a hard time defining the line between being spammy and making 100% sure the user knows about something they should.   Of course the user will have options to change their preferences, but defaults are what most people will deal with and are important.   We will notify users in many ways, sms, email, web, and a facebook app notification.   I'm thinking following the idea of "Make 100% certain the user knows, but don't bother them beyond that" would lead to the best design. Meaning to send users   Currently I'm planning on sending essential notifications (we won't have any other notifications for a few months) via all channels: sms, email, facebook and web.    The nice thing I see about this is that wherever the user has technology, they'll get it right then and there.   With twitter, I enjoy getting a text and then clicking on my messages or mentions when I'm on the web.  Any feedback on this would be appreciated.


Today, I uploaded this  on a  I asked on superuser.com. But strangely enough, on my computer the image which is shown on the question is valid but if I look at the same question via mobile site of superuser then I see this . which is invalid. I don't know if the other users who are reporting that the image is invalid are on a mobile device.  And here's the original link to the image uploaded:   It seems to be some kind of bug which is displaying the invalid image on the same link to some users. I doubt that it could be that the image format (.png) I used is unsupported.

^^^^^^ Here is an image.   I've just tried to upload the screen shot for this question and I've seen that the upload image from computer doesn't work.  It must be fixed.  Clicking the image link I receive the following error on the page:     DNS Points to Prohibited IP You've requested a page on a website   (img.stack.imgur.com) that is on the CloudFlare network.   Unfortunately, it is resolving to an IP address that is creating a   conflict within CloudFlare's system. If you are the owner of this   website, you should login to CloudFlare and change the DNS A records   for img.stack.imgur.com to resolve to a different IP address.      Timestamp: Fri, 28-Jun-13 05:23:58 GMT      Your IP address: XXX.X.XX.XXX      Requested URL: img.stack.imgur.com/qhEV9.png0      Error reference number: 1000      Server ID: FL_11F1      Process ID: PID_1372397038.656-1-9635161      User-Agent: ....


I just recently purchased a a 4TB Backup Plus and installed about 1.5GB worth of data. I connected it using the USB 3.0 input on my motherboard. Works fine.  I then decided to use the bare drive itself, internally. So I took apart the external and opened it up. I removed the HDD and installed it in my tower. When I powered on the PC (Windows 8.1 Pro), and tried to open the drive, it gave me the:     This drive must be formatted, blah, blah, blah…   Then:     …the volume does not contain a recognized file system, blah, blah…   I’ve unplugged it from the tower (Desktop) and used the bottom adapter which housed the external drive and connected it using the USB 3.0 again and it works fine. It just won’t work internally using the SATA III ports.  The drive model is  and my file system is NTFS. When I first plugged it in using the USB 3.0, I did a full format.

I have a 3TB Seagate Backup Plus Desktop USB 3.0 drive, which works fine when in its enclosure, but when I get it off its enclosure and directly plug it as an internal SATA drive, it's just not properly recognized (it works again when used in the enclosure). My systems’s motherboard is an , which has two SATA 6.0 Gb/s and four SATA 3.0 Gb/s ports.  When used as an internal SATA drive Windows 7 asks if I want to format the drive, as if it didn’t have a proper filesystem, and if I use the DISKMGMT.MSC tool (typing that in the start menu) I get completely wrong information about the drive.  It says the drive has 3 partitions (349,31GB of RAW data and two unassigned partitions of 1698,68GB and 746,52GB). This information is plain wrong, since the drive, when used in the USB enclosure, works as a single NTFS partition (2794,52GB). How come it’s shown as 3 partitions without filesystem when connected through SATA?!  Is Seagate using some proprietary way of storing the data when using the drive in its provided USB 3.0 enclosure? I didn’t use any kind of encryption. I just plugged the drive with USB 3.0 and started using it straight away, since it apparently came pre-formatted with an NTFS filesystem.


if I have a list like this:  list1 = ['a', 'b', 'c', 'd']   How can I convert them to characters so I can get the ASCII codes?

How do I get the  value of a character as an int in ?


\begin{cases} x+y+\dfrac{x^2}{y^2}=7\\ \dfrac{(x-y)x^2}{y^2}=12 \end{cases} I don't have any idea to solve this. I tried to subtract, add and multiply the given equations, but nothing help me to find $x$ or $y$. Can someone help me to solve this system? Thanks for attention.


I am working through my dissertation and was just wondering, how would you know if a journal is peer reviewed or actually legitimate? If a journal etc has an ISSN number on them, does this mean the journal is peer reviewed and good to use?

. While the reasons for his doing this are not yet public, this is a real loss of a valuable service. Does anyone know of similar services available to the general public?  Edit:  is definitely relevant, but that approach is more appropriate for finding top journals rather than identifying bottom ones. I.e., following that method would probably exclude lots of valid, lower-tier journals. Are there any approaches to easily identifying a predatory publisher?


Yesterday i was trying to answer 2 questions on SO, but when i finished typing the questions was closed because they were duplicate.  One of the question was answered by a really not that good of an answer (so the question is closed, but that answer is the only one to show), and the second question had no answer at all.  Now if someone will see the first question and its answer, he will be giving the sense that this answer is ok to work with it, and no one can give other answers, or they won't bother as that question is closed, so those users will be using the wrong way.   The second answer is actually more important, because the question had actually couple of right answers, and couple of right ways to do what the OP wanted, but the duplicate that was linked to it was a specific one way (the OP asked for a specific way to do it, so i can't answer with the other way to do it as it won't be answering the question), but again, because the question is closed, no one will bother answering it or take a look if its really a duplicate?  I don't have enough points to comment or chat, so i can't do anything about it, but SO is about helping people to understand code, the first question was a typo of the OP and needed exactly 2 lines to answer it (first line the code, and second is where his problem was), the second question had few answers but yet the duplicate only specifically talking about one of those answers.  So i kinda have 2 questions, do we really need to close questions without giving any answer? If a questions have couple of ways to do it, does it really a duplicate of a question that is only specifically talking about 1 way to do it?

I'm looking around for answers to my questions on several Stack Exchange sites and the good boy that I am I don't want to ask duplicate questions.  Often I find that there are other people who asked the same questions, sometimes years earlier, but still don't have an answer. I'd figure I could bump these back to top, but if I don't have enough rep for a edit (or comment), how would I do that?  Or, in that case, I should just post a 'newer' version of the same question?


I have come across a problem where PostgreSQL does not insert records at the end of the table (according to id, which is the primary key)  So if, for example I have ids like 1521, 1522, 1527, the id of the next insert will be 1523 and not 1528 as I expected and would like to occur.  The missing ids may be due to the fact that the database that was migrated from MySQL. The id has the following definition: Data type: bigint Default value: nextval('fleetmanager.workorderjob_id_seq'::regclass) Not null Storage: Plain  I use PostgreSQL version 10 on Windows.  How can I get it to always do insert after the last id?

I'm using Django, and every once in a while I get this error:     IntegrityError: duplicate key value violates unique constraint "myapp_mymodel_pkey"   DETAIL:  Key (id)=(1) already exists.   My Postgres database does in fact have a myapp_mymodel object with the primary key of 1.  Why would Postgres attempt to use that primary key again? Or, is this most likely my application (or Django's ORM) causing this?  This issue occurred 3 more times in a row just now. What I've found is that when it does occur it happens one or more times in a row for a given table, then not again. It seems to happen for every table before it completely stops for days, happening for at least a minute or so per table when it does occur, and only happening intermittently (not all tables right away).  The fact that this error is so intermittent (happened only 3 or so times in 2 weeks - no other load on the DB, just me testing out my application) is what makes me so wary of a low-level problem.


Filenames of photos stored on a camera's memory card follow the . They are merely counters with a prefix, e.g. DSC_, DSCF_, IMG_, ... and files are stored in a folder with a prefix as well, see also .  I am not aware of any camera manufacturer including time stamps in the filenames.  It would be rather convenient to be able to identify photos by a unique filename, ex DSCF_01012017_120302.jpg taken on Jan. the 1st 2017 at 12:03:02; rather than DSCF_12345.jpg, given the file name counter can be reset, and has no mnemonic indication of the file's content. If photos are shot at high burst rate (more than 1/second), then one could simply add a millisecond time-stamp or use a 2 letters coding.  One reason I can foresee for not using timestamps is that the file name can be long; but this can be solved by removing for example the date (day, month, year) from the name and storing files in folders with the date in their names.   Is there any specific reason not to use time stamps in photo filenames stored on memory cards?  Edit:  When asking my question, I hadn't found any similar one nor had SE suggested one, but here is a discussion on the topic:  and a .

I notice that when taking photos using my camera phone, the file name consists of the date and time. (e.g. 20131101-110015.jpg)  However, most point and shoot and DSLR cameras do not. Their file name is usually in a sequence like DCM0011.jpg  Is there a way that we can set a camera option so that it will create the file with a name that contains the date and time?  With reference to a Point and Shoot Camera Samsung EX1 vs a Camera phone Samsung Galaxy S2


I purchased some games second-hand from someone else. I have the original discs, cases and product codes. However I cannot activate the games because they were activated by the previous owner, whoever that is. I get the "Duplicate Product Code" message.   What are my options?

I've just created a new steam account and wanted to activate Half-Live there. Then I got this error message:    When I click on 'Retrieve Account', nothing happens. I am quite sure that I have already activated this many years ago on another account, but I don't remember which account (and which email-address) I used.  When I click on '' it seems not to contain helpful information.  I have the original CD and even the receipt.  What can I do now?


I have an Android phone and imported all my contacts from Gmail. Most of my old contacts weren't in Gmail, but on the iPhone 3GS.  Now getting the iPhone contacts into Gmail is proving to be a huge pain, there is a ton of information about this on the web but a lot of it must be outdated and none of the methods have worked for me yet.    How can I get contacts of iOS 5 iphone 3GS, and into Gmail so that they can be visible on my new Android phone (Galaxy Nexus)?  I've been trying for 4 hours and it's very frustrating.

I know someone who just got an Atrix 4G and previously had an iPhone 3GS. I was asked how he could move his contacts from the iPhone/iTunes onto the Android device. I have never owned an iPhone and have had limited interaction with them. Does anyone know the simplest method of getting iPhone contacts onto an Android device?


I had Windows 7 on my computer and wanted to install Ubuntu. I did not do manual partitioning. When I restarted the system, I found out that my drive was reformatted. Is there a way I can recover my files?

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


I have the following situation: Suppose $x,y$ are real numbers with $y > 0$. Then, I would like to show that for small values of $t$, we have   $$ (tx)^2 + (ty - 1)^2 \leq 1 $$  How can I show this in a formal manner?? For instance, I find myself struggling because I don't know that is the definition of small values of $t$.   Can someone help me? thanks

Suppose $x,(y > 0)$ are real numbers. I want to know if it is true that for small $t$, we have  $$ (tx)^2 + (ty)^2 \leq 2ty $$


I am failing to understand why the integral is defined as:  $$\int_a^b f(x) dx = \lim_{n\to\infty}\sum_{i=1}^n f(x_i^*)\Delta x$$  instead of:  $$\int_a^b f(x)dx=\sum_{i=1}^\infty f(x_i^*)\Delta x$$    Is the former just popular preference or is there something I am not conceptually understanding here?

Consider one of the standard methods used for defining the :       Suppose $\sigma$ denotes any subdivision $a=x_0<x_1<x_2\cdots<x_{n-1}<x_n=b$, and let $x_{i-1}\leq \xi_i\leq x_i$. Then if    $$|\sigma|:=\max\{x_i-x_{i-1}|i=1,\cdots,n\},$$   which we shall call the norm of the subdivision, we define:   $$\int_a^bf(x)dx:=\lim_{|\sigma|\to 0}\sum_{i=1}^nf(\xi_i)(x_i-x_{i-1}).$$   When one talks about the limit of a function $\lim_{x\to x_0}f(x)$, one has exactly one value $f(x)$ for every $x$. However, for every $|\sigma|$, the value of the Riemann sum $\sum_{i=1}^nf(\xi_i)(x_i-x_{i-1})$ is not necessarily unique. Using the $\epsilon$-$\delta$ language, one may restate the definition as follows:     Suppose $f:[a,b]\to{\mathbb R}$, $J\in{\mathbb R}$. If for all $\epsilon>0$, there exists $\delta>0$ such that for any subdivision $\sigma$ and $\{\xi_i\}$ on $\sigma$ (i.e. $x_{i-1}\leq \xi_i\leq x_i$), $|\sigma|<\delta$ implies   $$|\sum_{i=1}^nf(\xi_i)\Delta x_i-J|<\epsilon,$$   we call $J$ is the Riemann integral of $f$ on $[a,b]$ and denote   $$J=\int_a^bf(x)dx.$$   Here are my questions:   How should I understand this kind of limit? It seems that this is not the "limit of a function" I learned in elementary real analysis. Where does it appear in mathematics besides the definition of Riemann integrals?


I want to generate random numbers to vectors, but when the external loop ends, the list contains duplicate values from the last vector  class Cops_planner:     def __init__(self):         self.move_plan_vector = []         self.move_plan_vector.append(0)         self.move_plan = []         for i in range(number_of_cops):             self.move_plan.append(self.move_plan_vector)      def algorithm(self, worlds_list_copy):         vector = []         for j in range(number_of_cops):             vector.clear()             for i in range(k):                 vector.append(randint(0, 4))             self.move_plan[j] = vector             print(self.move_plan[j]) #1.         print(self.move_plan) #2.   So, for example, the first print looks like this:  [1, 0, 4, 3, 3] [4, 0, 1, 3, 1] [0, 0, 3, 2, 2] [2, 3, 0, 4, 2]   and the second one is like this:  [[2, 3, 0, 0, 2], [2, 3, 0, 0, 2], [2, 3, 0, 0, 2], [2, 3, 0, 0, 2], [2, 3, 0, 0, 2]]

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


I have to sort the content of 2 files in such a way that I must first sort it by the dates and then within each subgroup sort them also by times. I tried achieving this by simply using  sort -k 2   and then  | sort -k 3   The 2nd line contains the dates and the 3rd one contains the times. The problem is that instead of actually sorting the values in each subgroup, after the second sort command, it just rearranges all the values only by the times, ignoring the previous sorting completely. For example, say I have the following input:  name1 3.5. 10:00  name2 3.5. 11:00  name3 3.5. 8:00  name4 4.5. 13:00  name5 5.5. 7:00  I would like to sort them by the times they have in each subgroup separately while the dates remain in the same order:  name3 3.5. 8:00  name1 3.5. 10:00  name2 3.5. 11:00  name4 4.5. 13:00  name5 5.5. 7:00  It would also be very helpful if the solution can be written in one line (using | for example).  Thank you in advance.  UPDATE:  I tried using sort -k2,2 -k3,3 but for whatever reason it STILL doesn't work! It sorts the dates correctly, but the times are out of order. If I add -n at the end, it sorts the times correctly, but then the dates are out of order...  I even tried sorting the dates normally and the times numerically:     sort -k2,2 -k3,3n but it STILL sorts only the dates correctly, while the times still remain out of order. I don't know what else to do. This is killing me...

I have potentially large files that need to be sorted by 1-n keys.  Some of these keys might be numeric and some of them might not be.  This is a fixed-width columnar file so there are no delimiters.  Is there a good way to do this with Unix sort?  With one key it is as simple as using '-n'.  I have read the man page and searched Google briefly, but didn't find a good example.  How would I go about accomplishing this?  Note:  I have ruled out Perl because of the file size potential.  It would be a last resort.


I am travelling to Vietnam and Australia through Vietnam Airlines.  My passport name is: Mrs A B C  The ticket has been printed as: Mrs B A C  (To be clear; A to represent first name, B to represent middle name and C to represent last name)  There are no discrepancies in the spelling of any of the names. After reading an overwhelming amount of information and posts on forums, it seems as though it isn't an issue in general. It's just worrying to know I could be denied at the airport or even worse denied on flights abroad. My tickets cannot be reprinted by the travel agency. I can either cancel and rebook (at a VERY large price, £1200+) or take a chance... any further advice?

I use my middle name pretty much everywhere.  At work I used to book travel myself and would always book under my first and last name.  We recently hired an admin who booked travel using my middle and last name.  Jet blue refused to change the ticket (or perhaps wasn't able to?).  The only option was to cancel the flight and re-book it at the last minute price, of course.  The other option is to show up to the flight and risk TSA refusing to let me travel.  Any advice?


let valueOne = 3; let valueTwo = "3"; if(valueOne==valueTwo)     {console.log("same")} else     {console.log("different")}      console.log("valueOne==valueTwo: " + valueOne==valueTwo);   Why is the output:  same false   It doesn't even print the string  valueOne==valueTwo:.  However, when extra parentheses are added it's outputting the expected results.  console.log("valueOne==valueTwo: " + (valueOne==valueTwo));      Output:   same valueOne==valueTwo: true   It appears that the == operator has lower precedence than concatenation in javascript,   which is different from Java:    Anyone know the design concern here?  Thanks!

I'm using  to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.  Is there a performance benefit to replacing == with ===?   Any performance improvement would be welcomed as many comparison operators exist.  If no type conversion takes place, would there be a performance gain over ==?


I'm pretty sure this question has a duplicate, but since I can't seem to find it, I'm asking it again.  If $a_{1},a_{2}...a_{n}$ are $1$ or $-1$ and if,$$a_{1}a_{2}a_{3}a_{4}+a_{2}a_{3}a_{4}a_{5}+...+a_{n}a_{1}a_{2}a_{3}=0$$prove that $n$ is divisible by $4$.  What I've done so far is manage to prove that $n$ is even, which is pretty obvious. I haven't come up with any workable leads so far, so I'd be much obliged if you could give me some pointers.

Let $a_1,a_2,\cdots,a_n$ be $n$ numbers  such that $a_i$ is either $1$ or $-1$. If $$a_1a_2a_3a_4+a_2a_3a_4a_5+\cdots+a_na_1a_2a_3=0$$    then prove that $4 \mid n$.   My work: By multiplying all the terms, we get, $$a_1^4a_2^4\ldots a_n^4=1.$$  I think that I will be able to represent $4n$ a power of $1$, but getting no clue. Please help! I also think that this problem can be done with invariance and extremal principal too. Please help with these approaches too!


If you don't consider general relativity, could you say that the geometry of spacetime might be different from how it's specified by the Minkowski metric? Or is Minkowski spacetime the only geometry that can fully portray the fundamentals of SR?

What is the chain of reasoning (beginning, of course, from observations about the universe) that leads one to predict that Minkowski space provides an accurate description of space-time in the framework of special relativity?  That is, why should flat space-time have the Minkowski metric  $$\eta = \left(\eta_{\alpha\beta}\right) = \left( \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & -1 \end{matrix}\right)\,?$$


Is there a way to create a snapshot of a Windows 7 system?  My goal is to be able to save the current state of my Windows 7 OS, on external storage, and be able to restore it on the same hardware in the future. Much like a snapshot on a virtual machine.   One solution would be to install two hard drives in RAID 1, then take one of them out an store it. Is there an easier solution?

I was wondering if anyone knew of free software to take an OS snapshot.  Something that would also compare and list the differences between the two different snapshots.


I have had unsalted butter in the fridge for a while and used it from time to time. Now I realize that's it's been there for many, many months. It tastes fine but is it safe to keep it longer than a month?

I just came back from a long trip and I was cleaning out my fridge, and I noticed that there is an expiration date on the butter. It expired about two months from when I bought it. The butter doesn't look any different than normal butter.  How strictly should I follow the date on the box? Is there a way to test to see if the butter has actually gone bad?


At the moment I'm using an old laptop that previously had Windows Vista OEM. I upgraded it to Win7HP using Upgrade Box bought at local retailer.  Now I want to buy myself a new laptop, but the one I chose has Win8 preinstalled. Since I'm going to format the old computer and install linux on it, will I be able to use the Win7 upgrade box license on the new computer as a downgrade option? I don't really like the new Windows and would like to use Win7...

We get a lot of questions on Super User about Windows activation and licensing. This question is an attempt to answer the most common questions in one place with a .   When reinstalling Windows, the following questions often come up:   Can I transfer the copy of Windows from my old computer to a new one? Does the license key on the sticker on my computer work on any computer? If I have a 32-bit version, can I install a 64-bit version? I have an OEM version of Windows, but only a retail disk. Can I still use it? I want to install Windows with a different language. Do I need a new license in that language? I changed some hardware. Will I be able to reactivate my computer? Can I back up my activation before doing a reinstall? How many computers can I install my license on? Do I have to deactivate my old installation before transferring a license? If so, how? How does licensing work in Windows ? What are the restrictions on transferring, reinstalling, and changing versions of Windows?


I have tried to open nm-applet but it doesn't list my/any networks. I thus can't connect to the internet.   $ lspci | grep -i Network  network controller: Broadcom corporation BCM4321 802.lla/b/g/n  (rev 03)   I installed Lubuntu 14.04 on a "HP Pavilion Entertainment PC" laptop.  What do I need to do to connect to my network?

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


-I'm looking for an introductory books in "Graphic Designing" for beginners, Please help!   A little note to Admins: If the post violates your rules... Kindly, Edit it to be in keeping with the rules... Instead of, Putting it [on Hold]... BTW, I don't mind.

What is the single most influential book every designer should read?


Why was helium hydride ion HeH$^+$, and not hydrogen H$_2$, the first molecule formed in the early universe?  How did NASA scientists confirm it?

This press release by NASA:      When the universe was still very young, only a few kinds of atoms existed. Scientists believe that around 100,000 years after the big bang, helium and hydrogen combined to make a molecule called helium hydride for the first time. Helium hydride should be present in some parts of the modern universe, but it has never been detected in space — until now.   Naively I would expect that the first molecule to form would be the H$_2$. A claim that HeH$^+$ was before that should mean that it has larger binding energy that allowed the molecules to withstand more radiation. However, if I check Wikipedia for dissociation energies of these molecules, I see $436\,\rm kJ/mol$ for H$_2$ and $360 \,\rm kJ/mol$ for HeH$^+$.  Additionally, helium hydride is charged and should interact with lower energy photons that will destabilize the bond due to sheer quantity.   And finally, the temperature mentioned in the article is $4000\rm\, K \sim 0.34 \, eV$ — which is quite below the dissociation energy of molecular Hydrogen ($4.52 \,\rm eV$). Why was the formation of molecules delayed so much? Is this one of those situations where baryon-to-photon ratio is important and photons overwhelm the baryons?  Could someone please explain this situation?


So I am asking the user for their username, and if the user types in "username" then he/she will have "Correct, that is your username!" displayed and if they get it wrong they will get "Incorrect, that is not your username!" displayed.  The problem I am having is that whenever I type the username, in this example the username being "username" I have the Incorrect message displayed.   I would like to know where I went wrong and if this question has been asked a million times if someone could direct me to one of those posts where this has been solved that would be great since I can't seem to find one that's like this problem.  import javax.swing.*;  import java.util.Scanner;  public class userID {  public static void main(String[] args) {      Scanner input = new Scanner(System.in);      String username;     String password;     String email;     String scanner1;      username = "username";     password = "password";     email = "emailhere";      System.out.println("------------------------------------------");     System.out.println("Welcome to the ID memory tester");     System.out.println("Author: me");     System.out.println("------------------------------------------");      System.out.println("What is your username?");       scanner1 = (input.nextLine());       if (scanner1 == username) {         System.out.println("Correct, that is your username!");     } else {         System.out.println("Incorrect, that is not your username!");     } }   }

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


In our physics class we were discussing about Coulomb's Law and equation for the electrostatic force between two points: $$F_{e}=\frac{Q_{1}Q_{2}}{4\pi \epsilon_0 r^2}$$  From the equation a query arose which is for what reason does the constant involve $4\pi$.

The Coulomb force in SI units reads $\displaystyle  F = \frac{1}{4\pi\varepsilon  }\frac{Q_1\times Q_2}{R^{2}} $. On the other hand, in CGS this reads $\displaystyle F = \frac{Q_1\times Q_2}{R^{2}} $. Why is this? I mean, doesn't it make any difference in dimension? Particularly since $  \varepsilon $ itself has dimension. An identical question holds for the magnetic force.


Below is an image of my seven day unlimited travel ticket for Berlin B Section:    I have painted black on its printed serial number, and have circled the validation stamp impression in red.  I bought it on 11th Nov about 11am, from a ticket vending machine in Wedding S Station, for 30 Euros, and immediately validation stamped it to start using it. Now, I can calculate 7 days from 11th, inclusive, are till 17th, inclusive.  My question is where in validation stamp its mentioned that it was stamped on 11th Nov? What can I say to Ticket Inspector on 16th or 17th if he says its expired. (At Gesundbrunnen Metro Station the lady at info desk said its expired today, when I asked her same question, although we both struggled in German and English language. When I said I bought today, she said ok.)  So, could you please interpret the validation stamp, part by part, and/or ticket (or any other part), to prove that it is valid for 7 days.  Edit: One more sample of validation stamp I got, on different ticket, one time use, Eur 2.70, Date 10th Nov, Time somewhere 11:30ish AM, Berlin Airport TXL    Edit2: Ok,   Do means Donnerstag, Thursday. Fr means Freitag, Friday. 11:40 is time in first ticket, 11:00 in second. Looks like 45 is the week number of year 2016, from Nov 7 to 13. What does 6 mean (rotated 90°, after 45)?

I have purchased an AB zone Berlin 7 day transport ticket and validated it on Sunday 17th April so hopefully it will be valid until Sunday 24th.  I validated the ticket at about 10:00am so I guess 1000 is the time I validated? But what are the numbers 15 and 6 and letters 'So' correspond to? How (if checked by a guard) can they tell if the ticket is valid? And how can I as a customer tell when it is validated to?


Below is the question and the answer is "what."     Xerosis is a technical medical term for ___ most people refer to as dry skin.    From my instinct, I understood why "what" should be an answer. The problem is I can't explain why "which" can't be an answer.   If I chose "which" for this question, then "which" indicated the word "term," but it couldn't be like that. I need an explanation based on grammar.

Most of the time one or the other feels better, but every so often, "which" vs. "what" trips me up.   So, what's the exact difference and when should you use one or the other?


"What the hell?!" He said with surprise when he noticed my coming up the water.   Do we use my or possessive pronouns in such sentences? Or should it be     … he noticed me coming up the water"?

I was reading a book and encountered this sentence (emphasis added by me):        I know it without his telling me.      Despite being grammatically correct, it seemed a little strange to me. What came to my mind was this sentence instead:        I know it without him telling me.      Another case was this:        I can’t control the fact of temptation, but there’s no chance of my giving in to it.      QUESTION: Is using "me" here in #3 (or "him" as done in the previous one) correct? If so, what's the difference between the two?


Let's say I have a small data set (~50 observations) and 50 or so explanatory variables, and I want to develop a linear model for the sake of prediction. First, I want to construct a correlation matrix or a variable selection technique to select a smaller number of predictors to include within the model. However, I'm wondering what would be the appropriate action when attempting to train the model and checking whether it has predictive power? train-test data split? cross validation? what would be the best could of action with a small dataset and large number of explanatory variables?  Tagged w/ R because I'll be using R to conduct analysis.

I am a bit confused about the application of cross-validation. So, if I have a big data set, I will split my data into test and training data and and perform validation on the test data. But if I have a small data set I would like to used cross-validation and then the validation is already performed within it.  What puzzles me is that lots of people split data, perform training on training data with cross-validation, and then perform validation on the test dataset. So they combine those two methods. Is this a proper way to do it? May I do only cross-validation since my data set is quite small?


So I just had a software update on ubuntu 14.04 and now when I try to login, it just sits there for a few seconds then returns to the login screen. I've tried restarting and doing a few things I found on the web but none of them helped. If you can, please help!

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.   I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M


So I can not figure out the combinatorial proof for Vandermonde's Identity for the example  $\sum_{i=0}^k \binom {k} {i}^2 = \binom {2k} {k}$ Any help would be appreciated.  Figured it out, thanks :)

I was hoping to find a more "mathematical" proof, instead of proving logically $\displaystyle \sum_{k = 0}^n {n \choose k}^2= {2n \choose n}$.  I already know the logical Proof:  $${n \choose k}^2 = {n \choose k}{ n \choose n-k}$$  Hence summation can be expressed as:  $$\binom{n}{0}\binom{n}{n} + \binom{n}{1}\binom{n}{n-1} + \cdots + \binom{n}{n}\binom{n}{0}$$  One can think of it as choosing $n$ people from a group of $2n$  (imagine dividing a group of $2n$ into $2$ groups of $n$ people each. I can get $k$ people from group $1$ and another $n-k$ people from group $2$. We do this from $k = 0$ to $n$.


Could any one explain what is going on in the below code? Why is nothing getting printed?  var actions = new Action[100]; for(int i=0;i<100;i++) {     actions[i] = () => DoSomething(i); }  foreach(var action in actions) {     action(); }  void DoSomething(int i) {     if(i % 9 == 0)         Console.WriteLine("{0} is a multiple of 9",i); }

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


This is from a song lyric     If a picture paints a thousand words,   Then why can't I paint you?   The words will never show the you I've come to know.   If a face could launch a thousand ships,   Then where am I to go?   There's no one home but you,   You're all that's left me too.   And when my love for life is running dry,   You come and pour yourself on me.   First the singer says If a picture paints a thousand words.  Followed by, If a face could launch a thousand ships.  Why does the singer sing "If a face could launch a thousand ships"?  Why not, "If a face can launch a thousand ships"?  Why is  can used in the past?

When should I use can? When should I use could? What is right under what context?


Is there any way to override the standard css provided by salesforce in LWC?  I tried the way we did for aura components but it doesnot seem to affect the structure in any way.  Do we have different method of doing so?

I'm trying to set max-height property to slds-scrollable_y class inside lighting-datatable web component via css with:  .slds-crollable_y{     max-height: 10rem !important; }   But it's not working. Is it even possible to overwrite standard lwc css as it was in aura?


I have been seeing this a lot at work and at home. At home, a single device will not obtain an IP from the DHCP so it self assigns an IP in the 169.xxx.xxx.xxx range. If I put in a static IP it works most of the time. I only have that issue with that specific laptop at home. ANYWHERE else it works fine.  I have also seen this a work with Windows 8 surface tablets. I can connect a students surface to our open network but not any of the 4 secure networks we have set up.   In both situations I have tried 'ipconfig /release' and 'ipconfig /renew' Release tells me that it can be performed because no media is connected and renew just sits there and doesn't renew the IP at all.

My Windows system got an 169.xx.xx.xx IP address the other day, and I fixed the issue, but why did Microsoft chose this address as the default?    Why not 1.xx.xx.xx or 255.xx.xx.xx? Did one guy at Microsoft say      Hey, pick a number 1 to 255....who just said 169?! OK, we're going with that for our Windows default IP address.


I don't know how to fix this, it is a friend's 2017 Macbook Air running High Sierra, thought I would update it to Big Sur finally. There is an issue with my mac running High Sierra. Now that I need to update, it is showing this.

Basically the "updates page" loads in a non rich html format, and if theres an update it's missing the tabs on the update page as well.  I can't figure out if this is just because apple may have stopped supporting El Capitan or if I have something else going on.  Any help would be appreciated.  I've trashed the caches in library and the user profile. But this page is the only one that still loads like this (see pic below) on my app store.


Let R be a integral domain with a finite number of elements. Prove that R is a field.  Let a ∈ R \ {0}, and consider the set aR = {ar : r ∈ R}.   Guessing i will have to show that |aR| = R, and deduce that there exists r ∈ R such that ar = 1 but don't know what to do?

This is how I'm approaching it: let $R$ be a finite integral domain and I'm trying to show every element in $R$ has an inverse:   let $R-\{0\}=\{x_1,x_2,\ldots,x_k\}$,  then as $R$ is closed under multiplication $\prod_{n=1}^k\ x_i=x_j$,  therefore by canceling $x_j$ we get $x_1x_2\cdots x_{j-1}x_{j+1}\cdots x_k=1 $,  by commuting any of these elements to the front we find an inverse for first term, e.g. for $x_m$ we have $x_m(x_1\cdots x_{m-1}x_{m+1}\cdots x_{j-1}x_{j+1}\cdots x_k)=1$, where $(x_m)^{-1}=x_1\cdots x_{m-1}x_{m+1}\cdots x_{j-1}x_{j+1}\cdots x_k$.   As far as I can see this is correct, so we have found inverses for all $x_i\in R$ apart from $x_j$ if I am right so far. How would we find $(x_{j})^{-1}$?


The following is python code, I initialize a 2-d list using operator *, and set the diagonal elements with other value. But get unexpected output.  table = [([False]*5)]*5 for i in range(5):    table[i][i] = 1   The expected output is   [[True, False, False, False, False],  [False, True, False, False, False],  [False, False, True, False, False],  [False, False, False, True, False],  [False, False, False, False, True]]   But I got   [[True, True, True, True, True],   [True, True, True, True, True],   [True, True, True, True, True],   [True, True, True, True, True],   [True, True, True, True, True]]   May the elements in the list refers one, I guess. How could I get the expected output without using numpy or other packages?

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