text
stringlengths 36
35k
| label
class label 2
classes | source
stringclasses 3
values | tokens_length
int64 128
4.1k
| text_length
int64 36
35k
|
|---|---|---|---|---|
I read my son the Bible. He's four, and started talking about God, and repeating what our friends kids told him. I asked if he wanted to know more, and cracked open my bible.
I went through the creation story, stopping at each point to go over what humans have discovered; and he quickly got the point that it was just a fantasy story.
When I got to the part about God threatening Adam and Eve with death, he told me he thought God was stupid. I think he recognised that God was a bully.
At dinner, he told my father-in-law that we had read the Bible. "How did that go?" he was asked.
"Not good".
I've never heard my FIL laugh so hard.
| 0non-cybersec
|
Reddit
| 162
| 639
|
New environment (with nested environments, i.e. tcolorbox and tabularx). <p>This is my code:</p>
<pre><code>% XeLaTeX
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tcolorbox}
\usepackage{environ}
\setlength\parindent{0pt}
\usepackage{array}
\usepackage{tabularx}
\newenvironment{solution}
{
\begin{tcolorbox}
\begin{tabularx}{\textwidth}{p{0.7cm}X}
}
{
\end{tabularx}
\end{tcolorbox}
}
\def\fakta#1{\stepcounter{fakta} F{\arabic{fakta}}: & #1 \\}
\def\contoh#1{\stepcounter{contoh} C{\arabic{fakta}}{\alph{contoh}}: & #1 \\}
\def\huraian#1{\stepcounter{huraian} H{\arabic{fakta}}{\alph{huraian}}: & #1 \\}
</code></pre>
<p>and I'm trying to do something like</p>
<pre><code>\begin{solution}
\fakta{blablabla}
\end{solution}
</code></pre>
<p>but it doesn't work and errors keep coming out. Why?</p>
<p>UPDATE:</p>
<pre><code>\newenvironment{solution}
{
\tabularx{\textwidth}{lX}
}
{
\endtabularx
}
</code></pre>
<p>^this works, but not this:</p>
<pre><code>\newenvironment{solution}
{
\begin{tcolorbox}
\tabularx{\textwidth}{lX}
}
{
\endtabularx
\end{tcolorbox}
}
</code></pre>
| 0non-cybersec
|
Stackexchange
| 507
| 1,191
|
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
|
Why does decltype not see the member declaration?. <p>Trying to compile this simple class:</p>
<pre><code>#include <vector>
struct M
{
// interface
auto begin() -> decltype(identities.begin())
{
return identities.begin();
}
// implementation
private:
std::vector<int> identities;
};
</code></pre>
<p>results in an error:</p>
<pre><code>$ g++-510 where.cpp -std=c++11
where.cpp:57:35: error: ‘struct M’ has no member named ‘identities’
auto begin() ->decltype(this->identities.begin())
^
where.cpp:57:35: error: ‘struct M’ has no member named ‘identities’
$ clang++ where.cpp -std=c++11 -Wall -pedantic -Wextra
where.cpp:57:35: error: no member named 'identities' in 'M'
auto begin() ->decltype(this->identities.begin())
~~~~ ^
</code></pre>
<p>Why doesn't <code>decltype</code> see the class member?</p>
| 0non-cybersec
|
Stackexchange
| 316
| 933
|
nodejs net sockets + websocket without socket.io. <p>I'm trying to create something like chat using nodejs.
I'm a newbie in nodejs and i want to create it without socket.io (i want to learn how it works).
Here is the code i'm using.</p>
<pre><code>var http = require('http');
var net = require('net');
var server = http.createServer(function(req,res){
res.writeHead(200,{'content-type' : 'text/html'});
res.write('<a href="./lol/">lol</a><br>');
res.end('hello world: '+req.url);
var client = new net.Socket();
client.connect('7001', '127.0.0.1', function() {
console.log('CONNECTED TO: ');
// Write a message to the socket as soon as the client is connected, the server will receive it as message from the client
client.write('I am Chuck Norris!');
});
// Add a 'data' event handler for the client socket
// data is what the server sent to this socket
client.on('data', function(data) {
console.log('DATA: ' + data);
// Close the client socket completely
client.destroy();
});
// Add a 'close' event handler for the client socket
client.on('close', function() {
console.log('Connection closed');
});
//req.
});
server.listen(7000);
require('net').createServer(function (socket) {
console.log("connected");
socket.on('data', function (data) {
console.log(data.toString());
});
}).listen(7001);
</code></pre>
<p>And all works fine, (i think).
When i open localhost:7000 i'm getting in node CMD messages about "CONNECTED TO:" and "connected" and "I am Chack Norris".
After that i'm trying to write in the browser console:</p>
<pre><code>var conn = new WebSocket('ws://localhost:7001/');
</code></pre>
<p>Also no errors, but when i try this line:</p>
<pre><code>conn.send('lol');
</code></pre>
<p>I'm getting an error: "Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.(…)"</p>
<p>And after some time i get one more error: "WebSocket connection to 'ws://localhost:7001/' failed: WebSocket opening handshake timed out"</p>
<p>maybe this code is wrong, but i have tried everything that i found through google. Can someone help me with this?</p>
| 0non-cybersec
|
Stackexchange
| 687
| 2,256
|
I (26/f) recently called off my wedding, jumped into a new relationship with someone (40/m) and my family is furious.. I was engaged to a wonderful man, also 26-years-old, for a year. We were living together, things were great, but I always had a nagging feeling that something was missing. I don't know if it's because NONE of my other friends are even close to the marriage stage in their lives, but the overwhelming feeling that our relationship didn't have "spark" anymore was eating away at me.
I broke up with him and moved out. Within a few weeks I was very casually dating an older man I met at work. We've taken things incredibly slowly due to my situation and see each other maybe once or twice per week. Most of my friends tell me, "You're crazy but we still love you." However, my parents are taking a different route. I've always been incredibly close with them and have never done anything they disapprove of. It is very clear they disapprove of this. My mother has resorted to immature tactics, telling me I'm an embarrassment to the family, looking up the new guy on the Internet and then making snarky comments, asking me how "grandpa" is doing, etc. My father hasn't said a word to me at all.
Now, I am stubborn. I want to see where things go with this person because I feel a spark I haven't felt before. Yet every time I talk with my mother, I feel like I should just end this new relationship in order to keep the relationship with my parents.
Am I crazy? Or are my parents crazy?
tl;dr: Broke off engagement, got into new relationship with man 15 years older. Parents freaking out and trying to convince me not to do it.
edit: Thank you for all of your responses. They remind me not to get too serious about the new "relationship" and treat it as a fling. I have been clear with the older man that if someone who seems interesting asks me on a date, that I am keeping my options open and will say yes. As for living life as a single person, I live alone, see friends every night, feel no dependance whatsoever on this new person, and am confident in my ability to be independent.
| 0non-cybersec
|
Reddit
| 490
| 2,108
|
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
|
General Topology - Proving that the Slinky Line is Hausdorff but not first countable.. <p>Consider <span class="math-container">$\mathbb{R}$</span> with the usual topology. Prove that <span class="math-container">$\mathbb{R} / \mathbb{N}$</span> is Hausdorff but not first countable.</p>
<p>I am not sure how to start this proof.</p>
<p>Some relevant information that is helpful: </p>
<p>The diagonal relation on the set <span class="math-container">$\mathbb{R}$</span> is a relation <span class="math-container">$\Delta_\mathbb{R}$</span> on <span class="math-container">$\mathbb{R}$</span> st:
<span class="math-container">$$\Delta_\mathbb{R} = \{(x,x) : x \in \mathbb{R}\} \subseteq \mathbb{R} \times \mathbb{R}$$</span></p>
<p>Let <span class="math-container">$\mathbb{R}$</span> be a space and <span class="math-container">$\mathbb{N} \subseteq \mathbb{R}$</span>. The set <span class="math-container">$R = (\mathbb{N} \times \mathbb{N}) \cup \Delta_\mathbb{R}$</span> is an equivalence relation on <span class="math-container">$\mathbb{R}$</span>. <span class="math-container">$X / R$</span> is denoted by <span class="math-container">$X / \mathbb{N}$</span> and <span class="math-container">$p_R$</span> is denoted by <span class="math-container">$p_\mathbb{N}$</span>. So, <span class="math-container">$X / \mathbb{N}$</span> has the quotient topology coinduced by <span class="math-container">$p_\mathbb{N}$</span>. Also, <span class="math-container">$R = (\mathbb{N} \times \mathbb{N}) \cup \{(x,x) : x \in \mathbb{R}\}$</span> and <span class="math-container">$p_\mathbb{N} : \mathbb{R} \rightarrow \mathbb{R} / \mathbb{N}$</span> is the natural projection. </p>
<p>To prove that <span class="math-container">$\mathbb{R} / \mathbb{N}$</span> is Hausdorff we must show that for any two unique elements in <span class="math-container">$\mathbb{R} / \mathbb{N}$</span> there exist disjoint open sets in the topology such that each open set contains a unique element. </p>
<p>To show that <span class="math-container">$\mathbb{R} / \mathbb{N}$</span> is not first countable we must show that there is not a countable neighborhood base at some element in the space. </p>
| 0non-cybersec
|
Stackexchange
| 696
| 2,184
|
I was handed a Windows 10 image to deploy that has all "Run as" options disabled while logged in as a user. How do I re-enable this? Google searches have yet to provide a fix.. [SOLVED]
Nevermind everyone, I found it. It's a custom ADMX template configured on a local GPO.
Hey everyone! I've got a corporate image of Windows 10 Enterprise x64 handed to me from a higher department to deploy across my OU via SCCM. The trouble is, while a user is logged in, Run as Administrator has been blocked and when I hold shift+right click, the run as a different user option does not show. If I right click a program from the start menu, click more, and then click on Run as a Different user, there is no dialogue box that comes up to enter credentials.
In GPresult, the only configuration that is obviously related has the run as a different user from the start menu option enabled. Various registry settings I found on tenforums.com have not been successful in re-enabling this option.
At present, the only way I or my help desk can run elevated programs and install applications is to completely log off the user account and then log back on using administrator credentials.
The higher department is not answering my calls or emails, I've been instructed to find a fix for this by my manager. Am I missing something?
| 0non-cybersec
|
Reddit
| 299
| 1,314
|
Does PDFTK respect PDF security flags?. <p>I have a PDF File which says that document security is enabled. It says that the only things allowed are: Printing, Content Copying or Extraction, and Content Extraction for Accessibility.</p>
<p>I'm trying to use <a href="http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/" rel="noreferrer">PDF Toolkit (PDFTK)</a> to create a smaller version of this PDF file so that it takes up less hard drive space. When I try running PDFTK on the file, though, it says that the owner password is required. If I open up the file in a Adobe Reader, it doesn't ask for a password and opens up fine.</p>
<p>I'm not familiar with PDF encryption, and so I was wondering what's going on here and why I can read the file in Reader but not PDFTK.</p>
<p>It seems to me that there are three options:</p>
<ol>
<li>It's easy to read the data which is supposedly encrypted, but PDFTK respects the permissions flag and won't allow you to modify a file if you don't provide the owner's password.</li>
<li>While it's possible to decrypt the data in a protected PDF (since it's not really secure), it's not a simple task and PDFTK didn't implement the logic needed to do this.</li>
<li>The data is actually encrypted, and you need the owner password in order to read its contents.</li>
</ol>
<p>Which of the three is correct?</p>
<p>It seems that #3 is unlikely since I am able to read the contents of the file in Acrobat without providing a password.</p>
| 0non-cybersec
|
Stackexchange
| 408
| 1,478
|
[vent][discussion] There is a leash law for a reason!. I just came back from taking my rescue dog for a quick walk. She’s pretty much scared of everything. For quick walks I like to go down a circle street that comes out at two different ends. I was walking with her and this old man is outside. In the far background I can see a black dog and I can see a tan dog coming up to the old man. I think ‘Should I go back?’ Fuck yes I should have, but didn’t. The black dog comes running up to us with the old man yelling that she likes to play. Before I could even get a word out that dog is next to mine sniffing her butt. She did seem like a nice dog but I get very nervous. My dog has her tail between her legs and I don’t know if she gonna go off. I tried to pull my dog away with the black dog following suit. That’s when I started to yell stop. This continues for a few a second till I start yelling at the old man (who btw is a few house ahead of us so its not like he could anything) to tell his dog to stop. I think I hear him say something like run ( Im not 100% sure tho) and that she just wants to play. Luckily she stopped and I turned around and walked away fast as hell. Like wtf? Dogs are great but you never know if there’s something about another person or dog that they just don’t like. Add to that my screaming it sure didn’t help. I nearly had a heart attack. Gonna report cause wtf. Only problem is the circular street has three different street name within it 😒😒
| 0non-cybersec
|
Reddit
| 362
| 1,480
|
My serious girlfriend [18] of 12 months doesn't think that I [18] am attractive, but says it doesn't matter.. My girlfriend always makes comments about how good other guys look, and when ever I ask if I am better looking, she says something like "looks don't matter to me, and I wouldn't be with them anyway cause they are assholes." This really bothers me because to me, she is the most beautiful woman on earth, and the feeling isn't mutual. We do have sex, so she must not think I'm repulsive. /r/relationship how should I handle this? Should I just not care about it?
**TL;DR: Girlfriend doesn't find me very attractive, but says it doesn't matter. It bothers me.**
| 0non-cybersec
|
Reddit
| 164
| 671
|
Post Match Thread: Manchester United 3-1 Paris Saint-Germain [3-3 agg.] [UEFA Champions League]. # Manchester United advance to the QF!
​
2nd Leg
Goals:
* 0-1 [Lukaku](https://streamja.com/X25N)
* 1-1 [Bernat](https://streamja.com/B5pN)
* 1-2 [Lukaku](https://streamja.com/dZZ5)
* 1-3 [Rashford](https://www.clippituser.tv/c/apqazm)
​
**Venue: Parc des Princes**
​
**LINE-UPS**
Paris Saint-Germain
Gianluigi Buffon, Thiago Silva, Presnel Kimpembe, Thilo Kehrer, Marco Verratti, Marquinhos, Juan Bernat, Dani Alves, Kylian Mbappé, Ángel Di María, Julian Draxler.
Subs: Edinson Cavani, Eric Maxim Choupo-Moting, Alphonse Areola, Layvin Kurzawa, Leandro Paredes, Thomas Meunier, Colin Dagba.
​
Manchester United
David De Gea, Victor Lindelöf, Chris Smalling, Luke Shaw, Eric Bailly (Diogo Dalot), Fred, Scott McTominay, Andreas Pereira, Ashley Young, Marcus Rashford, Romelu Lukaku.
Subs: Sergio Romero, Marcos Rojo, Angel Gomes, Tahith Chong, James Garner, Mason Greenwood.
​
**MATCH EVENTS | via ESPN**
**2' Goal! Paris Saint Germain 0, Manchester United 1. Romelu Lukaku (Manchester United) left footed shot from the left side of the six yard box to the bottom right corner.**
**12' Goal! Paris Saint Germain 1, Manchester United 1. Juan Bernat (Paris Saint Germain) left footed shot from the left side of the six yard box to the bottom left corner. Assisted by Kylian Mbappé.**
**30' Goal! Paris Saint Germain 1, Manchester United 2. Romelu Lukaku (Manchester United) left footed shot from very close range to the centre of the goal.**
34' Ángel Di María (Paris Saint Germain) is shown the yellow card for a bad foul.
36' Substitution, Manchester United. Diogo Dalot replaces Eric Bailly.
55' Ángel Di María (Paris Saint Germain) Goal ruled out for offside.
70' Substitution, Paris Saint Germain. Leandro Paredes replaces Thilo Kehrer.
70' Substitution, Paris Saint Germain. Thomas Meunier replaces Julian Draxler because of an injury.
75' Leandro Paredes (Paris Saint Germain) is shown the yellow card for a bad foul.
80' Substitution, Manchester United. Tahith Chong replaces Andreas Pereira.
87' Substitution, Manchester United. Mason Greenwood replaces Ashley Young.
**90'+4' Goal! Paris Saint Germain 1, Manchester United 3. Marcus Rashford (Manchester United) converts the penalty with a right footed shot to the high centre of the goal.**
90'+5' Substitution, Paris Saint Germain. Edinson Cavani replaces Dani Alves.
90'+9' Luke Shaw (Manchester United) is shown the yellow card for a bad foul.
| 0non-cybersec
|
Reddit
| 846
| 2,582
|
Apache mapping URL to CGI script. <p>In Apache I would like a URL "/myscript" or "/myscript?param=myparam" to execute a CGI script located at:</p>
<pre><code>/usr/local/scripts/custom.pl
</code></pre>
<p>I have tried:</p>
<pre><code>Action custom-action /usr/local/scripts/custom.pl
<Location "/myscript">
SetHandler custom-action
</Location>
</code></pre>
<p>but this isn't working.</p>
<p>Any ideas how I can achieve the mapping of URL to script?</p>
| 0non-cybersec
|
Stackexchange
| 168
| 474
|
Measuring dispersion. <p>I am trying to define a proper metric for characterizing dispersion of a set of $k \in \mathbb N$ points distributed over different spatial grids. </p>
<p>Formally, </p>
<p>given different 2-dimensional grids shapes $(A,B,...)$ not necessarily square but connex (see figure for a basic illustration). Cells are labeled $ [1,2,...,N_X]$ , $N_X$ being the total number of cells in grid $(X)$ and $N_X \neq N_Y$ in general. Given also a set $\{x_1,x_2,...,x_k\}$ of $k \in \mathbb N$ elements that are distributed over each grids, i.e. they occupy some cell centers. It is however possible for a single cell to host up to $k$ elements. A specific distribution over grid $(X)$ is named an $M_X$ map. All maps host exactly k elements but can differ by (1) the grid shape (2) the configuration of elements. </p>
<p>Is it possible to construct a dispersion metric in order to compare configurations between all different maps?</p>
<p>I have thought at this definition:</p>
<p>\begin{equation}
\delta_{M_X} := \frac{\sum\limits_{i < j\leq k} d(x_i,x_j)}{\max\limits_{all\ M_X}(\sum\limits_{p < q\leq k}d(x_p,x_q))}
\end{equation}</p>
<p>where $d(x_i,x_j)$ represents the shortest path distance (e.g. Manhattan distance) between elements $x_i$ and $x_j$. If it is not clear from syntax the normalizing factor correspond to the maximal possible dispersion of k elements on the same grid shape that the actual (i,j indexed) configuration being measured. $\delta_{M_X}$ is thus constructed to take values between 0, when all elements are concentrated on a same cell, to 1 when elements are maximally spread. The first problem is that I don't know how to derive the normalization factor for arbitrarily large grids other than using brute force algorithm (that is testing all possibilities). The second problem is that I am not sure of the validity of this definition. Thirdly I am quite confident that something better exists.</p>
<p>As a non-mathematician I don't even know in which field of mathematics I should try to find informations about this, any advice would be greatly welcome.</p>
<p><img src="https://i.stack.imgur.com/CgqpF.png" alt="Illustration of maps"></p>
| 0non-cybersec
|
Stackexchange
| 619
| 2,204
|
Vincero Kairos Series Watch in Rose/White Gold Review - Should you buy? - No you shouldn't.. Hi r/malefashionadvice
You might remember me from my latest review entries in the past couple of months. If you want to check them out, they are here:
[Loake 1880 Chatsworth Brown Chelsea Boots](https://www.reddit.com/r/malefashionadvice/comments/9czclr/review_loake_1880_chatsworth_chelsea_boots_in/)
[Tuscany Leather Parma Briefcase](https://www.reddit.com/r/malefashionadvice/comments/99c5nn/review_parma_2_compartment_full_grain_vegetable/)
Today I am going to bring you something different, because honestly I have been pretty pissed off by those "influencers" around the web that recommend products, giving them high grades, calling them revolutionary etc. when they are not even close to what is advertised. Take a look at Vincero Collective. A brand that has over 7500 "real" reviews that are mostly 5 star.
Do some research on google, you will find heaps of praise about them. Articles about how amazing they are, luxurious and incredible quality. All for 139$. That should raise some red flags already right?
You can read the whole article [I wrote here on Misiu Academy](https://www.misiuacademy.com/vincero-watch-review-kairos-series/) (My own blog about fashion). This post however is completely new though as I can speak a bit more freely and casually.
​
[For those wondering, this is a Suitsupply DB custom suit.](https://preview.redd.it/jqck9fg06vn11.jpg?width=2992&format=pjpg&auto=webp&s=a977c38483181f227c80132afe276677e39ed320)
**BACKGROUND OF PURCHASE**
Before I Started my fashion blog, I was quite a newbie when it came to watches and frankly, I still am. I started watching Real Men Real Style and these kinds of YouTubers because I wanted to grasp the basics. I then realised that it is all a commercial farce and that they try to make money, so let's skip that. Oh and those "seduction" videos...man I want to gouge my eyes out with a pitchfork.
I saw Antonio advertising these Vincero Watches on every try and frankly, I thought they looked pretty and at the moment I believed I should support the channel and fill the last void in my wardrobe. So what did I do? I went online and bought the Vincero Kairos in Rose/White Gold with the RMRS code thinking I will save some $.
**QUICK INFO ABOUT VINCERO**
Three friends woke up one day and decided to fly to Asia and make their dreams come true. They failed for 4 years then made Vincero Collective. They slapped some Italian Marble on the back, wrote a few fancy words in Latin "*Veni Vidi Vici*" and told you to go chase your dream and live your legend. I challenge you to live your legend on 139$.
Not only that, they said they have reinvented the dress watch and they have bold designs. Well gentlemen of MFA, the only bold thing here is their outlandish claim. Tales of luxury and quality for affordability, dragons and dwarves mining gold in the mines of Moria. You get the point.
**SPECIFICATIONS**
​
[Looks alright on paper honestly.](https://preview.redd.it/21fb1jn46vn11.jpg?width=1887&format=pjpg&auto=webp&s=5b01e8f15650b7389742ecc6576c0d5c09d36568)
**ORDERING AND SHIPMENT - 5/10 (For European Orders)**
The fun began here already.
Navigation in the website is smooth, fast and easy. Very easy to spot where to put discount code, input your shipping details etc. They give free shipping even internationally which is good. Delivery time in EU is 3-5 business days. Great, I thought.
I placed my order, received a nice email telling me "fire in the hole" and my order was being processed.
Fast forward 2 weeks and I have no clue where the watch is. I dig around and find out that my package has stuck in the Swedish customs. I have to find out a way to pay the import fee, which Vincero advertised that the watch comes with no additional fees. Silly me, but hey.
I pay the fee of about 25$ and then after 2 more weeks I finally received my watch.
Not a good start if you are in Europe. Then why would you buy this in Europe? I guess to write a review about it! Not only that, I have heard that the Vincero Customer Service is as bad as the Greek Economy (I am from Greece, I had to throw it in there).
**UNBOXING - 7/10**
Nothing to see here gentlemen! Sturdy black box with the Vincero Logo and a smooth textured inside. You will find a Refer a friend and win 30$ for your next purchase leaflet and some information on how to use the watch and set the time and date.
​
[Live your legacy gentlemen.](https://preview.redd.it/458plhf76vn11.jpg?width=4032&format=pjpg&auto=webp&s=31c9d97870f7943fc47d028d01b35a39210d8251)
The watch is folded and fits snugly in the box. At first glance it looks pretty and I like the texture and pattern of the strap. Nothing mind-blowing here though.
**DESIGN - 7/10**
What I wanted was a dress watch that can fit every occasion and look minimalist and as "clean" as possible. That is why I liked this one.
It has a big case (maybe too big) without hour marks and the only numbers are small ones and count every 5 seconds. There is your classic dial for hours, minutes and seconds and a date counter which is too close to the centre hand and also reveals movements too small for the case as a watch aficionado friend of mine said.
​
[A closer look.](https://preview.redd.it/ohjsyox96vn11.jpg?width=3024&format=pjpg&auto=webp&s=df732f17457095ff0334ddc3dabdb27c1ef80007)
Casing is 42mm wide and 10mm thick which fits nicely on my wrist but is a little too big sometimes for the cuffs of my shirts. The crown bears the Vincero Logo and is placed at 3 o'clock.
The Kairos Series has a variety of different colours. Blue, Black, White, Rose/White Gold and you can also choose or change easily the leather strap. Antonio calls this "*Like having a new watch*". Bullshito.
The leather strap is brown in this occasion and has some nice pattern on it.
On the back you can find the Italian Marble and the Latin proverbs which is a nice touch but who is really gonna see the back of your watch?
After re-writing this article here on Reddit I dropped the score down to 7/10 from 8/10.
**QUALITY - 4/10**
Grab some popcorn lads.
Let's start with the good stuff. The watch tells you the time. Quite accurately too. I have not noticed any problems with water and there are no scratches on the casing or the glass which is advertised as anti-scratch. This is actually good for 6 months wear.
The crown is easy to use, makes a distinctive sound when you pull it to change time and date.
The movement is the Miyota Quartz and in general people say that it is quite reliable. Problem with this though is that it triggers my OCD every time I notice the problem I am about to describe. The subdial that points to the seconds is not accurate. Instead of pointing to 0, 1, 2 seconds etc. it goes like 0.1, 1.1, 2.1 etc.
Now this is supposed to be a general issue with the Quartz movement but is eliminated in higher quality watches such as Grand Seiko for example. You will not notice this until you look at the watch up-close and it will not have any impact on your life, but if you have OCD like me you will be triggered.
Up next, we find the Date issue. You want your watch to tell you the correct time and...."*drum roll*" the correct date! In this case, the watch comes from the US and I think it is set to the US time. Which means that the date changes at random times during the day. So at the time of writing the watch will show 23 of September instead. At least 5-7 good hours behind in total.
Lastly, on today's show we have.....the leather strap.
It has bent creating an S line, it is incredibly stiff and hard to bend and feels like it's going to break eventually every time you try to pull it through the loops.
​
[Is it a snake? Is it a worm? No! It's the Vincero Leather Strap.](https://preview.redd.it/lgafrq8c6vn11.jpg?width=4032&format=pjpg&auto=webp&s=4bc20e5c45f9c4f1eb1f1ec9b0a9d40eb10a93c2)
Not only that, but the strap has began to fray in many places and the leather is rubbing off around the holes. Some of them have been enlarged too. Woohoo!
​
[This is like bad wine, it gets worse with time \(I promise I just came up with this one!\).](https://preview.redd.it/1g3xtugf6vn11.jpg?width=3024&format=pjpg&auto=webp&s=0b9db1d308d806d565a4f75f1a1fbc2ba103dd65)
**FINAL VERDICT - A GENEROUS 5/10**
Let's sum up with Pros and Cons:
**Pros**:
* Classy and elegant look
* Casing is good though a bit on the thick side
* Not expensive at 139$ with many discount codes flying around the web
* Renowned Quartz movement
* Easy to use crown
* I guess it tells you the time?
**Cons:**
* Disappointing leather strap that bends and holes have enlarged
* Late delivery due to customs (for outside the US)
* Seconds dial not pointing correctly
* Every couple of days I have to correct the date
* Strap has began to show signs of wear
**CONCLUDING REMARKS**
This is not a terrible watch. It looks ok, it tells you the time and has a durable casing. It costs 139$ for the love of god.
What pissed me off though is the whole influencer thing. Antonio says "*You will get compliments on this watch*". 6 months in I have not had a single compliment about it and I will never receive one I promise. It is by far the weakest part of my wardrobe.
The lengths that people go to for a commission or a paid promotion are incredible and have become blatantly apparent to me now.
Would I tell you to buy this? **Absolutely NO**. Save more for a better watch that will be an investment for the future and you can pass it to your children. Go with an established brand instead of a brand with bad customer service, terrible quality and anyone that is related to your run-of-the-mill YouTuber with mass followings. Rather watch the Gentleman's Gazette.
Live your legacy with a watch that means "weather" in Greek, be bold with a bold-less simple watch and live your legacy backpacking with 139$. I see what they try to do there, but re-inventing the classic dress watch? Not in a million years.
​
https://preview.redd.it/98z089wj6vn11.jpg?width=2000&format=pjpg&auto=webp&s=a7ba017726ad59e7cd156ec7658e3bc79a84237e
For 139$ this watch is ok. But not something that should be your first priority. You can do much better and you should. I didn't expect them to tell me to live my legacy. I am making it.
Thanks everyone. I hope you found this honest (one could say scathing) and humorous review about the Vincero Kairos in Rose/White Gold. Do you have one? I would love to engage with you down in the comments.
The next review will be in about a month's time about the Carlos Santos Double Monk Straps in Wine Shadow Patina. I hope you are as excited to read about them as much as I want to write about them.
Best,
Kostas
| 0non-cybersec
|
Reddit
| 2,993
| 10,820
|
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
|
Frobenius Series Solution of $x^{2}y''+xy'+5y=0$. <p>The equation $x^{2}y''+xy'+5y=0$ is equidimensional and has the general solution</p>
<p>$$y(x) = c_{1}\cos(\sqrt{5}\log x) + c_{2}\sin(\sqrt{5}\log x)$$</p>
<p>But this differential equation also has a regular singular point around $x = 0$ and hence we can use the Frobenius method to find $a_{n}$ such that </p>
<p>$$y(x) = \sum_{n = 0}^{\infty} a_{n}x^{n + s}$$</p>
<p>But wouldn't this imply that $\sin(\sqrt{5}\log x)$ has a series expansion around $x = 0$? Also when I use the indicial equation to find $s$, I get $s = \pm i\sqrt{5}$ which doesn't seem right?</p>
| 0non-cybersec
|
Stackexchange
| 248
| 638
|
mysql create user if not exists. <p>I have a query to check mysql users list for create new user.</p>
<pre><code>IF (SELECT EXISTS(SELECT 1 FROM `mysql`.`user` WHERE `user` = '{{ title }}')) = 0 THEN
CREATE USER '{{ title }}'@'localhost' IDENTIFIED BY '{{ password }}'
END IF;
</code></pre>
<p>But i get this error:</p>
<pre><code>ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF (SELECT EXISTS(SELECT 1 FROM `mysql`.`user` WHERE `user` = 'cms_localhost')) = 0 ' at line 1
</code></pre>
| 0non-cybersec
|
Stackexchange
| 193
| 613
|
Double wrap infant/toddler beds for nighttime convenience. This tip was given to us when stocking the room for our first, and it has saved us a few times. When putting sheets on the crib or toddler mattress, put the mattress protector down, then the fitted sheet, another protector, and another sheet. This way, when your little one has any form of accident out of either end, all you have to do is strip the first set and the bed is ready to go again. It is nice to skip the need to find a new sheet/protector and put them on when you are most likely already doing the same with pajamas for your little one. If it happens again in the same night, well you probably won't be getting much sleep anyway, so good luck.
| 0non-cybersec
|
Reddit
| 169
| 719
|
Ms Sql Server Table Design question. <p><strong>Background</strong></p>
<p>I'm designing a table which will serve as a repository of payment information to be used for research purposes. This table will have around 4.5 million records initially and will grow at a rate of around 400k annually. The PaymentReference column would be the only unique column in the table on an on going basis meaning after the initial historical load of data which would contain nulls. </p>
<p>Table example:</p>
<pre><code> CREATE TABLE [dbo].[Bil_ReturnsRepository](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[PolicyNumber] [nvarchar](32) NOT NULL,
[PaymentReference] [nvarchar](32) NULL,
[AccountingDate] [datetime] NOT NULL,
[ReturnDate] [datetime] NOT NULL,
[PaymentAmount] [decimal](19, 2) NOT NULL,
[RegionCode] [nvarchar](5) NULL,
[PolicyStateCode] [nvarchar] (3) NULL,
[CompanyCode] [nvarchar](4) NULL,
[LineOfBusiness] [nvarchar](4) NULL,
[ReturnReasonCode] [nvarchar](3) NULL,
[PaymentType] [nvarchar](20) NULL,
[PaymentPlan] [nvarchar](20) NULL,
[EntryUserId] [nvarchar](20) NULL,
[PolicyTermId] [bigint] NULL,
[PaymentDate] [datetime] NULL,
[DateOfFirstReturn] [datetime] NULL,
[BankId] [nvarchar](9) NULL,
[EquityDateOfPolicy] [datetime] NULL,
[OrginalStartDateOfPolicy] [datetime] NULL,
[PaymentSource] [nvarchar](20) NULL,
[DBTransactionTimeStamp] DATETIME NOT NULL DEFAULT(GETDATE()))
</code></pre>
<p><strong>Access to Data</strong></p>
<p>Business users will enter search criteria on a front end UI screen. The available options to use as search criteria will be every column located on the table except ID and DBTransactionTimeStamp. Every column of the table will have an associated text box that the user will have the ability to enter the necessary value for that column to use for the search. The only field that is not optional for the search is the ReturnDate field. For example, a search could be performed with just ReturnDate and PolicyNumber. ReturnDate, PaymentReference. ReturnDate, PolicyNumber, PaymentReference, AccountingDate. ReturnDate only. etc.... </p>
<p>A stored procedure will be created to actually perform the read of the table and will use the parameters passed by the front end UI when querying the table. </p>
<p><strong>Question</strong> </p>
<p>Since this is a new design I'm not currently experiencing any performance issues but I would like to be proactive and prevent any of those possible issues from occurring. I would imagine that with so many records on the table and the ability to search on all fields there would be table space scans that would occur. That would result in a slow response time for the output to be returned to the front end UI. So with that being said would it be beneficial to add any indexes and or keys to this table ? If so what Keys ? What indexes ?</p>
| 0non-cybersec
|
Stackexchange
| 795
| 2,913
|
Camel ActiveMQ Performance Tuning. <h3>Situation</h3>
<p>At present, we use some custom code on top of ActiveMQ libraries for JMS messaging. I have been looking at switching to Camel, for ease of use, ease of maintenance, and reliability.</p>
<h3>Problem</h3>
<p>With my present configuration, Camel's ActiveMQ implementation is substantially slower than our old implementation, both in terms of delay per message sent and received, and time taken to send and receive a large flood of messages. I've tried tweaking some configuration (e.g. maximum connections), to no avail.</p>
<h3>Test Approach</h3>
<p>I have two applications, one using our old implementation, one using a Camel implementation. Each application sends JMS messages to a topic on local ActiveMQ server, and also listens for messages on that topic. This is used to test two Scenarios:
- Sending 100,000 messages to the topic in a loop, and seen how long it takes from start of sending to end of handling all of them.
- Sending a message every 100 ms and measuring the delay (in ns) from sending to handling each message.</p>
<h3>Question</h3>
<p>Can I improve upon the implementation below, in terms of time sent to time processed for both floods of messages, and individual messages? Ideally, improvements would involve tweaking some config that I have missed, or suggesting a better way to do it, and not be too hacky. Explanations of improvements would be appreciated.</p>
<p><strong>Edit:</strong> Now that I am sending messages asyncronously, I appear to have a concurrency issue. <code>receivedCount</code> does not reach 100,000. Looking at the ActiveMQ web interface, 100,000 messages are enqueued, and 100,000 dequeued, so it's probably a problem on the message processing side. I've altered <code>receivedCount</code> to be an <code>AtomicInteger</code> and added some logging to aid debugging. Could this be a problem with Camel itself (or the ActiveMQ components), or is there something wrong with the message processing code? As far as I can tell, only ~99,876 messages are making it through to <code>floodProcessor.process</code>.</p>
<h3>Test Implementation</h3>
<p><strong>Edit:</strong> Updated with async sending and logging for concurrency issue.</p>
<pre><code>import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.camel.component.ActiveMQComponent;
import org.apache.activemq.pool.PooledConnectionFactory;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.jms.JmsConfiguration;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.log4j.Logger;
public class CamelJmsTest{
private static final Logger logger = Logger.getLogger(CamelJmsTest.class);
private static final boolean flood = true;
private static final int NUM_MESSAGES = 100000;
private final CamelContext context;
private final ProducerTemplate producerTemplate;
private long timeSent = 0;
private final AtomicInteger sendCount = new AtomicInteger(0);
private final AtomicInteger receivedCount = new AtomicInteger(0);
public CamelJmsTest() throws Exception {
context = new DefaultCamelContext();
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
PooledConnectionFactory pooledConnectionFactory = new PooledConnectionFactory(connectionFactory);
JmsConfiguration jmsConfiguration = new JmsConfiguration(pooledConnectionFactory);
logger.info(jmsConfiguration.isTransacted());
ActiveMQComponent activeMQComponent = ActiveMQComponent.activeMQComponent();
activeMQComponent.setConfiguration(jmsConfiguration);
context.addComponent("activemq", activeMQComponent);
RouteBuilder builder = new RouteBuilder() {
@Override
public void configure() {
Processor floodProcessor = new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
int newCount = receivedCount.incrementAndGet();
//TODO: Why doesn't newCount hit 100,000? Remove this logging once fixed
logger.info(newCount + ":" + exchange.getIn().getBody());
if(newCount == NUM_MESSAGES){
logger.info("all messages received at " + System.currentTimeMillis());
}
}
};
Processor spamProcessor = new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
long delay = System.nanoTime() - timeSent;
logger.info("Message received: " + exchange.getIn().getBody(List.class) + " delay: " + delay);
}
};
from("activemq:topic:test?exchangePattern=InOnly")//.threads(8) // Having 8 threads processing appears to make things marginally worse
.choice()
.when(body().isInstanceOf(List.class)).process(flood ? floodProcessor : spamProcessor)
.otherwise().process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
logger.info("Unknown message type received: " + exchange.getIn().getBody());
}
});
}
};
context.addRoutes(builder);
producerTemplate = context.createProducerTemplate();
// For some reason, producerTemplate.asyncSendBody requires an Endpoint to be passed in, so the below is redundant:
// producerTemplate.setDefaultEndpointUri("activemq:topic:test?exchangePattern=InOnly");
}
public void send(){
int newCount = sendCount.incrementAndGet();
producerTemplate.asyncSendBody("activemq:topic:test?exchangePattern=InOnly", Arrays.asList(newCount));
}
public void spam(){
Executors.newSingleThreadScheduledExecutor().scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
timeSent = System.nanoTime();
send();
}
}, 1000, 100, TimeUnit.MILLISECONDS);
}
public void flood(){
logger.info("starting flood at " + System.currentTimeMillis());
for (int i = 0; i < NUM_MESSAGES; i++) {
send();
}
logger.info("flooded at " + System.currentTimeMillis());
}
public static void main(String... args) throws Exception {
CamelJmsTest camelJmsTest = new CamelJmsTest();
camelJmsTest.context.start();
if(flood){
camelJmsTest.flood();
}else{
camelJmsTest.spam();
}
}
}
</code></pre>
| 0non-cybersec
|
Stackexchange
| 1,766
| 7,244
|
My wife [37 F] had a revenge affair and i [38 M] can't get over it.. My wife and i have been married for ten years and have two kids, a boy (8) and a girl (6).
We went through a rough patch In our marriage where we were barely communicating or having sex and i had a three month affair with a co-worker which she found out about by reading our texts. she kicked me out of the house for a few weeks but later let me back in and we've been in couples therapy.
Our therapist greatly stressed us being honest in order to save our marriage and during a session, she confessed that while we were separated, she hooked up with someone. We had a loud argument about it where she called me a hypocrite and said it wasn't fair of me to expect her to forgive what i wouldn't forgive. When i was calmer, i asked who it was and there the problem got worse.
Apparently, the person she hooked up with was her longtime friend (lets call him Adam). She and Adam (37 M) have been friends for 17 years now (they met in college and are very close). She confided in me many years ago that Adam once confessed while in college that he liked her but she said that they've always been nothing but best friends. Another round of arguing came up.
This man was at our wedding and is frequently around our family. Hell, our kids call him 'Uncle' and he and my wife are inseparable. I guess he was the one 'comforting' her when i was out of the house. I absolutely cannot get over the fact that my wife slept with another man, much less *him* of all people. The times we've talked about it, we yell the crazies things. The last time was the most brutal. My wife actually said that it was the 'best sex i've ever had' and that the only reasons she isn't in bed with him now is because of our children.
I absolutely do not know what to do and fear that my marriage is over.
**tl;dr**: My wife slept with her bestfriend while i was in the doghouse for an affair and i can't get over it.
Edit : I've read your numerous replies (didn't expect this many) and I've decided to accept my own fault and give therapy one last go. I'm now looking into another job and will try to repair what has been broken. I won't be responding to any more comments but I thank you all for you time and effort in responding.
| 0non-cybersec
|
Reddit
| 543
| 2,278
|
Page Number of Middle references in Multiple References not listed. <p>When I have multiple references:</p>
<pre><code>blah blah \cite{ref1, ref2, ref3}
</code></pre>
<p>then ref2 will not be listed on this page in my bibliography. Instead it just has</p>
<blockquote>
<p>-> pages</p>
</blockquote>
<p>with no page listed if I did not cite that reference anywhere else. In the PDF text it will show up as</p>
<blockquote>
<p>[1-3]</p>
</blockquote>
| 0non-cybersec
|
Stackexchange
| 155
| 458
|
Cooking butter chicken with rice and a premade sauce?. I found a cheap premade sauce for butter chicken (the Indian dish) at the grocery store and decided I wanted to make it in my slowcooker. It also helps that decision that the stove is not currently working.
However, I don't want the butter chicken sauce to get runny or diluted because of the amount of water that would go into cooking the rice.
Does anyone have any tips for cooking rice, chicken, and butter chicken sauce all together in a slowcooker? I've looked for recipes online but the only slowcooker recipes I've found involve combining your own ingredients whereas I have the premade sauce.
| 0non-cybersec
|
Reddit
| 147
| 659
|
SQL INSERT INTO SELECT and Return the SELECT data to Create Row View Counts. <p>So I'm creating a system that will be pulling 50-150 records at a time from a table and display them to the user, and I'm trying to keep a view count for each record.</p>
<p>I figured the most efficient way would be to create a MEMORY table that I use an INSERT INTO to pull the IDs of the rows into and then have a cron function that runs regularly to aggregate the view ID counts and clears out the memory table, updating the original one with the latest view counts. This avoids constantly updating the table that'll likely be getting accessed the most, so I'm not locking 150 rows at a time with each query(or the whole table if I'm using MyISAM).</p>
<p>Basically, the method explained <a href="http://www.the-art-of-web.com/sql/counting-article-views/">here</a>.</p>
<p>However, I would of course like to do this at the same time as I pull the records information for viewing, and I'd like to avoid running a second, separate query just to get the same set of data for its counts.</p>
<p>Is there any way to SELECT a dataset, return that dataset, and simultaneously insert a single column from that dataset into another table?</p>
<p>It looks like PostgreSQL might have something similar to what I want with the RETURNING keyword, but I'm using MySQL.</p>
| 0non-cybersec
|
Stackexchange
| 339
| 1,347
|
Simple vector word problem: a $100$-dimensional vector $x$, where $x_i$ denotes the number of $i-1$-year-olds in a population. <p>I'm given this word problem as part of an ungraded homework assignment for my numerical analysis class. I was hoping someone could review my answers and also help me with (c):</p>
<blockquote>
<p>1.13 Average age in a population: Suppose the <span class="math-container">$100$</span>-vector <span class="math-container">$x$</span> represents the
distribution of ages in some population of people, with <span class="math-container">$x_i$</span> being the number of
<span class="math-container">$i - 1$</span> year olds, for <span class="math-container">$i = 1, ..., 100$</span> (You can assume that <span class="math-container">$x \neq 0$</span>, and that there is no one in the population over age <span class="math-container">$99$</span>.) Find expressions, using vector notation,
for the following quantities.</p>
<p>(a) The total number of people in the population.</p>
<p>(b) The total number of people in the population age <span class="math-container">$65$</span> and over.</p>
<p>(c) The average age of the population. (You can use ordinary division of numbers
in your expression)</p>
</blockquote>
<p><strong>Part (a)</strong></p>
<p>This is <span class="math-container">$x_1 + x_2 + ... + x_{100} = 1^Tx$</span>, i.e. the <span class="math-container">$1$</span>-vector transposed and multiplied with <span class="math-container">$x$</span>. I'm wondering if there's a simpler way to express this.</p>
<p><strong>Part (b)</strong></p>
<p>For this one, I basically did the same as above except with a subscript: <span class="math-container">$1^Tx_{66:100}$</span>.</p>
<p><strong>Part (c)</strong></p>
<p>Here's the one I'm stuck on.</p>
<p>The average age of the population is the total age of the population divided by the number of people in the population. We got the answer for the denominator in part (a), so it's time to find the numerator.</p>
<p>The total age of the population is <span class="math-container">$x_1$</span> times the number of <span class="math-container">$0$</span>-year olds plus <span class="math-container">$x_2$</span> times the number of <span class="math-container">$1$</span>-year-olds plus ...:</p>
<p><span class="math-container">$$x_1(0) + x_2(1) + x_3(2) + ... + x_{100}(99)$$</span></p>
<p>Which simplifies to:</p>
<p><span class="math-container">$$x_2 + 2x_3 + ... + 99x_{100}$$</span></p>
<p>Now, I'm wondering if I'm missing something obvious that's simpler than this:</p>
<p><span class="math-container">$$\frac{\sum_{i=1}^{100}(i-1)(x_i)}{1^Tx}$$</span></p>
| 0non-cybersec
|
Stackexchange
| 865
| 2,677
|
Handling SSL_shutdown correctly. <p>The OpenSSL documentation on <code>SSL_shutdown</code> states that:</p>
<blockquote>
<p>It is therefore recommended, to check the return value of <code>SSL_shutdown()</code> and call <code>SSL_shutdown()</code> again, if the bidirectional shutdown is not yet complete (return value of the first call is 0).</p>
</blockquote>
<p><a href="https://www.openssl.org/docs/ssl/SSL_shutdown.html" rel="nofollow noreferrer">https://www.openssl.org/docs/ssl/SSL_shutdown.html</a></p>
<p>I have a code snippet below where I check for return value 0 from <code>SSL_shutdown</code> and call it again, which I have been using. My question is, is it okay to disregard the return value of <code>SSL_shutdown</code> on the second call or we should keep retrying <code>SSL_shutdown</code> until a 1 (bidirectional shutdown complete) is returned.</p>
<pre><code>int r = SSL_shutdown(ssl);
//error handling here if r < 0
if(!r)
{
shutdown(fd,1);
SSL_shutdown(ssl); //how should I handle return value and error handling here is it required??
}
SSL_free(ssl);
SSLMap.erase(fd);
shutdown(fd,2);
close(fd);
</code></pre>
| 0non-cybersec
|
Stackexchange
| 371
| 1,152
|
SQL statement to remove part of a string. <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/3944000/str-replace-in-sql-update">str_replace in SQL UPDATE?</a><br>
<a href="https://stackoverflow.com/questions/7481361/how-to-remove-part-of-string-in-mysql">How to remove part of string in mysql?</a><br>
<a href="https://stackoverflow.com/questions/10153852/sql-find-replace-part-of-a-string">SQL Find & Replace part of a string</a> </p>
</blockquote>
<p>I have a database table with a list of website urls e.g. <code>http://website.com/</code> and I want to remove all the <code>http://</code> and <code>https://</code> from them. Is their a simple SQL statement I could run on a column to remove it?</p>
<p>I've had a search around, but I can't find what I need. I'm presuming I need to use both REPLACE and UPDATE but I'm struggling.</p>
<p>So far I have:</p>
<pre><code>UPDATE list
SET website
WHERE website LIKE 'http://%';
</code></pre>
<p>Is that correct? I'm using MySQL and the table is list, and column is website and I want to remove the <code>http://</code> so a url like: <code>http://website.com/</code> becomes just: <code>website.com</code></p>
<p><strong>EDIT: Is it also possible to remove a trailing slash as well?</strong></p>
| 0non-cybersec
|
Stackexchange
| 434
| 1,321
|
Bastion Has Better Healing Than Roadhog. Bastion:
* Heals for 300
* In 4 seconds
* Full recharge in 8 seconds (1 second before it starts recharging after a heal and 7 seconds recharging process)
* Fully mobile during the heal process
Roadhog:
* Heals for 300
* In 2 seconds
* Full recharge in 8 seconds
* Fully stationary during the heal process
Now, if this didn't convince you, give bastion heal to roadhog and vice versa, who got nerfed? that's right.
Bastion is not forced to go all in on his heals as roadhog is, bastion can sip as much health as he needs, whenever he needs. On demand, as much as he needs, no more.
Again, let that sink in. Bastion, a defense hero(which is actually a dps hero recommended to be played on the defense side by blizz, that's all that defense means, all defense heroes are DPS role essentially), has:
* better healing than a tank
* is more durable than a tank due to his passive
* has 53% increased effective healing applied to his health due to his passive
* has 207% increased effective healing applied to his armor if faced with low damage(<15 dmg) per pellet heroes(read tracer/reaper/dva/zarya/symmetra/sombra/hog/winston/ana/mercy)
* but with lower health pool(which is not that lower with his passive, being at 461 ehp)
*sigh*
Just... just let that sink in.
| 0non-cybersec
|
Reddit
| 375
| 1,333
|
What does it mean if a flatpack app is appears in /var/lib/flatpak/app but not in `flatpak list --app`. <p>I recently installed and uninstalled org.gnome.FeedReader but due to some confusion involving GNOME Software I think I might have ended simultaneously installing the flatpak and non-flatpak versions of the package. Or something else, I don't really know what I actually did here.</p>
<p>Anyway, I'm now trying to clean up my mess by uninstalling FeedReader. <code>flatpak list --app</code> tells me that the flatpak version of FeedReader has been uninstalled but <code>locate feedreader</code> tells me that there are stil a bunch of FeedReader files living under <code>/var/lib/flatpak/app/org.gnome.FeedReader/</code>. What gives?</p>
<ul>
<li>Is this a flatpak bug or normal behavior (aka my fault)?</li>
<li>Can I <code>rm -rf</code> that directory inside /var/lib/flatpak or is there a better way to clean this up?</li>
</ul>
<p>I'm currently running Fedora Workstation 30 and flatpak 1.4.2</p>
| 0non-cybersec
|
Stackexchange
| 302
| 1,010
|
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 specify image size in HTML Doxygen?. <p>I am trying to manually specify the image size in the HTML generated by Doxygen. However, as I read in the <a href="http://www.doxygen.nl/manual/commands.html#cmdimage" rel="nofollow noreferrer">documentation</a>, this can only happen if using LaTeX output. Anybody here knows any workaround?</p>
<p>As an example, I would like to do something like this:</p>
<pre><code>\image html example.png "Caption" width=10px
</code></pre>
<p>Thank you!</p>
| 0non-cybersec
|
Stackexchange
| 154
| 497
|
deleted ubuntu 14.04 partition error: unknown filesystem. <p>By mistake I have deleted the Ubuntu 14.04 OS which is on dual boot with Windows 7.</p>
<p>After rebooting, following error message is displayed.</p>
<pre><code>error: unknown filesystem
Entering rescue mode ..
grub rescue >
</code></pre>
<p>I tried to fix the issue by performing the following steps:</p>
<pre><code>ls
set root=(hd0,msdos6)
set path=(hd0,msdos6)/boot/grub
instmod normal
</code></pre>
<p>but nothing works.</p>
<p>Please let me know the steps for resolving this issue.</p>
| 0non-cybersec
|
Stackexchange
| 179
| 561
|
Can a "const T*" match a pointer to free function?. <p>In a <a href="https://stackoverflow.com/questions/10145693/what-is-meaning-of-a-pointer-to-a-constant-function">related question</a> it's said that there's no such thing as a pointer to non-member const function. In addition, C++11 8.3.5/6 says</p>
<blockquote>
<p>The effect of a cv-qualifier-seq in a function declarator is not the same as adding cv-qualification on top of the function type. In the latter case, the cv-qualifiers are
ignored. [ Note: a function type that has a cv-qualifier-seq is not a cv-qualified type; <strong>there are no cv-qualified function types</strong>. —end note ]</p>
</blockquote>
<p>If I understand it correctly, this means that there's no such thing as a non-member const function. (Although such functions are not const, they cannot be modified as per 3.10/6). In particular, pointers to const function are meaningless.</p>
<p>However, it seems that some compilers do create pointers to const function in type deduction contexts. For instance, consider the code:</p>
<pre><code>#include <iostream>
void f() {}
template <typename T> void g( T*) { std::cout << "non const" << std::endl; }
template <typename T> void g(const T*) { std::cout << "const " << std::endl; }
int main() {
g(f);
}
</code></pre>
<p>When compiled with GCC and Intel the code outputs "non const" as I would expect from the quote above. However, the output is "const" when compiled with Clang and Visual Studio.</p>
<p>Is my interpretation correct?</p>
<p><strong>Update:</strong></p>
<p>Following the comments, I'm trying to clarify that I'm <strong>not</strong> talking about const member functions. I'm interested in non-member functions (but the same arguments probably apply to non-static member functions as well). I've also changed the question title to make it more precise.</p>
<p>Consistent with the resolution of <code>g(f)</code> mentioned above, the line below is ilegal for GCC and Intel but not for Clang and Visual Studio</p>
<pre><code>const auto* ptr = &f;
</code></pre>
<p><strong>Update 2:</strong></p>
<p>I agree with Andy Prowl's interpretation and have selected his answer. However, after that, I was made aware that this question is a CWG <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1584" rel="nofollow noreferrer">open issue</a>.</p>
| 0non-cybersec
|
Stackexchange
| 738
| 2,433
|
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 was asked to photograph local restaurants for their website, and for a local radio station/paper. I have never taken these type of photos though. May I ask here for tips?. I have a decent camera (Nikon D3100) and have never been officially hired for a job like this. I will be taking photos of restaurants/cafes interiors, and food. I haven't however done this before. I have strayed away from these photos, because the cliche "I'm taking photos of my food lawlz" thing. I realize though it is photography despite instagram cliches and a job like this is a great foot in the door. I am just looking for tips, and hope this is the right place. I am browsing google for tips, but am trying every resource at my fingertips. Thank you.
| 0non-cybersec
|
Reddit
| 174
| 733
|
How to set up a rebase in Git Bash on Windows. <p>I'm trying to following the instructions on <a href="https://help.github.com/articles/using-git-rebase-on-the-command-line/" rel="noreferrer">https://help.github.com/articles/using-git-rebase-on-the-command-line/</a> for interactively rebasing from my initial commit (More specifically, I'm trying to remove all the <code>bin</code> and <code>obj</code> folders from the history). So once I type in </p>
<pre><code>git rebase -i --root
</code></pre>
<p>I get the following screen as expected, but then I can't figure out how to change the first one to <code>edit</code>. Like I can't figure out which button on the keyboard to click. Sorry if this is a stupid question.</p>
<p><a href="https://i.stack.imgur.com/PmeFP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PmeFP.png" alt="enter image description here"></a></p>
| 0non-cybersec
|
Stackexchange
| 276
| 884
|
Distribute load evenly across many cycles. <p>I am looking for a solution that is fast and still readable. I have to do this in C but the code will be static in the end, which mean I could use any tool to generate it.</p>
<p>I have a task which runs cyclically and calls different functions also cyclically</p>
<blockquote>
<p>Main functions cycle is 1.</p>
<p>Function a has also cycle 1. So the main function calls it every time</p>
<p>Function b has cycle 2. Main function calls it every second cycle.</p>
<p>Function c has cycle 2.</p>
<p>Function d has cycle 4.</p>
<p>Function e has cycle 4.</p>
<p>Function f has cycle 4.</p>
<p>Function g has cycle 4.</p>
<p>... many more ....</p>
<p>Function X has cycle 500.</p>
</blockquote>
<p>If we have many functions that run in the same cycle we try to distribute them.<br />
So for function b we would call it in one cycle and c in the other. Distributing the load evenly.<br />
Similar for d to g. Each one gets called in a different cycle.</p>
<p>My current implementation is very bad.<br />
Every developer who had to add their task to main function calculates their on modulo and calls when needed. This leads to a very unreadable code.</p>
<p>I was thinking of doing something like:</p>
<pre><code>uint32 mod4 = timer % 4;
bool fourth_1 = mod4 == 0;
bool fourth_2 = mod4 == 1;
bool fourth_3 = mod4 == 2;
bool fourth_4 = mod4 == 3;
bool second_1 = fourth_1 || fourth_3;
bool second_2 = fourth_2 || fourth_4;
/* and so on*/
</code></pre>
<p>But this seems cumbersome and too error prone specially as the highest cycle time is too high.</p>
<p>How to approach this kind of problem?</p>
<p>-Edit-</p>
<p>As asked i have compiled some information about the number of functions that i have:</p>
<ul>
<li>32 functions cycle 1</li>
<li>9 functions cycle 2</li>
<li>14 functions cycle 4</li>
<li>3 functions cycle 8</li>
<li>3 functions cycle 32</li>
<li>3 functions cycle 40</li>
<li>2 functions cycle 200</li>
<li>2 functions cycle 400</li>
</ul>
| 0non-cybersec
|
Stackexchange
| 618
| 1,996
|
orthonormal vectors in generalized eigenvalue problem. <p>Consider the generalized eigenvalue problem
<span class="math-container">$$A\textbf{v}=\lambda B \textbf{v},$$</span>
where <span class="math-container">$A$</span> is assumed to be symmetric, nonsingular with distinct eigenvalues and <span class="math-container">$B$</span> symmetric and positive definite and let <span class="math-container">$(\lambda_i,\textbf{v}_i)$</span> be the <span class="math-container">$i$</span>-th eigenpair of the problem. I would like to show that the <span class="math-container">$\textbf{v}_i$</span> can be chosen such that
<span class="math-container">$$\textbf{v}_i^TB\textbf{v}_j=\delta_{ij}.$$</span>
I have managed to show that for <span class="math-container">$i \neq j$</span> the vectors <span class="math-container">$\textbf{v}_i$</span> and <span class="math-container">$\textbf{v}_j$</span> are orthogonal with respect to <span class="math-container">$B$</span> (i.e. <span class="math-container">$\textbf{v}_i^TB\textbf{v}_j= 0$</span> for <span class="math-container">$i \neq j$</span>), but I am not sure how to show that in the case <span class="math-container">$i=j$</span> I can have
<span class="math-container">$$\textbf{v}_i^TB\textbf{v}_i=1.$$</span></p>
| 0non-cybersec
|
Stackexchange
| 399
| 1,268
|
Is this an alternative answer to Spivak's question? (Chapter 1 Calculus). <p>The question is</p>
<p>Prove that if $0 \leq x < y$ then $x^n < y^n$, $n = 1, 2, 3, \ldots $</p>
<p>Spivak's solution was using (if $0 \leq x < y$ then $y^2 < x^2$) and generalising it for all n. Spivak does acknowledge the fact that the proof isn't rigorous </p>
<p>My method was: as $0 \leq x$, I used cases </p>
<p>First taking the case $x = 0$. We have $x= 0$ and $0 < y$, thus any power of zero will be greater than any power of $y$.</p>
<p>Then taking the case $0 < x < y$,</p>
<p>I use the fact that $(y - x)$ is in p.</p>
<p>Now, $y^n - x^n = (y - x) (y^{(n-1)} + y^{(n-2)}x \cdots + yx^{(n-2)} + x^{(n-1)})$</p>
<p>$(y - x)$ is positive.</p>
<p>The other term in the product is also positive due to closure under addition because we're adding only positive terms to positive terms.</p>
<p>Now as both the terms are positive, due to closure under multiplication, $y^n -x^n$ is also positive. </p>
<p>i.e, $y^n - x^n$ is in P. Thus $y^n > x^n$.</p>
<p>I'm confident I have used only those results that I have proved during earlier exercises and not assuming anything. Is my method consistent or flawed? Thank you very much for your time. :-)</p>
| 0non-cybersec
|
Stackexchange
| 475
| 1,272
|
Ethernet works from laptop, but not docking station. <p>I couldn't get my USB 3.0 ProDock Ethernet port to connect to the Internet for my connected Windows 10 ThinkPad. However, plugging into my native Ethernet port on the back of the laptop worked.</p>
<p>I only use one port at at time, so despite warnings from Windows, I gave them both the same static IP address. But then, the dock quit working and it seems that I've tried every combination of setting IP addresses versus "Automatic" settings.</p>
<p>When I run <code>ipconfig</code>, I see that the docking station Ethernet adapter gets an autoconfigured IP address, even when I try to explicitly assign a Static IP address.</p>
<p>(The <a href="https://superuser.com/questions/594022">post here</a> might be related, but it didn't mention the need for setting a static IP address.)</p>
| 0non-cybersec
|
Stackexchange
| 219
| 847
|
Disable auto focus in dialog- modal in Angular 2/ material. <p>I'm using dialog from angular material-2.</p>
<p>The problem is: I can't disable auto focus when modal-dialog is opened in iPhone or tablet especially. In iOS, it automatically focuses the first input field in the dialog!</p>
<p>I tried with tab index and with auto focus in other input-field it doesn't work</p>
<p>I'm using Angular 2 for my code, in my dialog I'm using form-control. I tried to use <code>markasuntouched</code> <code>afterviewInit</code>, but I still have the same problem !! </p>
| 0non-cybersec
|
Stackexchange
| 159
| 566
|
using perl or python to replace arabic character "ا" with "a" in one word, but "ә" in a different word. <p>I need to change a plain text UTF8 document from a R to L language to a Latin language. It isn't as easy as a character-character transliteration unfortunately.<br>
For example, the "a" in the R to L language (ا) can be either "a" or "ә" depending on the word composition.</p>
<p>In words with a g, k, e, or hamza (گ،ك،ە، ء)<br>
I need to change all the a, o, i, u (ا،و،ى،ۇ) to Latin ә, ѳ, i, ü (called "soft" vowels).<br>
eg. سالەم becomes sәlêm, ءۇي becomes üy, سوزمەن becomes sѳzmên</p>
<p>In words without a g, k, e, or hamza (گ،ك،ە، ء)<br>
the a, o, i, u change to Latin characters, a, o, i, u (called "hard" vowels).<br>
eg. الما becomes alma, ۇل becomes ul, ورتا becomes orta.</p>
<p>In essence,<br>
the g, k, e, or hamza act as a pronounciation guide in the arabic script.<br>
In Latin, then I need two different sets of vowels depending on the original word in the arabic script.</p>
<p>I was thinking I might need to do the "soft" vowel words as step one, then do a separate Find and Replace on the rest of the document. BUT, how do I conduct a Find and Replace like this anyway with perl, or python?</p>
<p>Here is a unicode example: \U+0633\U+0627\U+0644\U+06D5\U+0645 \U+0648\U+0631\U+062A\U+0627 \U+0674\U+06C7\U+064A \U+0633\U+0648\U+0632\U+0645\U+06D5\U+0645 \U+0627\U+0644\U+0645\U+0627 \U+06C7\U+0644 \U+0645\U+06D5\U+0646\U+0649\U+06AD \U+0627\U+062A\U+0649\U+0645 \U+0634\U+0627\U+0644\U+0642\U+0627\U+0631.</p>
<p>It should come out looking like: "sәlêm orta üy sѳzmên alma ul mêning atim xalқar".(NOTE: the letter ڭ, which is U+06AD actually ends up as two letters, n+g, to make an "-ng" sound). It shouldn't look like "salêm orta uy sozmên alma ul mêning atim xalқar", nor "sәlêm ѳrtә üy sѳzmên әlmә ül mêning әtim xәlқәr". </p>
<p>Much thanks to any help.</p>
| 0non-cybersec
|
Stackexchange
| 832
| 1,929
|
Can only boot notebook with disabled driver signature enforcement after crash. <p>I am running Windows 10 Enterprise Edition on an Acer notebook.
Yesterday there was a short power outage, for about 5 seconds, which crashed my computer. After that I couldn't boot normally into Windows anymore. The computer just stays stuck at the Acer logo, even when trying to boot in safe mode.</p>
<p>So, I tried various things from the Windows Automatic Repair menu and the console I could access through that.
But nothing I did there helped.</p>
<p>After all that I tried out all the options in the Startup Settings and with #7 Disable driver signature enforcement I can actually get into Windows again.
When I boot like that, it seems to boot rather slowly though.</p>
<p>I ran sigverif and that shows 2 files that haven't been signed.</p>
<ul>
<li>basicrenderer.sys version: 10.0.16299.19</li>
<li>bthport.sys version: 10.0.16299.64 </li>
</ul>
<p><br></p>
<ul>
<li>How can I fix that and sign these drivers? I don't want to run the computer with that permanently disabled.</li>
<li>And are these 2 files not being signed even the actual reason for me not being able to boot Windows? </li>
<li>Is it possible that that happened when my computer suddenly crashed?</li>
</ul>
<p><br></p>
<p>I also ran sfc /scannow and that returned:</p>
<p>Windows Resource Protection found corrupt files but was unable to fix some
of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log.</p>
<p>I was then looking into CBS.log to find that, but that file has 37492 lines and I don't know what to search for.</p>
<ul>
<li>Is that also related to the startup issue?</li>
<li>How can I find which corrupted files it hasn't been able to fix?</li>
</ul>
<p><br></p>
<p>I also had a look into SRTlog and it says there:
- Number of root causes = 1
- all the error codes are 0x0
- Startup Repair has tried several times but still cannot determine the cause of the problem.</p>
<ul>
<li>What is that telling me about the problem?</li>
</ul>
| 0non-cybersec
|
Stackexchange
| 593
| 2,034
|
Writing propositions using connectives and quantifiers. <p>So I have this statement that says:</p>
<p>For every two real numbers $x$ and $y$ with $x < y$, there is a real number with the property $P$ between $x$ and $y$.</p>
<p>Let $P(x)$ be the statement that says that a real number $x$ has some property $P$.</p>
<p>I have to write this using connectives and quantifiers and construct a negation for this proposition.</p>
<p>I've started by using the statements:</p>
<p>$(∀x \in R)(∀y \in R)(x < y)(x < P(x) < y)$</p>
<p>Something along the lines of this although I know this is incorrect.</p>
| 0non-cybersec
|
Stackexchange
| 208
| 615
|
Hells yeah! Samsung IR sensor can suck it.. So, I dunno where else I can post this but I feel damn proud I found a way to tell the "man" to shove it today.
I have a Samsung CLX-2160 Colour Laser Printer. Now, to those unfamiliar to Samsung laser printers, most modern models have this thing called a Waste Toner Tank. Basically, it's a little plastic bin that slots in along side all the toners that collects excess toner powder during the printing process.
What's supposed to happen is that whenever the Waste Toner Tank is full, you are supposed to replace it ($12-$15). Problem was, the tank wasn't full. Not even close. And the way the printer detects if the tank is full is by having an IR LED shine through a clear section of the tank and on the opposite side is a IR sensor. If the sensor detects IR light, then all is well. So, the key is to clean the clear section of the tank to ensure it remains clear.
Problem is I washed and cleaned it as much as I could and it was still giving me that error. And the printer refuses to work when this error shows up. I don't want to pay $15 to get a replacement, only to have it screw up a few months later.
So, I took the printer apart. Found where the IR sensor is and solder a short circuit between the two leads of the sensor. Now, regardless of what happens, this error will never happen again.
I've had other Samsung printers that also had this problem. Samsung really needs to get this fixed. It is a really stupid design and they purposely make it impossible to clean the tank throughly so you have to shell out money every few months. Fucking Samsung.
TLDR: I "hacked" a fix for my Samsung laser printer that is obviously designed to make you spend more.
EDIT: Images and instructions here: http://imgur.com/a/w4IA7
| 0non-cybersec
|
Reddit
| 426
| 1,780
|
How to solve $|x-5|=|2x+6|-1$?. <p>$|x-5|=|2x+6|-1$. </p>
<p>The answer is $0$ or $-12$, but how would I solve it by algebraically solving it as opposed to sketching a graph?</p>
<p>$|x-5|=|2x+6|-1\\
(|x-5|)^2=(|2x+6|-1)^2\\
...\\
9x^4+204x^3+1188x^2+720x=0?$</p>
| 0non-cybersec
|
Stackexchange
| 142
| 266
|
Sign of a series. <p>Someone could compute the sign of the following series ?</p>
<p>\begin{equation} \underset{k > 0}{\sum} \frac{\sin (kx)}{k} \end{equation}</p>
<p>I expect that is the same as the first term $\sin x$ because of the pseudo terms-alternate property of the serie, but it's not clear.
If you have an idea, it would be nice. </p>
<p>Thanx for helping.</p>
| 0non-cybersec
|
Stackexchange
| 128
| 378
|
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
|
Which is the kernel build directory (4.4.0-17134-Microsoft build)?. <p>How can I fix the following issue (4.4.0-17134-Microsoft build)?</p>
<pre><code>checking for Linux kernel build in /lib/modules/4.4.0-17134-Microsoft/build... not found
checking for Linux kernel build in /usr/src/linux-4.4.0-17134-Microsoft-obj... not found
checking for Linux kernel build in /usr/src/linux-4.4.0-17134-Microsoft... not found
checking for Linux kernel build in /usr/src/linux-headers-4.4.0-17134-Microsoft... not found
checking for Linux kernel build in /usr/src/kernels/4.4.0-17134-Microsoft... not found
**configure: error: Could not find a directory containing a Linux kernel 4.4.0-17134-Microsoft build. Perhaps try --with-linux=FULL_PATH_TO_KERNEL_BUILD**
</code></pre>
| 0non-cybersec
|
Stackexchange
| 246
| 765
|
Differentiability of a defined corner of a function?. <p>This is my first question so I apologise in advance if it doesn't fit the format that is expected, and I would appreciate any advice on how to ask questions properly.</p>
<p>I am given a function;</p>
<p><a href="https://i.stack.imgur.com/gcd71.png" rel="nofollow noreferrer">g(x)</a></p>
<p>I am then asked to do the following:</p>
<p><a href="https://i.stack.imgur.com/ahYhW.png" rel="nofollow noreferrer">Question.</a></p>
<p>The problem is that it really doesn't seem to me to be differentiable at $0$. $g(x)$ is undefined at $x=0$. Using the Squeezing Theorem I determined that the limit of $g(x)$ exists at $0$. The function $g(x)$ is even, and is therefore symmetric across the y axis. This implies that as both sides of the function approach $(0,0)$ they both make the same angle with the x axis. $h(x)$ fills the discontinuity, but surely that could not make it differentiable just because it is continuous? The opposite sides of the y-axis must meet at a corner, and corners cannot have tangents, right? Also, I'm a first year undergraduate, so an appropriately complex answer would be very much appreciated. Thank You!</p>
| 0non-cybersec
|
Stackexchange
| 342
| 1,196
|
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
|
Inline-level element being forced to a new line in flexbox. <p>How come the <code><strong></code> element, which is an inline element, is forced to a new line? </p>
<p>This setup has a flex within a flex, nothing particularly crazy I wouldn't have thought. So perhaps it's just my misunderstanding of how flexbox works.</p>
<p>Take a look at: <a href="http://codepen.io/leads/pen/mEYOay" rel="noreferrer">http://codepen.io/leads/pen/mEYOay</a></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>* {
margin: 0;
padding: 0;
}
.container {
display: flex;
border: 1px solid red;
height: 200px;
max-width: 600px
}
.left {
flex: 1;
background: rgba(0, 0, 0, .3);
}
.middle {
flex: 0 0 200px;
background: rgba(0, 0, 0, .4);
text-align: center;
display: flex;
flex-direction: column;
}
.middle button {
flex: 0 0 50px;
}
.middle p {
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
}
strong {
background: red;
}
.right {
text-align: center;
flex: 0 0 100px;
background: rgba(0, 0, 0, .5);
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="container">
<div class="left">
<p>some content in the top left</p>
</div>
<div class="middle">
<p>Lorem ipsum <strong>dolor</strong> sit amet, consectetur adipisicing elit.
</p>
<button>CTA</button>
</div>
<div class="right">
<p>CTA</p>
</div>
</div></code></pre>
</div>
</div>
</p>
| 0non-cybersec
|
Stackexchange
| 708
| 1,774
|
What are some examples of journals that will accept undergraduate student research?. <p>I am currently doing a research project with a professor and 3 other students in an area that is usually seen as a "recreational" math topic; that of change-ringing and its relation to group theory. The papers regarding change-ringing that I have managed to find on JSTOR are generally of an expository nature, and since we do have one or two somewhat original results (we were trying to see what subgroups of Sn can be enumerated using transformations allowed under the restrictions of change-ringing), I think we might have something at least worth trying to submit to a small journal. </p>
<p>Does anyone have any recommendations?</p>
| 0non-cybersec
|
Stackexchange
| 158
| 727
|
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 make a simple modal pop up form using jquery and html?. <p>I already read the tutorials on jquery but I'm having a hard time understanding it is there someone who can teach me more easier, please I want to happen is that when I press one of my buttons its value will display in #valueFromMyButton and when the modal pop out i can type a text and after i click ok the text that I type will be placed on #valueFromMyModal </p>
<pre><code><!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<input id="btn1" type="button" value="1">
<input id="btn2" type="button" value="2">
<input id="btn3"type="button" value="3">
<input id="valueFromMyModal" type="text">
<!--How to make this pop up modal form-->
<div id="myform">
<form>
<label id="valueFromMyButton"></label>
<input id="name" type="text">
<input id="btnOK" type="button" value="Ok">
</form>
</div>
</body>
</html>
</code></pre>
| 0non-cybersec
|
Stackexchange
| 401
| 1,176
|
Moving grub from one disk to another. <p>I have 13.04 installed on my hard drive in my laptop, I now also have 13.10 on an SSD in the same machine.</p>
<p>At the moment to boot 13.10 I have to set in bios to boot my hard drive (which is not the disk 13.10 is on) which I guess launches grub from my hd and then I can select to launch Ubuntu (which launches 13.10) or Ubuntu 13.04 - both work.</p>
<p>My question is - how do I move grub from the hd to the SSD so in future if my hd fails my instal won't? I don't really need the 13.04 install to keep working although it would be handy.</p>
<p>Many thanks.</p>
| 0non-cybersec
|
Stackexchange
| 182
| 613
|
Logout: GET or POST?. <p><strong>This question is not about when to use GET or POST in general;</strong> it is about which is the recommended one for handling logging out of a web application. I have found plenty of information on the differences between GET and POST in the general sense, but I did not find a definite answer for this particular scenario.</p>
<p>As a pragmatist, I'm inclined to use GET, because implementing it is way simpler than POST; just drop a simple link and you're done. This seems to be case with the vast majority of websites I can think of, at least from the top of my head. Even Stack Overflow handles logging out with GET.</p>
<p>The thing making me hesitate is the (albeit old) argument that some web accelerators/proxies pre-cache pages by going and retrieving every link they find in the page, so the user gets a faster response when she clicks on them. I'm not sure if this still applies, but if this was the case, then in theory a user with one of these accelerators would get kicked out of the application as soon as she logs in, because her accelerator would find and retrieve the logout link even if she never clicked on it.</p>
<p>Everything I have read so far suggest that <em>POST should be used for "destructive actions", whereas actions that do not alter the internal state of the application -like querying and such- should be handled with GET</em>. Based on this, the real question here is:</p>
<p>Is logging out of an application considered a destructive action/does it alter the internal state of the application?</p>
| 0non-cybersec
|
Stackexchange
| 368
| 1,570
|
Relabelling reference with link. <p>Sorry if this is a repeat question, I have found it really difficult to even google what I am trying to do! As such I have to admit to not really having tried much myself as I dont even really know where to start.</p>
<p>In my text I make frequent reference to a bibtex item and as such have taken the standard procedure of writing "\cite{someone2020} (hereafter paper1)". Now I wish to do two things:</p>
<ol>
<li><p>I would like it if I could have the text hyperlink every time I have "paper1" as if it was a regular bib item. That is it would jump to the relevant bib item if clicked on.</p>
</li>
<li><p>I would also like it if this could be put into a citation "group". So like \ref{someone2020, bob, betty, tom}" would give "paper1, Bob 1961, betty 2030, tom et al. 1945".</p>
</li>
</ol>
<p>Hopefully this makes sense.</p>
| 0non-cybersec
|
Stackexchange
| 268
| 911
|
Git SSH Not Working after installing new Dev Shell. <p>I have carefully followed the document <a href="https://dev-shell.gaiacloud.jpmchase.net/#/index#intellijconfiguration" rel="nofollow noreferrer">go/dev-shell</a> to install the new dev shell and Git Setup on LVDI3. When I run the ds sync, I got the error message:</p>
<pre><code>[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
</code></pre>
<p>I run the following two commands to check the configuration.</p>
<pre><code>$ ssh-add -l
error fetching identities: agent refused operation
</code></pre>
<pre><code>$ ssh -vT [email protected]
OpenSSH_8.2p1, OpenSSL 1.1.1e 17 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucketdc-cluster03-ssh.jpmchase.net [147.107.136.129] port 22.
debug1: Connection established.
debug1: identity file /c/Users/v684780/.ssh/id_rsa type 0
debug1: identity file /c/Users/v684780/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/v684780/.ssh/id_dsa type -1
debug1: identity file /c/Users/v684780/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/v684780/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/v684780/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/v684780/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/v684780/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/v684780/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/v684780/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/v684780/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/v684780/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/v684780/.ssh/id_xmss type -1
debug1: identity file /c/Users/v684780/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1
debug1: match: OpenSSH_6.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to bitbucketdc-cluster03-ssh.jpmchase.net:22 as 'v684780'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: [email protected] compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: [email protected] compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:U1WSHx08ejrFmnHhLOyTO6krz1ufthX3VNxKRKh1yjg
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for bitbucketdc-cluster03-ssh.jpmchase.net has changed,
and the key for the corresponding IP address 147.107.136.129
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:U1WSHx08ejrFmnHhLOyTO6krz1ufthX3VNxKRKh1yjg.
Please contact your system administrator.
Add correct host key in /c/Users/v684780/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/v684780/.ssh/known_hosts:2
ECDSA host key for bitbucketdc-cluster03-ssh.jpmchase.net has changed and you have requested strict checking.
Host key verification failed.
</code></pre>
<p>I googled the web, someone suggested to remove the cached key, or update the C:\Users\v684780.ssh\known_hosts. I am not sure how to do it.</p>
| 0non-cybersec
|
Stackexchange
| 1,551
| 5,246
|
Product is a supermartingale iff process itself is supermartingale. <p>Let <span class="math-container">$(\Omega,\mathcal A,\mathcal F)$</span> be a finite filtered measure space with time <span class="math-container">$\mathcal T=\{0,\ldots T\}, T\in\mathbb N$</span> and <span class="math-container">$P,Q$</span> two equivalent probability measures on it. Let <span class="math-container">$Z$</span> be the <span class="math-container">$\mathcal F$</span>-<span class="math-container">$P$</span> martingale defined by <span class="math-container">$Z(t)=E^P\big(\frac{dQ}{dP}\mid \mathcal F(t)\big)$</span>, <span class="math-container">$t\in\mathcal T$</span>. </p>
<blockquote>
<p>Show: A stochastic process <span class="math-container">$X$</span> on <span class="math-container">$\Omega$</span> wth time <span class="math-container">$\mathcal T$</span> is an <span class="math-container">$\mathcal F$</span>-<span class="math-container">$Q$</span> supermartingale iff <span class="math-container">$XZ$</span> is an <span class="math-container">$\mathcal F$</span>-<span class="math-container">$P$</span> supermartingale.</p>
</blockquote>
<p>Integrability is imediate and adaptedness aswell in both directions, but I do not see how to show the supermartingale property for both directions. Any help is welcome!</p>
| 0non-cybersec
|
Stackexchange
| 413
| 1,323
|
ErrorHandler & RxJS 6.2.2. <p>I have an application with an globalError handler like this:</p>
<pre><code>import { Injectable, ErrorHandler, Injector } from "@angular/core";
import { Router } from "@angular/router";
@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
constructor(
private injector: Injector) { }
public handleError(error: any) {
console.error("Something went wrong");
//.. Handle error here
}
}
</code></pre>
<p>This always worked in every constallation. If an error was thrown the global handler caught it and handled it.</p>
<p>Now after upgrading to RxJs 6.2.2 I understood that catching http errors changed.</p>
<p>Code errors still keep working but errors thrown by the HttpClient are not globally caught. The GlobalErrorHandler is not fired any more.</p>
<p>I am aware that I can handle errors within my service and that works fine like this:</p>
<pre><code>doSomething() {
return this.http
.get("http://someURL").pipe(
map((res: any) => { console.log(res) }),
catchError(this.handleError<any>(`blabla`))
);
}
/**
* Handle Http operation that failed.
* Let the app continue.
* @param operation - name of the operation that failed
* @param result - optional value to return as the observable result
*/
private handleError<T>(operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
console.log("Now throwing error");
// TODO: send the error to remote logging infrastructure
console.error(error); // log to console instead
// Let the app keep running by returning an empty result.
// ToDo: Global Error handler hier aufrufen....
return of(result as T);
};
}
</code></pre>
<p>But I actually would like to handle all errors centrally.</p>
<p><strong>What is the correct way with Angular 6 and RxJs 6 to handle errors centrally?</strong></p>
| 0non-cybersec
|
Stackexchange
| 554
| 1,948
|
Living just above the poverty line. My husband and I are living paycheck to paycheck and we have no money for ourselves for Christmas. No one knows about it, so everyone else will be getting presents like normal. What kills me is that we've cut every single unnecessary expense and we're STILL starving ourselves to save a few dollars. We're living in a house that's out of our price range, but we can't move because we can't seem to save up any money for moving costs. We owe 2 months worth on our cable, so we can't cancel and go with a different provider. We each have our own credit cards (mine was about to get charged off for not paying because we literally had no money), a different credit line, and a car that we MUST pay on. We're behind on all of our bills, so we can't even put them off so we can buy food. We can't get food stamps because I make too much money, but what the state doesn't take into account is the fact that we have not just rent and utilities, but a car and gas so that we can get to our jobs to make money to barely pay bills. I could go out and get a second job, but with the hours I work, there's no time. My husband is already working a job that he hates and is going to school full time. He's on the verge of having a nervous breakdown (which is really saying something, since he's so even tempered), but then again, so am I.
Sorry for the rant, I just needed to get this off my chest and have a little cry...now it's time to go eat a few bites of the Thanksgiving leftovers for dinner before they run out, too.
| 0non-cybersec
|
Reddit
| 363
| 1,548
|
Uniformly open functions - where's the contradiction. <p>Let $X$ and $Y$ be metric spaces. Let us say that $f\colon X\to Y$ is <strong>uniformly open</strong> if for every $\varepsilon >0$ there is $\delta > 0$ such that for any $x\in X$
$$ B(f(x),\delta) \subseteq f[B(x,\varepsilon)].$$</p>
<p>(See p. 202 of Kelley's <em>General topology</em>.)</p>
<p>It is not too hard to show that if $X,Y,Z$ are metric spaces and $f\colon X\to Y$ is a uniformly continuous surjection, $g\colon Y\to Z$ is a function such that $g\circ f$ is uniformly open, then $g$ is uniformly open. (A more abstract version of this statement can be found <a href="https://books.google.co.uk/books?id=eKTVeJ681iIC&pg=PA11&lpg=PA11&dq=%22uniformly%20open%22&source=bl&ots=LNaTEvUctu&sig=ZFGUzM25RF1Aosg3x2y35j-lLdk&hl=pl&sa=X&ved=0ahUKEwiKvOPlsKTTAhVpLMAKHW1yDGoQ6AEIXTAI#v=onepage&q=%22uniformly%20open%22&f=false" rel="nofollow noreferrer">here</a> - Proposition 1.13.)</p>
<blockquote>
<p>Consider $X=\mathbb C \times \mathbb C$, $Y=Z=\mathbb C$ and $f(x,y)=x+y$ and $g(z)=e^z$. Then $f$ is a uniformly continuous surjection. Let us look at the composition $g\circ f$. This is nothing but multiplication in $\mathbb C$ restricted to $\mathbb{C}\setminus \{0\}$. However, multipliction in $\mathbb C$ is uniformly open with $\delta(\varepsilon)=\varepsilon^2/4$. Thus $g$ should be uniformly open <a href="https://math.stackexchange.com/questions/2210658/is-exponentiation-open">but it is not</a>.</p>
</blockquote>
<p>What is wrong here?</p>
| 0non-cybersec
|
Stackexchange
| 594
| 1,579
|
Miso Glazed Crispy-Skinned Salmon. Takes only 20 minutes and is my absolute favorite way to make salmon.
The blog post has lots of pics.
http://nerdswithknives.com/miso-glazed-crispy-skinned-salmon-updated/
PREP TIME: 10 MINS / COOK TIME: 10 MINS / TOTAL TIME: 20 MINS
SERVES: 2 SERVINGS
INGREDIENTS
2 salmon fillets, skin on if possible
3 tablespoons white miso (some miso is GF)
3 tablespoons honey
3 tablespoons mirin (sweet rice wine) or substitute one extra tablespoon of honey
2 tablespoons soy sauce (or Tamari for GF)
2 tablespoons ginger, grated or minced
2 teaspoons neutral oil (like peanut or canola)
Thinly sliced scallions (optional for garnish)
Toasted sesame seeds (optional for garnish)
INSTRUCTIONS
Preheat broiler to high
In a small bowl, mix together the miso, honey, mirin, soy sauce, and ginger to form a thick sauce.
If you've rinsed it, make sure the fish is very dry. Slather half the sauce on the exposed flesh of the fish, avoiding getting sauce on the skin (or the bottom flesh, if skinless). If you have time, marinate for 10-15 minutes. (If some sauce gets on the skin, just wipe it off a bit before putting it in the pan).
Heat 2 teaspoons neutral oil in an ovenproof skillet on medium-high. Sear the fish, skin-side down, pressing the fish flat several times with a spatula so that it lies flush in the pan. Don't mash it to death, but you can use a bit of pressure here. Cook for three minutes, until the skin gets crispy.
Carefully spoon another tablespoon of sauce over the flesh of each fillet. Try to avoid having it drip all over the pan so it doesn't get too smoky. Reserve the remaining sauce for drizzling. Pop the pan under the broiler for 4-7 minutes, depending on the thickness of the filet and how well done you like it (I like salmon medium-rare and found that a 1½ inch thick fillet took 5 minutes).
While broiling, watch the fish carefully (the honey burns easily). If it starts to get too dark, move it down farther, away from the broiler.
Serve it with steamed rice or rice noodles. Garnish with slices scallions, sesame seeds and lime segments.
| 0non-cybersec
|
Reddit
| 574
| 2,121
|
Can't serve files without extension because they "appear to be script" on IIS7.5. <p>I created a certain number of static JSON files with no extension in a subfolder of my site. I want to use them for tests.</p>
<p>The problem is that IIS is refusing to serve them because :</p>
<blockquote>
<p>HTTP Error 404.17 - Not Found</p>
<p>The requested content appears to be script and will not be served by the static file handler.</p>
</blockquote>
<p>The folder is a subfolder of an ASP.NET application and I can't create an application just for it, neither can I change the parent application's application pool. Actually, I don't have access to the IIS configuration other than through the <code>web.config</code> file in the folder in question.</p>
<p>I assume there <em>must</em> be a way to get a web server to serve static files, right?</p>
| 0non-cybersec
|
Stackexchange
| 235
| 857
|
Seeking counterexample or proof for equivalence of two separation properties. <p>Two points $x,y$ of a topological space are said to be <em>distinguishable</em> if at least one has a neighborhood not containing the other, and <em>separated</em> if each has a neighborhood not containing the other.</p>
<p>It is readily seen that in an $R_0$ space (one in which distinguishable points are separated), separated points have disjoint closures. I'm curious, however, if the $R_0$ condition is necessary for separated points to have disjoint closures. Does anyone know of an example of a non-$R_0$ space in which separated points have disjoint closures? Alternately, does anyone know of a proof that non-$R_0$ spaces will necessarily have separated points with non-disjoint closures?</p>
<p><strong>Edit</strong>: coffeemath cleverly pointed out a trivial counterexample in the comments below. Does anyone know of a <em>non-trivial</em> counterexample? In particular, a space such that:</p>
<ul>
<li>there exist separated points in the space,</li>
<li>there exist distinguishable, non-separated points in the space, and</li>
<li>separated points in the space have disjoint closures.</li>
</ul>
| 0non-cybersec
|
Stackexchange
| 306
| 1,192
|
AirPods Pro aren’t reliable with Mac mini. <p>I have a 2018 Mac mini with fully up to date software. In December I purchased some AirPods Pro headphones and love them...mostly. The main downside is they're very unreliable with my Mac and troubleshooting has proven challenging.</p>
<p>First, and least concerning, is it often takes a little bit of time to pair when it's not already paired. 10, 15, 20 seconds may pass before it pairs. But next come the real problems. It's not uncommon for the headphones to randomly disconnect. Also, when I'm on calls in Webex or Microsoft Teams, people will often tell me my audio quality is poor but I can hear them just fine. If I have Webex call my phone, even using my Airpods, the audio is fine. This happens enough that I can't trust it to work reliably for talking on my Mac.</p>
<p>I'm using three other Bluetooth (or 2.4Ghz) devices. I have a Magic Keyboard, Magic Trackpad, and a Logitech mouse which uses one of those USB dongles (I don't think that's Bluetooth). Wireless is setup at 5Ghz so that's not a concern. I've heard USB 3 can interfere with 2.4Ghz signals. I'm using 2x 4k Dell monitors that connect using HDMI->USB-C adapters to the back of the mini. The keyboard and trackpad are reliable so I'm not 100% convinced that's the root cause, nor do I know how to fix that problem if it is.</p>
<p>I have used the Bluetooth Explorer you can download from Apple and found the AirPods RSSI does move more than the keyboard or trackpad. It'll be in the -40 range (very good!) and dip down into the -60 range, or worse. I just don't know if this is expected behavior with AirPods.</p>
<p>Apple Support had me reset the AirPods which helped for a bit but the quality is still a problem.</p>
<p>Can someone suggest troubleshooting steps I can take?</p>
| 0non-cybersec
|
Stackexchange
| 470
| 1,807
|
Ubuntu External HDD Login error. <p>I have Ubuntu installed on my external hard drive. It runs pretty decently until I leave it for a minute. Once it comes out of suspension, it asks for my password. After entering my password, the input box disappears and I get a message saying I entered the incorrect password. After pushing the power button to restart my PC, Ubuntu logs in normally but I get a message saying I have an error. After reporting the error, none of my programs show up in the dash. Nothing short of reinstalling Ubuntu can fix this and after reinstalling it happens again! Can anyone help?</p>
| 0non-cybersec
|
Stackexchange
| 134
| 611
|
Tracking yellow color object with OpenCV python. <p>How can I track a yellow object in python using opencv? And, if possible, how can I get the position of the object?</p>
<p>I've tried using the following method but i can't figure out how to lower and upper ranges work.</p>
<pre><code>import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while True:
screen = np.array(ImageGrab.grab())
ret, img = cap.read()
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
#Help
lower = np.array([])
upper = np.array([])
mask = cv2.inRange(hsv, lower, upper)
cv2.imshow('screen', mask)
if cv2.waitKey(25) & 0xFF == ord('q'):
cv2.destroyAllWindows()
break
</code></pre>
<p>It should find yellow objects and possibly get their position.</p>
| 0non-cybersec
|
Stackexchange
| 265
| 790
|
Turn Excel spreadsheet into a formula. <p>I have an Excel spreadsheet that has a complex computation that is not trivial to turn into a macro or a single-cell formula. The spreadsheet has about 10 different inputs (values a human enters in different cells of the spreadsheet) and then it outputs 5 independent calculations (in 5 different cells) based on that input. Their calculation is using some pre-entered data in the spreadsheet (about 100 different constants) and doing some look-ups on them.</p>
<p>I would like to use this whole spreadsheet as a formula on a different spreadsheet to calculate a set of input values and produce the corresponding set of output values. Imagine this as creating different table with 10 columns for the input variables and 5 columns for the outputs, then copying each input into the other spreadsheet and copying back the output in the results table.</p>
<p>For instance:</p>
<ul>
<li>A1, A2, A3,... A10 are cells where someone enters values</li>
<li>through a series of calculations B1, B2, B3, B4 and B5 are updated with some formulas</li>
</ul>
<p>Can I use the whole series of calculations from A1...A10 into B1...B5 without creating one massive huge formula or a VBA macro?</p>
<p>I want to have a set of input values in 100 rows from A100, B100, C100,... J100 onward then do some Excel magic that will:</p>
<ol>
<li>Copy the values from A100...J100 into A1 to A10</li>
<li>Wait for the result to appear in B1 to B5</li>
<li>Copy the values from B1 to B5 into K100 to O100 </li>
<li>Repeat steps 1 to 3 for all rows from 100 to 150</li>
</ol>
| 0non-cybersec
|
Stackexchange
| 427
| 1,593
|
Login only as guest, after have modified ~/.profile file. <p>Yesterday I have modified the file <code>.profile</code>, adding a new PATH at the end of it. After this change I can only login as guest user. Could these two things be connected? How could I solve this problem?</p>
<p>This is my <code>.profile</code> file content:</p>
<pre><code>if [ -n "$BASH_VERSION" ]; then
include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
</code></pre>
| 0non-cybersec
|
Stackexchange
| 178
| 589
|
$y_1, y_2, y_3$ are particular solutions of $y'+a(x)y=b(x)$, so the function $\frac{y_2-y_3}{y_3-y_1}$ is constant.. <p>I'd really love your help with the following exercise.</p>
<p>I need to show that if $y_1, y_2, y_3$ are particular solutions of the linear equation:</p>
<p>$y'+a(x)y=b(x)$, so the function $$\frac{y_2-y_3}{y_3-y_1}$$ is constant.</p>
<p>I got that a particular solution should be of the form: $e^{-\int_{x_0}^{x}a(s)ds}c(x)$, where $c'(x)=e^{\int_{x_0}^{x}a(s)ds}b(x)$. what else should I do? How should I solve this one?</p>
<p>Thanks!</p>
| 0non-cybersec
|
Stackexchange
| 251
| 578
|
Windows 10 1809 - Clock Speed Stuck at 0.40 Ghz. <p>lately my laptop clockspeed is stuck at 0.40 ghz that turned me lagging so bad , i dont know why but it only happen sometimes , like when im booting up my pc it 3ghz-2ghz until about 10 minutes and it turned to be 0.40 ghz again, heres all the picture of my pc specification, All i have tried is , setting the power option , my bios is up to date</p>
<p><a href="https://i.stack.imgur.com/1uUm5.png" rel="nofollow noreferrer">DXDIAG</a></p>
| 0non-cybersec
|
Stackexchange
| 160
| 494
|
How to use Web Workers in create-react-app with worker-loader?. <p>I am trying to implement Web Workers in my React app to share a single WebSockets connection over multiple tabs. I use the worker-loader dependency for loading in Web Workers.</p>
<p>Unfortunately i can't even get a simple dedicated web worker to work. </p>
<p>App.jsx:</p>
<pre><code>import React, { Component } from 'react';
// eslint-disable-next-line
import myWorker from 'worker-loader!./worker.js';
class App extends Component {
constructor(props) {
super();
this.state = {};
}
componentWillMount() {
if(window.SharedWorker) {
console.log(myWorker);
myWorker.port.postMessage('Hello worker');
myWorker.port.onmessage = function(e) {
console.log('Message received from worker');
console.log(e.data);
}
}
</code></pre>
<p>worker.js:</p>
<pre><code>onconnect = function(e) {
var port = e.ports[0];
port.onmessage = function(e) {
var workerResult = 'Result: ' + (e.data[0] * e.data[1]);
port.postMessage(workerResult);
}
}
</code></pre>
<p>When loading the page the following webpack error appears:</p>
<p><a href="https://i.stack.imgur.com/XN9Cr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XN9Cr.png" alt="webpack error"></a>
I can't use the config style usage of worker-loader because that requires some changes in the webpack config. This config can't be edited because of create-react-app. I could if i eject create-react-app, but that does have some disadvantages. </p>
<p>Why doesn't it work? Somebody any ideas?</p>
<p>Thanks in advance, </p>
<p>Mike</p>
| 0non-cybersec
|
Stackexchange
| 527
| 1,645
|
Problem with savesym. <p>MWE:</p>
<pre><code>\documentclass[12pt,a4paper]{article}
\usepackage{savesym}
\begin{document}
content...
\end{document}
</code></pre>
<p>Gets the following error <code>You have requested package ``savesym',but the package provides ``savesymbol'.</code>
If I look at the sty file it's clear the typo however in CTAN there's no mail to tell the developer.</p>
| 0non-cybersec
|
Stackexchange
| 128
| 389
|
npgsql Leaking Postgres DB Connections: Way to monitor connections?. <p>Background: I'm moving my application from npgsql v1 to npgsql v2.0.9. After a few minutes of running my application, I get a System.Exception: Timeout while getting a connection from the pool.</p>
<p>The web claims that this is due to leaking connections (opening a db connection, but not properly closing them).</p>
<p>So</p>
<p>I'm trying to diagnose leaking postgres connections in npgsql.</p>
<p>From the various web literature around; one way to diagnose leaking connections is to setup logging on npgsql, and look for the leaking connection warning message in the log. Problem is, I'm not seeing this message in the logs anywhere.</p>
<p>I also found utility that monitors npgsql connections, but it's unstable and crashes.</p>
<p>So I'm left manually inspecting code. For everyplace that creates an npgsql connection, there is a finally block disposing of it. For everyplace that opens a datareader, CommandBehavior.CloseConnection is used (and the datareader is disposed).</p>
<p>Any other places to check or can someone recommend a way to look for leaking pool connections?</p>
| 0non-cybersec
|
Stackexchange
| 304
| 1,167
|
How to optimise this query?. <p><strong>Script to create Tables Person and Company</strong></p>
<pre><code>USE optimisationTesting
CREATE TABLE Person(Id int not null, Name nvarchar(60), StreetAddress nvarchar(60)
, Height int, CompanyId int)
CREATE TABLE Company(Id int not null, Name nvarchar(60))
GO
ALTER TABLE [dbo].[Person] ADD CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED ([Id] ASC)
ALTER TABLE [dbo].[Company] ADD CONSTRAINT [PK_Company] PRIMARY KEY CLUSTERED ([Id] ASC)
GO
DECLARE @i int = 0
WHILE @i < 100000 BEGIN
INSERT INTO Person(Id, Name, StreetAddress, Height, CompanyId)
VALUES (
@i,
CONVERT(nvarchar(60), newid()),
CONVERT(nvarchar(60), newid()),
140+rand()*60,
rand()*100)
SET @i = @i + 1
END
SET @i=0
WHILE @i < 100 BEGIN
INSERT INTO Company(Id, Name) values (@i, convert(nvarchar(60), newid()))
SET @i = @i + 1
END
-------------------------------------------------------------------------------
set statistics time on
select *
from
Person p
where p.Name like 'a%'
set statistics time off
</code></pre>
<p>The average elapsed time after three execution was 363ms.
<strong>How can this query be further optimized to find out the names of people that starts with A?</strong></p>
| 0non-cybersec
|
Stackexchange
| 408
| 1,320
|
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 do you convert FLV file format to a format that Picasa recognizes (e.g. AVI, MPEG, WMV)?. <p>I use one of the Firefox plugins for embedded video to download content from Youtube and other sites. The program downloads these videos in FLV format, and I have VLC Media Player to play them, which seems to be pretty highly recommended around here.</p>
<p>The downloaded video quality is as good as it gets, so the FLV file format is no problem in itself. However, my girlfriend and I use Picasa for pretty much everything since it's so easy to upload and share with friends using the GUI. I really like Picasa as a program and would prefer not to use another media organizer for these FLV videos.</p>
<p>I guess there are at least 2 possible answers to this question:<br>
1) What is the best way to convert FLV format to a format that Picasa can read?<br>
2) Should I find another media organizer program to use specifically for FLV videos instead?</p>
<p>Some people might say I should use VLC to play the FLVs and leave it at that. However, (and I'm no VLC expert) I can't find a way to preview video thumbnails in the way Picasa does it, and that's what I would really like to be able to do.</p>
| 0non-cybersec
|
Stackexchange
| 309
| 1,202
|
Selling my hockey equipment. A few months back, my parents asked me to clean up the garage and sell off any old stuff we didn’t need anymore. I found a box of all my old hockey equipment, and posted it up on Facebook, making sure to show the condition of each piece of equipment in the description and photos (that will be important later.) That evening, some guy messaged me: “is all of this still available? My daughter is starting hockey this weekend and I’m desperate for equipment! Can I come take a look tonight?” I told him he could come on over and have his daughter try it on. He showed up about an hour later, I let him into the garage where all the gear was laid out on a table. It was clear from the start that he didn’t know what he was doing, he kept putting the equipment on her wrong and then claiming it didn’t fit. Even when I fixed it for him, he’d keep saying “that doesn’t look right at all, take it off honey, it doesn’t fit you” despite most of the equipment fitting like a glove. Finally, he found a pair of elbow pads and pants that he admitted fit correctly. He took a closer look at the pants, and saw a small skate-cut on the leg (which of course was pictured and described in the ad) and immediately told her to take the pants off. “These pants are trash, you trying to sell my daughter ruined pants? What kind of ripoff is this?” He said, taking them off her and throwing them on the floor. I picked them up and explained that the small cosmetic damage to the pants was clearly shown in the post, I wasn’t trying to scam him at all. He told me “you should be ashamed for trying to sell damaged items to people, that’s against the marketplace rules anyways.” (Half of what gets sold on Facebook are vehicles that don’t even start, lmao.) I asked him if he was still interested in the elbow pads, which had no damage and fit his daughter. He said “I’m not wasting my time buying just one item from you, I don’t want them.” I told him “I thought you were desperate for equipment? Doesn’t she start playing this weekend?” He responded with “still not wasting my time buying just one piece of equipment from you. I’d rather go get it all somewhere else.” Without another word, they both stormed out of the garage. Hope the poor girl got some equipment somewhere.
| 0non-cybersec
|
Reddit
| 529
| 2,287
|
[Build Complete] R9 290 Vapor-X / i7 4770K / Corsair 250D (Mini-ITX). My first build.
Water-cooled, of course! No idea how a regular heatsink big enough for overclocking a 4770K would have fit in this case.
[Finished product](http://imgur.com/a/ZZdGS)
All temps are well-within reasonable ranges, especially for the notoriously hot 290. Sapphire did a great job with the cooling on the Vapor-X. It goes to 60-70C under load, with 30-40C at idle. The 4770K hovers around 25-30C at idle.
[PCPartPicker part list](http://pcpartpicker.com/p/RD8fFT) / [Price breakdown by merchant](http://pcpartpicker.com/p/RD8fFT/by_merchant/)
Type|Item|Price
:----|:----|:----
**CPU** | [Intel Core i7-4770K 3.5GHz Quad-Core Processor](http://pcpartpicker.com/part/intel-cpu-bx80646i74770k) | $331.55 @ OutletPC
**CPU Cooler** | [Cooler Master Seidon 240M 86.2 CFM Liquid CPU Cooler](http://pcpartpicker.com/part/cooler-master-cpu-cooler-rls24m24pkr1) | $89.99 @ Newegg
**Motherboard** | [Asus H97I-PLUS Mini ITX LGA1150 Motherboard](http://pcpartpicker.com/part/asus-motherboard-h97iplus) | $107.24 @ Amazon
**Memory** | [Kingston Blu 8GB (1 x 8GB) DDR3-1333 Memory](http://pcpartpicker.com/part/kingston-memory-khx13c9b18) | $70.99 @ Newegg
**Storage** | [Samsung 840 EVO 500GB 2.5" Solid State Drive](http://pcpartpicker.com/part/samsung-internal-hard-drive-mz7te500bw) | $259.19 @ Amazon
**Storage** | [Western Digital Caviar Blue 1TB 3.5" 7200RPM Internal Hard Drive](http://pcpartpicker.com/part/western-digital-internal-hard-drive-wd10ezex) | $54.98 @ OutletPC
**Video Card** | [Sapphire Radeon R9 290 4GB Vapor-X Video Card](http://pcpartpicker.com/part/sapphire-video-card-100362vxsr) | $452.98 @ SuperBiiz
**Case** | [Corsair 250D Mini ITX Tower Case](http://pcpartpicker.com/part/corsair-case-cc9011047ww) | $76.99 @ Newegg
**Power Supply** | [EVGA 850W 80+ Gold Certified Fully-Modular ATX Power Supply](http://pcpartpicker.com/part/evga-power-supply-220g20850xr) | $109.99 @ Newegg
| | **Total**
| Prices include shipping, taxes, and discounts when available | $1553.90
Edit:
Now that Newegg accepts BTC, I went ahead and ordered some more stuff I was thinking about adding... an 80mm fan for the back and an aftermarket northbridge heatsink.
| 0non-cybersec
|
Reddit
| 811
| 2,254
|
Snapping back to baseline in documents with facing pages. <p>Usually the baseline in LaTeX's output is exactly continuous across pages, so that lines on the following pages appear as printed "on top" of each other when a page is turned.</p>
<p>But that behaviour can be disturbed by elements that have a <code>baselineskip</code> different from the main text. I encounter it rather frequently, for example</p>
<ul>
<li>when an element uses a smaller font size, such as in a quotation or table (at least in some style sheets), or when <code>\\[x pt]</code> is used, e.g. in a table</li>
<li>when elements from packages are used that lead to unusual spacing, e.g. when <code>\vspace</code> is hardcoded in a package</li>
</ul>
<p>I'd like to find a way to automatically revert to the baseline when such an element has been used. For example, in the MWE below, I'm looking for a command <code>\baselinerevert</code> that automatically calculates and inserts the needed vertical skip between the tabular and the main text such that the baselines in the main text on the facing pages match.</p>
<p>(In terms of Adobe's InDesign, I need the equivalent of the "align to baseline grid" setting in the paragraph settings)</p>
<hr>
<p>MWE:</p>
<pre><code>\documentclass{scrbook}
\usepackage{kantlipsum,booktabs}
\begin{document}
\kant[1-3]
\begin{table}{\footnotesize
\caption{A table that does not make much sense.}
\begin{tabular}{lrr}
\toprule
Variable & Value 1 & Value 2\\\midrule
A & 42.0 & 1.2\\
B & 0.5 & 2.1\\
\bottomrule
\end{tabular}}
\end{table}
\kant[6-7]
\end{document}
</code></pre>
<p><a href="https://i.stack.imgur.com/s2DFA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s2DFA.png" alt="MWE output"></a></p>
| 0non-cybersec
|
Stackexchange
| 566
| 1,849
|
Load balancing without a load balancer?. <p>I have 4 nginx-powered image servers on their own subdomains which users would access at random. I decided to put them all behind a HAProxy load balancer to improve the reliability and to see the traffic statistics from a single location. It seemed like a no-brainer.</p>
<p>Unfortunately, the move was a complete failure as the load balancer's 100mbit port was completely saturated with all requests now going through it.</p>
<p>I was wondering what to do about this - I could get a port upgrade ($$) or return to 4 separate image servers that are randomly accessed. I thought about putting HAProxy on each image server which would in turn route to another image server if that server's nginx service was having trouble.</p>
<p>What would you do? I would like to not have to spend too much additional money.</p>
| 0non-cybersec
|
Stackexchange
| 202
| 860
|
Evaluation of the Gamma and Digamma Functions. <p>Problem: Evaluate: </p>
<blockquote>
<p>$$\dfrac{1}{4}\dfrac{\Gamma(\frac{a+b+1}{2})\Gamma(\frac{1-b}{2})}{\Gamma(\frac{a+2}{2})}\bigg (\psi\bigg ( \frac{a+b+1}{2}\bigg )-\psi\bigg ( \frac{a+2}{2}\bigg )\bigg ) \bigg |_{a=0,b=1}$$</p>
</blockquote>
<p>This had come up while solving an integral. Upon plugging in $a=0,b=1$, I got However, this does not give the correct answer. A suggestion was to take the limit as $b\to 1$. I was unable to understand why this was done. Is it because when we cannot evaluate a function $f(x)$ at $x=a$, we take $$lim_{x\to a} f(x)$$</p>
<p>Could somebody please tell me how to solve this problem? Many thanks in advance!</p>
| 0non-cybersec
|
Stackexchange
| 258
| 716
|
Binary Relations - Set Theory. <p>This is an assignment question which I had - the instructor did NOT post solutions to these problems. Although they were not tested/marked, I would like assistance on these.</p>
<p>The following questions are about binary relations on the set A = {1, 2,..., n}.</p>
<p>(1) Suppose R is a relation on A containing r elements. Find an upper bound M on the number
of elements in the reflexive closure of R, and prove that your bound is as good as possible by giving an example of a relation R whose reflexive closure has exactly M elements.</p>
<p>(2) Show that the transitive closure of the relation
$R_1 = \{(1, 2),(2, 3),..., (n - 1, n), (n, 1)\}$ is the universal relation $A \times A$.</p>
<p>(3) What is the transitive closure of the relation $R_2 = \{(1, 2), (2, 3),..., (n - 1, n)\}$?</p>
<p>(4) Prove that $R_1$ is the smallest binary relation whose transitive closure is $A
\times A$.</p>
| 0non-cybersec
|
Stackexchange
| 281
| 936
|
Finitely generated $\mathbb{Z}/p^n\mathbb{Z}$-algebra. <p>Let <span class="math-container">$p$</span> be a prime number, let <span class="math-container">$n$</span> be a positive integer. Let <span class="math-container">$B=\oplus_{d=0}^\infty B_d$</span> be a finitely generated graded <span class="math-container">$\mathbb{Z}/p^n\mathbb{Z}$</span>-algebra. Suppose that there exist
integers <span class="math-container">$N$</span> and <span class="math-container">$M$</span> such that <span class="math-container">$B\otimes \mathbb{F}_p$</span> is generated over <span class="math-container">$\mathbb{F}_p$</span> by elements of degree at most <span class="math-container">$N$</span> with relations in degree at most <span class="math-container">$M$</span>. Is it true that <span class="math-container">$B$</span> is generated by its elements of degree at most <span class="math-container">$N$</span> with relations of degree at most <span class="math-container">$M$</span>?</p>
<p>I think it should be true by Nakayama's lemma but I am not sure exactly how to apply it.</p>
| 0non-cybersec
|
Stackexchange
| 337
| 1,078
|
How to set permissions for Android Bluetooth. <p>I'm new to Android development. I'm trying to get a simple HelloWorld app going on my (rooted) phone - and the app is trying to enable Bluetooth.</p>
<p>I've set the Bluetooth permissions in my manifest is as follows, but I'm getting a Permission Denial exception when I try to run the application on my phone via Eclipse:</p>
<pre><code> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloandroid"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:permission="android.permission.BLUETOOTH_ADMIN">
<activity android:name=".HelloAndroid"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-sdk android:targetSdkVersion="7" android:minSdkVersion="5"></uses-sdk>
</manifest>
</code></pre>
<p>Is there something obvious I'm missing?</p>
| 0non-cybersec
|
Stackexchange
| 467
| 1,544
|
Unity - how to make material double sided. <p>Search for the issue gives a number of solutions, but they don't work for some reason in mine Unity3D 5.4. Like
<a href="https://stackoverflow.com/questions/13776151/camera-inside-a-sphere">camera inside a sphere</a></p>
<p>I do not see <code>cull</code> and/or <code>sides</code> in material in Unity editor.
In C# </p>
<pre><code>rend = GetComponent<Renderer>();
mater = rend.material;
rend.setFaceCulling( "front", "ccw" );
mater.side = THREE.DoubleSide;
</code></pre>
<p>gives no such <code>setFaceCulling</code> and <code>side</code> property.</p>
<p>How to make material double sided?</p>
| 0non-cybersec
|
Stackexchange
| 231
| 653
|
How to launch 64-bit powershell from 32-bit cmd.exe?. <p>I know it's a weird question but I am locked into a third party vendor which launches a 32-bit cmd.exe on a target 64-bit Windows Server 2008 R2 clustered server. From here I want to launch a 64-bit PowerShell window and run a script.</p>
<p>Here's my test:</p>
<p><code>powershell.exe "Get-Module -ListAvailable| Where-Object {$_.name -eq 'FailoverClusters'}"</code></p>
<p>If I run this from a 32-bit cmd.exe I get nothing returned. If I run from a 64-bit cmd.exe I get:</p>
<pre><code>ModuleType Name ExportedCommands
---------- ---- ----------------
Manifest FailoverClusters {}
</code></pre>
<p>Any ideas on what I can do to invoke a 64-bit powershell script from a 32-bit cmd shell?</p>
| 0non-cybersec
|
Stackexchange
| 238
| 808
|
How to Install all the default packages by group Using the Local YUM repo. <p>I created a Local HTTP YUM repo. I can install the individual packages. But is there a way to install packages in the available groups?</p>
<p>When I tried to install using groups, it give me this message:</p>
<pre><code>[root@mainserver ~]# yum groupinstall "Development Tools"
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Group Process
Warning: Group Development Tools does not exist.
</code></pre>
| 0non-cybersec
|
Stackexchange
| 155
| 619
|
Fix image in pst-fractal. <p>I have worked only in tikz, I want to make an image of 600 px by 300 px so that the edge of the fractal image is a little white blurred and the background of the box has the same color as the attached image.</p>
<pre><code>\documentclass{standalone}
\usepackage{pst-fractal}
\begin{document}
\begin{pspicture}(-20,-6)(4,6)
\psframe*[linecolor=cyan](-4,-4)(4,4)
\psSier[unit=0.25,n=4,fillstyle=solid,fillcolor=yellow,linecolor=blue]
\end{pspicture}
\end{document}
</code></pre>
<p><a href="https://i.stack.imgur.com/OPQjf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OPQjf.png" alt="enter image description here"></a></p>
| 0non-cybersec
|
Stackexchange
| 254
| 678
|
Open.prof files by snakeviz. <p>I have few cProfile files which need to be opened in chrome.</p>
<p>The command to open cProfile files in chrome is <code>snakeviz fileName.prof</code>.</p>
<p>If i try to double click the .prof file & try to make it open by chrome, it downloads the file.</p>
<p>I want to always execute <code>snakeviz fileName.prof</code> command on every .prof file when double clicked.</p>
<p>I am currently running Ubuntu 16.04 LTS.</p>
<p>P.S. I have tried to edit dconf-editor settings but it did not seem to work.</p>
| 0non-cybersec
|
Stackexchange
| 179
| 550
|
What would be the best way to name a forest domain?. Hello,
I am trying to plan the forest domain name for a small business. However, the company already has their root domain of Company.com and a
sub domain of service.company.com in a DNS server and is currently serving web requests.
They want to have an internal domain, but since they already are using the root in a non-windows dns server, what would be the best way to name an internal AD forest and break it up into subdomains?
I was thinking internal.company.com as the forest root and ad.internal.company.com as the subdomain for AD.
Is this incorrect thinking? Is there a better way to go about this?
| 0non-cybersec
|
Reddit
| 160
| 665
|
Inserting an image on ALL pages of a word document. <p>I have the following code:</p>
<pre><code> Sub ImageInsert()
Application.ScreenUpdating = False
Dim Rng As Range, Shp As Shape, StrImg As String
StrImg = "filepath"
Set Rng = Selection.Range
Rng.Collapse
Set Shp = ActiveDocument.InlineShapes.AddPicture(FileName:=StrImg, _
SaveWithDocument:=True, Range:=Rng).ConvertToShape
With Shp
.LockAspectRatio = True
.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
.Left = wdShapeRight
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Top = wdShapeBottom
.WrapFormat.Type = wdWrapTopBottom
End With
Set Rng = Nothing: Set Shp = Nothing
Application.ScreenUpdating = True
End Sub
</code></pre>
<p>The question is, that i want to insert the image on ALL of the pages in the document, instead of just the page of selection. I've tried changing the range, but it doesn't seem to work.</p>
<p>Thanks in advance!</p>
| 0non-cybersec
|
Stackexchange
| 288
| 955
|
Sort spills to tempdb due to varchar(max). <p>On a server with 32GB we are running SQL Server 2014 SP2 with a max memory of 25GB we have two tables, here you find a simplified structure of both tables:</p>
<pre><code>CREATE TABLE [dbo].[Settings](
[id] [int] IDENTITY(1,1) NOT NULL,
[resourceId] [int] NULL,
[typeID] [int] NULL,
[remark] [varchar](max) NULL,
CONSTRAINT [PK_Settings] PRIMARY KEY CLUSTERED ([id] ASC)
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Resources](
[id] [int] IDENTITY(1,1) NOT NULL,
[resourceUID] [int] NULL,
CONSTRAINT [PK_Resources] PRIMARY KEY CLUSTERED ([id] ASC)
) ON [PRIMARY]
GO
</code></pre>
<p>with following non-clustered indexes:</p>
<pre><code>CREATE NONCLUSTERED INDEX [IX_UID] ON [dbo].[Resources]
(
[resourceUID] ASC
)
CREATE NONCLUSTERED INDEX [IX_Test] ON [dbo].[Settings]
(
[resourceId] ASC,
[typeID] ASC
)
</code></pre>
<p>The database is configured with <code>compatibility level</code> 120.</p>
<p>When I run this <a href="https://www.brentozar.com/pastetheplan/?id=HJZY5j3f4" rel="nofollow noreferrer">query</a> there are spills to <code>tempdb</code>.
This is how I execute the query:</p>
<pre><code>exec sp_executesql N'
select r.id,remark
FROM Resources r
inner join Settings on resourceid=r.id
where resourceUID=@UID
ORDER BY typeID',
N'@UID int',
@UID=38
</code></pre>
<p>If don't select the <code>[remark]</code> field no spills occurs. My first reaction was that the spills occurred due to the low number of estimated rows on the nested-loop operator.</p>
<p>So I add 5 datetime and 5 integer columns to the settings table and add them to my select statement. When I execute the query no spills are happening.</p>
<p>Why are the spills only happening when <code>[remark]</code> is selected? It has probably something to do with the fact that this is a <code>varchar(max)</code>.
What can I do to avoid spilling to <code>tempdb</code>?</p>
<p>Adding <code>OPTION (RECOMPILE)</code> to the query makes no difference.</p>
| 0non-cybersec
|
Stackexchange
| 691
| 2,021
|
Router/Modem needs power-cycle every time wireless user attempts to connect. <p>My home network and internet configuration consists of a Motorola SB 5102 model internet modem (to get internet), which is connected to a D-Link AC1000 wireless router, that provides wireless internet to my whole household- and 2 wired desktop workstations in the office where the router and modem are located. </p>
<p>Our internet works fine on both wireless and wired at any given time, and on any given device- all but one exception. One of the people that I live with recently purchased a Lenovo laptop, around the same time that I upgraded to my current wireless router. Everything was fine at first, but then one day when the user of said laptop attempted, her laptop was unable to connect, and also could not tell what the problem was other than it was not caused on the end of her laptop. After some testing on why this happened, I turned off the power strip that both the modem and router were attached too. When I turned it back on, I was able to get internet to every device previously connected (A Wired Windows 7 Desktop, A Nintendo 3DS, and an iPod Touch), which all worked even when the other laptop computer couldn't. After the power cycle, however, this laptop was successfully able to connect.</p>
<p>After this initial connectivity problem, Every time this user attempts to connect, the connection fails and I need to cycle BOTH devices- Router as well as modem. If i only cycle the one, It doesn't work, which I find weird- This says that the problem is caused by both the router AND the modem, and I have been using the modem for a good 2 years with no problems. Releasing the connection from my router's online settings causes the problem to be resolved about 20 percent of the time, but cycling the devices works best.</p>
<p>It can be very irritating if I'm, say, talking with a client over skype, and I need to disconnect just so that someone else can connect as well. Is there any way of fixing this?</p>
| 0non-cybersec
|
Stackexchange
| 450
| 2,014
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.