text
stringlengths 36
35k
| label
class label 2
classes | source
stringclasses 3
values | tokens_length
int64 128
4.1k
| text_length
int64 36
35k
|
---|---|---|---|---|
Why none of my mp3's purchased from Amazon play correctly on my Samsung Phone using the Google Play app? How to Fix?. <p>How do I get my Google play music app to play my mp3's purchased from Amazon correctly?<br>
There is a continued skip throughout all the songs. Very annoying.<br>
Music that I have not purchased from Amazon Music play without problems. Leery of purchasing a converter license only to find it will not fix the problem. </p>
<p>Any suggestions? Am I the only one who has this problem? </p>
| 0non-cybersec
| Stackexchange | 133 | 519 |
A smart attack on SMTP evading fail2ban. <p>I have an ongoing brute-force attack on my SMTP server in a way that evades typical fail2ban settings: </p>
<ul>
<li>attacks take place from several IPs in the same subnet</li>
<li>a single IP attacks in intervals longer than an hour, apparently to evade being blocked by fail2ban that typically uses <code>findtime</code> and <code>bantime</code> shorter than an hour</li>
</ul>
<p>This is the log:</p>
<pre><code>2017-09-05 01:11:19 LOGIN authenticator failed for (User) [91.200.12.165]:57519 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=soft)
2017-09-05 01:11:36 LOGIN authenticator failed for (User) [91.200.12.164]:51973 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=sandy)
2017-09-05 01:15:22 LOGIN authenticator failed for (User) [91.200.12.121]:51545 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=brown)
2017-09-05 01:28:57 LOGIN authenticator failed for (User) [91.200.12.105]:64938 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=family)
2017-09-05 01:48:32 LOGIN authenticator failed for (User) [91.200.12.165]:64730 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=soi)
2017-09-05 01:48:47 LOGIN authenticator failed for (User) [91.200.12.164]:59184 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=sanjeev)
2017-09-05 01:50:13 LOGIN authenticator failed for (User) [91.200.12.166]:64999 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=until)
2017-09-05 01:54:05 LOGIN authenticator failed for (User) [91.200.12.121]:58756 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=bryan)
2017-09-05 02:04:34 LOGIN authenticator failed for (User) [91.200.12.105]:55772 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=famous)
2017-09-05 02:25:36 LOGIN authenticator failed for (User) [91.200.12.165]:55563 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=soldiers)
2017-09-05 02:25:48 LOGIN authenticator failed for (User) [91.200.12.164]:50017 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=sanmiguel)
2017-09-05 02:30:33 LOGIN authenticator failed for (User) [91.200.12.166]:55835 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=update)
2017-09-05 02:32:56 LOGIN authenticator failed for (User) [91.200.12.121]:49589 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=bsd)
2017-09-05 02:40:11 LOGIN authenticator failed for (User) [91.200.12.105]:62983 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=far)
2017-09-05 03:02:29 LOGIN authenticator failed for (User) [91.200.12.165]:62775 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=solution)
2017-09-05 03:02:40 LOGIN authenticator failed for (User) [91.200.12.164]:57228 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=santamaria)
2017-09-05 03:10:50 LOGIN authenticator failed for (User) [91.200.12.166]:63046 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=upgrade)
2017-09-05 03:11:37 LOGIN authenticator failed for (User) [91.200.12.121]:56803 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=bubba)
2017-09-05 03:15:41 LOGIN authenticator failed for (User) [91.200.12.105]:53820 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=farias)
2017-09-05 03:39:36 LOGIN authenticator failed for (User) [91.200.12.165]:53612 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=solve)
2017-09-05 03:39:48 LOGIN authenticator failed for (User) [91.200.12.164]:64441 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=santos)
2017-09-05 03:50:50 LOGIN authenticator failed for (User) [91.200.12.121]:64015 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=buchhaltung)
2017-09-05 03:51:30 LOGIN authenticator failed for (User) [91.200.12.166]:53880 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=upload)
2017-09-05 03:51:34 LOGIN authenticator failed for (User) [91.200.12.105]:61032 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=farm)
2017-09-05 04:17:31 LOGIN authenticator failed for (User) [91.200.12.165]:60825 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=somebody)
2017-09-05 04:17:34 LOGIN authenticator failed for (User) [91.200.12.164]:55274 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=sara)
2017-09-05 04:27:43 LOGIN authenticator failed for (User) [91.200.12.105]:51865 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=farmer)
2017-09-05 04:30:06 LOGIN authenticator failed for (User) [91.200.12.121]:54848 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=buddy)
2017-09-05 04:32:02 LOGIN authenticator failed for (User) [91.200.12.166]:61091 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=upon)
2017-09-05 04:55:24 LOGIN authenticator failed for (User) [91.200.12.164]:62485 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=sarah)
2017-09-05 04:55:24 LOGIN authenticator failed for (User) [91.200.12.165]:51657 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=someone)
2017-09-05 05:03:42 LOGIN authenticator failed for (User) [91.200.12.105]:59078 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=farmers)
2017-09-05 05:09:10 LOGIN authenticator failed for (User) [91.200.12.121]:62060 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=build)
2017-09-05 05:12:27 LOGIN authenticator failed for (User) [91.200.12.166]:51923 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=ups)
2017-09-05 05:33:26 LOGIN authenticator failed for (User) [91.200.12.164]:53321 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=sat)
2017-09-05 05:33:26 LOGIN authenticator failed for (User) [91.200.12.165]:58869 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=somethin)
2017-09-05 05:40:00 LOGIN authenticator failed for (User) [91.200.12.105]:49912 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=fast)
2017-09-05 05:48:34 LOGIN authenticator failed for (User) [91.200.12.121]:52896 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=building)
2017-09-05 05:53:00 LOGIN authenticator failed for (User) [91.200.12.166]:59136 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=uranus)
2017-09-05 06:11:20 LOGIN authenticator failed for (User) [91.200.12.165]:49705 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=son)
2017-09-05 06:11:21 LOGIN authenticator failed for (User) [91.200.12.164]:60535 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=saturn)
2017-09-05 06:16:06 LOGIN authenticator failed for (User) [91.200.12.105]:57124 I=[192.168.1.224]:25: 535 Incorrect authentication data (set_id=father
</code></pre>
<p>Is there a way to make some sort of selective fail2ban setting that would catch such attacks in a way other than just increasing <code>findtime</code> and <code>bantime</code> to several hours?</p>
| 1cybersec
| Stackexchange | 2,593 | 7,050 |
Monitor visited websites of guest account through any browser. <p>I want to know which websites/URLs are visited by users of my home computer's guest account. </p>
<p>Is there a way to log this and save it as nicely formatted list to the disk? I only need date/time and visited URL. If possible, full URLs would be nice, but domain only is also good for a start.</p>
<p><strong>Update:</strong></p>
<p>After having read the linked answers and suggestions in the chat from <em>A.B.</em>, I ran the following command:</p>
<pre><code>$ sudo iptables -A OUTPUT -m owner --uid-owner 499 -j LOG --log-prefix='[GUEST INTERNET ACCESS] '
</code></pre>
<p>after having set the guest account UID to the fixed UID 499 following <a href="https://askubuntu.com/questions/699113/set-or-determine-the-uid-range-for-guest-accounts?lq=1">Set or determine the UID range for guest accounts</a>.</p>
<p>But the <code>/var/log/kern.log</code> still doesn't contain those logs but lots of messages by <code>apparmor</code> that tell it denied something:</p>
<pre><code>Nov 18 11:19:22 wolf-pack kernel: [ 1030.063374] audit: type=1400 audit(1447841962.731:164): apparmor="DENIED" operation="connect" profile="/usr/lib/lightdm/lightdm-guest-session" name="/run/systemd/journal/stdout" pid=4693 comm="dbus-daemon" requested_mask="w" denied_mask="w" fsuid=499 ouid=0
</code></pre>
<p>I have posted a separate question about the AppArmor problem here: <a href="https://askubuntu.com/q/699539/367990">AppArmor blocks logging set up through iptables for guest account - How to enable?</a></p>
| 0non-cybersec
| Stackexchange | 500 | 1,572 |
I made my girlfriend cry from orgasm denial and I'm feeling bad about it.. After she stopped yelling at me and calmed down from her hornyness she forgave me. But I'd be lying if I said I didn't enjoy it. Knowing that I got her so close and so sexually frustrated that she literally started crying gives me a bit of a thrill.
Now, I will never do it again without her explicit permission, but I'm feeling like a bit of a sadist for enjoying her agony. In retrospect it makes me feel like a huge asshole.
Is it "normal" to enjoy such a thing? I'm questioning myself at this point. Maybe it's a red flag and I'm completely unaware? | 0non-cybersec
| Reddit | 151 | 631 |
Why do I get "does not live long enough" in a return value?. <p>In examining <a href="https://stackoverflow.com/questions/53585774/how-do-i-box-arc-and-mutexed-variables-in-rust">How do I box Arc and Mutexed variables?</a>, I ran into an issue where code that looks OK is generating a "does not live long enough" error while constructing a return value from a <code>Mutex</code>. Simply pulling the <code>lock().unwrap()</code> access out of the return object removes the error - but I'd like to understand why Rust is complaining about a lifetime issue in this case.</p>
<p>I was able to cut the code down to a very simple reproducer: The first function compiles OK, the second generates the error message, and they're almost identical.</p>
<pre><code>use std::sync::Mutex;
pub struct Response {
resp: String,
}
pub fn get() -> Response {
let body = Mutex::new("a".to_string());
let x: std::sync::MutexGuard<_> = body.lock().unwrap();
Response { resp: x.clone() }
}
pub fn get2() -> Response {
let body = Mutex::new("a".to_string());
Response {
resp: body.lock().unwrap().clone(),
}
}
</code></pre>
<pre class="lang-none prettyprint-override"><code>error[E0597]: `body` does not live long enough
--> src/lib.rs:16:15
|
16 | resp: body.lock().unwrap().clone(),
| ^^^^ borrowed value does not live long enough
17 | }
18 | }
| - `body` dropped here while still borrowed
|
= note: values in a scope are dropped in the opposite order they are created
</code></pre>
| 0non-cybersec
| Stackexchange | 477 | 1,571 |
How to create RPM for generic Perl module. <p>I have a generic Perl module that will run on any release of Perl 5. I need to create an RPM for it that will install it into the vendor_perl subdirectory.</p>
<p>I don't want to create different RPMs for SUSE and Red Hat distros, their clones, and their different versions. I have successfully created similar, generic RPMs for non-Perl packages. </p>
<p>I can use %{perl_vendorlib} to map the correct directory, but only for the system where the RPM is created.</p>
<p>What is required in the RPM .spec so that the Perl module file is installed into %{perl_vendorlib} of the target system? Assume the target system could be CentOS 7, RHEL 8, SLES 12, or SLES 15.</p>
| 0non-cybersec
| Stackexchange | 200 | 718 |
Today is the one-year anniversary of /r/Games's creation - let's talk about the subreddit and how to keep it on track. One year ago today, Dacvak, tevoul and I [launched this subreddit](http://www.reddit.com/r/gaming/comments/metq6/announcement_rgaming_to_branch_into_two_separate/) as a place for people that wanted a general gaming subreddit focused on informative and interesting content and discussions. If you're curious, [here are the top posts that were made in the first few hours](http://stattit.com/r/Games/2011-11-16/), and [the top ones made over the next day](http://stattit.com/r/Games/2011-11-17).
Over the last year, the subreddit's grown extremely quickly. [Looking at the statistics](http://stattit.com/r/Games/), we're now the 46th largest subreddit on the site by number of subscribers, and are typically around the top 25 by number of users online and number of comments being posted. Considering most of the top 20 is made up of the default subscriptions, this makes us one of the very top non-default subreddits.
Overall, despite this massive growth, I still think the subreddit is mostly doing a good job of staying true to the initial vision. We've had to make some small tweaks to the rules here and there, but nothing very major. And on that note, there's a couple of things in particular that I want to discuss today.
### Game recommendations and other rules
Fairly early on in the subreddit's life, we banned "overly general" recommendation requests, posts like "I just got a PS3, what games are good?" Beyond that, we mostly allow anything, as long as there's at least something to guide the discussion. So asking for recommendations similar to other games or in particular genres is fine. However, there are still quite a few low-quality recommendation requests being posted, and I know that some people aren't happy about them. I should mention that I don't think they're really a huge issue since they're generally downvoted and aren't dominating the subreddit or anything, but they do clutter up the /new page a bit.
So I'd like to suggest an addition to the rules about recommendation posts, which is to also ban **overly personal or specific recommendations**. For example, "Should I buy Game A or Game B?" The answers to this are completely dependent on the poster's personal taste, so they naturally can't cause much of a discussion for others. Since we already ban other types of posts that are just looking for a specific answer ("Where can I buy Game X?", etc.), I think this also fits in well with that.
Any thoughts on this, or any other changes we should consider to the rules? Like I mentioned, I think the voting system does handle a lot of stuff, everything doesn't specifically need to be dealt with by moderation.
### An experiment in "community moderation"
But on that topic, the other main thing I want to discuss is an idea I had for a potential experiment. As anyone that spends much time on reddit eventually realizes, the voting system has a lot of weaknesses. Specifically, the biggest problem is that it doesn't rank things based on quality, it ranks by *popularity*, which is often very different. On reddit, whatever gets the most upvotes the fastest is the "best", which means a subreddit's content inevitably drifts towards things that are quick to view, easy to understand, and non-controversial. This drift can be managed with moderation, but never truly "solved" because it's inherent in the site's entire model.
The experiment I've been considering is one that basically adds another system to allow people that have been actively and positively involved in the community to take a more direct role in how it's moderated. It would be somewhat of a middle ground between being a regular user (where your downvote can be canceled out by anyone else's upvote) and a moderator (where your removal overrules all votes). Here's how it would work:
By scraping data from the subreddit, I would compile a number of statistics on the users here, including when they first participated in the subreddit, how often they post/comment, how well their posts/comments generally do, etc. From those statistics, derive a (large) list of users that are high-quality, regular participants in the community.
Then set up a bot that will perform moderation actions if the action receives enough "support" from these users. For example, perhaps each user begins with a weight of 1, and it takes a total weight of 5 to remove something. Then when 5 of the eligible users send a message to the bot requesting a particular post be removed, it takes the action. Other than removals, a few other actions could be supported through this as well, like adding the "[Misleading title]" tag that we use. Sending messages to a bot isn't very user-friendly, but unfortunately this is about the only way to add any functionality to reddit.
By using a weight system like this, users could also be adjusted over time (based on their participation statistics and correctness of past messages to the bot) to have more or less weight, so perhaps eventually someone's vote puts 4 weight towards performing an action instead of 1.
Overall, this system would allow users that are more involved in /r/Games to directly help keep the subreddit on track. It would also help deal with those edge-case posts that don't technically break the rules, but seem to be considered low-quality. With this system, if enough of the regular members of the subreddit agree that it doesn't belong, it could be removed.
What do you think? Is this an interesting idea that you'd be interested in at least trying out, or is it just overcomplicated and unnecessary?
And as always, any other feedback about the subreddit is welcome. | 0non-cybersec
| Reddit | 1,319 | 5,744 |
Can I use least square method to estimate a Box-Jenkins model?. <p>I have the known measurement: Noise $e(t)$, output $y(k)$, input $u(k)$.</p>
<p>I need to find the Box-Jenkins model:</p>
<p>$$y[k] = \frac{B(q)}{F(q)}u[k] + \frac{C(q)}{D(q)}e[k]$$</p>
<p>Where $B, F, C, D$ are polynomial expressions. Eg.:</p>
<p>$B(q) = 1 + b_1q^{-1} \dots b_nq^{-n}$</p>
<p>Often I have used least square $Ax=b$ to find the parameters inside the polynomial expressions. But in this case, it seems not to work for me.</p>
<p>Can I use least square(even if I fail to do that) or do I need to use another tool to find the parameters?</p>
<p>When I did least square on BJ-Model, I did in this way:</p>
<p>$$F(q)D(q)y[k] = B(q)D(q)u[k] + F(q)C(q)e[k]$$</p>
<p>Which didn't work because I cannot combine $F(q)D(q)$ or $B(q)D(q)$ for then solving each polynomial.</p>
<p><a href="https://i.stack.imgur.com/n9Ysw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n9Ysw.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange | 422 | 1,026 |
Air or water for SLI?. Currently I'm planning on buying another glorious gtx 1080.
So I look into my pcie slots and see a very little space, which means the two cards are gonna be very tight.
I'm wondering is that gap enough for air to get in so the fans could work or should I buy a hybrid card?
Currently I have a zotac amp extreme, I'm planning on moving the fat boy to the second x8 slot and have a EVGA ftw hybrid on the first x16 then OC it up to match the zotac amp extreme.
Also my PSU is a EVGA 850W GOLD, this should be enough for a core i7-6700k + x2 1080 right?
What is the better option, buying another zotac amp extreme or a evga ftw hybrid? | 0non-cybersec
| Reddit | 181 | 656 |
[Physics] How do frequency doubling crystals work?. I'm an undergraduate student working in a ultrafast laser research lab for the summer, and before I am allowed to use the frequency doubling crystal (it is a Beta-Barium Borate crystal and our laser has a gaussian beam with a 780nm fundamental center wavelength) I need to give a presentation on how it works.
I have been able to find quite a few papers on the math of how the higher harmonic frequencies are generated, but I am having trouble understanding what is physically happening inside the crystal.
Also, based on the math I have seen, why doesn't frequency doubling occur in all materials that light can travel through? Does the second order nonlinearity of the Polarization density vs. Electric field cancel out in most materials? I can not figure out the math of how that would work. Maybe a physical explanation would help me to understand this.
Thanks for your help | 0non-cybersec
| Reddit | 198 | 936 |
How to show which column has the first amount and count columns to reach a sum amount. <p>I am working on a Google sheet that shows a sum that has been advanced to a customer and then shows the income per month the customer receives. We will retain 100% of the income until the amount that has been advanced is repaid.</p>
<p>I am trying to come up with two formulas for <a href="https://docs.google.com/spreadsheets/d/1JAf3ZduWliOjk2VaEV_vFTOGEsXOckyqml09ASZpmbQ/edit?usp=sharing" rel="nofollow noreferrer">this spreadsheet</a> which will work on each row:</p>
<ol>
<li>in column C that returns the first month that revenue is earned by the client and </li>
<li>in column D that returns the number of months over which the client revenues pay back the advance listed in column B.</li>
</ol>
<p>My research suggests that this is probably possible using an array function but I can't seem to find an example and don't understand the syntax enough to make it work.</p>
| 0non-cybersec
| Stackexchange | 269 | 970 |
Is multiple equation 0/1 linear integer programming with bounded integer weights NP-hard?. <p>Suppose we forget about optimizing and just want to find a feasible solution to a set of equations:</p>
<p>$$\sum_i w_{ij} x_i = W_j.$$</p>
<p>Here we are given $w_{ij}$ and $W_j$, and want to solve for $x_i$. Also $x_i$ are restricted to be 0/1 and we're promised that $w_{ij}$ and $W_j$ will be non-negative integer constants and we will have $w_{ij} \leq M$ for some universal constant $M$. The number of variables and equations can be arbitrary.</p>
<p>Is this an NP-complete problem? If we have just one or a universal bounded number of equations then the problem can be solved in polynomial time. Certainly if we can find a solution then we can verify it in polynomial time, so the problem is in NP. I was trying to find a reduction from something like 3-SAT in the general case but to no avail.</p>
| 0non-cybersec
| Stackexchange | 251 | 905 |
This copy of the Install OS X Yosemite application can’t be verified. It may have been corrupted or tampered with during downloading. <p>Sorry if my question is easy because I am new to Mac. </p>
<p>OS X Yosemite on my friend's Macbook Air was removed. Now when we start his Mac it has just Windows.</p>
<p>For installing Os x, I got the the installation file (13 Zip file) from third party web site and extracted that and it produced dmg file.</p>
<p>Now I have tried to made a bootable USB of OS X Yosemite with my Mac by using Disk Maker App. </p>
<p>Now when we turn on Mac of my friend while pressing <kbd>Alt</kbd> , I can see the icon to install Yosemite. So I click on that and continue first steps like language without error, but after 2 or 3 steps I received error</p>
<p>" This copy of the Install OS X Yosemite application can’t be verified. It may have been corrupted or tampered with during downloading."</p>
<p>Please help what is the problem and how i can solve that.</p>
| 0non-cybersec
| Stackexchange | 282 | 998 |
SockPathMode - what is it?. <p>I have a plist installed on my system with the following in it:</p>
<pre><code><dict>
<key>SockPathMode</key>
<integer>438</integer>
</code></pre>
<p><code>man launchd.plist</code> tells me:</p>
<pre><code>SockPathMode <integer>
This optional key specifies the mode of the socket.
</code></pre>
<p>I haven't been able to find a list of modes and I haven't heard of 438 different modes either! If anyone can shed some light on what this key and value is really about I'd be very grateful.</p>
| 0non-cybersec
| Stackexchange | 190 | 567 |
Can we solve this without cubic formula?. <p>I'm looking for an algebraic solution for $x$. </p>
<p>$$ \frac{x}{x+2} -3 = \frac{5x}{x^2-4}+x$$ <p></p>
<p>My first go at this involved converting this into an expression with a cubic numerator and $(x+2)(x-2)$ as the denominator. To find the roots, I then tried to divide each factor in the denominator into to cubic. No success. <P></p>
<p>I've converted this expression to:</p>
<p>$$ x(x-7)= (x+3)(x+2)(x-2)$$</p>
<p>which illustrates the futility of my first approach. There are no common factors. Can I solve this without invoking the cubic formula?</p>
<p><P></p>
<p>Edit: To clarify, the the Precalculus textbook calls for an algebraic and graphic solution. If you have an algebraic solution that would be accessible to a precalculus student, please provide it. </p>
| 0non-cybersec
| Stackexchange | 261 | 829 |
Windows 10 Lock Screen always puts monitor to sleep after 60 seconds. <p>I use Windows 10 at work, and for security reasons, I always lock my workstation when I leave the room for any reason. The problem is that my monitor is a Samsung 4K TV and the lock screen puts it to sleep after only 60 seconds, and after a few more minutes, it goes completely off, requiring me to use the remote control to turn it on again. I'm OK with using the remote to turn it on in the morning when I come in, but it's annoying to have to use it after a 10-15 minute conversation in another office.</p>
| 0non-cybersec
| Stackexchange | 139 | 585 |
PHP convert string to array. <p>How can I convert a string to an array? For instance, I have this string:</p>
<pre><code>$str = 'abcdef';
</code></pre>
<p>And I want to get:</p>
<pre><code>array(6) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
[3]=>
string(1) "d"
[4]=>
string(1) "e"
[5]=>
string(1) "f"
}
</code></pre>
| 0non-cybersec
| Stackexchange | 186 | 381 |
Make reliable and fast server for Node.js chat based application. <p>Good day everyone.</p>
<p>We have a serious problem with server, Our dedicated server is not responding with high traffic, server response goes too slow whenever 2500 daily active users. Total users are more than 80000.</p>
<p>We have a chat based application for both iOS and Android and API's are written in Node.js and database used MongoDB.</p>
<p>Please suggest me how we can improve server speed? which server should I use? is single server is enough for this kind of daily active users? Our users are increasing day by day and we need to make it more reliable.</p>
<p>We are thinking to move to Amazon and should use load balancer but will it be a good idea?</p>
<p>Server Info:</p>
<hr>
<p>Commercial name
ADVANCE-LE - Intel Xeon W-2145 - 128GB DDR4 ECC 2666MHz - 2x SSD NVMe 960GB Datacenter Class Soft RAID</p>
<hr>
<p>System (OS):</p>
<hr>
<p>Cpanel 11.68 autoinstaller (CentOS 7 64bit)</p>
<hr>
| 0non-cybersec
| Stackexchange | 298 | 988 |
Delete a run in the experiment of mlflow from the UI so the run does not exist in backend store. <p>I found deleting a <code>run</code> only change the state from <code>active</code> to <code>deleted</code>, because the run is still visible in the UI if searching by <code>deleted</code>. </p>
<p>Is it possible to remove a <code>run</code> from the UI to save the space?
When removing a run, does the artifact correspond to the run is also removed?</p>
<p>If not, can the run be removed through rest call?</p>
| 0non-cybersec
| Stackexchange | 150 | 514 |
Reboots taking an hour due to fsck. <p>I'm running into an issue where reboots on two of my application servers are taking about an hour each time. I think that an fsck is happening each time but I cannot find much information in the logs to help debug.</p>
<p>In dmesg I'm seeing the following:</p>
<pre><code>[ 8.081130] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 10.776403] tg3 0000:02:00.0 eth0: Link is up at 1000 Mbps, full duplex
[ 10.776409] tg3 0000:02:00.0 eth0: Flow control is off for TX and off for RX
[ 10.776413] tg3 0000:02:00.0 eth0: EEE is enabled
[ 10.776448] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 11.771117] tg3 0000:02:00.1 eth1: Link is up at 1000 Mbps, full duplex
[ 11.771124] tg3 0000:02:00.1 eth1: Flow control is off for TX and off for RX
[ 11.771127] tg3 0000:02:00.1 eth1: EEE is enabled
[ 11.771173] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 3171.529473] FS-Cache: Loaded
[ 3171.549333] RPC: Registered named UNIX socket transport module.
[ 3171.549334] RPC: Registered udp transport module.
[ 3171.549335] RPC: Registered tcp transport module.
[ 3171.549335] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 3171.566048] init: failsafe main process (1506) killed by TERM signal
[ 3171.576544] FS-Cache: Netfs 'nfs' registered for caching
[ 3171.685710] Installing knfsd (copyright (C) 1996 [email protected]).
[ 3171.871112] audit_printk_skb: 6 callbacks suppressed
</code></pre>
<p>which corresponds to the same amount of time by boot takes.</p>
<p>I'm wondering if anyone has ideas on where to start investigating?</p>
<p>The machines are:
Dell Poweredge R420
Ubuntu 14.04</p>
<p>lsblk:</p>
<pre><code>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 558.4G 0 disk
├─sda1 8:1 0 243M 0 part /boot
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 558.1G 0 part
├─app2-root (dm-0) 252:0 0 542.2G 0 lvm /
└─app2-swap_1 (dm-1) 252:1 0 15.9G 0 lvm [SWAP]
sr0 11:0 1 1024M 0 rom
</code></pre>
<p>fstab:</p>
<pre><code>proc /proc proc nodev,noexec,nosuid 0 0
/dev/mapper/app2-root / ext4 errors=remount-ro 0 1
UUID=8a2c24e5-17ba-4992-82a1-68b9609b6983 /boot ext2 defaults 0 2
/dev/mapper/hd1app2-swap_1 none swap sw 0 0
</code></pre>
<h2>Edit</h2>
<p>This turned out to NOT be related to fsck at all. The issue was that there were Gigabytes of data in the /tmp which were cleared each time on boot. Note the gap between 11.771173 and 3171.529473 in the logs. Too bad dmesg doesn't display anything for useful for this particular scenario.</p>
| 0non-cybersec
| Stackexchange | 1,022 | 2,797 |
System read-only after upgrading Ubuntu Server 14.04 LTS to 16.04 LTS. <p>Today I upgraded my Ubuntu Server from 14.04 to 16.04 with <code>sudo do-release-upgrade</code>, which went smoothly until it rebooted and I logged in. Where I am met with the following message:</p>
<pre><code>Unable to setup logging. [Error 30] Read only file system:
'var/log/landspace/sysinfo.log'
run-parts: /etc/update-motd.d/50-landscape-sysinfo exited with return code 1
/usr/lib/ubuntu-release-upgrader/release-upgrade-motd: 39: /usr/lib/ubuntu-release-upgrader/release-upgrade-motd: cannot create /var/lib/ubuntu-release-upgrader/release-upgrader-available: Read-only file system
/usr/lib/update-notierfier/update-motd-fsck-at-reboot: 33: /usr/lib/update-notifier/update-motd-fsck-at-reboot: cannot create /usr/liv/update-notifier-fsck-at-reboot: Read-only file system
-bash: cannot create temp file for here-document: Read-only file system
</code></pre>
<p>So I have figured that the system is read-only and this a preventive measure if there is some sort of error/corruption of the file system or the disk?</p>
<p>So my questions is two folded:</p>
<ol>
<li>What did exactly happen?</li>
<li>How do I fix it?</li>
</ol>
<p>Don't know if this is relevant, but the OS is running of a USB-pen while there are 6 drives in Raid 5.</p>
<p>Thanks in advance!</p>
<p>Obviously I could just reinstall the OS and setup everything again, which would only take me a couple of hours, but I really want to learn and understand it instead :)</p>
<p><strong>Edit 1</strong></p>
<p>dmesg log added: <a href="http://pastebin.com/0bP8T4hH" rel="nofollow">http://pastebin.com/0bP8T4hH</a></p>
<p><strong>Edit 2</strong></p>
<p><code>/etc/fstab</code></p>
<pre><code># /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
/dev/md0 /mnt/rdisk ext4 user 0 0
</code></pre>
| 0non-cybersec
| Stackexchange | 760 | 2,220 |
What is the definition of Computer Science, and what is the Science within Computer Science?. <p>I am pursuing a BS in Computer Science, but I am at an early point of it, and I am pretty sure I will be happy with my choice given that it seems like an academically and career flexible education to pursue.</p>
<p>Having said that, there seems to be a variety of definitions about what Computer Science really is in respects to academia, the private-sector, and the actual "Science" in "Computer Science" I would love to have answers(Or shared pondering) as to the breadth of things an education in Computer Science can be applied to, and ultimately the variety of paths those within Computer Science have pursued.</p>
| 0non-cybersec
| Stackexchange | 159 | 718 |
Online compilers and repls - not one big security hole?. <p>There are plenty of compilers and REPL services on the web. For example: <a href="http://ide.fay-lang.org/" rel="noreferrer">Fay ide</a>.</p>
<p>I find that implementing some similar technology would be very interesting. But it seems like a major security hole. Am I wrong in thinking that exposing a compiler would be risky? An interpreter seems even worse.</p>
<p><strong>update:</strong> I can be a bit more specific. The kind service I'm thinking about hosting myself (a thought experiment at this stage) would be kind of close to the case of the Fay ide above. You take input from the user, process it and return it, potentially as runable javascript to the same or other users. Let's look at that example in particular.</p>
<p>The most obvious security concern that I see for this case, as I don't actually evaluate the code server side, would be for the users, as they would run code made by an 'unknown' author. The fact that they are allowed to read the code before running it should be a significant safeguard in this regard.</p>
<p>Although I also wonder if and when translation of code constitute a threat to the server? What kind of exploit vectors could be thought of in this context?</p>
<p><strong>Summary:</strong> </p>
<ol>
<li>Beyond what you can expect from any web server set up, and beyond the most obvious concerns (or perhaps some of those obvious concerns as well), how could one user compromise another?
-. How can the server application be hardened to ensure not being compromised?</li>
<li>What important questions have I neglected? ;)</li>
<li>I would like to try some experiments, and I have nearlyfreespeech in mind as a host. I could imagine that such use might be prohibited by their terms of use? Or perhaps I can trust them to be sure enough that they have sandboxed my account well enough. What should be my "minimum" safeguards, for trying stuff out and what safeguards would be possible with such limited hosting environment?</li>
</ol>
<p><strong>update2:</strong> I believe that compiling to javascript for client side evaluation or evaluating limited edsls would cover for most/all use cases I have in mind. I take it that this means that I really don't put the server side to a more prominent risk than <em>usual</em>. And I don't see how the user is being put into more risk than compared to going to a random link on jsFiddle.</p>
| 0non-cybersec
| Stackexchange | 595 | 2,442 |
LR-rule and Standard Young Tableau counting. <p>given that <span class="math-container">$s_\lambda s_\mu=\sum_{\nu} C_{\lambda \mu}^\nu s_\nu$</span> with <span class="math-container">$\vert \lambda\vert +\vert\mu \vert=\vert \nu\vert$</span>, why does apparently also hold that <span class="math-container">$$h(\lambda) h(\mu) {\vert \nu\vert \choose \vert \lambda \vert}=\sum_{\nu} C_{\lambda \mu}^\nu h(\nu)$$</span> where <span class="math-container">$h(\lambda)$</span> denotes the count of Standard Young Tableaux as given by the hooklength formula? A similar relation, but without the binomial factor, is well known for the semi-standard tableaux. This last one is easily understood by comparing monomials in the schur functions on both sides together with the relation between the weights of the monomials and semi-standard tableaux. For the relation above, I fail to grasp the link.<br>
Any hints?</p>
| 0non-cybersec
| Stackexchange | 252 | 911 |
Hunter or Hunted(Part Three). You can find part 2 [here](http://www.reddit.com/r/nosleep/comments/lwiao/hunter_or_huntedpart_deux/)
It had been a rough time for Thomas and the gang after the events of the last story. Thomas had some of the most horrible nightmares... most of them revolved around him being in the middle of the woods or some vast expanse of land, it would be night-time and he would be freezing cold. It was there he would encounter the *thing* and wake up terrified. The strange thing was the similarity between the dreams Thomas would have and the dreams the rest of the squad would talk about. Each person had a unique dream but the one factor shared amongst all these different dreams was the presence of the *thing*.
One night, roughly 3 weeks after the first "incident" was the second encounter with this entity. Thomas was on watch with another soldier. Which he didn't mind too much since he hadn't been sleeping well anyways. Thomas and the other soldier talked awhile about their dreams and how odd it was that they had never found any signs of the soldier that went missing. For the most of the night it was quiet and Thomas just sat there smoking a cig looking out into the darkness and listening for any signs of movement.
The night passed without a hitch until about 2am when Thomas heard the other soldier say "No way"(Thomas hadn't been paying attention and didn't notice that the other soldier had stopped scanning the horizon with the NV scope and instead was focused on one particular area). Thomas replied inquisitively "What?" to which the other soldier just said "Take a look". Thomas raised up his rifle to use his own scope and quickly was able to see what looked like a soldier on the side of the mountain across from where their base was located.
Unable to make anymore detail (because of the distance) Thomas went to get a sniper rifle that had a much better and much more powerful scope attached. He was making the return trip when he heard the other soldier start "whisper-yelling" his name, Thomas quickened his pace and made it back to the watch post. Thomas quickly set the rifle up on the sandbags and asked again "What is it?" but his question was soon answered. When he focused the rifle on the area where he had seen "the soldier" he saw it again, except this time the eyes that haunted his dreams were there peering back... red eyes seeming to seep out from underneath this shell of a soldier.
Thomas sat there watching this thing for what he said "seemed like an eternity" before it began to move. It did not travel up or down the mountain, but to the side. Thomas watched it all the way, but just before leaving eyesight and moving to the other side of the mountain the *thing* turned, stared right at him and waived... Thomas shuddered and took his eyes off his scope. When he peered back through, the thing was gone. The rest of the night passed without incident and Thomas was put at ease. That is until they found the body of the missing soldier on the other side of the mountain the next day. No eyes, no bones, no organs... just a shell... | 0non-cybersec
| Reddit | 689 | 3,109 |
Trying to install Eclipse or Codeblock. <p>I am new to using Ubuntu, and so in need of some help getting my development box up and running. I am trying to develop C++ code, but when I try to install CodeBlock IDE or Eclipse indigo, I run into some wall. </p>
<p>When I attempt to use Ubuntu Software to install Eclipse Indigo, I get an error about my internet connection "Failed to download Package File, Check your internet connection"(I use wireless and have no problems using the internet). When I try to install Codeblock, I get the same error. Is there some configuration issue I have not handled here? I am running Ubuntu on VMWare. Any help will be very much appreciated. </p>
| 0non-cybersec
| Stackexchange | 164 | 686 |
Regarding a current frontpage post that makes me sick.. There's a post on the front page about a dude and his girlfriend accidentally walking into a brothel "spa" in Bangkok. The comments are filled with jokes about the price and serious discussion about how awesome Thailand is for its affordable hookers.
Well no shit they're affordable. The bodies of women and children are pretty cheap among the poor in Thailand, you think they just waltzed into Bangkok from whatever province they came from to fulfill their lifelong dream of jacking off fat, middle-aged white and Japanese guys for an "affordable" price? Get a fucking clue, if you even care...
**Edit:** For those constantly bringing up those prostitutes who actually *are* living their dream as prostitutes, [this](http://www.prostitutionresearch.com/pdf/Prostitutionin9Countries.pdf) article paint a much bleaker picture for the vast majority of sex workers. | 0non-cybersec
| Reddit | 202 | 921 |
Which bibliography entry type should I use for a document defining a European norm?. <p>I'm currently doing a research internship in the Photovoltaics laboratory of a university. I am writing my report, and in my bibliography, I would like to cite a document that is an International Standard for defining how to make measurements on photovoltaic systems.</p>
<p>More specifically, it's the international standard IEC 61724:1998 : <em>Photovoltaic system performance monitoring - Guidelines for measurement, data exchange and analysis</em>. <a href="https://webstore.iec.ch/preview/info_iec61724%7Bed1.0%7Den.pdf" rel="nofollow">Here is an excerpt of the document</a>. (unfortunately the full-text document is not available without paying)</p>
<p>Now, my question is: <strong>Which BiblateX bibliography entry type should I use to cite this document? Article, Technical Report, Reference, Patent, ... ?</strong></p>
<p>Is there a bibliography entry type that is dedicated to this kind of documents (international standards)?</p>
| 0non-cybersec
| Stackexchange | 261 | 1,032 |
5 weeks of tracking my calories and exercise, and I've lost 21.4 pounds! (113.4 total!). I've been recording my diet and exercise for 5 weeks now, and I've dropped 21.4 pounds so far! From my heaviest weight, I've lost a total of 113.4 pounds!
The last couple weeks I've completely cut out carbs and have tried to do 30-60 minutes of cardio every day. I've had a little more free time after work than usual, so I was able to get more creative at dinner time. It really hasn't been too bad, although I still would love to binge on some pizza, but that will never change.
Here was my diet and exercise for the week: https://www.youtube.com/watch?v=sM5TeSgK-ek
This sub has been amazing over the last month, and I would love any questions or suggestions! | 0non-cybersec
| Reddit | 202 | 757 |
Stored procedure with default parameters. <p>I am trying to create a stored procedure based on a query I wrote with parameters that are predefined.</p>
<p>When restructuring to a create stored procedure and I execute the stored procedure it states that the parameters were not supplied. Can anyone tell me why? </p>
<p>I know I have missed something essential but after messing about with the code I have reached the point of needing some help from the experts.</p>
<p>This is my code (shortened):</p>
<pre><code>Alter Procedure [Test]
@StartDate AS varchar(6),
@EndDate AS varchar(6)
AS
Set @StartDate = '201620' --Define start YearWeek
Set @EndDate = (SELECT CAST(DATEPART(YEAR,getdate()) AS varchar(4)) + CAST(DATEPART(WEEK,getdate())-1 AS varchar(2)))
SELECT
*
FROM
(SELECT DISTINCT
[YEAR], [WeekOfYear]
FROM
[dbo].[DimDate]
WHERE
[Year] + [WeekOfYear] BETWEEN @StartDate AND @EndDate) dimd
LEFT JOIN
[Schema].[Table1] qad ON (qad.[Year] + qad.[Week of the Year]) = (dimd.[Year] + dimd.WeekOfYear)
</code></pre>
<p>When I run the procedure I get:</p>
<blockquote>
<p>Msg 201, Level 16, State 4, Procedure test, Line 0<br>
Procedure or function 'test' expects parameter '@StartDate', which was not
supplied.</p>
</blockquote>
<p>Thanks in advance.</p>
| 0non-cybersec
| Stackexchange | 421 | 1,387 |
SCNKit ERROR removing the root node of a scene from its scene is not allowed. <p>I have the following code (SceneKit in Swift targeting iOS):</p>
<pre><code>let scnView = self.view as SCNView
let scene = SCNScene()
let levelScene = SCNScene(named: "level")
scene.rootNode.addChildNode(levelScene.rootNode)
scnView.scene = scene
scnView.backgroundColor = UIColor.grayColor()
scnView.allowsCameraControl = true
scnView.showsStatistics = true
</code></pre>
<p>The problem is, at <code>scene.rootNode.addChildNode(level.rootNode)</code> I get the following error in the console:</p>
<p><code>[SCNKit ERROR] removing the root node of a scene from its scene is not allowed</code></p>
<p>I am not sure why this error is coming up, but I am trying to load my <code>level.dae</code> file in and add it to the scene. From what I can see in the simulator (and device), it loads fine.</p>
<p>What should I do to prevent the error message from occuring?</p>
| 0non-cybersec
| Stackexchange | 301 | 954 |
Combinatorics in finite vector space. <blockquote>
<p>Let $q$ be a prime power and $V$ a finite $\mathbb F_q$-vector space with two subspaces $I$ and $J$.
Let $k$, $a$ and $b$ be non-negative integers.
Determine the number of subspaces $K$ of $V$ with $\dim(K) = k$, $\dim(K\cap I) = a$ and $\dim(K\cap J) = b$.</p>
</blockquote>
<p>The answer should depend on the numbers $a,b,k$ and $v = \dim(V)$, $i = \dim(I)$, $j = \dim(J), c = \dim(I\cap J)$, but otherwise be independent of the exact choice of $I$ and $J$.</p>
<p>In the case that only a single subspace $I$ is given (say $J = \{0\}$ and $b = 0$), I found the answer
$$
q^{(k-a)(i-a)}\binom{i}{a}_{\!q} \binom{v-i}{k-a}_{\!q},
$$
where $\binom{x}{y}_q$ denotes the Gaussian binomial coefficient.</p>
<p>However for two subspaces $I$ and $J$, this problems looks quite hard to me. Any ideas are welcome. Even the special cases $I \cap J = \{0\}$ or $J \subseteq I$ (both generalizing the case $J = \{0\}$ discussed above) are not clear to me.</p>
| 0non-cybersec
| Stackexchange | 367 | 1,012 |
The Dimension of Vector Space. <p>Question:
Let <span class="math-container">$A$</span> be an <span class="math-container">$n×n$</span> complex matrix with <span class="math-container">$n$</span> distinct eigenvalues. Let <span class="math-container">$V$</span> be the set of all <span class="math-container">$n×n$</span> complex matrices <span class="math-container">$B$</span> that commute with <span class="math-container">$A$</span>. Prove that V is a vector space and find its dimension (Justify your answer).</p>
<p>My Answer: I know how to show that V is a vector space, but I don't know how to find its dimension.
I tried showing that if v is an eigenvector corresponding to some eigenvalue, so is Bv, and got that for all B, Bv = kv for some scalar v. But I'm not sure if this helps.</p>
| 0non-cybersec
| Stackexchange | 238 | 798 |
How do I check if an environment variable is set in cmake. <p>I set an environment variable in my bash profile, so I can see it in the terminal just fine . .</p>
<blockquote>
<p>blah/builds$ echo $THING</p>
<p>thingy</p>
</blockquote>
<p>How do I display it in a cmake message and check if it is set? I have tried the following, but it just displays thing as blank and skips the body of the if statement</p>
<pre><code>message("THING:" $ENV{THING})
if(DEFINED ENV{THING})
message(STATUS "THING environment variable defined")
# some more commands
endif()
</code></pre>
| 0non-cybersec
| Stackexchange | 191 | 596 |
How to access user information via sys.fn_dump_dblog. <p>I am reviewing sys.fn_dump_dblog and I can see the old states of the records, but I can not see which users are doing the operations.
SPID, Transaction SID columns are always null, how to fix it, or any options?</p>
<p>I am using SQL Server 2016.</p>
<p>My query:</p>
<pre><code>SELECT
*
FROM sys.fn_dump_dblog(NULL, NULL, NULL, 1, 'E:\LogBackup\blabla.trn', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
WHERE (
[operation] IN ('LOP_INSERT_ROWS', 'LOP_DELETE_ROWS', 'LOP_MODIFY_ROW')
AND (
([context] IN ('LCX_HEAP', 'LCX_CLUSTERED', 'LCX_MARK_AS_GHOST'))
OR ([context] = 'LCX_TEXT_MIX'
AND (DATALENGTH([RowLog Contents 0]) IN (0, 14, 28)))
)
AND [PartitionID] IN (72057595034533888)
)
OR ([operation] = 'LOP_HOBT_DDL')
</code></pre>
| 0non-cybersec
| Stackexchange | 424 | 1,133 |
Software pattern for combining properties. <p>I have two classes that read distinct files. As an examples, two classes, sourceA or Client, and sourceB or Resources:</p>
<pre><code>public class Client()
{
public string ClientName {get; set;}
public int ClientNumber {get; set;}
public string Address {get; set;}
//...
}
public class Resources()
{
public int ClientNumber {get; set;}
public decimal Resources {get; set;}
//...
}
</code></pre>
<p>Let's say that I need to merge booth classes into a new one, but I just need some fields from class <code>Client</code> and <code>Resources</code>. Is there any software pattern motivated by something like this, to compose a class like <code>ClientReport</code>?</p>
<p>The new class should be something like this:</p>
<pre><code>public class ClientReport()
{
public string ClientName {get; set;}
public int ClientNumber {get; set;}
public string Address {get; set;}
public decimal Resources {get; set;}
public int CalculateRating()
{
//...
}
}
</code></pre>
<p>These new classe will have some properties of <code>Client</code> and <code>Resources</code>, and copying code from them in order to create <code>ClientReport</code> seems to be a repetition, and I think it should be a away to compose this class and only use the needed properties from <code>Client</code> and <code>Resources</code>.</p>
| 0non-cybersec
| Stackexchange | 390 | 1,415 |
What's the worst you've been trolled by an authority figure? Mine was by a cop.. Coming back from an undergraduate, underage party, we were pulled over by the cops. Our designated driver had not had anything to drink. The cop asks her such and seems to believe her answer. He then shines the light into the rest of the car and asks if the rest of us has been drinking. She answers yes, as we're clearly shitfaced. He asks if we're all underage and she answers yes again. He then announces, "okay, you're all under arrest."
The driver started crying and we all started freaking out, not even moving out of disbelief and poor comprehension. She starts to undo her seatbelt to step out of the car on his command when he stops her and says, "Just kidding; April fools!" and happily walks back to his car.
You could tell that he'd been trolling college kids all night - it was just a few hours past midnight and no one realised yet that it was already April 1st. | 0non-cybersec
| Reddit | 233 | 969 |
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 | 349 | 1,234 |
Multiple Documents with shared TOC and Indexes. <p>I've recently started a personal project for creating and managing a knowledge base, but with the individual pages written in ConTeXt instead of markup, markdown, or any of the other currently-popular choices.</p>
<p>I'm very new to ConTeXt and have not seen any examples doing what I'm trying to do. It may simply be that I do not know the right place to look.</p>
<p>I'd like to be able to cross-link between pages and produce metadata pages covering the entire contents (e.g. TOC, index, list of figures).</p>
<p>At the moment I am not concerned with rendering these pages as HTML (but may be at some point). Ideally the output will be a set of cross-linked PDFs: one for each topic plus separate PDFs for the TOC, index, and any lists of figures/tables/whatever that I decide to produce.</p>
<p>Any pointers?</p>
| 0non-cybersec
| Stackexchange | 232 | 874 |
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 | 349 | 1,234 |
Virtual screen on Windows like XVFB on Linux. <p>For a good while I have been playing with the idea of having a virtual screen which is "attached" to my real screen but does not really exist.</p>
<p>The idea is that it should almost be like xvfb, the virtual X server which only runs as a framebuffer and isn't attached to a real graphics card and screen.</p>
<p>My use case here would be to have an application running on the fake screen that will be screen-recorded all the time. I don't want to see this application the whole time though. </p>
<p>The ideal thing would be if the software had a virtual screen viewer that, in fact, is just a small window that displays whatever is on that virtual screen.</p>
<p>Let me recap:</p>
<ul>
<li>Virtual monitor attached to the real one in desktop extension mode</li>
<li>Capability of recording said screen</li>
<li>Capability of looking at said screen through an application window</li>
</ul>
<p>The only idea I'd have that would come remotely close is running a virtual machine which has this hidden screen that is recorded. Though I can't just pull windows into this screen then!</p>
| 0non-cybersec
| Stackexchange | 292 | 1,139 |
Linear algebra change of basis always makes a linear map diagonal.. <p>Prove that there exist bases $\alpha $ and $\beta$ for V such that $ [T]_{\alpha}^{\beta} $ is a diagonal matrix with each diagonal entry equal to either 0 or 1.</p>
<p>Originally i thought that T=I was the only solution to this i realize that is not the case now but i am still lost what if T forms an non-invertable matrix? i really dont understand how we can always know that this is true cause if the map is non-invertable isn't it not diagonalizable?</p>
| 0non-cybersec
| Stackexchange | 138 | 532 |
Google bot hits on files 'apple-app-site-association' and 'assetlinks.json' showing up in Google Webmasters as pages with errors. <p>I've seen a number of posts on this but none really answer the question of why Google Bots specifically are trying to access the following on ALL of my sites, every single one of them...</p>
<pre><code>/.well-known/apple-app-site-association
/apple-app-site-association
/.well-known/assetlinks.json
</code></pre>
<p>In each case on my server a 404 is returned, but the troubling thing is these files now show up as Top pages with errors in Webmaster tools alongside other non existent files</p>
<pre><code>/m/
/mobile/
</code></pre>
<p>Should I worry about this?</p>
| 0non-cybersec
| Stackexchange | 214 | 720 |
I know my battery should be replaced, but is that all of the problem? (Update). <p>Updated:<br>
I am using a MacBookPro8,1 with a non-replaceable battery. Recently that battery charging status was saying,<code>Replace soon</code>. But it was working fine and kept enough charge for my daily works. So I didn't need to take the charger at work.
But when I shut down the laptop for few minutes, then I cannot turn it on without the charger plugged in.<br>
The battery status is now <code>Replace Now</code>.
when I press Battery indicator button at side of the laptop case, all LEDs start blinking at same time (5 times).<br>
The MagSafe LED is also green.<br>
Also Mac OSX shows that 98% of the battery is charged.<br>
But when the laptop is off, pressing the Battery indicator button doesn't turn on any LEDs (Normally it should turn on all LEDs as it is charged 98%)<br>
Also, more importantly when I plug out the charger the computer turns off <em>instantly</em>. Not even with a second delay.<br>
On the other side, when I turn on the laptop the time goes back to 2001.<br>
I tried to rest SMC by holding Shift+crtl+option+power and then releasing them at same time while the computer was off. Then I pressed the turn off/on button. </p>
<p>I had <a href="https://apple.stackexchange.com/questions/170601/battery-is-not-charging-despite-smc-reset/173697#173697">another problem</a> with my MacBook's charging issue few months ago. But I solved it with replacing the charger's capacitors. But I think in this case the problem is with the battery </p>
<blockquote>
<p>I know my battery should be replaced, but is that all of the problem? Or Does it have other issues? </p>
<p>Did I correctly reset SMC with that approach? </p>
<p>Is there anything I can do to use this battery a bit longer and
postpone buying a new one?</p>
</blockquote>
<p>Thanks for your reply.</p>
<p>Here are the status images:<br>
<img src="https://i.stack.imgur.com/oMeYF.png" alt="enter image description here">
<img src="https://i.stack.imgur.com/5zvzO.png" alt="enter image description here"></p>
| 0non-cybersec
| Stackexchange | 605 | 2,097 |
How to debug an Elixir application in production?. <p>This is not particularly about my current problem, but more like in general. Sometimes I have a problem that only happens in production configuration, and I'd like to debug it there. What is the best way to approach that in Elixir? Production runs without a graphical environment (docker).</p>
<p>In dev I can use IEX.pry, but since mix is unavailable in production, that does not seem to be an option.</p>
<p>For Erlang <a href="https://stackoverflow.com/a/21413344/1561489">https://stackoverflow.com/a/21413344/1561489</a> mentions dbg and redbug, but even if they can be used, I would need help on applying them to Elixir code.</p>
| 0non-cybersec
| Stackexchange | 191 | 691 |
Reset horizontal scroll bar width in Notepad++. <p>I have a document open in Notepad++, and for some reason the horizontal scrollbar is tiny. It looks like the width of the text area is over 7000 characters. The document does have a (single) long line, about 1000 characters long, but it's of course much smaller than the area reserved for it.</p>
<p>Is there a way to reset the horizontal size in Notepad++? It's a pain to scroll with a bar so small, especially since the used area is only 10-20% of the total.</p>
| 0non-cybersec
| Stackexchange | 134 | 517 |
Is it possible to prevent reading from a frozen python dataclass?. <p>I have a situation where I would like to be able to treat a frozen <code>dataclass</code> instance as always having the latest data. Or in other words, I'd like to be able to detect if a dataclass instance has had <code>replace</code> called on it and throw an exception. It should also only apply to that particular instance, so that creation/replacements of other dataclass instances of the same type do not affect each other.</p>
<p>Here is some sample code:</p>
<pre><code>from dataclasses import dataclass, replace
@dataclass(frozen=True)
class AlwaysFreshData:
fresh_data: str
def attempt_to_read_stale_data():
original = AlwaysFreshData(fresh_data="fresh")
unaffected = AlwaysFreshData(fresh_data="not affected")
print(original.fresh_data)
new = replace(original, fresh_data="even fresher")
print(original.fresh_data) # I want this to trigger an exception now
print(new.fresh_data)
</code></pre>
<p>The idea here is to prevent <em>both</em> accidental mutation and stale reads from our dataclass objects to prevent bugs.</p>
<p>Is it possible to to do this? Either through a base class or some other method?</p>
<p>EDIT: The intention here is to have a way of enforcing/verifying "ownership" semantics for dataclasses, even if it is only during runtime.</p>
<p>Here is a concrete example of a situation with regular dataclasses that is problematic.</p>
<pre><code>@dataclass
class MutableData:
my_string: str
def sneaky_modify_data(data: MutableData) -> None:
some_side_effect(data)
data.my_string = "something else" # Sneaky string modification
x = MutableData(my_string="hello")
sneaky_modify_data(x)
assert x.my_string == "hello" # as a caller of 'sneaky_modify_data', I don't expect that x.my_string would have changed!
</code></pre>
<p>This can be prevented by using frozen dataclasses! But then there is still a situation that can lead to potential bugs, as demonstrated below.</p>
<pre><code>@dataclass(frozen=True)
class FrozenData:
my_string: str
def modify_frozen_data(data: FrozenData) -> FrozenData:
some_side_effect(data)
return replace(data, my_string="something else")
x = FrozenData(my_string="hello")
y = modify_frozen_data(x)
some_other_function(x) # AHH! I probably wanted to use y here instead, since it was modified!
</code></pre>
<p>In summary, I want the ability to <em>prevent</em> sneaky or unknown modifications to data, while also forcing invalidation of data that has been replaced.
This prevents the ability to accidentally use data that is out-of-date.</p>
<p>This situation might be familiar to some as being similar to the ownership semantics in something like Rust.</p>
<p>As for my specific situation, I already have a large amount of code that uses these semantics, except with <code>NamedTuple</code> instances instead. This works, because modifying the <code>_replace</code> function on any instance allows the ability to invalidate instances. This same strategy doesn't work as cleanly for dataclasses as <code>dataclasses.replace</code> is not a function on the instances themselves.</p>
| 0non-cybersec
| Stackexchange | 946 | 3,265 |
ar
X
iv
:p
hy
si
cs
/0
50
71
10
v3
[
ph
ys
ic
s.
ed
-p
h]
2
A
ug
2
00
8
MISCONCEPTIONS ON RELATIVITY
GRAVITATION AND COSMOLOGY
Marcelo Samuel Berman
Instituto Albert Einstein
Av. Candido Hartmann, 575 - # 17 and
80730-440 - Curitiba - PR - Brazil - email: [email protected]
(Dated: (Original date: June 30, 2002 - This Version date: July 26, 2008))
Abstract
Fifteen misconceptions involving Relativity, Gravitation and Cosmology are exposed, along with
corrections.
1
http://arxiv.org/abs/physics/0507110v3
MISCONCEPTIONS ON RELATIVITY
GRAVITATION AND COSMOLOGY
Marcelo Samuel Berman
Introduction
By perusing several elementary Physics textbooks, I was astonished with the inclusion of
misconceptions dealing with Relativity, Gravitation and Cosmology. I have to confess that
most Physics textbooks published in English can be recommended for beginner students.
The misconceptions and the corrections
1. ”Time is relative so there is not some master grandfather clock that controls time in
the Universe”.(sic)
[The comoving cosmic time is such a master clock; when I say that the Universe is 14
billion years old, this is absolute time. A comoving observer is always at rest relative to the
matter in its neighborhood. All the literature in Cosmology is based in such observers].
2.”The laws of Physics are the same for all inertial observers”. (sic)
[Einstein outlined his theory with the use of tensor notation and four dimensional space-
time; only when the laws are cast in tensor notation, and in 4D spacetime, the laws of Physics
retain the same form for all observers. In three-dimensional space and common elementary
mathematics, the laws of Physics can be very awkward depending on the observer. For
instance, the Maxwell equations of electromagnetism can be very complicated for an observer
moving relative to another at rest.].
3.”You define relativistic 3-momentum, and then you assume conservation when there
are no forces”. (sic)
[In fact, the concept of force must be generalized from Newtonian Physics into Special
Relativity, so that, the relativistic force is equal to the proper time derivative of relativistic
linear momentum, but the textbooks forget to generalize the 2nd. law. The examples in the
textbooks only deal with collisions, when the external force is supposed to be null.].
4.”Today, when atomic clocks are transported from one place to another, the time dilation
of Special Relativity is to be always taken into account.” (sic)
2
[Because differences in gravitational potential also affect measures of time, the difference
in gravitational potential is also to be taken into account.].
5.”Inertial reference systems are those where Newton´s laws are valid.” (sic)
[Newton’s laws are only valid for low speeds and weak gravitational fields, but the defini-
tion of inertial systems of references is also necessary in Special Relativity, where Newtonian
laws need modification.].
6.”Special Relativity is not Classical Physics.” (sic)
[Classical Physics means Non-Quantum Physics; so that, Special Relativity and General
Relativity, along with the Electromagnetism, are all Classical Theories.].
7.”The principle of equivalence states that gravitation and acceleration are equivalent.”
(sic)
[This is only valid at a given point and its infinitesimal neighbourhood. There is no point
in substituting a gravitational acceleration for, say, a centripetal acceleration. Both may
be numerically equal in a certain point of space; nevertheless, the gravitational acceleration
decays with the inverse square of distance, while the centripetal one increases with distance
so that, if they are equal in one point they may be different in other locations.].
8.”Newtonian Physics deals with low speeds.” (sic)
[It should be always remembered that it is only valid for weak gravitational fields. If the
speeds are not low, but the gravitational field is weak, Special Relativity is to be taken into
account; if the gravitational field is intense, General Relativity must play a rôle].
9.”Edwin Hubble studied distant galaxies.” (sic)
[In fact the linear relation is valid for not too distant galaxies, which were those he could
observe in the year 1929].
10.”The principle of equivalence says that a homogeneous gravitational field is completely
equivalent to a uniformly accelerated reference frame.” (sic)
[This is correct, but represents a trivial consequence of the true principle. See #7].
11.”The gravitational field is an example of a vector field.” (sic)
[Einstein’s General Theory of Relativity, is based on the assumption that the gravitational
field is represented by a metric tensor, which represents the potentials of gravitation. This
metric tensor is not a vector. ].
12. ”With Einstein’s postulates, i.e., the equivalence and covariance principles, we find
3
General Relativity.” (sic)
[In fact, the mentioned postulates can support other theories, which have different field
equations, like for instance, scalar-tensor gravitation.]
13. ”The Universe has a center.” (sic)
[In most models, the Universe is homogeneous, so that any point is equivalent to any
other one, and may be considered the center. I call this the egocentric observer postulate.]
14. ””Dark matter” and ”dark energy”, are the same thing, because of Einstein’s mass-
energy relation”. (sic)
[In fact, dark matter and dark energy are different concepts: the first one responds for
the missing of visible matter, which should represent about 33% of all matter, but only
5% is visible; 27% is the dark matter. Dark energy, which is 67% of the energy density in
the Universe, is there because the Universe must have been made of critical energy density,
which is the value that turns the Universe a ”flat” tri-dimensional one; the agent causing
this dark energy, responds for the acceleration of the present Universe].
15. ”The Universe expands, so it accelerates”. (sic)
[What accelerates, is the rate of expansion, and not the ”center”, which is at any point].
Conclusions
Even good and recommendable textbooks should make an effort to bring a correct picture
also in Relativity, Gravitation and Cosmology: what we commented in this paper should be
taken as an alert on otherwise high praised books.
Acknowledgements
I thank Prof. M.M. Som and F.M. Gomide for conversations on the subject of this paper.
I recognize the good service of Mr. Marcelo Fermann Guimarães in typing this and many
other manuscripts, and the encouragement of Albert, Paula and Geni.
4
| 0non-cybersec
| arXiv | 1,666 | 6,663 |
Is it wrong to get sick of your kids and just want to run for the hills?. I have 5 lovely children, most of them adopted with my wife. Our oldest is 20, then we have 17 year old twins, a 13 year old daughter, and a 7 year old daughter. Both my wife and I work, and we don’t see much of our oldest until she comes down from college for the weekend. Our twins babysit the younger kids, and it mostly works out. Sometimes, things are great! I’m so thankful to have a family that I love, and were all happy. Then, there’s the other days.
Our oldest transferred schools this year, and has been having a hard time adjusting. We get a call from her almost every night, sobbing that nothing is the same. I try to console her and sympathize, but she just gets angrier and hangs up. The twins are both applying for college, and our son is doing better academically than our daughter (she’s still doing okay, just not as well, and we make sure to praise her for what she’s doing), so he has more options. It’s creating a lot of jealousy and twin fights that often result in mass destruction once we’re home. Our daughter is a troublemaker at school, and it’s always a fight with her over homework or test scores. I tried to do Mommy Daughter Study Time, and she wouldn’t do it! I’ve asked her to do an hour worth of homework with me each night, and she flips me off and locks her door. Taking away her car did nothing, grounding her did nothing. It just makes her angrier.
Our 13 yr old has hit the angsty teen phase, too. She plays her music way too loud, always yells, slams doors, and fights with her siblings constantly. Her latest technique is harassing our little one, and making fun of her for singing or dancing or just being happy in general. I got a call from a concerned teacher at our youngest’s school saying that she won’t sing like she normally does, and that she was “afraid of getting yelled at.” I told my daughter about it, and she said good, because then her sister wouldn’t be so embarrassing. We’ve been working with her to get her self-esteem back up, but she won’t sing anymore, and if she catches herself dancing, she looks very sad and stands perfectly still. She’s a handful on her own, though. If dinner isn’t up to par? It gets smashed into the floor. If she has to do too much homework? It gets shredded. If I’m talking too long? She screams. If I don’t give her my phone at dinner? She smashes her head on the table. Time out is fairly effective, but once she’s out, she just goes back to it.
Ugh!! Sometimes I just want to go take a vacation all by myself and hide. Is this a normal feeling? | 0non-cybersec
| Reddit | 640 | 2,615 |
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 | 349 | 1,234 |
Warning Match may not be exhaustive. <p>I was trying out below code:</p>
<pre><code> val set1 = Set(1,2,3,4,5,67,8)
val TRUE_BOOLEAN = true
val FALSE_BOOLEAN = false
set1.contains(4) match {
case TRUE_BOOLEAN => println("Element found")
case FALSE_BOOLEAN => println("Element not found")
}
</code></pre>
<p>But, when i am trying to run it in <code>IntelliJ</code>, it is giving below warning in <code>Messages</code> tab:</p>
<pre><code>Warning:(11, 16) match may not be exhaustive.
It would fail on the following inputs: false, true
set1.contains(4) match {
</code></pre>
<p>Whereas, if i use <code>true</code> and <code>false</code> instead of <code>TRUE_BOOLEAN</code> and <code>FALSE_BOOLEAN</code>, i am not getting any warning.</p>
<pre><code>set1.contains(4) match {
case true => println("Element found")
case false => println("Element not found")
}
</code></pre>
<p>Can someone please explain the reason for this warning and why does it goes away with <code>true</code> and <code>false</code>.</p>
| 0non-cybersec
| Stackexchange | 371 | 1,053 |
Asked for a raise last year, and after a very awkward interaction I got one. Need some advice on how to do so again this year.. I want to preface this by saying that I hate the company I work for, and am actively looking for new work, but until something comes along, asking for a raise is my only other opportunity to increase my income.
I work for a mid-size company where I report directly to the CEO and COO. Last year I emailed the CEO asking him if we could sit down at some point and discuss my compensation because of a lot of new work I had taken on in recent months. I had a list of accomplishments ready to go over, as well as examples of what my "market value" was. He emailed me back and told me that it wasn't necessary for us to meet because they give raises when they deem it appropriate and are always fair about it. This obviously pissed me off because it sounded like he was blowing me off, but then a week later he gave me a 20% raise.
It has now been a year since I got that raise, and since the company doesn't do reviews or performance meetings of any sort, I want to ask for another one. The team I managed has grown in the last year, and I've also gone above and beyond by helping a few other departments cut out inefficient processes that should be more than enough to argue for at least a small raise. I'm just not sure how to approach it a second time. Should I just email him again as I did last time, and ask for a meeting? He obviously didn't respond well to it the first time, but... I did also get a raise. I'm not sure if there's a better way I should approach it considering what he said last time. I'm hoping you guys could share some thoughts on how to proceed.
Thanks! | 0non-cybersec
| Reddit | 391 | 1,716 |
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 | 349 | 1,234 |
Is there a way to install Firefox add-ons in Chrome?. <h2>in brief</h2>
<p>Some Firefox add-ons (e.g., <a href="https://addons.mozilla.org/en-US/firefox/addon/smart-bookmarks-bar/" rel="nofollow noreferrer">Smart Bookmarks Bar</a>) are not available as extensions for Chrome. Is there a way to install Firefox add-ons in Chrome or to install them in one of the Firefox-tab extensions?</p>
<h2>full details</h2>
<p>Is there a Chrome addon to open a new tab as Firefox tab (similar to IE Tab addon but for Firefox)?
I'm looking for an addon for Chrome which functions similar to IE Tab, but it opens Firefox in a new tab inside Chrome. Any suggestion for me? Thank you!</p>
<p>The reason I'm looking for this addon is as followed. There's lots of addon in Firefox that are still not available in Chrome - the typical one is the smart bookmark toolbar and download helper.</p>
| 0non-cybersec
| Stackexchange | 254 | 878 |
in-place coalescing like elements in a std::vector. <p>I have an array of pairs, for example:</p>
<pre><code>X = {{A, 1}, {B, 2}, {C, 1}, {A, 3}, {C, 4}}
</code></pre>
<p>I would like to produce an array:</p>
<pre><code>Y = (x, n) such that n = sum i for (x, i) in X
</code></pre>
<p>so in the example above, we'd have:</p>
<pre><code>Y = {{A, 4}, {B, 2}, {C, 5}}
</code></pre>
<p>The code I currently have is:</p>
<pre><code>#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
char A = 'A';
char B = 'B';
char C = 'C';
vector< pair<char, int> > X = {{A, 1}, {B, 2}, {C, 1}, {A, 3}, {C, 4}};
// Sort by first element of the pair
sort(begin(X), end(X), [](auto a, auto b) { return a.first < b.first; });
// Could this be better? Is there an existing STL algorithm that will
// do this in-place?
vector< pair<char, int> > Y;
for(auto p : X) {
if(Y.empty() || Y.back().first != p.first) {
Y.push_back(p);
} else {
Y.back().second += p.second;
}
}
cout << "Y:";
for (auto p : Y) {
cout << '{' << p.first << ' ' << p.second << '}';
}
cout << '\n';
}
</code></pre>
<p><em>Could this code be made more succinct?</em> (Without changing the type of the underlying container)</p>
<p>I'm looking to try to eliminate the <a href="https://youtu.be/qH6sSOr-yk8?t=130" rel="nofollow noreferrer">raw loop</a>, by replacing with an algorithm in the standard library, but I don't see one that would quite fit.</p>
<p>I'd want some variant of <code>std::unique</code> which takes not only a predicate for whether two elements are equivalent, but also a function which defines how to combine them. It might look like:</p>
<pre><code>coalesce(begin(X), end(X), [](auto a, auto b){ return a.first == b.first; }, [](auto a, auto b) { return {a.first, a.second+b.second} });
</code></pre>
<p>FWIW, here's an implementation of <code>coalesce</code> which seems to work:</p>
<pre><code>template<class ForwardIt, class BinaryPredicate, class BinaryFunction>
ForwardIt coalesce(ForwardIt first, ForwardIt last, BinaryPredicate p, BinaryFunction f)
{
if (first == last)
return last;
ForwardIt result = first;
while (++first != last) {
if(p(*result, *first)) {
*result = f(*result, *first);
} else {
++result;
*result = *first;
}
}
return ++result;
}
</code></pre>
<p>And the code becomes:</p>
<pre><code> vector< pair<char, int> > X = {{A, 1}, {B, 2}, {C, 1}, {A, 3}, {C, 4}};
// Sort by first element of the pair
sort(begin(X), end(X), [](auto a, auto b) { return a.first < b.first; });
// Easier to understand the intent!
auto e = coalesce(begin(X), end(X),
[](auto a, auto b) { return a.first == b.first; },
[](auto a, auto b) { return pair<char, int>{a.first, a.second+b.second}; });
for_each(begin(X), e, [](auto p) {
cout << '{' << p.first << ' ' << p.second << '}';
});
cout << '\n';
</code></pre>
<p>NOTE: I'm quite familiar with <code>map</code>, etc, and don't want to use it.</p>
| 0non-cybersec
| Stackexchange | 1,243 | 3,369 |
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 | 349 | 1,234 |
What can we say about the order of a group given the order of two elements?. <p>If I know that a group of finite order has two elements $a$ and $b$ s.t. their orders are $6$ and $10$, respectively. What statements can be made regarding the order of the group?</p>
<p>I know by Lagrange's that the elements should divide the order of the group, so I've taken the $\operatorname{lcm}$. I think the order of our group should be a multiple of $30$. But I'm thinking there's more I can say.</p>
| 0non-cybersec
| Stackexchange | 134 | 491 |
Fibonacci numbers expressed as squares of lower Fibonacci numbers. <p>I am no mathematician so my apologies for my ignorance.</p>
<p>I notice that every number in the Fibonacci series can be expressed as a previous Fibonacci number squared plus or minus (alternating) another previous Fibonacci number squared, and both columns of squares themselves are composed of the Fibonacci sequence, each number appearing twice from 2 onwards. ie</p>
<pre><code>1 1 + 0 1+0
1 1 - 0 1-0
2 1 + 1 1+1
3 2 - 1 4-1
5 2 + 1 4+1
8 3 - 1 9-1
13 3 + 2 9+4
21 5 - 2 25-4
34 5 + 3 25+9
55 8 - 3 64-9
89 8 + 5 64+25
144 13 - 5 169-25
233 13 + 8 169+64
377 21 - 8 441-64
610 21 + 13 441+169
987 34 - 13 1156-169
</code></pre>
<p>and so on.</p>
<p>Is this well known? Is there a proof that it works for all Fibonacci numbers?</p>
| 0non-cybersec
| Stackexchange | 342 | 916 |
Trying to understand the definition of a free Abelian group.. <blockquote>
<p>Let $B$ be a subset of an (additive) abelian group $F$. Then <strong>$F$ is free abelian with basis $B$</strong> if the cyclic subgroup $\langle b \rangle$ is infinite cyclic for each $b \in B$ and $F=\sum_{b \in B} \langle b \rangle $ (direct sum). A free abelian group is thus a direct sum of copies of $\Bbb Z$. A typical element $x \in F$ has a unique expression $$x = \sum m_b b$$ where $m_b \in \Bbb Z$ and almost all $m_b$ (all but a finite number) are zero.</p>
</blockquote>
<p>I understand that by $F = \sum_{b \in B} \langle b \rangle$ (direct sum), they mean an external direct product of the infinite cyclic subgroups $\langle b \rangle$.</p>
<p>But what does $x=\sum m_bb$ mean? </p>
<p>Since $F = \sum_{b \in B} \langle b \rangle = \{ ...,-b_1, 0, b_1, ...\} \oplus \dots \oplus \{\dots, -b_n, 0, b_n, \dots\}$ and $x \in F$, then $x=(m_1b_1, \dots, m_nb_n)$. But each $b$ is an element of $F$ and therefore by the same logic shouldn't each $b$ be of the form $(j_1b_1, \dots, j_nb_n)$? And therefore $x=(m_1(j_1b_1, \dots, j_nb_n), etc \dots)$?</p>
<p>What exactly am I misunderstanding here? This seems like a circular definition.</p>
| 0non-cybersec
| Stackexchange | 443 | 1,243 |
generate HD addresses using publicKey Bip44. <p>I'm just wondering if it's possible to generate HD address using xPub?</p>
<p>I tried to create HD address using BitWASP-PHP with the following path:</p>
<pre><code>m / purpose' / coin_type' / account' / change / address_index
m/44/0'/0'/0/1
</code></pre>
<p>but the response is: </p>
<blockquote>
<p>Can't derive a hardened key without the private key</p>
</blockquote>
<p>I know that I can do it with Bip32 with the following path: 0/addressIndex</p>
<p>but I would like to use bip44.</p>
| 0non-cybersec
| Stackexchange | 189 | 548 |
Decompose an invertible matrix into an exchangeable product of diagonalizable matrix and a matrix with all the eigenvalues equal to $1$. <blockquote>
<p>Let <span class="math-container">$ g $</span> be an invertible <span class="math-container">$ n\times n $</span> complex matrix. Show that <span class="math-container">$ g $</span> can be written as
<span class="math-container">$$ g=su=us ,$$</span>
where <span class="math-container">$ s $</span> is diagonalizable and all eigenvalues of <span class="math-container">$ u $</span> are equal to <span class="math-container">$ 1 $</span>.</p>
</blockquote>
<p>My Attempt:</p>
<p>Since <span class="math-container">$ g $</span> is an invertible complex matrix, then we assume that <span class="math-container">$ g $</span> is similar to <span class="math-container">$ \operatorname{diag}\{ J_1(\lambda_1), J_2(\lambda_2),\cdots, J_k(\lambda_k) \}=h^{-1}gh, \ h\in GL(n, \mathbb C) $</span> where <span class="math-container">$ J_i(\lambda_i) $</span> is the <span class="math-container">$ i $</span>-th Jordan block with eigenvalue <span class="math-container">$ \lambda_i>0 $</span>. If <span class="math-container">$ k=n $</span>, i.e., <span class="math-container">$ g $</span> is diagonalizable, then take <span class="math-container">$ s=g, \enspace u=I_n $</span> the identity matrix and we are done. If not, it suffices to consider a non-diagonal Jordan block, say, <span class="math-container">$ \left(J_1(\lambda_1)\right)_{m_1\times m_1} $</span> with <span class="math-container">$ 2\le m_1\le n $</span>, since diagonalization and eigenvalues are invariant under similar transformations. </p>
<p>Let's first try the easiest case which is <span class="math-container">$ m_1=2 $</span>. If we want to find a <span class="math-container">$ s $</span> which is diagonalizable, then we can find invertible matrix <span class="math-container">$ Q $</span>, s.t. <span class="math-container">$ Q^{-1}sQ=\operatorname{diag}\{ \tau_1, \tau_1 \}_{2\times 2},\ 0\ne\tau_1\in\mathbb C $</span>. Then we can write:
<span class="math-container">$$\begin{align} Q^{-1}J_1(\lambda_1)&=Q^{-1}su\\
&=(Q^{-1}sQ)Q^{-1}u\\
&=\tau_1Q^{-1}u .\end{align}$$</span>
Hence we have
<span class="math-container">$$ \begin{pmatrix}\lambda_1/\tau_1 & 1/\tau_1\\
0&\lambda_1/\tau_1 \end{pmatrix}=u .$$</span>
Since all eigenvalues of <span class="math-container">$ u $</span> are <span class="math-container">$ 1 $</span>, we deduce that <span class="math-container">$ \lambda_1=\tau_1 $</span>. Thus
<span class="math-container">$$ u=\begin{pmatrix} 1&1/\lambda_1\\
0&1 \end{pmatrix}. $$</span>
And it should be clear that <span class="math-container">$$ s=\begin{pmatrix}\lambda_1&0\\0&\lambda_1\end{pmatrix} .$$</span>
In general, we conclude that
<span class="math-container">$$ s=\operatorname{diag}\{ \underbrace{\lambda_1,\cdots, \lambda_1}_{m_1},\underbrace{\lambda_2,\cdots, \lambda_2}_{m_2},\cdots, \underbrace{\lambda_k,\cdots, \lambda_k}_{m_k} \} ,$$</span>
and <span class="math-container">$$ u=\operatorname{diag}\{ \frac{1}{\lambda_1}J_1(\lambda_1), \frac{1}{\lambda_2}J_2(\lambda_2),\cdots, \frac{1}{\lambda_k}J_k(\lambda_k) \} $$</span>
up to similarity.</p>
<hr>
<p>Is it right to give a proof like that?</p>
| 0non-cybersec
| Stackexchange | 1,133 | 3,312 |
How can I find the Jordan form of this upper triangular Toeplitz matrix?. <blockquote>
<p>Given an <span class="math-container">$n \times n$</span> matrix <span class="math-container">$A$</span> whose <span class="math-container">$(i,j)$</span> entry is</p>
<p><span class="math-container">$$a_{ij} = \begin{cases} n-j+i & \text{if } j \geq i\\ 0 & \text{otherwise}\end{cases}$$</span></p>
<p>find its Jordan form.</p>
</blockquote>
<p>I know that all the Jordan blocks will have <span class="math-container">$\lambda = n$</span> as eigenvalue, but how can I find the size of each block?</p>
| 0non-cybersec
| Stackexchange | 204 | 600 |
$f(x)=a^{x}.$ Find $f(f^{-1}(x))$. Explain the intuition behind this.. <p>Question: <span class="math-container">$f(x)=a^{x}.$</span> Find <span class="math-container">$f(f^{-1}(x))$</span>. Explain the
intuition behind this. </p>
<p>I know that <span class="math-container">$f(f^{-1}(x))=x$</span>, so it is a silly question, but what does
it really mean? How would you explain it from basics to a student in for
example middle school?</p>
| 0non-cybersec
| Stackexchange | 156 | 445 |
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 | 349 | 1,234 |
How to fix NixOS localtime service?. <p>Setting <code>services.localtime.enable = true;</code> <a href="https://nixos.org/nixos/options.html#services.localtime.enable" rel="nofollow noreferrer">should</a> start a "simple daemon for keeping the system timezone up-to-date based on the current location.", but <a href="https://github.com/NixOS/nixpkgs/issues/67673" rel="nofollow noreferrer">it doesn't</a>:</p>
<blockquote>
<p>Failed to get target of /etc/localtime: No such file or directory</p>
</blockquote>
<p><code>touch /etc/localtime</code> might fix it in the short run, but I don't expect that's a reasonable workaround – NixOS' /etc is not meant to be hacked this way, after all. I guess some other setting is also needed to make this work, but the documentation doesn't mention anything. Unfortunately the bug report linked above hasn't received any attention, so I hope someone in this community knows what to do.</p>
<hr>
<p><a href="https://github.com/NixOS/nixpkgs/issues/67673#issuecomment-527859105" rel="nofollow noreferrer">Setting <code>time.timeZone = "UTC";</code> as well</a> results in the service starting. However, the service (and the geoclue service) don't produce any useful output:</p>
<pre><code>$ journalctl --boot --output=cat --unit geoclue.service
Starting Location Lookup Service...
Started Location Lookup Service.
$ journalctl --boot --output=cat --unit systemd-timedated.service
Starting Time & Date Service...
Started Time & Date Service.
Failed to set timezone: Europe/Zurich
</code></pre>
<p>and <strong>the /etc/localtime symlink keeps pointing to /etc/zoneinfo/UTC</strong> even after being online for an hour or so.</p>
| 0non-cybersec
| Stackexchange | 504 | 1,680 |
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 | 349 | 1,234 |
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 | 349 | 1,234 |
Where are the connection files for IIS Manager for Remote Administration?. <p>I have <a href="http://www.microsoft.com/en-us/download/details.aspx?id=41177" rel="nofollow noreferrer">IIS Manager for Remote Administration</a> installed on one PC and now I have a new PC and want to move the connections I setup on my old PC. But I don't know where are the connection files are saved. I tried to look into my Profile but don't have a clue on where they are.</p>
<p>I have the 32bit on the old PC and 64bit on the new PC. I also wonder if the connection files can be shared among them at all?</p>
| 0non-cybersec
| Stackexchange | 163 | 595 |
How do I repeat an included .tex file multiple times?. <p>I would like to repeat a file in a LaTeX document multiple times:</p>
<pre><code>\include{probenahme/sample}
\include{probenahme/sample}
\include{probenahme/sample}
\include{probenahme/sample}
\include{probenahme/sample}
</code></pre>
<p>However, if I compile the main document with <code>latexmk -pdf main-document.tex</code>, It will throw the following error:</p>
<pre><code> level-1 auxiliary file: probenahme/sample.aux
Already encountered file probenahme/sample.aux
---line 26 of file probenahme.aux
: \@input{probenahme/sample.aux
: }
I'm skipping whatever remains of this command
Already encountered file probenahme/sample.aux
---line 27 of file probenahme.aux
: \@input{probenahme/sample.aux
...
</code></pre>
<ul>
<li>It works fine with a single <code>\include{probenahme/sample}</code></li>
<li>It works if I run <code>pdflatex main-document.tex</code> instead of <code>latexmk -pdf main-document.tex</code></li>
<li>I don't want to use the <code>latexmk -f</code> option because it runs in a continuous integration environment and I want that to catch other errors.</li>
</ul>
<p>What is the problem and how do I solve it while still using <code>latexmk</code>?</p>
| 0non-cybersec
| Stackexchange | 412 | 1,274 |
Probability - binary array through a comm. channel. <p>An information through a communication channel is transmitted as a binary array - an array of bits (1s and 0s). But the bits can get corrupted, 1 can turn into a 0 and 0 can turn into a 1 with a probability of $1-a$ . </p>
<p>The bits are transmitted independent of one another. </p>
<p>Seeing a lot of signals that need to be transmitted, it was acknowledged that the ratio between 0s and 1s is $3:4$ .</p>
<p>Find the distribution of the input array, if the output is $101$ . </p>
| 0non-cybersec
| Stackexchange | 155 | 542 |
[REQUEST] Shows that are NOT slow burners/slow paced?. After watching Travelers, The Sinner and Man in the High Castle within the last few months, I'm sick to death of slow motion shows where every conversation is dragged out unnecessarily, and episodes are 5-10 mins longer than they should be because we spend time watching people stare at something/someone for ages.
So I'm looking for shows where things progress a bit quicker. I'm thinking the likes of The Last Kingdom, Jack Ryan, Bosch, Chuck, The Marvel Shows, sons of anarchy, orange is the new black etc etc.
Any recommendations please? | 0non-cybersec
| Reddit | 138 | 598 |
macOS Sierra doesn't have the crispy fonts as they used to be in earlier versions. <p>First, running the following command:</p>
<pre><code>defaults -currentHost read -globalDomain AppleFontSmoothing
</code></pre>
<p>gives me back <code>3</code>.</p>
<p>But the fonts nowhere look the way they used to look in earlier versions of macOS. I was using Yosemite before, and today I upgraded to Sierra. Below is the screenshot of Sublime Text editor.</p>
<p><a href="https://i.stack.imgur.com/IWvrU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IWvrU.png" alt="enter image description here"></a></p>
<p>They look OK in iTerm, but elsewhere - including browsers - font rendering is much worse.</p>
<p>So how can I make these fonts as crispy as they used to on earlier macOS/OS X versions? I guess it definitely has something to do with AppleFontSmoothing, or font anti-aliasing in general, but I have tried the many other options in this regard, that are as follows:</p>
<ol>
<li>Setting <code>AppleFontSmoothing</code> with and without <code>currentHost</code> flag, and restarting the macbook each time I make a change to see the changes.</li>
<li>Ran the command <code>sudo atsutil databases -remove</code> to remove all the user installed fonts.</li>
<li>Re-installing the font that I was using to get the desired result. (Note: I was using "Bitstream Vera Sans Mono")</li>
<li>Tried to change font smoothing option for specific applications like <code>com.apple.terminal</code> but it didn't work either.</li>
</ol>
<p>Note: <a href="https://discussions.apple.com/thread/7273274?start=0&tstart=0" rel="nofollow noreferrer">a similar question.</a></p>
| 0non-cybersec
| Stackexchange | 511 | 1,686 |
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 | 349 | 1,234 |
I rename a app folder on the iPhone 3GS using iTunes 10.1 on Mac; then sync causes it to revert. <p>I run iTunes on the Mac MBP (Snow Leopard). I have a folder of apps called New Folder. I click on it to open it, rename it, then close it. It shows the new name. But then after sync it changes back to New Folder.</p>
<p>I do wonder if it is some name conflict. The new name was sushi, and there are sushi apps. But what is weird is it does show up with the new name until I press sync.</p>
<p>EDIT 2/20/11: It isn't a name conflict; I have seen this at other times. Also it shows all the apps in alphabetical order, it appears.</p>
| 0non-cybersec
| Stackexchange | 188 | 640 |
Error estimate for a Finite Element Method. <p>Let $0=x_0<x_1<...<x_n$ be a partition of the interval [0,1] and let $S=\{v\in C^0([0,1]):v|_{[x_i,x_{i-1}]} \mathrm{is\ a\ linear\ polynomial}, i=1,...,n\ \mathrm{and}\ v(0)=0\}.$Suppose $u(x)\in S$ is such that
$$
\int_0^1u'(x)v'(x)dx=\int_0^1f(x)v(x)dx
$$
and let $\tilde{u}(x)\in S$ be such that
$$
\int_0^1\tilde{u}'(x)v'(x)dx=\sum_{i=0}^N\frac{h_i+h_{i+1}}{2}f(x_i)v(x_i)$$
where
$$
h_i=x_i-x_{i-1},\ h_0=h_n=0.
$$
I want to show that
$$
||u'-\tilde{u}'||_{L_2}\leq Ch^2(||f'||_{L_2}+||f''||_{L_2}).
$$
I've attempted to integrate by parts, use Holder's inequality, and use Poincare's inequality where appropriate, but have come up empty. Does anyone have any suggestions on how to prove this estimate?</p>
| 0non-cybersec
| Stackexchange | 353 | 770 |
we yell too much.. my almost 4 year old has been difficult for most of his 3's - as most kids are - i know i'm not alone or unique in this.
he's not a bad kid, he's not trying to be difficult, but he's all ego, and if he doesn't want to do something, it's a fucking fight. he's got impulse control, but only on the things that matter to him. i don't think he has add/adhd, though he is called "busy" often. he needs to be redirected, he needs to calm the fuck down sometimes. but i got a migraine yesterday, my first ever, and he just pushed all the buttons.
i am venting... so in short, i yell at him when he's not listening, being difficult, and that's not effective. i feel really bad, really guilty. i've never been a yeller and i know i'm a huge part of the problem. i'm going to turn it around but i'm here so i don't feel so alone, in both my frustration, disappointment and guilt - with him AND myself. | 0non-cybersec
| Reddit | 240 | 915 |
grep and directories containing spaces. <p>I would like to search all files containing an association of strings (here the files should contain 'arthur' AND ('déni' OR 'deni') for instance) in a directory and subdirectories. After some search I came up with the following code:</p>
<pre><code>egrep -li 'arthur' `egrep -lir 'déni|deni' /path/to/files/`
</code></pre>
<p>the trouble is I get error messages because many files and directories contain spaces. Is there a way to go round this issue?</p>
| 0non-cybersec
| Stackexchange | 146 | 502 |
A time-domain filter that optimizes accuracy of the result of Fourier transform within a frequency band. <p>I remember from a lecture that there is a filter, applied to a time-domain signal, that results in the smallest mean-squared error between the "true" (continuous) Fourier transform of that signal, and it's discretised version given finitely many sample points, within a specific frequency range.</p>
<p>So, the error is only evaluated within <span class="math-container">$f_{\min}$</span> and <span class="math-container">$f_{\max}$</span>, the accuracy outside this range is ignored. </p>
<p>This is from memory and I'm not certain whether it was</p>
<ul>
<li>within a frequency range or just below or above a specific frequency</li>
<li>whether the error was really mean-squared error.</li>
</ul>
<p>I'm happy to delete this question if it doesn't make sense (if my memory is completely off).</p>
<p>I researched, but what I found so far is only filters that reduce the signal to lie within a specific range. That is not my intention, because the Fourier transform will take care of this. (However, those filters might also improve the accuracy of the Fourier-transformed signal. That would again be interesting.)</p>
<p>I have close to no background in signal processing, unfortunately.</p>
| 0non-cybersec
| Stackexchange | 327 | 1,308 |
$\mathrm{Supp}(\mathrm{Exc}(f))=\mathrm{Supp}(K_X-f^*K_Y)?$. <p>Let <span class="math-container">$f:X\to Y$</span> be a log resolution of normal varieties, let <span class="math-container">$\mathrm{Exc}(f)$</span> be the locus (the complement in <span class="math-container">$X$</span> of the largest open where <span class="math-container">$f$</span> is an isomorphism). </p>
<p>Is there an example of <span class="math-container">$f$</span>, such that some codimension <span class="math-container">$1$</span> component of <span class="math-container">$\mathrm{Exc}(f)$</span> does not appear in the support of <span class="math-container">$K_X-f^*K_Y$</span>? </p>
| 0non-cybersec
| Stackexchange | 226 | 668 |
We are three experts on individuals who cause sexual harm and the prevention of sexual abuse; ask us anything about sexual abuse and sexual violence.. **EDIT:** Thank you everyone for the great questions! We will stop now at 5:00 PM Eastern. Please visit www.atsa.com & www.nsvrc.org for more information regarding sexual abuse perpetration and prevention. Check out our twitter accounts to follow us for updates:
[@MakeSocietySafe](https://twitter.com/MakeSocietySafe) Association for the Treatment of Sexual Abusers
[@NSVRC]( https://twitter.com/NSVRC) National Sexual Violence Resource Center
[@MCSeto](https://twitter.com/MCSeto) Michael Seto
------------------------
Recently, we have witnessed unprecedented media coverage and public attention regarding sexual abuse. As high-profile accounts of abuse and harassment have been highly publicized, it can feel overwhelming and confusing and raise questions regarding what we can do to prevent the perpetration of sexual abuse. Sexual abuse affects everyone in our society and the three of us are here today to answer questions you may have regarding those who cause sexual harm, survivors of sexual abuse, sexual abuse prevention, sex offender treatment and/or management and resources for survivors of sexual abuse. Ask us anything about sexual abuse.
Maia Christopher, /u/MaiaATSA is the Executive Director of the Association for the Treatment of Sexual Abusers (ATSA). Focusing on preventing sexual abuse through understanding and interrupting the behaviors of people at risk of offending ATSA specializes in disseminating research, defining and supporting effective treatment practices and promoting evidence based policies.
Karen Baker, LMSW, /u/KarenNSVRC has been the Director of the National Sexual Violence Resource Center (NSVRC) for the past 17 years. She is a Member of the Board of Directors for the Association for the Treatment of Sexual Abusers (ATSA) and Co-Chair of the ATSA Prevention Committee. Ask me anything about sexual violence, needs of survivors, victim advocacy, the role of bystanders, prevention strategies and resources related to sexual violence. Follow NSVRC on Twitter @NSVRC.
Michael Seto, /u/MCSeto is a clinical & forensic psychologist & researcher who has focused on the areas of pedophilia, paraphilias, sexual offending against children, and online offending. He has presented and published extensively on these topics and has written well reviewed solo books on pedophilia & sexual offending against children (2008) and online sexual offending (2013). Follow him on Twitter, @MCSeto.
Proof: https://imgur.com/a/tYoiq
EDIT:
More Proof: https://twitter.com/MCSeto/status/941020600839090187
https://twitter.com/MakeSocietySafe/status/941021881326501890
https://twitter.com/NSVRC/status/941020925415260160
| 0non-cybersec
| Reddit | 641 | 2,812 |
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 | 349 | 1,234 |
How can I find this integral for a fourier series?. <p>I have to calculate the following integral $$ b_n = \dfrac{1}{\pi} \int_{-\pi}^{\pi} \dfrac{1}{2}x \sin nx dx$$</p>
<p>The correct answer is apparently $$\dfrac{(-1)^{n-1}}{n}$$</p>
<p>But I have no idea how I should get this answer. I was able to find that $$\int \dfrac{1}{2}x\sin nx dx = \dfrac{\sin nx - nx \cos nx}{2n^2}$$</p>
<p>How should I proceed?</p>
| 0non-cybersec
| Stackexchange | 160 | 419 |
Problem 2h. Munkres Topology Section 1.1 Confirmation. <p>I'm learning (or trying to) topology from Munkres' Topology. I believe I've solved 2h in Section 1.1, but I wanted to confirm with someone that I am doing it right. Here it is: </p>
<blockquote>
<p>$ A\cup (B - C) = (A \cup B) - (A \cup C)$</p>
</blockquote>
<p>I believe that this is false, and here's why. On the RHS, you have elements in $A \cap C$ that you don't have on the LHS. Therefore, I believe that there is a backwards implication ( $\impliedby$). Can someone confirm or tell me where my logic is wrong? Thank you so much :) </p>
| 0non-cybersec
| Stackexchange | 193 | 604 |
Prove by induction that ${x}^{2k}-{y}^{2k}=(x+y)t$ for all natural numbers $k$ and $t$.. <p>Although it is an elementary algebraic result proved easily using algebra but I wanted to prove it inductively.</p>
<p>In my endeavor to do this, I've reached to the step which not only requires the preceding term but also the penultimate term to be true but in induction we only starts with the assumption of the previous term to be true. So, I'm left wondering how could I proceed further?</p>
<p>My proof goes like this:</p>
<p>$a(k)={x}^{2k}-{y}^{2k}$</p>
<p>$a(1)={x}^{2}-{y}^{2}=(x+y)(x-y)$</p>
<p>So, $a(1)$ is true.</p>
<p>Now, let us assume that $a(n)$ is true.</p>
<p>So, ${x}^{2n}-{y}^{2n}=(x+y)p$ for some polynomial $p$</p>
<p>Now, </p>
<p>$a(n+1)={x}^{2n+2}-{y}^{2n+2}$</p>
<p>$={x}^{2n+2}-{y}^{2n+2}-{x}^{2}{y}^{2n}+{x}^{2}{y}^{2n}+{y}^{2}{x}^{2n}-{y}^{2}{x}^{2n}$</p>
<p>$={x}^{2}({x}^{2n}-{y}^{2n})+{y}^{2}({x}^{2n}-{y}^{2n})-{x}^{2}{y}^{2}({x}^{2n-2}-{y}^{2n-2})$</p>
<p>$=({x}^{2}+{y}^{2})({x}^{2n}-{y}^{2n})-{x}^{2}{y}^{2}({x}^{2n-2}-{y}^{2n-2})$</p>
<p>$=({x}^{2}+{y}^{2})((x+y)p)-{x}^{2}{y}^{2}({x}^{2n-2}-{y}^{2n-2})$</p>
<p>Now I'm stuck with ${x}^{2}{y}^{2}({x}^{2n-2}-{y}^{2n-2})$ divisibility by 11 that is the divisibility of $a(n-1)$ term by 11.</p>
| 0non-cybersec
| Stackexchange | 600 | 1,288 |
Haproxy auto reload on configuration change. <p>I am new to haproxy, I have below questions...</p>
<p>1.) I am trying to configure Haproxy in such a way that it automatically reloads after the configuration on the file(haproxy.cfg) is changed.</p>
<p>Tried, but did not work :- <a href="https://serverfault.com/questions/361412/haproxy-graceful-reload">Haproxy graceful reload</a>.</p>
<pre><code>/usr/sbin/haproxy -f haproxy.cfg -p /var/run/haproxy.pid -D -sf $(cat /var/run/haproxy.pid)
</code></pre>
<p>Also tried:-</p>
<pre><code>/usr/sbin/haproxy -f haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)
</code></pre>
<p>2.) I installed haproxy by <code>apt-get install haproxy</code>, will this ensure that it runs in daemon mode ?</p>
<p>P.S. I am using haproxyv1.8</p>
| 0non-cybersec
| Stackexchange | 314 | 798 |
C# & ASP.NET MVC: how to remove null and empty fields from SignalR JSON response globally. <p>I want to remove the empty or null value from the JSON response.</p>
<p>I have already used in the SignalR but in this project used dependency injection.</p>
<pre><code>public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseCors(CorsOptions.AllowAll);
HubConfiguration config = new HubConfiguration()
{
EnableDetailedErrors = true,
EnableJavaScriptProxies = true,
};
var jsonSerializer = new JsonSerializer();
jsonSerializer.DateFormatString = GlobalConfig.DateFormat;
jsonSerializer.NullValueHandling = NullValueHandling.Ignore;
GlobalHost.DependencyResolver.Register(typeof(JsonSerializer), () => jsonSerializer);
app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
app.MapSignalR("/signalr", config);
}
}
</code></pre>
<p>But I want to use in simple 3 tier architecture ASP.NET MVC project but I can't find a proper solution.</p>
| 0non-cybersec
| Stackexchange | 284 | 1,098 |
How to swap parameters in Shell command. <p>I have a command with parameters in shell. like</p>
<pre><code>Command -a -b
</code></pre>
<p>assume <code>a</code> <code>b</code> are very long directory name, and they are not always the first and last parameters.</p>
<p>However, I need to use this command again. I use <code>ctrl+p</code> to go back the command, but this time I need to reverse <code>a</code> <code>b</code> order.</p>
<pre><code>Command -b -a
</code></pre>
<p>Instead of retyping them again, is there any way to fast swap them?</p>
<p>Thanks in advance.</p>
| 0non-cybersec
| Stackexchange | 196 | 579 |
Convert. Earlier today at a family reunion, one of my cousins brought out a few board games to play together. For a while we were just playing Samurai Sword, but it was a three person game and one of us had ot leave partway through. So then he brought out Convert (we were calling it Converge because of the strange lettering on the box). He bought it at some games convention, and I looked it up recently... It's amazingly fun, simple to learn and it's a very quick game (good for playing in between turns of something like Axis and Allies). I honestly just want to share this game with you guys, it's really fun, and I want it to do well.
You can find it [here.](http://www.yodeogames.com/products/convert) I have no affiliation with the makers of this game, I just think it's cool.
~~There's a facebook page somewhere where the creator posts one-person brainteasers, too, but I can't seem to find it. I will update this if/when I do!~~
EDIT: Found it fairly fast! The facebook page is [here](https://www.facebook.com/YodeoGames?fref=ts), if anyone is interested. You may have to scroll through a bit to find the puzzles. | 0non-cybersec
| Reddit | 286 | 1,126 |
TIFU by spilling 4000 gallons of jet fuel.. But seriously, that's like 30,000 dollars worth of fuel that's going to cost at least 100,000 dollars to have cleaned up.
Now for the story. I work at an airport as a line service technician, which mostly involves fueling aircraft. The fuel in our trucks comes from tanks we have on the field, which are filled up by tanker trucks a few time a day. So I was checking in this fuel load, and didn't get all the right valves open to direct it to a certain tank, and it re routed to another tank which happened to already be full. Now the fun begins, when the tank gets full, the high level emergency shutoff valves is supposed to kick on and stop the flow of fuel into the tank. The shutoff valve on this tank happened to be broken, thus causing the 4000 gallons of fuel to spray out the top of the tank like a sprinkler.
The way I see it, it's as much my fault as it is my supervisors. Apparently this has happened twice before, never this much, but it has happened. Yes, I did have the valves wrong, but my supervisor also failed to fix the faulty equipment. | 0non-cybersec
| Reddit | 257 | 1,105 |
How much does the data model affect scalability and performance in so called "NoSQL" database?. <p>You can't ever have a talk about so called "NoSQL" database without bringing the CAP theorem (Consistency, Availability, Partition : pick two). If you have to pick say, between MongoDB (Partition, Consistency) and CouchDB (Availability, Partition), the first you need to think about is "Do I need correct data or do I need access all the time?".</p>
<p>Those new database were <em>made</em> to be partitioned. But what If I <em>don't</em>? What if I just think its pretty cool to have a Key/Value, Column, Document, whatever database instead of a relational one, and just create one server instance and never shard it? In that case, wouldn't I have both availability and consistency? MongoDB wouldn't need to replicate anything, so it would be available. And CouchDB would have only one source of data, so it would be pretty consistent. </p>
<p>So that would mean that, in that case, MongoDB and CouchDB would have little difference in term of use case? Well, except of course performance, API, and al, but that would be more like choosing between PostgreSQL and MySQL than having two fundamentally different set of requirements.</p>
<p>Am I right here? Can I change a AP or CP database to an AC one by not creating more than one instance? Or is there something that I am missing?</p>
<p>Let's ask the question in reverse. What if I take a relational database, let say MySQL, and put it in a master/slaves configuration. I don't use ACID transactions If I require that any write be synchronized to the slave immediately, wouldn't that make it a CP database? And what if I synchronise it a some predefined intervals, and it doesn't matter if a client read stale data from a slave. Wouldn't that make it an AP database? Wouldn't that mean that if I give up ACID compliance I can still use the relationnal model for a partionned database?</p>
<p>In essence : is scalability about what you are ready to give up in the CAP theorem, more than the underlying data model? Does having Column, Document, Key Value, whatever give a boost to scalability over a relational model? Could we design a relational database designed from the ground up for partition tolerance? (Maybe it already exists). Could we make NoSQL database ACID compliant?</p>
<p>Sorry, its a lot of questions, but I have read a lot about NoSQL database recently and it seem to me that the biggest benefit of using them is that they fit better the "shape" of your data, rather than just the partition, CAP and giving up ACID compliance. After all, not everyone has so much data that they need to partition it. Is there a performance/scalability benefit to not using the relational model <em>before I even think about partitioning my data?</em></p>
| 0non-cybersec
| Stackexchange | 678 | 2,820 |
Two of my [51m] kids [18f and 13m] hate each other.. I have 4 kids: 18f, 15f, 13m, and 10m. Through the years, each of them have gone through "phases" of not getting along. However, they've always grown out of it after a couple years; all except the 18 and 13 year old. There are no other major ongoing tensions with ANY of them. They are both close with the other 2 kids, but they can't stand each other.
The first explanation I have is that their personalities just clash. They always have, and I fear they always will. Since my son could talk, he's been arguing with his oldest sister.
I'm ashamed to admit it, but parenting did play a role. Their mom left about 5 years ago, but she mentally checked out after the birth of our youngest. Money was tighter back then so I was working 2-3 jobs at the time. From the time she was 8 or 9, my oldest daughter would look after her young siblings after school and summers until I got home at 6 or 7 as their mother would spend all her time on the computer. It got to the point where I would have to ask my 9 year old daughter what my 1 year old son was saying, because she was the only one who understood his baby talk. This went on until she was about 13 or 14 when I got a better job and was able to spend more time with them. Because of this, her relationship with her siblings is somewhat skewed; she's a half-mother figure to them. She corrects them like a parent would and this causes countless arguments with her 13 year old brother. I've told her over and over that she needs to stop bossing him around and I can tell she tries, but it's an old habit that was encouraged for years.
Her bossiness isn't the sole reason for their fights, but it instigates many of them. They'll bicker over anything and it escalates. Most times, the 13 year old becomes annoyed over a small thing (ex:her telling him to take his elbows off the table) and takes it way too far, calling her names and trying to get on her nerves until she inevitably loses patience with him. They both find entertainment in making the other angry. I know there's still a chance they'll outgrow it, but that seems less and less likely the older they get. Some of the things they've said to each other are just atrocious; my daughter is an amazing and caring person normally, but (unbeknownst to me) she was subjected to years of psychological abuse from her mother and she can become incredibly cruel. I thought the 18 year old moving out would help things, but I've realized while she's been home from college on winter break that nothing has changed. I want ALL my kids to get along and look forward to reunions when they're all grown. How do I go about trying to fix their relationship?
---
**tl;dr**: Two of my four kids despise each other. I believe there are 2 reasons: 1) Their personalities clash and 2) the 18 year old was forced into helping raise her siblings when she was younger and still occasionally acts more like a parent than a sister. How can I fix their relationship? | 0non-cybersec
| Reddit | 692 | 3,011 |
Touch ID: Biometry is locked out. Code=-8. <p>Im using Touch id to identify iPhone users in my app, when is use <code>canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics</code> to evaluate if the user is eligible for using Touch id, but after many failed tries even if the user is eligible for using touch id, it returns <code>FALSE</code>.</p>
<p>And that will lead the app to skip this step and thinks that the touch id is not supported in this device.</p>
<p>Here is the error i get:</p>
<blockquote>
<p>Error Domain=com.apple.LocalAuthentication Code=-8 "Biometry is locked
out." UserInfo={NSLocalizedDescription=Biometry is locked out.}</p>
</blockquote>
| 0non-cybersec
| Stackexchange | 192 | 682 |
Microsoft To-Do's Open Email in Outlook.exe. <p>When flagging an email in outlook you can set this up to sync between Microsoft To-Do's</p>
<p>To-Do's gives you the option to open the flagged message but this opens in outlook online where it would be preferred to open in outlook desktop app.</p>
<p>Is this possible?</p>
<p><a href="https://i.stack.imgur.com/vO6Ll.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vO6Ll.png" alt="enter image description here" /></a></p>
| 0non-cybersec
| Stackexchange | 159 | 494 |
ZFS Equivalent of lvdisplay snap_percent. <p>I've been using LVM snapshots for backing up MySQL databases. <code>FLUSH TABLES WITH READ LOCK</code> is issued and then <code>lvcreate --snapshot --size 4G</code> etc. Because the database is live while the snapshot is active the <code>snap_percent</code> (amount of snapshot storage being used to track deltas with the original state of the filesystem at the time the snapshot was taken) starts increasing. This <code>snap_percent</code> is monitored day-over-day and the <code>--size</code> is increased in the event it reaches 80%.</p>
<p>My question is whether or not there is an equivalent statistic or property in ZFS for determining how much space is being consumed by a snapshot as a percentage of space remaining in the pool? Obviously I don't need to pass a <code>--size</code> parameter to <code>zfs snapshot</code> but how can I determine whether the clone based upon that snapshot is nearing the limits of the pool.</p>
<p>Hopefully that makes sense, it sure sounds like a convoluted question now that I read.</p>
| 0non-cybersec
| Stackexchange | 279 | 1,080 |
Hell Is For Children. “Do *good girls* keep secrets, Mommy?”
As I dreamily tucked my daughter into bed, I was brought back to reality by the weight of her question.
“Uhm. . . .” I stammered. “What do you mean, Gracie?”
With a yawn, she answered, “I was just wondering.”
“We’ll talk about it tomorrow,” I said before I kissed her on the forehead, and I left her bedroom. As I prepared myself to go to bed, I talked with my husband about what Gracie asked me.
“She could have overheard someone in church,” Michael suggested. Spitting my mouthwash into the bathroom sink, I expressed my dissatisfaction with his explanation.
“I don’t think Father Richards discusses children keeping secrets from their parents in his homilies,” I said as I exited the bathroom, and I climbed into bed with Michael. “What if it was someone in preschool?”
“Why do you think that?”
“She started preschool yesterday,” I explained. “And she didn’t tell us much about it. What if she has a bully, who tells her to keep it a secret?”
Before he could respond, I said, “I’m not jumping to conclusions, Michael.”
“I didn’t say anything,” he responded. “I was going to say that it’s not odd for children to keep secrets from their parents.”
I murmured, and he continued, “Did you have a bully when you went to *Sunny Days*?”
“No,” I admitted. Although my recollections of *Sunny Days* were vague, I couldn’t remember having a bully. “But I don’t want our daughter to keep secrets from us.”
“I know that,” he said. “And it’ll be OK. Goodnight, honey.”
“Goodnight,” I replied, and we turned off our bedside lamps in unison.
Although I more or less accepted Michael’s explanation for Gracie’s question, I didn’t understand something that I withheld from Michael — “*Good girls* keep secrets.” Why did that sentence unnerve me? It caused a sense of unease to build within me, but I didn’t understand why. As I ruminated on these thoughts, I eventually fell asleep.
The room was dark, the lone source of illumination coming from the candles held by the group of people in brown robes. I was a child, standing in the center of a pentagram on the floor. A woman in a brown robe turned me around to face her, and she held a disposable paper cup to my lips, pouring its contents into my mouth. The cup was filled to the brim with blood. The woman crouched down to my level, and she said, “*Good girls* keep their secrets.” I screamed, a loud, piercing shriek, and then I woke up. My face was stained with tears. I considered waking Michael up, but I decided against it. *It was just a nightmare*. I lay myself back down on the bed. *Right?*
On the following day, I decided to speak with Natalie, the head teacher of *Sunny Days Daycare*. When I picked Gracie up from preschool, I saw that she was sitting at her desk in the front of the room, reading from a red folder as parents picked up their children. I walked toward her with Gracie’s hand in mine. After she saw us approach her, she closed the folder, placed it in her desk, and she arose from her seat.
“Mrs. Hendricks,” she said as she shook my hand. “Natalie.”
“Please,” I said with a shake of the head. “Julie.”
“Was there anything you wanted to talk about, Julie?” She smiled.
“I wanted to know how well Gracie is doing in school,” I answered.
“Fantastic.”
“Has she made any friends?” I asked.
“Mommy. . . .” Gracie said as she tugged on my sleeve. “I want to go home.”
“Wait a minute, baby,” I replied. “*Has* she made any friends?”
“Yes,” Natalie answered. “She is a sweetheart. All of us here at Sunny Days love her.”
I smiled before I laughed, “My husband says I worry too much, which I’m inclined to believe is true.”
“It’s OK,” she replied. “I understand a mother’s concern for her daughter’s welfare.”
“Thank you for speaking with me.”
“No problem,” she said. “I’ll see you tomorrow, right, Gracie?”
“Right,” she said.
We said goodbye to Natalie, who began to talk with other parents. As Gracie and I left the preschool, we entered my car for the drive home. I watched as Natalie closed the blinds of the window in the front room. I wanted to believe that I was worrying too much, but I couldn’t shake the feeling that there was something more to *Sunny Days Daycare*. However, life took precedence, and I fell into a routine. I would drop Gracie off in the morning, go to work, and I would pick Gracie up on the way home. As I waited one day for class to be dismissed, I looked at the drawings made by the class hanging on the wall in the front room. I recalled a memory of my experience at *Sunny Days*, where my teacher hung my drawing on the wall, and she patted my head, referring to me as a “*Good little girl*.” Despite my best efforts, I could not remember the content of the drawing. The class was dismissed, and Gracie came up to me. As we hugged each other, I saw a teacher leave a room toward the back of the building with a sign inscribed, “*PLAYROOM*,” and she locked the door behind her. After Gracie and I greeted each other, I noticed the distinct smell of candles emanating from the back of the building. It reminded me of church. Natalie approached us, and I asked her, “Do you smell that?”
“What?”
“It smells like candles. Blown out candles. . . .” I trailed off.
“I’m sorry,” Natalie said. “I don’t.”
“Do you, Gracie?” I asked.
She shook her head, and therefore I dismissed it. Gracie bade farewell to Natalie, and we left for home. As the week went on, Gracie continued to acclimate to her new environment. She made friends — “Boys and girls, Mommy!” — and she was chosen to be the caretaker of a rabbit, whom Natalie introduced as the class pet. Gracie was expected to name him, but she was unable to think of a name that she liked. After I suggested it, Gracie christened the class pet, “Thumper.” The week seemed to be an idyll.
On Friday of the first week of preschool, I lavished Gracie with praise as I dropped her off, and I promised her that she and I would join her father at the local ice cream parlor to celebrate her first week of school. With a smile on her face, she left the car in haste, and she waved goodbye before she entered the school with Natalie and her fellow classmates. As I drove toward work, I noticed something in the rearview mirror. *Gracie’s bookbag*. I looked at the time on the car radio, and I deduced that I would be able to give Gracie her bookbag and make it to work on time. I turned around, and I headed back toward *Sunny Days*. I parked in the parking lot, and I grabbed her bookbag from the backseat, looking into it to ensure that she had everything that she needed in it. In her bookbag, I found drawings, which gave me pause as I was under the impression that all of her drawings were given to the teachers to hang on the wall of the front room of the school. I looked at them with a smile on my face. They depicted scenes from home with her father and me, school with her friends, her grandparents’ houses. However, I found a piece of paper torn haphazardly from a larger piece of paper, and the words, “*Miss Natalie is*. . . .” written on it with a red crayon. I put the papers back into her bookbag, and I exited my car. It was then that I noticed the blinds of the window in the front room were closed, and no light emanated from within.
Confused by the empty appearance of the school, I walked slowly to the front door, which was unlocked. I was going to alert the teachers to my presence, but a voice within told me, *Be quiet*. I smelled the same distinct smell of candles. As I walked through the darkened school, I seemed by rote to be heading toward the Playroom. *What is going on?* I stopped at the door to the Playroom, and I heard indistinct voices within. Through the din of voices, I was able to distinguish the voice of Natalie. However, I could not hear everything that she was saying — “Good boys, *good girls*. . . . Your parents have given you to us. . . . *Keep your secrets*.” As I debated with myself to open the door, I heard a loud, piercing shriek, and the sound of children crying. The door seemed to open on its own, which gave me a chance to peek inside.
Gracie, dressed in a tattered white nightgown, lying in the center of a pentagram on the floor, which was surrounded by adults in hooded brown robes, all of whom were holding onto her classmates. Natalie, dressed in a brown robe, holding a dead Thumper in her hands, its white fur turning pink as a result of the blood gushing from its neck. She held the animal over Gracie’s head, draining its blood into her mouth. Gracie appeared weak as Natalie traced a pentagram onto her forehead with Thumper’s blood.
I held my hand to my mouth in shock. As I saw my daughter forced to drink the blood of her pet, I attempted to rush into the playroom, but I was held back as if by a force that I could not see. *Get out*. I was pushed back in the direction of the front room. When I attempted again to rush into the playroom, I was pushed toward the front door. As I made my third attempt, I was struck by an intense pain in my head, which caused me to collapse onto the floor. The pain was accompanied by memories from *Sunny Days*, which flashed in my mind as if they were slides in a projector — the disposable paper cup with its crimson contents, pink rabbits twitching, “The Master” — a man, physically beautiful, dressed entirely in black, who asked us to sign his book.
I was eventually pushed out of the front door, falling back onto the gravel in the parking lot. A wave of nausea overcame me, and I vomited into the grass. The memories of *Sunny Days* concluded — the teacher, a woman in her seventies, caressing my tear–stained face, saying, “You’re a *good girl*, Julie. And what do *good girls* do?”
“*Good girls keep their secrets*.” | 0non-cybersec
| Reddit | 2,485 | 9,763 |
java String.format: numbers with localization. <p>Is it possible to localize numbers in String.format call the same way as NumberFormat.format does?</p>
<p>I've expected it simply to use</p>
<pre><code>String.format(locale, "%d", number)
</code></pre>
<p>but this doesn't return the same result as if using NumberFormat. For example:</p>
<pre><code>String.format(Locale.GERMAN, "%d", 1234567890)
</code></pre>
<p>gives: "1234567890", while </p>
<pre><code>NumberFormat.getNumberInstance(Locale.GERMAN).format(1234567890)
</code></pre>
<p>gives: "1.234.567.890"</p>
<p>If it can't be done, what's recommended way for localizing text including numbers? </p>
| 0non-cybersec
| Stackexchange | 228 | 665 |
How can I mount the SSD drive on Amazon's m3.medium?. <p>Amazon's <a href="http://aws.amazon.com/ec2/instance-types/" rel="noreferrer"><code>m3.medium</code></a> instance comes with a 4GB SSD Drive:</p>
<p><img src="https://i.stack.imgur.com/SSDpY.png" alt="enter image description here"></p>
<p>But I can't seem to find the device using <code>df</code>:</p>
<pre><code>$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 20G 2.9G 16G 16% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 1.9G 8.0K 1.9G 1% /dev
tmpfs 375M 228K 375M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 0 1.9G 0% /run/shm
none 100M 0 100M 0% /run/user
</code></pre>
<p>Or at <code>/dev</code>:</p>
<pre><code>$ ls /dev
autofs hvc0 i2c-5 loop7 ram0 ram7 tty1 tty21 tty33 tty45 tty57 ttyS1 ttyS21 ttyS5 vcs6 zero
block hvc1 i2c-6 loop-control ram1 ram8 tty10 tty22 tty34 tty46 tty58 ttyS10 ttyS22 ttyS6 vcs7
btrfs-control hvc2 i2c-7 mapper ram10 ram9 tty11 tty23 tty35 tty47 tty59 ttyS11 ttyS23 ttyS7 vcsa
char hvc3 input mem ram11 random tty12 tty24 tty36 tty48 tty6 ttyS12 ttyS24 ttyS8 vcsa1
console hvc4 kmsg net ram12 rfkill tty13 tty25 tty37 tty49 tty60 ttyS13 ttyS25 ttyS9 vcsa2
core hvc5 log network_latency ram13 shm tty14 tty26 tty38 tty5 tty61 ttyS14 ttyS26 uinput vcsa3
cpu hvc6 loop0 network_throughput ram14 snapshot tty15 tty27 tty39 tty50 tty62 ttyS15 ttyS27 urandom vcsa4
cpu_dma_latency hvc7 loop1 null ram15 snd tty16 tty28 tty4 tty51 tty63 ttyS16 ttyS28 vcs vcsa5
disk i2c-0 loop2 port ram2 stderr tty17 tty29 tty40 tty52 tty7 ttyS17 ttyS29 vcs1 vcsa6
ecryptfs i2c-1 loop3 ppp ram3 stdin tty18 tty3 tty41 tty53 tty8 ttyS18 ttyS3 vcs2 vcsa7
fd i2c-2 loop4 psaux ram4 stdout tty19 tty30 tty42 tty54 tty9 ttyS19 ttyS30 vcs3 vga_arbiter
full i2c-3 loop5 ptmx ram5 tty tty2 tty31 tty43 tty55 ttyprintk ttyS2 ttyS31 vcs4 xen
fuse i2c-4 loop6 pts ram6 tty0 tty20 tty32 tty44 tty56 ttyS0 ttyS20 ttyS4 vcs5 xvda1
</code></pre>
<p>The small print (with a <code>*</code>) suggests that I should have inserted some sort of parameter during launch:</p>
<blockquote>
<p>*6 Instance storage for M3 instances will be provided when these block device mappings are specified in the instance launch parameters.</p>
</blockquote>
<p><strong>Do I have to re-launch the instance to gain access to the SSD drive? Which parameters are required during launch?</strong></p>
| 0non-cybersec
| Stackexchange | 1,125 | 3,083 |
Native JS add class using a counter reset on each parent class. <p>I have this structure:</p>
<pre><code><div class="parent">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
<div class="parent">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
</code></pre>
<p>I need to increment on each child div by one and reset the counter when it passes to the new parent class. I can do this easily with Jquery using <code>each</code> but I am struggling to make it work with native JavaScript, since the project I am working on does not use Jquery. The structure should look like this:</p>
<pre><code><div class="parent">
<div class="child-1"></div>
<div class="child-2"></div>
<div class="child-3"></div>
<div class="child-4"></div>
</div>
<div class="parent">
<div class="child-1"></div>
<div class="child-2"></div>
<div class="child-3"></div>
</div>
</code></pre>
<p>I have been using <code>var ParentDiv= document.querySelectorAll(".parent");</code> and <code>ChildDiv = document.querySelectorAll(".child");</code></p>
<p>I've got a counter going on with a <code>for</code> loop but not been able to get it to restart the counter on each parent. Any help to point me out how I can accomplish this?</p>
| 0non-cybersec
| Stackexchange | 648 | 1,742 |
Lebesgue integral, differentiation under the integral sign. <p>Let $f:[0,1] \times [0,1] \to \mathbb R$ be a function such that:</p>
<p>(a) for each $x \in [0,1]$, the function $y \to f(x,y)$ is Lebesgue integrable on $[0,1]$.</p>
<p>(b) $\dfrac{\partial f}{\partial x}(x,y)$ is a bounded function of $(x,y)$.</p>
<p>Show that for each $x$, the function $y \to \dfrac{\partial f}{\partial x}(x,y)$ is measurable and $\dfrac{d}{dx} \int_0^1 f(x,y)dy=\int_0^1 \dfrac{\partial f}{\partial x}(x,y)dy$.</p>
<p>I am a bit stuck on the exercise, to prove that $g_x(y)=\dfrac{\partial f}{\partial x}(x,y)$ I did the following:</p>
<p>If for each $x$, $f_x(y)=f(x,y)$ is integrable, by definition, it is measurable. So given $x$ in [0,1), the function $f_{x+\frac{1}{n}}$ is measurable for each $n>\dfrac{1}{x+1}$ and the function $f_{1-\frac{1}{n}}$ is measurable for $x=1$, but then for $0 \leq x <1$ we have $$\dfrac{\partial f}{\partial x}(x,y)=\lim_{n \to \infty} \dfrac{f(x+\frac{1}{n},y)-f(x,y)}{\frac{1}{n}}$$</p>
<p>and for $x=1$, $$\dfrac{\partial f}{\partial x}(x,y)=\lim_{n \to \infty} \dfrac{f(x-\frac{1}{n},y)-f(x,y)}{-\frac{1}{n}}$$</p>
<p>Since each function is a pointwise limit of measurable functions, then for each $0 \leq x \leq 1$, $\dfrac{\partial f}{\partial x}(x,y)$ is a measurable function.</p>
<p>I am not sure if my reasoning is correct and I don't know what to do for the last part of the exercise. Any help would be greatly appreciated. Thanks in advance</p>
| 0non-cybersec
| Stackexchange | 565 | 1,496 |
Rename outlook2007 categories not working. <p>I'm new to outlook 2007 and I'm trying to rename a category. Acordingly to MS, I can achieve it by just renaming it:</p>
<p><a href="http://office.microsoft.com/en-us/outlook/HA012316361033.aspx" rel="nofollow noreferrer">http://office.microsoft.com/en-us/outlook/HA012316361033.aspx</a></p>
<p>But as soon as I click the OK button, confirming the change, it returns to it's original value. For instance, if I rename the "Blue Category" to "Home" it will accept without erros. But, when I click again in the Categorize icon, I'll see that the "Blue Category" is still there, and my "Home" category does not exist.</p>
<p>Has someone experienced this kind of problem?</p>
<p>TIA,</p>
<p>Bob</p>
| 0non-cybersec
| Stackexchange | 241 | 745 |
Subsets and Splits