I have a query here:  SELECT MAX(Sales.Revenue-Sales.Costs), Company.Name FROM Sales  INNER JOIN Company ON Company.ID = Sales.ID WHERE Sales.Date &lt;= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH);   My question: where should I use an index and why?
Given that indexing is so important as your data set increases in size, can someone explain how indexing works at a database-agnostic level?  For information on queries to index a field, check out .
Is it possible to install an app and exclude some of its requested permissions? Occasionally I want to install an application which requires certain permissions that I feel it really shouldn't need. Can I install the app without giving it these permissions? For example, GPS location, , internet connection, etc.  Is it possible to change the permissions of an application once it is installed? What is a StackOverflowError? What is a StackOverflowError, what causes it, and how should I deal with them? What does the caret (‘^’) mean in C++/CLI? I just came across this code and a few Google searches turn up no explanation of this mysterious (to me) syntax.  Hashtable^ tempHash = gcnew Hashtable(iterators_);  IDictionaryEnumerator^ enumerator = tempHash-&gt;GetEnumerator();   What the heck does the caret mean? (The gcnew is also new to me, and I asked about that .) Why is (sizeof(int) > -1) false? Is drinking water during or after a meal better? What does the 'static' keyword do in a class? I searched all over this site and the web for a good and simple example of autocomplete using jQuery and ASP.NET. I wanted to expose the data used by autocomplete with a webservice (and will probably do that next). In the meantime, I got this working, but it seems a little hacky...  In my page I have a text box:  &lt;input id="txtSearch" type="text" /&gt;   I am using jQuery autocomplete, set up per their example:  &lt;link rel="stylesheet" href="js/jquery.autocomplete.css" type="text/css" /&gt; &lt;script type="text/javascript" src="js/jquery.bgiframe.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery.dimensions.pack.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery.autocomplete.js"&gt;&lt;/script&gt;   Here is where it starts to get hacky... I call a page instead of a webservice:    &lt;script type="text/javascript"&gt;     $(document).ready(function(){         $("#txtSearch").autocomplete('autocompletetagdata.aspx');     });         &lt;/script&gt;   In the page I stripped out ALL of the html and just have this (otherwise, various HTML bits show up in the autocomplete dropdown):  &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="autocompletetagdata.aspx.cs" Inherits="autocompletetagdata" %&gt;   And in my autocompletetagdata.aspx, I am using SubSonic to query, format and return data from the database (one data item per line):  protected void Page_Load(object sender, EventArgs e) {     // Note the query strings passed by jquery autocomplete:     //QueryString: {q=a&amp;limit=150&amp;timestamp=1227198175320}      LookupTagCollection tags = Select.AllColumnsFrom&lt;LookupTag&gt;()         .Top(Request.QueryString["limit"])         .Where(LookupTag.Columns.TagDescription).Like(Request.QueryString["q"] + "%")         .OrderAsc(LookupTag.Columns.TagDescription)         .ExecuteAsCollection&lt;LookupTagCollection&gt;();      StringBuilder sb = new StringBuilder();      foreach (LookupTag tag in tags)     {         sb.Append(tag.TagDescription).Append("\n");     }      Response.Write(sb.ToString()); }   If you don't do a LIKE query, then it returns everything that contains a match for the character(s) you type -- e.g., typing "a" will include "Ask" and "Answer" as well as "March" and "Mega." I just wanted it to do a starts with match.  Anyway, it works and it's pretty easy to set up, but is there a better way? My eth0 has gone and I don't have internet and network connection I had internet connection, but when I upgraded my VGA and restarted my PC then everything for eth0 has gone.     When I used ifdown:     ifdown: interface eth0 not configured   Is there something I could do?    EDIT: Content of /etc/network/interfaces    auto lo iface lo inet loopback   When I ifconfig I don't have these lines:    inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0 inet6 addr: fe80::219:5bff:fe5e:a5e/64 Scope:Link   In the Terminal typed:  sudo gedit /etc/network/interfaces   and then added these lines in the bottom:  auto eth0 iface eth0 inet dhcp   then I typed:    sudo ifdown eth0 sudo ifup eth0   when I send the second command I received the below message:    No DHCPOFFERS received No working leases in persistent database - sleeping   Any help? Why will Ubuntu no longer measure file size unit as byte, megabyte, gigabyte, etc? I read on  that Ubuntu will no longer use the familiar file size units we all know by now (kB, MB, GB, TB) and switch to a different IEC standard (KiB, MiB, GiB, TiB). If this is true, I would like to know what's the reasoning behind this change, and the impact (if any) this change has, especially with multiplatform applications or applications run with Wine. Soft version of the maximum function? In the book Deep Learning, it says the softmax function is de facto a soft argmax function, and the corresponding soft version of the maximum function is $$\text{softmax} (z)^T z$$ How to understand the latter? ${!FOO} performs a double substitution in bash, meaning it takes the (string) value of FOO and uses it as a variable name. zsh doesn’t support this feature.  Is there a way to make this work the same in bash and zsh?  Background:  I’ve got a list of environment variables, like  PATH MAIL EDITOR   and want to first print the variable names and afterwards their values.  This works in bash but not zsh:    for VAR in LIST do         echo $VAR         echo ${!VAR} done   It should be somehow possible “the old way” with eval, but I can’t get it to work:  for VAR in LIST do         echo $VAR         echo `eval \$$VAR` done   I’m never going to understand why I can’t simply do arbitrary deep substitutions like ${${VAR}} or even ${${${VAR}}} if need be, so an explanation for that would be nice, too. Are IP addresses with and without leading zeroes the same? Defining commands/abbreviations that contain numbers I tend to use \newcommand to define macros for symbols I use often, e.g. \newcommand{\hankel}{H^{(1)}_0}.  One inconvenience of this approach is the fact that command names cannot include numbers.  What I ideally want is to map something like \H0 to H^{(1)}_0.  I imagine this could be done with some macro expansion/snippet package, or one might use \newcommand to define a command that takes a parameter, etc.  Before I start experimenting, though -- is there a canonical way of dealing with this problem? Let $f$ be a real valued and continuous function over $[a,b]$ with $a &lt;b$ such that $f(a)=f(b)$ , My question here is :     Question (claim): How to show that : there  exists  $c \in [a, \frac{a+b}{2} ]$ such that : $f(c)=f(c+\frac{b-a}{2})$.   Note: I have tried intermediate values but I didn't succeed. Suppose that $f:\Bbb R\to \Bbb R$ is continuous and that $f(x)\to 0$ as $x\to \pm\infty.$Prove that $f$ is uniformly continuous. Suppose that $f:\Bbb R\to \Bbb R$ is continuous and that $f(x)\to 0$ as $x\to \pm\infty$. Prove that $f$ is uniformly continuous.   Since $f(x)\to 0$ as $x\to \pm\infty$ we have $|f(x)|&lt;\epsilon $ whenever $x&lt;-K$ and $x&gt;K$ where $K&gt;0$.  Also $f$ is uniformly continuous on $[-K,K]$ as the domain is compact.  Hence $f$ is uniformly continuous in $(-\infty,-K)\cup [-K,K]\cup (K,\infty)$.  But how to conclude that $f$ is uniformly continuous on $\Bbb R$ from above as I may chose $x\in (-\infty,-K);y\in [-K,K]$ ,how to conclude that $|f(x)-f(y)|&lt;\epsilon $ from above for a given $\epsilon$?  Please suggest the edits required. Even though a question may be closed by receiving 5 close votes, the votes do not necessarily need to agree.  I think this is a good behavior, but  (which it was) and found the question was closed as "not a real question".  This is unfortunate, while I'm happy to display my username and acknowledge that I voted to close, I'd like some additional transparency.  That is, if it was a 4-1 vote for "not a real question" vs "exact duplicate" I'd be interested in seeing that level of information.  The point is to be transparent about why the question was closed, and though 5 users may agree the question needs to be closed they may not agree why.  It's important to recognize all the reasons for closure, not just the majority reason.  I'd suggest displaying this information as something like:     closed on Jun 21 at 4:26 as:         not a real question by foo, bar, baz   exact duplicate by alice, bob      Once a question has been closed I'd argue it's more important to understand the rationale than it is to worry about an extra 2 lines of text. If the votes are 2,1,1,1 perhaps keep just 2 bullets, the first showing the majority vote, the second saying "for other reasons" as a summary of the change.  The point is to aggregate the summary by reason. Can I just change straightforward wheel axles to QR skewers? Enqueue Stylesheets After Theme's "rtl.css" I am currently developing a theme with internationalization support, and would like to load stylesheets after my theme's rtl.css (an alternative style.css loaded for languages with a right-to-left reading order).  I am familiar with enqueueing my stylesheets and controlling their load order with dependencies using the wp_register_style() and wp_enqueue_style() functions, however rtl.css is loaded automatically by WordPress whenever the locale's language direction is rtl, and there doesn't seem to be a way to specify the stylesheet as a dependency.  I know I can conditionally enqueue stylesheets using the is_rtl() function, however  these stylesheets' &lt;link&gt; elements are still printed out before WordPress automatically prints rtl.css's. I could also simply manually insert &lt;link&gt;s to the stylesheets that I wish to depend on rtl.css right after the call to wp_head() in my theme's header.php file, but I believe it's bad practice to do so, and I would like my theme to be commercial quality.  How can I load stylesheets after WordPress loads rtl.css? NetworkManager not populating resolv.conf Where are the pristine, untouched contents of a ~/.profile file?