text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
TIFU by Playing Music for a Sex Dungeon. I currently live in an apartment building in Seattle. Nearby my unit is a man named "Frank" and his girlfriend (who is quite vocal, thus why I know her boyfriend's name). Now Frank and his girlfriend have incredibly loud sex throughout the entirety of Friday and Saturday nights. Annoyed by all of the sound and trying to find a way to blot it out, I began a habit a few months ago of playing music (singing, playing guitar) whenever they would start doing the dirty over the course of the last couple months. As an added bonus, I could hear my neighbors yell "sing" throughout the night, so I assumed that my playing was a helpful solution to an unfortunate circumstance borne by all of the other neighbors around me.
​
However, tonight, I noticed something kind of strange. They were having sex, per usual, and I began to play music to cover up the sound. I stopped to drink some water between songs, when some of my neighbors started yelling "play." For some reason, though, I didn't do anything for a few seconds, and I heard the guy, Frank's, voice call out "keep playing or I'm not going to cum" through the walls. I listened a while longer to see if I'd heard correctly, and they both kept moaning the same thing. It was at this point that I came to a terrible conclusion. In my attempts to cover up the sound of them having sex, I managed to pull some weird Pavlovian trick where whenever they had sex, I played guitar and sang. Thus, whenever I started to play guitar to cover up an original sound, it just added to their voyeuristic thrill and they started to depend upon it to finish. When I'd heard my presumed neighbors yell sing, it was actually Frank and his girlfriend. Unsure if I was right, I started playing another song and when I finished, they were going as hard as possible and moaning heavily so I figured that I'd assumed correctly.
​
My neighbors them get understandably angry that my music playing has made this neighbor couple have sex, so then ***they*** begin to have really rough revenge sex against my wall because they think that I've caused this problem (which I have). At this point, I'm listening to Frank and his girlfriend and the couple next to my wall, one couple horny and one full of revenge, and all of this was because I tried to save myself from listening to sex in the first place.
​
Edit: here's a video I uploaded as proof that I'm actually playing music. They weren't having sex this morning, so everyone will have to leave that part to their imagination. [https://www.youtube.com/watch?v=PYOP3n2pxac&feature=youtu.be](https://www.youtube.com/watch?v=PYOP3n2pxac&feature=youtu.be)
2nd Edit: Wow, this really blew up. Hopefully everyone enjoyed the story! Regarding proof of their sex, I’m not going to record the sound of my neighbors screwing and upload it to the internet, so my apologies there. To answer everyone’s questions, the song is an original, but I’ve never recorded anything professionally and I play as a hobby.
3rd Edit: This a few months later, but some people said that we should try to record the song, so we did! Hope those few that see this enjoy it! [https://open.spotify.com/track/3XFE8bZTZmaXt9uwWcPBol?si=McCbAVFsQ0C8ih6qmaRNDw](https://open.spotify.com/track/3XFE8bZTZmaXt9uwWcPBol?si=McCbAVFsQ0C8ih6qmaRNDw)
TL;DR: Thought I was covering up sex sounds with music, turns out I was serenading a couple while they fucked and keeping them horny all night. Neighbors had angry sex against my bedroom wall as revenge for disturbing their sleep because I acted as a musical facilitator. | 0non-cybersec
| Reddit |
Jason Rubin, President of THQ, tweeted that THQ is looking into possibly porting games to Linux.. | 0non-cybersec
| Reddit |
Scientists have discovered a smell they are calling “olfactory white”. The found complex mixtures of many odours tend to smell the same. The smell, which is not unpleasant, could be used to mask other odours such as the smell of public toilets or explosives.. | 0non-cybersec
| Reddit |
Talked to someone who claimed Raspberry Pis are illegal in Canada. I stopped in at a computer retail store that I walk past on my way to the bus stop after work. Sales guy asked if he could help me so I said I was thinking of getting a Raspberry Pi and he said they are illegal in Canada and so they don't carry them.
I was confused as I had never heard of that before so I said, "No they fucking aren't". And he insisted that they are and told me to look it up. He said it had to do with how easy it is to turn them into illegal streaming boxes.
My BS meter was pinging pretty loudly seeing as the Android TV boxes in the case behind him are just as easily turned into streaming systems and every single computer in the shop can do the same thing. He kept saying that it was something about the instruction set that made RPis better at it than any other platform.
So I spent the bus ride home trying to google legal issues around raspberry pis but I came up blank.
So was he just misinformed, was he intentionally bullshitting me in hopes that I would buy a more expensive Android Box, or is there anything to what he was saying? | 0non-cybersec
| Reddit |
How do I restore the display state in FreeCommander?. <p>How can the display state in FreeCommander for files/folders be restored to the initial state (as after installation)?</p>
<p>I have inadvertently changed the display state, see below, in <a href="http://en.wikipedia.org/wiki/FreeCommander" rel="nofollow noreferrer">FreeCommander</a> and I can't figure out how to get back to the previous state. I don't want both the folder hierarchy and the one folder view in each panel. I only want the one folder view in each panel, corresponding to the scratched out parts not being there in this illustration:</p>
<p><img src="https://i.stack.imgur.com/G2BhV.png" alt="alt text"></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 |
So a guy spends 20 years trying to find his dream girl.... They finally meet and have been dating for quite awhile now. The one thing he has always wanted to try is anal.
He has a master plan....He buys her a fancy dress...hires a limo to take her to an amazing dinner......off to an amazing hotel overlooking the beach.....
he works his magic in the bedroom.......the excitement builds......and he decides this is the moment.
He bends her over and slips it right into her ass...
WOAH!!! she says.... THAT'S MIGHTY PRESUMPTUOUS.
WOAH!!!! he says..... THAT'S A MIGHTY BIG WORD FOR A 12 YR OLD. | 0non-cybersec
| Reddit |
Global Study Shows Half Think That Religion Does More Harm than Good. | 0non-cybersec
| Reddit |
Creating shortcuts on OS X without using mouse. <p>Say I have a file under /var and I want to make its shortcut on desktop without using the mouse. Is that possible? I really want to use the trackpad as little as possible since I don't like it.</p>
| 0non-cybersec
| Stackexchange |
License Compatibility: CC-BY-NC 3.0 with GPL2 (for Wordpress)?. <p>I'm trying to figure out if I can use code licensed under Creative Commons Attribution-NonCommercial 3.0 (CC-BY-NC 3.0) in a Wordpress plugin (which must be released under GPL). I <em>think</em> the answer is "no," based on here (<a href="https://www.gnu.org/licenses/license-list.en.html#CC-BY-NC" rel="nofollow">https://www.gnu.org/licenses/license-list.en.html#CC-BY-NC</a>), but I find the whole licensing mess to be just incomprehensible.</p>
<p>Basically, I already have a plugin that uses Fancybox (<a href="http://fancybox.net/" rel="nofollow">http://fancybox.net/</a>). Prior to v2.0 this was licensed under GPL; unfortunately, the author decided to release v2.0+ under CC-BY-NC (<a href="http://fancyapps.com/fancybox/#license" rel="nofollow">http://fancyapps.com/fancybox/#license</a>). 1.x is now extremely outdated and is having some problems with newer releases of WP.</p>
<p>So what I'm trying to figure out is, can I update the copy of Fancybox that I'm bundling with my plugin to 2.0? I think the answer is "no," because the author changed its license to CC-BY-NC. But I just want to make sure, before I start spinning my wheels and looking for a totally new solution...</p>
| 0non-cybersec
| Stackexchange |
Can the following Domain Entity contain logic for creating/deleting other entities?. <p>a) As far as I understand it, in most cases <em>Domain Model</em> <strong>DM</strong> doesn't contain code for creating/deleting <em>domain entities</em>, but instead it is the job of layers ( ie <em>service layer</em> or <em>UI layer</em> ) on top of <strong>DM</strong> to create/delete <em>domain entities</em>? </p>
<p>b) <em>Domain entities</em> are modelled after <em>real world entities</em>. Assuming particular <em>real world entity</em> being abstracted does have the functionality of creating/deleting other <em>real world entities</em>, then I assume the <em>domain entity</em> abstracting this <em>real world entity</em> could also contain logic for creating/deleting other entities? </p>
<pre><code>class RobotDestroyerCreator
{
...
void heavyThinking()
{
...
if(...)
unitOfWork.registerDelete(robot);
...
if(...)
{
var robotNew = new Robot(...);
unitOfWork.registerNew(robotNew);
{
...
}
}
</code></pre>
<p>Thank you</p>
| 0non-cybersec
| Stackexchange |
Don't think she saw this coming. | 0non-cybersec
| Reddit |
Disabling the prompt to "Click Continue to permanently get access to this folder" (e.g. via GPO). <p><a href="http://support.microsoft.com/en-us/kb/950934" rel="nofollow noreferrer">http://support.microsoft.com/en-us/kb/950934</a> describes the manner in which, when a member of the Administrators group uses Explorer to navigate to a folder to which the Administrators group has permission, the user will be prompted to "Click Continue to permanently get access to this folder".</p>
<p>When they do this, Explorer alters the ACL of the folder to grant that specific user Full Control to the folder. The MS link describes exactly the design constraint that requires it to be this way.</p>
<p>However, it ruins the permission set for that folder and makes central management of permissions effectively impossible. For example, if the named user is later removed from the Administrators group, that ACL entry still exists to permit them access to that folder.</p>
<p>I'm not looking to disable UAC (I actually <em>like</em> the distinction between elevated and non-elevated), and I am happy to use alternative tools to navigate and view files in an elevated fashion. </p>
<p>The eventual intent is to run one of the workarounds described in the MS link (either using a separate file navigator that <em>can</em> run elevated, or defining a separate group to control access to the whitelisted folders) but, all the time Explorer continues to clobber the ACLs of the folder, at will, it makes it impossible to identify where these workarounds need to be applied (short of regularly auditing every folder for ACL changes).</p>
<p>I would simply prefer to have the standard "access denied" message, if I attempt to access a restricted folder when running non-elevated in Explorer.</p>
<p><strong>Is there a setting (either one-time on each box, or via GPO) that removes this "permanently get access" prompt, <em>while retaining the other facilities of UAC</em>?</strong></p>
<p><em>NB: I fully understand why this prompt exists, what it means and why the behaviour is as it is (although I don't necessarily agree with the design decision). However, I should point out that I am not looking to discuss workarounds relating to the working practice of my users, nor the merits/pitfalls of UAC or Administrators group membership.</em></p>
| 0non-cybersec
| Stackexchange |
Spring HATEOAS ControllerLinkBuilder with methodOn. <p>One thing I do not understand when using <strong>ControllerLinkBuilder</strong> with <strong>methodOn</strong> feature is what are you suppose to do when your Controller has method signature like so:</p>
<pre><code>public HttpEntity<ResourceSupport> update(@PathVariable(USER_ID) Long userId, @Valid @RequestBody UserUpdateRequest userUpdateRequest, BindingResult bindingResult)
</code></pre>
<p>So whenever I wish to use <strong>methodOn</strong>, how am I to fill the blanks like <strong>UserUpdateRequest</strong> argument and <strong>BindingResult</strong> (I use binding result to handle bad request exceptions with @ControllerAdvice and JSR 303 to make output messages human readable).</p>
<p>When I wish use out of the box spring HATEOAS <strong>ControllerLinkBuilder</strong> for more ease with <strong>methodOn</strong> I end up writing something like this (mind me I do not know if this will not backfire but the code does not look comforting): </p>
<pre><code>resource.add(linkTo(methodOn(UserController.class).update(userId, null, null)).withSelfRel());
</code></pre>
<p>Ofcourse I can omit the <strong>methodOn</strong> part and just use <strong>linkTo</strong> which would then require me to play around building the path.</p>
<p>Is it appropriate to just pass on <strong>null</strong> refs ? Plus how is it convenient using <strong>methodOn</strong> as if you decide to remove say: <strong>BindingResult</strong> or add something like <strong>HttpServletRequest</strong> to the controller method signature so that spring could pass me more info about request if I wanted to log an IP address for some security reason. This would require me to go and change the link construction part using <strong>methodOn</strong>.</p>
<p>Another question that is bit boggling me is say I pass a legitimate ref to <strong>methodOn</strong> like <strong>userUpdateRequest</strong> filled with data - does that data suppose to go anywhere with the generated link ? I've seen some Hypermedia that include along with rel and href a body of what you pass - is that possible with Spring HATEOAS and is it a good practice to create links with ready to post/put payloads in them ?</p>
<p>But getting back to <strong>ControllerLinkBuilder</strong> using only <strong>linkTo</strong> method building links with <strong>.slash("...")</strong> - is it potentially less maintenance costly ?</p>
<p>In day to day practice what would you recommend and what do you think about link construction ? Maybe someone could provide professional tips/advices.</p>
<p>Thank You,</p>
| 0non-cybersec
| Stackexchange |
Stuffit expander free on Mac OS 10.4.11. <p>Just two questions:</p>
<ol>
<li>Does it exist? </li>
<li>Which version of stuffit expander is surely working on this version of mac os x?</li>
</ol>
<p>I've been trying to download the 10.3 to 10.3.9 version from allume website but it won't install.</p>
| 0non-cybersec
| Stackexchange |
Which header defines the macro that specifies the machine architecture?. <p><em>Shorter version of question:</em></p>
<p>Which C header contains the macro that corresponds to the machine architecture of the system (e.g., <code>__x86_64__</code>, <code>__ia64__</code>, <code>__mips__</code>?)</p>
<p><em>Longer version of question:</em></p>
<p>I'd like to run the <a href="http://ganglia.info/" rel="noreferrer">ganglia</a> monitoring tools on a <a href="http://tilera.com/" rel="noreferrer">Tilera</a>-based system that runs Linux. </p>
<p>Ganglia doesn't currently have support for Tilera. To get this to work, I ned to modify a C function called <a href="http://sourceforge.net/apps/trac/ganglia/browser/trunk/monitor-core/libmetrics/linux/metrics.c#L523" rel="noreferrer">machine_type_func</a> that returns the machine architecture. The body of this function is determined at compile-time, it looks like this:</p>
<pre><code>g_val_t
machine_type_func ( void )
{
g_val_t val;
#ifdef __i386__
snprintf(val.str, MAX_G_STRING_SIZE, "x86");
#endif
#ifdef __x86_64__
snprintf(val.str, MAX_G_STRING_SIZE, "x86_64");
#endif
...
return val;
}
</code></pre>
<p>I need to add the appropriate line for Tilera, but I don't know the name of the macro that specifies a Tilera-based system. I'm guessing this macro is defined in one of the standard Linux headers, but I don't know which one to look in. </p>
| 0non-cybersec
| Stackexchange |
How to sew invisible stitches. | 0non-cybersec
| Reddit |
Bek Nice Siap Dilepas Dengan Bandrol 30 Juta Euro. | 0non-cybersec
| Reddit |
What is a mapping class group, and how can we use it to understand fibrations of 3-manifolds when the fiber is a surface?. <p>So I'm reading this book, kind of committed to reading the entire thing, and in the section I'm up to the author starts using some language regarding monodromies and mapping class groups. Having never studied that particular topic, I find myself getting stuck on some really basic stuff.</p>
<p>I looked up monodromies in Ratcliff's Foundations of Hyperbolic Manifolds, and found a nice discussion of moduli spaces, including the definition of a mapping class group. I also found some info about monodromies in Bredon's Topology and Geometry and that part I understood, just don't know how it ties in. Ratcliff defines the mapping class group like so:</p>
<p>Let $M$ be a closed surface of non-positive Euler characteristic.
Let $\text{Hom}(M)$ be the set of homeomorphisms from $M$ to itself, given a group structure via composition.
Let $\text{Hom}_1(M)$ be the subgroup of $\text{Hom}(M)$ consisting of homeomorphisms homotopic to the identity.
The mapping class group is then Map$(M):=\text{Hom}(M)/\text{Hom}_1(M)$.</p>
<p>Okay, first embarrassing question: how can a homeomorphism not be homotopic to the identity map? As far as I know, you can deform an object much more drastically using a homotopy than you can using a homeomorphism. The only example I can think of where a homeomorphism of a surface is not homotopic to the identity is when the surface has more than one connected component and the homeomorphism interchanges some of them. I'm sure there must be less trivial examples or this thing would be kind of useless.</p>
<p>Once I understand the mapping class group, I'm interested in how one would use it to get information about a 3-manifold, knowing that it has a particular fibration with a known surface as the fiber. I expect it should give some information about how the surface had to be deformed to get embedded in the manifold, but right now I can't see how it does.</p>
<p>Thanks in advance for any help!</p>
| 0non-cybersec
| Stackexchange |
a bit more of PE. | 1cybersec
| Reddit |
What's this?. | 0non-cybersec
| Reddit |
Update an existing array element with jsonnet. <p>I am using jsonnet to read in a value which consists of an array. I want to modify the first element in that array to add a value. The data structure looks like this:</p>
<pre><code>{
"my_value": [
{
"env": "something"
},
{
"var": "bar"
}
]
}
</code></pre>
<p>I want to add a value to <code>my_value[0]</code>. How can I reference that in jsonnet?</p>
| 0non-cybersec
| Stackexchange |
Behold the majesty and terror that is the Tarrasque. | 0non-cybersec
| Reddit |
Laser or laser. | 0non-cybersec
| Reddit |
Secret symbols of travelers and theives. | 0non-cybersec
| Reddit |
Do you guys have your first outfit ready to flex for school yet? ( No 🔥😩FLEX OFFENDERs😩🔥). Let me see what heat y'all reserving for the first day of school. | 0non-cybersec
| Reddit |
How to monitor traffic from domains forwarding?. <p>I have suppose 10 domains all redirecting( using godaddy forwarding) to example.com. Is there a way I can monitor traffic from these 10 domains ? Probably some how in Google Analytics or some other way out ? I am using Google Analytics on example.com</p>
| 0non-cybersec
| Stackexchange |
Webtrends tracking parameters on our site URLs are causing duplicate content and SEO problems. <p>We have some issue with duplicate content on Google SERP. The problem is that we are using Click Tracking on Webtrends that adds a parameter after the URL. This is what a URL can look like when Webtrends loads on the webpage: <code>https://www.example.com/private/loan.html?WT.ac=xxxxx-xxxx_xxx_animate_loan_button-v1&WT.svl=Menu</code></p>
<p>As I am aware Google Crawl the links and adds also the parameters so this content is duplicated because if you remove everything after <code>?WT.ac</code> the same content is shown.</p>
<p>How can I prevent either Webtrends to stoop adding this or make Google not crawl these parameters? I have seen some ideas but not found a real answer I can use:</p>
<ol>
<li>Add self-referral</li>
<li>noindex on parameter "WT.xx=.*"</li>
<li>Add the parameters after crawl with JavaScript</li>
<li>Add the parameter to a meta-tag</li>
</ol>
<p>I am not so familiar with which method I can use and is the best? </p>
| 0non-cybersec
| Stackexchange |
What cases exist for the new iPad (3rd generation) most similar to Apple's 1st generation case?. <p>I am looking for cases that fit the full size iPad with retina displays (3rd and 4th generation) and function similarly to the original black case from Apple for the first generation iPad.</p>
<p>The aspects most appealing from that original design were:</p>
<ul>
<li>slim - visually and form fitting without adding the bulk of an Otterbox product.</li>
<li>wedge for two angles (yes the vertical placement wasn't the most stable)</li>
<li>no covers on the screen or the ports letting all charging cables and controls work well</li>
<li>light drop, scratch and bump protection</li>
<li>durable (having seen over 25 case designs wear over 6+ months - the Apple one is surprisingly durable)</li>
<li>reputable warranty service (you can call for an exchange without hassle if it starts tearing 6 months into use)</li>
</ul>
<p>The closest case (that isn't shipping yet) I have seen is the <a href="http://goincase.com/products/detail/magazine-jacket-cl60129/3" rel="nofollow">incase Magazine Jacket</a>. What cases meet any (or many) of the criteria listed above?</p>
| 0non-cybersec
| Stackexchange |
Write on Slave redis db. <p>I have a master redis server (S1) and I have 6 other servers. I want them to have local redis slaves, so any change on the redis master will be replicated to the slaves on each local server</p>
<p>Can I write on a slave and make this one update the master, and then the master will update the other slaves?</p>
| 0non-cybersec
| Stackexchange |
how to convert .dae to .scn files in SceneKit. <p>This is a screenshot from Apple's Fox sample code. As you can see, they use .scn file format for graphics object. They explicitly state in the wwdc2015 video that this was done by an artist. So far I only worked with .dae and was until recently convinced that this is the only supported format. My question is, how do I export objects stored in .dae file to .scn file?</p>
<p><a href="https://i.stack.imgur.com/3PhCC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3PhCC.png" alt="enter image description here"></a></p>
<p>EDIT: this is what I get if go to Editor-> Convert to SceneKit scene file format (.scn)</p>
<p><a href="https://i.stack.imgur.com/5VoEU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5VoEU.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
Made Whole Wheat Sourdough Baguettes (recipe inside). | 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 |
Want to master Android development in less than 20h? Here you go.. | 0non-cybersec
| Reddit |
It's not the most beautiful goal, but this crowd.... | 0non-cybersec
| Reddit |
Encounter Order wrong when sorting a parallel stream. <p>I have a <code>Record</code> class:</p>
<pre><code>public class Record implements Comparable<Record>
{
private String myCategory1;
private int myCategory2;
private String myCategory3;
private String myCategory4;
private int myValue1;
private double myValue2;
public Record(String category1, int category2, String category3, String category4,
int value1, double value2)
{
myCategory1 = category1;
myCategory2 = category2;
myCategory3 = category3;
myCategory4 = category4;
myValue1 = value1;
myValue2 = value2;
}
// Getters here
}
</code></pre>
<p>I create a big list of a lot of records. Only the second and fifth values, <code>i / 10000</code> and <code>i</code>, are used later, by the getters <code>getCategory2()</code> and <code>getValue1()</code> respectively.</p>
<pre><code>List<Record> list = new ArrayList<>();
for (int i = 0; i < 115000; i++)
{
list.add(new Record("A", i / 10000, "B", "C", i, (double) i / 100 + 1));
}
</code></pre>
<p>Note that first 10,000 records have a <code>category2</code> of <code>0</code>, then next 10,000 have <code>1</code>, etc., while the <code>value1</code> values are 0-114999 sequentially.</p>
<p>I create a <code>Stream</code> that is both <code>parallel</code> and <code>sorted</code>.</p>
<pre><code>Stream<Record> stream = list.stream()
.parallel()
.sorted(
//(r1, r2) -> Integer.compare(r1.getCategory2(), r2.getCategory2())
)
//.parallel()
;
</code></pre>
<p>I have a <code>ForkJoinPool</code> that maintains <code>8</code> threads, which is the number of cores I have on my PC.</p>
<pre><code>ForkJoinPool pool = new ForkJoinPool(8);
</code></pre>
<p>I use the trick <a href="https://stackoverflow.com/questions/21163108/custom-thread-pool-in-java-8-parallel-stream">described here to submit a stream processing task to my own <code>ForkJoinPool</code> instead of the common <code>ForkJoinPool</code></a>.</p>
<pre><code>List<Record> output = pool.submit(() ->
stream.collect(Collectors.toList()
)).get();
</code></pre>
<p>I expected that the parallel <code>sorted</code> operation would respect the encounter order of the stream, and that it would be a <em>stable</em> sort, because the <code>Spliterator</code> returned by <code>ArrayList</code> is <code>ORDERED</code>.</p>
<p>However, simple code that prints out the elements of the resultant <code>List</code> <code>output</code> in order shows that it's not quite the case.</p>
<pre><code>for (Record record : output)
{
System.out.println(record.getValue1());
}
</code></pre>
<p>Output, condensed:</p>
<pre><code>0
1
2
3
...
69996
69997
69998
69999
71875 // discontinuity!
71876
71877
71878
...
79058
79059
79060
79061
70000 // discontinuity!
70001
70002
70003
...
71871
71872
71873
71874
79062 // discontinuity!
79063
79064
79065
79066
...
114996
114997
114998
114999
</code></pre>
<p>The <code>size()</code> of <code>output</code> is <code>115000</code>, and all elements appear to be there, just in a slightly different order.</p>
<p>So I wrote some checking code to see if the <code>sort</code> was stable. If it's stable, then all of the <code>value1</code> values should remain in order. This code verifies the order, printing any discrepancies.</p>
<pre><code>int prev = -1;
boolean verified = true;
for (Record record : output)
{
int curr = record.getValue1();
if (prev != -1)
{
if (prev + 1 != curr)
{
System.out.println("Warning: " + prev + " followed by " + curr + "!");
verified = false;
}
}
prev = curr;
}
System.out.println("Verified: " + verified);
</code></pre>
<p>Output:</p>
<pre><code>Warning: 69999 followed by 71875!
Warning: 79061 followed by 70000!
Warning: 71874 followed by 79062!
Warning: 99999 followed by 100625!
Warning: 107811 followed by 100000!
Warning: 100624 followed by 107812!
Verified: false
</code></pre>
<p>This condition persists if I do any of the following:</p>
<ul>
<li><p>Replace the <code>ForkJoinPool</code> with a <code>ThreadPoolExecutor</code>.</p>
<pre><code>ThreadPoolExecutor pool = new ThreadPoolExecutor(8, 8, 0, TimeUnit.SECONDS, new ArrayBlockingQueue<>(10));
</code></pre></li>
<li><p>Use the common <code>ForkJoinPool</code> by processing the <code>Stream</code> directly.</p>
<pre><code>List<Record> output = stream.collect(Collectors.toList());
</code></pre></li>
<li><p>Call <code>parallel()</code> <em>after</em> I call <code>sorted</code>.</p>
<pre><code>Stream<Record> stream = list.stream().sorted().parallel();
</code></pre></li>
<li><p>Call <code>parallelStream()</code> instead of <code>stream().parallel()</code>.</p>
<pre><code>Stream<Record> stream = list.parallelStream().sorted();
</code></pre></li>
<li><p>Sort using a <code>Comparator</code>. Note that this sort criterion is different that the "natural" order I defined for the <code>Comparable</code> interface, although starting with the results already in order from the beginning, the result should still be the same.</p>
<pre><code>Stream<Record> stream = list.stream().parallel().sorted(
(r1, r2) -> Integer.compare(r1.getCategory2(), r2.getCategory2())
);
</code></pre></li>
</ul>
<p>I can only get this to preserve the encounter order if I don't do one of the following on the <code>Stream</code>:</p>
<ul>
<li>Don't call <code>parallel()</code>.</li>
<li>Don't call any overload of <code>sorted</code>.</li>
</ul>
<p>Interestingly, the <code>parallel()</code> without a sort preserved the order.</p>
<p>In both of the above cases, the output is:</p>
<pre><code>Verified: true
</code></pre>
<p>My Java version is 1.8.0_05. This anomaly also <a href="http://ideone.com/vli0tC" rel="nofollow noreferrer">occurs on Ideone</a>, which appears to be running Java 8u25.</p>
<p><strong>Update</strong></p>
<p>I've upgraded my JDK to the latest version as of this writing, 1.8.0_45, and the problem is unchanged.</p>
<p><strong>Question</strong></p>
<p>Is the record order in the resultant <code>List</code> (<code>output</code>) out of order because the sort is somehow not stable, because the encounter order is not preserved, or some other reason?</p>
<p>How can I ensure that the encounter order is preserved when I create a parallel stream and sort it?</p>
| 0non-cybersec
| Stackexchange |
Ballboy makes incredible catch during Federer-Nadal match (video). | 0non-cybersec
| Reddit |
Writing an Infinite Union as the Union of Disjoint Sets. <p>According to my lecture notes, with the help of a little "trick" it is possible to write an infinte union of sets as the infinite union of disjoint sets as follows:</p>
<p>$$A = \bigcup \limits_{k=1}^{\infty} A_k = \bigcup \limits_{k=1}^{\infty} \tilde{A_k}$$</p>
<p>with the disjoint sets $\tilde{A_k}$ whereas $\tilde{A_1} := A_1$ and $\tilde{A_k} := A_k \setminus A_{k-1}$ for $k \geq 2$.</p>
<p>My question: Given we have three sets $A_1,A_2$ and $A_3$ and none of them is disjoint. When I define $\tilde{A_3}$ as $A_3 \setminus A_2$ I don't see how $A_1$ and $A_3$ are supposed to be disjoint..so on what am I missing out?</p>
| 0non-cybersec
| Stackexchange |
Return an image from asp.net web api core as IActionResult. <p>What is the best way to return an image file as IActionResult while using asp.net web api core?
I tried returning a base64 string and it works fine. But not considered as efficient.
Is there a way using which we can return an image file object itself as IActionResult.</p>
| 0non-cybersec
| Stackexchange |
NodeMCU esp8266 ||an attacker can disconnect security cameras or other important equipment from the network. | 1cybersec
| Reddit |
Ref request: modelling regular theories as an injectivity condition. <p>The background to the following observation is standard material in categorical logic, and I thought this was was too — I don’t remember learning it, but I don’t think it is original — but I can’t now find it anywhere in the literature. Does it ring a bell to anyone? Even if it is not in print, I would be interested to know if people have heard this discussed informally, to get an idea of which communities this is folklore in.</p>
<p>Recall: a <em>regular</em> formula (over a signature $\Sigma$) is a formula constructed just from atomic formulas, finite conjunction, and existential quantification. $\newcommand{\x}{{\vec x}}\newcommand{\y}{{\vec y}}$Any regular sequent $\varphi(\x) \vdash_\x \psi(\x)$ is derivably equivalent to one in <em>regular normal</em> form, i.e. $\varphi'(\x) \vdash_{\vec x} \exists \y.\ \psi'(\x,\y)$, where $\varphi'$, $\psi'$ are conjunctions of atomics and $\psi'(\x,\y) \vdash_{\x,\y} \varphi'(\x)$ is derivable (this is D1.3.10 in the Elephant).</p>
<p>If $\varphi(\x)$ is any conjunction of atomic formulas, then there is a $\Sigma$-structure $\newcommand{\str}[2]{\langle\!\langle\, #1 \ |\ #2 \,\rangle\!\rangle } \str{\x}{\varphi}$, generated by elements for each variable in $\x$, and with the interpretation just enough to make $\varphi$ hold. This <em>represents</em> the interpretation of $\varphi$: for any other structure $A$, $\newcommand{\Str}{\Sigma\text{-}\mathbf{Str}}\newcommand{\interp}[2]{[\![\, #1 \ |\ #2 \,]\!] } \interp{\x}{\varphi}^A \cong \Str(\str{\x}{\varphi}, A)$.</p>
<p>Then (this is the fact I’m after) a structure validates a regular normal sequent $\varphi(\x) \vdash_{\vec x} \exists \y.\ \psi(\x,\y)$ just if it is <em>injective</em> w.r.t. the obvious map $\str{\x}{\varphi} \to \str{\x,\y}{\psi}$. Correspondingly, being a model of a regular theory $\mathbf{T}$ is a small-injectivity condition.</p>
| 0non-cybersec
| Stackexchange |
Wait. What?. | 0non-cybersec
| Reddit |
Scaling AngularJS + NodeJS app on Linode. <p>I have developed an application using AngularJS + NodeJS (together with MariaDB, Redis and Socket.io for realtime notifications) and I have deployed it on a single Linode node. Now I would like to organize the architecture in a way I can easily scale the application in case of traffic increases in the future.</p>
<p>So my idea is to prepare everything as follow:</p>
<ul>
<li>1 Linode LoadBalancer server that will be the main point and will redirect the requestes coming from the users</li>
<li>1 Linode node server where I will install Nginx that, acting as a reverse proxy, redirects to the NodeJS server in the same node</li>
<li>1 Linode node server for MariaDB and Redis server</li>
</ul>
<p>so when I need to scale I add a new node with Nginx + NodeJS. For MariaDB + Redis I would set the clustering for both (I use Redis for the session and MariaDB for the data).</p>
<p>Now my doubts are the following:</p>
<ul>
<li><p>what would be the proper architecture for the application?</p></li>
<li><p>where should I put the AngularJS app, on the LoadBalancer or on each node?</p></li>
<li><p>do I need nginx acting as reverse proxy on each node?</p></li>
</ul>
<p>Thank you!</p>
| 0non-cybersec
| Stackexchange |
Morning Commute. | 0non-cybersec
| Reddit |
Is it really necessary to learn how to write a quadratic in standard to vertex form?. <p>How crucial is this skill or form of writing and polynomial function? Can't we just always use the $-b/2a$ trick for the $x$ intercept and just plug it back into the function to find the $y$?</p>
| 0non-cybersec
| Stackexchange |
[WP] Aliens on a distant planet find the remains of Laika the 1st dog in space drifting past their planet. They are unable to comprehend how the canine was able to construct such a machine without opposable fingers and thumbs so they send a recon mission to earth to investigate.. On arrival at Earth the recon team find the canines have enslaved a primitive ape species to perform all their physical labour, research and farming for them, the apes even following the canines round to pick up their excrement whilst the canines take their exercise. | 0non-cybersec
| Reddit |
Some idiot thought it'd be a good idea to make their server icon have a ping icon in it so it looks like you're always pinged. | 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 |
After name server change, DNS queries on and off. <p>I migrated the domain www.pantego.com to a different name server. We were using the Enom registrar and their default name servers, but I migrated them to AWS Route 53. I know all records were copied over, but the domain seems to go up and down at random. Sometimes the website works, and sometimes it doesn't. This corresponds to when nslookup works and doesn't work. The previous TTL was two days and it has not been that long yet, however, why does DNS go up and down for my site? Other users report this too. Any help is appreciated.</p>
<p>Edit:</p>
<p>Dig always works - nslookup (and therefore ping and http requests) don't always work. I did notice that pinging ns1.pantego.com and ns2.pantego.com return the old IPs, but nothing should be using those addresses anyways? Both the old name server and the new name server have the same settings. I will remove the old one when the TTL expires.</p>
| 0non-cybersec
| Stackexchange |
😋. | 0non-cybersec
| Reddit |
Why does Eclipse's "Check for updates" not work. <p>I just did a fresh install of 12.04 Precise. In Eclipse, if I do "Help" > "Check for updates" I see 8 packages which are grayed out with the message "Insufficient access privileges to apply this update." Any idea how I fix this?</p>
| 0non-cybersec
| Stackexchange |
How to use parameters within the filter in AngularJS?. <p>I want to use parameter in filter, when I iterate some arrays with ng-repeat</p>
<p>Example:</p>
<p>HTML-Part:</p>
<pre><code><tr ng-repeat="user in users | filter:isActive">
</code></pre>
<p>JavaScript-part:</p>
<pre><code>$scope.isActive = function(user) {
return user.active === "1";
};
</code></pre>
<p>But I want to be able to use filter like</p>
<pre><code><tr ng-repeat="user in users | filter:isStatus('4')">
</code></pre>
<p>But its not working. How can I do something like that?</p>
| 0non-cybersec
| Stackexchange |
Pencil Drawing, Getting Started by Jillian Smith. | 0non-cybersec
| Reddit |
Unique decomposition of $c$ sums of products of $k$ numbers greater than 1, allowing duplicates?. <p>This question differs from <a href="https://math.stackexchange.com/questions/387441/unique-decomposition-of-c-sums-of-products-of-k-prime-numbers-allowing-dupl">Unique decomposition of $c$ sums of products of $k$ prime numbers, allowing duplicates?</a> in that prime number restriction is changed to any number greater than 1.</p>
<p>Suppose that there are $n$ different numbers greater than 1. Define procedure a) as following ($k \leq n$ and $k$ fixed): procedure a) for each time, we select one number out of $n$ possible cases and multiply it to the product (number may be repeated). For the first time, we choose a number and that is the product. We do this $k$ times.</p>
<p>Then, we do the following for $c$ times where $c$ is fixed: procedure b) we define variable $z$. For the first time procedure b) is started, $z = 0$. Now call procedure a) and get a result into variable $y$. Then we add $y$ to $z$ - and the sum replaces the original value of $z$ into $z$. We repeat this $c$ times.</p>
<p>So, step is: we call procedure b) (which then recursively calls procedure a) ) and see the result $z$.</p>
<p>Now the question is, is this $z$ unique in its decomposition, given $k$ and $c$? (So, there would be $c$ sums of product of $k$ numbers greater than 1, allowing duplicates.)</p>
<p>Or if not, what would be the general rule when this holds?</p>
<p>For every step, the set of $n$ numbers greater than 1 remains the same - that is, it does not change.</p>
| 0non-cybersec
| Stackexchange |
B/W cat has B/W shoe fetish. | 0non-cybersec
| Reddit |
Injecting external dependencies in Microsoft Bot Framework Dialog using Autofac. <p>I've been trying to pass a service to a LuisDialog from the MessagesController like so:</p>
<pre><code>public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
...
await Conversation.SendAsync(activity, () => new ActionDialog(botService));
</code></pre>
<p>The botService is injected into the MessageController using dependency injection.</p>
<p>When I start a bot conversation I get an error:</p>
<p>Type 'ThetaBot.Services.BotService' in Assembly 'ThetaBot.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.</p>
<p>Looking around for a solution I can find:
<a href="https://github.com/Microsoft/BotBuilder/issues/106" rel="noreferrer">https://github.com/Microsoft/BotBuilder/issues/106</a></p>
<blockquote>
<p>I understand your question better now. We have a similar issue with service objects that we want to instantiate from the container rather than from the serialized blob. Here is how we register those objects in the container - we apply special handling during deserialiation for all objects with the key Key_DoNotSerialize:</p>
</blockquote>
<pre><code>builder
.RegisterType<BotToUserQueue>()
.Keyed<IBotToUser>(FiberModule.Key_DoNotSerialize)
.AsSelf()
.As<IBotToUser>()
.SingleInstance();
</code></pre>
<p>However I cannot find an example or documentation that details how to register your own dependencies into the existing Bot Framework modules.</p>
<p>I also found <a href="https://github.com/Microsoft/BotBuilder/issues/252" rel="noreferrer">https://github.com/Microsoft/BotBuilder/issues/252</a> which indicates that it should be possible to instantiate the dialogs from the container. </p>
<p>I have tried this suggestion:</p>
<pre><code>Func<IDialog<object>> makeRoot = () => actionDialog;
await Conversation.SendAsync(activity, makeRoot);
</code></pre>
<p>Together with:</p>
<pre><code>builder
.RegisterType<ActionDialog>()
.Keyed<ActionDialog>(FiberModule.Key_DoNotSerialize)
.AsSelf()
.As<ActionDialog>()
.SingleInstance();
</code></pre>
<p>This does not work.</p>
<p>I have also tried:</p>
<pre><code>var builder = new ContainerBuilder();
builder.RegisterModule(new DialogModule_MakeRoot());
// My application module
builder.RegisterModule(new ApplicationModule());
using (var container = builder.Build())
using (var scope = DialogModule.BeginLifetimeScope(container, activity))
{
await Conversation.SendAsync(activity, () => scope.Resolve<ActionDialog>());
}
</code></pre>
<p>Together with the following in the ApplicationModule:</p>
<pre><code> builder
.RegisterType<ActionDialog>()
.Keyed<ActionDialog>(FiberModule.Key_DoNotSerialize)
.AsSelf()
.As<ActionDialog>()
.SingleInstance();
</code></pre>
<p>This does not work and I encounter the same issue.</p>
<p>If I simply mark all the services and their dependencies as serializable I can get this to work without the need to use FiberModule.Key_DoNotSerialize.</p>
<p>The question is - what is the correct / preferred / recommended way to register and inject dependencies into Bot Framework Dialogs?</p>
| 0non-cybersec
| Stackexchange |
Peer review of C# cryptography for Azure Table security. <p>Edit: Update - I am researching how to implement AES with authentication in an efficient way for this project. If you have the time I'd appreciate your skill in finding the best implementation for this FOSS project.</p>
<hr>
<p>Could you folks review and comment on the <a href="http://azuretableencrypt.codeplex.com/SourceControl/list/changesets" rel="nofollow noreferrer">encryption code I just posted</a> on Codeplex? The intent is to use this as a foundation for encrypting Azure Table properties and prevent any unauthorized MSFT employee from casually browsing or editing my data. It's a working sample that should use any public private key pair on your local system. Just make sure you set permissions on your private key correctly.</p>
<p>For Azure Table, I want to encrypt each and every property below (including rowkey and partitionkey) using a symmetric key. </p>
<pre><code>public class ContactDataModel :TableServiceEntity
{
public ContactDataModel(string partitionKey, string rowKey)
: base(partitionKey, rowKey)
{
}
public ContactDataModel(): this(Guid.NewGuid().ToString(), String.Empty)
{
}
public string Name { get; set; }
public string Address { get; set; }
// Used to rotate keys, while allowing old data to still be read
public int EncryptionVersion {get;set;}
}
</code></pre>
<p>I intend to store the encrypted version of the symmetric key, and the nonencrypted IV on Azure Table storage. The overall design assumes that an encrypted symmetric key renders all other encrypted table data useless, even if the IV is available.</p>
<p>The symmetric key is encrypted with a RSA key that is <a href="https://security.stackexchange.com/questions/2514/key-management-in-cloud-datacenters/3731#3731">securely delivered to my Azure Role instance</a>.</p>
<p><strong>Known issues:</strong></p>
<p>I do know that I'm missing a seed in my symmetric encryption. How would I implement this from a Crypto perspective?</p>
| 0non-cybersec
| Stackexchange |
Aspiring youtuber thinks she has a fan.. | 0non-cybersec
| Reddit |
Working moms- How do you do it?. Hi, r/parenting. I do not have children, but I will be trying sometime in the near future, and my spouse and I have recently gone over finances and realized that I will have to return to work after having a baby. This has always been a fear of mine, and I'm wondering how working moms do it. What tips do you have? Do you feel guilty? What happens if your kid gets sick, does your job understand? How do you not die of exhaustion? I'm very interested in any information and all different experiences, thank you! | 0non-cybersec
| Reddit |
Adult Swim announces Upfront slate. | 0non-cybersec
| Reddit |
Two Operating System On Two Different Hard Drives. <p>I have installed two different Hard drives on a single computer where HDD-1(make:SATA) has windows on it and HDD-2(make: Western-Digital) has Linux on it.
At Boot-up I am not getting the option of selecting between the two HDD rather it's selecting windows as default. I am totally unable to select HDD-1.</p>
<p>What is the way to do that?</p>
| 0non-cybersec
| Stackexchange |
Webcam not working nor detected. <p>I recently bought Acer Aspire E3-111-C10N (8GB version), and to my surprise webcam is not working.</p>
<p>lspci:</p>
<pre><code>00:00.0 Host bridge: Intel Corporation Atom Processor Z36xxx/Z37xxx Series SoC Transaction Register (rev 0e)
00:02.0 VGA compatible controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Graphics & Display (rev 0e)
00:13.0 SATA controller: Intel Corporation Device 0f23 (rev 0e)
00:14.0 USB controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series USB xHCI (rev 0e)
00:1a.0 Encryption controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Trusted Execution Engine (rev 0e)
00:1b.0 Audio device: Intel Corporation Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller (rev 0e)
00:1c.0 PCI bridge: Intel Corporation Device 0f48 (rev 0e)
00:1c.1 PCI bridge: Intel Corporation Device 0f4a (rev 0e)
00:1c.2 PCI bridge: Intel Corporation Device 0f4c (rev 0e)
00:1f.0 ISA bridge: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Power Control Unit (rev 0e)
00:1f.3 SMBus: Intel Corporation Device 0f12 (rev 0e)
02:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
</code></pre>
<p>lsusb:</p>
<pre><code>Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 0489:e078 Foxconn / Hon Hai
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
</code></pre>
<p>How you see, linux is not detecting my webcam, so do you have any ideas?
And yes, Cheese, GTK UVC and Skype also cold not reach my webcam.</p>
| 0non-cybersec
| Stackexchange |
Control shooting frequency when the button to shoot is pressed?. <p>The bullets shoot all at once when the button is pressed but I only want them to shoot once every 0.5 seconds if the button to shoot is pressed.</p>
<p>I have tried to import time and delay the bullets but it just delayed pygame itself.</p>
<p>Is there any way that I can regulate how frequent the character can shoot?</p>
<pre><code>import pygame
pygame.init()
win = pygame.display.set_mode((700, 480))
pygame.display.set_caption("First project")
run = True
red = (255, 0, 0)
green = (0, 255, 0)
def drawbg():
pygame.display.update()
win.fill((255, 255, 255))
for bullet in bullets:
bullet.draw(win)
class person(object):
def __init__(self, x, y, width, height):
self.x = x
self.y = y
self.width = width
self.height = height
self.vel = 5
self.IsJump = False
self.jumpCount = 10
self.left = False
self.right = False
class projectile(object):
def __init__(self, x, y, radius, colour, facing):
self.x = x
self.y = y
self.radius = radius
self.colour = colour
self.facing = facing
self.vel = 7 * facing
def draw(self, win):
pygame.draw.circle(win, self.colour, (self.x, self.y), self.radius)
man = person(100, 400, 50, 60)
man2 = person(500, 400, 50, 60)
bullets = []
while run:
pygame.time.delay(25)
for bullet in bullets:
if bullet.x < 700 and bullet.x > 0:
bullet.x += bullet.vel
else:
bullets.pop(bullets.index(bullet))
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
keys = pygame.key.get_pressed()
if keys[pygame.K_g]:
if man.left:
facing = -1
else:
facing = 1
if len(bullets) < 5:
bullets.append(projectile(man.x + man.width//2, round(man.y + man.height/2), 6, (100, 100, 100), facing))
if keys[pygame.K_p]:
if man2.left:
facing = -1
else:
facing = 1
if len(bullets) < 50:
bullets.append(projectile(man2.x + man2.width//2, round(man2.y + man2.height/2), 6, (0, 0, 0), facing))
if keys[pygame.K_LEFT] and man2.x > man2.vel:
man2.x -= man2.vel
man2.left = True
man2.right = False
if keys[pygame.K_RIGHT] and man2.x < 700 - man2.width - man2.vel:
man2.x += man2.vel
man2.right = True
man2.left = False
if keys[pygame.K_a] and man.x > man.vel:
man.x -= man.vel
man.left = True
man.right = False
if keys[pygame.K_d] and man.x < 700 - man.width - man.vel:
man.x += man.vel
man.right = True
man.left = False
if not man.IsJump and keys[pygame.K_w]:
man.IsJump = True
man.JumpCount = 10
if man.IsJump:
if man.JumpCount >= -10:
neg = 1
if man.JumpCount < 0:
neg = -1
man.y -= (man.JumpCount ** 2) / 2 * neg
man.JumpCount -= 1
else:
man.IsJump = False
man.JumpCount = 10
if not man2.IsJump and keys[pygame.K_UP]:
man2.IsJump = True
man2.JumpCount = 10
if man2.IsJump:
if man2.JumpCount >= -10:
neg = 1
if man2.JumpCount < 0:
neg = -1
man2.y -= (man2.JumpCount ** 2) / 2 * neg
man2.JumpCount -= 1
else:
man2.IsJump = False
man2.JumpCount = 10
pygame.draw.rect(win, red, (man.x, man.y, man.width, man.height))
pygame.draw.rect(win, green, (man2.x, man2.y, man2.width, man2.height))
drawbg()
pygame.quit()
</code></pre>
| 0non-cybersec
| Stackexchange |
New location of docker actions. <p>I was using this for docker:</p>
<pre><code>- name: Build container image
uses: actions/docker/cli@master
with:
///// removed
- name: Docker Login
uses: actions/docker/login@master
env:
///// removed
</code></pre>
<p>However github.com/actions/docker do not seem to exist anymore.</p>
<p>My builds are giving 404:</p>
<blockquote>
<p>Failed to download action '<a href="https://api.github.com/repos/actions/docker/tarball/master" rel="nofollow noreferrer">https://api.github.com/repos/actions/docker/tarball/master</a>'. Error Response status code does not indicate success: 404 (Not Found).</p>
</blockquote>
<p>Does anyone know the new location?</p>
| 0non-cybersec
| Stackexchange |
Deciding on The very best Indoor Shuffleboard Tables | Acquire Recreation Tables For the Rec Place. | 0non-cybersec
| Reddit |
Selecting 11/5 out of 30 students.. <p>How many ways are there to select a team consists of 11 members for baseball and other 5 members for basketball, from a class of 30 people?</p>
| 0non-cybersec
| Stackexchange |
How to customize colors in Material UI Stepper Step?. <p>I am trying to customize the disabled Step color on <a href="https://material-ui.com/demos/steppers/" rel="nofollow noreferrer">Material UI Steppers</a></p>
<p>The default color is Blue (Enabled) + Grey (Disabled). But I am looking to change this to something like so:</p>
<p><a href="https://i.stack.imgur.com/HGGxp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HGGxp.png" alt="enter image description here" /></a></p>
<p>But I don't seem to able to find any hook into the <code>Icon</code> section of the <code>StepLabel</code>. I already tried applying the CSS to the <code>IconContainer</code>, but the specificity is not sufficient.</p>
<p>My code is available here: <a href="https://codesandbox.io/s/0102v4z1op" rel="nofollow noreferrer">https://codesandbox.io/s/0102v4z1op</a></p>
<p>TIA!</p>
| 0non-cybersec
| Stackexchange |
The Witcher 3 HD Project version 4.4 is now available. | 0non-cybersec
| Reddit |
u_IAJAKI explains why he can't sell his brother to the Pawn Stars. | 0non-cybersec
| Reddit |
Self numbers in c++. <p>Hey, my friends and I are trying to beat each other's runtimes for generating "<a href="http://en.wikipedia.org/wiki/Self_number" rel="noreferrer">Self Numbers</a>" between 1 and a million. I've written mine in c++ and I'm still trying to shave off precious time.</p>
<p>Here's what I have so far,</p>
<pre><code>#include <iostream>
using namespace std;
bool v[1000000];
int main(void) {
long non_self = 0;
for(long i = 1; i < 1000000; ++i) {
if(!(v[i])) std::cout << i << '\n';
non_self = i + (i%10) + (i/10)%10 + (i/100)%10 + (i/1000)%10 + (i/10000)%10 +(i/100000)%10;
v[non_self] = 1;
}
std::cout << "1000000" << '\n';
return 0;
}
</code></pre>
<p>The code works fine now, I just want to optimize it.
Any tips? Thanks.</p>
| 0non-cybersec
| Stackexchange |
"Secret Millionaire" is a downright disgusting concept for TV show.. | 0non-cybersec
| Reddit |
[By Mel DiGiacomo] Street Photography | LA vs. NY. | 0non-cybersec
| Reddit |
[Homemade] Just a bacon cheeseburger I made that I'm really proud of.. | 0non-cybersec
| Reddit |
Our Little Sweet Rat, Cheeju. | 0non-cybersec
| Reddit |
Custom Collection using IEnumerable vs ICollection vs IList. <p>I need to design my own custom <code>GenericCollection</code> class. Now i have plenty of options to derive it using <code>IEnumerable</code>, <code>ICollection</code>, and <code>IList</code>, where later offers some added functionalities.</p>
<p>I am little confused that if i go with <code>IEnumerable<T></code> i might require declaring the object to actually hold the collection like in this case <code>_list</code>.</p>
<pre><code>public class GenericCollection<T> : IEnumerable<T>
{
private List<T> _list;
//...
}
</code></pre>
<p>But if i go with <code>ICollection<T></code> or <code>IList<T></code>, i do not require to declare the <code>List</code> object as it is implicitly available.</p>
<pre><code>public class GenericCollection<T> : IList<T>
{
// no need for List object
//private List<T> _list;
//...
}
</code></pre>
<p>What is the difference between these two approaches with respect to <em>performance</em>?</p>
<p>In which scenario each one is preferred especially when it comes to designing your own collection. I am interested in the light weight collection with good performance. I think this can be achieved using <code>IEnumerable<T></code> but how exactly along with some strong reasons to go with it?</p>
<p>I have reviewed some existing posts but none is giving required information.</p>
<p><a href="https://stackoverflow.com/questions/9855693/ilist-vs-icollection-vs-collection">Returning 'IList' vs 'ICollection' vs 'Collection'</a></p>
| 0non-cybersec
| Stackexchange |
Quartz scheduler in cluster environment. <p>I am using </p>
<pre><code>SchedulerFactory schedulerFactory = new StdSchedulerFactory();
scheduler = schedulerFactory.getScheduler();
scheduler.start();
Trigger asapTrigger = getAsapTrigger();
JobDetail asapJob = getAsapJobDetails();
scheduler.scheduleJob(asapJob, asapTrigger);
</code></pre>
<p>This is working but when I go for cluster environment, 2 threads are running for the same job.</p>
<p>I am using annotations not properties file. I want to run only one thread. Can someone help on this. How to configure?</p>
<p>my code almost look like : <a href="http://k2java.blogspot.com/2011/04/quartz.html">http://k2java.blogspot.com/2011/04/quartz.html</a></p>
| 0non-cybersec
| Stackexchange |
Anyone else eat too much last night?. I ate a whole 12 inch specialty pizza from Marcos. 3 kids size bags of chips. And 52 oz of mtn dew. I think I gave myself an ulcer.
ITT: what you ate for munchies last night
How do you avoid over eating after over indulging ?
Edit: sorry worked a 12 hour starting at a [3] just reading these | 0non-cybersec
| Reddit |
Qt or Symbian C++?. <p>I am planing to develop on Symbian systems but I am not familiar with it. I know (might be) the most popular way of developing on Symbian is Symbian C++, and I also heard of Qt. What's the difference between them? If I want my app run on most of the Symbian systems, which should I choose?
Can someone give me some overall advices?</p>
<p>Thank you~</p>
| 0non-cybersec
| Stackexchange |
I have finally gotten under my 98.5kg (217) barrier :). I know I is not a big deal to loose 2.3kg but for the past year every attempt at weight loss stagnated once I got to 98.5kg. I am not 97.7kg (215) :D so happy and it also means I get to use my first flair which is so cool.
Also I dislike pounds saying I am 97 feels bad but saying I am 215 just seems unfair. | 0non-cybersec
| Reddit |
How can I send an HTML email with Perl?. <p>I am trying to send an HTML email using Perl.</p>
<pre><code> open(MAIL,"|/usr/sbin/sendmail -t");
## Mail Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
## Mail Body
print MAIL "Content-Type: text/html; charset=ISO-8859-1\n\n"
. "<html><head></head><body>@emailBody";
close(MAIL)
</code></pre>
<p>Is that the correct way of doing it? It is not working for some reason. Thanks for your help.</p>
| 0non-cybersec
| Stackexchange |
Chain Reaction Candle. | 0non-cybersec
| Reddit |
In Back To The Future when Marty auditions for the school dance, he plays The Power of Love by Huey Lewis & The News. Huey Lewis is the judge that tells him he’s “just too darn loud.”. | 0non-cybersec
| Reddit |
Decided to end a shroom trip with a bowl and its the most intense high I have ever had. [10]. So yesterday, I did shrooms with a buddy and it was fun. Came back home at night and decided to smoke a bowl thinking it would ease the comedown. Boy was I wrong. It got really intense.
I played [Dark side of the moon] (https://www.youtube.com/watch?v=DLOth-BuCNY) and it felt like the video and music are made specifically for this experience. I just kept staring at the screen and couldn't move. Shutting my eyes felt like I was stuck inside a kaleidoscope. I could feel that my brain was on hyperdrive throughout the experience. Not sure if I would do this again but that was one hell of a trip.
| 0non-cybersec
| Reddit |
Is it possible to have a HDD with Windows 10 and a Linux fully encrypted with VeraCrypt?. <p>So I'd like to set up a multiboot system on my 4TB hard drive with Windows 10 64bit and a Linux distribution such as Debian and fully encrypt it with VeraCrypt. Is this possible? And if so how?</p>
| 0non-cybersec
| Stackexchange |
Seeking Healthy Recipes for Someone with Acid Reflux, Few Teeth & High Blood Pressure. I just bought my dad a crockpot and would like some suggestions on what would be good to help him cook in it. He is not particularly picky, but has some health issues that restrict what he can eat. Ideas that fit with those limits would be much appreciated.
High blood pressure-have to do low sodium recipes or recipes that can be made low sodium. Reducing saturated fat and focusing on unsaturated fats would also be good.
Acid-Reflux-spicy food is a no-go for him. Most other foods seem to be ok, but stomach friendly stuff is preferable.
Few teeth-while he should get dentures he keeps trying to hold out for free ones from the VA so for now has just a few teeth and can't chew well. I was able to macerate turkey breast enough for him to eat it and thawed frozen veggies seem to be soft enough for him to manage, but fresh veggies and solid chunks of meat are a little too difficult for him.
I look forward to hearing your suggestions. Thanks | 0non-cybersec
| Reddit |
Ladies, What sort of men/women do you attract?. I got the idea for this question seeing the same question addressed towards men on Askmen and wanted to know your take on the question. Credit due to the original poster. | 0non-cybersec
| Reddit |
Can I use cookie dough in a waffle iron?. Got a waffle iron recently, was just wondering if I could use cookie dough in it. I've found only a few recipes specifically for waffle iron cookies, but could I just use any other cookie recipe? Or maybe a specific type of cookie dough (e.g. soft, teaspoon-drop type vs solid, cookie-cutter type)? | 0non-cybersec
| Reddit |
How to make a formula to calculate how many of each unique item are in a column in the last 365 days. <p>I have <a href="https://docs.google.com/spreadsheets/d/1udhBB1ojZTKWPJHFrDKFxsCV4nEVTewFf4TmXMdh2ZI/edit#gid=0" rel="nofollow noreferrer">two columns A:A (dates) and B:B (items)</a></p>
<p>.....
I need to find a formula to calculate how many of each unique item are in column B : B in the last 365 days.
In the example the right value in the formula is 2</p>
| 0non-cybersec
| Stackexchange |
How to use a column header to reference a cell in Google Apps Script Spreadsheet. <p>I have several Google Sheets that I connect and update cells between them. Right now I have to use R1C1 or A1 type references to define getting or setting cells based on specific columns.</p>
<p>If a new column is added, all those references are now off.</p>
<p>Row one of each sheet has column headers as values in those cells.</p>
<p>Can I reference a cell in a format such as [columnHeader]5 for the cell in that column, fifth row?</p>
<p>I thought of setting each individual column heading as a 'named range', but I am stuck at being able to reference a cell using [named range]5.</p>
<p>I suppose I could use some method of dynamically defining 100 variables to the then current column numbers (R1C1) format (in all the sheets) and then try to use those pseudo-header variables in my cell references. But I will probably run the scripts 100's of times a day and that horrible inefficiency hurts the engineer in me.</p>
<p>Thanks in advance.</p>
<p>chuck</p>
| 0non-cybersec
| Stackexchange |
The Chicago Bears have resigned long snapper Patrick Scales. | 0non-cybersec
| Reddit |
Feedly has finally won me over. The new mobile app is brilliant and productive.. | 0non-cybersec
| Reddit |
The sound of war rumbles from the gates of Orgrimmar.. | 0non-cybersec
| Reddit |
will it be dense in $M_n(\mathbb{C})\times M_n(\mathbb{C})$. <p>Set of all pair $(A,E)$ for which $\det(A-\lambda E)\ne 0$ as a polynomial, forms a dense open set in $M_n(\mathbb{C})\times M_n(\mathbb{C})$?</p>
<p>I proved $GL_n(\mathbb{C})$ is dense and open set in $M_n(\mathbb{C})$
like this:
$A$ be any complex matrix, found its eigenvalues $\lambda_1,\dots,\lambda_n$ and choose $\lambda<\min\{|\lambda_1|,\dots,|\lambda_n|\}$
Then the sequence $A_n=A-\frac{\lambda}{n}I\to A$ and since $\frac{\lambda}{n}\ne\lambda_i$, each entries of the sequence $\{A_n\}$ is an invertible matrix, converging to an arbitrary matrix $A$ in the set. I was trying to mimic this proof in my currently needed problem but did not succed. Thanks for helping.</p>
| 0non-cybersec
| Stackexchange |
New At The Drive In album. I have been a huge ATDI fan since I was 12. I really like their new album, in•ter a•li•a.
What are your thoughts? | 0non-cybersec
| Reddit |
Problem with math formula contains alpha subscript. <p>I am newbie to latex. I would like to write a long math formula but I can't figure out why alpha subscript is missed out after compiling (Please find the attached picture). Here is how I write the formula in overleaf.</p>
<pre><code>\begin{equation}
u = \sum_{I=1}^{N} N_I{(x)} \left[U_I + H(x)a_I + \sum_{\alpha{=1}}^{4}F_{\alpha}(x)b_I^{\alpha}\right]
\end{equation}
</code></pre>
<p>For further clarification, I can see that the following packages and fonts are used for writing the math in class file.</p>
<pre><code>\RequirePackage{amsmath}
\RequirePackage{mathspec}
\setmathsfont(Digits,Latin,Greek)[Numbers={Proportional},SizeFeatures={{Size=-8, OpticalSize=8},{Size= 8-, OpticalSize=12}},]{EB Garamond}
\setmathrm{EB Garamond}
</code></pre>
<p>Please could someone point out what is wrong here? Many thanks for your help in advance!</p>
<p><a href="https://i.stack.imgur.com/no5GL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/no5GL.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
Subdomain SSL and redirecting. <p>So, I have a portal type of website that I'm considering selling.</p>
<p>Let's for the sake of convenience, call my website www.portal.com. If I sell one of these portals, I would like them to be under the portal umbrella, and therefor have them as: client1.portal.com or if their company name is Microsoft, have it be microsoft.portal.com.</p>
<p>To add complexity, I would like there to be SSL on the website(s).</p>
<p>I'm assuming I need a wildcard SSL to facilitate all my clients as I don't want to change my certificate every time a client is added or removed.</p>
<p><strong>The main question:</strong></p>
<p>Is there a way that, for my client to keep their own website: www.client1.com, instead, redirect to client1.portal.com without them seeing this in their URL bar?</p>
<p>What do I need (incase I need to buy anything) and what is the technical term of achieving this?</p>
| 0non-cybersec
| Stackexchange |
uint64 is not exact for vectors in Matlab. <p>I have discovered an inconsistency for <code>uint64</code> when using vectors in Matlab. It seems as an array of uint64 is not exact for all 64 bits. This did not give the output I expected,</p>
<pre><code>p=uint64([0;0]);
p(1)=13286492335502040542
p =
13286492335502041088
0
</code></pre>
<p>However</p>
<pre><code>q = uint64(13286492335502040542)
q =
13286492335502040542
</code></pre>
<p>does. It is also working with</p>
<pre><code>p(1)=uint64(13286492335502040542)
p =
13286492335502040542
0
</code></pre>
<p>Working with unsigned integers one expect a special behaviour and usually also perfect precision. This seems weird and even a bit uncanny. I do not see this problem with smaller numbers. Maybe anyone knows more? I do not expect this to be an unknown problem, so I guess there must be some explanation to it. I would be good to know why this happen and when, to be able to avoid it. As usual this kind of issues is mentioned nowhere in the documentation.</p>
<p>Matlab 2014a, windows 7.</p>
<p><strong>EDIT</strong></p>
<p>It is worth mentioning that I can see the same behaviour when defining arrays directly.</p>
<pre><code>p=uint64([13286492335502040542;13286492335502040543])
p =
13286492335502041088
13286492335502041088
</code></pre>
<p>This is the root to why I ask this question. I have hard to see workaround for this case.</p>
| 0non-cybersec
| Stackexchange |
HOW TO HACK WIFI | LET'S HACK #7. | 1cybersec
| Reddit |
ELI5: How do they transport horses for international races like the Melbourne Cup?. Ship? Plane? Special plane? Special phip? Network of Horse Tunnels made by rare tunneling work horses? | 0non-cybersec
| Reddit |
If money was no object, what 802.11 bridge/repeater/wi-fi extender combo would you get and why?. I've been looking into alfa, ubiquiti, and aruba brand appliances and almost all of them seem too "consumer grade" I'm kind of looking for the signal strength of the "industrial strength" variety
Power tools that really push the limits of range and signal strength here. | 1cybersec
| Reddit |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.