text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
Nâng mũi có bị biến chứng nguy hiểm không cách hạn chế tai biến.
0non-cybersec
Reddit
Changing the rootViewController of a UIWindow. <p>When my app first loads, I set the <code>rootViewController</code> property of my <code>UIWindow</code> to <code>controllerA</code>. </p> <p>Sometime during my app, I choose to change the <code>rootViewController</code> to <code>controllerB</code>.</p> <p>The issue is that sometimes when I do a flip transition in <code>controllerB</code>, I see <code>controllerA</code>'s view behind it. For some reason that view isn't getting removed. Whats even more worrying is that after setting the <code>rootViewController</code> to <code>controllerB</code>, <code>controllerA</code>'s <code>dealloc</code> method never gets fired.</p> <p>I've tried removing the subviews of <code>UIWindow</code> manually before switching to <code>controllerB</code>, that solves the issue of seeing <code>controllerA</code>'s views in the background but <code>controllerA</code>'s dealloc still never gets called. <strong>Whats going on here????</strong></p> <p>Apples docs say:</p> <blockquote> <p>The root view controller provides the content view of the window. Assigning a view controller to this property (either programmatically or using Interface Builder) installs the view controller’s view as the content view of the window. If the window has an existing view hierarchy, the old views are removed before the new ones are installed.</p> </blockquote> <p><strong>UPDATE</strong></p> <p>Here's the code of my AppDelegate:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [self showControllerA]; [self.window makeKeyAndVisible]; return YES; } - (void)showControllerA { ControllerA* a = [ControllerA new]; self.window.rootViewController = a; } - (void) showControllerB { ControllerB* b = [ControllerB new]; self.window.rootViewController = b; } </code></pre>
0non-cybersec
Stackexchange
Martingale roulette system. <p>I'm making a roulette system simulator, specifically right now the Martingale roulette system. So what I do know about the system that there is an Anti-Martingale too, which is the same, but you have to double the bet at every win. So let's only take a look at the red bets:</p> <p>The function looks like this:</p> <pre><code>public void Red(List&lt;int&gt; red, int random) { if (anti == false) { if (red.Contains(random)) // reds: 1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36 { money -= currentPot; money += currentPot * 2; currentPot = startPot; } else // if it's black or null { money -= currentPot; currentPot *= 2; } } else // double at win { if(red.Contains(random)) { money -= currentPot; money += currentPot * 2; currentPot *= 2; } else { money -= currentPot; currentPot = startPot; } } } </code></pre> <p>the anti variable holds if it's anti or normal martingale, random is the spinned number.</p> <p>So I have an output file, after 10 spins it looks like this:</p> <p>money, startPot, currentPot, spinnedNumber</p> <p>900, 100, 100, -</p> <p>800, 100, 200, BLACK</p> <p>1000, 100, 100, RED</p> <p>900, 100, 200, BLACK</p> <p>700, 100, 400, BLACK</p> <p>1100, 100, 100, RED</p> <p>1000, 100, 200, BLACK</p> <p>800, 100, 400, BLACK</p> <p>1200, 100, 100, RED</p> <p>1300, 100, 100, RED</p> <p>1200, 100, 200, NULL</p> <p>My question is: Does the Martingale system make always profit or there's something wrong with my code? I know every casino has an edge, but if there's no edge, it will always be profitable after a certain number of spins.</p>
0non-cybersec
Stackexchange
What would you want to see at the Museum of Mathematics?. <p><b>EDIT</b> (30 Nov 2012): MoMath is opening in a couple of weeks, so this seems like it might be a good time for any last-minute additions to this question before I vote to close my own question as "no longer relevant".</p> <hr> <p>As some of you may already know, there are plans in the making for a <a href="http://momath.org/">Museum of Mathematics</a> in New York City. Some of you may have already seen the <a href="http://mathmidway.org/">Math Midway</a>, a preview of the coming attractions at MoMath.</p> <p>I've been involved in a small way, having an account at the <a href="http://mathfactory.org/tiki-index.php?page=Exhibit%20Plans">Math Factory</a> where I have made some suggestions for exhibits. It occurred to me that it would be a good idea to solicit exhibit ideas from a wider community of mathematicians.</p> <blockquote> <p>What would you like to see at MoMath?</p> </blockquote> <p>There are already a lot of suggestions at the above Math Factory site; however, you need an account to view the details. But never mind that; you should not hesitate to suggest something here even if you suspect that it has already been suggested by someone at the Math Factory, because part of the value of MO is that the voting system allows us to estimate the level of enthusiasm for various ideas.</p> <p>Let me also mention that exhibit ideas showing the connections between mathematics and other fields are particularly welcome, particularly if the connection is not well-known or obvious.</p> <hr> <p>A couple of the answers are announcements which may be better seen if they are included in the question.</p> <p>Maria Droujkova: We are going to host an open online event with Cindy Lawrence, one of the organizers of MoMath, in the <a href="http://mathfuture.wikispaces.com/events">Math Future series.</a> On January 12th 2011, at 9:30pm ET, follow <a href="http://tinyurl.com/math20event">this link</a> to join the live session using Elluminate. </p> <p>George Hart: ...we at MoMath are looking for all kinds of input. If you’re at the Joint Math Meetings this week, come to our booth in the exhibit hall to meet us, learn more, and give us your ideas.</p>
0non-cybersec
Stackexchange
How to add a file to a docker container which has no root permissions?. <p>I'm trying to add a file to a Docker image built from the official <code>tomcat</code> image. That image does not seem to have root rights, as I'm logged in as user <code>tomcat</code> if I run bash:</p> <pre><code>docker run -it tomcat /bin/bash tomcat@06359f7cc4db:/usr/local/tomcat$ </code></pre> <p>If I instruct a <code>Dockerfile</code> to copy a file to that container, the file has permissions <code>644</code> and the owner is <code>root</code>. As far as I understand, that seems to be reasonable as all commands in the Dockerfile are run as root. However, if I try to change ownership of that file to <code>tomcat:tomcat</code>, I get a <code>Operation not permitted</code> error.</p> <p><strong><em>Why can't I change the permissions of a file copied to that image?</em></strong></p> <p>How it can be reproduced:</p> <pre><code>mkdir docker-addfilepermission cd docker-addfilepermission touch test.txt echo 'FROM tomcat COPY test.txt /usr/local/tomcat/webapps/ RUN chown tomcat:tomcat /usr/local/tomcat/webapps/test.txt' &gt; Dockerfile docker build . </code></pre> <p>The output of <code>docker build .</code>:</p> <pre><code>Sending build context to Docker daemon 3.072 kB Sending build context to Docker daemon Step 0 : FROM tomcat ---&gt; 44859847ef64 Step 1 : COPY test.txt /usr/local/tomcat/webapps/ ---&gt; Using cache ---&gt; a2ccb92480a4 Step 2 : RUN chown tomcat:tomcat /usr/local/tomcat/webapps/test.txt ---&gt; Running in 208e7ff0ec8f chown: changing ownership of '/usr/local/tomcat/webapps/test.txt': Operation not permitted 2014/11/01 00:30:33 The command [/bin/sh -c chown tomcat:tomcat /usr/local/tomcat/webapps/test.txt] returned a non-zero code: 1 </code></pre>
0non-cybersec
Stackexchange
"BONK!!".
0non-cybersec
Reddit
[Help] How can I install a ceiling fan light fixture in a regular ceiling light box?. Situation: I have a basement room that is a full 12x12 room, but only about half finished. I'm using the room as a studio/den, but lighting in there is pretty bad. Limited outlets to only two walls, only one tiny window so very little natural light. There is **a ceiling light fixture (standard light box) but it's not attached to any light switch**, so I have a really basic single bulb light with a pull chain installed there now [like this](https://images-na.ssl-images-amazon.com/images/I/31lfA27V9bL._SY300_.jpg). Thing is I really want more light in the room. Most of the light fixtures with a pull chain are at best two bulb, but I really want a 4 bulb solution. There are some excellent options for this designed for ceiling fans [like this one](https://hw.menardc.com/main/items/media/HUNTE001/ProductLarge/99094.jpg) that are really inexpensive, but they have a completely different mounting system than a regular light box allows. I think. So can anyone offer some suggestions on getting a ceiling fan light kit to work in a regular light box? Is there a ready made product out there already?
0non-cybersec
Reddit
How are files and folders moved on most filesystems?. <p>Some file synchronization programs can detect when a file is moved (as opposed to a file being deleted and another being created). How does this affect synchronization performance? Do they unlink the file from one place and relink it to another instead of deleting and recreating them?</p>
0non-cybersec
Stackexchange
How to specify bit/key size with gpg -c?. <p>I'm trying to specify the RSA key size when using <code>-c</code> with gpg or gpg2. Example:</p> <pre><code>&gt; gpg -c --armor --passphrase &lt;password&gt; --keysize 4096 file.txt </code></pre> <p>Is this possible? I couldn't find the command line flag in the gpg manpage. How many bits long is default when using <code>-c</code>?</p>
0non-cybersec
Stackexchange
This is one bad, little guy. Punching mantis shrimp inspires super-tough composites.
0non-cybersec
Reddit
Part #2 of a blog I made for generating world building ideas. Fell free to add your own ideas, or use these..
0non-cybersec
Reddit
Moody weather on the Cliffs of Moher - Co. Clare, Ireland [OC][4000x2500].
0non-cybersec
Reddit
MD5 Checksum and DLL injection. <p>I would like to know if it is possible that a file checksum or MD5 Checksum is an option for identifying malicious embedded code. As an example, I have a development environment and I want to prevent somebody or an internal threat from injecting malicious code or something into an external dll and using it with the original dll name. So an developer saying, can during development call an external malicious dll and use it as the same name as the original dll?</p> <p>That way altering the application's behaviour. Making it difficult to find out. I have done some research but digital signatures may help fix but not sure if all. </p> <p>Please if there is any solution to this I will be very grateful.</p>
1cybersec
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
Intersection multiplicity for two curves defined by $f=0,g=0$. <p>I want to understand how I can find the intersection multiplicity $I_p$ at a point $p$ for two curves $f,g$. </p> <blockquote> <p>I have the example where $$ f(x,y) = y^2-x^3, \,\,\,\, g(x,y)=y^2-x^2(x+1) $$ Then I am looking for the intersection multiplicity of the ideal $(f,g)$ at $p=(0,0)$.</p> </blockquote> <p>My first attempt is to notice that $g(x,y)=y^2-x^3-x$ and the ideal $(f,g)$ can be written as $(f,g-f)=(y^2-x^3,x^2)$. But now I am stuck since I cannot find a way to possibly simplify this ideal as to conclude about the intersection form. Only step I can go further is to note that $$ I_{(0,0)}(y^2-x^3,x^2) = 2I_{(0,0)}(y^2-x^3,x) $$<br> What would the next step be in order to determine $I_p$? In a previous example I was able to reduce the original ideal to an ideal involving only degree 1 curves concluding easily about what the multiplicity is. Now? </p>
0non-cybersec
Stackexchange
I have super limited calf ankle flexion which keeps me from getting too low in my squats, any ideas?. So basically I can't flex my ankle the way that you'd pull your toes up towards me hardly at all. If I stand with my toes against a wall I can barely touch my knees to it. The problem is this makes it nearly impossible to squat deep. Like I can get almost parallel but then there's just too much weight backwards and since I can't lean foward with my calves I either stop or fall backward. So I've been doing calf (gastrocnemius and soleus) stretches but I can't tell if they're working They feel stretched out but I don't know if I'm making progress (and even if I do it will take some time). So what can a guy do to get lower in his squats while he's waiting for his ankle flexibility to increase?
0non-cybersec
Reddit
BFF. Photographer: Szilvia Pap-Kutasi.
0non-cybersec
Reddit
Apache security for multi-user development web server. <p>I've been searching and reading through documents all morning and understand that I need to use some combination of chown and probably 'jailing' to securely give programmers access to directories on my centos webserver.</p> <p>Here's the situation: I have an apache web server that has any number of virtual sites located in /var/www/site1 /var/www/site2 etc..</p> <p>I have different developers that need full access both ssh and vsFTP to only the site they are working on. What is the best way to create and maintain security in this scenario. My thought would be to create a new user for each coder, jail that user to the website directory they are allowed to work in, add their user to a group and set the webroot's owner to that group. </p> <p>Any thoughts? Good, bad, ugly? Thanks!</p>
0non-cybersec
Stackexchange
0.05% skilled airshot.
0non-cybersec
Reddit
Snowdonia, Wales [3000x2000][OS].
0non-cybersec
Reddit
An interesting series. <p>$\sum_{n=1}^{\infty} \frac{\varphi(n)}{n}$ where $\varphi(n)$ is 1 if the variable $\text n$ has the number $\text 7$ in its typical base-$\text10$ representation, and $\text0$ otherwise.</p> <p>I am supposed to find out if this series converges or diverges. I think it diverges, and here is why.</p> <p>We can see that there is a series whose partial sums are always below our series, but which diverges. Compare some of the terms of each sequence</p> <p>$\frac{1}{7} > \frac{1}{8}$<br/> $\frac{1}{70} > \frac{1}{80}$<br/> $\frac{1}{71} > \frac{1}{80}$<br/> $\frac{1}{72} > \frac{1}{80}$<br/> $\text ... $<br/> $\frac{1}{79} > \frac{1}{80}$<br/> $\text ... $<br/> $\frac{1}{700} > \frac{1}{800}$<br/> $\text ... $<br/></p> <p>And continue in this way.</p> <p>Obviously some terms are left out of the sequence on the left, which is fine since our sequence of terms on the left is already greater than the right side. Notice the right side can be grouped into</p> <p>$\frac{1}{8} + \frac{1}{8} + ... $ because we will have $10$ $\frac{1}{80}$s, $100$ $\frac{1}{800}$s, etc etc. Thus we are adding up infinitely many 1/8s. This is similar to the idea of the divergence of the harmonic series. So, my conclusion is that it diverges. A bunch of other students in my real analysis class have come to the conclusion that is, in fact, convergent, and launched into a detailed verbal explanation about comparison with a geometric series that I couldn't follow without seeing their work. Is my reasoning, like they suspect, flawed? I can't see how.</p> <p>Sorry about the poor format, I'm new to TeX and couldn't figure out how to format a piecewise function (it was telling me a my \left delimiter wasn't recognized).</p>
0non-cybersec
Stackexchange
Never let a man convince you that abuse in any form is normal.. (**Please also read the edit at the bottom of this post**) The subject of domestic violence is weighing heavily on my heart today, and I feel a strong need to reiterate these thoughts on the chance someone needs to see it: If your boyfriend or husband hits you, pushes you around, demands sex from you when you don’t want it, guilts you into giving false consent for things, isolates you from your friends or family, hurts you and then makes you feel sorry for him, insults you, that is not normal behavior. Anything even remotely like this is abnormal. I grew up in an abusive household. When we finally left and moved into our safe house, my mother explained to me what a slow escalation it was from the initial red flag warnings to the life-threatening situations they became 20 years later. Take the warnings seriously because they will not get better. Please. If you’re experiencing any of these red flags, *get out*. It breaks my heart to see women settle for these types of men, and think that it’s the way relationships are across the board. You might not think you deserve better, but you absolutely do. We’re all deserving of love and respect, and no man holds the right to abuse us, especially in the name of “love.” I know that leaving is not always a simple solution, and that you put yourself at a potential high risk in doing so. But please find out what your resources are: United States: *National Domestic Violence Hotline* 1-800-799-7233 thehotline.org Outside US Resources: Domesticshelters.org has listings for other countries and may be a good resource. (I’m sorry I couldn’t find more concrete resources.) Be safe, friends. Advocate for yourselves, because you deserve it. ❤️ **EDIT: This applies to all relationships, and I apologize for limiting it to saying just men! But it absolutely applies to all** ❤️
0non-cybersec
Reddit
ltablex and booktabs. <p>I need a table which is larger than one page and it should have a fixed size. To improve the look, I use booktabs. However, the foot of the table is not nice on all pages, except on the last page. <img src="https://i.stack.imgur.com/V0rwa.png" alt="enter image description here"> Here is my MWE</p> <pre><code>\documentclass{scrartcl} \usepackage{booktabs} \usepackage{ltablex} \usepackage{blindtext} \begin{document} \begin{tabularx}{\linewidth}{XX} left &amp; right\\\toprule \endhead \bottomrule \endfoot \blindtext &amp; \blindtext\\*\midrule \blindtext &amp; \blindtext\\*\midrule \blindtext &amp; \blindtext\\ \end{tabularx} \end{document} </code></pre> <p>Is there a possibility to detect, if a row will be the last row on a page? Than I would be able to avoid the double line. Like the following pseudo code</p> <pre><code>is row last row of the page than \bottomrule else \midrule </code></pre> <p>I would like to have only a <code>\bottomrule</code> at the end of each page but no double line</p> <p><img src="https://i.stack.imgur.com/ygQI5.png" alt="enter image description here"></p>
0non-cybersec
Stackexchange
Vita on sale now at Target $199.
0non-cybersec
Reddit
This tree looks like it has a face.
0non-cybersec
Reddit
Fed Ex surprise delivery.
0non-cybersec
Reddit
Irish-American Wrestler from 1909 [1200x1567].
0non-cybersec
Reddit
We're fucked.
0non-cybersec
Reddit
Use Vue variable in style section of a component. <p>Is it possible to use a variable with the style tag of a component? Basically I have imported a mixin to my style tag that accepts 2 colors to create a gradient within a class. It works great but I want this dynamic so I can set it via a database. I understand I can bind a style via inline but a gradient for a div is rather long and works way better as a mixin. </p> <p>component:</p> <pre><code>&lt;template&gt; &lt;section class="section" v-bind:class=" { 'color-section' : content.gradient_color_one }"&gt; &lt;div class="container"&gt; &lt;div class="columns"&gt; &lt;div class="column is-half"&gt; &lt;h2 class="is-size-4" v-html="content.title"&gt;&lt;/h2&gt; &lt;div class="section-content" v-html="content.description"&gt;&lt;/div&gt; &lt;a class="button" :href=" '/'+ content.button_link"&gt;{{ content.button_text }}&lt;/a&gt; &lt;/div&gt; &lt;div class="column"&gt; &lt;img :src="content.image" :alt="content.title" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/template&gt; &lt;script&gt; export default { props:[ 'content' ], } &lt;/script&gt; &lt;style lang="scss" scoped&gt; @import "../../sass/helpers/mixins"; .color-section{ color:red; @include diagonalGradient( content.gradient_color_one , content.gradient_color_two); } &lt;/style&gt; </code></pre> <p>mixins</p> <pre><code>@mixin diagonalGradient($top, $bottom){ background: $top; background: -moz-linear-gradient(-45deg, $top 0%, $bottom 100%); background: -webkit-gradient(left top, right bottom, color-stop(0%, $top), color-stop(100%, $bottom)); background: -webkit-linear-gradient(-45deg, $top 0%, $bottom 100%); background: -o-linear-gradient(-45deg, $top 0%, $bottom 100%); background: -ms-linear-gradient(-45deg, $top 0%, $bottom 100%); background: linear-gradient(135deg, $top 0%, $bottom 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#92fe9d', endColorstr='#00c8ff', GradientType=1 ); } </code></pre>
0non-cybersec
Stackexchange
How to derive the general formula for the Killing form for classical Lie algebras?. <p>Let $\mathfrak g$ be a semisimple Lie algebra over a field $k$ of characteristic zero. Then the Killing form is a symmetric, nondegenerate bilinear form on $\mathfrak g$ by defined by $B(X,Y) = \textrm{Tr}(\textrm{ad}(X) \circ \textrm{ad}(Y))$.</p> <p>The wikipedia article on the Killing form gives the following formulas: </p> <p><a href="https://i.stack.imgur.com/osqFI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/osqFI.png" alt="enter image description here"></a></p> <p>With the basis $e_1 = \begin{pmatrix} 1 &amp; \\ &amp; -1\end{pmatrix}, e_2 = \begin{pmatrix} &amp; 1 \\ &amp; \end{pmatrix}, e_3 = \begin{pmatrix} &amp; \\ 1 &amp; \end{pmatrix}$ for $\mathfrak{sl}(2,\mathbb{R})$, I calculated the matrices of the linear transformations $\textrm{ad}(e_i)$ and then found the matrix of the Killing form to be the symmetric nonsingular matrix:</p> <p>$$\begin{pmatrix} 8 \\ &amp; &amp; 4 \\ &amp; 4 \end{pmatrix}$$</p> <p>That is, $(e_1,e_1) = 8, (e_2,e_3) = (e_3,e_2) = 4$, and all other combinations are zero. From here, I verified the formula for $B(X,Y)$ in the table for $\mathfrak{sl}(2,\mathbb{R})$. How does one begin to see the general formulas for the Killing form for all classical Lie algebras?</p>
0non-cybersec
Stackexchange
Porting Silverligtht application to web application with Asp.net and HTML 5. <p>I work as internal software developer. We used Silverlight to build our application, but we have been asked to start considering their replacement.</p> <p>Currently our set-up is:</p> <ul> <li>Silverlight application for client side.</li> <li>Asp.Net soap web service. Deployed in two servers with a load balancer.</li> <li>MS SQL server 2008. Also Deployed in two servers with a load balancer.</li> </ul> <p>Our application as as a sort of suite, performing several different functions, included but not restricted to:</p> <ul> <li>Reporting.</li> <li>Data analysis.</li> <li>Front-end for several database tables that are used both for other processes in the application, and for other applications in the company.</li> </ul> <p>Our constraints:</p> <p><strong>Limited development resources:</strong> We are a small team, a dozen or so developers, and while we have already hired more people to be able to cope with a increasing work load, getting more reinforcements is unlikely. Time also is constrained, as new projects, bug fixes,requests for new features in existing application and changes in the business logic are quite frequent. </p> <p><strong>Slow technology update:</strong> Our company changed from Windows XP to Windows 7 last year, and only because the support ended. We started considering to upgrade database servers to SQL server 2010 recently. Official browser is Internet Explorer 9 and Chrome. New Servers,licenses and tools can be requested, but they often take time.</p> <p><strong>Big, slow data:</strong> Some of our data come from tables big, clunky tables with million of rows and many columns, with only the bare minimum indexing, because they are updated frequently. We have little control over those specific big tables because they are feeds from other systems and requesting changes in those feeds is possible, but, as before, it takes time.</p> <p><strong>User mentality:</strong> The managers appreciate the fancy interfaces and dashboards to show in meetings. All users appreciate responsiveness and general UI smoothness. Also, many of our users come from a Excel background, which means that they are accustomed to take big chunks of data and filter them, perform analysis, make statistics, generate charts, etc, and they expect to be able to do it in the application too. </p> <p><strong>Our own experience:</strong> Most of our developers have backgrounds related to .net, asp.net, Windows Forms and Silverlight. Only a few of us have Java experience (non android). Only a few of us have experience with web applications besides some small projects.</p> <p><strong>Our past:</strong> The first iteration of our application was a windows forms application who suffered an acute case of installer bloating. Some of the IT heads decided that this could be solved by turning it into a web application. Since this was before HTML5 and we were still using IE6 as our official browser, we decided to go with Silverlight as it offered us the best compromise. </p> <p>Our advantages:</p> <p><strong>Homogenized hardware:</strong> Most users use exactly the same type of laptop with the same specifications. Available screen size range is not very wide, so we should not have to struggle with different resolutions.</p> <p><strong>Intranet:</strong> We work in a controlled environment.</p> <p><strong>Reasonable budget:</strong> Most request for Servers,licenses and the like will be approved if a sufficiently good reason is given.</p> <p>Recently, the higher ups has started to fear that Silverlight support may end abruptly. And they have suggested that we update the application to a more stable technology, hinting that HTML5 would be a good idea. They have asked us how feasible would be, and how much time it would take. We have next to 0 experience in this type of projects, so we are researching a bit to be able to give them an answer. This is my question:</p> <p>Given this situation and set-up, would be feasible to port this kind of application to a web application with HTML5 and asp.net while keeping most of its functionality? </p> <p>If not, why? Which of the above would need to be changed in order to make it possible?.</p>
0non-cybersec
Stackexchange
Pinecones..
0non-cybersec
Reddit
On decompositions of integers as a linear combination of $(1, 2, 3,\ldots)$. <p>Edited: Given integer $N\geq 0$, let $$I(N):=\Bigl\{(n_k)_{k\geq 1}\in {\mathbb N}^\infty \,:\, n_k\geq 0, \sum_{k\geq 1}kn_k = N \Bigr\}$$ be the set of all decompositions of $N$ as a linear combination of $(1, 2, 3,\ldots)$ with nonnegative integer coefficients. Then $$\sum_{(n_k)\in I(N)}\prod_{k\geq 1} \frac{1}{k^{n_k} n_k!} = 1.$$ Is there a simple (non Fourier analytic) proof of this identity?</p>
0non-cybersec
Stackexchange
How to prevent forced line break between vbox and text when vbox starts a line and precedes text?. <p>I was surprised to copy a character (I'd spent so much time to trim whitespace around) from a <code>\vbox</code> just to discover that it forces a line break whenever it precedes text (on the same line). Below is a simplified version that creates the same outcome. I need <code>@</code> to appear on the same line as <code>hello world</code>, without enclosing both within an <code>\hbox</code> (this is the only way I discovered that works, but I can't enclose <code>hello world</code>--only <code>@</code>--in my original code due to design issues).</p> <p>P.S. let's limit solution to plain TeX code compiled in XeLaTeX.</p> <pre><code>\documentclass[border=5mm,varwidth]{standalone} \usepackage{color} \pagecolor{black} \color{white} \begin{document} \newbox\zT \setbox\zT\vbox{\makeatletter@\makeatother} \copy\zT hello world\par % try 1 (failed) \hbox{\copy\zT}hello world % try 2 (failed) \end{document} </code></pre> <p><img src="https://i.ibb.co/KbDsnx9/SCREEN1.png" alt=""></p> <p>EXPECTED OUTPUT (APPROXIMATION):</p> <p><img src="https://i.ibb.co/rmMnct8/SCREEN2.png" alt=""></p>
0non-cybersec
Stackexchange
Austin pirate radio station, flagship for Alex Jones, faces $15k fine.
0non-cybersec
Reddit
This is my fur baby..
0non-cybersec
Reddit
Error 0x80070091 on WSL (windows subsystem for linux) install on Win10. <p>I first installed WSL on win10 then did an uninstall via the command: lxrun /uninstall / full </p> <p>I then try to reinstall with lxrun /install </p> <p>But I'm getting the Error 0x80070091 -- I'm not sure how to solve this issue. </p>
0non-cybersec
Stackexchange
Why The Persians Should Be The Good Guys In '300' - Hilarious Helmet History #1.
0non-cybersec
Reddit
Django Structlog is not printing or writing log message to console or file. <p>I have installed <a href="https://pypi.org/project/django-structlog/" rel="nofollow noreferrer">django-structlog 1.4.1</a> for my Django project. I have followed all the steps which has been described in that link.</p> <p>In my <strong>settings.py</strong> file:</p> <pre><code>import structlog MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django_structlog.middlewares.RequestMiddleware', ] LOGGING = { "version": 1, "disable_existing_loggers": False, "formatters": { "json_formatter": { "()": structlog.stdlib.ProcessorFormatter, "processor": structlog.processors.JSONRenderer(), }, "plain_console": { "()": structlog.stdlib.ProcessorFormatter, "processor": structlog.dev.ConsoleRenderer(), }, "key_value": { "()": structlog.stdlib.ProcessorFormatter, "processor": structlog.processors.KeyValueRenderer(key_order=['timestamp', 'level', 'event', 'logger']), }, }, "handlers": { "console": { "class": "logging.StreamHandler", "formatter": "plain_console", }, "json_file": { "class": "logging.handlers.WatchedFileHandler", "filename": "log/json.log", "formatter": "json_formatter", }, "flat_line_file": { "class": "logging.handlers.WatchedFileHandler", "filename": "log/flat_line.log", "formatter": "key_value", }, }, "loggers": { "django_structlog": { "handlers": ["console", "flat_line_file", "json_file"], "level": "DEBUG", }, "django_structlog_demo_project": { "handlers": ["console", "flat_line_file", "json_file"], "level": "DEBUG", }, } } structlog.configure( processors=[ structlog.stdlib.filter_by_level, structlog.processors.TimeStamper(fmt="iso"), structlog.stdlib.add_logger_name, structlog.stdlib.add_log_level, structlog.stdlib.PositionalArgumentsFormatter(), structlog.processors.StackInfoRenderer(), structlog.processors.format_exc_info, structlog.processors.UnicodeDecoder(), structlog.processors.ExceptionPrettyPrinter(), structlog.stdlib.ProcessorFormatter.wrap_for_formatter, ], context_class=structlog.threadlocal.wrap_dict(dict), logger_factory=structlog.stdlib.LoggerFactory(), wrapper_class=structlog.stdlib.BoundLogger, cache_logger_on_first_use=True, ) </code></pre> <p>In my <strong>views.py</strong>:</p> <pre><code>from django.http.response import HttpResponse import structlog logger = structlog.get_logger(__name__) def func(request): logger.debug("debug message", bar="Buz") logger.info("info message", bar="Buz") logger.warning("warning message", bar="Buz") logger.error("error message", bar="Buz") logger.critical("critical message", bar="Buz") return HttpResponse('success') </code></pre> <p>Output in <strong>json.log</strong>:</p> <pre><code>{"request_id": "7903fdfb-e99a-4360-a8f0-769696520cc9", "user_id": null, "ip": "127.0.0.1", "request": "&lt;WSGIRequest: GET '/test'&gt;", "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36", "event": "request_started", "timestamp": "2020-02-12T05:11:23.877111Z", "logger": "django_structlog.middlewares.request", "level": "info"} {"request_id": "7903fdfb-e99a-4360-a8f0-769696520cc9", "user_id": null, "ip": "127.0.0.1", "code": 200, "request": "&lt;WSGIRequest: GET '/test'&gt;", "event": "request_finished", "timestamp": "2020-02-12T05:11:23.879736Z", "logger": "django_structlog.middlewares.request", "level": "info"} </code></pre> <p>Output in <strong>flat_line.log</strong>:</p> <pre><code>timestamp='2020-02-12T05:11:23.877111Z' level='info' event='request_started' logger='django_structlog.middlewares.request' request_id='7903fdfb-e99a-4360-a8f0-769696520cc9' user_id=None ip='127.0.0.1' request=&lt;WSGIRequest: GET '/test'&gt; user_agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36' timestamp='2020-02-12T05:11:23.879736Z' level='info' event='request_finished' logger='django_structlog.middlewares.request' request_id='7903fdfb-e99a-4360-a8f0-769696520cc9' user_id=None ip='127.0.0.1' code=200 request=&lt;WSGIRequest: GET '/test'&gt; </code></pre> <p>Output in <strong>console</strong>:</p> <pre><code>2020-02-12T05:11:23.877111Z [info ] request_started [django_structlog.middlewares.request] ip=127.0.0.1 request=&lt;WSGIRequest: GET '/test'&gt; request_id=7903fdfb-e99a-4360-a8f0-769696520cc9 user_agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36 user_id=None {'request_id': '7903fdfb-e99a-4360-a8f0-769696520cc9', 'user_id': None, 'ip': '127.0.0.1', 'bar': 'Buz', 'event': 'warning message', 'timestamp': '2020-02-12T05:11:23.879035Z', 'logger': 'operational.views.core_view', 'level': 'warning'} {'request_id': '7903fdfb-e99a-4360-a8f0-769696520cc9', 'user_id': None, 'ip': '127.0.0.1', 'bar': 'Buz', 'event': 'error message', 'timestamp': '2020-02-12T05:11:23.879292Z', 'logger': 'operational.views.core_view', 'level': 'error'} {'request_id': '7903fdfb-e99a-4360-a8f0-769696520cc9', 'user_id': None, 'ip': '127.0.0.1', 'bar': 'Buz', 'event': 'critical message', 'timestamp': '2020-02-12T05:11:23.879468Z', 'logger': 'operational.views.core_view', 'level': 'critical'} 2020-02-12T05:11:23.879736Z [info ] request_finished [django_structlog.middlewares.request] code=200 ip=127.0.0.1 request=&lt;WSGIRequest: GET '/test'&gt; request_id=7903fdfb-e99a-4360-a8f0-769696520cc9 user_id=None [12/Feb/2020 05:11:23] "GET /test HTTP/1.1" 200 7 </code></pre> <p><strong>My issues are:</strong></p> <ul> <li>'info' and 'debug' level log message is not showing at the console.</li> <li>Any type of log message is not writing at the log files except "event='request_started'" and "event='request_finished'"</li> </ul> <p><em>I want same message in all of my log files and console. How can i achieve this?</em></p>
0non-cybersec
Stackexchange
I (M18) have to literally pull my FWB (F18) off me when she gives me head because of sensitivity issues. Something I can work on to improve my endurance so she can enjoy finishing?. Essentially my FWB gives absolutely amazing head. Literally mind blowing. In the past I'm used to girls just trying to deep throat and apply that fully "engulfed" feeling I guess? Anyway she has trouble deepthroating me because even though length wise I'm maybe a little above average, I'm thick (like 4.5-5 around). She makes up for it by paying a lot of attention to the head using her tongue and slurping around and for some reason it becomes a sensory overload! Like I have to pull her off because it's just too much after 45 seconds to a minute. It doesn't hurt, it's just more intense than the feeling of sensitivity post orgasm and I just get all fidgety and I can't take it anymore. tl:dr FWB gives amazing BJ, but head of penis is too sensitive to let her perform for more than a minute. Any way that I can try to fix this? Edit: Can't English.
0non-cybersec
Reddit
Rick Rolling yourself.
0non-cybersec
Reddit
Unpacked a tar...badly - now locked out of my own files!. <p>Not knowing well what I was doing, I opened a tar with sudo, and now it's linked to a user that doesn't exist and I can't remove it under any circumstances - perhaps because it's off the home directory. Help please?</p> <pre><code>total 44 drwx------ 2 3047 3047 4096 Sep 25 2012 library drwx------ 2 3047 3047 4096 Sep 25 2012 source drwx------ 2 3047 3047 4096 Sep 25 2012 examples -rw-rw-rw- 1 q q 28828 May 6 07:02 image_processing.tar.gz </code></pre>
0non-cybersec
Stackexchange
&quot;Host key verification failed&quot; despite deleting known_hosts. <p>I know what this error means, and usually I just remove that entry from the known_hosts file and get on with it (when I know why the verification is failing). </p> <p>This time I still got the error after removing the specific entry for the host from known_hosts, so I removed all the entries and still got the error, then removed the entire known_hosts file and still get the error?!</p> <p>I'm having this issue on all hosts.</p> <p>I just moved .ssh to .ssh-bak, copied my keys into the new directory and still got the error.</p> <p>What is the cause of this?</p> <pre><code>$ ssh -vvv [email protected] OpenSSH_7.3p1, LibreSSL 2.4.1 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 20: Applying options for * debug2: resolving "github.com" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to github.com [192.30.253.113] port 22. debug1: Connection established. debug1: identity file /Users/herbert/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /Users/herbert/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/herbert/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/herbert/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/herbert/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/herbert/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/herbert/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/herbert/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.3 debug1: Remote protocol version 2.0, remote software version libssh-0.7.0 debug1: no match: libssh-0.7.0 debug2: fd 5 setting O_NONBLOCK debug1: Authenticating to github.com:22 as 'git' debug3: hostkeys_foreach: reading file "/Users/herbert/.ssh/known_hosts" debug3: send packet: type 20 debug1: SSH2_MSG_KEXINIT sent debug3: receive packet: type 20 debug1: SSH2_MSG_KEXINIT received debug2: local client KEXINIT proposal debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c debug2: host key algorithms: [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,[email protected],zlib debug2: compression stoc: none,[email protected],zlib debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug2: peer server KEXINIT proposal debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: host key algorithms: ssh-dss,ssh-rsa debug2: ciphers ctos: [email protected],aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc debug2: ciphers stoc: [email protected],aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc debug2: MACs ctos: hmac-sha1,hmac-sha2-256,hmac-sha2-512 debug2: MACs stoc: hmac-sha1,hmac-sha2-256,hmac-sha2-512 debug2: compression ctos: none,zlib,[email protected] debug2: compression stoc: none,zlib,[email protected] debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug1: kex: algorithm: [email protected] debug1: kex: host key algorithm: ssh-rsa debug1: kex: server-&gt;client cipher: [email protected] MAC: &lt;implicit&gt; compression: none debug1: kex: client-&gt;server cipher: [email protected] MAC: &lt;implicit&gt; compression: none debug3: send packet: type 30 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug3: receive packet: type 31 debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 debug3: hostkeys_foreach: reading file "/Users/herbert/.ssh/known_hosts" debug3: hostkeys_foreach: reading file "/Users/herbert/.ssh/known_hosts" Host key verification failed. $ ssh -G github.com user herbert hostname github.com port 22 addressfamily any batchmode yes canonicalizefallbacklocal yes canonicalizehostname false challengeresponseauthentication yes checkhostip yes compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no fingerprinthash SHA256 forwardagent no forwardx11 no forwardx11trusted no gatewayports no gssapiauthentication no gssapidelegatecredentials no hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no protocol 2 proxyusefdpass no pubkeyauthentication yes requesttty auto rhostsrsaauthentication no rsaauthentication yes streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false useprivilegedport no verifyhostkeydns false visualhostkey no updatehostkeys false canonicalizemaxdots 1 compressionlevel 6 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc hostkeyalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa hostbasedkeytypes [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa kexalgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1 loglevel INFO macs [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 pubkeyacceptedkeytypes [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa xauthlocation xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ed25519 canonicaldomains globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 userknownhostsfile ~/.ssh/known_hosts ~/.ssh/known_hosts2 sendenv LANG sendenv LC_* connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos lowdelay throughput rekeylimit 0 0 streamlocalbindmask 0177 </code></pre> <p>Almost everything in dev has these permissions: </p> <pre><code>0 crw-rw-rw- 1 root wheel 2, 0 22 Mar 10:07 tty </code></pre> <p>Could these 4 have something to do with it? </p> <pre><code>0 crw--w---- 1 herbert tty 16, 0 12 Mar 12:55 ttys000 0 crw--w---- 1 herbert tty 16, 1 22 Mar 15:12 ttys001 0 crw--w---- 1 herbert tty 16, 2 22 Mar 15:14 ttys002 0 crw--w---- 1 herbert tty 16, 3 22 Mar 17:44 ttys003 0 crw--w---- 1 herbert tty 16, 4 22 Mar 17:44 ttys004 $ ls -lsa ~/.ssh total 24 0 drwx------ 5 herbert staff 170 22 Mar 15:39 . 0 drwxr-xr-x+ 114 herbert staff 3876 22 Mar 15:29 .. 8 -rw------- 1 herbert staff 1675 22 Mar 15:31 id_rsa 8 -rw-r--r-- 1 herbert staff 414 22 Mar 15:31 id_rsa.pub 8 -rw-r--r-- 1 herbert staff 848 22 Mar 16:42 known_hosts </code></pre>
0non-cybersec
Stackexchange
What&#39;s my Ubuntu Server administrator password?. <p>I just installed Ubuntu Server here, which went fine. However, not sure what's going on here now.</p> <p>I installed gnome using <code>sudo aptitude install --without-recommends ubuntu-desktop</code>, which worked great. But, I'm not able to use the Synaptic Package Manager!</p> <p>When using the Login Screen thing I can click unlock and it asks for authorization. I enter the password I gave during install, and it works fine. But when SPM asks for my password, it doesn't accept it! What's going on? My user password is the only one I have been asked to create. I can use <code>sudo</code> fine in the terminal. Why does SPM block me here?</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
HTTPS doesn&#39;t work anymore after adding SSLRequireSSL directive. <p>I have a Mac Mini Server, running macOS Sierra (10.12.2) with macOS Server (5.2). This comes with a built-in Apache server, which is set up to listen on ports 80 and 443. This works fine; documents are accessible over both HTTP and HTTPS.</p> <p>However, as soon as I use the <code>SSLRequireSSL</code> directive in the .htaccess file, it stops working. In the browser, when accessing <code>https://www.example.com/path/document</code>, I see the following:</p> <blockquote> <h2>Forbidden</h2> <p>You don't have permission to access /path/document on this server.</p> <hr> <p><em>Apache Server at www.example.com Port 80</em></p> </blockquote> <p>Note that the error message mentions port 80, even though it is served over HTTPS / port 443 (I checked this with curl - so browser redirects aren't an issue here). But this <em>could</em> be related to the source of the problem.</p> <p>In the Apache error log, the following is shown:</p> <blockquote> <p>[Sun Jan 29 16:38:07.674342 2017] [ssl:error] [pid 82204] [client 127.0.0.1:50195] AH02219: access to /Users/Glorfindel/wwwroot/path/document failed, reason: SSL connection required</p> </blockquote> <p>Other directives in the .htaccess file do work (e.g. <code>Options -Indexes</code>).</p>
0non-cybersec
Stackexchange
What are common design patterns in Cocoa Touch?. <p>In Java community, design pattern is very common term. </p> <p>In Object C and Cocoa touch world, there are also some design patterns, such as MVC, target-action, delegate, KVO etc. </p> <p>The purpose question here is to hear more professional experience from guru. After all, some patterns are common used in iOS development. Just like some are very common in J2EE world. </p> <p>So question maybe how many common patterns in iOS development field ? Let me put some here</p> <ul> <li>MVC </li> <li>delegate, target-action ( communication between V and C ) </li> <li>KVC KVO Notification ( comm between M and C ) </li> <li>Singleton .... ....</li> </ul>
0non-cybersec
Stackexchange
Google and Microsoft must turn over customer data stored in Europe to US government.
0non-cybersec
Reddit
[Help] I would like to socialize my adult dogs, but am anxious about how they'll act at, for instance, a dog park. They don't know how to react to other dogs.. I have two female dogs, 9 and 5 years old, who are good with each other and crazy about people, but they did not get the opportunity to socialize much when they were young. When I take them on walks, they misbehave when they see other dogs, pulling on the leash toward them, staring at them as if fixated, sometimes barking, sometimes their hair stands up on their backs. I'd like it if they could be cool with other dogs and make new friends, and I wonder if trying a dog park is the right move, but I don't know what kinds of behavior need to be established before they can handle the very stimulating environment of a dog park. What are the right precautions I should take and what behaviors should I watch for if I do take them to a dog park? Should I try taking them one at a time first? I really just want to enrich their lives and reduce both their anxiety and my own. Any advice would be appreciated. Edit: [Obligatory photo](http://imgur.com/a/HNTF5)
0non-cybersec
Reddit
Swery's The Good Life has been funded on Kickstarter.
0non-cybersec
Reddit
Can&#39;t load files using system.file or file.path in R?. <p>I am using a program that requires me to load a "sam" file. However, the code given does not create the <code>data.file</code> variable necessary and instead produces <code>""</code>, a blank instead. </p> <p>This is the code given:</p> <pre><code>data.file &lt;- system.file(file.path('extdata', 'vignette-sam.txt'), package='flipflop') </code></pre> <p>I put in:</p> <pre><code>data.file &lt;- system.file(file.path("Users", "User1", "Desktop", "Cond_18", "Sorted_bam_files", "Cond_18_1.bam_sorted.sam"), package='flipflop') </code></pre> <p>The path is definitely correct and the package name is <code>flipflop</code>. However every time I check what the variable <code>data.file</code> is, it produces <code>""</code>. So the file is never being loaded and the script can't run. </p> <p>I also put in the entire file path into one version of it:</p> <pre><code>data.file &lt;- system.file('/Users/User1/Desktop/Cond_18/Sorted_bam_files/DBM_18_1.bam_sorted.sam', package='flipflop') </code></pre> <p>That version does not include <code>file.path</code>, but it is one of the script examples.</p> <p>The line in the code that uses these variables is this:</p> <pre><code>if(preprocess.instance==''){ print('PRE-PROCESSING sam file ....') data.file &lt;- path.expand(path=data.file) # In case there is a '~' in the input path if(data.file==''){ print('Did you forget to give a SAM file?') ; return(NULL) } annot.file &lt;- path.expand(path=annot.file) samples.file &lt;- path.expand(path=samples.file) </code></pre> <p>And since data.file is <code>""</code> it defaults to <code>NULL</code>.</p>
0non-cybersec
Stackexchange
1 class model or 3 class models? 1 for each - UI, Hardware API Library, and Database. <p>I've always used one class model in all 3 area's of my projects. User Interface, Hardware API (for data collection), Database (entity database context). Every new project only seems to grow in size, which means it gets hard to change the class model because everything uses it. </p> <p>It was suggested to me by seasoned programmer to split up my class model and use a different one for each part of my project. Then convert the data between models with passing data back and forth between the different parts. Which means if one of the models change that you only have to change the code in that section and change the "converters".</p> <p>Is this a general practice? It's definitely more work initially but I am wondering if it will save me time in the future.</p> <p>EDIT: I changed data model to class model as suggested in the comments. Though what I am specifically talking about is data modeled in classes in my application.</p>
0non-cybersec
Stackexchange
Why can we assume that a piecewise continuous function has a maximum?. <p>In a proof I found in a book regarding the ODE <span class="math-container">$\dot{x}(t) = A(t)x(t)$</span> where <span class="math-container">$A$</span> is piecewise continuous on a compact interval I, it is assumed that the maximum <span class="math-container">$K = \max_I ||A(t)||$</span> exists. In my opinion this doesn't have to be the case. Take, for example, <span class="math-container">$I = [-1,1]$</span> and <span class="math-container">$A(t) = \frac{1}{t}$</span> for <span class="math-container">$t &gt; 0$</span> and <span class="math-container">$A(t) = 0$</span> for <span class="math-container">$t \leq 0$</span>. Is there a mistake in the book or am I just wrong somewhere?</p>
0non-cybersec
Stackexchange
I constantly fantasize about saying no to women once I achieve my dream body.. This fantasy is so motivating that its ridiculous. Sometimes I think I want to know what it feels like to deny a beautiful woman more than I want to actually be with a beautiful woman. Its not just about finally sitting on the other side of the table. I want to sit there and put someone firmly on the other end. I lift heavier and diet harder than anyone I know in hopes of being able to do this one day. I know its wrong. Im not proud of myself and I should find more positive motivations for sculpting my body. Hell, I think everyone knows what it feels like to pine after someone 'out of your league.' It just plain sucks. But my female friends/colleagues make it seem like such a thrill to have this power over someone that I want to hold it over women myself.
0non-cybersec
Reddit
Alabama man arrested on six charges four days after publicly criticizing county sheriff.
0non-cybersec
Reddit
Discussion of: Treelets—An adaptive multi-Scale basis for sparse unordered data ar X iv :0 80 7. 40 11 v1 [ st at .A P ] 2 5 Ju l 20 08 The Annals of Applied Statistics 2008, Vol. 2, No. 2, 472–473 DOI: 10.1214/08-AOAS137A Main article DOI: 10.1214/07-AOAS137 c© Institute of Mathematical Statistics, 2008 DISCUSSION OF: TREELETS—AN ADAPTIVE MULTI-SCALE BASIS FOR SPARSE UNORDERED DATA By Fionn Murtagh University of London The work of Lee et al. is theoretically well founded and thoroughly moti- vated by practical data analysis. The algorithm presented has the following important properties: 1. Hierarchical clustering using a novel, adaptive, eigenvector-related, ag- glomerative criterion. 2. Principal components analysis carried out locally, leading to the required sample size for consistency being logarithmic rather than linear; and com- putational time being quadratic rather than cubic. 3. Multiresolution transform with interesting characteristics: data-adaptive at each node of the tree, orthonormal, and the tree decomposition itself is data-adaptive. 4. Integration of all of the following: hierarchical clustering, dimensionality reduction, and multiresolution transform. 5. Range of data patterns explored, in particular, block patterns in the covariances, and “model” or pattern contexts. While I admire the work of the authors, nonetheless I have a different point of view on key aspects of this work: 1. The highest dimensionality analyzed seems to be 760 in the Internet advertisements case study. In fact, the quadratic computational time re- quirements (Section 2.1 of Lee et al.) preclude scalability. My approach in Murtagh (2007a) to wavelet transforming a dendrogram is of linear computational complexity (for both observations, and attributes) in the multiresolution transform. The hierarchical clustering, to begin with, is typically quadratic for the n observations, and linear in the p attributes. These computational requirements are necessary for the “small n, large p” problem which motivates this work (Section 1). In particular, linearity in p is a sine qua non for very high dimensionality data exploration. Received October 2007; revised October 2007. This is an electronic reprint of the original article published by the Institute of Mathematical Statistics in The Annals of Applied Statistics, 2008, Vol. 2, No. 2, 472–473. This reprint differs from the original in pagination and typographic detail. 1 http://arxiv.org/abs/0807.4011v1 http://www.imstat.org/aoas/ http://dx.doi.org/10.1214/08-AOAS137A http://dx.doi.org/10.1214/07-AOAS137 http://www.imstat.org http://www.imstat.org http://www.imstat.org/aoas/ http://dx.doi.org/10.1214/08-AOAS137A 2 F. MURTAGH Since L = O(p) in Section 2.1, this cubic time requirement has to be alleviated, in practice, through limiting L to a user-specified value. 2. The local principal components analysis (Section 2.1) inherently helps with data normalization, but it only goes some distance. For qualitative, mixed quantitative and qualitative, or other forms of messy data, I would use a correspondence analysis to furnish a Euclidean data embedding. This, then, can be the basis for classification or discrimination, benefiting from the Euclidean framework. See Murtagh (2005). 3. My final point is in relation to the following (Section 1): “The key prop- erty that allows successful inference and prediction in high-dimensional settings is the notion of sparsity.” I disagree, in that sparsity of course can be exploited, but what is far more rewarding is that high dimensions are of particular topology, and not just data morphology. This is shown in the work of Hall et al. (2005), Ahn et al. (2007), Donoho and Tanner (2005) and Breuel (2007), as well as Murtagh (2004). What this leads to, potentially, is the exploitation of the remarkable simplicity that is concomitant with very high dimensionality: Murtagh (2007b). Applications include text analysis, in many varied applications, and high frequency financial and other signal analysis. In conclusion, I thank the authors for their thought-provoking and moti- vating work. REFERENCES Ahn, J., Marron, J. S., Muller, K. M. and Chi, Y.-Y. (2007). The high-dimension, low-sample-size geometric representation holds under mild conditions. Biometrika 94 760–766. Breuel, T. M. (2007). A note on approximate nearest neighbor methods. Available at http://arxiv.org/pdf/cs/0703101. Donoho, D. L. and Tanner, J. (2005). Neighborliness of randomly-projected simplices in high dimensions. Proc. Natl. Acad. Sci. USA 102 9452–9457. MR2168716 Hall, P., Marron, J. S. and Neeman, A. (2005). Geometric representation of high dimension low sample size data. J. Roy. Statist. Soc. B 67 427–444. MR2155347 Murtagh, F. (2004). On ultrametricity, data coding, and computation. J. Classification 21 167–184. MR2100389 Murtagh, F. (2005). Correspondence Analysis and Data Coding with R and Java. Chap- man and Hall/CRC, Boca Raton, FL. With a foreword by J.-P. Benzécri. MR2155971 Murtagh, F. (2007a). The Haar wavelet transform of a dendrogram. J. Classification 24 3–32. MR2370773 Murtagh, F. (2007b). The remarkable simplicity of very high dimensional data: Appli- cation of model-based clustering. Available at www.cs.rhul.ac.uk/home/fionn/papers. Department of Computer Science Royal Holloway University of London Egham, Surrey TW20 0EX United Kingdom E-mail: [email protected] http://arxiv.org/pdf/cs/0703101 http://www.ams.org/mathscinet-getitem?mr=2168716 http://www.ams.org/mathscinet-getitem?mr=2155347 http://www.ams.org/mathscinet-getitem?mr=2100389 http://www.ams.org/mathscinet-getitem?mr=2155971 http://www.ams.org/mathscinet-getitem?mr=2370773 http://www.cs.rhul.ac.uk/home/fionn/papers mailto:[email protected] References Author's addresses
0non-cybersec
arXiv
"City Lights", by Natmir Lura, Acrylic on canvas, 2016.
0non-cybersec
Reddit
Building around the RTX 3000 series. I’m new to building a PC but have finally decided to give it a shot. My goal is to build a future-set machine that’s capable of whatever I can throw at it. It’ll be primarily for gaming, thinking Halo Infinite - 4K to start. The GF works at Nvidia which is part of what sparked the idea to build around their flagship GPU. That said, I’m planning on waiting for the new RTX 3080 or RTX 3080 TI. I’m not in a rush and looking to start the planning. Anyone else started planning around Nvidia’s latest for their new build?
0non-cybersec
Reddit
Software as we plan. [PIC].
0non-cybersec
Reddit
ITAP in southern West Virginia.
0non-cybersec
Reddit
A blog with a huge variety of slowcooker recipes. Some of them look pretty good..
0non-cybersec
Reddit
Amber Heard Denies Fabricating Injuries in Johnny Depp Libel Trial.
0non-cybersec
Reddit
Karlsson hasn’t considered long-term contract with Sharks.
0non-cybersec
Reddit
What is the benefit of std::literals::.. being inline namespaces?. <p>In the C++-Standard (eg. N4594) there are two definitions for <code>operator""s</code>:</p> <p>One for <code>std::chrono::seconds</code> :</p> <pre><code>namespace std { ... inline namespace literals { inline namespace chrono_literals { // 20.15.5.8, suffixes for duration literals constexpr chrono::seconds operator "" s(unsigned long long); </code></pre> <p>and one for <code>std::string</code> :</p> <pre><code>namespace std { .... inline namespace literals { inline namespace string_literals { // 21.3.5, suffix for basic_string literals: string operator "" s(const char* str, size_t len); </code></pre> <p>I wonder what is gained from those namespaces (and all the other namespaces inside <code>std::literals</code>), if they are <code>inline</code>.</p> <p>I thought they were inside separate namespaces so they do not conflict with each other. But when they are <code>inline</code>, this motivation is undone, right? <em>Edit:</em> Because <a href="http://www.stroustrup.com/C++11FAQ.html#inline-namespace" rel="nofollow noreferrer">Bjarne explains</a> the main motivation is "library versioning", but this does not fit here.</p> <p>I can see that the overloads for "Seconds" and "String" are distinct and therefor do not conflict. But would they conflict if the overloads were the same? Or does take the (<code>inline</code>?) <code>namespace</code> prevents that somehow?</p> <p>Therefore, what is gained from them being in an <code>inline namespace</code> at all? How, as @Columbo points out below, are overloading across inline namespaces resolved, and do they clash?</p>
0non-cybersec
Stackexchange
This makes me want to face palm so hard.
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
Grilled Pesto Chicken Sandwiches [OC] [670 x 670].
0non-cybersec
Reddit
Documented way to disable ASLR on OS X?. <p>On OS X 10.9 (Mavericks), it's possible to disable <a href="http://en.wikipedia.org/wiki/Address_space_layout_randomization" rel="noreferrer">address space layout randomization</a> for a single process if you launch the process by calling <a href="https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/posix_spawn.2.html" rel="noreferrer"><code>posix_spawn()</code></a> and passing the undocumented attribute <code>0x100</code>. Like this:</p> <pre class="lang-c prettyprint-override"><code>extern char **environ; pid_t pid; posix_spawnattr_t attr; posix_spawnattr_init(&amp;attr); posix_spawnattr_setflags(&amp;attr, 0x100); posix_spawn(&amp;pid, argv[0], NULL, &amp;attr, argv, environ); </code></pre> <p>(This is reverse-engineered from <a href="http://www.opensource.apple.com/source/gdb/gdb-1708/src/gdb/macosx/macosx-nat-inferior.c" rel="noreferrer">Apple's GDB sources</a>.)</p> <p>The trouble with undocumented features like this is that they tend to disappear without notice. According to <a href="https://stackoverflow.com/a/22001746/68063">this Stack Overflow answer</a> the dynamic linker <a href="https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html" rel="noreferrer"><code>dyld</code></a> used to consult the environment variable <code>DYLD_NO_PIE</code>, but this does not work in 10.9; similarly the static linker apparently used to take a <code>--no-pie</code> option, but this is no longer the case.</p> <p>So is there a documented way to disable ASLR?</p> <p>(The reason why I need to disable ASLR is to ensure repeatability, when testing and debugging, of code whose behaviour depends on the addresses of objects, for example address-based hash tables and <a href="http://www.memorymanagement.org/glossary/b.html#term-bibop" rel="noreferrer">BIBOP-based</a> memory managers.)</p>
0non-cybersec
Stackexchange
J.J. Abrams Screens Star Trek Into Darkness for Dying Fan.
0non-cybersec
Reddit
Using Pandoc to transform Markdown to Beamer Latex Code?. <p>According to </p> <p><a href="http://pandoc.org/demos.html">http://pandoc.org/demos.html</a></p> <p>I see the command for turning an md file into a beamer pdf file.</p> <blockquote> <p>pandoc -t beamer SLIDES -o example8.pdf</p> </blockquote> <p>When I change the extension to tex instead of pdf,</p> <blockquote> <p>pandoc -t beamer SLIDES -o example8.tex</p> </blockquote> <p>the body of the tex file gets produced but there is no preamble. (No \begin{document}, etc)</p> <p>Is there a way to get the tex file for beamer with the headings? It's not that big of a deal, but it would be convenient.</p>
0non-cybersec
Stackexchange
Resize the box in relation to the text contained inside. <p>Two questions:</p> <ol> <li><em>How can I reduce the size of the box?</em></li> <li><em>How I can reduce the box in relation to the text contained in the box?</em></li> </ol> <p><a href="https://i.stack.imgur.com/gI0JO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gI0JO.png" alt="enter image description here"></a></p> <p>Here my MWE.</p> <pre><code>\documentclass[12pt,a4paper,oneside]{book} \usepackage[lmargin=.8cm, rmargin=.7cm, bmargin=2cm, marginparwidth=5.5cm, marginparsep=2em]{geometry} \usepackage[svgnames]{xcolor} \usepackage[most]{tcolorbox} \begin{document} \tcbset{enhanced,colback=LightGoldenrodYellow, boxrule=1.1pt, colframe=LightGoldenrodYellow,fonttitle=\bfseries,halign=center,valign=center} \begin{tcolorbox}[ lifted shadow={1mm}{-2mm}{3mm}{0.1mm}% {black!50!white}] \textbf{SVILUPPO IN MULTIPOLI \\DI POTENZIALI NEWTONIANI \\E COULOMBIANI} \end{tcolorbox} \end{document} </code></pre>
0non-cybersec
Stackexchange
What is the difference between Trading Volume and Transaction Volume?. <p>Looking at the Bitcoin Statistics summery from <a href="https://blockchain.info/stats" rel="nofollow noreferrer">Blockchain.info</a></p> <p>there are Trading Volume and Transaction Volume listed. I understand that transaction volume represents the amount of bitcoin used for transactions, eg. user sends bitcoins over to another user.</p> <p>What about trade though? How is the value for trading value determined?</p>
0non-cybersec
Stackexchange
TypeScript and field initializers. <p>How to init a new class in <code>TS</code> in such a way (example in <code>C#</code> to show what I want):</p> <pre><code>// ... some code before return new MyClass { Field1 = "ASD", Field2 = "QWE" }; // ... some code after </code></pre> <p><strong>[edit]</strong><br> When I was writing this question I was pure .NET developer without much of JS knowledge. Also TypeScript was something completely new, announced as new C#-based superset of JavaScript. Today I see how stupid this question was. </p> <p>Anyway if anyone still is looking for an answer, please, look at the possible solutions below.</p> <p>First thing to note is in TS we shouldn't create empty classes for models. Better way is to create interface or type (depending on needs). Good article from Todd Motto: <a href="https://ultimatecourses.com/blog/classes-vs-interfaces-in-typescript" rel="noreferrer">https://ultimatecourses.com/blog/classes-vs-interfaces-in-typescript</a></p> <p><strong>SOLUTION 1:</strong></p> <pre><code>type MyType = { prop1: string, prop2: string }; return &lt;MyType&gt; { prop1: '', prop2: '' }; </code></pre> <p><strong>SOLUTION 2:</strong></p> <pre><code>type MyType = { prop1: string, prop2: string }; return { prop1: '', prop2: '' } as MyType; </code></pre> <p><strong>SOLUTION 3 (when you really need a class):</strong></p> <pre><code>class MyClass { constructor(public data: { prop1: string, prop2: string }) {} } // ... return new MyClass({ prop1: '', prop2: '' }); </code></pre> <p>or </p> <pre><code>class MyClass { constructor(public prop1: string, public prop2: string) {} } // ... return new MyClass('', ''); </code></pre> <p>Of course in both cases you may not need casting types manually because they will be resolved from function/method return type.</p>
0non-cybersec
Stackexchange
Bluetooth fails to load firmware on boot - Ubuntu 15.04. <p>I get bluetooth firmware errors on boot in 15.04 on an Inspiron 3647. How can I fix it?</p> <pre><code>Bus 003 Device 003: ID 0c45:8603 Microdia Bus 003 Device 007: ID 0cf3:0036 Atheros Communications, Inc. Bus 003 Device 002: ID 062a:4102 Creative Labs Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub bluetooth 391136 2 ath3k,btusb 0: phy0: Wireless LAN Soft blocked: yes Hard blocked: no [ 9.983204] Bluetooth: Core ver 2.17 [ 9.983221] Bluetooth: HCI device and connection manager initialized [ 9.983227] Bluetooth: HCI socket layer initialized [ 9.983229] Bluetooth: L2CAP socket layer initialized [ 9.983231] Bluetooth: SCO socket layer initialized [ 16.957937] Bluetooth: Error in firmware loading err = -110,len = 448, size = 1906 [ 16.957969] Bluetooth: Loading sysconfig file failed [ 16.957937] Bluetooth: Error in firmware loading err = -110,len = 448, size = 1906 </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
Go fold the dishes.
0non-cybersec
Reddit
Horsetail Falls in Yosemite, California (1494×4216).
0non-cybersec
Reddit
RxJava : Using Retry with Extended Single Observable doesn&#39;t Emit the data. <p>The <code>subscriber</code> doesn't receive the data if the retry operator is added to an <code>observable</code> which was created by extending <code>Single</code>.</p> <pre><code> getSingle() .retry(1) .subscribe(System.out::println, System.out::println); getSingleExt() .subscribe(res -&gt; System.out.println("WITHOUT RETRY " + res), System.out::println); getSingleExt() .retry(1) .subscribe(res -&gt; System.out.println("WITH RETRY " + res), System.out::println); private static Single&lt;String&gt; getSingle() { return Single.create(emitter -&gt; emitter.onSuccess("Single.create")); } private static Single&lt;String&gt; getSingleExt() { return new ExtendedSingle(); } private static class ExtendedSingle extends Single&lt;String&gt; { @Override protected void subscribeActual(SingleObserver&lt;? super String&gt; emitter) { emitter.onSuccess("ExtendedSingle"); } } </code></pre> <p>Output</p> <p><code>Single.create</code></p> <p><code>WITHOUT RETRY ExtendedSingle</code></p> <p>Expected</p> <p><code>Single.create</code></p> <p><code>WITHOUT RETRY ExtendedSingle</code></p> <p><code>WITH RETRY ExtendedSingle</code></p>
0non-cybersec
Stackexchange
Solving $y&#39;(x)-2xy(x)=2x$ by using power series. <p>I have a first order differential equation:</p> <p>$y'(x)-2xy(x)=2x$</p> <p>I want to construct a function that satisfies this equation by using power series. </p> <p><strong>General approach:</strong></p> <p>$y(x)=\sum_0^\infty a_nx^n$</p> <p><strong>Differentiate once:</strong></p> <p>$y'(x)=\sum_1^\infty a_nnx^{n-1}$</p> <p><strong>Now I plug in the series into my diff. equation:</strong></p> <p>$\sum_1^\infty a_nnx^{n-1}-2x\sum_0^\infty a_nx^n=2x$</p> <p>$\iff \sum_0^\infty a_{n+1}(n+1)x^n-2x\sum_0^\infty a_nx^n=2x$</p> <p>$\iff \sum_0^\infty [a_{n+1}(n+1)x^n-2xa_nx^n]=2x$</p> <p>$\iff \sum_0^\infty [a_{n+1}(n+1)-2xa_n]x^n=2x $ </p> <p><strong>Now I can equate the coefficients:</strong></p> <p>$a_{n+1}(n+1)-2xa_n=2x$</p> <p>I am stuck here. I don't really understand why equating the coefficients works in the first place. Whats the idea behind doing this. I don't want to blindly follow some rules so maybe someone can explain it to me. Do I just solve for $a_{n+1}$ now?</p> <p>Thanks in advance</p> <p><strong>Edit:</strong></p> <p>Additional calculation in response to LutzL:</p> <p>$\sum_1^\infty a_nnx^{n-1}-\sum_0^\infty 2a_nx^{n+1}=2x$</p> <p>$\iff \sum_0^\infty a_{n+1}(n+1)x^n-\sum_1^\infty 2a_{n-1}x^n=2x$</p> <p>$\iff \sum_1^\infty a_{n+1}(n+1)x^n+a_1-\sum_1^\infty 2a_{n-1}x^n=2x$</p> <p>$\iff \sum_1^\infty [a_{n+1}(n+1)-2a_{n-1}]x^n=2x-a_1$</p> <p>So how do I deal with the x on the other side now? Can I just equate the coefficients like this:</p> <p>$a_{n+1}(n+1)-2a_{n-1}=2x-a_1$?</p>
0non-cybersec
Stackexchange
J.J Abrams says the Force will not play key role in new trilogy..
0non-cybersec
Reddit
Testing an electric fence With Bare Hands WCGW.
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
Porn/relationship Question. I don't know if I would consider myself addicted to pornography but I enjoy looking at it and can find any excuse to look at it (boredom). Fyi, when I say porn, it is typically man on woman, girl on guy (nothing too "crazy"). When I was single, it became somewhat of a daily habit. However, now that I have been in a relationship for two years, its dropped to looking at it around twice a week. In the beginning of the relationship, I was open and honest with her about looking at it quite a bit. Now that we live together, the initial request was that I not look at it when she is home (she felt weird about it, and has no desire to watch it with me). Because our communication is pretty spot on, my fiancee has told me that she "feels uncomfortable" when I look at it in general, because she is self conscious about her body and doesn't like the idea of me looking at naked women and "envisioning having sex with them." I understand that women and men view sex differently, but to me, porn isn't a big deal. However, I'm trying to be aware of her feelings. It has been two weeks since I've last looked at it and I feel like that is a type of accomplishment. Yet I feel the urge. She and I work pretty hard throughout the week, and after we get home, make dinner, I typically have an hour or two of work, we are too exhausted for sex. I used to get home and to relax, look at porn before she got home. But even though she has voiced how she feels (and we have argued about it a bit), there is still that urge to look... We have talked about how we want to have more sex, but we are so wiped out, we end up waiting for the weekends (usually twice). Growing up in a pretty religious family, we were taught that porn/masturbation is a bad thing. So I used to feel awful after the fact when I looked at it. Nowadays, I just "shrug it off." My hope is that I the urge to look at porn would go away over time, and while I don't think about it, it still sounds awesome (even knowing how she feels). And when I initially found Gonewild several months ago, I thought "this is so great! A site for normal women that have the confidence to show off their bodies." **I think it all comes down to how I feel that porn isn't really that bad (though after reading this, I think I might have a problem), but I'm trying to respect what she thinks and feels even if I don't necessarily agree with it myself.** Any advice on continuing to fight this?
0non-cybersec
Reddit
Permission when running script in Vagrant using Vagrantfile. <p>I have created a vagrant box for running rails applications and I have managed to create it manually.</p> <p>My next step was to create a shell script that I can include in the Vagrantfile so when creating new boxes all installation will be done automatically.</p> <p>But when I reach the line:</p> <pre><code>source ~/.bash_profile </code></pre> <p>I get this error</p> <pre><code>mkdir: cannot create directory `/home/vagrant/.rbenv/shims': Permission denied mkdir: cannot create directory `/home/vagrant/.rbenv/versions': Permission denied </code></pre> <p>Works fine from CLI</p> <p>Any ideas?</p> <h2><strong>UPDATE</strong></h2> <p>I have fixed the mkdir error and the script runs from end to end with no apparent errors.</p> <p>Now when I <code>vagrant ssh</code> and check my home directory I do not find any of the git repos I downloaded and installed using my script nor .bash_profile hence I can not <code>rbenv</code> </p> <p>Any ideas why this may happen - what am I doing wrong?</p> <pre><code>vagrant@precise64:~$ ls -a . .bash_history .cache .profile .sudo_as_admin_successful .veewee_version .. .bash_logout .bashrc postinstall.sh .ssh .vbox_version vagrant@precise64:~$ </code></pre> <p>this is setup.sh:</p> <pre><code># Update sources: sudo apt-get -y update # Install development tools: sudo apt-get -y install build-essential # Packages required for compilation of some stdlib modules sudo apt-get -y install tklib # Extras for RubyGems and Rails: sudo apt-get -y install zlib1g-dev libssl-dev # Readline Dev on Ubuntu: sudo apt-get -y install libreadline-gplv2-dev # Install some nokogiri dependencies: sudo apt-get -y install libxml2 libxml2-dev libxslt1-dev # Install Git sudo apt-get -y install git-core # Install Sqlite sudo apt-get -y install sqlite3 libsqlite3-dev # Install Make sudo apt-get -y install make # Install NodeJS (Required for Rails) sudo apt-get -y install python-software-properties sudo add-apt-repository -y ppa:chris-lea/node.js sudo apt-get -y update sudo apt-get -y install curl nodejs # Install RBENV git clone https://github.com/sstephenson/rbenv.git ~/.rbenv touch ~/.bash_profile echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &gt;&gt; ~/.bash_profile echo 'eval "$(rbenv init -)"' &gt;&gt; ~/.bash_profile source ~/.bash_profile # Install Ruby 2.1.0 git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build sudo sh ~/.rbenv/plugins/ruby-build/install.sh rbenv install 2.1.0 rbenv rehash rbenv global 2.1.0 # Install gems for Rails # gem install rdoc gem install bundler # gem install rake gem install sqlite3 -v '1.3.9' gem install rails rbenv rehash </code></pre> <p>Many thanks in advance.</p>
0non-cybersec
Stackexchange
App for Reading - iPad &amp;&#160;PDF. <p>I am searching for a application with the following functionality, but cant find one:</p> <p>I want to read PDFs. I want to highlight some text from time to time or add a note (with its timestamp). The summary of all highlights / notes should aggregated together so there is some special page(s) / section that contain only the highlighted text and notes.</p> <p>Does something like this exist? I know there are dozens of apps for reading itself, but i am not sure whether there is app that allows me to list in "my highlighted content" only.</p>
0non-cybersec
Stackexchange
How to make Facebook’s Messenger desktop app start with Windows?. <p>The <a href="https://www.microsoft.com/en-us/p/messenger/9wzdncrf0083?activetab=pivot:overviewtab" rel="nofollow noreferrer">offical desktop app</a> works well on Windows, but apparently it doesn't show notification for new messages if the app is not started.</p> <p>Is there an option to start it with Windows automatically? Such apps usually has a setting like that, but I couldn't find it.</p>
0non-cybersec
Stackexchange
How do I get 2 Dell monitors to work with my MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports). <p>OSX doesn't support MST daisy chaining monitors. I've got 2 brand new monitors and a decent mac and Apple wont let me use it due to software limitations.</p> <p>Is there any product I can buy (Amazon preferably) that will let me use my two monitors (not screen mirroring) as I want to? I can plug both displays into the mac but then I can't charge the mac at the same time or close the lid without it going off. Dell U2518D are the displays.</p>
0non-cybersec
Stackexchange
Bootstrap/Stylus - Make Table Column as small as possible. <p>I'm practicing using Bootstrap to make my table responsive on a search list I'm creating, the issue is that two of my columns I'd like to make as small as possible instead of equal sized. In the picture below, you can see Date and Link take up more space then they need. How can I go about fixing this? Thanks in advance!</p> <p><img src="https://i.stack.imgur.com/H7jpU.png" alt="Title and Link are too big"></p> <p>HTML (Snipped):</p> <pre><code>&lt;div class="table-responsive"&gt; &lt;table class="table table-striped table-hover table-bordered table-condensed"&gt; &lt;tbody&gt; &lt;tr class="active" ng-repeat="s in results"&gt; &lt;!-- &lt;td class="hidden-xs hidden-sm"&gt;{{$index}}&lt;/td&gt; --&gt; &lt;td class="hidden-xs hidden-sm"&gt;{{s.provider}}&lt;/td&gt; &lt;td&gt;{{s.title}}&lt;/td&gt; &lt;td&gt;{{s.date}}&lt;/td&gt; &lt;td class="hidden-xs hidden-sm"&gt;{{s.cat}}&lt;/td&gt; &lt;td&gt;&lt;a href="{{s.link}}"&gt;D/L&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p>Stylus:</p> <pre><code>table table-layout fixed word-wrap break-word </code></pre>
0non-cybersec
Stackexchange
Judge Says NSA Program Is Unconstitutional, 'It's Time to Move'.
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
Shawn Wasabi - SNACK feat. raychel jay (2019).
0non-cybersec
Reddit
With Volo's coming out with a Kobold race, I'm gonna be running a small All-Kobold campaign. Since kobolds wouldn't work with the regular PHB backgrounds I made 7 new kobold-specific backgrounds!.
0non-cybersec
Reddit
[No Spoilers] Was the rating of The Expanse changed to TV-MA?. I was looking on demand fios, trying to find The Expanse, and it said that season2 was rated MA. I haven't gotten a chance to start it, but what exactly did they change? Do they have f-bombs and nudity now?
0non-cybersec
Reddit
embed shiny app into Rmarkdown html document. <p>I am able to create an Rmarkdown file and I'm trying to embed a shiny app into the html output. The interactive graph shows if I run the code in the Rmarkdown file. But in the html output it only shows a blank box. Can anybody help fix it?</p> <p>Run the code in Rmarkdown file:</p> <p><a href="https://i.stack.imgur.com/nYUbY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nYUbY.png" alt="enter image description here" /></a></p> <p>In the html output:</p> <p><a href="https://i.stack.imgur.com/WNnYj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WNnYj.png" alt="enter image description here" /></a></p> <p>My Rmarkdown file (please add the three code sign at the end yourself somehow i cannot do here):</p> <pre><code> --- title: &quot;Data Science - Tagging&quot; pagetitle: &quot;Data Science - Style Tagging&quot; author: name: &quot;yyy&quot; params: creation_date: &quot;`r format(Sys.time(), c('%Y%m%d', '%h:%m'))`&quot; runtime: shiny --- ```{r plt.suppVSauto.week.EB, out.width = '100%'} data &lt;- data.frame(BclgID = c('US','US','US','UK','UK','UK','DE','DE','DE'), week = as.Date(c('2020-06-28', '2020-06-21', '2020-06-14', '2020-06-28', '2020-06-21', '2020-06-14', '2020-06-28', '2020-06-21', '2020-06-14')), value = c(1,2,3,1,2,2,3,1,1)) shinyApp( ui &lt;- fluidPage( radioButtons(inputId = 'BclgID', label = 'Catalog', choices = type.convert(unique(plot$BclgID), as.is = TRUE), selected = 'US'), plotOutput(&quot;myplot&quot;) ), server &lt;- function(input, output) { mychoice &lt;- reactive({ subset(data, BclgID %in% input$BclgID) }) output$myplot &lt;- renderPlot({ if (length(row.names(mychoice())) == 0) { print(&quot;Values are not available&quot;) } p &lt;- ggplot(mychoice(), aes(x=as.factor(week), y=value)) + geom_line() + labs(title = &quot;test&quot;, subtitle = &quot;&quot;, y=&quot;Value&quot;, x =&quot;Date&quot;) + theme(axis.text.x = element_text(angle = 90)) + facet_wrap( ~ BclgID, ncol = 1) print(p) }, height = 450, width = 450) } ) </code></pre>
0non-cybersec
Stackexchange
Set the line separation in a tabu table equal to the line separation in the document. <p>As is known, the <code>tabu</code> environment does not automatically adjust the vertical distance between a cell with multiple lines and another cell, cf. <a href="https://tex.stackexchange.com/questions/82573/text-too-close-to-cell-border-when-having-a-nested-tabu-and-vspace-in-a-cell">Text too close to cell border when having a nested tabu and \vspace in a cell</a> and <a href="https://tex.stackexchange.com/questions/64337/consistent-vertical-spacing-with-tabu">Consistent vertical spacing with tabu</a>.</p> <p>This can be adjusted with <code>tabu</code>'s <code>\tabulinesep</code> command, but instead of setting this separator to some arbitrary value, I would like it to be the same as the vertical distance between lines in the document as such. How do I do that?</p> <pre><code>\documentclass{article} \usepackage{tabu,setspace} \singlespacing \parindent=0pt \begin{document} % \tabulinesep = &lt;whatever the distance between lines in the document is&gt; \begin{tabu} to\linewidth{lX} Lipsum &amp; Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh\\ Lipsum &amp; FkRtfh\\ \end{tabu} \end{document} </code></pre> <p><img src="https://i.stack.imgur.com/a8tKq.png" alt="enter image description here"></p>
0non-cybersec
Stackexchange
If `[` is a function for subsetting in R, what is `]`?. <p>I'm reading the advanced R introduction by Hadley Wickham, where he states that [ (and +, -, {, etc) are functions, so that [ can be used in this manner</p> <pre><code>&gt; x &lt;- list(1:3, 4:9, 10:12) &gt; sapply(x, "[", 2) [1] 2 5 11 </code></pre> <p>Which is perfectly fine and understandable. But if [ is the function required to subset, does ] have another use rather than a syntactical one?</p> <p>I found that:</p> <pre><code>&gt; `]` Error: object ']' not found </code></pre> <p>so I assume there is no other use for it?</p>
0non-cybersec
Stackexchange
Does cooling the body (ie cold shower, standing in a cooler) burn calories as the body re-heats itself?. I was having this discussion with a friend, who's argument was that drinking water burns calories because it cools the body, which is then forced to reheat itself...so IF that were the case, wouldn't being in a cold environment cause the body to burn more calories in heat? Edit: Front Page? You are too kind, truly.
0non-cybersec
Reddit
It's a malamute thing.
0non-cybersec
Reddit
Spring wiring by type is slower by magnitude than wiring by name. <p>In my project, I am trying to migrate all usages of</p> <pre><code>Foo foo = (Foo) beanFactory.getBean("name"); </code></pre> <p>into </p> <pre><code>Foo foo = beanFactory.getBean(Foo.class); </code></pre> <p>The benefits are obvious: type safety, less convoluted code, less useless constants, etc. Typically such lines are located in static legacy contexts where such a wiring is the only option.</p> <p>This was all fine until one day users started to complain about the slowness which turned out to come from Spring internals. So I fired up a profiler to find a hotspot in </p> <p><code>org.springframework.beans.factory.support.AbstractBeanFactory::doGetBean(String, Class&lt;T&gt;, Object[], boolean)</code> </p> <p>which has an expensive call to </p> <p><code>Class.isAssignableFrom(anotherClass)</code>.</p> <p>I have quickly created a small performance test to find out the speed difference between string name and type lookups is a whooping <strong>350</strong> times (I'm using <code>StaticApplicationContext</code> for this test FAIW)!</p> <p>While investigating this, I found <a href="https://jira.springsource.org/browse/SPR-6870">SPR-6870</a> which has high number of votes but for some reason isn't addressed. This led me to <a href="http://jawspeak.com/2010/11/28/spring-slow-autowiring-by-type-getbeannamesfortype-fix-10x-speed-boost-3600ms-to/comment-page-1/">an attempt to solve this problem</a> which does significantly improve the situation but is still slower <strong>~25</strong> times than lookup by String! It turns out this attempt only solves half of the problem: it caches the name of the bean to save on O(n) iteration but still has to do call <code>isAssignableFrom</code> to validate the type.</p> <p>Described problem is not only related to my scenario but is also for beans which use <code>@Autowired</code> and can be felt hard in cases where beans are created inside a loop.</p> <p>One of solutions would be to override one of the bean factory methods and cache the is-this-bean-of-the-same-type check results but clearly this should be done in Spring and not in my own code.</p> <p>Is anyone else suffering from a similar problem and found a solution to it?</p>
0non-cybersec
Stackexchange
crackmes.de - more info. [crackmes.de](http://crackmes.de/)
1cybersec
Reddit