Create a list of functions using R?
Returning anonymous functions from lapply - what is going wrong?
How to pass multiple operator properties via UI layout? Basically, I want to have a single operator which can do multiple things, based on some attributes values.  class MyPanel(bpy.types.Panel):     # (...)     layout = self.layout     row = layout.row()     row.operator("my.button", text="Button text")  class MY_BUTTON_OT_Button(bpy.types.Operator):     bl_idname = "my.button"     bl_description = "Button description"     bl_label = "Button"     foo = bpy.props.IntProperty()     bar = bpy.props.BoolProperty()      if bar:         # Do something with foo     else:         # Do something else :P   I know how to set one attribute, like so:      row.operator("my.button", text="Button text").foo=5   But what about multiple arguments? I tried several things that didn't worked, like (e.g.):   With setattr(): row.operator("my.button", text="Button text").setattr(foo=5,bar=True)   With a custom method setVal() in the operator class: row.operator("my.button", text="Button text").setVal(foo=5,bar=True)   Maybe I must use a single EnumProperty? I hope to avoid this, so my question is: Is it possible to pass multiple custom arguments to set attributes in an operator class? And if yes, how ?  Thanks for your help. I need to knock out a quick animation in C#/Windows Forms for a Halloween display.  Just some 2D shapes moving about on a solid background.  Since this is just a quick one-off project I really don't want to install and learn an entire new set of tools for this.  (DirectX dev kits, Silverlight, Flash, etc..)  I also have to install this on multiple computers so anything beyond the basic .Net framework (2.0) would be a pain in the arse.  For tools I've got VS2k8, 25 years of development experience, a wheelbarrow, holocaust cloak, and about 2 days to knock this out.  I haven't done animation since using assembler on my Atari 130XE (hooray for page flipping and player/missile graphics!)  Advice?  Here's some of the things I'd like to know:   I can draw on any empty widget (like a panel) by fiddling with it's OnPaint handler, right?  That's how I'd draw a custom widget.  Is there a better technique than this? Is there a page-flipping technique for this kind of thing in Windows Forms?  I'm not looking for a high frame rate, just as little flicker/drawing as necessary.   Thanks.  Post Mortem Edit ... "a couple of coding days later"  Well, the project is done.  The links below came in handy although a couple of them were 404.  (I wish SO would allow more than one reply to be marked "correct").  The biggest problem I had to overcome was flickering, and a persistent bug when I tried to draw on the form directly.   Using the OnPaint event for the Form: bad idea.  I never got that to work; lots of mysterious errors (stack overflows, or ArgumentNullExceptions).  I wound up using a panel sized to fill the form and that worked fine. Using the OnPaint method is slow anyway.  Somewhere online I read that building the PaintEventArgs was slow, and they weren't kidding.  Lots of flickering went away when I abandoned this.  Skip the OnPaint/Invalidate() and just paint it yourself.  Setting all of the "double buffering" options on the form still left some flicker that had to be fixed.  (And I found conflicting docs that said "set them on the control" and "set them on the form".  Well controls don't have a .SetStyle() method.)  I haven't tested without them, so they might be doing something (this is the form):      this.SetStyle(ControlStyles.UserPaint, true);     this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);     this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);    So the workhorse of the code wound up looking like (pf is the panel control):      void PaintPlayField()     {         Bitmap bufl = new Bitmap(pf.Width, pf.Height);         using (Graphics g = Graphics.FromImage(bufl))         {             g.FillRectangle(Brushes.Black, new Rectangle(0, 0, pf.Width, pf.Height));             DrawItems(g);             DrawMoreItems(g);             pf.CreateGraphics().DrawImageUnscaled(bufl, 0, 0);         }     }   And I just called PaintPlayField from the inside of my Timer loop.  No flicker at all. Creating mask file from shapefile using ArcGIS for Desktop? I have a shapefile of Lakes over my study area. Each polygon has attribute information of each lake, name, shape etc. Actually I want to eliminate all lakes from analysis. In other word, I want lakes to have 0 value and the area that out of boundary of lake to have their orginal pixel values. when I do subset using this shapefile, the output is not I want because my shapefile deoesn't have any value outer boundary of lake.   How can I build a proper mask file (inner part of lake has 0 value, outer is 1) using this shapefile in ArcGIS Desktop? What happens when I hover over a link in Chrome? boolean variable values in PHP to javascript implementation What is the difference between procfs and sysfs? What is the difference between procfs and sysfs?  Why are they made as file systems? As I understand it, proc is just something to store the immediate info regarding the processes running in the system. Why GCP Kubernetes Node host location for europe-north1 seems to be in US? Disable sleep on laptop lid close in tty1 I'm using Ubuntu Desktop 15.10 on a laptop and it runs an Apache server with SSH as well. When using a GUI, I have the power options set to not sleep at all even when the laptop lid is closed, but recently I stopped the X-System and am now using TTY1 instead to save resources. However, in TTY1, if I close the laptop lid, the computer goes to sleep and prevents the SSH and Apache server from working. Any way to prevent this easily? The realistic answer I bet is to use Ubuntu Server instead (unless I'm mistaken and Ubuntu Server will also sleep on lid close) but I don't exactly want to switch yet unless there's an easy way to switch to it like you can switch from ubuntu-desktop to lubuntu-desktop? Any advice is welcome to prevent the computer from sleeping I just checked my server's /var/log/auth.log and found that I'm getting over 500 failed password/break-in attempt notifications per day! My site is small, and its URL is obscure. Is this normal? Should I be taking any measures? How do I keep Python print from adding newlines or spaces? In python, if I say  print 'h'   I get the letter h and a newline.  If I say   print 'h',   I get the letter h and no newline.  If I say  print 'h', print 'm',   I get the letter h, a space, and the letter m.  How can I prevent Python from printing the space?  The print statements are different iterations of the same loop so I can't just use the + operator. After monitor calibration colors on my two monitors are still different, why? I have a pair of pretty nice monitors (HP ZR30w) which I calibrated with a pretty good calibrator (i1-Pro) and after I calibrated both they still show colors every so slightly differently.  My left monitor has a little more magenta color to it in photos.  Is monitor calibration only ment to get things 'close'?  Other people in the office have experienced similar issues with their pairs of monitors, both HP ZR30w and Dell 3007WFP-HC monitors.  If I can't even get colors to match between my two exact same monitors connected to the same computer I have little confidence that colors on my monitors will look the same on somebody else's calibrated monitor :p Minimal polynomials and cyclic subspaces I'm trying to make my way through two problems in Curtis's Linear Algebra, chapter 25.  One of the two problems is this one, #5:     Prove that $V$ is cyclic relative to a linear transformation $T \in \mathcal{L}(V)$ if and only if the minimal polynomial of $T$ is equal to the characteristic polynomial.   Part of the issue is that I'm not really sure what it's asking. The statement that $V$ is cyclic seems to suggest that the entire vector space (say it has dimension $n$) is generated by some vector $v \in V$, along with $Tv, T^2v, \ldots T^{n-1}v$; Curtis's definition of a cyclic subspace (as opposed to a space, though I can't see why there should be a difference) seems to reinforce this:     A $T$-invariant subspace $V_1$ of $V$ is called cyclic relative to $T$ if $V_1 \neq 0$ and there exists a vector $v_1 \in V_1$ such that $V_1$ is generated by $\{ v_1, Tv_1, T^2v_1, \ldots T^kv_1 \}$ for some $k$.   However, I've seen several examples that seem to directly contradict this interpretation. For example, we recently had a take-home midterm that required we find elementary divisors, rational canonical form, etc., of a $6\times 6$ matrix; a classmate who received a perfect score on her test found that her matrix's characteristic polynomial was equal to its minimal polynomial &#151; it was $(x+8)^2 (x+14)^2 (x^2+61x+80)$ &#151; and yet the vector space could be written as $\left&lt; v_6 \right&gt; \oplus \left&lt; v_4 \right&gt; \oplus \left&lt; -v_2+v_3+v_6 \right&gt;$ &#151; i.e., as the direct sum of three cyclic subspaces, not as one cyclic subspace.  So that suggests that "$V$ is cyclic" might mean the direct sum of cyclic subspaces. However, while working on the exercise that follows (#6), I came across this:  $$S= \left(\begin{array}{ccc} -1 &amp; 0 &amp; 0 &amp; 0\\ 0 &amp; 1 &amp; 0 &amp; 0\\ 0 &amp; 0 &amp; 1 &amp; 0\\ 0 &amp; 0 &amp; 0 &amp; 2 \end{array}\right)$$  Here, the characteristic polynomial is not equal to the minimal polynomial, which is $m(x) = (x-1)(x+1)(x+2)$. The eigenspace associated with $\lambda = 1$ has dimension $2$. And so it seems as though, if $V$ has basis $\{ v_1, v_2, v_3, v_4 \}$, we can write $V = \left&lt; v_1 \right&gt; \oplus \left&lt; v_2 \right&gt; \oplus \left&lt; v_3 \right&gt; \oplus \left&lt; v_4 \right&gt; $. This would seem to contradict my second interpretation of the original question.  Obviously I'm missing something. Could someone fill me in on what it might be? (I've tried to be thorough, but I'm also trying not to make this ridiculously long; if I've left out necessary information, I'll be happy to append it.) What's the deepest reason why QCD bound states have integer charge? Total time derivatives and partial coordinate derivatives in classical mechanics Change desktop background to a solid color (e.g. pitch black) in GNOME 3 Hole-and-nail paradox in special relativity Yesterday we started relativity on our physics class, and my professor taught us a few concepts. We did some examples on how things changed by looking them from different reference systems, and a paradox came to my mind from an example he did on the blackboard:  Suppose that we have a bug inside a hole (and suppose that the height of the bug is $0$). This hole is $L$ meters deep. There's a man outside the hole that wants to kill the bug with a nail of length $l$, with $l&lt;L$. Obviously, it's not possible for him to kill the bug by trying to push the nail in the hole. However, if the nail moves really fast, from it's reference system the hole will have a height $L_n&lt;L$, and if it moves fast enough then it will happen that $L_n&lt;l$, so he finally could kill the bug. On the other hand, the bug knows that from his reference system, the nail will have a lenght $l_b&lt;l$, so it would never reach him.  Is it possible to quantify the problem? How is it possible that the nail reach the bug from it's reference system and from the bug's reference system it's even smaller than before? Prove $\frac{1}{1 \cdot 3} + \frac{1}{3 \cdot 5} + \frac{1}{5 \cdot 7} + \cdots$ converges to $\frac 1 2 $ Show that $$\frac{1}{1 \cdot 3} + \frac{1}{3 \cdot 5} + \frac{1}{5 \cdot 7} + \cdots = \frac{1}{2}.$$  I'm not exactly sure what to do here, it seems awfully similar to Zeno's paradox. If the series continues infinitely then each term is just going to get smaller and smaller.  Is this an example where I should be making a Riemann sum and then taking the limit which would end up being $1/2$? Hello,   I create an app using the Promoted Links in Sharepoint 2013. I chose to do this because the feature has the awesome hover effect and is easy to customize the image.  The issue is that I have been trying to figure out how to change the tile sizes. They are awesome the way they are, however I just need them smaller. I still want the hover effect as well and for the text to match the same ratio as the tile. I have tried web zones, I have done each ID but with no luck. I have attached a sample image of the tiles I'm referring to. Please help. find spectrum matrix A Let $A = \left[ \begin{array}{*{20}{c}} 0&amp;b&amp;0&amp;0&amp;0&amp;0\\ c&amp;0&amp;b&amp;0&amp;0&amp;0\\ 0&amp;c&amp;0&amp;b&amp;0&amp;0\\ 0&amp;0&amp;c&amp;0&amp;b&amp;0\\ 0&amp;0&amp;0&amp;c&amp;0&amp;b\\ 0&amp;0&amp;0&amp;0&amp;c&amp;0 \end{array} \right]_{n \times n}$.  Why does matrix $A$ have spectrum $\sigma (A) = \left\{ 2\sqrt {bc} \cos \left(\frac{\pi k}{n + 1}\right):k = 1,2,\ldots,n \right\}$? Colored borders around windows after update