text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
Can I install `libssl-dev:i386` on x86_64 system without losing important packages?. <p>On my x86_64 12.10 system, when I try to </p> <pre><code>apt-get install libssl-dev:i386 </code></pre> <p>apt wants to remove a bunch of things:</p> <pre><code>The following packages will be REMOVED: build-essential dkms g++ g++-multilib gcc gcc-multilib hardening-wrapper nvidia-current The following NEW packages will be installed: libc6-dev:i386 libssl-dev:i386 linux-libc-dev:i386 zlib1g-dev:i386 </code></pre> <p>Why does this happen? How can I install <code>libssl-dev:i386</code> without losing gcc?</p> <p>I noticed that <code>libssl-dev</code> and <code>libssl-dev:i386</code> have no "Multiarch" field reported by <code>apt-cache show</code>, which I think means they cannot coexist. ( <a href="https://wiki.ubuntu.com/MultiarchSpec" rel="noreferrer">https://wiki.ubuntu.com/MultiarchSpec</a> )</p>
0non-cybersec
Stackexchange
314
907
php jpeg support. <p>I have complied php with the below options</p> <pre><code>'./configure' '--with-config-file-path=/opt/apache/php/etc' '--with-config-file-scan-dir=/opt/apache/php/etc/php.d' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-shmop' '--enable-soap' '--enable-bcmath' '--disable-debug' '--enable-ftp' '--with-curl=/usr/include' '--with-regex=system' '--enable-inline-optimization' '--enable-magic-quotes' '--enable-mbstring' '--enable-wddx=shared' '--enable-xml' '--with-gd' '--with-gettext' '--with-mysql' '--with-zlib-dir=/usr/local/lib' '--enable-mbstring' '--prefix=/opt/apache/php' '--with-apxs2=/opt/apache/bin/apxs' '--with-zlib' '--with-openssl' '--with-freetype-dir=/usr/include/freetype2/freetype--with-jpeg-dir=/usr/lib/' </code></pre> <p>but I have no jpeg support.</p> <p>Am I missing something?</p> <p>libjpeg and libjpeg-devel are installed </p> <p>Thanks</p>
0non-cybersec
Stackexchange
367
916
How to add superscript on summation symbol. <p>I'd like to add superscript on summation symbol, but I get an error message: </p> <blockquote> <pre><code>Please, use `\mathaccent` for accents in math mode. I can't use ^ symbol to add superscript. </code></pre> </blockquote> <p>Here is the code:</p> <pre><code>\begin{equation} y &amp; = \beta_{0}+\sumˆ{2}_{j=1}\beta_{j}X_{j}+\sum\sum_{i&lt;j}\beta_{ij}X_{i}X{j}+\sum_{j=1}\beta_{jj}X_{j}\textsuperscript{2} \label{equation1} \end{equation} </code></pre>
0non-cybersec
Stackexchange
204
517
How do you restore a corrupted object in a git repository (for newbies)?. <p>I tried to open my repository today and it came up with no commit history. Everything I tried (git status, git log, git checkout...) threw an error about a corrupt object.</p> <p>I researched this problem online and found the <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/recover-corrupted-blob-object.txt" rel="noreferrer">article</a> by Linus Torvalds, but got lost at the point where he found the broken link ID: none of my file IDs, tree or blob, match the culprit ID thrown by the error message.</p> <p>I then returned to the article on recovering <a href="https://stackoverflow.com/questions/801577/how-to-recover-git-objects-damaged-by-hard-disk-failure">"git objects damaged by hard disk failure"</a> and (after moving the culprit object out of the way) worked my way through until </p> <pre><code>$ cat packed-refs </code></pre> <p>at which point my computer said: <code>cat: packed-refs: No such file or directory</code> I skipped that step and did the</p> <pre><code>$ git fsck --full </code></pre> <p>and got the appropriate output, but then I was supposed to copy the culprit (or what I was referring to as the culprit, the sha1 ID thrown by the error) from a backup repository back into the main repository, then copy the missing objects from the backup repository into the main repository, as far as I can tell; and I don't want to do anything <em>too</em> drastic or I might force something I can't unforce later.</p> <p>So my question(s) is (are), was I supposed to have made a backup (<em>ooh, newbie alert</em>), or was that what happened when I unpacked the .pack file? And is the "culprit" I'm copying back actually a clean file, i.e. not corrupted?</p> <p>(I think it only fair to tell you that I was initially confused by a simple dash in Torvalds' file between the "git" and "fsck." So I'm <em>REALLY</em> new at this.)</p> <h2>BUG-LIST</h2> <h3>Original bug:</h3> <pre><code>$ git status fatal: object 016660b7605cfc2da85f631bbe809f7cb7962608 is corrupted </code></pre> <h3>Bug after moving corrupt object:</h3> <pre><code>$ git status fatal: bad object HEAD $ git fsck --full error: HEAD: invalid sha1 pointer 016660b7605cfc2da85f631bbe809f7cb7962608 error: refs/heads/RPG does not point to a valid object! dangling tree 2c1033501b82e301d47dbf53ba0a199003af25a8 dangling blob 531aca5783033131441ac7e132789cfcad82d06d dangling blob 74a47ff40a8c5149a8701c2f4b29bba408fa36f5 dangling blob b8df4d9751c0518c3560e650b21a182ea6d7bd5e dangling blob fc2d15aead4bd0c197604a9f9822d265bb986d8b $ git ls-tree 2c1033501b82e301d47dbf53ba0a199003af25a8 040000 tree 4a8b0b3747450085b1cd920c22ec82c18d9311bd folder1 040000 tree 33298295f646e8b378299191ce20b4594f5eb625 folder2 040000 tree dec82bad6283fc7fcc869c20fdea9f8588a2f1b2 folder3 040000 tree 4544967c6b04190f4c95b516ba8a86cab266a872 folder4 $ git ls-tree dec82bad6283fc7fcc869c20fdea9f8588a2f1b2 100644 blob 67bda6df733f6cd76fc0fc4c8a6132d8015591d8 fileA 100644 blob 4cb7272c9e268bfbd83a04e568d7edd87f78589c fileB 100644 blob ce9e0f2cc4d3b656fa30340afbdfed47fe35f3ef fileC $ git ls-tree 4544967c6b04190f4c95b516ba8a86cab266a872 100644 blob d64fe3add8328d81b1f31c9dbd528956ab391fb6 fileD 100644 blob d1ebd7df7082abc5190d87caa821bf3edb7b68e8 fileE 100644 blob bb6cd264e47a3e5bc7beadf35ea13bac86024b02 ... 100644 blob 995d622b9012f4ef69921091d1e1a73f32aa94e6 100644 blob 9141dbd2b1c7931a6461195934b6599f5dfb485a 100644 blob ab128da1d82907cd0568448dc089a7996d5f79d3 100644 blob 57b11a7eb408a79739d2bb60a0dc35c591340d18 100644 blob 118105291c1c6ca4a01744889ffafbb018bc7ed3 100644 blob 86b1dfda56d0603f16910228327751f869d16bdc 100644 blob 077fe0cddde0d0be9d0974f928f66815caca7b76 100644 blob c0b32fd0450f21994bdc53ea83d3cf0bccd74004 100644 blob 37b87a4d11453468c4ae04572db5d322cd2d1d80 100644 blob 79d39f8d4e57fa3a71664598a63b6dfd88149638 100644 blob ee07bbe3e8cb5d6bb79fb0cd52cfbc9bd830498d files $ git ls-tree 33298295f646e8b378299191ce20b4594f5eb625 100644 blob f9d6f45cd028aec97f761f00c5f4f2f6b50fb925 MoreFiles 100644 blob 0cb9eed1d0dd9214d54a03af1bda21f37b8c0d02 100644 blob 198e4f97ece735cce47b7e99b54f1b5fa99fabf5 100644 blob fc004212fa8e483e5a8ab35b508027c7a9a1cbfa 100644 blob 0c7d74c7a9a8337b4a9f20802b63d71d42287f89 $ git ls-tree 4a8b0b3747450085b1cd920c22ec82c18d9311bd 100644 blob 0320f5b23dd7cce677fac60b9ad03f418cff5c88 oneLASTfile </code></pre> <h3>After moving the corrupted object back:</h3> <pre><code>$ git log --raw --all fatal: object 016660b7605cfc2da85f631bbe809f7cb7962608 is corrupted $ cat packed-refs cat: packed-refs: No such file or directory $ git fsck --full fatal: object 016660b7605cfc2da85f631bbe809f7cb7962608 is corrupted </code></pre> <h3>After moving the file back out:</h3> <pre><code>$ git fsck --full` error: HEAD: invalid sha1 pointer 016660b7605cfc2da85f631bbe809f7cb7962608 error: refs/heads/RPG does not point to a valid object! dangling tree 2c1033501b82e301d47dbf53ba0a199003af25a8 dangling blob 531aca5783033131441ac7e132789cfcad82d06d dangling blob 74a47ff40a8c5149a8701c2f4b29bba408fa36f5 dangling blob b8df4d9751c0518c3560e650b21a182ea6d7bd5e dangling blob fc2d15aead4bd0c197604a9f9822d265bb986d8b </code></pre> <h3>After unpacking the .pack file:</h3> <pre><code>$ git log fatal: bad object HEAD $ cat packed-refs cat: packed-refs: No such file or directory $ git fsck --full error: HEAD: invalid sha1 pointer 016660b7605cfc2da85f631bbe809f7cb7962608 error: refs/heads/RPG does not point to a valid object! dangling tree 2c1033501b82e301d47dbf53ba0a199003af25a8 dangling blob 531aca5783033131441ac7e132789cfcad82d06d dangling blob 74a47ff40a8c5149a8701c2f4b29bba408fa36f5 dangling blob b8df4d9751c0518c3560e650b21a182ea6d7bd5e dangling blob fc2d15aead4bd0c197604a9f9822d265bb986d8b </code></pre>
0non-cybersec
Stackexchange
2,422
5,874
How many of you are also considering/planning on just hitting the road indefinitely, or are already doing so?. About a month ago I made the decision that when my lease is up in June, I'm simply going to hit the road, and if I can help it, never set foot in a cubicle again. I'm planning to start with Mexico, Central America and South America and see what happens from there. Since I made that decision I'm noticing threads like [this](http://www.reddit.com/r/backpacking/comments/ljhkv/quitting_job_backpacking_americas_indefinitely/) and blogs like [this](http://hitchtheworld.com/) where people have either been doing so for a few years or are planning on doing the same thing. I have a hunch that more people may be doing this or are planning to. So, if indefinite backpacking may be on your agenda, or if you are/have been doing so, I'd love to hear from you! Let's exchange ideas, experiences, advice, etc.
0non-cybersec
Reddit
235
916
How to verify that array contains object with rest assured?. <p>For example, I have JSON in response:</p> <pre><code>[{"id":1,"name":"text"},{"id":2,"name":"text"}]} </code></pre> <p>I want to verify if a response contains a custom object. For example: </p> <pre><code>Person(id=1, name=text) </code></pre> <p>I found solution:</p> <pre><code>Person[] persons = response.as(Person[].class); assertThat(person, IsArrayContaining.hasItemInArray(expectedPerson)); </code></pre> <p>I want to have something like this:</p> <pre><code>response.then().assertThat().body(IsArrayContaining.hasItemInArray(object)); </code></pre> <p>Is there any solution for this?<br> Thanks in advance for your help!</p>
0non-cybersec
Stackexchange
237
704
Examples of Exp tool to export data from Oracle db table to text file. <p>I need to export data from an Oracle database and then import the data to another oracle database. To import data, I can use SQLLDR tool to load a flat text file. To do that, I have to generate this flat text file from a Oracle database table first.</p> <p>Are there any examples to use this tool? I need to pass Oracle database name, schema name with user/pwd, table name, constrains, and date time column format information to generate a text file. This text file will be used by SQLLDR tool.</p>
0non-cybersec
Stackexchange
143
574
Eigenspace and Eigenvalues (Comprehension Question). <blockquote> <p>I'm a bit confused on a couple linear algebra topics..</p> <p>Say I have a $5 \times 5$ matrix, with 3 eigenvalues With One of the corresponding eigen-spaces being 1 dimensional Another corresponding eigen-spaces dimension being 2 dimensional </p> <p>Would it be possible for that matrix to <strong>NOT</strong> be diagonalizeable?</p> </blockquote> <p>I would say <strong>YES</strong> because if the $3rd$ eigenvalue<br> and it's associated eigen-space dimension is not $2$<br> then it can't possibly be diagonalizeable.</p> <p>Is this logical? Also would it be possible to have an eigen-space with dimension $0$?</p> <p>Also if anyone could help me understand how this relates to the geometric multiplicities and algebraic multiplicities it would be greatly appreciated!</p>
0non-cybersec
Stackexchange
244
870
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
Embedded Jetty rewrites not working properly. <p>I am trying to implement a simple rewrite rule in an embedded Jetty server, following the Jetty documentation examples.</p> <p>I want requests to <code>/admin/</code> to rewrite to /admin.html. At the moment if I request <code>/admin/</code> I get a 404 error with <code>/admin.html</code> not found. But if I request <code>/admin.html</code> directly, it works!</p> <p>There are 2 other similar posts on stackoverflow but no answers to the question!</p> <p>Here's the code:</p> <pre class="lang-java prettyprint-override"><code>WebAppContext _ctx = new WebAppContext(); _ctx.setContextPath("/"); _ctx.setDefaultsDescriptor(JETTY_DEFAULTS_DESCRIPTOR); _ctx.setParentLoaderPriority(true); _ctx.setWar(getShadedWarUrl()); _ctx.setResourceBase(getShadedWarUrl()); RewriteHandler rewriter = new RewriteHandler(); rewriter.setRewritePathInfo(true); rewriter.setRewriteRequestURI(true); rewriter.setOriginalPathAttribute("requestedPath"); RewritePatternRule admin = new RewritePatternRule(); admin.setPattern("/admin/"); admin.setReplacement("/admin.html"); admin.setTerminating(true); // this will stop Jetty from chaining the rewrites rewriter.addRule(admin); _ctx.setHandler(rewriter); HandlerCollection _handlerCollection = new HandlerCollection(); _handlerCollection.setHandlers(new Handler[] {_ctx}); server.setHandlers(_result); </code></pre>
0non-cybersec
Stackexchange
418
1,408
Sort a list of tuples with None values in Python3. <blockquote> <p>In Python 3 the ordering comparison operators (&lt;, &lt;=, >=, >) raise a TypeError exception when the operands don’t have a meaningful natural ordering</p> </blockquote> <p>This change in comparison creates difficulties to order a list of tuples, if there exist None values.</p> <p><strong>In Python 2:</strong></p> <pre><code>&gt;&gt;&gt; unordered_list = [('3', '1', None), ('3','1', '4'), ('3', '1', None)] &gt;&gt;&gt; sorted(unordered_list, reverse=True) [('3', '1', '4'), ('3', '1', None), ('3', '1', None)] </code></pre> <p><strong>In Python 3:</strong></p> <pre><code>&gt;&gt;&gt; unordered_list = [('3', '1', None), ('3','1', '4'), ('3', '1', None)] &gt;&gt;&gt; sorted(unordered_list, reverse=True) TypeError: unorderable types: str() &lt; NoneType() </code></pre> <p>Do you have any idea how to have the same behavior with Python 2 an elegant way?</p> <p><strong>NOTE:</strong> In the above examples I have integers, but it's only an example. The elements of the tuples will have the same type and they could be any type.</p> <pre><code>ex.2 [('test3','test1', 'test4'), ('test3', 'test1', None)] ex.3 [( 3, 1, 4), (3, 1, None)] ex.4 [( 3.1, 1.1, 4.1), (3.1, 1.1, None)] </code></pre>
0non-cybersec
Stackexchange
468
1,281
Maven/Gradle way to calculate the total size of a dependency with all its transitive dependencies included. <p>I would like to be able to perform an analysis on each of my project POMs to determine how many bytes each direct dependency introduces to the resulting package based on the sum of all of its transitive dependencies.</p> <p>For example, if dependency A brings in B, C, and D, I would like to be able to see a summary showing A -> total size = (A + B + C + D).</p> <p>Is there an existing Maven or Gradle way to determine this information?</p>
0non-cybersec
Stackexchange
144
556
What can you do or have done fitness wise that puts you at the top 1%?. I recently achieved my life goal of doing 20 pull ups. I mentioned this to a friend who then said I'm in the top 1% (not really sure how valid this is). Never did I thought I would be able to achieve being in the top 1% for anything. So I want to pose this question to /r/fitness, what can you do or have done fitness wise that puts you at the top 1%? Edit: Thanks for the all the amazing posts. I tried reading all of the accomplishments and upvoting everyone. Some of them are really amazing. Thanks for sharing!!! Edit: Can't believe the posts are still coming in. Spending way too much time reading them all. You guys and gals have done some amazing stuff. It's a shame how if anyone had posted these individually it'll get downvoted to oblivion. It's apparent people like to share their accomplishments but can't because some people would view it as bragging.
0non-cybersec
Reddit
231
947
Text &#39;stretched&#39; in a table. <p>I have a minor problem, although I'm unsure how to fix it. The two tables below show the tables as they appear in my thesis:</p> <p><img src="https://i.stack.imgur.com/COE29.png" alt="enter image description here"></p> <p>As you can see the space between the words 'Each' and 'successive' is too much. However when I try to replicate the problem with a MWE, the problem does <strong>not</strong> appear:</p> <p><img src="https://i.stack.imgur.com/4OId2.png" alt="enter image description here"></p> <p>What could be causing the stretched words? I have other packages loaded in my main thesis document, but I don't think they are relevant to this problem.</p> <p>My MWE is the following:</p> <pre><code>\documentclass{article} \usepackage{booktabs} \usepackage{threeparttable} \usepackage{array} \newcolumntype{L}[1]{&gt;{\raggedright\arraybackslash}p{#1}} \newcolumntype{C}[1]{&gt;{\Centering\arraybackslash}p{#1}} \begin{document} \begin{table}[htbp] \centering \renewcommand\arraystretch{1.2} \begin{threeparttable} \caption{Course Load of a Representative EBE student} \label{table:eng} \begin{tabular}{@{}p{0.20\textwidth}*{3}{L{\dimexpr0.25\textwidth-2\tabcolsep\relax}}@{}} \toprule &amp; \multicolumn{3}{c}{\bfseries Cumulative Number of Prescribed Credits} \\ \cmidrule(l){2-4} &amp; BSc (Eng)&amp; ASPECT &amp; BSc (Geomatics) \\ \midrule First-year &amp; \multicolumn{1}{c}{144 -- 148} &amp; \multicolumn{1}{c}{104 -- 116} &amp; \multicolumn{1}{c}{142 -- 144} \\ Each successive \hbox{two-year} period\tnote{1} &amp; \multicolumn{1}{c}{264 -- 294} &amp; \multicolumn{1}{c}{232 -- 248} &amp; \multicolumn{1}{c}{296 -- 330} \\ \bottomrule \end{tabular} \end{threeparttable} \end{table} \end{document} </code></pre>
0non-cybersec
Stackexchange
640
1,777
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
Using Windows as middle for migrating between two Linux machines. <p>We're developing a tool that will do a migration between some platforms. Both source and/or destination servers can be Windows or Linux.</p> <p>The tool is currently built in .NET and we'd like to keep it that way if possible. But a new requirement emerged that requires us to copy files and their permissions.</p> <p>So my questions are</p> <ul> <li>Is it possible to copy permissions (or read old then write file and set new permissions)?</li> <li>Possibly related, is it possible to execute remote scripts from windows (say PowerShell) on Linux?</li> </ul> <p>Is this possible, and where can I find any documentation on this topic?</p>
0non-cybersec
Stackexchange
185
712
Pharmacy Scammer Gives Advice on Keeping CC Safe. So I have been getting a call from these guys every day for weeks, but I never answer. I decided to answer today just to see what came of it, and sure enough, pharmacy call offering me pain meds. After goofing around pretending I wanted to buy highly illegal drugs from them if available (street drugs) I offered to pay with my Visa. Janet who was so kind to make me this 'once in a lifetime offer' kindly spent several minutes explaining to me why I should never give my credit card information to anyone who calls me asking for funds. Despite trying to get me to buy pharmacy meds from them, I thought I'd give a shout out to her for trying to watch out for dumb-ol' me, just blindly trying to give out my credit card information. Thanks for being a bro (kinda?), Janet!
0non-cybersec
Reddit
205
839
Here are a bunch of quick tips to mitigate wrist aches and pains caused by bodyweight exercises.. **When doing planks, downward dogs, handstands, etc** * **[Slight Turn Out:](http://i.imgur.com/OIXgJqh.png)** Spread the fingers wide apart and set the hand down in such a way that the index finger is facing forward. That will make sure you're turning your hands out slightly, just enough to reduce some potential impingement. (When going more extreme, like in the case of planche's, some people turn them out even more.) * [**Press down the knuckle of the index finger:**](http://i.imgur.com/EKrcH6z.jpg) Avoid putting all your weight in the heel of your hand by making sure you're pressing the knuckle of the index finger firmly down into the ground! This helps to distribute the pressure better. * **[Yoga mat mod:](http://i.imgur.com/hoTGvJF.jpg)** Another modification that works to distribute the pressure better, is to roll up the end of a yoga mat so that the wrist bones are elevated and the fingers can slope downwards off the end of them. **If push ups hurt your wrists, here are some modifications:** * **Do them on fists,** placing most of your weight on the knuckles of the index and middle fingers. * **Use push up bars,** parallettes or the iron-gym pull up bar or dumbbells on the floor and use their handles. * I made a video showing these tips [here](https://www.youtube.com/watch?v=Ua7B2q21UHg) if you wanna see visually. **Don't rush through the wrist mobility stuff!** * I recently had a friend who said they were starting to have wrist pains despite going through **[the wrist mobility exercises](https://youtu.be/8lDC4Ri9zAQ?t=7m20s)** of our [**recommended routine'**](https://www.reddit.com/r/bodyweightfitness/wiki/kb/recommended_routine) I asked them if they were rushing through them or doing them slowly. He admitted he was performing them all at quite a fast speed because he had memorized them and wanted to speed through them. * **I've found it best to purposely slow everything down and not rush through the dynamic wrist stretching and strengthening exercises.** Do them purposely in a slower manner, much slower than you're used to and that should help quite a bit. Rushing through the exercises is almost the same as not doing a wrist warm-up at all sometimes. Exhibit mindfulness and control and respect for the ritual you're embarking on that involves warming up your body and mind. The warm-up becomes more and more important the more advanced you become so it's good to respect it. Hope that helps! Also, if you have serious wrist issues that are not healing, seek out a sports oriented physical therapist and take care of your body. Nothing is more important than your health! If you got a tip to share, absolutely leave a comment!
0non-cybersec
Reddit
691
2,789
Windows 10 hangs for 1 second while typing. <p>My laptop recently started having an unusual issue: whenever I'm typing, it will randomly freeze for about 0.5 to 2 seconds, after that, it will resume working and also catch up on all the text I've written since. Please note that since the freeze is so quick, it might just be an impression that it only happens while typing. I know for a fact that it does not stop audio or video playing.</p> <p>It happens on any application where you can type, including any browser (Chrome, Edge, FFox), messaging app or text editor.</p> <p>It happens randomly so it's very hard to trubleshoot, although my general impression is that the frequency increases if RAM usage is > 25%. For example the frequency seems to increase a lot if I open Chrome or a heavy IDE.</p> <p><strong>What I have tried:</strong></p> <ul> <li><p>Check windows files for integrity with <code>sfc /scannow</code>: No problems found</p></li> <li><p>Updating keyboard, audio and video drivers from manufacter website: All were up to date</p></li> <li><p>Clean boot (disabling all services except microsoft): Nothing changed</p></li> <li><p>Ram memory diagnostic (the tool that comes with windows): No problems found</p></li> <li><p>Clean cache, delete temp files</p></li> <li>Reset winsock registry (<code>netsh winsock reset</code>): Nothing changed</li> <li>Windows Update: all done</li> <li><p>Undo any recent hardware or software changes: I haven't changed anything in weeks, except for updating a few drivers that were otherwise causing a BSOD. This however happened about 5-6 days before the freezing problem occurred, and I hadn't changed anything since.</p></li> <li><p>Disabling "turn off Hard Drive after.." in advanced power settings</p></li> <li><p>Setting manual virtual memory, minimal at recommended value and maximum at 1.5 times my total RAM</p></li> </ul> <p>Any idea? I'm lost at this point.</p> <p><strong>Useful Specs:</strong></p> <pre><code>Keyboard: Integrated laptop keyboard Laptop: Alienware 17R3 Windows 10 Home 1709 Build: 16299.248 (Updated from .225) SSD (C:, OS) 500GB, 150 GB avaiable HDD (D:) 1TB, 250GB avaiable data only Ram: 16GB DDR4 (8x2) NVIDIA GTX 980M lastest drivers </code></pre> <p>Laptop froze about 6 times while writing this post.</p>
0non-cybersec
Stackexchange
660
2,305
set_metadata_recursive failing on Android install. <p>I'm trying to bring up a 4.4 android build for my droid razr HD. It compiles cleanly, but when I try to install it fails with the following error in the recovery log:</p> <pre><code> ApplyParsedPerms: removexattr of /system/xbin/zipalign to 0 failed: Operation not supported on transport endpoint script aborted: set_metadata_recursive: some changes failed set_metadata_recursive: some changes failed E:Error executing updater binary in zip '/external_sd/MSI/update-XenonHD-11-07-13-signed-xt926.zip' Error flashing zip '/external_sd/MSI/update-XenonHD-11-07-13-signed-xt926.zip' </code></pre> <p>So... I did a fair amount of research into the changes made by AOSP in build and bootable/recovery, including comments others have made on this issue, and I'm thinking it's a missing seandroid configuration for /system/xbin. It's definitely something about items in /system/xbin because when I remove zipalign from the build, it errors out on tcpdump, and so on.. Is this indeed a sepolicy configuration that's missing? Is there something else I need to check? Can anyone tell me how to include xbin without having to mess with the files residing there? Thanks, appreciate your time! </p>
0non-cybersec
Stackexchange
355
1,409
My doctor listened to me when I requested a thyroid related blood test and I just went back in for more tests today. I finally might know what's been so wrong with my body!. I've been depressed ever since high school along with heaps of anxiety inherited from mom. In college I'd be perpetually fatigued but I just chalked it up to being so busy. Then I graduated and I. Kept. Sleeping. 12 hours, 15 hours, I'd sleep and sleep and sleep. I brushed it off though because I figured I had a sleep debt to repay. Then I began to finally tackle the 10 pounds I gained in college. And as I counted my calories I noticed something odd. To lose weight I had to eat 1,000 calories a day or less. This is with daily moderate exercise. My weight is maintained with the same exercise on 1,300 calories max. No more. I am 5'7" but I chalked it up to being Chinese and thus having a smaller frame. Then after a month of traveling in China I got back and my sleep deteriorated entirely and my depression kicked up to the point where I'd be crying miserably while feeling so fatigued I couldn't move. I felt even fogger than I did in college, as if I'm moving through mud. I made more typos while working, things slipped my mind, I just became a mess. Finally my mom and husband pushed me to seek out therapy. My therapist immediately said I need to get bloodwork done for vitamin D and thyroid testing. And one of my college friends who was recently diagnosed with severe hypothyroidism later told me she wants me to be tested. She had a bad feeling in her gut that I might be suffering from the same condition. So when I met my new doctor (I just aged out of my pediatric doctor) I told her everything and she listened. She felt my thyroid and said she thinks it is normal. But she submitted to the lab tests for vitamin D, a basic thyroid panel , other basic panels, and even anemia. My results came back 24 hours later. My TSH levels were extremely high. The lab called me and said I need to go back ASAP for further testing. I was also severely deficient in vitamin D and my doctor already prescribed me supplements. I just got my blood drawn again today. I already feel like a huge weight is off of me. Being so fatigued just makes my depression worse because then I get nothing done and I feel like a waste of a person. But hearing that there might be a physical problem makes me feel so relieved. And my doctor will help me fix it. Right now I'm laying in bed because my cat fell asleep on my chest and I just wanted to share a victory story with you all. EDIT: ahhhhhhh thank you all for the support! And thank you kind stranger for the gold!
0non-cybersec
Reddit
607
2,643
Real Analysis Qualifying Exam Problem. <p>I think this should be an easy question, and I believe the answer should be in the positive, but I am not sure how to start. I would appreciate some help. Thank you.</p> <blockquote> <p>Suppose that <span class="math-container">$f_j$</span> is a sequence of functions in <span class="math-container">$L^1(\mathbb{R})$</span> satisfying</p> <p>(i) <span class="math-container">$\|f_j\|_\infty \leq 5$</span> and <span class="math-container">$f_j(x) = 0$</span> for <span class="math-container">$|x| \geq 10, j \in \mathbb{N}.$</span></p> <p>(ii) the <span class="math-container">$f_j$</span> converge pointwise to <span class="math-container">$f \in L^1(\mathbb{R})$</span>.</p> <p>Does it follow that the <span class="math-container">$\hat{f_j}$</span> converge pointwise to <span class="math-container">$\hat{f}$</span>?</p> </blockquote>
0non-cybersec
Stackexchange
304
885
How to perform two searches at once in Vim?. <p>In Vim, I often find myself performing one search immediately followed by another search. I am wondering if I can combine the two searches into one command.</p> <p>For example, if I want to find the first instance of the <code>foobar</code> variable within a function named <code>transmogrify</code>, I would enter:</p> <pre><code>/def transmogrify /foobar </code></pre> <p>Or if I'm in a log file and I want to search for an error that happened after a specific date:</p> <pre><code>/2012-07-26 /ERROR </code></pre> <p>Is there a better way to do this? And no, I'm not looking to record a macro.</p>
0non-cybersec
Stackexchange
198
654
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
Hi, we are the creator & designer of BoJack Horseman, Ask Us Anything!. Hi Redditors! I'm Lisa Hanawalt (production designer) and I'm here with Raphael Bob-Waksberg (creator). We're excited to answer your questions about BoJack Horseman, now streaming on Netflix! Or anything else! (Except Rampart, we will not be answering any questions about Rampart.) Lisa is /u/ponytv and Raphael is /u/rbwrbw **Our Proof:** https://twitter.com/lisadraws/status/515238200445378560 EDIT: Yes there will be a Season 2, not sure what the release date is yet. We are working on it RIGHT NOW! :))))
0non-cybersec
Reddit
170
583
Cisco IP communicator unreliable for incoming calls - IP address conflict?. <p>My workplace uses <a href="http://www.cisco.com/en/US/products/sw/voicesw/ps5475/index.html" rel="nofollow noreferrer">Cisco IP communicator</a> as a softphone for employees.</p> <p>I have found it to be quite unreliable for receiving incoming calls. When my wife calls me, she intermittently gets forwarded straight to my voice-mail (which implies that there is a disconnect between the client and server). Sometimes she will have to try and call 3-4 times before it starts ringing on my PC.</p> <p>I suspect this is a flapping issue of some sort where the client is constantly being disconnected from the server for short periods of time, and if the incoming phone call comes at a time when it is connected properly, my phone will ring.</p> <p>Today when I came into work, there was the following message on my screen:</p> <pre><code>Windows has detected an IP address conflict ... </code></pre> <p>It sounds like this could be connected. Any recommendations?</p>
0non-cybersec
Stackexchange
276
1,053
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
Should I go to Iran or Jordan. Soon I am about to go on a round the world trip and at the end when I have some spare time (less than a week) I'd like to stop in the middle east. I will have been away for a few months at this stage so money will be tight and I wont be able to do both. I have narrowed it down to Iran and Jordan. Iran looks like it has great architecture and probably more to see, But Jordan has Petra and I have always dreamed of going there. Anyone that has been to both, which country would you recommended I experience? Is there more to view in Jordan than just Petra, or is Petra enough to justify the visit
0non-cybersec
Reddit
147
628
Faces of the intersection of convex sets. <p>Let $V$ be a normed real vector space and let $K_1, K_2\subseteq V$ be closed convex subsets such that the intersection $K_1\cap K_2$ is non-empty. Assume that $F_1$ is a face of $K_1$ and $F_2$ is a face of $K_2$ (face $F$ of a convex set $K$ is a convex subset such that $a=tb+(1-t)c$, for $a\in F$, $b, c\in K$, $0&lt;t&lt;1$, implies $b,c\in F$). If $F_1\cap F_2$ is non-empty, then it is a face of $K_1\cap K_2$.</p> <blockquote> <p>Question: is every face $F$ of $K_1\cap K_2$ the intersection of $F_1, F_2$, where $F_1$ is a face of $K_1$ and $F_2$ is a face of $K_2$?</p> </blockquote> <p>Probably the answer is known to experts working in convexity, however I am not able to find a reference in the literature. In my opinion the answer is affirmative, but maybe I am wrong and there are (even simple) counterexamples. It is possible that the answer is much simpler if one assumes that $V$ is finite dimensional. On the other hand it is also possible that the answer is known also for more general case when instead of the intersection of two convex sets we have the intersection of an arbitrary family of closed convex sets.</p>
0non-cybersec
Stackexchange
391
1,187
Can I configure git so it does not guess user.email configuration settings?. <p>On my system I don't have the <code>user.email</code> git configuration value set at the global level, on purpose. Instead, I configure it individually in each sandbox. This is because I need to use different e-mail addresses for different projects.</p> <p>Unfortunately I sometimes forget to configure the value when I create a new sandbox. In those cases, git just "guesses" a value based on information it gets from the environment. That leads to various problems, for example commits are not attributed to me on github, and I won't have much luck getting those commits with <code>@localhost</code> e-mail addresses attributed to me retroactively.</p> <p>Is there a way to configure git to error out instead of guessing when I try to commit without a local or global <code>user.email</code> value configured?</p>
0non-cybersec
Stackexchange
212
898
Comma as separator in variable initialization (not as operator). <p>This seems such a simple question, but something I've not examined for ages in my own style... When initializing variables separated by a comma, I've assumed the following to be an unsafe practice:</p> <p><code>unsigned int n = foo.size, nxn = n * n;</code></p> <p>Since I don't really ever use the comma <em>operator</em> as such for syntactic sugar, etc; but rather to indicate that two expressions are independent - as a kind of implicit commentary on 'fine-grained parallelism' (or expression independence), that often makes code a bit more terse, e.g.,</p> <pre><code>if (&lt;some condition&gt;) a = true, b = value; </code></pre> <p>rather than requiring <code>{}</code> scope for semi-colon separated expressions.</p> <p>But my question is really in re-examining the variable initialization case. Have I been incorrect in my assumption that <code>nxn</code> can't be relied on to be initialized as expected? Or have I been laboring under a misinterpretation all this time?</p>
0non-cybersec
Stackexchange
288
1,061
Crash when trying to run WebGoat with a Java Agent. <p>I am currently learning how to boot a web application with a java agent for monitoring.</p> <p>The Web Application I chose was <a href="https://github.com/WebGoat/WebGoat" rel="nofollow noreferrer">WebGoat</a>, and running WebGoat with <code>java -jar webgoat-server-8.0.0.M17.jar</code> as stated in WebGoat's README works perfectly fine.</p> <p>However, when I try to add my agent, I get the following mess of an error log: </p> <pre><code> . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.5.12.RELEASE) 2018-06-06 22:36:08.528 INFO 3741 --- [ main] org.owasp.webgoat.StartWebGoat : Starting StartWebGoat v8.0.0.M17 on MacBook-Pro.local with PID 3741 (/Users/andrewfan/Desktop/Lang Agent Dev Proj help info/webgoat-server-8.0.0.M17.jar started by andrewfan in /Users/andrewfan/Desktop/Lang Agent Dev Proj help info) 2018-06-06 22:36:08.531 INFO 3741 --- [ main] org.owasp.webgoat.StartWebGoat : No active profile set, falling back to default profiles: default 2018-06-06 22:36:08.844 INFO 3741 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1376c05c: startup date [Wed Jun 06 22:36:08 EDT 2018]; root of context hierarchy 2018-06-06 22:36:11.354 INFO 3741 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$8e12590a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-06-06 22:36:11.442 WARN 3741 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'webgoat.user.directory' in value "${webgoat.user.directory}" 2018-06-06 22:36:11.455 INFO 3741 --- [ main] utoConfigurationReportLoggingInitializer : Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2018-06-06 22:36:11.464 ERROR 3741 --- [ main] o.s.boot.SpringApplication : Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'webgoat.user.directory' in value "${webgoat.user.directory}" at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372) ~[spring-beans-4.3.16.RELEASE.jar!/:4.3.16.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) ~[spring-beans-4.3.16.RELEASE.jar!/:4.3.16.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.16.RELEASE.jar!/:4.3.16.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.16.RELEASE.jar!/:4.3.16.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) ~[spring-beans-4.3.16.RELEASE.jar!/:4.3.16.RELEASE] at </code></pre> <p>...</p> <p>I cut the error messages short since the trace is a few pages long, but the main error seems to be <code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'webgoat.user.directory' in value "${webgoat.user.directory}"</code></p> <hr> <p>I am running my agent as follows: <code>java -javaagent:/Users/path/to/jar/Spn-LangAgent-0.0.jar -jar webgoat-server-8.0.0.M17.jar --server.port=8080 --server.address=localhost</code></p> <p>My agent is as follows:</p> <pre><code>package com.spnlangagent.langagent; import java.io.File; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLClassLoader; import java.lang.reflect.Field; import java.lang.instrument.Instrumentation; import java.lang.instrument.UnmodifiableClassException; import com.google.monitoring.runtime.instrumentation.AllocationRecorder; public class LangAgent { public static void premain(String agentArgs, Instrumentation inst) throws Exception { System.out.println("LangAgent: premain now running"); setupInstrumentation(agentArgs, inst); startRuntime(agentArgs); } private static void setupInstrumentation(String agentArgs, Instrumentation inst) throws Exception { System.out.println("setupInstrumentation: now running with agentArgs: " + agentArgs); } private static void startRuntime(String agentArgs) throws Exception { System.out.println("startRuntime: now running with agentArgs: " + agentArgs); } } </code></pre> <p>The original contents of the agent were commented out except for a few print statements, and yet even with this, WebGoat is crashing on startup. </p> <p>I tried another agent with WebGoat and it worked fine, so the only thing I can think of is that something is wrong with either my agent, or the way it is being packaged.</p> <p>I am using Maven, and my MANIFEST.MF is as follows:</p> <pre><code>Manifest-Version: 1.0 Premain-Class: com.spnlangagent.langagent.LangAgent Can-Redefine-Classes: true Can-Retransform-Classes: true </code></pre> <p>After running <code>mvn package</code>, the MANIFEST packaged in the .jar is as follows:</p> <pre><code>Manifest-Version: 1.0 Premain-Class: com.spnlangagent.langagent.LangAgent Built-By: andrewfan Can-Redefine-Classes: true Can-Retransform-Classes: true Created-By: Apache Maven 3.5.3 Build-Jdk: 1.8.0_172 </code></pre> <p>In my pom.xml, I am doing the following to reach the manifest:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt; &lt;version&gt;3.1.0&lt;/version&gt; &lt;configuration&gt; &lt;archive&gt; &lt;manifestFile&gt;src/main/resources/META-INF/MANIFEST.MF&lt;/manifestFile&gt; &lt;/archive&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>If someone could point me in the right direction in regards to figuring out why WebGoat is crashing, or if someone could provide more insight into why what I am currently doing is wrong, that would be greatly appreciated. </p> <p>Thank you.</p> <p>Note: If the rest of my pom.xml is necessary for debugging, I will gladly provide it; it's just that the question is already very long as-is.</p>
0non-cybersec
Stackexchange
2,318
7,716
Resolving dbcontext per request with Unity in WebApi. <p>I am struggling to make this work. I've got Unity and Unity.AspNet.WebApi packages (v 3.5.1404) installed and below activation code which came with the packages</p> <pre><code>public static class UnityWebApiActivator { /// &lt;summary&gt;Integrates Unity when the application starts.&lt;/summary&gt; public static void Start() { var container = UnityConfig.GetConfiguredContainer(); var resolver = new UnityHierarchicalDependencyResolver(container); GlobalConfiguration.Configuration.DependencyResolver = resolver; // DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule)); } /// &lt;summary&gt;Disposes the Unity container when the application is shut down.&lt;/summary&gt; public static void Shutdown() { var container = UnityConfig.GetConfiguredContainer(); container.Dispose(); } } </code></pre> <p>and my type registration looks like this:</p> <pre><code> public static void RegisterTypes(IUnityContainer container) { container.RegisterType&lt;IAuditService, AuditService&gt;( new PerThreadLifetimeManager(), new InjectionConstructor(new SecurityDbContext())); } </code></pre> <p>So far I've tried PerThreadLifetimeManager and TransientLifetimeManager with no success. I've also got the Unity.Mvc package and tried using the PerRequestLifetimeManager as suggested by msdn but no luck. It always gives me the same instance of dbcontex.</p> <p>I rather do not include any MVC dependency as this is purely WebApi but when I try to use Unity.Mvc, I ended up some http runtime errors too.</p> <p>Anyone has a good suggestion/example to resolve dbcontext per request with Unity in WebApi, preferably without any mvc dependency?</p>
0non-cybersec
Stackexchange
477
1,854
Basic stochastic inequality. <p>Let $X$ and $Y$ be independent random variables. Prove that $$P(X \leq x\mid X &gt;Y) \leq P(X \leq x).$$</p> <p>I try to use the definition of conditional probability, but I can't get success. $$P(X \leq x\mid X &gt;Y) = \frac{P(X \leq x, X &gt; Y)}{P(X &gt;Y)} = \frac{P(Y &lt; X \leq x)}{P(X &gt;Y)}$$</p> <p>Any ideas?</p>
0non-cybersec
Stackexchange
154
361
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
Number of Solutions for Trigonometric Equation on $\theta \in [-\pi , \pi]$. <p>I just ran into this question for an admission test...</p> <p>How many solutions does the equation:</p> <p>$$(1+\sec\theta)(1+\csc\theta)=0$$</p> <p>have for $\theta \in [-\pi , \pi]$?</p> <p>My trial so far:</p> <p>$$2\cos^{2}\left(\frac{\theta}{2}\right)=1+\cos\theta$$</p> <p>Divide both sides by $\cos\theta$ and I get:</p> <p>$$1+\sec\theta=2\frac{\cos^{2}\left(\frac{\theta}{2}\right)}{\cos\theta}$$</p> <p>Substituting and doing some algebra, I get that the solution would be $\sin\theta=-1$, which gives me $\theta=-\frac{\pi}{2}$.</p> <p>However the correct solution is that <strong>there are no solutions in the interval...</strong></p> <p>What am I missing here? Any help is appreciated</p> <p>Thanks in advance</p>
0non-cybersec
Stackexchange
298
818
how to determine whether a dynamical system is the uniformly exponentially stable if at equilibrium point. <p>Given that equilibrum point $x_e=0$ and a dynamical system:</p> <p>$\dot x(t)=\begin{bmatrix} a(t) &amp; 1\\ 0 &amp; -1\\\end{bmatrix}x(t)$</p> <p>for each $a(t)$ below, determine if it is uniformly exponentially stable</p> <p>a) $a(t)=0$</p> <p>b) $a(t)=-1$</p> <p>Please help me with this question, I know the theorem behind this which is that if there exist constants $C$, $\lambda &gt;0$ and $r\gt 0$ such that $||x(t)||\le Ce^{-\lambda(t-t_o)}||x(t_o)|| $ for all $t\ge t_o$ and $||x(t_o)||\le r$. But I don't how to use this in a real problem. Also this the $\lambda$ denote eigenvalue of the A matrix?</p>
0non-cybersec
Stackexchange
267
728
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
&quot;Cannot open log file&quot; - Kile is not able to identify log file location. <p>I am using kile for my latex documentation.</p> <p>I wanted to keep the top level directory of tex files clean, so I have created a folder named "tmp" in the current directory and added the option to compilation as:</p> <blockquote> <p><code>pdflatex --output-directory tmp</code></p> </blockquote> <p>using kile's build-configuration settings.</p> <p>After setting this, compilation is working very fine and the directory is clean as I desired, but the "log and messages" pane in Kile, at the bottom is not able to show the compilation status message and says:</p> <blockquote> <p><code>Cannot open log file; did you run LaTeX?</code></p> </blockquote> <p>Any suggestions about how do I tell KILE about new log file location??</p> <hr> <p><strong>Solution update 7-Nov-2016:</strong></p> <p>Below is a compromising work-around for this age-old, unsolved bug/problem with kile. (As the Q is closed and I only can edit the Q):</p> <p>Basically the aim is to keep the current directory clean, so one may compromise to ONE additional file, more specifically a link to the .log file. Note that we already avoided a ton of other files.</p> <p>So the main problem happens to be a simple bug, that the .log file is not accessible to the kile, hence complaining as above. Because kile is (in spite of the relative directory setting) still thinking that the log file should exist in the current directory to read and present its summary in "log and messages". </p> <p>So I kept a symbolic link to the actual log file (which should have been created in <code>tmp</code> directory as a result of the option <code>--output-directory</code>) in the current directory, i.e.: </p> <blockquote> <p><code>ln -s tmp/&lt;filename&gt;.log &lt;filename&gt;.log</code></p> </blockquote> <p>This has solved the error message and everything else is normal.</p>
0non-cybersec
Stackexchange
558
1,945
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
Need cookie to remember two-factor authentication success (not persistent login). <p>I've read a lot here and other places about using a cookie for a "remember me" option, but what I'm looking for is a way to design a cookie to record success of a two-factor authentication. This is what, for example, Google does: If the second step succeeds (e.g., you entered the code that you received via SMS), then it sets a cookie good for a period of time (e.g., 30 days) that means that the second step can be bypassed. Call this the "verification cookie." My understanding is that if in that time you logout and then in again, it won't do the second step, but only the first step. (I tested this and that seemed to be the case.)</p> <p>My question is how to design this cookie. One idea is to put the user ID and a 128-bit random number in the cookie, and then to store that number in the database along with the user ID. This is what Charles Miller recommends (<a href="http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/" rel="noreferrer">http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/</a>) for persistent-login cookies.</p> <p>However, that's not good enough, I think. The problem is that, since the user is using a two-factor authorization, whatever cookie is used to record that the second step was successful, should be safer than would be the case with a one-factor authorization.</p> <p>What I want to avoid is this: The cracker has the hashed/salted passwords from the database, and has somehow gotten the password. If he/she has that much, I assume that the 128-bit random number that was in the verification cookie is available as well. (If the cracker has gotten the password some other way, and doesn't have the database, then the verification cookie is safe unless he/she has physical access to the computer. I'm only worried about the compromised database case.)</p> <p>Maybe an idea is to encrypt the 128-bit random number? (Needs to be 2-way -- not a hash.) The encryption key would be accessible to the application, maybe stored however the database credentials are.</p> <p>Has anyone implemented what I'm calling a verification cookie (<em>not</em> a persistent login cookie) and can tell me (us) how it was done?</p> <hr> <p>UPDATE: Thinking about this, what would I think be secure enough would be this: Cookie consists of userID and 128-bit random number -- call it R.</p> <p>Database contains password and R, each hashed and salted (e.g., using PhPass). R is then considered to be a second password. Benefit: Even if first password is bad (e.g., "password1"), R is a very good password. Database really can't be cracked, so it should not be a worry. (I was unnecessarily worried about it, I think.)</p>
0non-cybersec
Stackexchange
713
2,786
Friend [F/23] said she needed space, but instead of sticking with that she desperately keeps asking for my [M/24] attention.. EDIT: Update down below Hi, My friends strange behavior is pissing me off. We've been really close for over a year now, but recently she started acting really jealous towards other girls. Would get angry with me if I spoke to other girls, or when I was out and I mentioned that it'd have been nice to have her around also she'd make comments such as "you're lying, you don't want me around. I'm not as good as those people" which is utter bulls**t. I thought this behavior was kinda odd, especially for a girl who has a boyfriend and claims to be very happy in that relationship. She explicitely told me this when I confronted her with her behavior, because I mentioned that it seems as if she's into me. That maybe she should take a look at her behavior and perhaps her current relationship when she's telling someone else she loves him. Anyhow, now just last week we had a fall out over basically the same thing. I got angry, she got angry, kind of how it goes. I made it very clear that I doubted all of her claims because whatever she claims is the contrary of her behavior. This went on for a couple of days and in the end she told me that she "doesn't want to lose me, but needs space/room to breathe in order to think about what has been said to one another". Okay fair enough, I was kinda tired of it anyway and made my point of view very clear. That it's confusing and strange. I also didn't want to put our friendship at stake any longer so I figured that if some space was the solution, so be it. I went to bed and just didn't really think about it anymore. Not even ~~24~~ **8** hours into the "needing some space" she sent me a message saying "I kind of miss you". Okay, weird, so much for needing space. Figured I'd just go with it and because I didn't want to leave her hanging I responded with "I kind of miss you too" to which she just responded "Ooh okay". Weird weird weird. After work she called me because she wanted to tell me something, and we ended up talking for about 2 hours. This was pretty stupid on my end, I shouldn't have picked up. Again.. So much for "needing space". Today again, she's very obviously trying to have contact with me.. And where I was upset it had to be this way at first, I don't know.. I don't really miss it now. Reckon I should just tell her that my interpretation of "needing" space is like.. No talking and thinking about what it is you needed the space for, instead of asking for attention? TLDR - Had a fight with a friend, she said she needed space but keeps asking for my attention. **UPDATE** I messaged her about her behavior, that it confused me and that I didn't really know what to make of it. Her excuse for telling me that she missed me during a period of "needing space" was that even though we had a fight and things were said, she wanted to let me know that she missed me a little bit anyway. She sent this message by mail, because that'd be less personal than a text. Awkward. Furthermore I did what I should have done a while ago already.. Like some of you guys suggested, tell her how you feel. I did exactly this, pinpointed her behavior and why I believe that she's into me also. This was a mistake in a way because it led to the same fight we always have. Long story short: I was wrong, she has no feelings for me. She understood that her signals may have said otherwise but NOPE. I interpret everything she said the wrong way, her relationship is amazing. She also said that she doesn't know what to think of me now, where I stand and so on. Okay cool, I couldn't be any more skeptic about what she was saying at this point so I figured I'd just point out all the things that have been said, have happened and so on. That if her relationship is that pictureperfect, she should tell everything to her boyfriend and see what he has to say to her "there are no feelings" nonsense. She never responded. She promised that she was going to give me answers as to why she said those things and that she was going to explain her behavior. This is where it more or less ended. I suppose that I'm just going to take my own space and wait for her to explain her behavior, after this.. I'll let her off easy, even though we might be missing out as some of you said, it is for the best at this point.
0non-cybersec
Reddit
1,037
4,406
Username is not in the sudoers file. This incident will be reported. <p>I am running Ubuntu 12.04 on my laptop using VMware Player. I am not sure why but I have an account called &quot;User Account&quot; in addition to my account that I usually login to use Ubuntu. Well that was just a side comment but basically all I am trying to do is install the ncurses library on Ubuntu. I have tried installing ncurses using the following command lines:</p> <pre><code>sudo apt-get install libncurses5-dev sudo apt-get install ncurses-dev </code></pre> <p>When I tried installing ncurses twice using the above commands I received the following prompt in the terminal:</p> <pre><code>[sudo] password for username </code></pre> <p>When I type in my password I receive the following message:</p> <pre><code>username is not in the sudoers file. This incident will be reported. </code></pre> <p>So far I have tried enabling the root user (&quot;Super User&quot;) account by following the instructions at this link: <a href="https://help.ubuntu.com/community/RootSudo" rel="noreferrer">https://help.ubuntu.com/community/RootSudo</a></p> <p>Here are some of the things the link suggested to do:</p> <blockquote> <p>Allow an other user to run sudo. Type the following in the command line:</p> <p>sudo adduser username sudo</p> <p>Or</p> <p>sudo adduser username sudo</p> <p>logging in as another user. Type the following in the command line:</p> <p>sudo -i -u username</p> <p>Enabling the root account. Type the following in the command line:</p> <p>sudo -i</p> <p>Or</p> <p>sudo passwd root</p> </blockquote> <p>I have tried all of the above command lines and after typing in each command I was prompted for my password. After I entered my password I received the same message as when I tried to install ncurses:</p> <pre><code>fsolano is not in the sudoers file. This incident will be reported. </code></pre>
0non-cybersec
Stackexchange
546
1,894
Linux command line partition manager with LVM. <p>I need to write a program to format SD card with, FAT boot, ext4 and swap partitions. I would like the ext4 to use LVM. Ideally there would be scope for mdadm.</p> <p>I need help finding a command line utity which is capable of all this. I will be able to control any command from within my program. Would rather not cut &amp; paste source. </p> <p>I understand that Gparted does not cope well with LVM.<br> Any suggestions for a better command?</p>
0non-cybersec
Stackexchange
140
503
Create intermediate folders if one doesn&#39;t exist. <p>I am trying to create a folder for each username a user logs in as. Currently I have</p> <pre><code>private String destination = "C:/Users/Richard/printing~subversion/fileupload/web/WEB-INF/uploaded/"; // main location for uploads File theFile = new File(destination + username); // will create a sub folder for each user </code></pre> <p>but the <code>File theFile</code> bit does not create a new folder for the username. How would I do this ?</p> <p>I have tried </p> <pre><code>private String destination; public void File() { destination = "C:/Users/Richard/printing~subversion/fileupload/web/WEB-INF/uploaded/"; // main location for uploads File theFile = new File(destination + username); // will create a sub folder for each user (currently does not work, below hopefully is a solution) theFile.mkdirs(); } </code></pre> <p>but I need to use the destination later on in the program, how would I do that?</p> <p>This is my whole code:</p> <pre><code>/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package richard.fileupload; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import java.io.File; import org.primefaces.event.FileUploadEvent; @ViewScoped @ManagedBean(name = "fileUploadController") public class FileUploadController { /* public void handleFileUpload(FileUploadEvent event) { System.out.println("called"); FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded."); FacesContext.getCurrentInstance().addMessage(null, msg); } } */ private String username; private String destination; @PostConstruct public void init() { System.out.println("called get username"); username = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser(); } public void File() { destination = "C:/Users/Richard/printing~subversion/fileupload/web/WEB-INF/uploaded/"; // main location for uploads File theFile = new File(destination + username); // will create a sub folder for each user (currently does not work, below hopefully is a solution) theFile.mkdirs(); } public File getDirectory(String destination, String username) { System.out.println("called get directory"); // currently not working, is not calling the username or destination //set the user directory from the destinarion and the logged user name File directory = new File(destination, username); //check if the location exists if (!directory.exists()) { //let's try to create it try { directory.mkdir(); } catch (SecurityException secEx) { //handle the exception secEx.printStackTrace(System.out); directory = null; } } return directory; } public void handleFileUpload(FileUploadEvent event) { System.out.println("called handle file"); FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded."); //Displays to user on the webpage FacesContext.getCurrentInstance().addMessage(null, msg); try { copyFile(event.getFile().getFileName(), event.getFile().getInputstream()); } catch (IOException e) { //handle the exception e.printStackTrace(); } } public void copyFile(String fileName, InputStream in) { try { // write the inputStream to a FileOutputStream OutputStream out = new FileOutputStream(new File(destination + fileName)); // cannot find path when adding username atm System.out.println("Called CopyFile"); //testing System.out.println(destination + fileName); int read = 0; byte[] bytes = new byte[1024]; while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } in.close(); out.flush(); out.close(); //make sure new file is created, (displays in glassfish server console not to end user) System.out.println("New file created!");//testing } catch (IOException e) { e.printStackTrace(); FacesMessage error = new FacesMessage("The files were not uploaded!"); FacesContext.getCurrentInstance().addMessage(null, error); } } } </code></pre> <p>FINAL EDIT (Hopefully)</p> <pre><code> public void copyFile(String fileName, InputStream in) { try { destination = "C:/Users/Richard/printing~subversion/fileupload/web/WEB-INF/uploaded/"; // main location for uploads File theFile = new File(destination + "/" + username); theFile.mkdirs();// will create a sub folder for each user (currently does not work, below hopefully is a solution) (DOES NOW WORK) System.out.println("Completed File"); // write the inputStream to a FileOutputStream OutputStream out = new FileOutputStream(new File(destination + fileName)); // cannot find path when adding username atm System.out.println("Called CopyFile"); //testing System.out.println(destination + fileName); int read = 0; byte[] bytes = new byte[1024]; while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } in.close(); out.flush(); out.close(); //make sure new file is created, (displays in glassfish server console not to end user) System.out.println("New file created!");//testing } catch (IOException e) { e.printStackTrace(); FacesMessage error = new FacesMessage("The files were not uploaded!"); FacesContext.getCurrentInstance().addMessage(null, error); } } } </code></pre> <p>Just how can i print out the new destination and use this later on as currently it creates the new folder but does not select it to use</p> <p>EDIT SOLVED THIS TOO :</p> <pre><code> NewDestination = "C:/Users/Richard/printing~subversion/fileupload/web/WEB-INF/uploaded/" + username; </code></pre> <p>Added the above code and now it all works</p>
0non-cybersec
Stackexchange
1,782
6,790
Declare CSS style outside the &quot;HEAD&quot; element of an &quot;HTML&quot; page?. <p>my use-case is the following :</p> <p>I'm composing an <strong>HTML page</strong> by using parts that are <strong>valid HTML fragments</strong> but not valid pages, like <strong>Divs</strong>; these elements are using <strong>CSS</strong> to manage their style.</p> <p>I'd like to allow each fragment to be responsible for its own styling requirements and to not rely on the declarations of style-sheets in the main fragment (the one with the "HTML" tag).</p> <p>So here come the question : <strong>is there any (standard) way to add some CSS styling outside the HEAD element</strong> (excluding the inline styling via the "style" attribute) ?</p> <p>I guess I could use frames but I'd prefer to avoid this solution.</p> <p>Thanks in advance for your help.</p> <p><strong>FINAL EDIT :</strong></p> <p>Thanks to the propositions of <strong><em>zzzzBov</em></strong>, <strong><em>JMC Creative</em></strong> and <strong><em>moontear</em></strong>, and after some testing, here is the answer :</p> <ul> <li>use <strong>JavaScript to dynamically load some CSS style-sheets</strong> : <strong>HTML4/XHTML</strong> and <strong>HTML5 compliant</strong>,</li> <li><strong>embed "style" elements</strong> directly inside the fragments : <strong>non-compliant</strong> with <strong>HTML4/XHTML</strong> but seems to be <strong>broadly supported</strong>, and is <strong>HTML5 compliant</strong>.</li> </ul> <p>As I must support email clients I've used the second solution which moreover is more simple.</p> <p>Thanks all for your interest and participation.</p>
0non-cybersec
Stackexchange
485
1,649
$‎\Delta ‎^2(.)-‎\frac{‎‎\lambda‎‎}{|x|^4}(.): W^{2,2}(\Omega) \cap W^{1,2}_0(\Omega) \to W_0^{-2,2}(\Omega) ‎$ is coercive.. <p>I am reading an article and there, author claim that $$‎L(.)=\Delta ‎^2(.)-‎\frac{‎‎\lambda‎‎}{|x|^4}(.): W^{2,2}(\Omega) \cap W^{1,2}_0(\Omega) \to W_0^{-2,2}(\Omega) ‎$$ is coercive if ‎‎$ ‎0\leq ‎‎\lambda&lt;\Lambda_N=(‎\frac{N^2(N-4)^2}{16})‎$ , because of the following inequality:</p> <blockquote> <p>For all ‎‎‎$ u‎ ‎\in‎ W^{2,2}(\Omega) \cap W^{1,2}_0(\Omega) $ و ‎‎$‎N&gt;4‎$‎‎ ‎ $$ ‎\Lambda_N ‎\int_{\Omega}‎\frac{u^2}{|x|^4}\mathrm{d}x ‎\leq ‎\int_{\Omega} ‎|\Delta u|^2 ‎\mathrm{d}x‎ $$ where $‎\Lambda_N=(‎\frac{N^2(N-4)^2}{16})‎$ is optimal constant.</p> </blockquote> <p>My question is this that how the inequality with the optimal constant conclude that operator is coercive for ‎‎$ ‎0\leq ‎‎\lambda&lt;\Lambda_N=(‎\frac{N^2(N-4)^2}{16})‎$.</p> <p>my try:</p> <p>the norm on the hilbet space $\mathbb{H}=W^{2,2}(\Omega) \cap W^{1,2}_0(\Omega)$ is $$\langle u,v\rangle_{‎\mathbb{‎‎H}}=\int_{\Omega} \Delta u \Delta v dx$$</p> <p>I must show that $$\langle Lu,u \rangle_{\mathbb H} \geq c ||u||_{\mathbb H}^2 $$ for a positive constant $c$.</p> <p>with simple calculations and using above inequality, I have showed that $$\langle Lu,u \rangle_{L^2} \geq c ||\Delta u||_{L^2}=c||u||_{\mathbb H}^2 $$ for a positive $ c $ </p> <p>but I must show that $$\langle Lu,u \rangle_{\mathbb H} \geq c||u||_{\mathbb H}^2 $$ .</p>
0non-cybersec
Stackexchange
698
1,482
My friend dissmisses certain claims by famous scientists because "they have been wrong before"... help me understand why he is approaching this the wrong way?. I understand that everyone is wrong at some point. I also understand that it is important to be skeptical of someones claims, even if they are famous, and a genius, but that isn't what he is doing. He is dissmissing their claims, and using a past failing of theirs as a justification only because he doesn't like what they are saying. (read: stephen hawkings recent article on god and the cosmos) I suppose my stance on it is that his justification that hawking was wrong before is ad hominem, but i wanted to see if you guys had anything else to add. thanks!
0non-cybersec
Reddit
161
722
How to find out the difference between a structured and unstructured mesh using the file containing the mesh information?. <p>I have two different mesh files (both are .inp files obtained from Abaqus) that represent the exact same geometries with the same boundary conditions, etc. The only difference is that one of them is meshed in a structured fashion and the other one is meshed in an unstructured way.</p> <p>Now here is my question, how do I find out which file contains the structured mesh and which one contains the unstructured one? Of course, I mean apart from visualizing the files and trying to zoom in on the meshes and see if they look structured or unstructured. </p> <p>What should I do in such situation in general? What is the "scientific" way to figure out the answer and avoid visualizing the mesh? </p>
0non-cybersec
Stackexchange
191
827
Chevron Symbols in Commutator. <p>I am reading a chapter on Commutator in Group Theory and came across chevron symbols "$\langle$" and "$\rangle$" like these:</p> <blockquote> <p><strong>Question #1:</strong> Let $E$ and $F$ be non-empty subsets of $G$, we set $$[E, F] := \langle [e,f] \mid e \in F, f \in F \rangle.$$</p> </blockquote> <p>Correct me if I am wrong here: The chevron symbols here do not have special meaning except that they are differentiating from "$\{$" and "$\}.$" The text does not give any explanation.</p> <p>And then on the same page I saw this problem:</p> <blockquote> <p><strong>Question #2:</strong> Let $H$ be a subgroup of $G.$ Show that $[H, g] = [H, \langle g \rangle]$ for each element $g$ in $G.$</p> </blockquote> <p>Here the chevron signs have special meaning, they refer to $g$ as generator. If I am correct, how do you go about solving this problem? My understanding that I have to start from the LHS, without assuming that $g$ is a generator. Please help and thanks for your time.</p> <p><strong>POST SCRIPT - 1:</strong> ~~~~~~~~~~~~~~~~~~~~~~ <BR/> I am following hints from "someone you know" in solving Question #2 like these: <br/></p> <p>$$\begin{align*}[H,g] &amp;= \{hgh^{-1}g^{-1} \mid h \in H \}\\ &amp;= \{hg (g^{n-1})(g^{n-1})^{-1}h^{-1}g^{-1} \mid h \in H \} \\ &amp;= \{h(g g^{n-1})(g^{n-1})^{-1}h^{-1}g^{-1} \mid h \in H \} \\ &amp;= \{hg^n(g^{n-1})^{-1}h^{-1}g^{-1} \mid h \in H \} \\ &amp;= ... \\ &amp;= ... \\ &amp;= [H, \langle g \rangle] \end{align*}\\$$</p> <p>How do you go from the 4th. line to the next to move the $(g^n)^{-1}$ to the right side of $h^{-1}$ without resorting to the group being abelian? Thank you again.</p> <p><strong>POST SCRIPT - 2:</strong> ~~~~~~~~~~~~~~~~~~~~~~ <BR/> Since I did not receive any feedback after the Post Script - 1, and since on the subsequent pages of the same class note I saw a very similar question like this:</p> <blockquote> <p>Let $G$ be a group and let $g \in G,$ and let $N$ be commutative normal subgroup of $G.$ Show that $[N, \langle g \rangle] = \{[n, g] \} \mid n \in N \}.$ </p> </blockquote> <p>Do you agree with me that there is actually a typo in the Question #2, in that $G$ and therefore $H$ should be declared as commutative in the first place? Thanks for your time and feedback.</p>
0non-cybersec
Stackexchange
801
2,329
Controlling several raspberry pis from one location.. I am a member of a volunteer rescue team in Iceland. We are opening new headquarters in the coming weeks which will have several information monitors around the station. I am thinking of using raspberry pi with a monitor to show various operation information on a local web site. This should be relatively easy. Each monitor will be on a wall, without keyboard and mouse. What I need is to be able to swap between pages easily on some/all monitors. For example swap from operation information to weather forecast. Is there any tool that makes this easy?
0non-cybersec
Reddit
130
612
Counting elements of $\Bbb{Z}/2\Bbb{Z}(\alpha)$. <p>I have the field $K=\Bbb{Z}/2\Bbb{Z}$, I proved that the polynomial $P(X)=X^3+X^2+1$ is irreducible. Then I know that the quotient $K[X]/P$ is a field of $8$ elements. Let now $\alpha$ be a root in an extension of $K$, as $\alpha$ is algrebaic, we have $K[\alpha]$ isomorphic to $K(\alpha)$.</p> <blockquote> <p>It's asking to enumerate elements of $K(\alpha)$</p> </blockquote> <p>How can I do that ?</p>
0non-cybersec
Stackexchange
175
463
JavaScript event handler arguments. <p>I have the following JavaScript code:</p> <pre><code>var ans_el = document.createElement( 'input' ); ans_el.setAttribute( 'id', unique_int_value ); ans_el.setAttribute( 'type', 'radio' ); ans_el.setAttribute( 'name', 'group' ); ans_el.setAttribute( 'value', 'myValue' ); ans_el.onclick = myFunction( this.id, this.value ); // Add ans_el to DOM. function myFunction( index, value ) { // do something } </code></pre> <p>This, of course, does not work as expected. At least not in Firefox 3.6. What happens is the <em>onclick</em> event is fired when the element is created and the arguments passed to <em>myFunction</em> are null. After the element is added to the DOM, the <em>onclick</em> event does not fire when the radio button is select. </p> <p>I'd be grateful if anyone has some insight into what's happening here, and/or how dynamically adding event handlers can be accomplished.</p>
0non-cybersec
Stackexchange
282
938
How to approximate a function in the limit $|x| &lt;&lt; 1.$ Leading term and order of error?. <p>So basically I'm doing my first year of a natural sciences undergraduate course, and I came up against this series of questions. </p> <p>"Approximate the following functions in the limit $|x| &lt;&lt; 1.$ In each case give the leading term and order of the error." </p> <p>So, how would I go about doing that, for instance with the function: $$f(X)=\frac{X^3+X}{X+8} ?$$ I could tell you that as $x\to 0$ this function $f(X) \to 0,$ but that's about it. </p> <p>I think my biggest problem is that I'm not actually sure what it means by 'leading term' and 'order of error'. </p> <p>I've met big O notation briefly, it was explained as "$\lim_{x \to a} f(x) = O(g(x))$ if $f(x)$ and $g(x)$ look the same around a."</p> <p>I assume it relates to that, but I can find nothing among my lecture notes nor on Google as to what this question actually wants from me, so if somebody could explain, that would be great! Thanks!</p>
0non-cybersec
Stackexchange
314
1,025
10 Tips On How To Use Extreme Wide Angle Lenses for Landscape Photography. 10 Tips on how to use extreme wide angle lenses for landscape photography by Albert Dros As a landscape photographer I love extreme wide angle lenses. I use my 16-35 for 90% of my photos and I mostly use it at 16mm. When I give lectures about photography I often hear people saying they have trouble with using extreme wide angle uses just because they are ‘so wide’ (doh). Wide angle lenses require a different approach then your kit lens to get the most out of them. Here are 10 tips on how to use/start using an extreme wide angle lens for landscape photography: 1. When first starting out with wide angle lenses, Instead of using your eyes to look at the scene, use the camera/viewfinder. Keep watching through the viewfinder/live view while holding your camera close to you and see the effect you’re creating. Foregrounds are extremely important when using wide angle lenses. Even very small things like a little rock or plant can appear much bigger in comparison to the background on your photo. 2. That immediately brings me to the next tip: When you see an epic backdrop, look around for small things on the ground that you can point your lens at. The trick is to not get overwhelmed by an epic mountain or waterfall as they will appear rather small on your final photo. Look at the small things around you to include them in the photo. 3. Use low apertures (high f-stop numbers) around f14-f16 to get as much into focus as possible. This is especially important when you’re close up to a foreground. try not to close your lens too much (f18-f22) as this will decrease image quality. 4. Use a technique called ‘focus stacking’ when you can’t get everything into focus in 1 shot. With this technique you shoot different photos with different focus points and merge them later in Photoshop (rather simple technique, easy to find on google) 5. Don’t underestimate the wideness of your lens. When you’re just starting out using extreme wide angles you notice you can almost fit anything in your frame, often way too much. Experience shooting the same subject with different distances. When you’re hiking to a mountain for example, shoot at different times during your hike and see how this affects the distance between the foreground and backdrop. 6. Small lines and textures on the ground appear huge on your foreground when you hold your camera very low to the ground. Try it out. 7. The height of which your camera is set makes a great differences when using very wide angle lenses. Experience shooting the same scene at different heights. The higher you hold your camera from the ground, the more you point the camera down to include more foreground. 8. Know that a super small change of position, tilt, or pan from your camera makes a huge impact on the image. When I have a good scene in mind I always spend quite some time walking around objects to get them in perfect position of the frame. 9. Extreme wide angle lenses can create quite some distortion some times. They often make the sky look distorted and the clouds pointing to the middle. You can use this to your advantage. Experiment with a half land/half sky composition (instead of the general rule of thirds) when the sky asks for it. 10. Pay close attention to the corners in your frame, especially the bottom 2 corners. Try to get objects or lines leading into the image close to the corners. This is not a tip for only wide angle lenses. You want to indirectly lead the viewer into your image. some examples: https://www.flickr.com/photos/albertdros/34917206910/in/dateposted-public/ https://www.flickr.com/photos/albertdros/34158633355/in/dateposted-public/ https://www.flickr.com/photos/albertdros/26207441546/in/dateposted-public/ https://www.flickr.com/photos/albertdros/30005303871/in/dateposted-public/ Pretty simple stuff for most of us probably, but these might be useful for people just starting out with extreme wide angle lenses :) Feel free to add stuff!
0non-cybersec
Reddit
935
4,035
Screen Sharing icon on login screen. <p>I noticed the Screen Sharing icon when logging in despite it being disabled on my computer. After logging in, it didn't appear in the menu bar.</p> <p><a href="https://i.stack.imgur.com/6XfSo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6XfSo.png" alt="The Screen Sharing icon, on the login screen"></a></p> <p>What could be causing it? I tried enabling and disabling it via the command line but it persists.</p> <pre><code># Enable Screen Sharing sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist # Disable Screen Sharing sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist </code></pre> <p>I tried looking for solutions but only found confirmation that this is indeed the Screen Sharing icon.</p> <p><a href="https://apple.stackexchange.com/questions/218798/what-are-the-overlapping-squares-icon-in-status-menu-on-login-screen">What are the &quot;Overlapping Squares&quot; icon in status menu on login screen?</a></p>
0non-cybersec
Stackexchange
332
1,054
difference between linear, semilinear and quasiliner PDE&#39;s. <p>I know a PDE is linear when the dependent variable $u$ and its derivatives appear only to the first power. So, $u_t + u_x +5u = 1$ would be linear. However, I do not quite understand the other two. </p> <p>My professor described "semilinear" PDE's as PDE's whose highest order terms are linear, and "quasilinear" PDE's as PDE's whose highest order terms appear only as individual terms multiplied by lower order terms. No examples were provided, only equivalent statements involving sums and multiindeces which I do not think I could decipher by tomorrow. </p> <p>Can someone provide some examples of "semilinear" and "quasilinear" PDE's?</p>
0non-cybersec
Stackexchange
190
717
Cannot add ANY new ppa on ubuntu 10.04. <p>this is an example:</p> <pre><code>add-apt-repository ppa:libreoffice/ppa gpg: keyring `/tmp/tmpEVJtjw/secring.gpg' created gpg: keyring `/tmp/tmpEVJtjw/pubring.gpg' created gpg: requesting key 1378B444 from hkp server keyserver.ubuntu.com gpg: /tmp/tmpEVJtjw/trustdb.gpg: trustdb created gpg: key 1378B444: public key "Launchpad PPA for LibreOffice Packaging" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK </code></pre> <p>The problem is: when i try to install LibreOffice it says:</p> <pre><code>$ apt-get install LibreOffice Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package LibreOffice </code></pre> <p>I have the same problem with almost every apps!! how can i fix this? Many Thx </p>
0non-cybersec
Stackexchange
309
899
On the subject of gym creeps: I'm sure you have similar stories, and how'd it turn out?. There's a guy that recently started coming in to our small gym. He seemed a little off at first, but was friendly and made small talk with my wife and I. It didn't take long for the creepiness to start though. When my wife is doing something like squats or working her hamstrings on a machine he'll come over and say "That's a really good exercise for her to do!" And she says that she's caught him staring at her with this really creepy look multiple times. I've also noticed that he doesn't talk to anyone else in the gym unless there is a female involved. He barely works out. He just does things like hangs on the pullup bar, swings around for a bit and then extravagantly jumps off. I'm not really a confrontational person so I ended up just telling the dude at the front desk. He said that this isn't the first time someone has complained about the guy and he'd be leaving a note for the owner. I feel bad because this guy may just be completely socially inept and not know what he's doing, but I really don't want to spend the entire time I'm at the gym dodging him (which is very hard to do in the first place) and having my wife be entirely uncomfortable doing whatever workouts she wants. Should I have talked to him myself?
0non-cybersec
Reddit
304
1,326
I am getting this error : &quot;Error 102 : non-boolean type specified in a context where a condition is expected&quot; for this request :. <pre><code>private void button2_Click(object sender, EventArgs e) { con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = &quot;delete from MYDB where First name='&quot; + first.Text + &quot;'&quot;; cmd.ExecuteNonQuery(); con.Close(); disp_data(); MessageBox.Show(&quot;Contact deleted successfully&quot;); } </code></pre>
0non-cybersec
Stackexchange
163
546
how to get iframe to fill entire page 100% and top:4px?. <p>I've been coming here for a while, and only asked 1 question before. And I have designed many sites. But the only thing I do not fully get is 'iFrames'. They mess with my head a tad bit.</p> <p>.:What i'm trying to achieve:.</p> <p><strong><em>note: I do not have ownership of the origin of the iFrames domain... It should be irrelevant since you are simply taking one page, and showing it on another. Their External Styling still shows their page how it should. I know this because i've done it.</em></strong></p> <p>1) I need to know how to get the iFrame to show on my site as a FULL PAGE. I know there are ALOT of topics on here about iFrames, but 1) they are outdated. 2) they do not apply to me/my site. I've tried everything, and yet it all seems futile.</p> <p>.:Example:.</p> <p>When user(s) go to <a href="http://www.example.com/news.php" rel="noreferrer">http://www.example.com/news.php</a>, the page should load the content from another news site. i.e cnn, wn, cbs...</p> <p>I have figured this out before, so please no1 tell me all that rubble about not having ownership of contents, then I cannot reach my goal.</p> <p>I don't remember how I wrote it, but I know there was NO CSS styling whatsoever. It was something VERY similar to:</p> <pre><code> &lt;body style="scrolling:no;&gt; &lt;iframe src='http://www.example.com' style='position:absolute; top:4px; left:0px; width:100%; height:100%; z-index:999' onload='sendParams();' frameborder='no' scrolling='auto'&gt; &lt;/iframe&gt; &lt;/body&gt; </code></pre> <p>What I am not getting is: No matter what style I use to customize the iFrame, it seems to be held within a box about the <code>size= 867x155</code>. I even tried to put the iFrame itself within a <code>DIV</code>, and <code>DIV</code> set to: W- <code>100%</code> H- <code>100%</code>.</p> <p>when I tried the CSS approach, the marginheight/width was ignored. Also, a different body style of <code>margin="0"</code>, was futile; yet again.</p>
0non-cybersec
Stackexchange
647
2,071
$g(x)=\int_{0}^x f(t)dt$, Is $g$ bounded and monotone?. <p>Let <span class="math-container">$f$</span> be a continuous real valued function defined on <span class="math-container">$[0,1]$</span> such that <span class="math-container">$f(t)\geq 0$</span>. </p> <p>Let <span class="math-container">$$g(x)=\int_{0}^x f(t)dt$$</span></p> <p>True/False: <span class="math-container">$g$</span> is bounded and monotone. </p> <p>Efforts: </p> <p>I considered taking the modulus </p> <p><span class="math-container">$|g(x)|\leq \int_{0}^x|f(t)|dt$</span></p> <p>Now <span class="math-container">$f$</span> is continuous function on a compact interval, hence it is bounded. Therefore <span class="math-container">$g$</span> is also bounded. </p> <p>For the monotone part, I used Leibniz Integral rule. Note that <span class="math-container">$g'(x)=f(x)$</span> and <span class="math-container">$f$</span> is positive. Therefore it follows that <span class="math-container">$g$</span> is monotone.</p> <p>Am I using the right ideas? I know I have to fill in the details. </p> <p>Thanks in advance.</p>
0non-cybersec
Stackexchange
397
1,103
how is the concatenate dog utility installed?. <p>Where is the repo to install <a href="https://mydevelopedworld.wordpress.com/2012/06/30/linux-when-a-dog-is-better-than-a-cat/" rel="nofollow noreferrer">dog</a>?</p> <blockquote> <p>To get the command on Ubuntu you can just open a terminal and type:</p> <p>sudo apt-get install dog</p> <p>After the installation you can retrieve all the information you need about dog...</p> </blockquote> <p>I get:</p> <pre><code>thufir@doge:~$ thufir@doge:~$ sudo apt-get install dog Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package dog thufir@doge:~$ thufir@doge:~$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS" thufir@doge:~$ </code></pre> <p>Just that it's the antagonist to <code>cat</code> makes it interesting.</p> <p>My repos:</p> <pre><code>thufir@doge:~$ thufir@doge:~$ cat /etc/apt/sources.list # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://archive.ubuntu.com/ubuntu xenial main restricted # deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted # deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://archive.ubuntu.com/ubuntu xenial universe # deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial universe deb http://archive.ubuntu.com/ubuntu xenial-updates universe # deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://archive.ubuntu.com/ubuntu xenial multiverse # deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial multiverse deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse # deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse # deb-src http://ca.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu xenial partner # deb-src http://archive.canonical.com/ubuntu xenial partner deb http://archive.ubuntu.com/ubuntu xenial-security main restricted # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted deb http://archive.ubuntu.com/ubuntu xenial-security universe # deb-src http://security.ubuntu.com/ubuntu xenial-security universe deb http://archive.ubuntu.com/ubuntu xenial-security multiverse # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse deb http://ag-projects.com/ubuntu xenial main deb-src http://ag-projects.com/ubuntu xenial main thufir@doge:~$ thufir@doge:~$ ls cat /etc/apt/sources.list.d/ ls: cannot access 'cat': No such file or directory /etc/apt/sources.list.d/: google-cloud-sdk.list ring-nightly-man.list webupd8team-ubuntu-java-xenial.list.save jitsi.list webupd8team-ubuntu-java-xenial.list thufir@doge:~$ </code></pre>
0non-cybersec
Stackexchange
1,330
4,424
Using Ordinal Notations in Computability Theory Is There A Standard Notation For The Notations Below $\alpha$. <p>I find I frequently have to refer to the set of ordinal notations below some given notation. For instance given a notation $\alpha$ I often need to refer to the set $\lbrace \beta \mid \beta &lt;^{\mathcal{O}}_s \alpha\rbrace$. Higher Recursion Theory simply writes such sets as $W_{g(\alpha), s}$ (where $g$ is the appropriate computable function) but this isn't very helpful when writing a paper.</p> <p>I find that when one is working with constructions occurring at infinite ordinal levels (say in $\alpha$-REA sets) these sets pop up everywhere and without a specific notation for them it is unwieldy to refer to them or specify properties of the enumeration. </p> <p>Is there a standard notation for what I'm looking for? If not any suggestions?</p> <p>How about $\mathcal{O}_{&lt; \alpha, s}$, i.e., the part of Kleene's O below $\alpha$? Writing out $\mathcal{O}\restriction_{&lt; \alpha, s}$, while correct, seems confusing as it's not obvious what set the stage subscript refers to.</p> <p>I want to settle on something so I can put it in the next version of my recursion theory latex package.</p>
0non-cybersec
Stackexchange
322
1,229
Why this C++ type deduction is allowed. <p>I encountered some production code which made me wonder why it compiled. I've distilled it down to the following.</p> <p>I compiled it with gcc 6.4.1 and 8.1 along with a couple of other online compilers and they all report no errors.</p> <pre><code>struct Y { }; struct X { using XY = Y; }; struct VZ { virtual void f( X::X::XY xy ) = 0; }; struct Z : public VZ { virtual void f( X::XY xy ) override {} }; int main( int c, char *v[] ) { } </code></pre> <p>Notice that the pure virtual is declared with what looks like an incorrect type (X::X::XY). It also make no difference how many X:: I prepend the type with, it still compiles.</p> <p>I suspect that it may be a simple parser issue but not sure. </p>
0non-cybersec
Stackexchange
251
769
[AMA Request] One of the NHL officials who presided over the March 26, 1997 "Brawl in Hockeytown", which saw 9 separate play stoppages due to fighting, and one of the best goalie fights of all time.. **My 5 Questions:** 1. What is something you saw on the ice that night that the T.V. audience didn't or couldn't see? 2. It's sometimes easy to forget that the officials almost always need to stop the fight once the risk of injury grows too significant. How do you go about breaking up fights? Were any of the officials hurt during that game? 3. Fighting is a very controversial part of NHL Hockey. Are you for or against fighting in Hockey? What is your opinion of the argument that fighting actually makes Hockey safer? 4. Later in his career, Brendan Shanahan (the guy who did a full-speed body check on Patrick Roy during that game, and also the only NHL player ever with over 600 goals AND 2000 penalty minutes) later became president of the NHL's office of player safety. What are your thoughts on Shanahan's transition? 5. If you could do that night over again, would you change anything? *PSA: Patrick Roy's last name is pronounced "Wah".*
0non-cybersec
Reddit
277
1,153
Should I try to separate state from implementation?. <p>Right now I'm working with some code that combines state and operations.</p> <p>It looks something like this (note: doesn't actually deal with Cars/Trucks. I'm abstracting the business logic here, and apologize in advance that the analogy doesn't entirely make sense)</p> <pre class="lang-cpp prettyprint-override"><code>TruckImpl { // Fields/Properties int Mileage bool MissionAccomplished // ... and many, many more // Constructor TruckImpl TruckImpl(IRentalAgreement agreement) // methods void Drive() { // Sets a whole bunch of fields/properties which are subsequently used to make decisions in Park() GetCarFromDealer() Haul() } void GetCarFromDealer() void Haul() // Return to rental company if done, otherwise park at home void Park() } CarImpl { // Fields int Mileage bool MissionAccomplished // Constructor CarImpl CarImpl(IRentalAgreement agreement) // methods // Sets a whole bunch of fields/properties which are subsequently used to make decisions in Park() void Drive() { // Sets a whole bunch of fields/properties which are subsequently used to make decisions in Park() GetCarFromDealer() Race() } void GetCarFromDealer() void Race() // Return to rental company if done, otherwise park at home void Park() } </code></pre> <p>It's used in some code that looks similar to the following pseudocode:</p> <pre class="lang-cpp prettyprint-override"><code>RentalVehicleHandler { IVehicleImplFactory factory; Handle(IRentalAgreement agreement) { impl = factory.Create(agreement) impl.Drive() impl.Park() } } Main() { while(true) { var agreements = GetAgreements(); foreach(var agreement in agreements) { handler.Handle(agreement) } } </code></pre> <p>In the above code, we're getting batches of "RentalAgreements", but still processing each of them individually. Now, I want to handle Cars and Trucks slightly separately. For Trucks, I will still Drive() then Park() each individually. For Cars, I want to GetCarFromDealer() individually, but then Race() the entire batch of cars at once before Parking them. I might want to do something similar for Trucks in the future, but maybe not.</p> <p>I thought that it would be helpful to separate my state from my implementation like below: (to start, no batching-related stuff added yet):</p> <pre class="lang-cpp prettyprint-override"><code>// One per rental agreement RentalVehicle { #Properties RentalAgreement agreement int Mileage bool MissionAccomplished //(...all of the TruckImpl propertiies?) } // Can handle any number of RentalAgreements, maybe multiple CarDriver { RentalVehicle Drive(RentalVehicle vehicle) RentalVehicle Park(RentalVehicle vehicle) } TruckDriver { RentalVehicle Drive(RentalVehicle vehicle) RentalVehicle Park(RentalVehicle vehicle) } </code></pre> <p>Is this a helpful/reasonable thing to do? Or is it just a bunch of extra work that will gain me no advantage? I think it will help me both with the problem at hand and help me with further refactoring, but I've also tried a few other things that were dead-ends and I don't want to spend a bunch of time refactoring this for no reason.</p>
0non-cybersec
Stackexchange
923
3,408
Representing operations in reverse Polish notation/postfix that return multiple values. <p>I'm working on a recipe definition language which uses operands ("milk", "eggs"), unary operators ("slice", "chop"), and binary operators ("combine", "fold in"). To avoid ambiguity, I've decided to use postfix/reverse Polish notation, so an example simple recipe would look as follows:</p> <pre><code>* eggs, 3 =beat * cream, 1 Tbsp /add * salt /add * pepper /add =cook, over medium heat =stir </code></pre> <p>Operands would be *, = are unary operators, / represent binary operators.</p> <p>Now, I'm facing a issue with recipe steps that require splitting ingredients in order to perform different operations on them. An example could be beating eggs together, and then using half now for a batter, and the rest later on for brushing the cake with. An idea I have would be an operator that splits an operand into multiple portions.</p> <p>Is this something that is theoretically possible in RPN? Even if so, are there any kinds of recipes that couldn't be represented if I do this (for example, each of the split elements is processed separately and only recombined much further down the line)?</p>
0non-cybersec
Stackexchange
295
1,195
Fresh install of Windows keeps freezing. <p>I got a computer from a friend who said he got some viruses and that he didn't have the time to fix it. I decided to just reformat and do a fresh install. Windows 7 installed fine but after booting in, it would freeze every twenty minutes or so and I would have to reboot.</p> <p>I thought maybe I messed up installing something so I reinstalled it. Still froze. I put in a Debian LiveCD I had lying around and that worked fine. Booted back into Win7, but safe mode this time, and that worked fine as well.</p> <p>Any ideas?</p>
0non-cybersec
Stackexchange
148
575
Proof of inequalities. <p>I am having trouble with the following exercise:</p> <hr> <p>Let $p$ and $n$ denote positive integers. Use the formula $$b^p - a^p = (b-a)(b^{p-1}+b^{p-2}a + \cdots +ba^{p-2} + a^{p-1})$$ to show that $$n^p &lt; \frac{(n+1)^{p+1}-n^{p+1}}{p+1} &lt; (n+1)^p.$$</p> <hr> <p>I've been trying to find a proof of the inequalities above but every time I am getting stucked with the term $(p+1)$ in the denominator. Could you please provide a hint about that or complete proof?</p>
0non-cybersec
Stackexchange
191
505
Pidgin &amp; Lync - Some buddies are not recognized. <p>I'm running RHEL 6 and using Pidgin to connect to the corporate Lync server. Overall it works quite well. My problem is that, apparently randomly, some of my 'buddies' are not properly looked up from the Lync server. In most cases I can add a new buddy by using their email address. Pidgin then goes and looks up all kinds of details, including name and status. For a small handful of people who I attempt to add as a buddy, none of that happens. I get no status or name, and the person is just listed in my buddy list as 'sip:their_email@our_company.com'. I can delete the buddy and re-add always with the same result.</p> <p>I'm just wondering if anyone else has seen this and/or has any suggestions.</p>
0non-cybersec
Stackexchange
208
771
TIFU: I peed and vomited in the back of my friend's car then broke my house door down because I couldn't work the key.. It probably had something to do with the handle of whiskey I'd been working on. A few friends from work and I were heading downtown to check out a few bars and to save money, I brought along a bottle of Crown Royal so we'd already feel good when we got there. Well, it seems the ride was longer than I'd anticipated and we finished the bottle before we even arrived, and I was completely blacked out. That's when the vomit started flying, purple shit and spaghetti everywhere. I started yelling, screaming, and trying to get out of the car in the middle of traffic. I guess I had to pee and was looking for somewhere to go. When they wouldn't let me out, I unzipped my pants, whipped it out, and peed all over the back seat. By now the night was ruined, so my buddies just took me home and dropped me off, but I was too drunk to stick the key in the door to get in. So I called my sister, who was out with her friends, to come help me get inside. That's when I saw that my girlfriend had been texting me and calling me all night and she was freaking out, so I tried to text her but all I could manage to write is "baby this isnt whats happning right slihg whatodhff notg hslhggshjc." So then I called her, but that was a bad idea. I was mad because I couldn't get in, and I transferred my anger over to her, screaming "YOU'RE NOT MY GIRLFRIEND, FUCK YOU, JESUS FUCKING CHRIST YOU BITCH!!" She said she's never heard anyone yell at her like that, except maybe her dad. I kept yelling for a while, while she cried, and I eventually hung up on her. I went around to the back door to see if I could get in that way, but it was locked too. This made me even more frustrated and I ripped the sliding screen door right out. I guess my sister finally got there and let me in because I woke up in my own bed this morning. My belt, the bottle, and miscellaneous items from my pockets were strewn throughout the yard. But the worst part, the *worst part* was the texts I woke up to from my girlfriend: Her: Don't you call me at all tomorrow. Her: I can't believe you you're a monster. Her: I'm crying so much right now Her: You are so drunk right now I can't believe you just go away. Her: Goodnight.
0non-cybersec
Reddit
591
2,316
How to prove complex identity?. <p>I proved that $z^6+z^3+1 = (z^2-2z\cos(\frac{2π}{9})+1)(z^2-2z\cos(\frac{4π}{9})+1)(z^2-2z\cos(\frac{8π}{9})+1)$</p> <p>Using this, how to show that $$2\cos(3 \theta)+1=8\left(\cos \theta-\cos\left(\frac{2π}{9}\right)\right)\left(\cos \theta-\cos\left(\frac{4π}{9}\right)\right)\left(\cos\theta-\cos\left(\frac{8π}{9}\right)\right)$$</p> <p>I know it involves some trig substitution but I'm not sure how. Help appreciated, thanks.</p>
0non-cybersec
Stackexchange
201
472
Ubuntu 18.04 Freezing on boot. <p>I have a Lenovo T60 and everytime I try to boot 18.04 it gets to "Starting user manager for UID 121" on the boot screen it freezes then the mouse arrow comes up. This is massive bug exclusive to 18.04. On 17.10 and 16.04 everything is fine Ive purged and reinstalled every form of nvidia, purged and reinstalled nouveau as well as upgraded GRUB more than I can count.. I am currently typing this question in recovery mode. Thats the only way I can get it to work. I wonder if its a 32/64 bit issue. For windows its 64 bit but for linux I can only do 32 bit.</p>
0non-cybersec
Stackexchange
160
597
Little value in unit-testing the database component. <p>Having a component that represents the database is wonderful! You can use it from the business logic to read and write data. But should that component be unit-tested? </p> <p>I would argue that it should not. Unit-tests are all about testing the contract of a component with its external actors.</p> <p>Let's take a typical interface of a database component</p> <pre><code>void insertUsers(List&lt;UserRecord&gt; users); List&lt;UserRecord&gt; fetchUsers(List&lt;UserID&gt; userIds); void deleteUsers(List&lt;UserID&gt; userIds); </code></pre> <p>Each method listed utilizes the database library to send the appropriate queries to the database.</p> <p>The external actors of the database component are: </p> <ul> <li>The business logic</li> <li>The database</li> </ul> <p>Unit testing would require me to mock the connection, prepared statement and result set objects of the database library.</p> <p>However since the entire database component consists only of interactions with the database library, any test I write will end up mirroring the component code and is hence fragile.</p> <p>Testing the contract means asserting on the following:</p> <ul> <li>Calling insertUsers should write those users in the database</li> <li>Calling fetchUsers should retrieve those users from the database</li> <li>Calling deleteUsers should delete those users from the database</li> </ul> <p>Testing interaction with the database library will lead to fragile code:</p> <ul> <li>A lot of equivalent SQL statements can be created. Changing a statement to an equivalent one does not break the contract and should not break the test</li> <li>One could use the database library in different ways: eg: use a statement instead of a prepared statement object. That again does not break the contract</li> <li>Changing the order of columns in a select or insert statement would yield equivalent results. No point in asserting on resultset.getString(0) or preparedStatement.setString(1, "Bill")</li> <li>The database library used should not matter.</li> </ul> <p>The following thoughts, have lead me to the conclusion that unit-tests for the database component offer little value. I truly feel that an integration test which requires an actual database is the way to go.</p> <p>Please share your thoughts on the subject; Could it be that I am missing something?</p> <p>Edit: Please suggest how can the following code be unit-tested in a non-fragile way. Feel free to refactor the code if you like.</p> <pre><code>void insertUsers(List&lt;UserRecord&gt; users) throws RepositoryException{ try(Connection connection = datasource.getConnection(); PreparedStatement stmt = connection.prepareStatement("insert into users (Name, Surname, DateOfBirth) values (?,?,?)")){ for (UserRecord user : users){ stmt.setString(1, user.name); stmt.setString(2, user.surname); stmt.setTimestamp(3, user.dateOfBirth); stmt.execute(); } } catch(SQLException ex){ throw new RepositoryException(ex); } } </code></pre>
0non-cybersec
Stackexchange
825
3,134
Puzzled over basic exponentiation problem with complex argument. <p>I can't figure out where is my erroneous thinking in the following elementary use of exponents. I have used Mathematica to verify that I don't know what I'm doing.</p> <p>$$ a^{bc}=\left(a^{b}\right)^{c} $$ Mathematica says "True".</p> <p>$$ e^{bc}=\left(e^{b}\right)^{c} $$ Mathematica says "True".</p> <p>$$ e^{ibc}=\left(e^{ib}\right)^{c} $$ Mathematica says "True" ($i=\sqrt{-1}$).</p> <p>$$ e^{i2\pi c}=\left(e^{i2\pi}\right)^{c} $$ Mathematica says "False".</p> <p>FWIW I used <code>PowerExpand[]</code> on each of these expressions in Mathematica and put them inside a <code>TrueQ[]</code> function. I know that $ e^{i2\pi} = 1 $, that $ 1^{c}=1 $, and that $ e^{i2\pi c} $ is generally some point on the unit circle depending on the value of $c$ and thus a complex number with unit magnitude.</p> <p>Please show me what is wrong.</p>
0non-cybersec
Stackexchange
318
916
install(TARGETS ...) and add_subdirectory. <p>Is it possible to use install(TARGETS ...) with targets that are defined in directories added with add_subdirectory?</p> <p>My use case is, that I want to build e.gg an rpm for gtest. the gtest project happens to have a CMakeLists.txt without any install statements. I want to build the package without adding those statements to the CMakeLists.txt of gtest.</p> <p>I have this resulting directory structure:</p> <pre><code>+ gtest-1.5.0/... + CMakeLists.txt </code></pre> <p>The CMakeLists of gtest-1.5.0 defines libraries like this:</p> <pre><code>cxx_static_library(gtest "${cxx_strict}" src/gtest-all.cc) cxx_static_library(gtest_main "${cxx_strict}" src/gtest_main.cc) target_link_libraries(gtest_main gtest) </code></pre> <p>now i want to add something like this to my CMakeLists.txt:</p> <pre><code>add_subdirectory(gtest-1.5.0) install(TARGETS gtest gtest_main ARCHIVE DESTINATION lib) </code></pre> <p>but cmake correctly states:</p> <pre><code>CMake Error at CMakeLists.txt:10 (install): install TARGETS given target "gtest" which does not exist in this directory. </code></pre> <p>Is there a way to do this without patching gtest-1.5.0?</p>
0non-cybersec
Stackexchange
418
1,213
Flutter map_view center to user location. <p>I'm using the <a href="https://pub.dartlang.org/documentation/map_view/latest/" rel="nofollow noreferrer">map_view</a> plugin to build a map in my Fluter app. I'm following the example, but I would like to initialize the map to the user current location without hardcoding the coordinates.<br><br> I have been digging into the docs and the Github issues and found <a href="https://github.com/apptreesoftware/flutter_google_map_view/issues/28" rel="nofollow noreferrer">this</a>, but I can't understand how to apply it.</p> <p>The map is initialized this way:</p> <pre><code>mapView.show( new MapOptions( mapViewType: MapViewType.normal, showUserLocation: true, initialCameraPosition: new CameraPosition( new Location(45.5235258, -122.6732493), 14.0), title: "Recently Visited"), toolbarActions: [new ToolbarAction("Close", 1)]); </code></pre> <p>Get notified when the map is ready</p> <p>How can I use this code to set the position of the map?</p> <pre><code>mapView.onLocationUpdated.listen((location) =&gt; myUserLocation = location); </code></pre> <p>This is the entirety of my code:</p> <pre><code>Location myUserLocation = null; class NuMapView extends StatefulWidget { @override _NuMapViewState createState() =&gt; new _NuMapViewState(); } class _NuMapViewState extends State&lt;NuMapView&gt; { static String apiKey = "mykey"; MapView mapView; CameraPosition cameraPosition; var compositeSubscription = new CompositeSubscription(); var staticMapProvider = new StaticMapProvider(apiKey); Uri staticMapUri; @override void initState(){ print("dentro init state\n"); mapView = new MapView(); mapView.onLocationUpdated.listen((location) { print("cacchissime\n"); if (myUserLocation == null){ print("user location non null\n"); myUserLocation = location; showMap(); } else { print("user location è nullo!!\n"); } } ); super.initState(); } bool ready = false; List&lt;Marker&gt; _markers = new List&lt;Marker&gt;(); }); } @override Widget build(BuildContext context) { return new MaterialApp( home: new Scaffold( body: new Text("ciao") ), ); } showMap() { mapView.show( new MapOptions( mapViewType: MapViewType.normal, showUserLocation: true, showMyLocationButton: true, showCompassButton: true, initialCameraPosition: new CameraPosition( new Location(myUserLocation.latitude, myUserLocation.longitude), 35.0), hideToolbar: false, title: "Cerca sulla mappa"), ); StreamSubscription sub = mapView.onMapReady.listen((_) { mapView.setMarkers(_markers); }); compositeSubscription.add(sub); sub = mapView.onLocationUpdated.listen((location) { print("Location updated $location"); }); compositeSubscription.add(sub); sub = mapView.onTouchAnnotation .listen((annotation) =&gt; print("annotation ${annotation.id} tapped")); compositeSubscription.add(sub); sub = mapView.onCameraChanged.listen((cameraPosition) =&gt; this.setState(() =&gt; this.cameraPosition = cameraPosition)); compositeSubscription.add(sub); } </code></pre>
0non-cybersec
Stackexchange
1,005
3,372
My wife[32/f] and I [30/m]had a shouting match in the car, and almost caused a car crash. Now I am not talking to her.. Seriously, this woman cannot take things easily. I came back late to pick her friend and her up to get a haircut for me. She was already criticizing me for being late. (I did some training with a friend, and asked beforehand if it's ok for me to stay a little late. She agreed.) After we dropped off my friend and hers, we were driving and I missed a u-turn lane on the left. She screamed at me, and flustered, I almost hit the car coming up to my left. I yelled back that I almost hit car, and she screamed "just hit the car!" I drove angrily for the next few minutes, and pulled over when we were safe. I told her calmly that yelling at me while I am driving is very dangerous. She muttered something about my missing a u-turn, but didn't argue with me. We went to get a haircut, and she acted very caring for me, telling my hairstylist how to cut my hair, etc. One our way back home, I told her again that when she yelled at me, I couldn't see the car coming up on the left and we almost crashed, and that missing a turn isn't as bad as having a car crash. She stayed quiet and from then on, throughout the night I didn't talk to her besides a few grunts here and there. I know she's trying to apologize by being very nice to me, but she has not actually said she's sorry yet. Meanwhile, I am getting annoyed with just how she just blows her fuse over small things easily. Overall, she is a critical person, and for the most part I can live with it, because most of the time, her criticisms are valid. But the way she goes about it is insensitive and even hurtful at times. The more I think about it, the more negative things I begin to think of our relationship. I know I am probably overreacting a little, but I think deep down I am not very happy with her negative side. She's going away for a few months for business soon, I secretly am happy that I can be left alone for the first time since we are together. I don' even know what I am trying to achieve by not talking to her. I feel that there are issues that a simple "I am sorry" isn't going to cut it. Obviously I want our marriage to work out, but I am a little scared how relieved I feel that she's actually going away. What should I do? **tl;dr** Wife with short fuse screamed at me while driving for missing a turn and almost caused an accident. I am not talking to her now while ruminating on our marriage's problems of her being critical and insensitive at times. UPDATE: So after giving her the silent treatment for the past two days (I know, I am terribly immature when it comes to my emotions. This is my way of showing that I am unhappy), I sent her a text, basically saying that her criticism and insensitivity is constantly causing a riff in our marriage. I said that instead of patient support, what I get from her is cold criticisms. I asked that we should get marriage counseling before she leaves for business. She asked me if I am going to pay for it, I said yes. She wanted to have the marriage counseling after she comes back in 6 months, saying that counseling is long term, and she's 2 weeks away from leaving. I figured if she is serious about it, we can do that. She then suggested instead to have her friend mediate for us. I refused, saying that I would like to keep our personal issues from our friends, and that we have tried that before, and rarely does it change her behavior for long. Our conversation then turned into another argument, with my criticizing the way she treats me, and her criticizing all the little things about me. She just couldn't accept that the way she criticizes me is wrong. It's almost as if she only knows one way of criticizing. Instead of agreeing to change, she turns it back to me, saying why I can't do this and be that, and that my inadequacies do not allow her to have patience and gentleness with me. I countered by saying that her trying to constantly change me and control me is making me very tired and exhausted. We went on and on, seeming more pessimistic about our relationship than before. We sort of just wanted to let the temporary separate come, and get some time and space between us to figure things out. As for marriage counseling, she said that she doesn't believe in it, and it became almost an afterthought. She wanted to see how we are after our separation, to see if it is even worth fixing. We sort of left it at that. It doesn't help that her mom found out about her crying alone in the house, and called me and yelled at me about being a man and just letting her. I grumbled a few words saying we will fix our problems ourselves. She got more emotional and yelled more. Ironically, this is how my wife got her problems from. Her mom seemed to think that by yelling and telling me what to do, we would quickly fix our problems and be fine. I will go back home tonight to see what will happen...
0non-cybersec
Reddit
1,152
4,975
Validating sections of a form. <p>I've broken my form up into divs and using Next buttons to shop and hide those sections. I am also using jQuery Validation Plugin to do all the validation for me.</p> <p>What I need to know is how to validate section by section. So this is what I have</p> <ol> <li>Personal Information</li> <li>Address details</li> <li>Project Information</li> <li>Terms and conditions</li> </ol> <p>2,3,and 4 are hidden by default to make the form less daunting.</p> <p>Clicking on the next button of Personal Information will hide this div and show the Address Details and so on.</p> <p>The very last screen has the submit form button which then would validate the entire form normally but I need to validate each section before the user moves on.</p> <p>Here's what I thought should have worked:</p> <p><strong>CSS</strong></p> <pre><code> .project-address {display:none;} </code></pre> <p><strong>HTML</strong></p> <pre><code> &lt;form class="wpcf7"&gt; &lt;div class="project-details"&gt; &lt;h2&gt;Project details&lt;/h2&gt; &lt;label&gt;Project name: &lt;/label&gt;&lt;input type="text" class="reg-project-name" size="40" value="" name="projectName"&gt; &lt;div class="back-next"&gt;&lt;span class="reg-next-button"&gt;Next&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="project-address"&gt; &lt;h2&gt;Project address&lt;/h2&gt; &lt;label&gt;Project address:&lt;/label&gt;&lt;input type="text" class="reg-project-address" size="40" value="" name="projectAddress"&gt; &lt;div class="back-next"&gt;&lt;span class="reg-next-button"&gt;Next&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p><strong>JQUERY</strong></p> <pre><code> //clicking the next button hides this section and shows the next section jQuery('.project-details .reg-next-button').click(function() { // jQuery(".project-details").slideUp(); // jQuery('.project-address').slideDown(); jQuery('.reg-project-name').validate({ debug: true, rules: { projectName: "required" }, messages: { projectName: "Please give your project a name", } }); }); </code></pre> <p><strong>EDIT: Have tried to validate one element like this.</strong></p> <pre><code> jQuery('.project-details .reg-next-button').click(function() { // jQuery(".project-details").slideUp(); // jQuery('.project-funding').slideDown(); var validator = jQuery( ".wpcf7-form" ).validate(); validator.element( ".reg-project-name" ); }); </code></pre> <p><strong>EDIT:</strong> If I click on the Next button, I need the form elements to be validated in that div before moving on which is not happening. i.e the form elements are not being validated..</p> <p>Any thoughts? Many thanks.</p>
0non-cybersec
Stackexchange
918
2,960
How do you solve the following a - b(mod5) = a + b(mod5)?. <p>attempted solution:</p> <p>a - b(mod5) = a + b(mod5)</p> <p>2a(mod5) = 0</p> <p>a = 5</p> <p>5 + b mod 5 = 5 - b mod 5</p> <p>b mod 5 = -b mod 5</p> <p>b = 0</p>
0non-cybersec
Stackexchange
129
230
Find supremum and infimum for the sets: $A=\{x^2+x+2: x \in \mathbb{R} \},$ $B=\{n^2+n-2: n \in \mathbb{Z} \}.$. <p>Find supremum and infimum for the sets:</p> <p><span class="math-container">$A=\{x^2+x+2: x \in \mathbb{R} \},$</span></p> <p><span class="math-container">$B=\{n^2+n-2: n \in \mathbb{Z} \}.$</span></p> <p>I think that </p> <p><span class="math-container">$\sup_A=+\infty$</span> and <span class="math-container">$\inf_A=\frac{-7}{4},$</span> </p> <p><span class="math-container">$\sup_B=+\infty$</span> and <span class="math-container">$\inf_B=-2.$</span> </p> <p>I found these values based on the graphs of these functions. It is correct? I should prove it somehow or my answer is enough?</p>
0non-cybersec
Stackexchange
287
716
Trying to make a column of &quot;select count&quot; in reference to another column. <p>I am pulling data from multiple sheets in my workbook to create an array. In the first part of the array I pull data straight from a sheet like a user name # of points and rank. Now for the rest of the data I need to count the # of instance a particular user pop with certain value in other sheets.<br> In one query I am trying to create a column that counts the number of times the value '7' exists for each user. In sheet1 the user is in column A and in the active sheet it is in B. </p> <p>Now if I make the query </p> <pre><code> =QUERY(sheet1!A:F,"select count(D) where D=7 and A = '"B2"'",0) </code></pre> <p>I get the right answer but in 2 rows. One with the title and another one with the value. So I can't repeat the same query for each row. </p> <p>When I try this query</p> <pre><code> =QUERY(sheet1!A:F,"select count(D) where D=7 and A = '"B"'",0) </code></pre> <p>It doesn't recognize B as a column and gives an error. </p>
0non-cybersec
Stackexchange
321
1,032
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
PartitionKey value must be supplied for this operation. <p>I am trying to retrieve a document from the Azure Cosmos Db Collection. I am running into an error</p> <pre><code>Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.UnsupportedOperationException: PartitionKey value must be supplied for this operation.] with root cause java.lang.UnsupportedOperationException: PartitionKey value must be supplied for this operation. </code></pre> <p>I was trying to look up online how can I provide the partition key value to the function findById(), but it seems like the "Azure Spring data cosmosdb" doesn't have the option to provide the partition key with the function for the java implementation </p> <pre><code>orderTransactionRepository.findById("id").get </code></pre>
0non-cybersec
Stackexchange
208
869
How do I restrict access to my network hard drive?. <p>I just bought a <a href="http://rads.stackoverflow.com/amzn/click/B001RB1QWW" rel="nofollow noreferrer">WD My Book</a> NAS for use at home. I want to use it for scheduled backups from my Windows 7 PC(s) as well as general storage. I do not want any remote access. I plugged it into my router and mapped the network drive; now I have 2 questions:</p> <ol> <li>I occasionally give visitors my WiFi password (WPA2-PSK) so they can access the internet, but I don't want them to have access to the data on the NAS. Is there a way to achieve this?</li> <li>How can I ensure that my NAS is secure against intruders from outside my home network?</li> </ol>
0non-cybersec
Stackexchange
208
705
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
Will D-Wave&#39;s quantum computers ruin classical encryption?. <p>D-Wave has commercially available 512-qbit quantum computers now. A lot of <a href="http://www.theglobeandmail.com/report-on-business/small-business/sb-tools/small-business-briefing/quantum-computing-firm-d-wave-lands-30-million/article4591920/" rel="nofollow noreferrer">big names</a> are taking it seriously. Google, NASA, and USRA have joined forces to <a href="http://googleresearch.blogspot.ca/2013/05/launching-quantum-artificial.html" rel="nofollow noreferrer">start a quantum AI lab</a>. </p> <p>How far are we from destroying classical encryption? Perhaps a more direct question, what will it take for my bitcoins to be in danger of a quantum brute force attack?</p> <p>EDIT: I posted this question after reading a <a href="https://crypto.stackexchange.com/questions/436/now-that-quantum-computers-have-been-out-for-a-while-has-rsa-been-cracked">similar one</a>, but felt that it was relevant since the other question is 2 years old now and DWave seems to have made new developments (major increases in qubit depth, new interests).<br> The comment below mentions that DWaves machines aren't crypto-breaking capable, and also that QC is only effective against asymetric encryption (the bitcoin kind!). I wonder if someone can expand on these points...</p>
0non-cybersec
Stackexchange
373
1,338
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
Calculating number of days from two dates in XML with XSLT. <p>I've been going on for about 5 hours now, trying exactly EVERY example found on Google found with the serach term "xml xslt calculate number of days between dates" that I could find to just take two dates from "date.xml" file and calculating the days between the dates, in format "YYYY-MM-DD" <strong><em>(example below doesn't have this format, but it's the only format I need)</em></strong></p> <p>I finally found this page:: <a href="https://forums.oracle.com/thread/2432132" rel="noreferrer">https://forums.oracle.com/thread/2432132</a></p> <p>Where the solution can be verified at: <a href="http://xslttest.appspot.com/" rel="noreferrer">http://xslttest.appspot.com/</a></p> <p>But, saving the "date.xml/date.xslt" on localhost trying to open the page in Internet Explorer, Google Chrome or Firefox either shows error or nothing at all and as it's always seem to have been - no information what is wrong. The same happens when the file is on a webserver.</p> <p>So, why can't I try out a simple example that I've found that everyone says has the solution or what am I doing wrong?</p> <p>XML File from the above example:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet type="text/xsl" href="date.xslt"?&gt; &lt;root&gt; &lt;date1&gt;2012-01-11T00:00:00.000-05:00&lt;/date1&gt; &lt;date2&gt;2012-01-15T00:00:00.000-05:00&lt;/date2&gt; &lt;/root&gt; </code></pre> <p>XSLT File from the above example:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"&gt; &lt;xsl:template match="/"&gt; &lt;xsl:variable name="date1" select="xs:dateTime(/root/date1)"/&gt; &lt;xsl:variable name="date2" select="xs:dateTime(/root/date2)"/&gt; &lt;xsl:value-of select="fn:days-from-duration($date2 - $date1)"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>Adding this to the XSLT verifier, it shows the right value "4" days between these two dates.</p> <p>I want to be able to just create a document that actually can do calculations, whether they are dates or numbers but it's seems impossible at this moment. Get number of dates, then do some calculation with that value.</p>
0non-cybersec
Stackexchange
827
2,410
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
Logitech presenter R800 set-up problem on Ubuntu 18.04 LTS (64-bit). <ul> <li>I am on <strong>Ubuntu 18.04 LTS (64-bit)</strong> on my Asus notebook and I am trying to setup the <strong>USB presenter by Logitech R800</strong>.</li> </ul> <p>I searched on plenty of Linux forums (also on Logitech community forum, specifically) and could not find any solution for my problem, which is the failure to recognize the USB receiver that comes with the Logitech R800 presenter. This causes the presenter device not to work at all.</p> <p>As I do not have experience with Ubuntu - or any other Linux distribution, really - I look for detailed and step-by-step information, please.</p> <p><em>Aiming at elaborating better what is happening, please, guide me with the right questions and suggestions, if needed.</em></p> <p>This is the best I can express this problem.</p> <p>I hope to get a response. </p> <p>Thank you! </p> <p>Related:<a href="https://askubuntu.com/q/113984/66509">Is Logitech&#39;s Unifying receiver supported?</a></p>
0non-cybersec
Stackexchange
317
1,037
Text (preferably centered with the first line in bold) to the side of included graphics in LaTeX. <p>I have a document with a main heading followed by a picture with some contact information to the right of it. After that the other subheadings continue.</p> <p><img src="https://i.stack.imgur.com/80qXm.jpg" alt=""></p> <p>I want to do the same in LaTeX. Which I am actually quite familiar with. Which method would you recommend to get the same layout using LaTeX? I really want to use this layout.</p>
0non-cybersec
Stackexchange
138
505
Number of zeros of $p(z)=z^5+10z-3$ on annulus $A(0,1,2)$. <blockquote> <p>How many zeros does the function <span class="math-container">$p(z)=z^5+10z-3$</span> have on the annulus <span class="math-container">$A(0,1,2)$</span>?</p> </blockquote> <p>For <span class="math-container">$z\in C(0,2)$</span>, we have <span class="math-container">$|f(z)|=|z^5|=32$</span> and <span class="math-container">$|g(z)|=|10z-3|\leqslant 10\cdot 2+3=23$</span>, thus <span class="math-container">$|f|&lt;|g|$</span> on <span class="math-container">$C(0,2)$</span>, which implies by Rouché's Theorem that <span class="math-container">$p=f+g$</span> has as much zeros as <span class="math-container">$f$</span> in <span class="math-container">$B(0,2)$</span>, which is <span class="math-container">$5$</span>.</p> <p>We can do the same trick on <span class="math-container">$C(0,1)$</span> using <span class="math-container">$f(z)=10z$</span> and <span class="math-container">$g(z)=z^5-3$</span>, to show that <span class="math-container">$p$</span> has <span class="math-container">$1$</span> zero in <span class="math-container">$B(0,1)$</span>. (Since <span class="math-container">$p(0)p(1/2)&lt;0$</span>, this is a real zero)</p> <p>Now I want to conclude that in the annulus <span class="math-container">$A(0,1,2)$</span> there are <span class="math-container">$5-1=4$</span> zeros. However, how can I be sure that there is no zero on the circle <span class="math-container">$C(0,1)$</span>? </p>
0non-cybersec
Stackexchange
572
1,493
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
Does anyone else have no problem finding a date, but struggle with finding friends?. This sounds really odd because usually it's the other way around for people (having friends but being single). I usually find it difficult to connect with people and maintain a long-lasting friendship. But it's really easy for me to just get a guy. I have had several boyfriends and a bunch of flings. Sometimes I enjoy it, but I would prefer having friends to boyfriends since I don't want to cling to just one person. Don't know if there's anything problematic with me. I don't get it, if I'm likable enough to get guys, why isn't it the same with making friends?
0non-cybersec
Reddit
148
653
I don't want to live and there is nothing i can do about it.. I guess i'll just jump right into it. I am a 25 year old trans-man, almost 26. I have no motivation to live, that's it, i don't want a hand in life. When i was eighteen i told myself if i didn't find some reason, motivation, goal, literally anything, any reason to live by the time i turned 25 i would kill myself. I started dating a boy when i was 24, a few months before i turned 25. I told myself i'll give this a shot, my 25th birthday came and went and a few months later we broke up when i came out as trans. I figured that was fine, i'll just push the date back to my twenty sixth birthday, same deal. In December my little brother killed himself, and i saw first hand the impact and hurt that inflicted on not only my family but his friends too and now i don't think i can do the same, not after my stepdad held me, sobbing into my shoulder and making promise to never make him go through that again. But i just have no will to live, i don't care about my life, its stupid and selfish and i wish i cared more but i don't. I am almost 26 and i don't even have my highschool diploma I don't have my drivers licence I don't have a job nor have i ever held one for more than a week. Anti-depressants and therapy didn't do anything for even when i was desperately trying, to make it work. The only reason i'm able to live comfortably is because one of my ex boyfriends parents took pity on me after he knocked me up and my mom disowned me. They let me stay with them and i do nothing for them in return and i feel like shit but i can't motivate myself to do anything about it. I want to die, but i can't. I'm not interested in anything. I don't know what to do.
0non-cybersec
Reddit
442
1,749