I want to loop over list with indexes, while looping I want for loop to consider both start index and last index, although it respect start index it does not respect last index. The code I am trying is this:  arr = [0,1,2,3,4,5,6,7,8,9]  for i in arr[4:8]:         print(i)   Actual Result:  4 5 6 7   Desired Result:  4 5 6 7 8

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


Having troubles breaking up and regrouping my list so that information about a single airline company and it's fees are in one list element, by a loop, with every 6 elements becoming an element on its own.  myList = ['Southwest', '0', '0', '0', '0', 'Yes!', 'JetBlue', '20', '35', '75', '125', 'Yikes']   (This list goes on for 6 airlines in total, there's 2 listed here, the list is in order of Airline name, fees(4), and then a short word describing the value)  I need to group Southwest, 0, 0, 0, 0, Yes! together as an element.  Then group JetBlue, 20, 35, 75, 125, Yikes together as an element.  Then I will do this for 4 more airlines. I obviously want to use a loop since it's multiple airlines.

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


$\mid\sum_{i=1}^{n} x_i\mid\leq \sum_{i=1}^{n}\mid x_i\mid$   If $n$ is even we will divide the sum into groups of $2$ $x$'s namely $\mid x+x \mid \leq \mid x\mid+\mid x \mid$ and will repeat the process to get $\mid\sum_{i=1}^{n} x_i\mid\leq \sum_{i=1}^{n}\mid x_i\mid$  If $n$ is odd, we will divide the sum into an even number of $x$'s called $a$ and the leftover $x$ called $b$, by using the proof for even $n$ and the triangle inequality   $\mid a+b\mid\leq \mid a \mid +\mid b \mid= \mid\sum_{i=1}^{n} x_i\mid\leq \sum_{i=1}^{n}\mid x_i\mid$  Is the proof valid?

I am trying to prove: $P(n): |x_1| + \cdots + |x_n| \leq |x_1 + \cdots +x_n|$ for all natural numbers $n$. The $x_i$ are real numbers.  Base: Let $n =1$:    we have $|x_1| \leq |x_1|$ which is clearly true  Step: Let $k$ exist in the integers such that $k \geq 1$ and assume $P(k)$ is true.  This is where I am lost. I do not see how to leverage the induction hypothesis.  Here is my latest approach:  Can you do the following in the induction step: Let $Y$ = |$x_1$ +...+$x_n$| and Let $Z$ = |$x_1$| +...+ |$x_n$| Then we have: |$Y$ + $x_n+1$| $\leq$ $Z$ + |$x_n+1$|. $Y$ $\leq$ $Z$ from the induction step, and then from the base case this is just another triangle inequality. End of proof.


Given two random variables $X,Y$, it is well known that   $\Pr[ x_1 < X \leq x_2, y_1 < Y \leq y_2]  = F_{X,Y}(x_2,y_2) - F_{X,Y}(x_1, y_2) - F_{X,Y}(x_2, x_1) + F_{X,Y}(x_1, y_1)$  Where $F_{XY}$ is the joint CDF of $X,Y$.  Is there a generalization of the above to three random variables $X,Y,Z$?  To $n$ variables $X_1, \ldots, X_n$?  I have looked at a few probability references but I couldn't find any.

How can I obtain an expression of $P([a_1,b_1]\times [a_2,b_2]\times...\times[a_k,b_k])$ knowing that $F(x_1,...,x_k)=P((-\infty,x_1]\times (-\infty,x_2]\times...\times(-\infty,x_k])$?  I solve the problem for $k=2$. $P([a_1,b_1]\times [a_2,b_2])=F(b_1,b_2)+F(a_1-,a_2-)-F(a_1-,b_2-)-F(b_1-,a_2-)$.    But I dont know how to do it for any $k$.  Thanks a lot :)


DELETE from Table WHERE Date > GETDATE();   GETDATE() includes time.  Instead of getting  2011-01-26 14:58:21.637   How can I get:  2011-01-26 00:00:00.000

SELECT GETDATE()   Returns: 2008-09-22 15:24:13.790  I want that date part without the time part: 2008-09-22 00:00:00.000  How can I get that?


My fiance is planning to visit me in Wales within the next couple of months for a period of 5-6 months. Will he need entry clearance and what are chances of him being turned away?

Everything I've seen points to no (and I would love that to be true since applying for a visa online costs money) but I'm worried about getting refused due to the length of time I wish to stay, which is 6 months.  I went to university in the UK on a Tier 4 visa, but have never just been a tourist which is what I would like to do now. Since graduating, I have started working but am underwhelmed and would love to travel again. My original plan was Australia but now I would like to see the rest of the UK as well beforehand.  If I arrived with the following, would I be refused entry simply for not applying online?: an approved Australian work & holiday visa, a mini itinerary, bank statements for the last 6 months.


I'm trying to run a .deb file with the latest version of opera in the terminal. I get the following output:   Failed to execute process './opera-stable_41.0.2353.46_amd64.deb'. Reason: exec: Exec format error The file './opera-stable_41.0.2353.46_amd64.deb' is marked as an executable but could not be run by the operating system.   Any help is much appriciated!

How do I install a .deb file via the command line?


I have a Huwaei data card and Aircel SIM. I don't have internet plan or balance in my prepaid SIM but whenever I connect Internet it gets connected and windows shows Internet access.  and in fact I don't have internet access it just shows Internet access.    My question is how windows detects Internet connection ?

In Windows 7, the notification area networking icon will show an error indicator if there is no internet access , and the error icon goes away once there is a successful connection to the internet . Sometimes, if the WiFi connection requires an in-browser authentication step, like on many guest networks in hotels or universities, then the following pop-up bubble appears, saying as much:    How does Windows know whether or not it has a successful internet connection? Presumably it is checking some online Microsoft service to see whether it has a successful connection, gets redirected to some other page, or doesn't get any response at all, but I haven't seen anywhere that this process or the services used are documented. Can anybody explain how this works? I would prefer answers that refer to facts, rather than just guessing, but if you have a really good guess, then go for it.     This question was a .   Read the May 16th, 2011  for more details or  Question of the Week.


I have Collection with objects which I want to persist to the file:  private List< TestPart > testParts;   Class TestPart is extending Abstract class and two interfaces. Is it possible to write that kind of collection to the file? I tried to use jaxb/kryo - without effect.  Class TestPart is not implementing Serializable interface and I can't change it.  I should also mention that class TestPart has a references to the other not serializable classes.  Any ideas how to save data like this?  Thanks in advance.

I have:  class MyClass extends MyClass2 implements Serializable {   //... }   In MyClass2 is a property that is not serializable. How can I serialize (and de-serialize) this object?  Correction: MyClass2 is, of course, not an interface but a class.


Let $v \in L^1_\text{loc}(\mathbb{R})$ weakly differentiable, $b\in \mathbb{R} \setminus \{0\} $ constant and $u:\mathbb{R}^2 \to \mathbb{R}$ defined by $u(x,t):= v(x-bt)$.  Show that $u$ has weak derivatives $ \partial_x u$ and $ \partial_t u$ which satisfy the transport equation $\partial_t u + b \partial_x u = 0$ almost everywhere.  I know the definition of the weak derivative, but since I don´t have any explicit function given I don´t know how to test it. I also wonder if there is a chain rule for weak derivatives, since $u$ is a concatenation of $v$ with $x-bt$.   Could anyone help me out with this problem? Thank you very much in advance!

I am stuck on the following problem that says:       a) Find a weak formulation for the partial differential equation $${\partial u\over\partial t\ }+ c{\partial u \over \partial x\ }=0$$    b) Show that $u=f(x-ct)$ is a generalized solution of $${\partial u\over\partial t\ }+ c{\partial u \over \partial x\ }=0$$ for any distribution $f$    My Attempt:   I know that in order to find a weak form of a pde, we need to multiply it by a test function, then integrate it. Also, to find a generalized solution, we need to find a weak solution and just multiply it by the Heaviside function.  Let's take any test function $\phi $, then we have (integrating by parts second part of the integral) $$\int_{\Omega } ( {\partial u\over\partial t\ }+ c{\partial u \over \partial x\ })*\phi(x) dx= \int_{\Omega } {\partial u\over \partial t}\phi(x) dx - c\int_{\Omega } u(x,t)\phi'(x)dx$$ where $\phi $ vanishes at boundaries. So, is it the final form or can we proceed further? And how am I supposed to find a generalized solution?  Can someone help me out? Thanks in advance for your time.


Can cosmic aether be considered analogous to higgs field? Higgs field remains (almost) consistent throughout.

As of this writing it has been made clear to me that classical physics' Luminiferous aether was a terriblly poor discriptor of space. With the advent of Special Relativity and General Relativity, that aether ceased to be applicable. Today I began reading on the Higgs boson, and the Higgs field. How are those theories different from or similar to the seemingly irrational Luminiferous aether?  P.S. I am a first year student at Bakersfield Community College. If this question seems naive, you now have an explanation.  (EDIT) To me the similarity rests upon their fundamental influences regarding static positions in space. I currently only accept models in which static spacial positions are impossible. Contrastingly relative positions seem quite reasonable. In my humble opinion my naivatisms inhibit me from absorbing and understanding the Higgs boson. If they actually are similar, public protest would probably be more apparant. However, I have put forth my best effort to pose an direct question here.  P.S. The questions Where does space go when it falls? and What happens to time lost when matter accelerates? come much earlier in my studies, and they seem relevant.


Let (G, ∗) be a group and a,b € G.   Show that (a✻b)^-1 = a^-1✻b^-1 if and only if a✻b=b✻a  I could not solve this, how can ve prove it?  a^-1 means inverse of a

Let $(G,\cdot)$ be a group show that  A) $G$ is abelian  B) For all $x,y\in G: (xy)^{-1}=x^{-1}y^{-1}$  C) For all $x,y\in G: (xy)^{2}=x^{2}y^{2}$  D) There existst an $n\in \mathbb{Z}$ such that for all $x,y\in G$  $\displaystyle (xy)^{n-1}=x^{n-1}y^{n-1}$ and $\displaystyle (xy)^{n}=x^{n}y^{n}$ and $\displaystyle (xy)^{n+1}=x^{n+1}y^{n+1}$  are equivalent.    I showed $A\iff B,A\iff C$ and $A\iff D$. That was not really hard, except maybe $D\Rightarrow A$. I would like to do a circular argument, but i have no idea how.  Any hints?  Thanks in advance!


I use the environment thebibliograghy for a document of the book class, but I'd like to have a bibliography title formatted like a section title (no page clearing, for example) instead of a chapter title (the book is a collection of papers each one being a chapter and having its own bibliography).  Can thebibliography environment be changed so to create a title formatted like the one of a section instead of chapter?  Thanks in advance for any clue.

I have the following:   \documentclass{article}  \usepackage{multicol}   \begin{document}  \begin{multicols}{2}   \section{}  \begin{thebibliography}{99}   \subsection{Differentiation}   \bibitem{DifIntWiki}    \emph{URL}   \end{thebibliography}  \end{multicols}  \end{document}   It creates a section with a number, and the Bibliography follows on the next line.  I'm interested in combining these two lines together, essentially turning the bibliography into a section.  Is there any way to do this?  Additionally, I'm using the multicol package, so I'm wondering if there is a way to do this without affecting the columns.


How can I make the Code add leading zeros to my strings (containing only 1s and 0s) IF it is shorter than 8 chars?

What is a Pythonic way to pad a numeric string with zeroes to the left, i.e. so the numeric string has a specific length?


As per , "brown" refers to long wavelength hues, yellow, orange, or red, in combination with low luminance or saturation. So what about the short wavelength hues? Is there any reason why they are not called differently when desaturated? Specifically, is there any physical reason? That is, is brown in some way qualitatively different from orange in some way, more so than desaturated blue from regular blue?

My father was colorblind, and I always wondered if colors were a matter of physics or if different colors are just a human way of describing and differentiating our visual perception of the world?  For example, is the color blue by nature blue, or is it just what we see?


When Maz gives Lukes lightsaber to Finn he still has his blaster across his back. The next time we see him is when he comes out of the rubble and he only has the saber which he uses to take down a stormtrooper.  Where did his blaster go?

When entering, we see that Finn has the blaster that was given to him earlier:    However, when the fighting begins, Finn tells Maz that he needs a weapon and no longer has his blaster with him.  It seems unlikely to have been lost in the first shots, given how it is secured across his body.  Also, Han and Chewie didn't lose their weapons and they are arguably less secure.  Now, when the team gets to the Resistance base, Finn again has his blaster:    So where was this blaster during the battle?


Sauron was defeated multiple times while he was in possession of the Ring. What does the Ring actually allow Sauron to do that he could not do without it? Did it make him more powerful in battle? Did it give him control over vast armies. What power, apart from controlling other rings of power (or those who wore them) did it give him?

The temptation of the One Ring, we quickly learn, is always tied up with power: each character's fantasies of possessing it seem to be about what they would do with great power. Even Sam, as I recall, imagines the power to create great huge sweeping gardens. Boromir wants the power to save Gondor, etc.  But does the One Ring actually convey power to anyone but Sauron? It actually seems to diminish its bearers: Bilbo feels "thin" and "stretched", Sméagol becomes the wretched Gollum, Frodo is never quite the same even after it is destroyed. None of them seem more "powerful," even in the abstract way that magic-users in Tolkien operate. No mention is made, that I can recall, of a Ringbearer having greater stature or authority, or of people naturally following them or obeying their commands, while they possess the Ring.  The accepted answer to  implies that a being as powerful as Gandalf could dominate the Ring and break Sauron's hold over it, but even then Tolkien says that "It would have been the master in the end", and his descriptions of a Ringbearing Gandalf sound pretty much like Gandalf is using his own powers, not terribly augmented by the Ring:     [Gandalf] would have remained 'righteous', but self-righteous. He would have continued to rule and order things for 'good', and the benefit of his subjects according to his wisdom (which was and would have remained great).   Now that sounds out of character for a being as humble as Gandalf, but it doesn't actually sound like something he would have been unable to do before. It's a twisted motive, but not really an enhanced power.  Pretty much everyone in Middle-earth agrees that the One Ring will corrupt you, but they all seem to agree that it DOES convey great power even so. Why? Do we ever see any actual, "positive" effects from possessing the One Ring?


I'm trying to process a form with AJAX, and then (after the response comes back through), make a popup that gives a user 2 buttons.   The first AJAX request executes just fine, and the popup appears properly too. The issue is that one of the buttons in the popup does nothing when pressed.   The button in question is addressed with the following code:  $(".c").on("click", function(){     alert('dfgh'); });   The HTML of the popup (created by the original AJAX request) is:  <div id="exchange_pc" class="popupContainer" style="z-index: 1000;">     ….text….     <table>         <tbody>             <tr>                 <td>                     <form class="removeAndApply" action="">                         ….hidden inputs….                         <button type="submit">XYZ</button>                     </form>                 </td>                 <td>                     <button class="c">Keep Current Codes</button> //this is the button I'm asking about                 </td>             </tr>         </tbody>     </table> </div>   Weird thing is, that when I create a regular old button it works just fine. Only in the generated popup it doesn't. (Even though it's dynamically created, my understanding is that using ".on()" should make it work…)

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 am not getting the motivation behind defining Complex plane. I mean why defining such plane helps to understand $i$? So if I want, can I replace any other number in place of $i$( suppose, I replace it by $\Phi=\frac{\sqrt{5}-1}{2})$ to study properties of some number? Will that be helpful? If yes, why?   I have searched for this question, it is not asked before here. A similar question - . But that is defferent from my question.

I've read a bit about the history of the complex numbers, and many seem to credit Caspar Wessel with the idea of associating the complex numbers as points on a 2-dimensional plane (or at least the first to explicitly publish the idea). But what was the motivation behind this? Why did people make this leap, and what were their justifications for this?  edit: just to be clear, my question is only about the justification of identifying complex numbers as points on a plane, NOT about justifying complex numbers themselves.


I have two genomic  sequences that I want to compare letter by letter. They share almost the same pattern but some nucleotide transitions occur.   For example  Sequence 1    ATGGCGATGAGCAGCGGCGGCAGTGGTGGCGGCGTCCCGGAGCAGGAGGATTCCGTGCTGTTCCGGCGCGGCACAGGCCAGAGCGATGATTCTGACATTTGGGATGATACAGCACTGATAAAAGCATATGATAAAGCTGTGGCTTCATTTAAGCATGCTCTAAAGAATGGTGACATTTGTGAAACTTCGGGTAAACCAAAAACCACACCTAAAAGAAAACCTGCTAAGAAGAATAAAAGCCAAAAGAAGAATACTGCAGCTTCCTTACAACAGTGGAAAGTTGGGGACAAATGTTCTGCCATTTGGTCAGAAGACGGTTGCATTTACCCAGCTACCATTGCTTCAATTGATTTTAAGAGAGAAACCTGTGTTGTGGTTTACACTGGATATGGAAATAGAGAGGAGCAAAATCTGTCCGATCTACTTTCCCCAATCTGTGAAGTAGCTAATAATATAGAACAAAATGCTCAAGAGAATGAAAATGAAAGCCAAGTTTCAACAGATGAAAGTGAGAACTCCAGGTCTCCTGGAAATAAATCAGATAACATCAAGCCCAAATCTGCTCCATGGAACTCTTTTCTCCCTCCACCACCCCCCATGCCAGGGCCAAGACTGGGACCAGGAAAGCCAGGTCTAAAATTCAATGGCCCACCACCGCCACCGCCACCACCACCACCCCACTTACTATCATGCTGGCTGCCTCCATTTCCTTCTGGACCACCAATAATTCCCCCACCACCTCCCATATGTCCAGATTCTCTTGATGATGCTGATGCTTTGGGAAGTATGTTAATTTCATGGTACATGAGTGGCTATCATACTGGCTATTATATGGGTTTCAGACAAAATCAAAAAGAAGGAAGGTGCTCACATTCCTTAAATTAA   Sequence 2   ATGGCGATGAGCAGCGGCGGCAGTGGTGGCGGCGTCCCGGAGCAGGAGGATTCCGTGCTGTTCCGGCGCGGCACAGGCCAGAGCGATGATTCTGACATTTGGGATGATACAGCACTGATAAAAGCATATGATAAAGCTGTGGCTTCATTTAAGCATGCTCTAAAGAATGGTGACATTTGTGAAACTTCGGGTAAACCAAAAACCACACCTAAAAGAAAACCTGCTAAGAAGAATAAAAGCCAAAAGAAGAATACTGCAGCTTCCTTACAACAGTGGAAAGTTGGGGACAAATGTTCTGCCATTTGGTCAGAAGACGGTTGCATTTACCCAGCTACCATTGCTTCAATTGATTTTAAGAGAGAAACCTGTGTTGTGGTTTACACTGGATATGGAAATAGAGAGGAGCAAAATCTGTCCGATCTACTTTCCCCAATCTGTGAAGTAGCTAATAATATAGAACAGAATGCTCAAGAGAATGAAAATGAAAGCCAAGTTTCAACAGATGAAAGTGAGAACTCCAGGTCTCCTGGAAATAAATCAGATAACATCAAGCCCAAATCTGCTCCATGGAACTCTTTTCTCCCTCCACCACCCCCCATGCCAGGGCCAAGACTGGGACCAGGAAAGCCAGGTCTAAAATTCAATGGCCCACCACCGCCACCGCCACCACCACCACCCCACTTACTATCATGCTGGCTGCCTCCATTTCCTTCTGGACCACCAATAATTCCCCCACCACCTCCCATATGTCCAGATTCTCTTGATGATGCTGATGCTTTGGGAAGTATGTTAATTTCATGGTACATGAGTGGCTATCATACTGGCTATTATATGGAAATGCTGGCATAG   Is there a bash way to compare the sequence and colorize or print the differences?  EDIT: I want to compare gene sequence by means of linux tools.   I need line by line comparison of letters and highlighting the differences. I think diff is not good at comparing single word which formed  of hundreds of letters.

I have some sql dumps that I am looking at the differences between. diff can obviously show me the difference between two lines, but I'm driving myself nuts trying to find which values in the long list of comma-separated values are actually the ones causing the lines to be different.   What tool can I use to point out the exact character differences between two lines in certain files?


In an answer to this question  egreg uses   \def\relaxtag#1#{\relaxrelaxtag} \def\relaxrelaxtag#1{}   The role of the second # is unclear or me. It seems to be neither element of definition with arguments with the structure nor alignment marker.

Knuth hid a special rule for delimited arguments in exercise 20.5 of the TeXbook.     If the very last character of the   parameter text is #, so that this #   is immediately followed by {, TeX   will behave as if the { had been   inserted at the right end of both the   parameter text and the replacement   text.   This means that a macro can be defined as,  \def\a#1#{#1}   calling it as \a 10 will give a runaway argument error whereas calling it as \a{12}, will compile with no trouble.  I struggled to find a practical application for such macros even after looking at TeX by Topic, TeXbook and LaTeX source.   Here is my take on it, create some commands to typeset and do some calculations for fractions, as for example those found in basic arithmetic texbooks. You type this,  \[\FRAC ADD{3}{8}+{1}{7}\] \[\FRAC SUB{5}{8}-{1}{7}\] \[\FRAC MUL{5}{8}x{13}{1201}\]   and you get this:    Here is the code,  \documentclass{article}  \begin{document} %% macro factory \def\FRAC#1#{\csname #1\endcsname} %% add \def\ADD#1#2+#3#4{%   \frac{#1}{#2}+\frac{#3}{#4}=   \frac{\the\numexpr(#4*#1)+(#3*#2)}{\the\numexpr#2*#4} } %% subtract \def\SUB#1#2-#3#4{%ok top   \frac{#1}{#2}-\frac{#3}{#4}=   \frac{\the\numexpr(#4*#1)-(#3*#2)}{\the\numexpr(#2*#4)} } %% multiply \def\MUL#1#2x#3#4{%   \frac{#1}{#2}\times\frac{#3}{#4}=   \frac{\the\numexpr(#1*#3)}   {\the\numexpr#2*#4} } %% testing \[\FRAC ADD{3}{8}+{1}{7}\] \[\FRAC SUB{5}{8}-{1}{7}\] \[\FRAC MUL{5}{8}x{13}{1201}\] \end{document}   Are there any practical applications for such macros? Are there any special precautions one should take? Why would Knuth include this facility in the first place?


I'm a C/C++ guy with a growing confidence in C#, but have run into a blocker that I can't seem to find the right search word/phrase.  I am looking through an existing codeset which uses a "float" type to manipulate/pass data around.  The problem with this is that the data in question can be expressed in different units, and some of the routines expect one unit, while others, the second unit is used.  This is making it extremely difficult to read/follow/debug.  A familiar example may be with units of measurement.  Let's say for example it's weight.  So, it's a mix of using ounces & pounds (or grams & kg.) So, I want to change the local variables and the routine definitions to use/take in a "PoundsType" or "OuncesType" - so, when I see it in the code it's clear what unit the number should be in.  I would like to use it just like I would a "float", (without the "new" or getting the value instead of indexing into a class) but let the compiler complain if the wrong unit is used somewhere.  (Similar to how an enum would work) I saw through the googles someone suggested "using PoundsType = float;" but before I could test to see if that would meet my needs, that line wouldn't even compile.  - So, I don't know if it's been taken out of the language, or was never valid. An example of what I'm after would be: void foo (PoundsType valueInPounds) { /* do something. */ } void bar (OuncesType valueInOunces) {/* do something. */ } PoundsType ouncesToPounds (OuncesType NumOunces) {return NumOunces / 16.0F; } main ()  { PoundsType numPounds = 50; OuncesType numOunces = 38; bar (numPounds); /* compile error */ }

Is there a typedef equivalent in C#, or someway to get some sort of similar behaviour? I've done some googling, but everywhere I look seems to be negative. Currently I have a situation similar to the following:  class GenericClass<T>  {     public event EventHandler<EventData> MyEvent;     public class EventData : EventArgs { /* snip */ }     // ... snip }   Now, it doesn't take a rocket scientist to figure out that this can very quickly lead to a lot of typing (apologies for the horrible pun) when trying to implement a handler for that event. It'd end up being something like this:  GenericClass<int> gcInt = new GenericClass<int>; gcInt.MyEvent += new EventHandler<GenericClass<int>.EventData>(gcInt_MyEvent); // ...  private void gcInt_MyEvent(object sender, GenericClass<int>.EventData e) {     throw new NotImplementedException(); }   Except, in my case, I was already using a complex type, not just an int. It'd be nice if it were possible to simplify this a little...  Edit: ie. perhaps typedefing the EventHandler instead of needing to redefine it to get similar behaviour.


I am writing a python script for ArcGIS 10.3. I know about Scale tool in ArcGIS interface but I can't find such arcpy command. It exists?  As you can see on the picture the Scale tool works different than Buffer tool - it changes the form of original polygon. So the question is:   Can I use Scale tool (available from ArcGIS interface) using arcpy?

I have a polygon shapefile and need to create new polygons, within the originals, as % of original area.  I used buffer by field (Field= new area as %) but the buffers are created in circles around the polygons.  What am I doing wrong?  I am using ArcGIS Desktop 10.


After placing glass in Minecraft, I cannot pick it back up. I can break it but it does not go back into my inventory.  Is there any way I can pick it back up?

I have never been able to tell if I could break glass and get it back (like dirt, wood, cobblestone etc). Is this possible at all? is it possible in version 1.6.2.


I'm constructing a linear model from a data set with 10 variables and my current "best" model uses 4 variables. I've tested the variables and not all of them show significance, so the most that I might add to the model might be 5 variables overall. However, with 4 and 5 variables, eventhough I get very good Pr(>|t|) values for all the variables that I've added and while my $R^2$ value has been improving, it's still just "only" $0.4287$ and the scale is $[0,1]$.  Should I be happy with $< 0.5$ $R^2$ value of should I aim to improve it in order to improve my model even more? What can I do to increase the $R^2$ value now that I have already added all variables that I can add as predictors? Should I look into interaction terms? Or something else?

I've fitted my model and am trying to understand whether it's any good. I've calculated the recommended metrics to assess it ($R^2$/ AUC / accuracy / prediction error / etc) but do not know how to interpret them. In short, how do I tell if my model is any good based on the metric? Is an $R^2$ of 0.6 (for example) sufficient to let me proceed to draw inferences or base scientific/business decisions?     This question is intentionally broad, to cover a wide variety of situations that members frequently encounter; such questions could be closed as duplicates of this one. Edits to broaden the scope beyond the metrics mentioned here are welcome, as are additional answers - particularly those that offer insight about other classes of metrics.


/usr/share/texlive/texmf-dist/tex/latex/biblatex/blx-bibtex.def: Package biblatex Warning: Using fall-back BibTeX(8) backend: (biblatex)                functionality may be reduced/unavailable.   EXAMPLE:   \usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex}   \addbibresource{Elyssesbib.bib}  \usepackage[autostyle=true]{csquotes}   \begin{document} \...... rest of doc.

How can I resolve the warning in the title? I have tried using different backends (biber and bibtex8): it will either not fix the problem, or make worse problems.  MWE:  \documentclass{article} \usepackage[backend=bibtex,style=numeric,natbib=true,citestyle=numeric-comp,sorting=none]{biblatex} \addbibresource{thesis.bib}  \begin{document}      The Pearl Street Station and subsequent plants provided power at 110V dc \cite{hirsh_emergence_2002}.      \printbibliography  \end{document}   And bibliography:  @misc{hirsh_emergence_2002,   title = {Emergence of {{Electrical Utilities}} in {{America}}},   timestamp = {2017-03-05T00:55:18Z},   howpublished = {\url{http://americanhistory.si.edu/powering/}},   journal = {Smithsonian Institution: Powering a Generation of Change},   author = {Hirsh, Richard F.},   month = sep,   year = {2002} }


I'm working on a page that displays a map via jQuery, and I have a div layered in front of the map, with an x in the corner to be used to close it. When I disable the map, clicking the x closes the div (via jQuery's fadeOut() function), but when the map loads, the x does nothing.  Is there any way to enable the .click() function on a layered div like this? Using a delegated event handler does not solve the problem.  $('#close_btn').click(function() {     $('#msg1').fadeOut('fast'); });   or  $(document).on('click','#close_btn',function() {     $('#msg1').fadeOut('fast'); });

         Some stuff!         Some other stuff.

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


I'm making a shopping mall website using a Yahoo solution. I have multiple options for items and some items have different price dependent on the options.  Yahoo doesn't support multiple price options, and therefore I try to find a solution for this problem. One of my ideas is to make multiple pages and redirect the page dependent on options. For example, if a customer chose  model A, the page will stay in the page A which displays $1000. If a customer chose model B, the page will redirect to the page B which displays $500.  I have already made dynamic options with JavaScript, but I want to modify it to redirect a page. Here is the link of my page:    In the page, there are options in the middle. If a customer chose his/her hand, it shows options, "#4 Thru AW," "Lob Wedge," and "Sand Wedge." If a customer chose either "Lob Wedge" or "Sand Wedge', the page has to redirect to a page which has a different price.  PS:  I'm using JavaScript to generate options dependent on the previous option. The code is:  <script type="text/javascript" language="javascript">     <!--     document.write('<select name="Iron(s)" onChange="javascript:     listboxchange     (this.options[this.selectedIndex].value);"><option value="">Select Iron(s)</option></select>')     --> </script>

How can I redirect the user from one page to another using jQuery or pure JavaScript?


Let’s define $C_\alpha^\beta$ as the cardinality of the set of all subsets with cardinality $\beta$ of a set with cardinality $\alpha$:  $$C_\alpha^\beta = |\{T \subset S| |T| = \beta \}|$$  where $|S| = \alpha$.  It is easy to see, that $C_\alpha^\beta$ is well defined, and if $\alpha$ and $\beta$ are finite, then $C_\alpha^\beta$ becomes classical binomial coefficients.  It is also true, that $C_\alpha^\beta = 0$ for all $\beta > \alpha$.  Now one can see, that for infinite $\alpha$ and finite $\beta$ we have $C_\alpha^\beta = \alpha$.  It is also true, that for infinite $\alpha$ $C_\alpha^\alpha = 2^{\alpha}$:  $|\{T \subset S| |T| = |S| \}| \geq |\{T \subset S| |T| < |S| \}|$, as if $|T| < |S|$, then $|S \setminus T| = |S|$, for infinite $S$.  $$2^{|S|} = |\{T \subset S \}| = |\{T \subset S| |T| = |S| \}| + |\{T \subset S| |T| < |S| \}| \leq |\{T \subset S| |T| = |S| \}| \leq |\{T \subset S \}| = 2^{|S|}$$  However, I do not know the values of $C_\alpha^\beta$, where $\alpha$ and $\beta$ are both infinite and $\beta < \alpha$. Is there a way to find them too?

If $\lambda\leq\kappa$ are infinite cardinals, how many subsets of $\kappa$ of size $\lambda$ are there? And of size $\leq\lambda$? Is there some sort of explicite formula for this? The internet isn't as helpful on this as one would expect (unless one knows what to look for, I guess).


What's the significance of the number, like the 2 in STAT(2), seen in man pages?  For example, man 2 stat yields a man page with STAT(2) at the top and a description that begins, The stat() function..., while man stat yields a man page with STAT(1) at the top and a description that begins, The stat utility...  I noticed the page for STAT(1) says BSD General Commands Manual, while that for STAT(2) says BSD System Calls Manual, so maybe the number is a code for the type of command?

So, for example, when I type man ls I see LS(1). But if I type man apachectl I see APACHECTL(8) and if I type man cd I end up with cd(n).  I'm wondering what the significance of the numbers in the parentheses are, if they have any.


Given a runtime of $\frac{n^2 - n}{2}$, how would we prove that the big-O notation is $\mathcal{O}(n^2)$. I want to use the $f(n) = \mathcal{O}(g(n))$ formula.

Given the definition of Big-O, prove that $f(n) = n^2 - n$ is $O(n^2)$.  When I use the given definition, I get $n^2 - n \leq n^2 - n^2$ which means that $n^2 -n \leq 0$, which is not true. Is there some step I'm missing?


I recently have made a search engine using an html form , php and mysqli. What it does is whatever terms i put in the form it searches that in my mysql database and echos it back on my html page. So far its working as I wanted. However I have seen people warn for Mysql injection attacks on the tutorial i made this engine from so can anyone please check my code below and give me an advice.    <?php  $k = mysqli_real_escape_string($_GET['k']); $terms = mysqli_real_escape_string(explode(" ", $k)); $query = "SELECT * FROM xaplinks WHERE "; $i = 0;  foreach ($terms as $each) {  $i++;  if ($i == 1) {    $query .= "xap_name LIKE '%$each%'"; }  else {    $query .= "OR xap_name LIKE '%$each%'"; } }  $con = mysqli_connect('mysql.hostinger.in','steve','password', 'win');  $query = mysqli_real_escape_string(mysqli_query($con, $query)); $numrows = mysqli_num_rows($query);  if ($numrows > 0) {   while ($row = mysqli_fetch_assoc($query)) {     $name = $row['xap_name'];     $link = $row['xap_link'];      echo "$name
";   } } else {   echo "No results found. :( "; } mysqli_close($con); ?>     I read online that escape string in mysqli can help prevent injection so ive used it but not sure if its properly implemented. Im very new to mysqli.   Any help / tip would be appreciated , Thanks in advance. :)

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


I have all my notes on my Mac, and I want to move them to iCloud so I can use them on a different laptop. Using the image below as an example, how do I move all notes from "On My Mac" to "iCloud" so that they are stored on iCloud?

I have OS X 10.8, and there is an empty list of notes on my Mac. But I have some notes on my iPhone, which are not in iCloud. Instead, they are local notes in the "On My iPhone" folder. How to move them into iCloud?


In the  it casually mentions that:     moving out of multiple of a creature’s threatened squares in the same move action doesn’t provoke two attacks of opportunity.   However, when I checked the rest of the FAQ and the  I couldn't find anything that confirmed or denied this. Does moving out of multiple threatened squares in the same action provoke multiple attacks of opportunity?

I have seen this question for D&D 4e:  and I was wondering about attacks of opportunity in Pathfinder/3.5e.  If an enemy goes from one threatened square to another one threatened by the same guy twice, and the threatening creature has combat reflexes and enough dexterity, could he be making more than one AoO against the same enemy for that movement?  As an example, imagine that a Medium size creature (A) with 5ft. reach charges against a Large humanoid with a reach weapon and a non-reach natural attack (e.g. a bite), Dex 20 and Combat Reflexes (B).  B threatens from 20ft to 10ft with his reach weapon and from 10ft to 5ft with the bite. For a total of 4 squares threatened on a straight line.  So, does A provoke three AoOs from B whenever he charges, for leaving 20ft., 15ft. and 10ft. during the same move?  Further, lets say B gets Hold the Line feat, which states:     Benefit      You may make an attack of opportunity against a charging opponent who   enters an area you threaten. Your attack of opportunity happens   immediately before the charge attack is resolved.   Does A now provoke an AoO from B for both entering and leaving these squares, for a total of 6?


Need some clearance on a couple of things, here is a problem in it's complete form,  A mass of $400 \textrm{ g}$ stretches a spring by $5 \textrm{ cm}$.  (a) Find the spring constant $k$, the angular frequency $\omega$, as well as the period $T$ and frequency $f$ of the free undamped motion for this spring-mass system.  (b) Find the general solution $x(t)$ of the DE for the free spring-mass system.  (c) Suppose that an exterior force of $F(t) = 27\sin(13t) \textrm{ N}$ acts on the spring-mass system. Find the equation of motion of the system if the mass initially is at rest in its equilibrium position.  I have the general solution $x(t) = c_1\sin(14t) + c_2\cos(14t)$. What initial conditions do I use here to find the constants? $x(0) = 0, x'(0) = 0$?   For part (c), I just set the force equal to my general solution and use the method of undetermined coefficients, right? I'm confused at this point as to what my guess should be.

I have this study guide for an upcoming test for DE class I'm trying to figure out.   A mass of 400 grams stretches a spring by 5 centimeters. (a) Find the spring constant k, the angular frequency ω, as well as the period T and frequency f of free undamped motion for this spring-mass system. (b) Find the general solution of the DE for the free spring-mass system. (c) Suppose that an exterior force of F(t) = 27sin(13t) Newtons    acts on the spring-mass system. Find the equation of motion of the system if the mass initially is at rest in its equilibrium position.  I know K is 784 (or do I need to convert to 5 centimeters to 0.05 meters?) and w is sqrt(k/m), but I'm not sure what I need to find T and F. I can find the general solution, but then I have no clue on what to do with part c.


I'm experiencing really strange behavior, which I cannot neither understand nor explain. I was able to create a really simple sample to demonstrate that. That was reproduced on VS.Net 2013 & 2015 on different machines with several target .Net versions.  using System; using System.Linq;  namespace Sample {     internal static class Program     {         private static void Main(string[] args)         {             ExecuteInParallel(new[]             {                 new Tuple<string, Action>("Task1", () => { }),                 new Tuple<string, Action>("Task2", () => { throw new Exception("Exception"); })             });         }          private static void ExecuteInParallel(Tuple<string, Action>[] tasks)         {             tasks.AsParallel().ForAll(x =>             {                 Console.WriteLine("Starting " + x.Item1);                 x.Item2();             });         }     } }   When you just run that code without debugging, you receive what expected: two task started, one failed, and AggregateException details in console:  Starting Task1 Starting Task2  Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.Exception: Exception    at Sample.Program.<Main>b__1() in d:\temp\ConsoleApplication40\ConsoleApplication40\Program.cs:line 13 ...   But when you start the same code with debugging, results are really weird. First, you receive AggregateException:     But when you click Continue, it just starts both tasks again and again - here is sample output from Console:  Starting Task1 Starting Task2 Starting Task1 Starting Task2 Starting Task1 Starting Task2 Starting Task1 Starting Task2   I was using two tasks to demonstrate that they are both restarting; you can comment out empty one and receive the same confusing results.  My question here - is this a VS.Net bug, or some feature I don't understand?  Is there a way to debug in a "normal" way here?

When I debug a C# program and I get an exception throwed (either thrown by code OR thrown by the framework), the IDE stops and get me to the corresponding line in my code.  Everything is fine for now.  I then press "F5" to continue. From this moment, it seams like I'm in an infinite loop. The IDE always get me back to the exception line. I have to Shift + F5 (stop debugging/terminate the program) to get out of his.  I talked with some co-workers here and they told me that this happens sometime to them too.  What's happening?


Quite recently the company  has developed a new kind of power plant that supposedly utilizes the buoyancy effect to generate electricity. The apparatus consists of a vertical conveyor belt with buckets attached to it. The whole construct sits inside a cylinder of water. Through a compressor, air is blown into the upturned buckets which decreases their density and allows them to rise. At the top the air is released and the buckets go back to the bottom of the cylinder. This turns the conveyor belt and a generator that produces electricity. A schematic is shown below.    Now this technology is very controversial and many claim that it is a fraud but the company has had a test facility running for quite a while and generated enough electricity to power both the compressor and a number of household appliances.  I have spent a lot of time trying to figure out problems with the system because it seems that it does not conserve energy. Sure it uses gravity but still there is no loss of energy elsewhere, like the loss of potential energy in a hydroelectric facility for example.  I simply do not understand where the energy is coming from. Would this not count as a perpetual motion machine?  (If this is more related to engineering feel free to migrate the question)

I realize this isn't possible, but I can't see why not, especially if you change the model a little bit so that the balls simply travel through a tube of water on the way up, rather than exactly this model.  Please be clear and detailed.  I've heard explanations like "the balls wouldn't move" but that doesn't do it for me - I really do not see why the balls on the right would not be pulled/pushed up, and the rest of the chain wouldn't continue on.


I am studying the fourth edition of Royden Real Analysis and I have tried to solve the following exercise:  Let $\mathcal{F}$ be a family of function, each of which is integrable over E. Show that $\mathcal{F}$ is uniformly integrable over E if and only if for each $\varepsilon>0$, there is a $\delta>0$ such that for each $f \in \mathcal{F}$,  $$\text{if}\; A \subset E\;\text{is measurable and }m(A)<\delta,\; \text{then}\; \Biggl|\int_Af\Biggr|<\varepsilon.$$  Solution:  The straight direction is obvious. Let $\epsilon>0$. Since $\mathcal{F}$ is uniformly integrable over E, there is a $\delta>0$such that for each $f \in \mathcal{F}$,  $$\text{if}\; A \subset E\;\text{is measurable and }m(A)<\delta,\; \text{then} \int_A|f|<\epsilon,$$ and therefore, $$\Biggl|\int_Af\Biggr|<\int_A|f|<\epsilon.$$  To show the opposite direction we suppose that for  each $\varepsilon>0$, there is a $\delta>0$ such that for each $f \in \mathcal{F}$,  $$\text{if}\; A \subset E\;\text{is measurable and }m(A)<\delta,\; \text{then}\; \Biggl|\int_Af\Biggr|<\varepsilon.$$ We also know that every $f \in \mathcal{F}$ is integrable so for fixed $f \in \mathcal{F}$ and fixed $\epsilon$, there is a $\delta_f>0$ such that,  $$\text{if}\; A \subset E\;\text{is measurable and }m(A)<\delta_f,\; \text{then}\; \int_A|f|<\epsilon.$$  My problem is that I cannot find a common $\delta$ for all $f$ to show the desire.

Let $(X,\mathcal{M},\mu)$ be a measure space and $\{f\}$ be a sequence of functions on $X$, each of which is integrable over $X$. Show that $\{f_n\}$ is uniformly integrable if and only if for each $\varepsilon \gt 0$, there is a $\delta \gt 0$ such that for any natural number $n$ and measurable subset $E$ of $X$, if $\mu(E) \lt \delta$, $$ \left|\int_E f_n~d\mu\right| \lt \epsilon.$$     I think one direction $(\Rightarrow)$ is clear. Since $f_n$ being uniformly integrable imply that for every $\varepsilon\gt 0,~\exists \delta \gt 0$ such that for any $E\in \mathcal{M},~\mu(E)\lt \delta$, $\int_E |f_n|~d\mu$ for every natural $n$. But then   $$ \left|\int_E f_n~d\mu\right|\le \int_E|f_n|~d\mu \lt \varepsilon.$$    Any suggestions for the other direction?   Edit:  Following Davide's suggestions, I have   $$ \begin{align*} \int_E |f_n|~d\mu & \le \int_{E\cap [f_n \ge 0]} f_n~d\mu + \int_{E\cap [f_n \lt 0]} (-f_n)~d\mu\\ & = \left| \int_{E\cap [f_n \ge 0]} f_n~d\mu \right| + \left| \int_{E\cap [f_n \lt 0]}f_n~d\mu \right| \\ & \lt \varepsilon + \varepsilon = 2\varepsilon. \end{align*} $$


I am building a two body problem simulation in one dimension (plus time). Two masses m1, m2 at rest that start moving because of gravitation attraction and eventually meet.  I read that the problem has no closed form solution, so I opted for a numerical one (leapfrog). However, searching here I found several expressions for the velocity of the bodies (something that I need in order to depict the orthogonal curves to the (spacetime) trajectory of the bodies, which is the ultimate goal of the simulation, hence the title.) For instance:        I may have found one or two more that I can't locate now.  So my question is, is there a non numerical solution for this problem -- and I mean a solution that gives you algebraic equations for x1, x2, v1, v2 that I can use in the simulation (not integrals that may or may not be solvable). If so, what is it? Is any of the above expressions correct? (Please no polar coordinates if possible.)  Responding to the first comment below, the equations I am using are the usual equations for the two body problem:  $$F_1=G\frac{m_1m_2}{(x_1-x_2)^2}$$  therefore  $$\frac{d^2x_1}{dt^2}=G\frac{m2}{(x_1-x_2)^2}$$  As I have mentioned, I am using numerical leapfrog integration.

This is a problem that has bothered me for a couple of weeks now, and I can't seem to wrap my head around it and understand it.  Let's say we have a planet with a mass of m. We also have an object of relatively small mass (so small that its gravitational field would not affect the planet), and we know that at time 0 it is at position h.  If we know the acceleration due to gravity (g), we can calculate the position y  at time t:  $y = h - { g \; t^2 \over 2 } $  And we know that the acceleration due to gravity could be calculated:  $g = G { m \over y^2 }$  But since the acceleration depends on the position of the object relative to the planet, and the position of the object is dependent on the acceleration, this would obviously mean that the first formula won't work when we are working with displacement so large that it would change the acceleration significantly.  So, in essence, my question is, what formula can we use to calculate the position of an object, taking into consideration the change in acceleration due to gravity?


I have a question: Does every vector space have an inner product?  I think, yes. But I failed to find an essential reason. If it does not exist, then give me a counterexample. Thanks.

Quick question: Can I define some inner product on any arbitrary vector space such that it becomes an inner product space? If yes, how can I prove this? If no, what would be a counter example? Thanks a lot in advance.


I'd like to know if there are books about how to design electronic circuits.  I have lots of theoretical books that cover how to analyse circuits, but I'd like to read about something more practical, like how to actually design something and what to look out for.  So for example, in my circuit theory books, say like Sedra And Smith, they analyse, say, Cascode amplifiers and come up with large convoluted expressions for things like gain and input and output resistance; it seems like it's impossible to really use those equations to design anything (though they are helpful in understand the circuit).  I guess I'd basically like a book that goes through the design of standard building block circuits, like differential amplifiers with current sources and active mirrors and multistage amplifiers etc.  Could anyone point me in the right direction?

I need basic electronics books  (diodes,transistors,current.. etc) as I am just starting out with electronics and want to have something to read over the holiday.  Any suggestions of good beginners' books?


Is there a feature in  (advanced search, etc.) or in other Google products where you can limit your searches to only a specific set of sites?  I tried searchterm site:xyz.com , abc.com, but that does not work.

I tried   (search term site:stackoverflow.com) OR (search term site:superuser.com) OR (search term site:stackexchange.com) search term site:stackoverflow.com,superuser.com,stackexchange.com search term site:stackoverflow.com site:superuser.com site:stackexchange.com   None of them works. What is the correct way to search?


When a user is removed who has not cast too many votes, the votes they did cast are reversed. For example, an hour ago, I lost 40 network-wide reputation points because of this reversal (which is extremely frustrating but not what I'm asking about.)  As you can see in the above image, the post graph tells me why I lost 30 reputation, but, unlike the upvote below it, it does not link to the post which was voted on. So, I have no idea which post's had their upvotes removed. I would like to be able to see this. Is it possible to implement this feature?

Here is my previous query:  which was resolved when it was found that a user was deleted therefore it showed as no vote.  Now it looks like this:    Can we show which post the rep was deleted from (aka which post a vote was removed)?  In this case I know which post it is referring to, but in the future I may not.  Can we show:    Or something like that?


I was attempting to install w3af, and following their instructions, I ran the generated script to install the Python dependencies:  > sudo pip install pyClamd==0.3.15 PyGithub==1.21.0 GitPython==2.1.3 > pybloomfiltermmap==0.3.14 esmre==0.3.1 phply==0.9.1 nltk==3.0.1 > tblib==0.2.0 pdfminer==20140328 futures==2.1.5 pyOpenSSL==0.15.1 > ndg-httpsclient==0.3.3 pyasn1==0.2.3 lxml==3.4.4 scapy-real==2.2.0-dev > guess-language==0.2  >     cluster==1.1.1b3 msgpack-python==0.4.4 python-ntlm==1.0.1 halberd==0.2.4 darts.util.lru==0.5 Jinja2==2.7.3 vulndb==0.0.19 > markdown==2.6.1 psutil==2.2.1 mitmproxy==0.13 > ruamel.ordereddict==0.4.8 Flask==0.10.1 tldextract==1.7.2 > pebble==4.3.2 xdot==0.6   Now anytime I run pip, I get the following:  > Traceback (most recent call last): File "/usr/bin/pip", line 9, in > from pip import main File > "/usr/lib/python2.7/dist-packages/pip/init.py", line 21, in from > pip._vendor.requests.packages.urllib3.exceptions import > DependencyWarning File > "/usr/lib/python2.7/dist-packages/pip/_vendor/init.py", line 64, in > vendored("cachecontrol") File > "/usr/lib/python2.7/dist-packages/pip/_vendor/init.py", line 36, in > vendored import(modulename, globals(), locals(), level=0) File > "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/init.py", > line 9, in File > "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", > line 1, in File > "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", > line 4, in File > "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/init.py", > line 52, in File > "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", > line 59, in File > "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", > line 32, in vendored File > "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", > line 47, in File > "/usr/local/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in > from OpenSSL import rand, crypto, SSL File > "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in > SSL_ST_INIT = _lib.SSL_ST_INIT AttributeError: 'module' object has no > attribute 'SSL_ST_INIT   After some research, I believe it's due to the python openssl package, but all I've seen to do is reinstall it or upgrade, but I can't even run pip. At this point I'd like to just be able to use pip again, whether that means fixing the pyopenssl issue, or removing it, or reinstalling python altogether.  Thanks.

I have a Kali Linux distrubution which is Kali GNU/Linux Rolling (currently version 2017.3) on amd64. I'm keeping it regularly up to date and have not meddled with system files or the package management. Yet, some time ago python2 and OpenSSL stopped playing together. In the beginning this was simply odd but now it is a major nuisance. E.g. a simple call like this fails:  # pip /usr/lib/python2.7/dist-packages/cffi/model.py:532: UserWarning: 'point_conversion_form_t' has no values explicitly defined; guessing that it is equivalent to 'unsigned int'   % self._get_c_name()) Traceback (most recent call last):   File "/usr/bin/pip", line 9, in <module>     from pip import main   File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 21, in <module>     from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning   File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>     vendored("cachecontrol")   File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored     __import__(modulename, globals(), locals(), level=0)   File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>   File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>   File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in <module>   File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/__init__.py", line 52, in <module>   File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 59, in <module>   File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 32, in vendored   File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in <module>   File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>     from OpenSSL import rand, crypto, SSL   File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 112, in <module>     if _lib.Cryptography_HAS_SSL_ST: AttributeError: 'FFILibrary' object has no attribute 'Cryptography_HAS_SSL_ST'   Sifting thorough various search engine results I found out that this seems to be a known incompatibility problem, but apparently there is no tangible clean solution. What puzzles me is that how can that happen in an actively maintained distro? (In fact, a collegue with the same setup does not have this problem.)  Is there a simple way to repair/fix this without reinstalling the whole distribution?  The installed versions are python/kali-rolling 2.7.14-1, python-openssl/kali-rolling 16.2.0-1 and python-cffi/kali-rolling 1.9.1-2.


In the circuit the relay is controlled from a manual switch on a 12v bus. I can't understand why you would want to add the extra components of the transistor and diodes to the circuit? ie why are D4, R1, T1, D1 needed? Thinking about cost and component count here.

It appears most people drive relays through a transistor rather than directly from a digital output pin on an Arduino.  I had wired the output pin directly to my relay before realizing this and it worked fine.  What's the transistor for?    Is it to protect the output pin from exceeding the max current if the relay coil has too low a resistance?  Or, is it to conserve energy taking advantage of the common emitter amplification?  To produce less heat perhaps?


I want to download Ubuntu portable and I searched on Google and results came showing Ubuntu remix.I was not sure if it was genuine or not. So please tell me.

I want to make a persistent live Ubuntu USB drive with more than 4GB of storage.   I know there is an option of installing directly on the drive but I don't want to do this as it will restrict the drive from working on different computers.   One option is to make an additional partition with extra space but if I do this how can I get newly installed software to be stored on this partition?


I understand that the Maximum Likelihood Estimator for variance, in general, is biased (the average calculated from the sample itself reduces the degree of freedom by 1 e.t.c):  MLE <- sum((x - mean(x))^2) / n   But in single linear regression, it's assumed that the errors are independent and identically distributed as N(0, sigma^2), then the MLE for sigma^2 becomes  s^2 <- sum(error^2) / n   Is it still a biased estimator? (According to the textbook, yes; but I don't see why) Can somebody be so kind to explain this to me, please? I'm so confused.

I was just watching a lecture on statistics and someone was calculating something called the residual standard error. It looked a lot like finding the average of the square of the residuals, the residuals being the difference between the prediction of your model and the actual values. So for a linear fit, the prediction is $\hat{y}(x_i)=mx_i+b$ and the actual value is $y_i$. So the residual is $r_i = (y_i - \hat{y}(x_i))$. The residual standard error is $\frac{1}{n-2}\sum_i r_i^2$. I don't understand why dividing by $n-2$ is necessary?   Update: I have a better idea. If there are only two data points, then the residuals would all be zero. So you could not estimate the error with only two points. But this still does not explain why dividing by $n-2$ is a good idea. It only explains why the formula is undefined for $n=2$.


This problem has me stumped. Suppose that $\mathbb{v}_j$ are smooth functions of $s$ in $\mathbb{R}^3$ and $\{\mathbb{v}_1, \mathbb{v}_2, \mathbb{v}_3\}$ is an orthonormal system for $s_0$. Assume that $A = a_{ij}$ is a skewsymmetirc matrix and that the following holds: $$ \dot{\mathbb{v}}_i=\sum_{j=1}^3a_{ij}\mathbb{v}_j $$ Show that $\{\mathbb{v}_1(s), \mathbb{v}_2(s), \mathbb{v}_2(s)\}$ is orthonormal for all s. I tried to show that $\frac{d}{ds}\left[(\mathbb{v}_1 \cdot \mathbb{v}_2)^2+(\mathbb{v}_2 \cdot\mathbb{v}_3)^2 + (\mathbb{v}_1 \cdot \mathbb{v}_3)^2\right]$ is a constant for all s. But I can't go anywhere with this.

Let $(a_{ij})$ be a skew-symmetric $3 \times 3$ matrix (i.e., $a_{ij}=-a_{ji}$  for all $i, j$).   Let $v_1$, $v_2$ and $v_3$ be smooth functions of a parameter $s$ satisfying the differential equations $$v'_i= \sum_{j=1}^3 a_{ij} v_j$$  for i = $1, 2$ and $3$, and suppose that for some parameter value $s_0$ the vectors $v_1(s_0)$, $v_2(s_0)$ and $v_3(s_0)$ are orthonormal. Show that the vectors $v_1(s), v_2(s)$ and $v_3(s)$ are orthonormal for all values of $s$.  I am facing difficulties. Any hints how to show that  the vectors $v_1(s), v_2(s)$ and $v_3(s)$ are orthonormal for all values of $s$?  EDIT Nr.1:  $\frac{d}{ds}(\left< v_i(s), v_j(s) \right>) = \frac{d}{ds}(v_i(s)^t v_j(s)   )=(v_i(s)^t)' v_j(s)+v_i(s)^t (v_j(s))' \\= \sum_{k=1}^3 a_{ik} v_k(s)^t v_j(s)+v_i(s)^t \sum_{k=1}^3 a_{jk}v_k(s) $  Any ideas how I can continue?   $$$$   EDIT Nr.2:   We have $$\frac{d}{ds}(\left< v_i(s), v_j(s) \right>) = \frac{d}{ds}(v_i(s)^t v_j(s)   )=(v_i(s)^t)' v_j(s)+v_i(s)^t (v_j(s))' \\= \sum_{k=1}^3 a_{ik} v_k(s)^t v_j(s)+v_i(s)^t \sum_{k=1}^3 a_{jk}v_k(s) =\sum_{k=1}^3 a_{ik} v_k(s)^t v_j(s)-v_i(s)^t \sum_{k=1}^3 a_{kj}v_k(s)$$   It is $$v_k(s)^tv_j(s)=v_k(s)v_j(s)^t$$ right?    Therefore we have $$\frac{d}{ds}(\left< v_i(s), v_j(s) \right>) =\sum_{k=1}^3 a_{ik} v_k(s)^t v_j(s)-v_i(s)^t \sum_{k=1}^3 a_{kj}v_k(s)=\sum_{k=1}^3 [a_{ik} v_k(s) v_j(s)^t-a_{kj} v_i(s)^t v_k(s)]=\sum_{k=1}^3 v_k(s)[a_{ik} v_j(s)^t-a_{kj} v_i(s)^t]$$   What can we do next?


I'm trying to compile a latex file from coq on Mac and get the following error:  File utf8x.def not found.  Where can I find utf8x.def?  Most of the other answers pertain to ubuntu and don't work on mac.

I'm trying to compile a .tex file (which I know to be working in Windows' TeXstudio), however in Ubuntu installation (with sudo apt-get install texstudio), I get the following error:  File `utf8x.def' not found. \endinput   I think this is because I have \usepackage[utf8x]{inputenc} in my preamble, but don't know how to fix the issue.  Thanks for any help,  Edit:  Thanks to the suggestions, I changed utf8x to utf8, but now the line \usepackage{cite} gives this error:  File `footmisc.sty' not found. \usepackage


I'm sure you've all seen the diagrams and/or 3D visualizations of gravity; the ball sitting on a piece of fabric which makes it sink down. They've also started using it in the videos that explain gravitational waves. Two objects will be circling each other on the fabric and will emit waves.  I know this is an oversimplification of what's going on, but it is quite misleading and has left me a little bit puzzled as to why gravitational waves are infact the size of protons, not the size of planets like the videos suggest.   So I guess my question is, why are they in fact so small, and why can't we detect them from astral bodies in our solar system that we can actually detect a physical force from?

Assume two black holes in the most common size range, spiraling into each other until they merge. The event releases significant amounts of energy via gravitational waves, which warp the space-time.  If the distortion is powerful enough, it would get noticed in daily life, or perhaps even detected by the proprioceptors in the human body.  How close, as an order of magnitude estimate, would you have to be to the merger to perceive it like that, without any instrument?


I don't know why the wires are not connecting upto the nodes (a) and (b). Can someone please help? Thanks in advance.  \begin{center}   \begin{tikzpicture}[circuit logic US]     % The two gates     \node[xor gate, inputs={nn}] (xor) at (0,1) {};     \node[and gate, inputs={nn}] (and) at (0,0) {};      % XOR input wires     \draw (xor.input 1) --++(left:1cm);     \draw (xor.input 2) --++(left:1cm);      % Drawing the nodes to be connected with the AND gate inputs     \draw (xor.input 1) node[left=4mm](a) {};     \draw[fill] (a) circle (0.02);     \draw (xor.input 2) node[left=7mm](b) {};     \draw[fill] (b) circle (0.02);      \draw (and.input 1) -| (a);     \draw (and.input 2) -| (b);   \end{tikzpicture} \end{center}

I have used the code shown below to draw a static CMOS inverter. I have tried to use the TikZ library calc to calculate the point at which drains of the PMOS and the NMOS devices meet; and the mid-point of the line which connects the gates of the two devices. Apparently calc gets the y coordinates of the points right. However, calc seems to get the x coordinates of the points wrong. What could I be doing wrong?  Here is the TikZ code:  \documentclass{standalone} \usepackage[americaninductors]{circuitikz} \usetikzlibrary{calc} \begin{document} \begin{circuitikz} \draw % Draw MOSFETs: (0,0) node [pigfete,yscale=-1,anchor=S] (M1) {} (M1.D) node[nigfete,anchor=D] (M2) {} (M1.G)--(M2.G) % The line connecting the gates of the MOSFETs. ; % Draw the power rails: \draw ($(M1.S)-(2.0,0)$) -- (M1.S) -- ($(M1.S)+(1.2,0)$); \draw ($(M2.S)-(2.0,0)$) -- (M2.S) -- ($(M2.S)+(1.2,0)$); % Input and output nodes: \node (I) at ($0.5*(M2.G)+0.5*(M1.G)$) {}; % The mid-point between the gates. \node (O) at (M1.D) {}; % The point at which the drains of the MOSFETs are conneted. % The Input and output lines. \draw ($(I)-(.8,0)$) -- (I); \draw (O) -- ($(O)+(0.8,0)$); \end{circuitikz} \end{document}   Here is the figure that I get: Note that that input and the output lines are not connected to the rest of the circuit. Can we attribute the problem of the lines not being connected, to the rest of the circuit, to the way I am using calc?


I have following log string and I need to get from them only MedSoftware part, which means   after .com\ before first occurence of \      SERVERNAME2018-03-08 18:40:28 File: "x:_default\app.address.com\MedSoftware.data\BackEnd.Technical.Dictionaries.Service-180308182311\Web.config", Name: "dictionaries_data_product", CS: "###connectionStrings.dictionariesdataproduct.connectionString" info: Format of the initialization string does not conform to specification starting at index 0. 6069   Now my regex looks like this:  ((?<=.com\\).*(?=\\))   and catches all after .com but goes to LAST occurence of \

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


I always see instructions for adding the Universe and Multiverse repositories that look something like the following:  sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"   Recently I tried editing this to use HTTPS instead and was dismayed to find that archive.ubuntu.com doesn't appear to respond to HTTPS. Now I wonder how feasible it would be, or what damage could be done, if an attacker were to successfully perform a man-in-the-middle attack here?  Am I being too paranoid, considering the role these repositories perform on a system?

Are repository updates secure?  As a bear of little brain from the developer side, I cannot understand why the repository list is http://security.ubuntu.com and the other http(unsecured) sites listed in /etc/apt/sources.list.  Without a certificate chain match this appears as "ask any responder for a list of packages to update" instead of "ask the ubuntu.com site..."  Can any network choose to spoof the update sites, and is this a common practice to provide a locally cached and vetted copy?


I have a figure block with 2 'minipage', each having a figure. When I typeset the document, the figure goes to the top of the page instead of being in the sub-section where I am defining it. The following is the code I am using to do this.  \begin{figure}   \centering   \begin{minipage}[t]{.45\textwidth}     \centering     \includegraphics[height=.4\linewidth]{sample.png}     \caption{Collection Definition}   \end{minipage}   \begin{minipage}[t]{.45\textwidth}     \centering     \includegraphics[height=.4\linewidth]{tree.png}     \caption{Collection Result}   \end{minipage} \end{figure}

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


OK, so heres what I'm trying to do:      class MyClass(object):      #Class I want to access     """MyClass, base class for my class"""     def __init__(self, numberOfApples):         numberOfApples = 12     #Attribute I plan to use  myClassString = "MyClass"  #What I'm trying to do:  if myClassString.numberOfApples >= 12:   """myClassString is in place of the real class name, MyClass"""     print "Wow, you got alot of apples!"   And what I'm trying to do is seeing if it is possible to reference an attribute of a class by using a string in place of the actual class name. Is this possible? If not, what's the closest thing I can get? Thanks.

What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.


What is the proper word to use when asking the question below:     Could you please send your mobile number?    or     Can you please send your mobile number?   Is one of those better than the other for some reason? Or are they about the same?

I heard using 'could' is for politeness. When I request something, should I say "Can you please" or "Could you please"? Does the latter sound over-polite and pretentious?


i'm trying to make a program that downloads some files, and now i want to open the folder (on the windows explorer) where those files are (it's always the same folder) and select the last file that was downloaded, i found this code to do it on java: private void openFile(File f) {     try {         Runtime.getRuntime().exec("explorer.exe  /select," + f.getAbsolutePath());                 } catch (Exception ex) {         System.out.println("Error - " + ex);     } }  It works, but every time i press the button to open the folder it opens a new folder to select the file so i end up with many windows opened. Is there a way to do this on the folder that is already open? I've been looking on the web for this but i only found the same code that i'm already using. All of those other posts about this issue are from many years ago so i don't know if it used to work that way on previous versions. Thank you so much if any of you can help me.

I was wondering if there was some kind of J tool in the java swing library that opens up a file browser window and allows a user to choose a file. Then the ouput of the file would be the absolute path of the chosen file.  Thanks in advance,


I have a question about the mathematical details of Ridge Regression and I have not been able to find a detailed explanation. For what I know the ridge regression is a penalty term that is used to penalize the parameters of a linear regression model (for example the weights in a linear model). So I always have seen the following equation (1):  and I found that the formula above originates from a algebraic formulation of the following optimization problem, equation (2):  I have read some material in which it says the equation 1 refers to the cost obtained from adding the RSS and the penalization of the weights. The problem that I have is how can I transform from equation 2 to equation 1? Also, and for not creating another thread, I have found this figure to explain Ridge regression:  and the explanation given is that the contour plots represents values of beta with equal RSS (likelihood) and that ridge regression pushes this contour plot to touch the inner blue ball that is in the center of the coordinates. At this point, I get lost, what does really the bull ball represents in this graph and why it says (in the readings I found) that the best value is within the blue circle? Thank you for your help and sorry for any misinterpretation that I might have in this question.

To prevent overfitting people people add a regularization term (proportional to the squared sum of the parameters of the model) with a regularization parameter $\lambda$ to the cost function of linear regression. Is this parameter $\lambda$ the same as a lagrange multiplier? So is regularization the same as the method of lagrange multiplier? Or how are these methods connected?


I keep finding Elder Dragons just outside of Whiterun, but I'm only on level 27, just walking around discovering caves. Can you help?

It's cool to fight dragons and all but sometimes I just want to wander around and find some new places and BOOM a dragon comes from nowhere and start to follow my trails and wants to burn my arse.  How can I tell him to get lost and don't get into a fight?


I need a hint to solve this:  Let $a_1 = 1$ and define a sequence recursively by $$a_{n+1} = \sqrt{a_1 + a_2 + ... a_n}$$  Show that $$\lim_{n \to \infty} \dfrac{a_n}{n} = \dfrac{1}{2}$$  Any help? Thank you

A sequence $a_n$ is defined as $a_1=1$ and $a_{n+1}=\sqrt{a_1+a_2+\cdots+a_n}$ .Prove that $ \lim\limits_{n \rightarrow \infty} \frac{a_n}{n}=\frac{1}{2}$  I have no idea how to approach this. But I have a feeling that Cesaro's lemma may come in handy


I am using the aps revtex4-1 layout. For eight times, I included a figure through \begin(figure)[h] and they all were properly positioned. Although I followed the same procedure for Fig. 9, the figure gets placed under section "Analysis of Circular Polarization", even though I have clearly declared it before the declaration of the section. Any help in trying to remedy this issue would be appreciated.

Is there any package or a method to force LaTeX to keep floating environments like table and figure closer to where they are declared?


I was using windows 7 32bit then it was showing some problems so I switched to Ubuntu and I accidentally deleted all my files on the hard disk during the Ubuntu setup....all those collection, pictures, videos and projects I had in my life is lost! Plzzz HELP ME!!!

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


I just copied a 50 GB disk image using dd for bit copying to a new harddisk with 200 GB storage. On the disk is LVM including the system partition EXT4 and a swap partition (both LVs).  Well the copy is running and works great. Now I would like to expand the whole LVM VG, and LV and also the underlying EXT4 to use the whole disk.  At the moment it still claims to have 50 GB only. I would like to extend it not at a second disk to the Volume Group. What would be the best way to do it?

I have an Ubuntu virtual machine running in VirtualBox 2.2.4, and I created it on an 8gb virtual disk which is too small.  So, I am trying to increase the size of the disk.  So far, I have done this:   Created a new larger virtual disk Added the 2nd disk to the machine Used CloneZilla to clone the first disk onto the 2nd disk Removed the first disk Booted up off the 2nd (larger disk)   But now I'm still stuck with an 8gb partition on my new 100gb virtual disk.  Whats the easiest path from here to having a 100gb partition? :) I gather GPart can resize partitions, but it doesn't seem to support LVM2 partitions, which mine seems to be.  thx   Alex


In a  by Sabine Hossenfelder, it is mentioned that in an expanding universe, energy is not conserved. The reason for this is that there is no time translation symmetry, an experiment performed at one time will not necessarily give the same result as an otherwise identical performed at another time, so Noether's theorem will not apply. She then goes on to state, that strictly speaking, that energy cannot be defined in an expanding universe, but if we ask what the energy would be if the universe was not expanding, and then see what happens to if it starts expanding, we would see that this energy is not conserved. The example given, is for light which is redshifted as the universe expands. She asks where does its energy go as it redshifts? Then answers her own question by saying that "it is just not conserved." Is this true? Or are there some subtitles that I have missed in the explanation? To clarify, I am talking about the total energy of the universe, not some particular system within it.  I received a  asking me to edit my question explaining why it is different from the  one. So I am placing my comment on the matter here: The  asks if the total energy is zero, and the answers reflect this. 3 of 6 equate the stress-energy tensor of the universe to zero, but this is not what I had in mind when I asked the question. 1 of the answers talks about a particular region of space within the universe. 1 of the answers just restates what I wrote in my question, about the difficulty defining energy, and the last one simply states that the total energy in the universe is not zero, but doesn't talk about other constant values. Furthermore, the single answer this question received is in contradiction with the linked questions answers. It claims that time translation symmetry holds for the whole universe in the context of GR, while answers on the linked question claim it does not.

In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim – does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this?


I am a mathematics student, but always interested in philosophical arguments especially on Love and God. I am also currently studying an extra course on philosophy of rationality which discusses science and religion well. Including Dawkins' God delusional.   Nietzsche has often attracted me. His thoughts that I have seen in his quotations attracts me. Can somebody tell me from which text I should start Nietzsche's work and then which one next in order. I do not want to stumble upon a harder text and then leave it halfway feeling boredom. Thanks in advance!

Similar to  I've been planning to read some of Nietzsche's work for a while, but have no idea where to start. Which of his writings would be a good initial introduction to his philosophical views?  Should I try one of his writings or perhaps a summary/critique written by others?


I am a phd scholar doing research in the area of mathematical modelling related to dynamical systems. I want to study manifold theory and does not know anything about it. So, can anyone suggest some basic references for it. Thanks!!

I was studying some hyperbolic geometry previously and realised that I needed to understand things in a more general setting in terms of a "manifold" which I don't yet know of.  I was wondering if someone can recommend to me some introductory texts on manifolds, suitable for those that have some background on analysis and several variable calculus. A lecturer recommended to me "Analysis on Real and Complex Manifolds" by R. Narasimhan, but it is too advanced.   I had a look at Loring W. Tu's text on manifolds and it seemed accessible.


This computer was originally Windows Vista, but Boot manager went missing and couldn't boot up.  A friend of mine gave me a compact disk with Linux 11.04, and replaced Vista. However, I am unable to login in any way other than in Safe Mode, or Classic: No Effects. I realize you can go into Update Manager and update it from there, but I need to download it from the Ubuntu software Center, which freezes upon launch. There was one time where I was able to search something in the software center, and turns out I have no sources to download anything. 700 some packages are broken, that may be a good connection, but I'll do the repair process and it'll say it fixed everything, when it did virtually nothing.  I downloaded the .iso for the newer Ubuntu, and made a bootable flashdrive, and using F12 to boot from the memory stick, it would start to work. Whatever option I chose from there (run Ubuntu from usb, install Ubuntu on a hard disk, etc) it would blast through some terminal stuff, then stop at when it says:  ,locks=none   or under that it stops at  [   0.288973] PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0x9afd, dseg 0x400   So, uh, are there any other methods of installing Ubuntu on a broken Ubuntu? Should I just buy a new computer? I'm stuck and lost and don't know what to do.

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


Why can I typedef a template and construct it without declaring a constructor, but can't extend a template as a class and construct it without declaring a constructor? In this example, the typedef works but the class does not. Surely somewhere C++ is generating a constructor for the typedef - why can't it do the same for the class? #include <iostream> #include <string>  template <class T> class Event {     public:         Event(T data){this->data = data; std::cout<<data;}         virtual ~Event(){}         T data; };  typedef Event<std::string> StringEvent;  class MyEvent : public Event<std::string> {};  int main() {     StringEvent event("hi"); // ok     MyEvent event2("hi");    // no           return 0; }  Output main.cpp: In function ‘int main()’: main.cpp:21:24: error: no matching function for call to ‘MyEvent::MyEvent(const char [3])’      MyEvent event2("hi");                         ^ main.cpp:14:7: note: candidate: MyEvent::MyEvent(const MyEvent&)  class MyEvent : public Event<std::string> {};        ^~~~~~~ main.cpp:14:7: note:   no known conversion for argument 1 from ‘const char [3]’ to ‘const MyEvent&’ main.cpp:14:7: note: candidate: MyEvent::MyEvent(MyEvent&&) main.cpp:14:7: note:   no known conversion for argument 1 from ‘const char [3]’ to ‘MyEvent&&’

Why does this code:  class A {     public:          explicit A(int x) {} };  class B: public A { };  int main(void) {     B *b = new B(5);     delete b; }   Result in these errors:   main.cpp: In function ‘int main()’: main.cpp:13: error: no matching function for call to ‘B::B(int)’ main.cpp:8: note: candidates are: B::B() main.cpp:8: note:                 B::B(const B&)   Shouldn't B inherit A's constructor?  (this is using gcc)


I am currently doing Algebra in a college in India. The professor asks students to note down solved examples in class, and then poses the very same questions in the tests.   I don't go to class for these very reasons. Hence, I end up writing alternate proofs for such problems. The professor is incompetent to the extent that he does not understand proofs written by an undergrad, and gives me zero on all those answers.   When applying for grad school, I will have bad grades in Algebra and other math subjects (I suspect). How do I convey the this to the Admissions committee when applying for a PhD?  I believe this is relevant to a lot of students studying in the sub-continent.

I have a master's degree in International Studies, and a double major with Computer Science from undergrad.  My transcripts suck.  There's no other way to dress it up.  I have pretty good teaching experience, and my GRE scores are awesome, and I suspect my recommendations are as bland as everyone else's.  Basically, to an admissions committee, I suspect I'm the model of a student who is probably smart enough but didn't work hard enough.  I want to do a Ph.D. in Political Science, but the response from my applications is looking pretty grim.  Am I permanently out of the running, or is there something I can do for the next few years which will help to counterbalance my unfavorable GPA?


I am wondering how important is the general GRE exam for top 10 schools in the US in engineering? Do they use it as a factor to admit students or it can be only used for funding or none/both of them?

I was reading the following article by Mathew Might.  I saw the following the paragraph  What doesn't matter GPA? I don't care if it's 2.0 or 4.0. I won't even look at it. The school you went to? I'll judge you the same whether you went to Nowhere State U or a top-ten school. Transcripts? Never seen one. GREs? Irrelevant. Where you work/worked? Unless it's a research lab, it's not important. I don't think these items have much predictive capacity as to whether or not someone can complete a Ph.D.  Is Mathew Might telling the truth? For me it's very hard believe that GPA, GRE scores and undergraduate school don't matter. I used to think that they play an extremely important role in grad school admission.


I found in HTML Improvements section google search console about 1200 duplicate meta title, then I checked one of them for example Tehran to Qeshm flights:    /flights/THR-GSM/1392-02-02/1-0-0 /flights/THR-GSM/1392-08-10/1-0-0 /flights/THR-GSM/1395-06-17/1-0-0 /flights/THR-GSM?adult=1&child=0&infant=0&departing=1397-02-20&step=results /flights/THR-GSM?departing=1393-10-12&adult=1&child=0&infant=0 /flights/THR-GSM?departing=1393-10-15&adult=1&child=0&infant=0   In fact, the main URL for the page is: /flights/THR-GSM, but when users search in search box for a specific date, child and adult or other parameters, they would include in URLs as you see above.  It appears that Google sees them as different pages and lists them in "duplicate meta titles" section.   Why does this happen?  Why are they are shown as separate and different pages?    Should I use canonical tags for this issue?

I'm running into duplicate content warnings on my site. I have product overview pages which can be sorted on price, popularity and more. I end up with URLs like these:  www.example.com/products?sort=popular%20asc www.example.com/products?sort=popular%20desc www.example.com/products?sort=price%20desc www.example.com/products?sort=price%20asc    and with paging I get URLs like:  www.example.com/products?sort=popular%20asc&page=3&rows=10 www.example.com/products?page=6&rows=20    Now, the displayed products are obviously different, but these products can all be accessed via www.example.com/products too and then by paging through them.  Would any of these URL's be considered duplicate content by Google?  And If so, how would I prevent this from being marked as such? I've read about the canonical tag but am not sure if it's applicable here and if so, how it should be applied.


I am curious as if it is possible to change the color of light being emitted from a light bulb or LED. The theory is if you were to use a frequency generator, up to above UV hrz, and used an amplifier to power the light bulb, one might be able to change the color of the light emitted. As a standard filament bulb is powered by DC current, as in a flashlight, the filament gets hot and glows. If a similar filament bulb is powered by AC current like a typical desk lamp, the filament gets hot and glows. I wonder if frequency would have any effect on how the filament emits light. I do believe however that with a non-filament light like an LED would change color. Also what about GAS lights like Neon or other gas tube lights? Anyone have insight on this? Thanks.

If a radio could produce waves in the visible light spectrum, what would the result be?  This is a thought experiment that I've pondered for a few years now.  I realize there are a few/many real-world constraints, but if we lifted these constraints for the sake of thought, what could we expect?  Personally, I don't see why we wouldn't observe visible light emitting from the antenna, disregarding any light from Blackbody Radiation.


While $$ \mathrm{E}(\tilde{\mathrm{y}})=\alpha+\beta \tilde{\mathrm{x}} $$ Subject is Regression Analysis and this formula is from the "Features of Estimation ". and y is a neutral variable. Formula for the variance of "y". Where this plus 1 ( the one that has red underline) came from.

Suppose there is a very big (infinite?) population of normally distributed values with unknown mean and variance.  Suppose also that we have a sample, S, of n values from the entire population. We can calculate mean and standard deviation for this sample (we use n-1 for stdev calculation).  The first and most important question is how is stdev(S) related to the standard deviation of the entire population?  An illustration for this issue is the second question:  Suppose we have an additional number, x, and we would like to test whether it is an vis-a-vis the general population. My intuitive approach is to calculate Z as follows:  $Z = \frac{x - mean(S)}{stdev(S)}$  and then test it against standard distribution if n>30 or against t-distribution if n<30.  However, this approach doesn't account for n, the size of the sample. What is the right way to solve this question provided there is only single sample S?


The system has 16GB of memory, and the memory pressure looks well below even 50%. This doesn't make any sense. Usually the message starts popping after about 10 days without restarting.  Any light to shed here? I used to have a 12GB hackintosh with Yosemite and this NEVER happened, it lasted stable without restarting for months at a time, this is really ridiculous, I was really expecting for Apple hardware to be more reliable, not less.

macOS is regularly popping up a "Force Quit Applications" dialog:       Your system has run out of application memory.      To avoid problems with your computer, quit any applications you are not using.   How is that possible if there are only a few open apps?


This question may sound senseless but I am novice, just looking for clarification. My Cordless phone has a Wall wart AC Power Adapter rated at 9v 500mAh. As far as replacement is concerned, does output power only matters or we have to be specific with ratings also? Like a 4.5V 1A adapter output will also be 4.5W as original rating. I have read in this forum that higher current rating may not matter but higher voltage may damage. Also, I have heard that SMPS based supplies senses the actual load and outputs accordingly. Please correct me.

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 would like to prove that for any positive semidefinite matrix $\Sigma_{n\times n}$ and any vector $\mu_{n\times1}$, are there always data points (no matter how many, as long as finite) whose empirical covariance matrix is $\Sigma_{n\times n}$ and the empirical vector is $\mu_{n\times1}$. What is the way to prove it rigorously?

Given a covariance matrix $\boldsymbol \Sigma_s$, how to generate data such that it would have the sample covariance matrix $\hat{\boldsymbol \Sigma} = \boldsymbol \Sigma_s$?    More generally: we are often interested in generating data from a density $ f(x \vert \boldsymbol\theta) $, with data $x$ given some parameter vector $\boldsymbol\theta$. This results in a sample, from which we may then again estimate a value $\boldsymbol{\hat\theta}$. What I am interested in is the reverse problem: What if we are given a set of parameters $\boldsymbol\theta_{s}$, and we would like to generate a sample $x$ such, that $ \boldsymbol{\hat\theta} = \boldsymbol\theta_{s}$.   Is this a known problem? Is such a method useful? Are algorithms available?


It seems to be a common practice in India to respond to someone's call by saying tell me. It's used even in calls; the conversation goes something like this:     Me: Hello   Caller : Hello   Me: Who's this?   Caller: Ram (Some old friend)...   Me : Yeah Ram, Tell me...   Is this correct English??

I have heard a lot of people pick their phone and go "Yes, XX, tell me" (highly used in India).  I think the right way should be "Hey, XX, what's up?" or "Hey, XX, what's going on"? But does this work in a professional environment?


For a simulation study I've been trying to find an appropriate distribution for job handling times in R. I have a very large dataset of 77010 records (handling time in seconds).  I've been exploring several distributions (lognormal, exponential, Gamma, Weibull, Burr, Pareto and more) and want to confirm which distribution best represents my data. I found that from all fitted distributions (using fitdist) the log normal distribution best represents my data (see picture below).      This plot makes me think that the lognormal distribution is a good representative of my data compared to the other distributions (also when comparing BIC, AIC & MLE). But, when I take the logs of my dataset and test for normality using ad.test (i.e., the Anderson Darling test), the null hypothesis is rejected. Likewise, when I perform the Kolmogorov-smirnov test (ks.test, note that ties are present here), the test is also rejected.  I suspect my dataset is too large to obtain meaningful results from these tests.  How do I proceed in finding substantial evidence that this distribution fits my data?

A former colleague once argued to me as follows:      We usually apply normality tests to the results of processes that,   under the null, generate random variables that are only   asymptotically or nearly normal (with the 'asymptotically' part dependent on some quantity which we cannot make large); In the era of   cheap memory, big data, and fast processors, normality tests should   always reject the null of normal distribution for large (though not insanely large) samples. And so, perversely, normality tests should   only be used for small samples, when they presumably have lower power   and less control over type I rate.   Is this a valid argument? Is this a well-known argument? Are there well known tests for a 'fuzzier' null hypothesis than normality?


How to install the latest version (Acrobat DC) in Ubuntu?

I am new to Ubuntu, but I believe I have Ubuntu 11.10 installed correctly.  I am trying to install Acroread using AdbeRdr9.4.6-1_i386linux_enu.deb that I downloaded from the Adobe web site.  How do I do this?


If you are never going to instantiate an object from that class, when are you going to ever use its constructor? Sorry if I come off as ignorant. I just started a class on Java at my high school.

Can an abstract class have a constructor?  If so, how can it be used and for what purposes?


We know from the series that a Horcrux is an object to hide a "part of your soul" so you can never die before the Horcrux is destroyed.  I would like to know how the resurrection process work. Say you have a Horcrux and then you get killed. Do you revive in the location of the Horcrux? Do you "discharge" the Horcrux to revive? So, for example, if you use a Horcrux to revive, does the Horcrux become empty so it has to be filled again?

A few questions regarding the Horcruxes.   Had Voldemort actually succeeded in using a Horcrux, would he come back the same age (biologically and/or aesthetically) he was when he made the Horcrux, or the age he would biologically be if he had never died (half died)? If Harry was a Horcrux, then in the graveyard, when Wormtail added Harry's blood to the potion to bring Voldemort back, didn't that technically use up the Horcrux inside of Harry? So in Deathly Hallows when Voldemort kills Harry, shouldn't Harry have actually died rather than just have the Horcrux inside him destroyed, seeing as it was technically used in the Goblet of Fire?


the question probably already has been answered, but i honestly dont know what to search for, an "Reflection" did not solve my issue.   I want to call a field by a string such as:      string str = "Green";     Color colorForPurpose = Color.str;   Of course this does not work, but the purpose should be clear.   Anyone has an idea?

What's the best way to convert a string to an enumeration value in C#? I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to the corresponding enumeration value. In an ideal world, I could do something like this: StatusEnum MyStatus = StatusEnum.Parse("Active");  but that isn't a valid code.