I am looking for a solution to change the background and font color of a cell based on hex-values in another cell.  I am managing a google spreadsheet for an online basketball league. I have several sheets where there should be formatting based on the team name. For example, in the standings, the cell with the team name should appear in the teams' colors. With conditional formatting I am able to say (sloppy way:) if team name = xyz -> background color = #aaaaaa, font color = #bbbbbb  I want to have a single sheet where I can "store" these team colors, so if a team has a change in their team art, I don't have to change the conditional formatting on 100 different sheets, but just on a "color" sheet and everything gets updated after that.  So in the end, I want to have a sheet named "color" (or whatever) where I have 3 rows "team name", "color 1" and "color 2". If I change values in these cells, the whole document should update all cells where these team colors are used.  Does anybody have a solution for this?
I'd like to colorize a cell based on its contents. 0 = red, 100 = green, and linearly interpolated between.  function LinInt(x){       var ss = SpreadsheetApp.getActiveSheet();   var cell = ss.getActiveRange();   var hue;   hue = (x/100)*120;    var color = HSVtoRGB(hue, 40, 100);   cell.setBackground(color);    return x;     }     function HSVtoRGB(h, s, v) {     var r, g, b, i, f, p, q, t;     if (h &amp;&amp; s === undefined &amp;&amp; v === undefined) {         s = h.s, v = h.v, h = h.h;     }     i = Math.floor(h * 6);     f = h * 6 - i;     p = v * (1 - s);     q = v * (1 - f * s);     t = v * (1 - (1 - f) * s);     switch (i % 6) {         case 0: r = v, g = t, b = p; break;         case 1: r = q, g = v, b = p; break;         case 2: r = p, g = v, b = t; break;         case 3: r = p, g = q, b = v; break;         case 4: r = t, g = p, b = v; break;         case 5: r = v, g = p, b = q; break;     }   return '#'+((b | g &lt;&lt; 8 | r &lt;&lt; 16) / 0x1000000).toString(16).substring(2); }   When I do this I get an error saying that I am not allowed to call setBackground. I assume this is because I'm not allowed to change the color of one cell from another because I'm screwing up getting the current cell that the function is running in.  How do I get the cell that the function is running in so that I can call setBackground() on it?  For example, I'd like to type =LinInt(50) into cell A1 and have A1 be yellow and have the number 50 in it. Then when I type =LinInt(100) into cell A2 it is green and has the number 100 in it.
Statistical inference when the sample "is" the population Can I unwarp my cutting board? I should have paid more attention but after regular washing of top surface, my half-inch-thick board is rocking like a cradle.  It is not practical to use flipped over as it has a counter lip.  I tried keeping the backside moist over 24hrs with no noticeable affect.  Wet grass and sunshine was suggested  but it doesn't sound very practical for me. What indoor solutions can I try? I know base 2 and base 10 , MB and MiB, but i'm not understanding the byte counts shown for a directory, by du and by windows explorer The du command shows 43G in use. I'm not sure whether that's base 2 in the sense of 2^30 or if it's base 10, in the sense of 10^9.  But anyhow -   Running this du command from cygwin, to see the size of the windows directory (done from an administrative command prompt - since it seemed to have some issues reading some directories otherwise)  user@comp ~ $ du -sh /cygdrive/c/windows 43G     /cygdrive/c/windows   Windows Explorer  which I understand shows it in 'base 2', (a larger unit for KB,MB,GB than base 10 KiB, MiB e.t.c.), and hence a lower quantity of that larger unit is required to give the same result.    Windows explorer shows      46.6GB  , over 50 billion bytes.    (according to windows explorer)  or  46.8GB  , over 50 billion bytes. (according to windows explorer)  So, du aside.  Even if I multiply the larger figure, 46.8GB  by 1.048576 then I get 49.0733568 that's not over 50 billion. So that's part A of the question,  but then also, part B of the question, why is the du figure so low. Why Process Builder doesn't work on Delete Scenario? As most of the time we have to think of requirement to accomplished using out-of-Box feature like e.g process builder which we think of an alternative to trigger, but suppose I have to handle scenario of Delete using Process Builder then there is limitation!(e.g calculation of roll-up on Delete) so I am curious about what is that limitation because of which Delete scenario is not handled in Process Builder. Can anyone please help me with my problem regarding my WordPress left hand side admin menu. I want it collapsed at all times, how do I do that?  Well, I'm creating a WP Multisite so I want that menu bar to be always collapsed at all times.  Any help would be appreciated. Looking for code or if plugin exists, should be fine, too. Thanks. tikz trees: How to not draw a single edge I'm trying to make a longtable that is wider than the textwidth at a certain moment. I've tried different things always ending up with a different problem:  First possibility: If I use the adjustwidth environment the longtabu does not align correctly. The left margin stays fixed and the right margin gets out of the page. This in contrast, if I do the exact same thing to make a tabu (instead of longtabu), it works perfectly. I think using the adjustwidth is the best way to go, but I can't manage to get it working.  Second possibility: I've found a solution using the fullwidth package. That package does the trick on small longtables, but freezes when I'm trying to do it on my big longtable. The command \setlength\LTleft{-2cm} didn't work as well.  The final option I tried was to use geometry. But that changes the margin of the whole page thus making a page break which I'm not interested in. The code I used for this was  \newgeometry{left=1.2cm} \begin{longtable} long table stuff \end{longtable} \restoregeometry   Here's an example of what I want contra what I get  \documentclass[a4paper]{article} \usepackage{longtable} \usepackage{chngpage} \usepackage{lipsum} \usepackage{tabu}  \begin{document} \section{This is the original textwidth.} \lipsum[1]  \section{This is the width I need for my longtabu} \begin{adjustwidth}{-1in}{-1in} \begin{tabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{tabu} \end{adjustwidth}  \section{This is what happens} \begin{adjustwidth}{-1in}{-1in} \begin{longtabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{longtabu} \end{adjustwidth}  \end{document} Prevent malicious bots from posting spam I remember  due to misuse and I wonder if bots have a part of it. If the bot is POSTing something to my site what are ways I can combat it? I was thinking of setting some cookies and having the cookies changed via JavaScript + timestamp and sign (so yesterday's cookies can't be used today and next week).  I'm sure most people/bots would just use another site instead of enabling JavaScript in their bot.  What else can I do? I'm thinking daily POST limit and a honeypot for generic bots who just randomly post spam. Can an ideal in a commutative integral domain be its own square? If $I$ is a non-zero proper ideal of a commutative integral domain, is it possible for $I$ to be its own square? Comment on Duplicate Reference: Why would this be marked duplicate when it was asked years prior to the question referenced as a duplicate?  I also believe the question, detail, and response is much better than the referenced question.  I've been a C++ programmer for quite a while but I'm new to Java and new to Eclipse.  I want to use the  to visualize some data I'm working with.  This code is organized like this:  ./com ./com/touchgraph ./com/touchgraph/graphlayout ./com/touchgraph/graphlayout/Edge.java ./com/touchgraph/graphlayout/GLPanel.java ./com/touchgraph/graphlayout/graphelements ./com/touchgraph/graphlayout/graphelements/GESUtils.java ./com/touchgraph/graphlayout/graphelements/GraphEltSet.java ./com/touchgraph/graphlayout/graphelements/ImmutableGraphEltSet.java ./com/touchgraph/graphlayout/graphelements/Locality.java ./com/touchgraph/graphlayout/graphelements/TGForEachEdge.java ./com/touchgraph/graphlayout/graphelements/TGForEachNode.java ./com/touchgraph/graphlayout/graphelements/TGForEachNodePair.java ./com/touchgraph/graphlayout/graphelements/TGNodeQueue.java ./com/touchgraph/graphlayout/graphelements/VisibleLocality.java ./com/touchgraph/graphlayout/GraphLayoutApplet.java ./com/touchgraph/graphlayout/GraphListener.java ./com/touchgraph/graphlayout/interaction ./com/touchgraph/graphlayout/interaction/DragAddUI.java ./com/touchgraph/graphlayout/interaction/DragMultiselectUI.java ./com/touchgraph/graphlayout/interaction/DragNodeUI.java ./com/touchgraph/graphlayout/interaction/GLEditUI.java ./com/touchgraph/graphlayout/interaction/GLNavigateUI.java ./com/touchgraph/graphlayout/interaction/HVRotateDragUI.java ./com/touchgraph/graphlayout/interaction/HVScroll.java ./com/touchgraph/graphlayout/interaction/HyperScroll.java ./com/touchgraph/graphlayout/interaction/LocalityScroll.java ./com/touchgraph/graphlayout/interaction/RotateScroll.java ./com/touchgraph/graphlayout/interaction/TGAbstractClickUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractDragUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractMouseMotionUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractMousePausedUI.java ./com/touchgraph/graphlayout/interaction/TGSelfDeactivatingUI.java ./com/touchgraph/graphlayout/interaction/TGUIManager.java ./com/touchgraph/graphlayout/interaction/TGUserInterface.java ./com/touchgraph/graphlayout/interaction/ZoomScroll.java ./com/touchgraph/graphlayout/LocalityUtils.java ./com/touchgraph/graphlayout/Node.java ./com/touchgraph/graphlayout/TGAbstractLens.java ./com/touchgraph/graphlayout/TGException.java ./com/touchgraph/graphlayout/TGLayout.java ./com/touchgraph/graphlayout/TGLensSet.java ./com/touchgraph/graphlayout/TGPaintListener.java ./com/touchgraph/graphlayout/TGPanel.java ./com/touchgraph/graphlayout/TGPoint2D.java ./com/touchgraph/graphlayout/TGScrollPane.java ./TG-APACHE-LICENSE.txt ./TGGL ReleaseNotes.txt ./TGGraphLayout.html ./TGGraphLayout.jar   How do I add this project in Eclipse and get it compiling and running quickly? I know what anti-matter is and how when it collides with matter both are annihilated. However, what about anti-photons? Are there such things as anti-photons?  I initially thought the idea preposterous. However I am curious because, if anti-photons don't exist, then anti-matter could theoretically transfer its energy to normal matter - through the mechanism of light. Is it right? Suppose $a_n \ge 0$ for all natural numbers $\Bbb{N}$ and $\sum{a_n}$ converges. Is it necessarily true that $\sum{(a_n)^2}$ converges?  I think yes.  Clearly as $a_n \ge 0$ it follows $(a_1+a_2+\dots+a_n)^2 \ge a_1^2+a_2^2+\dots+a_n^2 \ge 0$ and so $(\sum_{n=1}^{\infty}{a_n})^2 \ge \sum_{n=1}^{\infty}{a_n^2} \ge 0$.  As we are told $\sum{a_n}$ converges to say $L$ where $L$ is a real number it follows $L^2 \ge \sum_{n=1}^{\infty}{a_n^2} \ge 0$ and so therefore $\sum{(a_n)^2}$ converges.  Is this correct? Given a matrix $A \in R^{n \times n}$ which is normal ($AA^H=A^HA$ where $A^H$ is hermitian of $A$) and nilpotent ($A^k=0$ for some $k$). Now we need to show that $A=0$. (This is essentially exercise 5(b) in sec. 80 on p.162 of Paul R. Halmos' Finite-Dimensional Vector Spaces.) I tried to show in the following way, we know that, $AA^H=A^HA$ pre-multiply by $A^{k-1}\implies A^kA^H=A^{k-1}A^HA$ Now, we have $0 = A^{k-1}A^HA$, since $A$ nilpotent. I am not sure how to proceed from here to show $A=0$. Can someone help me in this problem? How do I set the grub timeout and the grub default boot entry? In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see at boot time) as I'm dual-booting Windows (7/8) and Ubuntu (12.04 or above)? In JUnit 3, I could get the name of the currently running test like this:  public class MyTest extends TestCase {     public void testSomething()     {         System.out.println("Current test is " + getName());         ...     } }   which would print "Current test is testSomething".   Is there any out-of-the-box or simple way to do this in JUnit 4?  Background: Obviously, I don't want to just print the name of the test. I want to load test-specific data that is stored in a resource with the same name as the test. You know,  and all that. Every season near the trade deadline, we see teams that are out of it trading expensive players and/or free agents-to-be, typically for younger players or prospects.  For example, Matt Garza, set to become a free agent after the season, was traded to the Rangers for a few prospects.  It made sense for the Cubs to trade Garza, because he wasn't under contract any further than this season, and thus doesn't have much value to them.  Compare Garza to someone like Mike Trout, who is likely the most valuable property in baseball, given his skill and inexpensive cost over the next several years.  There's no way the Angels would trade him, because he'll be the cost-controlled centerpiece of the team for years to come.  However, with the Angels out of it this year, what if they wanted to trade Trout to a contender (say the Pirates), but only for the remainder of this season?  That is, they'd get several top prospects now, and would have an agreement with the Pirates that they'd trade him back in the offseason (for something pretty worthless, say for a journeyman minor leaguer).  The Pirates get Trout for the stretch run and are happy to give up a few prospects.  Trout doesn't have much value to the Angels this year, but he has a ton of value for next year.  So they get a few prospects for him, in exchange for the part of his career which has very little value to them.  So in effect, the Pirates are renting or borrowing him for the remainder of 2013.  Why don't trades like this happen?  Are there any rules prohibiting trades like this? I want to append some data to a layer in my PostGIS DB using a shapefile, but when I use the Import layer/file tool in QGIS, it doesn't allow me to choose the append option.  Why is this and how do I get it to allow me to append? Let the function $f(x)$ be differentiable  and $f'(x)$ be continuous in $\left(-\infty,\infty \right)$ with $f'(2)=14$ then evaluate the limit  $$\lim_{x\to 0}\frac{f(2+\sin x)-f(2+x\cos x)}{x-\sin x}$$  My attempt:  $\lim_{x\to 0}\frac{f(2+\sin x)-f(2+x\cos x)}{x-\sin x}$  $\lim_{x\to 0}\left(\frac{f(2+\sin x)-f(2+x\cos x)}{\sin x-x\cos x}\right)$ $\frac{\sin x-x\cos x}{x-\sin x}$$=\left(f'(2)\right)(2)=28$  Is the method used here correct Is time continuous or discrete? I was coding a physics simulation, and noticed that I was using discrete time. That is, there was an update mechanism advancing the simulation for a fixed amount of time repeatedly, emulating a changing system.  I though that was interesting, and now believe the real world must behave just like my program does. It is actually advancing forward in tiny but discrete time intervals? Number of solutions to the congruence $x^q \equiv 1 \mod p$. Let $p, q$ be distinct odd primes, I would like to compute the number of solution $\mod p$ to the congruence $x^q \equiv 1 \mod p$. (Show that it's $gcd(q, p - 1))$  If $x^q \equiv 1 \mod p$, since $q$ is prime, this must mean that $x$ is either $1$ or has order $q$.   Hence, the problem reduces to finding the number of elements of $U_p$ which is either $1$ or has order $q$.  If $ q \nmid  p - 1$, then there is only one element, namely $1$.  If $q \mid p - 1$, then the number of elements of order $q$ is $\phi(q) = q - 1$, and so the number of solutions to the congruence $\mod p$ is $q - 1 + 1 = q$, and in either case the number of solutions is $\gcd(q, p - 1)$.  Does this look fine?