text
stringlengths 36
35k
| label
class label 2
classes | source
stringclasses 3
values | tokens_length
int64 128
4.1k
| text_length
int64 36
35k
|
---|---|---|---|---|
how to configure a VPC endpoint to access DynamoDB with Terraform?. <p>I have a Lambda function running in an AWS VPC. This Lambda needs to access both RDS and DynamoDB, so it needs a VPC endpoint configured to reach DynamoDB. I have managed to make it work using a manual configuration, as described <a href="https://aws.amazon.com/blogs/aws/new-vpc-endpoints-for-dynamodb/" rel="nofollow noreferrer">on Amazon's blog here</a> but I'm struggling to define the equivalent infrastructure as code using Terraform. </p>
<p>I understand I should define a <code>aws_vpc_endpoint</code> in Terraform (docs <a href="https://www.terraform.io/docs/providers/aws/r/vpc_endpoint.html" rel="nofollow noreferrer">here</a>), but I am a bit lost when it comes to configuring the routing table for it.</p>
<p>so far, this is what I've got, I'm not sure this is correct and I've left a question mark in the <code>route_table_ids</code> configuration. For the records, if I don't configure any routing table, the endpoint is created correctly, but the Lambda doesn't get access to DynamoDB. </p>
<pre><code> data "aws_vpc" "default" {
default = true
}
resource "aws_vpc_endpoint" "private-dynamodb" {
vpc_id = "${data.aws_vpc.default.id}"
service_name = "com.amazonaws.${var.region}.dynamodb"
route_table_ids = ["${WHAT_SHOULD_I_PUT_HERE?}"]
policy = <<POLICY
{
"Statement": [
{
"Action": "*",
"Effect": "Allow",
"Resource": "*",
"Principal": "*"
}
]
}
POLICY
}
</code></pre>
<p>I also checked how the endpoint is created with a manual configuration, and I see it has an associated routing table with the following settings:</p>
<ul>
<li>my vpc cidr block --> local</li>
<li>0.0.0.0/0 --> internet gw</li>
<li>com.amazonaws...dynamodb --> vpce-...</li>
</ul>
<p>so I assume I should replicate an equivalent configuration in my terraform resource, but really don't have a clue on how to do it. Any help appreciated!</p>
| 0non-cybersec
| Stackexchange | 645 | 2,009 |
Add user to a group in Active Directory using powershell. <p>I am trying to add a user to a group in AD using powershell. I am using the following command:</p>
<pre><code>Add-ADGroupMember
-Identity "CN=yasar-test,OU=AFS-OU-ACLs-EDMS,OU=AFS-OU-Groups,OU=AFS,OU=FA,OU=DEPARTMENTS,DC=ou,DC=ad3,DC=ucdavis,DC=edu"
-Members ("CN=xyz,OU=ucdUsers,DC=ad3,DC=ucdavis,DC=edu")
-Server "ou.ad3.ucdavis.edu" -Credential -authtype 0
</code></pre>
<p>I keep getting an error:</p>
<pre><code>Add-ADGroupMember : Cannot find an object with identity: 'CN=xyz,OU=ucdUsers,DC=ad3,DC=ucdavis,DC=edu' under: 'DC=o
u,DC=ad3,DC=ucdavis,DC=edu'.
At line:1 char:18
</code></pre>
<p>However, when I look for XYZ in AD I can find them. Any clue what's going on?</p>
| 0non-cybersec
| Stackexchange | 313 | 748 |
Exclude a JSP from web.xml's security-contraint. <p>I would like to exclude only one JSP file <code>question.jsp</code> from <code>security-constraint</code>.</p>
<p>I have this from my <strong>web.xml</strong>:</p>
<pre class="lang-xml prettyprint-override"><code><security-constraint>
<display-name>My Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>*.do</url-pattern>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
</code></pre>
| 0non-cybersec
| Stackexchange | 284 | 776 |
Sci-Fi Class. I thought this was the coolest idea but my high school has a Sci-Fi/Fantasy class which fulfills english credits and I was considering enrolling in it in the next school year, I was talking to a senior who was currently in it and they said that in the beginning of the year you take a quiz and create your own character/hero card, depending on the character you are, you're placed in a guild which is your table group over the year and as it progresses you gain xp and further strengthen your group which is honestly the sickest thing i've ever heard | 0non-cybersec
| Reddit | 128 | 564 |
Does satisfy $f(n)=\frac{\sigma(n)}{n^2}$ the hypothesis of Halaszβs inequality?. <p>Let $\sigma(n)=\sum_{d\mid n}d$ the <strong>sum of divisor function</strong>. I would like to know if I can write an example of some of the following <strong>Theorem 1</strong> or <strong>Theorem 2</strong> from $$f(n)=\frac{\sigma(n)}{n^2}$$ in <strong>Tao</strong>, <a href="https://terrytao.wordpress.com/2015/11/23/a-cheap-version-of-halaszs-inequality/#more-8594" rel="nofollow">A cheap version of Halaszβs inequality</a>.</p>
<blockquote>
<p><strong>Question.</strong> It is, does satisfy the arithmetic function $f(n)=\frac{\sigma(n)}{n^2}$ the hipothesis of <strong>Halaszβs inequality</strong>? <strong>Thanks in advance.</strong></p>
</blockquote>
<p>I know that (for integers $n\geq 1$) it is easy to deduce that $f(n)=\frac{\sigma(n)}{n^2}$ is a <strong>multiplicative function bounded in magnitude</strong> by $1$. And $f(p)=\frac{p+1}{p^2}$ for prime numbers.</p>
<p>Secondly I can write (1) of Theorem 1 in the cited theorems as $$\sum_{p\leq x} \left( \frac{1}{p}-\frac{(p+1)\cos(t\log p)}{p^3} \right)\geq M,$$
but precisely it is what I need to prove or disprove. </p>
<p>The additional information that I 've is a <strong>Mertens theorem</strong> tell us the known asymptotic $\sum_{p\leq x} \frac{1}{p}=\log\log x+A+O((\log x)^{-1})$ . And the <strong>expansion series for the cosine function</strong>. </p>
<p>My previous <strong>Question</strong> is: can you prove or disprove that there is a constant $M>0$ such that satisfies the hypothesis of <strong>Halaszβs inequality</strong>
$$\sum_{p\leq x} \left( \frac{1}{p}-\frac{(p+1)\cos(t\log p)}{p^3} \right)\geq M?$$</p>
<p>I would like to know this example to understand better the dependence of $x$ on $T$ (see <strong>Theorem 2</strong>) and such $M$. If after you answer my question you want state the deduction of such theorem you are welcome.</p>
| 0non-cybersec
| Stackexchange | 654 | 1,924 |
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 |
[C++] "Blank_Program has stopped working". I posted here a bit ago, with some errors in my program. Now those errors are fixed and the program can compile.
I am writing this in CodeBlocks, and the "fire_data.txt" is stored on my PC, so if you get the message "Error opening data file" that is why, and that is not the problem I'm having.
Right when I run the program, no errors show up but immediately the error message shows up saying "Blank_Program has stopped working".
ANY and ALL help would be greatly appreciated, I DO NOT EXPECT YOU TO FINISH THIS FOR ME!
[Source Code](http://ideone.com/0jpfuv)
Thanks in advance! | 0non-cybersec
| Reddit | 167 | 626 |
TIFU by grabbing extra strength gold bond foot powder not the intended baby powder. (maybe nsfw). I woke up really tired about an hr ago, everyone in my house is sick and we just finished moving. Add to that I'm back at work and I'm in zombie mode. so this morning I have a nice hot shower to wake me up. Now I should mention I work in a hot kitchen all day and chaff easily, so every morning I apply baby powder to my sweaty areas I can't wipe the sweat away from while working with food.
I was so tired this morning I didn't notice I grabbed the extra strength gold bond foot powder and used a big handful all over my special places.. even after a shower it feels like a cigar was put out on my hole and my balls are on fire to the point I'm almost in tears.
tldr thingy: used gold bond Xtra strength on my junk and want to cry. | 0non-cybersec
| Reddit | 201 | 834 |
What iptables rules are needed to allow an nfs share on 16.04?. <p>Can anyone provide the exact wording/coding I would have to add to my /etc/iptables/rules.v4 file ? The server I am working on has many complicated firewall rules, and I have determined it is for sure the iptables preventing the nfs mount as I can mount if the iptables are down. My NFS version is 4. As I understand ports 111 and 2049 need to allow traffic, but I feel I am not typing the rules correctly. The share is over a private network. The NFS share's IP is 172.16.10.25, and the private IP of the 16.04 server is 172.16.10.20. </p>
<p>NOTE: There are several filters in place so any advice on where exactly to place the rules is much appreciated. </p>
<p>I have tried these two seperate answers found on the net will no joy.</p>
<pre><code># Portmap ports
-A INPUT -m state βstate NEW -p tcp βdport 111 -j ACCEPT
-A INPUT -m state βstate NEW -p udp βdport 111 -j ACCEPT
# NFS daemon ports
-A INPUT -m state βstate NEW -p tcp βdport 2049 -j ACCEPT
-A INPUT -m state βstate NEW -p udp βdport 2049 -j ACCEPT
</code></pre>
<p>The other is</p>
<pre><code> iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -A INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p udp -m multiport --sports 10053,111,2049,32769,875,892 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p tcp -m multiport --sports 10053,111,2049,32803,875,892 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p udp -m multiport --dports 10053,111,2049,32769,875,892 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p tcp -m multiport --dports 10053,111,2049,32803,875,892 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -I INPUT -i lo -d 127.0.0.1 -j ACCEPT
iptables -I OUTPUT -o lo -s 127.0.0.1 -j ACCEPT
iptables -L -n --line-numbers
</code></pre>
<p>Using my own IP instead of what is in the above example. </p>
| 0non-cybersec
| Stackexchange | 755 | 2,060 |
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 |
Simple Lie Algebra + $Z(G) = \{1\}$ $\Rightarrow$ Simple Lie Group.. <p>Let <span class="math-container">$G$</span> be a connected Lie Group (<span class="math-container">$\mathrm{dim}G>1$</span>) such that <span class="math-container">$Z(G) = \{1\}$</span> (center of <span class="math-container">$G$</span>) and <span class="math-container">$\mathrm{Lie}(G) = \mathfrak g$</span> is a simple Lie Algebra. How do I prove that these conditions imply <span class="math-container">$G$</span> simple (as a group)?</p>
<p>Can anyone help me?</p>
<hr>
<h2>Some Ideas</h2>
<p>If <span class="math-container">$H< G$</span> is a normal group of <span class="math-container">$G$</span>, then <span class="math-container">$\overline{H}$</span> is a Lie Group (since <span class="math-container">$\overline{H}$</span> is closed), then <span class="math-container">$\mathrm{Lie}\left(\overline{H}\right)$</span> is a ideal of <span class="math-container">$\mathfrak{g}$</span>, implying <span class="math-container">$\mathrm{Lie}\left(\overline{H}\right) = \{0\}$</span> or <span class="math-container">$\mathrm{Lie}\left(\overline{H}\right) = \mathfrak{g}$</span>, if <span class="math-container">$\mathrm{Lie}\left(\overline{H}\right) = \{0\}$</span> then <span class="math-container">$H$</span> is discrete normal set <span class="math-container">$\Rightarrow$</span> <span class="math-container">$H\subset Z(G) = \{1\}$</span>. On the other hand, if <span class="math-container">$\mathrm{Lie}\left(\overline{H}\right) = \mathfrak{g}$</span>, <span class="math-container">$H$</span> is dense in <span class="math-container">$G$</span>, and I don't know how to proceed.</p>
<p>Moreover, since <span class="math-container">$\mathfrak{g}$</span> is simple <span class="math-container">$\mathfrak g' = [\mathfrak g,\mathfrak g] =g$</span>, which implies <span class="math-container">$G' = [G,G] = G$</span>, then </p>
<p><span class="math-container">\begin{align*}
\det \mathrm{Ad}(g) &= \det \mathrm{Ad}([g_1,h_1]\cdot \ldots \cdot[g_k,n_k])\\
&=[\det(\mathrm{Ad}(g_1),\det\mathrm{Ad}(h_1)]\cdot \ldots\cdot[\det(\mathrm{Ad}(g_k),\det \mathrm{Ad}(h_k)]\\
&= 1\cdot\ldots\cdot 1 = 1,
\end{align*}</span>
then <span class="math-container">$\det \mathrm{Ad}(g)=1$</span>, <span class="math-container">$\forall$</span> <span class="math-container">$g\in G$</span>.</p>
<p>Note
<span class="math-container">$$\rho : G\to SL(n,\mathbb{R}) $$</span>
<span class="math-container">$$g\mapsto \mathrm{Ad}(g) $$</span>
is a homomorphism such that <span class="math-container">$\mathrm{Ker}(\mathrm{Ad})= Z(G)={1}$</span>. Then <span class="math-container">$\rho$</span> is a embedding in of <span class="math-container">$G$</span> in <span class="math-container">$SL(n,\mathbb{R})$</span>, however I do not know, again, how to proceed.</p>
<p>Finally, if <span class="math-container">$G$</span> is simply connected then <span class="math-container">$H$</span> normal and connected <span class="math-container">$\Rightarrow$</span> <span class="math-container">$H$</span> closed <span class="math-container">$\Rightarrow$</span> <span class="math-container">$H$</span> is lie group <span class="math-container">$\Rightarrow$</span> <span class="math-container">$\mathrm{Lie}(H)$</span> is a ideal of <span class="math-container">$\mathfrak{g}$</span>, then <span class="math-container">$H=\{1\}$</span> or <span class="math-container">$H = G$</span> (using the same argument of the beginning). If <span class="math-container">$G$</span> is not simply connected I don't know what to do.</p>
| 0non-cybersec
| Stackexchange | 1,220 | 3,596 |
Decidable properties of the Cayley complex of a presentation. <p>Let $X= X(P)$ be the Cayley complex of a finite group presentation $P=<S | R>$. Are there geometric properties of $X$ that are known to be decidable by an algorithm that takes $P$ as input? For example, being a tree is trivially decidable. I think I can prove that being planar is also decidable. </p>
<p>The question makes more sense for properties that depend on the choice of $P$ and not only on the group, so that e.g. the Adjan-Rabin theorem cannot be applied.</p>
| 0non-cybersec
| Stackexchange | 149 | 542 |
Strange underlines in font-awesome CSS. <p>When I hover on font-awesome's icons (when they're stacked together) like below (see picture). I get these strange underlines. Any idea where they could come from?<img src="https://i.stack.imgur.com/T1wgA.png" alt="enter image description here"></p>
<p>Source:</p>
<pre><code><div class="text-center">
<!-- FB -->
<a href="http://www.facebook.com/share.php?u=${shareURL}" target="_blank" style="color : #555">
<i id="facebook" class="fa-3x fa fa-facebook-square"></i>
</a>
<!-- Twitter -->
<a href="http://twitter.com/?status=Sign-Up+for+SolidTranslate+here!:+${shareURL}+@SolidTranslate" target="_blank" style="color : #555">
<i id="twitter" class="fa-3x fa fa-twitter-square"></i>
</a>
<!-- LinkedIn -->
<a href="http://www.linkedin.com/shareArticle?url=${shareURL}&title=Sign-Up%20for%20SolidTranslate%20here:%20${shareURL}&summary=To%20get%20started%20translating%20SolidWorks%20files%20register%2\
0here:%20${shareURL}&source=${shareURL}"
target="_blank" style="color : #555">
<i id="linkedin" class="fa-3x fa fa-linkedin-square"></i>
</a>
<!-- Google+ -->
<a href="https://plus.google.com/share?url=${shareURL}" target="_blank" style="color : #555">
<i id="googleplus" class="fa-3x fa fa-google-plus-square"></i>
</a>
</div>
</code></pre>
| 0non-cybersec
| Stackexchange | 580 | 1,482 |
Finding the prime number $n$: why checking for a divisor between 2 and $\lfloor \frac{n}{2} \rfloor$ is enough?. <p>Let's say I want to check whether 33 (say $n$) is a prime number or not. Instead of checking whether 33 is divisible by a number between 2 and 31 or not, it is sufficient enough to verify that 33 is divisible by a number between 2 and 15 ($\lfloor \frac{31}{2} \rfloor$). I wrote a program, and it worked fine. Why half the size of the number is sufficient enough? How can you make sure that the divisor does not lie between $\frac{n}{2}$ and $n - 1$.</p>
| 0non-cybersec
| Stackexchange | 154 | 572 |
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 |
Titlesec & titles extending into margin. <p>I would like to use <code>titlesec</code> to have gradient shaded section titles that extend into the left margin. I would like the section number and the gradient to extend into the left margin, but <strong>would like the section title text to be aligned with the document text</strong>.</p>
<pre><code>\documentclass{article}
\usepackage{tikz}
\usepackage[nobottomtitles*]{titlesec}
\usepackage{blindtext}
\titleformat{\section}[block]%
{\Large\bfseries
\tikz[overlay] \shade[left color=black!20,right color=white] (0,-1ex) rectangle (\textwidth,1em);}%
{\thesection}%
{3em}% <---- what do I need here???
{}
\titlespacing*{\section}{-5em}{*1}{*1}
\begin{document}
\section{Here is my section title}
\blindtext
\end{document}
</code></pre>
<p>It seems as though I would need something like <code>5em-<sep>-<labelwidth></code> but I don't know how to accomplish that. I would like the result to work regardless of the font or font size used.</p>
<p>Question: How can I, in a font independent way, have the section title text aligned with the text of the document body?</p>
| 0non-cybersec
| Stackexchange | 358 | 1,200 |
Pull and addtoset at the same time with mongo. <p>I have a collection which elements can be simplified to this:</p>
<p><code>{tags : [1, 5, 8]}</code></p>
<p>where there would be at least one element in array and all of them should be different. I want to substitute one tag for another and I thought that there would not be a problem. So I came up with the following query:</p>
<pre><code>db.colll.update({
tags : 1
},{
$pull: { tags: 1 },
$addToSet: { tags: 2 }
}, {
multi: true
})
</code></pre>
<p>Cool, so it will find all elements which has a tag that I do not need (1), remove it and add another (2) if it is not there already. The problem is that I get an error: </p>
<blockquote>
<p>"Cannot update 'tags' and 'tags' at the same time"</p>
</blockquote>
<p>Which basically means that I can not do pull and addtoset at the same time. Is there any other way I can do this? </p>
<p>Of course I can memorize all the IDs of the elements and then remove tag and add in separate queries, but this does not sound nice.</p>
| 0non-cybersec
| Stackexchange | 324 | 1,038 |
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 |
Execute shell script in Gradle. <p>I have a gradle build setup at the beginning of which I want to execute a shellscript in a subdirectory that prepares my environment. </p>
<pre><code>task build << {
}
task preBuild << {
println 'do prebuild stuff:'
}
task myPrebuildTask(type: Exec) {
workingDir "$projectDir/mySubDir"
commandLine './myScript.sh'
}
build.dependsOn preBuild
preBuild.dependsOn myPrebuildTask
</code></pre>
<p>However, when I execute the task either by calling <code>gradle myPrebuildTask</code> or by simply building the project, the following error occurs:</p>
<pre><code>> A problem occurred starting process 'command './myScript.sh''
</code></pre>
<p>Unfortunately, thats all I get. <br/>
I have also tried the following - same error.</p>
<pre><code>commandLine 'sh mySubDir/myScript.sh'
</code></pre>
<p>I use Gradle 1.10 (needed by Android) on Windows, inside a Cygwin shell. Any ideas?</p>
| 0non-cybersec
| Stackexchange | 299 | 948 |
Our family is not like the others.. We are the Windsors. Our family is not like the others. We are rich and reserved. Our family is wealthy enough that money will never be a problem for us. We have come to know no neighbors nor friends. There is only us and the cooks and the butlers and the cleaners of our manor. We have pride. Our name is not one that is said in mockery. All who know about us look up and never down. They know about our grandeur and our prestige. They know about our expensive cars and our well-kept gardens. They know about our lineage. We are the Windsors. Our needs are more important than anyone elseβs. Nothing must compromise the assurance of our survival. Whatever must be done will be done to ensure this. We value our reputation. No disgrace of any kind must befall the untarnished Windsor name. It is our honor. It is who we are.
My name is Claire Windsor. I own 3,426 books. This is only a quarter of the Windsor library. I have read through half of them. Today I am reading *Jude the Obscure*. I have been reading through Thomas Hardyβs books and this is the last one. Tomorrow I will go to the library and pick another book to read. There is not a lot of things I do every day. I wake up at dawn. In the mornings, I sit in my room to read. I read through chapter until chapter until the last page of every book. I am a good reader. As good a reader as Edward is a painter. Edward is the eldest. His room houses a mountain of blank canvasses and an outburst of palettes. He hardly ever shows me any of his paintings but I have seen enough to know that he is an extraordinary artist.
Our family is reserved. Edward chose painting as his outlet. The emotion that you should be seeing in his face was delineated through brushstrokes and the smell of paint. In his paintings, he is most human. We are like sponges, my brother and I. Edward gushes out art whenever he is squeezed and wrung hard enough. I soak in art in the form of stories and conversations from the penned words of ingenious authors. My brother only painted in the evenings because that is when the manor is most silent. He took his inventiveness after mother. Mother adored all forms of art. She had seen all the best operas and had bought the most expensive antique amphorae. She taught Edward how to appreciate art as she does. She told him about the paintings and the poetry. She told him that there is genius in everyone and that Edwardβs was art.
My father owns all the books in the library. He is the reason why I read as much as I do. As a child, I have seen him carry a different book each day. As he said goodnight one evening, my younger self had caught the title of the book in his hands. *The Stranger* was written across the cover of the book. That night, I had wondered who the stranger was and why he had a book written about him. He must be important. I had twisted and turned in my bed while unable to stop wondering who the stranger might be. Was he an irrelevant servant? A killer, perhaps? I must know. Younger me ran to the library to retrieve the book the minute she woke up. I knew that father had finished the book before I fell asleep and should be reading through a different one by morning. With the book in hand, I had run back to my room and started reading. I read *The Stranger* for ten days as a young girl. Today I would be finished with the book before dinner. I will have finished the book before the brush in Edwardβs hand makes contact with the canvass to paint a new piece. This is what we do best, my brother and I. This will not tarnish the Windsor name.
Someone is knocking at my door. I know it is mother because no one ever knocks at my door except she. My mother comes in and tells me that dinner is ready. She wearing a long, intricate dress that is the color of mud. I stand up to follow her outside. While we are climbing down the grand staircase, my mother says that Edward will not be joining us today. He started painting before mother could knock at his door. I nod my acknowledgement and we continue walking to the dining hall in silence. When we reach the table, my senses are overcome by the divine smell of stew. We have the finest cooks. I am used to being served with marvelous dishes that most people do not get to eat. I am most grateful for this.
I take my seat beside father and watch him closely. My father is a quiet man. He does not believe in small talk. He is kind but he does not seem like it. He greets me good morning every day and bids me goodnight before I go to sleep. I have never seen him angry. He rarely smiles, but most of the ones I have seen are directed toward me. I know that I am his favorite. He is pleased that I appreciate his books but he does not tell me. This does not bother me. It only makes me wonder how he was as a young man. Had he always been this quiet? I ponder this thought while I chew tender meat from the stew.
We do not talk while dining. We are content with the silence for it does not demand the need for supplying words which have no meaning and are merely said to remark. When we are done eating, I say goodnight to my father and my mother follows me up to my room. There, I sit facing the mirror as she braids my hair. When she is done, she places her hand on my shoulder as a way of saying goodnight. Then, she turns toward the door and leaves the room. I move over to the bed and sleep soundlessly through the night.
When I wake up next morning, I walk to the library to find another book by a different author. I pass the grand staircase and stop in my footsteps as I hear motherβs uncharacteristically shrill voice. I see her at the bottom of the staircase overlooking the tall double doors that lead outside the manor.
ββ¦fail to keep this hushed and we will be at your doorstep faster than you canββ motherβs sentence is cut short when she realizes that I am awake and witnessing what was happening. I see one of the cooks shy away from mother. She glances up at me in alarm and pauses in her stance before scurrying out through the doors. I wonder why mother is being so secretive. Everyone in this family knows, and everyone acts like they do not.
That evening, mother calls for dinner again and this time, on the table is an exquisite display of roast, steak, and meat cut in all sorts of delectable ways. Edward is joining us for dinner today. I eat slowly and savor the taste of the food. Eating is the only thing I remember when I finally go to bed. That night, I dream of a memory. I see myself as a child bent over the sink of one of the gloriously white bathrooms in the manor. I am vomiting out steak and roast and meat cut in all sorts of delectable ways. My family and I had gone out eat in celebration of a good turn in fatherβs business meeting. I had been immensely excited because it was my first time eating dinner outside. In my dream, I raise my head and see my mother looking down at me with tear-stricken eyes. My mother never cried.
In the morning, I wake up to the sunlight seeping in through a gap in the curtains. I pull them together to keep the sunlight out. There is a peculiar feeling that is heavy at the pit of my stomach. I try to ignore it but it does not go away. I cannot shake the thought that something is horribly wrong. I spend my day walking around the manor, searching for things that are out of place or anything that does not belong where it should. I find nothing. Mother and father are in the living room and Edward is in his room. The Windsor library is as I had left it. All the books are placed in towering bookshelves that extend toward the ceiling. I walk to the kitchens and see the cooks preparing dinner. I notice that one of the cooks is missing but pay no attention to it. I know that she was dismissed yesterday. I go back to my room and spend the rest of the day reading.
When evening comes, I do not wait for mother to call me to dinner. I walk down the staircase and when I am halfway through, my feet are glued to the wooden steps. I cannot move. I am about to question why when I hear a bang and the doors burst open. Through the doors, men in uniform carrying guns are entering the manor. They force their way in while my mother tries to keep the chaos to a bare minimum. All around us, men are standing with their dirty shoes bringing unsightly mud onto the polished floor.
I have always looked up to soldiers and policemen and people who fight for their country. I respect them as I know how good their intentions are and that they will not do anything unjust. But I do not like how these men grabbed my mother by the arm and pointed their guns at us. It is disrespectful. They are fools. Do they not know who my father is? I turn to him blankly. His face is devoid of emotion, there is nothing I can read out of it. I do not understand what is happening. My father does not move to get them out of our house. They are trying to take us. I try to pull my hand free out of their grasps but stop as I realize that father still hadn't moved. Why isn't he doing anything? Do we deserve to be taken? Maybe so. I look at Edward and I see him trying to resist. My eyes follow mother and I see her losing her composure. We must do something. I am sure we must. Is there nothing we can do?
βSir, we have received information that you are involved in illegal acts that amount to a number of disregarded lawsββ *We are the Windsors. Our family is not like the others. We are rich and reserved. Our family is wealthy enough that money will never be a problem for us. We have come to know no neighbors nor friends. There is only us and the cooks and the butlers and the cleaners of our manor.* ββ βit is by order that we inform you now of our knowledge that it is on your account that people are being kidnapped and killedββ *We have pride. Our name is not one that is said in mockery. All who know about us look up and never down. They know about our grandeur and our prestige. They know about our expensive cars and our well-kept gardens. They know about our lineage.* Β ββ βyou and your family are under arrest for kidnapping and murder. Charges against you also include unauthorized harvesting of these peopleβs organs and the inhumane consumption of human fleshβ ββ *We are the Windsors. Our needs are more important than anyone elseβs. Nothing must compromise the assurance of our survival. Whatever must be done will be done to ensure this.* ββ βwe are also ordered to inform you that your family has no place in prison. You are to be detained in Lexington Mental Institution outside of the country till due time that all the charges against you has been put to court. With these offenses, sir, your whole family is facing the death penalty.β *We value our reputation. No disgrace of any kind must befall the untarnished Windsor name. It is our honor. It is who we are.*
I look at mother until she meets my eyes. She is apologizing, I know because her lips are pursed and there is a crease on her forehead. There is nothing to apologize for. Mother and Father did this for us. I am certain that Edward knew well before I was born. He knew that our family is not as perfect as it seemed. They had hoped that I would not turn out the way they were. But hope had failed them. Hope had failed us. The face of my father has turned to stone. I have never seen my mother look so desperate, so helpless. My brother had stopped trying to resist, he is staring hard at the wooden floor. I am frozen at the staircase, looking at the high double doors that led outside the manor. Looking at the wreckage that is our blood and our flesh and our legacy. We are the Windsors. Our family is not like the others. | 0non-cybersec
| Reddit | 2,694 | 11,676 |
simple inequality. <p>I want to show that this inequality holds for $0<p,q<1$.</p>
<blockquote>
<p>$ q^{-p}(1-q)^{p-1} \geq (1-p)^{p-1}p^{-p} $</p>
</blockquote>
<p>I have tried to divide it into 3 cases:</p>
<ol>
<li>$0<p<q<1$ </li>
<li>$0<q<p$</li>
<li>$p=q$ (obvious)</li>
</ol>
<p>But it doesn't seem to work! </p>
| 0non-cybersec
| Stackexchange | 176 | 347 |
Search for an element by case insensitive attribute with xdocument. <p>I have this code for parsing some xml which is working well:</p>
<pre><code>string text = File.ReadAllText("myfile.xml");
XDocument doc = XDocument.Parse(text); //or XDocument.Load(path)
// LINQ to XML query
XElement alternateSpkgRootElement =
(from el in doc.Descendants()
where (string)el.Attribute("name") == "myname" || (string)el.Attribute("Name") == "myname"
select el).FirstOrDefault();
</code></pre>
<p>The problem is my XML can have attributes with capital letters at the start, e.g. instead of <code>el.Attribute("name")</code> it could be <code>el.Attribute("Name")</code>.</p>
<p>Is there a nice way to search for these without doing:</p>
<pre><code>where (string)el.Attribute("name") == "myname" || (string)el.Attribute("Name") == "myname"
</code></pre>
<p><strong>Edit</strong></p>
<p>Here is some sample XML to show why previously suggested questions do not answer my problem:</p>
<pre><code><testenv version="1" edition="1" testArchitecture="amd64" xmlns:x="1">
<x:Copy File="../s34tenv" Ref="22" x:Id="W34CG">
<x:Set Select="//testlistSearchPath" Name="path" Value="\\s3464\TestMD" />
<x:Append>
<chunkRequirement name="BV34n" flavor="amd64fre" />
<chunkRequirement name="TES34INS" flavor="amd64fre" />
<param name="InvestigationMappingsFilePath" value="\\red34CG.xml" />
<param name="Rerun\Enabled" value="True" />
<param name="_AlternateSpkgRoot" value="\\34MD\AEAuto" />
<param name="_DeleteETWLogs" value="0" />
<param name="MinLoadBalanceFactor" value="6" />
<param name="MaxLoadBalanceFactor" value="12" />
<param name="Rerun\Attempts" value="1" />
</x:Append>
</x:Copy>
<x:Copy File="../34es.xml" Ref="DES34iles" />
</testenv>
</code></pre>
| 0non-cybersec
| Stackexchange | 696 | 1,933 |
How to compute the power of an ideal of an order in the imaginary quadratic field?. <p>I want to compute the power of an ideal by hand and I am clueless on how to do so.</p>
<p>Let $\mathfrak{a}$ be an ideal of an order with discriminant $\Delta$ in the imaginary quadratic field such that $\mathfrak{a} = \left[a\mathbb{Z} + \frac{b+\sqrt{\Delta}}{2}\mathbb{Z}\right]$ and $\mathfrak{a} = (a,b)$ in standard representation.</p>
<p>Let $\mathfrak{b} = \left(\frac{p+1}{4},1\right) = \left[\frac{p+1}{4}\mathbb{Z} + \frac{1+\sqrt{\Delta}}{2}\mathbb{Z}\right]$. I want to calculate $\mathfrak{b}^p$. Here $p\equiv 3 \pmod 4$ and $\Delta = p^4\Delta_K$ where $\Delta_K = -p$. I do not have any work to show because I don't know how to compute this by hand.</p>
<p>On Sage, I have, $\mathfrak{b}^p = \left[\frac{p+1}{4}\mathbb{Z} + \frac{1+\sqrt{\Delta}}{2}\mathbb{Z}\right]^p = (p^2,-p)$. I need to show this on paper for a proof so I want to know how does one go about doing this by hand. </p>
| 0non-cybersec
| Stackexchange | 343 | 995 |
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 am Zach Phelps-Roper. I am a former member of the Westboro Baptist Church. Ask me anything!. I grew up in the Westboro Baptist Church all my life, before leaving in February of this year.
Proof: http://i.imgur.com/bNd42lU.jpg
EDIT: A lot of you guys want to know if it's true that the objective of the church is to piss people off to the point of violence, sue, and gain profit. the answer is no. :)
edit 2: the most common question I receive is about my current beliefs. I still believe in God, but I believe God loves everyone. :) I attend a Unitarian Universalist church.
edit 3: I encourage EVERYONE to treat the members of the WBC with LOVE! That will make a difference. Saying "fuck you" can easily be forgotten and it doesn't change their beliefs but only makes them feel validated. However, to help you get it out of your system, here is a video of an old woman screaming "GO FUCK YOURSELF" at a WBC member:
http://youtu.be/i0OZ1k77V6c?t=47s
However, I also want you to understand that my family are human beings. This is a GREAT short video (under 20 minutes) made for a college class that really makes you understand them. :)
https://www.youtube.com/watch?v=R9kXanMbLXw
edit:I am also interested in doing media. So, if you send me a message saying who you are and what you represent, I'll seriously consider it. :)
| 0non-cybersec
| Reddit | 366 | 1,338 |
Check out r/BadReads for the worst book reviews!. Hello and salutations, fellow connoisseurs of bad reviews!
I just wanted to take the time to plug my new subreddit r/BadReads, where we aim to collect the nastiest literary hot-takes from Goodreads, Amazon, and beyond. Featuring:
* A white guy who is literally [insulted](https://www.reddit.com/r/BadReads/comments/g2e2gd/white_guy_literally_insulted_by_toni_morrisons/) by Toni Morrison!
* The genius who discovered that *The Divine Comedy* is [worse](https://www.reddit.com/r/BadReads/comments/gdbaa8/you_heard_it_here_first_the_divine_comedy_is/) than *Twilight.*
* The scholar who determined that *Ulysses* is [garbage](https://www.reddit.com/r/BadReads/comments/gcskrc/i_only_read_a_few_pages_but_this_deserves_1_star/) after only a few pages.
* The reviewer who finally realized *The Old Man and the Sea* is actually written for [mermaids](https://www.reddit.com/r/BadReads/comments/g2fu7x/recommended_for_mermaids/)!
* A man unafraid to speak the truth: the Diary of Anne Frank is [absolute debauchery](https://www.reddit.com/r/BadReads/comments/g4sa8y/the_diary_of_anne_frank_absolute_debauchery/)!
* And so many more!
Come check it out if you're interested. | 0non-cybersec
| Reddit | 417 | 1,219 |
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 |
Algorithms: Using maximum flow to calculate correct matrix values. <p>I am given an matrix A with size N x M with <code>N,M <= 100</code>. Matrix A consists of integer values A(i,j) where i and j are <code>0 < i < M</code> and <code>0 < j < N</code>. I am also given the "correct" column sums and row sums of the matrix. The given values A(i,j) are "incorrect" (they do not match the "correct" sums) and therefore we are provided with corresponding "incorrectness" values B(i,j), where B(i,j) ranges from 0 to A(i,j).</p>
<p>The goal is to calculate the "correct" values C(i,j) in the matrix, where <code>A(i,j) - C(i,j) =< B(i,j)</code>, the C(i,j) values must also match the given row and column sums. I think I have to use maximum flow, but my attempts have not worked. How can I achieve this?</p>
| 0non-cybersec
| Stackexchange | 273 | 822 |
Can dart produce readable javascript libraries?. <h1>Goal</h1>
<p>I would like to write a javascript library (framework), but need OOP and mixins.</p>
<p>Was giving a go to typescript, but it doesn't support mixins (the handbook says it does, but the compiler/specifications has nothing that is mixin related).</p>
<h1>Typescript</h1>
<p>In typescript, the following code:</p>
<pre><code>class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
</code></pre>
<p>Compiles to:</p>
<pre><code>var Greeter = (function () {
function Greeter(message) {
this.greeting = message;
}
Greeter.prototype.greet = function () {
return "Hello, " + this.greeting;
};
return Greeter;
})();
</code></pre>
<p>Then clients can simply call:</p>
<pre><code>var greeter = new Greeter("world");
</code></pre>
<h1>Dart</h1>
<p>Can dart do something similar? Can someone show how?</p>
<p>The main goal is that the produced javascript code is readable, preferably with all the dart extras residing in a different script.</p>
<p>I've seen <a href="https://stackoverflow.com/questions/23723500">this question</a> and <a href="https://stackoverflow.com/a/15669488/1179377">this answer</a>, but neither seem to yield a readable JS file, like in the typescript example above.</p>
| 0non-cybersec
| Stackexchange | 458 | 1,416 |
How to randomly construct a square full-ranked matrix with low determinant?. <p>How to randomly construct a square (1000*1000) full-ranked matrix with low determinant?</p>
<p>I have tried the following method, but it failed.</p>
<p>In MATLAB, I just use:</p>
<p>n=100;</p>
<p>A=randi([0 1], n, n);</p>
<p>while rank(A)~=n</p>
<p>A=randi([0 1], n, n);</p>
<p>end</p>
<p>The above code generates a random binary matrix, with the hope that the corresponding determinant can be small.</p>
<p>However, the determinant is usually about 10^49, a huge number.</p>
<p>Not to mention when n>200, the determinant is usually overflowed in MATLAB.</p>
<p>Could anyone have comments how I can generate matrix (could be non-binary) with very low determinant (e.g. <10^3)?</p>
| 0non-cybersec
| Stackexchange | 266 | 775 |
Add multiple IPs for one host into /etc/hosts with puppet. <p>I manage my hosts with puppet. Hosts run dual stack IPv4 and IPv6. I want to add both addresses to /etc/hosts. When I would add it by hand my /etc/hosts file would look like this:</p>
<pre><code>192.0.2.1 hostname.example.com hostname
2001:db8::1 hostname.example.com hostname
</code></pre>
<p>I try to do this with puppet while still being able to add hosts to /etc/hosts by hand.</p>
<p>My first try was the following manifest: </p>
<pre><code>host {
"hostname.example.com":
ip => '192.0.2.1',
host_alias => ["hostname"],
;
"hostname-v6.example.com":
ip => '2001:db8::1',
host_alias => ["hostname","hostname.example.com"],
;
}
</code></pre>
<p>This will result in the following /etc/hosts file:</p>
<pre><code>192.0.2.1 hostname.example.com hostname
2001:db8::1 hostname-v6.example.com hostname.example.com hostname
</code></pre>
<p>This will work but introduce a unneeded second hostname that some applications (e.g. pythons getfqdn()) will return as default hostname.</p>
<p>When I try to decouple the resource name and the hostname in /etc/hosts like this:</p>
<pre><code>host {
"ip4-host":
name => "hostname.example.com",
ip => '192.0.2.1',
host_aliases => ["hostname"],
alias => 'ipv4-hostname',
;
"ip6-host":
name => "hostname.example.com",
ip => '2001:db8::1',
host_aliases => ["hostname"],
alias => 'ipv6-hostname',
;
}
</code></pre>
<p>I will get the following error:</p>
<pre><code>Cannot alias Host[ipv6-host] to ["hostname.example.com"] at (file: /etc/puppetlabs/code/environments/production/site/mymodule/manifests/init.pp, line: 23); resource ["Host", "hostname.example.com"] already declared (file: /etc/puppetlabs/code/environments/production/site/mymodule/manifests/init.pp, line: 19) (file: /etc/puppetlabs/code/environments/production/site/mymodule/manifests/init.pp, line: 23, column: 9) on node hostname.example.com
</code></pre>
<p>where Line 19 ist the first host resource and 23 the second.</p>
<p>Currently I write my /etc/hosts with a template but this way I loose the ability to add entries by hand.</p>
<p>Do you have any other idea?</p>
| 0non-cybersec
| Stackexchange | 813 | 2,324 |
MVC 3 - Razor - Print value from model. <p>I am trying to set the value of a label using Razor, I have a model and </p>
<pre><code><label id="status">
@{
if (Model.Count() > 0)
{
Model.First().StatusName.ToString();
}
}
</label>
</code></pre>
<p>If I put a breakpoint on Model.First().StatusName.ToString(); I can see that that expression has the value that I need, but I cannot see it when the page gets rendered -
Am I missing something in my syntax ?</p>
<p>Thank you</p>
| 0non-cybersec
| Stackexchange | 173 | 564 |
Why is Safariβs default font tracking/letter-spacing different than other browsers?. <p>Iβm experiencing an issue with Safari where a block of text using webfonts (not sure webfonts are the issue) is wrapping differently in Safari than it is in any other browser. In this particular instance, weβre designing these blocks to <em>look</em> like theyβre set to <code>text-align: justify;</code> but theyβre actually set to <code>text-align: left;</code>. <code>text-align: justify;</code> is undesired in this setting as it does a poor job of calculating the space between words.</p>
<p><strong>Important things to know:</strong></p>
<ul>
<li>As I mentioned, the layout uses webfonts. It doesnβt matter which webfonts (Iβve reviewed hundreds and it happens for all).</li>
<li>The entire page, including padding and font-size, uses viewport width (vw). The idea here is that the block of text scales equally for all browser sizes and retains itβs layout, including rags.
<br /><br /></li>
</ul>
<p><strong>A visual aid:</strong></p>
<p><a href="https://i.stack.imgur.com/6ZubT.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6ZubT.gif" alt="enter image description here"></a></p>
<p><br />
<strong>Details about the layout and dimensions:</strong></p>
<ul>
<li>Frame 1: Safari desktop.</li>
<li>Frame 2: Chrome desktop.</li>
<li>Frame 3: Chrome at 50% opacity over Safari.</li>
<li>Window width in this screenshot is <code>1220px</code>.</li>
<li>Left/right padding is <code>padding: 0 calc(129 / 1220 * 100vw);</code> which computes to <code>129px</code>.</li>
<li>That leaves the available content space of <code>962px</code>.</li>
<li><code>letter-spacing</code> is set to 0 by default for all content.</li>
</ul>
<p>So, anyone have any idea why Safari seems to have exaggerated tracking/letter-spacing?</p>
<hr>
<p><br />
<strong>EDIT</strong></p>
<p>We just launched the site in question, so you can see the issue in action here: <a href="https://www.typography.com/fonts/hoefler-text/overview" rel="nofollow noreferrer">https://www.typography.com/fonts/hoefler-text/overview</a></p>
| 0non-cybersec
| Stackexchange | 667 | 2,115 |
Mongoengine is very slow on large documents compared to native pymongo usage. <p>I have the following mongoengine model:</p>
<pre><code>class MyModel(Document):
date = DateTimeField(required = True)
data_dict_1 = DictField(required = False)
data_dict_2 = DictField(required = True)
</code></pre>
<p>In some cases the document in the DB can be very large (around 5-10MB), and the data_dict fields contain complex nested documents (dict of lists of dicts, etc...).</p>
<p>I have encountered two (possibly related) issues:</p>
<ol>
<li>When I run native pymongo find_one() query, it returns within a second. When I run MyModel.objects.first() it takes 5-10 seconds.</li>
<li><p>When I query a single large document from the DB, and then access its field, it takes 10-20 seconds just to do the following:</p>
<pre><code>m = MyModel.objects.first()
val = m.data_dict_1.get(some_key)
</code></pre></li>
</ol>
<p>The data in the object does not contain any references to any other objects, so it is not an issue of objects dereferencing.<br>
I suspect it is related to some inefficiency of the internal data representation of mongoengine, which affects the document object construction as well as fields access. Is there anything I can do to improve this ?</p>
| 0non-cybersec
| Stackexchange | 369 | 1,279 |
Decomposition of $C[G]$ as $C[G]$-module into direct sum of submodules of the form $Ce_{\chi}$. <p>Let C be the complex field, and <span class="math-container">$G$</span> be a cyclic group generated by <span class="math-container">$a$</span>. The group ring <span class="math-container">$C[G]$</span> is a <span class="math-container">$C[G]$</span>-module (over itself) with the module action <span class="math-container">$C[G]\times C[G] \rightarrow C[G]$</span> the same as the group ring action.</p>
<p>The problem states to give a decomposition of C[G] as a direct sum of simple modules of the form <span class="math-container">$Ce_{\chi_m}$</span> where
<span class="math-container">$$e_{\chi_m}=\frac{1}{n}\sum_{a^k \in\langle a\rangle} \exp\left(2\pi i \frac{m}{n} k\right) a^{-k}$$</span></p>
<p>I am guessing that
<span class="math-container">$$C[G] \cong \bigoplus ^{n-1}_{j=0} Ce_{\chi_j}$$</span></p>
<p>I've showed that <span class="math-container">$Ce_{\chi_m}$</span> is a submodule of rank 1 and that <span class="math-container">$e_{\chi_m}$</span> is idempotent but I'm having some difficulty showing how the <span class="math-container">$e_{\chi_m}$</span>'s are linearly independent.</p>
<p>I am trying to show if they are linearly independent, since if so then it is clear we have the direct sum. Perhaps I should try another method?</p>
<p><strong>edit</strong>: Originally the question was phrased with <span class="math-container">$e_{\chi_m} = \frac{1}{n}\sum_{a^k \in\langle a\rangle} \chi_m(a^k) a^{-k}$</span>, but I found <span class="math-container">$$\chi(a^k) = \exp\left(2\pi i \frac{m}{n} k\right)$$</span> for integers <span class="math-container">$m$</span> to be the only possible morphisms of the form <span class="math-container">$\chi : G \rightarrow C^\times$</span></p>
<p><strong>edit2</strong>: title</p>
| 0non-cybersec
| Stackexchange | 626 | 1,856 |
Do you think we need more female plumbers?. You often hear feminists complaining that there aren't many women in STEM or not enough women doctors. Plumbers make a decent salary.
>The median salary for a plumber was $49,140 in 2012, the BLS reports. The best-paid pulled in about $84,440, while those in the bottom 10 percent earn $29,020 a year. The metropolitan areas that pay particularly well include Nassau, N.Y., San Jose, Calif., and Taunton, Mass.
However, in my existence I don't think I have ever encountered one female plumber. Do you think we need to create more incentive for women to get into plumbing? How will you encourage your daughters that as women they too can be plumbers? | 0non-cybersec
| Reddit | 171 | 697 |
4 tikzpictures in a 2x2 layout. <pre><code> \documentclass{article}
\usepackage{pgfplots}
\usetikzlibrary{fit,shapes,positioning}
\begin{document}
\begin{tikzpicture}[
mydot/.style={ circle, fill, inner sep=2pt }, >=latex,
shorten >= 3pt, shorten <= 3pt,
every fit/.style={ellipse,draw,inner sep=0pt}
]
\node[mydot,label={left:1}] (a1) {};
\node[mydot,below=of a1,label={left:2}] (a2) {};
\node[mydot,below=of a2,label={left:3}] (a3) {};
\node[mydot,below=of a3,label={left:4}] (a4) {};
\node[mydot,right=4cm of a1,label={right:1}] (b1) {};
\node[mydot,below=of b1,label={right:2}] (b2) {};
\node[mydot,below=of b2,label={right:3}] (b3) {};
\node[mydot,below=of b3,label={right:4}] (b4) {};
\node[draw,fit=(a1) (a2) (a3) (a4),minimum width=2cm] {} ;
\node[draw,fit=(b1) (b2) (b3) (b4),minimum width=2cm] {} ;
\path[->] (a1) edge (b2) edge (b1);
\path[->] (a2) edge (b4);
\path[->] (a3) edge (b3);
\path[<-] (a4) edge (b1);
\end{tikzpicture}
\end{document}
</code></pre>
<p>The above MWE generates a mapping diagram.
I am trying to create a 2x2 <code>groupplot</code> of the above function mapping diagram.</p>
<p>I have used the <code>groupplot</code> environment on previous occasions with great success (when using graphs on a Cartesian plane); via the <code>\addplot</code> command.</p>
<p>However, using the Ti<em>k</em>Z commands for the function mapping diagrams, all I can generate are 4 boxes with tick marks around them.</p>
| 0non-cybersec
| Stackexchange | 611 | 1,527 |
ESXi boot process / state storage. <p>I've got a standalone ESXi server and I'm having problems with it losing config on reboot. I restored the config from a previous install and it reverts to that every time it's restarted.</p>
<p>My current hypothesis is that although the state is correctly being backed up to <code>/bootbank/local.tgz</code> on the hour (it's a USB installation and if I understand <code>autobackup.sh</code> correctly, that's expected behaviour), the boot process is reading from <code>/bootbank/state.tgz</code>.</p>
<p>I think this because of the contents of <code>/bootbank/boot.cfg</code> (specifically the <code>modules</code> line) and because the restored config was from a disk installation, rather than USB:</p>
<pre><code>~ # cat /bootbank/boot.cfg
kernel=b.z
kernelopt=
modules=k.z --- s.z --- c.z --- oem.tgz --- license.tgz --- m.z --- state.tgz
build=4.1.0-381591
updated=2
bootstate=0
</code></pre>
<p>Should I swap in <code>local.tgz</code> for <code>state.tgz</code> here (bearing in mind one is an archive and one is an archive of an archive and so need to be treated differently), or is this entry a result of a setting elsewhere I should be targeting instead?</p>
<p>Alternatively, should I just delete this entry from the <code>modules</code> line (to have it go to <code>local.tgz</code> by default because of the USB boot status)? Do I need to adjust <code>/altbootbank/boot.cfg</code> too? I ask these two questions because neither state file is included in the modules line in this file.</p>
<p>Normally, I'd just experiment, but I'm wary of tampering with the boot process in case it stops booting!</p>
<p>The system is a recently patched 4.1 (free version - it's not a production system) on more or less HCL hardware, using DAS for the datastore and a 2GB USB stick for the hypervisor install.</p>
<p><strong>Edit</strong></p>
<p>I've looked through <code>/sbin/backup.sh</code> (which is called from <code>autobackup.sh</code>) and this actually adds <code>--- state.tgz</code> to the <code>modules</code> line in <code>boot.cfg</code> if a) it's not a USB boot and b) it's not already there. This strongly suggests to me that (in my USB boot environment) it's there erroneously and I should just delete it... but I'd still love some confirmation of that from someone more knowledgeable.</p>
<p>Can anyone tell me (or even speculate on) why "embedded" / USB booting systems use <code>local.tgz</code> and "installed" systems use <code>state.tgz</code> (which, AIUI, just contains local.tgz)? Could it be something to do with multiple configs for clusters?</p>
| 0non-cybersec
| Stackexchange | 750 | 2,620 |
Can't connect to openVPN Server (pfsense). <p>i have some problems connecting to openvpn server with pfsense.</p>
<p>For my tests i got 2 network interfaces both on my pfsense openvpn server and my windows 10 openvpn client. </p>
<p>On my pfsense i have 1 network interface on WAN configure with DHCP :
-WAN 192.168.0.28/24
-LAN interface static 192.168.10.10/24</p>
<p>On my Windows 10 client :
-WAN DHCP 192.168.0.30/24
-LAN interface static 192.168.10.15/24</p>
<p>The first time i tryed to use udp but i had "tls key negotiation failed to occur within 60 seconds tls handshake failed" so i tryed to connect with tcp but i got this error : </p>
<p>"tcp connect to af_inet failed unknown error"</p>
<p>My OpenVPN configuration is : </p>
<pre><code>Server mode Remote Access (SSL/TLS + User Auth)
Backend for authentication Local Database
Protocol TCP
Device mode tun
Interface WAN
Local port 1194
Description VPN
TLS authentication Enable authentication of TLS packets
Key ...
Peer Certificate Authority OpenVPN CA
Server certificate ServerCertificate (Server: Yes, CA: OpenVPN CA, In Use)
DH Parameter length 2048
Encryption Algorithm AES-256-CBC(256 bit key, 128 bit block)
Auth digest algorithm SHA1(160-bit)
Hardware Crypto No Hardware Crypto Acceleration
Certificate Depth One(Client+Server)
IPv4 Tunnel Network 192.168.15.0/24
IPv4 Local network 192.168.10.0/24
Concurrent connections 5
Compression No Preference
Dynamic IP Allow connected client to retain their connections if their IP address changes
Address Pool Provide a virtual adapter IP address to clients
DNS Server enable Provide a DNS server list to clients
DNS Server 1 8.8.8.8
Force DNS cache update Run "net stop dnscache" ...
</code></pre>
<p>My Client configuration is : </p>
<pre><code>client
dev tun
proto tcp
remote 192.168.0.28 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca OpenVPN+CA.crt
cert UserCertificate.crt
key UserCertificate.key
cipher AES-256-CBC
verb 5
</code></pre>
<p>I created the certificate authority and the server/user certificate,</p>
<p>Then i added some firewall and NAT rules :
i opened everything on the lan / wan interface and added a nat rule to forward trafic like this : </p>
<p>WAN TCP * * WAN net * 192.168.10.10 1194 </p>
<p>interface - protocol - source addr - source port - dest addr - dest ports - NAT ip - nat ports</p>
<p>I checked firewall on pfsense it's seems like the port 1194 is open </p>
<p>The firewall on my windows client is down too. </p>
<p>I searched for log on the server and client, i think i don't get any logs on the server after the failing login, i just get logs when i start/restart the service</p>
<p>this is my logs on the server : </p>
<pre><code>Apr 7 18:34:54 openvpn 13595 OpenVPN 2.3.14 i386-portbld-freebsd10.3 [SSL (OpenSSL)] [LZO] [MH] [IPv6] built on Feb 15 2017
Apr 7 18:34:54 openvpn 13595 library versions: OpenSSL 1.0.1s-freebsd 1 Mar 2016, LZO 2.09
Apr 7 18:34:54 openvpn 13883 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Apr 7 18:34:54 openvpn 13883 Control Channel Authentication: using '/var/etc/openvpn/server1.tls-auth' as a OpenVPN static key file
Apr 7 18:34:54 openvpn 13883 TUN/TAP device ovpns1 exists previously, keep at program end
Apr 7 18:34:54 openvpn 13883 TUN/TAP device /dev/tun1 opened
Apr 7 18:34:54 openvpn 13883 ioctl(TUNSIFMODE): Device busy: Device busy (errno=16)
Apr 7 18:34:54 openvpn 13883 do_ifconfig, tt->ipv6=1, tt->did_ifconfig_ipv6_setup=0
Apr 7 18:34:54 openvpn 13883 /sbin/ifconfig ovpns1 192.168.15.1 192.168.15.2 mtu 1500 netmask 255.255.255.0 up
Apr 7 18:34:54 openvpn 13883 /usr/local/sbin/ovpn-linkup ovpns1 1500 1559 192.168.15.1 255.255.255.0 init
Apr 7 18:34:54 openvpn 13883 Listening for incoming TCP connection on [AF_INET]192.168.0.25:1194
Apr 7 18:34:54 openvpn 13883 TCPv4_SERVER link local (bound): [AF_INET]192.168.0.25:1194
Apr 7 18:34:54 openvpn 13883 TCPv4_SERVER link remote: [undef]
Apr 7 18:34:54 openvpn 13883 Initialization Sequence Completed
</code></pre>
<p>logs on the client : </p>
<pre><code>Sat Apr 07 20:31:33 2018 OpenVPN 2.4.5 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Mar 1 2018
Sat Apr 07 20:31:33 2018 Windows version 6.2 (Windows 8 or greater) 64bit
Sat Apr 07 20:31:33 2018 library versions: OpenSSL 1.1.0f 25 May 2017, LZO 2.10
Enter Management Password:
Sat Apr 07 20:31:33 2018 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Sat Apr 07 20:31:33 2018 Need hold release from management interface, waiting...
Sat Apr 07 20:31:33 2018 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Sat Apr 07 20:31:33 2018 MANAGEMENT: CMD 'state on'
Sat Apr 07 20:31:33 2018 MANAGEMENT: CMD 'log all on'
Sat Apr 07 20:31:33 2018 MANAGEMENT: CMD 'echo all on'
Sat Apr 07 20:31:33 2018 MANAGEMENT: CMD 'bytecount 5'
Sat Apr 07 20:31:33 2018 MANAGEMENT: CMD 'hold off'
Sat Apr 07 20:31:33 2018 MANAGEMENT: CMD 'hold release'
Sat Apr 07 20:31:33 2018 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Sat Apr 07 20:31:33 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]192.168.0.28:1194
Sat Apr 07 20:31:33 2018 Socket Buffers: R=[65536->65536] S=[65536->65536]
Sat Apr 07 20:31:33 2018 Attempting to establish TCP connection with [AF_INET]192.168.0.28:1194 [nonblock]
Sat Apr 07 20:31:33 2018 MANAGEMENT: >STATE:1523125893,TCP_CONNECT,,,,,,
Sat Apr 07 20:33:34 2018 TCP: connect to [AF_INET]192.168.0.28:1194 failed: Unknown error
Sat Apr 07 20:33:34 2018 SIGUSR1[connection failed(soft),init_instance] received, process restarting
Sat Apr 07 20:33:34 2018 MANAGEMENT: >STATE:1523126014,RECONNECTING,init_instance,,,,,
Sat Apr 07 20:33:34 2018 Restart pause, 5 second(s)
Sat Apr 07 20:33:39 2018 SIGTERM[hard,init_instance] received, process exiting
Sat Apr 07 20:33:39 2018 MANAGEMENT: >STATE:1523126019,EXITING,init_instance,,,,,
</code></pre>
<p>Thanks in advance !</p>
| 0non-cybersec
| Stackexchange | 2,150 | 6,116 |
Ways to make MiTM phishing more viable?. So, you probably know that when you Man in the middle someone and redirect their HTTPS to your own phishing site, pretty much every browser will start shouting "You're being attacked!". This hurts the success rate of such hacking, so I was wondering how to do it better.
One idea I had was that if you make your own site HTTP (without SSL), then the browsers probably won't start any alarms. The victim won't see a green lock button and may or may not be concerned that the website is in HTTP, but it's still less alarming than being told by your browser that you're being attacked.
Are there any other techniques to make sure you get a successful phish? I haven't done MiTM yet but it's an interesting topic I want to get into. | 1cybersec
| Reddit | 177 | 771 |
biblatex: automatically abbreviate year ranges. <p>For consistency's sake I need to abbreviate <em>all</em> number-ranges in my document.</p>
<p>While biblatex <a href="https://tex.stackexchange.com/questions/23483/how-can-i-automatically-abbreviate-page-ranges-in-citations-biblatex">can easily be made to abbreviate page ranges</a> the equivalent command for the year ranges breaks compilation with <code>Argument of \@secondoftwo has an extra }</code></p>
<pre><code>\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{mylibrary.bib}
@book{somebook1769,
Address = {Place},
Author = {Name, Given},
Title = {Some title of this publication},
Date = {1769/1783}}
}
\end{filecontents*}
\usepackage[style=authoryear,backend=biber]{biblatex}
\usepackage{csquotes}
\addbibresource{mylibrary.bib}
\DeclareFieldFormat{postnote}{\mkcomprange[{\mkpageprefix[pagination]}]{#1}}
\DeclareFieldFormat{pages}{\mkcomprange{#1}}
%%doesn't work:
%\DeclareFieldFormat{date}{\mkcomprange{#1}}
%%works (just for comparison)
%\DeclareFieldFormat{date}{\textbf{#1}}
\begin{document}
βsome quoteβ from \cite[1348--1368]{somebook1769}
\printbibliography
\end{document}
</code></pre>
<p>(I tried to use </p>
<pre><code> Year = {1769--83}}
</code></pre>
<p>which <em>looks</em> right but biblatex warns</p>
<pre><code> WARN - year field '1769--83' in entry 'somebook1769' is not an integer - this will probably not sort properly.
</code></pre>
<p>and indeed the order of publications in the bibliography for several works by the same author is not correct.)</p>
| 0non-cybersec
| Stackexchange | 533 | 1,593 |
How small can the Mumford-Tate group of hypersurface be?. <p>Is there some way of giving a lower bound on the dimension of the Mumford-Tate group of a hypersurface? Let's say it's of general type, say, of degree $10$ inside $ \mathbb{P}^3$. </p>
<p>(Edited from here onward, because I forgot about Fermat hypersurfaces):</p>
<p>I would expect small Mumford-Tate groups to be rare.
For example, a Fermat hypersurface has Mumford-Tate group a torus. Is it possible to say, for example, that points with toral Mumford-Tate group are not Zariski-dense?</p>
| 0non-cybersec
| Stackexchange | 169 | 557 |
Fibonacci polynomials and factorization redux. <p>I recently asked a <a href="https://math.stackexchange.com/questions/764119/a-factorization-problem-involving-fibonacci-and-lucas-polynomials">question</a> about factorizing a certain expression involving Fibonacci and Lucas polynomials. That question had a very simple and nice answer, but now I've come across another similar question which has me stumped.</p>
<p><strong>Conjecture:</strong> <em>The polynomial $4- F_n(x)^4(x^2+3)$ factors as $H_n(x)H_n(-x)$ for some integer polynomial $H_n(x)$, where $F_n(x)$ is the nth Fibonacci polynomial.</em></p>
<p>Any ideas? </p>
<p>(In case anybody is wondering why I care about these question, they are related to calculating the Conway polynomial of certain families of knots.)</p>
<p><strong>Edit:</strong> As requested, here are the first few examples. Let $G_n(x)=4- F_n(x)^4(x^2+3)$. Then</p>
<ul>
<li>$G_1(x)=(1+x)(1-x)$</li>
<li>$G_2(x)=(1+x)(1-x)(2+x^2)^2$</li>
<li>$G_3(x)=(-1 - 3 x + 2 x^2 - 4 x^3 + x^4 - x^5) (-1 + 3 x + 2 x^2 + 4 x^3 +
x^4 + x^5)$</li>
<li>$G_4(x)= (2 - 4 x + 4 x^2 - 10 x^3 + 4 x^4 - 6 x^5 + x^6 - x^7) (2 + 4 x +
4 x^2 + 10 x^3 + 4 x^4 + 6 x^5 + x^6 + x^7)$</li>
<li>$G_5(x)=(-1 - 5 x + 6 x^2 - 20 x^3 + 11 x^4 - 21 x^5 + 6 x^6 - 8 x^7 + x^8 -
x^9) (-1 + 5 x + 6 x^2 + 20 x^3 + 11 x^4 + 21 x^5 + 6 x^6 + 8 x^7 +
x^8 + x^9)$</li>
</ul>
<p><strong>Edit 2:</strong> Following Will Jagy's ideas, define a family of polynomials $H_n(x)$ by $H_0(x)=2$, $H_1(x)=-1+x$ and then $$H_{n+2}(x)=(x^2+2)H_{n+1}(x)-H_n(x)+(-1)^n(6+2x^2)$$ for $n\geq 0$. Computations show that $$H_n(x)H_n(-x)=G_n(x)$$ for $n\leq 20$. What remains is to prove that this is a valid formula in general.</p>
| 0non-cybersec
| Stackexchange | 744 | 1,726 |
how to read gcc input from external file. <p>I'm trying to read the input for a c++ file <code>y.cpp</code> from the file <code>file.in</code> and save the result in <code>file.out</code> but I can't figure how to do it.</p>
<p>for example, if the following code was in <code>y.cpp</code></p>
<pre><code>#include<iostream>
using namespace std;
int main(){
int x;
cin>>x;
cout<<x<<" was entered";
}
</code></pre>
<p>and the content of <code>file.in</code> was</p>
<pre><code>56
</code></pre>
<p>I want a shell command to write <code>56 was enterdd</code> in file.out</p>
<p>What I did so far is compiling <code>y.cpp</code> and printing the result in <code>file.out</code>.</p>
<pre><code>g++ y.cpp -o y.out
./y.out>file.out
</code></pre>
<p>But in my code, reading is from the terminal and not from <code>file.in</code>, and I want to read from <code>file.in</code>. </p>
<p>I searched for a piping method to pipe <code>file.in</code> content into the <code>g++</code> command instead of reading from the terminal. But I didn't find anything about piping input file. all what I found was piping source code into the compiler and not piping input.</p>
<p>I searched also for all the options of g++ that have <code>file</code> parameter but could not find aything to answer my question.</p>
<p>How can I do it?How to read c++ input from external file instead of reading it from terminal?</p>
| 0non-cybersec
| Stackexchange | 487 | 1,430 |
Hartshorne: Definition of $K^*$ where $K$ a function field of scheme.. <p>Let $X$ be a noetherian integral separated scheme which is regular of codimension one. Let $K$ be the function field of $X$. </p>
<p>Now let $f \in K^*$, (I am interpreting $K^*$ to be the set of field automorphisms from $K \to K$) be any nonzero rational function on $X$.</p>
<p>I am very confused by the statement after the parenthesis. I thought a rational function on $X$ was an element of the function field $K$. </p>
<p>How can $f \in K$ and $f \in K^{*}$ ? </p>
<p>It is likely that I am not interpreting $K^*$ correctly. </p>
| 0non-cybersec
| Stackexchange | 194 | 614 |
Oracle installed new version and hosed my Java environment. <p>Oracle installed a new version a day or two ago. Now I go to use it and I get:</p>
<pre><code>C:\JavaTools>java -version
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
</code></pre>
<p>(I find 'Software\JavaSoft\Java Development Kit' in the registry, but no 'Java Runtime Environment'.)</p>
<p>No doubt something has been hosed in my path or registry or whatever, but I haven't a clue what. Any ideas?</p>
<p>(I did find <a href="https://stackoverflow.com/questions/6362037/java-error-opening-registry-key">this</a> but it doesn't appear to address quite the same case. I didn't intentionally muck with any of the Java config, just said "OK" when Oracle asked to update my existing config.)</p>
<p>Cygwin finds these versions of java.exe -- I have no idea which one Oracle has supposedly been updating:</p>
<pre><code>/cygdrive/c/Program Files/Java/jdk1.7.0_07/bin/java.exe
/cygdrive/c/Program Files/Java/jdk1.7.0_07/jre/bin/java.exe
/cygdrive/c/Program Files (x86)/Java/jre7/bin/java.exe
/cygdrive/c/Windows/System32/java.exe
/cygdrive/c/Windows/SysWOW64/java.exe
</code></pre>
<p>The only version of javac.exe I could find was at:</p>
<pre><code>/cygdrive/c/Program Files/Java/jdk1.7.0_07/bin/javac.exe
</code></pre>
<p>%path% includes:</p>
<pre><code>C:\"Program Files"\Java\jdk1.7.0_07\bin\
</code></pre>
<p>(I know I shouldn't have said "OK" when Oracle asked to update, but I was busy with something else and wanted to get it out of the way. That'll teach me!!)</p>
<p><strong>Update:</strong> I finally just deleted and reloaded Java. One thing I was unsure of is whether I should touch the java.exe instances in Windows\System32 and Windows\SysWOW64 -- the old ones are still there, but don't seem to cause trouble. (I did delete the other paths, finally, after finding and killing the background job that was referencing some of he files.) Had to manually update %path% with the new version number. But Java seems to be working again.</p>
| 0non-cybersec
| Stackexchange | 679 | 2,142 |
Nginx still throwing a 403 even if I connect from an allowed IP. <p>The following code is throwing a 403 even if I connect from the allowed IP</p>
<pre><code>location /railo-context/admin {
allow 1.2.3.4 #my ip
deny all;
}
</code></pre>
<p>this is the whole file:</p>
<pre><code>server {
listen 8080;
server_name $hostname;
# root should be out of location blocks according to Nginx best practices
root /opt/railo/tomcat/webapps/$host;
# index files
index index.htm index.html index.cfm index.cfml;
location / {
try_files $uri @rewrite;
}
# This block will catch static file requests, such as images, css, js
# The ?: prefix is a 'non-capturing' mark, meaning we do not require
# the pattern to be captured into $1 which should help improve performance
location ~* \.(?:ico|css|js|gif|jpe?g|png|bmp|html|htm)$ {
# Some basic cache-control for static files to be sent to the browser
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location /railo-context/admin {
# include the external ip of the server or any other fixed ip
# in order to prevent access to Railo Admin by others
allow 1.2.3.4;
deny all;
# include all proxy related settings from the proxy_params file
include proxy_params;
}
location @rewrite {
rewrite ^ /rewrite.cfm/$request_uri break;
#include all proxy related settings from the proxy_params file
include proxy_params;
}
# this prevents any aspx,php,jsp,cgi or perl files from being served
location ~ \.(aspx|php|jsp|pl|cgi|perl|prl)$ {
return 410;
}
# this prevents hidden files (beginning with a period) from being served
location ~ /\. {
access_log off; log_not_found off; deny all;
}
}
</code></pre>
| 0non-cybersec
| Stackexchange | 570 | 1,828 |
Question about installing an alternative ROM. I have a Samsung Galaxy S2, unlocked and rooted. I'm interested in trying out some custom ROMs on it, but am a bit leery I'll wreck something. I have quite a few apps installed and configuration to get it how I like it, so I'd like to be able to do a full restore of the stock ROM, apps, configuration if I don't find another ROM I want to stick with.
I've purchased both Titanium Backup and ROM Manager. From watching a video on ROM Manager, supposedly its as simple as picking a new ROM from within the app and installing it...is it really all that easy?
After installing a new ROM, can I restore all of my apps from my stock ROM into that one (and expect them to generally work), or do I have to do a reinstall of everything?
Any other particularly useful apps one should have before going down this path? | 0non-cybersec
| Reddit | 201 | 859 |
Windows 10 4TB HDD formatted with MBR by Windows. <p>Yesterday I set up my new PC. I installed Windows 10 via a USB boot drive. My PC has an SSD which I wanted to use for the OS and important applications and then Iβve got an HDD with 4TB for mass storage. I installed Windows 10 on my SSD. When I then after the install was completed tried to format my HDD (using Windows 10 built in tools) I saw that Windows for whatever reason did two stupid things. Firstly it automatically formatted my 4TB HDD with MBR instead of GUID which is why only 2TB of the 4TB can be used at the moment (even though Windows support says Windows automatically chooses a suitable partition scheme). That alone would not be a problem as I could easily reformat the drive. The problem is that Windows 10 for some stupid reason I cannot quite fathom decided to use ~500MB of the 4TB HDD and use it as some kind of security/recovery/etc partition... I do not know why Windows even did that because I told it to use the SSD for the OS. Now here is my problem: because Windows 10 allocated part of my HDD for itself I cannot reformat the drive or do anything else with it. I would really appreciate it if you know how to reformat my HDD (using GUID) so I can use all the 4TB of the drive. I would also like to know how to tell Windows to stop using the HDD for OS purposes (just the SSD). Is this by any chance possible without reinstalling the OS? Thank you for your time and answers! PS: Some further information: when I tried to boot into Windows while the HDD was physically disconnected Windows 10 did not boot up. My BIOS is in UEFI mode.</p>
| 0non-cybersec
| Stackexchange | 380 | 1,622 |
Detect word the causes overflow. <p>I have a <code><p></code> tag inside a <code><div></code> which I've set the following properties on:</p>
<pre><code>div {
height: 105px;
width: 60px;
overflow: hidden;
}
</code></pre>
<p>If the <code><p></code> tag contains a lot of text then some of it will be cut off.</p>
<p>My goal is to detect what the first word not being shown is.</p>
<p>For example, in the following scenario:</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>div {
height: 105px;
width: 60px;
overflow: hidden;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><div>
<p>People assume I'm a boiler ready to explode, but I actually have very low blood pressure, which is shocking to people.</p>
</div></code></pre>
</div>
</div>
</p>
<p>the function would return the word "explode".</p>
<p>I know from <a href="https://stackoverflow.com/questions/143815/determine-if-an-html-elements-content-overflows">this question</a> that it is quite easy to detect if there's an overflow, but can we take this one step further and detect which word is the first to be hidden?</p>
| 0non-cybersec
| Stackexchange | 451 | 1,336 |
Estimating number of crossings for Erastothenes' Sieve. <p>In <a href="http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf" rel="nofollow">this paper</a> (2.1) I need to understand the formula for the total number of operations: $$\sum_{i=1}^{\pi(\sqrt n)}\frac{n}{p_i} \approx n\ln \ln n + O(n)$$ On a sidenote, since we're only checking up till the square root then why shouldn't the summand be $\frac{\sqrt{n}}{p_i}$ </p>
<p>I have taken sequences and series and calculus in the past but I am clueless regarding these sums one pages 3 and 4.</p>
| 0non-cybersec
| Stackexchange | 184 | 553 |
How to increase exim default message body size?. <p>i have following router and i want to increase default exim <code>message_body</code> size, now i have read that if we use this variable <code>message_body_visible</code> we can increase the default body size.</p>
<p>This is my router</p>
<pre><code>runscript:
driver = accept
transport = run_script
unseen
no_expn
no_verify
message_body_visible = 2000
</code></pre>
<p>Now when i try this as follows i get an error </p>
<pre><code> Starting Exim: 2015-11-16 04:47:29 Exim configuration error in line 318 of /opt/afterlogic/etc/exim.cnf:
option "message_body_visible" unknown
</code></pre>
<p>now can any help me, if i can use this variable here? or there is some other way to do it?</p>
| 0non-cybersec
| Stackexchange | 246 | 798 |
Matrix Representation of Linear Transformation with Factor Modules. <p>Let $V = \mathbb{R}^4$ and $U =\{ \vec{v} = (v1, v2, v3, v4)^T \in \mathbb{R}^4: v1 = v2, v3 = v4\}$</p>
<p>In Parts 1-3 of this question we show $U$ is a subspace of $V$, find a basis for $U$,which I found to be $\{(1,1,0,0)^T, (0,0,1,1)^T\}$.
Then extending the basis of $U$ to a basis of $V$ I found as $\{(1,1,0,0)^T, (0,0,1,1)^T, (1,-1,0,0)^T, (0,0,1,-1)^T\}$.
Then we are asked to find a vasis for the factor module V/U, I found this to be $\{(1,-1,0,0)^T + U, (0,0,1,-1)^T + U\}$.</p>
<p>Part 4: "Write down the matrix that represents the canonical mapping $can:V \rightarrow V/U$ sending $\vec{v}$ to $\vec{v} + U$ in terms of the ordered basis ${\vec{e1}, \vec{e2}, \vec{e3}, \vec{e4} } $ of $V$, and the one you chose in 3) for $V/U$ (that is $(1,-1,0,0)^T + U, (0,0,1,-1)^T + U$). Also write the matrix representing this mapping, this time in terms of the ordered bases you chose for 2 and 3. That is in terms of $\{(1,1,0,0)^T, (0,0,1,1)^T, (1,-1,0,0)^T, (0,0,1,-1)^T\}$ and $\{(1,-1,0,0)^T + U, (0,0,1,-1)^T + U\}$.</p>
<p>We are given the answer to part 4 as the matrices (1/2 0 1/2 0, 0 -1/2 0 -1/2) and (0 0 1 0 , 0 0 0 1) but I can't see where these come from, I can normally do linear transformations so I reckon I am getting confused as with it being a factor module. Can someone explain where these answers come from? Thanks</p>
| 0non-cybersec
| Stackexchange | 577 | 1,425 |
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 |
Call forwarding. <p>I would like to forward all calls to my number on to the new predefined number
automatically. Is it possible to forward incoming call ?</p>
<p>Probably it is possible for Froyo at least. I found application called Easy Call Forwarding.
<a href="http://www.appstorehq.com/easycallforwarding-android-189596/app" rel="noreferrer">http://www.appstorehq.com/easycallforwarding-android-189596/app</a>
But many people reckon it doesn't work actually.</p>
<p>We can notice forwarded call by <code>onCallForwardingIndicatorChanged()</code> from <code>PhoneStateListener</code> but
I have no idea how to set forwarding mode.</p>
| 0non-cybersec
| Stackexchange | 188 | 642 |
Bipartite clustering is NP-hard?. <blockquote>
<p>Let $G = (A\cup B, E)$ be a bipartite graph with edge weights $w: E\to \mathbb{R}$. Find a partition $B_1, B_2$ of $B$ and a nonempty disjoint subsets $A_1, A_2$ of $A$ such that $w(A_1,B_1) + w(A_2, B_2)$ is maximum, where $w(A_i, B_i) := \sum\limits_{\{a,b\}\in (A\times B)\cap E}w(a,b)$. </p>
</blockquote>
<p>I think this problem is already known but I couldn't find any reference. Does anyone know any related problems? Or is this problem NP-hard? </p>
| 0non-cybersec
| Stackexchange | 197 | 511 |
Buy from the App Store via Desktop browser and have app auto-install to my iOS device?. <p>How can I buy an iOS app from the App Store and have it downloaded to my iOS device, perhaps telling it?</p>
<p>Anytime I attempt to go to the App Store website, it keeps trying to push me towards iTunes, which I don't have installed on all my computers (e.g. my work computer). I'd like to fire up a browser on my work or other machines, log into the App Store from the desktop browser, purchase and push the app directly to one of my AppleID linked devices, it's gotta be possible in this day of cloud and mobile computing. (like Android or Windows Phone 8/10).</p>
<p>What am I missing here? Is there a different link? Different setting?</p>
| 0non-cybersec
| Stackexchange | 188 | 738 |
Not receiving DMARC reports from major ESPs (gmail, yahoo, hotmail, etc). <p>I have recently set up a DMARC record for my domain. DMARC record looks like this, only domain name has been redacted:</p>
<pre><code>v=DMARC1; p=none; fo=1; rua=mailto:[email protected]!10m; ruf=mailto:[email protected]!10m; sp=reject
</code></pre>
<p>I'm receiving DMARC aggregate reports from a few ESPs, mostly smaller European ones, and Comcast. However, I'm not receiving anything from Gmail, Yahoo, MSN, etc, and I'm not sure why. I know for a fact that I'm sending e-mails to those ESPs. All the DMARC syntax checkers and record checkers report that the record is correctly formed and live.</p>
<p>Any insight?</p>
| 1cybersec
| Stackexchange | 227 | 720 |
Problem while installing Fedora 20 on a system with Windows 7. <p>I am getting stuck at some point during a Fedora 20 installation from a live USB image. </p>
<p>I have a drive with 133GB space that I am going to use as free space to install Fedora. Here are the details:</p>
<p><img src="https://i.stack.imgur.com/Hdz4V.png" alt="enter image description here"></p>
<p>Check the blue and red lines.</p>
<p>Once I deleted that existing partition to make it unallocated free space for Fedora, what is that red line area for? Same as free space even if I don't have any such drive?</p>
<p>Here is the result after deleting:</p>
<p><img src="https://i.stack.imgur.com/OsjWj.png" alt="enter image description here"></p>
<p>During the installation I get to the following step:</p>
<p><img src="https://i.stack.imgur.com/pLQDa.png" alt="enter image description here"></p>
<p>Why is there 0B space even if I have 133GB of unallocated space?
I don't understand this.</p>
<p>You can check my installation steps here <a href="https://drive.google.com/file/d/0B1jKNrWC6qzaWVVLcWIzWFBFWERZU0c0VVkzRDJNdnhiUVNV/edit?usp=sharing" rel="nofollow noreferrer">in this document</a>.</p>
| 0non-cybersec
| Stackexchange | 390 | 1,177 |
Show computer name on Windows desktop computer icon. <p>I know how to do this in Windows XP, as explained in <a href="https://superuser.com/a/298296/113526">this answer</a>, but it seems that <code>LocalizedString</code> in <code>HKLM\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}</code> is locked in Windows 7. Every time I try to edit it, I get the following error, <em>Cannot edit LocalizedString: Error writing the value's new contents</em></p>
<p>Does anyone know how I can edit this to show the computer name on the desktopβs "Computer" icon?</p>
| 0non-cybersec
| Stackexchange | 175 | 553 |
A 0-1 law of Brownian motion hitting time. <p>Define the first hitting time <span class="math-container">$\tau^x_A:=\inf\{t>0, B^x\in A\}$</span>, B is a standard Brownian motion, my question is: if <span class="math-container">$P(\tau_A^x<\infty)>0$</span>, then <span class="math-container">$P(\tau_A^x<\infty)=1$</span>? For 1, 2 dimensional Brownian motion, it is true. But what about dimension <span class="math-container">$\geq 3$</span>? </p>
| 0non-cybersec
| Stackexchange | 159 | 463 |
All closest pairs of points with minimum distance in a plane. <p>I have to find all closest pairs of points in a plane from a given set.</p>
<p>I've successfully implemented a naive algorithm <code>O(nΒ²)</code> similar to this pseudocode function, where <code>set</code> is a list of all points on input, <code>count</code> is count of all points on input, which returns <code>dist</code> which is minimum distance found and <code>result</code> is list of all point-pairs with such distance.</p>
<pre class="lang-javascript prettyprint-override"><code>function naive(Points[] set, int count)
result = []
distance = INF
for i=0 to count-1:
for j=i+1 to count:
newDistance = distance(set[i], set[j])
if newDistance < distance:
result = []
result.append({set[i], set[j]})
else if newDistance == distance:
result.append({set[i], set[j]})
return (dist, result)
</code></pre>
<p>This solution works well, but is, thanks to high <code>O(nΒ²)</code> complexity, very slow for larger inputs. I want to find a faster, optimised solution, so I've implemented an <code>O(n logn)</code> solution using recursive divide-and-conquer algorithm based on <a href="https://www.tutorialspoint.com/Closest-Pair-of-Points-Problem" rel="nofollow noreferrer">this article</a>, which works well for most inputs, but since such approach does not iterate through all the points it fails on inputs like this one (order of pairs and order of points inside pairs does not matter):</p>
<pre class="lang-bash prettyprint-override"><code>Input:
{A[0,0], B[1,0], C[1,1] D[0,1]}
Current (wrong) output:
{A[0,0], D[0,1]}, {B[1,0], C[1,1]}
Desired output:
{A[0,0], B[0,1]}, {A[0,0], D[0,1]}, {C[1,1], B[1,0]}, {C[1,1], D[1,0]}
</code></pre>
<p>and also since it's recursive, stack overflows easily for larger inputs. What's a better way to solve this problem?</p>
<p>Thank you</p>
| 0non-cybersec
| Stackexchange | 625 | 1,954 |
Solving a SDE with quadratic drift. <p>I am wondering whether the following SDE can be solved explicitly? </p>
<p>$$
d X_t = X_t^2 d t + X_t d B_t
$$</p>
<p>where $B_t$ is a standard Brownian motion. If not, can we say some thing about the moments of the solution, i.e., $E(|X_t|^n)$?</p>
<p>Thank you very much for any hints!</p>
<p>Anand</p>
| 0non-cybersec
| Stackexchange | 138 | 348 |
How to work with Connections. <p>I am currently reading a book which deals with complex manifolds. Since I am fairly new to the topic I don't know exactly the meaning of the followinig:</p>
<p>Suppose we have a holomorphic vector bundle $V$ over the manifold $M$ with frames $s_\alpha$ over each trivialization $U_\alpha \subset M$ </p>
<p>We can construct a Hermitian metric $h$ on $V$, and the author says this is given locally as </p>
<p>$h_\alpha = (s_\alpha,s_\alpha) $.</p>
<p>Then a connection 1 - form is defined locally by </p>
<p>\begin{equation}
\omega_\alpha = \partial h_\alpha h_\alpha^{-1}
\end{equation}
where
\begin{equation}
d = \partial + \bar{\partial}
\end{equation}
and
\begin{equation}
\partial(f) = \sum_j \frac{\partial f}{\partial z^j}dz^j
\end{equation}
(more generally $\partial \colon C^\infty(\Lambda^{p,q}) \to C^\infty(\Lambda^{p+1,q}) $.
It is then shown in the book that these 1-forms patch together to form a connection $\triangledown_h$.</p>
<p>Now comes the bit where I am struggeling with, to the extend that I can't read on without a bad feeling:</p>
<p>From the definition, one should see that
\begin{align}
(\triangledown_h s_\alpha, s_\alpha) + (s_\alpha, \triangledown_h s_\alpha) &= \omega_\alpha h_\alpha + h_\alpha \omega^*_\alpha \\
&=
\partial h _\alpha + \bar{\partial}h _\alpha = dh _\alpha
\end{align}</p>
<p>I am afraind I don't know enough about connections yet, in particular I don't really understand how to get from the first expression to the second. If anyone could fill in a little more details into the lines above that would be very helpful! </p>
| 0non-cybersec
| Stackexchange | 522 | 1,630 |
Use previous users already present in Linux Home directory. <p>I recently installed a fresh copy of Ubuntu 16.04.0 LTS on my server PC. I mounted my earlier <code>/home</code> directory to it. It consisted of multiple user accounts that were previously made.
But after installation, none of that account showed on the login screen. Now, I recreated those account using same earlier information (i.e. Name, Username .etc), but now whenever they try to login from the login screen, they are unable to do so while when they use ssh for login, the following message is shown:</p>
<p><a href="https://i.stack.imgur.com/J7V1Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J7V1Q.png" alt="Error message after login using ssh"></a></p>
<p>Moreover, there are some directory ownership issues as well. Could somehow help in solving the problem.</p>
| 0non-cybersec
| Stackexchange | 230 | 862 |
Background tabs loading incorrectly sized when Chrome starts up maximized. <p>I just switched from Firefox to Chrome and noticed certain pages display funny when they're loaded on startup. Specifically, their horizontal size does not fill the Chrome window, like they're stuck at a pre-set size. This only happens when Chrome starts maximized, and page resizes correctly <s>when I hit reload or</s> if I restore Chrome window size and then maximize it again.</p>
<p>I also just noticed that if one of the problematic tabs has focus when Chrome starts, it does not have any issues loading. Only the background tabs cause problems.</p>
<p>I can't distinguish what content could be causing some windows to work properly and some to not. For example, Gmail loads correctly but not Google Finance.</p>
<p>Any ideas as to what is causing this?</p>
<p>EDIT: As it turns out, reloading the page does <em>not</em> fix the issue. I have to restore and then re-maximize <strong>each broken tab</strong> each time I start Chrome.</p>
<p>I've also confirmed that this is not due to any of the extensions I was using. </p>
<p><img src="https://i.stack.imgur.com/hNWy1.png" alt="Google Finance - One of the problematic pages in question"></p>
| 0non-cybersec
| Stackexchange | 316 | 1,234 |
Is it safe to update postgres server to 9.5 with ubuntu automatic update. <p>Postgres 9.5 is out and Ubuntu has it in the update manager already. I'm wondering though, is it safe to update that way?</p>
<p>Concerns/Questions: </p>
<p>Does it install 9.5 in addition to my already running 9.4 or replace it?</p>
<p>Does it migrate my data automatically?</p>
<p>Will there be downtime during the process?</p>
<p>Is it the same thing as running <code>pg_upgrade</code></p>
<p>Am I missing anything else that I should be asking?</p>
| 0non-cybersec
| Stackexchange | 173 | 537 |
Effects of a 4-hour erection.. You've seen all the commercials. But what really happens when you ask for help with an erection lasting more than 4 hours?
I walked into a drug store and asked to talk to a male pharmacist. The woman I was talking to said that she was the only pharmacist, and since she and her sister were owners of the store, there were no male employees.
She then asked if she could help me. I said that I would prefer to speak to a male pharmacist.
The lady pharmacist assured me that she was completely professional and whatever it was that I needed to discuss, I could be confident that she would treat me with a high level of professionalism.
I reluctantly agreed and began by saying, β This is tough for me, as a shy man, to discuss, but I get erections every day that last more than four hours. It causes me a lot of problems and severe embarrassment, and I was wondering what you could give me for it.β
The pharmacist said, "Just a minute. I'll talk to my sister."
When she returned, she said, β We discussed it at length and this is the absolute best we can do:
...1/3 ownership in the store,
...a company pickup truck,
...a king size bed and
...$3,000 a month in living expenses. | 0non-cybersec
| Reddit | 302 | 1,222 |
How to understand or "debug" hanging / not starting `bash` from WSL?. <p>I installed <a href="https://msdn.microsoft.com/commandline/wsl/about" rel="nofollow noreferrer">WSL</a> and was using <code>bash</code> via PowerShell in the last few days without any problems. Super nice. </p>
<p>But now it doesn't start anymore, after typing <code>bash</code> it just hangs and does nothing. </p>
<p><code>bash.exe</code> is listed in the "Details" tab of "Task Manager" as <code>00 CPU</code> and <code>708 K Memory</code> - no changes. This is matched in "Processes" where the "Microsoft Bash Launcher" is a subprocess of "Windows PowerShell" which all use 0% CPU and are doing nothing. </p>
<p>I am running current Windows 10 with all updates:</p>
<p><a href="https://i.stack.imgur.com/ewBxj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ewBxj.png" alt="Windows 10 Pro, Version 1709, OS Build 16299.19"></a></p>
<p>How can I debug the <code>bash</code> process to find out what is going wrong?</p>
<hr>
<p>(Previous questions with similar name are all for earlier iterations of WSL, now solved bugs or generally about error messages, not hanging processes) </p>
<p>Unfortunately, <a href="https://msdn.microsoft.com/en-us/commandline/wsl/troubleshooting#bash-is-hung" rel="nofollow noreferrer">Microsoft's troubleshooting instructions for "Bash is hung"</a> are pretty useless and don't make any sense. Besides it's for them debugging any hangs, not for the user to fix his problem (which of course is ok - but doesn't help me in my case here)</p>
| 0non-cybersec
| Stackexchange | 490 | 1,583 |
Integration of $\xi$ function over rectangle. <p>Hey simple question (I hope so),
IΒ΄m reading <em>Introduction to Analytic and Probabilistic Number Theory</em>, and I don't get this step.</p>
<p>The author writes, this equation works by a "well known formula". But which is it, I donΒ΄t really get it?</p>
<p><span class="math-container">$$
2N(T) = \frac{1}{2\pi i } \int_R \frac{\xi^{\prime}(s)}{\xi(s)}\ ds
= \frac{1}{2\pi} \Im\left(\int\limits_{R}\frac{\xi^{\prime}(s)}{\xi(s)}ds \right).
$$</span></p>
<p><span class="math-container">$\xi$</span> is the Riemann <span class="math-container">$\xi$</span>-function and R is a rectangle with vertices <span class="math-container">$2+iT,~2-iT,~-1-iT,~-1+iT$</span> and N(T) is the number of zeros of <span class="math-container">$\xi$</span> till <span class="math-container">$\Im(s) \leq T$</span></p>
| 0non-cybersec
| Stackexchange | 311 | 863 |
What is the best artificial sweetener?. I've been doing keto now for almost 4 months. I was using Splenda for the first couple of weeks until I found out how bad it is for your health and insulin levels. Since then, I haven't had any sugar or artificial sweeteners at all but I'm dying inside!
I've done some research on Stevia and as far as I learned there are certain brands that aren't too bad for you like Sweet Leaf Stevia.
Any thoughts?
I live in the south and drinking unsweetened tea is getting real old! I need something to sweeten my tea!
BTW: Down 1 pound today! Only 10 pounds more to goal weight! | 0non-cybersec
| Reddit | 152 | 613 |
Good horror TV series?. I really want to watch a good horror tv series.
Here are some things I like:
Twin Peaks (okay okay, not *really* horror but certainly has horror elements, right? Maybe I should make a post "is Twin peaks a horror series?")
Twilight Zone
tales from the crypt
Goosebumps, are you afraid of the dark, eerie Indiana (guilty pleasures)
American horror story
Any other good horror series out there? i'd be nice if it was on Netflix, but not necessarily required.
Thank you!! | 0non-cybersec
| Reddit | 131 | 497 |
Calling System.gc( ) explicitly?. <p>It is said that we cannot force the <strong><em><code>garbage collection</code></em></strong> process in java.<br>
It's after all, a daemon thread. </p>
<p>But still sometimes, why we call the <code>System.gc( );</code> function explicitly ?<br>
Is it worth calling it ? Any Pro's and Con's ?<br>
If not useful in many situations, why this method is not deprecated from Java ?</p>
<p>PS : Explanation with an example will be useful</p>
| 0non-cybersec
| Stackexchange | 147 | 477 |
Residue and Laurent Series, is this valid?. <p>something with the Laurent series is confusing me, first I'll give a background of what I think I know.</p>
<p>If <span class="math-container">$z_0$</span> is an isolated singularity of a function <span class="math-container">$f$</span> we can find the <span class="math-container">$Res(f, z_0)$</span> by finding the coefficient of the <span class="math-container">$\frac{1}{z-z_0}$</span> of the laurent series expansion.
So for example in <span class="math-container">$$f(z) = z + \frac{i}{z-1}$$</span> If we want to find <span class="math-container">$Res(f, 1)$</span> we can see that the residue is <span class="math-container">$i$</span> from the above definition.</p>
<p>However, if instead we expand the series in <span class="math-container">$z_0 = 0$</span> we get a Taylor Series valid for <span class="math-container">$|z| < 1$</span> that goes like <span class="math-container">$$f(z) = z - i\sum_{n=0}^\infty z^n$$</span> and a Laurent series expansion valid for <span class="math-container">$|z| > 1$</span> which is <span class="math-container">$$f(z) = z + \sum_{n=0}^\infty \frac{i}{z^{n+1}}$$</span> and if I wanted I could just make <span class="math-container">$n = 0$</span> and I would get the same <span class="math-container">$i$</span>, which is the <span class="math-container">$Res(f, 1)$</span>, and it doesn't happen just on this exercise. Is this valid or to get the <span class="math-container">$Res(f, z_0)$</span> I do really need powers of <span class="math-container">$z-z_0$</span> and this is all just a coincidence? Everything I read says that to get the residue at <span class="math-container">$z_0$</span> I need to have powers of <span class="math-container">$z - z_0$</span>, however most of the times using a series of <span class="math-container">$z^n$</span> works as I get the same value, by using the expansion valid for <span class="math-container">$|z| > z_0$</span> and it gives me the correct value of <span class="math-container">$Res(f, z_0)$</span>.</p>
<p>Would appreciate clarification on this subject as I feel I'm missing something here. </p>
| 0non-cybersec
| Stackexchange | 688 | 2,162 |
Creating a UserManager outside of built in dependency injection system. <p>This is using asp.net core with identity and entity framework core. I working on a saas application where I have a separate admin web app where you can add new tenants to the system. After a tenant is creates the app creates a default database (database per tenant set up) for the new tenant. I want to add a default user to this new database but I'm struggling with creating user manager outside of the dependency injection system.</p>
<p>The admin web app uses the usermanager that is created in the startup.cs (via the built in DI system) as the manager for the admin app. When I go to add the user to the new tenants database I am not using the DI system I just want to create a UserManager with the IdentityDbContext associated with the connection string for the new tenants database.</p>
<p>I'm am using this after a new tenant is created in the admin app:</p>
<pre><code>public class TenantDbInitializer
{
private Tenant tenant;
private ApplicationDbContext context;
private UserManager<ApplicationUser> userManager;
public TenantDbInitializer(Tenant tenant)
{
this.tenant = tenant;
}
public void Init()
{
// tenant contains connection string
context = new ApplicationDbContext(tenant);
var userStore = new UserStore<ApplicationUser>(context);
userManager = new UserManager<ApplicationUser>(.........
}
}
</code></pre>
<p>The UserManager construction parameters contain items that I can't find examples on what instances I should use. Some of the interfaces appear to have default implementations but I'm not sure if this is the way to proceed (or to pass null). The constructor is:</p>
<pre><code> public UserManager(IUserStore<TUser> store,
IOptions<IdentityOptions> optionsAccessor,
IPasswordHasher<TUser> passwordHasher,
IEnumerable<IUserValidator<TUser>> userValidators,
IEnumerable<IPasswordValidator<TUser>> passwordValidators,
ILookupNormalizer keyNormalizer,
IdentityErrorDescriber errors,
IServiceProvider services,
ILogger<UserManager<TUser>> logger)
</code></pre>
<p>Looking at the identity source it appears that I can pass null in for some of these parameters but I want to make sure I understand what is going on here so I don't do anything incorrectly.</p>
<p>The source for user manager is here:
<a href="https://github.com/aspnet/Identity/blob/dev/src/Microsoft.AspNetCore.Identity/UserManager.cs" rel="noreferrer">https://github.com/aspnet/Identity/blob/dev/src/Microsoft.AspNetCore.Identity/UserManager.cs</a></p>
<p>Thanks,
Brian</p>
| 0non-cybersec
| Stackexchange | 739 | 2,772 |
If $\Phi:G \rightarrow G$ is a group homomorphism, $\Phi(x)=ax^3a$ then what is $Ker \Phi, Im(\Phi)$. <p>If <span class="math-container">$\Phi:G \rightarrow G$</span> is a group homomorphism, <span class="math-container">$\Phi(x)=ax^3a$</span> where <span class="math-container">$a$</span> is a an element in <span class="math-container">$G$</span>, then what is <span class="math-container">$Ker \Phi, Im(\Phi)$</span></p>
<p>The question asked to show that </p>
<p><span class="math-container">$$Ker \Phi = \{x\in G | x^2 = e\}$$</span>
<span class="math-container">$$Im \Phi = \{x^2 | x\in G \}$$</span></p>
<p>I've tried calculating <span class="math-container">$a^2$</span> first and found it to be <span class="math-container">$a^2=e$</span>. So the kernel is</p>
<p><span class="math-container">$$Ker \Phi = \{x\in G | ax^3 a = e\}$$</span>
<span class="math-container">$$Ker \Phi = \{x\in G | x^3 = e\}$$</span></p>
<p>However, I don't see how I can reduce this to proving <span class="math-container">$x^2=e$</span> ?</p>
<p>For the image, I have </p>
<p><span class="math-container">$$Im \Phi = \{y | \exists x\in G , \quad y=ax^3a \}$$</span>
<span class="math-container">$$Im \Phi = \{y | \exists x\in G , \quad aya=x^3 \}$$</span>
<span class="math-container">$$Im \Phi = \{y | \exists x\in G , \quad ay^3a=x^9 \}$$</span>
<span class="math-container">$$Im \Phi = \{y | \exists x\in G , \quad \Phi(y)=x^9 \}$$</span></p>
<p>But I don't see how to get it down to the form too. Any help?</p>
| 0non-cybersec
| Stackexchange | 583 | 1,511 |
How do you create a border around the outside of a selection with GIMP?. <p>How do you create a border around the <strong>outside</strong> of a selection using GIMP?</p>
<p>When I create a border using the Selection tool and the <code>Edit -> Stroke Selection...</code> menu option, the border is centered on the selection.</p>
<p>For example, if use <code>Stroke selection...</code> to draw around the perimeter of the selection a line that is 8 pixels wide, 4 of those pixels will be inside selection and 4 will be outside the selection.</p>
<p>How do you create a border that only has pixels on the outside of the selection?</p>
| 0non-cybersec
| Stackexchange | 170 | 638 |
Iterated removal of singleton Pythagorean triples. <p>Consider the set of all Pythagorean triples (positive integers <span class="math-container">$a, b, c$</span> such that <span class="math-container">$a^2 + b^2 = c^2$</span>, not necessarily coprime). Then for each integer that appears in exactly one triple, remove that triple from the set and repeat this process an infinite number of times.</p>
<p>For example, 3 is a member of only one triple (3, 4, 5), so that triple is removed. Afterwards, 5 is a member of only one triple (5, 12, 13), so that triple can also be removed, and so on.</p>
<p>Call a triple <em>stable</em> if it is never removed by this process, and a positive integer stable if it is a member of at least one stable triple.</p>
<p>For example, 15 is stable because taking each elementwise product of the triples (3, 4, 5) and (5, 12, 13) results in a "magic square" where each row and column is a Pythagorean triple. Since each element in the square is a member of two different triples including only other elements of the square, every row, column, and element of such a square is stable.</p>
<p><span class="math-container">$\begin{matrix}
15 & 36 & 39\\
20 & 48 & 52\\
25 & 60 & 65
\end{matrix}$</span></p>
<p>My questions are</p>
<ol>
<li>Is every stable integer connected to one or more cycles of stable triples as described above? Or are there stable integers which are stable merely because they are the root of an infinitely ascending tree of Pythagorean triples that can't be removed in a countable number of steps?</li>
</ol>
<p>and </p>
<ol start="2">
<li>Is there a simple algorithm to determine whether an integer is stable?</li>
</ol>
| 0non-cybersec
| Stackexchange | 492 | 1,707 |
How long does it take to receive your full wage after starting a new job?. Just got hired at McDonald's and we get paid bi-weekly on Thursdays. Last week, I had my 3 hour orientation and this week, I worked two shifts, each about three hours. On my paycheck today, I only got paid for three hours when I worked nine hours, so I was wondering if it will take longer for them to process the more recent shifts, or should I ask the manager where the rest of the money is?
EDIT: Just so everyone knows, I get paid by direct deposit, so I don't know where to check to see the dates. | 0non-cybersec
| Reddit | 140 | 578 |
From positive definite function to Følner sequence ----- a question on amenability and nuclearity. <p>We know that amenability of countable discrete group $\Gamma$ has many equivalent characterizations. In particular, there are two: a) there is a sequence of finitely supported positive definite functions $\phi_i$ defined on $\Gamma$ such that $\lim_{i\to\infty}\phi(\gamma)=1$ for any $\gamma\in \Gamma$; b) $\Gamma$ satisies the FΓΈlner condition, i.e., there exists a sequence of $F_k\subset\Gamma$ such that $\lim_{k\to\infty}\frac{|F_k\cap sF_k|}{|F_k|}=1$ for any $s\in \Gamma$. Can somebody provide a proof of $a) \Rightarrow b)$? I have checked N. P. Brown and N. Ozawa's classical book "$C^\ast$-algebras and Finite-Dimensional Approximations", but no hint. It would be nice if somebody gives a hint or a reference. Thanks in advance.</p>
<p>Let $\varphi$ be a positive definite function on $\Gamma$. Then $m_{\varphi}: \sum c_t\lambda_t \rightarrow \sum\varphi(t)c_t\lambda(t)$ extends to a completely positive map $\phi$ from $C^\ast_\lambda (\Gamma)$ into itself. My question is if it is possible to factor $m_{\varphi}$ through finite-dimensional matrix algebra $M_n(\mathbb{C})$ as Brown and Ozawa show in their Theorem 2.6.8. </p>
<p>For convenience, I'd like to recall the construction there w.r.t. F{\o}lner condition. Given a sequence of F{\o}lner sets $F_k$, for each $k$, let $P_k\in B(l^2(\Gamma))$ be the orthogonal projection onto the finite-dimensional subspace spanned by $\{\delta_g:g\in F_k\}$. Identity $P_kB(l^2(\Gamma))P_k$ with the matrix algebra $M_{F_k}(\mathbb{C})$ and let $\{e_{p,q}\}_{p,q\in F_k}$ be the canonical matrix units of $M_{F_k}(\mathbb{C})$. One can chechk that for each $s\in \Gamma$ we have $e_{p,p}\lambda_se_{q,q}=0$ unless $sq=p$, and $e_{p,p}\lambda_se_{q,q}=e_{p,q}$ if $sq=p$. Since $P_k=\sum_{p\in F_k}e_{p,p}$, we have $P_k\lambda_sP_k=\sum_{p,q\in F_k}e_{p,p}\lambda_se_{q,q}=\sum_{p\in F_k\cap sF_k}e_{p,s^{-1}p}$. Let $\varphi_k:C^\ast_\lambda (\Gamma)\rightarrow M_{F_k}(\mathbb{C})$ be the u.c.p. map defined by $x\mapsto P_kxP_k$. Now define a map $\psi:M_{F_k}(\mathbb{C})\rightarrow C^\ast_\lambda (\Gamma)$ by sending $e_{p,q}\mapsto\frac{1}{|F_k|}\lambda_p\lambda_{q^{-1}}$. Evidently this map is unital; it is also completely positive. Since the linear span of $\{\lambda_s:s\in\Gamma\}$ is norm dense in $C^\ast_\lambda (\Gamma)$, it suffices to check that $\|\lambda_s-\psi_k\circ \varphi_k(\lambda_s)\|\rightarrow 0$ for all $s\in \Gamma$. This follows from the definition of F{\o}lner sets together with the following computation $\psi_k\circ \varphi_k(\lambda_s)=\psi_k(\sum_{p\in F_k\cap sF_k}e_{p,s^{-1}p})=\sum_{p\in F_k\cap sF_k}\frac{1}{|F_k|}\lambda_s=\frac{|F_k\cap sF_k|}{|F_k|}\lambda_s$.</p>
| 0non-cybersec
| Stackexchange | 969 | 2,785 |
How to repair powerstate (intel_pstate) on Intel Haswell chips?. <p>I recently installed <code>tlp</code> on my Lenovo U430p laptop. After I runned it I noticed significant drop in my laptop's on bettery time. Now my laptop lasts on battery for 2 hours less than before. </p>
<p>After that I read on arch wiki page not to use it with other programs such as <code>powertop</code> which I used before, because it may overwrite the powerstates, which it did. My powerstates now looks this way:</p>
<pre><code>+++ Processor
CPU Model = Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 2080000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 2080000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 2600000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 2600000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 2600000 [kHz]
/sys/devices/system/cpu/intel_pstate/no_turbo = 0
/proc/sys/kernel/nmi_watchdog = 0
</code></pre>
<p>As you can see all scaling governors are renamed to powersave and I think that means my Haswell i5 4200U processor rus all the time at maximum frequency. </p>
<p>So my question is: <strong>How can I repair it?</strong> I don't know how the states were named before.</p>
<p>I also noticed that my dedicated graphic card runs even on battery (which it didn't while I was using powertop only).</p>
<p>Your help is appreciated.</p>
| 0non-cybersec
| Stackexchange | 797 | 2,276 |
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 nested Library in windows 7?. <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://superuser.com/questions/113037/is-it-possible-to-have-nested-libraries-in-windows-7">Is it possible to have nested libraries in Windows 7?</a> </p>
</blockquote>
<p>I want to make new "Songs" library inside "Music" Library.</p>
<p>How to do that?</p>
<p>How to make nested library in windows 7?</p>
<p><strong>Edit:</strong> I know how to add folders to music library but i want to make new library inside music library. Is that possible?</p>
| 0non-cybersec
| Stackexchange | 186 | 571 |
Everyone is unhappy about Super Mario Run requiring a constant internet connection. From Nintendo's perspective, what would be your solution?. Here are things to keep in mind:
* SMR is a higher-quality mobile game with higher production costs than average mobile games
* SMR offers no in-app purchases or ads, and therefore 100% of their profit comes from the single intitial purchase of the game
* iOS has upwards of 60% piracy rate (Android has 95%)
* Because SMR is $10 (ten times more expensive than the average mobile game), logically it is far more likely to be pirated
* Nintendo as a company has [likely] been greatly hurt by piracy in the past, specifically with regards to their portable platforms
And one argument I hate seeing is how "people who pirated the game were never going to buy it anyway". That's straight-up speculation and very, very likely to be untrue. When I was younger, I absolutely pirated games that I would have otherwise purchased.
Nintendo is in a very tough position, and while I don't agree that an always-on connection DRM is a great solution to their piracy problem, I honestly can't think of a great solution myself.
One of the most popular solutions for mobile developers is to release a free game and have their monetization come entirely from in-app purchases, because it is a lot easier for the developer to verify the legitimacy of those purchases.
I applaud Nintendo for deciding to make a game with no IAP, and hope to see more higher-quality, one-time-purchase games like SMR in the future. It's an excellent precedent a company like Nintendo is setting. (Not saying they're the first to set it, obviously.) But it ends up being far more risky for the company since they won't have a consistent revenue stream coming in the form on IAP, and all someone has to do is pirate the game once in order for them to potentially lose a sale.
This is why I understand why they're requiring the always-connected DRM. I don't agree with it, but I feel far more angry at piracy in general than Nintendo for trying to protect their profits.
In any case, what do you think would be a **realistic** solution for Nintendo, from their perspective? | 0non-cybersec
| Reddit | 489 | 2,186 |
Backbone.js render().el Usage. <p>I've got this piece of code from a Backbone.js tutorial from <a href="http://arturadib.com/hello-backbonejs/docs/4.html" rel="noreferrer">here</a>. The code is as follows:</p>
<pre><code>(function($){
var Item = Backbone.Model.extend({
defaults: {
part1: 'Hello',
part2: 'World'
}
});
var ItemList = Backbone.Collection.extend({
model: Item
});
var ItemView = Backbone.View.extend({
tagName: 'li',
initialize: function(){
_.bindAll(this, 'render');
},
render: function(){
$(this.el).html("<span>" + this.model.get('part1') + " " + this.model.get('part2') + "</span>");
return this;
}
});
var AppView = Backbone.View.extend({
el: $('body'),
initialize: function(){
_.bindAll(this, 'render', 'addItem', 'appendItem');
this.collection = new ItemList();
this.collection.bind('add', this.appendItem)
this.counter = 0;
this.render();
},
events: {
'click button#add': 'addItem'
},
addItem: function(){
var item = new Item();
item.set({
'part2': item.get('part2') + this.counter++
});
this.collection.add(item);
},
appendItem: function(item){
var itemView = new ItemView({
model: item
});
$('#list', this.el).append(itemView.render().el);
},
render: function(){
$(this.el).append("<button id='add'>Add Item</button>");
$(this.el).append("<ul id='list'></ul>")
},
});
var Tasker = new AppView();
})(jQuery);
</code></pre>
<p>There is one thing I could not understand from the above code. In the function <code>appendItem</code> there is this piece of code:</p>
<pre><code>itemView.render().el
</code></pre>
<p>Could anybody explain me why the <code>render()</code> function is called with the <code>.el</code> part and why not just <code>itemView.render()</code>?</p>
<p>Thank you for your time and help :-)</p>
| 0non-cybersec
| Stackexchange | 675 | 2,255 |
Where to permanently put an "ethtool -L eth0 combined 56" cmd?. <p>We have Mellanox network cards on SLES12.3 servers and need to set the:</p>
<p>ethtool -L eth0 combined 56</p>
<p>to have good performance.</p>
<p>But where to put this setting, to be permanent?</p>
<p>Best is so far in an initscript, which runs at every boot (off: applying this setting causes 1 min network outage!).</p>
<p>Previously we tried with "vi /etc/sysconfig/network/ifcfg-ethX":</p>
<p>ETHTOOL_OPTIONS='ethtool -L eth0 combined 56'</p>
<p>or:</p>
<p>ETHTOOL_OPTIONS='set-channels combined 56'</p>
<p>but they didn't applied the setting to the "Current" in "ethtool -l ethX"</p>
| 0non-cybersec
| Stackexchange | 251 | 697 |
"Failed authorization procedure" when trying to add SSL certificate to site. <p>When I ran this command in my digital ocean server:</p>
<p><code>sudo certbot --authenticator webroot --webroot-path /home/james/postr --installer nginx -d <sitename></code></p>
<p>I get this error:</p>
<pre><code>Failed authorization procedure
The client lacks sufficient authorization :: Invalid response from
http://www.<sitename>.com/.well-known/acme-challenge/oAVGa4eBNfQQ1Vrn_q-
iKjV2T6ue3H5kOcxEWpztrHc
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: www.venvor.com
Type: unauthorized
Detail: Invalid response from
http://www.<sitename>.com/.well-known/acme-challenge/oAVGa4eBNfQQ1Vrn_q-
iKjV2T6ue3H5kOcxEWpztrHc:
"<h1>Not Found</h1><p>The requested URL
/.well-known/acme-challenge/oAVGa4eBNfQQ1Vrn_q-iKjV2T6ue3H5kOcxEWpztrHc
was not found on "
</code></pre>
<p>I already tried adding the url path to my urls file:</p>
<pre><code>urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^.well-known/acme-challenge/', admin.site.urls),
]
</code></pre>
<p>However it still doesn't work. Any idea what the problem is?</p>
<p><strong>EDIT:</strong></p>
<p><code>/etc/nginx/sites-available/postr</code></p>
<pre><code>server {
listen 80;
server_name venvor.com www.venvor.com 174.138.62.249;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/james/postr;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/james/postr/draft1.sock;
}
}
</code></pre>
| 0non-cybersec
| Stackexchange | 637 | 1,666 |
Loading AssetImages with Flutter. <p>I'm trying to define some assets for my Flutter app.</p>
<p>This is my directory structure:</p>
<pre><code>- lib
- assets
- images
β bg_login.png <-- this one is 400x800px
β 2.0x
β bg_login.png <-- this one is 800x1600px.
- test
- ios
- android
- build
- pubspec.yaml
</code></pre>
<p>This is my pubspec file (indented with 2 whitespaces):</p>
<pre><code>name: my_app
description: My App
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/images/bg_login.png
</code></pre>
<p>I load the image like that:</p>
<pre><code>new Positioned(
top: 0.0,
width: MediaQuery.of(context).size.width,
child: Image.asset(
"assets/images/bg_login.png",
fit: BoxFit.fitWidth,
)
)
</code></pre>
<p>Sometimes the image loads, sometimes it fails with this error:</p>
<pre><code>Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
Syncing files to device Android SDK built for x86...
D/ ( 3460): HostConnection::get() New Host Connection established 0xb099df40, tid 3479
D/EGL_emulation( 3460): eglMakeCurrent: 0xa325a620: ver 2 0 (tinfo 0xb0983620)
I/flutter ( 3460): βββ‘ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE βββββββββββββββββββββββββββββββββββββββββββββββββββββ
I/flutter ( 3460): The following assertion was thrown resolving an image codec:
I/flutter ( 3460): Unable to load asset: assets/images/bg_login.png
I/flutter ( 3460):
I/flutter ( 3460): When the exception was thrown, this was the stack:
I/flutter ( 3460): #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
I/flutter ( 3460): <asynchronous suspension>
I/flutter ( 3460): #1 AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:427:44)
I/flutter ( 3460): <asynchronous suspension>
I/flutter ( 3460): #2 AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:412:14)
I/flutter ( 3460): #3 ImageProvider.resolve.<anonymous closure>.<anonymous closure> (package:flutter/src/painting/image_provider.dart:266:86)
I/flutter ( 3460): #4 ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:143:20)
I/flutter ( 3460): #5 ImageProvider.resolve.<anonymous closure> (package:flutter/src/painting/image_provider.dart:266:63)
I/flutter ( 3460): (elided 8 frames from package dart:async)
I/flutter ( 3460):
I/flutter ( 3460): Image provider: AssetImage(bundle: PlatformAssetBundle#267c3(), name: "assets/images/bg_login.png")
I/flutter ( 3460): Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#267c3(), name: "assets/images/bg_login.png",
I/flutter ( 3460): scale: 1.0)
I/flutter ( 3460): ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
</code></pre>
<p>It really happens randomly, sometimes it works, most of the time it throws that error. I also tried with <code>ImageAsset</code>, I got the same error.</p>
<p>What's going on? Am I missing something on how to properly declare and load images?</p>
| 0non-cybersec
| Stackexchange | 1,167 | 3,385 |
Xamarin remove app title. <p>I'm struggling with the dumbest thing (I guess I'm just not used to the Xamarin Designer).</p>
<p>How can I remove the title of my app ? It keeps showing up but it is not in my Layout Source.</p>
<p>I want to remove this whole part but can't figure out how.<br>
In C# Winforms or WPF I would have selected the whole window or screen and then accessed the main window properties but in this case, I can only select the controls I added (buttons and labels) and not the whole screen or the title.</p>
<blockquote>
<p><img src="https://i.stack.imgur.com/wy4Bf.png" alt="enter image description here"></p>
</blockquote>
| 0non-cybersec
| Stackexchange | 190 | 650 |
Decomposing $SU(4)$ into $SU(3) \times U(1)$. <p>I'm solving these problems concerning the <span class="math-container">$SU(4)$</span> group and I've reached the point where I have determined the Cartan matrix of <span class="math-container">$SU(4)$</span>, its inverse and the weight schemes for <span class="math-container">$(1 0 0)$</span> and <span class="math-container">$(0 1 0)$</span> highest weight states.</p>
<p><a href="https://i.stack.imgur.com/4eQYd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4eQYd.png" alt="enter image description here"></a></p>
<p>How do I decompose the <span class="math-container">$(1 0 0)$</span> and <span class="math-container">$(0 1 0)$</span> into irreps of <span class="math-container">$SU(3) \times U(1)$</span> using the inverse of the Cartan matrix of <span class="math-container">$SU(4)$</span> and the weight scheme? </p>
| 0non-cybersec
| Stackexchange | 298 | 895 |
Uploading sudoers.d file through ansible gives syntax error but opening and saving in vi fixes it. <p>Alright, I know the question title sucks, but it's the same with the situation itself.</p>
<p>What I am trying to do is this:</p>
<ol>
<li>Create a file with sudoers configuration locally</li>
<li>Use Ansible to ubload that file with the template module</li>
<li>Use the validate feature of the template module to make sure the configuration works</li>
</ol>
<p>So far, so good. Now comes the weird part: The validation (<code>validate: 'visudo -cf %s'</code>) of that file throws an error. When I comment out the validation line the files gets uploaded, but a manual validation (<code>visudo -cf /etc/sudoers.d/foo_bar</code>) fails also. Opening the file using vi, saving it (<code>:wq</code>) without making any changes and running the validation again succeeds.</p>
<p>My current working thesis: WTF?!</p>
<p>But it's late and I am tired. If anyone has suggestions please let me know. I will update this question as soon as I have new information and I will clean it up once I zero in on a solution.</p>
| 0non-cybersec
| Stackexchange | 308 | 1,115 |
Isaac Asimov's Foundation series. Should I read them in chronological order or by order of publication?. After never really giving the genre much of a go, I have decided to try reading a number of the classic sci-fi books. Isaac Asimov is one odf the clsassics I have been told I need to read. But I don't know whether to start with Foundation and read them all in publication order or start with the two prequels first. I'm worried that information in the prequels will spoil my enjoyment of Foundation.
Edit: Thanks for the advice everyone. FYI I have just ordered the first few books of the Robot Series and then plan on starting with Foundation once I've finished Robots and Empire. | 0non-cybersec
| Reddit | 159 | 687 |
Showing $0 \le e^x \le 1$ for $x \in \mathbb{R}_{\le 0}$. <p>I find the exponential function extremely hard to grasp from a rigorous point of view. For example, I want to show that $0 \le e^x \le 1$ for $x \in \mathbb{R}_{\le 0}$.</p>
<ol>
<li><p>First, if $x = 0$, then $e^x = e^0 = \Sigma_{n=1}^\infty \frac{0^n}{n!}= 0 + \frac{0^2}{2} + \ldots = 0$.</p></li>
<li><p>Otherwise if $x < 0$ then we have </p></li>
</ol>
<p>$$e^x = \Sigma_{n=1}^\infty \frac{x^n}{n!}= x + \frac{x^2}{2} + \frac{x^3}{6} \ldots$$</p>
<p>Now clearly the odd terms in this sequence are negative while the even terms of this sequence are positive. But it's not clear to me why this sequence will always be bounded by $1$. For example, if we took out the negative terms the sequence could certainly be larger than $1$ (so we can't bound $e^x$ by its positive terms).</p>
<p>What then are then some useful bounds with the exponential function to solve problems like this and related problems? What if we fixed $t > 0$ and considered for example $e^{tx}$?</p>
| 0non-cybersec
| Stackexchange | 369 | 1,047 |
Are Linux commands interchangeable with Unix commands?. <p>I find that some commands, for example, <code>ls</code> and <code>pwd</code>, can be used on both Linux and Unix systems.</p>
<ul>
<li>Is it that all Linux commands can be used in the Unix systems, and all Unix commands can be used in Linux?</li>
<li>Or just that all the Linux commands can run on Unix but not all Unix commands can run on Linux.</li>
<li>Or that all Unix commands can run on Linux, but not all Linux commands can run on Unix?</li>
<li>Or is there a reference to show me which commands can run on both Linux and Unix, and where both have their own unique command?</li>
</ul>
| 0non-cybersec
| Stackexchange | 180 | 652 |
How to prevent scale down of newly scaled up pod for specific period of time which was created by HPA in Kubernetes?. <p>I have a Kubernetes cluster set up in DigitalOcean. The cluster is configured to auto-scale using HPA(Horizontal Pod Autoscaler). I want to prevent termination of a pod that got scaled up in the last 1 hour to avoid thrashing and saving the bill.
Following are the two reasons for the same:</p>
<ol>
<li>Due to unpredictable traffic, sometimes new pods scale up and down multiple times in an hour. Because of the nature of the application, 50-60 new users need a new pod to handle the traffic. </li>
<li>DigitalOcean droplets are charged per hour. Even if the droplet was up for 15 minutes, They would charge it for an hour. So, sometimes we are paying for 5 droplets in an hour which could have been paid for just 1 droplet. </li>
</ol>
<p>From the <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">documentation</a>, I could not find anything related to this. Any hack for the same would be helpful. </p>
| 0non-cybersec
| Stackexchange | 278 | 1,091 |
Prove that $f(x)$ is continuous over $\mathbb{R}.$. <h1>Problem</h1>
<p>Let <span class="math-container">$f(x)$</span> be continuous at <span class="math-container">$x=0$</span> and satisfy that <span class="math-container">$f(0)=0$</span>,
<span class="math-container">$$3f(x)-4f(4x)+f(16x)=3x ,\forall x \in \mathbb{R}.$$</span>
Prove that <span class="math-container">$f(x)$</span> is continuous over <span class="math-container">$\mathbb{R}.$</span></p>
<h1>Comment</h1>
<p>Maybe, we can obtain
<span class="math-container">$$3[f(x)-f(4x)]-[f(4x)-f(16x)]=3x.$$</span>
Denote
<span class="math-container">$$g(x):=f(x)-f(4x).$$</span>
Then
<span class="math-container">$$3g(x)-g(4x)=3x.$$</span>
Can we apply the induction from here? I'm not sure.</p>
| 0non-cybersec
| Stackexchange | 303 | 754 |
Algorithm for directly finding the leading eigenvector of an irreducible matrix. <p>According to the Perron-Frobenius theorem, a real matrix with only positive entries (or one with non-negative entries with a property called irreducibility) will have a unique eigenvector that contains only positive entries. Its corresponding eigenvalue will be real and positive, and will be the eigenvalue with greatest magnitude.</p>
<p>I have a situation where I'm interested in such an eigenvector. I'm currently using numpy to find all the eigenvalues, then taking the eigenvector corresponding to the one with largest magnitude. The trouble is that for my problem, when the size of the matrix gets large, the results start to go crazy, e.g. the eigenvector found that way might not have all positive entries. I guess this is due to rounding errors.</p>
<p>Because of this, I'm wondering if there's an algorithm that can give better results by making use of the facts that $(i)$ the matrix has non-negative entries and is irreducible, and $(ii)$ we're only looking for the eigenvector whose entries are positive. Since there are algorithms that can make use of other matrix properties (e.g. symmetry), it seems reasonable to think this might be possible.</p>
<p>While writing this question it occurred to me that just iterating $\nu_{t+1} = \frac{A\nu_t}{|A\nu_t|}$ will work (starting with an initial $\nu_0$ with positive entries), but imagine with a large matrix the convergence will be very slow, so I guess I'm looking for a more efficient algorithm than this. (I'll try it though!)</p>
<p>Of course, if the algorithm is easy to implement and/or has been implemented in a form that can easily be called from Python, that's a huge bonus.</p>
<p>Incidentally, in case it makes any kind of difference, my problem is <a href="https://math.stackexchange.com/questions/661801/infinite-matrix-leading-eigenvalue-problem">this one</a>. I'm finding that as I increase the matrix size (finding the eigenvector using Numpy as described above) it looks like it's converging, but then suddenly starts to jump all over the place. This instability gets worse the smaller the value of $\lambda$.</p>
| 0non-cybersec
| Stackexchange | 523 | 2,184 |
SSIS Package produces SQLDUMPER_ERRORLOG.log. <p>Failing intermittently but more frequently. Package just calls a couple stored procs and exports the results to two Excel spreadsheets.</p>
<p>Where to go from here:</p>
<pre><code>(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Input parameters: 4 supplied
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Parameter 1: 1500
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Parameter 2: 0
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Parameter 3: 0:0
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Parameter 4: 0011B568
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Parsed parameters:
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ProcessID = 1500
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ThreadId = 0
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Flags = 0x0
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, MiniDumpFlags = 0x0
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, SqlInfoPtr = 0x0011B568
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, DumpDir = <NULL>
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ExceptionRecordPtr = 0x00000000
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ContextPtr = 0x00000000
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ExtraFile = <NULL>
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, InstanceName = <NULL>
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ServiceName = <NULL>
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Callback type 11 not used
(D08:FC8) 09/05/13 14:05:57, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Callback type 15 not used
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Callback type 7 not used
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, MiniDump completed: c:\Program Files (x86)\Microsoft SQL Server\100\Shared\ErrorDumps\SQLDmpr0047.mdmp
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Location of module 'dbghelp.dll' : 'c:\Program Files (x86)\Microsoft SQL Server\100\Shared\dbghelp.dll'
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, File version of module 'c:\Program Files (x86)\Microsoft SQL Server\100\Shared\dbghelp.dll' : '6.8:4.0'
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Product version of module 'c:\Program Files (x86)\Microsoft SQL Server\100\Shared\dbghelp.dll' : '6.8:4.0'
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Location of module 'sqldumper.exe' : 'c:\Program Files (x86)\Microsoft SQL Server\100\Shared\SQLDUMPER.EXE'
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, File version of module 'c:\Program Files (x86)\Microsoft SQL Server\100\Shared\SQLDUMPER.EXE' : '2009.100:1600.1'
(D08:FC8) 09/05/13 14:06:00, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Product version of module 'c:\Program Files (x86)\Microsoft SQL Server\100\Shared\SQLDUMPER.EXE' : '10.50:1600.1'
(D08:FC8) 09/05/13 14:06:00, ACTION, DTExec.exe, Watson Invoke: No
</code></pre>
| 0non-cybersec
| Stackexchange | 1,424 | 3,313 |
Unit Ball of $\mathcal{l}_2$. <p>Let $B(\mathcal{l}_2) :=\{x \in \mathcal{l}_2 : \|x \| \leq 1 \}$ and $S(\mathcal{l}_2) :=\{x \in \mathcal{l}_2 : \|x \| = 1 \}$ be the unit ball and the unit sphere of $\mathcal{l}_2$, respectively.</p>
<p>I'm trying to show that $B(\mathcal{l}_2)$ contains an infinite set $A$ such that, for every $x,y \in A$ with $x \neq y$, we have $\|x -y \| > \sqrt{2}$.</p>
<p>My intuition tells me that such a set $A$ should lie inside $S(\mathcal{l}_2)$. Next, I've tried to use a point $z$ such that $d(z,S(\mathcal{l}_2)) = \sqrt{2}$ to define $A$. I know that for such a $z$ there exists $w \in S(\mathcal{l}_2)$ such that $\|z - w \| = \sqrt{2}$, and for every $v \in S(\mathcal{l}_2),v \ne w$, we must have $\|z - v \| > \sqrt{2}$.</p>
<p>So, right now I'm confused about how to go ahead with the definition of $A$ in a way that the distance between any <strong>two distinct points in $A$</strong> is greater that $\sqrt{2}$. I get the feeling that I should be able to use what I've described in the previous paragraph, but I don't see how.</p>
<p>Could somebody point me in the right way?</p>
| 0non-cybersec
| Stackexchange | 398 | 1,135 |
vim unable to write to files even though sudo is used. <p>I find that with <code>vim</code>, if I try and edit a file which as a normal user I do not have write access with, even if I use <code>sudo</code>, I am unable to write to it, although if I use <code>nano</code> to edit the same file it works.</p>
<p>So for instance if I do:</p>
<pre><code>sudo vim /var/path/to/file.conf
</code></pre>
<p>I will get this in the file and not be able to edit that file:</p>
<pre><code>"/var/path/to/file.conf" [readonly]
</code></pre>
<p>But if I instead do:</p>
<pre><code>sudo nano /var/path/to/file.conf
</code></pre>
<p>It will be able to write to the file, why is this, why does <code>sudo</code> not give <code>vim</code> write access like it does with <code>nano</code>? Is this some sort of bug? Or is this just something which is meant to be? Because it is very annoying.</p>
<hr>
<h2>OS Information:</h2>
<pre><code>Description: Ubuntu 15.04
Release: 15.04
</code></pre>
<h2>Package Information:</h2>
<pre><code>vim:
Installed: 2:7.4.488-3ubuntu2
Candidate: 2:7.4.488-3ubuntu2
Version table:
*** 2:7.4.488-3ubuntu2 0
500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
100 /var/lib/dpkg/status
</code></pre>
| 0non-cybersec
| Stackexchange | 453 | 1,266 |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
- Downloads last month
- 15