text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
how to fix axes position by using set_position method in python matplotlib?. <p>I think this is quite easy but I searched the internet and matplotlib users mailing list and not able to find an answer. ax2 is an inset axes within the "ax" axes in figure "fig", which I make by following here: <a href="http://matplotlib.sourceforge.net/examples/pylab_examples/axes_demo.html">http://matplotlib.sourceforge.net/examples/pylab_examples/axes_demo.html</a></p> <p>but now my problem is that I cannot fix the ax2 the exact position I want, it seems that draw() command change this:</p> <pre><code>In [352]: ax2.set_position([0.125,0.63,0.25,0.25]) In [353]: ax2.get_position() Out[353]: Bbox(array([[ 0.125, 0.63 ], [ 0.375, 0.88 ]])) In [354]: draw() In [355]: ax2.get_position() Out[355]: Bbox(array([[ 0.15625, 0.63 ], [ 0.34375, 0.88 ]])) </code></pre> <p>notice that, after "draw()" command, the x0 of ax2 changed. could anyone give any hints? </p> <p>thanks!</p>
0non-cybersec
Stackexchange
Loading 5MB of Memory into a Pan Am Jet, 1956 [520x690](r/historyporn).
0non-cybersec
Reddit
Qualifying Le Mans 1977 - on-board Porsche 936/77 Spyder.
0non-cybersec
Reddit
Solving differential equation with power series $y&#39;&#39; - xy&#39; - y = 0$. <p>I need a work check</p> <blockquote> <p><span class="math-container">$$y'' -xy' - y = 0$$</span> given <span class="math-container">$y(0) = 1$</span> and <span class="math-container">$y'(0) = 0$</span></p> </blockquote> <p>so we have:</p> <p><span class="math-container">$$ \begin{split} y &amp;= \sum_{n=0}^\infty C_nx^n\\ y' &amp;= \sum_{n=1}^\infty nC_nx^{n-1}\\ y' &amp;= \sum_{n=2}^\infty n(n-1)C_nx^{n-2} \end{split} $$</span></p> <p>so making a substitution into the original differential equation:</p> <p><span class="math-container">$$y' = \sum_{n=2}^\infty n(n-1)C_nx^{n-2} - \sum_{n=0}^\infty nC_nx^{n-1} - \sum_{n=0}^\infty C_nx^{n} = 0$$</span></p> <p><span class="math-container">$$y' = \sum_{n=0}^\infty (n+2)(n+1)C_{n+2}x^{n} - \sum_{n=0}^\infty (n+1)C_nx^n = 0$$</span></p> <p><span class="math-container">$$C_{n+2} = \frac{C_n}{n+2}$$</span></p> <p>so first a few terms:</p> <p><span class="math-container">$C_0 = C_0$</span> and <span class="math-container">$C_1 = C_1$</span> and <span class="math-container">$C_2 = \frac{C_0}{2}$</span> and <span class="math-container">$C_3 = \frac{C_1}{3}$</span> and <span class="math-container">$C_4 = \frac{C_2}{4} = \frac{C_0}{4 \cdot 2}$</span> and <span class="math-container">$c_5 = \frac{c_3}{5} = \frac{C_1}{5 \cdot 3}$</span></p> <p>even terms are: <span class="math-container">$\frac{C_0}{2^n \cdot n!}$</span> odd terms are: <span class="math-container">$\frac{C_1}{1 \cdot 3 \cdot 5 \cdot ...(2n+1)}$</span></p> <p>and so <span class="math-container">$$y = \sum_{n=0}^\infty \frac{c_0}{2^n \cdot n!}x^{2n} + \sum_{n=0}^\infty \frac{c_1}{1 \cdot 3 \cdot 5 \cdot (2n+1)} x^{2n+1}$$</span></p> <p>Where do I go from here? if I do <span class="math-container">$y(0)$</span>, I don't get 1. How do I take the derivative of this to check the initial condition <span class="math-container">$y'(0) = 0$</span></p>
0non-cybersec
Stackexchange
AITA for hating my brother?. My brother and I used to be good friends when I was a kid. We hung out, played vidya, and enjoyed each other's company. I looked up to him (he's 13 years older). About the time he joined the navy and he had his first kid with his first wife, things changed. He started acting like my dad and shitting on me for everything I did. As his marriage fell apart and they had two more kids, he started getting angrier and angrier with life in general. Physical altercations between him and I became more of a regular thing. He's been remarried for almost ten years now, but his anger has only gotten worse. He screams blue murder at his kids for doing regular dumb kid shit and whenever I pull him aside to tell him to chill, he threatens me saying I'm "patronizing him". I met my now wife and he's said awful things about her weight and career choice to me, but insists on asking her advice for kid stuff (recently his eldest son shit too close to the house, in a manner of speaking). He ruined a trip my wife and our parents made to his place for new years with one of his explosive outbursts to the point we left his house and celebrated new years eve in our hotel room. Our mom claims that he's jealous because I'm happier and I don't have kids and have all my disposable income to spend on fun shit while he's drowning in debt (mind you, he bought two large swaths of land and a used $16000 beemer and a used $40000 truck). I'm at the point that I'm going to tell him to exit my life and to only talk to me when mom and dad die because his negative influence literally drags me down (he used to put all kinds of negative shit in my head about my wife cheating on me, or trapping me into having a kid and then never working again and it used to get my wife and I into arguments because of how paranoid he made me). I wish he'd realize I'm a grown man and if he needs to reach out, to have enough respect for me as his brother and fellow man to ask for help, but he won't. It breaks my fucking heart to know the guy has issues that he needs to get off his chest but that he won't see me as equal enough to let me help him out in some way.
0non-cybersec
Reddit
A man is sitting at home alone when he hears a knock on the front door.. He opens it to find two policemen standing there. One policeman asks if he is married. He says, “Yes, I am.” The policeman then says, “I’m sorry, sir. But it looks like your wife’s been hit by a truck.” The guy replies, “I know, but she has a great personality and is an excellent cook.”
0non-cybersec
Reddit
Two soviet moon rockets (N1) on the pad at the Baikonur cosmodrome in what is now Kazakhstan.Circa 1970 [1194x1536] . I have heard that one of these is a mockup and the other is a flight article.
0non-cybersec
Reddit
Limit of alternating sum of fractional parts. <p>Find</p> <p><span class="math-container">$\newcommand{\pars}[1]{\left\{ \frac{n}{#1} \right\}}$</span></p> <p><span class="math-container">$$\lim_{n\to\infty}\dfrac{1}{n} \left( \pars{1} - \pars{2} + ... + (-1)^{n+1} \pars{n} \right),$$</span></p> <p>where <span class="math-container">$\left\{ x \right\} $</span> denotes the fractional part of <span class="math-container">$x$</span>.</p> <p>My guess is that the limit is equal to 0; I tried finding some asymptotics for the fractional part sum, by looking for example at ways to bound <span class="math-container">$\pars{k} - \pars{k+1}$</span>; My intuition is that this difference is rather small(perhaps less than <span class="math-container">$\frac{n}{k(k+1)}$</span>) and that it is big enough to be relevant only when one of them is zero, meaning that <span class="math-container">$k$</span> or <span class="math-container">$k+1$</span> divides <span class="math-container">$n$</span>. This would lead me to conjecture that it grows at most as <span class="math-container">$O(\sqrt{n})$</span>, which would make the limit zero, but I have not been able to make this rigorous. Another idea I had would be to look at the sum with odd denominator and the sum with even denominators and show that they must be "rather" close; this seems pretty intuitive but the fractional part is very chaotic and I have not been able to get any bounds.</p> <p>Any ideas/tips would be appreciated!</p>
0non-cybersec
Stackexchange
Phase IV: your thoughts. A classic alien contact film, the twist is that it is earthbound. What is the alien? Ants. Billions upon trillions of ants.
0non-cybersec
Reddit
Find the posterior distribution of θ. <p>I have this problem</p> <p>Given a loss function</p> <p><span class="math-container">\begin{align}l(a,\theta) = |a-\theta|\end{align}</span> for a ∈ A = {4,5,6} and <span class="math-container">$\theta$</span> ∈ <span class="math-container">$\theta$</span> = {4,5,6}</p> <p>Assume the prior distribution is</p> <p><span class="math-container">\begin{align}Pr(\theta=i)=\pi_i=\begin{cases} 0.5, &amp; \text{for i=4}.\\ 0.3, &amp; \text{for i=5}.\\ 0.2, &amp; \text{for i=6}.\\ \end{cases}\end{align}</span></p> <p>How would I find the posterior distribution of <span class="math-container">$\theta$</span> given a sample of 3 observations on a RV X: <span class="math-container">$X_1=x_1=4,X_2=x_2=0,X_3=x_3=3$</span>. Note that <span class="math-container">$X_1,X_2,X_3$</span> are IID Poisson so</p> <p><span class="math-container">\begin{align} f(x_i|\theta=\frac{e^{-\theta}\theta^{x_i}}{x_i!}) for x_i=0,1,2,.. \end{align}</span></p> <p>How would I find the posterior distribution of θ?</p> <p>Thoughts so far: I have done other examples where the prior is a continuous distribution and applied it in the formula <span class="math-container">$f(\theta|x)=\frac{\pi(\theta)f(x|\theta)}{f(x)}$</span>, but I am not sure regarding a discrete prior and what to do with the 3 sample observations On a side note, would the prior distribution be the natural conjugate for <span class="math-container">$\theta$</span>?</p>
0non-cybersec
Stackexchange
Why Should You Identify a Reliable and Reputable Online Platform in India While Buying a Tablet?.
0non-cybersec
Reddit
MRW I ask my daughter what she wants for Christmas and she says, "A doll.".
0non-cybersec
Reddit
How to inherit static methods from base class in JavaScript?. <p>I'm trying to achieve some basic OOP in JavaScript with the prototype way of inheritance. However, I find no way to inherit static members (methods) from the base class.</p> <p>We can simulate the basic class model by using prototype:</p> <pre><code>SomeClass = function(){ var private_members; this.public_method = function(){ //some instance stuff.. }; }; Class.static_method = function(){ //some static stuff; }; //Inheritance SubClass = function(){ //sub-class definition }; SubClass.prototype = new Class(); </code></pre> <p>However, <code>SubClass</code> doesn't inherit <code>static_method</code> from <code>Class</code>.</p>
0non-cybersec
Stackexchange
How to make a Mac (Macbook Pro) not hibernate?. <p>I have already set in the Energy Saver of System Preferences that </p> <pre><code>Computer sleep: on Battery Power, Never when plugged in, Never </code></pre> <p>so if I close the cover of the Macbook Pro running Mountain Lion, so that it sleep, then if I open up the cover within a few hours, then it wakes up right away -- which is all fine. However, if I open up the the cover and not touch it, then after some 12 or 24 hours, then it will wake up from hibernation, taking about 2.5 minutes before any password can be typed in. (update 2015: this Macbook Pro was running with a non SSD hard drive. The wake up time is a lot better if it is an SSD drive).</p> <p>This is all when the Macbook Pro is plugged in (powered by the power adapter). Is there a way to make it not hibernate?</p>
0non-cybersec
Stackexchange
No Fucks To Give 😤.
0non-cybersec
Reddit
Camera Behavior In Pyglet. <p>I would like to know from you how I can make sure that the camera in pyglet (2D) always follows the player keeping it always in the middle of the screen. Also, I would like to know how I can make a linear zoom, with the mouse wheel, always holding the player in the middle of the screen. To be clear, if anyone knows Factorio, I would like the camera to behave the same way. Around I found only examples on how to do it by moving the mouse etc. Unfortunately, I have not found anything that interests me.</p> <p>This is the script I'm currently using:</p> <p>Main class (I do not report all the script, but the parts related to the camera):</p> <pre><code>def on_resize(self, width, height): self.camera.init_gl(width, height) def on_mouse_scroll(self, x, y, dx, dy): self.camera.scroll(dy) def _world(self): self.camera = camera(self) self.player = player(self, 0, 0) self.push_handlers(self.player.keyboard) </code></pre> <p>Camera script:</p> <pre><code>class camera(object): zoom_in_factor = 1.2 zoom_out_factor = 1 / zoom_in_factor def __init__(self, game): self.game = game self.left = 0 self.right = self.game.width self.bottom = 0 self.top = self.game.height self.zoom_level = 1 self.zoomed_width = self.game.width self.zoomed_height = self.game.height def init_gl(self, width, height): self.width = width self.height = height glViewport(0, 0, self.width, self.height) def draw(self): glPushMatrix() glOrtho(self.left, self.right, self.bottom, self.top, 1, -1) glTranslatef(-self.game.player.sprite.x + self.width / 2, -self.game.player.sprite.y + self.height / 2, 0) self.game.clear() if self.game.runGame: for sprite in self.game.mapDraw_3: self.game.mapDraw_3[sprite].draw() glPopMatrix() print(self.game.player.sprite.x, self.game.player.sprite.y) def scroll(self, dy): f = self.zoom_in_factor if dy &gt; 0 else self.zoom_out_factor if dy &lt; 0 else 1 if .1 &lt; self.zoom_level * f &lt; 2: self.zoom_level *= f vx = self.game.player.sprite.x / self.width vy = self.game.player.sprite.y / self.height vx_in_world = self.left + vx * self.zoomed_width vy_in_world = self.bottom + vy * self.zoomed_height self.zoomed_width *= f self.zoomed_height *= f self.left = vx_in_world - vx * self.zoomed_width self.right = vx_in_world + (1 - vx) * self.zoomed_width self.bottom = vy_in_world - vy * self.zoomed_height self.top = vy_in_world + (1 - vy) * self.zoomed_height </code></pre> <p>This is what I get: <a href="https://i.stack.imgur.com/vm8Tz.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vm8Tz.gif" alt="enter image description here"></a></p> <p>This is what I would like to get (use Factorio as an example):</p> <p><a href="https://i.imgur.com/FteOKOV.gif" rel="nofollow noreferrer"><img src="https://i.imgur.com/FteOKOV.gif" alt="enter image description here"></a></p> <p>The script that I use at the moment I took it from here and modified for my need:</p> <p><a href="https://stackoverflow.com/questions/19428258/how-to-pan-and-zoom-properly-in-2d">How to pan and zoom properly in 2D?</a></p> <p>However, the script I am using, as you see, is based on something that has been created by someone else and I hate using something this way, because it does not belong to me. So I'm using it just to experiment and create my own camera class. That's why I asked for advice.</p> <p>Other examples I watched:</p> <p><a href="https://www.programcreek.com/python/example/91285/pyglet.gl.glOrtho" rel="nofollow noreferrer">https://www.programcreek.com/python/example/91285/pyglet.gl.glOrtho</a></p> <p><a href="https://groups.google.com/forum/#!topic/pyglet-users/g4dfSGPNCOk" rel="nofollow noreferrer">https://groups.google.com/forum/#!topic/pyglet-users/g4dfSGPNCOk</a></p> <p><a href="https://www.tartley.com/2d-graphics-with-pyglet-and-opengl" rel="nofollow noreferrer">https://www.tartley.com/2d-graphics-with-pyglet-and-opengl</a></p> <p>There are other places I've watched, but I do not remember the links</p> <p>To avoid repetition, yes, I looked on pyglet's guide, but at least that I am so stupid (I do not exclude it), I did not find anything that would help me to understand how to do it.</p>
0non-cybersec
Stackexchange
Finding automorphisms of totally colored graphs with nauty/traces. <p>The <a href="http://pallini.di.uniroma1.it/" rel="nofollow noreferrer">nauty and traces</a> software package is able to calculate automorphism groups of vertex colored graphs. The accompanying <a href="http://pallini.di.uniroma1.it/Guide.html" rel="nofollow noreferrer">manual</a> also describes (in section 14) how to obtain automorphism groups of edge colored graphs by mapping the problem to an equivalent one over vertex colored graphs.</p> <p>My question is whether there exists a similar approach for the same problem over totally colored graphs. One possible solution might be to compute the automorphism groups for variants of such a graph with vertex-/edge-only coloring first and to then compute their intersection but I believe that this might be computationally expensive and would also require a base and strong generating set for both these groups which are internally generated by nauty but not actually accessible via its C-interface (at least that is my impression after reading the manual).</p> <p>Can anyone give me a suggestion as to what would be the most efficient approach from a practical standpoint?</p>
0non-cybersec
Stackexchange
What Armadillo Aerospace has been up to for the last 8 months. With Pictures!.
0non-cybersec
Reddit
Manowar - Holy War.
0non-cybersec
Reddit
Probability distribution of $\frac{1}{\sigma^2}Y&#39;AY$. <blockquote> <p>If $A_{p\times p}$ is a non-random matrix, symmetric and idempotent matrix with $\mu_{p\times 1}=0$ and $\Sigma=\sigma^2 I_{p\times p}$, then $$V=\frac{1}{\sigma^2}Y'AY\sim \chi_r^2$$ where $Y_{p\times 1}\sim N(\mu,\Sigma)$ and $r=rank(A)$.</p> </blockquote> <p>First I used the matrix properties of $A$, so $$V=\frac{1}{\sigma^2}Y'AY=\frac{1}{\sigma^2}Y'AAY=\frac{1}{\sigma^2}(AY)'AY$$</p> <p>Let $Z_{p\times 1}=AY$ then $$V=\frac{1}{\sigma^2}Z'Z=\frac{1}{\sigma^2}\sum_{i=1}^pZ_i^2 \quad(*)$$</p> <p>To find the distribution of $Z$ I used moment generating function</p> <p>$$M_Z(t)=E[\exp(t'(AY)]=E[\exp(A't)'Y]=M_Y(t)(A't)$$ $$=\exp\Big(\frac{1}{2}t'(A\Sigma A')t\Big)$$ so $Z\sim N_p(0,A\Sigma A')$ and from marginalization propertie I know that each $Z_i$ have Normal distribution also.</p> <p>The problem is that I don't find a way to link it with $(*)$</p> <p>I'm not understanding well the relationsheep between the rank of $A$ and the degree of freedom in the chi-squared distribution. Why when I have $A=I_{p\times p}$ (identity matrix) I get that $V\sim \chi_p^2$?</p>
0non-cybersec
Stackexchange
Should I be concerned with wood movement here?.
0non-cybersec
Reddit
Finnish officers inspecting Soviet skiing manuals during the Winter War, February 1940. Behind them are Stalin banners captured in battle. [707 x 768].
0non-cybersec
Reddit
Inis reviewed in under a minute - one of the best strategy games I've played.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Steam: New steam library folder must be on a filesystem mounted with execute permissions. <p>This question is not a duplicate, as the other questions with the same issue do not have working solutions.</p> <p>I installed steam onto my main hard drive, but I need to add a library because my main hard drive doesn't have enough space for games. When I try to create a new library, I get the error message:</p> <pre><code>New steam library folder must be on a filesystem mounted with execute permissions. </code></pre> <p>The drive I'm trying to install games onto is NTFS, and gets mounted by <code>fstab</code> on <code>/media/reddragon/games</code>. However, even when adding the options <code>exec</code> and <code>rwx</code> to the options area, I still have the same error.</p> <p>The current workaround is to mount the drive through <code>nautilus</code> when I log in, but It's kind of annoying, since I shutdown my computer every time I walk away for more than a few minutes.</p> <p>Does anyone know what I'm doing wrong here?</p> <p>Also, making a symbolic link to the default directory won't work, I don't like symbolic links, they're very complicated to deal with, especially when unmounting and mounting drives.</p>
0non-cybersec
Stackexchange
Difflib&#39;s SequenceMatcher - Customized equality. <p>I've been trying to create a nested or recursive effect with SequenceMatcher.</p> <p>The final goal is comparing two sequences, both may contain instances of different types.</p> <p>For example, the sequences could be:</p> <pre><code>l1 = [1, "Foo", "Bar", 3] l2 = [1, "Fo", "Bak", 2] </code></pre> <p>Normally, SequenceMatcher will identify only [1] as a common sub-sequence for l1 and l2.</p> <p><strong>I'd like SequnceMatcher to be applied twice for string instances</strong>, so that <code>"Foo"</code> and <code>"Fo"</code> will be considered equal, as well as <code>"Bar"</code> and <code>"Bak"</code>, and the longest common sub-sequence will be of length 3 <code>[1, Foo/Fo, Bar/Bak]</code>. That is, I'd like SequenceMatcher to be <strong>more forgiving when comparing string members</strong>.</p> <p>What I tried doing is write a wrapper for the built-in str class:</p> <pre><code>from difflib import SequenceMatcher class myString: def __init__(self, string): self.string = string def __hash__(self): return hash(self.string) def __eq__(self, other): return SequenceMatcher(a=self.string, b=self.string).ratio() &gt; 0.5 </code></pre> <p>Edit: perhaps a more elegant way is:</p> <pre><code>class myString(str): def __eq__(self, other): return SequenceMatcher(a=self, b=other).ratio() &gt; 0.5 </code></pre> <p>By doing this, the following is made possible:</p> <pre><code>&gt;&gt;&gt; Foo = myString("Foo") &gt;&gt;&gt; Fo = myString("Fo") &gt;&gt;&gt; Bar = myString("Bar") &gt;&gt;&gt; Bak = myString("Bak") &gt;&gt;&gt; l1 = [1, Foo, Bar, 3] &gt;&gt;&gt; l2 = [1, Fo, Bak, 2] &gt;&gt;&gt; SequenceMatcher(a=l1, b=l2).ratio() 0.75 </code></pre> <p>So, evidently it's working, but I have a bad feeling about overriding the <strong>hash</strong> function. When is the hash used? Where can it come back and bite me?</p> <p>SequenceMatcher's documentation states the following:</p> <blockquote> <p>This is a flexible class for comparing pairs of sequences of any type, so long as the sequence elements are <strong>hashable</strong>.</p> </blockquote> <p>And by definition hashable elements are required to fulfill the following requirement:</p> <blockquote> <p>Hashable objects which compare equal must have <strong>the same hash value</strong>.</p> </blockquote> <p>In addition, do I need to override <strong>cmp</strong> as well?</p> <p>I'd love to hear about other solutions that come to mind.</p> <p>Thanks.</p>
0non-cybersec
Stackexchange
Sql Server deterministic user-defined function. <p>I have the following user-defined function:</p> <pre><code>create function [dbo].[FullNameLastFirst] ( @IsPerson bit, @LastName nvarchar(100), @FirstName nvarchar(100) ) returns nvarchar(201) as begin declare @Result nvarchar(201) set @Result = (case when @IsPerson = 0 then @LastName else case when @FirstName = '' then @LastName else (@LastName + ' ' + @FirstName) end end) return @Result end </code></pre> <p>I can't create an Index on a computed column using this function cause it's not deterministic. Someone could explain why is it not deterministic and eventually how to modify to make it deterministic? Thanks</p>
0non-cybersec
Stackexchange
Philosophy as therapy is an ancient idea, endorsed by Wittgenstein & popularized by self-help books. But the purpose of philosophy -to change the world or simply reconcile us to it- is yet to be decided..
0non-cybersec
Reddit
Finding a linear spanning equation from basis vectors. <p>I understand how to find basis vectors from a linear equation, for example, finding the vectors: <span class="math-container">$\pmatrix{1\\0\\-\frac{3}{2}}, \pmatrix{0\\1\\\frac{1}{2}}$</span> from the equation <span class="math-container">$2z-y+3x=0$</span> but I am struggling to find an intuitive approach to go the other way round, i.e., finding a linear equation from basis vectors. If somebody could explain how this is done with examples I would really appreciate it, thank you.</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
IAmA white male from the US who used to work in a factory in one of those Chinese Microsoft-type factories (as a manager).. I was there for about six months and will be returning again soon. I'm posting this because I'm at the bottom of the controversial thread about the Microsoft vendor in China from the front page and I believe I can offer more insight into an area of the world we depend on so much but about which have so little understanding. I also used to live & work in India - where my living quarters were an office back room (responding to a past request for strange living quarters). PS. No Reddit is not blocked by the Chinese firewall. However, BBS similar to Reddit are very popular in China.
0non-cybersec
Reddit
For an Artinian ring semiprimitive implies semisimple.. <p>I'm currently reading Rotman's <em>An Introduction to Homological Algebra</em> (2nd edition), and on page 188 in the proof of Theorem 4.66 (Every left Artinian ring is semiperfect), I ran across the claim:</p> <blockquote> <p>If <span class="math-container">$R$</span> is left Artinian, and <span class="math-container">$J(R)$</span> is the Jacobson radical of <span class="math-container">$R$</span>, then <span class="math-container">$R/J(R)$</span> is left semisimple.</p> </blockquote> <p>Now, it's quite possible that I've run across this claim earlier in the text accompanied by a citation likely of either Lam's <em>A First Course in Noncommutative Rings</em> or Rotman's own <em>Advanced Modern Algebra</em> (the books Rotman usually cites for algebra facts), but there is no citation for the fact at this point in the text.</p> <p>However, I don't have a copy of either of these books, so I decided to try to reconstruct a proof.</p> <p>It suffices to prove that if <span class="math-container">$R$</span> is left Artinian and semiprimitive (<span class="math-container">$J(R)=0$</span>), then it is left semisimple.</p> <p><strong>Attempted proof:</strong> </p> <p>Consider the set of finite intersections of maximal left ideals. Since <span class="math-container">$R$</span> is left Artinian, this collection has a minimal element, <span class="math-container">$I=M_1\cap \cdots \cap M_n$</span>. Then <span class="math-container">$I=J(R)=0$</span>, since if <span class="math-container">$m\in I$</span> with <span class="math-container">$m\ne 0$</span>, then since the intersection of all maximal ideals is <span class="math-container">$J(R)=0$</span>, there is a maximal ideal <span class="math-container">$M_0$</span> with <span class="math-container">$m\not\in M_0$</span>, so <span class="math-container">$I\cap M_0 \subsetneq I$</span>, contradicting the minimality of <span class="math-container">$I$</span>.</p> <p>Thus let <span class="math-container">$M_1,\ldots,M_n$</span> be maximal left ideals such that <span class="math-container">$M_1\cap M_2\cap\cdots \cap M_n=0$</span>.</p> <p>Now consider the map <span class="math-container">$$\phi : R\to \bigoplus_{i=1}^n R/M_i$$</span> defined by <span class="math-container">$r\mapsto (r+M_i)$</span>.</p> <p>The kernel of this map is <span class="math-container">$\bigcap_{i=1}^n M_i=0$</span>, so this map is injective. Hence, we have realized <span class="math-container">$R$</span> as a submodule of the semisimple module <span class="math-container">$\bigoplus_{i=1}^n R/M_i$</span>.</p> <p>Thus we have realized <span class="math-container">$R$</span> as a submodule of a semisimple (left) <span class="math-container">$R$</span>-module, so <span class="math-container">$R$</span> is left semisimple itself (Corollary 4.2 in Rotman <em>Hom. Alg.</em>). <span class="math-container">$\blacksquare$</span></p> <p><strong>Questions</strong></p> <ol> <li>Is this proof correct or am I missing something?</li> <li><p>My first thought was to take <span class="math-container">$R\to \prod_M R/M$</span> with <span class="math-container">$M$</span> running over all maximal left ideals, and I hoped that the image of <span class="math-container">$R$</span> would end up in the direct sum, but I realized that I couldn't guarantee that this was going to be the case unless there were finitely many maximal ideals. In the commutative case it's not hard to see immediately that an Artinian ring has finitely many maximal ideals, since we have the lemma</p> <blockquote> <p>If <span class="math-container">$Q \supseteq \bigcap_{i=1}^n P_i$</span>, then <span class="math-container">$Q\supseteq P_i$</span> for some <span class="math-container">$i$</span>. (Proof: Otherwise take <span class="math-container">$p_i\in P_i\setminus Q$</span> and consider <span class="math-container">$\prod_i p_i$</span>.)</p> </blockquote> <p>The contrapositive of this says that if there were infinitely many maximal ideals, their successive finite intersections wouldn't stabilize. Is there a similar argument to prove that there are only finitely many maximal ideals in the noncommutative case? Naturally, <a href="https://www.springer.com/us/book/9780387951836" rel="nofollow noreferrer">this follows from semisimplicity</a>, but I was wondering if there's a way to see this a priori.</p></li> </ol> <p><strong>Note:</strong> I wrote the bulk of this yesterday, before finding a copy of <em>Advanced Modern Algebra</em> online. It does in fact contain a (different) proof of this proposition. (Theorem 8.45 in the second edition) Since the proof is different, question (1) remains valid, and I'm still curious about question (2).</p> <p><strong>Edit note:</strong> I am editing the writing at several points to make my thoughts, intentions and argument more clear, following the advice of rschweib's answer. This note is for future readers who may therefore be puzzled by the parts of rschweib's answer commenting on certain things in the question that were poorly expressed.</p>
0non-cybersec
Stackexchange
What are the differences between the multiple ways to create zero-sized structs?. <p>I found four different ways to create a <code>struct</code> with no data:</p> <ul> <li><pre><code>struct A{} // empty struct / empty braced struct </code></pre></li> <li><pre><code>struct B(); // empty tuple struct </code></pre></li> <li><pre><code>struct C(()); // unit-valued tuple struct </code></pre></li> <li><pre><code>struct D; // unit struct </code></pre></li> </ul> <p>(I'm leaving arbitrarily nested tuples that contain only <code>()</code>s and single-variant <code>enum</code> declarations out of the question, as I understand why those shouldn't be used).</p> <p><strong>What are the differences</strong> between these four declarations? Would I use them for specific purposes, or are they interchangeable?</p> <p>The book and the reference were surprisingly unhelpful. I did find <a href="https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md" rel="noreferrer">this accepted RFC (<em>clarified_adt_kinds</em>)</a> which goes into the differences a bit, namely that the unit struct also declares a constant value <code>D</code> and that the tuple structs also declare constructors <code>B()</code> and <code>C(_: ())</code>. However it doesn't offer a design guideline on why to use which.</p> <p>My guess would be that when I export them with <code>pub</code>, there are differences in which kinds can actually be constructed outside of my module, but I found no conclusive documentation about that.</p>
0non-cybersec
Stackexchange
Sigma releases mirrorless foveon sensor camera..
0non-cybersec
Reddit
I'm surprised the UN hasn't done something about Japanese movies. [NSFW?].
0non-cybersec
Reddit
Call for help: researching the recent gmail password leak. Hey /r/netsec, I'm trying to do some research on the recent list of apparent @gmail.com passwords that were posted this week. In the interest of disclosure: I work at Google, but I'm not doing this in any kind of official capacity - it's pure curiosity / personal research. Anyway, if you were amongst those who had accounts listed, and you can uniquely recognize your password and identify which site it came from, please check out: https://blog.skullsecurity.org/2014/call-for-help-researching-the-recent-gmail-password-leak I'd really like to get a list of which breaches were aggregated in this list! As a special bonus, I also posted an aggregated list of passwords there. And no, I'm not gonna release or keep email addresses. :) <edit> I changed the link from isleaked.com to haveibeenpwned.com - thanks to u/takentakentekken for the info!
1cybersec
Reddit
Aphromoo shows that Veigar is balanced.
0non-cybersec
Reddit
A continuous function on a compact set which takes any value finitely many times.. <p>Let $f : [0,1] \to \mathbb{R}$ be continuous function, such that it takes any value finitely many times and $f(0) \neq f(1)$, then does there exist a point $r_{0}$ in the range such that the cardinality of $f^{-1}(r_{0})$ is odd? (Note that the domain is compact.)</p> <p>I feel that the answer is affirmative but not been able to come up with any concrete argument. I feel this because, as the function is continuous on $[0,1]$, it would attain its maximum and minimum. With out loss of generality, we can assume that the minimum is attained at $0$ and maximum is attained at $1$. In between, $0$ and $1$ it might oscillate any number of times. But the number of times minimum is attained and maximum is attained must have different parity. </p>
0non-cybersec
Stackexchange
I see your "problem" and raise you an addiction....
0non-cybersec
Reddit
How to put a long equation spanning two columns while using IEEEtran?. <p>I am using the IEEEtran document class to generate my PDF file so that it has two columns, but now I get a long equation and I cannot put it into just one of the two columns. Thus I used \onecolumn at the beginning of my equation and \twocolumn at the end of my equation like this:</p> <pre><code>\documentclass[journal]{IEEEtran} \begin{document} ... \onecolumn \begin{align} T\triangleq{} &amp; \int_{0}^{\infty} \frac {\gamma^{k+m_2-1}\exp\Bigl(-\frac{m_2\gamma}{\bar\gamma_2}\Bigr)} {1+\Bigl(\frac{(m_1+s\bar\gamma_1)\gamma}{cm_1}\Bigr)^{m_1}(1+\frac{1}{c}\gamma_2) ^{\lceil m_1 \rceil -m_1}} \,\mathrm{d}\gamma \\ \nonumber ={}&amp; C\int_{0}^{\infty}\gamma^{k+m_2-1}\exp\Biggl(-\frac{m_2\gamma}{\bar\gamma_2}\Biggr) \\ &amp;\times H_{1,1}^{1,1} \left[ \frac{(m_1+s\bar\gamma_1)\gamma}{cm_1} \;\middle|\; \begin{gathered} (1-m_1,1) \\ (0,1)\end{gathered} \right] H_{1,1}^{1,1} \left[ \frac{\gamma}{c} \;\middle|\; t \begin{gathered} (1-\lceil m_1 \rceil +m_1,1) \\ (0,1)\end{gathered} \right] \mathrm{d}\gamma \\ ={}&amp; C\Biggl(\frac{\bar\gamma_2}{m_2}\Biggr)^{k+m_2} H_{1,\,[1:\,1],\,0,\,[1:\,1]}^{1,\,1,\,1,\,1,\,1} \left[ \begin{gathered} \frac{(m_1+s\bar{\gamma}^{}_{1})\bar{\gamma}^{}_{2}}{c\,m_1m_2} \\ \frac{\bar{\gamma}^{}_{2}}{c\,m_2} \end{gathered} \;\middle|\; \begin{gathered} (k+m_2,1) \\ (1-m_1,1);(1-\lceil{m_1}\rceil+m_1,) \\ - \\ (0,1);(0,1) \end{gathered} \right] \\ ={}&amp; C\Biggl(\frac{\bar\gamma_2}{m_2}\Biggr)^{k+m_2} G_{1,\,[1:\,1],\,0,\,[1:\,1]}^{1,\,1,\,1,\,1,\,1} \left[ \begin{gathered} \frac{(m_1+s\bar{\gamma}^{}_{1})\bar{\gamma}^{}_{2}}{c\,m_1m_2}\\ \frac{\bar{\gamma}_{_2}}{c\,m_2} \end{gathered} \;\middle|\; \begin{gathered} k+m_2\\1-m_1;1-\lceil{m_1}\rceil+m_1 \\ - \\ 0;0\end{gathered} \right]. \end{align} \twocolumn </code></pre> <p>which will generate an equation in the middle of the paper like this: <img src="https://i.stack.imgur.com/HiWwW.png" alt="The long equation I want to break"> But I was told that the format is not suitable for publication, and I have to <strong>put this long equation spanning two columns</strong>. What's the solution?</p>
0non-cybersec
Stackexchange
Vertical alignment of reaction mechanism. <p>How can I align the following reaction mechanism of the Aspirin synthesis in chemfig?</p> <p>Code:</p> <pre><code>\schemestart \definesubmol\nobond{-[2,0.2,,,draw=none]} \chembelow[5mm]{\chemfig[][scale=0.7]{HO-[:-30]@{5}(!\nobond\scriptstyle\oplus)(-[:-90]CH_3)(-[@{2}:30]O-[:-30](-[:-90]CH_3)=[:30]O)}}{\chembelow[5mm]{+}{\chemfig[][scale=0.7]{*6(=-=(-([:90]=O)([:-40]-OH))-(-@{4}O@{3}H)=-)}}} \qquad\qquad \arrow(.base east--.base west){-&gt;[\tiny\chemfig{{-}CH_3COOH}][][4pt]} \chemfig[][scale=0.7]{*6(=-=(-([:90]=O)([:-40]-OH))-(-O-[:-210](-[:90]@{7}O-[@{6}:360]H)(-[:210]CH_3))=-)} \chemmove[-&gt;,shorten &lt;=2pt]{ \draw[shorten &gt;=8pt](2)..controls +(-50:2.5cm)and+(45:1cm)..(3);} \chemmove[-&gt;,shorten &lt;=2pt]{ \draw[shorten &gt;=3pt](4)..controls +(180:1cm)and+(-135:1cm)..(5);} \chemmove[-&gt;,shorten &lt;=2pt]{ \draw[shorten &gt;=5pt](6)..controls +(90:5mm)and+(90:5mm)..(7);} \arrow{-&gt;[\tiny\chemfig{{-}\chemabove{H}\oplus}]} \chemfig[][scale=0.7]{*6(=-=(-([:90]=O)([:-40]-OH))-(-O-[:-210](=[:90]O)(-[:210]CH_3))=-)} \schemestop </code></pre> <p>Thank you for your answer!</p> <p><img src="https://i.stack.imgur.com/8kFKy.png" alt="Reaction mechanism in the actual state"></p>
0non-cybersec
Stackexchange
Problem adding std::filesystem to CMake Project. <p>I am new to CMake projects and I want to use the file system library in my project. I am running Ubuntu 18.04 with GCC 8.2 and CMake 3.13. In order to achieve this I tried two options: </p> <p><strong>Option 1</strong></p> <pre><code>cmake_minimum_required(VERSION 3.13) project(TheFsProject) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "-std=c++17 -lstdc++fs") </code></pre> <p>This does not help as the compiler still cannot find the file system library during compile time.</p> <p><strong>Option 2</strong> (copied from: <a href="https://www.scivision.co/cmake-cpp-17-filesystem/" rel="nofollow noreferrer">https://www.scivision.co/cmake-cpp-17-filesystem/</a>)</p> <pre><code>make_minimum_required(VERSION 3.13) project(TheFsProject) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_REQUIRED_FLAGS -std=c++17) include(CheckCXXSymbolExists) CHECK_CXX_SYMBOL_EXISTS(std::filesystem::path::preferred_separator cxx17fs) if(cxx17fs) add_executable(TheFsProject main.cpp) set_property(TARGET TheFsProject PROPERTY CXX_STANDARD 17) endif() </code></pre> <p>This does not help either as I get a CMake error which I don't understand.</p> <pre><code>(CHECK_CXX_SYMBOL_EXISTS): CHECK_CXX_SYMBOL_EXISTS Macro invoked with incorrect arguments for macro named: CHECK_CXX_SYMBOL_EXISTS </code></pre> <p>I feel out of my depth on this topic which is why I came here. I don't mind putting extra work into finding out more but I don't know anymore where to look. Any help would be appreciated!</p> <h3>EDIT 1</h3> <p>Thanks for the replies so far! I made <strong>Option 3</strong> based on your feedback:</p> <pre><code>cmake_minimum_required(VERSION 3.13) project(TheFsProject) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(TheFsProject main.cpp) target_link_libraries(TheFsProject stdc++fs) </code></pre> <p>Sadly it doesn't fix my problem. It still issues an error during compilation that it can't find the compilation header.</p> <h3>EDIT 2</h3> <p>Thanks for all the replies so far. All of these help. I tried Ashkan his answer last (because it seemed intimidating). This one returns </p> <blockquote> <p>Compiler is missing file system capabilities.</p> </blockquote> <p>so I'm guessing something is wrong on that end. This is useful in the sense that I now know it's probably not due to my CMake file. I now have to find out why the compiler does support the file system header though...</p> <h3>EDIT 3</h3> <p>Strictly speaking this question is answered because my question is about the CMake file. I am going to mark Ashkan his answer as the solution simply because it produced the next step in my troubleshooting search. If I could I would also mark lubgr his answer because I think that's a really good answer as well. Thanks everyone!</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Laravel Hash equivalent in core php. <p>I already have a web application where i have encrypted all my password using</p> <blockquote> <p>Hash::make($string);</p> </blockquote> <p>What is the equivalent of that in core php , that would help my android developers in syncing with my app. I tried with hash and crypt, it wasn't same. Help me with it, so that it would be easier for my developers to write backend. </p>
0non-cybersec
Stackexchange
A limit of n times sine values at factorially spaced arguments. <p>Evaluate the following limit </p> <p>$\lim\limits_{n \to \infty} n \sin(2\pi \;e \;n!)$</p> <p>I have no idea how to proceed forward? </p> <p>Answer for above is $2\pi$ but I don't know how this comes about.</p>
0non-cybersec
Stackexchange
AITA for renting my Airbnb house just days before my sister planned to stay there? It was part of our agreement but she says because of the timing, I'm a major asshole.. I guess where to start. This is a throwaway because I'm very active on the Airbnb sub and I don't want people to misconstrue that this is somehow a backdoor advertisement for my place. I'm 23, about 5 years ago I got a really nice inheritance from grandmother after years and years of probate. I am madly in love with this little ski town in Northern New Mexico so I went and bought a condo there. I use it whenever I can but to make it feasible I also put it on Airbnb. It doesn't really make me any money but I figure I'm allowing other people to pay my equity and plus I have an awesome place I can use whenever I want. I try to be generous with my family regarding the condo, but after years of it being on the Airbnb market I finally had to tell people that I can't accept long term "free" reservations. It just happened too many times where all my friends and family would reserve big holidays or whatever months in advance and then not only would I miss out on the income from those big events, a few times they didn't even show or arrived late or left early. (To illustrate how big a deal this is, I make 80% of my yearly income payment over about 25 days of holidays...it's a huge deal to miss out on that income). My sister and I are sisters for sure but we don't really get along that well. It's even more exacerbated because she blew through all of her inheritance in about two years and really doesn't have much to show for it. So my house is a major thorn in her side. In April she asked me if she could "reserve" my condo for 4th of July week. I told her I couldn't block it out on my Airbnb calendar but as long as no one rented it, she could use it. I even looked through my texts and I even told her when we were talking about this "please understand that if someone rents it last minute, I have to be able to get the income." She agreed to that. I thought it would be a non-issue because the place always rents well in advance for 4th of July but this year it didn't. She was supposed to drive up Saturday the 29th. On Friday the 28th I got a rental request for not only 4th of July week (at the premium price) they wanted to stay on through middle of September. This is thousands of dollars which will help me install a new hot water heater. I told my sister that I was sorry but the place rented last minute so I had to let it go to the paying customer. Well all hell broke loose. She screamed her head off at me saying that she had made non refundable rafting reservations, made special arrangements with her ex to get the kids that week and soured her relationship with her boss for extra vacation time. I told her I was really sorry but that had been part of our agreement. She said I was a stupid bitch and our agreement meant that last minute meant like week prior, not the day prior. I hung up on her because I don't need to be called names. But then I got many calls from my other siblings and mom saying that I was really screwing my sister over. Was I the asshole?
0non-cybersec
Reddit
/all: Don't worry guys... .
0non-cybersec
Reddit
Benítez not showing confidence in James.
0non-cybersec
Reddit
Not a Monad Constraint. <p>Is it possible to define a instance constrain for "not a monad", in order to define two non-overlapping instances, one for monadic values, other for non-monadic values?</p> <p>A simplified example:</p> <pre><code>{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverlappingInstances #-} class WhatIs a b | a -&gt; b where whatIs :: a -&gt; b instance (Show a) =&gt; WhatIs a String where whatIs = show instance (Monad m, Functor m, Show a) =&gt; WhatIs (m a) (m String) where whatIs x = fmap show x main :: IO () main = do let x = 1 :: Int putStrLn "----------------" {-print $ whatIs (1::Int)-} print $ whatIs (Just x) putStrLn "--- End --------" </code></pre> <p>So, I use the FunctionalDependencies to avoid type annotations, but of course, the compiler complains with</p> <pre><code> Functional dependencies conflict between instance declarations: instance [overlap ok] Show a =&gt; WhatIs a String -- Defined at test.hs:10:10 instance [overlap ok] (Monad m, Functor m, Show a) =&gt; WhatIs (m a) (m String) -- Defined at test.hs:13:10 </code></pre> <p>Because <code>a</code> can assume the value <code>m a</code>, and thus a conflict arises.</p> <p>However, if I could replace the first instance with something like:</p> <pre><code>instance (NotAMonad a, Show a) =&gt; WhatIs a String where whatIs = show </code></pre> <p>This problem would not present itself.</p> <p>So far I've found this <a href="http://okmij.org/ftp/Haskell/isFunction.lhs" rel="nofollow">very old email</a> that seems to propose a somewhat related solution, but I'm not sure if there are new techniques to address this...</p> <p>I also found the <a href="http://hackage.haskell.org/package/constraints-0.3.4.2/docs/Data-Constraint.html" rel="nofollow">constraints</a> package, which I'm sure has useful functions for this case, but it is sorely lacking in (simple) examples.</p> <p>Any clues?</p> <p><strong>Edit: after user2407038 correct answer.</strong></p> <p>So, I tried user2407038 answer below, and indeed I managed to compile the provided example. The conclusion? I should not have simplified the example so much. After some thinkering with my actual example, I was able to reduce it to this:</p> <pre><code>{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module IfThenElseStackExchange where class IfThenElse a b c d | a b c -&gt; d where ifThenElse :: a -&gt; b -&gt; c -&gt; d instance (Monad m) =&gt; IfThenElse (m Bool) (m b) (m b) (m b) where ifThenElse m t e = do b &lt;- m if b then t else e instance (Monad m) =&gt; IfThenElse (m Bool) b b (m b) where ifThenElse ma t e = do a &lt;- ma return $ if a then t else e </code></pre> <p>But I still getting the dreaded <code>Functional dependencies conflict between instance declarations</code> error. Why? The part after the <code>=&gt;</code> (the <a href="http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/type-class-extensions.html#instance-decls" rel="nofollow">instance head</a>, as user2407038 promptly noted) is in fact quite different, thus it does not even qualify for OverlappingInstances, as the compiler can choose the most specific one.</p> <p>Then what?</p> <p>The error is, as always, hinted by the error message. The <code>a b c d | a b c -&gt; d</code> part is not being respected by the code above. So I finally tried this instead:</p> <pre><code>{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module IfThenElseStackExchange where class IfThenElse a b c d | a b c -&gt; d where ifThenElse :: a -&gt; b -&gt; c -&gt; d instance (Monad m, c ~ b) =&gt; IfThenElse (m Bool) (m b) (m b) (m c) where ifThenElse m t e = do b &lt;- m if b then t else e instance (Monad m, c ~ b) =&gt; IfThenElse (m Bool) b b (m c) where ifThenElse ma t e = do a &lt;- ma return $ if a then t else e </code></pre> <p>Et voilà!</p> <p>By using <code>(m b)</code> in the last parameter, I was trying to indicate that the final result has the same type as the second and third parameter. But the problem seems to be that the <code>FunctionalDependencies</code> extension does not make the same kind of instance choosing on types as <a href="http://www.haskell.org/ghc/docs/7.0.4/html/users_guide/type-class-extensions.html#instance-overlap" rel="nofollow">OverlappingInstances</a>, and thus considers <code>b</code> and <code>(m b)</code> "the same" for its purposes. Is this interpretation correct, or am I still missing something?</p> <p>I can still 'tell' the compiler that <code>c</code> is of the same type as <code>b</code> using the constrain <code>c ~ b</code>, and thus reaching the intended result.</p> <p>After reading some more material about this, I highly recomend reading <a href="http://okmij.org/ftp/Haskell/typeEQ.html" rel="nofollow">this article by Oleg</a> where he generalizes his former solutions that both I and user2407038 linked. I found it quite accessible.</p> <p>If my interpretation of the FunctionalDependencies above is correct, and TypeFamilies being presented as a more flexible solution for the same problem domain, I wonder if could use them to solve this in another way. Oleg solution mentioned above sure uses them, of course.</p>
0non-cybersec
Stackexchange
.NET Application_BeginRequest - How to get User reference?. <p>I'm trying to get a reference to the user object in my Global.asax file's <code>Application_BeginRequest</code>. I'm using the property <code>Context.User</code> but I get a <code>NullReferenceException</code>. <strong>Is it possible to get a user object reference in Application_BeginRequest?</strong></p>
0non-cybersec
Stackexchange
Keyboard failure. Press F1..
0non-cybersec
Reddit
AWS Retrieving Security Credentials from Instance Metadata. <p>This is not a duplicate of the question "Getting my AWS credentials using an API call" because I am asking specifically about what Amazon means in the example that they give.</p> <p>I am looking here: <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html" rel="noreferrer">http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html</a></p> <p>I see this bit:</p> <blockquote> <p><strong>Warning</strong></p> <p>If you use services that use instance metadata with IAM roles, ensure that you don't expose your credentials when the services make HTTP calls on your behalf. The types of services that could expose your credentials include HTTP proxies, HTML/CSS validator services, and XML processors that support XML inclusion.</p> <p>The following command retrieves the security credentials for an IAM role named s3access.</p> <pre><code>$ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/s3access </code></pre> </blockquote> <p>Where does this IP address come from? What is 169.254.169.254? It can't be my server, since I don't have software running on port 80, nor would I grant Amazon an alias on my server. </p> <p>But I did actually run the above, and it simply timed out. So the IP address 169.254.169.254 is not a service that Amazon is actively running. So what is it? </p> <p>Does anyone understand this example that Amazon offers? </p>
0non-cybersec
Stackexchange
[USA]Insurance scam fails part #3 ( WARNING GRAPHIC CONTENT!!!!!).
0non-cybersec
Reddit
Why do toasters have a burn the bread setting?. Is there something that can be cooked in a toaster that needs that heat? edit: So it seems that there's a lot more items that can be cooked in a toaster than I thought! Thanks everyone! :)
0non-cybersec
Reddit
Korganizer synchronization. <p>I use Korganizer in my main laptop and in my secondary laptop - both runs netrunner linux. </p> <p>Recently the main went kaboom and i realize the necessity of having a way to synchronize my data accress devices. </p> <p>I know that I can use google or outlook or ical or such big companies. </p> <p>But what are my other options if I want :</p> <ol> <li>To easily an seemlessly synchronize my PIM data across linux and hopefully Cyanogen mod;</li> <li>To use aprefereablly free service;</li> <li>To not use any company like Google due to privacy reasons </li> </ol> <p>? Thank you for answers.</p>
0non-cybersec
Stackexchange
You must be available for fifteen hours five days a week for $20 a day? What? Is this $1.33 an hour?.
0non-cybersec
Reddit
TIL that there's a Santa school, where people learn how to play the part of Santa. They also learn toy/Santa related sign language so that even deaf people can communicate with them!.
0non-cybersec
Reddit
Hacker Shows a youtuber his Fortnite MongoDB Exploit/Backdoor.
1cybersec
Reddit
\ref returns both caption name and numbering. <p><code>\ref{key}</code> returns caption name (as configured using <code>\captionsetup</code>) and numbering as <code>\autoref{key}</code> do. How can I return only numbering?</p> <p>Here is my preamble with main packages and <code>\captionsetup</code>. For instance, I get using <code>\ref{key}</code> after compiling is "FIGURA 1.1" instead "1.1". In another document with almost the same preamble, I get the expected result.</p> <pre><code>\documentclass[12pt,letterpaper,openany]{book} \usepackage[brazil]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{graphicx} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage[hidelinks]{hyperref} \usepackage{chngcntr} \usepackage{tabto} \usepackage{extsizes} \usepackage{mathptmx} \usepackage{chemformula} \usepackage{chemarrow} \usepackage{shadow} \usepackage{microtype} \usepackage{multicol} \usepackage{chemfig} \usepackage{chemmacros} \usepackage[shortlabels]{enumitem} \usepackage{sectsty} \usepackage{floatrow} \usepackage{tabu} \usepackage{subfiles} \usepackage{booktabs} \usepackage{siunitx} \usepackage{chemstyle} \usepackage[version=4]{mhchem} \usepackage{cancel} \usepackage{tikz} \usetikzlibrary{calc,shadows} \usepackage{pgfplots} \pgfplotsset{table/search path={data}} \usepackage{fontspec} \usepackage{titlesec} \usepackage{caption} \newfontfamily\MProBoldCn[Mapping=tex-text, Numbers=Lining]{Minion Pro Bold Cond} \newfontfamily\MProBoldCnIt[Mapping=tex-text, Numbers=Lining]{Minion Bold Condensed Italic} \newfontfamily\RokkirrBold[Mapping=tex-text, Numbers=Lining]{Rokkitt} \newfontfamily\AcuminPro[Mapping=tex-text, Numbers=Lining]{Acumin Pro} \DeclareCaptionFont{rok}{\RokkirrBold} \DeclareCaptionFont{acuminP}{\AcuminPro} \definecolor{azulE1}{RGB}{0,93,171} \begin{document} \chapter{Chapter} \section{Section} As cited in \ref{test}. \begin{figure}[H] \centering \tikz\draw[red,fill=red] (0,0) circle (.5ex); \caption{Figure example.} \label{test} \end{figure} \end{document} </code></pre>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Does latex have the z-index property. <p>May be this is a very strange question. But I found this property is very useful to control the overlap element.</p> <p>So I wonder if latex own this property as HTML div.</p> <p>Do you have any better idea to solve the overlap problem. Sometime, I need to push some element back.</p> <p><strong>update</strong>:the MWE code</p> <pre><code> \documentclass{article} \usepackage{listings} \usepackage{courier} \usepackage{caption} \usepackage{xcolor} \usepackage{calc} \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\parbox{\textwidth}{\colorbox{gray}{#1#2#3}}} \captionsetup[lstlisting]{format=listing, labelfont=white, textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize} } \newlength\tdima \setlength\tdima{ \fboxsep+\fboxrule} \lstset{ basicstyle=\small\tt, tabsize=2, extendedchars=true, breaklines=true, mathescape, escapeinside={\%*}{*)}, showspaces=false, showtabs=false, showstringspaces=false, columns=flexible, xleftmargin=\tdima, framextopmargin= 10pt, framexbottommargin=10pt, float=tp, % float setting frame=single, }% \begin{document} \begin{lstlisting}[caption=overlap] using namespace std; int main(void) { return 0; } \end{lstlisting} \end{document} </code></pre> <p><strong>Output:</strong></p> <p><img src="https://i.stack.imgur.com/n16ZT.jpg" alt="enter image description here"></p> <p>The caption overlap with the frame. And I want to push the caption back. Let the frame cover it. I don't want to use the \vskip to fine tuning the caption position.</p>
0non-cybersec
Stackexchange
sms dxb.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
To those who want the most out of Gal*Gun: Double Peace, be sure to pick up this $90 (!) DLC that lets you zoom in on the girls to see through their clothes (but underwear still on!).
0non-cybersec
Reddit
export is not recognize in cmd while Cygwin is installed. <p>My machine is running win7 64bit. I installed Cygwin and added <code>C:\cygwin64\bin</code> to the <code>PATH</code>. Now linux commands work on cmd , but <code>export</code> is not recognized:</p> <blockquote> <p>'export' is not recognized as an internal or external command, operable program or batch file.</p> </blockquote> <p>while it works properly in Cygwin64 Terminal. How should I add it to windows default cmd?</p>
0non-cybersec
Stackexchange
That is not contagious laughter but viral disease type of laughter. She sounds like a goose!.
0non-cybersec
Reddit
Computation for composition of polynomials. <p>Let $R$ be a ring, $f(X)$ be a polynomial with coefficients in $R$ of degree $n$. It's known that for any $\alpha \in R$, one can evaluate $f$ at $\alpha$, i.e compute $f( \alpha) $ in $O(n)$ operations in $R$ for some $k &gt;0$ . But could we compute $ f( X + \alpha ) $, or more generally compute $ f( \alpha X + \beta)$ in $O(n)$ or $O(n * ( \mathrm{log} \; n)^k )$ operations in $R$. Since the result is a polynomial in $X$ of degree at most $n$, I would guess there is a such way. But from the naive way, I can't just figure out a $O(n^2)$ algorithm to do this as follows: If $f(X) = \sum_{i=1}^n a_i X^i$, then one compute $g \leftarrow a_0, h \leftarrow \alpha X + \beta, g \leftarrow g+ a_{i+1} * h, h \leftarrow h* (\alpha X + \beta) $ for $0 \leq i \leq n-1$. In the $i$-th step, $g$ is a polynomial of degree $i$ and $h$ is a polynomial of degree $i+1$, so we need $O(i)$ operations in $R$ to compute $ g+ a_{i+1} * h$ and $h* (\alpha X + \beta) $, so the total operations needed is $O(n^2)$.</p> <p>Is there any way to do so in $O(n)$ or $O(n * ( \mathrm{log} \; n)^k )$ operations in $R$? I don't really need to know how the algorithm works, I just need an explicit reference which says this is possible.</p>
0non-cybersec
Stackexchange
Bug report : I killed a Mei as Reaper and a soul dropped.. I don't know how it can be. Please fix it Blozzard, it's literally unplayable...
0non-cybersec
Reddit
Unable to use NTFS partition for Dropbox in Linux. <p>Dropbox won't let me choose the sync folder inside a <strong>NTFS partition</strong>. First thought I had was mounting and its permissions (the Dropbox installer <em>does</em> let me choose my linux home as the Dropbox home). After searching and trying several other lines, the partition is mounted via <strong>fstab</strong> with these settings:</p> <pre><code>/dev/sda5 /mnt/documents ntfs-3g uid=1000,gid=100,dmask=027,fmask=137 0 0 </code></pre> <p><strong>I can read and write</strong> in the partition, here is a <strong>ls</strong> output:</p> <pre><code>24 drwxr-x--- 1 tuxcayc users 24576 Sep 2 06:42 documents </code></pre> <p>I'm using an Arch-based distro (<a href="http://blog.manjaro.org/" rel="nofollow noreferrer">Manjaro</a>) and Dropbox installed via <em>yaourt</em>.</p> <p>I guess it's still some issue with mounting permissions. Any help is appreciated,</p> <p>Thanks.</p>
0non-cybersec
Stackexchange
open source click or mouse tracking software. <p>does any one know of or recommend any Click tracking or heat map generation - open source php based software ?</p> <p>like <a href="http://www.labsmedia.com/clickheat/" rel="noreferrer">http://www.labsmedia.com/clickheat/</a></p>
0non-cybersec
Stackexchange
Convergence of vector and matrix sequence $a_n = b_n + M_n a_{n-1}$. <p>Suppose I have a vector sequence $a_n$:</p> <p>$$a_n = b_n + M_n \, a_{n-1},$$</p> <p>which depends on its previous term $a_{n-1}$. Also, $\lim \,b_n = 0$ and the matrix sequence $\lim \, M_n = O$, a zero matrix as $n$ gets to the infinity.</p> <p>Does the sequence $a_n$ converge? Should I impose further assumption on $a_n$ such that I can prove the convergence?</p> <p>Thanks in advance.</p>
0non-cybersec
Stackexchange
Recommendation of a good source on Lyapunov theorem in dynamical systems. <p>As part of my research I wish to read a full proof of Lyapunov's classic theorem on dynamical systems that for an analytic planar vector field where all Lyapunov/focal values are zero, the local phase portrait is a center. I have not found anything matching this even after extensive search efforts so I turn to the community for salvation. Thanks all</p>
0non-cybersec
Stackexchange
Ansible multiline results and loop. <p>Im registering with Ansible output from network checking in such way:</p> <pre><code>- name: Test kube networking shell: kubectl exec -n iperf -it {{ item }} /test.sh loop: "{{ pods.stdout_lines }}" register: echo - debug: msg={{ item.stdout_lines }} loop: "{{ echo.results }}" </code></pre> <p>and now how to go trough all of entries? I want to have all "stdout_lines" from every result as item. Is such thing posible? Or maybe some "nested" loop one over results and second trough all stdout_lines from every result?</p>
0non-cybersec
Stackexchange
Rainy day smoke. [6].
0non-cybersec
Reddit
Can I freeze deboned pounded chicken thighs?. I mainly cook with chicken thighs, and I always have to freeze, defrost, debone, remove skin, then pound flat. I could cut down on the mess if I could just defrost, and do all the other prep at once before freezing. But would I notice a significant drop in the quality of the chicken if I did this? Would the flavor change, would the tenderness be altered? Freezer burn doesn't end up being an issue with the bone in thighs, I think because my turnover is quick enough.
0non-cybersec
Reddit
[WP] You are a young and successful writer of "speciality erotica" and have kept your professional life hidden from you family via pen name. You sit down to Christmas dinner with your whole extended family. Your younger sister keeps making thinly veiled references to your works.
0non-cybersec
Reddit
Advice on troubleshooting Fuji Xerox DocuCentre-V C5575. Anyone familiar with this printer? I'm a helpdesk so not sure what is the cause of this. Users want to print from Tray 5 with labels using A3, but it keeps printing from Tray 3 with A4. I tried to do this on my machine, set to Tray 5 but it printed from Buff tray (Tray 2) I tried setting the tray from Word and Publisher to Tray 5, no luck, even in Printer Properties. Any tips for a newbie would be appreciated.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
By popular demand, we have released Gymsurfing for ALL smartphone browsers: book day passes at gyms starting at $5. Hey guys, we were absolutely *floored* at [the response](http://www.reddit.com/r/Fitness/comments/25kvao/with_amazingly_helpful_feedback_from_the_rfitness/) from r/fitness when we launched Gymsurfing. Thank you again for your awesome feedback! The #1 question was: how do I use this if I don’t have an iPhone? The answer is: **now you can**. [Just go to Gymsurfing.com](http://www.gymsurfing.com/cities) on your phone and you can start looking for gym passes in San Francisco and a few other places. The other question was: when will you been in more cities? We’re working on a way you can get paid for signing up gyms on Gymsurfing, kind of like an affiliate network. Please e-mail us at *info (at) gymsurfing.com* with the subject “affiliate” and we’ll send you more info as it’s available. Also use this email for bug reports :) Thanks! (Edit: We are brainstorming and writing out what is involved with a native Android app and we have mostly figured it out. Thanks to everybody who emailed us to offer their skills!)
0non-cybersec
Reddit
What URL does OWIN understand for ipv6 self-hosting?. <p>My application uses self-hosting feature of <a href="http://www.asp.net/web-api" rel="noreferrer">ASP.NET Web API</a>. NuGet package name I use is Microsoft.AspNet.WebApi.SelfHost. I used <a href="http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api" rel="noreferrer">following example</a> as a base.</p> <p>Following code works for me to launch host on ipv4 localhost endpoint:</p> <pre><code>WebApp.Start&lt;Startup&gt;("http://127.0.0.1:43666"); </code></pre> <p>What do I enter if I want to specify ipv6 address? "http://[::1]:43666" does not work. Exception thrown is [reformatted]:</p> <pre><code>System.Net.HttpListenerException: The network location cannot be reached. For information ..about network troubleshooting, see Windows Help at System.Net.HttpListener.AddAllPrefixes() at System.Net.HttpListener.Start() at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, ..Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory) at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, ..IDictionary`2 properties) </code></pre> <p>Judging by my inspection of code in reflector, the <code>HttpAddUrlToUrlGroup</code> function returned error code 1232</p>
0non-cybersec
Stackexchange
how do i make sure i have read and write access to the folder when i&#39;m mounting it in Linux (Ubuntu) using the fstab file. <p>follow up to <a href="https://superuser.com/questions/174684/how-do-i-set-up-shared-folders-in-virtual-box-windows-7-host-ubuntu-guest">How do i set up shared folders in virtual box (windows 7 host, Ubuntu guest)?</a></p> <p>i can get the folder to mount on start up, but it keeps coming up with a padlock symbol on the icon and i can't write to it</p> <p>the linux machine is a virtual machine in a Mac OSX host using virtual box, i have made sure the shared folder in virtual box isn't set to read only</p> <p>here's what i've got as my fstab file:</p> <pre><code># /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier # for a device; this may be used with UUID= as a more robust way to name # devices that works even if disks are added and removed. See fstab(5). # # &lt;file system&gt; &lt;mount point&gt; &lt;type&gt; &lt;options&gt; &lt;dump&gt; &lt;pass&gt; proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=f7ee2f9b-6d1d-4aae-84f0-d706fdd34e99 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=133ed8f3-c850-40bc-8dee-8f71d611c549 none swap sw 0 0 # mandy_share with baldrick mandy_share /home/kirstin/Desktop/mandy_share vboxsf defaults 0 0 # Baldrick's desktop copy of my Lab Book Lab_Book_Uni /home/kirstin/Desktop/Lab_Book_Uni vboxsf defaults 0 0 </code></pre>
0non-cybersec
Stackexchange
Cartesian Product in Relational Algebra. <p>I'm a total begginer in Relational Algebra and I don't manage to fully understand how cartesian product works.</p> <p>I want to know what happen in cartesian product when my two table have common attributes. I have no problem to understand when both table don't have any attribute in common. </p> <p>For instance I tried to understand on example I made myself.</p> <pre><code>T1 T2 ---------- ----------- A B C A B D 1 4 7 1 4 8 2 5 3 2 9 5 4 7 1 7 3 2 </code></pre> <p>If I want to do T1 x T2, when I want to write the line that is the concatenation of the first line of T1 <code>A=1 , B=4 , C=7</code> and the second line of T2 <code>A=2 ,B=9 ,C=5</code> , what happen to the column A and B ?</p> <p>If you could show me the result of T1 x T2 it would be really useful! </p>
0non-cybersec
Stackexchange
Best Encryption Software To Replace TrueCrypt. I've used TrueCrypt in the past however BitLocker has replaced it, are there any alternatives? Also Is BitLocker as secure as TrueCrypt was?
1cybersec
Reddit
About the Ceres bright spots.... In that animation that shows ceres rotating the bright spots stay bright when entering the dark zone. Why is that?
0non-cybersec
Reddit
Random Walks proof SOS. <p>Given this equation:</p> <p>$f_{2k}2^{2k}u_{2n-2k}2^{2n-2k}$=$f_{2k}u_{2n-2k}2^{2n}$</p> <p>then it asks to "sum over k" to obtain this equation:</p> <p>$u_{2n}2^{2n}$=$f_0u_{2n}2^{2n}+f_2u_{2n-2} 2^{2n}$+....+$f_{2n}u_02^{2n}$</p> <p>then dividing both sides of the equation by $2^{2n}$ completes the proof I need.</p> <p>My question is, what does it mean by "sum over k"</p> <p>Does it want me to sum from 0 to $\infty$ for k? And which k, all of them? And how? Do I start by plugging in o to all k's and see what happens? continue then add them all up? Seems strange to me! Any help will be greatly appreciated! </p>
0non-cybersec
Stackexchange
Proving that for Fibonacci numbers $a_n \lt (\frac {1 + \sqrt 5} 2)^n$ for $n \ge 1$. <p>I'd like to prove that for Fibonacci numbers $a_n \lt \left(\frac {1 + \sqrt 5} 2\right)^n$ for $n \ge 1$. I suppose it needs induction so, after verifying the trivial case $n=1$, the inductive step needs to be justified: $$a_{n+1} \lt \left(\frac {1 + \sqrt 5} 2\right)^{n+1}.$$ Assume $$a_n \lt \left(\frac {1 + \sqrt 5} 2\right)^n.$$ I can only think of multiplying both sides by $\left(\frac {1 + \sqrt 5} 2\right)$, which yields $$a_n\left(\frac {1 + \sqrt 5} 2\right) \lt \left(\frac {1 + \sqrt 5} 2\right)^{n+1}$$ and then somehow show that $a_{n+1} \lt a_n\left(\frac {1 + \sqrt 5} 2\right)$. I tried using the fact that $a_{n+1}=a_n + a_{n-1}$ but wasn't able to conclude anything useful. Can you suggest me a way to prove it?</p>
0non-cybersec
Stackexchange
Tom Brady got booed at the Superbowl.
0non-cybersec
Reddit
What's the word for when the sun shines through breaks in cloud or tree cover and forms a spotlight-like cone of light?. I've seen it a lot driving around today and I know there's a word for it but I cannot for the life of my remember what it is!
0non-cybersec
Reddit
Snow on the red rocks of the Canyon de Chelly, in the Navajo Nation, Arizona [2048x1365][OS] photo by Arnaud Lagandré.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Aniplex enjoys taking my money.
0non-cybersec
Reddit
Do international FaceTime audio calls cost anything? Is it free versus just calling them?.
0non-cybersec
Reddit
Appache 2.4 - Reverse Proxy with location directive not working. <p>I'm facing problem in apache2.4 reverse proxy. </p> <p><strong>Appache config</strong>:</p> <pre><code>ProxyPass "/" "http://domain2.com" ProxyPassReverse "/" "http://domain2.com/" SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 # If the path restricted cookie is set or the request asks for Javascript, images, or other content we don't need to protect RewriteCond %{HTTP_COOKIE} t_path=.+ #RewriteCond %{REQUEST_URI} \.(?!(html|htm|pdf)) RewriteRule ^/(.*)$ http://domain2.com/$1 [P,QSA] # If we have a token in the query string, verify it RewriteCond %{QUERY_STRING} t=(.+)$ RewriteRule ^(/.*) /auth/?path=$1 [passthrough,QSA] RewriteRule ^.*$ - [F] &lt;Location /test&gt; SetHandler modperl PerlOptions +GlobalRequest PerlResponseHandler test::Handler &lt;/Location&gt; </code></pre> <p>If i hit url <a href="http://domain1.com/abc/cdb/?t=787986" rel="nofollow noreferrer">http://domain1.com/abc/cdb/?t=787986</a> in browser, its throws error as "<code>The requested URL /auth/ was not found on this server.</code>" Also if i do the steps as "remove reverse proxy lines->restart apache->hit url in browser->add reverse proxy lines-restart apache", works fine(may be cahed). <code>test::Handler</code> will check the valid url and their params and set return redirection url. there was proble in reverse proxy and location. Please someone help me to get resolved.</p>
0non-cybersec
Stackexchange
Why not &quot;DOT lol&quot; domains?. <p>How would one go about creating a website using the ".lol" domain? Is it even possible? And if not, why not?</p>
0non-cybersec
Stackexchange
Guy freaks out on Walmart employees for not having oreos during coronavirus shortage.
0non-cybersec
Reddit
How to get full stacktrace in SBT 0.10.0?. <p>I'm using SBT 0.10.0 to compile a combination of Java and Scala files. When I run the program through <code>sbt run</code> it returns a nonzero error but doesn't show me a stacktrace -- it simply fails silently with the cryptic message:</p> <pre><code>Nonzero exit code: 1 </code></pre> <p>If I run the program through <code>scala</code> command line, it does show the stacktrace. </p> <p>Is there any way I can get SBT to print out the entire stacktrace?</p>
0non-cybersec
Stackexchange
Some people are truly mad!.
0non-cybersec
Reddit
Credit card's FICO score service says I have a "serious delinquency" but I don't see any such thing on my credit report. How do I find what they're seeing?. Like the title says. On three different credit cards I have (all of which have zero balance carried, btw) that include free FICO reporting, they all say my score is impacted by "serious delinquency". Problem is, I can't find anything I'm delinquent on or ever have been. I've always paid my bills on time and I figure if there was something out there I somehow totally lost track of I'd have gotten calls or letters from collectors, but nothing on that front either. I pulled my reports from [annualcreditreport.com](https://annualcreditreport.com/) and can't find anything even late, let alone seriously delinquent. However, this is clearly something that institutions are somehow seeing on my report. How do I go about finding out what they are picking up if I can't see it on my report? I haven't been denied for anything I've applied for, including buying a house a year ago, so I guess maybe it's not worth worrying about, but it's bugging me that it's probably impacting my score and I don't know what is going on.
0non-cybersec
Reddit
You have a robot assistant. And it falls in love with you. But you don’t see it that way. However you still want your house cleaned and your food made for you. How do you let it down gently, and tell it, that it’s better to be just friends?.
0non-cybersec
Reddit
DATA RECOVERY from a NTFS formatted disk. <p>While installing Ubuntu, by mistake I gave my C drive as the Swap space. It ended up formatting the logical drive(E, but not C !). I realised my mistake in the middle and forcefully ended installation. However it formatted the disk. On windows, the disk space appears to be unallocated. Is there a way I can recover the data?</p>
0non-cybersec
Stackexchange