What is Dependency Injection with a real world example?
what is the real use case of dependency injection?
Undelete accidentally deleted records in Sqlite3 As title, possible? I have by accident deleted another record due to my ugly html interface in FireFox. The bad thing is this record delete is a root folder which the program automatically cascade delete everything :( Set the QGIS display to show decimal degrees? Using QGIS 2.6.1 Brighton. I am trying to set the CRS for the project to display Decimal Degrees, where it is defaulting to Feet. I can change it in the Properties Dialog, but it does not change it, it is just staying on Feet. How do I change it?  Edit: this layer was imported from a shapefile where it was internally set to Feet. I was able to get the vendor to supply one with Decimal Degrees so my problem is gone. Still would love to know if there was a way to do it myself from within QGIS. How is ** implemented in Python? I'm wondering where I find the source to show how the operator ** is implemented in Python.  Can someone point me in the right direction? Ways to evaluate $\int \sec \theta \, \mathrm d \theta$ Is there a C++ decompiler? How to use inotifywait to watch a directory for creation of files of a specific extension I have seen .      You should consider using inotifywait, as an example:  inotifywait -m /path -e create -e moved_to |     while read path action file; do         echo "The file '$file' appeared in directory '$path' via '$action'"         # do something with the file     done    My question is that, the above script watches a directory for creation of files of any type, but how do I modify the inotifywait command to report only when a file of certain type/extension is created (or moved into the directory) - e.g. it should report when any .xml file is created.  WHAT I TRIED:  I have run the inotifywait --help command, and have read the command line options. It has --exclude &lt;pattern&gt; and --excludei &lt;pattern&gt; commands to EXCLUDE files of certain types (by using regEx), but I need a way to INCLUDE just the files of a certain type/extension. Linear regression with fixed point I have a data set to which I want to add a trend line. For my system, there will always be a fixed point on (2, 0). I have the line representing this system, but currently I do not account for the fixed point. Is there functionality to achieve this?  \begin{figure} \begin{tikzpicture} \begin{axis} [     ylabel={Some Time [ms]},     ]     \addplot[only marks, color=red, error bars/.cd,                        y dir=both, y explicit]         table [x=num_of_nodes, y=MyData, y error=stdev_delay_var] {MyData.dat};     \label{plot_one}     \addplot +[mark=none, dashed]          table[y={create col/linear regression={y=MyData}}]         {MyData.dat}; \end{axis} \end{tikzpicture} \caption{Test Results} \label{fig:test_results} \end{figure} What does "had had" mean? How does this differ from "had"? For example, what is the difference between the following two sentences:     I had a bad day      I had had a bad day Let $T:V\to V$ be a linear map, where $V$ is an inner product space. Given $T^2=\frac{T+T^*}{2}$, prove that $T$ is normal and that $T=T^2$. Let $T:V\to V$ be a linear map, where $V$ is a finite-dimensional inner product space. Given $T^2=\frac{T+T^{*}}{2}$, I would like to prove that $T$ is normal and that $T=T^2$. The first part, to prove that $T$ is normal, is quite easy: from $T^2=\frac{T+T^{*}}{2}$ we'll have $\,T^{*}=2T^2 - T$, and as $TT^{*} = 2T^3 -T^2 = T^{*}T$. Now, I need to prove that $T=T^*$, then $T = T^2$ is immediate. I have been thinking about this question for some days and I can't figure out in what technique to prove that $T = T^{*}$. The word that always gets me mixed up : JUST I had just arrived at the hotel, checked in and gotten into my room. Just as I was about to unpack, I noticed that one of my bags was missing. At first I thought I had left it back at the airport, but it turned out that I had left it on the taxi.  Here, what's the meaning and role of "just"?  Why do you guys input the word "just" here?  What exactly does the word do grammatically?   Could you help me? My processor is 64-bit - does that mean I need the amd64 image? My processor is an Intel Core 2 Duo P8600 (2.40GHz). As far as I know that's a 64-bit processor - I'm a bit confused as the architecture is called AMD 64, is this a generic name given to 64-bit architectures? I've heard of x64 but can't see a release labelled with this. Is there a way to see the pokestops and gyms on a map? I'm on vacation on a pretty rural area and there is only 3 pokestops and a gym around me. I wonder how many pokestops and gyms are near my house in another city.   Is there a way to see pokestops and gyms in other places in a map (preferably online)?    There seems so be loads of websites linked. While posting your own website is allowed (as long as it answers the question properly) please keep in mind that stating your affiliation is required (Add something like "Disclaimer: I own this website" to the end of your answer) in order to avoid being spam flagged. Function with same name but different signature in derived class Continuous footnote numbering I would like footnote numbering to continue over pages and chapters. In my document it's reset every chapter. I'm using the report documentclass. What is the reason the log transformation is used with right-skewed distributions? I once heard that      log transformation is the most popular one for right-skewed distributions in linear regression or quantile regression   I would like to know is there any reason underlying this statement? Why is the log transformation suitable for a right-skewed distribution?   How about a left-skewed distribution? Is a set without limit points necessarily closed? According to the definition on Rudin' Principles of Mathematicial Analysis, closed set is defined as:      $E$ is closed if every limit point of $E$ is a point of $E$.   Then I have a question: if a set has no limit point, is it necessarily closed? I think this idea doesn't contradict the definition of closed sets. Am I right?  And another question is #10 in Chap.2 of Rudin's:      Let $X$ be an infinite set. For $p\in X$ and $q\in X$, define    $d(p,q)=0$ when $p=q$. Otherwises,$d(p,q)=1$.    I have known that every set in the metric space is closed. To prove it, we can show that the complement of any set is open, which is quite trivial. My question is: how can we prove that every set is closed just by checking according to the definition of closed set, i.e. how can we show that every limit point of any arbitrary set $E$ in the metric space is a point of $E$?   Thanks in advanced! Why is a ConcurrentModificationException thrown and how to debug it Evaluating $\int_{0}^{1}\frac{x-1}{(x+1)\ln x} dx $ Evaluate the following integral $$\displaystyle I=\int_{0}^{1}\frac{x-1}{(x+1)(\ln x)} \mathrm{d}x $$ My work: I tried it by letting $\displaystyle I(a)=\int_{0}^{1}\frac{(x-1)x^a}{(x+1)(\ln x)} \mathrm{d}x$ and then $\displaystyle I'(a)=\int_{0}^{1}\frac{(x-1)x^a}{x+1} \mathrm{d}x$. Now $\displaystyle I'(a)=\int_{0}^{1}x^a \mathrm{d}x-\int_{0}^{1}\frac{2x^a}{x+1} \mathrm{d}x$ Now if $\displaystyle J(a)=\int_{0}^{1}\frac{x^a}{x+1}\mathrm{d}x$ , then by applying integration by parts, we get the reccurence relation $J(a)+J(a-1)=\dfrac{1}{a}$ and we can solve it then, but the thing is, we neet to find $I(0)$ ,so even if we compute $J(a)$, it wouldn't be defined at $0$ and so would $I(a)$, then how do I find $I'(a)$ by other method? I also tried the substitution $x \to \frac{1}{x}$, which yields $\displaystyle I=\int_{1}^{\infty}\frac{(x-1)}{(x+1)(\ln x)} \mathrm{d}x$ and when I saw their graphs, it clearly doesn't seem that the area under the graph of this function from $0$ to $1$ and from $1$ to $\infty$ are equal. I would appreciate if someone could  continue from my method and other solutions are also welcomed... How did the Death Star move? In the Star Wars saga, one of the most iconic weapons of the Empire was the Death Star: a self sustained weapons platform the size of a moon, with the capacity to destroy a planet. in A New Hope, we see the first Death Star in close proximity to the planet Alderaan, holding the planet hostage as the Empire tries to deduce the location of the Rebel Alliance's headquarters. In Return of the Jedi, we see the second Death Star in "dry dock" over the forest moon of Endor as it is being constructed.  My question is: How did the Death Star move? I imagine a spherical space station the size of a moon would be utterly massive, requiring a massive amount of thrust to move it. If it was constructed in low orbit of an inhabited planet/moon, the gravitational field would be immense, consisting of the planet/moon's gravity, and the Death Star's own considerable gravity. Breaking that gravitational field would be a massive task, yet we see no thrusters or engines on either Death Star. Were they hidden, stored under the station's surface while not in use? Was the station towed by another vessel? Say I create an object as follows: let myObject = {   &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,   &quot;method&quot;: &quot;newURI&quot;,   &quot;regex&quot;: &quot;^http://.*&quot; };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,   &quot;method&quot;: &quot;newURI&quot; };