I'm 15 this year and have a passion in physics What kind of math do I need to tackle general relativity?  Also what year in uni do we learn about general relativity?

This question recently appeared :     Slashdot posts a fair number of physics stories. Many of us, myself included, don't have the background to understand them. So I'd like to ask the Slashdot math/physics community to construct a curriculum that gets me, an average college grad with two semesters of chemistry, one of calculus, and maybe 2-3 applied statistics courses, all the way to understanding the mathematics of general relativity. What would I need to learn, in what order, and what texts should I use? Before I get killed here, I know this isn't a weekend project, but it seems like it could be fun to do in my spare time for the next ... decade.   It seems like something that would be a good addition to this site: I think it's specific enough to be answerable but still generally useful. The textbook aspect is covered pretty well by , but beyond that: What college-level subjects in physics and math are prerequisites to studying general relativity in mathematical detail?


I am working on an Auth/Login system, that does the following. JavaFX-App sends POST-Request to an "auth.php", auth.php check if the user exists and returns a JSON with userdata. If my Database contains a character like "Ü,Ä,ä,ö etc" the method json_encode($data) fails. it returns nothing. Without one of those chars all works so fine. How I can get my code to working? <?php     require "config.php";     $username = "";     $password = "";     foreach($_POST as $keyname => $value){         switch($keyname){             case 'un':                 $username = $value;                 break;             case 'pw':                 $password = $value;                 break;             default:                 break;             }     }      $authuser = new AuthUser(false, -1, "dummy", "dummy", true);     $sql = "SELECT `id`, `username`, `authkey`, `banned` FROM `users` WHERE `username`= ? AND `password` = ? LIMIT 1;";     $statement = $conn->prepare($sql);     $statement->bind_param('ss', $username, $password);     $statement->execute();     $result = $statement->get_result();     if($result->num_rows > 0){         $data = $result->fetch_assoc();         $authuser = new AuthUser(true, $data['id'], $data['username'], $data['authkey'],  $data['banned'] ? true : false);     }  //Here it returns nothing if the data contains an "ü,ö,Ä etc..." it is like the json_encode cannot convert the user object containing special chars to an JSON String     echo json_encode($authuser);      class AuthUser{         var $auth = false;         var $id;         var $username;         var $authkey;         var $banned;         function __construct($auth, $id, $username, $authkey, $banned){             $this->auth = $auth;             $this->id = $id;             $this->username = $username;             $this->authkey = $authkey;             $this->banned = $banned;         }     } ?>  Fixed by setting the mysqli connection encoding to UTF-8

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I would like to set things up that there are never more then three hyphenated lines in a row. Is there a command or parameter for this?

How can I reduce the number of consecutive lines ending in a hyphenation?  I have a very long document (600 pages) and need an automatic way to tell latex the maximum number of lines ending in a hyphenation. I have seen occurences with 4 consecutive lines with hyphenation, my publisher asks for no more than 3.  I use xelatex, koma-script, document-class: scrbook.   Edit: a small example with a german lorem ipsum plus extra long words. Please note that this might not be the most minimal, but I thought that e.g. small page sizes (as in my book) might contribute to the problem.  \documentclass[ 10pt,  openany,         paper=20.5cm:13.5cm, ]{scrbook} \areaset{10.3cm}{17.0cm}  \setlength{\oddsidemargin}{-13.4mm} \setlength{\evensidemargin}{-5.4mm}  \setlength{\headheight}{10pt} \setlength{\topmargin}{-13.4mm}   \linespread{0.958}\selectfont \setlength{\headsep}{0.4485cm} \usepackage[ngerman]{babel}      \usepackage{fontspec} \defaultfontfeatures{Numbers=OldStyle, Mapping=tex-text, Ligatures={Common}} \usepackage{xunicode} \usepackage{xltxtra} \setmainfont[]{Garamond} \setsansfont[]{Garamond}  \begin{document} Er hörte leise Schritte hinter sich. Das bedeutete nichts Gutes. Wer würde Quartzstaublunge  ihm schon folgen, spät in der Nacht und dazu noch in dieser engen Gasse mitten im übel beleumundeten Hafenviertel? Gerade jetzt, wo er das Ding seines Lebens gedreht hatte Amrolltreppenendeimwegsteher  und mit der Beute verschwinden wollte! Hatte einer seiner zahllosen Kollegen dieselbe Amrolltreppenendeimwegsteher Idee gehabt, Amrolltreppenendeimwegsteher ihn beobachtet Amrolltreppenendeimwegsteher und abgewartet, um ihn nun um die Früchte seiner Arbeit zu erleichtern? Oder gehörten die Schritte hinter ihm zu einem der unzähligen Gesetzeshüter dieser Stadt, und die Amrolltreppenendeimwegsteher stählerne Acht um seine Handgelenke würde gleich zuschnappen? Er konnte die Aufforderung stehen Amrolltreppenendeimwegsteher zu bleiben schon hören. Gehetzt sah er sich um. Plötzlich erblickte er den schmalen Durchgang. Blitzartig drehte er sich nach rechts und verschwand zwischen den beiden Gebäuden. Amrolltreppenendeimwegsteher Beinahe wäre er dabei über den umgestürzten Mülleimer gefallen, der mitten im Weg lag. Er versuchte, Allesvomtischschmeisser sich Amrolltreppenendeimwegsteher in der Dunkelheit seinen Weg zu Amrolltreppenendeimwegsteher ertasten und erstarrte: Anscheinend Fliegenindiesuppemacher gab es keinen anderen Ausweg aus diesem kleinen Hof Haareimbadverteilersystem als den Durchgang, durch den er gekommen war. Die Schritte wurden lauter und lauter, er sah eine dunkle Gestalt um die Ecke biegen. Fieberhaft Amrolltreppenendeimwegsteher irrten seine Augen durch die nächtliche Dunkelheit und suchten einen Ausweg. War jetzt wirklich  \end{document}


I want regex with at least 2 characters start with any alphabet or any  digit not matters.But It can accept - and _ . Ex : ABD , Abc_123 , 12, A-_ , A1 etc.

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


Let's say I have  on the board. He is a 2/2 that says:  Whenever another creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.  I play a . It says:  Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step.  The sacrifice portion is not important to this question. What is important is how these two cards interact with each other. Playing this card in my first main phase, assuming no counters or other shenanigans by my opponent, I will have my Commander and 3 tokens on the battlefield. What will happen in terms of the power/toughness of my tokens and Commander? Option A The tokens will be 1/1 each. They don't see each other come in at all. The Commander is 3/3, as one "enter the battlefield" trigger happens. Option B The tokens will be 1/1. They don't see each other come in at all, because they weren't on the battlefield to see any of the triggers. The Commander is 5/5, as he saw three "enter the battlefield" triggers occur. Option C The tokens will all be different, with one being 3/3 as he saw the other two come in, one being 2/2 as he saw only the last one come in, and 1/1 as the last one saw none come in. Option D The tokens will all be 4/4, as three creatures entered the battlefield this turn. I am obviously hoping for this option. It may be supported by a ruling on Goldnight Commander that says, emphasis mine:  The creature that entered the battlefield will also get +1/+1 until end of turn if it's still on the battlefield when the ability resolves.  The key being the ability resolving. So my thought is thus:  Thatcher Revolt goes on the stack. Thatcher Revolt resolves, and three separate "enter the battlefield" triggers go on the stack as the three humans enter the battlefield as 1/1. The last (it is a stack) "etb" trigger resolves. This puts an ability from Goldnight Commander on the stack. This resolves and the humans are now all 2/2. The next "etb" trigger resolves. This puts a new ability from Commander on the stack, and resolves with the humans being 3/3. The first "etb" trigger finally resolves, puts a Command ability on the stack, which resolves putting the humans at their final state of 4/4.  Option E The tokens will all be 2/2.  Thatcher Revolt goes on the stack. Thatcher Revolt resolves, and one single "enter the battlefield" trigger goes on the stack. The "etb" trigger resolves. This puts an ability from Goldnight Commander on the stack. This resolves and the humans are now all 2/2.  I would really like to have a complete understanding both of the result and how this result is calculated by the game engine.

There are many cards that can put multiple permanents onto the battlefield simultaneously, such as , , or .  How do these interact with the following types of abilities?  As [this permanent] enters the battlefield... You may have [this permanent] enter the battlefield as... [This permanent] enters the battlefield with... When [a permanent with certain characteristics] enters the battlefield...   Justification There have been many questions already about particular instances of this situation.  This question is intended to be a canonical question and answer to all questions such as:      Note to moderators: three of these five questions have already been marked as duplicates pointing to this one.  Can we do the same for the remaining two?


I'm doing a simple program and I'm using templates in C++ to implement a library with a few data types when I don't find the way to compile it.  The code is:  VectorT.cpp file:  template <class T> VectorT<T>::VectorT(){   elementos = NULL;   numElementos=0; }   VectorT.h file :  #ifndef __VectorT_h__ #define __VectorT_h__  template <class T> class VectorT{    private:      T * elementos;     int numElementos;    public:      VectorT(); };  #include "VectorT.tpp" #endif   And the compile way, with the error:  g++ -c -o obj/VectorT.o src/VectorT.cpp -I include/VectorT.h  g++: warning: src/VectorT.cpp: linker input file unused because linking not done   Any idea? Thank you so much.

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


Suppose that there is a hovercraft floating a few centimetres above the Earth's surface. As it is disconnected from the Earth, which is spinning from West to East, shouldn't it appear to move East to West to observers on the ground? Does this happen? If not, why not?

I was reading somewhere about a really cheap way of travelling: using balloons to get ourselves away from the surface of the earth. The idea held that because the earth rotates, we should be able to land in a different place after some time. As we all know, this doesn't happen.  Someone said that the reason why this doesn't happen is because the atmosphere (air, clouds etc.) also revolves around the earth (with the same angular velocity as the earth's rotation). Since we are also part of the atmosphere, our position doesn't change relatively.  Well, I'm not convinced with that answer. Why does the atmosphere rotate along with earth?  Gravitational force is towards the centre of the earth, but I don't see how it's making the atmosphere rotate.


Is there an equivalent to the birthday paradox for more than 2 messages.  Solving Hash(x) = 0 takes $2^{bits}$ steps on average  Solving Hash(x) XOR Hash(y) = 0 takes around $2 ^{bits/2}$ due to the birthday paradox.  Is there an algorithm that can solve Hash(x) XOR Hash(y) XOR Hash(z) = 0 in $2^{bits/3}$ steps (or similar)?  If so, does it get easier to find a solution if you add more terms?  [edit] The second post by Squeamish Ossifrage is what I was looking for, thanks.

Let $H:\{0,1\}^*\to\{0,1\}^n$ be a cryptographic hash function as a black-box, and suppose we have unlimited space.  As I understand, finding $x$ such that $H(x)=0$ (if such exists) would require a preimage attack, and avg. time $O(2^n)$ (linear in the size of the output). On the other hand, finding $x\neq y$ such that $H(x)\oplus H(y)=0$ could use the birthday attack, and therefore avg. time $O(2^{n/2})$.  My question is, if something better can be said for finding 3 (or more) distinct values $x,y,z$ such that $H(x)\oplus H(y)\oplus H(z)=0$. It seems clear that this could be done using less samples of $H$, but it's not clear to me if the time complexity could be improved.


Let X and Y be two $ \mathcal{N}(0, 1) $ distributions. I have to prove that for $(a,b)\in \mathbb{R}^2 $, $ aX + bY $ is equal to $\mathcal{N}(0, a^2 + b^2)$. I'm trying to do this using the characteristic function of a Gaussian distribution. $$ \phi_{aX + bY}(t) = \int_{\mathbb{R}}{ \mathbb{e}^{it(ax+by)}{\frac{1}{2} \mathbb{e}^{-\frac{x^2}{2}}} dx} $$ I don't really know what to do since by changing the variable I can't replace both x and y. Any sugestions ?

If $X_i$, $i =1,2$ are independent and have normal distribution with mean $0$ and variance $\sigma_i ^2$. Show that $X_1 + X_2$ has a normal distribution with mean $0$ and variance $\sigma_1^2 + \sigma_2^2$.  Any idea is appreciated.


Why some titles like  are styled that way?  What I mean is that usually, in English (and even in German and other Germanic languages, I suppose), the adjective is placed before the noun, so the most common form would be Royal Astronomer.  Placing the adjective after the noun is more common in Romance languages, like French or my own Italian (that in example would be Astronomo Reale).  I suspect that the reason is of contamination between languages, but are there other reasons why some titles use this particular styling, while other, even similar ones, like i.e. the , use the more conventional way?  I'm interested in both answers that address the generic placement of adjectives after the nouns, and in the more specific history of the styling of the title Astronomer Royal itself.

I would expect the term "inspector general" to be "general inspector" instead.    In part, that may be because I know the German variant as "Generalinspekteur" of "Generalinspektor".  But I'm pretty sure it would be like this without knowing the German word, just from general language intuition.  So, why does the order of words make sense?    It would be interesting how it came to be like that - but that would not answer it alone. (An answer to  indicates it may be a method distinguish titles from general desrciptions.)


Simple Question, I want to check if a specific package = sp, say gparted is installed on Ubuntu 16.04 server.

At our university we can get almost any ubuntu package installed we want, but we are not superusers ourselves (we need to request packages being installed).  With some libraries it is not always easy to know whether the package is already installed or not. Is there a simple way/command to check this?


I have a small office shredder which can destroy not only paper but also CDs and credit cards.  Can I use that to destroy an M2 SSD or will that break my shredder? In other words, are components of an M2 SSD "harder" or "softer" than a CD?

I need to make two hard drives unreadable. Unfortunately, I have some constraints which make this harder than usual (in particular, they rule out the answers to ):   I don’t have a computer to mount the drives and erase them (weird, right?) I don’t have a strong magnet I don’t have the right tools (screwdrivers …) to properly dismantle the drives I don’t have access to corrosive chemicals I don’t have a sledgehammer.   How can I destroy the drives with the least monetary / material requirements?  The only thing I can think of off the top of my head is to pinch off the connection pins, and perhaps destroy the circuit board using a small hammer.  I realise that given all the above constraints this may be too much to ask. I’m willing to settle for whatever I can get. I don’t have to fulfil legal obligations of data security, and the data on the discs, though personal, is not critical. I don’t want to prevent the FBI from reading my discs, just the next door wannabe MacGyver.


This is the searchview in MainActivity  searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {         @Override         public boolean onQueryTextSubmit(String text) {             return false;         }          @Override         public boolean onQueryTextChange(String text) {             servantAdapter.getFilter().filter(text);             //Toast.makeText(MainActivity.this,text,Toast.LENGTH_SHORT).show();             return true;         }     }); }   And This is the Adapter  public class ServantAdapter extends RecyclerView.Adapter<ServantAdapter.ViewHolder>implements Filterable { private List<Servant> mServant;  @Override public Filter getFilter() {//The front omitted...     return new Filter() {         @SuppressWarnings("unchecked")         @Override         protected void publishResults(CharSequence constraint, FilterResults filterResults) {             mServant = (List<Servant>) filterResults.values;             ServantAdapter.this.notifyDataSetChanged();         }         @Override         protected FilterResults performFiltering(CharSequence constraint) {             List<Servant> filteredResults = null;             if (constraint.length() == 0) {                 filteredResults = mServant;             } else {                 filteredResults = getFilteredResults(constraint.toString().toLowerCase());             }              FilterResults results = new FilterResults();             results.values = filteredResults;              return results;         }      }; } protected List<Servant> getFilteredResults(String constraint) {     List<Servant> results = new ArrayList<>();      for (Servant item : mServant) {         if (item.getName().toLowerCase().contains(constraint)) {             results.add(item);         }     }     return results; }   Why when I run this program and imput something in the searchview the program is shut dowm and ReportErrors java.lang.NullPointerException: Attempt to invoke virtual method 'android.widget.Filter com.example.a76959.tired.ServantAdapter.getFilter()' on a null object reference  But if I use the Toast in the code ,the program can run regular and toast the message what I input（I didnt take the searchview in Toolbar or ActionBar,I only put it on the top of recyclerview in MainActivity.xml,I don't know if it has any effect ） Who can help me...(Thanks for read my poor English Orz..)

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


I wish to validate a 10 digit phone number, and allow for up to four spaces in between each numeric segment, in CakePHP. How might I do this?  Examples of valid input:   04 123 123 34  0266 234 234  0266123123 02 66 55 12 12

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.


I made a categorized symbology on a shapefile, but the color value of outline (stroke color) is different than the color of fill color option. How can I ensure that both colors are the same for fill color and outline color using categorized symbology? See an example below.

In the past I have just manually matched the color of the border to the color of the fill, but this can be time consuming.   I am wondering, is there any way to have the program automatically match the border color to that of the fill?   The fill color is being assigned through the styling tab in layer properties.  Using QGIS 2.8.6


For example, should we write the dimension of mass, e.g. $\mathrm{kg}$  as $[M]$ or is it enough to write it as $M$?

One of the most useful tools in  is the use of square brackets around some physical quantity $q$ to denote its dimension as  $$[q].$$  However, the precise meaning of this symbol varies from source to source; there are a few possible interpretations and few strict guidelines. What conventions are there, who uses them, and when am I obliged to follow them?


I am trying to loop through a directory to search all xml files. I got this accomplish by doing Directory.EnumerateFiles and by finding every .xml type. The thing is now, there are some random xml files that are empty with no information written in them. I want to check for all files that do not have any information in them.  Code  foreach (string file in Directory.EnumerateFiles("/xmlFiles", "*.xml", SearchOption.AllDirectories)) {     //Find the XML File     XDocument doc = XDocument.Load(file);      //Check if the XDocument doc has no root element      if (doc == null)     {         Console.WriteLine(File + " has NO root element");     }     else     {         Console.WriteLine(File + " has a root element");     } }   I tried doing a if else statement comparing the file to null after parsing the xml file but I get a error when loading my file before I can compare it.  Error: System.Xml.XmlException: 'Root element is missing.'

I'm loading an XML document in my C# application with the following:  XDocument xd1 = new XDocument(); xd1 = XDocument.Load(myfile);   but before that, I do test to make sure the file exists with:  File.Exists(myfile);   But... is there an (easy) way to test the file before the XDocument.Load() to make sure it's a valid XML file?  In other words, my user can accidentally click on a different file in the file browser and trying to load, say, a .php file causes an exception.    The only way I can think of is to load it into a StreamWriter and simple do a text search on the first few characters to make sure they say "  Thanks!  -Adeena


I recently flagged a comment as unfriendly/unkind, but after returning to it after some time, I think I may have made a mistake.  So can we be allowed to unflag comments?

I misread the content of a comment, and flagged it. Then I realized that the comment wasn't what I had initially thought. Would it be possible to have the ability to retract comment flags, just like we have the ability to retract flags on questions and answers?  I'm aware of this  . But the answer there is just that it's not possible. At the time it was not possible to retract any flags.   This is a separate  which requests that it may become possible to retract comment flags.  If I've realized a flag was a mistake, I think it's unnecessary to keep it in the queue of content the moderators have to look at. Also, it would add an unnecessary "rejected" to the flaggers statistics. Sure, people should think before they flag. But everyone makes mistakes sometimes.


My son asked me this question and checking the web revealed some rules but none of them handle all sorts of exceptions. How do I teach my son this usage ?  Deadrat earlier answered "Encourage your son to read voraciously". Agreed, this is true and comes through experience, but now that I committed to him that I will give him some answer, I ended up trying this forum to get an answer that is explainable to a 6 year old kid.

I almost hesitate to ask this, because it is hard to believe no one else asked it; but it isn't showing up in the "similar titles" list.  What is special about 'C' that switches the 'IE' immediately following it?


In this scene, I want the blue disk to be invisible to the camera, hide the part of text that disk covers while keeping the plane all visible.

I am animating objects that will be rendered with video footage in the compositor. My difficulty is how to apply a mask so that the objects disappear when they expand past a certain point.  Objects within circle mesh should be visible   Objects outside of circle mesh should be invisible   Current nodes set-up for object materials:   What masking options are at my disposal to achieve this effect, and how can I apply them?   Thanks for any insights.


Lots of planets seem to have only one or two locations where the action takes place -  Naboo: Theed Tatooine: Mos Espa / Mos Eisley Iego: The city where Jaybo lives Bespin: Cloud City  Is this the equivalent of aliens always managing to find either New York or London in Earth sci-fi? i.e. It discounts the vast majority of civilised areas in favour of one or two population centres. Or is it a result of planets being colonised by small settlements, and the resulting populations being fairly central? e.g. The coastal cities of westerners in early Australia.

Did all the humans in the Star Wars universe originate on a single planet some time in the distant past, or did they originate on different worlds and intermix into one species over millenia?  This is specifically about only humans, not humanoid aliens. I would prefer answers from the main canon or EU canon.


I have been always mixing these two notations, regarding them both as a string in Python.   What are the differences between them?   Under what circumstances can we only use one of them?

According to the documentation, they're pretty much interchangeable.  Is there a stylistic reason to use one over the other?


I have applied to a very well-known institution for PhD in Europe. They evaluate students first and then match them with advisors, so this is not a position with a specific supervisor; an admission committee will decide, not a single supervisor. I am thinking about an interview that one will have with them. This university has almost the best group in my field and is extremely famous for it. It’s obvious that many students, who are interested in this field, want to study there. I was thinking about the following question in their interview, and how I should answer? “Why did you decide to apply to this institution/Why in particular this university?” I am having a hard time in preparing an honest while strong answer to this question. The problem is that, as I said, it’s obvious they’re good and I think they aren’t interested in hearing this from an applicant. At the same time, that’s basically my reason for applying there: since there are great professors there, very talented students, etc. On the other hand, their research is very specific and I believe they do not expect from a candidate to show off with “knowing” their research in “detail”. I know what they are doing, I believe it is important and valuable, and it matches with my interest as my background shows. However, I cannot prove to them by examples or other ways I know in details what they are doing since that’s not right. My question is this: What is your suggestion to me? Should I start reading their research in detail to be able to make specific examples to support my reasons for applying to their group? I am a bit puzzle about this. Please if you think more information is needed leave a comment before writing an answer. Thanks a lot!

Whenever somebody asks me "why are you interested in joining my research group", I find myself helpless. What are the usual points or aspects I should talk about in reply of this question?


So guys I need to find the limit of:     $\displaystyle\lim_{n \to \infty}\left(\sqrt{n^2+2n+5}-n\right)$   The quadratic equation is hard to factorise and I really struggle to answer these questions.  Do I need to use the limit comparison test after I simplify this?

This is being asked in an effort to cut down on duplicates, see here: , and here: .    What methods can be used to evaluate the limit $$\lim_{x\rightarrow\infty} \sqrt[n]{x^{n}+a_{n-1}x^{n-1}+\cdots+a_{0}}-x.$$  In other words, if I am given a polynomial $P(x)=x^n + a_{n-1}x^{n-1} +\cdots +a_1 x+ a_0$, how would I find $$\lim_{x\rightarrow\infty} P(x)^{1/n}-x.$$  For example, how would I evaluate limits such as $$\lim_{x\rightarrow\infty} \sqrt{x^2 +x+1}-x$$ or $$\lim_{x\rightarrow\infty} \sqrt[5]{x^5 +x^3 +99x+101}-x.$$


In Analysis this past week, we touched upon indeterminate forms which included some talk on undefined terms. One of the forms that got my attention was $0^0.$ Some of my colleagues argued that the best definition was $0^0=1$ since it made it easier to prove other theorems. The proof they gave me was this: $$1=(0+1)^1$$ $$= \binom{1}{0}\times0^1\times1^0+\binom{1}{1}\times0^0\times1^1$$ $$= 1\times0\times1+1\times0^0\times1$$ $$= 0^0.$$ Thus by Binomial Theorem and transitivity, $$1=0^0.$$  My problem with this is that it can easily be disproven by a counterexample (or so I think). Observe similarly, $$2=(0+2)^1$$ $$= \binom{2}{0}\times0^2\times2^0+\binom{2}{1}\times0^1\times2^1+\binom{2}{2}\times0^0\times2^2$$ $$= 1\times0\times1+2\times0\times2+1\times0^0\times4$$ $$= 0^0\times4.$$ Thus, $$2= 0^0\times4$$ $$\implies \frac{1}{2}=0^0.$$ But if $0^0=1$ then it follows that, $$2=4.$$ But this is a contradiction. Therefore $0^0\neq1.$  Would this work? Or did I do something wrong?  P.S. THIS IS NOT A DUPLICATE. I did check out the other link but the closest answer (which is not satisfying for me) was by celtschk. But celtschk said, "Therefore the definition $0^0=1$ is the most reasonable one" which I disagree and I have shown my reason above. If I made a mistake or am wrong, I hope someone will charitable point it out.

Could someone provide me with a good explanation of why $0^0=1$?  My train of thought:  $x>0$  $0^x=0^{x-0}=0^x/0^0$, so  $0^0=0^x/0^x=\,?$  Possible answers:   $0^0\cdot0^x=1\cdot0^0$, so $0^0=1$ $0^0=0^x/0^x=0/0$, which is undefined   PS. I've read the  on mathforum.org, but it isn't clear to me.


Given the following definition of a periodic function:  $$\exists P, P > 0, f(x + P) = f(x)$$  It is possible to argue that $f(x)=k$ ($k$ being a constant) is a periodic function, since you can define $P$ to be any given constant within the real numbers and the definition would be valid. ($f(x + P) = f(x)$ will always be true if $P\in \mathbb R$).  So my question is, can a horizontal line be considered periodic, even when its period is ambiguous?

I am not getting satisficatory explanation for this. Clearly $f(x+T) = f(x)$ for all values of $T$.  If we assume it is periodic, does this mean period =  $0$?


I have a template class defined like this:  closedlist.h  template <typename T> class ClosedList { public:     // …      bool isEmpty () const { return (size() == 0); }      T first () const;     T pop_first ();      void push_back (const T &value);     ClosedList& operator << (const T &value) { push_back(value); return *this; }      int size () const { return _size; }  private:     // … };   Then, I have defined the functions in another file, like this:  closedlist.cpp  #include "closedlist.h"  template <typename T> T ClosedList<T>::first () const {     // …     T elem;     // …     return elem; }  template <typename T> T ClosedList<T>::pop_first () {     // …     T elem;     // …     return elem; }  template <typename T> void ClosedList<T>::push_back (const T &value) {     // … }   If I change the method implementation, e.g. adding or removing the const behind it, g++ shows me an error that the method does not match any prototype. So I guess g++ finds the correct prototype for the function. But I get these errors:  obj/someclass.o: In function `SomeClass::doSomething()': src/someclass.cpp:231: undefined reference to `ClosedList<Solution>::pop_first()' src/someclass.cpp:326: undefined reference to `ClosedList<Solution>::push_back(Solution const&)' obj/someclass.o: In function `ClosedList<Solution>::operator<<(Solution const&)': include/closedlist.h:69: undefined reference to `ClosedList<Solution>::push_back(Solution const&)'   Note: I read  but since the question is from 2009 and I'm using C++11 I'm wondering if this is still like that. Other web pages showed like  (sorry it's in German) shows code where the members are defined outside of the class definition.

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


For example, when I use the command (in Overleaf/ShareLaTex):  \begin{figure}[H]     \centering     \includegraphics{some_graphic}     \caption{some_caption}     \label{fig:some_label} \end{figure}   the \includegraphics{} comes without the [] parameter to change the size of the image, and \begin{figure} without the [H] option by default.   Is it possible to renew the command to make it default? By that I mean that when I type the \begin{figure} command it adds the [H] and [h] as well as [width=\textwidth] in the \includegraphics command, rather than making a global change in the preamble e.g.

Is it possible to change the default width of an image included via \includegraphics (from the graphicx package) to a custom value, for example \linewidth.  So I want something like this:  \documentclass{article}  \usepackage[draft,width=\linewidth]{graphicx}  %or something like \setglobalimagewidth=\linewidth  \begin{document}  \includegraphics{test1} %width=\linewidth \includegraphics[width=4cm]{test1} %width=4cm   \end{document}


I have this problem:  Find a contnuous function $f$ such that:  $$\int_0^x f(t)\,dt = (x-1)e^{2x} + \int_0^x e^{-t} f(t)\,dt$$  and it's required to find $f(x)$ so $$ \int_0^x f(t)\,dt  -  \int_0^x e^{-t} f(t)\,dt= (x-1)e^{2x} $$ here I differentiated both sides and factor $f(x)$ on the left $$ f(x)\cdot (1-e^{-x})= 2(x-1)e^{2x}+e^{2x}$$ $$f(x)= \frac{2(x-1)e^{2x}+e^{2x}}{(1-e^{-x})}$$ but the answer appointed is  $$f(x)= \frac{(1-2x)e^{2x}}{(e^{-x}-1)}$$ did I mess up somewhere or am I lacking some algebra work here? here is a similar question alredy answered

I do not understand how to perform this exercise:     If $f$ is a continuous function such that:$$\int_0^xf(t)\ dt=(x-1)e^{2x}+\int_0^xe^{-t}f(t) \ dt$$ For all $x$, what function $f$ results?


I need to prove that if $X$ and $Y$ are iid $N(0,1)$ random variables, then $U=\frac{X Y}{\sqrt{X^{2}+Y^{2}}} \sim N(0,1 / 4)$. I know that:  $U=\frac{\left(\frac{X+Y}{2}\right)^2-\left(\frac{X-Y}{2}\right)^2}{\sqrt{X^2 + Y^2}}$; $\left(\frac{X+Y}{2}\right)^2, \left(\frac{X-Y}{2}\right)^2$ follows a chi-squared distribution with parameter 1; $X^2 + Y^2 \sim \chi_2^2$ follows a chi-squared distribution with parameter 2. But I don't know how to move forward from this or even if this is the right path.

It is given that $X,Y \overset{\text{i.i.d.}}{\sim} N(0,1)$  Show that $\frac{XY}{\sqrt{X^2+Y^2}},\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}} \overset{\text{i.i.d.}}{\sim} N(0,\frac{1}{4})$  I was thinking of making polar transformations $X=r \cos \theta, Y=r \sin \theta$  Then I am getting stuck at ranges of $\theta$


What I have learnt that we use "among" when we are talking about more than two, and "between" for two.   But  1 Between the students in the class which is the best?  2 The U.N.O. insists on better understanding between the countries of the world.   3 There is a treaty between the five great power.  But in these sentences "between" is used. There are many more examples like this. When we use "between" for more than two things or people. Can you explain the reason behind this?  Thank you

Consider the following two versions of a question:1   Version 1: What is the difference in meaning between "[to be] not invited" and similar negation forms?  Version 2: What is the difference in meaning among "[to be] not invited" and similar negated forms?    Personally, I think Version 1 might subtly suggest a Star Topology (see below) with the target sentence "[to be] not invited"at the center.  And Version 2 might subtly suggest a more free-form comparison like the Mesh or Fully Connected, with the target sentence simply "one among many":   Between approx equal "Star" and among approx equal "Fully Connected"?  Don't get me wrong: I do think this is quite subtle, not always applicable, and I don't think anyone would intuit such a "network topology" meaning without further explanation.   So the main question is, are both grammatically correct?  If yes, is there a semantic difference to choose one over another, perhaps as I suggested?  Or does the plurality aspect of between and among trump other semantic and stylistic issues?    1. In my question , another user provided a very helpful edit. However, the change of the word between to among prompted this question.


I overstayed my 90 day stay in South Africa by 2 days before leaving for Namibia. The officials wanted me to sign a one-year ban which I did not sign.   I now need to re-enter South Africa again only 24hours later. Is that possible?

I arrived in South Africa from Australia at the end of october, so I have 3 months in the country, but in december I left the country for a month and recently re-entered thinking I would get another 3 months. But they didn't give me the extra 3 months because they said I had to return to South Africa, so they only gave me the stamp for 3 more weeks, counting the 3 months from when I first entered.  Does anyone know if this is a new rule that you have to go back to where you came from? Because I thought I would get another 3 months as that is what happened with most people I know that didn't get a visa, and now it is too late to get a visa or an extension, does anyone know what will happen to me if I don't leave in 3 weeks and keep my original ticket which was 3 months?


I answered a question 8 seconds after a moderator had closed it. I thought answers on closed questions were not allowed. Is this a bug, or is it something special with mod-deleted questions?  is the question. I'm not sure if I can get the exact times of closure and answering, but I saw that when the question was under a minute old, I answered after the question had been closed

Question:   Answer:   The question was closed at 11:57:57 (according to the hover-over-"x-mins-ago" bar) and the answer was posted at 12:16:35. It's a fairly lengthy answer, so it's possible that it was started to be written before it was closed but I swear I've started to answer a question then I got a banner along the top saying "this question has been closed" and the answer was no longer post-able.


I have slow internet connection, when I watch online TV I'm trying to close those apps and processes on my Mac that use internet.   Besides the intuitive way (close skype, browser tabs, dropbox, etc) how to identify what apps are using internet?

I think I remember a command line utility that did this, but I can't remember what it's called and a few Google searches turn up nothing.


Is the use of comma before "and" in the following sentence correct?  Interviews are by invitation only, and conducted during the admissions review process.

I apologize in advance for any and all wrong use of terminology.  Consider a sentence of the form      The project was created to practice X and learn Y.   I believe the "practice X and learn Y" is a compound predicate and so there should be no comma before the "and". However, I get confused if X is a list. If I simply replace the X by "V, W, and X", I get      The project was created to practice V, W, and X and learn Y.   Is this correct? It looks strange to me, and I'm not so sure since the "X and learn Y" could be read as a single item? I was going to write a similar sentence, and I wrote it as     The project was created to practice V, W, and X, as well as to learn Y.   However, if the "as well as" is just a placeholder for "and", then isn't the comma before "as well as" wrong, since it "splits a compound predicate"?  Any help is appreciated. Thank you for your time and have a great day.


I have LAMP server installed on my system and it is working perfectly. However, I am very curious to know why we need not start Apache server in LAMP. When we have WAMP on Windows, by contrast, we have to start it and activate Apache and MySQL. Does Apache start as we start Ubuntu (i.e., it always runs in the background) or does it start when we open localhost?  The answers to the question "" describe how to start LAMP manually, but not how it works internally to start LAMP automatically.

I setup a LAMP server on my desktop Ubuntu install for testing web applications. How do I set it to only run when I tell it to rather than at startup? It is not used as a production web server but instead for testing PHP scripts I write before pushing them to my public web server.


I want to ask about online stores such as Amazon, Newegg, erc. and I don't know on which Stack Exchange website I should ask such questions.  I need to ask about buying a laptop and which website will be better and some other questions.

I just got a question closed because it was rendered subjective by the moderators. The question is important to me and I believe other people would benefit. So, I ask the following non subjective question: on which site of the Stack Exchange ecosystem should I post  question?


I have been using/testing the Android smartphone application for the past few days and I must say I really like the whole experience.  The one thing I would like to request is to add the functionality to allow users(obviously with enough reputation) to perform the review tasks from the smartphone application only.  I am suggesting this as I feel that its still a lot easier and handy for a user to perform a review from the application than writing a complete answer,so it will add more value to the app too.

I know there are some similar posts on adding review queues to the mobile web page. However, this is regarding the Stack Exchange Android app. I really would like to review posts and edits from the Android app, however this isn't included in the app yet. I'm not sure how it would be implemented; maybe there could be a button or something for review. Could we please see this?


i am new android developer who developing a persian real estate android project.i have a form which inserts new estate to mysqli table using php file.but when i use persian characters in every field of that  form it actually inserts null values to every fields of table.but when i use english characters it inserts to the table completely! for example here is my english characters json sent from android :  {"price":"5668845555","address":"ssfghhvcxdd","phoneNumber":"544585533","bedRoom":6,"describtion":"fdstghgccff","isForSale":"rent","isCommertial":"not commertial","meter":545,"image":"android.graphics.Bitmap@c10755a"}   and this is included persian characters json sent from android:  {"price":"5668845555","address":"بلاتذزییبغاتتاا","phoneNumber":"544585533","bedRoom":6,"describtion":"یباننترلبقثس","isForSale":"rent","isCommertial":"not commertial","meter":545,"image":"android.graphics.Bitmap@c10755a"}   while both json's is completely correct the json with persian characters dont inserts to table correctly!  this is my php file:  <?php  define("SERVER_NAME", "localhost"); define("USER_NAME", "root"); define("PASSWORD", ""); define("DATABASE_NAME", "mydb");  $conn = mysqli_connect(SERVER_NAME, USER_NAME, PASSWORD, DATABASE_NAME);   header("content-type: application/json;charset=utf-8");    $jsonContent = file_get_contents('php://input'); mysqli_set_charset($conn, "utf8"); utf8_encode($jsonContent);   $arrayContent = json_decode($jsonContent,true);   $price = $arrayContent["price"]; $address = $arrayContent["address"]; $phoneNumber=$arrayContent["phoneNumber"]; $image=$arrayContent["image"]; $meter=$arrayContent["meter"]; $bedRoom=$arrayContent["bedRoom"]; $isCommertial=$arrayContent["isCommertial"]; $isForSale=$arrayContent["isForSale"];  $describtion=$arrayContent["describtion"];     // Check connection if ($conn->connect_error) {     die("Connection failed: " . $conn->connect_error); }  $sql = "INSERT INTO estates (price,address,phoneNumber,image,meter,bedRoom,isCommertial,isForSale,describtion) VALUES ('$price','$address','$phoneNumber','$image','$meter','$bedRoom','$isCommertial','$isForSale','$describtion')";  if ($conn->query($sql) === TRUE) {     echo "Estate added successfully"; } else {     echo "Error: " . $sql . "<br>" . $conn->error; }   $conn->close(); ?>   and this is what mysql table looks like after these two json's    and i have to say that all of my fields collation is utf8_persian_ci   so what do you think is my mistake? thank you  Problem Solved!  by using String Formatter Class in android i sent json in right way to php!    public class StringFormatter {      // convert UTF-8 to internal Java String format     public static String convertUTF8ToString(String s) {         String out = null;         try {             out = new String(s.getBytes("ISO-8859-1"), "UTF-8");         } catch (java.io.UnsupportedEncodingException e) {             return null;         }         return out;     }      // convert internal Java String format to UTF-8     public static String convertStringToUTF8(String s) {         String out = null;         try {             out = new String(s.getBytes("UTF-8"), "ISO-8859-1");         } catch (java.io.UnsupportedEncodingException e) {             return null;         }         return out;     }  }

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I'm creating a list of all countries and major cities in the world. The list has about 7000 nodes including countries, states and cities. It seems like this: United States - California - Los Angeles  And I need to search locations by keyword. I've created a XML file to store them, the file is about 300kb and average query time is 30-40ms. But now I need to search locations by multiple languages, so I must extend the file which is a problem. I like the convenience of reading XML directly but I need the extensibility of database. I wonder which one I should use to store data like these that don't change often but need to be queried?

I've been working on database-driven web applications for a few years now and recently took on a project involving a CMS that is XML-capable. This has led me to think about the usage of XML/XSLT in general and in what situations it would be more useful than the approach I've always used, which is storing all of my data in a (My)SQL database and then using PHP/Python/etc. to work with it on the web as needed.  There's obviously something I'm not "getting" here.. could anyone give me examples of applications where storing the data in XML files instead of in a database would be preferable?


There are five identical bins contains 4, 9, 7, 10, and 3 coins. How many ways to select 12 coins, such that at least a coin selected from each bins?  I don't have an idea. But, i thinks it is related to integer partition of 12 (with 5 parts).  At a glance, this question looks similar to other question asked by another user. But if you look at it carefully, you will notice that there is a big difference. It is the bins, here, it is identical.

There are five boxes consisting of several identical coins. The first box contains 4 coins, the second box contains 9 coins, the third box contains 7 coins, the fourth box contains 10 coins, and the fifth box contains 3 coins. Some coins are taken from the boxes such that at least a coin taken from each box. In how many ways in taking the coins, such that the numbers of the coins taken are 12?  My attempt was solving it using repetition combination of which, there are only seven coins remaining considering that at least a coin taken from each box. By using the repetition combination, i.e. taking 7 from 9 (five boxes and four borders), resulting in 36 ways. However, there is no 36 ways in the choices.


This has surely been asked before but I think I don't know the correct terms to search for. What I want is in my custom panel, sliders for changing the active camera's location and rotation. Basically, I get this easily with:  def draw(self, context):     layout = self.layout     scene = context.scene      cam = context.scene.camera      layout.label(text="Location:")     layout.prop(cam, "location", slider=True, index=0, text="X")     layout.prop(cam, "location", slider=True, index=1, text="Y")     layout.prop(cam, "location", slider=True, index=2, text="Z")     layout.label(text="Rotation:")     layout.prop(cam, "rotation_euler", slider=True, index=0, text="X")     layout.prop(cam, "rotation_euler", slider=True, index=1, text="Y")     layout.prop(cam, "rotation_euler", slider=True, index=2, text="Z")   However, this ends up in a slider with no limits (limits are number ranges of computer, I think), so a slight change in the slider will result in massive change in position/rotation of camera.   Actually, what I really want to achieve is a copy of the sliders like they appear in the "Item" tab when I select the camera. Anyone able to help me there with links to other threads or questions or a direct solution?

So if I have this custom panel in the 3D view, is there a way I can take a property from for example the properties window and paste it onto my panel below the "text" prop, without creating a new property?  The reason I do not want to create a new property is because I want them to share all data, such as values, keyframes, drivers etc.        bl_info = {     "name": "",     "description": "",     "author": "",     "version": (0, 0, 1),     "blender": (2, 70, 0),     "location": "",     "warning": "",      "wiki_url": "",     "tracker_url": "",     "category": "" }  import bpy  from bpy.props import (StringProperty,                        BoolProperty,                        IntProperty,                        FloatProperty,                        FloatVectorProperty,                        EnumProperty,                        PointerProperty,                        ) from bpy.types import (Panel,                        Operator,                        AddonPreferences,                        PropertyGroup,                        )   class inouse_Settings(PropertyGroup):      my_bool = BoolProperty(         name="Enable or Disable",         description="A bool property",         default = False)     class UV_OT_my_panel(Panel):     bl_space_type = 'VIEW_3D'     bl_idname = "UV_OT_my_panel"     bl_label = "Custom"     bl_category = "Custom"     bl_region_type = 'TOOLS'      def draw(self, context):          scn = context.scene         mytool = scn.inhouse         layout = self.layout          col = layout.column(align=True)         row = col.row(align = True)         row.prop(mytool, "my_bool", text="Text")       def register():     bpy.utils.register_module(__name__)     bpy.types.Scene.inhouse = PointerProperty(type=inouse_Settings)  def unregister():     bpy.utils.unregister_module(__name__)     del bpy.types.Scene.inhouse  if __name__ == "__main__":     register()


I have a panasonic G85 with Lens LUMIX G VARIO 12-60mm / F3.5-5.6 ASPH. / POWER O.I.S. How do I find the right ND filter for this lens? I'm new to photography and really confused about this.   Closest Focusing Distance0.20m / 0.66ft (Wide), 0.25m / 0.82ft (Tele) Maximum magnification Approx. 0.27x / 0.54x (35mm camera equivalent) Diagonal Angle of View84.05°(Wide) to 20.44°(Tele)  General Filter Sizeφ58mm / 2.3inchMax.  Diameterφ66.0mm / 2.6inch

I've seen a few related posts on the site but nothing specifically on this point:  I'd like to be able to take long exposure photos during daylight (like the examples in ). I'm told that you can do this by using a neutral density filter. So my question is: what is a neutral density filter exactly, and how is it used to achieve that smooth long exposure effect?


I want to transfert my PC minecraft world to Xbox. It has command blocks that do various things like teleporting. My questiln is, can I convert, and will the command blocks still work?

I would like to know if the same Minecraft account used on a computer can be used on a different platform like the Xbox 360? I am not asking about playing on each simultaneously as each platform has been purchased - I am asking if you can cross play on multiple platforms with the same account. Basically I would like to know if all the saved stuff and settings from one platform will carry over to another.


Prove that for for $a_k>0,$ if $\sum a_k^2$ converges, then $\sum \frac{a_k}k$ converges. I was given this in an introductory calculus class, where I was only taught the basic convergence tests. I’ve tried limit comparison, power series, direct comparison, all to no avail. I have tried proving the contrapositive, using integrals as well, but the limit comparison with any series I’ve tried just goes to 0 or infinity which is inconclusive. My searches on MSE just yield the simpler problem of “if$\sum a_k$ converges then prove $\sum a_k^2$ converges“, and searches on google turned up nothing. Thank you for any help.

Let $a_1,a_2,a_3,\ldots$ be reals. Prove that if $\sum_{n=1}^{\infty} a_n^{2}$ converges, then so does $\sum_{n=1}^{\infty} \frac {a_n}{n}$.   For this I have shown the case for when $ a_n^{2} \le\frac {|a_n|}{n}$ $\Rightarrow$ $ |a_n|\le\frac {1}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le \frac{1}{n^{2}}$ and we know that $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges and hence $\sum_{n=1}^{\infty}\frac {a_n}{n}$ converges by the comparison test. Now considering $ a_n^{2} \ge\frac {|a_n|}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le a_n^{2}$ $\rightarrow$ combining the two cases for any n we have: $\frac {|a_n|}{n}\le\frac{1}{n^{2}}+a_n^{2}$ Hence using the comparion test again we know that $\sum_{n=1}^{\infty} a_n^{2}$ converges and $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges hence the sum converges so we can conclude that $\sum_{n=1}^{\infty} \frac {a_n}{n}$ is absoluetly convergent $\Rightarrow$ convergent.  Not to sure if this is correct, any help would be much appreciated, many thanks.


This question is ALL over ubuntu, with MODS saying its duplicate, but I have found no good answers!  I want to run the command, (this will work for script as well)  sudo service deluged restart   at boot after everything is done, IE: last thing to run  I first found this post, marked duplicate    Which seth blocked from future help and linked to this post    First off, I run a server, not a desktop (Which is what the linked "duplicate" guide shows you), so I can only use CLI based guides. Second those are 2 different questions.  Then there is this post    Marked as duplicate and linked to this question which may answer his specific question, but does not answer the question, run a command at boot.    Anyway, there is more!, but what I am getting at is I know what I want is just ONE example of how to do this via CLI and simple. I am not a coder, but I can read code and edit it to suit my needs and understand it, i just can't create it so to speak.  As another mod (takkat) has said, this is a duplicate of a question relating to    but again my point is that this post, i am using  sudo service deluged restart  as an example on how to run a command/script at boot, not troubleshooting why a service is not runnnig. While rc.local may serve as a dirty fix for a problem i have,  it can be used in a lot of other situations.   please try to answer the question directly, not give me links to what you think might help, and if it is a duplicate then link to a cli guide that covers HOW TO RUN A COMMAND/SCRIPT AT BOOT, because CLI guides can be used by both desktop and server users of Ubuntu.

How can I run scripts automatically when Ubuntu starts up so I don't have to run them manually after startup?


For example, I've have just solved some problem on my own. I believe my solution might be quite useful to others (and myself in the future), like a KB article.   Should I post it as question and answer it myself and mark as community wiki? I'm not interested in extra points in this case.

I showed up here to write a perfectly normal rant about misaligned pixels, and there's a big fat checkbox cluttering up the "Ask" page:    WHAT THE EEEEK IS THIS NEW ABOMINATION?


If I pass a vector by reference to a function:  void QuadraticInterpolateArray(vector<double> &b) {     double step = 12.2;     for (int j = 0; j < b.size(); j++) {         b[j] = step;     } }   I don't need later to deference b when I need to access to its value by using operator []. Instead, if I pass vector by pointer:  void QuadraticInterpolateArray(vector<double> *b)   I need (*b)[j] later.   In both case I'm passing the "address" of that vector. Why with reference it works and with pointer doesn't? Its just by design?

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


Simple regex question on extracting comments with linebreaks:  String:     <description language="de">Diese Tabelle zeigt die Zugangswege der Besucher auf die Website</description>     <options>       <!-- Hier stehen die Optionen für den View, die sich nicht auf colums beziehen.            Bisher gibt es da nix, kann aber mal nicht schaden das vorzusehen  -->    </options>      <defaultcolumn>       <!-- Hier können für Basiswerte für alle Spalten definiert werden.             Die Spaltendefinition weiter unten gibt die Möglichkeit die Werte je Spalte zu überschreiben            Welche Optionen es gibt (incl. Titel, Description und Emptycelltext) siehe "allvaluescolumn" oben.        -->       <options>          <option name="align" value="left"><!-- (left|center|right), default left --></option>   My regex attempt:  /<!--(.*)-->/   This extracts all one-line comments.   Question:  How do I get all comments?  Also the multiline ones? Adding \n or \r\n\ did not succeed.  <!-- get me (linebreak) me also -->

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


By a contradiction. Then prove that there is also no nonzero rational solution.    I'm lost in my first proof course. I appreciate any help.

Suppose we wish to prove that the square root of two is irrational. We begin by assuming that it is rational.  Namely, where both $a$ and $b$ are integers $$\frac{a}{b} = \sqrt 2  % MathType!MTEF!2!1!+- % faaagCart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj % 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x % bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq % pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa % aiaabeqaamaabaabaaGcbaWaaSaaaeaacaWGHbaabaGaamOyaaaacq % GH9aqpdaGcaaqaaiaaikdaaSqabaaaaa!31D3! $$  Why is it so important that both $a$ and $b$ be coprime and the fraction be irreducible?  That is, if $a$ and $b$ are not coprime and the fraction is indeed reducible, then$$\frac{a}{b} \ne \sqrt 2  % MathType!MTEF!2!1!+- % faaagCart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj % 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x % bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq % pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa % aiaabeqaamaabaabaaGcbaWaaSaaaeaacaWGHbaabaGaamOyaaaacq % GHGjsUdaGcaaqaaiaaikdaaSqabaaaaa!3294! $$


I want to resize my picture, but there is always an error with displaying it.   How can I do it?    public class Panel extends JPanel {      private ImageIcon imgIcon;       public Panel(){         super();         File imageFile=new File("mar.jpg");          try {             BufferedImage bi = ImageIO.read(imageFile);             ImageIcon imgIcon = new ImageIcon(bi);             imgIcon = new ImageIcon(bi.getScaledInstance(400,400, Image.SCALE_DEFAULT));                 } catch (IOException e) {             System.err.println("error");             e.printStackTrace();         }          Dimension dimension=new Dimension(1400,1000);         setPreferredSize(dimension);     }     @Override     public void paintComponent(Graphics g){         Graphics2D g2d=(Graphics2D)g;         g2d.drawImage(imgIcon.getImage(),0,0,this);     } }

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


We have developed a App that uses GCM push, that seems that needs Google Play Services (Google account).  Customer has 100-200 devices, it it possible to use the same google account in all devices? Gmail will be inactivated, and buy apps to Market will be disallowed.  Aditional info: We have proposed Google for Work, but Customer is not interested at this moment

Many schools are looking at using Android tablets in classrooms.  Some have classroom sets of 35-40 tablets.  As a means to manage apps, having them tied to a single Google Play account would be ideal.  Is there a maximum number of devices allowed?    This setup would also be cost effective, if the school uses any pay apps, as the app is linked to the account, not the devices.  Does anybody have any experience or knowledge beyond, "I have 5 devices in my family all synced and it works."?


$\partial(y^T*A*x)/\partial(x)$ for the expression above I did the steps: $A*x = u \\ y^T*u = z \\ => \partial(z)/\partial(x) = \partial(z)/\partial(u)*\partial(u)/\partial(x) \\ =y^T*A $ but  this site says  $\partial(y^T*A*x)/\partial(x) = A^T*y$ Which one is True? Sorry for my grammatical mistakes,my native language is not English.

It's stated that the gradient of:  $$\frac{1}{2}x^TAx - b^Tx +c$$  is   $$\frac{1}{2}A^Tx + \frac{1}{2}Ax - b$$  How do you grind out this equation? Or specifically, how do you get from $x^TAx$ to $A^Tx + Ax$?


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?


Question is from my lecture notes. What will I show? It is clear, isn't it?  So, $5\mathbb{N}+3\mathbb{N}$={$5n_{1}+3n_{2}$:$n_{1},n_{2} \in\mathbb{N}$}={$0,3,5,6,8,9,10,11,12,...$}.

Can you check if my proof is right?  Theorem.  $\forall x\geq8, x$ can be represented by $5a + 3b$ where  $a,b \in \mathbb{N}$.  Base case(s): $x=8 = 3\cdot1 + 5\cdot1 \quad \checkmark\\ x=9 = 3\cdot3 + 5\cdot0 \quad \checkmark\\ x=10 = 3\cdot0 + 5\cdot2 \quad \checkmark$  Inductive step:  $n \in \mathbb{N}\\a_1 = 8, a_n = a_1 + (x-1)\cdot3\\ b_1 = 9, b_n = b_1 + (x-1)\cdot3 = a_1 +1 + (x-1) \cdot 3\\ c_1 = 10, c_n = c_1 + (x-1)\cdot3 = b_1 + 1 + (x-1) \cdot 3 = a_1 + 2 + (x-1) \cdot 3\\ \\ S = \{x\in\mathbb{N}: x \in a_{x} \lor x \in b_{x} \lor x \in c_{x}\}$  Basis stays true, because $8,9,10 \in S$  Lets assume that $x \in S$. That means $x \in a_{n} \lor x \in b_{n} \lor x \in c_{n}$.  If $x \in a_n$ then $x+1 \in b_x$,  If $x \in b_x$ then $x+1 \in c_x$,  If $x \in c_x$ then $x+1 \in a_x$.  I can't prove that but it's obvious. What do you think about this?


Sorry I just started out learning everything. thank you guys


I was looking at the decision tree algorithm and I wondered that for example if the training set has 20 features but only 5 features are important and classification can be done by using only them then will my end result decision tree has only 5 features? My understanding is that as decision tree is a kind of greedy based algorithm, so I believe it will only consider those features which can be used for the best fit of the training data and ignore the rest of them.

I have built CART model using sklearn. I'm having total 6 features in training dataset and passing all of them in fit function. I've tested both criteria Gini and entropy. But whenever I plot tree using graphviz, the tree uses only 3 features in case of Gini and 4 features in case of entropy. I've also implemented CART from scratch for cross check purpose and still, Gini uses 3 features and entropy uses 4 features.  Everything else is working fine. I'm getting the result as expected in test dataset with accuracy 97%. I just want to confirm that, is this normal? Does cart chooses best features only and ignore other features to avoid the wrong classification? Also, my dataset is quite small in size, only 220 records.


I know many examples of block devices (HDDs, SSDs, files, ...), but I haven't heard a simple definition of it. Especially since files are apparently included in the definition I feel a bit confused...

How are character special files and block special files different from regular files in a Unix-like system? Why are they called “character special” and “block special” respectively?


I have a (non-rooted) Sony Xperia Z3 with default Lollipop installed. One challenge I often run into is that I can connect to a WiFi network, and my friends with iPhone cannot (I've also encountered the opposite, but that's another topic). It seems the hotspot functionality only works with connection to a telephone network, and not as a regular WiFi-WiFi hotspot. Do any of you know of a built in functionality that will do this, or an app I can download that will solve this issue for me? Thanks :)

Can we use an Android phone as a Wi-Fi repeater?  Imagine situation when you can access a weak Wi-Fi signal from a free hotspot (coffee shop) signal near window, but want to work in the middle of the room. Then we can put the phone on the window sill to spread the signal over the entire home.  Is it feasible?


I am struggling with my json answer as I got different answer when I work localy and on my hosted server (1and1). I use jquery autocomplete and $.getJSON to retrieve data from my database. When I work locally my JSON answer doesn't contain blank line at the begining of my answer and the accentued characters are well interpreted. However when I use same code on my hosted server I got a JSON answer with a blank line at the top of my answer and accentued chars are not well interpreted. The answer of my JSON looks like   [{"id":"17035","label":"45110-Germigny-des-Pr\u00c3\u00a9s","value":"45110-Germigny-des-Pr\u00c3\u00a9s"},{"id":"17041","label":"45110-Saint-Martin-d'Abbat","value":"45110-Saint-Martin-d'Abbat"}]   I set the header of my php script to utf-8 but doesn't help. below the output with non encoded chars   Any help or clue on that issue?

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


For example:  A question was closed with this:     "closed as not a real question by Will May 14 at 17:55"   It could be a UP and DOWN marker in left side of this decision. So the users could vote if it was a good or bad decision. If it receives too many negative votes, it could be reversed.

To reopen a closed question,  must agree that the question is suitable for the site and cast votes to reopen the question. But:  How does one actually vote to reopen? Is there a reputation level that you must have before you can see this function? Or do I just leave a comment along the lines of, "I vote to reopen"? What happens if someone with less than 3000 reputation leaves a comment that they wish to vote to reopen? How can one draw attention to their closed questions? Is it done via a posting new question? Or do you edit the closed question?   Related:  For more information, see "" in the .


Other people i'v googled with this MySQL error have had restricted words, but I cant see any in mine.  I'm having trouble storing an css div in a variable and inserting it into a table as a field.  I'm very confused because the 2
's work perfect, but then it breaks when I try a div.  userrepost.php      /* Connect and Query database "accounts", then close connection */     $connection=mysql_connect("localhost","root","");     if (!$connection)     {         die('Cannot connect to MySQL. Error: ' . mysql_error());     }      $check_database = mysql_select_db("accounts", $connection);     if (!$check_database)     {         die('Cannot connect to database. Error: ' . mysql_error());     }      /* Escape all POST variables */     $query=mysql_query("SELECT * FROM posts WHERE id='$_GET[postid]'");     $result = mysql_fetch_row($query);     $escaped_repostinfo=$_POST['repostinfo'];     $final_repostinfo=$escaped_repostinfo."

".$result[0]." ".$result[1]."
";     echo $final_repostinfo;     $date = new DateTime('Canada/Saskatchewan');     $date->setTimezone(new DateTimeZone('Canada/Saskatchewan'));     $date_string=$date->format('d/m/Y H:i:s');      /* Query database to save user's post */     /* If field "repostid==0", then the post is not a repost; if the field "repostid>0", then the post is a repost with the field "repostid" linking to the id of the post to be reposted */      $result = mysql_query("INSERT INTO posts (user, content, repostid, date) VALUES ('$_SESSION[username]', '$final_repostinfo', '$_GET[postid]', '$date_string')");     if (!$result)     {         die('Cannot query. Error: ' . mysql_error());     }      /* Close Connection */     mysql_close($connection);   'rptext' is a css div( #rptext{stuff;} )  This is the error:  Cannot query. Error: 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 'rptext'>shawn619 dfsd', '51', '09/11/2013 15:27:11')' at line 1

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?


Please look at the following sentences and tell me the difference between them.   If you have met him today, then you must consider yourself lucky. If you met him today, then you must consider yourself lucky.   Also,    Today, I've seen your friend talking to my neighbour. Today, I saw your friend talking to my neighbour.   Thank you.

I read (or do I say "have read"?) many rules for when to use the present perfect. I found them complex and hard to understand (or do I say "have found"?). I am finding it hard to apply these rules in real sentences.  Is there a simple and clear way to explain the difference between past simple and present perfect? If there is a simple explanation, please tell it! If there is no simple explanation, please tell why it is so complicated. Maybe if I knew why there is no simple explanation, that would help me understand what work I need to do in order to learn the difference.


A newbie so please excuse  I use the below script to create copies of the same file  for i in {1..5}  do    cp file xfs/file$i  done   To create   file1 file2 file3 file4 file5  My Question is if i wanted to dictate how many files are created how do i do this  I have tried  read -p "How many files do you want" num  for i in {1..$num}  do    cp file xfs/file$i  done   I'm unsure on how to get the "for" command top accept my variable  Any ideas

How do I iterate over a range of numbers in Bash when the range is given by a variable?  I know I can do this (called "sequence expression" in the Bash ):   for i in {1..5}; do echo $i; done   Which gives:     1    2    3    4    5   Yet, how can I replace either of the range endpoints with a variable? This doesn't work:  END=5 for i in {1..$END}; do echo $i; done   Which prints:     {1..5}


Like the title says, does $X$ (a random variable) usually refer to the population or the sample?

What do they mean when they say "random variable"?


Prior to Ubuntu 18.04, the compress dialog window listed a dozen file formats to choose from:    In the new version, the dialog window offers only 3 options:    This is somewhat limited in my opinion. I am used to compress my packages in the tar.gz format, and I like have all of them with the same extension.   I know one can manually open the archive manager window, drag-and-drop a directory into it and then create an archive to get a tar.gz package. Alternatively, I can use the terminal. But both of these approaches are somewhat sub-optimal and less immediate than the previous one.  Q: is there any way to restore the old compress dialog window in Ubuntu 18.04?

In Ubuntu 17.10 ubuntu upgraded Nautilus (File Browser) to version 3.26.0. New nautilus is not using file-roller anymore, it has  to an integrated compression mechanism.     This makes it complicated to create encrypted archives and/or different types compression archives that file-roller does provide.  How to make nautilus use file-roller as before?  Related question:


I have an iMac 27" with two thunderbolt ports, and a PC with DisplayPort output. In order to use the iMac as a monitor, it appears that a thunderbolt display output at the source is required (), and using a DP-mDP cable did not work (Target DisplayMode on the mac using cmd-F2 doesn't respond).  The question is, is there anything I can do on the PC side (a new graphics card, perhaps? or some sort of a converter) to make this happen?

Recently (less than one year ago) i bought an iMac 21,5". Now i would like to use it as secondary monitor for my laptop. (My laptop runs Windows 7).  Is it possible? (I found conflicting opinions on the web, even on the Apple forum).  What type of cable do I need? (I will appreciate also a link to the product on some online store: amazon, ebay etc.)  Thank you in advance.  UPDATE:  I tried air display... i'm not satisfied at all...  typical scenario: browser window on the main Windows laptop, dev tools/firebug on the secondary iMac screen. The mouse goes fast between the 2 screens (GOOD), but when i changed the selected tab nothing happens. I had to drag the dev tools window to the main screen to get an update of the selected tab.  My test is ended here.  I'm still waiting for other answers.   I will prefer an answer that suggest me what kind of cable i've to buy, and where i can find it on the web.


I was wondering that if there is a Local Area Network and one public IP,through which various clients connect(which have been allocated private IP's).Suppose one of the clients spoofs his IP to try to launch an attack against a server(say Google).Does there exist a way that Google uses to secure itself against such attacks,without the help of network administrator.

I am an undergraduate Computer Science student and was hoping to gain some knowledge of ways to help prevent IP spoofing but all the resources I have tried out elaborate this concept in a theoretical way. I want to try out my hands at one of the techniques like:      How do I simulate this whole situation in my own system were I myself am the attacker and I myself have to defend it? And once I have gained an understanding of it, then how do I start translating that into programming terms?


I  have  this  code,  class  Test{  public static void main(String args[]) { Boolean a; Boolean b; char [] c={'S','t','r','i','n','g'};  a=("String".replace('g','G')=="String".replace('g', 'G'));  b=("String".replace('g','g')=="String".replace('g', 'g'));  System.out.println("---"+a); System.out.println("---"+b); System.out.println(c.toString()=="String"); }   The  Out  put  is  ---false ---true false  I  did  visit  JLS  documentation  by  oracle where it says.  The replace method: Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar. If the character oldChar does not occur in the character sequence represented by this String object, then a reference to this String object is returned. Otherwise, a new String object is created that represents a character sequence identical to the character sequence represented by this String object, except that every occurrence of oldChar is replaced by an occurrence of newChar.  when the O/p one is false why the O/p second  is true?  JLS document says about toString method: This object (which is already a string!) is itself returned. then  why  not  O/p  third  is  true?  Can  any  one  please  explain  it  to  me  Thanks  in  advance GPAR

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?


Of course, I mean that the edge of the disk is traveling at the speed of light. This is a question that popped into my head a few years ago when I was learning about some basic relativity in high school.  According to what I learned, if an object were to move at near-light-speed, it would be "compressed" along the direction of movement (for a stationary observer), but I'm asking myself what would happen if a disk were to spin along its axis. Would its circumference also get compressed?  Even though there is no such material that would resist the extreme centrifugal forces of this spinning disk, I think that a stationary observer would see this disk shrink as it approaches the speed of light.  But if the disk shrinks, a point on its circumference wouldn't travel so fast anymore (because of the reduced radius), so I'm guessing that the maximum speed of such a point is lower than speed of light.  I'm pretty sure I am way off the tracks as far as relativity is concerned, but I made some calculations back then, and using some help from Wolfram|Alpha I came to the conclusion that if my assumptions are correct (that the disk would shrink, and high-school geometry still applies), the maximum speed of a point on the circumference of the disk would be exactly c/2, before requiring an infinite amount energy to increase its speed any further.  So... what would in fact happen?

I understand that the closer something travels to the speed of light, that time will stretch by a factor, and distance will compress by the same factor.  My question is, if something travels in a circle, close to the speed of light, what does the distance of the journey look like to them? They measure that the trip took them 10 minutes. And an outside observer says that the journey took 20 minutes, and the outside observer measured that they did, for example, 1000 laps of a circle circumference 1000 km.  So if the plane had a distance trip counter, what would it read? And if they were looking out of the window, would the circle still look like it had a circumference of 1000km?


How to integrate $\frac{1}{\log(x)}$?  I have tried integration by parts, but it is a never ending series with no specific general term.  PS: It is indefinite integration.

Please integrate $\frac{1}{\log(x)}$ and illustrate the steps of your method of integration. I have already tried integration by parts following the ILATE rule and otherwise. Eventually it forms a loop that takes me back to the direct or substituted term where I started the process of integration.


I have some raster data whose metadata defines its coordinate system as:  rotated regular grid, virtual North Pole at 39.25 N, 162.00 W (rotated coordinates)  Its spatial resolution is 0.044 degree.  I am trying to get this data into regular longitude, latitude coordinates and to do so I have defined a custom projection with these parameters:  +proj=longlat +datum=WGS84 +lat_0=39.25 +lon_0=-162 +no_defs.  It doesn't really seem to help though, this is the raster layer and OSM basemap layer, both visualized in WGS84:    and this is the same layers, both visualized with this defined coordinate system:   I feel like I must be missing something obvious here.  Is this not how you would define a coordinate system for a rotated regular grid?  The source data, as well as the metadata PDF is

First I should clarify I don't have previous experience with the field, so I don't know the technical terminology. My question is as follows:  I have two weather datasets:    The first one has the regular coordinate system (I don't know if it has an specific name), ranging from -90 to 90 and -180 to 180, and the poles are at latitudes -90 and 90. In the second one, although it should correspond to the same region, I noticed something different: latitude and longitude were not the same, as they have another reference point (in the description is called a rotated grid). Together with the lat/lon pairs, comes the following information: southern pole lat: -35.00, southern pole lon: -15.00, angle: 0.0.    I need to transform the second pair of lon/lat to the first one. It could be as simple as add 35 to the latitudes and 15 to the longitudes, since the angle is 0 and it seems a simple shifting, but I'm not sure.  Edit: The information I have about the coordinates is the following    Apparently, the second coordinate system is defined by a general rotation of the sphere  "One choice for these parameters is:   The geographic latitude in degrees of the southern pole of the coordinate system, thetap for example; The geographic longitude in degrees of the southern pole of the coordinate system, lambdap for example; The angle of rotation in degrees about the new polar axis (measured clockwise when looking from the southern to the northern pole) of the coordinate system, assuming the new axis to have been obtained by first rotating the sphere through lambdap degrees about the geographic polar axis, and then rotating through (90 + thetap) degrees so that the southern pole moved along the (previously rotated) Greenwich meridian."   but still I don't know how to convert this to the first one.


Could someone please tell me if "That" should be capitalized in the following title:  Learn the Winning Formula That Ironman Triathletes Use to Create Unstoppable Sales Success

Since the version of the word "that" might matter to the correct answer, I'll provide the actual title in question:  Title:  Existing Solutions that Didn't Work  If someone could explain the why of the answer, I would be appreciative.  EDIT:  It has been suggested that this is a duplicate, and that may be, in a sense.  However, the after reading the suggested prior question, I'm no closer to my answer.  I think it may have to do with my use of the word "that."  Perhaps it is incorrect?  Using these definitions of the word "that:" I'm having trouble figuring out which definition of that matches my title.  Am I even using it correctly?  Perhaps I should use which instead:  Possible Title:  Existing Solutions which Didn't Work  If my original usage is incorrect, and I should use which, then the answer is simple since which is always a pronoun or adjective, and those are both capitalized in a title.  However, I'm having difficulty understanding which part of speech that is in my original title.


I would like to add the value of an input field to the value of the attribute data-value. This actually works but I have a button that generates new fields. So the value can be added to the first input field but not to those which get generated by clicking the button.  <button id="another_field">Add a new field</button>  <div class="cpt_area">   <input placeholder="Type something here..." class="full_width cpt_name" type="text" name="cpt_name[]"> </div>   // This will copy an input field $('#another_field').click(function() {   $('.cpt_name:first').clone().prependTo(".cpt_area").val(''); });  // This will generate a data-value attribute $('input').keyup(function() {   $(this).attr('data-value', $(this).val()); });   You can try it here:   Any ideas how I can fix this?

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


I'm finishing up the rough in wiring for a kitchen remodel, but I have a situation where I can't run cables through studs for a light switch because there is no wall cavity. I decided to run it strait up against the wall into the attic space through conduit. Its a short 5' run of conduit and just 90 degree stubs out into the attic then connects with the kitchen lighting circuit. I ended up just stripping the romex back instead of using THHN because I needed the attic portion of the run to be sleeved (I'm aware of the lack of conductor labeling violation here, its just what I ended up doing in my own kitchen). The conduit does NOT connect back to the panel. Is having a bare ground inside conduit going to be an issue? Is this any different from having a ground connected to a metal box? Any info would be much appreciated, thanks!

Is there a reason I should use bare copper instead of THWN for a grounding electrode conductor (e.g. bonding water pipes and ground rods; not an equipment grounding conductor)?  I cannot find anywhere that says THWN must be run inside conduit/raceway when used as a grounding electrode conductor. Section 250.62 indicates the conductor can be "solid, stranded, insulated, covered, or bare" and 4 and 6 awg THWN are generally cheaper in my area than bare copper (both solid and stranded), so I'm just wondering if there is some section of code I am missing or a practical reason to prefer a bare conductor since bare wire seems to be in wide use for this purpose where I look.


$g(x+y)=g(x)g(y)$ for all $x,y \in\mathbb{R}$.   If $g$ is continuous at $0$, prove that $g$ is continuous on $\mathbb{R}$.

Prove that if $f\colon\mathbb{R}\to\mathbb{R}$ is such that $f(x+y)=f(x)f(y)$ for all $x,y$, and $f$ is continuous at $0$, then it is continuous everywhere.   If there exists $c \in \mathbb{R}$ such that $f(c) = 0$, then $$f(x + c) = f(x)f(c) = 0.$$ As every real number $y$ can be written as $y = x + c$ for some real $x$, this function is either everywhere zero or nowhere zero. The latter case is the interesting one. So let's consider the case that $f$ is not the constant function $f = 0$.  To prove continuity in this case, note that for any $x \in \mathbb{R}$ $$f(x) = f(x + 0) = f(x)f(0) \implies f(0) = 1.$$  Continuity at $0$ tells us that given any $\varepsilon_0 > 0$, we can find $\delta_0 > 0$ such that $|x| < \delta_0$ implies $$|f(x) - 1| < \varepsilon_0.$$  Okay, so let $c \in \mathbb{R}$ be fixed arbitrarily (recall that $f(c)$ is nonzero). Let $\varepsilon > 0$. By continuity of $f$ at $0$, we can choose $\delta > 0$ such that $$|x - c| < \delta\implies |f(x - c) - 1| < \frac{\varepsilon}{|f(c)|}.$$  Now notice that for all $x$ such that $|x - c| < \delta$, we have $$\begin{align*} |f(x) - f(c)| &= |f(x - c + c) - f(c)|\\  &= |f(x - c)f(c) - f(c)|\\  &= |f(c)| |f(x - c) - 1|\\  &\lt |f(c)| \frac{\varepsilon}{|f(c)|}\\   &= \varepsilon. \end{align*}$$ Hence $f$ is continuous at $c$. Since $c$ was arbitrary, $f$ is continuous on all of $\mathbb{R}$.  Is my procedure correct?


I am a manual tester and I want to learn test automation. I have basic knowledge of core Java and I would start to learn Selenium.   Should I start to learn Selenium IDE, Selenium1/RC or Web driver.   Also, any websites/apps on which I can practice test automation?

I am a manual functional tester and I am keen on shifting my career from Manual testing to Automation testing using Selenium. What is the best way to begin with this goal of mine? Thanks!


Prove that the order of $D_n$ is $2n$.  I'm trying to find a proof for this, but couldn't find anything on the site. I found , but it's not exactly what I'm looking for. They're mentioning something about "orbits" and "stabilizers" which I haven't heard before. Is there an alternative proof for this?

Consider the dihedral group  $$D_{2n}= \langle a,b \mid a^n = 1 = b^2, b^{-1}ab = a^{-1}\rangle$$  How can I show that $|D_{2n}| = 2n$?   I'm trying to show that we can write every element in the form  $$x = a^i b^j$$ where $i= 0, 1, \dots, n-1$; $b = 0,1$.   I managed to show existence, and it is clear that there are $2n$ such elements, so if I can show that every choice of $i,j$ gives a distinct element, I'll be done.  Any ideas?


if there are two voltaic servant triggers, can i respond to the second trigger after the first trigger resolves? For example; I tap steel overseer during my turn. At the end of my turn my two voltaic servants trigger to untap a target artifact. I untap my steel overseer for the first trigger and in response to the second trigger I tap steel overseer again. After that the second trigger goes off and I will have effectively tapped steel overseer 2 times and untapped 3 times because of the two voltaic servants. Is this correct?

So for example: I have  with  equipped. He is targeted with . In response I tap Krenko to make 1 Goblin token. I also have  to sacrifice the token. Can I sacrifice the token after it has been made to untap Krenko and make more tokens before Doom Blade resolves?


Let $f:\Bbb R \to \Bbb R$ be continuous. Assume   $$ \begin{aligned} &f(x) \rightarrow a \quad \text { for } x \rightarrow-\infty\\ &f(x) \rightarrow b \quad \text { for } x \rightarrow \infty \end{aligned} $$   Show that $f$ is uniformly continuous.   I'm lost here.

Let $f : [a, +\infty) \rightarrow \mathbb{R}$ be continuous, such that   $\lim_{x \rightarrow +\infty} f(x) = l \in \mathbb{R}$. Show that f is   uniformly continuous.   I want to split the domain - one in which we have continuity, and the other in which the values of f are approaching $l$. This means there are theree possibilities for our $x$ and $y$ using the uniformly continuous definition: x and y are in the first part, x and y are in the second, x is in the first and y in the second.   How would I do this proof?


A friend showed me a circle inside a square such that the diameter of the circle is equal to the side length of the square. The perimeter of the square is 8r. He then proceeded to take small squares of the corners of the original square, maintaining perimeter as 8r. As this continues the original square begins to appear like a circle, somehow making it seem like the perimeter of the circle is 8r, which I know isn't true.   What is the flaw in the method above to show that it the perimeter is not 8r?

What is wrong with this proof?    Is $\pi=4?$


Let $A$ a infinite set, and $a$ the cardinal number of $A$, then $a.a=a$ My attempt: We know $a.a=card(A\times A)$ and $card(A)=a$, then we need prove $card(A\times A)=card(A)$  Let $f:A\times A\rightarrow A$ such that $f(x,y)=x$ with $x,y \in A$ this is a bijective function and this implies $card(A\times A)=card(A)$  is correct this?

I am trying to understand the proof that uses a maximal-lexicographic ordering.  For an infinite ordinal $\kappa,$ the canonical well-ordering of $\kappa \times \kappa,$ denoted by $<_{cw}$ is defined as follows: $(\alpha_1, \beta_1)<_{cw} < (\alpha_2, \beta_2)$ iff either one of the following holds.  $(1): \max\{\alpha_1,\beta_1\} < \max\{\alpha_2,\beta_2\}$  $(2): \max\{\alpha_1,\beta_1\} =\max\{\alpha_2,\beta_2\}$ and $\alpha_1<\alpha_2$   $(3): \max\{\alpha_1,\beta_1\} =\max\{\alpha_2,\beta_2\}$ and $\alpha_1 = \alpha_2$ and $\beta_1 < \beta_2.$  How would I prove that this ordering is well ordered?  EDIT: I'm not looking for a proof of $\kappa\cdot\kappa= \kappa,$ for infinite cardinals, I'm looking for a proof that the ordering as it's defined is well ordered on $\kappa\times\kappa$.


I know that we see in experiments (physical and thought) that energy is always transformed into something else, but what propels our universe to behave this way? What is happening at small levels that only allows conservation as a possible outcome and not destruction of energy?    Update: Based on a given answer stating that energy is mass, I should probably then expand this question into "Why must mass must always be conserved?"

My physics instructor told the class, when lecturing about energy, that it can't be created or destroyed.  Why is that?  Is there a theory or scientific evidence that proves his statement true or false?  I apologize for the elementary question, but I sometimes tend to over-think things, and this is one of those times. :)


I tried the mist effect and the smoke simulation but didn't like the results. What I want to achieve is a static fog like the fog in this picture.   Steady but also moving slowly on the surface of lake.

I'm trying to make a low lying fog, and the box I used as a boundary on the smoke rendered as a solid object, blocking everything inside it. How can I fix this?


I have run into a problem when trying to find multiple matches in a length of text. The text has the following format:  string text = "#IDENTIFIER http://www.link1.com #IDENTIFIER http://www.link2.org #IDENTIFIER http://www.link3.com #IDENTIFIER http://www.link4.net";   My objective is to extract each #IDENTIFIER link occurrence from this and I am doing it using the following code:  string pat = @"(#IDENTIFIER)(.*)\.(com|org|net)"; MatchCollection matches = Regex.Matches(text, pat); foreach(Match match in matches) {     Console.WriteLine("'{0}' found at index {1}.", match.Value, match.Index); }   The problem is, it returns one match and not 4. Why are the in-between patterns ignored?  Do you know what I am missing?

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


Have 9 speed Shimano chain that I need to shorten.     I don't have the Shimano pin so I need to go buy one. Could just reuse the regular pin but I already broke one chain tool trying that.  I think the SRAM Powerlink would be more convenient.       Is it safe to use the SRAM Powerlink on a Shimano chain? Or is there some other reusable connector (master link) for a Shimano chain?

I just bought a pair of SRAM Powerlocks for 10-speed chains. The packaging says that they can only be used with SRAM chains. Will anything nasty happen if I use it with a Shimano chain and cassette?


Let $f$ be differentiable on $R$ and $f(0) = f(1) = 0$.  Prove that there exists $c \in (0,1)$ such that $f(c) + f'(c) = 0 $  Can someone help me with this proof?

Prove that if $f$ is differentiable on $ [a,b]$ and if $ f(a)=f(b)=0$ then for any real $k$ there is an $ x \in (a,b) $such that $$kf(x)+f'(x)=0 $$  As all the conditions of Rolle's theorem are satisfied one can say that there is at least one  $c \in (a,b) $ such that $f'(c) =0$ How should I proceed furthur ? How can I use this to get to the required equation ?


I have a question concerning multiple inheritance. In my project, I want to add support for dll plugins and need an interface for that reason. In the application, I create objects like players and visual objects and hand them to the dll interface. the dll only has the ability to interpret a character pointer as ICharacter for example. My problem occurs, within the application itself:  class IGameObject {     virtual const std::string &getName(void) const = 0;     virtual void setName(const std::string &name) = 0; };  class IVob : public virtual IGameObject {     virtual const Math::Vec3 &getPosition(void) const = 0;     virtual void setPosition(const Math::Vec3 &pos) = 0;     // more pure virtual functions };  class ICharacter : public virtual IVob {     // pure virtual functions };  class GameObject : public virtual IGameObject {     GameObject();      virtual const std::string &getName(void) const override;     virtual void setName(const std::string &name) override;     // more virtual function override };  class Vob : public virtual IVob, public GameObject {     Vob(VobType type);      virtual const Math::Vec3 &getPosition(void) const override;     virtual void setPosition(const Math::Vec3 &pos) override;     // more virtual function override };  class Character : public ICharacter, public Vob {     Character();      // virtual function override };   Suppose character is of ICharacter  Now, if I want to call character->setPosition(pos); it may crash, since it comes as ICharacter pointer. If I reinterpret_cast<Character*>(character)->setPosition(pos); it, then it may work properly. It seems, as if the vtables got mixed up, but I can't see where that happens. If I reorder the inheritance it may – in some constellation – work.  Process looks like:  Creation (Character*) -> dll interface (reinterpret_cast<ICharacter*>) -> call functions in dll interface, which are 100% part of the original character  If passed back to the application:  dll interface (ICharacter*) -> application (reinterpret_cast<Character *>)  What do I miss?  Thanks in advance  Edit: In fact did I try to dynamic_cast, but that didn't help. Now it crashes in an even earlier call.

What are the proper uses of:   static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style cast type(value)   How does one decide which to use in which specific cases?