Why do I get a 'context is incorrect' error when trying to use Python `bpy.ops.nla.tracks.add()`with the NLA? I am trying to use bpy.ops.nla.tracks.add() but I get this error:
poll() failed, context incorrect? - Example: bpy.ops.view3d.background_image_add() I keep on getting context errors in the Blender Python API.  I don't understand the issue of the context in the API, how do I know which is the correct context?   Thanks!
Here's a scenario:  Someone asked about "How to build a SQL query to get count and blah blah blah..."  His only tag is . I added the  and  tags to it.  Someone else answered with a nice SQL statement that has a "group by" statement which seems "logically inevitable".  I proceed to add a tag . I did that on the basis that someone who searches for  will be able to find this post useful, just as I did. My concern is, it wasn't described at all in the question, nor was it implied, unlike  and .  What is the community opinion?  The scenario above is a real one . And the one who answered it nicely is Jon Skeet. If $f,g$ are continuous at $a$, show that $h(x)=\max\{f(x),g(x)\}$ and $k(x)=\min\{f(x),g(x)\}$ are also continuous at $a$ If $f,g$ are continuous at $a$, show that $h(x)=\max\{f(x),g(x)\}$ and $k(x)=\min\{f(x),g(x)\}$ are also continuous at $a$. Here is my attempt at a proof. It feels very elaborate and I am not sure if it is correct. Can someone please point out any mistakes or places where I may improve. Thanks!  By the definition of continuity at $a$ of $f,g$ we have that $\lim\limits_{x\to a}f(x)=f(a)$ and $\lim\limits_{x\to a}g(x)=g(a)$. Suppose that $f(a)&gt;g(a)$. Then there exists a $\delta&gt;0$ such that $f&gt;g$ for all $x$ satisfying $|x-a|&lt;\delta$. Then for $x$ satisfying $|x-a|&lt;\delta$ we have $h(x)=f(x)$ and $k(x)=g(x)$ and thus $h$ and $k$ are continuous at $a$ because $f$ and $g$ are continuous at $a$. Now if $f(a)&lt;g(a)$ we simply relabel $f=\tilde{g}$ and $g=\tilde{f}$, so that $\tilde{f}(a)&gt;\tilde{g}(a)$ and we apply the previous result to show that again $h$ and $k$ are continuous at $a$.\  Now if $f(a)=g(a)$ then we can distinguish three cases. $f\geq g$ in a small neighborhood about $a$, $f\leq g$  in a small neighborhood about $a$ or $f\geq g$ on one side of $a$ and $f\leq g$ on the other side. In the first case we assume that $f\geq g$ in some small neighborhood about $a$. Then, since $f(a)=g(a)$ we have $h(x) = f(x)$ in this neighborhood and $k(x) = g(x)$ and again we see that $h$ and $k$ are continuous at $a$ due to the continuity of $f$ and $g$ at $a$. Similarly if $f\leq g$ in a neighborhood around $a$ then $h(x)=g(x)$ and $k(x)=f(x)$ in this neighborhood and $h$ and $k$ are continuous at $a$.   Suppose that just to the left of $a$ we have $f\geq g$ and just to the right of $a$ we have $f\leq g$. Then $\lim\limits_{x\to a^-}h(x)=\lim\limits_{x\to a^-}f(x)=f(a)=h(a)=g(a)=\lim\limits_{x\to a^+}g(x)=\lim\limits_{x\to a^+}h(x)$. Similarly $\lim\limits_{x\to a^-}k(x)=\lim\limits_{x\to a^-}g(x)=g(a)=k(a)=f(a)=\lim\limits_{x\to a^+}f(x)=\lim\limits_{x\to a^+}k(x)$. So $\lim\limits_{x\to a}h(x)=h(a)$ and $\lim\limits_{x\to a}k(x)=k(a)$ which means that $h$ and $k$ are continuous at $a$. Lastly if $f\leq g$ just to the left of $a$ and $f\geq g$ just to the right of $a$ we can relabel $f=\tilde{g}$ and $g=\tilde{f}$ and apply the last result to show $h$ and $k$ are continuous at $a$.   Again, please point out any mistakes I may have made. Thanks!! How often do ewoks eat sentients? In Return of the Jedi, the ewoks plan on eating Luke, Han and Chewie.     THREEPIO: I'm rather embarrassed, General Solo, but it appears you are to be the main course at a banquet in my honor.   At this point, the tribe had already met and befriended Leia, and had encountered the Imperials in the past, making it fairly likely that they knew humans were .  This raises the question of how often they ate sentients. Was it a one-off thing, to honor an extremely rare visit from a god, or was this fairly common? Without using sudo, preferably? In  (2017), Logan seems to be dying from sort sort of ailment, that prevents him to heal properly and seems to be decaying his body in a way that wasn't happening in any of the other films his character appears in.  I don't recall that this is being explained in the film. The Wikipedia page only mentions "adamantium poisoning" and "his healing factor fading", but it is not backed up with citations, so I would love to get an in-depth answer for this question, maybe using excerpts from the comic or original source material.  What is happening to Logan? I just came across this idiom in some open-source Python, and I choked on my drink.  Rather than:  if isUp:     return "Up" else:     return "Down"   or even:  return "Up" if isUp else "Down"   the code read:  return isUp and "Up" or "Down"   I can see this is the same result, but is this a typical idiom in Python? If so, is it some performance hack that runs fast? Or is it just a once-off that needs a code review? Pagination not working with custom loop I've got a custom loop that I'm using to display some Real Estate listings that will be available within 60 days. I'm calling it with the following function:   &lt;?php  $sixtydays = date('Y/m/d', strtotime('+60 days')); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $query = new PostsOrderedByMetaQuery(array(   'post_type' =&gt; array('post', 'real-estate'),   'meta_key' =&gt; 'Time Available',   'meta_compare' =&gt; '&lt;=',   'meta_value' =&gt; $sixtydays,   'paged' =&gt; $paged,   'orderby_meta_key' =&gt; 'Price',   'orderby_order'    =&gt; 'ASC' )); ?&gt; &lt;?php while ($query-&gt;have_posts()) : $query-&gt;the_post(); ?&gt;   While the loop works great, I can't get it to paginate. It shows the first 10 (my default) posts but doesn't show the pagination. The only way to display all posts is to show them on one page by adding 'posts_per_page' =&gt; -1, I have similar loops on other pages that have no problem paginating. The only difference with this one is that there are two meta keys that are filtering the posts.   I'm using WP Page Navi for this and the rest of my pages. I'm closing the loop and adding the pagination using the following code:   &lt;?php endwhile; // End the loop. Whew. ?&gt; &lt;?php wp_pagenavi(); ?&gt; &lt;?php wp_reset_query(); ?&gt;   How can I go about fixing this? How to redirect with "www" URL's to without "www" URL's or vice-versa? I am using ASP.NET 2.0 C#. I want to redirect all request for my web app with "www" to without "www"  www.example.com to example.com  Or  example.com to www.example.com  Stackoverflow.com is already doing this, I know there is a premade mechanism in PHP (.htaccess) file. But how to do it in asp.net ?  Thanks "Open in terminal" not working on nautilus as root When using natilus as root, open in terminal used to work as using with any user. However, when I press open in terminal when using nautilus as root now, it does nothing.  How to solve it?  The error:  GLib-GObject-CRITICAL **: g_object_set_data: assertion 'G_IS_OBJECT (object)' failed How to fix "404 Not Found" crawl errors reported by Google in Search Console I was checking on Google webmaster tools for my blog site to see if there's any indication on why my blog traffic decreased to half in one day and i saw 43 Not Found crawl errors and 5 in Sitemap Not Found errors.   The 5 Not Found errors in Sitemap were the links to categories. I guess I renamed categories that's why Google can't find the links.   As for the 43 other Not Found errors, I see blog post titles that contain ' or . For example "McDonald's" or "O.N.E."  They weren't found by Google crawler.   There is also a blog post with /CachedYou at the end and a blog post with /www.example.com attached at the end.  They weren't found by Google crawlers either.   How do I correct those Not Found Errors? 'const int' vs. 'int const' as function parameters in C++ and C Consider:  int testfunc1 (const int a) {   return a; }  int testfunc2 (int const a) {   return a; }   Are these two functions the same in every aspect or is there a difference?  I'm interested in an answer for the C language, but if there is something interesting in the C++ language, I'd like to know as well. 18.04: color emoji not showing up at all in Chrome, only partially in Firefox How do I get started playing Dungeons and Dragons 4th edition by myself? I've been wanting to start playing D&amp;D for some time, and I was wondering how I could get started by myself with relative ease. I own the first two player handbooks, and a set of dice. Solve $$u_{xx}-3u_{xt}-4u_{tt}=0$$ where $u(x,0)=x^2$ and $u_t(x,0)=e^x$.  My workings so far: I have factored the differential equation in the following way: $$(\delta_x-4\delta_t)(\delta_x+\delta_t)=0$$ where $\delta_x=\frac{\delta}{\delta x}$ etc. Now if we let $v$ be the solution to $(\delta_x+\delta_t)u$ then we have the following two equations: \begin{eqnarray*} (\delta_x+\delta_t)u=u_x+u_t=v\\ (\delta_x-4\delta_t)v=v_x-4v_t=0 \end{eqnarray*} Now for $v$ we simply find $$v=h(t+4x)$$ where $h$ is an arbitrary function of one variable. Now what remains is find $u$ such that $$u_x+u_t=h(t+4x)$$ I am stuck here, I thought about making a change of variables $\zeta=x+t$ and $\eta=x-t$ and thus using the product rule to show that $u_x=u_{\zeta}+u_{\eta}$ and $u_t=u_{\zeta}-u_{\eta}$ and thus $u_x+u_t=2u_{\zeta}$ and we need to solve $$u_{\zeta}=h(t+4x)$$ (I left out the factor 2 because $h$ is an arbitrary function). Do I simply integrate now and conclude $$u=f(\zeta)h(t+4x)+g(\eta)=f(x+t)h(t+4x)+g(x-t)$$ This seems wrong to me...  Some help would be greatly appreciated! I read this set of stories in the 80's.  What I recall is this:  A planet where the ruling caste was made up of humanoid women.  These women would, as almost pubescent girls, go out into the wilderness with only a spear and attempt to kill an animal in a life or death struggle.  When it happened, they would burst open a DNA packet in themselves that caused them to rapidly mature, their skin to become bronze colored, and give them some kinds of other "powers", I think over fire.  They were called "Bahronas", I think.  The population of this planet was primitive, but they were in contact with an advanced humanoid species, I think of actual homo-sapiens, who were there observing and advising them.  The advanced species wasn't allowed to intervene, just advise and watch.  The main character was a castaway boy, crash landed on their planet and stranded.  He became friendly with the ruling family of Bahronas and entered their confidence.  We find out through the course of the story that he's been genetically engineered and is not a normal boy.  At some point, the advanced species notices him and explains that he is a clone of a famous explorer and a spy, and they explain that they won't do anything in front of him.  The central part of the story is something of a blur, but, the final part of the story is told in a dramatically different style and shifts to a planet populated by catlike creatures who live in boughs of silk scarves, some of which sing.  THey are recording devices which play back the songs.  On this planet, there is another silk scarf, a white one, which doesn't play a song at all.  The cat creatures are greatly disturbed by it when they hear it's message, which they don't understand.  The narrator then goes on to say that it's a spoken word recording, made by the explorer which the boy was a clone of, explaining that he is captured and held hostage on the planet which makes the scarves, and forced to help make them (I think.) If GCD $(a_1,\ldots, a_n)=1$ then there's a matrix in $SL_n(\mathbb{Z})$ with first row $(a_1,\ldots, a_n)$ Let $n \geq 2$. Let $a_1, a_2, \ldots, a_n$ be $n$ integers such that $\gcd\left(a_1, a_2, \ldots, a_n\right) = 1$. Prove that there exists a matrix in $\operatorname{SL}_n\left(\mathbb{Z}\right)$ whose first row is $\left(a_1, a_2, \ldots, a_n\right)$.   Since the gcd of the integers $a_1,\ldots, a_n$ is $1$, there exists weights $x_i \in \mathbb{Z}$ such that $a_1x_1+\cdots+ a_nx_n=1$. My two ideas are (a) to brute force construct an $n\times n$ matrix with first row $a_1,\ldots ,a_n$ and to construct the remaining rows such that the determinant is $\sum a_ix_i=1$ or (b) to use induction.  (a) (Constructive) This is tedious since once I find a way to construct the remaining $n-1$ rows to ensure that $a_1x_1$ appears in the determinant, I am not sure how to modify these $n-1$ rows to ensure  that only the terms $a_ix_i$ appear in the cofactor expansion. If such a matrix exists, I'd like to see it.  (ii) (Non-constructive) If I proceed by induction then the base case $n=2$ is settled since I can choose the 2nd row to be $-x_2, x_1$ so that the determinant is $a_1x_1-a_2(-x_2)=1$. However, I'm not sure how to use the inductive hypothesis to show that if I can construct such an $n\times n$-matrix then I can construct an $\left(n+1\right) \times \left(n+1\right)$-matrix with the desired property. In particular, if the gcd $(a_1,\ldots ,a_{n+1})$ is $1$, it is not necesarry that the gcd of any $n$ of these terms is $1$, so induction may not even apply here.  How can I construct such a matrix or prove that one exists (without necessarily constructing it)? System.Exception: Too many SOQL queries: 101 Can jQuery .load append instead of replace? Is it possible for information (like 1 and 0s) to be transmitted faster than light?   For instance, take a rigid pole of several AU in length. Now say you have a person on each end, and one of them starts pulling and pushing on his/her end.   The person on the opposite end should receive the pushes and pulls instantaneously as no particle is making the full journey.  Would this actually work? What do you call all the pieces of a song minus the lyrics I think there must be a good word for this, but can't think of what it might be.  Harmony and Melody are pieces of it, beat seems simplistic, Instrumentation seems too scientific and dull.  Any Ideas?