text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
Public Approval Of Obamacare Hits Record High Ahead Of 2018 Midterms. | 0non-cybersec
| Reddit |
Drools disable a rule at runtime. <p>I'm starting a project whith Drools and Drools Guvnor.</p>
<p>My rules are deployed in drools guvnor. My rule engine instance can access those rules via the pkg file exposed by drools Guvnor when you do a package release build and release.</p>
<p>This is all working fine, what I'm looking for is a solution for disabling a rule at runtime. </p>
<p>The only solution I have right now is to go to guvnor, archive the rule and do a build + release of the package containing that rule.</p>
<p>Isn't there another strategy ?</p>
| 0non-cybersec
| Stackexchange |
Metapost suffix to string. <p>Is there a way to convert <em>suffix</em> to <em>string</em>?
More specifically, i need to do something like this:</p>
<pre><code>def myMacro (suffix a, b) =
something.a = fOne(a);
something.b = fOne(b);
something.scantokens("somethingelse"&**suffixtostring**(a)&**suffixtostring**(b)) = fTwo(a,b);
enddef;
</code></pre>
| 0non-cybersec
| Stackexchange |
Just moved house, mum said she didn't know what it's from but they were fun to play with.. | 0non-cybersec
| Reddit |
Grobner basis: Basis for K-vector space.. <p>This is a problem from my Groner basis class. I am unsure about how to do this problem:</p>
<blockquote>
<p>Let <span class="math-container">$A$</span> be an ideal of <span class="math-container">$R=K\left[x_{1},...,x_{n}\right]$</span>, and let <span class="math-container">$G=\{g_{1},...,g_{t}\}$</span> be a Grobner basis for <span class="math-container">$A$</span>. We want to prove that a basis for the <span class="math-container">$K$</span>-vector space <span class="math-container">$R/A$</span> is
<span class="math-container">$$\left\{X+A \ | \ X\in \mathbb{T}^{n}, lp(g_i)\; \text{does not divide}\; X, \forall i=1, \dots ,t\right\}.$$</span></p>
</blockquote>
<p>lp: leading product, <span class="math-container">$\mathbb{T}^n$</span>: the set of all power products, <span class="math-container">$f\xrightarrow{G}_{+}r$</span> : <span class="math-container">$f=\sum_{i}u_ig_i+r, u_i\in R, g_i\in G$</span> (reduction modulo <span class="math-container">$G$</span>)</p>
<p>My attempt:</p>
<p>Suppose <span class="math-container">$A \leq R$</span> and <span class="math-container">$G=\{g_{1},...,g_{t}\}$</span> is a Grobner basis for <span class="math-container">$A$</span>. If <span class="math-container">$f\in R$</span> then <span class="math-container">$f\xrightarrow{G}_{+}r$</span>, <span class="math-container">$r$</span> reduced w.r.t <span class="math-container">$G$</span>. Then, the coset representative for <span class="math-container">$R/A$</span> is
<span class="math-container">$\left\{r+A \ | \ f \in R, f\xrightarrow{G}_{+}r\right\}$</span>
Notice that <span class="math-container">$r=\sum_{i}c_iX_i$</span>, where <span class="math-container">$c_i \in K, X_i\in \mathbb{T}^n$</span>. We have that since <span class="math-container">$r$</span> reduced w.r.t G, <span class="math-container">$lp(g_i)$</span> not divide <span class="math-container">$lp(r), \forall i=1,...,t$</span> or <span class="math-container">$r=0$</span>, then it means that <span class="math-container">$X=\max{X_i}=lp(r)$</span> does not divisible by <span class="math-container">$lp(g_i)$</span>. Hence, a basis for the <span class="math-container">$K$</span>-vector space <span class="math-container">$R/A$</span> is <span class="math-container">$$\left\{X+A \ | \ X\in \mathbb{T}^n, lp(g_i)\; \text{does not divide}\; X, \forall i=1,\dots...,t\right\}$$</span></p>
<p>I don't know whether my proof is correct or not. Really unsure about this.</p>
| 0non-cybersec
| Stackexchange |
Get static property by string. <p>I have <code>public static class MyClass</code> which contains many <code>public static string</code> parameters.</p>
<p>Following I have some value</p>
<pre><code>string val = "something";
</code></pre>
<p>Using that <code>val</code> I want to be able to get specified property - like <code>MyClass.something</code>.
How can I do that ?</p>
| 0non-cybersec
| Stackexchange |
Do professional chefs use meat thermometers?. I've been watching a lot of cooking shows on TV and when the contestants cook meat they always stress over the doneness. Some percentage of the time, they're even raw.
Are they not allowed to use meat thermometers, or is it viewed as armature to use one for that matter?
If I were a constant on TV, I don't care how well I think I can check by hand, there'd be a thermometer in every protein in front of me.
| 0non-cybersec
| Reddit |
Less 'sexy' cancers: A rather sickly pink. "This enormous blaze of publicity around breast cancer stops people thinking about women with other cancers and other diseases.". | 0non-cybersec
| Reddit |
Men of reddit, How do you handle a woman who has a bad personality? wether in a relationship or just friends.. Edit: I got my answer. if mod can see this, Please lock this thread. ty | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Heated argument spirals out of control. | 0non-cybersec
| Reddit |
Should linux cron jobs be specified with an "&" to indicate to run in background?. <p>In a crontab file, should commands be specified with a trailing "&", or will the command run in the background anyway?</p>
<p>I have:</p>
<pre><code>*/20 * * * * /home/me/monitor/check.sh /home/me/monitor/check.properties >> /home/me/monitor/check.log 2>&1 &
</code></pre>
<p>I've seen contradictory answers to this question in various places. Some say no need to put an "&", others that without the ampersand cron waits for output from the command, even though all output is redirected.</p>
| 0non-cybersec
| Stackexchange |
This is great lol. | 0non-cybersec
| Reddit |
Performing Open Heart Surgery on a Furby [PDF]. | 1cybersec
| Reddit |
[Art] it's my cakeday apparently, so here's some OC of my two PCs. | 0non-cybersec
| Reddit |
Two sets isometric to their union. <p>Does there exist two sets $A, B \subset \mathbb{R}^2$ such that $A$ and $B$ are both isometric to their union $A \cup B$?</p>
<p>I thought of this question as a little exercise and it seems the answer is no, but I can’t prove it, or come up with a counterexample. </p>
| 0non-cybersec
| Stackexchange |
Inkscape 0.92.0 (snap) fonts problem - Ubuntu 16.10. <p>Inkscape does not see any new installed font.</p>
<ol>
<li>Installed inkscape 0.92 (snap package)</li>
<li>It works and recognizes all default fonts of Ubuntu 16.10</li>
<li>Installed new font with font manager (Roboto ttf font family)</li>
<li>Restarted inkscape and system. Inkscape does not "see" new font.</li>
<li>Installed roboto font by copying directly to the <code>usr/share/fonts/</code> folder. Refreshed font cache. Restarted system. Inkscape still does not see new font.</li>
</ol>
<p>I've tried with couple of different fonts, and the situation is the same. </p>
<p>New fonts are appearing in LibreOffice for example, but not in Inkscape (maybe I need to ask elsewhere if it's Inkscape's problem?)</p>
| 0non-cybersec
| Stackexchange |
[Cosplay] World Class by 前羽_rr. http://imgur.com/a/kElk1
While roaming around facebook I came across this album I think r/anime will have a field day with it.
Hope it is not a repost, enjoy~
Source: http://m.weibo.cn/u/1628426184 | 0non-cybersec
| Reddit |
Got it to balance on my car key. | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Converting (7,5) Cartesian coordinates to polar coordinates. <p>Find the point (r, $\theta$) in polar coordinates given the fact that when converted in Cartesian coordinates, the point is $(7,5)$. Use that to find the point $\left( 2r, \theta + \frac{\pi}{2} \right)$ in rectangular coordinates.</p>
<p>I found that $r = \sqrt{7^2+5^2} = \sqrt{74}$</p>
<p>However, I'm having trouble with $\theta$. I know that I would have to find $\tan \theta = \frac{5}{7}$, and then find $\theta$ from that, but I'm not sure how to find it so that it is in neat terms like $\frac{\pi}{6}$, so that it would be easier to add it to $\frac{\pi}{2}$. </p>
<p>Any hints?</p>
| 0non-cybersec
| Stackexchange |
T-SQL Case statement strange behavior with newid() as randomness source. <p>I'm using SQL Server 2012.</p>
<p>If I do the following to get a list of random-ish numbers in the range [1,3], it works just fine:</p>
<pre><code>SELECT TOP 100
ABS(CHECKSUM(NEWID()))%3 + 1 [value_of_rand]
FROM sys.objects
</code></pre>
<p>and I get nice things like this (all between 1 and 3).</p>
<pre><code>3
2
2
2
1
....etc.
</code></pre>
<p>But if I then put the output of that same chained-random-value function into a CASE statement, it apparently does not produce only the values 1,2,3.</p>
<pre><code>SELECT TOP 100
CASE (ABS(CHECKSUM(NEWID()))%3 + 1)
WHEN 1
THEN 'one'
WHEN 2
THEN 'two'
WHEN 3
THEN 'three'
ELSE
'that is strange'
END [value_of_case]
FROM sys.objects
</code></pre>
<p>It outputs:</p>
<pre><code>three
that is strange
that is strange
one
two
...etc
</code></pre>
<p>What am I doing wrong here?</p>
| 0non-cybersec
| Stackexchange |
Woolrich to Close American Plant by Year's End. | 0non-cybersec
| Reddit |
pandas.concat of multiple data frames using only common columns. <p>I have multiple pandas data frame objects cost1, cost2 , cost3 ....</p>
<ol>
<li>They have different column names (and number of columns) but have some in common.</li>
<li>Number of columns are fairly large in each dataframe, hence handpicking the common columns manually will be painful.</li>
</ol>
<p>How can I append rows from all of these data frames into one single data frame
while retaining elements from only the common column names ?</p>
<p>As of now I have</p>
<p>frames=[cost1,cost2,cost3...]</p>
<p>new_combined = pd.concat( frames,ignore_index=True)</p>
<p>This obviously contains columns which are not common across all data frames.</p>
| 0non-cybersec
| Stackexchange |
Removable Singularity Problems at $z = 0$. <p>My problem is to find the radius of convergence <span class="math-container">$R$</span> of the function <span class="math-container">$f(z) = \frac{z}{\sin(z)}$</span> around the the point <span class="math-container">$z_{0} = \pi i$</span>. I find the singularities of <span class="math-container">$f(z)$</span> are <span class="math-container">$z = n \pi$</span> (<span class="math-container">$n$</span> is integer). But why <span class="math-container">$z = 0$</span> is a removable singularity? If considering another function <span class="math-container">$g(z) = \frac{z^{2}}{(\sin(z))^{3}}$</span>. At <span class="math-container">$z = 0$</span> is a pole. Can you please explain to me how to determine the difference between these two types of singularities.? </p>
| 0non-cybersec
| Stackexchange |
Unable to modify DCOM Config properties for a single application in Component Services. <p>The following is appearing in the application server role events. </p>
<blockquote>
<p>The machine-default permission
settings do not grant Local Activation
permission for the COM Server
application with CLSID
{000C101C-0000-0000-C000-000000000046}
to the user [Domain][User] SID
([SID]) from address LocalHost (Using
LRPC). This security permission can be
modified using the Component Services
administrative tool.</p>
</blockquote>
<p>I've solved a similar (application permission) problem on "IIS WAMREG admin Service" before by going into Component Services and assigning the correct permissions (Activate & Launch). However, the previous method seems impossible as all the properties are disabled for app id {000C101C-0000-0000-C000-000000000046}, also I noticed that it doesn't have a name - there are a few applications without a name, but the properties aren't disabled on them.</p>
<p>This is a fresh install of server 2008 (Std not R2) with sharepoint server 2010. Nothing appears to be "broken" that I notice, but I get many errors (over 100 for a single minute around 1am) in the event log and this isn't fun.</p>
<p>I've found a few pointers on google <a href="http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/47fc256c-7419-492b-a981-5c0bcb68774a" rel="nofollow noreferrer">here</a>, <a href="http://www.velocityreviews.com/forums/t103476-access-denied-attempting-to-launch-a-dcom-server-the-server-is-000c101c-0000-0000-c000-000000000046-the-user-is-aspnet-servername-sid-s-1-5-21-1606980848-602162358-1801674531-1007-a.html" rel="nofollow noreferrer">here</a> & <a href="http://support.microsoft.com/kb/931355/en-us" rel="nofollow noreferrer">here</a>, but am not convinced I should be changing the registry to solve this. According to <a href="http://arstechnica.com/phpbb/viewtopic.php?f=17&t=162481" rel="nofollow noreferrer">this</a> the app is MSIServer, but that doesn't appear. Does anyone know what the problem is, and why this is happening, and why I can't change the properties to solve the problem?</p>
| 0non-cybersec
| Stackexchange |
In OSX 10.8 how do I constrain a subview to be the same size as its parent view. <p>I have the default NSWindow created in a new application which has a single NSView. I then create a new NSViewController which has it's own XIB and a view. In the app delegate I do the obvious</p>
<pre><code>self.mainViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
[self.window.contentView addSubview:self.mainViewController.view];
self.mainViewController.view.frame = ((NSView*)self.window.contentView).bounds;
</code></pre>
<p>OK, how do I set a constraint in the new way to have my subview keep its size identical to the Window, i.e. it's superview. It doesn't seem to work automatically. Autoresizessubviews is ON for both views.</p>
| 0non-cybersec
| Stackexchange |
Do you guys have any favourite (but easy) chicken breast recipes?. My boyfriends birthday is coming up and I was planning to surprise him with a fancy home cooked meal. I work a lot so I wont have the time for a lot of preparation, so I was hoping you guys new of any quick and easy, but most important, delicious chicken breast recipes (he loves chicken). Thanks! | 0non-cybersec
| Reddit |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Is the semantics of a first order logic system defined as part of the first order logic system?. <p>Does a first order logic system consist <strong>only</strong> of</p>
<ul>
<li>a first order language</li>
<li>a first order deductive system?</li>
</ul>
<p>Is a first order logic system <strong>nothing more than</strong> a formal system?</p>
<p>Is the semantics of a first order logic system defined as <strong>part of</strong> the first order logic system? In other words, is a first order logic system defined to also consist of its semantics? (By semantics, for example, the logical consequential relation between formulas)</p>
<p>Thanks.</p>
| 0non-cybersec
| Stackexchange |
Nintendo says there won’t be supply issues, but the Switch is already sold out at major retailers on both sides of the pond.. | 0non-cybersec
| Reddit |
How to fix a "java.io.IOException: unexpected end of stream on Connection" exception in HTTPClient on .NetStandard. <p>I have been scratching my head with this one for a while. I'm building an Android app in Xamarin and I have a login POST request that mostly works, but will occasionally recieve this error. I notify the user and tell them to try again but I am still getting the error far too often and want to fix it so the app provides a smoother experience.</p>
<p>Here is the stack trace I have logged on App Center:</p>
<pre><code>LoginProvider+d__1.MoveNext () C:\source\repos{MyApp}{MyApp}{MyApp}\Services\LoginProvider.cs:35
java.io.IOException: unexpected end of stream on Connection{testclarity.i-menzies.com:443, proxy=DIRECT@ hostAddress=62.244.173.166 cipherSuite=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 protocol=http/1.1} (recycle count=0)
com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:210)
com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:905)
com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:789)
com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443)
com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)
com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
Caused by: java.io.EOFException: \n not found: size=0 content=...
com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:200)
com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
</code></pre>
<p>I am using .NETStandard 2.0, with Xamarin Forms 3.2.0.871581.</p>
<p>I have scoured most of Google and identified that this is an issue with various Android libraries, especially OkHttp (the same one mentioned in my stack trace). I've tried investigating the .NETStandard source on Github to identify the possible cause, but I find the project very difficult to navigate, especially as this problem seems to be Android specific. <strong>Any advice on finding the right source would be ideal.</strong> </p>
<p>Things I have tried based on suggestions from the internet:</p>
<ul>
<li>Setting my connection header to closed. </li>
<li>Setting my transfer encoding
to chunked. </li>
<li>Swapping out the Android HttpClient implementation from
Android to Default in the Android project's properties.</li>
</ul>
<p>These seem to be among the popular suggestions online, some of which work for people, some of which don't. </p>
<p>Another common suggestion is setting the OkHttp library's configuration to OkHTTP.setRetryOnConnectionFailure(true), which apparently fixes the problem for many people, as suggested here: <a href="https://github.com/square/okhttp/issues/1517#issuecomment-144069139" rel="noreferrer">https://github.com/square/okhttp/issues/1517#issuecomment-144069139</a>.</p>
<p>Also, a similar bug seems to have been filed in Xamarin.Android here: <a href="https://bugzilla.xamarin.com/show_bug.cgi?id=41100" rel="noreferrer">https://bugzilla.xamarin.com/show_bug.cgi?id=41100</a>. But this has been marked as fixed. I'm not sure whether this would feed into my Xamarin Forms project.</p>
<p>Does anyone know how I can fix this problem or how I can investigate further beyond what I've already tried?</p>
| 0non-cybersec
| Stackexchange |
How do I assign the output of a command to a variable in Jupyter notebook?. <p>Is there a way to assign a value to a variable, that value which we get in terminal by writing any command?</p>
<p>I try with this code:</p>
<pre><code>!number_of_lines=$(wc -l < cord_19.json)
!echo $number_of_lines
</code></pre>
<p>I get empty output.
When I run </p>
<pre><code>!wc -l < cord_19.json
</code></pre>
<p>I get correct response with number.</p>
<p>Do you have idea what is wrong or how can I set variable?</p>
| 0non-cybersec
| Stackexchange |
wget download only certain folders from site. <p>I want to download <a href="http://www.s-manuals.com/smd/" rel="nofollow noreferrer">this site</a> with wget, and to do this I'm using this command:</p>
<pre><code>wget.exe --no-clobber --no-parent -r --convert-links --page-requisites -U Mozilla "http://www.s-manuals.com/smd/"
</code></pre>
<p>That's ok for me, but the linked PDF files are located in a folder in the same level of my URL example:</p>
<pre><code>http://www.s-manuals.com/pdf/datasheet/a/f/afn3400_alpha-mos.pdf
</code></pre>
<p>So I need to download the <code>/pdf/</code> folder too. The issue is that if its in the same level dir the <code>--no-parent</code> options avoid this dir, but if I remove the <code>--no-parent</code> the entire site is going to be downloaded, so I'm wondering if there is a option that allow me to download only these 2 folders? </p>
| 0non-cybersec
| Stackexchange |
OnTouchListerner shall not interpret swipes to open DrawerLayout as Long Click. <p>I'm detecting clicks in my recyclerview using the OnItemTouchListener class below. Unfortunately, this does not work well when using a <code>DrawerLayout</code>. If I swipe to open the <code>DrawerLayout/NavigationView</code>, my <code>OnItemTouchListener</code> gets this event too and executes the <code>onLongClick</code> action.</p>
<p>This does not happen if I use the ViewHolders' <code>View.OnLongClick</code>. What's the little secret, Views' OnLongClickListener checks before firing an LongClick-event to detect that the drag-action is not a long click, but a gesture to open the drawer?</p>
<pre><code>class OnItemTouchListener(context: Context, recyclerView: RecyclerView, private var onTouchCallback: ItemTouchListener) : RecyclerView.OnItemTouchListener {
//region Variables
private val gestureDetector: GestureDetector
//endregion
init {
gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
override fun onSingleTapUp(e: MotionEvent?): Boolean {
return true
}
override fun onLongPress(e: MotionEvent?) {
val child: View? = recyclerView.findChildViewUnder(e!!.x, e.y)
if (child != null) {
onTouchCallback.onItemLongClick(child, recyclerView.getChildLayoutPosition(child), e)
}
super.onLongPress(e)
}
})
}
//region TouchHandler
override fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean {
val child = rv.findChildViewUnder(e.x, e.y)
if (child != null && gestureDetector.onTouchEvent(e)) {
onTouchCallback.onItemClick(child, rv.getChildLayoutPosition(child), e)
}
return false
}
override fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {
}
override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) {
}
//endregion
interface ItemTouchListener {
fun onItemClick(view: View, pos: Int, e: MotionEvent)
fun onItemLongClick(view: View, pos: Int, e: MotionEvent)
}
companion object {
fun isViewClicked(container: View, @IdRes viewId: Int, e: MotionEvent): Boolean {
val view = container.findViewById<View>(viewId)
val rect = Rect()
view.getGlobalVisibleRect(rect)
return view.isVisible && rect.contains(e.rawX.toInt(), e.rawY.toInt())
}
}
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Taking ages to create MSSQL DB on GCE. <p>I am setting up infrastructure on GCE and we use MSSQL for DB.</p>
<p>Since now, we used AWS EC2 and it took about 15 seconds to create fresh new SQL database with initial size 50GB on gp2 storage.</p>
<p>If I now try to do the same on GCE it takes about 4 minutes.</p>
<p>I've had tried with same OS version and SQL version as it is on AWS and I've tried with the latest software (WinServer2016 and SQL2016), used SSD persistent disk storage (200GB) and I used instance n1-standard-8 to do it. I've also setup SQL server the same as on AWS.</p>
<p>Any hints why is taking so long to create new DB on GCE?</p>
<p>I know making initial size smaller will speed things up for DB creation but I am worried for DB auto growth.</p>
<p>Best regards,
Matjaz</p>
| 0non-cybersec
| Stackexchange |
Pass function from HOC to component (React, React native). <p>I am a beginner regarding Facebooks ReactJS and React-native, so I started coding with help of a tutorial, showing
<a href="http://blog.differential.com/sharing-code-between-android-and-ios-in-react-native/" rel="noreferrer">how to share code between Android and iOS</a>.</p>
<p>Later in this tutorial a button is implemented, which toggles a state.
Unfortunately this is made with a mixin. I want to do it with an HOC-component.</p>
<p><strong>Original mixin</strong></p>
<pre><code>export default {
getInitialState() {
return {
pressed: false
}
},
handlePress() {
this.setState({pressed: !this.state.pressed});
}
}
</code></pre>
<p><strong>Original call of above mixin</strong></p>
<pre><code>{ ...
render() {
const buttonStyle = [styles.button];
if (this.state.pressed) buttonStyle.push(styles.buttonPress);
return (
<TouchableOpacity onPress={this.handlePress.bind(this)} style={buttonStyle}>
<Text style={styles.text}>{this.props.text}</Text>
</TouchableOpacity>
)
}
}
reactMixin.onClass(Button, ButtonCommon);
export default Button;
</code></pre>
<p><strong>My HOC</strong></p>
<pre><code>export var ButtonComp = (ComposedComponent) => class extends Component {
constructor(props) {
super(props);
this.state = {pressed: false};
}
handlePress() {
this.setState({pressed: !this.state.pressed});
}
render() {
return <ComposedComponent {...this.props} data={this.state.pressed} />;
}
};
</code></pre>
<p><strong>My HOC usage</strong></p>
<pre><code>import { ButtonComp } from './button.common';
class Button extends Component {
render() {
const buttonStyle = [styles.button];
if (this.props.data) buttonStyle.push(styles.buttonPress);
return (
<TouchableOpacity onPress={this.handlePress.bind(this)} style={buttonStyle}>
<Text style={styles.text}>{this.props.text}</Text>
</TouchableOpacity>
)
}
}
export default ButtonComp(Button); // Enhanced component
</code></pre>
<p>When I execute above code, I get the following error (when the call of this.handle happens, so in the TouchableOpacity tag):</p>
<p><em>undefined is not an object (evaluating 'this.handlePress.bind')</em></p>
<p>So what am I doing wrong? Are HOC only to pass data, not functions?
Thanks for the help!</p>
| 0non-cybersec
| Stackexchange |
Dinosaurs Vs Shark | Gorilla Lion Pig Cartoons | Animals Nursery Rhymes .... | 0non-cybersec
| Reddit |
how to get a split-pot/total mindf**k at a poker game... (nothing arranged, pure luck..). | 0non-cybersec
| Reddit |
Researchers identify multiple molecules that shut down SARS-Cov-2 polymerase reaction. | 0non-cybersec
| Reddit |
Why did terminal delete all my desktop files?. <p>I have been looking for a way to delete a folder which I simply cannot delete on my Mac. I guess this folder must belong to an old system because its folder name contains HFS+. Anyway, I came across an article which says I can delete a file or a folder directly from terminal, so I tried but it didn’t delete the HFS+ folder. What this command did delete instead was ALL my desktop files and folders.</p>
<p>Can someone please tell me what I have done wrong here?</p>
<p>The command that I typed in terminal is rm ~rf /.trash/*</p>
| 0non-cybersec
| Stackexchange |
NVIDIA to skip 600-series, jump straight to GeForce GTX 780? Did I mention it is nearly twice as fast as the GTX 580?. | 0non-cybersec
| Reddit |
LPT: As your well-trained dog reaches the last few years of life and you want to have another dog, get a puppy while your older dog is alive so it can learn how to behave from your older dog. | 0non-cybersec
| Reddit |
Overwrite single file in my current branch with the same file in the master branch?. <p>Say I have two branches - <code>master</code> and <code>redesign</code>. How would I go about overwriting the file <code>default.aspx.cs</code> in my redesign branch with the one from master?</p>
<p>I found <a href="https://stackoverflow.com/questions/692246/how-do-i-revert-one-file-to-the-last-commit-in-git">this question</a> but it seems to go over how to revert a file back to it's previous version in the same branch. I also considered using a <code>merge</code>, but I don't want to merge, I want to overwrite. Suggestions?</p>
| 0non-cybersec
| Stackexchange |
One arm, one leg full bridge. Is this safe? What I mean is, get into a full bridge (like so https://d3vs5ss8iow0ry.cloudfront.net/video-library/thumbnail/back-bridge_-_step_1.max.v1.png), and then lift one arm off the ground followed by the opposite leg, so that you are supporting yourself with one arm and one leg. I started to attempt this today but it just felt like something my body wasn't supposed to do. Is there any reason not to try it? | 0non-cybersec
| Reddit |
Java 8 Method references called on a local variable. <p>I am in the process of learning Java 8 and I came across something that I find a bit strange.</p>
<p>Consider the following snippet:</p>
<pre><code>private MyDaoClass myDao;
public void storeRelationships(Set<Relationship<ClassA, ClassB>> relationships) {
RelationshipTransformer transformer = new RelationshipTransformerImpl();
myDao.createRelationships(
relationships.stream()
.map((input) -> transformer.transformRelationship(input))
.collect(Collectors.toSet())
);
}
</code></pre>
<p>Basically, I need to map the input set called <code>relationships</code> to a different type in order to
conform to the API of the DAO I'm using. For the conversion, I would like to use an existing <code>RelationshipTransformerImpl</code> class that I instantiate as a local variable.</p>
<p>Now, here's my question:</p>
<p>If I was to modify the above code as follows:</p>
<pre><code>public void storeRelationships(Set<Relationship<ClassA, ClassB>> relationships) {
RelationshipTransformer transformer = new RelationshipTransformerImpl();
myDao.createRelationships(
relationships.stream()
.map((input) -> transformer.transformRelationship(input))
.collect(Collectors.toSet())
);
transformer = null; //setting the value of an effectively final variable
}
</code></pre>
<p>I would obviously get a compilation error, since the local variable <code>transformer</code> is no longer "effectively final". However, if replace the lambda with a method reference:</p>
<pre><code>public void storeRelationships(Set<Relationship<ClassA, ClassB>> relationships) {
RelationshipTransformer transformer = new RelationshipTransformerImpl();
myDao.createRelationships(
relationships.stream()
.map(transformer::transformRelationship)
.collect(Collectors.toSet())
);
transformer = null; //setting the value of an effectively final variable
}
</code></pre>
<p>Then I no longer get a compilation error! Why does this happen? I thought the two ways to write the lambda expression should be equivalent, but there's clearly something more going on.</p>
| 0non-cybersec
| Stackexchange |
Why ulimit can't limit resident memory successfully and how?. <p>I start a new bash shell, and execute:</p>
<pre><code>ulimit -m 102400
ulimit -a
"
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) 102400
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
"
</code></pre>
<p>and then ,I execute compiling a huge project. the Linking of it will use large memory, more then 2G. The result, process ld used more then 2G resident memory.</p>
<p>is there any wrong ? how to use ulimit or can I use other programs to limit resident memory?</p>
<p>the target of limit resident memory, is because computer will freeze when one process almost used all memory.</p>
| 0non-cybersec
| Stackexchange |
How can I contribute to Ubuntu 12.04?. <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://askubuntu.com/questions/692/how-can-i-contribute-to-ubuntu">How can I contribute to Ubuntu?</a> </p>
</blockquote>
<p>I'm a noob, but I want to help, I want to be apart of Ubuntu. What can I do to learn, or help with the development of Ubuntu 12.04?</p>
| 0non-cybersec
| Stackexchange |
What are the potential security risks of using a commercial VPN service?. <p>Commercial VPN services are gaining a lot of popularity and some of them are heavily advertising their products on social media networks and technology magazines today. </p>
<p>The advantages of using such a service could be privacy from ISPs and additional protection from man-in-the-middle attacks when connecting mobile devices to obscure networks, if no own private server to tunnel the connection to is available to the user. </p>
<p>But what are the risks involved in using such a service? </p>
<p>It's recommended to research and find a trustworthy VPN service, if needed. What could happen, if the service provider acts against their users? (Because of malicious intent or a security breach)</p>
<p>In a <a href="https://security.stackexchange.com/questions/83871/what-are-the-risks-in-using-a-vpn-tunnel">similar question</a>, it was mentioned that the VPN service provider could be monitoring the users' traffic, instead of their ISP, but the question was more directed toward the outward appearance of the user by connecting to a VPN in general. </p>
<p>What additional security risks could a commercial VPN service potentially <em>introduce</em>, compared to using a direct connection to the target server? </p>
<p>Sub questions: </p>
<ul>
<li>Could the VPN provider supply manipulated websites to the user? Would HTTPS protect from this?</li>
<li>Can the VPN connection potentially work both ways, as in: The provider gaining access to home networks? (When using OpenVPN or proprietary client software)</li>
<li>Can the customer information be falsified and lead to incorrect incrimination on basis of the illegal activity of another user with shared server resources? Or even fabricated evidence?</li>
</ul>
<p>Are there other risks involved?</p>
| 1cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Silencing “Your disk is almost full” notification. <p>Since none of the solutions found here <a href="https://apple.stackexchange.com/questions/254485/silencing-your-disk-is-almost-full-notification">Silencing "Your disk is almost full" notification</a> worked for me on Mojave, I simply disabled the deamon.</p>
<pre><code>sudo mv /System/Library/PrivateFrameworks/StorageManagement.framework/Resources/diskspaced /System/Library/PrivateFrameworks/StorageManagement.framework/Resources/diskspaced.disabled
</code></pre>
<p>Brute force, I know, but unloading/removing/disabling using launchctl didn't work and I got annoyed.</p>
<p>Is there a more elegant way to turn off Apple's constant nannying alert messages? </p>
| 0non-cybersec
| Stackexchange |
What does "defer features updates" do in Windows Server 2016?. <p>I know what the <a href="http://www.howtogeek.com/223083/what-does-%E2%80%9Cdefer-upgrades%E2%80%9D-in-windows-10-mean/" rel="noreferrer">"defer upgrades" option</a> in Windows 10 does - it allows you to choose between the "<em>Current Branch</em>" and the "<em>Current Branch for Business</em>".</p>
<p>Windows Server 2016, on the other hand, <a href="http://windowsitpro.com/windows-server-2016/current-branch-and-long-term-servicing-branch-windows-server-2016" rel="noreferrer">always uses the "<em>Long Term Servicing Branch</em>"</a>.</p>
<p>Thus, I was surprised to find the following option in the advanced Windows Update options on my newly installed Windows Server 2016 Standard:</p>
<p><a href="https://i.stack.imgur.com/qFJ7J.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qFJ7J.png" alt="screenshot"></a></p>
<p>What does it do? I tried to click on "learn more", but it just links to a <a href="http://go.microsoft.com/fwlink/?linkid=529169" rel="noreferrer">bing search of <code>defer upgrades in Windows 10</code></a>, which, obviously, does not apply to Windows Server 2016.</p>
| 0non-cybersec
| Stackexchange |
I lost my best friend of 18 years today. This is one of my favorite pictures of him.. | 0non-cybersec
| Reddit |
Porter Robinson - Flicker [Future Beats] (2014). | 0non-cybersec
| Reddit |
Best way to shop around for mortgage rates?. Preferably a place where i dont need to make an acct and dont have to spend 20 minutes filling out questions. | 0non-cybersec
| Reddit |
How do you manage multiple versions of the same software for each customer?. <p>I have source code that is 95% the same for all customers. Some customers ask for something specific, however. How can I manage this, is it possible with VisualSVN/Subversion?</p>
<h2>Update:</h2>
<p>Some details about the application, it's a web ASP.NET MVC with NHibernate. </p>
<p>The application has several projects : the web part, the repo part (where we use NHibernate to access database) and a service project.</p>
<p>The service project uses the repo project and the service project is the project with business rules.</p>
| 0non-cybersec
| Stackexchange |
Passing the output of locate as an argument to an editor. <p>What I mean is doing this in a 1-liner:</p>
<pre><code>ubu@ubuntu:~$ locate filename.sh
/home/ubu/path/to/filename.sh
ubu@ubuntu:~$ gedit /home/ubu/path/to/filename.sh
</code></pre>
<p>I can't seem to figure out the right piping to do so</p>
| 0non-cybersec
| Stackexchange |
Cutting spinach noodles. | 0non-cybersec
| Reddit |
Cleveland Cavaliers Beer Bottle Mosaic. | 0non-cybersec
| Reddit |
How to represent characteristic polynomial in terms of those of invariant direct sum subspaces?. <blockquote>
<p>Suppose <span class="math-container">$V$</span> is a complex vector space and <span class="math-container">$V_1,...,V_m$</span> are nonzero subspaces of <span class="math-container">$V$</span> such that <span class="math-container">$V = V_1 \oplus ... \oplus V_m$</span>. Suppose <span class="math-container">$T \in \mathcal{L}(V)$</span> and each <span class="math-container">$V_j$</span> is invariant under <span class="math-container">$T$</span>. For each <span class="math-container">$j$</span>, let <span class="math-container">$p_j$</span> denote the characteristic polynomial of <span class="math-container">$T|_{V_j}$</span>. Prove that the characteristic polynomial of <span class="math-container">$T$</span> equals <span class="math-container">$p_1...p_m$</span>.</p>
</blockquote>
<p>The above question is from <em>Linear Algebra Done Right</em> 3rd ed. Chapter 8C problem 20.</p>
<p>I found and understood the proof from <a href="https://math.stackexchange.com/questions/2974885/direct-sum-and-characteristic-polynomial">here</a>. However since the book above I am (self) studying doesn't introduce determinant till the last chapter, I would be very grateful if someone could help me with a determinant free proof.</p>
<p>Note:<br>
In the book the characteristic polynomial is defined as the product
<span class="math-container">$$(z−\lambda_1)^{m_1}⋯(z−\lambda_n)^{m_n}$$</span>
for some <span class="math-container">$T \in \mathcal{L}(V)$</span> where <span class="math-container">$V$</span> is a finite-dimensional complex vector space, where <span class="math-container">$\lambda_k$</span> are the distinct eigenvalues of <span class="math-container">$T$</span> and <span class="math-container">$m_k$</span> it algebraic multiplicities.</p>
| 0non-cybersec
| Stackexchange |
What is the numerical norm for an Ideal?. <p>I'm reading this text on Algebraic Number theory: (<a href="https://www.jmilne.org/math/CourseNotes/ANT.pdf" rel="nofollow noreferrer">https://www.jmilne.org/math/CourseNotes/ANT.pdf</a>, pg.68). They state the following: </p>
<blockquote>
<p>Let <span class="math-container">$\alpha$</span> be a nonzero ideal in the ring of integers <span class="math-container">$\mathscr{O}_{K}$</span> of a number field <span class="math-container">$K$</span>. Then <span class="math-container">$\alpha$</span> is of <strong>finite index</strong> in <span class="math-container">$\mathscr{O}_{K}$</span> and we let <span class="math-container">$\mathbb{N}\alpha$</span>, <strong>the numerical norm of</strong> <span class="math-container">$\alpha$</span> be this index:
<span class="math-container">$$ \mathbb{N}\alpha = (\mathscr{O}_{K} : \alpha )$$</span> </p>
</blockquote>
<p>Just exactly what index are they referring to? Does this mean that <span class="math-container">$\alpha$</span> has a finite set of ramification indices and we pick the largest? Does it refer somehow to the class number, although how?! </p>
<p>Frantic google searching just returns the definition of a Norm for an ideal, which is explicitly said not to be the same thing. </p>
<p>Would really appreciate anybody who could illuminate this for me. </p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Intermittent switch failure and data flooding, hardware capacity?. <p>We are using a switch (ZIO-SW500) connected to the building main network and we suffers from intermittent network halt. </p>
<p>Normally the network works well.
But, sometimes traffic designated to other IPs floods in and our network halts for a while (1~3 minutes).
Packets were captured by WireShark, and huge number of packets to certain IPs were observed.
(the IPs are not connected to our switch)
Mostly the packet belonged to TCP protocol and we think that the traffic itself is normal.
It seems like that our switch randomly fails to block these packets. </p>
<p>Our network manager tried to help us but as the network break down takes place only 1~3 minutes and about 10 times a day, he cannot find the cause of the problem. </p>
<p>Currently we are considering changing the switch (though this switch is the one replacing the previous one due to the same problem.) under the hypothesis that our swtich had reached its maximum switch capacity and give up working.</p>
| 0non-cybersec
| Stackexchange |
Windows XP ISO not booting. <p>Ok, so I know that similar questions to this have been asked many times, but I think my situation is somewhat unique:</p>
<p>I'm trying to re-install Windows XP Pro on 3 older machines (they have OEM copies, so I am using the Product Keys on the stickers on the cases). I downloaded an .iso of Windows XP Pro 32 bit SP3 direct from Microsoft: <a href="http://www.microsoft.com/en-us/download/confirmation.aspx?id=25129" rel="nofollow noreferrer">http://www.microsoft.com/en-us/download/confirmation.aspx?id=25129</a></p>
<p>First, I tried burning an install disc on a CD-RW. The disc looked good (was not just an .iso file, had autorun and all the other things you would expect). In one machine, I would get the "Press any key to boot from CD" prompt, but nothing happened. In the other machine it wasn't even recognized.</p>
<p>Next, I tried burning a DVD. Again, everything looked good, but the machine still wouldn't recognize it or boot from it.</p>
<p>I tried downloaded Rufus to make a bootable USB (<a href="http://rufus.akeo.ie/" rel="nofollow noreferrer">http://rufus.akeo.ie/</a>), but I get the following error: "This version of Rufus only supports bootable ISOs based on bootmgr/WinPE, isolinux or EFI. This ISO doesn't appear to use either..."</p>
<p>Is this not the correct ISO? Is the problem that I've tried CD-RWs and DVDs, and should just use a CD-R? Any help would be much appreciated.</p>
| 0non-cybersec
| Stackexchange |
ELI5: How does the brain store memories, and how are we able to remember things after having not thought about them for years?. Sometimes something will jog my memory, but it'll cause a lot of other related memories to be released. For example, I was recently near my childhood home and saw an empty lot that was once a miniature golf course. Upon seeing it I vividly remembered going to a birthday party there when I was about 7 or 8. Not only could I remember the party, but I remembered the name of the boy whose birthday it was, what he looked like, the present I brought him, and I remembered a dumb joke I made when I showed up there.
That sort of thing happens from time to time -- something will jog my memory, but I'll be able to remember a lot of other unrelated things. Sometimes when I see a movie, for instance, I'll be able to remember exactly where I was and who I was with the first time I saw the movie. Or other random memories will just pop into my head uninvited.
So my question is this: Where and how are all those memories being stored in my brain? How can I have things that I'd not thought about for possibly decades come back to me with such clarity? Where have they been hiding all this time?
**Edit:** Thank you everyone for all the answers! It makes a lot more sense now, even if the big answer was "we don't know". It's amazing being around for this part of history -- we're learning so much so fast. Who knows what we'll know or be able to do in 20 years. (Also I fixed a spelling error). | 0non-cybersec
| Reddit |
My roommate is different at night (pt2). [part 1 ](https://www.reddit.com/r/nosleep/comments/atvsli/my_roommate_is_different_at_night/?st=JSIZINNK&sh=a3fbf264)
Considering her dad just died, you might be expecting her to cry, but her dad treated her so bad I’m not surprised she didn’t. She didn’t seem too upset, she seems more relieved. I’m still comforting her, but she seems fine.
“Someone broke in and stabbed him to death.”
if I’m being honest, I’m glad he’s dead. Yeah I know It’s a bad thing to say, but he’s caused her so much pain and knowing he suffered and can’t hurt her again makes me feel better. He deserved the shit that happened to him.
“How do you feel.”
“Fine. But I don’t think anyone deserves that fate.”
She really is the nicest person ever. How could a sweet, innocent girl like Amore kill her dad. She couldn’t. She probably has another reason for the blood, or maybe I was dreaming. I have been reading a lot of horror stories lately. We hear a knock on the door and it’s Sky. Her eyes are bloodshot and it’s obvious she’s been crying. She’s the one who found her dad after all.
“There was blood everywhere. It happened right after you left, you got out right in time.”
“I’m really glad you’re okay. I don’t know what I could’ve done if I would’ve lost you. Is mum okay?”
“Yeah I hid with mum in her bedroom.”
She really does seem clueless. I doubt she did it.
A few weeks go by and surprisingly the “sleepwalking” or whatever the fuck that was stopped for a while. Our relationship was amazing, and we officially started dating. I loved her, and I had already forgotten about her dad and that night. I had come to the conclusion that it must have been a dream.
“All you do is eat,” Amore says while giggling.
I eat another brownie. “Okay and? You’re literally just stating facts. Food is my love.”
“What about meee.”
“Okay you’re second.”
She starts fake pouting like a kid does when they don’t get their way.
“You know i love you more than anyone or anything else in the world.” I say with a smile. I can’t believe she’s my girl. She goes in for a kiss and we have an amazing night together and go to sleep.
It eventually got interrupted as around 1am she got up and said she had to go somewhere.
A few hours later she came back covered in blood. Again I thought this must be a dream. She turns toward me with the same black eyes but this time, she has a knife in her hand dripping blood. I take a step back realizing she has it.
“Don’t worry, we’re not going to hurt you.”
Somehow this made me feel better. The voice sounded slightly different that Amores, it sounded demonic, but it was still her. Right? She went to go shower as she had even more blood on her than last time, so much that with every step she would take blood would drip off her and leave a trail to the bathroom. I got down and wiped up all the blood so we didn’t slip on it and because I didn’t want blood on my floor. I’m so thankful we don’t have carpet. That would suck.
When she was in the shower I burned the clothes as I didn’t know what else to do with them. I thought it was a dream anyway. Eventually I went back to sleep and woke up to Amore close up next to me. Weird dream again huh.
That day we found out what had been happening to my brother Matt. My parents were doing exactly what they used to do to me not that long ago. He would make one mistake and get the shit beaten out of him. Keep in mind he’s a kid. He’s only 7. I got beat as a kid and I wouldn’t wish it on anyone. Especially not on my little brother.
I had to leave him behind to move. But they never hit him when I lived there so I thought it was fine. They hit him even worse then they ever hit me. I only found out after my parents were murdered. They would’ve gotten away with it too. They were murdered last night and my brother found them. He was completely unharmed, and they were stabbed to death.
I got questioned as I’m their kid, or I guess I should say I was their kid. They cleared me as a suspect right away. Seeing what they did to my brother and knowing what they did to me definitely didn’t help me care about the fact they were gone. I didn’t even cry until I saw how beat up he was. Last night was the last time he got beat. They were fighting and he walked in so he got thrown around and even had marks around his neck where they tried to choke him. He has bruises on his face, back, and legs, a black eye, and even cuts on his arms. They’ve gotten even worse.
He got put into my grandmothers care, and he’s okay now.
I visited him today, and got a big surprise. My grandmother had to go to work so I was watching him.
“I have to tell you something. But it’s a secret.”
“Well if it’s a secret then now you have to tell me!”
“Okay. Your friend Amore saved me yesterday. She looked kind of scary though.”
Wait what? He’s never met Amore.
“You know Amore?”
“I met her yesterday. She said she was gonna save me from mommy and daddy and all I had to do was stay in my room and not call the cops until morning.”
My eyes went wide. Did Amore really come over here last night. More importantly did she kill my parents. I didn’t know what to do in this situation except ask more questions. I wanted an explanation.
“Why did she look scary?”
“Because her eyes were black. But she told me not to be scared and said she knew you. I wasn’t scared then. I only got scared when I heard Mommy and Daddy screaming for me to help.”
He seemed so calm and composed saying all this, considering he heard our parents getting killed. I mean I don’t miss them either but still.
“I really like your friend. After she killed them she got me milk and told me they wouldn’t hurt me or you again. She’s nice.”
Jesus Christ. I honestly don’t know how to feel about this. I should probably talk to her about it? But if this isn’t a dream, the black in her eyes must mean she’s possessed. But why is she only possessed at night. Who’s knocking on the door. Grandma can’t be back yet.
Matt went to go get the door and I heard Amore.
“Hey buddy. How are you?”
“I’m good. I really want some milk though. I kind of miss mommy and daddy.”
“That’s totally okay. But they were really bad people, so it’s also okay if you don’t.”
“I just miss when they were being nice. It didn’t happen a lot.”
I have to talk to her.
I go into the kitchen and Amore’s getting Matt some milk. He motions me to come over and whispers.
“Your friends eyes look less scary today.”
[part 3 ](https://www.reddit.com/r/nosleep/comments/av0bx3/my_roommate_is_different_at_night_pt_3/) | 0non-cybersec
| Reddit |
Baby gets glasses, and can see clearly for the first time.. | 0non-cybersec
| Reddit |
How did folks during The Great Depression see the time period they were living in?. For example: did people just walk around lamenting their situation or was just a stamp put on a period of time by historians? Or was it much like any time in history where some people had and some people had not? Also, what major American philosophers were prominent during this period?
| 0non-cybersec
| Reddit |
How do you get ANativeWindow from a SurfaceTexture in the NDK. <p>I've got some OpenGL ES code that has been rendering to a <code>GLSurfaceView</code>, and I'm currently modifying it to work with either <code>SurfaceView</code> and <code>TextureView</code>.</p>
<p>The common element I need from both inside my native code is: <code>ANativeWindow</code>.</p>
<p>For the <code>SurfaceView</code> I got it by passing <code>Surface</code> to:</p>
<pre><code>m_jwindow = ANativeWindow_fromSurface(env, surface);
</code></pre>
<p>For <code>TextureView</code>, I take <code>SurfaceTexture</code>, and in API 14 I can use this:</p>
<pre><code>m_jwindow = ANativeWindow_fromSurfaceTexture(env, surface);
</code></pre>
<p>However, that function was removed in Jellybean. Which leaves me wondering, how can I get <code>ANativeWindow</code> from a <code>SurfaceTexture</code> in API 16+?</p>
| 0non-cybersec
| Stackexchange |
Define the sequences $x_n$& $y_n$ for $n \geq 1$ using the relations $x_n = x_{n+1} +2y_{n+1}$ & $y_n = y_{n-1} +x_{n-1}$ $?$. <p>Define the sequences <span class="math-container">$x_n$</span>& <span class="math-container">$y_n$</span> for <span class="math-container">$n \geq 1$</span> using the relations <span class="math-container">$x_n = x_{n+1} +2y_{n+1}$</span> & <span class="math-container">$y_n = y_{n-1} +x_{n-1}$</span> <span class="math-container">$?$</span></p>
<p><span class="math-container">$:$</span> </p>
<p><span class="math-container">$n \geq 1$</span> , <span class="math-container">$x_0,y_0 \epsilon \mathbb{Z}_{+} $</span></p>
<p><span class="math-container">$x_n = x_{n+1} +2y_{n+1}$</span> </p>
<p><span class="math-container">$y_n = y_{n-1} +x_{n-1}$</span></p>
<p>I came across this problem while solving some problems on limits of sequences,where in this question it asks to define the sequence. So, I tried out by finding the difference <span class="math-container">$d_x$</span> and <span class="math-container">$d_y$</span> as follows,</p>
<p><span class="math-container">$d_x$</span>=<span class="math-container">$x_{n+1}-x_n$</span>= <span class="math-container">$-2y_{n+1}$</span> </p>
<p><span class="math-container">$d_y$</span> =<span class="math-container">$y_n- y_{n-1}$</span>=<span class="math-container">$x_{n-1}$</span> </p>
<p>then defining the sequence using the difference I got,</p>
<p><span class="math-container">$x_n = x_0 -(n-1)2y_{n+1}$</span> </p>
<p><span class="math-container">$y_n = y_0 +(n-1)x_{n-1}$</span></p>
<p>But I know this is not the way because, after it asks to prove the limit.After quite researching I came to know about the recurrence relations, but I don't know anything about that. I'm quite confused!!</p>
| 0non-cybersec
| Stackexchange |
Inserting SPS NAL Units into h.264 stream. <p>I'm currently using FFmpeg to convert a Youtube livestream HLS into a H.264 UDP stream. </p>
<p>For it to work correctly with the device I'm using, the stream needs to have SPS NAL units inserted every so often.</p>
<p>I have found out that using the H.264 'main' profile, no SPS units are present.
<strong>But when using the 'baseline' profile, one SPS unit gets inserted before each IDR NAL unit</strong>.</p>
<p>Unfortunately, the 'baseline' profile causes some <a href="https://i.stack.imgur.com/j8wWI.jpg" rel="nofollow noreferrer">video glitches</a> (some patterns get repeated multiple times horizontally).</p>
<p>I have also tried <code>dump_extra=all</code> but still no SPS units.</p>
<p>Any ideas to make this work?</p>
<p>Here is the current command I use :</p>
<pre><code>ffmpeg \
-err_detect explode \
-fflags "+genpts" -avoid_negative_ts "make_zero" \
-loglevel warning -nostats \
-re -i hls_url.m3u8 -segment_time 10 -hls_time 10 \
-c:v libx264 -preset veryfast -r 30 -flags +cgop -profile:v main -level 3 -bufsize 5M -minrate 5M -maxrate 5M -b:v 5M -pix_fmt yuv420p -bf 3 -s ntsc -x264opts nal-hrd=cbr:force-cfr=1:aud=1:keyint=25:open_gop=0 -aspect 16:9 -refs 3 -g 50 \
-acodec ac3 -ar 48000 -ab 192k \
-vf "fifo,setpts=PTS-STARTPTS" -af "afifo,asetpts=PTS-STARTPTS" \
-bsf:v h264_mp4toannexb \
-threads 2 \
-bitrate 6M -packetsize 188 -flush_packets 0 -f mpegts "udp://multicastip:multicastport?pkt_size=1316&dscp=32"
</code></pre>
<p>Thanks!</p>
| 0non-cybersec
| Stackexchange |
David Cameron rejects call to return Falkland Islands to Argentina. | 0non-cybersec
| Reddit |
Something strange happens while keypress. <p>I have meka g-unit keyboard. This keyboard has 12 additional keys.
I found scancodes of this keys via evtest and mapped these codes to f13-24 key codes.
Everything works fine, but some keys(F20,21,22,23) have strange behavior.
I used xev to test this.
So, if i press any normal key, i have in output only keypress/keyrelease events, but these 4 keys gave me strange result:</p>
<pre><code>FocusOut event, serial 40, synthetic NO, window 0x8200001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 40, synthetic NO, window 0x8200001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 40, synthetic NO, window 0x0,
keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 64 0 0 0 0 0 0 0
KeyRelease event, serial 40, synthetic NO, window 0x8200001,
root 0x126, subw 0x0, time 28272076, (407,392), root:(2331,421),
state 0x4010, keycode 198 (keysym 0xffd1, F20), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
</code></pre>
<p>evtest gives me this output:
normal key(f13):</p>
<pre><code>Event: time 1502817652.419417, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700cc
Event: time 1502817652.419417, type 1 (EV_KEY), code 183 (KEY_F13), value 1
Event: time 1502817652.419417, -------------- SYN_REPORT ------------
Event: time 1502817652.455412, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700cc
Event: time 1502817652.455412, type 1 (EV_KEY), code 183 (KEY_F13), value 0
Event: time 1502817652.455412, -------------- SYN_REPORT ------------
</code></pre>
<p>Broken key(f20):</p>
<pre><code>Event: time 1502817690.387065, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700d3
Event: time 1502817690.387065, type 1 (EV_KEY), code 190 (KEY_F20), value 1
Event: time 1502817690.387065, -------------- SYN_REPORT ------------
Event: time 1502817690.491038, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700d3
Event: time 1502817690.491038, type 1 (EV_KEY), code 190 (KEY_F20), value 0
Event: time 1502817690.491038, -------------- SYN_REPORT ------------
</code></pre>
<p>xmodmap -pke output:</p>
<pre><code>keycode 191 = F13 F13 F13
keycode 192 = F14 F14 F14
keycode 193 = F15 F15 F15
keycode 194 = F16 F16 F16
keycode 195 = F17 F17 F17
keycode 196 = F18 F18 F18
keycode 197 = F19 F19 F19
keycode 198 = F20 F20 F20
keycode 199 = F21 F21 F21
keycode 200 = F22 F22 F22
keycode 201 = F23 F23 F23
keycode 202 = F24 F24 F24
</code></pre>
<p>My 70-keyboard.hwdb:</p>
<pre><code>evdev:input:b0003v060Bp5253e0111-e0*
KEYBOARD_KEY_700cc=f13
KEYBOARD_KEY_700cd=f14
KEYBOARD_KEY_700ce=f15
KEYBOARD_KEY_700cf=f16
KEYBOARD_KEY_700d0=f17
KEYBOARD_KEY_700d1=f18
KEYBOARD_KEY_700d2=f19
KEYBOARD_KEY_700d3=f20
KEYBOARD_KEY_700d4=f21
KEYBOARD_KEY_700d5=f22
KEYBOARD_KEY_700d6=f23
KEYBOARD_KEY_700d7=f24
</code></pre>
<p>How to fix that? As i see, evtest gives right result for every key, but something happens with action, while system parses this event.</p>
<p>showkey shows correct press/release events and keycodes. Only showkey works fine with these keys, another apps like firefox works like xev shows.</p>
| 0non-cybersec
| Stackexchange |
Recover Memory Stick which system is being only recognised as RAW partition. <p>I removed my 8GB Memory stick Pro Duo (FAT32) from my Windows 7 laptop while it was being accessed and when i tried to put it back in to read something from it, it tells me I need to format it. it is now being recognised as a 32mb drive. I have a lot of files that i would like to recover from it, but I have tried Testdisk/Photorec without success. Also just tried a tool called Davory, but still nothing.</p>
<p>I don't think there is anything physically wrong with it, it was working fine this morning.</p>
<p>and i have already looked at both the following links without finding a solution.</p>
<p><a href="https://superuser.com/questions/256755/recover-data-from-corrupted-flash-drive-with-raw-file-system">https://superuser.com/questions/256755/recover-data-from-corrupted-flash-drive-with-raw-file-system</a></p>
<p><a href="https://superuser.com/questions/51984/how-do-i-recover-files-from-an-usb-flash-drive">How do I recover files from an USB flash drive?</a></p>
<p>i have also looked at the memory stick inside Ubuntu (dual-boot) but Ubuntu also cannot read from it, even in gparted.</p>
<p>is there any way to recover the data or even just get a list of files on the memory stick?</p>
| 0non-cybersec
| Stackexchange |
How to resize a parbox depending on the actual text width?. <p><strong>Context</strong></p>
<p>I'm working on a pseudocode package to write algorithms with multiline support. Then, long lines can be broken and the proper identation is handled accordingly. I do the job with <code>parbox</code>es.</p>
<p>The text looks better if it is left aligned, so <code>\RaggedRight</code> (from <code>ragged2e</code>) is used, as hyphenation also helps.</p>
<p><strong>The problem</strong></p>
<p>Each line of the code can have a comment, which is placed in the right margin. The text part is resized to make place for the comment.</p>
<p>Long comments also can span to multiple lines. When this happens, they have to be limited to a maximum witdh.</p>
<p>Unfortunately, when a comment has more than a single line, it doesn't touch the right margin, because the comment is left aligned inside the <code>parbox</code> and the size of the <code>parbox</code> is set to a fixed maximum width (see MWE).</p>
<p><strong>My question</strong></p>
<p>Is it possible to make the <code>parbox</code> (re)sized to the actual width of the text it will hold, so the <strong>text</strong> (and not the <code>parbox</code>) touchs the right margin, while keeping it left aligned?</p>
<p><strong>MWE</strong></p>
<p>The macro <code>\algparbox</code> is my implementation to handle the text and the comment. I've rewritten a cleaner version of it for this MWE, hiding details from the algorithmic stuff (like nesting control, for example).</p>
<p>Comments wider than <code>\largestcommentwidth</code> are broken in lines. </p>
<pre><code>\documentclass{article}
\usepackage[english]{babel}
\usepackage[showframe]{geometry}
%% uncomment to make parboxes visible
%\let\pb\parbox
%\setlength{\fboxsep}{0pt}
%\setlength{\fboxrule}{0.01pt}
%\renewcommand{\parbox}[3][]{\fbox{\pb[#1]{#2}{#3}}}
\def\commentleftsymbol{$\triangleright$}
\newlength{\commentwidth}
\newlength{\largestcommentwidth}
\setlength{\largestcommentwidth}{3.5cm}
\newlength{\commentsep}
\newlength{\commentsymbollength}
\usepackage{ragged2e}
\newcommand{\algparbox}[3]{%
% #1: comment
% #2: text
% #3: hangindent
\def\comment{#1}
\ifx\comment\empty%
\setlength{\commentsep}{0pt}%
\setlength{\commentwidth}{0pt}%
\setlength{\commentsymbollength}{0pt}%
\else%
\setlength{\commentsep}{0.25cm}%
\settowidth{\commentwidth}{\slshape\comment}%
\settowidth{\commentsymbollength}%
{\hspace{\commentsep}\commentleftsymbol\hspace{\commentsep}}%
\fi%
%
% HERE: how to adjust \commentwidth to actual text width?
%
\ifdim\commentwidth>\largestcommentwidth\relax%
\setlength{\commentwidth}{\largestcommentwidth}%
\fi%
%
\noindent%
\parbox[t]%
{\dimexpr \linewidth - \commentwidth - \commentsymbollength \relax}%
{\setlength{\hangindent}{#3}\RaggedRight#2\strut}%
\ifx\comment\empty\else%
\hspace{\commentsep}\commentleftsymbol\hspace{\commentsep}%
\parbox[t]{\commentwidth}{\slshape\RaggedRight\comment\strut}%
\fi%
\par
}
% short excerpt from kantlipsum text
\newcommand{\kant}{As any dedicated reader can clearly see, the Ideal of practical reason is a representation of, as far as I know, the things in themselves; as I have shown elsewhere, the phenomena should only beused as a canon for our understanding. The paralogisms of practical reason are what first give riseto the architectonic of practical reason.}
\begin{document}
\algparbox{}{Short text without comment}{1cm}
\algparbox{short comment}{Short text with short comment}{1cm}
\algparbox{this is a longer comment}{Short text with long comment}{1cm}\marginpar{$\longleftarrow$~How to avoid this and make the text touch the right margin?}
\algparbox{}{Long text without comment. \kant}{1cm}
\algparbox{short comment}{Long text with short comment. \kant}{1cm}
\algparbox{some little longer comment}{Long text with long comment. \kant}{1cm}\marginpar{$\longleftarrow$~And this?}
\algparbox{longer comment. \kant}{Long text. \kant\ \kant\ \kant}{1cm}\marginpar{Hyphenation helps here, but it's not a solution}
\end{document}
</code></pre>
<p>My package is <code>algxpar</code> and is in <a href="https://ctan.org/pkg/algxpar" rel="nofollow noreferrer">CTAN</a>, but this is irrelevant for the question. :-)</p>
| 0non-cybersec
| Stackexchange |
I wish I would have a pillow like this.. | 0non-cybersec
| Reddit |
Determine all possible integers $x$ and $y$ s.t. $3x + 7y \equiv 14 \pmod{28}$ and $x + 3y \equiv 8 \pmod{28}$.. <p>Determine all possible ints $x$ and $y$ that satisfy $3x + 7y \equiv 14 \pmod {28}$ and $x + 3y \equiv 8 \pmod {28}$. The answer should be in terms of $x\equiv r$ and $y \equiv s$ where $r$ and $s$ are remainders.</p>
<p>Here is what I have tried. Am I headed in the right direction?</p>
<p>$8\cdot (3x + 7y) \equiv 14 \pmod {28}$ and $14 \cdot (x + 3y) \equiv 8 \pmod {28}$</p>
<p>$24x + 56y \equiv 112 \pmod{ 28}$ and $14x + 42y \equiv 112 \pmod {28}$</p>
<p>$24x + 56y \equiv 14x + 42y \pmod {28}$</p>
<p>This is where I start to get unsure,</p>
<p>$24x + 28y + 28y \equiv 14x + 14y + 28y \pmod {28}$</p>
<p>$24x \equiv 14x + 14y \pmod {28}$</p>
<p>$48x \equiv 28x + 28y \pmod {28}$</p>
<p>So then...?</p>
<p>$20x \equiv 1 \pmod {28}$?</p>
<p>Stuck here. Is this even the right idea?</p>
| 0non-cybersec
| Stackexchange |
Alienware - Webcam - Mic don't work. <p>I have Alienware M14x R1 laptop. I used Ubuntu 12.10. Anybody know how can I install the webcam and the mic. I would like use with the skype, but the system don't find the mic and the webcam.
Thanks!</p>
| 0non-cybersec
| Stackexchange |
BLOBs or references in PostgreSQL. <p>I need to store binary data files in a PostgreSQL database which runs on an Ubuntu server. Initially there will be a few dozen files of approximately 250kb in size each. However, the number of files will increase over time. I may at times need to extract data from the files for other downstream analyses.</p>
<p>I've done some research regarding the age-old question of storing binary data as BLOBs or references. Both obviously have their pros and cons. Are there any specific issues relating to PostgreSQL that I should be aware of? Is one method or the other preferable if I want to extract data from the files, either via a PostgreSQL function or via an external Python program?</p>
<p>If I were to store the data files directly in the database, would it be better to store them in a separate table with a foreign key referencing the "main" table, rather than in the table containing all the other fields?</p>
<p>I have read the question and answers <a href="https://dba.stackexchange.com/questions/736/is-it-better-to-store-images-in-a-blob-or-just-the-url">here</a>; a comment there suggests that storing binary files by reference (in the filesystem) on Linux is better. My questions here relate to PostgreSQL specifically and to extracting data from the files for various analyses.</p>
<p>Update: Similar <a href="https://stackoverflow.com/questions/4560640/postgresql-use-bytea-blob-or-file-location-to-store-serialized-object">question</a>.</p>
| 0non-cybersec
| Stackexchange |
screen flickering. <p>I have HP G60 notebook. Just installed ubuntu. Now screen flickers when mouse moves over browser and apps. Also can't find a way to access Grub. Booting doesn't offer me a choice. NVIDIA AM 64. Did try to find driver, took all day to install, it was Linux and didn't work, so reinstalled ubuntu.</p>
| 0non-cybersec
| Stackexchange |
As if porta-potties aren't freightening enough.... | 0non-cybersec
| Reddit |
SQLAZURE Resource limitations-Max concurrent sessions. <p>I was trying to select a tier for our internal consumption and going through this limitations in detail..<a href="https://docs.microsoft.com/en-us/azure/sql-database/sql-database-resource-limits" rel="nofollow noreferrer">Azure SQL Database resource limits</a> </p>
<p>One particular instance of trouble was below chart and particularly highlighted values </p>
<p><a href="https://i.stack.imgur.com/hbOmm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hbOmm.png" alt="enter image description here"></a></p>
<p>as you see ,from the highlighted ,there is a max concurrent limitation of 60 concurrent logins and 600 concurrent sessions </p>
<p><strong>ASK:</strong><br>
a single query can go in parallel and can have multiple sessions,will those sessions count under this limitation ?</p>
<p>i tried to test this using Paul White's article <a href="http://web.archive.org/web/20180404164406/http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspx" rel="nofollow noreferrer">Forcing a Parallel Query Execution Plan</a> like below</p>
<pre><code>DBCC FREEPROCCACHE
DBCC SETCPUWEIGHT(1000)
GO
-- Query to test
some expensive query
GO
DBCC SETCPUWEIGHT(1)
DBCC FREEPROCCACHE
</code></pre>
<p>or using </p>
<pre><code>OPTION (RECOMPILE, QUERYTRACEON 8649)
</code></pre>
<p>but i can only go upto 9 sessions,when i checked using below DMV </p>
<pre><code>select * from sys.dm_os_tasks
where session_id=61
</code></pre>
<p>and these trace flags and DBCC options wont work in azure .let me know if i am unclear</p>
| 0non-cybersec
| Stackexchange |
How to create loop sequence?. <p>I am trying to create a script that will be getting one variable from user and should print a pyramid as below:</p>
<pre><code>*
**
***
****
*****
</code></pre>
<p>I used this script but it shows me numbers:</p>
<pre><code>for i in {1..5}
do
a=${a}${i}
echo ${a}
done
</code></pre>
<p>the output:</p>
<pre><code>1
12
123
1234
12345
</code></pre>
<p>How can I insert "*" sign instead of numbers?</p>
| 0non-cybersec
| Stackexchange |
In-store Macintosh posters from the '80s (x-post from /r/VaporwaveAesthetics). | 0non-cybersec
| Reddit |
Correlation Function of Squared Standard Wiener Process. <p>I'm trying to find the mean and correlation functions of <span class="math-container">$ X_t:=W_t^2 $</span>, where <span class="math-container">$W_t$</span> is a standard Wiener process (<span class="math-container">$\sigma=1,E\{W_t^2\}=t$</span> for <span class="math-container">$t\geq 0$</span>).</p>
<p>Unless I'm missing something large here, the mean is very easy to compute.</p>
<p><span class="math-container">$m_x(t) = E[X_t] = E[W_t^2] = \sigma^2 t = t$</span>, for <span class="math-container">$t\geq 0$</span></p>
<p>Where I run into trouble is the correlation function. I've omitted some intermediate steps for time's sake that I could include if asked.</p>
<p><span class="math-container">$$R_x(t_1,t_2)=E[X_{t_1}X_{t_2}]=E[W_{t_1}^2 W_{t_2}^2]=E[W_{t_1}W_{t_1}W_{t_2}W_{t_2}] = E[W_{t_1}^4] + (\sigma^2t_1)(\sigma^2(t_2-t_1))=E[W_{t_1}^4]+t_1(t_2-t_1) $$</span></p>
<p>I run into trouble calculating <span class="math-container">$E[W_{t_1}^4]$</span>. I saw a solution somewhere online that led me to believe it should be <span class="math-container">$3\sigma^4t_1^2$</span>, but I have no idea how to arrive at this answer. </p>
<p>I've been trying to use the method for solving <span class="math-container">$E[V_t^2]$</span>, where <span class="math-container">$V(t)$</span> is integrated white noise, <span class="math-container">$V(t)=\int_0^tX_\tau d\tau$</span> to give an idea...</p>
<p><span class="math-container">$$E[V_t^2] = E[(\int_0^tX_\tau d\tau)(\int_0^tX_\theta d\theta)]=\int_{0}^{t} \int_{0}^{t} R_{X}(\tau-\theta) d \tau d \theta=\int_{0}^{t} \int_{0}^{t} \sigma^{2} \delta(\tau-\theta) d \tau d \theta=\sigma^{2} t$$</span></p>
<p>... but I seriously doubt it's as easy as squaring the result.</p>
<p>A nudge in the right direction for solving <span class="math-container">$E[W_{t_1}^4]$</span> would be much appreciated (assuming it's correct in the first place)</p>
| 0non-cybersec
| Stackexchange |
Creepy abandoned cities. | 0non-cybersec
| Reddit |
How To Upgrade Kubuntu From 16.04 to 16.10 using Kubuntu 16.10 ISO Image File?. <p>I have just downloaded the latest image ISO file of Kubuntu 16.10. </p>
<p>I would like to learn if there is a way to upgrade my current operating system from Kubuntu 16.04 LTS to Kubuntu 16.10 using the new ISO image file that I have just downloaded. </p>
<p><strong>Note:</strong><br>
I know that I can get the latest upgrade using the following command:</p>
<pre><code>sudo do-release-upgrade
</code></pre>
<p>The above upgrade command though will re-download the same files that I have already downloaded.</p>
| 0non-cybersec
| Stackexchange |
Why does performance of java stream fall off with relatively large work compared to "for" loop?. <p>I had an earlier question about interpreting JMH output, which was mostly answered, but I updated the question with another related question, but it would be better to have this be a separate question.</p>
<p>This is the original question: <a href="https://stackoverflow.com/questions/55349631/verify-jmh-measurements-of-simple-for-lambda-comparisons">Verify JMH measurements of simple for/lambda comparisons</a> .</p>
<p>My question has to do with performance of streams at particular levels of "work". The following excerpted results from the previous question illustrates what I'm wondering about:</p>
<pre><code>Benchmark Mode Cnt Score Error Units
MyBenchmark.shortLengthConstantSizeFor thrpt 200 132278188.475 ± 1132184.820 ops/s
MyBenchmark.shortLengthConstantSizeLambda thrpt 200 18750818.019 ± 171239.562 ops/s
MyBenchmark.mediumLengthConstantSizeFor thrpt 200 55447999.297 ± 277442.812 ops/s
MyBenchmark.mediumLengthConstantSizeLambda thrpt 200 15925281.039 ± 65707.093 ops/s
MyBenchmark.longerLengthConstantSizeFor thrpt 200 3551842.518 ± 42612.744 ops/s
MyBenchmark.longerLengthConstantSizeLambda thrpt 200 2791292.093 ± 12207.302 ops/s
MyBenchmark.longLengthConstantSizeFor thrpt 200 2984.554 ± 57.557 ops/s
MyBenchmark.longLengthConstantSizeLambda thrpt 200 331.741 ± 2.196 ops/s
</code></pre>
<p>I was expecting, as the tests moved from shorter lists to longer lists, that the performance of the stream test should approach the performance of the "for" test.</p>
<p>I saw that in the "short" list, the stream performance was 14% of the "for" performance. For the medium list, it was 29%. For the longer list, it was 78%. So far, the trend was what I was expecting. However, for the long list, it is 11%. For some reason, a list size of 300k, as opposed to 300, caused the performance of the stream to drop off, compared to the "for".</p>
<p>I was wondering if anyone could corroborate results like this, and whether they had any thoughts about why it might be happening.</p>
<p>I'm running this on a Win7 laptop with Java 8.</p>
| 0non-cybersec
| Stackexchange |
How do I read double connectives in modal logic?. <p>My book says:</p>
<p>$\neg \Box p \rightarrow \Box \neg \Box p$ is not a valid formula and proves it by saying that in Figure 5.3, if we change $L(x_4)$ to $\{p, q\}$, then $\neg \Box p$ is true but $\Box \neg \Box p$ is not.</p>
<p><a href="https://i.stack.imgur.com/gTeQO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gTeQO.png" alt="enter image description here"></a></p>
<p>I get that $\neg \Box p$ is true: It is not the case that all worlds accessible from $x_4$ are labeled $p$.</p>
<p>Now why is $\Box \neg \Box p$ not true? What does $\Box \neg \Box p$ really mean? Could you please provide more examples of multiple connectives with relation to a diagram (the one provided if you want), so I can get a better understanding?</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
FPS sequel Homefront: The Revolution revealed for PS4. | 0non-cybersec
| Reddit |
I thought the live-action version of Space Battleship Yamato was pretty good. It did justice to the franchise (and my childhood - when I knew it as Star Blazers).. | 0non-cybersec
| Reddit |
Boundary and closure of a set. <p>I'm trying to show that a point is in the boundary of $E$ if and only if it belongs to the closure of both $E$ and its complement. </p>
<p>Let $\overline{E}$ denote the closure of $E$ and $E^\circ$ be the interior of $E$. Then the boundary is defined to be $\overline{E} \setminus E^\circ$. </p>
<p>So what I need to show is $\overline{E} \setminus E^\circ = \overline{E} \cap \overline{(S \setminus E)}$.</p>
<p>After looking at this link: <a href="https://math.stackexchange.com/questions/350197/a-point-is-in-the-boundary-of-e-if-and-only-if-it-belongs-to-the-closure-of-bo">A point is in the boundary of $E$ if and only if it belongs to the closure of both $E$ and its complement.</a> I am confused about how the OP concluded that he/she needed to show $S \setminus E^\circ = \overline{(S \setminus E)}$.</p>
<p>Could someone explain why? </p>
| 0non-cybersec
| Stackexchange |
Is it possible to apply a style to all (tikz) rectangles?. <p>I know that it's possible to apply styling to all tikz nodes or paths, as in the following example:</p>
<pre><code>\tikzset{
every node/.style={
text=red
},
every path/.style={
color=green,
thin
}
}
</code></pre>
<p>(Which makes all nodes have red text and all paths have thin green lines.)</p>
<p>Is there a similar way to apply styling to all tikz rectangles, so those produced by draw commands such as <code>\draw (1,1) rectangle (3,3);</code>?</p>
<p>I tried the following, on the off-chance it might work (it didn't, hence my question!):</p>
<pre><code>\tikzset{
every rectangle/.style={%
blue,
rounded corners,
ultra thick
}
}
</code></pre>
<p>My current work-around is to use a style which I apply to every rectangle manually, although this is a little tedious. This is demonstrated in the below minimal working example.</p>
<pre><code>\documentclass{report}
\usepackage{tikz}
\tikzset{
every rectangle/.style={
blue,
rounded corners,
ultra thick
},
my rectangle/.style={
blue,
rounded corners,
ultra thick
}
}
\begin{document}
\begin{tikzpicture}
% A rectangle which would be styled by the "every rectangle" bit if
% it worked in the way that I would like it to:
\draw (1,5) rectangle (4,7);
% A rectangle with my custom styling applying to it:
\draw [my rectangle] (1,1) rectangle (4,3);
\end{tikzpicture}
\end{document}
</code></pre>
<p>The rectangles in the above would be identical (besides position) if <code>every rectangle</code> worked in the way I would like it to or if there's some other way to style all rectangles.</p>
<p>So essentially I would like to know if an actual equivalent to my pseudo <code>every rectangle</code> exists.</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
Bench press grip for the chest.(cant do wide). Hi. I'm doing a bench press and of course my main focus is the chest. The farther the width is better in targeting the chest. I can't do the wide grip because of wrist issues. In this video ( https://youtu.be/QfPuGYt9zAw ), his grip in 1:55 is MY grip(this is my grip since i started going to the gym).I can really feel it to my triceps. I didnt mind it that time because i was thinking it will also target the chest. I want to change my mindset. I want to do this with the focus is on the chest, but i cant because of wrist issues. Any suggestions/tips? Thank you very much. | 0non-cybersec
| Reddit |
Snake Eyes!... You are doin' it wrong.. | 0non-cybersec
| Reddit |
PHP URL Rewrite - No getting Query String Parameter. <p>I am working on a site and learning PHP at the same time so it is relatively new to me. I am working on URL rewrite currently, however, I am not getting the desired result.</p>
<p>I am trying to change: <code>example.com/CMS/listing?id=1</code> into <code>example.com/CMS/listing/1</code>.</p>
<p>Using the <code>.htaccess</code> file held in the root of the files, I have the following:</p>
<pre><code>RewriteEngine On
RewriteBase /
RewriteRule CMS/listing/([0-9]+) CMS/listing.php?id=$1
</code></pre>
<p>And on the site, I have a simple echo function which gets the query string param for <code>id</code>. When I navigate to <code>example.com/CMS/listing?id=1</code> the function displays <code>1</code>, however, when I go to <code>example.com/CMS/listing/1</code> it does not show anything. Is there something I'm missing or doing wrong?</p>
<pre><code># Get QString Param
$id = $_GET["id"];
echo $id;
</code></pre>
<p><em>Footnote</em></p>
<p><code>.htaccess</code> is held at the root, and <code>listing.php</code> is within a folder called <code>CMS</code>.</p>
| 0non-cybersec
| Stackexchange |
File ended while scanning use of \frac [2]. <p>The equation I'm trying to write is as follows:
<a href="https://i.stack.imgur.com/TdFX3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TdFX3.png" alt="enter image description here"></a></p>
<p>The Latex Code I've written is:</p>
<pre><code>$\text{I.F.}= \frac{1}{Mk+Nt}= \frac{1}{k \sqrt{t^2+k^2}+kt-kt}= \frac{1}{k\sqrt{t^2+k^2}}$
</code></pre>
<p>I keep getting the aforementioned error. I've read the answers to an identical question and tried to remove any line from this equation. Still the error persists. </p>
| 0non-cybersec
| Stackexchange |
[50/50] Cute Puppy Skateboards (SFW) | Decapitated Man (NSFL). | 0non-cybersec
| Reddit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.