text
stringlengths 3
1.74M
| label
bool 2
classes | source
stringclasses 3
values |
---|---|---|
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>
| false | Stackexchange |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
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 | false | Reddit |
[Russia] Fast & Furious wannabe Lada driver causes high speed fatal accident.. | false | Reddit |
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>
| false | Stackexchange |
Colin Kaepernick completed his $1 million donation pledge today. Here are all 40 organizations that received money, with links to learn more and donate. [xpost r/49ers]. | false | Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| false | Stackexchange |
[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! | false | Reddit |
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. | false | Reddit |
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>
| false | Stackexchange |
Confused Bo. | false | Reddit |
Akira Movie Now a Reality. | false | Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| false | Stackexchange |
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>
| false | Stackexchange |
Are HIIT Exercises better than cardio?(Cutting). Is it true that using HIIT types of exercises is much better than normal cardio?
Source: http://www.bodybuilding.com/fun/wotw40.htm | false | Reddit |
Lib Dems get 80% the number of votes Labour have, yet 20% the number of seats. Care about electoral reform? Let's do something about it.. | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
Forget Ja, Where is Future!?!. | false | Reddit |
Volkswagen boss warns US emissions deal could cost more. | false | Reddit |
A friend sent me this. I think it's wonderfully made. Thoughts?. | false | Reddit |
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>
| false | Stackexchange |
This machine turns any bottled coke into a slushy.. | false | Reddit |
If Josh McCown starts at least six games this season, he would join Babe Parilli, Roger Staubach, Warren Moon and Doug Flutie as the only QBs to start more than half of their career games after the age of 34. | false | Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| false | Stackexchange |
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>
| false | Stackexchange |
Comes by me on the way to Dublin.. | false | Reddit |
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>
| false | Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| false | Stackexchange |
[Art] I printed my cartoon on some hoodies:). | false | Reddit |
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>
| false | Stackexchange |
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. | false | Reddit |
Nice going, geniuses.. | false | Reddit |
Compilation of Best Hydro Dipping Videos Top 5 Hydro Dip. | false | Reddit |
Would 8GB of RAM suffice for the next few years?. Hi there r/Mac , i’m planning on getting a new Macbook Pro for university and am torn between 8GB or 16GB of ram. I’m mainly using my laptop for general productivity (ie. word processing, powerpoints, excel, google docs) and nothing intensive such as photoshop/video editing.
This is a sizeable purchase for me and i plan on keeping it for the next 4/5 years. It’s my first Macbook Pro.
Thanks /r/Mac !! | false | Reddit |
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>
| false | Stackexchange |
this advertisement’s “great” deals. | false | Reddit |
"Degree 3 fields". <p>I was wondering what was known about fields $k$ having the property that any polynomial
over $k$ of degree $3$ has <em>at least one</em> root in $k$. Does such a field have a special name ?
Is there some kind of classification ? </p>
<p>Many thanks ...</p>
| false | Stackexchange |
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>
| false | Stackexchange |
Famitsu confirms with The Pokémon Company that Pokémon let's go have online features (battles, trades) with the paid online subscription. | false | Reddit |
Software Crash Analysis for Automatic Exploit Generation on Binary Programs by Shih-Kun Huang, Min-Hsiang Huang, Po-Yen Huang, Han-Lin Lu, and Chung-Wei Lai. | true | Reddit |
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>
| false | Stackexchange |
U.S. Investigates Whether Blackwater Tried Bribery. | false | Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| false | Stackexchange |
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. :)
| false | Reddit |
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. | false | Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| false | Stackexchange |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
Rescued this Creeping Jenny. What does it look like she needs (doesnt need)?. | false | Reddit |
RecyclerView.Adapter.notifyItemMoved(0,1) scrolls screen. <p>I have a RecyclerView managed by a LinearlayoutManager, if I swap item 1 with 0 and then call mAdapter.notifyItemMoved(0,1), the moving animation causes the screen to scroll. How can I prevent it?</p>
| false | Stackexchange |
I think this is a pretty good start to my Blu-ray collection.. | false | Reddit |
Drop Internet Connection If VPN Drops. <p>I am running <code>OpenVPN</code> and want a way in <code>Ubuntu</code> to drop my wifi connection if <code>OpenVPN</code> loses connection. </p>
<p>Is this something that is achievable, and if yes, how would I do it?</p>
| false | Stackexchange |
Indigenous European Sami in regional dress protesting with native Americans against oil pipelines. 2016.. | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
Grandmaster level boop. | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
‘Star Wars’ Force for Change: Fans Can Win a Role in ‘Star Wars: Episode VII’. http://www.omaze.com/experiences/starwars-episode-vii You can donate to Unicef for a chance to win a role in Episode VII! Also some cool rewards for donating. | false | Reddit |
Pascal's Wager is Wrong.. | false | Reddit |
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>
| false | Stackexchange |
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? | false | Reddit |
First book for calculus. <p>I am in high school (18 years old) and I'd like to buy a calculus book.
I'm interested in Spivak's calculus book.
I love mathematics so I am motivated, but I don't want to read something too advanced neither a simple and basic textbook.</p>
| false | Stackexchange |
The reason I woke up this morning. | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
Integrating serenity/thucidydes with spock. <p>I am working on automation tests with selenium webdriver and spock framework. I would like to know how can I integrate serenity with spock testing?
My project is build with gradle and groovy is the language used for writing tests. Any sample class files or links will be appreciated.</p>
<p>Thanks,
RV</p>
| false | Stackexchange |
Wading through Water. NEED ANSWER ASAP
I'm about to throw a new party I am DMing for (about 2hrs from now) through a sewer dungeon crawl in an urban setting. My idea was the deeper down they went they'd have to deal with deeper and deeper sewage to wade through. I only just realized that one of my PC's is a halfling. I was going to have water come up to waist height on the mostly human party to restrict their movements. Am I going to have to tell the poor halfling to make swim checks? | false | Reddit |
Manually Retry Job in Delayed_job. <p>Delayed::Job's auto-retry feature is great, but there's a job that I want to manually retry now. Is there a method I can call on the job itself like...</p>
<pre><code>Delayed::Job.all[0].perform
</code></pre>
<p>or run, or something. I tried a few things, and combed the documentation, but couldn't figure out how to execute a manual retry of a job.</p>
| false | Stackexchange |
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. | true | Reddit |
3D Printed Guitar with internal lighting and a vintage neck. | false | Reddit |
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>
| false | Stackexchange |
Website testing for some percent of visitors. <p>What's the name of website testing method when the new feature is shown only for some users (not for all), for instance 20%?
Are there some online services for that?
I know about A/B testing but I'm not sure that's what I need.</p>
| false | Stackexchange |
More New York Times shorts. "14 Actors Acting" playlist from 2010. Black and white with symphony instruments and no voices. 1080p available.. | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
Found on the back of an old bike. | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
3 friends.. | false | Reddit |
You left your account open and I made a post so I must be a hacker!. | false | Reddit |
When you stub your toes.... | false | Reddit |
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>
| false | Stackexchange |
Stargazing over a secluded beach in Corsica [1600x2000] [OC]. | false | Reddit |
My husky took my chair. | false | Reddit |
Developer of Sherlock Holmes: Crimes and Punishment announce new Lovecraftian game. | false | Reddit |
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? | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
I'll just leave this here for you guys.. | false | Reddit |
Cursed_ can you imagine drinking that. | false | Reddit |
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>
| false | Stackexchange |
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>
| false | Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| false | Stackexchange |
Cybersecurity Topic Classification (CTC) Dataset
Note: This is an unofficial upload of the Cybersecurity Topic Classification (CTC) dataset. The original dataset and accompanying paper were developed by Elijah Pelofske, Lorie M. Liebrock, and Vincent Urias.
This dataset comprises training and validation data for the Cybersecurity Topic Classification (CTC) tool, as introduced in the paper "A Robust Cybersecurity Topic Classification Tool" by Elijah Pelofske, Lorie M. Liebrock, and Vincent Urias. The dataset facilitates the detection of cybersecurity-related discussions in natural English text.
Dataset Overview
The dataset includes unprocessed English text samples labeled as either cybersecurity-related or non-cybersecurity-related. These samples were sourced from Reddit, StackExchange sites, and arXiv documents, utilizing user-defined tags and metadata for labeling. Please note that the data has not undergone manual labeling, post-processing, filtering, or censorship; therefore, some labels may be incorrect.
Accessing the Data
You can load this dataset directly using the Hugging Face datasets
library:
from datasets import load_dataset
dataset = load_dataset("naufalso/cybersec-topic-classification-dataset")
Usage
This dataset is intended for research purposes, particularly in training and evaluating machine learning models for cybersecurity topic classification. Users should be aware of the potential for incorrect labels and the unprocessed nature of the text data.
Citation
If you utilize this dataset in your research, please cite the original paper:
@article{pelofske2021robust,
title={A Robust Cybersecurity Topic Classification Tool},
author={Pelofske, Elijah and Liebrock, Lorie M. and Urias, Vincent},
journal={arXiv preprint arXiv:2109.02473},
year={2021}
}
Acknowledgments
We extend our gratitude to the authors for providing this dataset and to the platforms Reddit, StackExchange, and arXiv for making their data publicly accessible.
For additional information and resources, please refer to the original GitHub repository.
- Downloads last month
- 108