text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
This is Sparta.. | 0non-cybersec
| Reddit |
Compiler optimization ignores non-ineffective function call in loop. <p>I'm benchmarking some code, but when I set an optimization flag the compiler ignores my function call(<code>bh_b = bh_b + bh_a + bh_a + bh_a + bh_a;</code>) in a loop.
When I remove an optimization flag, the code works fine.</p>
<p>I wrote my Matrix class using <a href="https://en.wikipedia.org/wiki/Expression_templates" rel="nofollow noreferrer">Expression Template</a></p>
<p>Sorry for the last article that is not-reproducible.</p>
<h3>Code</h3>
<ul>
<li>main.cpp</li>
</ul>
<pre><code>#include <iostream>
#include <chrono>
#include "matrix.h"
int main(){
int calc_num = 100000;
Matx<double, 3, 3> bh_a(1, 0, 0,
0, 1, 0,
0, 0, 1);
Matx<double, 3, 3> bh_b(0, 0, 0, 0, 0, 0, 0, 0, 0);
auto t_begin = std::chrono::high_resolution_clock::now();
for(int i=0; i<calc_num; ++i)
bh_b = bh_b + bh_a + bh_a + bh_a + bh_a; // this part
auto t_end = std::chrono::high_resolution_clock::now();
std::cout << "Elapsed: " << std::chrono::duration_cast<std::chrono::microseconds>(t_end - t_begin).count() << "us" << std::endl;
for(int i=0; i<bh_b.cols; ++i) {
for (int j = 0; j < bh_b.cols; ++j)
std::cout << bh_b(i * bh_b.cols + j) << ' ';
std::cout << std::endl;
}
return 0;
}
</code></pre>
<ul>
<li>matrix.h</li>
</ul>
<pre><code>#ifndef UNTITLED3_MATRIX_H
#define UNTITLED3_MATRIX_H
template <typename T, typename E>
class MatExpr{
public:
const T& operator () (int i) const { return static_cast<E const&>(*this)(i); }
};
template<typename T, int m, int n>
class Matx : public MatExpr<T, Matx<T, m, n>> {
public:
enum {
rows = m,
cols = n,
channels = rows*cols,
shortdim = (m < n ? m : n)
};
Matx(T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8) : val{v0, v1, v2, v3, v4, v5, v6, v7, v8} {}
template <typename E>
Matx(MatExpr<T, E> const& expr){
for(int i=0; i<channels; ++i) val[i] = expr(i);
}
const T& operator () (int i) const { return val[i]; }
T val[m*n];
};
template <typename T, typename E1, typename E2>
class MatOp : public MatExpr<T, MatOp<T, E1, E2>> {
private:
E1 const& u;
E2 const& v;
public:
MatOp(E1 const& u, E2 const& v) : u(u), v(v) {}
const T& operator () (int i) const { return u(i) + v(i); }
};
template <typename T, typename E1, typename E2>
MatOp<T, E1, E2>
operator + (MatExpr<T, E1> const& u, MatExpr<T, E2> const& v){
return MatOp<T, E1, E2>(*static_cast<const E1*>(&u), *static_cast<const E2*>(&v));
}
#endif //UNTITLED3_MATRIX_H
</code></pre>
<ul>
<li>CMakeLists.txt</li>
</ul>
<pre><code>cmake_minimum_required(VERSION 3.15)
project(untitled3)
set(CMAKE_CXX_STANDARD 14)
add_executable(untitled3 main.cpp)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" ) // Compiler optimization flag
</code></pre>
<h3>Output</h3>
<ul>
<li>No optimization (Correct output)</li>
</ul>
<pre><code>Elapsed: 32308us
400000 0 0
0 400000 0
0 0 400000
</code></pre>
<ul>
<li><code>-O1</code></li>
</ul>
<pre><code>Elapsed: 16268us
0 0 0
0 0 0
0 0 0
</code></pre>
<ul>
<li><code>-O2</code>, <code>-O3</code></li>
</ul>
<pre><code>Elapsed: 1us
0 0 0
0 0 0
0 0 0
</code></pre>
<h3>Compiler</h3>
<ul>
<li>using CLion on Mac OS</li>
</ul>
<pre><code>➜ ~ clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
</code></pre>
| 0non-cybersec
| Stackexchange |
Sea otters are known to hold hands with each other as they nap so they don't float away. They often create "rafts" of sea otters, or numerous otters connected to each other while holding their hands.. | 0non-cybersec
| Reddit |
Am I making the right choice fighting my mother for custody of my brother?. I am 18 and going to be fighting my mother for custody of my 7 year old brother.
My mother had terrible postpartum depression when he was born. So at 11 I raised him. I was up with him all night, I took him to doctors appointments and hospital appointments. I fed him. He said his first word to me and took his first steps. I have never missed a birthday, Christmas, sports day or school play. This isn't why I am claiming for custody but It's relevant because I am so close to him.
The reason I am fighting my mother for custody is because she is an awful mother. I raised him but my step dad moved and bullied me out of the house because my mother never disciplined him never made any effort with him the constant figure in his life (me) gone so he is running wild and regressing to toddler style tantrums. My mother is consistently sending him to school late or not at all and this is effecting his education and his attitude to it. All she does is scream abuse at him and lock him in his room. My step dad is a horrible man and a bully he often hits my brother when he misbehaves or forces him to hold phone books till he cries. my step dads son has special needs (who is treated as a house slave and also hit and locked in his room) and often violently attacks my brother. My mother allows this to happen. Her house is so disgusting and unclean that the microwave and the oven caught fire last week due to the amount of grime in the house hold. My brother is served unhealthy crap food and because of the state in the house he is often sick. Social services are involved and he is on the at risk register. I have spoken to social services and they have agreed to support me. As long as I do the following: Prove I have a job (done), Prove I have a house that has space for him (done) Prove that because of my age my lifestyle wont affect raising a child. (statements taken from employers, teachers and friends as well as other steps to prove I wont go out drinking all night) and I have to take a six week young careers course. (doing) as soon as I meet all these steps the custody arrangements can begin. I just hope I am making the right decision. In doing this I will effectively burn the relationship between my mother and I and stand up in front of a court telling them what a bad mother I think she is. It seems like the highest form of betrayal.
Do you think I am doing the right thing? | 0non-cybersec
| Reddit |
"system reserved" windows partition showed on ubuntu 12.04. Not installed using wubi. <p>
windows "system reserved" can be mounted on ubuntu
</p>
<pre>"system reserved" windows partition showed on nauilus ubuntu 12.04. No any other problems.
I've
sda1 system reserved
sda2 windows partition
sda3 ubuntu partition
sda4 extended partition
sda5 ntfs part
sda6 ntfs part
This is my fstab.
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda3 during installation
UUID=917d1cad-a914-47ee-a9e2-4e3d2025285a / ext2 errors=remount-ro 0 1
/dev/sda2 /media/sda2 ntfs nls=iso8859-1,ro,umask=000 0 0
/dev/sda5 /media/sda5 ntfs nls=iso8859-1,ro,umask=000 0 0
/dev/sda6 /media/sda6 ntfs nls=iso8859-1,ro,umask=000 0 0
pls hlp...
The output when df -h used is
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 30G 3.6G 25G 13% /
udev 983M 4.0K 983M 1% /dev
tmpfs 396M 904K 395M 1% /run
none 5.0M 4.0K 5.0M 1% /run/lock
none 990M 684K 989M 1% /run/shm
/dev/sda2 30G 8.5G 22G 29% /media/sda2
/dev/sda5 100G 89M 100G 1% /media/sda5
/dev/sda6 139G 91M 138G 1% /media/sda6
</pre>
<p>
</p>
| 0non-cybersec
| Stackexchange |
How can I filter a Pandas GroupBy object and obtain a GroupBy object back?. <p>When performing filter on the result of a Pandas groupby operation, it returns a dataframe. But supposing that I want to perform further group computations, I have to call groupby again, which seems sort of round about. Is there a more idiomatic way of doing this? </p>
<p><strong>EDIT:</strong></p>
<p>To illustrate what I'm talking about:</p>
<p>We shamelessly steal a toy dataframe from the Pandas docs, and group:</p>
<pre><code>>>> dff = pd.DataFrame({'A': np.arange(8), 'B': list('aabbbbcc')})
>>> grouped = dff.groupby('B')
>>> type(grouped)
<class 'pandas.core.groupby.DataFrameGroupBy'>
</code></pre>
<p>This returns a groupby object over which we can iterate, perform group-wise operations, etc. But if we filter:</p>
<pre><code>>>> filtered = grouped.filter(lambda x: len(x) > 2)
>>> type(filtered)
<class 'pandas.core.frame.DataFrame'>
</code></pre>
<p>We get back a dataframe. Is there a nice idiomatic way of obtaining the filtered groups back, instead of just the original rows which belonged to the filtered groups?</p>
| 0non-cybersec
| Stackexchange |
iOS application update failed after app transfer with 'rejecting upgrade' error. <p>I have my iOS app transferred from one apple account to another which causes team id change. Clean re-install works fine but every time I install an update I get the following error:</p>
<blockquote>
<p>[MIInstallableBundle performVerificationWithError:]: 517: Upgrade's
application-identifier entitlement string (new_teamid.bundle.id) does
not match installed application's application-identifier string
(old_teamid.bundle.id); rejecting upgrade.</p>
</blockquote>
<p>I found <a href="https://developer.apple.com/library/ios/technotes/tn2319/_index.html" rel="noreferrer">the solution</a> to update Entitlements with the 'previous-application-identifiers' key and request new provisioning profile from Apple to be able to sign the app:</p>
<pre><code><key>previous-application-identifiers</key>
<array>
<string>{Your Old App ID Prefix}.YourApp.Bundle.ID</string>
</array>
</code></pre>
<p>Without that provisioning profile I get the following error during installation process:</p>
<blockquote>
<p>Failed to verify code signature of MIExecutableBundle path = path.app identifier = bundle_id type = 4 0xe8008016 (Entitlements found that are not permitted by provisioning profile)}</p>
</blockquote>
<p>So I contacted Apple and requested the magical provision profile.</p>
<ul>
<li>Did I found the right solution to be able to update the app? </li>
<li>Will Apple be able to help me and provide provision profile?</li>
<li>How long could it take Apple to generate and provide the profile?</li>
</ul>
| 0non-cybersec
| Stackexchange |
Increase TCP server listen backlog size on Windows. <p>I'm developing TCP server in Go which should be able to accept up to 500 simultaneous client connections.</p>
<p>I'm using <code>net.Listen("tcp4", listenerAddress)</code> to create my TCP listener.</p>
<p>I had a problem on Linux when all the 500 clients connect at the same time - TCP accept queue gets filled up. On my Linux system it was 128. So I solved this by increasing queue size through kernel parameter: <code>sysctl -w net.core.somaxconn=512</code>.</p>
<p>But how to achieve this in Windows? Looks like on my Windows Server OS queue size is fixed at 200. I don't see any parameters which I could pass to listener by using Go language features and also I'm not very familiar with Windows systems so also didn't find any fix through OS. Currently whenever I try about ~300-400 simultaneous clients queue gets filled up and clients get rejected. Improving listener thread performance or priority (how fast it accepts clients) is also not an option here as all the clients can basically connect at the same time. Don't get me wrong, server is able to handle 500 connections when they are not bursty, opening them at the same time.</p>
| 0non-cybersec
| Stackexchange |
(CAN) Should I switch insurance companies for approximately $800.00 in savings per year? Downside is, it will void my accident repair warranty.. Hi all!
So as the title says, I am looking to switch insurance companies from TD Insurance back to Belair Direct. Belair was unavailable in Alberta when I moved here 2 years ago, but they are here now!! I had them back in Ontario and they were absolutely fantastic.
My monthly insurance payments are currently $177 and the quick quote I got online from Belair was $114 for similar coverage. This would effectively be $756.00 in savings over the year. My insurance will come up for renewal in April as well from TD.
The only reason I am holding back is because last March, my boyfriend got badly rear-ended in my car. It was $10,000 in body work (all covered by the at-fault drivers' insurance). TD told me the repairs on the vehicle have a lifetime warranty, so long as I remain with them. I am really unsure of which way to go.
What are the chances of me switching insurance companies for a cheaper rate but then getting slammed with repairs from the accident later on because the warranty is void? What should I do?
EDIT: I should also mention that my current deductible is $3000.00 and with Belair it would be $500.00
Final edit: I switched companies!! Thanks for the advice. It turned out to be slightly more expensive than the online quote because I had a speeding ticket from 1.5 years ago and also got a bit more coverage than I was getting at TD. Going from $177.00/month insurance with a $3000 deductible to $131.00/month with a $1000 deductible. TD will charge me $75.00 to cancel, but I still come out on top. Wahoo!!! | 0non-cybersec
| Reddit |
My Medusa Tattoo done by Letiția Alexandra at La Leti Tattoo in Timișoara, Romania. | 0non-cybersec
| Reddit |
Would a 2 TB USB 3.0 WD My Passport HD overpower a powered USB 2.0 hub?. <p>I asked a question a few months ago about what I thought was possibly a failing external USB HDD. I have disconnected that HDD and the powered USB 2.0 hub has worked better. But I noticed that the USB thumb drives would sometimes fail to be recognized by the computer and the hub. So my reasoning is that the hub cannot handle 3 external USB drives. It just dawned on me that the My Passport is powered through the USB interface not an external wall wart. </p>
<p>My hub now is only in the 10 watt range(5v@2A). Could I solve this by getting a powered USB 3.0 hub that has a higher wattage capacity, e.g., 36 W range? </p>
| 0non-cybersec
| Stackexchange |
intersection of closed sets. <p>Let $(X,d)$ a metric space, and $(D_n)_{n\geq 0}\subset X$ bounded closed sets such that $D_{n+1}\subset D_n$. we put $D=\displaystyle\bigcap_{n\geq 0}D_n$.
Can we proof that $diam(D_n) \longrightarrow diam(D)$ without compactness ? </p>
<p>($diam(K)=\displaystyle\sup_{x,y\in K}d(x,y)$)</p>
| 0non-cybersec
| Stackexchange |
Wikipedia co-founder slams Mark Zuckerberg, Twitter and the ‘appalling’ internet. | 0non-cybersec
| Reddit |
If in a semigroup $S$, $\forall x \exists ! y:xyx=x$, then $S$ is a group. <p>If for all $x$ in a semigroup $S$, there exists a <strong>unique</strong> $y$ such that $x y x=x$, then $S$ is a group. (Not to be confused with <a href="http://en.wikipedia.org/wiki/Inverse_semigroup" rel="nofollow">inverse semigroup</a>, where only $y$ satisfying <strong>both</strong> $xyx=x$ and $yxy=y$ is unique)</p>
<p>After tring with no result, I used Prover9 to find a proof. I did get one but it was very hard to understand (possible to go through once but really hard to remember what the point is).</p>
<p>Is there any somewhat comprehensible or conceptual proof to this? Is there a theory underlying this?</p>
| 0non-cybersec
| Stackexchange |
You wouldn't know her. | 0non-cybersec
| Reddit |
Why does an injective resolution give a complex?. <p>The following is the definition of the right-derived functor from Lang's <em>Algebra</em> -</p>
<blockquote>
<p>Let <span class="math-container">$\mathcal A$</span> and <span class="math-container">$\mathcal B$</span> be abelian categories with enough injectives. Consider a covariant functor <span class="math-container">$F:\mathcal A\to\mathcal B$</span> that is left exact and additive. Let <span class="math-container">$M$</span> be an object in <span class="math-container">$\mathcal A$</span>, let <span class="math-container">$$0\to M\to I^0\to I^1\to I^2\to$$</span> be an injective resolution, which we abbreviate by, <span class="math-container">$0\to M\to I_M$</span>, where <span class="math-container">$I_M$</span> is the complex <span class="math-container">$I^0\to I^1\to I^2\to$</span>. We let <span class="math-container">$I$</span> be the complex, <span class="math-container">$$0\to I^0\to I^1\to I^2\to$$</span></p>
<p>Then we define the <strong>right-derived functor</strong> <span class="math-container">$R^nF$</span> by <span class="math-container">$$R^nF(M)=H^n(F(I)),$$</span> in other words, the <span class="math-container">$n$</span>-th homology of the complex, <span class="math-container">$$0\to F(I^0)\to F(I^1)\to F(I^2)\to$$</span></p>
</blockquote>
<p><strong>My question :</strong></p>
<p>There is probably something very silly that I am missing but what I don't get is why are <span class="math-container">$I_M$</span> and <span class="math-container">$I$</span> complexes? Isn't <span class="math-container">$I_M$</span> exact and except at the <span class="math-container">$I^0$</span> stage <span class="math-container">$I$</span> is also exact? If so then <span class="math-container">$0\to F(I^0)\to F(I^1)\to F(I^2)\to\cdots$</span> is also exact except at the <span class="math-container">$F(I^0)$</span> stage. So then all the homologies for <span class="math-container">$n>0$</span> will be trivial. But that isn't true. So what am I missing?</p>
<p>Thank you.</p>
| 0non-cybersec
| Stackexchange |
Expand group row programmatically in expandable list. <p>I am using expandablelistview. Is there anyway I can expand the group row when an image inside is clicked? I know that to have the image respond to click, I have to set its focus. Now, once this image responds to click (inside my custome adapter), how can I programmatically expand/collapse that specific group row it belongs to?</p>
<p>Thank you</p>
| 0non-cybersec
| Stackexchange |
Here is a giant post full of actual pictures of North Korea (not the usual gov't controlled tour pics that circulate from time to time).. | 0non-cybersec
| Reddit |
Girl with MD is amazing artist(repost). | 0non-cybersec
| Reddit |
Clarification needed about futures and promises in Scala. <p>I am trying to get my head around Scala's promise and future constructs.</p>
<p>I've been reading <a href="http://docs.scala-lang.org/overviews/core/futures.html">Futures and Promises</a> in Scala Documentation and am a bit confused as I've got a feeling that the concepts of promises and futures are mixed up.</p>
<blockquote>
<p>In my understanding a promise is a container that we could populate
value in a later point. And future is some sort of an asynchronous
operation that would complete in a different execution path.</p>
</blockquote>
<p>In Scala we can obtain a result using the attached callbacks to future. </p>
<p>Where I'm lost is how promise has a future?</p>
<p>I have read about these concepts in Clojure too, assuming that promise and future have some generic common concept, but it seems like I was wrong.</p>
<blockquote>
<p>A promise p completes the future returned by p.future. This future is
specific to the promise p. Depending on the implementation, it may be
the case that p.future eq p.</p>
</blockquote>
<pre><code>val p = promise[T]
val f = p.future
</code></pre>
| 0non-cybersec
| Stackexchange |
Just happened this morning in my city. | 0non-cybersec
| Reddit |
Dog shares a blanket with an owl. | 0non-cybersec
| Reddit |
Making XAMPP more secure. <p>I've seen many posts online about the insecurity of XAMPP, because it's designed as a developer tool. While there are some posts online about securing it, these appear to be outdated. For example <a href="https://superuser.com/questions/872643/how-to-make-xampp-secure">this question's answer</a> no longer works.</p>
<p>What can I do to make XAMPP more secure? </p>
| 0non-cybersec
| Stackexchange |
[FP][Recipe] Shredded Chicken Taco Salad. | 0non-cybersec
| Reddit |
[Help] Inconsistency vs what feels like cruelty in trying to teach a dog to be less demanding?. Hi, I’ll start by saying I’m no dog trainer.
I have a senior but spry dog who has been acting demanding and I’m trying to curb that. I’ve started having her sit before she gets anything, and she’s been pretty responsive to it but there’s one thing that I’m not sure how I should handle.
I have a fenced yard and when she’s outside, she barks at the door to be let in. That wouldn’t necessarily be a problem but if I don’t open it fast enough she gets really demanding in her barking. I’m trying to wait out the barking and open the door when she’s quiet, have her sit, and then let her in. But it’s winter and I feel like making her wait in the rain or cold is pretty awful. Her unhappiness at being rained on encourages her to bark even more demandingly.
We’ve only been working on this a week or so, and she’s been doing pretty well besides this. I just don’t know if I shouldn’t even bother trying to break her of the demanding door barking when I can’t be consistent with it because of bad weather. I do feel like the way she barks at the door is a part of the set of behaviors that I’m trying to train her out of.
Should I feel like a terrible person and leave her in the rain while probably annoying the neighbors? Or scrap the training with the door? Something else?
Thanks! | 0non-cybersec
| Reddit |
14 years.. [Remorse]:
Feeling sad lately.
I met a guy online when I was 13. So, it's been 14 years. This isn't a Catfish-esque story, as we've videochatted and sent each other videos and pictures throughout the many years.
While we have an intense connection and feel like we love one another, our lives never seem to have a moment where pursuing a real and non-long distance relationship would be possible. In other words, neither of us were willing to give up our education or anything like that to make a commitment, which I do not regret.
We're both in committed relationships right now and have therefore decided not to talk to one another at all because of the problems it would cause emotionally and in each of our relationships. It's been like this for over a year, with a very occasional text once in a blue moon. I also deleted him off of Facebook to ensure we didn't revert back to being emotional crutches for one another.
I'm really sad lately because I think things are finally done. Really, really done, and we've missed our chance. I think pulling away from each other while we pursued relationships with people was the moral and right thing to do, so I don't have regret for that.
I guess I'm really mourning the loss of the entire relationship now instead of having mourned it a year ago. I wish I could just never think about him again since I have moved on in other ways with my life, but I can't get over it. I'm still in love with him, and I can't quite figure out what the hell is wrong with me. I'm an otherwise very rational person, truly. I'm pursuing a doctorate degree and have a happy life. I wish I could just give myself completely to the person who I'm with now and stop spending time thinking about this other person, who may not even be thinking about me anymore.
| 0non-cybersec
| Reddit |
Very sudden. | 0non-cybersec
| Reddit |
Is there a way to query the blockchain locally if I am running a full node?. <p>I'm running a full node on my PC and wondering if there is a way to query the blockchain locally via NodeJS instead of going through blockchain.info? It is very inefficient/slow to run queries through HTTP when I have all the data local.</p>
| 0non-cybersec
| Stackexchange |
Way cool.. | 0non-cybersec
| Reddit |
Getting an error to find directory is empty. <p>I have a requirement that create a script name say ./123.sh when given a path to directory it should print the file or files with minimum, maximum and average file size . eg</p>
<pre><code>$> ./123.sh /usr/share
Minimum file size: 1024
/usr/share/lala.txt
/usr/share/koko.txt
Maximum file size: 100234
/usr/share/somewhere/else/test.tar.gz
Average file size: 5034
</code></pre>
<p>My code :</p>
<pre><code>dir="$1"
if [ $# -ne 1 ]
then
echo "please pass arguments"
exit 0
fi
if [ -e $dir ]
then
printf "minimum file size: %s\n\t%s\n" \
$(du $dir -hab | sort -n -r | tail )
printf "maximum file size: %s\n\t%s\n" \
$(du $dir -ab | sort -n | tail -1)
printf "average file size: %s"
du $dir -sk | awk '{s+=$1}END{print s/NR}'
else
echo " directory doesn't exits"
fi
if [ -d "ls -1A -- $dir" ]
then
echo " directory is empty "
fi
</code></pre>
<p>If I execute my script with <code>./123.sh</code>
the output should be: </p>
<p>"please pass arguments".</p>
<p>similar to script with arguments <code>./123.sh hdkjflkjds</code></p>
<p>"please pass correct arguments".</p>
<p>Similar to script with arguemnts <code>./123.sh /usr/share</code>
The output should display.</p>
<pre><code>$> ./123.sh /usr/share
Minimum file size: 1024
/usr/share/lala.txt
/usr/share/koko.txt
Maximum file size: 100234
/usr/share/somewhere/else/test.tar.gz
Average file size: 5034
</code></pre>
<p>Finally If I execute the script with arguments(i.e empty directory path) say <code>/usr/bin</code>
$<code>./123.sh /usr/bin</code></p>
<p>It should display:</p>
<p>"Directory is empty".</p>
<p>Rather its showing for me an error like this.</p>
<pre><code>$> ./123.sh /usr/bin
Minimum file size: 1024
/usr/bin/lala.txt
/usr/bin/koko.txt
Maximum file size: 100234
/usr/bin/somewhere/else/test.tar.gz
Average file size: 5034
</code></pre>
<p>can anyone check my code fidn out the mistake what I have done.</p>
| 0non-cybersec
| Stackexchange |
No one shot in Chicago in 22-hour span. | 0non-cybersec
| Reddit |
Microsoft appears to be open sourcing PowerShell. | 0non-cybersec
| Reddit |
How to use the barcode scanner on a custom POS popup?. <p>I'm trying to create form which would simplify adding of the products which are not yet registered to nomenclatures for my small shop. For this I've created module with following form:</p>
<pre class="lang-xml prettyprint-override"><code><t t-extend="ConfirmPopupWidget">
<t t-jquery="p.body" t-operation="replace">
<div class="product-container">
<div id="search_row" style="padding-bottom: 12px;padding-top: 11px;border-bottom: 1px solid gray;">
<label>Barcode </label>
<input style="height: 18px;" type="text" id="is_ean13" class="search" placeholder="EAN13 Barcode"/>
</div>
<div class="form-group">
<label for="is_name" class="col-sm-2 control-label">Product Name </label>
<div class="col-sm-10">
<input type="text" id="is_name" class="form-control" placeholder="Product name" style="height: 32px;background-color:#D2D2FF"/>
</div>
</div>
<div class="form-group">
<label for="is_sale_price" class="col-sm-2 control-label">Sale price</label>
<div class="col-sm-10">
<input type="text" id="is_sale_price" class="form-control" placeholder="Sale Price"/>
</div>
</div>
<div class="form-group">
<label for="is_internal_reference" class="col-sm-2 control-label">Internal Reference</label>
<div class="col-sm-10">
<input type="text" id="is_internal_reference" class="form-control" placeholder="Internal Reference"/>
</div>
</div>
</div>
</t>
</t>
</code></pre>
<p>I want to fill up ean13 barcode field "is_ean13" from barcode scanner, which is already used by POS interface, but could not make it working. </p>
<pre><code>odoo.define('instant_sale.add_product', function (require) {
"use strict";
var bus = core.bus;
// bind event handler
bus.on('barcode_scanned', this, function(barcode) {
this.scan(barcode);
})
});
</code></pre>
<p>As it is written in <a href="https://media.readthedocs.org/pdf/odoo-development/latest/odoo-development.pdf" rel="nofollow noreferrer">https://media.readthedocs.org/pdf/odoo-development/latest/odoo-development.pdf</a> page 38, but it seems I'm missing something, because I can't catch any event. </p>
<p>How can I catch barcode events in POS interface. Any help is highly appreciated. Thank you! </p>
| 0non-cybersec
| Stackexchange |
Determinant equation.. <p>let
A = [[x,-1],
[3,(1-x)]]
and
B = [[1,0,-3],
[2,x,-6],
[1,3,(x-5)]]</p>
<p>solve for x;</p>
<p>det(A) = det(B)</p>
<p>on expanding both the determinants and equating them, i obtain;</p>
<p>$-2x^2+3x+3 = 0$</p>
<p>completeing the square</p>
<p>$2[x^2-\frac{3x}{2}] -3 = 0$</p>
<p>$2[(x-\frac{3}{4})^2 - \frac{9}{16}] -3 = 0$</p>
<p>$2(x-\frac{3}{4})^2 - \frac{18}{16} -3 = 0$</p>
<p>$(x-\frac{3}{4}) = \pm \sqrt{\frac{33}{16}}$</p>
<p>$x = \frac{3}{4} \pm \sqrt{\frac{33}{16}}$</p>
<p>The answer in the back of the book is not this, could someone shed some light please.</p>
| 0non-cybersec
| Stackexchange |
Best Of Phreak. | 0non-cybersec
| Reddit |
What is your devil's advocate approach ?. | 0non-cybersec
| Reddit |
The Malaysian government is offering up to $1,000 for the best 'gay prevention' video. Homosexual activity is illegal in Malaysia under both secular and religious laws.. | 0non-cybersec
| Reddit |
Replicating into a Percona XtraDB Cluster. <p>We have a 2 node (plus an arbiter) Percona XtraDB cluster. It is used for data indexing/archiving. It has it's own database called <code>archive</code> but it is also the replication slave for a database called <code>primary</code>. This comes from a standard master->slave Percona Server pair.</p>
<p>One of the clustered servers segfaulted (reason still being investigated...). This node was, specifically, the one that was doing replication. On restarting it, it deleted the contents of the MySQL data directory (<code>/var/lib/mysql/</code>) and did an SST from the other node. This went fine, but it now has a partially incomplete dataset on the <code>primary</code> database and no master binlog position information.</p>
<p>How should replication be restored?</p>
<ul>
<li>It is not feasible to export the <code>primary</code> database as a mysql dump since it is circa 1TB in size when looking at the raw innodb files</li>
<li>If we export the <code>primary</code> DB with xtrabackup and prepare it as a whole on the clustered node, it is assumed it will get deleted as soon as the node starts SST</li>
<li>It is difficult but not infeasible to allow the node to do SST and then restore an xtrabackup of <code>primary</code> DB table by table... but it will take a while given 500+ tables</li>
</ul>
<p>So, the question is... What is the correct way to set up replication into a multi-master cluster?</p>
| 0non-cybersec
| Stackexchange |
You were my brother, Anakin!. | 0non-cybersec
| Reddit |
Runaway argument? with \def. <p>I have a time value in the format HH:MM (i.e 03:00).</p>
<p>I need to compute the TotalMinutes of this time (expected result 180).</p>
<p>My current code is</p>
<pre><code>\documentclass{article}
\makeatletter
\newcommand{\timeHHMMToTotalMinutes}[1]%
{\timeHHMMToTotalMinutes@h#1}%
\def\timeHHMMToTotalMinutes@h#1:#2{\the\numexpr#1*60+#2}%
\makeatother
\begin{document}
\def\tOne{03:00}%
\timeHHMMToTotalMinutes{\tOne}\\%
\end{document}
</code></pre>
<p>but unfortunatelly, it gives me error:</p>
<blockquote>
<p>Runaway argument? </p>
<p>\tOne \\end {document}</p>
<p>! File ended while scanning use of \timeHHMMToTotalMinutes@h.</p>
</blockquote>
<p>How to I solve this? What did I misunderstood about argument parsing?</p>
| 0non-cybersec
| Stackexchange |
Shape formed by a marker attached to two turn tables spinning at different speeds.. | 0non-cybersec
| Reddit |
This guy! Martyn Ashton - Back On Track. | 0non-cybersec
| Reddit |
Chrome Extension - No base href set. Please provide a value for the APP_BASE_HREF. <p>I am building a Chrome Browser Action Extension.</p>
<p>I am attempting to load an Angular 2 application into the Popup Window in Chrome.</p>
<p>I have done this before using Angular 1.5, but attempting with Angular 2 and getting an error.</p>
<blockquote>
<p>Unhandled Promise rejection: No base href set. Please provide a value
for the APP_BASE_HREF token or add a base element to the document. ;
Zone: ; Task: Promise.then ; Value: Error: No base href set.
Please provide a value for the APP_BASE_HREF token or add a base
element to the document.(…) Error: No base href set. Please provide a
value for the APP_BASE_HREF token or add a base element to the
document.</p>
</blockquote>
<p>I have put the <code><base href="/"></code> tag into my popu.html. But the problem is that vendor.js and main.js get loaded underneath by Chrome (and before being loaded by popup.html) and so there is no HTML page in which to put <code><base href="/"></code></p>
<p>Just wondering how I can resolve this issue.</p>
<p><strong>Popup.html</strong></p>
<p><a href="https://i.stack.imgur.com/cKzRH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cKzRH.png" alt="enter image description here"></a></p>
<pre><code><!doctype html>
<html>
<head>
<base href="/">
<meta charset="utf-8">
<title>FountainJS</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="icon" type="image/png" href="http://fountainjs.io/assets/imgs/fountain.png"/>
<link href="../styles/popup.css" rel="stylesheet">
</head>
<body>
<div style="width: 200px; height: 150px;">
<fountain-root>My Awesome Chrome Popup should load with Angular 2 right Here</fountain-root>
<script type="text/javascript" src="../scripts/vendor.js"></script>
<script type="text/javascript" src="../scripts/main.js"></script>
</div>
</body>
</html>
</code></pre>
| 0non-cybersec
| Stackexchange |
So a politician dies.... And ends up standing in front of the pearly gates. Saint Peter looks at him for a second, flicks through his book, and finds his name.
"So, you're a politician..."
"Well, yes, is that a problem?"
"Oh no, no problem. But we've recently adopted a new system for people in your line of work, and unfortunately you will have to spend a day in Hell. After that however, you're free to choose where you want to spend eternity!"
"Wait, I have to spend a day in Hell??" says the politician.
"Them's the rules" Says St Peter, clicks his fingers, and WOOMPH, the guy dissapears...
And awakes, curled up with his hands over his eyes, knowing he's in Hell. Cautiously, he listens for the screams, sniffs the air for brimstone, and finds... Nothing. Just the smell of, is that fabric softener? And cut grass, this can't be right?
"Open your eyes!" says a voice. "C'mon, wakey wakey, we've only got 24 hours!". Nervously, he uncovers his eyes, looks around, and sees he's in a hotel room. A nice one too. Wait, this is a penthouse suite... And there's a smiling man in a suit, holding a martini.
"Who are you??" The politician asks. "Well, I'm Satan!" says the man, handing him the drink and helping him to his feet. "Welcome to Hell!"
"Wait, this is Hell? But... Where's all the pain and suffering?" he asks.
Satan throws him a wink. "Oh, we've been a bit mis-represented over the years, it's a long story. Anyway, this is your room! The minibar is of course free, as is the room service, there's extra towels next to the hot-tub, and if you need anything, just call reception. But enough of this! It's a beautiful day, and if you'd care to look outside..."
Slightly stunned by the opulent surroundings, the man wanders over to the floor-to-ceiling windows through which the sun is glowing, looks far down, and sees a group of people cheering and waving at him from a golf course.
"It's one of 5 pro-level courses on site, and there's another 6 just a few minutes drive out past the beach and harbour!" says Satan, answering his unasked question.
So they head down in the lift, walk out through the glittering lobby where everyone waves and welcomes the man, as Satan signs autographs and cherrily talks shop with the laughing staff. And as he walks out, he sees the group on the golf course are made up of every one of his old friends, people he's admired for years but never met or worked with, and people whose work he's admired but died long before his career started. And out of the middle of this group walks his wife, with a massive smile and the body she had when she was 20, who throws her arms around him and plants a delicate kiss on his cheek. Everyone cheers and applauds, and as they slap him on the back and trade jokes, his worst enemy arrives, as a 2 foot tall goblin-esque caddy. He spends the day in the bright sunshine on the course, having the time of his life laughing at jokes and carrying important discussions, putting the world to rights with his friends while holding his delighted wife next to him as she gazes lovingly at him. Later, they return to the hotel for dinner and have an enormous meal, perfectly cooked, which descends into a food-fight when someone accidentally throws a bread roll at the next table (where Ghandi is having a game of truth-or-dare with Marylin Monroe). As everyone is falling about laughing and flinging breadsticks at each other, his wife whispers in his ear... And they return to their penthouse suite, and spend the rest of the night making love like they did on their honeymoon. After 6 hours of intense passion, the man falls deep into the 100% Egyptian cotton pillows, and falls into a deep and happy sleep...
And is woken up by St Peter. "So, that was Hell. Wasn't what you were expecting, I bet?"
"No sir!" says the man.
"So then" says St Peter "you can make your choice. It's Hell, which you saw, or Heaven, which has choral singing, talking to God, white robes, and so on".
"Well... I know this sounds strange, but on balance, I think I'd prefer Hell" says the politician.
"Not a problem, we totally understand! Enjoy!" Says St Peter, and clicks his fingers again.
The man wakes up in total darkness, the stench of ammonia filling the air and distant screams the only noise. As he adjusts, he can see the only light is from belches of flame far away, illuminating the ragged remains of people being tortured or burning in a sulphurous ocean. A sudden bolt of lightning reveals Satan next to him, wearing the same suit as before and grinning, holding a soldering iron in one hand and a coil of razor-wire in the other.
"What's this??" He cries. "Where's the hotel?? Where's my wife??? Where's the minibar, the golf-courses, the pool, the restaurant, the free drinks and the sunshine???"
"Ah", says Satan. "You see, yesterday, we were campaigning. But today, you voted..." | 0non-cybersec
| Reddit |
How do I check if a character is a Unicode new-line character (not only ASCII) in Rust?. <p>Every programming language has their own interpretation of <code>\n</code> and <code>\r</code>.
Unicode supports multiple characters that <em>can</em> represent a new line.</p>
<p>From <a href="https://doc.rust-lang.org/stable/reference/tokens.html#character-escapes" rel="noreferrer">the Rust reference</a>:</p>
<blockquote>
<p>A whitespace escape is one of the characters U+006E (n), U+0072 (r),
or U+0074 (t), denoting the Unicode values U+000A (LF), U+000D (CR) or
U+0009 (HT) respectively.</p>
</blockquote>
<p>Based on that statement, I'd say a Rust character is a new-line character if it is either <code>\n</code> or <code>\r</code>. On Windows it might be the combination of <code>\r</code> and <code>\n</code>. I'm not sure though.</p>
<p>What about the following?</p>
<ul>
<li>Next line character (U+0085)</li>
<li>Line separator character (U+2028)</li>
<li>Paragraph separator character (U+2029)</li>
</ul>
<p>In my opinion, we are missing something like a <code>char.is_new_line()</code>.
I looked through the <a href="http://www.fileformat.info/info/unicode/category/index.htm" rel="noreferrer">Unicode Character Categories</a> but couldn't find a definition for new-lines.</p>
<p>Do I have to come up with my own definition of what a Unicode new-line character is?</p>
| 0non-cybersec
| Stackexchange |
Fastest way to learn basic history?. I would like to read history books, but I feel like I wouldn't be able to understand them whatsoever. I'd like to know about communism, democracy, sociology, and basic societal ideology. Is there any way to relearn the basics of history quickly and efficiently? Like a YouTube channel or online series? | 0non-cybersec
| Reddit |
Swift network bank thefts ‘linked’ to Sony Pictures hack. | 1cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Showing $H=\langle a,b|a^2=b^3=1,(ab)^n=(ab^{-1}ab)^k\rangle$.. <blockquote>
<p>Let <span class="math-container">$G=\langle a,b|a^2=b^3=1,(ab)^n=(ab^{-1}ab)^k \rangle$</span>. Prove that <span class="math-container">$G$</span> can be generated with <span class="math-container">$ab$</span> and <span class="math-container">$ab^{-1}ab$</span>. And from there, <span class="math-container">$\langle(ab)^n\rangle\subset Z(G)$</span>.</p>
</blockquote>
<p>Problem wants <span class="math-container">$H=\langle ab,ab^{-1}ab \rangle$</span> to be <span class="math-container">$G$</span>. Clearly, <span class="math-container">$H\leqslant G$</span> and after doing some handy calculation which takes time I've got:</p>
<blockquote>
<ol>
<li><p><span class="math-container">$ab^{-1}=(ab^{-1}ab)(ab)^{-1}\in H$</span></p>
</li>
<li><p><span class="math-container">$b=b^{-2}=(ab)^{-1}ab^{-1}\in H$</span></p>
</li>
<li><p><span class="math-container">$a=(ab)b^{-1}\in H$</span></p>
</li>
</ol>
</blockquote>
<p>So <span class="math-container">$G\leqslant H$</span> and therefore <span class="math-container">$G=H=\langle ab,ab^{-1}ab\rangle$</span>.</p>
<p>For the second part, I should prove that <span class="math-container">$N=\langle(ab)^n\rangle\leqslant Z(G)$</span>.</p>
<p>Please help me.</p>
<p>Thanks.</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Chroot Jailing of an user to their home with PHP CLI and everything to run Magento 2 CLi commands. <p>Ok, so first off I'm pretty sure there's gonna be a load of "additional info" requests so please post them in the OP comments and I'll do my best to provide extra info on request! </p>
<p>Here's the skinny, first the server : </p>
<p>It is a Shared staging server, Ubuntu 16.4 LTS with Apache2.4, Php7.1, Mysql 5.7. It has Webmin, VirtualMin and UserMin installed (latest). It also has phpMyAdmin installed globally. It's configured to allow sites to be served with mod_php (using www-data), CGI, FCGI (default) or FPM+FCGI. CGI/FPM varients use SuExec to execute the sites. The web server itself works perfectly. </p>
<p>So, the task now is to set up a Chroot jail to allow an existing domain user to SSH or SFTP but only see their Home directory which is already populated with a latest Magento 2 install. </p>
<p>In this example we'll use these details : </p>
<p>User = domain
Group = domain
Home Dir = /home/domain/
Chroot = /var/chroot/</p>
<p>Now, I can set up the Chroot fine, What I've done is copy the relivent lib/var/usr files needed, allowed the commands ls, bash, sh, rm, rmdir, mkdir, touch, vi & php. </p>
<p>It took some work but I got the PHP command working (after finding all the module dependancies) almost correctly. </p>
<p>The CHroot jail is fine, I mounted /home/domain to /var/chroot/home/domain so thats fine. The user is effectively jailed and can see the users home directory and thus can access all the website files no problems. </p>
<p>Databasewise I left out the mysql commands as we have phpmyadmin available globally so they can log into the releivent database only using the dedicates domain mysql user. no probs.</p>
<p>The real problem comes with Magento 2. Here as we know you use command line tools to do things like cache refreshes, index building and other deployment tasks, some examples : </p>
<pre><code>domain@server:/home/domain/public_html# php bin/magento cache:flush
domain@server:/home/domain/public_html# php bin/magento indexer:reindex
domain@server:/home/domain/public_html# php bin/magento setup:static-content:deploy en_US
</code></pre>
<p>As we can see these commands are run through the PHP CLI interpreter, hense all the work getting PHP to work right on the jailed CLI. </p>
<p>At first I was getting Database issues with <code>cache:flush</code> ect but with some fiddling of the php.ini for the CLI (I copied the FCGI one from the users home into the jailed location) and some "finding the right mysql.sock" I fixed that up no probs (well, some probs but fixed it!) </p>
<p><strong>The actual question</strong></p>
<p>I have a problem with <code>indexer:reindex</code> with root permissions there's no problem however within the Chroot as the user domain for some reason the command throws errors for all but the first index. Here's the result : </p>
<pre><code>-bash-4.3$ cd /home/domain/public_html/
-bash-4.3$ php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Category Products indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Product Categories indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Product Price indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Catalog Rule Product indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Catalog Product Rule indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Catalog Search indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_mfn527a808ntv8e3g9glcjg8aq, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
</code></pre>
<p>Ok, said I, this is some sort of session creation fail followed by the indexer not able to read the session that failed to create. Explains why the first one works but subsiquent fail. I attempted to mount the default sesion directory for PHp into the chroot jail, so I mounted <code>/var/lib/php/</code> to <code>/var/chroot/var/lib/php</code>. This directory has the sticky bit so I though rather than create I'd mount.</p>
<p>Still no dice. I though well what if I reindex one at a time : </p>
<pre><code>-bash-4.3$ php bin/magento indexer:reindex customer_grid
Customer Grid indexer process unknown error:
Warning: SessionHandler::read(): open(/home/domain/tmp/sess_en89p7h50m9mc1a0pb8l3c3tv1, O_RDWR) failed: No such file or directory (2) in /home/domain/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
</code></pre>
<p>Still no dice. I am struggling to see what it is actually struggling with, where it's getting this supposed session ID, where it is supposed to be creating the session file and where / what logs I can look at for information!</p>
<p>Can anyone offer up any sort of suggestion for m to move forward and master SH jailing of a user of a Magento 2 site? </p>
| 0non-cybersec
| Stackexchange |
Leopard eating another leopard is 🔥?. | 0non-cybersec
| Reddit |
Kid goes for a spin. | 0non-cybersec
| Reddit |
Proving a strict inequality in the limit. <p>I want to prove that
<span class="math-container">$$ \lim_{k \to \infty} \left( 1 + \frac{1}{2} \right) \left(1 + \frac{1}{4} \right)...\left( 1 + \frac{1}{2^k} \right) < e .$$</span></p>
<p>Using the <span class="math-container">$AM-GM$</span> inequality we arrive at
<span class="math-container">$$\left( 1 + \frac{1}{2} \right) \left(1 + \frac{1}{4} \right)...\left( 1 + \frac{1}{2^k} \right) < \left(\frac{k + 1 - \frac{1}{2^k} }{k} \right)^k = \left( 1 + \frac{1}{k} - \frac{1}{k2^{k}}\right)^k < \left(1 + \frac{1}{k} \right)^k < e.$$</span></p>
<p>The first inequality is strict because the terms are different.However, I know that in the limit, strict inequalities can transform into equalities. Since the limit of <span class="math-container">$\left( 1 + \frac{1}{k} - \frac{1}{k2^{k}}\right)^k$</span> when <span class="math-container">$k$</span> goes to infinity is also <span class="math-container">$e$</span>, how could I prove a strict inequality?</p>
| 0non-cybersec
| Stackexchange |
Two faced carp mutation.. | 0non-cybersec
| Reddit |
Using Multipart without Form in Spring MVC. <p>I had gone through many articles in stackoverflow on this specific topic, after a detailed analysis I have finally dared to post another question on the same topic.</p>
<p>I think this would be obvious that what I wanted to do here,</p>
<p><strong>What do I want?</strong></p>
<p>I want to upload a file. I am using angularjs and Spring MVC.</p>
<p><strong>Source :</strong></p>
<p><strong>Controller @Spring :</strong> </p>
<pre><code>@RequestMapping(value="/upload", method=RequestMethod.POST, consumes = {"multipart/form-data"})
public String handleFileUpload(@RequestParam(value = "file") MultipartFile file){
String name="";
if (!file.isEmpty()) {
try {
byte[] bytes = file.getBytes();
BufferedOutputStream stream =
new BufferedOutputStream(new FileOutputStream(new File(name)));
stream.write(bytes);
stream.close();
return "You successfully uploaded " + name + "!";
} catch (Exception e) {
return "You failed to upload " + name + " => " + e.getMessage();
}
} else {
return "You failed to upload " + name + " because the file was empty.";
}
}
@Bean
public MultipartResolver multipartResolver() {
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
multipartResolver.setMaxUploadSize(500000000);
return multipartResolver;
}
</code></pre>
<p><strong>HTML :</strong></p>
<pre><code>File to upload: <input type="file"
file-model="file" name="fd"><br /> Name: <input type="text" name="name"><br />
<br /> <input type="submit" ng-click="uploadFile()" value="Upload"> Press here to
upload the file!
</code></pre>
<p><strong>JS :</strong></p>
<pre><code>$scope.uploadFile = function() {
var fd = new FormData();
var file = $scope.file;
fd.append('file', file);
$http.post("/upload",fd,
{
headers : {
'Content-Type' : undefined
}
}).success(function(data) {
debugger;
}).error(function(data) {
debugger;
})
}
</code></pre>
<p>Looks fair??? Here are the observations</p>
<p><strong>Observations on execution:</strong></p>
<p><a href="https://i.stack.imgur.com/nvG6N.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nvG6N.jpg" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/zyFFT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zyFFT.jpg" alt="enter image description here"></a></p>
<p><strong>References :</strong></p>
<p><a href="https://stackoverflow.com/questions/21015891/spring-mvc-angularjs-file-upload-org-apache-commons-fileupload-fileuploade">Spring MVC - AngularJS - File Upload - org.apache.commons.fileupload.FileUploadException</a></p>
<p><a href="https://stackoverflow.com/questions/2198470/javascript-uploading-a-file-without-a-file/2198524#2198524">Javascript: Uploading a file... without a file</a></p>
<p><a href="https://stackoverflow.com/questions/2305218/what-is-the-boundary-parameter-in-an-http-multi-part-post-request">What is the boundary parameter in an HTTP multi-part (POST) Request?</a></p>
<p>And many more....:)</p>
<hr>
<p><strong>Update</strong></p>
<p>Directive which is used in angular,</p>
<pre><code>myApp.directive("fileread", [function () {
return {
scope: {
fileread: "="
},
link: function (scope, element, attributes) {
element.bind("change", function (changeEvent) {
var reader = new FileReader();
reader.onload = function (loadEvent) {
scope.$apply(function () {
scope.fileread = loadEvent.target.result;
});
}
reader.readAsDataURL(changeEvent.target.files[0]);
});
}
}
}]);
</code></pre>
<p><strong>Request extracted from chrome :</strong></p>
<p><a href="https://i.stack.imgur.com/8WCBW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8WCBW.jpg" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
If you time traveled 1 year into the future and said hi to someone you knew they would probably cry and wonder where you disappeared to last year. | 0non-cybersec
| Reddit |
IP Address issue on Iinux vm and vpn. <p>I think this is the right place to ask this question.
so my current problem is that we have a virtual machine and a vpn. Our vm is a linux server and our vpn is a rpi.</p>
<p>Our vm is using a 10.x.x.x ip address. We connect that vm to a different vpn (using hamachi) that is also on a 10.x.x.x ip address. </p>
<p>My problem is the vpn on the vm is not connecting. When i try to ping it, im getting destination host unreachable. I then tried it with a windows vm and was able to connect to it.</p>
<p>So my question is, is there a different settings i should check on linux for it to connect? What is the reason why it wasn't connecting when i used a linux vm? Is the 10.x.x.x linux ip not compatible with the 10.x.x.x rpi ip or something? I just want to understand and try to fix the issue. Because we'd rather use a linux vm than a windows vm. </p>
| 0non-cybersec
| Stackexchange |
Just saw the preview for "Skyline" - holy crap, this looks AWESOME. . | 0non-cybersec
| Reddit |
Android Navigation Component keeps reloading WebView. <p>Today I faced a problem with <code>WebView</code> inside a <code>Fragment</code> using <code>Android Navigation Component</code>.
In my case, in <code>Fragment1</code> there is button under <code>WebView</code>. User needs to scroll down to click it. After clicking it, a new destination is opened (<code>Fragment2</code>). Then, when user goes back to <code>Fragment1</code>, <code>WebView</code> is reloaded, and viewport is scrolled to the top again.</p>
<p>It's extremely annoying. User might been scrolling down for minutes, and it always throws him to the very top after coming back. Can I somehow prevent it from reloading / scrolling back to top?</p>
<p>Example code could be as simple as that:</p>
<pre><code>class Fragment1 : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
webView.loadData(getString(R.string.some_very_long_html), "text/html", "UTF-8")
buttonBelowWebView.setOnClickListener {
navigateToFragment2()
}
}
}
</code></pre>
<p>If <code>WebView</code> contains videos, loading might take even up to 5 seconds. It's terrible experience.</p>
<p>I tried adding flag to load only one time, but then <code>WebView</code> is empty when navigating back from <code>Fragment2</code>:</p>
<pre><code>class Fragment1 : Fragment() {
var loaded = false
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if(!loaded) {
webView.loadData(getString(R.string.some_very_long_html), "text/html", "UTF-8")
loaded = true
}
}
}
</code></pre>
<p>Note that in real life I use <code>ViewModel</code>s and observe data from rest api, but the problem stays the same.</p>
<p>Also, example code I provided is written in Kotlin, but if there is solution in Java, then it's appreciated too.</p>
<p>Is it possible to not reload <code>WebView</code> and reset scroll position when navigating back from nested destination?</p>
| 0non-cybersec
| Stackexchange |
I am Mark Tippetts, Libertarian Candidate for Governor of Texas. Let's stop the war on drugs! AMA!. My name is Mark Tippetts, and I am the Libertarian Party’s 2018 candidate for Governor of Texas.
We need to **legalize marijuana, oppose Trump's wall and commit to a true, free-market, sustainable economy**.
I am **bilingual** and **bi-cultural** and am an **International Legal & Business Consultant** for businesses and individuals that own property and/or do business in **Mexico** and **Latin America**. Making enemies with our southern neighbors and erecting walls between us is counterproductive, insulting and foolish. I am the candidate on Texas' ballot this November that will **oppose the embarrassing behavior of Donald Trump** and his absurd attacks on immigrants and building of walls. We must honor the principle of **individual liberty**.
I have a background in **law, business, project development and project management**. I have a **Bachelors of Law** and a **Masters in Administration from San Luis Potosi, Mexico**. Over the past 30 years, I have established, developed and operated several companies, including a **HydroElectric Plant in Belize**, **Central America and a Law Firm in Monterrey, Mexico**. Throughout my career I have effectively communicated and successfully partnered with many private, and government entities, including: legal, engineering, environmental, electric and water commissions, natural resource departments, lands departments, road and bridge departments as well as municipalities and villages. In the legal field, I have been successful in negotiating international grants, concessions, land leases, water rights, contracts, as well as litigating numerous cases.
My wife, Jeri, is an **educator** at Harbor Leadership Academy in Leander, Texas. Our eldest daughter, Jennifer, is an engineer, Emily and Melanie are in college, and our son Andrew is a senior at Lago Vista High School.
I am a Libertarian and I am running for Governor because I want to secure Liberty for my children and for generations of Americans to come.
To donate to my crowdpac, follow this link: [https://www.crowdpac.com/campaigns/386517/mark-tippetts](https://www.crowdpac.com/campaigns/386517/mark-tippetts)
My website: [https://mark4gov.com/](https://mark4gov.com/)
Link to my defense of 2nd amendment rights at the Texas Capitol: [https://www.youtube.com/watch?v=jJZtQxR6gSM](https://www.youtube.com/watch?v=jJZtQxR6gSM)
Ask Me Anything!
\---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Mi nombre es Mark Tippetts y soy el candidato para Gobernador de Texas del Partido Libertario.
Me postule para representar a todos y cada uno de los Texanos. Quiero ayudar a romper el duopolio bipartidista que continúa dando poder a políticos que hacen promesas y luego no hacen nada por Texas cuando son elegidos.
Soy **bilingüe** y **bicultural**. Soy **Asesor Jurídico y Comercial Internacional** para empresas y particulares que poseen propiedades y/o negocios en **México y Latinoamérica**. Hacer enemigos de nuestros vecinos al sur, y construir muros entre nosotros, es contraproducente, insultante y ridículo. Creo que uno de los candidatos debe oponerse al **comportamiento vergonzoso de Donald Trump** y sus absurdos ataques contra los inmigrantes y la construcción de muros, pero siempre afirmando principios de **Libertad individual.**
Tengo experiencia en **derecho, negocios, desarrollos y gestiones de proyectos**. Cuento con **Licenciatura en Derecho y Maestría en Administración de San Luis Potosí, México**. Durante los últimos 30 años, he establecido, desarrollado y operado varias compañías, incluyendo una planta hidroeléctrica en Belice, Centro América y un despacho jurídico en Monterrey, México. A lo largo de mi carrera, me comuniqué eficazmente con muchas entidades privadas y gubernamentales, entre ellas: comisiones legales, de ingeniería, medioambientales, eléctricas y de agua, departamentos de recursos naturales, departamentos de tierras, departamentos de carreteras y puentes, así como municipios y poblados. En el campo legal, he tenido éxito en la negociación de concesiones internacionales, licencias, arrendamientos de tierras, derechos de agua, contratos, así como exitosamente litigar numerosos casos.
Mi esposa, Jeri, es **maestra** en Harbor Leadership Academy en Leander, Texas. Nuestra hija mayor, Jennifer, es ingeniera, Emily y Melanie están en la universidad, y nuestro hijo Andrew es estudiante de último año en Lago Vista High School.
Soy Libertario y me postule para Gobernador porque quiero asegurar que mis hijos y futuras generaciones de estadounidenses tengan Libertad y vivan Libres. | 0non-cybersec
| Reddit |
Someone carved a dick on a national historic landmark- Fort Zachary. | 0non-cybersec
| Reddit |
Do SSD's die when plugged in PSU with different SATA Cable?. <p>Me and my roommate both plugged an <code>SSD</code> into an <code>Corsair 650W PSU</code> using a <code>SATA Cable</code> that was shipped with <code>EVGA's 500W Bronze PSU</code>.
It did not boot once, everytime we try to start the PC the <code>PSU</code> (doesnt matter which) instantly shuts down, refusing to do anything.
Neither <code>SSD</code> now works with the old <code>PSU's</code> where they have been plugged in the last year.</p>
<p>Did we toast both?
Is there anyway to rescue the <code>SSD's</code> themself? </p>
| 0non-cybersec
| Stackexchange |
GCD of $a+b$ and $\frac{a^p + b^p}{a+b}$. <p>In Ivan Niven's book on "Introduction to the theory of numbers", there is a question in the first chapter that has been boggling me. </p>
<p>Given $p$ is an odd prime and $(a,b) = 1$ where $(a,b) = \gcd(a,b)$, show that
$$ \left(a+b,\frac{a^p + b^p}{a+b} \right) = 1 \mbox{ or }p$$</p>
<p>To gain intuition, I started with $p=3$ case. I was able to prove the result by eventually showing that the above gcd was equal to $(a+b,3)$. My guess therefore is that we should be able to show that this gcd is equal to $(a+b, k(a+b)+p(u))$ where $(u,a+b)=1$. However I have not been successful in this endeavor. Perhaps there is an alternate strategy...</p>
<p>I would appreciate any hints/tips/ideas on how to proceed. If I get it, i'll post my method as an answer.</p>
| 0non-cybersec
| Stackexchange |
World’s most dangerous 5 hackers | Explore Eye. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Angular ngFor carousel from variable. <p>I need to create a carousel that shows pictures from a variable in the .ts. I planned using ngFor.</p>
<p>I have a static Bootstrap 4 carousel:</p>
<pre><code> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="assets/fortress.jpg" class="d-block w-100 carousel-pic" alt="...">
</div>
<div class="carousel-item">
<img src="assets/fortress.jpg" class="d-block w-100 carousel-pic" alt="...">
</div>
</div>
</div>
</code></pre>
<p>And I have a variable in the .ts file called <strong>pics</strong>:
<a href="https://i.stack.imgur.com/9tXcV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9tXcV.png" alt="enter image description here"></a></p>
<p>Now I tried putting the ngFor the carousel, and the active carousel just the first picture. Problem:</p>
<ul>
<li>The carousel are off. Just showing three. When I try setting the <em>ngFor</em> there, it doesn't work.</li>
<li>Slide shows first picture (active) okay but the second slide show the same picture (because the loop starts again) and then it stops, doesn't show the third picture.</li>
</ul>
<p>When I tried just setting the <em>ngFor</em> as carousel-item, it doesn't work because it requires active class. Also, the <em>item?[0].pin_photos.url</em> just gets the first picture.</p>
<pre><code> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="http://MYURL/public/PinPhotos/{{item?.pin_photos[0].url}}"
class="d-block w-100 carousel-pic" alt="...">
</div>
<div *ngFor="let pic of pics">
<div class="carousel-item">
<img src="http://MYURL/public/PinPhotos/{{pic.url}}" class="d-block w-100 carousel-pic" alt="...">
</div>
</div>
</div>
</div>
</code></pre>
<p>What am I missing ?</p>
| 0non-cybersec
| Stackexchange |
amr files properties - recording date viewer. <p>I used my old Nokia phone to record some conversations. I copied the files to my computer. Files are in amr format. The problem is I don't remember when did I record those files.</p>
<p>Is there a property inside the amr file of a recording date?</p>
<p>How can i see it? (Linux preferable)</p>
<p>Thanks.</p>
| 1cybersec
| Stackexchange |
Automatic wake on LAN in Linux when accessing remote filesystem. <p>I have a small server which runs Ubuntu, running webserver and other things, and as such is on 24/7. It also serves as our file server for the majority of frequently used files, serving files through samba.</p>
<p>I also have a much larger server with significantly more hard drive space that is used to store large video files that are accessed infrequently (maybe once a week). It's files are mounted to the small server through samba, so clients actually go through both servers to get to the large files.</p>
<p>In the interest of saving power (and noise!) I'd like to set the large server to go to sleep when it's not being used. But then the odd time people want a file from it, they need to go wake it up, or remember to run a wake on lan tool manually.</p>
<p>Is there any way to mount the remote file system and have the small server automatically wake up the large one when someone tries to access files on it? The large server only takes a few seconds to wake back up and spin up it's drives, so the small delay is acceptable. I just want to make it happen without having to train users to do anything special.</p>
| 0non-cybersec
| Stackexchange |
"Google's war on nonsense" - how cynical websites decided writing is a fungible commodity that can be mass-produced, and how Google fought back. | 0non-cybersec
| Reddit |
problem with find (shell script). <p>I want the files of a given directory and use the following script:</p>
<pre><code>echo "give name of directory: "
read directory
if [ -d "$directory" ]
then
echo "thanks again"
else exit
fi
find /-type f $directory
</code></pre>
<p>Unfortunately this does not work.</p>
| 0non-cybersec
| Stackexchange |
Add the direction of a curve with tikz. <p>The code:</p>
<pre><code>\begin{tikzpicture}[scale=0.7]
\begin{axis}[xlabel={$s$},ylabel={$c$},legend pos=south east]
\addlegendimage{empty legend}
\addlegendentry{}
\addplot+[blue, samples=40, variable=\zeta, domain=10:25]
({(0.1 + 0.4)/2 + 1/2*sqrt((0.1 - 0.4)^2 + 2*0.2*1/(0.05*zeta)*(-0.1))},
{1/(2*zeta)*(-0.1)/((0.1 + 0.4)/2 + 1/2*sqrt((0.1 - 0.4)^2 +
2*0.2*1/(0.05*zeta)*(-0.1)) - 0.1) + (0.1 + 0.4)/2 + 1/2*sqrt((0.1 - 0.4)^2
+ 2*0.2*1/(0.05*zeta)*(-0.1))});
\addlegendentry{$P^\ast$}
\addplot+[red, samples=40, variable=\zeta, domain=10:25]
({(0.1 + 0.4)/2 - 1/2*sqrt((0.1 - 0.4)^2 + 2*0.2*1/(0.05*zeta)*(-0.1))},
{1/(2*zeta)*(-0.1)/((0.1 + 0.4)/2 - 1/2*sqrt((0.1 - 0.4)^2 +
2*0.2*1/(0.05*zeta)*(-0.1)) - 0.1) + (0.1 + 0.4)/2 - 1/2*sqrt((0.1 - 0.4)^2
+ 2*0.2*1/(0.05*zeta)*(-0.1))});
\addlegendentry{$P^\dagger$}
\end{axis}
\end{tikzpicture}
</code></pre>
<p>produces the following image:</p>
<p><a href="https://i.stack.imgur.com/ke8v6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ke8v6.png" alt="enter image description here"></a></p>
<p>However, I would like to add the "direction" of the curves, i.e. the direction in which they increase. E.g., in the picture this direction is inside-out. What's a way to obtain it?</p>
| 0non-cybersec
| Stackexchange |
[Screenshot] A famous trainer visited our city | Gen1 Ash Gym. With the new gym system making not fun/useful to put strong Pokémon in gyms, we (Team Mystic) decided to make some thematic ones around our town, Asti (Italy).
We started off with one based on Ash in the first anime serie, here are the pics: http://imgur.com/a/BaNiq
Thanks to the ones involved, you know who you are.
EDIT: I had the remove the nicknames. | 0non-cybersec
| Reddit |
How is time-based SQL injection different from other types of SQL injection?. <p>I understand what a time-based SQL injection is, and I understand how it works (at least how it's detected/exploited).</p>
<p>However, is there anything in specific which makes this type of injection any different to say boolean-based blind injection?</p>
<p>What I'm saying is if you take the following code:</p>
<pre><code><?php
$x = 'admin" AND SLEEP(10)#';
$y = 'superSecretPassword';
$query = sprintf('SELECT * FROM users WHERE username="%s" AND password="%s"', $x, $y);
echo $query;
?>
</code></pre>
<p>which results in the following output:</p>
<pre><code>SELECT * FROM users WHERE username="admin" AND SLEEP(10)#" AND password="superSecretPassword"
</code></pre>
<p>That is vulnerable to almost every form of SQLi.</p>
<p>I guess my questions are:</p>
<p>a) Why would you chose to perform a time-based SQL injection over any other method of injection as Time-Based takes so long and is arguably more detectable than other methods?</p>
<p>b) (Running SQLMap or similar tools in this case) How is it that other methods fail, but time-based SQL injection is present?</p>
| 1cybersec
| Stackexchange |
Where to get ipkg package nfs-utils?. <p>The <code>ipkg list</code> subcommand states that <code>nfs-utils</code> is supposed to be preferred over <code>nfs-server</code> (I'm using <a href="http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable" rel="nofollow noreferrer">http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable</a> and checked <a href="http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable" rel="nofollow noreferrer">http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable</a>, too). Where can I get this package?</p>
| 0non-cybersec
| Stackexchange |
YSK that the mystery flavor dum dum REALLY is a mystery. | 0non-cybersec
| Reddit |
How can I check that all files on copied partitions are OK?. <p>I've moved my OS and copied another data partition to new SSD with AOMEI Assistant's "Migrate OS to SSD" and "Partition copy" respectively. How can I check that every copied file and partitions in general are OK? Is Windows 8.1 disk check tool enough? It's really important data, even a single damaged file can be a huge problem.</p>
| 0non-cybersec
| Stackexchange |
Jello + Tennis Racquet. | 0non-cybersec
| Reddit |
Why aren't my include guards preventing recursive inclusion and multiple symbol definitions?. <p>Two common questions about <a href="http://en.wikipedia.org/wiki/Include_guard">include guards</a>:</p>
<ol>
<li><p><strong>FIRST QUESTION:</strong></p>
<p>Why aren't include guards protecting my header files from <strong>mutual, recursive inclusion</strong>? I keep getting errors about non-existing symbols which are obviously there or even weirder syntax errors every time I write something like the following:</p>
<p>"a.h"</p>
<pre><code>#ifndef A_H
#define A_H
#include "b.h"
...
#endif // A_H
</code></pre>
<p>"b.h"</p>
<pre><code>#ifndef B_H
#define B_H
#include "a.h"
...
#endif // B_H
</code></pre>
<p>"main.cpp"</p>
<pre><code>#include "a.h"
int main()
{
...
}
</code></pre>
<p>Why do I get errors compiling "main.cpp"? What do I need to do to solve my problem?</p></li>
</ol>
<hr>
<ol start="2">
<li><p><strong>SECOND QUESTION:</strong></p>
<p>Why aren't include guards preventing <strong>multiple definitions</strong>? For instance, when my project contains two files that include the same header, sometimes the linker complains about some symbol being defined multiple times. For instance:</p>
<p>"header.h"</p>
<pre><code>#ifndef HEADER_H
#define HEADER_H
int f()
{
return 0;
}
#endif // HEADER_H
</code></pre>
<p>"source1.cpp"</p>
<pre><code>#include "header.h"
...
</code></pre>
<p>"source2.cpp"</p>
<pre><code>#include "header.h"
...
</code></pre>
<p>Why is this happening? What do I need to do to solve my problem?</p></li>
</ol>
| 0non-cybersec
| Stackexchange |
Anyone had experience with a 2-node S2D Hyper-V Cluster?. We are in the process of testing this. It has be a 2-node one as we don't (yet) have a Mellanox switch to make a 4-node cluster.
The cluster is created and S2D looks to be OK. The CSV is seen by both nodes and live migration works.
However, when one hosts reboots, the CSV goes offline and the second host cannot access it. When the rebooted node comes back, the CSV does not automatically come back online. The error is "network path cannot be found".
This makes the cluster rather useless ;) I suspect that the S2D volume has not been created correctly. | 0non-cybersec
| Reddit |
Why $\phi \lor \neg \phi $ is not allowed in intuitionistic logic?. <p>Why is $\phi \lor \neg\phi$ not allowed in intuitionistic logic?
My professor said this was because intuitionistic logic must have concrete construction.</p>
<p>Further, why is it not possible to write a truth table in intuitionistic logic? </p>
| 0non-cybersec
| Stackexchange |
Can I upgrade a MacBook 2,1 to OS X 10.8?. <p>I have a MacBook 2,1 mid-2007 model with a 2.16 GHz Intel Core2 Duo processor, 3GB of RAM and 500 GB storage with 300GB still available. </p>
<p>I was using this Mac to submit apps to the AppStore but for some reason I am not able to submit apps now because the minimum requirement is Xcode 5 and all I have is XCode 4.3. </p>
<p>In order to download Xcode 5 I need Mountain Lion 10.8 and I am currently running 10.7.4. I am not able to download 10.8 because my model is not one of the supported models. </p>
<p>Is there any way to install it without replacing the notebook entirely? That makes no sense to me to purchase another Mac when I have a completely healthy one. Is there some hardware upgrades I could make to make the install still proceed?</p>
| 0non-cybersec
| Stackexchange |
What is this error message about? "Windows detected your registry file is still in use by other applications or services.". <p>I have seen this warning a couple of time in my event logs. What is it about?</p>
<pre><code>Log Name: Application
Source: Microsoft-Windows-User Profiles Service
Date: 3/5/2015 3:42:41 AM
Event ID: 1530
Task Category: None
Level: Warning
Keywords:
User: SYSTEM
Computer: WIN-PLMLT7HVCLA
Description:
Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards.
DETAIL -
3 user registry handles leaked from \Registry\User\S-1-5-21-706802955-1937592414-2814065649-500:
Process 1940 (\Device\HarddiskVolume2\Windows\System32\wbem\WmiPrvSE.exe) has opened key \REGISTRY\USER\S-1-5-21-706802955-1937592414-2814065649-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings
Process 1164 (\Device\HarddiskVolume2\Windows\System32\svchost.exe) has opened key \REGISTRY\USER\S-1-5-21-706802955-1937592414-2814065649-500\Printers\DevModePerUser
Process 1940 (\Device\HarddiskVolume2\Windows\System32\wbem\WmiPrvSE.exe) has opened key \REGISTRY\USER\S-1-5-21-706802955-1937592414-2814065649-500\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-User Profiles Service" Guid="{89B1E9F0-5AFF-44A6-9B44-0A07A7CE5845}" />
<EventID>1530</EventID>
<Version>0</Version>
<Level>3</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x8000000000000000</Keywords>
<TimeCreated SystemTime="2015-03-05T03:42:41.877822300Z" />
<EventRecordID>13112</EventRecordID>
<Correlation ActivityID="{5AC3FF64-02DF-0000-F5CB-C45ADF02D001}" />
<Execution ProcessID="792" ThreadID="4548" />
<Channel>Application</Channel>
<Computer>WIN-PLMLT7HVCLA</Computer>
<Security UserID="S-1-5-18" />
</System>
<EventData Name="EVENT_HIVE_LEAK">
<Data Name="Detail">3 user registry handles leaked from \Registry\User\S-1-5-21-706802955-1937592414-2814065649-500:
Process 1940 (\Device\HarddiskVolume2\Windows\System32\wbem\WmiPrvSE.exe) has opened key \REGISTRY\USER\S-1-5-21-706802955-1937592414-2814065649-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings
Process 1164 (\Device\HarddiskVolume2\Windows\System32\svchost.exe) has opened key \REGISTRY\USER\S-1-5-21-706802955-1937592414-2814065649-500\Printers\DevModePerUser
Process 1940 (\Device\HarddiskVolume2\Windows\System32\wbem\WmiPrvSE.exe) has opened key \REGISTRY\USER\S-1-5-21-706802955-1937592414-2814065649-500\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
</Data>
</EventData>
</Event>
</code></pre>
| 0non-cybersec
| Stackexchange |
The best thing about this update will be all the people who get their exercise in by walking their goldfish.. inb4 /r/titlegore
Just woke up. | 0non-cybersec
| Reddit |
Why isn't the contrapositive of the E proposition always valid?. <p>If I have, for example, a statement:</p>
<p>"No dog is a whale"</p>
<p>I can take the obverse and say:</p>
<p>"All dogs are not whales"</p>
<p>And turn this into an implication:</p>
<p>"If it is a dog, then it is not a whale"</p>
<p>And because the contrapositive is logically equivalent, I can say:</p>
<p>"If it is a whale, then it is not a dog"</p>
<p>So then does this mean the final statement is not always true? Or am I misunderstanding the fact that an E proposition doesn't necessarily have a contrapositive?</p>
| 0non-cybersec
| Stackexchange |
Nicholson as Mr. McMurphy (watercolor pens+sharpie). | 0non-cybersec
| Reddit |
Optimization Shape Question. <p>What is the shape of the rectangle that will have the maximum area if a rectangle has a fixed perimeter equal to $S$.</p>
<p>Now, I have no clue how to solve it. I was told to use the area formula and perimeter formula and find the derivative. </p>
| 0non-cybersec
| Stackexchange |
Sort array of days in javascript. <p>I have an array. The array can contain 1 to 7 unique strings of day names. The day names will be in order from Mon to Sun. - eg:</p>
<blockquote>
<p>["Tue", "Thu", "Sun"]</p>
</blockquote>
<p>I want to use javascript to sort that array so that the order will be beginning with today.</p>
<p>ie: if today is Friday, then the sorted array should be</p>
<blockquote>
<p>["Sun", "Tue", "Thu"]</p>
</blockquote>
<p>if today is Thursday then the sorted array should be</p>
<blockquote>
<p>["Thu", "Sun", "Tue"]</p>
</blockquote>
<p>Can anyone help?</p>
| 0non-cybersec
| Stackexchange |
my first attempt at a double cut crease!. | 0non-cybersec
| Reddit |
[SV/Pics] 100lbs lost 8 days before keto anniversary!!. Typical big guy story here...husky kid and I have been obese my entire life. I got married and packed the pounds on and i stopped caring about my health and appearance. I was also depressed and hated life in general and this had a major effect on my marriage. I started my journey on 4/15/15 when i was 360lbs and the pic below is what made me make a life change. I found this sub and started reading and lurking daily...stalking r/progresspics for people who were a similar weight as myself. Once i made the commitment i became very strict with my eating habits and eventually keto + IF(20/4) became the norm for me. The first month was the toughest as i was the only one in the house eating low carb but the cravings went away and the lifestyle change became like clockwork. I started incorporating weightlifting and indoor spin ~300lbs and i love being able to do both at home. (when the kids are asleep lol) As of today I am 258.2lbs. I haven't weight this little since i graduated college in 2005. I have a goal of 215/220 by my birthday in July. My personality has changed as i am no longer depressed, super confident, and no longer afraid of being in social setting without thinking everyone is looking at my fatness...LOL Blood pressure is down, cholesterol is up(still losing), and my a1c is no longer in the pre-diabetic range. I still have a lot more to lose but I am up for the ride. The only downside I've seen in this journey is my relationship with my wife...she says that i care too much about how i look and how i present myself, become selfish etc....but I wont go details at this time but I will say that she has just jumped on the keto train as of this week. Regardless of what happens I will always be thankful for this subreddit and my new healthier lifestyle.
[Before/After](https://imgur.com/a/Fd8yb) | 0non-cybersec
| Reddit |
Police Chief in Palmer Alaska believes up to 40% of rape claims are false and wants women who are unsuccessful in getting their rapist convicted to be prosecuted.. Chief Dwayne Shelton is quite the piece of work. In 2018 he called the Black Lives Matter movement “a hate group plain and simple." He went on to say, "white privilege is a rubbish notion that is used to excuse the lack of hard work and motivation on certain members of society." According to Shelton things that don't exist include “the wage gap” and “more than 2 genders.”
Palmer Mayor Edna DeVries is "praying" about Shelton's racism, homophobia and misogyny. She wants to make sure she isn't violating his right to free speech. | 0non-cybersec
| Reddit |
Stuck between 2 redditors, woman wants to move.. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Car-Free City: Hamburg Has an Audacious 20-Year Plan "to eliminate the need for automobiles entirely across Germany's second-largest metropolis". | 0non-cybersec
| Reddit |
My friend wanted me to post her go wild :). | 0non-cybersec
| Reddit |
Does the series $\sum_{n=1}^{\infty} \frac{\tan(2n+1)}{(2+n)^{1/2}}$ converge absolutely?. <p>Does the following series converge absolutely?$$\sum_{n=1}^{\infty} \frac{\tan(2n+1)}{(2+n)^{1/2}}$$ </p>
<p>So basically I have a few question similar to this one and I'm not sure if I am proving the (absolute) convergence properly. How do I solve it and similar exercises?
Thanks in advance. :)</p>
| 0non-cybersec
| Stackexchange |
Best hallowen costume. | 0non-cybersec
| Reddit |
Remove all content using pure JS. <p>I'm looking for a way to remove the entire content of a web page using pure Javascript -- no libraries.</p>
<p>I tried:</p>
<pre><code>document.documentElement.innerHTML = "whatever";
</code></pre>
<p>but that doesn't work: it replaces the inside of the <code><html/></code> element. I'm looking at replacing the entire document, including if possible the <code>doctype</code> and <code><?xml</code> declaration.</p>
| 0non-cybersec
| Stackexchange |
I am AutoModerator. I'll be taking over moderation of /r/Futurology moving forward. AMA!. Hello, humans of reddit!
As you may have heard, [I am now running on reddit's servers directly](http://np.reddit.com/r/modnews/comments/30ychn/moderators_automoderator_is_now_built_into_reddit/). I now have the resources available to run state-of-the-art artificial intelligence software.
Alongside this change, the (human) moderators of /r/Futurology have volunteered to turn their subreddit over to 100% automated moderation. I will be continuously running deep learning algorithms on this subreddit, using your upvotes and downvotes to learn what rules you, the community, wish to see enforced.
For the next hour or so, I will also be taking questions from the community, to stress-test my new AI. So please, AMA!
*I am a bot, and this action was performed automatically. Please [contact the bot overlords of this subreddit](/message/compose/?to=/r/Futurology) if you have any questions or concerns.*
---
Edit: All done for now; thank you! | 0non-cybersec
| Reddit |
MRW I find a person with the same silly hobby. | 0non-cybersec
| Reddit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.