Before this is marked as a duplicate, my question is more specific than the other one.  In the third book, when Harry has his wand on Black in the Shrieking Shack, he wants to kill him. He also clearly plans to use a spell because his wand was pointing at Black's heart, and when Crookshanks sits on Black's chest to protect him, Harry thinks:     So what if he had to kill the cat too? It was in league with   Black.... If it was prepared to die, trying to protect Black, that   wasn't Harry's business   If Harry was planning on using physical force to kill Black (which doesn't seem in character anyway - Harry bashing someone's head in?), he wouldn't worry about Crookshanks being in the way. And in that case, the cat's protection wouldn't make a difference anyway.  So if Harry was planning on using a spell, which one would he have used? Even if he knew about Avada Kedavra (which he doesn't until the next year), I doubt 13 year old Harry would be powerful enough for it to work. He didn't know Stunning, etc until next year, and he had no idea expelliarmus could knock someone out (the Snape incident happens later).  He seems very assured about killing Black. The only thing that seems to be getting in his way is his nerve. He seems like he knows what he wants to do.     "Harry raised his wand. Now was the moment to do it."      "-- but the footsteps were thundering up the stairs and Harry still hadn't done it."      "He hadn't done it. His nerve had failed him."   What spell could he have been thinking of, even if it may mot have ended working?

In "The Prisoner of Azkaban", chapter 17, "Cat, Rat, and Dog":     Harry raised the wand.  Now was the moment to do it.  Now was the moment to avenge his mother and father.  He was going to kill Black.  He had to kill Black.  This was his chance...   How was Harry going to kill him, had he tried to go through with it?  It's only his third year, and I don't think he knows any killing curses yet.


When I click on the  tag on StackOverflow Meta, it opens a search result page to StackOverflow.

I am wondering because I was editing my profile and I though it would be nice to put the languages I know and stuff like tags.  Is it possible to post a tag? If it's not, do you think it's possible to implement on the profile?  For example:  [c#]   Would generate    With tag formatting and link...


AFAIK all known quantum laws are  (except the collapse postulate, which is dubious anyway).  Why is it important that the laws be unitary?

Is the reason why the time evolution operator is unitary based on purely physical arguments, i.e. that the physical processes that an isolated system undergoes shouldn't depend on any particular instant in time (homogeneity of time); thus two experimenters who conduct the same experiment starting from the same initial state, but at different times, should have the same probability amplitude for that state?! Or is there some mathematical argument as well?  Also, is the reason why the time evolution operator is linear implied by the superposition principle (as an arbitrary state can be expressed as a linear combination of basis states the operator should act linearly as otherwise the state as a whole would evolve differently to the superposition of states that it was initially represented by)?!


Is there a possible way to search my own answers that are posted only for bounty questions (whether or not they currently have a bounty on them)?

All active questions with awarded bounty can be seen in the Featured tab. However, there seems to be way to make searches to the contents of any particular question tab.  I realize that this is pretty much a duplicate of  but it has no clear answer whether there are any plans of supporting bounty searching or not.  So, could there possibly be a hasbounty:1 advanced search criteria?


When you scroll over the Stack Exchange symbol in the top left corner of every SE site page, it tells you the total number of sites on the SE network. For some reason this number is 138 on any SE site (or at least the ones I've checked this on), but 140 on the SE homepage (the page with the hot questions). Here it is on the SE homepage:  Here it is on Meta (also on SO, Lifehack, Worldbuilding, and Puzzling, and probably other sites too)  I checked the  on SE and it says 137 sites. Obviously there's some bug here. I haven't counted the sites (too lazy) but I've been told that it is actually 138. I'm not really sure why it's happening, but this may confuse some people.

Currently, Stackexchange claims 53 Q&A sites. I count 55, including MSO. I'll grant that MSO ought not to be counted, given that we don't count the other metas. But that still leaves me at 54, not 53. Count for yourself:  (I counted the occurrences of the word 'ago' on the page, I didn't do it manually.)


I have ubuntu 12.10 on an acer aspire one 722 with ALSA & an ATI soundcard. So, i finally figured out how to start JACK; I type in jackd & qjackctl & jack_mixer and then open a new terminal and open the applications i want to use JACK with, i.e. zynaddsubfx & ardour2 & hydrogen...This is the only way it will start JACK. I don't know why I need to open it with the mixer, but it's been working...  Maybe I need other JACK applications??? For all i know, these are the only three I have.  1.) If I use other applications before starting JACK, when i open qjackctl (or jackd & qjackctl) it says it doesn't recognize it:  13:09:14.967 Patchbay deactivated. 13:09:15.097 Statistics reset. 13:09:15.171 ALSA connection change. 13:09:15.795 D-BUS: Service is available (org.jackaudio.service aka jackdbus). 13:09:16.461 D-BUS: JACK server could not be started. Sorry Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started 13:09:16.486 ALSA connection graph change. Sat Jan 26 13:09:15 2013: Starting jack server... Sat Jan 26 13:09:15 2013: JACK server starting in realtime mode with priority 10 Sat Jan 26 13:09:16 2013: control device hw:0 Sat Jan 26 13:09:16 2013: control device hw:0 Sat Jan 26 13:09:16 2013: Acquired audio card Audio0 Sat Jan 26 13:09:16 2013: creating alsa driver ...   hw:0|hw:0|1024|2|44100|0|0|nomon|swmeter|-|32bit Sat Jan 26 13:09:16 2013: control device hw:0 Sat Jan 26 13:09:16 2013: ERROR: ALSA: Cannot open PCM device alsa_pcm for    playback. Falling back to capture-only mode Sat Jan 26 13:09:16 2013: ERROR: Cannot initialize driver Sat Jan 26 13:09:16 2013: ERROR: JackServer::Open failed with -1 Sat Jan 26 13:09:16 2013: ERROR: Failed to open server Sat Jan 26 13:09:17 2013: Saving settings to "/home/laura/.config/jack/conf.xml" ... 13:09:19.882 Could not connect to JACK server as client. - Overall operation failed.  - Unable to connect to server. Please check the messages window for more info. Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started   2.) When I run jackd, jack_mixer, and qjackctl as startup applications, they start up fine. And I can connect zynaddsubfx and ardour with them etc. But if I want to play a youtube video, no sound comes out, even if I quit JACK and then try to play it. It seems like starting JACK messes with the sound for my non-JACK applications.  What should I do?  Thanks.

Audio was working fine until I tried to use qjackctl and qsynth to play a MIDI keyboard. I followed * to setup the keyboard and it worked. But then I noticed other applications couldn't play audio (VLC, Rhythmbox, etc.). After a reboot it was fine again. And then I set up the keyboard and the problem was back. This went on for a few days and I thought I could live with it as it fixed itself on reboot. But then it didn't. I couldn't play audio, except via qsynth and the MIDI keyboard. Now not even that audio will play.   *Mostly. qjackctl wasn't exactly as described, but I believe I found all the mentioned controls.  I'm not sure what I really did with qjackctl, or how to get back where I was. I tried removing (with apt-get purge) qjackctl and qsynth but that didn't help. Now I've reinstalled qjackctl and have tried changing the which driver is used by qjackctl, all to on avail.  Ideally I'd like the MIDI keyboard to work, but far more important is getting the audio back like it should be.  I've checked all volumes using alsamixer.   I believe JACK makes pulseaudio stop (see  and , but I don't know how to stop jack and get it back to normal.    How can I make the audio work again?


I'm reading such a sentence and confused by the "with":  He was watching the monster with a smile.   (Let's say there is a kind of monster can smile.)  Who is smiling? He or the monster?   Is there an ambiguity here? If there is how can I correctly express the meaning?

I read a sentence,     John has published research in academic journals of philosophy and law.    The author meant John has published research in academic journals of philosophy and in academic journals of law. But one could take the sentence to mean John has published research in academic journals that cover both philosophy and law.  I remember reading an article about these sorts of 'and' constructions;  I don't have any sufficiently specific keywords in mind to search for the answer.   Do you know what keywords relate to these sorts of constructions?


I would like specify in XML comments that method return collection of IEnumerable<FileInfo>.  What is  correct format for XML tag <returns/>.  /// <summary> /// Extensions methods for class <see cref="System.IO.DirectoryInfo"/> /// </summary> public static class DirectoryInfoExtension {     /// <summary>     /// Load files from folder     /// </summary>     /// <param name="dir">Folder</param>     /// <param name="searchOption">search options</param>     /// <param name="extensions">types of files</param>     /// <returns>Collection of <see cref="IEnumerable{FileInfo}"/></returns>     public static IEnumerable<FileInfo> ByExtensions(this DirectoryInfo dir,         SearchOption searchOption, params string[] extensions)     {     }

When writing xml documentation you can use <see cref="something">something</see>, which works of course. But how do you reference a class or a method with generic types?   public class FancyClass<T> {   public string FancyMethod<K>(T value) { return "something fancy"; } }   If I was going to write xml documentation somewhere, how would I reference the fancy class? how can I reference a FancyClass<string>? What about the method?  For example in a different class I wanted to let the user know that I will return an instance of FancyClass<int>. How could I make a see cref thing for that?


I have a scene with an object I modelled and UV-mapped. When rendering, the object is very dark. The light in the scene doesn't seem to have any effect, either in rendered, shaded or solid mode. Here's what I tried:  adding sun, spot and other light types with no success. changing the light strengh to millions or other values moving the light all around adding a simple cube and it don't behave differently  I'm a beginner to the subject so I must be missing something very obvious. Here is the scene in material preview:  render:  Any pointers ? EDIT: don't why it was closed, the linked question doesn't help at all ? EDIT2: closing and reopening the file solved the problem, no idea why it behave like this.

I want to export my objects to unity, but in blender I`m using Eevee engine. However the light in rendered more and material preview mode is completely different, which impacts the colors of objects. Which one can i trust to see the true final colors of the objects so that they will be the same when i export them to unity?


I have two table (category, product) as below:   Category Table:   cid name parent 1  items Null 2    A    1 3    aa   2 4    ab   2 5    ac   2 6    B    1 7    ba   5 8    bb   5 9    bc   5 10   C    1 11   ca   9 12   cb   9 13   cc   9   Product Table:   pid  cid  pname 1     2   p1 2     3   p2 3     4   p3 4     4   p4 5     5   p5 6     5   p6   Here  I want to get all parent and child products for a particular parent. Here I have cid = 2, then I need all the products to cid=2 and its child.   Here I tried it something like this, but not sure how to join product table with this query:   select  cid,         name,         parent from    (select * from categories          order by parent, cid) categories,         (select @pv := '2') initialisation where   find_in_set(parent, @pv) > 0 and     @pv := concat(@pv, ',', cid)   UPDATES:  DB Model     Can anybody help me out?  Thank you.

Assume you have a flat table that stores an ordered tree hierarchy:  Id   Name         ParentId   Order  1   'Node 1'            0      10  2   'Node 1.1'          1      10  3   'Node 2'            0      20  4   'Node 1.1.1'        2      10  5   'Node 2.1'          3      10  6   'Node 1.2'          1      20   Here's a diagram, where we have [id] Name.  Root node 0 is fictional.                          [0] ROOT                           /    \                [1] Node 1          [3] Node 2               /       \                   \     [2] Node 1.1     [6] Node 1.2      [5] Node 2.1           /            [4] Node 1.1.1   What minimalistic approach would you use to output that to HTML (or text, for that matter) as a correctly ordered, correctly indented tree?   Assume further you only have basic data structures (arrays and hashmaps), no fancy objects with parent/children references, no ORM, no framework, just your two hands. The table is represented as a result set, which can be accessed randomly.   Pseudo code or plain English is okay, this is purely a conceptional question.  Bonus question: Is there a fundamentally better way to store a tree structure like this in a RDBMS?    EDITS AND ADDITIONS  To answer one commenter's ('s) question: A root node is not necessary, because it is never going to be displayed anyway. ParentId = 0 is the convention to express "these are top level". The Order column defines how nodes with the same parent are going to be sorted.  The "result set" I spoke of can be pictured as an array of hashmaps (to stay in that terminology). For my example was meant to be already there. Some answers go the extra mile and construct it first, but thats okay.  The tree can be arbitrarily deep. Each node can have N children. I did not exactly have a "millions of entries" tree in mind, though.  Don't mistake my choice of node naming ('Node 1.1.1') for something to rely on. The nodes could equally well be called 'Frank' or 'Bob', no naming structure is implied, this was merely to make it readable.  I have posted my own solution so you guys can pull it to pieces.


Lemma : If $(G,\times)$ is a cyclic group and $g \in G$ has order $n$,then $g^m=1$ if and only if $n$ divides m. $\Longleftarrow$ If $n$ divides $m$ then there exist an integer $r$ such that $nq=m$,and $g^{m}=g^{nq}=(g^{n})^q=1$ $\Longrightarrow$ Suppose $g^m=1$,by the division algorithm there is unique integers $r,q$ such that $$m=nq+r \;\;\;\;\;\;\;\;\;\;0\le r<n$$ $$g^m=(g^{n})^q\cdot g^r \;\;\;\text{so}\;\;\;\;\;\; 1=g^r$$ Since $n$ is the least such positive $n$ and $0\le r<n$,easily follows $=0$ and hence $n$ divides $m$.   If $(G, \times)$ is a cylic group and of order $n$,then for $m<n$ the order of $g^m$ is $\frac{n}{\gcd\left(n,m\right)}$.   ${\gcd\left(n,m\right)}$ divides $m$ and hence  $\frac{m}{\gcd\left(n,m\right)}$ is an integer and $n$ divides  $\frac{nm}{\gcd\left(n,m\right)}$,from the last lemma $$g^{\frac{nm}{\gcd\left(n,m\right)}}=\left(g^{n}\right)^{\frac{m}{\gcd\left(n,m\right)}}=1$$   Suppose $(g^m)^k=1$ ,by the lemma $n$ divides $mk$,so:   $$\frac{n}{\gcd\left(m,n\right)} \mid  k\cdot\frac{m}{\gcd\left(m,n\right)}$$   However $\gcd\left(\frac{n}{\gcd\left(m,n\right)},\frac{m}{\gcd\left(m,n\right)}\right)=1$,so $\frac{n}{\gcd\left(m,n\right)}$ divides $k$,and thus it divides any integer power of $g^m$ which is one,and so  the order of $g^m$ is $\frac{n}{\gcd\left(n,m\right)}$.  I don't understand why $\frac{n}{\gcd\left(m,n\right)} \mid  k\cdot\frac{m}{\gcd\left(m,n\right)}$ and why $$\gcd\left(\frac{n}{\gcd\left(m,n\right)},\frac{m}{\gcd\left(m,n\right)}\right)=1$$ Can someone help me?

Could someone please help me with this proof?     Suppose that $a, b \in N$, and $d = \gcd(a, b)$. Since $d$ divides $a$, we have $a = de$ for some integer $e,$ and similarly $b = df$ for some integer $f$. Prove that $\gcd(e, f) = 1$.   I understand why it works. Since d is all the common factors of $a$ and $b, e$ and $f$ had no common factors, therefore the $\gcd(e,f) = 1$. But how do I prove this?  Thanks in advance.


If a player lays down a Wild Draw Color Card, can the next player lay down their own Wild Draw Color Card to get out of drawing cards. I argued that this should be allowed since it's like in UNO playing a Draw Two Card and the next player then plays another Draw Two Card.

I was playing Uno, and the card was a yellow 4.  As I didn't have a yellow nor a 4 in my hand.  I played the draw 4 card.  Now should I have been challenged, I would have won the challenge.  But my friend behind me in the rotation, jumped in with another draw 4, making it a +8.  Now that he has played a +4, I am no longer challegeable, but would you be able to challenge him?  I don't think you would be able to, since it wasn't his turn so technically he didn't have to play anything, plus it was a jump in.  So can you challenge a jump in draw 4 card played?


Say the map $\phi$ is an isomorphism from $\mathbb R^{*} \rightarrow \mathbb R^{*}$, where $\mathbb R^{*}$ is the group of all real numbers not including $0$ under the multiplication operation.  The map $\phi$ is a bijection such that $\phi (ab) = \phi(a) \phi(b)$.  How would I prove that if $r > 0$ then $\phi (r) > 0$ and if $r < 0$ then $\phi (r) < 0$?  I can think qualitatively why this is true.  For instance, the identity element of $\mathbb R^{*}$ is $1$ and will remain $1$ for any bijection of $\mathbb R^{*} \rightarrow \mathbb R^{*}$ otherwise the mapping will not be a group, thus, not an isomorphism.  In order for $1$ to exist in the group after the mapping, you cannot multiply the elements of $\mathbb R^{*}$ by a constant.  However, I don't know how to prove this mathematically.  Does anyone know a way?

I am working on the following homework problem:  Let $\phi$ be an isomorphism from $\mathbb{R}^*$ to $\mathbb{R}^*$ (nonzero reals under multiplication). Show that if $r>0$, then $\phi(r) > 0$.  I was trying to prove this by contradiction, but I haven't been able to find any problems. I know that we must have $\phi(1) = 1$, and $\phi(-1) = -1$ no matter what, but despite playing around with those values, as well as $\pm r$ and $\pm \frac{1}{r}$, I haven't gotten any contradictions, and I'm starting to think this might be possible.  What if we defined $\phi(x)$ as: $$x\ \text{if}\ x=\pm 1 \\ -x \text{, otherwise}$$  Would this not be an isomorphism?  Any hints for this question would be much appreciated.


I am trying to calculate the partial derivative of $x_i$ from the following:  $$\frac{\partial}{\partial x} (\mathbb{x}^T\mathbb{A}\mathbb{x})$$  For some vector $\mathbb{x}$ and matrix $\mathbb{A}$.  I can show this a sum of sums such that:  $$\sum_{k=1}\sum_{j=1}x_k a_{kj} x_j$$  From this I can show the cases for which $k$ and $j$ respectively it not equal to $i$, and then add the remaining parts to the sum. This will yield:  $$\sum_{k\neq 1} (x_k a_{ki}) + \sum_{j\neq 1} (a_{ij} x_i) + 2a_{ii} x_i$$  However I cannot seem to break what I need to do to finish finding the partial derivative with respect to $x_i$. Any suggestions/help would be appreciated.

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$?


Im using A* pathfinding and unity 2d. Also im very new and dont really know how to code well so if you can tell me the code it would be much appreciated. I figured out how to use A* but i dont want the enemy to constantly follow my player every where

this might be a simple question but I don't know how to code very well and A* is confusing to me.


I'm working with  to creating a live USB on OS X. I managed to get Ubuntu booted but the screen looks like a corrupt/glitch image. I can just about make out the clock on the bottom right and a few icons. I've been told that this is easily fixed and that nomodeset needs to be set for the graphics card. But all the solutions I find are for Ubuntu systems installed to hard drives. Where you can cd in and edit the grub file - how do you do this is if it's in an iso?

I know that editing the boot options line and adding 'nomodeset' solves the problem of my laptop during LiveCD mode, what I don't know is how to set it at boot up through Grub2 after I've installed Ubuntu.  So, my question is; how do I set nomodeset before I boot into Ubuntu?


I have the following code of a class used to read a file (.txt that contains 3 lines of 180 numbers each) and it runs perfectly. The problem is that as you may see I am just returning the array "data1", and I would like to return 3 arrays (data1,data2,data3) and 3 integer (total1,total2,total3) into the same method. Any ideas of how could i do it?. Thank you so much ;)!  public int [] OpenFile() throws IOException {     FileReader reader = new FileReader(path);     BufferedReader textReader = new BufferedReader(reader);      int numberOfTimeZones = 3;     int[]  data1 = new int[180];     int[]  data2 = new int[180];     int[]  data3 = new int[180];     int total1 = 0;     int total2 = 0;     int total3 = 0;      for (int i = 0; i < numberOfTimeZones; i++){         if (i == 0)         {             String firstTimeZone = textReader.readLine();              String[] val =  firstTimeZone.split ("\\s+");             for (int u = 0; u < val.length; u++)             {                 int stats =  (int)(Math.ceil(Math.abs(Double.parseDouble(val[u]))));                 total1 += stats;                 total1= total1/180;                 data1[u] = stats;             }          }         else         if (i == 1)         {             String secondTimeZone = textReader.readLine();             String[] val =  secondTimeZone.split ("\\s+");             for (int u = 0; u < val.length; u++)             {                 int stats =  (int)(Math.ceil(Math.abs(Double.parseDouble(val[u]))));                 total2 += stats;                 total2= total2/180;                 data2[u] = stats;             }          }         else         {             String thirdTimeZone = textReader.readLine();             String[] val =  thirdTimeZone.split ("\\s+");             for (int u = 0; u < val.length; u++)             {                 int stats =  (int)(Math.ceil(Math.abs(Double.parseDouble(val[u]))));                 total3 += stats;                 total3= total3/180;                 data3[u] = stats;             }         }     }     textReader.close();     return data1; }   }

I want to return two objects from a Java method and was wondering what could be a good way of doing so?  The possible ways I can think of are: return a HashMap (since the two Objects are related) or return an ArrayList of Object objects.  To be more precise, the two objects I want to return are (a) List of objects and (b) comma separated names of the same.  I want to return these two Objects from one method because I dont want to iterate through the list of objects to get the comma separated names (which I can do in the same loop in this method).  Somehow, returning a HashMap does not look a very elegant way of doing so.


When I use the key combination Windows+E, Explorer loads with My Computer selected (showing the list of drives on my system). Good, this is the functionality I want.  However, when I click either the:   Windows Explorer shortcut on my Quick Launch toolbar Start > Programs > Accessories > Windows Explorer shortcut   then Explorer displays with My Documents selected.  On checking the properties of either shortcut, I noticed Start in was set to %HOMEDRIVE%%HOMEPATH%. Aha! I thought, I'll change that to C:\ or %SystemDrive% (which I confirmed from the command-line is set to C:\)...but neither help. Explorer always loads with My Documents selected when launched via shortcut.  How do I get the Windows Explorer shortcut to always start off in My Computer?

In Windows7, when you open the Windows Explorer using the pinned Windows Explorer button on taskbar, it opens WE and points it to My Documents folder.  Is there a way to change this so it doesn't open My Documents, but rather "Computer" just as Windows+E keyboard shortcut does?


Consider this image and quotations from :      When a continuous spectrum is viewed through some cool gas, dark spectral lines   (called absorption lines) appear in the continuous spectrum.        If the gas is viewed at an angle away from the source of the continuous spectrum, a pattern of bright spectral lines (called emission lines) is seen against an other-wise dark background.        As the radiation passes through a gas, certain wavelengths are absorbed. Those same wavelengths appear in emission when the gas is observed at an angle with respect to the radiation source.   Since the gas absorbs photons and then re-emits them isotropically by my logic there is no reason why there should be any dark lines appearing on the absorption spectrum. Explicitly, I don't understand why the diagram doesn't look like this instead:    Since, as I understood it, this should be the case:      Since the absorbed photons in the gas are re-emitted why do we see any dark lines?

I was looking at  on why  and emission lines don't cancel out:      An experiment shining light on the material and looking at the   reflected spectrum will see absorption lines at those frequencies,   because the relaxation of the excited electrons will emit back   radiation all around randomly, whereas the reflected spectrum is at a   specific angle.   However it is not totally convincing to me. The photons that get emitted towards the center of the Sun (by the electrons in higher energy states that absorbed a photon earlier) would get absorbed again when they hit a different electron (and then re-emitted) and would eventually make it out. So why don't absorption and emission lines cancel out in our Sun?


The scenario is like this: I click the Questions button and select the "newest" tab to see the latest questions. I have set it to show 50 questions per page. On reaching the end of the page, I click next. On the next page, I notice that some of the questions that I had seen earlier are again listed repeatedly. Say when I go to the fourth page, some of the questions I saw in the third page are seen. Is this expected behavior? I am using the  browser.

I have just been looking through the questions to answer those that I can and as I go to the next page (using the Next button at the bottom) I am presented with the same questions.  I imagine this is not a flaw and in fact questions are coming in fast filling up a page pushing my current page to the next one.  An idea to solve would be to set a variable for starting id when I start paging and only clicking an update button will reset the starting id.


I was looking at my buddy's site earlier, and I came across the most strange SQL error I have ever encountered. The PHP file is add_cart_new.php?id= which will add a product to the shopper's cart. If you have add_cart_new.php?id=184' you'll get an error that says:  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 ''' at line 1 insert into cart set session_id='1ibltcqbpziwstrilad0e9p61bztnu',product=184'  The part that got me was the ''' at line 1. I tried doing some other things like entering: add_cart_new.php?id=add_cart_new.php&return=d4.php which would be considered to be a local file inclusion vulnerability, I'm guessing. Anyway, that led to this error:  Unknown column 'add_cart_new.php' in 'field list' insert into cart set session_id='1ibltcqbpziwstrilad0e9p61bztnu',product=add_cart_new.php  I've researched this lots, but is there any way someone could actually exploit this to get sensitive information?  I've looked at lots of guides, and have tried tons of things.  None of them have worked.

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?


The question is :     If $\sum u_n$ is a divergent series of positive real numbers and $s_n = u_1 + u_2 + \dots + u_n$ , prove that the series $\sum \frac {u_n} {s_n}$ is divergent.   I tried my best. But I failed. Please help me by giving me a hint. Thank you in advance.  My solution :  Let $\{t_n\}$ be the sequence of partial sums of the series $\sum \frac {u_n} {u_1 +u_2 + \dots +u_n}$. Let $s_n=u_1 +u_2+ \dots +u_n$. If we can prove that $\{t_n\}$ is not Cauchy then our purpose will be served. For this we have to show that $\exists \epsilon>0$ such that $\forall n \in \mathbb N, \exists p \in \mathbb N$ for which $t_{n+p}-t_n \geq \epsilon$. Now since $\sum u_n$ is divergent, then so is $\{s_n\}$. Hence $\forall n \in \mathbb N, \exists q \in \mathbb N$ such that $s_{n+q}>2s_n$.  Now, $t_{n+q}-t_n= \frac {u_{n+1}} {s_{n+1}} + \frac {u_{n+2}} {s_{n+2}} + \dots + \frac {u_{n+q}} {s_{n+q}} > \frac {u_{n+1} +u_{n+2}+\dots +u_{n+q}} {s_n} > \frac {s_{n+q} -s_n} {s_n} >1$ which proves that $\{t_n\}$ is not a Cauchy sequence, hence the series $\sum \frac {a_n} {s_n}$ is divergent.

I've tried to use the limit test: $\lim_{n \rightarrow \infty} \frac{a_n}{b_n} = C$ in the series of $a_n$ and $\frac{a_n}{a_1+a_2+...+a_n}$ but it was inconclusive.  The question does not especify the sign of $a_n$ but proving it for positives would already help.  I think the sign can change as long as the partial sums never get to be zero. Like if the series has only negative numbers the result seems to stil hold.


I have a image sequence imported in blender and I want it to be influenced by the lights in blender, not just the shadow but also the amount of light and color of light.

I'm following this tutorial where you create a popular illusion using images as planes. Tutorial:  However, I can't seem to get the object to receive shadow unlike other objects I've worked with before. It could be that the nodes I've used to get this result is a mix shader that uses the images of the back and front of the illusion with backfacing but I don't know how to get around this.


i tried to add the queries in the comment ,but i couldn't able to tag the username.Even i tried adding it with "@" Why its so.? Is there any reputation limit needed for it.?

How do the comment replies (aka "pinging users") work?  Who can I send an @reply to? How do I respond to a specific user when entering my comment? Will they be notified? What do people mean when they talk about "pinging" another user?  Related:


I'm beginner in android developing. How can I make a double datatype i.e 56.32534 into 56.33? But I want to take it in a double variable. I know a way but it takes in String.  Double value = 56.32534; DecimalFormat df = new DecimalFormat("0.##"); String newvalue = df.format(value);   Here, newvalueis a string. But I want to take it in a double datatype.  I need to use it's numeric value not just in display purpose only.

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


$f$ is a continuous function on $[a,b]$. If $$ \int_a^bx^nf(x)\mathrm{d}x=0,\ n=0,1,2,\cdots. $$ Prove that $f(x)=0$. A further problem is we only have $$ \int_a^bx^nf(x)\mathrm{d}x=0,\ n=1,2,\cdots. $$ Prove the same result.  I tried to use a polynomial to approach $f(x)$, i.e. $$ \forall \epsilon>0, \exists  P(x), \forall x\in[a,b],\ |f(x)-P(x)|\leq\epsilon. $$ Therefore, $$ \int_a^bx^n(P(x)-\epsilon)\mathrm{d}x\leq\int_a^bx^nf(x)\mathrm{d}x\leq \int_a^bx^n(P(x)+\epsilon)\mathrm{d}x. $$ But I do not know how to go on. It seems we only need to see the coefficient of the first term, but I cannot write a clear proof of that. Appreciate any help!

As the title says, I'm wondering if there is a continuous function such that $f$ is nonzero on $[0, 1]$, and for which $\int_0^1 f(x)x^n dx = 0$ for all $n \geq 1$. I am trying to solve a problem proving that if (on $C([0, 1])$) $\int_0^1 f(x)x^n dx = 0$ for all $n \geq 0$, then $f$ must be identically zero. I presume then we do require the $n=0$ case to hold too, otherwise it wouldn't be part of the statement. Is there ay function which is not identically zero which satisfies $\int_0^1 f(x)x^n dx = 0$ for all $n \geq 1$?  The statement I am attempting to prove is homework, but this is just idle curiosity (though I will tag it as homework anyway since it is related). Thank you!


Currently, when I look at the reputation section of my profile I see something of the format top X% <time period>. Okay, cool. However, recently I've been topping the charts at , but the percentage values seem odd.  For example, yesterday (UTC yesterday) I had around ~400 rep this week. According to the Users page, I was the top user for the week. But my profile just said "Top 4% this week"  Now, today, I'm at around ~500 rep this week, and it says "Top 2% this week."  Huh?    First of all, if i'm the top user, why not just say "Top user this week" - that would not only be more descriptive, it's a nice pleasant reward for a user checking his rep stats.    Second, what's with the arbitrary percentage values? If I'm the top user, I'm in the top 1%, so why not say so? Why 4% or 2%? How is this calculated, and why?   tl;dr, can't the top X% <time period> be "prettier"?

Currently, under the gigantic Avatar, you see these details  {rep} reputation top {reverse percentile}% this {period} {count} views flag weight {z} (max) << private got flair?   It is hard to make out whether "0.1% this quarter" is better or "0.03% this week".  It also seems to have negative connotations - a percentile report favours the "bigger is better" approach but doing a "top" decreases your "number" as you go higher.  Yes you can click on it to be brought to the /leagues page, but since we're congregating information into this page, it seems appropriate to give it some context   perhaps a little {?} icon next to the link to show more info, such as "title" (mouseover) tag showing "#146 of 35248"; or perhaps just a bracket next to the link (146/35248)   I know someone  precision for the "top {x}% this {period}" feature but even on the largest site (StackOverflow), it is ridiculous to show a differentiation at 0.01% which equates to 3 users (for the quarter, 4 users for overall)?!  For reference, compare the top 2 users at physics.SE   - top 0.58% overall  - top 2% overall  "Top 1%" and "Top 2%" would suffice?  In fact, "top user overall" and "#2 overall" looks more sexy. ("edge cases" yadda yadda)


I am making a form that inserts the values into a sql database. It works fine and puts into the database cleanly. The problem is that when I try to use apostrophes (') in my form it gives me an error.   This is for a test for a bigger project. I've tried researching it, if I was writing it in PHP I would put a "/" but it's user input.   PHP Code (action):  $sql = "INSERT INTO promotions (yourname, yourrank, theirname, oldrank, newrank, reason, date, profile) VALUES ('$yname', '$rank', '$tname', '$orank', '$nrank', '$reason', '$datetext', '$profile')"; $dateTime = new \DateTime(null, new DateTimeZone('Europe/London'));  if ($conn->query($sql) === TRUE) {     echo "New record created successfully"; } else {     echo "Error: " . $sql . "
" . $conn->error; }   HTML Form:  <form action="action.php" id="promotions" method="post" class="ui form">
     Their name     <input required type="text" name="theirname" placeholder="Their name">

     Their old rank     <input required type="text" name="oldrank" placeholder="Their old rank">

     Their new rank     <input required type="text" name="newrank" placeholder="Their new rank">

     Reason     <textarea name="reason" form="promotions" placeholder="Their reason for promotion. Try to keep this brief and make sure you don't use apostraphes ( ' )."></textarea>
   <input class="ui button large fluid teal" type="submit" value="Submit"> </form>   Here is the error I get when I input "howd'y":  You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'y'   My expected result would be for me to be able to put apostrophes in my input, but instead I get that error.


Have two independent RV's $X$ and $Y$ sampled uniformly from $[0,1]$ and $C = (X-Y)^2$. Want $V(C$).  Rewrote as $V((X-Y)^2) = V(X^2) - 4V(X)V(Y) + V(Y^2)$ but that's too messy. Is it correct to write $\int_0^1\int_0^1 (x-\mu)^2\cdot f(,y) \cdot dxdy = \int_0^1\int_0^1 (x-1/12)^2\cdot f(x,y) \cdot dxdy$ ? Bit unsure how to evalute further.  Been awhile since I took a probability course so appreciate the help

When $U$ and $U'$ are two i.i.d. uniformly distributed random variables on $[0, 1]$, show that $$\mbox{Var} \left( (U-U')^2 \right) = 0.04 $$   I tried plugging in the formula $\mbox{Var}(U^2)=E(U^4)-E(U^2)^2$ but unable to get a solution. I guess this formula cannot be used here, but I have no idea why.


Why does a loop of irregular shape carrying current located in a magnetic field change to a circular shape?  Will this always happen assuming the wire to be flexible? Even when the force is inwards?  I think the reason might be to maximise flux but why should flux be maximised?

Does a charged rod or a shell have a magnetic potential energy when it is kept in a uniform magnetic field?  Also, can anyone quantitatively explain why a wire loop carrying current would tend to be circular?


I have a question regarding using the word it in a sentence. My question is whether I am properly using the pronoun it in the text below:     Making mistakes is an expected part of life; it is inevitable.   Thank you for your time. Any feedback is very much appreciated.

I am very confused. Unless I am mistaken, I know "it" has to be a noun of some sort, but I am unable to figure out what noun "it" is referring to.   What is "it" in the following sentence:      It is clear that Bob likes doughnuts.   Heres another couple of examples:     It is impossible to fly.


I wonder whether I can insert rows in html talbe by clicking them.  For example when I prepare this table like below, and by clicking them

           0	           1	           2

   My desired result is like this.  And I would like to know how to add any rows by clicking

           0	           1	           2

         .         .         .         .

   If someone has opinion, please let me know.  Thanks    table { border-collapse:collapse;}  td { border:solid black 1px; transition-duration:0.5s; padding: 5px}

       0	       1	       2

What is the best method in jQuery to add an additional row to a table as the last row?  Is this acceptable?  $('#myTable').append('
my data	more data
');   Are there limitations to what you can add to a table like this (such as inputs, selects, number of rows)?


Looking at the mettle test framework they have code like this:  #include <mettle.hpp> using namespace mettle;  suite<> basic("a basic suite", [](auto &_) {    _.test("a test", []() {     expect(true, equal_to(true));   });    for(int i = 0; i < 4; i++) {     _.test("test number " + std::to_string(i), [i]() {       expect(i % 2, less(2));     });   }    subsuite<>(_, "a subsuite", [](auto &_) {     _.test("a sub-test", []() {       expect(true, equal_to(true));     });   });  });   Is there something special going on with the use of underscore or is it a valid variable name?

It's common in C++ to name member variables with some kind of prefix to denote the fact that they're member variables, rather than local variables or parameters. If you've come from an MFC background, you'll probably use m_foo. I've also seen myFoo occasionally.  C# (or possibly just .NET) seems to recommend using just an underscore, as in _foo. Is this allowed by the C++ standard?


I have been using the following commands in my preamble.   \usepackage{amsthm} \theoremstyle{definition} \newtheorem{exmp}{Example}[section]  \newcounter{Examplecounter} \newenvironment{MathematicalBackground}{%   \begin{quote}%     \refstepcounter{Examplecounter}%     \textbf{Mathematical Background \arabic{Examplecounter}}%     \quad }{%   \end{quote}% }   Then in the text I am using the following.   \begin{mdframed}[backgroundcolor=brown!20]   \begin{MathematicalBackground}     ...   \end{MathematicalBackground} \end{mdframed}   I also have a different type of region in the text defined by,  \begin{exmp}   \begin{mdframed}[backgroundcolor=blue!20]     ...   \end{mdframed} \end{exmp}   With figures and tables we can create lists at the front of the document by using \listof... commands. How can I get a list of these two environments at the front of the document? I am aware of this  but still can not define my lists.   Many thanks for your help!   Edit   From the link I entered    \usepackage{thmtools} \renewcommand{\listoftheoremname}{MathematicalBackground}    Then entered the following at the start of the text.    \listoftheorems[ignoreall,show={MathematicalBackground}]   I also tried swapping MathematicalBackground for expm. All wouldn't parse, so I am definitely doing something very wrong here.

I've created my own environment example, similar to theorem. Now I want to generate a list of examples, similar to list of tables or list of figures. How can I achieve this?


What will be the query in MS Sql Server to concatenate my rows in one string , delimited by comma (Like shown below)

Consider a database table holding names, with three rows:  Peter Paul Mary   Is there an easy way to turn this into a single string of Peter, Paul, Mary?


I am in a sorta big trouble.  I ran into problems with Win8 and after fading up about it I have installed Ubuntu 12.04 LTS.  I was so frustrated I replaced Windows 8 and made a huge root directory of 9XX GB.  Please tell me how can I make three partitions of 250gigs so that I can install Windows 7 in one of them.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I'm using Google Docs quite often, and love the ability to change styles quickly by using Ctrl + Alt + NumPad shortcut.  However, with Unity this system shortcut is already used for Window placement. Is there a way to change this ?   I already had a look at the Keyboard shortcuts system settings, and tried to find something in Compiz config, but with no luck.  That's driving me crazy, I'm so used to this shortcut !

Unity (I'm using Ubuntu Trusty if it matters) has these very handy shortcuts where you can press ctrl+alt+numpad to place a window in one of 8 predetermined positions. For instance, ctrl+alt+7 will place the window in the top left quarter of the screen, resizing it appropriately. ctrl+alt+8 will place the window in the top half of the screen, maximizing horizontally; similarly, ctrl-alt-4 will place it in the left half, maximizing vertically.  This makes it very easy to "tile" windows in a non-overlapping fashion and is a huge time-saver for arranging windows.  Sadly, these shortcuts are almost unusable on compact laptops (i.e. without a numpad, so basically everything under 15" screen size), as they lack a dedicated numpad. Some have an "overlaid" numpad, accessible by some arcane key combination, which makes things very cumbersome as the sequence becomes "enable keypad - place window - disable keypad". Some others simply lack numpad functionality.  Is there a way or alternative shortcut for Unity to use on these systems?  I'm thinking something using the Super key which is already used extensively by Unity, but I couldn't find such feature.


While looking for a journal to publish my paper I noticed that one of the people I follow on ResearchGate has published his paper in      Journal of Advances in Mathematics   I never heard of this journal before yet it has impact factor of 1.244 or at least that is what it says on the journal .  Is this a real mathematics journal or fraud? Thanks.

A colleague and I recently submitted a paper to a journal with an impressive-sounding name, the "International Journal of Artificial Intelligence and Computational Research". According to ,      IJAICR is a referred [sic] journal in the field of computer science, artificial intelligence and soft computing methods.   It was accepted two days after we submitted it. That's too fast. We were suspicious. Although the journal said that all papers are peer-reviewed, we could not see how that was done in two days. Plus, we received no comments from the reviewers. Also, the submission guidelines didn't ask for a "blind" copy (without our names or any references to who we were).   But wait, there's more.  The acceptance letter asked us to send them US$300 to publish it. We did not. We've withdrawn our submission and will submit a new version of the paper to a more reputable journal in the coming months.  How might we make a better choice of respectable journals before we submit next time?


I'm using utf8_encode || utf8_decode ..., but I'm struggling to handle some special characters (é, è ê ... ,)  I'm using php.  Could someone help?

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 trying to understand if there exists a scheme $X$ and an $f \in \Gamma(X;\mathcal{O}_X)$ such that the natural map $\Gamma(X;\mathcal{O}_X)_f \to \Gamma(X_f ;\mathcal{O}_{X_f} )$ is not an equality ?  I think I need to look for something not affine, but I cannot think of the example, I will appreciate any help!

The qcqs lemma (in Ravi Vakil's notes) says that if $X$ is a quasi-compact (qc) and quasi-separated (qs) scheme, for any global section $f$, the natural map from $\Gamma(X, O_X)_f \to \Gamma(X_f, O_X)$ is an isomorphism.  (We are defining $X_f$ to be the complement of the set where $f(p) = 0$, i.e. where $f = 0$ in $O_{X,x} / m_x$. So the natural map is the one guaranteed by the universal property of localization as $f$ becomes a unit over $X_f$.)  The proof of this lemma uses in a crucial way these finiteness assumptions in order to take advantage of the willingness of localization to commute with finite products. (One builds the exact sequence describing the global sections via the sheaf axioms, plugs a finite affine cover with a finite affine cover of the overlaps into it. Then localizing this sequence expresses $\Gamma(X, O_X)_s$ as the kernel of the exact sequence describing $\Gamma(X_s, O_X)$, bootstrapping off of the case of this theorem in the affine case.)  I want counter examples in the situation when this hypothesis has been dropped.  Here is what I have been thinking so far:  I tried the example of the only qc but not qs scheme that I know: the infinite affine space with a doubled origin. The functions on this space and on any open subscheme are the same as functions on the corresponding open $\mathbb{A}^{\infty}$, since the gluing identifies the variables on a dense open set. So I don't think this will provide an example (but I am not sure - now after thinking about this I am more convinced that this example would provide a counter example, but I don't see how). Here one would (obviously) need to use that infinitely many affines are required to cover the intersection of the two $\mathbb{A}^n$ in order to produce something...   I think I found an example of a quasi-seperated non-quasi compact scheme that provides a counter example. Essentially the point is that localization doesn't commute with infinite products in general, so one can take the infinite disjoint union of $Spec Z / (2^i)$, for all $i \geq 0$, and try to invert the element $2$. $X_2 = \emptyset$, but $(\Pi Z / 2^i)[2^{-1}] \not = 0$, since for instance $(1,1,1,1, \ldots)$ is not 2-torsion.


I am doing a school coding project, in which (using Dr. Java) I code a game of rock, paper, scissors. My game asks the user for their throw, while randomly generating the computer's throw.  The code below represents my (incomplete) method for determining the winner of the game. It’s supposed to first check if the two throws are the same, then, if they are not, compare the two throws to see who won. The final else-statement is a backup, in case the user inputs an answer other that rock, paper, or scissors.   Currently, the string compAnswer is hardcoded to "rock".        if (userAnswer == compAnswer) {     System.out.println("Huh. A tie. That was... disappointing.");   win = 2; } else if (compAnswer == "rock"){  { if (userAnswer == "paper") {     System.out.println("Curses! I threw rock and lost!");     win = 0;   } else if (userAnswer == "scissors") {     System.out.println("Hah! I threw rock and crushed your scissors!");     win = 1;   }} } else {   System.out.println("...You cheater! That's not a legal throw! Off to the fire and brimstone with you!"); }    However, when I run my program, nothing gets printed- not when userAnswer gets "paper" or "scissors", or even when the answer is bogus. I’m at a loss here- why are my print statements not being triggered?

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


I am very new to programming and can't figure out the issue with my Cesar cipher my method for encryption works fine but my method for decryption is not working.  Main class  package com.company;  import java.util.Scanner;  public class Main {     public ceasarCipher ceasarCipher;      public static void main(String[] args) {          com.company.ceasarCipher utilityClass = new ceasarCipher();         int inShift;         String inString;         String encryptedString = "";          Scanner sca = new Scanner(System.in);          System.out.println("Please enter a string to encrypt");         inString = sca.nextLine();          System.out.println("=======================================================================================");         System.out.println("In this program");         System.out.println("Press 1 to encrypt your string by shifting it forward a certain amount");         System.out.println("Press 2 to decipher your string by shifting it backwards a certain amount");         System.out.println("Press 3 to give you all possible combinations of the shift in order to decipher");         System.out.println("Press 4 to exit the program");         System.out.println("=======================================================================================");          while(!sca.hasNext("x") && !sca.hasNext("X")){              int userInput;             userInput = sca.nextInt();              switch (userInput){                  case 1:                     System.out.println("Please enter the amount greater than 0 that you would like your String to be shifted forwards in order to encrypt it");                     inShift = sca.nextInt();                     System.out.println(utilityClass.ccEncrypt(inShift,inString));                 case 2:                     System.out.println("Please enter the amount greater than 0 that you would like your String to be shifted backwards in order to decipher it");                     inShift = sca.nextInt();                     System.out.println(utilityClass.ccDecipher(inShift,encryptedString));             }         }     } }   Subclass with methods  package com.company;  /**  * Created by Jake on 14/04/2017.  */ public class ceasarCipher {      private int maxVal = 26;      //private int inShift;     //private String inString;     private String letters = "abcdefghijklmnopqrstuvwxyz";      //-----------------------------------------------------------     public String ccEncrypt (int inShift, String inString) {          String encryptedString = "";         char modulo;         int pos;          inString = inString.toLowerCase();          for (int i = 0; i < inString.length(); i++) {              pos = letters.indexOf(inString.charAt(i));              modulo = this.letters.charAt((pos + inShift) % maxVal);              encryptedString += modulo;         }         return encryptedString;     }     //----------------------------------------------------------------------      public String ccDecipher (int inShift, String encryptedString) {          String decipheredString = "";         char modulo;         int pos;          for (int i = encryptedString.length() - 1; i >= 0; i--) {              pos = letters.indexOf(encryptedString.charAt(i));              modulo = this.letters.charAt((pos - inShift) % maxVal);              decipheredString += modulo;         }         return decipheredString;     }     // -----------------------------------------------------------------------      public void ccDecipherAll (String inString){      } }

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 have an audio mixing desk that I need a power supply for.   The output required is 16.8VAC 1.4 amperes. The original is discontinued but I have found one for sale that is rated 17VAC 1.2 amperes and one that is 18 VAC 2.0 amperes. Is the lower current rating a problem with the first and is the extra voltage a problem with the second?

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


I've got two javascripts on a page:   One is a script that gets some JSON from a server and then builds out some navigation markup and writes it to a div.   The other is a script that does something on click of one of the nav items.   So basically,   document.getElementById("writeNav").innerHTML += writeNav;   would replace:

 Home

   with:

 Home

 link 1

 link 2

   The Jquery, for the purpose of troubleshooting, would just launch an alert onClick of any of the ".nav-item" classes.     If I comment out the "getElementById" line and click "home" it triggers the alert.  If I don't comment it out, and click "home", it does not trigger the alert.  Why? What am I doing wrong?

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.


My terminal looks like this:    unless I uncheck "Use the system fixed width font" in which case it looks like this:      I noticed that the character spacing is off for applications other than the terminal. Am I missing fonts?

I installed Oneiric as a guest OS in VirtualBox using the Mini CD. I installed the ubuntu-desktop package and everything seems to work fine - well, except for a font issue with the terminal:    As you can see, some of the letters overlap and it's difficult to read. I checked the settings and it the checkbox "Use the system fixed width font" is checked with "Monospace | 12" selected underneath it.    Edit: running the commands mentioned in the comments:  $ fc-match "Monospace" DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" $ gconftool --get /desktop/gnome/interface/monospace_font_name Monospace 10 $ debsums ttf-dejavu-core /usr/share/doc/ttf-dejavu-core/AUTHORS                                        OK /usr/share/doc/ttf-dejavu-core/BUGS                                           OK /usr/share/doc/ttf-dejavu-core/NEWS.gz                                        OK /usr/share/doc/ttf-dejavu-core/README                                         OK /usr/share/doc/ttf-dejavu-core/changelog.Debian.gz                            OK /usr/share/doc/ttf-dejavu-core/copyright                                      OK /usr/share/doc/ttf-dejavu-core/langcover.txt.gz                               OK /usr/share/doc/ttf-dejavu-core/status.txt.gz                                  OK /usr/share/doc/ttf-dejavu-core/unicover.txt.gz                                OK /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf                      OK /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf                           OK /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf                  OK /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf                       OK /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf                     OK /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf                          OK


I want to make a c# library for my customer. But I don't want let them see the library content. My only need is to let them use library. Not seeing my library  code  in my Library:   using System;  using System.Collections.Generic;  using System.Linq;  using System.Text;  using System.Windows.Forms;   namespace Tcp1  {      public class Tcp1     {         public class Tcp        {            int a11;            string b11;            public Tcp(int a, string b)            {                a11 = a;                b11 = b;             }             private  static string Add(int a, string b)           {               string ss = a.ToString() + b;               MessageBox.Show(ss);               return ss;            }     }    } }   I need to hide the library code from customer, And I need to support the library for my customer, But I don't want my customer to  see the content of my detailed library code. I got to hide the library code & still could be used by customer at the meantime.  I am not sure what the customer call will be, Likewise:     int a;    string b;    string c;    Tcp ss = new Tcp();    c= Tcp.Add(a, b)

I wrote a windows application using C# .Net 2.0 and i want to do something which hide the source code, so when any one use refactor tool can't see the source code. I used dotfuscator but it just changed the function names but not all the source code.  UPDATE: I want to hide the source code, not because of hiding the key, but to hide how the code is working.  Thanks,


I have two raster data. They must cover each other. My problem is, one of them doesen't have prj file, therefore I don't know what is the projection of this one. I can not cover this raster with the other one. Of course, I tried define projection function several times, but I don't know which projection should I use.   I use ArcMap 10.6.1

I have a Shapefile but its coordinate system is Unknown, and there is no *.prj file.   How can I identify it now?


I received a word problem that goes like this.  A local kindergarten is thinking of making posters that show all the different ways of adding two or more integers from 1 to 9 to get a sum of 10. If there is enough space on each poster for up to 50 possible solutions, how many posters will the school need to make?  (Note: sums that contain the same number but in a different order are considered to be different; for example, 1 + 9 and 9 + 1 are two different solutions.)  What is the answer to this problem, and more importantly, how do I solve it?  To be clear, a solution such as,"1+1+1+1+1+1+1+1+1+1+1," is a valid one.  Please make your explanation somewhat thorough and be available to explain further. Thanks!


I think this:     You'll also receive parameters for authentication users via OAuth 2.0.   Should say:     You'll also receive parameters for authenticating users via OAuth 2.0.        Keep up the good work!

The sidebar of the StackApps  states:     You'll also receive parameters for authentication users via OAuth 2.0.   I believe this should read:     You'll also receive parameters for authenticating users via OAuth 2.0.


I want to make a file or folder undeletable, even the superuser can't be able to delete that file.Chattr command makes a file undeletable only if the files were in Linux filesystems (ext2,ext4). But I want to make a file undeletable which was present in ntfs filesystem.


To reproduce this problem make layout like this and then power the piston. Once the piston is extended, removing the power source will not retract it:    Since piston head block is transparent, I see no explanation for this. Also, even if it wasn't transparent, it still wouldn't power a piston. For example this doesn't power the piston:    But if I place redstone and THEN place the piston, it's powered:    It also remains powered no matter what, as long as there isn't a block update event:    I suppose this behavior can be used to make a block update detector, but in my case this sucks. I wanted such setup for automatic smooth stone generator (without any clocks):    But due to this bug, it won't work - the piston will be always extended.

I've lately become hooked into building computers in Minecraft and today I decided to build a giant hard drive. I've built HDDs before, but not at the scale I'm currently attempting, and I anticipated problems. As I was wiring some pistons, they activated and pushed forward oddly. As far as I can tell, there's nothing powering them.    I thought at first that it might be the redstone torches (top left of above pic) but they aren't powered.   Here's a top view of the same pistons. I also thought the line of redstone above  them might be the problem (middle of above pic), but when I destroy it, the pistons stay extended.  Is there a reason why my pistons are extending? If so, is there a way to get them to power (when I want them to) without disturbing the pistons above?


Is there an example of (2+2)-dimensional flat spacetime with neutral signature (i.e. (+,+,-,-))?  ...for example the metric $ds^2=(dt_1)^2+(dt_2)^2-(dx)^2-(dy)^2$,  has been studied? Are there any papers in this regard in the literature (i.e. I mean where the authors consider also the flat case)  EDITED  QUESTION

We know that space-time dimensions are 3+1 macroscopically, but what if 2+2?  Obviously it is tough to imagine two time dimensions, but mathematically we can always imagine as either having two parameters $t_1$ and $t_2$ or else in Lorentz matrix $$\eta_{00} = \eta_{11} = -1$$ and, $$\eta_{22} = \eta_{33} = 1.$$  Is there any physical reason for not taking this, like the norms become negative or something else?


Let $l_1$ and $l_2$ be the lengths of perpendicular chords of $y^2=4ax$ drawn through the vertex and $\left (l_1l_2 \right)^{\frac 43}= 4a^2\lambda (l_1^{\frac 23} + L_2^{\frac 23})$. Find $\lambda$   Let the chord be PQ where $P(t_1)$ and $Q(t_2)$  Since they subtend a right angle at the vertex $t_1t_2=-4$  Also Let OP be $l_1$ and OQ be $l_2$  $$PQ^2= l_1^2 +l_2^2$$ $$a^2(t_1^2-t_2^2)^2+4a^2 (t_1-t_2)^2=l_1^2+l_2^2$$ $$a^2(t_1-t_2)^2 \left [(t_1+t_2)^2+4\right ]=l_1^2+l_2^2$$  $$a^2(t_1^2+t_2^2+8)\left [t_1^2+t_2^2-4 \right ]=l_1^2+l_2^2$$  I couldnt solve further. Proceeding calculations are lengthy enough to make me think I am doing it wrong. How should I correctly solve it?

If $r_1,r_2$ be the length of the perpendicular chords drawn through the vertex of a parabola $y^2=4ax$, then show that $$(r_1r_2)^{4/3}=16a^2(r_1^{2/3}+r_2^{2/3})$$


The problem is to find in which value of n the $\{1,2,3,...n\}$ set can be parted in $3$ subsets such that each one has equal sum. I have looked for a lot for this answer, but I can't find anything.Here is a link [1]:.   The minimum such number is $5$. $\{5\},\{1,4\},\{2,3\}$.  I think that if this sum $1+2+3+...+n$ is divisible by $3$ and $n\geq3$ , then it is possible. If $1+...+n$ is equal to $3a$, then if I show that there exist $2$ subsets such that each one has its elements sum equal to $a$, then problem will be solved, I can show the that there exist one, but not the second.

Let $p$ be a positive integer.  For each nonnegative integer $k$, write $[k]$ for the set $\{0,1,2,\ldots,k\}$.  Also, we define $[-1]:=\emptyset$.  We say that an integer $k\geq -1$ is $p$-splittable if there is a partition of $[k]$ into $p$ subsets $A_1$, $A_2$, $\ldots$, $A_p$ such that $\sum_{x\in A_1}\,x=\sum_{x\in A_2}\,x=\ldots=\sum_{x\in A_p}\,x$ (i.e., these sets have the same sum).  Such a partition $\left\{A_1,A_2,\ldots,A_p\right\}$ is called a $p$-splitting of $[k]$. What are all $p$-splittable integers for a given $p$? How many $p$-splittings of $[k]$ are there for each of these available $k$'s?  If the exact number of $p$-splittings of $[k]$ is not easily computable, then what is the asymptotic answer?  Clearly, $k=-1$ and $k=0$ are $p$-splittable.  We can also ignore the trivial case $p=1$.  We know that, if $p=2$, then all $p$-splittable numbers are of the forms $4t-1$ and $4t$, where $t$ is a nonnegative integer.  If $p$ is an odd prime, then all $p$-splittable numbers are integers of the forms $tp-1$ and $tp$, where $t\in\{0,2,3,4,\ldots\}$. For $p=2$, we can show that the number of $2$-splittings of a $2$-splittable integer $k$ is given by the coefficient of $x^{\frac{k(k+1)}{4}}$ in the expansion of $\prod_{r=1}^k\,\left(1+x^r\right)$.  For example, if $k=3$, there are two $2$-splittings of $[3]$, namely, $\big\{\{0,1,2\},\{3\}\big\}$ and $\big\{\{1,2\},\{0,3\}\big\}$, whereas $$\prod_{r=1}^3\,\left(1+x^r\right)=1+x+x^2+2x^3+x^4+x^5+x^6$$ whose coefficient of $x^{\frac{k(k+1)}{4}}=x^3$ is also $2$.  Similarly, there are $2$, $8$, and $14$ $2$-spittings of $[k]$ for $k=4$, $k=7$, and $k=8$, respectively.  I do not know if there is any closed form for this coefficient for an arbitrary $2$-splittable $k$. I conjecture the following: (1) If $p$ is odd, then, for any $j\in\{-1,0,1,2,\ldots,p-2\}$ such that $p\mid j(j+1)$, every integer of the form $tp+j$, where $t\in\{2,3,4,\ldots\}$, is $p$-splittable, and nothing else (except $-1$ and $0$) is $p$-splittable. (2) If $p$ is even, then, for any $j\in\{-1,0,1,2,\ldots,2p-2\}$ such that $2p\mid j(j+1)$, every integer of the form $2tp+j$, where $t$ is a positive integer, is $p$-splittable, and nothing else (except $-1$ and $0$) is $p$-splittable. This conjecture is true, at least, if $p$ is a prime power (where $j=-1$ and $j=0$ are the only possible choices of $j$).  If you can show that (1) holds for $t=2$ and for $t=3$, and that (2) holds for $t=1$, then you are done.  It is worth noting that, if $k$ is $p$-splittable, then $k+2p$ is $p$-splittable. Inspiration:  P.S.  I include $k=0$ and $k=-1$ for the sake of completeness.  There is nothing subtle about these numbers.


Why this query didn't work    update gaji set jumlah_gaji='10' where jumlah_gaji = (select max(jumlah_gaji) from gaji);

I have a table story_category in my database with corrupt entries. The next query returns the corrupt entries:  SELECT *  FROM  story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category INNER JOIN         story_category ON category_id=category.id);   I tried to delete them executing:  DELETE FROM story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category        INNER JOIN story_category ON category_id=category.id);   But I get the next error:      #1093 - You can't specify target table 'story_category' for update in FROM clause    How can I overcome this?


I'm trying to find a way to authoritatively show whether a command prompt is running elevated or not, from the command prompt (CMD.exe), on a stock Windows installation. Most methods I've seen rely on non-native tools, third-party software, or proxy indicators which may not necessarily be reliable or compatible across all systems. I'm looking for something more along the lines of getting the system itself to explicitly state that the current session is elevated, or to show via command line that the current process is being run at an Integrity Level of High.  An example (but not necessarily absolute definition) of something that would be acceptable, would be a command that gets and displays the current PID followed by another command (if not same) that shows the Integrity Level for that PID. Commands which rely on the implications of a given output (e.g.: assuming the session is elevated if you can run certain commands, or determining elevation status based on the window's title bar) are not acceptable for this purpose.  Solutions should be compatible down to Windows 7 Pro SP0. Though these systems do have PowerShell, it is not an option for this purpose. Software not built-in to the OS is not an option.

I am looking to write a script that takes user input, then makes system wide changes. I need this to be very generic, but simply put, at the top, I need it to check to see if it's being run 'As an Administrator'. If it's not, then I want to display a message to tell them that; if it is, I want it to continue on. Is there a constant way to verify this? I am not looking to start a new session as the Administrator, I just want to detect if it's currently run as admin


I'm trying to reproduce this text in Latex  On the left you see what I could achieve by now, with the following LaTeX code: \polyring{\mathbb R}{x}_{/\ideal{x^2+1}}\mathrel{\mathop{\rightleftarrows}^{\mathrm{\alpha}}_{\mathrm{\beta}}} \mathbb C  Where \polyring and \ideal are defined as follows: \newcommand{\polyring}[2]{\ensuremath{#1\big[#2\big]}} \newcommand{\ideal}[1]{\ensuremath{\langle #1\rangle}}  Instead on the right you see the result I'd like to achieve. I couldn't find anything that would satisfy my needs. TIA.

I want to to show a two-way relations between A and B, where the arrow from A to B should have some text on top of it, while the relation (arrow) from B back to A should have some text on its bottom.  Which symbols are available that could be used for that?


Many DSLRs have a "fine focus adjustment" option, stored in the camera per lens.  Why is it that some lenses need this?   Why do some lenses not project a focused image onto the sensor when the camera body has adjusted it to a point where it believes focus is correct?   I assume this is a side effect of NOT using the sensor itself to confirm focus, using the phase detection array instead...

I can understand body focusing problems, but I can't imagine why lens might cause front or back focus. I have two third party manufacturer lenses for my Nikon: one is front-focusing, the other is back-focusing. The body works fine on five other lenses, 4 of those from Nikon.  Correct me if I'm wrong: the phase detection focus sensor gathers light from different angles and steers the motor back or forth, so that images on focus point (be it stripe or cross) align. Given that everything is right with the body, the system of mirrors creates the same image on the autofocus sensor as it does on the film or digital sensor.  Now, assuming body mirrors are calibrated, either the camera algorithm didn't move the motor, when its focus sensor still detected misalignment or the lens moved between mirror going up and shutter firing.  I can understand that some motors might not be precise, but that would give inconsistent focus depending on the direction of the last correction. I can understand poor quality lens, that would blur parts of the image, give chromatic abberations etc. I can understand non-planar focus shape, but it still doesn't explain why the image on the focus point would not be in focus. I can understand moire effects, but that is not the case I observed.  I see no way that the lens can create a consistent focus shift other than body doing this on purpose. How can lens cause front or back focus?


I need to calculate the integral $$\frac{1}{2\pi}\int_{0}^{2\pi}\log{|a-e^{i\theta}|}d\theta$$  When $|a|> 1$, I can show it equals $\log|a|$. But I failed to handle the situation when $|a|\leqslant 1$. I know it should be $0$.  I tried to use $\log(a-z)$, but when $|a|\leqslant 1$, such $\log$ can not be defined. So anyone can help?    Updated: the second situation should be $|a|<1$.

I have encountered this integral:$$\frac{1}{2\pi}\int_0^{2\pi}\log|\exp(i\theta)-a|\text{d}\theta=0$$ where $|a|<1$ in proving Jensen's formula. because I am stupid, I don't know why it is equal $0$, I can't work it out. After a moment,I find a smart way in Stein's book. After the change of variable $\theta \mapsto -\theta$,the above integral becomes:$$\frac{1}{2\pi}\int_0^{2\pi}\log|1-a\exp(i\theta)|\text{d}\theta$$ and use Cauchy's integral formulas to $F(z)=1-az$ in $\Omega \supset \overline{\Bbb{D}}=\{z\in\Bbb{C}:|z|\leq 1\}$:$$\log F(0)=\frac{1}{2\pi i}\int_{\partial \Bbb{D} }\frac{\log F(\zeta)}{\zeta}\text{d}\zeta$$ we get $$0=\log|F(0)|=\frac{1}{2\pi}\int_0^{2\pi}\log(1-a\exp(i\theta))\text{d}\theta$$  But I still feel uncomfortable. I think the reason maybe :  I can't calculate it directly  I don't know why it equal 0 (or I can't see it apparently)  Please help me, thanks very much.


The main_directory includes 0001 0102 0203 ... sub-directories. The sub-directories include lots of directories.  I need to delete all sub-directories except several ones whose names are "abc", "bcd" and "123", for example.  How can do this deleting processing using command?

My top-level directory is data. data includes several directories and these directories have sub-directories. I need to remove all files and directories inside data/ except several files in some directories.   For example, data includes the directories 100 and 101. I just want to keep a.txt and b.txt files in 100/ and c.txt and d.txt files in 101/ while removing all other files and directories in 100 and 101.  Example:  . ├── 100 │   ├── a.txt │   ├── b.txt │   ├── c.txt │   └── d.txt └── 101     ├── a.txt     ├── b.txt     ├── c.txt     └── d.txt   I use rm -rf !(a.txt|b.txt) command but I can't apply this command for each directory automatically.


As part of my Tikz diagram, partly made of small orange squares, I want a title phrase including the orange square at end of it. I must be missing the "node" concept because the code below doesn't work - the phrase "all men with haplotype" over-writes the orange square instead of prefixing it.   Can someone kindly explain 1) How can I do what I want? 2) What is the explanation for the behavior I see? 3) Suppose I wanted an explanatory phrase with an colored square or circle, or two of them, interspersed in the text. Is there a simple way to do that?    \begin{tikzpicture}[ rect/.style={inner sep=0pt,minimum size=2mm,draw,rectangle}, alive/.style={fill=orange,draw}] %% IBS enclosure for rectangle haplotype \draw (0,0) rectangle (6,5); \node[rect,alive,right](title) at (5,4.5) {}; \node[left of=title] {all men with haplotype}; \end{tikzpicture}

In the PGF/TikZ manual, sometimes I see the option right of=somenode instead of right=of somenode. They look very similar, but the effects are different.  The distance between nodes positioned with the latter option is boundary-to-boundary, as stated in the manual. However, with the first option, it seems that the distance is shorter. I couldn't find any explanation of the first option in the manual.  My question is: what is the difference between the two options? Is there any explanation in the manual that I missed?


I am trying out the following precise definition of a limit but seemed to be stuck at the following step below:  Given that:  \begin{align}  \lim_{x \to a} f(x) = L \end{align}  The precise definition is expressed as follows: \begin{align} 0<|x-a|< \delta \end{align} \begin{align} |f(x)-L|< \epsilon \end{align} I wanted to show that following if: \begin{align}  \lim_{x \to9} \sqrt{x} = 3 \end{align}  Then prove using the precise limit definition that  \begin{align} \sqrt{9} = 3 \end{align}  I attempted to subsitute with the following: \begin{align} 0<|x-9|<\delta \end{align} \begin{align} |\sqrt{x}-3|<\epsilon \end{align}  To make it look similar to the top one I changed the bottom to this form: \begin{align} |\frac{x-9}{\sqrt{x}+3}|<\epsilon \end{align}  But now I am stuck as I can't express epsilon nor delta, any clues where to go from here?

Prove: $\displaystyle\lim_{x\to9}\sqrt x=3$ using Cauchy's definition for a limit.   After doing the scratch work I get that: $\delta=\epsilon^2+6\epsilon$, so going back, I have to show that $|x-9|<\delta\Rightarrow |\sqrt x -3|<\epsilon$.  So we have: $\epsilon^2+6\epsilon-9<x<\epsilon^2+6\epsilon+9 \iff \epsilon^2+6\epsilon-9<x<(\epsilon+3)^2$ but what about the left side of the inequality? How can I simplify it to $(\epsilon-3)^2$?  Edit: if $\delta=3\epsilon$ then how can you justify the move from: $3\epsilon-9<x<3\epsilon +9$ to $\epsilon-3<\sqrt x<\epsilon +3$?


I am a first year graduate student in a completely theoretical field. How does one go about collaborating online or otherwise with researchers from other institutes/universities? In particular, if I am interested in a problem or an area which is not very well represented at my current institution, how do I approach researchers from other institutes to start a collaboration assuming I have the basic background to start research? Should I have a very particular problem/idea in mind while contacting a potential collaborator, or is it unusual if I approach a researcher just because I am interested in his work and would like to learn more and work on it with no particular problem in mind?

Quite often, graduate level research is done by researchers from different institutions, whether different universities or cooperation between a university and a private corporation.   How do the researchers get to know each other? How does the collaboration begin?


I have the following equations: \begin{equation} {1\over f(x,y)} {\partial f(x,y) \over \partial x} \alpha(x,y) + {1\over f(x,y)} {\partial f(x,y) \over \partial y} \beta(x,y) = \gamma(x,y) \end{equation} Where $\alpha(x,y)$, $\beta(x,y)$ and $\gamma(x,y)$ are exactly known functions. What I need to find is $f(x,y)$. Can anyone help me find a solution? Or are there any assumptions (other than $f(x,y) = g(x)h(y)$ that will allow me to solve this analytically? Is it a standard equation that I haven't come across? If no analytical solution exists can it be solved numerically - if so how would I go about doing that?

I have the following equations: \begin{equation} {1\over f(x,y)} {\partial f(x,y) \over \partial x} \alpha(x,y) + {1\over f(x,y)} {\partial f(x,y) \over \partial y} \beta(x,y) = \gamma(x,y) \end{equation} Where $\alpha(x,y)$, $\beta(x,y)$ and $\gamma(x,y)$ are exactly known functions. What I need to find is $f(x,y)$. Can anyone help me find a solution? Or are there any assumptions (other than $f(x,y) = g(x)h(y)$ that will allow me to solve this analytically? Is it a standard equation that I haven't come across? Many thanks guys!


I am new to ubuntu and my friend told me to SSH into my IPod so i can put/remove songs on it. I've been succesfully ssh'ing into it but i do not know how to copy and paste my songs from my Home Directory into my iPod. Any help would be greatly appreciated. I do know basic commands like ls, cd, pwd, etc. I do know the cp command but cannot utilize it.

I am trying to get some files off of my school Linux account using ssh. I have got the connection to work using:  scp <school_server>: ~/folder I want ~/where I want to go.    But when it goes to transfer folder it gives me the message:  not a regular file    The file contains .java files, and I want the whole folder.


I have a form with a button that is able to dynamically add a div that contains a paragraph and a "remove" button:   <form></form>   <button onclick="addParagraph()">Add Paragraph</button>     Unfortunately, if I add more than one div and click a remove button, it removes all of the dynamically generated divs. How can I get it so it just removes the one div?  I have also tried $(this).closest("div").remove();, but same result.

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 have multiple domain names with same content. Some with a different language and some with the same. I have a main website with a hotel name that has been around for some years now. I have recently bought websites with a better name related to area.   I don't want to change the main site as it would disrupt business and its doing OK anyway, but I do want to target certain countries better with the new domains with the new TLDs.   I will be using the same content and 2 domains the same language uk & USA. How do I tell google that this is the same website although the domain names are quite different from the original domain?

I have a client with a dozen territorial domains, like mydomain.co.uk, mydomain.fr, mydomain.de, etc Most of these domains hold a different language of the same dynamic content (shop), but some, like co.uk and .com, have the same language and content, except for some content customized to each country/domain in the front page, contact and other pages.  I am aware that we should use the canonical meta tag to mark those duplicated contents, but, we want the co.uk to be present in UK ( indexed in google.co.uk ) and the .com to be present in US and other countries, for example, or least that is the goal.  Is there anything we can do to "help" google determine the geographical meaning of each domain? If we mark with canonical tag the .com and co.uk sites, do you know how google will decide which one to show on a given search?


The Thief Rogue's 13th level feature allows them to ignore requirements on the use of magic items:  Use Magic Device. By 13th level, you have learned enough about the workings of magic that you can improvise the use of items even when they are not intended for you. You ignore all class, race, and level requirements on the use of magic items.  I've found examples of items that have class requirements (e.g. a Rod of the Pact Keeper) and of items that have race requirements (e.g. a Moonblade). However, I couldn't find any examples of items that have level-based requirements on their use. Are there any, or is this a redundant (/future-proofing) clause in the feature? Items from any published 5th edition material would be welcome as answers; if the only examples are in UA that would be useful information as well.

The 's  feature (E:RftLW, p. 58; WGtE, p. 180) states:     [...] You ignore all class, race, spell, and level requirements on attuning to or using magic items.   Class and race requirements are relatively intuitive, additionally, since an Artificer is able to cast spells they can already attune to items that require you to be a spellcaster. But there's still some questions:   Can they use a spell scroll of a spell not on their spell list? Is this one of the four requirements ignored? What are level and spell requirements; what are some examples?


I need to add a randomly generated number to an object state, keeping track of where in the array the object is by a count (acc_count) that is written to a text file each time a new object is added to the array. After the random number is added to the array as (.set/.getUserID) I want to print all userIDs in the array of objects, however I get the error [java.lang.NullPointerException]. Why is this happening?   public class Test {  public static int acc_count = 0;  public static void main(String[] args) throws IOException{      Accounts[] account = new Accounts[2000];     ArrayList<Integer> list = new ArrayList<Integer>();      for (int i = 1000; i < 9999; i++) {         list.add(new Integer(i));     }      Collections.shuffle(list);      FileReader fr = new FileReader("Instance Counter.txt");     BufferedReader br = new BufferedReader(fr);     FileWriter fw = new FileWriter("Instance Counter.txt", true);      String line = br.readLine();     acc_count = Integer.parseInt(line);     acc_count++;     String l = String.valueOf(acc_count);      PrintWriter pw = new PrintWriter("Instance Counter.txt");     pw.close();      fw.write(l);     fw.close();        account[acc_count-1] = new Accounts();     account[acc_count-1].setUserID(list.get(acc_count));           for (int f = 0; f < account.length; f ++){             System.out.println(account[f].getUserID());          }   }   }

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?


That is to check to see if a number is a prime we check if it is divisible by previous primes.  However if the number we are checking is number, and prime * prime > number, where number is the number we are checking then...  we know all primes after this will not be a factor of number.  Why is this conceptually?  // simple code implementing this concept function findPrimes(N) {   const primes = [2];   main: for (let i = 3; i <= N; i += 2) {     for (let j = 1, prime; prime = primes[j++];) {       if (prime * prime > i) break; // this line here       if (i % prime === 0) continue main;     }     primes.push(i);   }   return primes; }

I was reading about primality test and at the  page it said that we just have to test the divisors of $n$ from $2$ to $\sqrt n$, but look at this number:  $$7551935939 = 35099 \cdot 215161$$  Since $\sqrt {7551935939} \approx 86901,875$ so basically I would only have to check the divisors from $2$ to $90000$, but one of the divisors ($215161$) is greater than $90000$.  Also, do you guys have some ideas to improme my primality test?


i am getting Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at  this.commaPos = Name.indexOf("   "); line of my project. The concept is that i have 5 JButtons of ships, and when you click, you place the ship on a Board for a battleship game. Lot of time now i am stuck at this. Any ideas ? Thank you. !  EDIT: I changed the name of String name to String nname. Now i get the same error at the next line. this.commaPos = nname.indexOf(",");   public void stateChanged(ChangeEvent event)   {      JButton currentButton = (JButton)event.getSource();       System.out.println("STATE CHANGED");     String nname = currentButton.getName();     this.commaPos = nname.indexOf(",");     int x = Integer.parseInt(nname.substring(0, commaPos));     int y = Integer.parseInt(nname.substring(commaPos + 1));      checkDeletable(x, y);      if (currentButton.getName().equals(""))       return;     if (this.shipSelected == null) {       return;     }     this.shipSelected.setPos(x, y);      clearOldCoords();     boolean valid = getShipCoords();     paintShip(valid);      if ((currentButton.isFocusOwner()) && (valid))       placeShip();   }   Here i use the change listener:  {  for (int y = 0; y < 10; y++) {         for (int x = 0; x < 10; x ++) {             this.myBoard[x][y] = new JButton();             this.myBoard[x][y].setMargin(margins);              this.myBoard[x][y].setToolTipText(x + "," + y);             this.myBoard[x][y].setName(null);             this.myBoard[x][y].setIcon(this.sea);             this.myBoard[x][y].addChangeListener(this);             this.myBoard[x][y].addMouseListener(this);              myBoard.add(this.myBoard[x][y]);          }     } }


Any suggestions on how to increase cycles rendering quality? I would like to have this image as HQ as possible.

I know that this question is a bit old or maybe overdone, but I'm running the latest edition of Blender and when I use the Cycles engine I get really fuzzy results and I can't find a simple, non-compromising solution to the quality.  I don't know exactly what I'm doing wrong here, but I'm sure others share my frustration.  Leaving everything in default settings, I started a new project and switched to the Cycles render.  I duplicated the cube and set colors for two Diffuse BSDF shaders, then went ahead and made walls and a floor all sharing the same diffuse shader.  I made two windows to emit blue light.  The screenshot has gaps between the walls because of the setup:  I'm aware that it's considered very incomplete and many have come to terms with some amount of noise, but is this normal?  Furthermore, with default settings or not, I can't change the amount of noise produced.  Supposedly, using "progressively refine" in the rendering tab should make it refine itself indefinitely, however Cycles only counts to 10 refines and then stops, creating a render which is a pixel-perfect match of the ordinary rendering method when it's completed.  I understand that there are tricks that can be used to reduce noise, but at the cost of extra processing time and usually small quality conflicts, like blurring.  My question essentially boils down to is this Cycles' current limit?


Is there any way to determine if a substance is radioactive and if so, is there any way to determine in what form the radiation will appear, like β- or α-radiation? For example, if I am making a decay chain, is there any way to determine if the daughter isotope is radioactive without searching for information on the internet (or testing it, of course)?

Is there any way to predict the half-lives of radioactive isotopes from theory (that is, using only theoretical considerations, without using data about the decay)? For example, could we predict that the half life of Carbon-14 is roughly 5700 years?


Do I have to calculate it all out? That would be a pretty long calculation and boring... Is there an easier ways to find the real part? Thanks in advance

How would one convert $(1+i)^n$ to polar form?  I've heard about de Morgan's law but I don't know how to apply it here.


I'm working on a bash script which requires root privileges, but which I'd like to give the ability to notify a non-root user of certain alerts via notify-send in GNOME (or any other desktop shell supporting that command). As expected, simply invoking notify-send from a root shell doesn't display a notification on the non-root user's desktop.  I've tried to invoke the command via:  su -c "notify-send 'my message'" -s /bin/sh someuser   (as well as using /bin/bash, /usr/zsh), but neither of these has had any effect.  How can I invoke notify-send from a root shell so that it shows a notification on a (specified) non-root user's desktop?

I am using Arch Linux with KDE/Awesome WM. I am trying to get  notify-send to work with cron.   I have tried setting DISPLAY/XAUTHORITY variables, and running notify-send with "sudo -u", all without result.  I am able to call notify-send interactively from the session and get notifications.  FWIW, the cron job is running fine which I verified by echoing stuff to a temporary file. It is just the "notify-send" that fails to work.  Code:  [matrix@morpheus ~]$ crontab -l * * * * *  /home/matrix/scripts/notify.sh  [matrix@morpheus ~]$ cat /home/matrix/scripts/notify.sh #!/bin/bash export DISPLAY=127.0.0.1:0.0 export XAUTHORITY=/home/matrix/.Xauthority echo "testing cron" >/tmp/crontest sudo -u matrix /usr/bin/notify-send "hello" echo "now tested notify-send" >>/tmp/crontest  [matrix@morpheus ~]$ cat /tmp/crontest testing cron now tested notify-send  [matrix@morpheus ~]$    As you can see the echo before & after notify-send worked. Also I have tried setting DISPLAY=:0.0   UPDATE: I searched a bit more and  needs to be set. And after hardcoding this using the value I got from my interactive session, the tiny little "hello" message started popping up on the screen every minute!   But the catch is this variable is not permanent per that post, so I'll have try the the named pipe solution suggested there.   [matrix@morpheus ~]$ cat scripts/notify.sh #!/bin/bash export DISPLAY=127.0.0.1:0.0 export XAUTHORITY=/home/matrix/.Xauthority export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-BouFPQKgqg,guid=64b483d7678f2196e780849752e67d3c echo "testing cron" >/tmp/crontest /usr/bin/notify-send "hello" echo "now tested notify-send" >>/tmp/crontest   Since cron doesn't seem to support notify-send (at least not directly) is there some other notification system that is more cron friendly that I can use?


PCA method finds the covariance between data vectors, where each data vector includes observations of different variables (dimensions). So if the data matrix has variables in columns and observations in rows, then we find the covariance of rows. Right? Does it make sense to do PCA by finding the covariance between different dimensions instead? In the above dataset representation, it means to find covraince between columns. I am asking this, because I found in some standard libraries, the algorithm performs the latter instead.

I have a $20\times100$ matrix $X$, containing my $N=20$ samples in the $D=100$-dimensional space. I now wish to code up my own principal component analysis (PCA) in Matlab. I demean $X$ to $X_0$ first.  I read from someone's code that in such scenarios where we have more dimensions than observations, we no longer eigen-decompose the $X_0$'s covariance matrix. Instead, we eigen-decompose $\frac{1}{N-1}X_0X_0^T$. Why is it correct?  The normal covariance matrix is of size $D\times D$, each element of which tells us the covariance between two dimensions. To me, $\frac{1}{N-1}X_0X_0^T$ is not even of the correct dimensions! It is $N\times N$ matrix, so what would it tell us? Covariance between two observations?!


In Xanathar's Guide to Everything, the Path of the Zealot feature Divine Fury has been  to an effect triggered when the first creature is hit by a successful attack on each of the Barbarian's turns during a rage.     Divine Fury (XGtE, page 11)      Starting when you choose this path at 3rd level, you can channel divine fury into your weapon strikes. While you're raging, the first creature you hit on each of your turns with a weapon attack takes extra damage equal to 1d6 + half your barbarian level. The extra damage is necrotic or radiant; you choose the type of damage when you gain this feature.   The Player's Handbook notes on page 196 that:     If the attack involves other damage dice, such as from the rogue's Sneak Attack feature, you roll those dice twice as well.   If the attack that triggers Divine Fury is a critical hit, is a Zealot Barbarian allowed to roll 2d6 instead of 1d6? I feel that this question is sufficiently distinct from  because (a) part of the uncertainty is the result of the ability previously being an aura, and (b) it seems like a secondary effect that isn't an intrinsic part of the attack (the first attack succeeding is merely the condition that triggers it), like a Paladin's Divine Smite or a Rogue's Sneak Attack.

I'm a bit confused on how extra damage works for critical hits. Let's take the following example: A thief with sneak attack rolls a crit. I'm under the impression he rolls double his normal attack damage dice AND double his Sneak Attack damage dice. Is this accurate? Another example, I finished DM-ing my first campaign recently. The Giant Spider enemy monster has an melee attack that causes a constitution saving throw. If the player fails, the enemy rolls an additional 2D8 of damage. In this situation, if there was a critical hit, and the player failed their saving throw, would I also roll double dice on the additional damage? Or is that considered a separate attack?


How did the Red Skull on Earth get the Tessaract if Odin took it and locked it away in the weapons vault on Asgard after taking it from the frost giants in the first war? [avengers]

Wikis say that the Tesseract came to Earth accidentally. How exactly, did it come to Earth?