text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
President Obama faces stiff resistance from the public to a military attack, with a new Pew Research Center poll revealing that 48 percent oppose and only 29 percent approve of U.S. retaliation for Syria’s use of chemical weapons..
0non-cybersec
Reddit
Married women: What is the one thing/dream you wish your husband would do for you sexually?[Fantasy].
0non-cybersec
Reddit
Check out the first 20 minutes of RAGE on the PS3!.
0non-cybersec
Reddit
DM as an unreliable narrator. I have begun experimenting with this idea, accidentally at first, but then the possibilities started to interest me and I might make more use of it in the future. However, I think it's something players may either find fun or absolutely hate. It all started when a player vampire had his vampire masking necklace removed.... Ok, ok a little more backstory. One of my players wanted to play a vampire in my Strahd campaign for rp purposes. I agreed (because his four page backstory was pretty sweet) under condition that he must at all times wear a special medallion that basically turns off his vampirism and that should the medallion, also his holy symbol, ever be removed where Strahd or his spies could see, that the jealous Strahd would immediately hunt him down and kill him... seemed fair, he got his rp wish and I got to not deal with PC vampire cheese. He agreed to my terms. But then the inevitable happened. ...luckily, at the time the vampire pc was alone in a room with the npc who had cast a hold person spell on him and then removed the necklace, as the only thing of value the pc had on him. The player asked if he was still held by the spell now that he was a vampire and I reasoned that he was not so he charmed the npc, took his necklace back and left... Yeh I thought it was nice of him too. Actually too nice, and I remembered a line in the MM that says a DM may take control of a vampire pc, so I hatched a plan. The first character the player came across I described as looking cautious and asking if he was ok. Player shrugged it off and went to the Inn wherein the Innkeepers again asked if he needed medical attention. At this point he says, 'I look myself over' to which I replied, 'you are covered in blood'. Soon after he found himself accused of the vicious murder and mutilation of the npc that tried to take his medallion. Confronted with the evidence he realized that things that he thought transpired when the necklace was removed were not to be trusted. I'm curious what others, both players and DMs, think of the idea that the DM can be an unreliable narrator. Would it be permissible to do this in certain campaigns especially those dealing with eldritch horror or madness or would you feel like it betrays the necessary trust PCs have with the DM or it takes too much away from player agency? Was this interesting plot development or just a cheap retcon on my part?
0non-cybersec
Reddit
How do you cure a clogged nose?. I've been relatively nose-air-free since about 2 months ago, and I cannot take it any more. Heck, even over-the-counter decongestants don't work on me! Is there anything I can do to mitigate this botheration?
0non-cybersec
Reddit
When is a power series of two variables formally a rational function?. <p>If we have a (formal) power series of two variables with positive coefficients. Is there any necessary and sufficient condition for this to be (formally) a rational function?</p>
0non-cybersec
Stackexchange
Who doesn’t hate mosquitoes.
0non-cybersec
Reddit
Override the class patch with method patch (decorator). <p>I have several test methods in a class that use one type of patching for a object, so I have patched with class decorator. For a single another method i want to patch the same object differently. I tried the following approach, but the patch made as class decorator is in effect despite the method itself being decorated with different patch. I expected method patch to override class patch. Why is this not the case?</p> <p>In this particular case I can remove class patch and patch individual methods, but that would be repetitive. How can I implement such overriding (method overrides class patch) mechanism? </p> <pre><code>from unittest TestCase from unittest import mock @mock.patch('my_module.cls.method', mock.Mock(side_effect=RuntimeError('testing')) class SwitchViewTest(TestCase): def test_use_class_patching(self): # several other methods like this # test code .. @mock.patch('my_module.cls.method', mock.Mock(side_effect=RuntimeError('custom')) def test_override_class_patching(self): # test code ... </code></pre>
0non-cybersec
Stackexchange
[50/50] Ninja Cat with Crazy Hops (SFW) | Drunk Guy Falls Down the Stairs and Breaks Neck (NSFW).
0non-cybersec
Reddit
Heidegger in the Kitchen.
0non-cybersec
Reddit
How to unread a line in python. <p>I am new to Python (2.6), and have a situation where I need to un-read a line I just read from a file. Here's basically what I am doing.</p> <pre><code> for line in file: print line file.seek(-len(line),1) zz = file.readline() print zz </code></pre> <p>However I notice that "zz" and "line" are not the same. Where am I going wrong? </p> <p>Thanks.</p>
0non-cybersec
Stackexchange
How to resend a request for a recommendation on LinkedIn?. <p>I keep getting this message when I click on request a recommendation:</p> <blockquote> <p>You have already sent George a recommendation request for this position</p> </blockquote> <p>How can I resend it?</p>
0non-cybersec
Stackexchange
Any working admob tutorial for Phonegap in Android. <p>I tried to find few tutorials to implement Admob within my Phonegap app (Admob is NOT supporting mobile sites anymore). I tried these tutorials:<br> - <a href="http://wiki.phonegap.com/w/page/51172827/HOW%20TO%3a%20Add%20admob%20ads%20to%20your%20phonegap%20application">Adding admob ads to your phonegap application</a><br> - <a href="https://developers.google.com/mobile-ads-sdk/docs/android/fundamentals">Google AdMob Ads Android Fundamentals</a> </p> <p>These are not working in Phonegap V1.8.<br> Is there any working solution or an alternative for this?</p>
0non-cybersec
Stackexchange
Office 365 E3 with Exchange Hosted Encryption (EHE). <p>I have a client who wants to move to Office 365.</p> <p>They are currently running on a trial of Office 365 E3 plan.</p> <p>My staff are now also using Office 365 E3 via the internal use licenses provided as part of the MS Cloud Partner benefits.</p> <p>We've search high and low, spoken to about 15 different people at Office 365 Support, as well as my local distributor's MS Product Manager, but we cannot seem to find out exactly how to purchase/subscribe to the Exchange Hosted Encryption (EHE) service, or how to configure/use it from Office 365.</p> <p>Does anybody out there have any insight into how we can setup and use the EHE service?</p>
0non-cybersec
Stackexchange
Pound puppy turned police 'porn dog'.
1cybersec
Reddit
Here's a conversation I just had with my fiance who is talking in his sleep. He was talking about fishing at first then our cat, Nef, sneezed Me: "do you love nef?" Him: "yes" Me: "do you love me?" Him: "mmpphhh" Me: "...... So do you love me?" Him: "mmpphhh" Me: "do you love nef more than me?" Him: "yes" Me: "am I close?" Him "no"
0non-cybersec
Reddit
Do background processes get a SIGHUP when logging off?. <p>This is a followup to <a href="https://serverfault.com/questions/115999">this question</a>.</p> <p>I've run some more tests; looks like it really doesn't matter if this is done at the physical console or via SSH, neither does this happen only with SCP; I also tested it with <code>cat /dev/zero &gt; /dev/null</code>. The behaviour is exactly the same:</p> <ul> <li>Start a process in the background using <code>&amp;</code> (or put it in background after it's started using <code>CTRL-Z</code> and <code>bg</code>); this is done <strong><em>without using <code>nohup</code></em></strong>.</li> <li>Log off.</li> <li>Log on again.</li> <li>The process is still there, running happily, and is now a direct child of <code>init</code>.</li> </ul> <p>I can confirm both SCP and CAT quits immediately if sent a <code>SIGHUP</code>; I tested this using <code>kill -HUP</code>.</p> <p>So, it really looks like SIGHUP is <strong><em>not sent</em></strong> upon logoff, at least to background processes (can't test with a foreground one for obvious reasons).</p> <p>This happened to me initially with the service console of VMware ESX 3.5 (which is based on RedHat), but I was able to replicate it exactly on CentOS 5.4.</p> <p>The question is, again: shouldn't a SIGHUP be sent to processes, even if they're running in background, upon logging off? Why is this not happening?</p> <hr> <h2>Edit</h2> <p>I checked with <code>strace</code>, as per Kyle's answer.<br> As I was expecting, the process doesn't get <strong><em>any</em></strong> signal when logging off from the shell where it was launched. This happens both when using the server's console and via SSH.</p>
0non-cybersec
Stackexchange
Ardrand: The Arduino as a Hardware Random-Number Generator Benedikt Kristinsson Advisor: Ýmir Vigfússon Reykjavik University December, 2011 For the kid playing space station in the school yard. Abstract Cheap micro-controllers, such as the Arduino or other controllers based on the Atmel AVR CPUs are being deployed in a wide variety of projects, ranging from sensors networks to robotic submarines. In this paper, we investigate the feasibility of using the Arduino as a true random number generator (TRNG). The Arduino Reference Manual recommends using it to seed a pseudo random number generator (PRNG) due to its ability to read random atmospheric noise from its analog pins. This is an enticing application since true bits of entropy are hard to come by. Unfortunately, we show by statistical methods that the atmospheric noise of an Arduino is largely predictable in a variety of settings, and is thus a weak source of entropy. We explore various methods to extract true randomness from the micro-controller and conclude that it should not be used to produce randomness from its analog pins. 1 Introduction Various aspects in our lives may seem random — so thinking that generating randomness might seem easy at first glance. But when one inquires further one quickly realizes that due to the deterministic nature of CPUs, it is impossible for them to generate random numbers. However, there is a great need for unpredictable values in cryptography. Ker- ckhoff’s principle states that “a cryptosystem should be secure even if everything about the system, except the key, is public knowledge”. Almost all encryption schemes rely on the notion of secret keys so those keys must be generated in an unpredictable way, or else the encryption scheme is useless. Examples of this are the keystream in a one-time-pad, the primes in the RSA algorithm and the challenges used in a challenge-response system [8, 1]. Many secure encryption protocols use nonces (numbers used once) to add “noise” to messages [1]. If these numbers are predictable, the nonces do not serve much purpose. Since regular computers are unable to produce truly random numbers, psue- dorandom number generators (denoted PRNG) are the name of the game. A PRNG is a one-way function f the generates random sequnces, of either inte- gers or bits, from an intial seed s and then applies the function iteratively to 1 ar X iv :1 21 2. 37 77 v1 [ cs .C R ] 1 6 D ec 2 01 2 generate the sequence [8]. In a cryptographic system, a weak source for the seed weakens the whole system. It may allow an adversary to break it, as was perhaps most notably demonstrated by breaking the method that the Netscape browser used to seed its PRNG [5]. Thus a PRNG can only be random if its seed is truly random and its output is only a function of the seed data, the actual entropy of the output can never exceed that of the seed. However, it is generally computationally infeasible to distinguish between a good PRNG and a perfect RNG. A true random number generator (TRNG) uses a non-deterministic source to produce randomness e.g. measuring chaotic systems in nature like thermal noise, shot noise or flicker noise, which are all present in resistors [6]. Using background radiation and a Geiger counter is an appealing option, but expensive1 and thus unavailable for the public. Figure 1: Arduino Duemilanove The Arduino is a free and open-source electronics single-board micro-controller with an Atmel AVR CPU. There are several different versions of the board avail- able2, but we used the Arduino Duemilanove3 board (with the ATMega328 [3] micro-controller) for this research. The Arduino toolkit has the analogRead function that reads from a given analog pin on the board and returns a 10-bit integer. This function maps input voltages between 5 and 0 volts to integers in the range [0..1023]. This is what we tried to use in order to extract entropy. Micro-controllers like the Arduino are heavily used in e.g. sensor networks [10] where data integrity is a key issue. It follows that the demand for high 1A simple search on Amazon.com reveals that a USB connected Geiger counter costs about $300 2See: http://arduino.cc/en/Main/Boards 3See: http://arduino.cc/en/Main/ArduinoBoardDuemilanove for full specifications 2 http://arduino.cc/en/Main/Boards http://arduino.cc/en/Main/ArduinoBoardDuemilanove quality entropy is rather high in those situations. The Arduino Reference Manual suggests that reading from an unconnected analog pin gives a “fairly random” number [2], ideal for seeding the avr-libc PRNG4. We will later show that the numbers are generally not random, and that the reading from an unconnected pin provides very limited entropy. We will also show that building a RNG with the Arduino is infeasible and that if you follow the Arduino Reference Manual, the sheer lack of possible seeds makes it relatively easy for an adversary to guess the seed. We will provide a proof of concept tool for doing such guesswork automatically. We also attempt to build a random bit generator from the Arduino (without adding extra hardware). We will pose and discuss a few algorithms and discuss how they perform statistically speaking testing and how they fare at extracting entropy. Ultimately, we were unable to identify any such method which rises concerns over the use of Arduino as a TRNG. 1.1 Contributions The contributions of this work are the following: • We implement the monobit, poker and runs statistical tests in the Python programming language, as well as code that exposes an Arduino to these tests. (Section 3.2.) • We provide a program that given a sequence from the avr-libc PRNG seeded with a value from the analogRead-function on an Arduino, deter- mines the seed value. It was done by first analyzing data from the Arduino and building a probability distribution of the values. The program either collects data directly from the Arduino first or can be supplied with a data set. We supply a typical data set with the code. This includes an implementation of the avr-libc random function. (Section 5.2.) • We rebut the claim made by the Arduino manufactures that analogRead returns “fairly random” integers [2]. (Section 5.1.) All of the Ardrand code is free software and is maintained at http:// gitorious.org/benediktkr/ardrand 2 Related Work - Background Hardware random number generators have been designed with various methods. The search for external entropy has lead researchers down imaginative paths. Air turbulence in hard drives [4], which is proven to be a chaotic phe- nomenon, has been used as a source for random numbers. The raw disk times where both structured and correlated. The authors used the Fast Fourier trans- form algorithm to remove bias and correlation. The worst case observed bitrate was 100 bits/minute. Intel CPUs contain an on-board RNG [6] chip. It samples thermal noise, shot noise and flicker noise, all of which are present in resistors. The voltage 4Archival of this claim: http://web.archive.org/web/20110428064453/http://arduino. cc/en/Reference/RandomSeed 3 http://gitorious.org/benediktkr/ardrand http://gitorious.org/benediktkr/ardrand http://web.archive.org/web/20110428064453/http://arduino.cc/en/Reference/RandomSeed http://web.archive.org/web/20110428064453/http://arduino.cc/en/Reference/RandomSeed measured across undriven resistors is amplified, but these measurements are correlated to enviromental charasteristics, such as electromagnetic radiation, temperature and power supply fluctuations. The random source used is derived from two free-running oscillators, one fast and one much slower. The thermal noise is used to modulate the frequenciy of the slower clock. The erratic ticks of the slow clock is then used to trigger measurements of the faster one. Drift between the two clocks is used as a source for binary random digits. The initial measurements are then processed by the von Neumann box. On average, one bit is generated for every 6 raw binary samples. The limitations of using hard drives as a source of entropy is that not all computers have hard drives, for instance special-purpose hardware like routers or switches. As solid state drives (SSD) become more available, not even all general purpose computers have spinning hard drives any more. Routers and other special purpose hardware do not have exeternal sources for entropy, other than network traffic, which may be observeable or even controllable by an adversary. One example of this is the OpenWRT router [12]. Since it is based on Linux, it uses the Linux Random Number Generator (LRNG), /dev/random and /dev/urandom. It provides cryptographic services such as SSH, SSL and wireless encryption. It lacks entropy sources other than network interrupts. It has no mouse or keyboard, so it is impossible to use any user interaction to collect entropy. Although this is not part of the LRNG itself, almost all distributions include a script that saves the state of the LRNG between reboots. This is done so that when the operating system starts, the LRNG has a fresh starting state. The OpenWRT distribution does not do this and thus the LRNG state is reset to a predictable state on every reboot, only determined by time of day and a constant string. This example demonstrates that there is need for external entropy sources. 3 Theoretical Considerations We begin by making the notions of “fairly random” and “statistically random” more precise by defining statistical tests for sequences of integers. Let us first define a few terms, following the exposition by Menezes et al. [8]. Definition 1. A random bit generator (RBG) is a device or algorithm that outputs a sequence of statistically independent and unbiased binary digits. A random bit generator can easily be used to generate random numbers. To obtain an integer in the interval [0, n] we can simply generate blg nc+1 bits and cast over to an integer. If the result exceeds n, one option is to discard it and generate a new number. Definition 2. A pseudorandom random bit generator (PRBG) is a determin- istic algorithm or program that given a truly random binary sequence of length k, outputs a binary sequence that appears to be random. The input to the PRGB is called the seed, while the output is called a pseudorandom bit sequence. Note that the output from a PRBG is not random in the colloquial sense of the word. Given the deterministic nature of the algorithm, it will always produce the same sequence for any given seed value. 4 Definition 3. Let s be a binary sequence. We say that a run in s of length n is a subsequence consisting of either n consecutive 0’s or n consecutive 1’s. A run is neither preceded or proceeded by the same symbol. We call a run of 1’s a block and a run of 0’s a gap. Definition 4. Let s be a binary sequence of length n such that s = s0, . . . , sn−1 and let pi be the probability that si = 1 for any i. Way say that the generator generating s is biased if pi 6= 12 . Determining what is random and what is not is a deep philosophical question — proving mathematically that a generator is indeed generating random bits is impossible [8]. Measuring randomness is as much a philosophical question as it is a mathematical one. There are however statistical tests that allow us to detect certain weaknesses a RBG might have. Note that just because a bit sequence from a generator is accepted by the statistical tests, there is no guarantee that it is indeed random. On the other hand, if it is rejected, we can say with certainty that it is non-random. In other word, when a bit sequence is “accepted” it really is “not rejected”. 3.1 Statistical significance We interpret the results of the statistical tests by means of the χ2-distributions. It is used in the common χ2-tests to assess the goodness-of-fit. The χ2 distri- bution with k degrees of freedom is given by f(x, k) = { 1 2k/2Γ(k/2) xk/2−1e−x/2, x ≥ 0; 0, otherwise. where Γ is the gamma-function, given by Γ(n) = (n− 1)!. Then we can take our observed data and find an χ2 statistic, denoted X2, such that X2 = k∑ i (Oi − Ei)2 Ei for all i, where Ei denotes the expected number of occurrences and Oi de- notes the observed number of occurrences. Then the number X2 tells us about the significance of the test, given a significance level α. This is usually done by means of a table of percentiles. The degrees of freedom is the number of variables that are free to vary. It is worth noting that if we have m different values in our calculations, we can often figure out the mth variable from the m− 1 other values, so then we would have k = m− 1 degrees of freedom. This is often the case for our tests, such as the Monobit test we will define below. 3.2 Statistical tests Here we present a few statistical tests we used. We measured against the spec- ifications set forth in FIPS-140-1 [9, 8] rather than selecting the significance 5 levels ourselves. The motivation is that the FIPS document effectively sets a standard for the tests to satisfy and we therefore have something to measure against. There are several others tests available and NIST has published paper [7] that outlines a few tests such as the DIEHARD5 test suite, the tests outlined by Donald Knuth in The Art of Computer Programming and the Universal Statistical Test by Mauer [11] Let s = s0, s1, . . . , sn−1 be a binary sequence of length n. A single bitstring of length n = 20000 from our generator is subjected to each of these tests. If any one of the tests fail, we conclude that the output of our generator is non-random. 3.2.1 Monobit test In a random bit sequence, one would expect that the number of 1’s and 0’s are about the same. This test gives us a statistic on this distribution. Let n0 denote the number of 0’s and n1 the number of 1’s. We then find the statistic X1 = (n0 − n1)2 2 (1) which approximately follows a χ2 distribution with 1 degree of freedom (given n and n0 we can easily figure out n1). 3.2.2 Poker test The poker test tests for certain sequences of five numbers (bits) at a time, similar to a hand in poker. In a random sequence we would expect that each hand would appear approximately the same number of times in s. Let m be a positive integer such that ⌊ n m ⌋ ≥ 5 · 2m and let k = b n m c. We divide the sequence s into k disjoint parts of length m and let ni denote the number of sequences of “type” i. For a binary sequence si ∈ s, where |si| = m, we let ni be the number of sequences where i equals the decimal representation of si. Note that 0 ≤ i ≤ 2m. The statistic used is then X3 = 2m k ( 2m∑ i=1 n2i ) − k (2) which approximately follows a χ2 distribution with 2k−2 degrees of freedom (df). 3.2.3 Runs test The runs test determines if the number of runs (see Definition 3 ) in s is what is expected of a random sequences. The expected number of gaps, or blocks, of length i in a sequence of length n is ei = n− i+ 3 2i+2 . 5See http://stat.fsu.edu/~geo/diehard.html 6 http://stat.fsu.edu/~geo/diehard.html Let k be equal to the largest integer i for which ei ≥ 5, or k = maxi ei ≥ 5. Let Bi, Gi be the number of blocks and gaps, respectively, of length i, for each 1 ≤ i ≤ k. The statistic used is then X4 = k∑ i=1 (Bi − ei)2 ei + k∑ i=1 (Gi − ei)2 ei (3) which approximately follows a χ2 distribution with 2k-2 degrees of freedom. We note that this exactly finds the χ2 statistic since the number of runs is the sum of all gaps and blocks. 3.3 FIPS140-1 bounds We use the FIPS-140-1 bounds [9] for the tests of our Arduino RBG. Let s be a bit sequence of length 20,000. The documents states explicit bounds as follows: Monobit test The test is passed if 9.654 < X1 < 10.346 and the number n1 of 1’s should satisfy 9654 < n1 < 10346. Should follow a χ2 with 1 degree of freedom. Poker test The statistic X3 is computed for m = 4 and the test is passed if 1.03 < X3 < 57.4. Should follow a χ2 with 15 df. Runs test We count the number of blocks and gaps of length i — Bi and Gi respectively — in the sequence s, for each 1 ≤ i ≤ 6. For the purpose of this test, runs longer than 6 are truncated to length 6 [9]. The test is passed if the number of runs is each within the corresponding intervals below in table 1. The bounds must hold for both blocks and gaps, all 12 counts must lie within the bounds. The distribution should follow a χ2 with 16 df. Length of run Required Interval 1 2267 - 2733 2 1079 - 1421 3 502 - 748 4 223 - 403 5 90 - 223 6 90 - 223 Table 1: Required intervals for runs test as specified by FIPS-140-1 Long runs test The long runs test is passed if there are no runs of length greater than 34 in the bit sequence s. 3.4 Decorrelation with the von Neumann box Decorrelation is a term that refers to reducing autocorrelation, the similarity between observations as a function of the time separation between them. This 7 should not be observed in a random sequence, since the very definition of ran- domness implies differences in the sequence. A source of randomness may be faulty in that the output of it is either biased or correlated. Suppose that the probability that a RBG generates a 1 with a probability p and a 0 with probability 1− p, where p is unknown but fixed. We group the output of the generator into pairs of two bits. The pairs 00 and 11 are discarded, and a 10-pair is transformed to a 1-bit while a 01-pair is transformed into a 0. This procedure is called the von Neumann-corrector [8, 6] or von Neumann-box. 3.5 Algorithms used to try to extract entropy from the Arduino We implemented several algorithms in our search for entropy. These are de- scriptions of our algorithms. The Mean-RAND algorithm is implemented by keeping a list of the k last values and their mean. Then we compare the new reading to the mean and evalute to 0 if it is less, otherwise 1. To remove bias and reduce correlation we run it through the von Neumann-box. Listing 1: The Mean-RAND algorithm in Python esque pseudocode de f meanrand (n ) : buf = deque ( [ 0 ] ∗ k ) f o r i in [ 0 . . k ] : buf . push ( analogRead ( ) ) meanval = sum( buf )/ l en ( buf ) f o r i in [ 0 . . n ] : meanval −= buf . pop ( )/ k buf . push ( analogRead ( ) ) meanval += buf [−1]/k m = c e i l ( meanval ) y i e l d vNbox(1 i f analogRead ( ) > m e l s e 0) The Updown-RAND algorithm first reads an initial value v0 which is then used to determine if the next bit value v1 is 1 if v1 > v0 and 0 otherwise. We do this twice, i.e. we collect v1,0 and v1,1 and compare them with the von Neumann box until we obtain a legit bit. This algorithm showed low performance and bandwidth, and has consistently failed the statistical tests. Listing 2: The Updown-RAND algorithm de f updownrand (n ) : v0 = analogRead ( ) f o r i in [ 0 . . n ] : y i e l d vNbox(1 i f analogRead ( ) > v0 e l s e 0) The MixMeanUpdown-RAND algorithm acquires one bit from Mean-RAND and one from Updown-RAND and XORs them together to produce a new bit. Since this method is dependent on Updown-RAND it performs even worse, both in regards to bandwidth and entropy. 8 Listing 3: The MixMeanUpdown-RAND algorithm de f mixmeanupdown(n ) : m = meanrand ( ) u = updownrand ( ) f o r i in [ 0 . . n ] : y i e l d vNbox(m. next ()^u . next ( ) ) Let a = a9 . . . a1a0 be the binary representation of a 10-bit integer read from the analogRead-function on the Arduino. The Leastsign-RAND algorithm simply yields the least significant bit a0. As expected, this algorithm shows greater performance and some promise in regards to randomness. We use the von Neumann-box for decorrelating the output. Listing 4: The Leastsign-RAND algorithm de f mixmeanupdown(n ) : f o r i in [ 0 . . n ] : y i e l d vNbox( analogRead ()&1) The TwoLeastsign-RAND algorithm works in a very similar fashion. Instead of just using the least significant bit, we use the two least significant bits a0 and a1, XOR them together and run through the von Neumann-box. This algorithm has shown the greatest potential for entropy and has also been implemented on the Arduino itself. Listing 5: The TwoLeastsign-RAND algorithm de f two l e a s t s i gn (n ) : f o r i in [ 0 . . n ] : y i e l d vNbox( analogRead ()&1^( analogRead()>>1)&1) 3.6 NIST Security Levels National Institute of Standards and Technology (NIST, America) has defined [9] four basic security levels for cryptographic modules, such as RBGs and RNGs, as well as explicit bounds for statistical tests a RBG must satisfy. The security levels can be outlined as follows Security level 1 is the lowest level of security that specifies basic requirements for a cryptographic module. No physical mechanisms are required in the module beyond protection-grade equipment. It allows software cryptog- raphy functions to be performed by a regular computer. Examples of systems of level 1 include Integrated Circuit Boards and add-on security products. Security level 2 adds the requirement for tamper-proof coatings and seals, or pick-resistant locks. The coatings or seals would be placed on the module so that it would have to be broken in order to attain physical access to the device. It also adds the requirement that a module must authenticate that an operator is authorized to assume as specific role. Security level 3 extends the requirements of level 2 to prevent the intruder from gaining access to critical security parameters within the module and if a cover is opened or removed, the critical parameters are erased. 9 Security level 4 is the highest level of security. It protects the module from compromise of its security by environmental factors, such as voltage or temperature fluctuations. If one attempts to cut through an enclosing of the module, it should detect this attempt and erase all sensitive data. Most existing products do not meet this level of security. Although we were not aiming for physical security in this scenario, aiming for security level 1 seems like a reasonable decision. Note that in order for a device to conform to any of the security modules it has be able to perform self- tests, both at request and start-up. We implemented the tests in the Python programming language on a general-purpose computer. FIPS140-1 specifies that the sample must be 20,000 bits, or 2.5KB. But the Arduino Duemilanove only has 2 KB of RAM. Luckily, it has a 32KB Flash memory which could be utilized to implement the statistical tests on the Arduino itself. 4 Experimental Results We began by analyzing the output of the function analogRead on the Arduino in various different settings. We found that the output is dependent on several environmental factors, some of which are unknown to us. Reading from different pins gives different scopes of values, but the behavior is the same. We will show graphs of all pins on one Arduino connected to two computers to back this claim, see Figure 2. The computer to which the Arduino is connected to affects the results. On one computer tested, one of our algorithms produces sequences that were not rejected by the statistical tests. We want to know if, and by how much, the environment affects the results. We also investigate how and if we can use the analogRead output to find entropy and how we test for randomness. 4.1 Computers and devices used in research The output of the function analogRead on the Arduino is somewhat dependent on the environment in which it resides. We subjected the Arduino boards to different conditions, such as putting it in the freezer or on top of a hot heating element. These are descriptions of the computers used for the experiments. • A no-name desktop computer with a Gigabyte GA-MA69GM-S2H moth- erboard. This machine runs the Debian GNU/Linux testing/wheezer op- erating system. • A Dell D505 laptop. This machine runs the Ubuntu GNU/Linux Maverick Meekat 11.04 operating system. • A Dell D620 laptop. This machine runs the Ubuntu GNU/Linux Maverick Meekat 11.04 operating system as well. We found that both the laptops showed same or similar behavior, both on raw outputs and statistical testing, but the desktop differed. It is unclear what aspects trigger the deviations but we will discuss this point further in section 10 (a) Sample from Ard3 taken on the desktop computer (b) Sample from Ard3 taken on the D620 Figure 2: Readings from Ard3 taken over all pins on both a desktop computer and a D620 laptop. 4.3. For our research we used three identical Arduino Duemilanove boards with the ATMega 328 micro-controller. To distinguish between them, we call them ard1, ard2 and ard3. These names are also used to distinguish between them in our data samples. 4.2 Analysis of analogRead Our first hypothesis was the space and volume of the area that the Arduino resided in affected the values. If we look at Figure 3 we can see that the environment lays some role and that where you place it definitely has effect on the output. The figure shows readings taken in various different places — in an open space, a closed cupboard, inside a computer case and in a larger open space. 11 Figure 3: Readings from ard1 connected to the desktop. Samples are taken inside a small cupboard, in a fairly large room, a large living room and inside the desktop computer case itself. Moreover, by looking at the graph it becomes evident that there is limited entropy available. Note the drop at the beginning; it does not appear for all computers, e.g. specifically when connected to the D620 laptop (see Figure 4). It should be noted that the data originates from the same Arduino device, in the same setting. The only factor is the computer used. Our experiments have shown that the output is fairly regular and if we look at Figure 5, showing more limited ranges of readings, we see that the structure and apparent lack of entropy. The readings should have been heavily influenced by analog noise [2]. This is further investigated in section 5.1. Note the interference patterns in e.g. figures 7b and 6 — they show up more clearly in the case of the temperature experiments since we see a much wider range of values. Although we are not sure what causes these patterns, electrical fluctuations are a potential candidate. These patterns might also be a product of the analog pins themselves, or their manufacturing process. The exact physical causes for this phenomenon appear complex and are beyond the scope of this paper. 12 Figure 4: Readings from ard3 connected to the D620 laptop Figure 5: 200 readings from ard1 connected to the desktop computer 4.2.1 Effects of temperature Temperature is a key environmental factor. We see a much broader range of values when the Arduino is operating in heat or cold. The figures 6, 7b and 7a show the output from analogRead in various temperature conditions of the extreme kinds. Note that Figure 7b only has 10000 values, as opposed to the 50000 values in all the other figures. This is because the Arduino simply stops working after a few minutes at −11◦C. Arduino have not released any infor- mation regarding operating temperatures but according to AVR the operating temperatures for the ATMega 328 micro-controller is −40◦C to 85◦C [3]. One of our Arduino boards (ard1) broke after spending 4 hours in the freezer at −12◦C, so we conclude that some other component(s) on the board survive less cold than the micro-controller itself. 13 Figure 6: Readings on top of a hot heating element (approx. 40C) connected to a Dell D505 (a) Fridge (approx. 1C) (b) Freexer (approx. -11C) Figure 7: Readings in cold temperatures with a Dell D505 laptop 4.3 Harvesting entropy and statistical testing We subject the output of the RAND algorithms described in section 3.5 to the statistical tests described in section 3.2. These are our results using the three 14 different computers used in our experiments. We used a baudrate of 115200 bps, fast available for the Arduino over the FTDI RS232-to-USB connection, in these experiments for maximum bandwidth. The maximum reading rate of analogRead is about 10000 times per second [2]. When we read6 iteratively from analogRead over USB, pyserial will raise either an OSError or SerialException. This happens approximately once every 500 times and reading the pyserial source code7 we find a comment stating that “disconnected devices, at least on Linux, show the behavior that they are always ready to read immediately but reading returns nothing”. We therefore conclude that these exceptions are the result of analogRead blocking for moment. These are the results of our RAND algorithms using all three computers, sub- jected to the FIPS boundaries. Each bit sequence tested is n = 20000 bits long and each recorded result is the average of three consecutive runs. Green means Accepted and red Rejected. 4.3.1 Results with Desktop computer Algorithm Monobit Poker Runs Long runs Bandwidth Leastsign n1 = 9947 X3 = 869.44 Rejected Accepted 290.55 bps Twoleastsign n1 = 10027 X3 = 1290.05 Rejected Accepted 133.6 bps Mean n1 = 9979 X3 = 149.87 Rejected Accepted 85.34 bps Updown n1 = 8352 X3 = 1959.2 Rejected Accepted 3.87 bps Table 2: Statistical tests on desktop 4.3.2 Results with the D620 laptop Algorithm Monobit Poker Runs Long runs Bandwidth Leastsign n1 = 10006 X3 = 34.59 (Rejected) Accepted 290.55 bps Twoleastsign n1 = 10027 X3 = 10.36 Accepted Accepted 172.0 bps Mean n1 = 10030 X3 = 4743, 17 Rejected Accepted 25.32 bps Table 3: Statistical test on D620 laptop We can see that the Twoleastsign-RAND algorithm here produces sequences that are not rejected as being non-random. The Leastsign-RAND algorithm is a little less consistent since it is rejected by the tuns tests some of the time. We have exposed sequences that pass our statistical tests to a statistical test suite made available by NIST8. This suite consists of 15 tests, some of which are also implemented by us. We found that when a sequences passes our tests, it will also pass all the NIST tests. This implies that it is possible to generate random bits on the Arduino, but it relies on external factors that are not fully 6See poll.py in the Ardrand codebase 7See http://www.java2s.com/Open-Source/Python/Development/pySerial/pyserial-2. 5-rc2/serial/serialposix.py.htm 8See http://csrc.nist.gov/groups/ST/toolkit/rng/index.html 15 http://www.java2s.com/Open-Source/Python/Development/pySerial/pyserial-2.5-rc2/serial/serialposix.py.htm http://www.java2s.com/Open-Source/Python/Development/pySerial/pyserial-2.5-rc2/serial/serialposix.py.htm http://csrc.nist.gov/groups/ST/toolkit/rng/index.html understood by us. Our best guess is that the voltage from the USB connection on the computer influences the regularity of the analogRead readings. As we can see in Figure 4 and 2b, analogRead is producing different pat- terns (and no initial drop) on this computer, compared to the desktop computer. Note the drop on pin 3 in the beginning. Curiously, the Twoleastsign-RAND algorithm will fail when we choose pin 3. There is no guarantee that these sequences are truly random, they have just not been rejected as non-random. This shows that using some computers, the Arduino could possibly work as a RBG. But for a device to be a RBG, it has to work using all PC hardware, in all settings. 4.3.3 Results with the D505 laptop Algorithm Monobit Poker Runs Long runs Bandwidth Leastsign n1 = 10033 X3 = 27.4 Failed Accepted 473.32 bps Twoleastsign n1 = 10080 X3 = 18.68 (Accepted) Accepted 240.0 bps Mean n1 = 9980 X3 = 3365.65 Rejected Accepted 27.1 bps Table 4: Statistical with the D505 laptop This computer has shown inconsistent test results and sequences produced by it will sometimes be accepted by the poker and runs tests, while sometimes they are not. As before, the causes for this are unknown to us and open for speculations. 5 Breaking the Arduino as a RNG This section is twofold. We will both show that using the analogRead function to seed the avr-libc PRNG does not give adequate security and we also exhibit proof-of-concept code that finds such a seed value, given a sequence from the PRNG. 5.1 Refuting the claims made by Arduino The Arduino Reference Manual [2] states the following in the section about the randomSeed function. This claim is at the time of writing found in the manual, and is available via The Internet Archive9. The reference manual is only available online. “If it is important for a sequence of values generated by random() to differ, on subsequent executions of a sketch, use randomSeed() to initialize the random number generator with a fairly random input, such as analogRead() on an unconnected pin.” After having visually examined the raw output with the graphs in the section above, we clearly saw that the output is very likely non-random and not even 9See http://web.archive.org/web/20110428064453/http://arduino.cc/en/Reference/ RandomSeed 16 http://web.archive.org/web/20110428064453/http://arduino.cc/en/Reference/RandomSeed http://web.archive.org/web/20110428064453/http://arduino.cc/en/Reference/RandomSeed “fairly random” as claimed. This would also explain the troubles we had in devising an algorithm that produces random bits. The first issue with analogRead is that it only returns 10-bit integers, since it reads from the 10-bit analog-to-digital converter on the Arduino board10. It then follows trivially that if you use analogRead to seed the PRNG, there are only 210 = 1024 seed values for an adversary to explore. As we can see from Figure 2 there are only roughly 100-400 values that show up, but it is worth noting that using different pins give us different scopes of values. Note the drop when using the desktop but not the D620 laptop. We exposed the output from analogRead to the same statistical tests as our RAND algorithms. In order to use the FIPS-bounds to measure against we needed 20 000 bits, or 2000 10-bit integers that we converted to binary. We state the null hypothesis as follows, H0 = The output from analogRead is "statistically random" and show that the results are statistically significant and we can reject it as non-random. Note that the Arduino developers claim that the output is “fairly random” and not “statistically random”. These are the average over three consecutive runs in setting 0. Statistical test X statistic Accepted Required X interval Monobit 903.847 Rejected 9.964 < X1 < 10.346 Poker 3211.45 Rejected 1.03 < X3 < 57.4 Runs 2812.81 Rejected Lengths of runs used Table 5: Results of the statistical test applied to analogRead output We see that all of the statistics are far off from the FIPS requirements so we can safely conclude that the null hypothesis H0 is false and analogRead is not even “fairly random”. We note that the observed bitrate for reading values directly from analogRead is 17531 bps11. 5.2 Finding the seed This limited range of possible values from analogRead cuts down on search time for the seed. As we have seen, there are only a few hundred values that show up most of the time, although these values may vary. We have designed proof- of-concept code12 that given a sequence from the avr-libc (Arduino) PRNG, finds the seed — assuming it was generated by analogRead. The avr-libc PRNG is a Linear congruential generator defined by the re- currence relation13 Xn+1 ≡ 75 ·Xn (mod 231 − 1). 10See http://arduino.cc/en/Reference/AnalogRead 11Baudrate 115200 bps 12Implemented in the file seedfind.py in the Ardrand codebase 13Resides in libc/stdlib/random.c in avr-libc-1.7.1 and a Python implementation is found at avrlibcrandom.py in the Ardrand codebase 17 http://arduino.cc/en/Reference/AnalogRead In order to account for the diversity in values that the Arduino returns in various settings, our implementation inputs either a text file of samples or can connect to an Arduino board and collect fresh samples. To provide the same interface, this is implemented by means of inherited classes in the code. Let C denote the number of calls a program has made to the PRNG in order to generate a sequence s. Let m be our best-guess or estimation of the unknown C. Our program inputs s and m, as well as a sample source. It then builds a list of values in the range [0, 1023], sorted by the frequency by which they appear in the given sample. Let P denote this list of probability distribution values. We then create one bidirectional queue for each of the 1024 values in P. Let k be the length of the sequence s. For all i ∈ P we create a deque with k pseudo random integers derived from i as a seed. Then we iterate over P and generate k + m integers for each deque (holding k values at a time) until we find the sequence. Here is pseudo-code for our program. The functions srandom and random are the seeding function for the avr-libc PRNG and random function, respectively. Listing 6: Finding the seed de f f i nd s e ed ( s , m, samplesource ) : k = len ( s ) l a s t k = [ deque ( ) ]∗1024 P = bui ldProbDist ( samplesource ) # Expand all the deques by k elements from P[i] as seed f o r i in P: srandom ( i ) l a s t k [ i ] = deque ( [ random ( ) f o r _ in range (k ) ] ) # Did we receive a sequence derived directly from the seed? i f l a s t k [ i ] == s : re turn i whi l e True : f o r i in P: f o r _ in range (m+k ) : srandom ( l a s t k [ i ] [ −1 ] ) v = random ( ) l a s t k [ i ] . popfront ( ) l a s t k [ i ] . append (v ) i f l a s t k [ i ] == s : re turn i This program has running bounds given by O(C), since it has a endless while-loop, only bounded by C. The running time is thus not bounded by the O(m + k) loop, since that is only an estimation or best-guess of how long it takes to find the correct seed. 5.2.1 Possible optimizations While this program runs reasonably fast in practice, one can think of optimiza- tions of the code. Let G a sorted list of observed values in the sample source. Then one variation of the findseed program might generate sequences from 18 each value g ∈ G as seed for some constant time t before moving on to the less likelier values that are in P −G, the unobserved values. Thus we would spend t times more time on the more probable values. The while loop of this variation would look like Listing 7: One possible optimization of the findseed program . . . whi l e True : # Iterate over a sorted list of the observed values f o r i in G: f o r _ in range ( t ∗(m+k ) ) : expand ( l a s t k [ i ] ) i f l a s t k [ i ] == s : re turn i # Check the unobserved values, but spend less time there f o r i in P−G: f o r _ i range (m+k ) : expand ( l a s t k [ i ] ) i f l a s t k [ i ] == s : re turn i de f expand ( que ) : srandom ( que [ −1]) v = random ( ) que . popfront ( ) l a s t k [ i ] . append (v ) In order to determine the efficiency of our program, we first pseudo-randomly select an integer d such that 1 ≤ d ≤ 1000 with the Python PRNG. Then we generate a sequence s = s1, . . . , sd+100 with the avr-libc and pass the subsequence sd+1, . . . , sd+100 to our program. To seed the PRNG, we use the Python PRNG to select a analogRead value from a file of samples collected from an Arduino. We did this 5000 times and our program found the seed in every case, with a mean time of 1.6 seconds14 spent on each sequence. 6 Conclusions The primary goal of this project was to investigate the feasibility of using vanilla Arduino Duemilanove boards without add-on hardware as cheap RBG devices, in hopes of building a true hardware random number generator. Early on, we realized that there simply wasn’t enough entropy available to build a RBG. Most to our surprise, we found that using some of our computers, the Arduino seems to work as a RBG when using the Twoleastsign-RAND algorithm. The resulting strings were not rejected by our implemented statistical tests that had rejected all other sequences we tried. It should be noted that due to the very nature of randomness, we cannot say for sure that it is indeed producing random bits — we can only state that it was not rejected as non-random. But since this is only the case using specific hardware, we must reject the Arduino as a RBG since it is not universal. 14Using a computer with an AMD Athlon 64 X2 4000+ Dual Core Processor 19 Since it is only not rejected using a certain hardware, we have ultimately shown that these boards are not ideal devices for this task. Instead we have refuted the claim made by Arduino themselves and devised a program to find the seed when the onboard PRNG is seeded with analogRead, as recommended by Arduino. In future work, the exact nature of the ports read byanalogRead should be investigated with respect to the environment or USB connectors. It also remains open to find a cheap, readily available hardware that produce random statistically unbiased random numbers quickly. 7 * [1] Gary Anthes. The Quest for Randomness. CACM, 54(4):13–15, 2011. [2] Arduino.cc. Arduino Reference Manual, 2011. [3] ATMEL. 8-bit Atmel microcontroller with 4/8/16/32K Bytes In-System Programmable Flash, Datasheet, 2011. [4] Don Davis, Ross Ihaka, Philip Fenstermacher. Cryptographic Randomness from Air Turbulence in Disk Drives. Advances in Cryptography, 839:114– 120, 1994. [5] Ian Goldberg and David Wagner. Randomness and the Netscape Browser. Dr. Dobbs Journal, 21:66–106, 1996. [6] Benjamin Juan and Paul Kocher. The Intel Random Number Generator, 1999. [7] National Institute of Standards & Technology Juan Soto. Statistical testing of random number generators, 1999. [8] Alfred J. Menezes, Paul C. van Oorschot, and Scott A. Vanstone. Handbook of Applied Cryptography. CRC Press, 1996. [9] National Institute of Standards and Technology. FIPS PUB 140-1: Security Requierments for Cryptography Modules, 1994. [10] Rúnarsson, Kristinsson & Jónsson. TSense: Trusted Sensors and Supported Infrastructure, 2010. [11] Ueli M. Mauer. A universal statistical test for random bit generators. Journal of Cryptography, 5:89–105, 1992. [12] Zvi Gutterman, Benny Pinkas, Tzachy Reinman. Analysis of the Linux Random Number Generator. Security and Privacy, pages 385–400, 2006. 20 1 Introduction 1.1 Contributions 2 Related Work - Background 3 Theoretical Considerations 3.1 Statistical significance 3.2 Statistical tests 3.2.1 Monobit test 3.2.2 Poker test 3.2.3 Runs test 3.3 FIPS140-1 bounds 3.4 Decorrelation with the von Neumann box 3.5 Algorithms used to try to extract entropy from the Arduino 3.6 NIST Security Levels 4 Experimental Results 4.1 Computers and devices used in research 4.2 Analysis of analogRead 4.2.1 Effects of temperature 4.3 Harvesting entropy and statistical testing 4.3.1 Results with Desktop computer 4.3.2 Results with the D620 laptop 4.3.3 Results with the D505 laptop 5 Breaking the Arduino as a RNG 5.1 Refuting the claims made by Arduino 5.2 Finding the seed 5.2.1 Possible optimizations 6 Conclusions 7 *
1cybersec
arXiv
Grandma's phone cheat sheet.
0non-cybersec
Reddit
This glitch is still in the game?? I thought it got patched.
0non-cybersec
Reddit
How to install Typescript 2.2 in Visual Studio 2017 v15.4.3. <p>I tried this hack: <a href="https://github.com/Microsoft/TypeScript/issues/14529" rel="noreferrer">https://github.com/Microsoft/TypeScript/issues/14529</a> but got other terrible errors so I don't think it worked.</p> <p>And 2.2 is not available under options here: <a href="https://www.microsoft.com/en-us/download/details.aspx?id=55258" rel="noreferrer">https://www.microsoft.com/en-us/download/details.aspx?id=55258</a></p> <p>"Install-Package Microsoft.TypeScript.MSBuild -Version 2.2.2" did not work either, made the 2.2 show up on the dropdown but only as unavailable. <a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild/2.2.2" rel="noreferrer">https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild/2.2.2</a></p> <p><a href="https://i.stack.imgur.com/oo1RV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oo1RV.png" alt="unavailable"></a></p>
0non-cybersec
Stackexchange
What will be the order in which filters will be called?. <p>Suppose i have following in my web.xml</p> <pre><code>&lt;filter-mapping&gt; &lt;filter-name&gt;F1&lt;/filter-name&gt; &lt;url-pattern&gt;/XYZ/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;F2&lt;/filter-name&gt; &lt;url-pattern&gt;/XYZ/abc.do&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;F3&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; </code></pre> <p>What will be the order in which the filters will be called if a request comes as /XYZ/abc.do.And why?</p>
0non-cybersec
Stackexchange
Doctor who just gave Putin tour of Moscow's main COVID-19 hospital tests positive for virus - Financial News.
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
[Clip] Hyouka's English dub takes a somewhat normal scene and makes it kinda hilarious..
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
Why do explicit interface calls on generics always call the base implementation?. <p>Why do explicit C# interface calls within a generic method that has an interface type constraint always call the base implementation?</p> <p>For example, consider the following code:</p> <pre><code>public interface IBase { string Method(); } public interface IDerived : IBase { new string Method(); } public class Foo : IDerived { string IBase.Method() { return "IBase.Method"; } string IDerived.Method() { return "IDerived.Method"; } } static class Program { static void Main() { IDerived foo = new Foo(); Console.WriteLine(foo.Method()); Console.WriteLine(GenericMethod&lt;IDerived&gt;(foo)); } private static string GenericMethod&lt;T&gt;(object foo) where T : class, IBase { return (foo as T).Method(); } } </code></pre> <p>This code outputs the following:</p> <blockquote> <p>IDerived.Method<br> IBase.Method</p> </blockquote> <p>Instead of what one might expect:</p> <blockquote> <p>IDerived.Method<br> IDerived.Method</p> </blockquote> <p>There seems to be no way (short of reflection) to call a hidden, more derived explicit interface implementation of a type decided at runtime.</p> <p><strong>EDIT:</strong> To be clear, the following if check evaluates to true in the GenericMethod call above:</p> <blockquote> <p>if (typeof(T) == typeof(IDerived))</p> </blockquote> <p>So the answer is not that T is always treated as IBase due to the generic type constraint "where T : class, IBase".</p>
0non-cybersec
Stackexchange
Array of functions?. <p>How can I create an array of functions in Scala so I can loop over them and call them to perform calculations?</p> <pre><code>def f1(x: Int, y: Int): Int = x + y def f2(x: Int, y: Int): Int = x - y def f3(x: Int, y: Int): Int = x * y def test() { val someValues1 = List(1, 2) val someValues2 = List(3, 4) val fnList = Array(f1,f2,f3) for (f &lt;- fnList; a &lt;- someValues1; b &lt;- someValues2) { val result = f(a, b) println("Result=" + result) } } </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
C# send a simple SSH command. <p>I'm a young a student and received my homework for this week. It's pretty difficult for me because I have to create a program, that is able to connect to an SSH server and send the command "etc/init.d/networking restart".</p> <p>I should program this application in C# and I'm pretty new to it (Just have learned from some school lessons). I also should create a GUI.</p> <p>I understand the basics of C# (loop, if etc...).</p> <p>I've already created GUI, menus, buttons and a log listbox. GUI = 3 textboxes (ip, username, password) and a button to connect.</p> <p><img src="https://i.stack.imgur.com/lNzZI.png" alt="screenshot of ui"></p> <p><img src="https://i.stack.imgur.com/Iqqm8.png" alt="screenshot of code"></p> <p>I'm coding with Microsoft Vistual Studio.</p> <p>My question is: How can I establish an SSH connection to my server?</p>
0non-cybersec
Stackexchange
Inferences about convergence based on two pieces of data. <p>I am new to calculus and just wanted to check my reasoning:</p> <p><span class="math-container">$\sum a_n$</span> is positive and converges.</p> <p>This means that:</p> <ol> <li><span class="math-container">$\sum (-1)^na_n$</span> also converges, because it converges absolutely.</li> <li><span class="math-container">$\sum(sin(n)-2cos(n))·a_n$</span> converges, because <span class="math-container">$sin(n)-2cos(n)$</span> fluctuates between +2.23607 and -2.23607, therefore functioning much like a constant that could be moved to the right of the sum sign.</li> <li><span class="math-container">$\sum a_n x^n$</span> converges if and only if <span class="math-container">$-1\leq x \leq 1$</span></li> <li><span class="math-container">$\sum a_n^2$</span> converges, because the data given implies that <span class="math-container">$lim_{n\to\infty}a_n=0$</span>: therefore <span class="math-container">$a_n&lt;1$</span> and <span class="math-container">$a^2_n&lt;a_n$</span></li> <li><span class="math-container">$a_n$</span> is a decreasing series (at least starting from some point), again because the data given implies that <span class="math-container">$lim_{n\to\infty}a_n=0$</span>.</li> </ol> <p>Are each of these conclusions correct?</p> <p>Thank you!</p>
0non-cybersec
Stackexchange
Datatables - How to load only a certain amount rows on page-load?. <p>I have a <a href="https://jsfiddle.net/bheng/cL8ej4fa/2/" rel="noreferrer">fiddle</a> that make an ajax to <a href="https://api.myjson.com/bins/1egsx" rel="noreferrer">URL</a> and rendering a table, but I want to defer and load only 10 rows during page load.</p> <h1>HTML</h1> <pre><code>&lt;table id=&quot;example&quot; class=&quot;display&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Account ID&lt;/th&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Email&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;/table&gt; </code></pre> <hr /> <h1>JS</h1> <pre><code>$(document).ready(function() { $('#example').DataTable( { &quot;bPaginate&quot;: true, &quot;processing&quot;: true, &quot;bServerSide&quot;: true, ajax: { url: 'https://api.myjson.com/bins/1egsx', dataSrc: 'data' }, columns: [ { data: 'account_id' }, { data: 'name' }, { data: 'email' } ], &quot;deferRender&quot;: true, &quot;deferLoading&quot;: 10, } ); }); </code></pre> <hr /> <p>I kept getting</p> <blockquote> <p>No matching records found</p> </blockquote>
0non-cybersec
Stackexchange
Does not bode well for the day.
0non-cybersec
Reddit
X-ways timestamps. Hi :) I am doing some research for a university project, using x-ways it has given me the timestamps for this word document. so what I want to do now is find where the hex for this timestamp actually is to manually review it for my report, is there any way to do this through x-ways? Or better yet does anyone have any information on where the offset for the MAC timestamps may be located. I have searched the internet for this and can't find what I'm looking for It is word 2007 used to create the file, it is done on APFS on high sierra by apple. any help would be much appreciated
1cybersec
Reddit
Whitsundays, Great Barrier Reef, Australia by Justin James [2000x1333].
0non-cybersec
Reddit
How to use useEffect() correctly?. <p>I want to change style by scrolling. </p> <p>This code isn't working correctly . When I rolling up and down too many times and too fast, then the browser is going to freeze, crash.</p> <p>I think I used <code>useEffect()</code> wrong. How can I solve this issue.</p> <pre><code>const ArticleItem = ({title, content, active, chapter, program, id, scrollPos}) =&gt; { const ref = useRef(null); const client = useApolloClient(); useEffect(() =&gt; { if(ref.current.offsetTop &lt;= (scrollPos + 200)) { client.writeData({data: { curChapter: chapter.num, curArticle: id, curProgram: program.name }}); } }); if(active === false) return ( // Inactive Article &lt;div className='section-item' ref={ref}&gt; &lt;h2&gt;{title.toUpperCase()}&lt;/h2&gt; &lt;ReactMarkdown source={content} /&gt; &lt;br /&gt; &lt;/div&gt; ) return ( // Active Article &lt;div className='section-item active' ref={ref}&gt; &lt;h2&gt;{title.toUpperCase()}&lt;/h2&gt; &lt;ReactMarkdown source={content} /&gt; &lt;br /&gt; &lt;/div&gt; ) } </code></pre> <p>As a Result, I faced this warning.</p> <blockquote> <p>Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.</p> </blockquote> <p>I think this is the reason of issue?!</p>
0non-cybersec
Stackexchange
What is the different effect of using a different baking temperature on your steak?. I'm having a hard time understanding what the different effects will be from using different temperatures while baking a steak in an oven. What are the pros/cons/different effects of different temperatures?
0non-cybersec
Reddit
Can anyone explain the scientific reason why soups/sauces grow a "skin"?.
0non-cybersec
Reddit
"Gas LOL" Oregon version.
0non-cybersec
Reddit
Expect to raise_error and test fails because it raises this error. <p>I have simple test case:</p> <pre><code>it "is removed when associated board is deleted" do link = FactoryGirl.create(:link) link.board.destroy expect(Link.find(link.id)).to raise_error ActiveRecord::RecordNotFound end </code></pre> <p>And it fails with output: </p> <pre><code>1) Link is removed when associated board is deleted Failure/Error: expect(Link.find(link.id)).to raise_error ActiveRecord::RecordNotFound ActiveRecord::RecordNotFound: Couldn't find Link with id=1 # ./spec/models/link_spec.rb:47:in `block (2 levels) in &lt;top (required)&gt;' </code></pre> <p>Any idea why ?</p>
0non-cybersec
Stackexchange
git pull remote master in detached head. <p>This has been bothering me about git. I have a repository with multiple remotes, and I need to apply hotfixes to the remotes' master branches. So, I try doing:</p> <pre><code>git fetch remote1 master git checkout remote1/master </code></pre> <p>But, I always end up in a detached head state. What is the correct way to checkout the master of a remote and apply a patch?</p>
0non-cybersec
Stackexchange
Unable to boot EFI image off flash drive. <p>I am at my wit's end. I'm trying to install Windows (7 or 8, I've tried both) on my Dell Latitude E6430. I currently have Xubuntu 15.04 installed with Grub <code>2.02~beta2-22ubuntu1.1</code>. I want to dual-boot Xubuntu with Windows and I have allocated a partition for Windows.</p> <p>My problem is, I am unable to boot my Windows install media in EFI mode. My SSD has GPT, so I need to boot the Windows installer in an EFI mode, legacy will not work. I have tried creating install media using the following methods:</p> <h1>On my Xubuntu system</h1> <ul> <li><strong><code>ms-sys -7</code> and dropping the ISO contents on to the USB drive</strong> <em>This produced an image that could only be booted with legacy-boot.</em></li> <li><strong><code>ms-sys -n</code> and dropping the ISO contents on to the USB drive</strong> <em>This was not bootable.</em></li> <li><strong>unetbootin</strong> <em>I could not get any Windows install media to boot that was created with unetbootin</em></li> </ul> <h1>On a normal Windows System</h1> <ul> <li><strong><a href="https://rufus.akeo.ie/" rel="nofollow noreferrer">Rufus</a></strong> <em>This seemed to be the closest I got to working... I was able to manually use the UEFI boot settings on my computer to browse for the <code>bootmgr.efi</code> file on my USB drive when I created the image with Rufus. Unfortunately, when I tried to boot this way, I was told that the computer could not boot the selected media.</em></li> </ul> <p>In all cases, the install media would never show up in my list of boot options automatically, and the only time it would show up at all was after I manually added the rufus-created entry.</p> <p>Failing the traditional boot path, I thought I may be able to create a temporary grub entry that would boot my USB drive. The entry that I tried to use was:</p> <pre><code>insmod usbms insmod part_gpt insmod part_msdos insmod fat insmod search_fs_uuid insmod chain set root='(hd1,1)' search --no-floppy --fs-uuid --set 749A5FBD9A5F7A96 chainloader (${root})/bootmgr.efi </code></pre> <p>I also tried versions pointing to just about every <code>.efi</code> file on the USB drive. I used the grub <code>ls</code> command to verify that the files I was trying to boot actually existed, but they would all give me the same message, a very long string of path info terminated with:</p> <pre><code>/EndEntire error: cannot load image. </code></pre> <p>I am going insane, could someone lend some advice?</p> <p>EDIT: I have since been able to get the flash-drive recognized. Here are some photos of my process:</p> <p>This is my UEFI config menu, you can see that I'm choosing the <code>BOOTX64.EFI</code> file for this entry. <a href="https://i.stack.imgur.com/Tn7Sb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tn7Sb.jpg" alt="BIOS Menu"></a></p> <p>Finally the flash drive was recognized automatically, but when I tried to boot it... <a href="https://i.stack.imgur.com/0KqGA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0KqGA.jpg" alt="Recognized Flash Drive"></a></p> <p>Nothing. This is as far as I've ever gotten with a UEFI boot so far. <a href="https://i.stack.imgur.com/Tw4Ki.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tw4Ki.jpg" alt="FAIL"></a></p>
0non-cybersec
Stackexchange
How to make homemade old-tyme root beer from scratch..
0non-cybersec
Reddit
Why would a RAID5 rebuild fail?. <p>I have a IBM System x3650 server with a ServeRaid controller and two RAID5 arrays, each consisting of 3 disks.</p> <p>Yesterday, one disk failed (It was the Raid array that holds the data, the system is located on the sound array). I naively trusted the RAID controller in rebuilding the array. I shut down the server, replaced the failed disk with a new similar. I booted in the controller bios, where I could see that it recognized the new disk and was ready to rebuild (I had nothing to do, everything was automatic). I started the server and it rebuilt the array.</p> <p>This morning everything seemed OK. The rebuild was finished, the array seemed sound. Only a few hours later, the mysql service crashed with a corrupted database. I managed to dump the data partially and restored the rest from backup. I thought I was OK.</p> <p>But then I found that some active logfiles were corrupt: they included blocks from different random files. If I appreciate the situation correctly, only files modified since the rebuild has started are corrupted, but I'm not yet 100% sure for this. Somehow, the rebuild must have corrupted the data.</p> <p>I ask this question to learn out of error. I hope the next time will be never...</p> <p>What can be the reason that the rebuild failed ? What can I do better next time ?<br> Is it compulsary to cut the server from the network during rebuild ? I thought, the controller should manage concurrently rebuild and make ordinary reads and writes.<br> Or shouldn't this never happen, and maybe the controller is faulty ?</p>
0non-cybersec
Stackexchange
People are too obsessed with finding a romantic partner. I'm subscribed to sub-reddits like depression/offmychest/lonely/needafriend and I often see stuff like "I'm so lonely because I have no woman in my life" or some other kind of statement revolving around being upset/depressed/lonely because they have no partner. However, I feel that's the wrong way to go about yourself. While I don't know enough about these people to assert I know anything about their life, you'd be amazed how similar peoples' lives are in regards to specific qualities of life when they're subscribed to some of the same sub-reddits. I'm going to take a guess that these people who are lonely because they don't have a partner ALSO don't really have that many friends. I was, for a while, a bit depressed because I was worried I'd never find a partner, settle down, have kids, and do the whole shebang. I came to a realization that there's more to life than doing what everyone else does and getting married young and having kids. Sure, you might be missing out on romantic love, but the (excuse me if I start to sound a bit cheesy) love you give and receive to other people in your life, your friends for example, can be just as powerful as romantic love if you let it. I don't have many friends, and I have even fewer close friends. But for the first time in my life since I was in elementary school, I can say I have a best friend again. It's been 10 years since I've had a friend I'd trust with my life, but I have one now. We don't hang out much outside of work, but he's my best friend and I love him. I would feel confident putting my life in his hands. And all my other friends, the few of them at least, I know they appreciate who I am and get joy out of who I am and I get joy out of who they are. For that, I love them. When I feel lonely for not having a partner in my life, I quickly smack myself out of it by remembering I do have people I love and people who love me in life and I carry on with my day content with that fact. So cheer up folks, there's more than 1 kind of love out there and you don't to settle with just one nor do you need all of them. edit: As a note to anybody who might feel offended because they're lonely but also desire someone else: I'm not referring to you in this post. I understand what it feels like, so don't assume I'm so cold as to downplay your personalities.
0non-cybersec
Reddit
[I ate] Japanese Yakiniku. Kobe beef, pork cheeks, skirt steak, ribeye, pork belly, and beef carpaccio!.
0non-cybersec
Reddit
Migrate data from an older version of mongodb. <p>How can I backup and restore a large mongodb database (500GB) from a server running an older version (v2.6) than the target one (v3.6)?. The downtime is critical.</p> <p>We've tried by making a straight copy of the data files as well as filesystem snapshot, but these two methods result in incompatibility issues.</p>
0non-cybersec
Stackexchange
Amazon pauses new grocery signups, hires another 75,000 workers.
0non-cybersec
Reddit
Cain and Abel download.
1cybersec
Reddit
I'm high for the first time ever ha. Hi guys I've just gotten high for the first time in my life and I thought I would let you know how I feel. Everything tingles and my eyes are throbbing. I have pins and needles in my hands and tongue and mouth and my lips. My friends are here and they don't know we snuck off to get high but I reckon they've worked it out. I saw one of them send a text to the other then laugh and look at me. I can feel my heart throbbing in my heart. And the sun feels hot then cold then hot. I can't focus on something cos it feels like I'm looking through a blurry film and I'm watching a film. I try and concentrate but before I'm concentrated I go to something else. It's like at night where you're trying really hard to get to sleep and you're focussing so much on it that before you know it you've started to get to something else. You can't finish a though. Cos you've moved to skmefb else. And then you realise you've ignored reality for a bit and get jerked back. Your mind moves faster than your hands. Time is moving in slow motion. I've got the munchies but I'm not hungry, I just have a rubbish taste in my mouth and I'm hungry. I can't feel my hand on my face. Sound is quieter and reality is quieter. Deep lol. Ok I am hungry. My friends keep talking about drugs and how we aren't the type so they dint know. Unless they do know. And they're trying to work it out.ok I am hungry. Said that twice now have I lol? If I go get food know they will know for definite.I think the weed was off cos it burnt a lot and I hurt and coughed. Or maybe because I'm new. You've got to be articulate. I think I just rubbed my eyeliner off. I'm talking g ceap now so I'm gonna see you later. I Sony know if this is against the rules then if it is then sorry mods but please save it before you delete it so I can see it later thanks xx. I'm gonna get suncream now so I dint burn bye x
0non-cybersec
Reddit
A pilot took this image recently while flying over Munich, Germany..
0non-cybersec
Reddit
Ordering Balls of $N$ Types. <p>Given $a_n$ balls of type $n$ (for each $n$ between $1$ and $N$) how many ways of ordering them into an array of length $\sum_n a_n$ given that balls of the same type are indistinguishable?</p> <p>(Edit: some of the $a_n$'s may be null). </p>
0non-cybersec
Stackexchange
Show that $\lim_{n}\sum_{k=n}^{2n}{1\over k} = \ln2$ using elementary methods.. <blockquote> <p>Prove that: <span class="math-container">$$ \lim_{n\to\infty}\left({1\over n} + {1\over n+1} + \cdots + {1\over 2n} \right) = \ln2 $$</span></p> </blockquote> <p>I would like to show that using elementary methods, since I'm not allowed to even use derivatives, not to mention integrals.</p> <p>Before this one, I've been able to show that: <span class="math-container">$$ \exists\lim_{n\to\infty}\left(1 + {1\over 2} + {1\over 3} + \cdots + {1\over n} - \ln n\right) = L \tag 1 $$</span></p> <p>Since the expression in <span class="math-container">$(1)$</span> under the sign of limit is bounded below and is monotonically decreasing, then by monotone convergence theorem it must converge to some number (which appeared to be named the Euler-Mascheroni constant.)</p> <p>Now since <span class="math-container">$(1)$</span> converges then it must satisfy Cauchy's Criteria. Let's define the following sequence: <span class="math-container">$$ x_n = 1 + {1\over 2} + {1\over 3} + \cdots + {1\over n} - \ln n $$</span></p> <p>Then <span class="math-container">$x_{2n}$</span> is defined as follows: <span class="math-container">$$ x_{2n} = 1 + {1\over 2} + {1\over 3} + \cdots + {1\over 2n} - \ln (2n) $$</span></p> <p>But both limits exist and are equal, which implies that: <span class="math-container">$$ \exists\lim_{n\to\infty}|x_{2n} - x_n| = 0 \tag2 $$</span></p> <p>Now performing some algebraic manipulations on <span class="math-container">$(2)$</span> one may obtain: <span class="math-container">$$ \begin{align} |x_{2n} - x_n| &amp;= \left|\sum_{k=1}^{2n}{1\over k} - \sum_{k=1}^{n}{1\over k} -\ln(2n) + \ln n\right|\\ &amp;=\left|\sum_{k=n+1}^{2n}{1\over k} - (\ln(2n) -\ln n)\right| \\ &amp;=\left|\sum_{k=n+1}^{2n}{1\over k} - \ln 2\right| \end{align} $$</span></p> <p>Since <span class="math-container">$|x_{2n} - x_n|$</span> is convergent to <span class="math-container">$0$</span> then: <span class="math-container">$$ \forall \epsilon &gt; 0\ \exists N\in\Bbb N: \forall n\ge N \implies |x_{2n} - x_n| = \left|\sum_{k=n+1}^{2n}{1\over k} - \ln 2\right| &lt; \epsilon $$</span></p> <p>Which is a standard definition of the limit, hence: <span class="math-container">$$ \lim_{n\to\infty}\sum_{k=n}^{2n}{1\over k} = \ln 2 $$</span></p> <p>I would like to ask for verification of the proof above, and/or point to mistakes in case of any. Thank you!</p> <p><strong>Note:</strong> This problem is given among other problems in the "Limit of numerical sequences" section. Long before the definition of the Integral is given.</p>
0non-cybersec
Stackexchange
Variety of views around Venice.
0non-cybersec
Reddit
Looking for a jacket similar to this for less than $150.
0non-cybersec
Reddit
Caraibi di Puglia - Punta prosciutto Porto Cesareo - ActionCam.
0non-cybersec
Reddit
Rails 5 logstash produces too many log items instead of one. <p>Is there any way I can customize the way standard errors are being logged? Starting with Rails 5, logstash receives one fatal error as a lot of error items. Rails 4 only created one item (The way I liked it)</p> <p>The problem seems to be, that since Rails 5, the <code>log_error</code> method of the <code>DebugExceptions</code> middleware prints all lines of the backtrace calling <code>logger.fatal</code> separately, instead of Rails 4, which joins all lines to one string before calling <code>logger.fatal</code> only once.</p> <p>Compared:</p> <p>Rails 4: <a href="https://github.com/rails/rails/blob/4-2-stable/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb#L79" rel="noreferrer">debug_exceptions.rb</a></p> <pre><code>message = "\n#{exception.class} (#{exception.message}):\n" message &lt;&lt; exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code) message &lt;&lt; " " &lt;&lt; trace.join("\n ") logger.fatal("#{message}\n\n") </code></pre> <p>Rails 5: <a href="https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb#L161" rel="noreferrer">debug_exceptions.rb</a></p> <pre><code>logger.fatal " " logger.fatal "#{exception.class} (#{exception.message}):" log_array logger, exception.annoted_source_code if exception.respond_to?(:annoted_source_code) logger.fatal " " log_array logger, trace </code></pre> <p>I'm using <a href="https://github.com/dwbutler/logstash-logger" rel="noreferrer">logstash-logger</a> with the <code>:json_lines</code> formatter over UDP.</p> <p>The logstash configuration I use is working perfectly for rails 4 and other applications, but not for rails 5 (as it separates one error into several).</p> <p>I know, I could use <code>rescue_from</code> to rescue errors in controllers, but this would not catch errors on routing or others, I guess?</p> <p>Thank you in advance.</p>
0non-cybersec
Stackexchange
Safely remove USB modem?. <p>In short: before unplugging a USB modem, should I take any action to make the removal safe?</p> <p>I received a HUAWEI-367, it worked great the first day. The next morning the modem was very warm and had no internet connection. I tried to re-connect but it did not work, however it was blinking and Ubuntu did recognize I had a USB modem plugged. So I unplugged it and re-plugged it. However now it was as if the usb-device had died.</p> <p>Ubuntu no longer recognized it and no modem-lights were showing. I also tried plugging it in on a Mac and nothing was mounted. It could be that the device was a faulty one and broke due to the heat. However I am afraid that it was me unplugging it without first somehow unloading the device properly which caused it to break (perhaps writing random data to the firmware or something). On the other hand, I previously had a different HUAWEI model which I frequently unplugged and replugged without any problems.</p> <p>Now I would like to unplug my modem but I am not sure how to do it and I would not like to break another one.</p>
0non-cybersec
Stackexchange
KDE4 configuration via file?. <p>For quite some time I've got the following problem: on my desktop I placed a special folder view app (see screenshot). I cannot resize or move it in any way when the apps/ bars are in unlocked mode. </p> <p>I find the overall configuration a bit unhandy - is it somehow possible to configure one's desktop in a text-based fashion? Is there some other way to "debug" the desktop?</p> <p><img src="https://i.stack.imgur.com/2TvoZ.png" alt="Screenshot"></p>
0non-cybersec
Stackexchange
What would go good with this shirt that is not a gray zip-up hoodie?. [There's a couple pictures](http://imgur.com/bpY6q,reuBq#0). I want something that I can wear around the shirt, like that is long sleeved. Would a white zip-up hoodie or a black one look good? I'm thinking that would look too sloppy, but maybe I'm wrong. [Here it is with a cardigan](http://i.imgur.com/Qnfrn.jpg). Does it work? Perhaps it's too hipster? Thanks!
0non-cybersec
Reddit
Nginx : autoindex not working. <p>Hello all I'm following a guide <a href="https://www.youtube.com/watch?v=7QXnk8emzOU" rel="nofollow noreferrer">https://www.youtube.com/watch?v=7QXnk8emzOU</a> and exactly did everything same and I've checked other similar problems such as <a href="https://serverfault.com/questions/580711/nginx-autoindex-doesnt-work">nginx autoindex doesn&#39;t work</a> and <a href="https://serverfault.com/questions/347815/issues-with-nginx-autoindex">Issues with nginx autoindex</a> .</p> <p>Configuration file of nginx :</p> <pre><code>server { listen 80; #says to listen on standard port server_name _; #the default server location / { #location is the root of the site root /test/a/; #root is located at /test/a/ index index.htm; #index is for autocomplete autoindex on; #this way files will be autoindexed } } </code></pre> <p>The html files are located at <code>/test/a</code>, one is <code>/test/a/index.htm</code>, other is <code>/test/a/outdex.htm</code>. I see the content of index.htm when I connect to IP of server.</p> <p>I have recursively changed permissions of all the content for avoiding permission issues earlier as : </p> <p><code>chmod 777 -R /test</code></p>
0non-cybersec
Stackexchange
Extracting set properties from the Cayley Table to easily prove associativity. <p>I am aware of <a href="https://math.stackexchange.com/questions/168663/is-there-an-easy-way-to-see-associativity-or-non-associativity-from-an-operation">Light's associativity test for Cayley tables</a>, but I am wondering, is there a clever way to deduce associativity from the set's properties / presentation that permits one to not have compute every single product?</p> <p>I had a problem that involved deducing whether or not a set is associative given its Cayley table, and, upon confirming with my professor that one indeed has to compute every single product (64 of them!?), he mentioned that such a problem can be greatly simplified by observing certain patterns that seem to emerge in the table (i.e. the set's properties). Can someone give me an example of such a case where this happens?</p> <p>Thanks in advance.</p>
0non-cybersec
Stackexchange
Can able to install Linux Headers (Kali Linux)?. <p>How to install Kali Linux header? I used this command <code>apt-get update &amp;&amp; apt-get install -y linux-headers-$(uname -r)</code>, but it was showing the below error </p> <pre><code>E:unable to locate package linux-headers-4.6.0-kali1-686 pae' E: could not find any package by glob 'linux-headers-4.6.0-kali1-686 pae' E: could not find any package by regex 'linux-headers-4.6.0-kali1-686 pae' </code></pre>
0non-cybersec
Stackexchange
Who is using the MVVM architecture for large applications?. <p>I am currently working on an LOB application which I am basing on the MVVM architecture. Going by the answers to the questions I'm asking, it seems like there are not that many people building <em>large</em> and/or <em>complex</em> applications in MVVM.</p> <p>Hopefully, there is a number of you who have built such animals. If so, have you found that MVVM scales?</p>
0non-cybersec
Stackexchange
Convergence of the integral $\int_0^\infty \frac {2x+14}{x^3+1}dx$. <blockquote> <p>Theorem $1:$<br> Suppose $0\leq f(x)\leq g(x)$ for all sufficiently large $x$.<br> If $\int_a^\infty g(x)dx $ converges, so does $\int_a^\infty f(x)dx $<br> If $\int_a^\infty f(x)dx $ diverges, so does $\int_a^\infty g(x)dx $</p> <p>Theorem $2:$ If $0\leq f(x)\leq Cx^{-p}$ for all sufficiently large $x$, where $p\gt 1$, then $\int_a^\infty f(x)dx $ converges. </p> <p>Note also that $\int_1^\infty x^{-p}dx$ converges iff $p\gt 1$</p> </blockquote> <p>Now, in the book (using theorem $2$) it says the integral $$\int_0^\infty \frac {2x+14}{x^3+1}dx$$ converges because $$\frac {2x+14}{x^3+1}\leq \frac {4x}{x^3}=\frac {4}{x^2} , \qquad for \quad x\geq 7$$ What if I wanted to use theorem $1$? I know that $\int_1^\infty x^{-2}dx$ converges and $\frac {2x+14}{x^3+1}\leq {4}{x^{-2}} , \qquad for \quad x\geq 7$ </p> <p>However in theorem $1$ it says that "If $\int_a^\infty g(x)dx $ converges, so does $\int_a^\infty f(x)dx $": Here the lower bounds of the integrals are the same, but in our example the lower bound of the integral is $0$ in $\int_0^\infty \frac {2x+14}{x^3+1}dx$ and it is $1$ in $\int_1^\infty x^{-2}dx$. Doesn't this make any difference?<br> I also saw a remark which is: </p> <blockquote> <p>If $c\gt a$, the convergence of $\int_a^\infty f(x)dx$ is equivalent to that of $\int_c^\infty f(x)dx $ </p> </blockquote> <p>So can we say that the convergence of $\int_0^\infty \frac {2x+14}{x^3+1}dx$ is equivalent to the convergence of $\int_1^\infty \frac {2x+14}{x^3+1}dx$ so that now theorem $1$ can be applied correctly?</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
Some people just gotta chill out.
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
How can I get PyCharm to recognize the static files?. <p>I have one Django project that looks like:</p> <pre><code>/.idea /clients /app /static coin.png /templates index.html __init__.py urls.py /clients settings.py manage.py </code></pre> <p>In index.html I have (I can see the image on render):</p> <pre><code>{% load staticfiles %} &lt;img src="{% static 'coin.png' %}"&gt; </code></pre> <p>Relevant parts of settings.py:</p> <pre><code>STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static/') STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(os.path.dirname(__file__), '../static/'), ) INSTALLED_APPS = ( 'django.contrib.staticfiles', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.static', ) </code></pre> <p>In project structure I've added <code>/clients</code> since the root of the Django project is one level up from the repo root. However all my <code>{% static %}</code> uses in this project keep getting highlights as not existing even though Django can find them. Ideas on how to resolve this?</p>
0non-cybersec
Stackexchange
Pickup: Timbz.
0non-cybersec
Reddit
[WP] Humanity has recently joined the intergalactic community but has to make ends meet by being the galaxy's off-planetary-system customer service/tech support call-center.
0non-cybersec
Reddit
Problem upgrading from 16.04 LTS to 18.04 LTS. <p>I'm running 16.04 LTS (upstart) on a Dell T5600 computer. When I tried to upgrade to 18.04 LTS, I got the following:</p> <pre><code>pm@T5600U:~$ sudo do-release-upgrade Checking for a new Ubuntu release Get:1 Upgrade tool signature [819 B] Get:2 Upgrade tool [1,246 kB] Fetched 1,247 kB in 0s (0 B/s) authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg' extracting 'bionic.tar.gz' Reading cache Checking package manager Reading package lists... Done Building dependency tree Reading state information... Done Hit http://us.archive.ubuntu.com/ubuntu xenial InRelease Hit http://packages.microsoft.com/repos/vscode stable InRelease Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] Ign http://dl.google.com/linux/chrome/deb stable InRelease Get:2 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB] Hit http://dl.google.com/linux/chrome/deb stable Release Fetched 325 kB in 0s (0 B/s) Reading package lists... Done Building dependency tree Reading state information... Done Restoring original system state Aborting Reading package lists... Done Building dependency tree Reading state information... Done pm@T5600U:~$ </code></pre> <p>What am I doing wrong?</p>
0non-cybersec
Stackexchange
This guy has saved over 1,500 puppies by flying them up from kill shelters hundreds of miles away..
0non-cybersec
Reddit
I don't know about you guys, but I am so excited for Shadowlands!.
0non-cybersec
Reddit
vim fortran indentexpr issue. <p>Strange issue here with getting <code>indentexpr=FortranGetFreeIndent()</code> to be set correctly.</p> <p>The first time I open a file (free form, of course), say <code>new.f90</code>, <code>:set</code> gives </p> <pre><code>:set --- Options --- autoindent filetype=fortran incsearch smartcase autowrite helplang=en mouse=a syntax=fortran background=dark hidden ruler textwidth=72 backup history=500 shiftwidth=3 ttyfast comments=:!,:*,:C hlsearch showcmd ttymouse=xterm2 commentstring=!%s ignorecase showmatch backspace=indent,eol,start fileencodings=ucs-bom,utf-8,default,latin1 formatoptions=tcql include=^\c#\=\s*include\s\+ indentexpr=FortranGetFixedIndent() indentkeys=0{,0},:,0#,!^F,o,O,e,=~end,=~case,=~if,=~else,=~do,=~where,=~elsewh ere,=~select,=~endif,=~enddo,=~endwhere,=~endselect,=~elseif,=~type,=~interface, =~forall,=~associate,=~block,=~enum,=~endforall,=~endassociate,=~endblock,=~ende num printoptions=paper:letter runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/ vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg ,.inx,.out,.toc suffixesadd=.f95,.f90,.for,.f,.F,.f77,.ftn,.fpp Press ENTER or type command to continue </code></pre> <p>Now, if I manually <code>:set indentexpr=FortranGetFreeIndent()</code> and then write some code</p> <pre><code>program testfree print *,"Test free format" end program testfree </code></pre> <p>then the next time I open the file, <code>:set indentexpr</code> gives <code>indentexpr=FortranGetFreeIndent</code>.</p> <p>So it appears that "signs are detected in the first five columns of the first 25 lines" (comment quoted from 'fortran.vim') but that the file extension isn't being recognized as .f90 implying free form.</p> <p>Thanks for your help.</p>
0non-cybersec
Stackexchange
A Simple Stochastic Dynamic Billiard. <p>Consider the following stochastic dynamical system. </p> <p>Fix $a &gt; 0$, $b &gt; 0$, and $v &gt; 0$, and let $\mathbf{r}(t)=(x(t),y(t))$ be the position at time $t$ of a point which moves in the rectangle $R=\{ (x,y) \in \mathbb{R}^2: 0 \leq x \leq a, 0 \leq y \leq b \}$ with velocity of constant magnitude $v$ a according to the following rules:</p> <p>(i) in the interior of $R$ the point is subject to no force, so that is moves with constant velocity $(v_x(t), v_y (t)) = \mathbf{v}(t)=\frac{d\mathbf{r}}{dt}(t)$;</p> <p>(ii) when the point reaches the vertical side of $R$ corresponding to $x=0$ it is reflected diffusely, that is its velocity after the collision has always magnitude $v$, and the oriented angle $\theta$ that the versor $\mathbf{i}=(1,0)$ makes with the velocity $\mathbf{v}$ after the collision is uniformly distributed over $[-\pi/2,\pi/2]$;</p> <p>(iii) if the point reaches any other side of $R$, then it is reflected elastically, that is in the case of the vertical side corresponding to $x=a$ the $y$-component of $\mathbf{v}$ is preserved, while the $x$-component of $\mathbf{v}$ changes sign, while in the case of either of the two horizontal sides the $x$-component of $\mathbf{v}$ is preserved, while the $y$-component of $\mathbf{v}$ changes sign;</p> <p>(iv) finally, if the point reaches one of the vertices of $R$, then the reflection must be thought as the combination of two reflections by the the two edges involved; so e.g. if the point hits the vertex $(0,0)$ then it is reflected diffusely, that is its velocity after the collision has always magnitude $v$, and the oriented angle $\theta$ that the versor $\mathbf{i}=(1,0)$ makes with the velocity $\mathbf{v}$ after the collision is uniformly distributed over $[0,\pi/2]$; if instead the point hits e.g. the vertex $(a,0)$ then its velocity $\mathbf{v}$ before the collision is changed in $-\mathbf{v}$.</p> <p>Consider a time $T&gt; 0$, and let $N(T)$ be the number of time the point touches the vertical side of $R$ corresponding to $x=a$ (you can compute or not in $N(T)$ the times the point touches one of the vertices of this side: it should make no essential difference for what we want to prove, I think). Let $\theta_j$ be the angle that the velocity $\mathbf{v}$ just before the collision makes with $\mathbf{i}$ the $j$-th time the point touches the vertical sides of $R$ corresponding to $x=a$ (or one of its vertices, if you have considered also them in the computation of $N(t)$), and form the random sum \begin{equation} \sum_{j=1}^{N(T)} cos \theta_j. \end{equation} I would like to prove that for any initial conditions $(\mathbf{r}(0), \mathbf{v}(0))$, with $v_{x}(0) \neq 0$, the following equation holds \begin{equation} \lim_{T \rightarrow \infty} \frac{1}{T} E \left[ \sum_{j=1}^{N(T)} cos \theta_j \right] = \frac{v}{4 a}. \end{equation}</p> <p>Any help is welcome. For now, I have no idea about a possible proof.</p> <p>NOTE. This problem has been suggested to me by an interesting proof of a physical law called Wien's displacement law given by Richtmyer, Kennard and Cooper in their book "Introduction to Modern Physics", Sixth Edition, Appendix of Chapter 5 (see in particular p. 145). I formulated a first model of dynamic stochastic billiard in my post <a href="https://mathoverflow.net/questions/282145/a-stochastic-dynamical-billiard">Stochastic Dynamic Billiard</a>, but it was considerably more complicated. Then I realized that the simplest model above could be a good formulation of the physical system as well. In the obvious three-dimensional version of this model, in which the point moves inside a parallelepiped, whose face corresponding to $x=0$ reflect diffusely (that is $v$ remains unchanged and $\mathbf{v}/v$ is uniformly distributed over a hemisphere) while all other faces (and all the edges and vertices) reflect elastically, we should get</p> <p>\begin{equation} \lim_{T \rightarrow \infty} \frac{1}{T} E \left[ \sum_{j=1}^{N(T)} cos \theta_j \right] = \frac{v}{6 a}, \end{equation}</p> <p>which has a deep thermodynamical meaning (see the reference above and also ter Haar and Wergeland, Elements of Thermodynamics, $\S 5.3.3$).</p>
0non-cybersec
Stackexchange
Darth Vader Sith Lord Unlimited fan art print.
0non-cybersec
Reddit
Delete lines from a file which opened in less mode. <p>I have a file (huge size) which cannot be opened in <code>vi</code> but in <code>less</code> mode and I want to delete the lines which I do not required. But I am unable to delete lines from file open in <code>less</code> mode.</p> <p>Please suggest how can I delete lines in <code>less</code> mode</p>
0non-cybersec
Stackexchange
Outlook 2007 - Move to Folder Function. <p>Until recently, when I opened the Move To Folder function in Outlook 2007, the last accessed file folder would be highlighted. That made it easy to move another file there which happens often whenever a back and forth thread is going on.</p> <p>Last week, all of a sudden, when I open Move To Folder, it highlights one particular folder, one I almost never use. Even if I had just moved a folder into a different folder, it comes up on the same obscure one. </p> <p>I’ve tried ever thing I know to reset it to the previous default with no luck.</p>
0non-cybersec
Stackexchange
How can I remove a non-existent/lost device from firefox sync?. <p>I recently reinstalled both Windows and Linux from my home PC, and, as expected, I didn't deactivate any of the devices from Firefox sync before formatting. Now, when I look at "Tabs from others computers", I still see the data from the old (and lost) installations. Is there any easy way to get rid from these computers on sync?</p>
0non-cybersec
Stackexchange
Questions about the details of Abel&#39;s theorem. <p>This is an extract of Wikipedia's page on Abel-Ruffini theorem</p> <blockquote> <p>The following proof is based on Galois theory. Historically, Ruffini and Abel's proofs precede Galois theory.</p> <p>One of the fundamental theorems of Galois theory states that an equation is solvable in radicals if and only if it has a solvable Galois group, so the proof of the Abel–Ruffini theorem comes down to computing the Galois group of the general polynomial of the fifth degree.</p> <p>Let $y_1$ be a real number transcendental number|transcendental over the field of rational numbers $Q$, and let $y_2$ be a real number transcendental over $Q(y_1)$, and so on to $y_5$ which is transcendental over $Q(y_1, y_2, y_3, y_4)$. These numbers are called independent transcendental elements over Q. Let $E = Q(y_1, y_2, y_3, y_4, y_5)$ and let</p> <p>$ f(x) = (x - y_1)(x - y_2)(x - y_3)(x - y_4)(x - y_5) \in E[x]. $</p> <p>Multiplying $f(x)$ out yields the elementary symmetric functions of the $y_n$</p> <p>$$ s_1 = y_1 + y_2 + y_3 + y_4 + y_5 $$ $$ s_2 = y_1y_2 + y_1y_3 + y_1y_4 + y_1y_5 + y_2y_3 + y_2y_4 + y_2y_5 + y_3y_4 + y_3y_5 + y_4y_5 $$ $$ s_3 = y_1y_2y_3 + y_1y_2y_4 + y_1y_2y_5 + y_1y_3y_4 + y_1y_3y_5 + y_1y_4y_5 +y_2y_3y_4 + y_2y_3y_5 + y_2y_4y_5 + y_3y_4y_5 $$ $$ s_4 = y_1y_2y_3y_4 + y_1y_2y_3y_5 + y_1y_2y_4y_5 + y_1y_3y_4y_5 + y_2y_3y_4y_5 $$ $$ s_5 = y_1y_2y_3y_4y_5. $$ The coefficient of $x^n$ in $f(x)$ is thus $(-1)^{5-n} s_{5-n}$. Because our independent transcendentals $y_n$ act as indeterminates over $Q$, every permutation $\sigma$ in the symmetric group on 5 letters $S_5$ induces an automorphism $\sigma'$ on $E$ that leaves $Q$ fixed and permutes the elements $y_n$. Since an arbitrary rearrangement of the roots of the product form still produces the same polynomial, e.g.</p> <p>$ (y - y_3)(y - y_1)(y - y_2)(y - y_5)(y - y_4) $</p> <p>is still the same polynomial as</p> <p>$ (y - y_1)(y - y_2)(y - y_3)(y - y_4)(y - y_5) $</p> <p>the automorphisms $\sigma'$ also leave $E$ fixed, so they are elements of the Galois group $G(E/Q)$. Now, since $|S_5| = 5!$ it must be that $|G(E/Q)| \ge 5!$, as there could possibly be automorphisms there that are not in $S_5$. However, since the relative automorphisms $Q$ for splitting field of a quintic polynomial has at most 5! elements, $|G(E/Q)| = 5!$, and so $G(E/Q)$ must be isomorphism|isomorphic to $S_5$. Generalizing this argument shows that the Galois group of every general polynomial of degree $n$ is isomorphic to $S_n$.</p> <p>And what of $S_5$? The only composition series of $S_5$ is $S_5 \ge &gt; A_5 \ge \{e\}$ (where $A_5$ is the alternating group on five letters, also known as the icosahedral group). However, the quotient group $A_5/\{e\}$ (isomorphic to $A_5$ itself) is not an abelian group, and so $S_5$ is not solvable, so it must be that the general polynomial of the fifth degree has no solution in radicals. Since the first nontrivial normal subgroup of the symmetric group on n letters is always the alternating group on n letters, and since the alternating groups on n letters for $n \ge 5$ are always simple group|simple and non-abelian, and hence not solvable, it also says that the general polynomials of all degrees higher than the fifth also have no solution in radicals.</p> <p>Note that the above construction of the Galois group for a fifth degree polynomial only applies to the ''general polynomial'', specific polynomials of the fifth degree may have different Galois groups with quite different properties, e.g. $x^5 - 1$ has a splitting field generated by a primitive root of unity|primitive 5th root of unity, and hence its Galois group is abelian and the equation itself solvable by radicals. However, since the result is on the general polynomial, it does say that a general "quintic formula" for the roots of a quintic using only a finite combination of the arithmetic operations and radicals in terms of the coefficients is impossible. Q.E.D.</p> </blockquote> <p>I understand all vocabulary used here, but my doubts are in the connection beetween the splitting field and the Galois group. Why the condition of normal group? Why the condition of abelian group?</p>
0non-cybersec
Stackexchange
Hellraiser Lego Animation.
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
Can robots be funny? AI and humour is a growing research field.
0non-cybersec
Reddit
Nasus' Q shouldn't cost any mana.
0non-cybersec
Reddit
Meat horror puns for Halloween.
0non-cybersec
Reddit
FluidDATA allows you to search for spoken phrases in millions of audio files in seconds..
0non-cybersec
Reddit
Why weights dont change K-mean cluster center position in sci-kit learn package?. <p>I am trying to calculate center position of a cluster with weights option. But weights seems not to work.</p> <p>Here is the simple script which represent the problem</p> <pre><code>X = [] weights = [] for x in range(-10,10): for y in range(-10,10): X+= [[x,y]] if x&gt;0 and y&gt;0: weights += [10000] else: weights += [1] X = np.array(X) weights = np.array(weights) kmeans = KMeans(n_clusters=1, random_state=0).fit(X,weights) print kmeans.cluster_centers_ </code></pre> <p>It prints <code>[[-0.5 -0.5]]</code> with weights <em>10000</em> in the 1st quarter.</p> <p>I expect it to be approx <code>(5,5)</code></p> <p>EDIT1: Trying to call fit() as:</p> <pre><code>fit(X,sample_weight=weights) </code></pre> <p>Returns:</p> <pre><code>TypeError: fit() got an unexpected keyword argument 'sample_weight' </code></pre> <p>Adding second variable, does not help either:</p> <pre><code>fit(X,None,weights) </code></pre> <p>Returns:</p> <pre><code>TypeError: fit() takes at most 3 arguments (4 given) </code></pre>
0non-cybersec
Stackexchange
Starting my second year of college and have still not made any friends. What can this painfully shy sophomore do before it's too late?. Last year, I was a total hermit in my dorm. Didn't join any clubs, would rarely ever stick around after class, never hung around the main campus much other than for class or studying. I'll be starting my second year at a large university soon. It's a "commuter" school so making friends is already difficult enough to come by. While I'm absolutely set on joining at least one club this year, I'm still not sure what else I should do to make friends or how to better approach people whom I want to befriend. My issue is that I'm terribly (and I mean TERRIBLY) shy around strangers. Once I get to know someone and am comfortable with them, being social is never a problem. It's the whole "Hi I'm So-And-So! How are you? What are your hobbies?" that irks me. I have no idea how some people in college are just able to sit down in the dining hall (or what have you) and begin conversations with people they've never met before that blossom into friendships. I often become very self-conscious the instant someone new starts talking to me and therefore can rarely carry conversations with strangers. Any advice on overcoming this problem in order to leave my dorm and establish some friendships before the habits from last year come settling back? TL;DR: I have a really bad inferiority complex when it comes to strangers and can't do small talk. Help me talk to people other than my dorm mates. Please.
0non-cybersec
Reddit
Taking the average of two years, written as [1858-60]. <p>There are a few cases where the date is written as 'created ca. 1858-60', where a human reader would understand it as 'created ca 1858-1860.'</p> <p>As such, imagine two integers representing years.</p> <pre><code>a = 1858 b = 60 </code></pre> <p>I want to be able to get <code>a+b == 1859</code>. </p> <p>I could parse them to strings, take the first two characters (<code>'18'</code>), concatinate the shorter string and parse them back to numbers, sure, but..that seems a bit round-a-bound. </p> <p>What would be the Pythonic way to deal with this? </p>
0non-cybersec
Stackexchange
Brilliant touch by the sky sports app for International Women’s Day.
0non-cybersec
Reddit
Upcoming Dub Releases in November 2012. [X-Post /r/AnimeDubs].
0non-cybersec
Reddit
YSK: If you go to your Reddit profile, and look under the history tab, there is an option to see "account activity", which shows the locations in which your account has been logged in through.. Just found it myself, and realized it was logged in somewhere in the UK... So, it's super curious and feel I should let others know of such a feature.
0non-cybersec
Reddit
Iron Baby.
0non-cybersec
Reddit
Change SVN commit message retroactively?. <p>I would like to re-write a big number of SVN commit messages to a different structure, e.g. prefix a category. From:</p> <p><code>"foo" now accepts "bar" format for connection string.</code></p> <p>I want</p> <p><code>core - database - "foo" now accepts "bar" format for connection string.</code></p> <p>Is there an easy way to do this that does <em>not</em> include dumping the whole repository using <code>svndumpfilter</code>?</p> <p>I am working with TortoiseSVN on the client end, and VisualSVN on the server end. (VisualSVN is a wrapper around classic <code>svn</code>, which I can talk to through the command line as well.)</p>
0non-cybersec
Stackexchange
มาร์ติเนซทวิตบอกแฟนบอลอาการเจ็บไม่หนักอย่างที่คิด เล่นฮอลิเดย์ผ่านเว็บ เวสต์แฮมเซ็นสัญญายืมเอเมนิเก้จบฤดูกาล.
0non-cybersec
Reddit
Automatic open new browser tab on Mac OS X. <p>Im trying to create a action in Automator, but I am not sure if its possible only use this software or I would need use applescript.</p> <p>I need to create a action for when I set a specific URL in some tab on my browser (preferred Firefox but could be Safari) it automatic open a new url in a new tab.</p> <p>Someone knows if its possible? And how can I do it?</p>
0non-cybersec
Stackexchange
Instal pecl_http: raphf installed but ./configure isn&#39;t seeing it. <p>I'm trying to install pecl_http as an extension to php. </p> <p>phpise is working fine as I'm getting the configure file out. When I go to type ./configure I get the following error message;</p> <pre><code>... checking openssl/crypto.h usability... yes checking openssl/crypto.h presence... yes checking for openssl/crypto.h... yes checking for gnutls support in libcurl... no checking for ares support in libcurl... no checking for bundled SSL CA info... /etc/ssl/certs/ca-certificates.crt checking for event2/event.h... found in /usr checking for libevent version, roughly... 2.0.19-stable checking for ext/raphf support... no configure: error: Please install pecl/raphf and activate extension=raphf.so in your php.ini </code></pre> <p>I've added the following line to my php.ini file</p> <pre><code>extension=raphf.so </code></pre> <p>I know raphf is installed and loading as I've checked it with the following php:</p> <pre><code>echo extension_loaded(raphf) ? "raphf loaded" : "raphf not loaded"; </code></pre> <p>Which comes back it is loaded. </p> <p>Why is ./configure not seeing raphf?</p>
0non-cybersec
Stackexchange
paragraph &quot;&lt;p&gt;&quot; padding not applied. <p>The following three pieces of code behave exactly the same:</p> <pre><code>&lt;p {padding: 0 15 0 15}&gt; A paragraph of text here... &lt;/p&gt; &lt;p&gt; A paragraph of text here... &lt;/p&gt; &lt;p style="padding: 0 15 0 15"&gt; A paragraph of text here... &lt;/p&gt; </code></pre> <p>How do I get the paragraph indented on both sides? (I tried 15px instead of 15 (EDIT - but only on the first two), I also tried separating the numbers with commas, like an example I found on Google.)</p> <p>The above code is in a div which is in the body, no other divs or tables, etc. are involved.</p> <p>The div is defined:</p> <pre><code>&lt;div style="background-color: white; color: black; overflow:auto"&gt; </code></pre> <p>Thanks for any help.</p>
0non-cybersec
Stackexchange
Does update from TestFlight works the same as the update from Appstore. <p>We have an app which is already published to the app store (v 1.1) and now we wants to release a new build with some updates (v 1.2). We have uploaded the new build to test flight. </p> <p>We wants to make upgrade test of v 1.2 over v 1.1 but we are not sure about what happens when we download app from TestFlight (v 1.2) over the already downloaded app from AppStore(v 1.1). </p> <p>will it behave same as the app update from the Appstore? or we need to do something else for upgrade test.</p> <p>According to apple we can upgrade test using adhoc builds. <a href="https://developer.apple.com/library/archive/technotes/tn2285/_index.html#//apple_ref/doc/uid/DTS40011323" rel="nofollow noreferrer">https://developer.apple.com/library/archive/technotes/tn2285/_index.html#//apple_ref/doc/uid/DTS40011323</a></p>
0non-cybersec
Stackexchange