text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
Algebra Problem. <p>The expression $x^2-4x+5$ is a factor of $ax^3+bx^2+25$. Express the sum a+b as an integer. </p>
<p>Please give an explanation of how the answer </p>
| 0non-cybersec
| Stackexchange |
From Russia With Love. | 0non-cybersec
| Reddit |
Sending pdf files to user from nodejs to reactjs. <p>I have pdf documents stored in the file system on the server side.</p>
<p>I need to let the user download one of them when he/she clicks on download.</p>
<p>The problem is that I know how to send a file from NodeJS to browser but here the request will be made by a ReactJS axios request. So when I send a file, the response will go to react. How do I send that pdf file to the user? Do I access the file system directly using my front end code?</p>
<p>I get the following in the browser console when I log the response after I do <code>res.sendFile(file_path)</code> in NodeJS</p>
<p><a href="https://i.stack.imgur.com/8ESIc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ESIc.png" alt="enter image description here"></a></p>
<p>How do I process this so that I can make the user download the pdf?</p>
| 0non-cybersec
| Stackexchange |
Can anyone explain to me why this is not a CSPRNG?. This is a very simple question, and there is likely some trivial answer I am over looking, but I have not been able to come up with a convincing answer of this for myself.
Consider the following pseudo random number generator (PRNG). The seed is a randomly chosen set of n positive integers, in addition to a random irrational number, and let M be some positive integer constituting the output range of the PRNG. Then for each of the randomly chosen numbers, multiply the number by the random irrational number mod M, giving a term in the output of the generator: so the generator outputs n numbers for the size n+1 input seed.
This "generator" maps from the integers to the irrational real numbers, so it expands bits off the input key. Further, because each input integer was uniformly randomly chosen, the outputs of the generator should be unpredictable, and we have a secure PRNG.
Can anyone explain to me why this does not constitute a CSPRNG? Much less a provably secure one? | 1cybersec
| Reddit |
Ash has had enough of these obsessive photographers. | 0non-cybersec
| Reddit |
Hummingbird frenzy is 🔥. | 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 |
My 10th year dedication to the love of my life: the French Horn.. | 0non-cybersec
| Reddit |
TIL that in 1980 Weird Al Yankovic turned down a 5 million dollar (worth 14 million today) beer endorsement stating "a lot of my fans were young and impressionable, so ethically I believe I did the right thing". | 0non-cybersec
| Reddit |
AVPlayer And Local Files. <p>I am building a MP3 player for iOS that plays audio files hosted on the web. I want to offer the ability to play the files offline so I have the files downloading using ASIHTTP but I am cannot seem to find info on initiallzing AVPlayer with a mp3 in the app documents directory. Has anyone done this before? Is it even possible?</p>
<p>*I posted an answer below that shows how to use the iOS AvPlayer for both local and http files. Hope this helps!</p>
| 0non-cybersec
| Stackexchange |
New Install and Gaming Issues. <p>I'm totally new to linux, but I've basically had enough with using windows. A recent HDD failure has prompted me to take this as a good time to switch (my new setup will be a 250GB SSD and 1TB HDD for media).</p>
<p>Most of my tasks involve simply using browsers, checking emails, compiling LaTeX and so on. However, I do still occasionally play games on my PC (on steam) and this seems to be the only negative of switching to ubuntu.</p>
<p>So, my question is basically one of the best solution for installing ubuntu but still being able to play steam games (I am aware that they now support some games).</p>
<p>From what I gather, I have these options:</p>
<p>1) Just install ubuntu and use a program like wine to run games.</p>
<p>2) Partition my drive so that I have one for windows for when I want to play games and another for ubuntu, for everything else.</p>
<p>The only advantage of 1) is that I'll have more disk space without having to install windows (and potentially create too large of a partition for it. I assume that the games should be installed onto the same partition as the OS?). On the other hand, it feels natural to me that running games through a program like wine isn't going to be all that great - can it handle newer games well (civ V, CSGO?); does one see a general drop of frame rate?</p>
<p>Option 2) seems like the best option for me, but then I need to decide on how to partition the drive and risk losing unnecessary space.</p>
<p>I would be very grateful to hear opinions on the best solution. I am totally new to ubuntu and this forum, so apologies if the question isn't appropriate, is poorly phrased, or is too long!</p>
| 0non-cybersec
| Stackexchange |
How to disable the try again password in ssh command. <p>I want the ssh command to only allow one chance in typing the password, if the password was wrong at the first time the ssh will return</p>
<pre><code>Permission denied (publickey......).
</code></pre>
<p>Is there a flag that tells the ssh to request only once the password?</p>
<p>Instead of:</p>
<pre><code>[nir@dhcppc4 ~]$ ssh [email protected]
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied (publickey.....).
</code></pre>
<p>I want:</p>
<pre><code>[nir@dhcppc4 ~]$ ssh [email protected]
[email protected]'s password:
Permission denied (publickey.....).
</code></pre>
<p>The solution must be on the client side (e.g. some flag to the ssh command or using pipeline), I can't touch <code>sshd_config</code>, or any other system config file. Because -in general- I build 3rd party software (so I can't generate keys nor config system files) that access the servers in the LAN, the passwords are saved in the DB (therefore doesn't need second attempt). And in my code if I'll be able to assume that I only have one attempt to <code>ssh</code>/<code>scp</code> it will simplify the relevant code.</p>
| 0non-cybersec
| Stackexchange |
Non-CGI Special Effects. Hello, Dreadit!
I love films that use practical special effects -- The Fly, The Exorcist, the majority of Pan's Labyrinth, etc. CGI in movies, when obvious, really pulls me out of the experience.
I'm looking for recent movies (post-2000) that have good effects... with no (or very little and very unobtrusive) CGI. Can you offer some recommendations?
Gracias!
Edit: You are all amazing. Thank you! | 0non-cybersec
| Reddit |
What Just Happened.... | 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 |
Design for keeping local user profile data in sync with the server. <p>So I'm working on an iOS app and I’m thinking about how to keep user profile data in sync between server and client.</p>
<p>The first idea that comes to mind is to create a class called <code>User</code>. It would be a subclass of <code>NSMutableDictionary</code>.</p>
<p>Then I would declare a shared-instance within User so all view controllers and other classes could reference it without having to create their own instances.</p>
<p>User would have read-only properties like:</p>
<pre><code>User.DisplayName = "User1234"
User.ProfileUrl = "http://server.com/profile/121234.png"
User.Points = 12345
User.IAPs = ["removeAds","accountUpgrade"]
</code></pre>
<p>Then I'd make a function called <code>User.update()</code> that just pulls userdata from the server and populates the User class properties. This is the only function that would be allowed to write over the User properties.</p>
<p>I would run the <code>User.update()</code> function during times such as:</p>
<ul>
<li>App launch</li>
<li>App re-opened from sleep</li>
<li>Profile update</li>
<li>After in-app-purchase </li>
<li>etc.</li>
</ul>
<p>Does this seem like a reasonable design for keeping local user profile data in sync with the server?</p>
| 0non-cybersec
| Stackexchange |
Merging outlook files on two computers. <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://superuser.com/questions/148538/sync-outlook-between-two-computers">Sync outlook between two computers?</a> </p>
</blockquote>
<p>I have two computers laptop and desktop. Both have outlook 2010 and run windows 7 both have identical email accounts all of which are imap. I add contacts to sometimes to one and sometimes to the other and the same for calendar items etc. I just would like an easy way to periodically update both computers so they are identical--assume email is not an issue -- just contacts etc. I have read through the microsoft stuff and its mostly email focused but with imap that is not an issue I think.</p>
| 0non-cybersec
| Stackexchange |
Positive semidefinite matrices and polynomials. <p>If $A$ is positive semidefinite and if $p(t)$ is any polynomial such that $p(t) > 0$ for $t \geq 0$, show that $p(A)$ is positive semidefinite.</p>
| 0non-cybersec
| Stackexchange |
Generating set of an infinite group. <p>Must a generating set for a group of infinite order be finite?</p>
<p>E.g $\{1\}$ is a finite generating set for $(\mathbb{Z},+)$.</p>
| 0non-cybersec
| Stackexchange |
There are 4 cups of liquid. Three are water and one is poison. If you were to drink 3 of the 4 cups, what is the probability of being poisoned?. <p>In Season 5 Episode 16 of Agents of Shield, one of the characters decides to prove she can't die by pouring three glasses of water and one of poison; she then randomly drinks three of the four cups. I was wondering how to compute the probability of her drinking the one with poison.</p>
<p>I thought to label the four cups $\alpha, \beta, \gamma, \delta$ with events </p>
<ul>
<li>$A = \{\alpha \text{ is water}\}, \ a = \{\alpha \text{ is poison}\}$</li>
<li>$B = \{\beta \text{ is water}\},\ b = \{\beta \text{ is poison}\}$</li>
<li>$C = \{\gamma \text{ is water}\},\ c = \{\gamma \text{ is poison}\}$</li>
<li>$D = \{\delta \text{ is water}\},\ d = \{\delta \text{ is poison}\}$</li>
</ul>
<p>If she were to drink in order, then I would calculate $P(a) = {1}/{4}$.
Next $$P(b|A) = \frac{P(A|b)P(b)}{P(A)}$$ Next $P(c|A \cap B)$, which I'm not completely sure how to calculate.</p>
<p>My doubt is that I shouldn't order the cups because that assumes $\delta$ is the poisoned cup. I am also unsure how I would calculate the conditional probabilities (I know about Bayes theorem, I mean more what numbers to put in the particular case). Thank you for you help.</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 |
Simple question about how to value things. Something I can't resolve satisfactorily, is how we should attribute value to things.
It is quite clear to me, that people value things they derive satisfaction from. For example, I like eating food, because it makes me lose the negative feeling of hunger. Eating food makes me feel good.
Same thing with helping people: watching someone's gloves falling out of their jacket, most people will want to notify them of that. They value helping people.
What I do understand is how we evolved to value things. We like eating because we would die otherwise. We like helping people because this was evolutionary advantageous, being social animals.
I've also found that there isn't inherit sense in anything. Why should it be inherently morally unsound to kill a child? In the end all attempts to explain why end up sounding dogmatic.
Now here is where I'm lost. How do I decide which things I should value? Should I just do things that make me 'feel good' (ie, happy)? Why value happiness instead of sadness or confusion or whatever, except our inner drive to do so?
I feel like I have failed to grasp the second half of existentialism. I would be ecstatic about some directions on where to go from here, whom to read and learn from. Thank you.
tl;dr need help to decide whether to drink a cup of tea or kill myself. | 0non-cybersec
| Reddit |
what is PGP public key block?. <p>There's PGP public key block posted on some websites (eg. <a href="http://phrack.org/index.html">http://phrack.org/index.html</a>).</p>
<p>It's not hex code. it uses much more alphabet characters. What is it?</p>
<p>Why is this information posted? how can i use it?</p>
| 0non-cybersec
| Stackexchange |
Visualizing a magnetic field with iron filings. | 0non-cybersec
| Reddit |
Jay Gruden on Matt Jones' absence from OTAs: "I expect him to be back. He’s on our roster, he’s eating up a spot.". | 0non-cybersec
| Reddit |
My dad was driving his car and he put it in reverse. ... he said "This takes me back." | 0non-cybersec
| Reddit |
Sea sapphire copepods are tiny virtually invisible sea creatures, until they light up with iridescent light. | 0non-cybersec
| Reddit |
How to copy set of files and folder structure with identical names but different file extensions. <p>Let me preface this by saying that I am a linux novice to be sure. I am looking for a way to copy files of with the same name but a different file extension.</p>
<p>Some background:</p>
<p>I have a large collection of music. The vast majority is in .flac format. In order to play my collection in my car I transcoded all of it into different file formats. I have a library of source .flac files and then identical matching .mp3 and .m4a (AAC) transcoded libraries, due to various file formats supported by the cars we own. I have a flash drive in my car that supports AAC and MP3 playback, but not flac. On the flash drive is music that I have selected from the larger library on my computer. I have no want for lots of complete albums and thus I only have files on my flashdrive that I hand picked from the larger library.</p>
<p>Now, we sold our old car and bought a new one, and this one supports FLAC playback. Rather than manually matching the flac tracks on the new flash drive with the mp3 tracks on the old one, I was wondering if it would be possible via terminal to match the contents from Flashdrive1 with COMPUTER1 master library, and then copy the corresponding matched filenames with the desired filetype and appropriate folder structure to FLASHDRIVE2</p>
<p>tl:dr</p>
<p>take contents from:</p>
<pre><code>FLASHDRIVE1
\Artist
\Album
\01 tracktitle.mp3
02 tracktitle.mp3
</code></pre>
<p>find corresponding .flac version with identical file structure and naming scheme, only different file format within:</p>
<pre><code>COMPUTER1
\Artist
\Album
\01 tracktitle.flac
| 02 tracktitle.flac
| 03 tracktitle.flac
</code></pre>
<p>copy to:</p>
<pre><code>FLASHDRIVE2
\Artist
\Album
\01 tracktitle.flac
| 02 tracktitle.flac
</code></pre>
<p>*In this hypothetical, Track 03 being omitted because it does not exist on the Flashdrive1 and therefore do not want it on Flashdrive2</p>
<p>I know that I have to invoke find and set the filetype and that grep would be involved, but I am having trouble coming up with the proper syntax. I have googled for any similar questions but haven't been able to find any that achieve what I am looking to do. If I haven't looked hard enough, feel free to flame me. However help would be greatly appreciated.</p>
| 0non-cybersec
| Stackexchange |
Winding number on a simply connected region. <p>Let $\Omega$ be a simply connected region in $\mathbb{C}$ and $\gamma$ a closed piecewise continuous differentiable path.</p>
<p>Is there an intuitive explanation why the winding number $\mathrm{ind}_\gamma(\alpha)=0$, $\alpha \in \mathbb{C}\backslash \Omega$, on simply connected regions?</p>
| 0non-cybersec
| Stackexchange |
"Healthy" drunk food?. After coming back from a night of drinking I almost always get the munches and will make either pasta or mac & cheese, which isn't good for trying to have a low carb lifestyle. I want to try eating something a little more healthy so I don't feel so guilty when I wake up in the morning. Any suggestions? | 0non-cybersec
| Reddit |
The Absolute MADLAD. | 0non-cybersec
| Reddit |
#wrong. | 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 |
Well played, well played.. | 0non-cybersec
| Reddit |
Screenlet behaves like it has no underlying window. <p>I'm trying to write a screenlet from scratch following this guide <a href="http://www.ibm.com/developerworks/linux/library/l-script-linux-desktop-1/index.html" rel="nofollow">http://www.ibm.com/developerworks/linux/library/l-script-linux-desktop-1/index.html</a>.<br>
I have created the Hello World! example but when testing it I can't click on it, like the screenlet is being drawn directly on the desktop and it has no underlying window. When right-clicking on it the Desktop context menu appears. I tried printing <strong>self.window</strong> and this seems to be a regular <strong>Gtk.Window</strong> object.</p>
| 0non-cybersec
| Stackexchange |
Amidst the techno-optimism prevalent here, the future looks dystopian to me. Extreme inequality awaits us. Those in power will never relenquish it.. The header image for this subreddit is deeply inspiring. The future will enable us to be all that we can be. Suffering will gradually disappear and the fruits of civilization will be abundant.
The bitter truth is that we already live in times where suffering need not exist, and where the relatively few things which really make us happy and healthy could already be abundant.
Fundamentally, it is a question of power. Those who have it recognise that it is a zero-sum game. For true democracy to exist, pretty much everyone currently in a position of authority would have to cede their power to a democratic entity.
Moreover, those who treasure power can never have enough of it. In /r/Futurology, we should recognize that the current structure of society will only be reinforced, deepened and made vastly more efficient by the advances we expect to witness in the next 2-3 decades.
Does anyone really believe life extension technologies will be granted to all, or that the true purpose of the Dept. of Education is really to plant seeds of wisdom and self-realisation? Surely microscopic flying robots and all-seeing drones will serve only to further the interests of those who funded their R&D.
I'd love to hear counter opinions as well as further indications of what I'm talking about. I can't be the only one. | 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 |
Let me just bend over and stab myself in the face. | 0non-cybersec
| Reddit |
U.S. Ambassador Haley Tells U.N. Russia Responsible for Chemical Attack. | 0non-cybersec
| Reddit |
"The Vatican Thinks In Centuries". | 0non-cybersec
| Reddit |
What are best "20" roll stories?. | 0non-cybersec
| Reddit |
A more efficient way to write multiple CASE statements. <pre><code>SELECT CASE WHEN ( Table.COLUMN1) IS NOT NULL THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( Table 1.FULL) END ) IS NOT NULL THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( CASE WHEN Table 3.DO = 'Z' THEN 'Y' END ) END ) IS NOT NULL THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( NVL(( Table2.COLUMN3), ( Table2.COLUMN3 )) ) END ) IS NOT NULL THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( CASE WHEN ( Table 4. COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( NVL(( Table2.COLUMN3), ( Table2.COLUMN3)) ) END ) IS NOT NULL THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( Table 3.FULL) END ) IS NOT NULL THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( ( Table2.COLUMN3) ) END ) IS NOT NULL THEN 1 ELSE 0 END,
CASE WHEN ( CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
then CASE WHEN ( CASE WHEN ( CASE WHEN ( Table.COLUMN1 ) IS NOT NULL AND ( Table.COLUMN2)
IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( ( Table2.COLUMN3) ) END ) IS NOT NULL AND ( Table.COLUMN1) - ( CASE WHEN ( CASE WHEN ( Table.COLUMN1)
IS NOT NULL AND ( Table.COLUMN2) IS NOT NULL
THEN CASE WHEN ( Table.COLUMN1) - ( Table.COLUMN2) >= 180 THEN 'Y' ELSE 'N' END ELSE 'N' END ) = 'Y'
THEN ( ( Table2.COLUMN3) ) END ) < 90 THEN 'Y' ELSE 'N' END END ) = 'Y' THEN 1 ELSE 0 END,
</code></pre>
<p>Is there a more efficient way to write this statement?</p>
| 0non-cybersec
| Stackexchange |
Give PHP a fake request URL and protocol with Apache2 and mod_php. <p>I run a web server with multiple users. The machine provides Apache-based virtual hosts to a bunch of users, who can serve static content or use PHP. No other forms of server-side scripting are available.</p>
<p>Here's how a typical request is handled:</p>
<p><img src="https://i.stack.imgur.com/8ArLj.png" alt="Flow chart of request handling"></p>
<p>HTTPS traffic has its SSL stripped by Pound, which acts as a reverse proxy and forwards the request on to Varnish, which also acts as a reverse proxy, finally forwarding the request on to Apache.</p>
<p>By the time the HTTPS traffic reaches Apache, the protocol, port, and full URL have changed from, say, <code>https://example.com:443/</code> to <code>http://example.com:8443/</code>. This is a result of all the proxies before Apache.</p>
<p>Is there a way I can trick the PHP scripts into thinking the request came from the original URL, port, and protocol, <strong>without modifying the PHP code</strong>?</p>
<p>This is important because the users will wish to run Joomla, WordPress, and other PHP-based CMSes which detect the URL and cause trouble with redirects, links, etc.</p>
<p>I could probably patch <code>mod_php</code> and build it from source with the necessary changes for my specific scenario, but is there a better way to give the PHP scripts fake environmental variables, perhaps via some setting in php.ini?</p>
| 0non-cybersec
| Stackexchange |
Hello Make-up Addicts!. I keep seeing all of these phenomenal make-up photos, and I just HAD to see where they had originated from. I searched far and wide across these lands, and I think I've found the place! I normally do moulage (which is sort of like make-up?) but I have recently wanted to know more than just that. I hope to learn a lot here through all the posts and watch my make-up collection grow.
PS- Sephora is my favorite store too :) | 0non-cybersec
| Reddit |
[A little sad]Hopefully not a repost, This made me literally say, whoa dude.. | 0non-cybersec
| Reddit |
Watch this video Hans - Se Te Nota. | 0non-cybersec
| Reddit |
We still doing Mob Proof Doors? - Impractical. | 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 |
Play Java 2.3.8 deduplicate on sbt-assembly. <p><strong>The question: why is it ignoring the MergeStrategy.first?</strong></p>
<p>I've made a minor application within the Play Framework using version 2.3.8
According to the official documentation you can add the line <code>addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.12.0")</code>to the plugin.sbt and add a few (see code below) to use the <code>activator assembly</code> command.</p>
<p>This seems to be working but there is a deduplicate conflict. This happens strangely with the file ServerWithStop.class. In the build.sbt there is an assembleMergeStrategy for this class. This is an exact copy of the official documentation.</p>
<pre><code>case "play/core/server/ServerWithStop.class" => MergeStrategy.first
case other => (assemblyMergeStrategy in assembly).value(other)
</code></pre>
<p>I've added a few lines that I found to fix the spring.tooling deduplicates (which can be found again in the full sbt).
I understand the principles; its hashing SHA-1 to compare the classes then merge according to the behaviour, I understand that it doesn't understand what to do with the duplicates that seem to be different with ServerWithStop.class.</p>
<p>What I dont understand (and thus the question): why is it ignoring the MergeStrategy.first?</p>
<p>-</p>
<p><em>build.sbt</em></p>
<pre><code>name := """MovieRequest"""
version := "1.0"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache,
javaWs,
"mysql" % "mysql-connector-java" % "5.1.35"
)
mainClass in assembly := Some("play.core.server.NettyServer")
fullClasspath in assembly += Attributed.blank(PlayKeys.playPackageAssets.value)
assemblyExcludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
cp filter {x => x.data.getName.matches("sbt.*") || x.data.getName.matches(".*macros.*")}
}
// Exclude commons-logging because it conflicts with the jcl-over-slf4j
libraryDependencies ~= { _ map {
case m if m.organization == "com.typesafe.play" =>
m.exclude("commons-logging", "commons-logging")
case m => m
}}
assemblyMergeStrategy in assembly := {
case x if Assembly.isConfigFile(x) =>
MergeStrategy.concat
case PathList(ps @ _*) if Assembly.isReadme(ps.last) || Assembly.isLicenseFile(ps.last) =>
MergeStrategy.rename
case PathList("META-INF", xs @ _*) =>
(xs map {_.toLowerCase}) match {
case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) =>
MergeStrategy.discard
case ps @ (x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") =>
MergeStrategy.discard
case "plexus" :: xs =>
MergeStrategy.discard
case "spring.tooling" :: xs =>
MergeStrategy.discard
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case ("spring.schemas" :: Nil) | ("spring.handlers" :: Nil) =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.deduplicate
}
case "asm-license.txt" | "overview.html" => MergeStrategy.discard
// Take the first ServerWithStop because it's packaged into two jars
case "play/core/server/ServerWithStop.class" => MergeStrategy.first
case other => (assemblyMergeStrategy in assembly).value(other)
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Orson Scott Card talks Ender’s Game in rare interview. | 0non-cybersec
| Reddit |
Duplication of a file descriptor associated with an fcntl lock?. <p>According to the man page of <code>dup2</code>, this syscall make a new copy of the old file descriptor. The two descriptors do not share (the close-on-exec flag).</p>
<p>However in case the file descriptor we are trying to duplicate has an fcntl lock associated with it, does the new file descriptor get a new lock ? </p>
| 0non-cybersec
| Stackexchange |
Maximum area of convex quadrilateral in convex polygon. <p>I’m wondering if we can say anything about the following situation: Given a convex polygon $P$, you want to draw a convex quadrilateral $Q$ which is contained in $P$. You want to maximize the ratio $\dfrac{\text{Area }Q}{\text{Area }P}$. What is the minimum ratio that you can always achieve, no matter what $P$ is? Or can you not guarantee anything better than zero?</p>
| 0non-cybersec
| Stackexchange |
Why does operator[] only take one argument?. <p>There are plenty of questions related to operator[] only taking one argument, but I can't find one that actually says why.</p>
<p>For example, it seems a very natural extension of the language to have <code>matrix[0, 3]</code> call an <code>ElementT& operator[](SizeT x, SizeT y)</code> function.</p>
<p>Is there any particular reason (e.g. incompatibility) that this syntax isn't in the language, or anything besides lack of motivation actually preventing it from being added?</p>
<p>(Note: This has been marked a duplicate, but it is not. This question is "why isn't this syntax in the language?" not "how do I work around the issue?". As mentioned, there are plenty of questions that address the latter, but none that answer the former.)</p>
| 0non-cybersec
| Stackexchange |
What are benefits and downsides of unprivileged containers?. <p>The technical explanation of <a href="https://unix.stackexchange.com/questions/177030/what-is-an-unprivileged-lxc-container">what is unprivileged container</a> is quite good. However, it is not for ordinary PC user. Is there a simple answer when and why people should use unpriviliged containers, and what are their benefits and downsides?</p>
| 0non-cybersec
| Stackexchange |
Trudeau Reaches His Breaking Point With Trump. | 0non-cybersec
| Reddit |
Pancakes in Japan are far superior than anywhere else. | 0non-cybersec
| Reddit |
YSK about flvto.com, a free website that rips and downloads audio from YouTube videos. | 0non-cybersec
| Reddit |
Popular Overseas Tourist Scams (x-post from r/everymanshouldknow). | 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 |
Prove that $Lip [a,b]^{\circ}=\emptyset$. <p>Let $Lip[a,b]=\{f \in C[a,b] : \exists k>0, |f(x)-f(y)|\leq k|x-y|\}$, Prove that $Lip[a,b]^{\circ}=\emptyset$ in $C[a,b]$.</p>
<p>Suppose there exists $f \in Lip[a,b]^{\circ}$, then $\exists \delta>0$: $B(f,\delta) \subset Lip[a,b]$. Now, I am trying to construct a function $g \in C[a,b] : g \in B(f,\delta)$ but for every $k>0$, there are $x,y$ : $|f(x)-f(y)|> k|x-y|$. Can anyone give me an idea on how to construct or find a function that satisfies this? </p>
| 0non-cybersec
| Stackexchange |
Appendices as sections in TOC using memoir class. <p>While using the memoir class, I would like to show my appendices as:
<a href="https://i.stack.imgur.com/GUUte.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GUUte.png" alt="enter image description here"></a>
Like in the image, I want the individual appendices as sections under the common header "Appendices".</p>
<p>My simplified code is as follows:</p>
<pre><code>\documentclass[11pt,a4paper,twoside,openright]{memoir}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\chapter{First Chapter}
\lipsum[1]
\section{First Section}
\section{Second Section}
\appendixpage
\begin{appendices}
\makeatletter
\addtocontents{toc}{%
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection}
\makeatother
\chapter{First Appendix}
\chapter{Second Appendix}
\addtocontents{toc}{\endgroup}
\end{appendices}
\end{document}
</code></pre>
<p>However, I get the following:</p>
<p><a href="https://i.stack.imgur.com/9wX88.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9wX88.png" alt="enter image description here"></a></p>
<p>Are there any solutions for getting the appendix format indicated before?</p>
<p>Thank you</p>
<p>EDIT: Added simplified code, added my result, eliminated other code</p>
| 0non-cybersec
| Stackexchange |
Most efficient way to count rows of a query. <p>I'm using Hibernate to retrieve the number of rows for a specific query. Let's say I have a table called 'Person' with various columns. One of those columns is 'name'.</p>
<p>If I wanted to get the number of people with the name of 'Andrew', which of these ways would be most efficient? Assuming there is a performance difference between some/all of them. Is there a better way to do this using Hibernate/SQL?</p>
<p>(1) Select all columns</p>
<pre><code>Query query = session.createQuery("from Person where name= :name");
query.setParameter("name", name);
List result = query.list();
int count = result.size();
</code></pre>
<p>(2) Select just the name column</p>
<pre><code>Query query = session.createQuery("select name from Person where name= :name");
query.setParameter("name", name);
List result = query.list();
int count = result.size();
</code></pre>
<p>(3) Using Count in the query</p>
<pre><code>Query query = session.createQuery("select count(*) from Person where name= :name");
query.setParameter("name", name);
long count = (Long) query.uniqueResult();
</code></pre>
<p>(4) Using Count with the name column in the query</p>
<pre><code>Query query = session.createQuery("select count(name) from Person where name= :name");
query.setParameter("name", name);
long count = (Long) query.uniqueResult();
</code></pre>
<p>Edit: Sorry, I had two number 3's in my list</p>
| 0non-cybersec
| Stackexchange |
Guy tries to rob a bank that has an armed security guard on duty. Doesn't end well for the robber.. | 0non-cybersec
| Reddit |
Batman came for a visit today. | 0non-cybersec
| Reddit |
If $\frac{\sin^4 x}{a}+\frac{\cos^4 x}{b}=\frac{1}{a+b}$, then show that $\frac{\sin^6 x}{a^2}+\frac{\cos^6 x}{b^2}=\frac{1}{(a+b)^2}$. <blockquote>
<p>If $\frac{\sin^4 x}{a}+\frac{\cos^4 x}{b}=\frac{1}{a+b}$, then show that $\frac{\sin^6 x}{a^2}+\frac{\cos^6 x}{b^2}=\frac{1}{(a+b)^2}$ </p>
</blockquote>
<p>My work:<br>
$(\frac{\sin^4 x}{a}+\frac{\cos^4 x}{b})=\frac{1}{a+b}$<br>
By squaring both sides, we get,<br>
$\frac{\sin^8 x}{a^2}+\frac{\cos^8 x}{b^2}+2\frac{\sin^4 x \cos^4 x}{ab}=\frac{1}{(a+b)^2}$<br>
$\frac{\sin^6 x}{a^2}+\frac{\cos^6 x}{b^2}-2\frac{\sin^4 x \cos^4 x}{ab}-\frac{\sin^6 x \cos^2 x}{a^2}-\frac{\sin^2 x \cos^6 x}{b^2}=\frac{1}{(a+b)^2}$<br>
So, now, we have to prove that,<br>
$-2\frac{\sin^4 x \cos^4 x}{ab}-\frac{\sin^6 x \cos^2 x}{a^2}-\frac{\sin^2 x \cos^6 x}{b^2}=0$<br>
I cannot do this. Please help!</p>
| 0non-cybersec
| Stackexchange |
Coset representatives when a subgroup $H$ is not normal.. <p>Let <span class="math-container">$G$</span> be a group and let <span class="math-container">$H$</span> be a subgroup of <span class="math-container">$G$</span>. </p>
<p>If <span class="math-container">$H$</span> is normal then the set of all left coset representatives is the same as the set of all right coset representatives. </p>
<p>If <span class="math-container">$H$</span> is not normal, does there exist a set of left coset representatives which happens to also be a right coset representatives?</p>
| 0non-cybersec
| Stackexchange |
Stackblitz: How to import Bootstrap CSS framework. <p>I just found the amazing <strong>Stackblitz</strong> online VS Code editor.
I created an Angular project and under dependencies installed the Bootstrap CSS framework but how should I import Bootstrap in to my project?
Usually I do it by adding this line of code to <strong>angular-cli.json</strong>:</p>
<pre><code>"../node_modules/bootstrap/dist/css/bootstrap.min.css"
</code></pre>
<p>But how does it work on Stackblitz?</p>
<p>Thanks</p>
| 0non-cybersec
| Stackexchange |
Hey, I think you have something on your... wait, that's your... your.... | 0non-cybersec
| Reddit |
Whoa, anyone know who this guy is?. | 0non-cybersec
| Reddit |
An eigen value problem. <p>Let $A$ be a $3×3$ matrix with $\operatorname{trace} (A) = 3$ and $\det (A) = 2$. If $1$ is an eigenvalue of $A$, then what are the eigenvalues of the matrix $A^2 - 2I$?</p>
| 0non-cybersec
| Stackexchange |
GitHub keeps throwing "Could not commit submodules" error, and I don't see why that is. Any ideas?. <p>I'm trying to put my project on GitHub, but I keep running into an issue. I made a repo on GitHub (the website), downloaded the client, cloned (dragged and dropped the link GitHub gave me basically) it in, moved my project in the clone directory, and I still didn't see the files. So I checked under "Changes", and found my project files. Now it's saying "Could not commit submodules". How do I fix this?</p>
<p>Here's a screenshot if anyone needs it:</p>
<p><a href="https://i.stack.imgur.com/E2jpI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/E2jpI.png" alt="Error"></a></p>
<p>Due to being too long here is <a href="http://pastebin.com/FgHTWA3Y" rel="noreferrer">the log in its entirety</a>.</p>
| 0non-cybersec
| Stackexchange |
Constructing a computably infinite tree with no computable infinite branches using PA. <p>Define an infinite tree as any set of sequences closed under prefix restriction, i.e. any prefix restriction of a sequence in the set is also in the set, where a prefix restriction is a restritcion of the original sequence to an initial segment of it (the prefix). In our case, we are interested mainly in countable trees, so we may take trees to be sequences of natural numbers closed under restriction. A computable tree is a tree such that there is an algorithm for computing, for each sequence, if it belongs to the tree. Finally, a branch through a tree is an infinite sequence such that each finite prefix of this sequence is in the tree. (I hope these definitions are correct; I'm still getting used to working with trees)</p>
<p>It is well-known that it is possible to construct an infinite computable tree such that none of its branches are computable, e.g., the Kleene tree. However, I remember reading somewhere that another way of constructing such a tree would be to use Peano Arithmetic; something to the effect that the tree would consist of formulas of PA, and if one could compute every branch, this would imply the decidability of PA. Unfortunately, I don't remember where I read this and I couldn't reconstruct the proof by myself. Does this strategy sound plausible? If so, could anyone help me to reconstruct this proof?</p>
| 0non-cybersec
| Stackexchange |
Yao Ming visited my girlfriends restaurant, she's 4'11. | 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 |
Install Click build targets in Terminal. <p>The recommended/normal procedure is to install click build targets in Ubuntu SDK but I wanted to know if it's possible to install them in terminal.</p>
| 0non-cybersec
| Stackexchange |
This Garage has met a beggar or two. | 0non-cybersec
| Reddit |
What are some of the most "shining" examples of usage of LaTeX. <p>I was wondering what are the "creative limits" of LaTeX. I've seen many beautifully typeset documents, books, scientific papers, which are of the highest quality, both aesthetically and in respect to content. After all, LaTeX <strong>is</strong> the best typesetting system in my opinion — overwhelming amount of amazing works written in it is therefore no surprise. I've even seen it put to work when constructing <em>facsimile</em> of a medieval manuscript.</p>
<p>But I am convinced I haven't seen it all. Please link me some of the best works ('best' as in the best overall aesthetics, "cleaneness" of the final product) done with this superb piece of software. As an example of a brilliant scientific paper, I must link <a href="https://arxiv.org/pdf/1509.06811.pdf" rel="nofollow noreferrer">this</a> paper — the amount of attention to detail and hard work that went into this article is astonishing (and further demonstrated the power of <a href="https://ctan.org/pkg/tqft" rel="nofollow noreferrer"><code>tqft</code></a> package). Of course I accept literary works typeset with LaTeX with open arms as well. Thank you for your suggestions in advance.</p>
| 0non-cybersec
| Stackexchange |
Cop gives kid a drinking ticket and party goers immediately pitch in to help him pay it off.. | 0non-cybersec
| Reddit |
400 vs 422 for Client Error Request. <p>I've read a lot of posts and articles regarding proper http status code to return for client request error.
Others suggest to use 400 as it has been redefined in <a href="https://tools.ietf.org/html/rfc7231#section-6.5.1" rel="noreferrer">RFC 7231</a> though I'm not sure if the example given covers all the client error in my mind because the examples are syntactic. </p>
<blockquote>
<p>The 400 (Bad Request) status code indicates that the server cannot or
will not process the request due to something that is perceived to be
a client error (e.g., malformed request syntax, invalid request<br>
message framing, or deceptive request routing).</p>
</blockquote>
<p>I did find this statement in the Appendix B of the rfc 7231:</p>
<blockquote>
<p>The 400 (Bad Request) status code has been relaxed so that it isn't<br>
limited to syntax errors. (Section 6.5.1)</p>
</blockquote>
<p>Does this mean that I can consider any type of client error a bad request? Would it be better to use 400 for client requests and just specify a more specific error in the message?</p>
<p><br>
On the other hand, others say that it's better to use 422 (Unprocessable Entity). While this is more focused on semantics, it's only listed in <a href="https://tools.ietf.org/html/rfc4918" rel="noreferrer">RFC 4918</a> which is a webDAV extension for http/1.1</p>
<blockquote>
<p>The 422 (Unprocessable Entity) status code means the server<br>
understands the content type of the request entity (hence a<br>
415(Unsupported Media Type) status code is inappropriate), and the<br>
syntax of the request entity is correct (thus a 400 (Bad Request)<br>
status code is inappropriate) but was unable to process the contained
instructions. For example, this error condition may occur if an XML<br>
request body contains well-formed (i.e., syntactically correct), but<br>
semantically erroneous, XML instructions.</p>
</blockquote>
<p>Can I use this webDAV extension codes to handle my http requests? In the case of 422, can I use it even though it's not in the core http codes. <br></p>
<p>Should I use 400 or 422 for my client error?</p>
<p>Here are the possible client error I have in mind:</p>
<pre><code>1.) Invalid parameter. The client provided parameters but are found invalid. Example: I said that the userId is 1, but when I checked there's no userId of 1. Another example of invalid parameter is wrong data type.
2.) Missing required parameters
3.) Let's say I need to hash a value based on given params and it failed
4.) Blocked content is being used. Like, i want to apply for membership and i passed the userId of 1. However, userId of one is blocked / deactivated
5.) When I try to delete an entry but the entry is still being used in another table.
6.) Let's say i require a signature in my payload and the signature does not match when recalculated in the backend
7.) Let's say I have a value that counts a specific attribute like "shares" and it has reached the maximum value like 10.
etc...
</code></pre>
<p><br>
Any informative response will be highly appreciated. Thanks a lot, guys!</p>
<p>Update: I checked google api errors and they are not using 422. On the other hand, Twitter uses 422. I'm more confused than ever >.< Though there's a part of me that thinks 400 is the better choice as it is included in the RFC doc and 422 is not. I could be wrong though.</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 |
Network Traffic Log. <p>Background - On my "home" network I have a Linksys WTR45GL router providing my internet access as well as a wireless AP. </p>
<p>Connected I have
* 2 Windows PCs (wired)
* At least one laptop (Wired)
* Some 802.11 enabled handheld consoles (PSPs)
* A Nintendo Wii
* Some windows XP pcs used by the people in the granny flat.</p>
<p>Where I live, South Africa, well, 1Gb worth of monthly cap is, while not expensive, costly enough that I'd like to be sure that all the bandwidth used by devices on my network is ... well ... legitimate and not the result of neighbors parasiting my wireless, malware or just the result of "liberal" download policies in my software.</p>
<p>I got the Linksys WRT45GL on the understanding that there were custom firmwares (DD-WRT and Tomato) that allowed bandwidth tracking, but there doesn't seem to be any facility to get a log of traffic that can be examined to see (a) which local devices were the biggest consumers of bandwidth and (b) what they were connected to.</p>
<p>What tools are there for logging traffic such that, when it gets to that OMG moment in the month when all my bandwidth is gone, I have a chance to find out what used it all up (and hopefully attempt some corrective action).</p>
<hr>
<p>Solutions I have tried:</p>
<ol>
<li><p><a href="http://oss.oetiker.ch/mrtg/" rel="nofollow noreferrer">MRTG</a> - Installation of MRTG is complicated. It needs to install on a server PC - i.e. one running a web server. It's also "limited" to doing SNMP monitoring - which means it can only report on aggregate traffic per interface. Yay - I can confirm that there is Gb of traffic traversing my router. I already knew that!</p></li>
<li><p><a href="http://www.paessler.com/prtg/" rel="nofollow noreferrer">PRTG</a>'s free version is too limited to do anything useful with. Or the 'sensors' its suports are too limited. In addition to SNMP trapping it does packet sniffing, but still the capability to drill down in its reports is lacking. At least it can break down traffic a bit by protocol. So now I know that 80% of my traffic is HTTP. Still no idea what the sources and destinations are of the HTTP traffic. Also entirely unclear if its capable of measuring traffic over a not-well-know-port.</p></li>
<li><p><a href="http://www.dd-wrt.com/wiki/index.php/Using_RFlow_Collector_and_MySQL_To_Gather_Traffic_Information" rel="nofollow noreferrer">This Wiki Page</a> details how to (a) configure DD-WRT to broadcast traffic using RFlow and MACudp to a server on the network. (b) The server needs to be running RFlowCollector which captures the data, allows limited examination of the data, and (c) puts it in a mySQL database - where it can then be analysed with 3rd party tools - or (d) just MSQL Query Analyzer.</p></li>
</ol>
<p>Except for the fact that RFlowCollector is a badly written windows GUI app with no option to install as a service: Meaning that it can only capture data as long as <em>I</em> am physically logged in. Oh yes, and it uses 60% of my CPU even when theres noting being logged. Its own UI can't do any drill down analysis of the data (but does tease), so at the end of all this I'm left with a large mySQL database of 'raw' captured data to analyse.</p>
<ol start="4">
<li><a href="http://www.wireshark.org/" rel="nofollow noreferrer">Wireshark</a> has also been suggested. As a network protocol analyser it certainly gives the low level details - as long as I'm on the correct network segment Wireshark can be used to sniff and produce a comprehensive list of all the tcp and udp traffic. Which is a problem. Wireshark is just too low level. Theres too much data.</li>
</ol>
<p>Is it really this hard to try and do a simple analysis of a networks bandwidth? And by simple I mean, given a "chunk" of bandwidth usage on my router, ask something to tell me assign it to (a) local hosts, (b) remote hosts and (c) by protocol.</p>
| 0non-cybersec
| Stackexchange |
[Spoilers] Ore Monogatari!! - Episode 5 [Discussion]. **Episode title:** I'm Dense
**MyAnimeList:** [Ore Monogatari!!](http://myanimelist.net/anime/28297/Ore_Monogatari!!)
**Crunchyroll:** [MY love STORY!!](http://www.crunchyroll.com/media-678425)
**Episode duration:** 22 minutes and 52 seconds
---
**Previous episodes:**
|**Episode**|**Reddit Link**|
|:--|:-:|:--
|Episode 1|[Link](http://redd.it/31wnm0)|
|Episode 2|[Link](http://redd.it/32ps6j)|
|Episode 3|[Link](http://redd.it/33i8fd)|
|Episode 4|[Link](http://redd.it/34b31l)|
---
**Reminder:** Please do not discuss any plot points which haven't appeared in the anime yet. Try not to confirm or deny any theories, encourage people to read the source material instead. Minor spoilers are generally ok but should be tagged accordingly. Failing to comply with the rules may result in your comment being removed.
---
**Keywords:** my love story!!
---
This post is made by a bot. Any feedback is welcome and can be sent to /u/Shadoxfix. | 0non-cybersec
| Reddit |
Am I late to the Night Sky Petunia Party?. | 0non-cybersec
| Reddit |
Beyond Skyrim: Three Kingdoms Announcement. | 0non-cybersec
| Reddit |
The man who wasn't there. Just a creepy poem I like:
Yesterday, upon the stair,
I met a man who wasn’t there
He wasn’t there again today
I wish, I wish he’d go away...
When I came home last night at three
The man was waiting there for me
But when I looked around the hall
I couldn’t see him there at all!
Go away, go away, don’t you come back any more!
Go away, go away, and please don’t slam the door... (slam!)
Last night I saw upon the stair
A little man who wasn’t there
He wasn’t there again today
Oh, how I wish he’d go away | 0non-cybersec
| Reddit |
Tiny moon Despina casts it's shadow on Neptune.. | 0non-cybersec
| Reddit |
Converse Leather Boot Sneaker $29.99 (Usually $70). | 0non-cybersec
| Reddit |
Express number of ways integer can be written as coefficient in generating series. <p>Question:
"Express the number of ways that an integer $n$ can be written as a sum of a cube of an integer $s\ge-1$ plus the fourth power of an integer $t$ plus the square of an odd integer $r$ as a certain coefficient in an appropriate generating series."</p>
<p>So trying to simplify this convoluted question I arrive at:</p>
<p>Express the number of ways that an integer $n$ can be written as a sum of $s^3+t^4+r^2$ where$ -1\lt s \lt Z,t\in Z,r\in Zodd$ as a certain coefficient in an appropriate generating series. (where $Z$ is all integers).</p>
<p>So I believe that the sum would be something similar to</p>
<p>$$\sum_{n=0}^\infty c_n(s^3+t^4+r^2)\ . $$</p>
<p>I think that what it's asking me to do after this is determine the coefficient $c_n$ so that it is the number of combinations of $s,j,r$ so that $(s^3+t^4+r^2) = n$. I'm not sure how to go about this, if I'm even on the right track, or how the constraints on $s,j,r$ would come into play. </p>
<p>Any help would be much appreciated, thank you.</p>
| 0non-cybersec
| Stackexchange |
Determine FLOPS of our ASM program. <p>We had to implement an ASM program for multiplying sparse matrices in the coordinate scheme format (COOS) as well as in the compressed row format (CSR). Now that we have implemented all these algorithms we want to know how much more performant they are in contrast to the usual matrix multiplication. We already implemented code to measure the running time of all these algorithms but now we decided that we also want to know how many floating points operations per seconds (FLOPS) we can perform.
Any suggestion of how to measure/count this?</p>
<p>Here some background information on the used system:</p>
<pre><code>processor : 0
model name : ARMv7 Processor rev 2 (v7l)
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2
</code></pre>
<p>Our first idea was now to implement a kind of FPO counter which we increment after each floating point operation (Arithmetic operations as well as comparison and move operations), but that would mean that we have to insert increment operations all over our code which also slows down the application ...
Does anyone know if there is some kind of hardware counter which counts the number of floating point operations or maybe if there exist some kind of performance tool which can be used to monitor our program and measures the number of FPOs.
Any suggestions or pointers would be appreciated.</p>
<p>Here is the evaluation of the FLOPs for a matrix multiplication by using the counting approach. We first measured the running time than inserted counters for each instruction we were interested in and after that we calculated the number of floating point operations per second.
<img src="https://i.stack.imgur.com/d1GKJ.png" alt="Floating point operations per second for matrix multiplication"></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 |
Philip Rivers suffers hand injury during week 9 Miami game.. | 0non-cybersec
| Reddit |
What's the oldest MacBook Pro that has the Meltdown/Spectre patches?. <p>I currently have a 2014 MacBook Pro, but it needs to go in for service and, rather than renting one for a week, I was thinking of buying a cheap backup (maybe from 2011 or 2012). What is the oldest model that would incorporate Intel's complete set of patches for Meltdown/Spectre (aka Speculative Store Bypass Variants 1–3)? </p>
<p>According to what I've read (see details and sources, below), patches are available from Intel for the chips used in the 2010 and later 15"/17" MBP's, and for the 2011 and later 13" MBPs.</p>
<p>[DETAILS AND SOURCES: According to Intel's patch guidance (<a href="https://newsroom.intel.com/wp-content/uploads/sites/11/2018/04/microcode-update-guidance.pdf" rel="nofollow noreferrer">https://newsroom.intel.com/wp-content/uploads/sites/11/2018/04/microcode-update-guidance.pdf</a>), patches have been offered for Sandy Bridge and Arrandale, but not for Penryn. And according to <a href="https://en.wikipedia.org/wiki/MacBook_Pro" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/MacBook_Pro</a> (go to "Table of second generation MacBook Pro models" and click "Show"), the 2011's all use Sandy Bridge. With the 2010's, it gets a bit tricky: The 2010 MBP's used either 2.4 GHz (P8600) or 2.66 GHz (P8800) Penryn chips; or 2.4 GHz (520M), 2.53 GHz (540M), or 2.66 GHz (620M) Arrandale chips. And, according to <a href="https://everymac.com/systems/apple/macbook_pro/macbook-pro-unibody-faq/differences-between-macbook-pro-13-15-17-inch-early-2011-and-mid-2010.html" rel="nofollow noreferrer">https://everymac.com/systems/apple/macbook_pro/macbook-pro-unibody-faq/differences-between-macbook-pro-13-15-17-inch-early-2011-and-mid-2010.html</a>, the Penryns are in the 13", while the Arrandles are in the 15"/17"; if that's correct, patches are available for the chips used in the 2010 15"/17" models, but not the 2010 13" ones. The models from 2009 and earlier all use Penryn or earlier, so none of these are patched.]</p>
<p>However, it's not sufficient that Intel offers the patches. It also needs to be the case that Apple has incorporated those patches into the latest OS the chip family is capable of running. According to this chart (<a href="https://www.apple.com/lae/macos/how-to-upgrade/#hardware-requirements" rel="nofollow noreferrer">https://www.apple.com/lae/macos/how-to-upgrade/#hardware-requirements</a>), one can run High Sierra on all MBP's from 2010 onward. But that doesn't necessarily mean that Apple, within High Sierra, has made available patches going as far back as possible (i.e., that High Sierra contains Intel's Sandy Bridge & Arrandale patches). I assume it has, but I'd like confirmation.</p>
<p>Further, there's a practical performance question: I've not noticed a performance difference with the patch on my mid-2014 MBP. But is the <em>percentage</em> degradation in performance significantly higher with older chips? ["We may see a marginal impact and take a bit of a hit, but the newer processors don't have a huge loss. Older processors have more of an impact." ——John Michener, Chief Scientist, Casaba Security. Source: <a href="https://www.wired.com/story/meltdown-and-spectre-patches-take-toll/" rel="nofollow noreferrer">https://www.wired.com/story/meltdown-and-spectre-patches-take-toll/</a> ] [I don't know if he means that older processors show more percentage degradation, or simply that older processors, being slower to start with, have less performance headroom.]</p>
<p>Pragmatically, I'd like it to be decently-usable (rather than marginally usable) with Office 365 (even my top-of-the-line 2.8 GHz mid-2014 15" model struggles a bit with Office).</p>
| 0non-cybersec
| Stackexchange |
My all-time favorite line in a video game. | 0non-cybersec
| Reddit |
‘Extremely abominable’: Chinese gene-editing scientist faces law. | 0non-cybersec
| Reddit |
Question on $\mathcal{L}(\Omega, \mathcal{A}, P) \subseteq \mathcal{L}(\Omega, \mathcal{F}, P)$. <p>Let <span class="math-container">$\mathcal{A}\subseteq \mathcal{F}$</span> be sigma-algebras, then <span class="math-container">$\mathcal{L}(\Omega, \mathcal{A}, P) \subseteq \mathcal{L}(\Omega, \mathcal{F}, P)$</span>. But then for any <span class="math-container">$f\in \mathcal{L}(\Omega, \mathcal{A}, P)$</span>, this obviously means that <span class="math-container">$f\in \mathcal{L}(\Omega, \mathcal{F}, P)$</span>. Let's say there exists an event <span class="math-container">$B \in \mathcal{F}$</span> but <span class="math-container">$B \notin \mathcal{A}$</span></p>
<p>Surely I can then not evaluate <span class="math-container">$\int_{B}f(x)dx$</span> since <span class="math-container">$f\in \mathcal{L}(\Omega, \mathcal{A}, P)$</span> and <span class="math-container">$B \notin \mathcal{A}$</span>, in other words <span class="math-container">$f ^{-1}(B)=\varnothing$</span></p>
<p>but <span class="math-container">$f$</span> is also in <span class="math-container">$\mathcal{L}(\Omega, \mathcal{F}, P)$</span> so surely this is a contradiction?</p>
| 0non-cybersec
| Stackexchange |
My friend just sent me this on snap and I'm not sure how to feel about it. | 0non-cybersec
| Reddit |
First time on TV. | 0non-cybersec
| Reddit |
How do I enable the Ruby 2.3 `--enable-frozen-string-literal` globally in Rails?. <p>I am building a greenfield Rails application on top of Ruby 2.3, and I would like all Rails commands (e.g. <code>rails s</code>, <code>rails c</code>) and all Ruby commands (e.g. <code>rake do:something</code>) to use the new immutable-String functionality introduced in Ruby 2.3. (See, e.g. <a href="https://wyeworks.com/blog/2015/12/1/immutable-strings-in-ruby-2-dot-3/" rel="noreferrer">https://wyeworks.com/blog/2015/12/1/immutable-strings-in-ruby-2-dot-3/</a>)</p>
<p>So, how do I pass that lovely <code>--enable-frozen-string-literal</code> Ruby option down to Ruby in all possible contexts where some command I issue bottoms out in Ruby?</p>
<p>Thanks in advance!</p>
| 0non-cybersec
| Stackexchange |
Linux booting error (all distro). <p>I used to have a Windows Seven and Archlinux dual boot system, then I tried erasing my disk and installing only an Archlinux distribution. After I finished preparing everything (I made dozens of Archlinux installations before, it is not a newbie error) when I tried to boot up my fresh system my Dell Laptop froze on this screen: <a href="http://past.is/gxXe" rel="nofollow noreferrer">http://past.is/gxXe</a> .
I tried installing Gentoo Linux with the exact same result. I finally tried using an Ubuntu LiveCD and did not make it to the live environment and froze on the same screen.
Is there something fatally wrong with my computer? If yes, what is the component failing? My Hard drive? My CPU? </p>
| 0non-cybersec
| Stackexchange |
Stability of a set under multiplication and conjugaison / Inversible elements of a set. <p>Let $j=e^{2i\pi/3}$.
How can I prove that the set $A=\mathbb{Z}+j\mathbb{Z}$ is stable under multiplication and conjugaison ?
If I understood the question well, I need to prove the following :</p>
<p>a)If $x$ and $y$ are two elements of $A$, then $xy$ is also an element of A.</p>
<p>b)If $x$ is an element of $A$, so is $\bar x$.</p>
<p>For a), I tried basic multiplication stuff but could'nt write the result as $a+bj$ with $a$ and $b$ integers. And similarly for b).</p>
<p>And another problem I would like to solve is to find all inversible elements of $A$ ?</p>
| 0non-cybersec
| Stackexchange |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.