text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Met SO tool coworker and need to vent. I went to an afterwork party with my SO and was making the rounds, being introduced and making small talk. We get to the last set of couples and they ask what I do. I tell them I'm a teaching and mid-explanation of where/what I do, he starts saying "oh, my teacher was so hot. I mean, tiny waist, big boobs..." and I'm thinking "Ok, cool story bro" and get the vibe we aren't going to get along. So I start talking to another couple, but I can still hear him. Literally, the ONLY thing he talked to his date about was how hot/ugly every single female at the party was. Regardless of gender, I think it's rude and shallow to discuss such things with a date. He also made some shitty comments about my relationship with my SO about me wearing the pants, to which my SO handled beautifully. Anyway, thanks for letting me rant TwoX
0non-cybersec
Reddit
214
867
Checking whether a relation is transitive. <p>I'm currently preparing for my maths exam and one of the questions is to check whether or not a relation is transitive or not. I'm unsure on how to check if there is a transitive relation given an equation.</p> <p>The questions I would be getting is like this.</p> <p>Let $Q$ denote the relation on set $\mathbb Z$ of integers, where integers $x$ and $y$ satisfy $xQy$ if and only if</p> <p>$$x - y = x^2 + y^2 - 2xy$$</p> <p>I know how to figure out if it is symmetric and reflexive but I'm unsure on how to check the transitive part. Any help is appreciated, thank you.</p>
0non-cybersec
Stackexchange
188
626
Inactive window scrolling not working with excel. <h3>Inactive window scrolling:</h3> <p>With windows 10 there is a new feature called inactive window scrolling, which means if your mouse hovers over a window you can scroll on it, without it needing to be the active window.</p> <h3>Problem:</h3> <p>This feature is pretty great, but it does not work with Microsoft excel. If excel has the focus, you scroll in excel wherever your mouse is.<br /> So most of the time when I am working with excel and browsing in the web at the same time I almost always accidentally scroll my excel table away.</p> <p>Is there some kind of setting or feature or workaround to fix the problem? Thanks in advance</p>
0non-cybersec
Stackexchange
173
698
Is there a way to do in-place C macro expansion in VS code?. <p>I am using Visual Studio Code 1.34 and ms-vscode.cpptools 0.24.1. In a C file, when I hover over a statement containing a C macro, VS Code is kind enough to expand the macro in a hover box.</p> <p>I can select this expanded piece of code and then manually replace the macro's 'call' side with it. But I was wondering if there is a way in vscode or in one of its extensions to do this macro expansion in-place, e.g. using some key shortcut. From what I have read from the documentation, I think you cannot do this with ms-vscode.cpptools alone.</p> <p>It would be a nice bonus if back-slash line breaks were substituted with actual new lines in the in-place expension.</p>
0non-cybersec
Stackexchange
204
739
Need advice for night wakings. I am super sleep deprived so I am apologizing for my rambling and awful sentence structuring now. So this is what's up: I have a one year old and we have been trying to gently sleep train her for months with no progress, we have been bedsharing up until last night. Last night I succumbed to trying to CIO with me in the room with her in the crib (in her own room) and me in a mattress so I could stay with her while she cried. She cried for fourty minutes then finally went to sleep, I felt awful and cried too so please only constructive comments. Anyway she went to sleep but then woke up 2.5 hours later at 11:30 wanting to breastfeed and I let her, she actually seemed hungry. Then she fell asleep on my lap and I put her in crib again right away but she went to sleep, I was surprised but relieved. She then woke up again at 2:00am and we did the same thing, and again at 3:30am then again at 5:00 am but I had to take her back In our bed because I was exhausted and she wouldn't go back to sleep without being next to me. So I know that I need to at least cut the feeds in half. I also wonder if this is habitual waking because the whole reason I needed to start sleep training is because she was waking every two hours to feed in our bed and it got so out of control. So I'm unsure if I should try to go in an hour before the usual wake time and stir her a bit to get her to try to get out of this habitual waking. I also don't know what method to use to get baby to go back to sleep without feeding. I have a three year old so I try to get her back to sleep in the middle of the night without crying. I'm not sure if I can get away with getting her to sleep on her own without a feed without crying but I want too. She also was/is a Velcro baby, I don't know if this info is pertinent, she is pretty willful. I guess I don't know what my next steps are and I'm trying it figure out what to do, and how I should go about tackling these wakings and weaning on the feedings. I'm pretty hopeless.
0non-cybersec
Reddit
493
2,039
How to Best Minimize Damage After Loss of Computer. <p>Myself and the rest of my coworkers on my (former) employer’s dev team were all just laid off from our jobs, and the employer took our MacBook Pros without letting us clear of our personal information or log out from web services. </p> <p>Now, I’ve covered the bases the best I can by changing those web passwords, and I was smart enough to use a unique password for logging into this machine and used 2FA on all sites that supported it.</p> <p>I know that I’m screwed when it comes to the files that were stored on my computer; I lost months of work on personal projects. (To be fair, I shouldn’t have been using it for personal things… but alas, this is the situation I currently find myself in. Live and learn.)</p> <p>Something that does bother me a lot is that my private signing key and Apple iOS dev certs were on the computer as well.</p> <p>I’m just really paranoid that something bad is going to come from this. I’ve <em>never</em> let anything like this happen before, but this caught me and my coworkers by surprise; we didn’t have any time to back up or wipe anything. They called us into to a different room, told us the bad news, and unceremoniously escorted us out without letting us go back to our computers.</p> <p>What steps can and should I take from here on out to help prevent further damage from this?</p> <p><strong>TL;DR: Laid off, wasn’t able to clear personal data, remove private keys, or log out of websites. What can I do at this point to at least <em>minimize</em> Bad Things™?</strong></p>
0non-cybersec
Stackexchange
413
1,584
Theme WAYWT - Techwear Challenge - July 21, 2016. **THIS IS THE WAYWT THREAD** = ______ [Link to the announcement thread]( https://www.reddit.com/r/malefashionadvice/comments/4su3bn/announcement_techwear_challenge_thursday_072116/) ______ **What Do?** Show us your creativity = This is the techwear WAYWT challenge, if you are not ready to fight for the freedom of the dystopic future then sit this one out. Let those who dare to try to become cyborgs reap their glory as enhanced beings. Regular WAYWT will be posted tomorrow. ______ ***WAYWT and extra special Thursday rules apply.*** So if you think techwear is dead then you should probably just leave right now. _____ For a full reference of the 2016 Spring WAYWT Theme Challenge schedule, [please see this post]( https://www.reddit.com/r/malefashionadvice/comments/4ervu2/mfa_challengetheme_waywt_schedule_spring_2016/) - This are nearing the end of the season. Lets finish strong!
0non-cybersec
Reddit
281
972
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to make a CriteriaBuilder join with a custom &quot;on&quot; condition?. <p>I want make a query where I join 2 tables, using the CriteriaBuilder. In MySQL the query I'm trying to make would look like this:</p> <pre><code>SELECT * FROM order LEFT JOIN item ON order.id = item.order_id AND item.type_id = 1 </code></pre> <p>I want to get all orders and if they have an item of type #1, I want to join with this item. However, if no item of type #1 is found, I still want to get the order. I can't figure out how to make this with the CriteriaBuilder. All I know how to make is:</p> <pre><code>CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery&lt;Order&gt; cq = cb.createQuery(Order.class); Root&lt;Order&gt; order = cq.from(Order.class); Join&lt;Order, Item&gt; item = order.join(Order_.itemList, JoinType.LEFT); Join&lt;Item, Type&gt; type = order.join(Item_.type, JoinType.LEFT); cq.select(order); cq.where(cb.equal(type.get(Type_.id), 1)); </code></pre> <p>This query is broke, since it results in something like this in MySQL:</p> <pre><code>SELECT * FROM order LEFT JOIN item ON order.id = item.order_id WHERE item.type_id = 1 </code></pre> <p>The result will only contain orders with items of type #1. Orders without are excluded. How can I use the CriteriaBuilder to create a query like in the first example?</p>
0non-cybersec
Stackexchange
424
1,337
Implication of Area Formula (Measure Theory). <p>In the book <strong>Measure Theory and Fine Properties of Functions</strong> of <em>Evans and Gariepy</em> has the theorem:</p> <p><strong>Theorem (Area Formula)</strong>: Let $f: \mathbb{R}^n \longrightarrow \mathbb{R}^m$ be Lipschitz, $n\leq m$. Then for each $\mathcal{L}^n$-measurable subset $A\subset \mathbb{R}^n$, $\int_A Jfdx=\int_{\mathbb{R}^m} \mathcal{H}^0(A\cap f^{-1}(y))d\mathcal{H}^n(y)$.</p> <p>Where, $\mathcal{H}^n$ and $\mathcal{H}^m$ are Hausdorff measure. $\mathcal{H}^0$ is counting measure. $J(f)$ is the Jacobian of $f$.</p> <p>After the theorem has the remark,</p> <p><strong>Remark</strong>: Using the Area Formula, we see $f^{-1}(y)$ is at most countable for $\mathcal{H}^n$ a.e $y\in \mathbb{R}^m$.</p> <p><strong>My question</strong>: How to prove this remark?</p>
0non-cybersec
Stackexchange
307
853
Is there a way to ignore an error return value in Golang?. <p>I'm trying to initialize a struct in Go, one of my values is being which returns both an int and an error if one was encountered converted from a string using <code>strconv.Atoi("val")</code>.</p> <p>My question is : Is there a way to ignore an error return value in Golang?</p> <pre><code>ts := &amp;student{ name: td[0], ssn: td[2], next: students.next, age: strconv.Atoi(td[1]), } </code></pre> <p>which gives the error</p> <pre><code>multiple-value strconv.Atoi() in single-value context </code></pre> <p>if I add in the err, which i don't want to include in my struct, I will get an error that I am using a method that is not defined in the struct.</p>
0non-cybersec
Stackexchange
244
743
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Congruence numbers. <p>Having read about <a href="https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind" rel="nofollow">Stirling numbers of the second kind</a> I am curious. The article says it shows the number of equivalence relations on a set $n$ with $k$ equivalence classes which makes sense to me from the definition. I am curious, is there any such number/process to acquire the the <a href="https://en.wikipedia.org/wiki/Congruence_relation" rel="nofollow">congruence relation</a> count? I realize this would be heavily determined by the operations on but it could possibly exist, couldn't it?</p>
0non-cybersec
Stackexchange
166
617
What is the AngularJS equivalent to Backbone&#39;s Collections?. <p>Is there an equivalent to <a href="http://backbonejs.org/#Collection" rel="nofollow noreferrer">Backbone's Collection</a> or <a href="http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.data.Store" rel="nofollow noreferrer">Ext JS's Store</a> in Angular JS? I'm learning about <a href="http://docs.angularjs.org/api/ngResource/service/$resource" rel="nofollow noreferrer">$resource</a>, but not quite getting this aspect.</p> <h2>Controller</h2> <pre><code>// This is the "collection" I'm interested in. $scope.foos = []; // Foo is a $resource. Foo.query(function (foos) { // This works, but is there a smarter "collection" object? $scope.foos = foos; }); $scope.createFoo = function (data) { var foo = new Foo(data); foo.$save(function (shinyNewFoo) { $scope.foos.unshift(shinyNewFoo); }); }; </code></pre> <h2>Explanation</h2> <p>In <code>$scope.createFoo</code> I'm making a new Foo, persisting it, then adding it to my <em>poor man's collection</em>, an array. This works and the view is updated correctly, but I'm too lazy for this. Ideally, I'd like to have a "collection" I can add to and remove from that will automatically POST/DELETE. Maybe something like the following.</p> <h2>Pretend Implementation</h2> <pre><code>$scope.fooCollection = new CoolCollection({ // specify the type of resources this collection will contain itemsResource: Foo }); // Creates new Foo, saves, adds to collection. $scope.fooCollection.add(data); </code></pre> <p>Does something like this exist? The $resource docs mention a collection, but I didn't really get it. <a href="https://stackoverflow.com/questions/12762574/backbone-style-models-in-angularjs">This answer</a> seemed promising, but didn't explain the collection idea. Am I missing something or just not thinking about this <em>the Angular way</em>?</p> <hr> <h1>Addendum</h1> <p>In the MEAN.io boilerplate, <a href="https://github.com/linnovate/mean/blob/master/public/js/controllers/articles.js" rel="nofollow noreferrer">the article controller</a> suggests that the "collection" is managed manually (see the <code>splice</code> below).</p> <pre><code>$scope.remove = function(article) { if (article) { article.$remove(); for (var i in $scope.articles) { if ($scope.articles[i] === article) { $scope.articles.splice(i, 1); } } } else { $scope.article.$remove(); $location.path('articles'); } }; </code></pre> <p>If this elusive "collection" existed, I suppose they would have used it. Instead, they're managing an array manually.</p>
0non-cybersec
Stackexchange
849
2,683
Is it bad to break out of a labelled block in Java?. <p>I sometimes write Java code that looks like:</p> <pre><code>success: { fail: { if (...) break fail; // some code if (...) break fail; // some code if (...) break fail; // some code break success; } // failure handling code } </code></pre> <p>Is this bad practice? I could extract this to a method that returns an <code>Optional&lt;SomeResultClass&gt;</code>, and then call that method from the main method, but I'm worried that this will be bad for performance.</p>
0non-cybersec
Stackexchange
165
592
How to typeset this symbol with \mathcal?. <p>I want to typeset the symbol $(C_m)$ by using <code>\mathcal</code>, I tried</p> <pre><code>\documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{calrsfs} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[mathscr]{euscript} \begin{document} $\mathcal{(C}_m)$ \end{document} </code></pre> <p>The results are not beautiful. I can not use $\mathcal{(C_m)})$ How can I typeset this symbol?</p>
0non-cybersec
Stackexchange
192
551
Got an error reading communication packets. <p>I have a server application that's using MySQL INNODB databases to store its data. I know that this application has worked as is in the past, but I don't know anything about the database server configuration it was using. Now while interacting with said server application using its respective client application I get the following MySQL error:</p> <pre><code>Aborted connection XX to db: '...' user: '...' host: '...' (Got an error reading communication packets) </code></pre> <p>The server application meanwhile has this to say:</p> <pre><code>[ERROR] Database Execution Error - query '{ call sp_x8(?,?,?) }, message '[MySQL][ODBC 5.2(w) Driver][mysqld-5.6.19]Lost connection to MySQL server during query' [ERROR] 08S01 : try to reconnect : 08S01 [ERROR] Database Execution Error - can't execute stored procedure '{ call sp_x8(?,?,?) }' [ERROR] Database Error - query '{ call sp_x8(?,?,?) }', param : 1(int64), 0(int), -1(int), [ERROR] Database Execution Error - query 'rollback', message '[MySQL][ODBC 5.2(w) Driver][mysqld-5.6.19]MySQL server has gone away' [ERROR] 08S01 : try to reconnect : 08S01 [ERROR] Database Execution Error - can't execute stored procedure 'rollback' [INFO] UnhandledException </code></pre> <p>This happens at the same spot every time. It runs other stored procedures before just fine, but the one where the error happens is part of a larger transaction that runs several stored procedures. From the general log file:</p> <pre><code>23 Query set autocommit = off 23 Prepare call sp_x1(?,?,?) 23 Execute call sp_x1('1','1','0') 23 Close stmt 23 Query commit 23 Query set autocommit = on 46 Query set autocommit = off 46 Prepare call sp_x2(?,?) 46 Execute call sp_x2('1','') 46 Close stmt 46 Prepare call sp_x3(?) 46 Execute call sp_x3('1') 46 Close stmt 46 Query set autocommit = off 46 Prepare call sp_x4(?,?,?) 46 Execute call sp_x4('1','10','0') 46 Close stmt 46 Query commit 46 Query set autocommit = on 46 Query commit 46 Query set autocommit = on 45 Query set @@sql_select_limit=DEFAULT 45 Query set autocommit = off 45 Prepare call sp_x5(?,?) 45 Execute call sp_x5('1','1024') 45 Close stmt 45 Prepare call sp_x6(?,?,?) 45 Execute call sp_x6('1','1','-1') 45 Close stmt 45 Prepare call sp_x7(?,?,?) 45 Execute call sp_x7('1','1','0') 45 Close stmt 45 Prepare call sp_x8(?,?,?) </code></pre> <p>This is the entire log for this session, since after that last prepare the connection is lost. I doesn't matter if I make it not run <em>that</em> SP either, it will fail on the next one coming after it then.</p> <p>First I tried running the applications with the latest MySQL servers and ODBC connectors, but that actually resulted in this and other errors happening even earlier. Since the application was developed around 2014~2015 I downgraded to ODBC 5.3.4 and MySQL server 5.6.19, which got me this far.</p> <p>Now the internet is full of tips about how to solve this error message, but the usual solutions are tweaking the various <code>timeout</code> and <code>max_allowed_packet</code> settings. However, changing these settings made no difference to me, the error kept happening in the same spot. Right now these settings are as follows. I know that they're ridiculous high, but I was just hoping for <em>some</em> kind of change that never came as I raised them further and further.</p> <pre><code>max_allowed_packet = 1024M interactive_timeout = 600000 wait_timeout = 600000 connect_timeout = 600000 net_read_timeout = 600000 net_write_timeout = 600000 innodb_buffer_pool_size = 2G innodb_log_buffer_size = 64M innodb_log_file_size = 1024M innodb_log_files_in_group = 3 </code></pre> <p>I should also mention that all this happens in the span of seconds, so even default timeouts of 30 seconds shouldn't cause these errors I believe, because that entire general log snippet above takes place over the span of maybe 5 seconds.</p> <p>I'm at my wits' end and I'm hoping someone might have an idea what else could be causing this error, or which versions the application might've targeted.</p>
0non-cybersec
Stackexchange
1,246
4,233
Is being lame on social media a turn off?. I’m not good with social media and I don’t have much interest in getting better at it HAHA. I have very few followers and I usually lose a follower every time I post something (which is rare). I never gave it much thought until I overheard someone saying they were interested in someone but that they had a lame Instagram. At first I thought- wow that person is shallow. But now every time I start talking to someone they ask for my Instagram handle and I’m worried they’ll judge me based off of my sub par content and few followers. I feel lame even typing this out, please be kind :)
0non-cybersec
Reddit
143
630
Chaos Definition vs stretching and folding. <p>As recalled by <a href="https://en.wikipedia.org/wiki/Chaos_theory" rel="nofollow noreferrer">Wikipedia</a>: </p> <blockquote> <p>Although no universally accepted mathematical definition of chaos exists, a commonly used definition originally formulated by Robert L. Devaney says that, to classify a dynamical system as chaotic, it must have these properties:</p> <ul> <li>it must be sensitive to initial conditions, </li> <li>it must be topologically transitive</li> <li>it must have dense periodic orbits.</li> </ul> </blockquote> <p>I also know that a way to obtain chaos in phase space is when the system causes trajectories to stretch and fold. I would like to understand the connection between the stretching and folding process and the properties of aforementioned definition. The sensitivity to initial conditions is probably related to stretching dynamics but is the "folding" related to other two properties? And if yes, why?</p> <p>Answers, books and articles are welcome. Thanks!</p>
0non-cybersec
Stackexchange
274
1,066
Passing user identity to an internal REST service. <p>I have two services - A and B - which both expose a HTTP/REST API. Service A is exposed to the public and authenticates its users. It delegates part of the workload to service B which also has to know the identity of the authenticated user and perform some access control. Service B has no public IP address and only accepts connections from services in the same internal network (service A being one of them).</p> <p>As I consider the connection between A and B trusted (they are both behind two firewalls), I simply pass the user identity in a custom HTTP header. Are there vulnerabilities in this setup I'm not thinking of? Are there standard ways of passing the user identity instead of using a custom HTTP header? </p>
0non-cybersec
Stackexchange
171
779
Holomorphic function with reals to reals. <p>Suppose that $f$ is an entire function and that there is a bounded sequence of real numbers $a_1, a_2, ... $ such that $f(a_n)$ is real for all $n$. Show that $f(x)$ is real for all real $x$.</p> <p>Thoughts so far: Since $a_n$ is a bounded sequence of real numbers, we now that the set ${a_n}$ has an accumulation point. Now, since we're given that the function is entire, my first thought was to apply Liouville's Theorem somehow, but I can't get it to work out. A hint would be much appreciated.</p> <p>Context: I'm studying for a qual, so just a hint at this point would be most helpful. </p>
0non-cybersec
Stackexchange
193
644
pandas apply typeError: &#39;float&#39; object is not subscriptable. <p>I have a dataframe <code>df_tr</code> like this:</p> <pre><code> item_id target target_sum target_count 0 0 0 1 50 1 0 0 1 50 </code></pre> <p>I'm trying to find the mean of the target but excluding the target value of the current row, and put the mean value in a new column. The result would be:</p> <pre><code> item_id target target_sum target_count item_id_mean_target 0 0 0 1 50 0.02041 1 0 0 1 50 0.02041 </code></pre> <p>where I computed <code>item_id_mean_target</code> value from the formula:</p> <pre><code>target_sum - target/target_count - 1 </code></pre> <p>...with this code:</p> <pre><code>df_tr['item_id_mean_target'] = df_tr.target.apply(lambda x: (x['target_sum']-x)/(x['target_count']-1)) </code></pre> <p>I think my solution is correct but instead I got: </p> <pre><code>TypeError: 'float' object is not subscriptable </code></pre>
0non-cybersec
Stackexchange
367
1,168
I just need to rant for a quick minute.. I love racist jokes. They're my favorite, over all, because they're just jokes. It's so ridiculous that someone would actually believe that being born a different color or choosing a different faith makes them inherently better than those who differ from them. People need to understand that it's a just a goddamn joke and that being offended by something intended to lighten a mood is just a waste of energy when you just let that hater hate. I love when people provoke stereotypes because if I truly dislike any group of people in the world, it's those people who embody the bad stereotypes within all of their power. It's the most annoying bullshit that I've ever known. I honestly believe that Morgan Freeman knows the truest way to rid the world of racism. He says the way to get rid of racism is to stop talking about it. There is not a larger and more apparent truth in the history of anything, because children are more impressionable than a group of the most gullible folks on the face of the earth. Children become ignorant because they are taught ignorance. I was a toddler, I was a middle-class honkey who had no clue about the idea of racism. Some of my best friends were black and latino. I never looked down on anybody, never made fun of anyone. I just wanted to have friends, so I made friends out of everybody. There was no thought in my mind that the black kid was any different from me, sure I recognized his skin color, but more I recognized that we both fucking loved Power Rangers. I taught myself to except others for what their thoughts had in common with my own. Race was never an issue to me because no one brought it to my attention that I should think differently of others based upon their race or religion. It actually took me longer to accept the idea that racism exists because I didn’t understand the idea someone would look down on an entire group of people just because they were a different skin color. There are still black people that despise white people because they were raised on “the white man is the devil.” I despise anybody who would dare teach their children that my skin color automatically decides whether or not I am a trustworthy person. Saying that I look trustworthy because I’m an average sized white man with no piercings or tattoos is just as ignorant as saying the 6’4” tattooed black man looks untrustworthy. Is it hypocritical that I hate racism but love racist jokes? I don’t think so. I love racist jokes for the illogicality that is racism, but I hate racism because it’s so goddamn illogical. P.S.: Hey, white teenager. Stop calling your friends “nigga.” You’re only allowed to use that word in a demonstrative form. I don’t care if your black friend said it’s alright, my black friend says it’s definitely not alright. Cut that shit out.
0non-cybersec
Reddit
623
2,848
Odd derivatives of a function $f$ satisfying $f(1/z)=-f(z)$. <p>Suppose <span class="math-container">$f$</span> is a function in <span class="math-container">$z$</span> such that for all <span class="math-container">$z$</span>, <span class="math-container">$$f\left(\frac{1}{z}\right)=-f(z).$$</span> (Examples are <span class="math-container">$\frac{1-z}{1+z}$</span> and <span class="math-container">$\log z$</span>.) It turns out that for odd <span class="math-container">$k$</span>, <span class="math-container">$f^{(k)}(1)$</span> is independent of <span class="math-container">$f^{(j)}(1)$</span> for all <span class="math-container">$j&lt;k$</span>, whereas for even <span class="math-container">$k$</span>, <span class="math-container">$f^{(k)}(1)$</span> depends on all <span class="math-container">$f^{(j)}(1)$</span> for odd <span class="math-container">$j&lt;k$</span>. </p> <p>Is there a way to see that without computing individual derivatives and successively solving for <span class="math-container">$f^{(k)}(1)$</span>? Perhaps, combinatorially? This can be derived from the properties of the <a href="https://oeis.org/A105278" rel="nofollow noreferrer">Lah triangle</a>, but I wonder if there is a proof that avoids those heavy computations. To see why the Lah numbers are involved, see exercise 7 on page 157-158 of <a href="https://archive.org/details/Comtet_Louis_-_Advanced_Coatorics/page/n83" rel="nofollow noreferrer">Comtet</a> (the case of <span class="math-container">$\alpha=-1$</span>).</p>
0non-cybersec
Stackexchange
489
1,521
Plot for every 10 minutes in datetime. <p>The 'df' I am using has multiple rows for each <code>datetime</code>. I want to plot a scatterplot of all coordinates with the same <code>datetime</code> for every 10 minutes. There is a data entry for every location, every 10 minutes in <code>df_data</code></p> <p>It works if I manually input the times into <code>t_list = [datetime(2017, 12, 23, 06, 00, 00), datetime(2017, 12, 23, 06, 10, 00), datetime(2017, 12, 23, 06, 20, 00)]</code>but I want to replace this with something that uses the dates from <code>df</code> so I can use it for multiple datasets. </p> <pre><code>import pandas as pd import matplotlib.pyplot as plt from datetime import datetime, timedelta import numpy as np df_data = pd.read_csv('C:\data.csv') df_data['datetime'] = pd.to_datetime(df_data['TimeStamp'] ) df = df_data[(df_data['datetime']&gt;= datetime(2017, 12, 23, 06,00, 00)) &amp; (df_data['datetime']&lt; datetime(2017, 12, 23, 07, 00, 00))] ##want a time array for all of the datetimes in the df t_list = [datetime(2017, 12, 23, 06, 00, 00), datetime(2017, 12, 23, 06, 10, 00), datetime(2017, 12, 23, 06, 20, 00)] for t in t_list: t_end = t + timedelta(minutes = 10) t_text = t.strftime("%d-%b-%Y (%H:%M)") #boolean indexing with multiple conditions, you should wrap each single condition in brackets df_t = df[(df['datetime']&gt;=t) &amp; (df['datetime']&lt;t_end)] #get data into variable ws = df_t['Sp_mean'] lat = df_t['x'] lon = df_t['y'] col = 0.75 #calc min/max for setting scale on images min_ws = df['Sp_mean'].min() max_ws = df['Sp_mean'].max() plt.figure(figsize=(15,10)) plt.scatter(lon, lat, c=ws,s=300, vmin=min_ws, vmax=max_ws) plt.title('event' + t_text,fontweight = 'bold',fontsize=18) plt.show() </code></pre> <p>I have tried a few ways of attempting to make a copy of <code>datetime</code> as an iterable list which haven't given me the results I am after, the most recent below: </p> <pre><code>date_arrray = np.arange(np.datetime64(df['datetime'])) df['timedelta'] = pd.to_timedelta(df['datetime']) </code></pre> <p>example dataset </p> <p><a href="https://i.stack.imgur.com/FWroW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FWroW.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
823
2,342
java.lang.AbstractMethodError when spy the LinkedList in Android. <p>I want to spy the Linkedlist in android.</p> <pre><code>List list = new LinkedList(); List spyData = Mockito.spy(list); spyData.add("xxxx"); </code></pre> <p>However, the exception occured.</p> <pre><code>java.lang.AbstractMethodError: abstract method "boolean org.mockito.internal.invocation.AbstractAwareMethod.isAbstract()" at org.mockito.internal.invocation.InvocationImpl.callRealMethod(InvocationImpl.java:109) at org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:41) at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:93) at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29) at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38) at com.google.dexmaker.mockito.InvocationHandlerAdapter.invoke(InvocationHandlerAdapter.java:49) at LinkedList_Proxy.add(LinkedList_Proxy.generated) at com.app.test.testmethod(mytest.java:202) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1858) </code></pre> <p>The dependencies of libs are</p> <pre><code>dexmaker-1.2.jar dexmaker-mockito-1.2.jar mockito-core-1.10.19.jar </code></pre> <p>Even I update <code>mockito-core-1.10.19.jar</code> to <code>mockito-core-2.0.31-beta.jar</code>,</p> <p>the problem still exists.</p> <p>But <code>Mockito.mock(Linkedlist.class)</code> is ok, I have no ideas about this problem.</p> <p>Thank you.</p>
0non-cybersec
Stackexchange
608
1,803
How to include custom non-system folder under This PC in Windows 8.1?. <p>I've recently upgraded from Windows 8 to 8.1 and noticed the restructured <em>This PC</em> folder, formerly <em>Computer</em>. </p> <p><em>What I want to achieve is to include custom folder under "This PC".</em></p> <p><img src="https://i.stack.imgur.com/LpQQI.png" alt="This PC"></p> <p>What I've found after googling is that what is displayed under "This PC" is stored in registries under </p> <p><code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace</code></p> <p>However those folders (such as <em>Desktop</em>, <em>Documents</em>, etc) are referenced via <em>CLSID</em> and the folder I want to include in the list does not have <em>CLSID</em>.</p>
0non-cybersec
Stackexchange
251
776
Specify a different username for default Postgres user. <p>I have the same issue as: <a href="https://dba.stackexchange.com/questions/126926/specifying-a-username-while-running-initdb-causes-error-in-log-on-start-of-postg/126939#126939?newreg=77007c9fbf4949cc8cbe32c1fe0aac32">Specifying a username while running initdb causes error in log on start of PostgreSQL process</a></p> <p>but I am working on setting up PostgreSQL on Ubuntu 17.04 instead of CentOS. I've read that calling <code>initdb</code> directly in this environment is discouraged because the suite of tools packaged with the software such as <code>pg_createcluster</code>, etc. What differences should I consider if I try initializing with a user other than the default postgres user?</p>
0non-cybersec
Stackexchange
227
756
Selected references without hyperlink. <p>When using the <code>hyperref</code> package, is it possible to tell LaTeX not to create a link for some references?</p> <p>In my case the page number is displayed in the footer in</p> <pre><code>\fancyhf[FC]{\thepage\ of \pageref{pg:end}} </code></pre> <p>which is what I want. Unfortunately every single page in the document then has a link to the final page, which is a bit silly.</p> <p>Any ideas on how to fix that?</p>
0non-cybersec
Stackexchange
146
471
How to use std::optional in C++. <p>In C++17 <code>std::optional</code> is introduced, I was happy about this decision, until I looked at the <a href="http://en.cppreference.com/w/cpp/utility/optional" rel="noreferrer">ref</a>. I know <code>Optional</code>/<code>Maybe</code> from Scala, Haskell and Java 8, where optional is a monad and follows monadic laws. This is not the case in the C++17 implementation. How am I supposed to use <code>std::optional</code>, whithout functions like <code>map</code> and <code>flatMap</code>/<code>bind</code>, whats the advantage using a <code>std::optional</code> vs for example returning <code>-1</code>, or a <code>nullptr</code> from a function if it fails to compute a result? And more important for me, why wasn't <code>std::optional</code> designed to be a monad, is there a reason?</p>
0non-cybersec
Stackexchange
248
832
Most efficient way to clamp values in an OpenCv Mat. <p>I have an OpenCv <code>Mat</code> that I'm going to use for per-pixel remapping, called <code>remap</code>, that has <code>CV_32FC2</code> elements.</p> <p>Some of these elements might be outside of the allowed range for the remap. So I need to clamp them between <code>Point2f(0, 0)</code> and <code>Point2f(w, h)</code>. What is the shortest, or most efficient, way of accomplishing this with OpenCv 2.x?</p> <p>Here's one solution:</p> <pre><code>void clamp(Mat&amp; mat, Point2f lowerBound, Point2f upperBound) { vector&lt;Mat&gt; matc; split(mat, matc); min(max(matc[0], lowerBound.x), upperBound.x, matc[0]); min(max(matc[1], lowerBound.y), upperBound.y, matc[1]); merge(matc, mat); } </code></pre> <p>But I'm not sure if it's the shortest, or if split/merge is efficient.</p>
0non-cybersec
Stackexchange
310
866
Printing p-values with &lt;0.001. <p>I wonder how to put <code>&lt;0.001</code> symbol if p-value is small than <code>0.001</code> to be used in Sweave.</p> <pre><code>ctl &lt;- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt &lt;- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group &lt;- gl(2, 10, 20, labels = c("Ctl","Trt")) weight &lt;- c(ctl, trt) lm.D9 &lt;- lm(weight ~ group) summary(lm.D9)$coef Estimate Std. Error t value Pr(&gt;|t|) (Intercept) 4.8465 0.1557174 31.12368 4.185248e-17 group1 -0.1855 0.1557174 -1.19126 2.490232e-01 </code></pre> <p><strong>Desired Output</strong></p> <pre><code> Estimate Std. Error t value Pr(&gt;|t|) (Intercept) 4.8465 0.1557174 31.12368 &lt;0.001 group1 -0.1855 0.1557174 -1.19126 0.249 </code></pre>
0non-cybersec
Stackexchange
403
826
Is Fortigate-60D a fanless model?. <p>I would like to know if Fortigate-60D is a fanless model or not. However, neither <a href="http://www.fortinet.com/sites/default/files/productdatasheets/FortiGate-60D.pdf" rel="nofollow">Fortigate-60D datasheet</a> nor <a href="http://www.fortinet.com/sites/default/files/basicfiles/ProductMatrix.pdf" rel="nofollow">Fortinet Product Matrix</a> provide any information about this topic. </p> <p>Could you please confirm, either by your own experience or referencing any other document?</p>
0non-cybersec
Stackexchange
162
529
microtype tracking disables small caps in luaLaTeX. <p>Normall <code>microtype</code> tracking loosens the tracking of small caps. However, with <code>fontspec</code>'s <code>\setmainfont{</code>ebgaramond<code>}</code>, small caps are completely disabled and I get a loose normal text, </p> <p><img src="https://i.stack.imgur.com/UpX0C.png" alt="enter image description here"> </p> <p>as opposed to </p> <p><img src="https://i.stack.imgur.com/2AvYp.png" alt="enter image description here"> </p> <p>with the corresponding font package and normal pdfLaTeX. I want to use LuaLaTeX for some fancy ligatures, and XeLaTeX messes everything up.</p> <p>Using the <code>ebgaramond</code> package in LuaLaTeX doesn't help.</p>
0non-cybersec
Stackexchange
235
723
Evaluating $\int_a^{2a}\sqrt{2ax-x^2}\:dx$ where $a$ is a constant.. <p>definite integrate $(2ax-x^2)^{\frac12}$, upper limit $2a$, lower limit $a$. </p> <p>I used substitution, $x=a(1-\sin k)$</p> <p>This is my working <a href="https://i.stack.imgur.com/8kCi6.jpg" rel="nofollow noreferrer">enter image description here</a></p> <p>But I think i did something wrong, the answer is not correct... Please help.</p>
0non-cybersec
Stackexchange
160
416
Is Python a weakly typed language as variables can switch types?. <p>The way I understand it, the following is allowed in PHP because it's a weakly-typed language.</p> <pre><code>$var = 'Hello'; $var = 5; </code></pre> <p>I just installed a Windows version of Python 2.6 and I was expecting it NOT to let me change type just like that, but the Python equivalent of the above code works just like in PHP yikes!</p> <pre><code>&gt;&gt;&gt; var = "Hello" &gt;&gt;&gt; type(var) &lt;type 'str'&gt; &gt;&gt;&gt; var = 5 &gt;&gt;&gt; type(var) &lt;type 'int'&gt; </code></pre> <p>Is my understanding of weak/strong typing flawed?</p>
0non-cybersec
Stackexchange
215
632
Make big and small numbers human-readable. <p>I would like to print my very small numbers in C# in a human friendly way, such as:</p> <p><code>30µ</code> for <code>3E-5</code> or <code>456.789n</code> for <code>0.000000456789</code>.</p> <p>I know of the <a href="http://www.unix.com/man-page/FreeBSD/3/humanize_number/" rel="nofollow noreferrer">Humanize_number</a>() function from BSD in C, but only compatible with bit ints, not floats and doubles. Is there the equivalent in C# that supports those?</p> <p>Also, it should keep a certain amount of precision when displaying numbers, like:</p> <p><code>0.003596</code> should be displayed as <code>3.596µ</code>, not <code>3.6µ</code> (or worse, <code>4µ</code>). </p> <p>The possible answer here: <a href="https://stackoverflow.com/questions/1555397/formatting-large-numbers-with-net">Formatting Large Numbers with .NET</a> but adapted for negative log10 is truncating the numbers to 1 digit after the comma. That's far from complete in my opinion.</p> <p>Examples of how I'd like to present things:</p> <pre><code>3000 3K 3300 3.3K 3333 3.333K 30000 30k 300000 300k 3000000 3M 3000003 3.000003M // or 3M if I specify "4 digits precision" 0.253 253m 0.0253 25.3m 0.00253 2.53m -0.253003 -253.003m </code></pre> <p>I couldn't formulate my question to find relevant answers in SO, so if the question has been already answered, fire away!</p>
0non-cybersec
Stackexchange
488
1,458
Cannot see certain files on USB mounted device (MTP Android Xperia Play). <p>I'm using an emulator for PS2 and I was going to transfer my <code>.iso</code> files from my Xperia Play to Ubuntu 12.04. </p> <p>So I look for my <code>.iso</code>'s in the folder through file manager and it looks as it's empty, but there is a notification on the top asking to the open picture viewer, because there are pictures in this folder.</p> <p>I cannot see or interact with anything and there are no files are hidden.</p> <p>PS: To the forum mods: I am dyslexic and I find your requirement for exacting grammar and spelling unfair. It took a whole half hour just to get past your blocks.</p>
0non-cybersec
Stackexchange
186
682
How do I use a theme color from Angular Material prebuilt themes. <p>I would like to use a specific color from the material theme in my css. </p> <p>For example</p> <pre><code>.my_tab_group { border: 1px solid $some_color_from_theme; } </code></pre> <p>Does Angular Material expose different color shades via some variable, so that I can use in my own .scss file (e.g., like using $some_color_from_theme above)?</p>
0non-cybersec
Stackexchange
134
421
IAMA girl who has had ADD/ADHD her whole life. AMA. Hey reddit, I've noticed a lot of posts regarding ADD/ADHD (parents asking for advice, people wanting to know about the drugs involved, general question, etc...) and I wanted to offer the chance for people to ask questions about ADD/ADHD. I've pretty much had ADD my whole life (had ADHD when I was a kid), and I've been on medication since I was about 4 years old. Feel free to ask me anything! And if you have parenting questions that I can't answer (I don't remember everything my mum did when I was a kid), I'll even give my mum a ring to get the answer for ya! Ask away :)
0non-cybersec
Reddit
162
634
Nginx to allow only POST requests for certain URL&#39;s. <p>I have an application which will be served using GET &amp; POST method's. For better security, I have configured Nginx to serve the pages using only POST requests. Below is the config I have used in Nginx.</p> <p><strong>Config in Nginx:</strong> if ($request_method !~ ^(POST)$ ){ return 404; }</p> <p>This is working perfectly. Now, I wanted to change above configuration in Nginx to serve certain pages with both GET &amp; POST requests. But, I am unable to do it.</p> <p>I have used lot of combinations, but no luck.</p> <p>Can some one please help me in configuring nginx for the same.</p> <p>Below is my Nginx configuration file.</p> <p>Note: I am using Nginx (at front end) as a webserver and apache (at back end) for serving application. I have configured nginx to redirect the web pages requested to apache successfully.</p> <pre><code>#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 8081; server_name localhost; #charset koi8-r; access_log /logs/host.access.log; location /WebGoat { #root html; #index index.html index.htm; proxy_pass http://localhost:8080/WebGoat/; } location /application { ##sample project #root html; #index index.html index.htm; if ($request_method !~ ^(POST)$){ return 404; } proxy_pass http://localhost:8080/application/; } location ~ ^register\.html {##register.html page should be served with GET &amp; POST requests if ($request_method !~ ^(GET|POST)$){ return 500; } } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} } </code></pre> <p>Thanks in Advance, Sandeep</p>
0non-cybersec
Stackexchange
1,302
4,178
Best blog/newspaper/newsletter about nation state malware?. Hi all, what would you recommend to stay updated on the dynamics of nation state malware that are used every day by governments to target other governments? For example this article explains how attacks from North Korea and china have been detected this week: [https://bushidotoken.blogspot.com/2020/05/this-week-in-malware-4-may-2020.html](https://bushidotoken.blogspot.com/2020/05/this-week-in-malware-4-may-2020.html)
1cybersec
Reddit
135
482
Raptor! Gosh I love this game!. So I had a $20 credit at a local hobby shop and was looking to pick up something good at a reasonable price (looking to minimize that mark-up cost). Ended up deciding between Forbidden Desert and Raptor and ended up going with the latter because I already have Forbidden Island and I'm only luke-warm on co-op games. I realize Desert seems to be vastly superior to Island, but I digress. Just played two games of this today, one as the raptor and the other as the scientists. I love it! I want to keep playing at least like another 4 times today (although alas, I've lost a willing opponent). I love the a-symmetry, trying to read what you think the opponent is going to do, preparing yourself for multiple win conditions. Anywho, just needed to shout out some love for what seems to be a not very well-known game.
0non-cybersec
Reddit
206
849
[Troubleshooting]Electrical Fire?!. [Troubleshooting]Okay so yesterday I did my first build. This morning when I turned it on I got a CPU Tempeture error and I realised that my case fans were not on. I found the wire, plugged them in and when I turned it on again there was a smell of an electrical fire. I immediately turned it off and plugged everything out and opened the case. As I opened the case a small bit of smoke rised from the area of the CPU and one of the other fans. My case is a CM Silencio 550, My MOBO is an ASUS Maximus VI, Intel i5 4670k, CM CX750 PSU, and a ASUS GeForce GTX770 GPU. Anybody know what it could be? It has been off for a bout a hour now. I can give any other info if needed. Thanks. Also is it safe to turn back on?
0non-cybersec
Reddit
219
758
Fear of friends making a plan without me?. Every time I ask my friends to hang out some time in the weekend and I get a pretty vague answer (like "I'm not sure" or just no reply at all) I suddenly have the fear that this group of friends has been making plans together and ignoring me. I'm not sure if it is actually happening or not, but I am mostly sure that it is not happening and that I am just being scared that people make plans without me. What can I do to overcome the fear that my friends are doing things without me (when most of the time it doesn't happen) just because they say "I'm not sure" or don't reply after I ask them to hang out?
0non-cybersec
Reddit
152
650
Recomendation for Math books related to computer science. <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://softwareengineering.stackexchange.com/questions/85506/is-there-a-canonical-book-on-mathematics-for-programmers">Is there a canonical book on mathematics for programmers?</a> </p> </blockquote> <p>I need your recommendation for math books related to computer science in these areas:</p> <ul> <li>Boolean Algebra (Boolean logic, gates, state machines, etc.) </li> <li>Discrete Mathematics </li> <li>Probability &amp; Basic Statistics</li> </ul> <p>Please take note that i am self-learner, so please don't put books that is very hard to read or finish, i prefer book that is 300-500 pages more like an introductory book, also any recommendation whether or not the above list priority is correct, is highly appreciated.</p> <p>-note: i am a self-taught programmer, so the materials in the first item in the list are very familiar to me, but i never took any formal course in it.</p> <p>Thanks</p>
0non-cybersec
Stackexchange
297
1,037
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Color string in terminal in zsh. <p>I'm trying to convert this string that I had in .bash_profile</p> <p>PS1="[\e[37;1m][\u:\w]$ [\e[0m]"</p> <p>to an equivalent string in .zprofile in zsh. I've read the guide in </p> <p><a href="https://wiki.archlinux.org/index.php/Zsh#Colors" rel="nofollow noreferrer">https://wiki.archlinux.org/index.php/Zsh#Colors</a></p> <p>but I actually didn't manage to understand the new syntax to color my terminal and, in my case, show the full path where I am actually working. I understand it's a trivial questions but also looking at related post I didn't manage to fix my issue. Any hint would be more than welcome :)</p> <p>Thanks </p> <p>Daniele</p>
0non-cybersec
Stackexchange
236
691
Repeating Microsoft Word VBA until no search results found. <p>I've created a MS Word macro that searches for certain text (indicated by markup codes), cuts the text and inserts it into a new footnote, and then deletes the markup codes from the footnote. Now I want the macro to repeat until it doesn't find any more markup codes in the text.<br> Here's the macro below</p> <pre><code>Sub SearchFN() 'find a footnote Selection.Find.ClearFormatting With Selection.Find .Text = "&amp;&amp;FB:*&amp;&amp;FE" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchKashida = False .MatchDiacritics = False .MatchAlefHamza = False .MatchControl = False .MatchByte = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchFuzzy = False .MatchWildcards = True End With Selection.Find.Execute 'cut the footnote from the text Selection.Cut 'create a proper Word footnote With Selection With .FootnoteOptions .Location = wdBottomOfPage .NumberingRule = wdRestartContinuous .StartingNumber = 1 .NumberStyle = wdNoteNumberStyleArabic End With .Footnotes.Add Range:=Selection.Range, Reference:="" End With 'now paste the text into the footnote Selection.Paste 'go to the beginning of the newly created footnote 'and find/delete the code for the start of the note (&amp;&amp;FB:) Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "&amp;&amp;FB:" .Replacement.Text = "" .Forward = False .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchKashida = False .MatchDiacritics = False .MatchAlefHamza = False .MatchControl = False .MatchByte = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchFuzzy = False .MatchWildcards = True End With Selection.Find.Execute With Selection If .Find.Forward = True Then .Collapse Direction:=wdCollapseStart Else .Collapse Direction:=wdCollapseEnd End If .Find.Execute Replace:=wdReplaceOne If .Find.Forward = True Then .Collapse Direction:=wdCollapseEnd Else .Collapse Direction:=wdCollapseStart End If .Find.Execute End With 'do same for ending code (&amp;&amp;FE) With Selection.Find .Text = "&amp;&amp;FE" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchKashida = False .MatchDiacritics = False .MatchAlefHamza = False .MatchControl = False .MatchByte = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchFuzzy = False .MatchWildcards = True End With Selection.Find.Execute With Selection If .Find.Forward = True Then .Collapse Direction:=wdCollapseStart Else .Collapse Direction:=wdCollapseEnd End If .Find.Execute Replace:=wdReplaceOne If .Find.Forward = True Then .Collapse Direction:=wdCollapseEnd Else .Collapse Direction:=wdCollapseStart End If .Find.Execute End With Selection.HomeKey Unit:=wdStory 'now repeat--but how?? End Sub </code></pre>
0non-cybersec
Stackexchange
985
3,327
An Elementary Inequality Problem. <p>Given $n$ positive real numbers $x_1, x_2,...,x_{n+1}$, suppose: $$\frac{1}{1+x_1}+\frac{1}{1+x_2}+...+\frac{1}{1+x_{n+1}}=1$$ Prove:$$x_1x_2...x_{n+1}\ge{n^{n+1}}$$</p> <p>I have tried the substitution $$t_i=\frac{1}{1+x_i}$$ The problem thus becomes: </p> <p>Given $$t_1+t_2+...+t_{n+1}=1, t_i\gt0$$ Prove:$$(\frac{1}{t_1}-1)(\frac{1}{t_2}-1)...(\frac{1}{t_{n+1}}-1)\ge{n^{n+1}}$$ Which is equavalent to the following: $$(\frac{t_2+t_3+...+t_{n+1}}{t_1})(\frac{t_1+t_3+...+t_{n+1}}{t_2})...(\frac{t_1+t_2+...+t_{n}}{t_{n+1}})\ge{n^{n+1}}$$ From now on, I think basic equality (which says arithmetic mean is greater than geometric mean) can be applied but I cannot quite get there. Any hints? Thanks in advance.</p>
0non-cybersec
Stackexchange
344
756
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Remove page numbering for BEAMER&#39;s bibliography being out of frames. <p>I want a beamer presentation with my bibliography at the end. It should have a two-columns layout and a page number that, preferably, is inexistant (or that follows the page numbering from the last slide before the bibliography, even if a long bibliography is written over several slides).</p> <p>I can get the bibliography to be written over several slides in the desired layout only if the <code>\bibliography</code> argument is written outside of a <code>\frame</code> (or <code>\begin{frame}</code>) argument. </p> <p>The problem is that I obtain a bibliography with a page number that is repeated all along the bibliography and is all the same (i.e., is blocked) since the last <code>\frame</code>. I have unsuccessfully tried several commands (e.g., <code>\nopagenumbering</code> or <code>\pagenumbering{gobble}</code> or <code>\pagestyle{empty}</code> or <code>\renewcommand{\thepage}{}</code> ).</p> <p>Does someone has a solution or an idea ? Many thanks in advance !!</p> <p>SkyR</p> <p>Here is a reproducible example: First the file called "refs.bib":</p> <pre><code>@article{a, author = { Anat Freund PhD }, title = {Commitment and Job Satisfaction as Predictors of Turnover Intentions Among Welfare Workers}, journal = {Administration in Social Work}, volume = {29}, number = {2}, pages = {5-21}, year = {2005}, publisher = {Routledge} } @article{b, author = { Louis A. Penner and Alison R. Midili and Jill Kegelmeyer }, title = {Beyond Job Attitudes: A Personality and Social Psychology Perspective on the Causes of Organizational Citizenship Behavior}, journal = {Human Performance}, volume = {10}, number = {2}, pages = {111-131}, year = {1997}, publisher = {Routledge} } @article{c, title = "The influence of job satisfaction on child welfare worker's desire to stay: An examination of the interaction effect of self-efficacy and supportive supervision", journal = "Children and Youth Services Review", volume = "32", number = "4", pages = "482 - 486", year = "2010", issn = "0190-7409", author = "Szu-Yu Chen and Maria Scannapieco", keywords = "Child welfare, Worker retention, Job satisfaction, Supervisor's support, Work related self-efficacy" } @article{d, title = "Job conditions, unmet expectations, and burnout in public child welfare workers: How different from other social workers?", journal = "Children and Youth Services Review", volume = "33", number = "2", pages = "358 - 367", year = "2011", issn = "0190-7409", author = "Hansung Kim", keywords = "Child welfare, Job stress, Depersonalization, Social workers" } @article{e, author = {Petersen, Michael Bang and Sznycer, Daniel and Cosmides, Leda and Tooby, John}, title = {Who Deserves Help? Evolutionary Psychology, Social Emotions, and Public Opinion about Welfare}, journal = {Political Psychology}} </code></pre> <p>Second, the main file:</p> <pre><code>\documentclass[12pt]{beamer} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{color} \usepackage{multicol} \usepackage{natbib} \usepackage{pstricks} \usepackage[absolute,overlay]{textpos} \usepackage{tikz} \usepackage{array} \usepackage{amsmath} \usepackage{xcolor} \usepackage{graphics} \setbeamertemplate{items}[ball] \usepackage{appendixnumberbeamer} \mode&lt;presentation&gt;{} \usetheme{Warsaw} \addtocontents{toc}{\protect\thispagestyle{empty}} \pagenumbering{gobble} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vspace*{0.6cm} \title[small title]{{\large{Big title}}} \author[J. Deuf]{John Deuf} \vspace{1cm} \institute{ \Large{National center of research} } \date{1st of january 2043} \setbeamertemplate{navigation symbols}{} \addtobeamertemplate{footline} {\hfill\insertframenumber/\inserttotalframenumber\hspace{2em}\null} \begin{document} { \setbeamertemplate{headline}{} \begin{frame}[plain] \vspace{-1cm} \maketitle \end{frame} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \section{Part1} \frametitle{Title1} \nocite{ a,b,c,d,e} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \section{Part2} \frametitle{Title2} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \section{Part3} \frametitle{Title3} \end{frame} { \begin{multicols}{2} \color{black} \frametitle{} \bibliographystyle{alpha} \small \bibliography{refs} \end{multicols} } \end{document} </code></pre>
0non-cybersec
Stackexchange
1,425
4,488
GCLOUD Kubernetes in f1-micro results in (Node pools of f1-micro machines are not supported due to insufficient memory). <p>I tried to start a new f1-micro node in my cluster using Googles UI and it silently fails. So I decided to run it using gcloud to see if that one provides more details</p> <p>And so I ran the following</p> <pre><code>gcloud container node-pools create my-f1-pool --image-type ubuntu --machine-type=f1-micro --cluster bcomm-sg-cluster --disk-size=10GB --enable-autoscaling --min-nodes=2 --max-nodes=6 --zone=asia-southeast1-a --enable-autorepair </code></pre> <p>This is the result I got instead</p> <pre><code>WARNING: Modifications on the boot disks of node VMs do not persist across node recreations. Nodes are recreated during manual-upgrade, auto-upgrade, auto-repair, and auto-scaling. To preserve modifications across node recreation, use a DaemonSet. WARNING: Newly created clusters and node-pools will have node auto-upgrade enabled by default. This can be disabled using the `--no-enable-autoupgrade` flag. WARNING: Starting in 1.12, new node pools will be created with their legacy Compute Engine instance metadata APIs disabled by default. To create a node pool with legacy instance metadata endpoints disabled, run `node-pools create` with the flag `--metadata disable-legacy-endpoints=true`. This will enable the autorepair feature for nodes. Please see https://cloud.google.com/kubernetes-engine/docs/node-auto-repair for more information on node autorepairs. ERROR: (gcloud.container.node-pools.create) ResponseError: code=400, message=Node pools of f1-micro machines are not supported due to insufficient memory. </code></pre> <p>What does it mean by "Node pools of f1-micro machines are not supported due to insufficient memory". if its not allowed, then why does the option exist? also previously when I started toying with GCP, the first code pool I created was 3 f1-micro before I added an N1. but now I cannot add the f1-micro and get this error instead</p>
0non-cybersec
Stackexchange
541
2,008
Prove $(a, b) \mid ((a + b), (a - b))$. <p>I tried this:</p> <p>Suppose $(a, b) = d$. Then $ax + by = d$. </p> <p>Let $((a + b), (a – b)) = e$. </p> <p>Then $$\begin{align}e&amp; = (a + b)u + (a – b)v\\ &amp;= au + bu + av – bv\\ &amp;= a(u + v) + b(u – v)\end{align}$$</p> <p>Let $u + v = x$ and $u – v = y$, then $d = e$. So, $d \mid e$. </p> <p>What are the possible errors?</p>
0non-cybersec
Stackexchange
200
387
roll a dice repeatedly until the sum goes above 63. <p>I saw this question online but I don't know if my solution is right or not. Here is the original question:</p> <p>Roll a die repeatedly. Say that you stop when the sum goes above 63. What is the probability that the second to last value was X. Make a market on this probability. Ie what is your 90 percent confidence interval.</p> <p>This is my solution:</p> <p>X=63, 6 possible last roll as 1,2,3,4,5,6;</p> <p>X=62, 5 possible last roll as 2,3,4,5,6;</p> <p>X=61, 4 possible last roll as 3,4,5,6;</p> <p>X=60, 3 possible last roll as 4,5,6;</p> <p>X=59, 2 possible last roll as 5,6;</p> <p>X=58, 1 possible last roll as 6.</p> <p>BUT I don't know if it's right to think backward instead of considering the possible second to last value first? i.e. how many possibility to get a 63 regardless of last roll.</p> <p>Thank you very much!</p>
0non-cybersec
Stackexchange
307
906
Find distance from line k given parametric equation of: $x=2+t, y=-3+2t, z=2-t, t\in\mathbb{R}$ from plane $\pi:2x+y+4z=0$.. <p>My solution:</p> <p><span class="math-container">$$2(2+t)+(-3+2t)+4(2-t)$$</span> <span class="math-container">$$4+2t-3+2t+8-4t$$</span> <span class="math-container">$$9=0$$</span> Contradiction, so no solutions, line and plane are parallel.</p> <p>Its first time where I have such an example where equation is contradiction, I followed some example from internet and those are my next steps:</p> <p><span class="math-container">$$d(l,\pi)=\frac{|9|}{\sqrt{1+2^2+1}}=\frac{9\sqrt{6}}{6}$$</span></p> <p>I am not sure about this method, is this distance value right? Maybe there's better way to calculate it?</p>
0non-cybersec
Stackexchange
276
744
.NET GUID uppercase string format. <p>I need to format my GUIDs in the dashed format, all uppercase. I know using <code>myGuid.ToString("D")</code> or <code>String.Format("{0:D}", myGuid)</code> gives the dashed format, but using an uppercase <code>D</code> as opposed to a lower-case <code>d</code> doesn't give me an uppercased GUID like I thought it would. Is there a way to do this without doing anything crazy, or do I just need to call <code>myGuid.ToString().ToUpper()</code>?</p>
0non-cybersec
Stackexchange
149
488
What&#39;s the best way to test delayed_job chains with rSpec?. <p>Currently when I have a delayed method in my code like the following:</p> <pre><code>CommentMailer.delay.deliver_comments(@comment, true) </code></pre> <p>I write something like this in my spec:</p> <pre><code>dj = mock("DelayProxy") CommentMailer.should_receive(:delay).and_return(dj) dj.should_receive(:deliver_comments).with(comment, true) </code></pre> <p>Is there a better way to handle this and/or chained methods like that in rSpec in general?</p>
0non-cybersec
Stackexchange
169
526
Sister won't eat anything but my food.. My mom bought some packs of my favourite instant noodles for my sister and I and she already ate all of hers while I saved two of mine. These are my favourite type and my mom doesn't buy instant noodles very often. **I'm not mad at her eating instant noodles, I'm just pissed because she does this about everything and complains and makes up lies about me to my mom if I don't do what she wants.** &#x200B; One day, when I was home with my little sister, my mom had left and told me to make some dinner for my sis and myself. So, me being lazy, decided to eat one of the instant noodles I had saved for myself and offered my sister another kind of instant noodles. She didn't want them and said she wanted my extra pack I told her that she couldn't have it as she had already eaten hers and offered to cook up the other kind instead. She said no and went back to doing whatever she was doing. &#x200B; Couple minutes later, she starts whining and complaining about being hungry, so I naturally offered her the other type, which she rejected. I had asked her what she wanted to eat and she said anything but that kind of noodles. SO I offered to make some pasta or cook up something else for her. She said that she only wanted my mom's cooking and not mine. I reminder her that our mom is out and won't be back for a couple hours. She continues whining about being hungry so I asked if she wanted some crackers or something and she said that she only wanted my extra pack of instant noodles &#x200B; At this point, I was getting really annoyed and just ignored her continuous whining, but she started having a full-on **TANTRUM** and saying how she'll tell our mom that I won't give her any food and let her be hungry. She's 10. I keep giving her food suggestions and she keeps screaming and says she only wants my instant noodles. I had to calm her down because we've had noise complaints before because of my sister's loud yells and screams. So I give in and give her my extra and she stops having a tantrum and happily eats MY food. &#x200B; When my mom came back, I told her about what happened and my sister had to nerve to deny that it ever happened.
0non-cybersec
Reddit
516
2,206
Galerkin approximation for an elliptic BVP. <p>What is the process for deducing Galerkin approximation for an elliptic boundary value problem? For example, for a problem like--</p> <p><span class="math-container">$$ -\Delta u + cu = f\ \ \mathrm{in}\ Ω $$</span></p> <p><span class="math-container">$$ u = g\ \ \mathrm{on}\ \ \Gamma_1 $$</span></p> <p><span class="math-container">$$ \frac{∂u}{∂n} + pu = h\ \ \mathrm{on}\ \ \Gamma_2 $$</span></p> <p>here, <span class="math-container">$∂Ω = \Gamma_1 \cup \Gamma_2$</span> and <span class="math-container">$\Gamma_1\cap \Gamma_2 = \phi$</span> and <span class="math-container">$c \geq 0.$</span></p> <p><span class="math-container">$f, g, h, p$</span> are sufficiently smooth functions.</p> <p>I’ve calculated the weak solution of this problem to be </p> <p><span class="math-container">$$ \int_\Omega (\nabla u\cdot \nabla \phi + cu\phi)dw + \int_{\Gamma_2} (pu-h)\phi ds = \int_{\Omega} (f\phi) dw $$</span></p> <p>here <span class="math-container">$\Omega, \Gamma_2$</span> with the integral sign <span class="math-container">$\int$</span> are the domain identifier.</p> <p>So how can I propose a galerkin approximation from this weak form of the PDE</p>
0non-cybersec
Stackexchange
444
1,220
Styling default JavaFX Dialogs. <p>I'm looking for a way to style the default JavaFX Dialog (<code>javafx.scene.control.Dialog</code>). </p> <p>I tried to get the DialogPane and add a stylesheet, but it covers only a small piece of the dialog. I would prefer to style only with an external css file and without to add styleClasses over the code. This would look messy (header, content, own content on the content and more..)</p> <p>I googled already alot and only found examples for ControlsFX, but since jdk8_40 JavaFX has it's own Dialogs i use them now. </p> <p>Any suggestions?</p> <p><strong>Edit:</strong></p> <p>Since José Pereda posted the solution i created my own dialog.css. I'll post it here because it covers the whole dialog and maybe someone want's to copy&amp;paste it. Note .dialog-pane is already a given styleClass name so you don't need to apply your own. Of course, Josés is more fine detailed.</p> <pre><code>.dialog-pane { -fx-background-color: black; } .dialog-pane .label { -fx-text-fill: white; } .dialog-pane:header .header-panel { -fx-background-color: black; } .dialog-pane:header .header-panel .label { -fx-font-style: italic; -fx-font-size: 2em; } </code></pre>
0non-cybersec
Stackexchange
383
1,222
Interfacing strace with Process Name instead of PID. <p>How do I implement a wrapper script <code>pstrace</code> in bash that changees the interface of</p> <pre><code>[sudo] strace -c -p [PID] </code></pre> <p>to </p> <pre><code>[sudo] pstrace -c -p [PROCESS-NAME] </code></pre> <p>similar to how</p> <pre><code>killall [PROCESS-NAME] </code></pre> <p>is used. With completion and everything.</p>
0non-cybersec
Stackexchange
153
403
network device name is changed by itself. <p>I use a Ubuntu-arm, <code>uname -a</code></p> <pre><code>Linux arm 3.7.8-x8 #1 SMP Sat Feb 16 04:15:13 UTC 2013 armv7l armv7l armv7l GNU/Linux </code></pre> <p>I have two USB WiFi interfaces that are named wlan0 and wlan1 on <code>/etc/udev/rules.d/70-persistent-net.rules</code> </p> <p>I run a script on each start-up that does:</p> <pre><code>ifdown wlan0 rm /var/run/wpa_supplicant/wlan0 ifup wlan0 wpa_supplicant -B -Dnl80211 -iwlan0 -c/etc/w.conf ifdown wlan1 rm /var/run/wpa_supplicant/wlan1 ifup wlan1 wpa_supplicant -B -Dnl80211 -iwlan1 -c/etc/w2.conf </code></pre> <p>sometimes one of the interface is named as <code>rename5</code> whereas the other interface is named according to the <code>70-persistent-net.rules</code>.</p> <p>Could anyone explain why it is named rename5 instead of wlan0 or wlan1 and how can I prevent that thing to happen?</p>
0non-cybersec
Stackexchange
359
913
Elementary question about quiver. <p>How do we add elements in a quiver?</p> <p>Please see here:</p> <p><a href="http://planetmath.org/encyclopedia/AdmissibleIdealsBoundQuiverAndItsAlgebra.html" rel="nofollow">http://planetmath.org/encyclopedia/AdmissibleIdealsBoundQuiverAndItsAlgebra.html</a></p> <p>I know how to multiply this (by concatenation) but how do we add them, i.e how do we interpet ab - c ? I don't understand why ab- c is not an element of $R^{2}$.</p>
0non-cybersec
Stackexchange
166
471
bad ownership or modes for chroot directory component. <p>I created the user MY_USER. Set his home dir to /var/www/RESTRICTED_DIR, which is the path he should be restricted to. Then I edited sshd_config and set:</p> <pre><code>Match user MY_USER ChrootDirectory /var/www/RESTRICTED_DIR </code></pre> <p>Then I restarted ssh. Made MY_USER owner (and group owner) of RESTRICTED_DIR, and chmodded it to 755. I get</p> <pre><code>Accepted password for MY_USER session opened for user MY_USER by (uid=0) fatal: bad ownership or modes for chroot directory component "/var/www/RESTRICTED_DIR" pam_unix(sshd:session): session closed for user MY_USER </code></pre> <p>If I removed the 2 lines from sshd_config the user can login successfully. Of course it can access all the server though. What's the problem? I even tried to chown RESTRICTED_DIR to root (as I read somewhere that someone solved this same problem doing it). No luck..</p>
0non-cybersec
Stackexchange
284
936
Joint distribution of residuals in a simple linear regression model with iid normal errors. <p>In a simple linear regression $Y=X\beta + \varepsilon$, residuals are given by $\hat\varepsilon = M\varepsilon$, where $M = I_n - P$ is the annihilator matrix, and $P = X(X^TX)^{−1}X^T$ is the projection matrix, and $X$ is the design matrix. Assuing that the errors $\varepsilon$ are iid normal with mean $0$ and standard deviation $\sigma$, what is the joint (conditional on $X$) distribution of the residuals $\hat\varepsilon$? It seems to me that it should be multivariate normal, but what is the covariance matrix $\Sigma$?</p>
0non-cybersec
Stackexchange
166
628
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Solving $\int_0^\infty \left(1+\frac{y^{2}_{1}+y^{2}_{2}+\cdots+y^{2}_{n})}{\nu}\right)\mathrm dy_{1}\mathrm dy_{2}\cdots \mathrm dy_{n}$. <p>Interesting integral here:</p> <p>$$\int_0^\infty \frac{\Gamma(D/2+\nu/2)}{\Gamma(\nu/2)}\frac{|\Lambda|^{1/2}}{(\pi \nu)^{D/2}}\left(1+\frac{(x-\mu)^{T}\Lambda(x-\mu)}{\nu}\right)^{-D/2-\nu/2}\mathrm dx$$</p> <p>I tried to write $\Lambda$ as $\Lambda^{1/2}\Lambda^{1/2}$ and changing variables with $y =\Lambda^{1/2}(x-\mu)$ in order to get:</p> <p>$$\int_0^\infty \frac{\Gamma(D/2+\nu/2)}{\Gamma(\nu/2)}\frac{|\Lambda|^{1/2}}{(\pi \nu)^{D/2}}\left(1+\frac{y^{T}y}{\nu}\right)^{-D/2-\nu/2}|\Lambda|^{-1/2}\mathrm dy_{1}\mathrm dy_{2}\cdots \mathrm dy_{n}$$</p> <p>The integral in the form:</p> <p>$$\int_0^\infty \left(1+\frac{y^{2}_{1}+y^{2}_{2}+...+y^{2}_{n})}{\nu}\right)^{-D/2-\nu/2}\mathrm dy_{1}\mathrm dy_{2} \cdots \mathrm dy_{n}$$</p> <p>seems to generate a product of Gamma function but I can't get a closed form.</p> <p>Any help is appreciated. By the way, this question is somewhat related to <a href="https://math.stackexchange.com/questions/324351/simplifying-covariance-matrices-in-distributions">Simplifying covariance matrices in distributions</a>, so maybe one can help the other.</p>
0non-cybersec
Stackexchange
489
1,256
What is the intuition behind symmetric trees in catboost algorithm?. <p>I have been going through the catboost algorithm and it is hard for me to see the point of using symmetric trees. On this regard, i found in their github:</p> <blockquote> <p>An important part of the algorithm is that it uses symmetric trees and builds them level by level. Symmetric tree is a tree where nodes of each level use the same split. This allows to encode path to leaf with an idex. For example, there is a tree with depth 2. Split on the first level is f1&lt;2, split on the second level is f2&lt;4. Then the object with f1=5, f2=0 will have leaf with number 01b.</p> </blockquote> <p>They say it helps to be less prone to overfitting and to have a much quicker inference but, intuitively for me, it is like you need twice the depth to explore the same amount of splits. </p> <p>So, can anybody explain which is actually the advantage of using this types of trees??</p> <p>Many thanks.</p>
0non-cybersec
Stackexchange
267
986
How do I change the default program for Preview in the context menu when uploading images to websites in Windows 7?. <p>I'm not asking how to change the default program for a certain file extension, but how do I change the behavior of this particular context menu item? I've gone through various answers and search results that recommended context menu editors and various registry edits, but none of them address this particular item. I want to be able to preview certain gifs that I upload, but Windows Photo Viewer doesn't animate gifs. </p> <p><img src="https://i.imgur.com/N5m49vq.png" alt="Screenshot"></p>
0non-cybersec
Stackexchange
151
616
Copy null terminated char array to std::string respecting buffer length. <p>Maybe it's just the lack of coffee, but I'm trying to create a <code>std::string</code> from a null-terminated <code>char</code> array with a known maximum length and I don't know, how to do it.</p> <pre><code>auto s = std::string(buffer, sizeof(buffer)); </code></pre> <p>.. was my favorite candidate but since C++ strings are not null-terminated this command will copy <code>sizeof(buffer)</code> bytes regardless of any contained '\0'.</p> <pre><code>auto s = std::string(buffer); </code></pre> <p>.. copies from <code>buffer</code> until <code>\0</code> is found. This is almost what I want but I can't trust the receive buffer so I'd like to provide a maximum length.</p> <p>Of course, I can now integrate <code>strnlen()</code> like this:</p> <pre><code>auto s = std::string(buffer, strnlen(buffer, sizeof(buffer))); </code></pre> <p>But that seems dirty - it traverses the buffer twice and I have to deal with C-artifacts like <code>string.h</code> and <code>strnlen()</code> (and it's ugly).</p> <p>How would I do this in modern C++?</p>
0non-cybersec
Stackexchange
352
1,130
Is this a valid proof for ${x^{x^{x^{x^{x^{\dots}}}}}} = y$?. <p>So I got this challenge from my teacher.</p> <p><strong>Solve ${x^{x^{x^{x^{x^{\dots}}}}}} = y$ (eq. 1) for $x$.</strong></p> <hr> <p>My attempt:</p> <p>As $x^{y^z}$ per definition equals $x^{y \cdot z}$, then $x^y = y$ from (eq. 1). Thus, <strong>$x = \sqrt{y}$.</strong></p> <p>Is this a valid proof?</p>
0non-cybersec
Stackexchange
164
377
Help showing Frenet-Serret Formulas with respect to $t$. <p>The Frenet-Serret Formulas involve a unit tangent vector, <span class="math-container">$$\hat T = \frac{\vec r’(t)}{||\vec r’(t)||}$$</span> and a unit normal vector (differentiating with respect to <span class="math-container">$t$</span>) <span class="math-container">$$\hat N = \frac{\vec T’(t)}{||\vec T’(t)||}$$</span> and a unit binormal vector, the cross product of the two above: <span class="math-container">$$\hat B = \hat T \times \hat N$$</span> </p> <p>Normally, they are written with respect to the arclength parameter <span class="math-container">$s$</span>, but I’ve seen formulas with respect to <span class="math-container">$t$</span> that look way more complicated, such as these from wikipedia:<a href="https://i.stack.imgur.com/wvnFv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wvnFv.jpg" alt="enter image description here"></a></p> <p><strong>How do you derive these from the definitions above?</strong></p> <p>So far, I've gotten that <span class="math-container">$$\hat N = \frac{||\vec r’(t)|| r''(t) - r'(t) \frac{r'(t) \cdot r''(t)}{||\vec r’(t)||}}{\Big|\Big|||\vec r’(t)|| r''(t) - r'(t) \frac{r'(t) \cdot r''(t)}{||\vec r’(t)||}\Big|\Big|}$$</span> just from quotient rule, but I'm not even sure I differentiated <span class="math-container">$||\vec r’(t)||=\sqrt{\vec r'(t) \cdot \vec r'(t)}$</span> right. I'm not sure how to proceed -- any help with the <span class="math-container">$\hat N$</span> case or <span class="math-container">$\hat B$</span>, or with the curvature <span class="math-container">$\kappa$</span> or torsion <span class="math-container">$\tau$</span> is much appreciated. </p>
0non-cybersec
Stackexchange
588
1,719
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Monitoring Dell/HP Servers Running ESXi (Free). <p>What are you all doing to monitor ESXi servers that run the free edition? With the lack of SNMP support, it seems fairly limited to me. What'd I'd like to be able to do is get some type of alert when a drive or other hardware fails. I've seen a few articles on getting OpenManage installed on an ESXi box (to rebuild an array), but it seems to be quite a pain as well. Even if I get OpenManage working, I won't have alerts without SNMP.</p> <p>Any comments, input, or guidance would be greatly appreciated.</p>
0non-cybersec
Stackexchange
147
563
A notation to represent that all elements of a vector must be less than zero?. <p>I am defining an optimization algorithm. One of the constraints of the length <span class="math-container">$p$</span> vector <span class="math-container">$\boldsymbol{\theta}^-$</span> is that all elements in that vector must be less than or equal to zero. </p> <p>I could say that <span class="math-container">$$ \theta^+_j \leq 0\quad \forall j\in\{1 ... p\}.$$</span></p> <p>Is there any way to express this in the form</p> <p><span class="math-container">$$\boldsymbol{\theta}^+ \leq 0?$$</span> </p> <p>That doesn't make a lot of sense, but is there some alternate symbol or notation I could replace for <span class="math-container">$\leq$</span> to express that I want the vector to be element-wise less than or equal to zero?</p>
0non-cybersec
Stackexchange
239
824
No sound on Firefox and Opera, but works on Chrome. <pre><code>Ubuntu 18.04.2 Firefox Quantum 65.0.1 </code></pre> <p>There is no sound from Firefox or Opera browsers when playing youtube videos etc. Chrome works fine. Desktop music/video player apps also work without any issues. Neither inbuilt speakers nor headphones work for the problematic browsers.</p> <p>I've gone through the other posts that reported the same problem and tried all the solutions; didn't solve the issue.</p> <ul> <li><strong>Pulse-audio</strong> is installed by default. Firefox and Opera show up in the list of applications under sound settings with their respective volume control though.</li> </ul> <p><a href="https://i.stack.imgur.com/SWPLq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SWPLq.png" alt="Sound settings showing browser playback streams"></a></p> <ul> <li>Installing <code>ubuntu-restricted-extras</code> didn't help. I don't think it's a codec issue. Playing ogg/flac from wikipedia also makes no sound on firefox.</li> <li>Clearing cache as mentioned in firefox faq didn't help either.</li> </ul>
0non-cybersec
Stackexchange
316
1,121
Stirling numbers of the second kind formulae. <p>We want to determine the number of ways that 10 distinct pieces of candy can be placed into 2 identical bags with each bag getting at least 1 piece.<br> As we know the answer is <span class="math-container">$S(10,2)$</span>, where <span class="math-container">$S$</span> stands for Stirling number of the second kind.<br> I thought that we can start by choosing two candies out 10 to put each one in a bag, so we will have that each bag is nonempty. Then, the remaining 8 candies will either be put in a single bag or put in the two bags (meaning each bag gets at least one candy out of 8) and that can be done in <span class="math-container">$S(8,2)$</span> ways. And finally, I get <span class="math-container">$S(10,2)= \binom {10}{2} \left( S(8,1) + S(8,2) \right) $</span>.<br />I know that the result I get is wrong, because from the tables of the Stirling numbers <span class="math-container">$S(10,2)$</span> is <span class="math-container">$511$</span>. But the reasoning seems to me correct!!! Where is the problem with my reasoning?</p>
0non-cybersec
Stackexchange
318
1,097
What does Preserve sharing means in lazy Streams?. <p>I'm following the Functional Programming in Scala book. Here is the code snippet from Stream definition and functions to construct <code>constant</code> using smart constructor and using <code>unfold</code>:</p> <pre><code>sealed trait Stream[+A] case object Empty extends Stream[Nothing] case class Cons[+A](h: () =&gt; A, tl: () =&gt; Stream[A]) extends Stream[A] object Stream { def cons[A](h: =&gt; A, tl: =&gt; Stream[A]): Stream[A] = { lazy val head = h lazy val tail = tl Cons(() =&gt; head, () =&gt; tail) } def empty[A]: Stream[A] = Empty def constant[A](a: A): Stream[A] = cons(a, constant(a)) def unfold[A, S](z: S)(f: S =&gt; Option[(A, S)]): Stream[A] = f(z).fold(empty[A])(x =&gt; cons(x._1, unfold(x._2)(f))) def constantViaUnfold[A](a: A): Stream[A] = unfold(a)(x =&gt; Some((x, x))) } </code></pre> <p>There is a footnote saying that:</p> <blockquote> <p>Using <code>unfold</code> to define <code>constant</code> means that we won't get sharing as in the recursive definition. The recursive definition consumes constant memory even if we keep a reference to it around while traversing it, while the unfold-based implementation does not. Preserving sharing isn’t something we usually rely on when programming with streams, since it’s extremely delicate and not tracked by the types. For instance, sharing is destroyed when calling even <code>xs.map(x =&gt; x).</code></p> </blockquote> <p>What do the authors mean when saying that we are not getting <em>sharing</em>? What exactly is shared and why it's not preserved in <code>unfold</code> version? Also the sentence about constant memory consumption is not clear as well.</p>
0non-cybersec
Stackexchange
538
1,736
How can I store each separate entire line in a text file into an array?. <p>I have a file called "threewords". It contains the information:</p> <pre><code>\#gray speedy bee gr-A | sp-E-d-E | b-E \#gray greedy pea gr-A | gr-E-d-E | p-E </code></pre> <p>When I run the command:</p> <pre><code>cat threewords | grep ^# | cut -c2- </code></pre> <p>The command pulls the two lines beginning with #. It then removes the # and returns this as output:</p> <pre><code>gray speedy bee gray greedy pea </code></pre> <p>When I run my command:</p> <pre><code>array=($(cat threewords | grep ^# | cut -c2-)) </code></pre> <p>It creates the array but it separates all the words into separate array positions like this:</p> <pre><code>array[0] = gray, array[1] = speedy, array[2] = bee, array[3] = gray, array[4] = greedy, array[5] = pea </code></pre> <p>I can figure out the code to make it put the output of each line into an array like so:</p> <pre><code>array[0] = gray speedy bee, array[1] = gray greedy pea </code></pre>
0non-cybersec
Stackexchange
374
1,026
My 3 year old daughter is being called a baby by another kid at daycare because of how she speaks. She does have difficulty pronouncing words but it hurts to see her embarrassed by it.. It does bother her to be called a baby and I've mentioned this to one of the teachers at her daycare (though she claimed she'd never heard any of the other kids say this though my husband heard it firsthand himself). Anyways, she said she would intervene if she ever heard any of the kids calling her that. But I guess my question is, will she just grow out of it or should we get her to see a Speech Therapist?
0non-cybersec
Reddit
138
601
Second screen not disconnecting (HDMI). <p>I have an HP Pavilion TouchSmart laptop running Ubuntu 14.04.1 </p> <p>I usually connect a second display via HDMI which worked fine until today. I can connect the display fine and everything auto-configures properly. However, disconnecting the display has no effect most of the times - the desktop stays in extended mode and I can move the mouse / windows off the screen to where the second screen used to be. There is no short black-out that usually indicates a screen has been (dis)connected. </p> <p>I found out that just opening display settings under Ubuntu system settings fixes the issue and the system detects that I have in fact disconnected the second screen. The same happens when running xrandr from terminal - I'm using this as a workaround at the moment. </p> <p>There is one more strange thing - normally Super+P toggles between extended, clone, first screen only and second screen only modes. This works fine for me when the second screen is actually connected. After disconnecting the screen (and when the system doesn't register the disconnection), using this shortcut breaks all video output, I see fragments of the desktop on laptop screen, nothing seems to fix this problem except hard reset. </p> <p>I also have Windows 8.1 installed (dual boot) and everything works fine there, so it's not a hardware problem. The laptop has switchable graphic cards (Intel Haswell integrated CPU + AMD Radeon 8670M). I am using the default drivers and have never installed the proprietary ones.</p> <h1>[Edit - xrandr output]</h1> <p>HDMI Connected and working</p> <pre><code>Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 32767 x 32767 eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 309mm x 173mm 1366x768 60.1*+ 40.0 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 HDMI1 connected 1920x1080+1366+0 (normal left inverted right x axis y axis) 477mm x 268mm 1920x1080 60.0*+ 1680x1050 59.9 1600x900 60.0 1280x1024 75.0 60.0 1280x960 60.0 1152x864 75.0 1280x720 60.0 1152x720 60.0 1024x768 75.1 60.0 832x624 74.6 800x600 75.0 60.3 640x480 75.0 60.0 720x400 70.1 VIRTUAL1 disconnected (normal left inverted right x axis y axis) </code></pre> <p>HDMI Properly disconnected</p> <pre><code>Screen 0: minimum 320 x 200, current 1366 x 768, maximum 32767 x 32767 eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 309mm x 173mm 1366x768 60.1*+ 40.0 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 HDMI1 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis) </code></pre> <p>HDMI Disconnected but still being detected as connected (running xrandr produces this and then fixes the problem). Notice the strange output at the end.</p> <pre><code>Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 32767 x 32767 eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 309mm x 173mm 1366x768 60.1*+ 40.0 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 HDMI1 disconnected 1920x1080+1366+0 (normal left inverted right x axis y axis) 0mm x 0mm VIRTUAL1 disconnected (normal left inverted right x axis y axis) 1920x1080 (0x68) 148.5MHz h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.5KHz v: height 1080 start 1084 end 1089 total 1125 clock 60.0Hz </code></pre>
0non-cybersec
Stackexchange
1,150
3,831
New Earring. John is at work one day when he notices that his co-worker, Zach, is wearing an earring. This man knows his co-worker to be a normally conservative fellow, and is curious about his sudden change in "fashion". "Hey Zach" he yells out "I didn't know you were into earrings." "Don't make such a big deal out of it, ..it's only an earring." Says Zach sheepishly. "No really," probes John, "How long have you been wearing one?" ... "Ever since my wife found it in our bed."
0non-cybersec
Reddit
141
490
How to extend filecontents to append and count lines?. <p>Here are two questions about <code>filecontents</code> environment:</p> <ol> <li><p>is it possible to add content to a preexisting file or, at a minimum, to keep open the external file to append the content of several <code>filecontents</code> environments to the same external file?</p></li> <li><p>is it possible to know how many lines have been written to the external file by a <code>filecontents</code> environment?</p></li> </ol>
0non-cybersec
Stackexchange
136
495
Apache2.4 + Python 3.7 + mod_wsgi not executing script. <p>I have installed Apache 2.4 (vc15 apacheLounge) and Python 3.7. I installed the mod_wsgi using PIP and everything appears to be setup correct in the Apache server.</p> <p>error.log from apache:</p> <pre><code>[mpm_winnt:notice] [pid 9688:tid 780] AH00455: Apache/2.4.37 (Win64) mod_wsgi/4.6.5 Python/3.7 configured -- resuming normal operations [mpm_winnt:notice] [pid 9688:tid 780] AH00456: Apache Lounge VC15 Server built: Nov 21 2018 11:51:35 </code></pre> <p>I followed the steps on "<a href="https://modwsgi.readthedocs.io/en/develop/user-guides/quick-configuration-guide.html" rel="nofollow noreferrer">https://modwsgi.readthedocs.io/en/develop/user-guides/quick-configuration-guide.html</a>" and when I try to load the test app all I get is a text view of the code. </p> <p>My <code>httpd.conf</code> files details:</p> <pre><code>WSGIScriptAlias /wsgi "C:/apache24/htdocs/wsgi_app/wsgi_app.wsgi" &lt;Directory /apache24/htdocs/wsgi_app&gt; &lt;IfVersion &lt; 2.4&gt; Order allow,deny Allow from all &lt;/IfVersion&gt; &lt;IfVersion &gt;= 2.4&gt; Require all granted &lt;/IfVersion&gt; &lt;/Directory&gt; </code></pre>
0non-cybersec
Stackexchange
453
1,204
Vyatta (Brocade) receives BGP routes, but doesn&#39;t show in routing table. <p>What would be the reason for Brocade vRouter to receive BGP routes, identify them as valid and best, but not use in the routing table?</p> <p>*show ip bgp neighbors 169.254.5.1 received-routes <em>> 10.2.0.0/16 169.254.5.1 0 65500 7224 i</em></p> <p>but nothing for 10.2.0.0/16 in <em>show ip route</em></p> <p>The router can reach 169.254.5.1</p> <p>The same peer (Cisco CSR) advertises routes successfully to other neighbors, including some Vyatta flavors (Ubiquiti).</p> <p>I saw this post with similar question, but it doesn't answer it: <a href="https://serverfault.com/questions/570307/simple-vyatta-configuration-bgp-routes-not-injecting-into-routing-table">Simple Vyatta configuration / BGP routes not injecting into routing table</a></p>
0non-cybersec
Stackexchange
287
864
Spark: How to aggregate/reduce records based on time difference?. <p>I have time series data in CSV from vehicle with following information:</p> <ul> <li>trip-id</li> <li>timestamp</li> <li>speed</li> </ul> <p>The data looks like this:</p> <pre><code>trip-id | timestamp | speed 001 | 1538204192 | 44.55 001 | 1538204193 | 47.20 &lt;-- start of brake 001 | 1538204194 | 42.14 001 | 1538204195 | 39.20 001 | 1538204196 | 35.30 001 | 1538204197 | 32.22 &lt;-- end of brake 001 | 1538204198 | 34.80 001 | 1538204199 | 37.10 ... 001 | 1538204221 | 55.30 001 | 1538204222 | 57.20 &lt;-- start of brake 001 | 1538204223 | 54.60 001 | 1538204224 | 52.15 001 | 1538204225 | 49.27 001 | 1538204226 | 47.89 &lt;-- end of brake 001 | 1538204227 | 50.57 001 | 1538204228 | 53.72 ... </code></pre> <p><em>A braking event occurs when there's a decrease in <code>speed</code> in 2 consecutive records based on <code>timestamp</code>.</em></p> <p><strong>I want to extract the braking events from the data in terms of event <code>start timestamp</code>, <code>end timestamp</code>, <code>start speed</code> &amp; <code>end speed</code>.</strong> </p> <pre><code>+-------------+---------------+-------------+-----------+---------+ | breakID|start timestamp|end timestamp|start speed|end speed| +-------------+---------------+-------------+-----------+---------+ |0011538204193| 1538204193| 1538204196| 47.2| 35.3| |0011538204222| 1538204222| 1538204225| 57.2| 49.27| +-------------+---------------+-------------+-----------+---------+ </code></pre> <p>Here's my take:</p> <ol> <li>Defined a window spec with partition according to <code>trip-id</code>, ordered by <code>timestamp</code>.</li> <li>Applied window <code>lag</code> to move over consecutive rows and calculate speed difference.</li> <li>Filter out records which have positive speed difference, as i am interested in braking events only.</li> <li>Now that I only have records belonging to braking events, I want to group records belonging to same event. I guess i can do this based on the timestamp difference. If the difference between 2 records is 1 second, those 2 records belong to same braking event.</li> </ol> <p>I am stuck here as i do not have a <code>key</code> belonging to same group so i can apply key based aggregation. </p> <p>My question is:</p> <ol> <li><p>How can I <strong>map</strong> to add a <code>key</code> column based on the difference in timestamp? So if 2 records have a difference of 1 seconds, they should have a common key. That way, I can reduce a group based on the newly added key.</p></li> <li><p>Is there any <strong>better &amp; more optimized</strong> way to achieve this? My approach could be very inefficient as it relies on row by row comparisons. What are the other possible ways to detect these kind of "sub-events" (e.g braking events) in a data-stream belonging to a specific event (data from single vehicle trip)?</p></li> </ol> <p>Thanks in advance!</p> <hr> <p>Appendix:</p> <ul> <li>Example data file for a trip: <a href="https://www.dropbox.com/s/44a0ilogxp60wkk/ss_so_trip.zip?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/44a0ilogxp60w...</a></li> </ul>
0non-cybersec
Stackexchange
1,057
3,281
Problems Concerning Hermite and Legendre Polynomials (Folland&#39;s Fourier Analysis). <p>I am extremely confused as to how to proceed with problems 6.2.7, 6.3.4, 6.3.5, and 6.3.6. from Folland's Fourier Analysis text. I have posted a link to an online pdf of the book. The problems are listed as below.</p> <p>6.2.7 Let $ f(x)= 1 $ for $ 0 &lt; x &lt; 1 $ and $ f(x) = -1 $ for $ -1 &lt; x &lt; 0 $. Expand $ f $ as a series of Legendre polynomials.</p> <p>6.3.4 Expand the function $ f(x) = x^{2m} $ as a series of Hermite polynomials where $ m $ is a positive integers.</p> <p>6.3.5 Expand the function $ f(x) = e^{ax} $ as a series of Hermite polynimials.</p> <p>6.3.6 Let $ f(x) = 1 $ for $ x&gt;0 $, $ f(x) = 0 $ for $ x &lt; 0 $. Expand $ f $ in a series of Hermite polynomials.</p> <p><a href="http://www-elec.inaoep.mx/~rogerio/FourierAnalysisUno.pdf" rel="nofollow noreferrer">http://www-elec.inaoep.mx/~rogerio/FourierAnalysisUno.pdf</a></p> <p>Thank you very much.</p>
0non-cybersec
Stackexchange
387
987
Kernel of adjoint operator. <p>This problem is puzzling me, even though it should be really simple.</p> <p>Let $L=-\partial_x^2 + \frac 1 2 x^{-2}$ be an operator defined on $D(L)=C^\infty_c(0,+\infty)\subset L^2(0,+\infty)$. Its adjoint operator on $L^2$, will then be $L^*=-\partial_x^2 + \frac 1 2 x^{-2}$ with domain $D(L^*)=\{u\in L^2\colon\: (-\partial_x^2 + \frac 1 2 x^{-2})u\in L^2 \text{ in the sense of distributions} \}$. </p> <p>Now, I want to find the kernel of $L^*$, that I know to have dimension $1$. Hence, I solve $(-\partial_x^2 + \frac 1 2 x^{-2})u=0$, and find that it has two solutions: $x^{\frac{1\pm\sqrt 3} 2}$. The problem is that, while both of these functions are in $L^2$ near $0$, none of them is in $L^2$ at $+\infty$. </p> <p>Which is the right way to reason here? I cannot just consider the functions near $0$, otherwise I would end up with two of them, nor I see any justification in taking their sum as the generator of the kernel.</p> <p>Thank you for any answers! </p>
0non-cybersec
Stackexchange
344
1,011
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Why is my img element always loading the biggest image from srcset. <p>So, I'm trying to make a responsive image component that will load an appropriate size of image depending on the screen resolution/pixel density. As I understand it, the srcset attribute was designed for exactly this, but I can't get it to do what I want. What Am I doing wrong? Here's the element as rendered to the DOM:</p> <pre><code>&lt;img src="/static/media/image2_1x.20b2e636.png" srcset="/static/media/image2_05x.198c1f0f.png 590w, /static/media/image2_1x.20b2e636.png 1180w, /static/media/image2_2x.632d77c5.png 2360w" sizes="(max-width: 1180px) 90vw, 1180px"&gt; </code></pre> <p>What I expect this element to do is that when the screen size is wider than 1180px it loads an appropriate image for a 1180px width. If it's displaying on a high-density device, it might load the 2x image (2360w) here, but normally it would load the 1x image (1180w), when the size of the screen is lower, it should calculate what 90vw is in px and pick whichever of the three images is most apropriate factoring in pixel density and how many pixels 90vw is on screen.</p> <p>What actually happens is that the element always loads the biggest picture (the 2360w one). Even when I turn on responsive mode in my chrome dev tools and shrink the width of the screen to 300px clear the cache and reload it STILL loads the 2x one.</p> <p>I tried multiple sizes properties. If i set sizes to just 500px, it will display the image as 500px wide but it will still load the 2x image.</p> <p>Why is this happening? Did I make a mistake? How can I make it load the 0.5px one when the image is going to be 300px wide and doesn't need the high res version?</p>
0non-cybersec
Stackexchange
497
1,713
Want to install Ubuntu 14.04 onto a secondary partition on a secondary drive. <p>I currently have two hard drives, a 240 SSD with Win7 on it and a 1 TB drive that I mainly use for storage. I would like to partition off about 50 GB of the 1 TB drive and install Ubuntu 14.04 on it. So right now, I went into Windows and there is about 50 GB of unallocated space for my Ubuntu install. Can this be done? I have tried installing Ubuntu on it, but it seems to take the entire 1 TB drive and use it all for Ubuntu. I manually create all the partitions when installing, using 500MB for /boot, 15 GB for /, 4 GB for swap area and the rest of the remaining 50 GB for /home. Once it installs though, the entire 1 TB drive is used for Ubuntu. Please help. Thank you.</p>
0non-cybersec
Stackexchange
196
769
How to prevent font substitution?. <p>Im trying to make tufte-book to use EB Garamond. It does, but sadly, i have quite a few overfull boxes because many packages/styles use bold fonts.</p> <p>An MWE for the complaint would be this:</p> <pre><code>\documentclass[a4paper,nobib,twoside,nofonts,nols]{tufte-book} \usepackage{ebgaramond} \ifxetex \usepackage{fontspec} \setmainfont{EB Garamond} % some more renewals, as suggested in http://tex.stackexchange.com/a/202189/9293 % \renewcommand{\bfseries}[1]{\swshape} \fi \begin{document} \part{Whine and cheese} \end{document} </code></pre> <p>The above mwe compiles with the warnings:</p> <pre><code>LaTeX Font Warning: Font shape `EU1/EBGaramond(0)/bx/n' undefined (Font) using `EU1/EBGaramond(0)/m/n' instead on input line 32. [1] [2] (index.aux)stdin -&gt; index.pdf [1][2] 4341 bytes written LaTeX Font Warning: Some font shapes were not available, defaults substituted. </code></pre> <p>If i use my full document, its getting worse, because quite a few line breaks are at the wrong places (i suspect the font substitution to be the culprit).</p> <p>I already tried to renew the <code>\bfseries</code> command, as i suspect it to be responsible to be used in the <code>book.sty</code>, but if i do, the text for the part changes (first few chars are omitted, and "Part" is dropped, too), probably because redefining <code>\bfseries</code> does more than setting font weight :/</p> <p>Therefore i ask you: a) How to redefine the acutal font parameterization only for <code>\part</code>, and b) How to redefine all bold for all usage of ebgaramond? (Because EB Garamond does not support <code>bx</code>)</p> <p>or in general: How to fix such an problem?</p>
0non-cybersec
Stackexchange
567
1,744
Depressing the cubic, substitution. <p>I have been reading about Cordano's solution, tschirnhaus transformation, etc, for the past few days and one thing that I cannot understand, if anything, is the substitution of y=x-3/a or x=y+3/a (if the coefficient in front of cubed x is 1) . I have found pretty good lectures with Professor William Dunham and other links here and in other places, but none go into any details regarding that substitution. I want to know if there is any general form for it, for it feels very specific and since I don't want to just memorize it I would love to have some material (or any explanation here) to read but my searching lead me nowhere, either it has another popular name I am unaware of or there is nothing, which is unlikely. What little I know is that it is used to remove n-1 degree term to ease calculation but I want to read how it was derived or something similar, a read that isn't too advanced. I want to depress a cubic that has a square term in it, but actually know what or how the substitution that I used came about. Thank you!</p>
0non-cybersec
Stackexchange
256
1,081
[Beginner] What did I find?. For starters, I should point out that I'm a beginner with little software engineering skills. While I'm learning, I mostly rely on network forencis and high level process/OS activity for dynamic analysis. I downloaded this sample from malwr.com (link) as something to practice with and found something that I'm not really sure where to start with. **The make a quick summary of what I'm looking at:** The file from the link is a dropped that performs and HTTP get request for gooogledownloadfree[.]net/config/bin.zip. This file is extracted into %appdata%\Roaming\NetworkService and drops several executable files, DLLs, and a CA certificate. The CA is moved to the trusted certs folder and seems to be used later for SSL MITM. A "NetworkService" service is created and points to one of the dropped exe's. This service opens a port 0.0.0.0:6666 , seemingly to serve as a mitm proxy. All traffic goes back to the same IP address the dropped grabbed its binaries from, under a different domain name: youtube4tr[.]com. There is a post to youtube4tr[.]com/api containing a sort of unique ID and some other info I havent figured out yet. POST /api HTTP/1.1 Content-Type: application/json REQUEST-ACTION: login REQUEST-MODULE: command Content-Length: 66 Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: www.youtube4tr.com {"clientID":"{e95fff76-f138-494e-b1d6-5e0f230bf188}", "ver":"2.3"}HTTP/1.1 200 OK Date: Sat, 31 Oct 2015 18:47:09 GMT Content-Length: 75 Content-Type: text/plain; charset=utf-8 {"rc":0,"payroll":null,"st":1446317229,"today":2015101031,"time_zone":3600} **The interesting part(s):** In poking around, I browsed to the c2 server and got a 404 error on the root directory. However, the /config directory is full of folders with date stamps. Each folder contains several .txt file with a name similar to the unique ID spotted in the aforementioned HTTP post. The text files look like they contain keystrokes or something, but nothing else. Most of the language seems either be Portuguese or Italian. Incidentally, I couldn't located any text files with my unique string. In futher prodding, I found a list of domains registered by the registrant for original c2 domain (gooogledownloadfree[.]net). The registrant is Oasis Games and some of the other domains returned are: 85.195.110.142 account.uumessenger.com 85.195.110.142 api.uumessenger.com 85.195.110.142 gooogledownloadfree.net 85.195.110.142 ilolbox.com Link 85.195.110.142 lolmaster.com 85.195.110.142 www.lolmaster.com 85.195.110.144 gogledownload.net 85.195.110.144 uumessenger.com 85.195.110.166 lotr.oasgames.com 85.195.110.167 lotr.oasgames.com Some are no longer active, others I haven't looked into yet. However, gogledownload[.]net has another file index listing. Of particular interest is http://gogledownload[.]net/download/ which lists an executable 'GoogleMgr.exe'. I threw that one in the sandbox and this is where I'm totally lost. An HTTP connection is made back to the domain on port 4013. The stream fist send a login of some sort (not sure of encoding), then the client queries ipinfo.io and sends the returned json string (base64 encoded) to the server. An HTTP port 8787 is opened on the client, which I cannot connect to the life of me. Any attempt returns a 400 error with "CallID:" string appended as the error text. The exe spawns a cmd window but it isnt interactive it all, simply displays some info about the connection back to the server. (will screenshot if there's any interest). When an HTTP request is made, it displays the HTTP packet in the console, but there is no response in the browser. Has anyone seen anything like this before? Is anyone interested in looking a bit further into this? Any advice for moving forward?
1cybersec
Reddit
1,110
3,960
Why haven't i done this yet!?. Ok so i was rasied christain, and I've always lived in fear that if i did soemthing wrong i would go to Hell and be tortured for all eternity. But then 2 days ago, when i was worrying about that stupid shit, i found some vidoes that led to more videos and me doing some research, and THE BIBLE MAKES NO FUCKIN SINCE! I mean the story of Moses and Noah have both been disproved, and if God himself knows everything then why did he create Satan, in the first place? How come no matter how many people pray for starving kids, nothing changes? ... Ok look, i could go on, and on, and on about this but to make a lonh story short, i have been an Atheist for 2 days, and I've never been happier in my life! So i fully endorse atheism! May the non existent God (or God's) bless you.
0non-cybersec
Reddit
206
806
My girlfriend (16/f) thinks me (17/m) liking her more than she likes me is a HUGE issue is she right?. Well this argument got started because of another argument we had, basically one of her friends was cheating on one of my friends I told him about it even though she told me not to tell anyone, she got REAL mad about that understandably. I gave her this really long apology text about how I might love her and that she means a lot to me, you know all that, the thing is I REALLY didn't mean to come across like I am legit in love with her, but she stopped being mad at me and I thought all was well until today. I saw her at school shit seemed to be going fine, holding hands, until the end of the day it was almost like she was afraid to look at me. I thought she was mad or something so I texted her later and was like, "How could I be a better boyfriend, I feel like I've been pretty shitty lately." then she said, "You're not a shit boyfriend. I just feel like you like me a lot more than I like you. You keep telling me how much you care about me and I just wanna take things a lot slower. I guess I just take longer to like someone but it just makes me feel weird when you tell me how much you like me when I don't like you as much as that.". Then I basically said, something like ~ 'That's fine, just develop feelings at your own pace, you just need to let me know that you're still more interested" then I thought about what she said for like 30 seconds then said, "Fuck, I feel like you wanna break up with me" then she replied "It just makes me uncomfortable knowing that you like me so much and I don't share that same feeling." my next response was basically, ~'I don't see how this isn't an overcomeable issue'. After that she basically said she thought it was weird that I sent that message and that I'd cry if she broke up with me. Then I told her the truth I sent the message so she wouldn't be mad at me and I mentioned that after we've only been dating for a week. This is the comment that got to me the most though, she said "I just don't put a lot of stock in high school relationships. For me this is about spending time with a guy I like because it's fun. I just feel like you are a lot more invested in this relationship than I am. I don't mean to say I don't like you it's just that I'm not overly attached." This honestly fucking BIT me, it hurt a lot, maybe because it's because I believe in high school relationships because my parents met in High School they were each other's first BF/GF's and now they're still together, married at 18, my dad makes six figures, and they have 5 kids. I'm not saying I want to marry this girl, but later she said she wouldn't say she loved me cause she doesn't believe you can love someone in high school, but I do believe you legit can. I don't love her, at least not yet, and we agreed that I should just pump the brakes and we could continue dating. That sounds like a win, but I don't know if I want to, she's honestly not affectionate at all unless we're in my basement making out, and she's fine with our relatively fast sexual pace (I've got to second base, and I see us getting farther within weeks if we stay together, we've been together only a month and a half and I didn't see her in person for the first 2 weeks because of a snow storm), but emotionally she's just not on my level. While I did exaggerate the super gushy text to try to stop her from being mad at me, I meant about 20% of it. I'm scared to develop more feelings toward her if she might never be able to reciprocate them. All this being said I asked her if she's still coming over on Friday and she said, "I guess". We returned to casual conversation after that. Also she's my first girlfriend so I don't really feel confident with my ability to find someone else as good as her because she fits me so well 90% of the time, but the 10% is fucking killing me. How do I approach this whole situation? I see myself with a few options I can, A: Break up with her because she was right. B: Wade it out and try not to love her and see if she changes her mind. C: She breaks up with me. TLDR: I like my girlfriend more than she likes me, I didn't think it was a super big issue, but maybe it is. Will she change her mind? EDIT: I wasn't even the one who decided to write that gushy ass message, I was taking what I thought was good advice from a friend BTW.
0non-cybersec
Reddit
1,045
4,401