text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
PhpStorm – how to upload only modified files?. <p>I have a project in PhpStorm. I press <code>upload to ftp</code> on root folder and all files are uploaded to server. Then I work on this project – lets say modifying one file. When I press <code>upload to ftp</code> now, I see all files are being <strong>uploaded again</strong> – but they are <strong>not modified</strong> after last upload.</p> <p>I do not want to upload <em>automatically</em> nor <em>on explicit save action</em>. The setting <strong>overwrite up-to-date files</strong> in <code>settings → deployment → options</code> is <strong>NOT checked</strong>.</p> <p><em>Sync with deployed</em> is not a solution, because a project is huge ant comparing every file by content is a total waste of resources and time.</p> <p><strong>How to upload only modified files?</strong></p>
0non-cybersec
Stackexchange
Rsync won&#39;t sync recursively two directories in 2 different NTFS partitions. <p>I am using Linux Mint 17, arch x64. When trying to sync two directories from 2 different locally mounted NTFS partitions, it won't recurse, but instead copy only the files found in the 1st level directory.</p> <p>It works fine on 2 ext4 partitions.</p> <p>Command: <code>rsync -rtv /path1 /path2</code></p> <p>rsync version: 3.1.0</p>
0non-cybersec
Stackexchange
Examples of Topological Embeddings and Quotient Maps. <p>What is an example of</p> <ol> <li>a topological embedding that has no continuous left inverse?</li> <li>a quotient map that has no continuous right inverse?</li> </ol>
0non-cybersec
Stackexchange
My GF doesn't like her butt. So my (17M) GF (17F) has some self esteem issues in relation to her own body (as more people tend to have at the age of 17). She doesn't seem to have any problems with her boobs, but she doesn't really like her butt. I really is a beautifull girl in my opinion and it's a shame she doesn't like herself as much as she should. My question is: should I direct most on my attention on her strengths (such as her boobs) or rather towards her weaknesses (such as her butt)? I really want to make her feel better and would like some opinions on this.
0non-cybersec
Reddit
Sanchi | Sanchi Stupa | Great stupa at Sanchi | Stupa at Sanchi.
0non-cybersec
Reddit
Kid Cudi - Day 'n' Night [Crookers remix].
0non-cybersec
Reddit
There was no way to close this. Also, the ad itself..
0non-cybersec
Reddit
Kid gets a Kinder Surprise Egg in her Christmas stocking.
0non-cybersec
Reddit
How do I get grep to exclude specific paths?. <p>Note: This is NOT a duplicate. I am dealing with a certain instance where grep's options for excluding paths/directories do not behave in an expected way.</p> <p>I am trying to use grep to recursively search my root filesystem. I am trying to exclude certain directories like <code>/proc</code>, <code>/sys</code>, and <code>/usr/local</code>. If I use <code>--exclude-dir=${DIR_NAME}</code>, then it will not search in paths below <code>${DIR_NAME}</code>, but this will <em>also</em> mean that it will refuse to search paths below <code>${DIR_NAME}</code> if <code>${DIR_NAME}</code> is at a level below the current working directory. As an example, consider this filesystem tree:</p> <pre><code>${PWD}/ data/ settings/ sys/ users/ developer/ projects/ my_os/ build/ src/ apps/ sys/ Makefile extras/ sys/ apps/ os/ </code></pre> <p>If I want my search to exclude <code>${PWD}/sys</code> and everything under it, <code>grep -rl --exclude-dir=sys</code> will exclude it, but it will also exclude <code>${PWD}/data/settings/sys</code> and <code>${PWD}/users/developer/projects/my_os/src/sys</code>, two directories I want included in my search.</p> <p>I was originally hoping that <code>--exclude-dir</code>/<code>--exclude</code> would be allow for regular expressions and I've found <a href="https://stackoverflow.com/questions/6565471/how-can-i-exclude-directories-from-grep-r#comment32719649_8692318">this comment</a> indicating that they do, but it seems that regular expression syntax doesn't affect the utility's behavior (e.g, <code>"^/(dev|proc)"</code>). I'm fine if those two options don't use regular expressions, but I do not want the exclusion pattern to be applied to singular path components. Is there anyway to get it to work like that?</p>
0non-cybersec
Stackexchange
Paranoid Android Multi-windowing.
0non-cybersec
Reddit
Using port number in Windows host file. <p>After installing TeamViewer, I have changed the wampserver port to 8080, so the address is <code>http://localhost:8080.</code></p> <p>For the host file located at C:\WINDOWS\system32\drivers\etc\, I have also made the change as below</p> <p>BEFORE<br> <code>127.0.0.1 www.example.com</code></p> <p>AFTER<br> <code>127.0.0.1:8080 www.example.com</code></p> <p>When I access www.example.com, it doesn't redirect to my wampserver, how can I fix it?</p>
0non-cybersec
Stackexchange
XPS 13 with a USB C dock using two 34&quot; 4k monitors - after connecting second montor the XPS and first go blank. <p>Ok, I have been at this for a while and tried every tip I could find and I am still struggling. Although I have not found an article that was 100% my issue so that might be why nothing has worked so far =*)</p> <p>The setup: XPS 13 i7 xPro 8th Gen 16gb of mem Intel UHD 620 with a Startech dual DP dock (USB C) and two 34" curved 4k Dell monitors. Ubuntu 18.04 TLS. Using Ubuntu Desktop although I did try Plasma and had the same issue.</p> <p>The problem: When I connect the dock with 1 monitor everything is fine. When I plug in the second monitor the XPS screen and the second monitor go black and the third turns on. If I then disconnect the third only the first monitor turns on and if I open settings devices displays the XPS screen has no config. If I set a resolution and choose to extend the displays the XPS screen turns on again. If I connect both monitors to the dock and then connect to the XPS only monitor 3 turns on and then the same procedure stands to get the XPS screen back on. </p> <p>Lastly I should mention that the screens just go blank and Ubuntu thinks they are there. If I launch something it pops up on one of the blanked monitors and mouse can leave the third screen. </p> <p>I have tried three different docks from Dell and Startech with the same behavior. </p> <p>If anyone has any ideas I'd be greatful for some fresh eyes. </p> <p>Thanks!</p>
0non-cybersec
Stackexchange
How to call a stored procedure (with parameters) from another stored procedure without temp table. <p>I have stored procedure A and want to call store procedure B from A by passing a <code>@mydate</code> parameter. Stored procedure B will return a rowset which I can further use in procedure A. </p> <p>I researched this on Google but did not find anything without using a temporary table. Is there an easy way to get this without a temp table. </p> <p>P.S.: I tried to get this done using stored procedure as A and a function as B easily. But want to know if I can get it done only by using stored procedures.</p>
0non-cybersec
Stackexchange
Fundamental Theorem of Calculus With Weird Limits. <p>$$f(x) =\int_6^{x^3} \sin^3(5t) \, dt$$ what is $f'(x)$?</p> <p>I know I have to use fundamental theorem of calculus, but what do I do about the $x^3$ and $t^3$?</p>
0non-cybersec
Stackexchange
Can&#39;t receive phone call on my FreePbx extension. <p>I'm running out of hair to pull here. I have my freepbx installed and configured ok at the beginning. I was testing it with Google Voice account. I can call out and receive call. I'm sure I must did something when I was trying to configure a new DID from Voip.ms. Suddenly my sip phone can't dial out. Tried to call extension to extension and having the same problem also. Please help?</p> <pre><code>My Phone (Info Scrubbed): 2065551212 Destination Dial: 2065551234 FreePbx 2.11.0.10 Asterisk 11 OS: Centos 6.4 64Bit </code></pre> <p><strong>Here is my outbound setting.</strong></p> <pre><code>Route Name: mygvoicegmail.com dial patterns: prepend + prefix | match pattern /callerid empty + empty | 1NXXNXXXXXX /2065551212 1 + empty | NXXNXXXXXX /2065551212 Trunk Sequence: GVM_2065551212 Optional Destination on Congestion: Normal Congestion </code></pre> <p><strong>Here is the log on what's happening when I tried to call out.</strong></p> <pre><code>[2013-09-12 14:04:43] VERBOSE[10674][C-00000006] netsock2.c: == Using SIP RTP CoS mark 5 [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [12065551234@from-internal:1] Macro("SIP/8881-00000006", "user-callerid,LIMIT,") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:1] Set("SIP/8881-00000006", "TOUCH_MONITOR=1379019883.6") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:2] Set("SIP/8881-00000006", "AMPUSER=8881") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:3] GotoIf("SIP/8881-00000006", "0?report") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:4] ExecIf("SIP/8881-00000006", "1?Set(REALCALLERIDNUM=8881)") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:5] Set("SIP/8881-00000006", "AMPUSER=8881") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:6] Set("SIP/8881-00000006", "AMPUSERCIDNAME=MyHomeExt") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:7] GotoIf("SIP/8881-00000006", "0?report") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:8] Set("SIP/8881-00000006", "AMPUSERCID=8881") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:9] Set("SIP/8881-00000006", "__DIAL_OPTIONS=Ttr") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:10] Set("SIP/8881-00000006", "CALLERID(all)="MyHomeExt" ") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:11] GotoIf("SIP/8881-00000006", "0?limit") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:12] ExecIf("SIP/8881-00000006", "1?Set(GROUP(concurrency_limit)=8881)") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:13] ExecIf("SIP/8881-00000006", "0?Set(CHANNEL(language)=)") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:14] GosubIf("SIP/8881-00000006", "7?sub-ccss,s,1(from-internal,12065551234)") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@sub-ccss:1] ExecIf("SIP/8881-00000006", "0?Return()") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@sub-ccss:2] Set("SIP/8881-00000006", "CCSS_SETUP=TRUE") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@sub-ccss:3] GosubIf("SIP/8881-00000006", "0?monitor_config,1(from-internal,12065551234):monitor_default,1(from-internal,12065551234)") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [monitor_default@sub-ccss:1] GotoIf("SIP/8881-00000006", "0?is_exten") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [monitor_default@sub-ccss:2] StackPop("SIP/8881-00000006", "") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [monitor_default@sub-ccss:3] Return("SIP/8881-00000006", "FALSE") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:15] GotoIf("SIP/8881-00000006", "1?continue") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Goto (macro-user-callerid,s,28) [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:28] Set("SIP/8881-00000006", "CALLERID(number)=8881") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:29] Set("SIP/8881-00000006", "CALLERID(name)=MyHomeExt") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:30] Set("SIP/8881-00000006", "CDR(cnum)=8881") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:31] Set("SIP/8881-00000006", "CDR(cnam)=MyHomeExt") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [s@macro-user-callerid:32] Set("SIP/8881-00000006", "CHANNEL(language)=en") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [12065551234@from-internal:2] NoCDR("SIP/8881-00000006", "") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [12065551234@from-internal:3] Progress("SIP/8881-00000006", "") in new stack [2013-09-12 14:04:43] VERBOSE[10880][C-00000006] pbx.c: -- Executing [12065551234@from-internal:4] Wait("SIP/8881-00000006", "1") in new stack [2013-09-12 14:04:44] VERBOSE[10880][C-00000006] pbx.c: -- Executing [12065551234@from-internal:5] Progress("SIP/8881-00000006", "") in new stack [2013-09-12 14:04:44] VERBOSE[10880][C-00000006] pbx.c: -- Executing [12065551234@from-internal:6] Playback("SIP/8881-00000006", "silence/1&amp;cannot-complete-as-dialed&amp;check-number-dial-again,noanswer") in new stack [2013-09-12 14:04:44] VERBOSE[10880][C-00000006] file.c: -- &lt;SIP/8881-00000006&gt; Playing 'silence/1.ulaw' (language 'en') [2013-09-12 14:04:45] VERBOSE[10880][C-00000006] file.c: -- &lt;SIP/8881-00000006&gt; Playing 'cannot-complete-as-dialed.ulaw' (language 'en') [2013-09-12 14:04:47] VERBOSE[10880][C-00000006] pbx.c: == Spawn extension (from-internal, 12065551234, 6) exited non-zero on 'SIP/8881-00000006' [2013-09-12 14:04:47] VERBOSE[10880][C-00000006] pbx.c: -- Executing [h@from-internal:1] Hangup("SIP/8881-00000006", "") in new stack [2013-09-12 14:04:47] VERBOSE[10880][C-00000006] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/8881-00000006' </code></pre>
0non-cybersec
Stackexchange
Pimpchilla.
0non-cybersec
Reddit
A Dark Song is One of the Best Horror Movies That You Haven’t Seen.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
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
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
AJAX - PHP in codeigniter show posts and limit them. <p>So im new in ajax and not so "pro" at php, i need help. </p> <p>I have created an ajax call that on document.ready shows posts from DB</p> <pre><code>$.ajax({ type:"POST", url:"testphp.php", datatype: 'json', success:function myFunction(response) { var arr = JSON.parse(response); var i; var out = " "; for(i = 0; i &lt; arr.length; i++) { out += "&lt;div id='"+arr[i].ID+"' class='grid-item "+arr[i].shape+"'&gt; &lt;div class='grid_content'&gt;"+arr[i].img_holder+"&lt;/div&gt;&lt;div class='grid_title red'&gt;"+arr[i].naslovhj+"&lt;/div&gt; &lt;div class='content_grid'&gt;&lt;/div&gt; &lt;/div&gt;" } out += " "; document.getElementById("grids").innerHTML = out; console.log("uspjelo"); }, error:function(){ $("#ea").html('There was an error updating the settings'); } }); </code></pre> <p>Content in testphp.php is : </p> <pre><code>$conn = new mysqli($servername, $username, $password, $dbname); $myArray = array(); if ($result = $conn-&gt;query("SELECT * FROM postovi")) { $tempArray = array(); while($row = $result-&gt;fetch_object()) { $tempArray = $row; array_push($myArray, $tempArray); } echo json_encode($myArray); } $result-&gt;close(); </code></pre> <p>How do i make it so that it displays 10 posts per page , and that new page is aped the bottom of this one ( when i scroll to bottom of page, it appends next 10 posts ) </p> <p>i tried few infinite scrolls, but they are not working how i imagined they would. </p> <p>EDIT : Would be cool if this can be done by ajax in the middle and i guess some php model will be needed</p> <p>EDIT 2: </p> <p>View code: </p> <p>ALL CONTENT FROM DB GOES TO #GRIDS ELEMENT IN THIS FORMAT</p> <pre><code> &lt;?php defined('BASEPATH') OR exit('No direct script access allowed'); ?&gt;&lt;!DOCTYPE html&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;script src="https://code.jquery.com/jquery-2.2.2.js" integrity="sha256-4/zUCqiq0kqxhZIyp4G0Gk+AOtCJsY1TA00k5ClsZYE=" crossorigin="anonymous"&gt;&lt;/script&gt; &lt;script src="https://npmcdn.com/[email protected]/dist/packery.pkgd.js"&gt;&lt;/script&gt; &lt;script src="src/jquery.keep-ratio.js"&gt;&lt;/script&gt; &lt;link href='https://fonts.googleapis.com/css?family=Roboto+Condensed' rel='stylesheet' type='text/css'&gt; &lt;title&gt;KO web&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="grid" id="grids"&gt; &lt;div class="grid-item grid-normal"&gt; &lt;div class="grid_content"&gt;&lt;img src=""&gt;&lt;/div&gt; &lt;div class="grid_title red"&gt; title &lt;/div&gt; &lt;div class="content_grid"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;script&gt; $( document ).ready(function() { //ajax tes $.ajax({ type:"POST", url:"testphp.php", datatype: 'json', success:function myFunction(response) { var arr = JSON.parse(response); var i; var out = " "; for(i = 0; i &lt; arr.length; i++) { out += "&lt;div id='"+arr[i].ID+"' class='grid-item "+arr[i].shape+"'&gt;&lt;div class='grid_content'&gt;"+arr[i].img_holder+"&lt;/div&gt;&lt;div class='grid_title red'&gt;"+arr[i].naslovhj+"&lt;/div&gt;&lt;div class='content_grid'&gt;&lt;/div&gt;&lt;/div&gt;" } out += " "; document.getElementById("grids").innerHTML = out; console.log("uspjelo"); } , error:function(){ $("#ea").html('There was an error updating the settings'); } }); //end off ajax test setTimeout(function(){ $('.grid_title').each(function() { var mrs = $(this).innerHeight(); $(this).css("margin-bottom", "-" + mrs + "px"); });}, 100); $( document ).ajaxComplete(function() { $('.grid').packery({ // options itemSelector: '.grid-item', gutter: 0 }); var clickDisabled = false; counter_p = 0; $(".grid-item").click(function(){ counter_p ++; if(counter_p == 1){ $(this).attr("id", "active-grid-item-momentum"); $(this).children(".content_grid").attr("id", "active_cont"); $(this).children(".grid_title").css("display","none"); var width1 = document.getElementById('active-grid-item-momentum').offsetWidth; var height0 = document.getElementById('active-grid-item-momentum').offsetHeight; $(this).children(".grid_content").css("height", height0 + "px"); $(this).children(".grid_content").css("width", width1 + "px"); $(this).append( "&lt;div id='close_all'&gt;Test&lt;/div&gt;" ); $(this).css("cursor", "default") document.getElementById('active-grid-item-momentum').style.pointerEvents = 'none'; document.getElementById('active_cont').style.pointerEvents = 'auto'; $(this).children(".grid_content").children("img").css("opacity", "0"); document.getElementById("active_cont").innerHTML="&lt;h1&gt;Sea world&lt;/h1&gt;&lt;img src='../img/Aqua-Maris-Sea-World-game.png' style='float:left; margin-top:10px; margin-bottom:10px; margin-right:10px;' /&gt;&lt;a href='http://www.google.com'&gt;djlkjfkld&lt;/a&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nisi sapien, ut scelerisque diam malesuada ut. Donec eget nibh vitae erat vehicula ullamcorper. In vitae ultricies erat. Nam at dignissim arcu. Nunc nec metus ac sem porttitor pulvinar sed vel ipsum. Phasellus nec velit sapien. Quisque vel pretium purus. In at massa nibh. Aliquam condimentum mauris nunc, ac consequat dolor scelerisque sed. Nullam sed mi vitae massa accumsan tincidunt. Curabitur in sem blandit eros interdum molestie. Sed ultricies sem ac ex consequat mollis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer sollicitudin nulla ac velit imperdiet gravida.Maecenas sed dictum leo. Mauris ac diam nec ex lobortis blandit in vitae sapien. Etiam a sodales augue, sollicitudin mattis ligula. In elementum ligula nunc, et porta purus tincidunt eu. Etiam bibendum interdum lectus. Sed convallis ornare placerat. Nullam sodales eget dui quis sodales. Donec consequat nisl eget sapien cursus semper. Pellentesque finibus facilisis nulla, sit amet pellentesque justo tristique et. Cras sodales nisl sed est euismod fringilla.Duis lacus ex, volutpat sed maximus et, dapibus in tortor. Vestibulum tristique lectus congue quam suscipit, quis varius leo consectetur. Proin enim eros, pretium sed purus eu, consectetur pulvinar velit. Pellentesque enim nunc, iaculis ut lacus ut, posuere dapibus eros. Integer ac sem molestie sem iaculis cursus. Vivamus quis eros in est molestie luctus eget quis massa. Curabitur ut metus sodales, eleifend dolor sit amet, dapibus magna. Phasellus a est libero. Nunc sed dui at felis varius semper. Ut neque metus, volutpat sed tortor a, venenatis consectetur ex.Ut ullamcorper placerat mattis. Aenean finibus mauris a dui volutpat, at vulputate justo porta. Proin scelerisque eleifend quam eget congue. Nunc laoreet cursus massa sit amet condimentum. Sed sit amet semper augue, et ultricies arcu. Nullam iaculis euismod est interdum tristique. Praesent magna velit, volutpat a varius eget, cursus vel ex. Morbi molestie leo quis accumsan fringilla. Donec in facilisis nisi, sit amet dictum ligula. Aenean vel sodales dolor, nec elementum mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus at tristique dolor. Sed blandit venenatis turpis, sed varius nisi euismod a. Integer quis nisl lorem.Sed lorem velit, varius non lacus vitae, tincidunt porttitor nibh. Aliquam facilisis vulputate ex, eget fermentum sapien congue eu. Nunc ac scelerisque ipsum, vel iaculis felis. Pellentesque iaculis, ligula at ullamcorper ullamcorper, erat justo egestas magna, ut egestas quam metus vel enim. Mauris elementum ut ex eget venenatis. Quisque quis porttitor nibh. Quisque fermentum mauris in libero commodo, vel viverra nisl faucibus. Curabitur posuere metus luctus facilisis pellentesque. Integer rutrum augue ac odio tristique eleifend. Integer semper ante vitae dapibus varius. Quisque interdum turpis vel enim tempor sollicitudin quis maximus est. Mauris efficitur dui ac velit mattis ultrices. Curabitur elementum dictum felis, sed eleifend ex elementum sed.! massa accumsan tincidunt. Curabitur in sem blandit eros interdum molestie. Sed ultricies sem ac ex consequat mollis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer sollicitudin nulla ac velit imperdiet gravida.Maecenas sed dictum leo. Mauris ac diam nec ex lobortis blandit in vitae sapien. Etiam a sodales augue, sollicitudin mattis ligula. In elementum ligula nunc, et porta purus tincidunt eu. Etiam bibendum interdum lectus. Sed convallis ornare placerat. Nullam sodales eget dui quis sodales. Donec consequat nisl eget sapien cursus semper. Pellentesque finibus facilisis nulla, sit amet pellentesque justo tristique et. Cras sodales nisl sed est euismod fringilla.Duis lacus ex, volutpat sed maximus et, dapibus in tortor. Vestibulum tristique lectus congue quam suscipit, quis varius leo consectetur. Proin enim eros, pretium sed purus eu, consectetur pulvinar velit. Pellentesque enim nunc, iaculis ut lacus ut, posuere dapibus eros. Integer ac sem molestie sem iaculis cursus. Vivamus quis eros in est molestie luctus eget quis massa. Curabitur ut metus sodales, eleifend dolor sit amet, dapibus magna. Phasellus a est libero. Nunc sed dui at felis varius semper. Ut neque metus, volutpat sed tortor a, venenatis consectetur ex.Ut ullamcorper placerat mattis. Aenean finibus mauris a dui volutpat, at vulputate justo porta. Proin scelerisque eleifend quam eget congue. Nunc laoreet cursus massa sit amet condimentum. Sed sit amet semper augue, et ultricies arcu. Nullam iaculis euismod est interdum tristique. Praesent magna velit, volutpat a varius eget, cursus vel ex. Morbi molestie leo quis accumsan fringilla. Donec in facilisis nisi, sit amet dictum ligula. Aenean vel sodales dolor, nec elementum mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus at tristique dolor. Sed blandit venenatis turpis, sed varius nisi euismod a. Integer quis nisl lorem.Sed lorem velit, varius non lacus vitae, tincidunt porttitor nibh. Aliquam facilisis vulputate ex, eget fermentum sapien congue eu. Nunc ac scelerisque ipsum, vel iaculis felis. Pellentesque iaculis, ligula at ullamcorper ullamcorper, erat justo egestas magna, ut egestas quam metus vel enim. Mauris elementum ut ex eget venenatis. Quisque quis porttitor nibh. Quisque fermentum mauris in libero commodo, vel viverra nisl faucibus. Curabitur posuere metus luctus facilisis pellentesque. Integer rutrum augue ac odio tristique eleifend. Integer semper ante vitae dapibus varius. Quisque interdum turpis vel enim tempor sollicitudin quis maximus est. Mauris efficitur dui ac velit mattis ultrices. Curabitur elementum dictum felis, sed eleifend ex elementum sed.!"; $(this).css("width", "calc(100% - 10px)"); &lt;/script&gt; </code></pre>
0non-cybersec
Stackexchange
61% of Egyptian girls aged 15-17 suffering from Female Genital Mutilation (International Federation of Gynecology and Obstetrics).
0non-cybersec
Reddit
How to populate mvc razor partial view. <p>I need to create a view that displays Order Header information and I need to add a patial view that displays a grid of Line Items. The partial view will be strongly typed from a viewmodel. I understand that I should use the html helper @Html.Partial("Path/view"). I have only used controllers up til now to open a view, populating the viewmodel before sending it to the view. Since the partial view is being called form the html helper, I would like to know is what would be the best way to populate the parital view with the model data. </p>
0non-cybersec
Stackexchange
Over 8,000 marijuana convictions in San Francisco dismissed with help from a computer algorithm.
0non-cybersec
Reddit
Windows to Windows Mapped Drive?. <p>I'm trying to work on a remote Windows Server 2012 from my Windows 10 home PC and was told they map drives pretty much like <a href="https://www.serverintellect.com/support/windowsserver/mappingdrive/" rel="nofollow noreferrer">https://www.serverintellect.com/support/windowsserver/mappingdrive/</a> where you just do \1.2.3.4\c$ and enter your account info. I gave 2 common IP addresses I use which were added to a list in the firewall.</p> <p>1) Is this still a secure way? If not, what's better for them?</p> <p>2) If it is still a secure way, why would it work from one IP and not the other? Home cable internet doesn't work but an office WiFi with a dedicated fiber line does.</p> <p>Please let me know what else you need to know as I know this isn't a lot to go on, but I'm not sure what is relevant here.</p> <p>Thanks for any tips.</p>
0non-cybersec
Stackexchange
SocketIO : WebSocket is closed before the connection is established. <p>I am using angular 4, <strong>Express 4.16.3</strong> and <strong>Socket.IO 2.1.1</strong> to create a chat engine for a <strong>Support Admin Panel</strong> where the support team using the admin panel can chat with customers on the website for which I'm using one server on the admin panel's side and <strong>2 clients</strong> where one client is again on the admin panel for the support team and the other is on the website side for the customers.</p> <p>I have two subdomains (one for panel and one for website) and referring to <a href="https://stackoverflow.com/questions/36590194/using-socket-io-server-and-client-on-different-subdomains/36606555#36606555">this answer</a> as I needed a solution for cross-domain connection in socket.io<br> The <strong>Server is on adminpanel.azurewebsites.net</strong><br> My two clients are deployed on both the subdomains :<br> <strong>Website client on website.azurewebsites.net</strong> and<br> <strong>Panel(support) client on adminpanel.azurewebsites.net</strong><br> And I've also enabled the CORS on adminpanel.azurewebsites.net (Access-Control-Allow-Origin header set to *) and i have enabled websockets on the azure portal. Both my apps are https.</p> <p><strong>Server side(admin panel) looks like this</strong>: </p> <pre><code>port = process.env.PORT || 1337; var server = require('http').Server(app); var io = require('socket.io')(server ,{ transports: ['websocket'] }); io.on('connection', function(socket) { socket.emit('socket connected') //every time a new customer added on website end, new room is created socket.on('new customer added', function(username) { socket.broadcast.emit('new room', username) }) }); server.listen(port); </code></pre> <p><strong>Client Side(admin panel) looks like this</strong> : </p> <pre><code>this.socketUrl = 'adminpanel.azurewebsites.net' this.sockets['main'] = io.connect(this.socketUrl, { transports: ['websocket'] }); this.sockets['main'].on('new room', (room) =&gt; { this.sockets[room] = io.connect(this.socketUrl+'?token=' + room, { transports: ['websocket'] }); }); </code></pre> <p>On the panel client side, a room is created for every new customer.</p> <p><strong>Client Side(website) looks like this</strong> :</p> <pre><code>this.socket = io.connect('adminpanel.azurewebsites.net?token=' + this.username, { transports: ['websocket'] }); this.socket.emit('new customer added', this.username); </code></pre> <p>Now, the problem is that, this works perfectly on localhost but on production, the warning </p> <blockquote> <p>WebSocket connection to 'wss://adminpanel.azurewebsites.net/socket.io/?token=Test%20Name&amp;EIO=3&amp;transport=websocket' failed: WebSocket is closed before the connection is established.</p> </blockquote> <p>shows up on both admin panel side and website side and after that the chat stops working.</p> <p>This <strong>warning</strong> shows up a few times then the following error is displayed : </p> <blockquote> <p><code>enter code here</code>WebSocket connection to 'wss://adminpanel.azurewebsites.net/socket.io/?token=Test%20Name&amp;EIO=3&amp;transport=websocket' failed: WebSocket opening handshake timed out</p> </blockquote> <p>After debugging, this is what I got : </p> <pre><code>engine.io-client:socket socket error {"type":"TransportError","description":{"isTrusted":true}} +4ms socket.io-client:manager connect_error +8ms socket.io-client:manager cleanup +4ms socket.io-client:manager reconnect attempt error +5ms socket.io-client:manager will wait 2154ms before reconnect attempt +3ms engine.io-client:socket socket close with reason: "transport error" +19ms engine.io-client:socket socket closing - telling transport to close +3ms socket.io-client:manager attempting reconnect +2s socket.io-client:manager readyState closed +2ms socket.io-client:manager opening https://adminpanel.azurewebsites.net?token=Test Name +3ms engine.io-client:socket creating transport "websocket" +2s engine.io-client:socket setting transport websocket +3ms socket.io-client:manager connect attempt will timeout after 20000 +10ms socket.io-client:manager connect attempt timed out after 20000 +20s engine.io-client:socket socket close with reason: "forced close" +20s </code></pre> <p>So the apps work fine for sometime, but this warning shows up and the app stops working.</p> <p>I am not able to figure out what is causing this error and how I can stop it from occurring. Is there a way around this problem? </p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
My girlfriend is sick. Why the fuck does it turn me on so much?.
0non-cybersec
Reddit
ITAP of oncoming dread.
0non-cybersec
Reddit
Is there any formula or trick to count how many times a statement inside a nested loop gets executed?. <p>I am modifying a software which is for trash collection. While reading the code, I asked myself is there any formula or trick to quickly calculate the number of time the statement gets executed inside the nested loop rather than doing it manually in head. Here's the kinda pseudo code for this----</p> <pre><code>for(i=1; i&lt;=9;i++) { sum = 0; for(j=i; j&lt;=N &amp;&amp; sum&lt;=10; j++) sum = sum + arr[j] //any quick trick to calculate it's number of execution } </code></pre>
0non-cybersec
Stackexchange
Bash Scripting not able to parse remote SSH commands correctly. <p>I'm trying to build a script to scp somefiles to another machine, but I'm trying to do some checkups before starting the actual SCP.</p> <p>One of the checks is to see if there are somefiles (collectl raw files) on a remote host.</p> <p>This is the part I have from my script:</p> <pre><code>ssh -T $USERNAME@$HOSTNAME bash &lt;&lt; EOF shopt -s nullglob FILENAMES=( ${RAWDIR}/*${DATE}* ) if (( ${#FILENAMES[@]} )) &amp;&amp; [[ -e ${FILENAMES[0]} ]] then echo "At least one file matches the name" &gt;&amp;2 exit 0 else echo "No files exist" &gt;&amp;2 exit 1 fi EOF </code></pre> <p>But I get this error:</p> <pre><code>tooladm@mxmcato01:tooladm/scripts&gt; bash -x colplot.sh 20190201 + PLOTDIR=/var/lib/zabbix/collectlfiles + RAWDIR=/opt/app/collectl + IMDG=3 + HOSTNAME=mxmcaim03 + USERNAME=abpdg3 + DATE=20190201 + SSH_CONN=zabbix@mxmcamon05 + SEARCH_STRING='/opt/app/collectl/mxmcaim03-20190201*' + [[ 1 -ne 1 ]] + [[ 20190201 =~ ^[0-9]{8}$ ]] + date -d 20190201 + is_valid=0 + [[ 0 -ne 0 ]] + file_exists + ssh -T zabbix@mxmcamon05 FILES ARE NOT THERE, PROCEEDING WITH THE IMPORT + (( 0 )) + import_files + ssh -T abpdg3@mxmcaim03 bash bash: line 5: unexpected argument `]]' to conditional unary operator bash: line 5: syntax error near `]]' bash: line 5: `if (( 0 )) &amp;&amp; [[ -e ]]' </code></pre> <p>What I had to do to make it work as expected is creating a second script the same hosts from where I'm executing this script and redirect its out to my ssh connection, like this:</p> <pre><code>lookup_remote_files() { ssh -T $USERNAME@$HOSTNAME "bash -s" &lt; ./colplot_remote.sh "$DATE" } bash -x colplot.sh 20190201 + PLOTDIR=/var/lib/zabbix/collectlfiles + RAWDIR=/opt/app/collectl + IMDG=3 + HOSTNAME=mxmcaim03 + USERNAME=abpdg3 + DATE=20190201 + SSH_CONN=zabbix@mxmcamon05 + SEARCH_STRING='/opt/app/collectl/mxmcaim03-20190201*' + [[ 1 -ne 1 ]] + [[ 20190201 =~ ^[0-9]{8}$ ]] + date -d 20190201 + is_valid=0 + [[ 0 -ne 0 ]] + lookup_local_files + ssh -T zabbix@mxmcamon05 FILES ARE NOT THERE, PROCEEDING WITH THE IMPORT + (( 0 )) + lookup_remote_files + ssh -T abpdg3@mxmcaim03 'bash -s' 20190201 At least one file matches the name + (( 0 )) </code></pre> <p>I need to make this work from within the same script.</p> <p>UPDATE:</p> <p>The error is not there anymore, which I had also tried that, but it is not working as expected, for the date I'm using there are no files there:</p> <pre><code>tooladm@mxmcato01:tooladm/scripts&gt; bash -x colplot.sh 20190205 + PLOTDIR=/var/lib/zabbix/collectlfiles + RAWDIR=/opt/app/collectl + IMDG=3 + HOSTNAME=mxmcaim03 + USERNAME=abpdg3 + DATE=20190205 + SSH_CONN=zabbix@mxmcamon05 + SEARCH_STRING='/opt/app/collectl/mxmcaim03-20190205*' + [[ 1 -ne 1 ]] + [[ 20190205 =~ ^[0-9]{8}$ ]] + date -d 20190205 + is_valid=0 + [[ 0 -ne 0 ]] + lookup_local_files + ssh -T zabbix@mxmcamon05 FILES ARE NOT THERE, PROCEEDING WITH THE IMPORT + (( 0 )) + lookup_remote_files + ssh -T abpdg3@mxmcaim03 bash At least one file matches the name + (( 0 )) </code></pre>
0non-cybersec
Stackexchange
Image source not readable : Image Upload in Laravel. <p>I'm trying to upload an image to our system. It is working well when I'm using it in <code>localhost</code> but when I'm testing in server, it's throwing an error <code>Image source not readable</code>. I'm trying to upload a 2.2MB photo since my max size of image upload is 3MB. Uploading images less than or equal to 2MB in server has no problem but in local, it accepts up to 3MB in which it is the expected behavior. I'm using docker for my local development and my server is CentOS7. Is there some configurations I should touch so that it can accept 3MB image size in my server? Or is there something I have to change in my code below in processing the image? </p> <p><strong>REQUEST</strong></p> <pre><code>public function rules() { return [ 'photo' =&gt; 'image|mimes:jpeg,png,jpg|max:3000', ]; } </code></pre> <p><strong>Controller</strong></p> <pre><code>$photo = $request-&gt;file('photo'); $server_dir = storage_path(config('const.upload_local_temp_path')); FileHelper::addDirectory($server_dir, 0777); $file_name = FileHelper::makeUniqFileName($photo-&gt;getClientOriginalExtension(), $server_dir); $filepath = $server_dir . $file_name; $img_path = FileHelper::storeResizeImg($photo-&gt;path(), $filepath, null, 300); $img_url = FileHelper::getPublicPath($img_path); return $img_url; </code></pre> <p><strong>FILEHELPER</strong></p> <pre><code>/* * */ public static function addDirectory($directory, $mod) { if (!File::exists($directory)) { File::makeDirectory($directory, $mod, true); } } /** * */ public static function storeResizeImg($file, $filepath, $width, $height) { $org_img = Image::make($file); $org_img-&gt;orientate(); $org_img = $org_img-&gt;resize($width, $height, function ($constraint) { $constraint-&gt;aspectRatio(); }); $org_img-&gt;save($filepath); return $filepath; } public static function makeUniqFileName($ext, $path) { $file_name = ''; while (1) { $file_name = sha1(rand().microtime()).'.'.$ext; if (!File::exists($path. $file_name)) { break; } } return $file_name; } </code></pre> <p><strong>UPDATE</strong></p> <p>Error message that the image size is greater than 3MB is working in my local, but in server it says : <code>The given data was invalid.</code></p> <p>Please let me know of your thoughts.</p>
0non-cybersec
Stackexchange
Genus of a Compact Riemann Surface. <p>I was reading from Otto Forster's Lectures on Riemann Surfaces, and he defined the genus of a surface in a way that does not reflect any geometric intuition.</p> <p>Basically, we prove that <span class="math-container">$H^1(X,\mathcal{O})$</span>, the first cohomology group with coefficients in <span class="math-container">$\mathcal{O}$</span>, where <span class="math-container">$X$</span> is a compact Riemann surface, and <span class="math-container">$\mathcal{O}$</span> is the sheaf of holomorphic functions, is finite-dimensional, and we define that as the genus of the surface <span class="math-container">$X$</span>.</p> <p>On the other hand, the genus is the number of handles on the surface, that is, the maximum number of non-intersecting closed curves such that the surface remains connected. </p> <p>It is clear how defining the genus in terms of curves actually gives us the number of handles on the surface, but it is totally unclear how the dimension of the first cohomology group actually captures that concept. </p> <p>I would be grateful if someone can give me the connection.</p>
0non-cybersec
Stackexchange
Expected number of good presents. <p>Given <span class="math-container">$b$</span> boys and <span class="math-container">$g$</span> girls. Children give presents to each other. They know who gives a present whom from random permutation of <span class="math-container">$1,2,\dots b+g$</span>. If child gives present to child with same gender present is good with probability <span class="math-container">$p_1$</span>, otherwise probability is <span class="math-container">$p_2$</span>. Presents are good independently. We have a random variable <span class="math-container">$X$</span> representing number of good presents. What is <span class="math-container">$E(X)$</span> and <span class="math-container">$Var(X)$</span>?</p> <p>My idea of solving this: Without loss of generality I assume that <span class="math-container">$g \le b$</span>. Let <span class="math-container">$f(k)$</span> - number of permutations representing cases in which exactly <span class="math-container">$k$</span> girls give present to boys. <span class="math-container">$f(k) = [g (g-1)\cdots (g-k+1)b(b-1) \cdots (b-k+1)]\cdot [g (g-1)\cdots (g-k+1)]\cdot b! = \frac{g!}{(g-k)!}\frac{b!}{(b-k)!} \frac{g!}{(g-k)!}b!$</span> <span class="math-container">$E(X) = \sum\limits_{k=0}^{g}{\frac{f(k)}{(b+g)!}(E(Binom(b+g-2k, p_1))+E(Binom(2k, p_2)))} = \frac{g!g!}{(b+g)!}\sum\limits_{k=0}^{g}{\frac{(b+g-2k)p_1+(2k)p_2}{(b-k)!(g-k)!(g-k)!}}$</span></p> <p>How to finish it?</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Purpose of the NULL Space and big picture. <p>Can someone help me understand the purpose of finding the NULL space? I understand how to calculate but I’m failing to see the big picture. To be honest I feel like I understand certain aspects of linear algebra but I feel like I’m failing to understand the big picture and how the pieces relate like null space, column space, etc. I searched but couldn’t find a good explanation of how it all fits as a whole. Any help is appreciated and I’m new so if I did something wrong please correct me.</p>
0non-cybersec
Stackexchange
Boat Rendering Fixed in 1.9.
0non-cybersec
Reddit
&&&&& - arca.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
I need a super-cool anniversary present.. I'm not all that creative so I'm here to beg to borrow your creativity. My husband and I have had a really rough year and it'll be our 2nd anniversary in October. I want to do something really, you know, special and thoughtful but I can't think of anything that isn't really expensive. He's a geek, likes Star Wars and Doctor Who, video games...big geek. Kinda typical "dude", prefers beer and pizza to most other foods. Also, we live outside the US. Help?
0non-cybersec
Reddit
How to move Windows 7 files + apps to new PC when old PC no longer works. <p>Nutshell summary: old Windows 7 PC no longer stays running for more than a few minutes, but the hard disk still works. We obtained a new Windows 7 PC, and I'm trying to move user files, settings and applications over to the new machine. I <em>thought</em> this would have an easy solution, and I searched around and examined many answers on SuperUser and elsewhere, but everything I've found seems to assume one of the following scenarios: </p> <ol> <li>the old PC still runs (e.g., to use Windows Easy Transfer <a href="https://superuser.com/a/345687/114443">[per this answer at SuperUser]</a>), or </li> <li>I want to boot the old drive in the new PC <em>as the new PC's drive</em>, or </li> <li>I want to clone the old drive to the new drive. </li> </ol> <p><strong>None of these are my case</strong>: the old PC doesn't run long enough to use Windows Easy Transfer, I want to use the <em>new</em> disk in the new PC, and I "just" want to copy/transfer/migrate user files &amp; applications (and associated registry settings and miscellaneous files and whatnot). </p> <p>What is a good option to migrate the user settings, email, data, etc. from the old disk to the new one, preserving the new Windows copy on the new disk? Since I can install the old disk in the new machine, to have both available, and since both systems are running Windows 7, I hope this will be easier than in other situations. Yet I can't find a straightforward solution. I must be missing something obvious.</p> <p>The old PC is not worth trying to repair. I don't want to use the old disk in the new computer because the disk is old enough that eventually it will fail too. If reinstalling all the software is necessary, then that's doable, but I'm not a Windows expert and don't know how to transfer the settings and other files that the various software packages might need – so I'd appreciate pointers in the right direction.</p>
0non-cybersec
Stackexchange
ASUS is blocked from posting to MSI UK facebook page..
0non-cybersec
Reddit
SQL Server - creating a historical data backup. <p>I've run out of space on my SQL Server 2008 Express DB.</p> <p>i'm creating a "duplicate" SQL Server 2008 Express DB so i can backup my data before i purge my DB so i can start over. Is there a way in SQL Server to view the DDL text file, so i can easily recreate the empty table before i push data into it?</p> <p>Also, is there as "easy" way to bulk push data from one table into another once i've created the backup structure?</p> <p>at first i tried deleting some old rows, but of course that just increases the log file.</p>
0non-cybersec
Stackexchange
How to draw a single commutative diagram with double-ended arrow?. <p>I would like to draw a very single commutative diagram, I look for some basic examples to modify but did not found one that uses an arrow towards the left and the right (&lt;--->): <img src="https://i.stack.imgur.com/4MLwn.jpg" alt="My diagram">, if I write \leftarrow the resulting arrow is very small. I have found that tutorial for <a href="http://www.jmilne.org/not/CDGuide.html" rel="nofollow noreferrer">commutative diagrams</a>, but was not very useful. If you can help, I would like to know the code that allows to fix the diagram in a slide. </p>
0non-cybersec
Stackexchange
Best way to get rid of unused networking equipment?. Hey all, So at my job we have some networking equipment that we would like to sell (Cisco 3600 among other things). this equipment isn't new, but its still valuable. We paid quite a bit for some of these things, and would like to sell it. I'm new at this so i have no idea where to begin to look. There doesnt seem to be much of a market on ebay for this kinda stuff so thats not an option. Does anyone have any experience selling used network equipment? Are there any channels to reach this goal that i am unaware of? Any insight would be greatly appreciated.
0non-cybersec
Reddit
Does anyone else want the old title screen music back?. [discussion] The old music felt so much more hopeful and exciting than the new dark Taken King music. I understand why they changed it, Oryx was here and we needed to feel in danger. The thing is though that we beat Oryx and no one feels threatened by him anymore. Am I a day 1 fanboy who misses the feels from year 1? Probably. But maybe some people agree with me. Link for those who haven't heard it: https://www.youtube.com/watch?v=LRKfd5EKBtI Edit: If anyone could provide the name of this track, that would be great. I have the whole OST on Spotify but haven't been able to find this
0non-cybersec
Reddit
Random Forest performing much better than other methods. <p>When evaluating the performance of SVM, RF and a DT (max_depth = 3), I am getting really superior results with the RF model. The data being modeled on is real world data. They are all evaluated using stratified cross validation, since the data set is imbalanced.</p> <p>For the 4 different classes seen before, I am getting these scores for precision, recall and F1.</p> <p>Originally, the data set contained the following values_counts for the 4 classes shown below:</p> <ol> <li><strong>Feeding faults- (Diff. P-set/P-actual):</strong> 4 098 data samples</li> <li><strong>Feeding faults- (Feeding safety circuit faulty):</strong> 383 data samples</li> <li><strong>Generator heating:</strong> 228 668 data samples</li> <li><strong>Other:</strong> 51 966 851 samples</li> </ol> <p><strong>How could RF be so much better than SVM and DT?</strong> </p> <p>Thanks in advance! </p> <p><a href="https://i.stack.imgur.com/nn2ci.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nn2ci.png" alt="enter image description here"></a></p> <p><a href="https://i.stack.imgur.com/W7DVY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W7DVY.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
She showed you WHAT?!.
0non-cybersec
Reddit
Finding an optimal schedule [Dynamic Programming]. <p>I'm reading through an algorithm textbook and I've come across yet another problem that I'm stuck on. I'm looking for some help solving it and if anyone could provide some similar, already-existing, problems that I could reference to follow similar steps, that'd be great.</p> <p>This is the problem:</p> <p><img src="https://i.stack.imgur.com/YItas.jpg" alt="Scheduling problem"></p>
0non-cybersec
Stackexchange
Unable to print with lpr command. <p>I can't print with the <code>lpr</code> command even though I can print without the use of command line.</p> <p>What am I doing wrong?</p> <p><a href="https://i.stack.imgur.com/YihiK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YihiK.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
Potato seal.
0non-cybersec
Reddit
Rotten Tomatoes Issues Statement On Plot To Sabotage Black Panther's Audience Score.
0non-cybersec
Reddit
Can&#39;t import two p12/pfx client certificates into Chrome or Firefox. <p>I have a website I want to use client authentication certificates with. This is just a personal website for myself and a handful of family/friends, so I created a CA to sign some certificates that I can distribute to them so they can sign on without a password.</p> <p>The problem is, I created two client certificates in p12 format, but I can't load <strong>both</strong> into Chrome OR firefox. But I CAN load each individually, but I get 'unknown errors' when I try to load the second.</p> <p>So if I load my cert first into chrome or firefox, it loads fine. Then If I add my wife's, I get an error. If I delete mine and add only my wife's cert, it adds fine. But then when I try to import my cert, it gives an error.</p> <p>This is how I created everything.</p> <pre><code>#1 Make CA and Cert openssl genrsa -aes256 -out projects_ca.key 4096 openssl req -new -x509 -days 365 -key projects_ca.key -out projects_ca.crt #2 Make Server Key openssl genrsa -aes256 -out projects_server.key 4096 openssl req -new -key projects_server.key -out projects_server.csr #3 Self Sign Server Key openssl x509 -req -days 365 -in projects_server.csr -CA projects_ca.crt -CAkey projects_ca.key -set_serial 001 -out projects_server.crt #4 Make Client Key openssl genrsa -aes256 -out husband_client.key 4096 openssl req -new -key husband_client.key -out husband_client.csr #5 Sign Client Key openssl x509 -req -days 365 -in husband_client.csr -CA projects_ca.crt -CAkey projects_ca.key -set_serial 001 -out husband_client.crt #6 Converet Client Key to p12 openssl pkcs12 -export -out husband_client.p12 -inkey husband_client.key -in husband_client.crt -certfile projects_ca.crt </code></pre> <p>Then I repeat steps 4-5 for 'wife_client'.</p> <p>But I can NOT import BOTH wife_client.p12 AND husband_client.p12 into Chrome.</p> <p>Specifcally, in Chrome when I import the 2nd key. It asks for the p12 password, which I enter. But then it gives this error:</p> <p>"Unknown Error"</p> <p>In Firefox, I import the 2nd key, it also asks for the password which I enter, then I get this error:</p> <p>"The PKCS #12 operation failed for unknown reasons."</p> <p>Chrome is actually Chromium 53.0.2785.143</p> <p>Firefox is 52.0.2 on Linux</p> <p>How do I import two .p12 keys? They work individually, and I can sign into my website when I have just one installed. How can I get two installed?</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Not sure if y'all like this sort of thing here, but I finished up this knife handle and thought you guys might appreciate it..
0non-cybersec
Reddit
How can I watermark an image in Java?. <p>How can I create a watermark over an image using Java? I need user-entered text to be added to a provided position over an image. Any sample code/suggestions will help.</p>
0non-cybersec
Stackexchange
Dizziness after squats..how to prevent it?. hey Fittit, I was doing SL 5x5 for about 2 months before getting a new job last month and not working out for a month. Today, I finally dug out the motivation to go and did some light workouts. I did 2 x 135 of squats plus some warm up sets and got extremely dizzy afterwards. I know it is probably because of not going to the gym in a month, but is there a way to prevent this the next time I go?
0non-cybersec
Reddit
Cala lily and hydrangea tattoo by Liz Venom, from Bombshell Tattoo Galerie in Edmonton, Canada.
0non-cybersec
Reddit
Linear transformation, show that points on a plane mapped back on the same plane.. <p>I need help with the second part of this question</p> <p><a href="https://i.stack.imgur.com/meuF8.jpg" rel="nofollow noreferrer">Question</a></p> <p>The eigenvalues, with their corresponding eigenvectors are as follows (answers to the first part):</p> <p>λ = 1 , $e_1$ = –2j + k</p> <p>λ = 2 , $e_2$ = i + j</p> <p>λ = 3 , $e_3$ = 2i + 2j + k</p> <p>The answer scheme gives these steps (for the second part):</p> <p>r = se + tf</p> <p>A(se + tf) = sAe + tAf = (sλ)e + (tμ)f</p> <p>I do not understand how λ and μ come about, a step by step guide would be appreciated. </p>
0non-cybersec
Stackexchange
Pry not stopping when called from a Ruby script that reads from stdin. <p>I've created a console Ruby script that uses ARGF to load data from a file or stdin, that then calls Pry.</p> <p>This works great when I pass a file in (Pry pauses) but fails (Pry doesn't stop and just exits Ruby) when I pass my data using stdin.</p> <p>This is weird, anyone know why? I would like to pass data in via stdin and have Pry pause.</p> <p>Behold, an example script:</p> <pre><code>require 'rubygems' require 'pry' def pry_it(str) binding.pry end pry_it(ARGF.read) </code></pre> <p>When I call this app with a file in ARGV I get my proper response - pry pausing</p> <pre><code>% bundle exec ruby pry_test.rb file.txt From: /Users/wilcoxr/Development/json_pry/pry_test.rb @ line 8 Object#pry_it: 6: def pry_it(str) 7: =&gt; 8: binding.pry 9: end [1] pry(main)&gt; </code></pre> <p>Great! I can execute Pry commands all I want</p> <p>When I try to use STDIN to send data into my tool:</p> <pre><code>% cat file.txt | bundle exec ruby pry_test.rb From: /Users/wilcoxr/Development/json_pry/pry_test.rb @ line 8 Object#pry_it: 6: def pry_it(str) 7: =&gt; 8: binding.pry 9: end [1] pry(main)&gt; % </code></pre> <p>Look closely: note I'm back at my shell prompt, not pauses in IRB. Weird! I don't understand why I'm getting this behavior....</p>
0non-cybersec
Stackexchange
Viewing 32-bit floats in Internal Call disassembly from .NET 2.0 DLL in x64dbg. <p>I'm new to using x32/64dbg and I have an EXE with PDB symbols and want to disassemble and debug an unmanaged function call. It's from an x86 .NET 2.0 DLL where the unmanaged code sits compiled inside the EXE.</p> <p>I have looked up the internal call that I want to debug in the symbols, and set up breakpoints on the entry and exit of the function. </p> <p>The function takes a set of 3 32-bit floats in the .NET DLL method call as inputs through an internal call that runs some calculations and then outputs a set of 4 32-bit floats back to .NET. </p> <p>The function basically does a few sin/cos/atan2 calls on the parameters, along with some other math that I want to review for accuracy. Is there a way to read the parameter values as floats? I couldn't seem to find this in the docs anywhere. Basically I just need to get the values of the inputs and outputs to the function.</p> <p>In the lack of finding a method I tried to whip up a quick app to input 4 bytes as hex and output the sign/exponent/significand based on some docs here (<a href="https://msdn.microsoft.com/en-us/library/system.single(v=vs.110).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/system.single(v=vs.110).aspx</a>) but my results aren't matching up with the app's input, I'm sure I'm not doing something right.</p> <p>Disassembly of the function looks like so:</p> <pre><code>push ebp mov ebp,esp mov eax,dword ptr ss:[ebp+8] sub esp,10 push 4 push eax lea ecx,dword ptr ss:[ebp-10] push ecx call &lt;testapp.ConversionFunction&gt; movq xmm0,qword ptr ds:[eax] mov ecx,dword ptr ss:[ebp+C] movq dword ptr ds:[ecx],xmm0 movq xmm0,qword ptr ds:[eax+8] add esp,C movq qword ptr ds:[ecx+8],xmm0 mov esp,ebp pop ebp ret </code></pre>
0non-cybersec
Stackexchange
Best pic I’ve taken of my boy Ollie.
0non-cybersec
Reddit
Saudi will shut down air defenses to allow Israel to bomb Iranian Nuclear facilities.
0non-cybersec
Reddit
Search for a specific file in a set of folders. If that file is the only one in the folder, delete the folder. <p>I have a very large eBook library. The structure is as follows:</p> <pre><code>/Library /Author Name /Book Name /{.pdf .mobi .epub eBook files}, {.opf metadata files}, {.jpg book cover files} </code></pre> <p>About 15% of the 11,000 "Book Name" folders I have contain only a .opf file and sometimes a .jpeg/.jpg/.png/.gif cover file, with no eBook files.</p> <p>I would like to write something that can find folders that do not contain an eBook file (.pdf/.epub/.mobi) and delete the contents of the "Book Name" folder, the "Book Name" folder itself, and if it is the only "Book Name" folder in the "Author Name" folder, delete the "Author Name" folder, as well.</p> <p>I am completely knew to this, but will continue to research and post my results here if someone else can't help me out.</p>
0non-cybersec
Stackexchange
How can I increment and decrement a value in angularjs?. <p>I have one value initially - let's call it x. Selecting the increment button should increase "+1" to the value. If I select decrement, x should decrease by -1. </p> <p>However, what actually happens is that when I press the increment button, it increases +1 but if i click decrement, it decreases -2. It should only be increased/decreased by 1 value only. Also don't require continuous iteration (count++ and count--). it would be better if "count" is taken as variable inside .js file, not mentioning it in html as ng-init="count=15" .</p> <p><a href="http://jsbin.com/huyozapena/1/edit" rel="noreferrer"><strong>JsBin</strong></a></p> <pre><code>&lt;div ng-controller="CounterController"&gt; &lt;button ng-click="count = {{count}}+1" ng-init="count=15"&gt; Increment &lt;/button&gt; count: {{count}} &lt;button ng-click="count = {{(count) - 1}}"&gt; Decrement &lt;/button&gt; &lt;div&gt; </code></pre>
0non-cybersec
Stackexchange
What services does hosts.allow NOT affect?. <p>I know that hosts.allow and host.deny only affect things that are tcpwrappered, but what does this mean in practice? It seems that most people use hosts.allow to handle ssh and nfs blocking, but what other services are typically handled there? And what services AREN'T typically handled there?</p> <p>Edit: ok, I realize I did a terrible job of explaining what I was after. No, I'm not interested in knowing if a particular service <strong>can</strong> be handled by hosts.allow, I want to know if a service <strong>will</strong> be handled. For example, if I do an <code>lsof -i</code>, I get a nice list of things that are listening for connections to my box. I want to know which ones will be affected if I go stick an entry into hosts.allow (well, I really want to know which ones <strong>won't</strong> be affected).</p>
0non-cybersec
Stackexchange
Is it possible to detect IDS name and version. <p>the title said it. Is it possible to detect IDS name and version. If server use Snort as IDS, would I be able to detect it from external PC? And if it's possible how?</p>
0non-cybersec
Stackexchange
Is there a good reason to initialize a static variable on every call to the function where it is defined?. <p>A colleague is doing some code review, and he is seeing many static variable declarations similar to the following:</p> <pre><code>void someFunc(){ static int foo; static int bar; static int baz; foo = 0; bar = 0; baz = 0; /* rest of the function code goes here */ } </code></pre> <p>Our question is, Are the programmers who wrote this code simply unclear on the concept of a static variable, or is there some clever reason to do this on purpose?</p> <p>If it makes any difference, the environment is an embedded microcontroller and the compiler is GCC.</p>
0non-cybersec
Stackexchange
How do I split AND encode an audio into two parts and merge them back using ffmpeg?. <p>Excuse the long question, I don't know an easier/shorter way to tell you my point.</p> <p>I want to use ffmpeg to edit (fadeout etc.) AND split an audio file and merge it back together after. (I can't use -c copy because I use filters)</p> <p>Using mp3 the split position obviously breaks when merging back together. So I tried using a raw, linear format but that produces artifacts at the split point, too.</p> <p>Is there an audio codec that can be used for my purpose or do you have any other idea that could solve my problem? Thanks in advance!</p> <p>As a starting point, here is my commands right now:</p> <pre><code>ffmpeg -t 20 -i song.mp3 -filter_complex afade=t=in:ss=0:d=2 -vn -f u16le part1.raw ffmpeg -ss 20 -i song.mp3 -filter_complex afade=t=out:ss=60:d=2 -vn -f u16le part2.raw </code></pre> <p>^ I know this can be done without splitting, but I will later pipe the output etc. in a live environment so I need to split/merge...</p> <p><code>ffmpeg -f u16le -i "concat:part1.raw|part2.raw" -vn output.mp3</code></p>
0non-cybersec
Stackexchange
Use of $\curlywedge$ for a void/empty sequence?. <p>In <a href="https://books.google.com/books/about/Quantification_in_Nonclassical_Logic.html?id=RXMzk-ZbC78C&amp;printsec=frontcover&amp;source=kp_read_button#v=onepage&amp;q&amp;f=false" rel="nofollow noreferrer"><em>Quantification in Non-Classical Logic</em></a>, Gabbay et al. use the curly wedge symbol ($\curlywedge$) to denote a void/empty sequence (see page 20 in the Google Books preview; it's introduced on page xviii in the introduction).</p> <p>Is this an established/common notation? Does anyone know where the notation comes from, assuming it isn't novel to this book?</p>
0non-cybersec
Stackexchange
The reason why I joined the Horde back when....
0non-cybersec
Reddit
This ravioli rolling pin.
0non-cybersec
Reddit
Odd parenthesis spacing in beamer. <p>I'm using Beamer for the first time.</p> <pre><code>\documentclass{beamer} \usepackage{polyglossia} %\usepackage{setspace} %\usepackage{parskip} \usepackage{mathtools} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \usepackage{bm} \usepackage{commath} % caps \usepackage[justification=centering]{caption} \usepackage{subcaption} \usepackage{verbatim} \usepackage{graphicx} \usepackage{asymptote} % units \usepackage{siunitx} \setdefaultlanguage{french} % fonts \usefonttheme{serif} \usepackage{fontspec} \setbeamertemplate{caption}[numbered] \input{commands} </code></pre> <p>However, </p> <pre><code>\begin{equation} I_1\ddot{\theta} + \od{\!V}{\theta}(\theta(t)) = 0 \end{equation} </code></pre> <p>produces this undesirable spacing issue around (t) : <a href="https://i.stack.imgur.com/t31bE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t31bE.png" alt="enter image description here"></a></p> <p>It's really minor, but nevertheless irks me. Where does it come from ?</p>
0non-cybersec
Stackexchange
Error in strings.xml file in Android. <p>I have declared a long string in <code>string.xml</code> of an application.</p> <p>Declared like this </p> <pre><code>&lt;string name="terms"&gt;PLEASE READ THESE TERMS OF USE CAREFULLY BY ACCESSING THIS .................&lt;/string&gt; </code></pre> <p>But this gives the following error :</p> <pre><code>error: Apostrophe not preceded by \ (in PLEASE READ THESE TERMS OF USE CAREFULLY </code></pre>
0non-cybersec
Stackexchange
Kind gesture during Ferguson unrest in 2014.
0non-cybersec
Reddit
RC4 NOMORE: Breaking RC4 in HTTPS.
1cybersec
Reddit
Period of solutions of ODEs on closed orbits. <p>Let <span class="math-container">$W$</span> be an open subset of <span class="math-container">$\mathbb R^n$</span> and <span class="math-container">$f: W \to \mathbb R^n$</span> a locally Lipschitz field.</p> <p>Suppose I know for some reason (say I have one or more first integrals) that a maximal solution <span class="math-container">$x$</span> of the ODE <span class="math-container">$\dot x = f(x)$</span>, <span class="math-container">$x(t_0) = x_0$</span> stays inside the set <span class="math-container">$M \subseteq W$</span>. Furthermore, suppose I know that <span class="math-container">$M$</span> is diffeomorphic to <span class="math-container">$S^1$</span> and <span class="math-container">$f \neq 0$</span> on all of <span class="math-container">$M$</span>.</p> <p>Is this enough to tell that <span class="math-container">$x$</span> is a peroidic solution defined for all times with image <span class="math-container">$M$</span> and period <span class="math-container">\begin{align*} p = \int_M \lVert f\rVert^{-1}\,\quad ? \end{align*}</span></p> <p>Here is a sketch of my attempt to prove it:</p> <p>I do not know a lot about differentiable manifolds. So <span class="math-container">$M \cong S^1$</span> means for me that there is some diffeomorphism <span class="math-container">$\varphi^{-1}: \mathbb R^n \to \mathbb R^n$</span> which sends <span class="math-container">$M$</span> bijectively to the circle <span class="math-container">$S^1$</span> embedded in the <span class="math-container">$x_1$</span>-<span class="math-container">$x_2$</span>-plane. Then <span class="math-container">$y = \varphi^{-1}\circ x$</span> is a maximal solution of the ODE <span class="math-container">$\dot y = (\varphi^*f)(y)$</span>, <span class="math-container">$y(t_0) = \varphi^{-1} (x_0)$</span>, where <span class="math-container">$\varphi^*f$</span> is the pullback of <span class="math-container">$f$</span> under <span class="math-container">$\varphi$</span>. That is <span class="math-container">\begin{align*} (\varphi^*f) (y) = (\varphi'(y))^{-1} f(\varphi(y))\,. \end{align*}</span> It suffices to show that <span class="math-container">$y$</span> is surjective and periodic and has period <span class="math-container">\begin{align*} p = \int _{S^1} \lVert \varphi^*f \rVert^{-1}\, . \end{align*}</span> Choose three points <span class="math-container">$a_0 = \varphi^{-1}(x_0)$</span>, <span class="math-container">$a_1$</span> and <span class="math-container">$a_2$</span> on<span class="math-container">$S_1$</span> and three diffeomorphisms <span class="math-container">$\psi_j^{-1}$</span> which map the circle segment between <span class="math-container">$a_j$</span> and <span class="math-container">$a_{j+1}$</span> respectively to a line segment on the <span class="math-container">$x_1$</span>-axis. The transformations are sketched in the picture. This effectively reduces the roblem to a one dimensional one. The result should follow from the one-dimensional version:</p> <p>Suppose <span class="math-container">$g: J \to \mathbb R$</span>, <span class="math-container">$J$</span> open in <span class="math-container">$\mathbb R$</span>, is locally Lipschitz and <span class="math-container">$[a,b] \subseteq J$</span> and <span class="math-container">$g &gt; 0$</span> on <span class="math-container">$[a,b]$</span> and <span class="math-container">$x$</span> is a maximal solution of the ODE <span class="math-container">$\dot x = g(x)$</span>, <span class="math-container">$x(0) = a$</span>. Then <span class="math-container">$x$</span> is strictly monotone increasing, <span class="math-container">$[a,b] \subseteq im(x)$</span> and the unique <span class="math-container">$t$</span> such that <span class="math-container">$x(t) = b$</span> is given by <span class="math-container">\begin{align*} t = \int_0^b 1/g(s)\, ds\,. \end{align*}</span> The one-dimensional version can be shown with help of the inverse function theorem. <a href="https://i.stack.imgur.com/32ES3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/32ES3.jpg" alt="enter image description here" /></a></p>
0non-cybersec
Stackexchange
Shrink JScroll Pane to same Height as JTable. <p>I currently have JTables nested in JScrollPanes like so:</p> <p><img src="https://i.stack.imgur.com/hZQGW.png" alt="enter image description here"></p> <p>My problem is that the number of rows in each table is variable when the table is created. What I want to do is make the JScrollpane smaller if the table is too short, but I want to keep it at a set size if the table is too long.</p> <p>How can I accomplish this?</p>
0non-cybersec
Stackexchange
Keyloger in Minecash mod !!!!!!!!!!!!!!!!!! .
0non-cybersec
Reddit
Should I stop smoking while playing Overwatch?.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Is it safe to pass pointers to data members to base class constructor?. <p>Is it safe to pass pointers to data members to base class constructor? i.e., is the memory layout of the derived class data members, at least, already set before the base class constructor is called, even if the data members are not yet initialized?</p> <p>Obviously, dereferencing the pointers must only be done after construction has completed, and the objects pointed to are already valid. But the question is if it's guaranteed that the pointers received by the base class constructor would actually still point to their objects once construction of the derived object has completed.</p> <p>The motivation is providing some functionality in the base class, for example iterating over the pointers-to-objects provided at construction and do something for each at a later time.</p> <p>It's possible to just provide a setter accessible to the derived class, but I'm curious if it's also safe to provide the pointers at construction time.</p> <p>Example:</p> <pre><code>#include &lt;iostream&gt; #include &lt;utility&gt; #include &lt;vector&gt; struct Base { Base(std::initializer_list&lt;int*&gt; ptrs = {}) : ptrs_(ptrs) {} std::vector&lt;int*&gt; ptrs_; }; struct Derived : public Base { Derived() : Base{{&amp;a_,&amp;b_,&amp;c_}} {} int a_=1, b_=2, c_=3; }; int main() { Derived obj; for (auto* ptr : obj.ptrs_) { std::cout &lt;&lt; *ptr &lt;&lt; '\n'; } } </code></pre> <p><a href="https://wandbox.org/permlink/rDJw0UU8KcWckLlo" rel="nofollow noreferrer">https://wandbox.org/permlink/rDJw0UU8KcWckLlo</a></p>
0non-cybersec
Stackexchange
Evaluate the series $\sum _{n=1}^{\infty} \frac{n}{5^n}$. <p>$$\sum _{n=1}^{\infty}\frac{n}{5^n}$$</p> <p>I tried to plug in $n=1,2,3,4,...$ but I can't use common ratio to solve problem. I think there is another way like using differentiation or integral but I don't no exactly what to do.</p>
0non-cybersec
Stackexchange
World split in 7 areas of equal population (@MaxCRoser).
0non-cybersec
Reddit
How to make text in responsive circle &lt;div&gt; responsive as well. <p><a href="https://i.stack.imgur.com/K2yED.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K2yED.png" alt="enter image description here"></a></p> <p>I have dealt with this problem for some days now and it's making me crazy, I want the text inside the circle to move in the same position inside the cirkle div when I make the screen smaller, as illustrated in the picture.</p> <p>If you have any tips please share! </p> <p>CSS Code and Html Code: </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.circleBase { border-radius: 50%; } .contact-circle { margin-top: 29%; margin-left: 4%; position: fixed; width: 23%; height: auto; padding-top: 23%; background-color: rgba(255, 86, 86, 0.2); } #contact-text { top: 20%; bottom: 20%; left: 18%; font-size: auto; position: absolute; text-align: center; width: 60%; opacity: 1; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="circleBase contact-circle"&gt; &lt;div id="contact-text"&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, &lt;/p&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p>
0non-cybersec
Stackexchange
System Volume Information folders : the system cannot find the file specified. <p>I am working on to shrink my C drive. To do so, I need to remove my System Volume Information and defragment my drive. I have tried various versions of tutorial online yet the same happens : the system cannot find the file specified.</p> <p>The command typed on prompt :</p> <pre><code>c: rmdir "system volume information" /s /q The system cannot find the file specified </code></pre> <p>The command prompt is already run as administrator and I have unhidden the directory. Is there anything else I miss? I am sorry if this question has been asked before.</p> <p>Thanks everyone.</p> <p>Edited : Here is another method I tried yet unsuccessful. This is copied from <a href="https://superuser.com/questions/242760/how-to-turn-off-system-restore-and-remove-system-volume-information-folders-in-w">another post</a> regarding similar question.</p> <blockquote> <p>Start Button -> System Preferences -> System Left Pane - System Protection Mark the Volume you are working on, then hit Configure In the Dialog popping up hit the delete button and confirm, it basically deletes all Windows Restore Points, nothing else.</p> </blockquote> <p>Yet the system volume information folder is still not empty, though system protection consumes 0 byte according to the system setting in System. I don't have enough reputation to post a screencap. Sorry for the inconvenience.</p> <p>Edited : As requested, a few pictures are attached.</p> <p>Screen cap of setting. All the restore points are deleted. The restoring function contains 0 bytes. Sorry it is in traditional Chinese.</p> <p><a href="https://i.stack.imgur.com/yev8W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yev8W.png" alt="http://i.stack.imgur.com/yev8W.png"></a></p> <p>The "system volume information" directory after setting "no restore and delete all restore points". Obviously it is not empty. It contains only ~400Mb according to "properties".</p> <p><a href="https://i.stack.imgur.com/Yb2UA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yb2UA.png" alt="http://i.stack.imgur.com/Yb2UA.png"></a></p> <p>Edited :</p> <p>Initially I wanted to do this for better defragmentation, yet still unsuccessful after several attempts. After following more suggestions, I ultimately remove the whole windows for ubuntu-windows dual boot.</p>
0non-cybersec
Stackexchange
On Sunday, April 2, Buzz Aldrin flew in a formation flight with the Air Force Thunderbirds over Kennedy Space Center, including Launchpad 39A where Apollo 11, with Aldrin onboard, headed to the moon nearly 50 years ago. Aldrin became the oldest person to fly with the Thunderbirds..
0non-cybersec
Reddit
How to search installed apps. <p>Do a one finger downward stroke to bring up the search menu. Type an app name "twitter". I expect to see the installed application "twitter" because this is the behavior that occurred in iOS 8. Instead, I see podcasts, mail, messages, notes, websites and bing searches. I have to manually click through my 100+ installed apps to open them or ask siri to do it. This behavior began immediately after upgrading to iOS 9.0.</p> <p>How do I enable search for installed apps in ios 9?</p>
0non-cybersec
Stackexchange
Division by zero in Haskell. <p>I found a quite strange inconsistency between the behaviour of <code>div</code> and <code>/</code>.</p> <pre><code>*ghci&gt; :t 1 `div` 0 1 `div` 0 :: Integral a =&gt; a *ghci&gt; :t 1 / 0 1 / 0 :: Fractional a =&gt; a *ghci&gt; 1 / 0 Infinity *ghci&gt; 1 `div` 0 *** Exception: divide by zero </code></pre> <p>I was quite surprised to notice that the fractional division by zero leads to <code>Infinity</code>, whereas <code>div</code> correctly leads to an exception. A <code>NaN</code> could be acceptable too for <code>/</code>, but why <code>Infinity</code>? There is no mathematical justification for such a result. Do you know the reason for this, please?</p>
0non-cybersec
Stackexchange
Dear Loseit, I've lost 15 pounds since September 15th, thanks for your encouragement. A month and a half ago I realized I had to take my health and life more seriously. Loseit has been the most incredible resource I could have found for motivation. I now weigh 270 pounds, down from 285 in September and from 295 in April (I had an active summer) I've also been using livestrong to count calories maintaining a 1000 calorie deficit on most days but otherwise not changing what I eat just how much. Also going to the gym 3 times a week. Please share your success stories and any food/work out strategies that are easily maintained for a busy University student/part time worker. Thank you
0non-cybersec
Reddit
How to prove limit of measurable functions is measurable. <p>I need help to prove the following theorem </p> <blockquote> <p>Suppose $f$ is the pointwise limit of a sequence of $f_n$, $n = 1, 2, \cdots$, where $f_n$ is a Borel measurable function on $X$. Then $f$ is Borel measurable on $X$.</p> </blockquote> <p>My idea is to use the standard definition like for every $c$,$\{x:f(x)&lt;c\}$ is Borel measurable. But got stuck as how to do it for sequence of $f_n$.</p>
0non-cybersec
Stackexchange
Dividing both sides by $y(x)$ when solving separable differential equations. <p>Consider, for example, the differential equation </p> <p>$$\frac{dy(x)}{dx} = y(x)$$ </p> <p>This is generally solved as follows </p> <p>$$\frac{dy(x)}{dx} = y(x) \Longleftrightarrow \frac{1}{y(x)} \frac{dy(x)}{dx}= 1 \Longleftrightarrow \int \left( \frac{1}{y(x)} \frac{dy(x)}{dx}\right) dx = \int dx \Longleftrightarrow \log|y(x)| = x+C_1 \Longleftrightarrow y(x) = C_2\exp(x)$$ </p> <p>In the first step, why are we allowed to divide both sides by $y(x)$? We are making the <em>a priori</em> assumption that $y(x) \neq 0$ for all $x$. In other words, the above argument holds only if we assume that $y(x)$ vanishes nowhere. What if there are solutions where $y(c) = 0$ for some $c$? In fact, what if there are solutions where $y(c) = 0$ and $y$ is not the zero function?</p> <p>Of course, there are <a href="https://math.stackexchange.com/questions/58097/proof-that-c-expx-is-the-only-set-of-functions-for-which-fx-fx"><em>other</em></a> ways to prove that $C\exp(x)$ uniquely satisfies the equation, but this was merely an example: </p> <blockquote> <p>Why are we allowed to do this in general when solving separable ODEs? </p> </blockquote>
0non-cybersec
Stackexchange
Limit of the $L^p$ norm of a simple function as $p\to 0^+$. <p>If $\phi:[0,1] \rightarrow (0,\infty)$ is a simple function, please give me a hint for how to calculate this limit: $$\lim_{p\to 0^+}\|\phi\|_p$$</p>
0non-cybersec
Stackexchange
Partitioning SSDs. <p>I'm a lifelong Windows user, and absolutely new to Ubuntu. I just built this new computer and wanted Ubuntu on it, but there's a bit of a learning curve...</p> <p>I have a 32GB SSD (sdb) that I would like to be just for booting and other important system things,</p> <p>and a 256GB SSD (sda) that I would like to throw documents, games, and other files and media into.</p> <p>Currently, everything is on the 32GB, and every time that I make a partition on the 250GB, I am unable to move any files over because it says I do not have permission, which is emotionally hurtful because I just made it and have administrator status.</p> <p>I downloaded a couple of games, and they play and run well, but everything is on the 32GB, which is running out of room, as I probably should have seen coming.</p> <p>So how do I get the games and downloads and such fluff (home directory?) to the bigger SSD, and have new downloads and docs default to there as well?</p> <p>I appreciate all help in advance.</p>
0non-cybersec
Stackexchange
Android undefined reference with NDK. <p>I'm trying to implement code from </p> <p><a href="https://github.com/webjb/myrobot" rel="nofollow noreferrer">here</a></p> <p>When trying to compile it, I get these errors:</p> <pre><code>Error:(339) undefined reference to `ANativeWindow_fromSurface' Error:(340) und Error:(349) undefined reference to `ANativeWindow_setBuffersGeometry' Error:(351) undefined reference to `ANativeWindow_lock' Error:(353) undefined reference to `ANativeWindow_release' Error:(406) undefined reference to `ANativeWindow_unlockAndPost' Error:(407) undefined reference to `ANativeWindow_release' Error:error: linker command failed with exit code 1 (use -v to see invocation) Information:BUILD FAILED Information:Total time: 2.012 secs Information:8 errors Information:0 warnings Information:See complete output in console </code></pre> <p><code>ANativeWindow</code> gets from 2 c++ .h files, one is </p> <pre><code>#include &lt;android/native_window.h&gt; </code></pre> <p>and other</p> <pre><code> #include &lt;android/native_window_jni.h&gt; </code></pre> <p>Now, my CMake file looks like this:</p> <pre><code>cmake_minimum_required(VERSION 3.4.1) # OpenCV stuff include_directories(D:\\opencv-3.2.0-android-sdk\\OpenCV-android-sdk\\sdk\\native\\jni\\include) add_library( lib_opencv SHARED IMPORTED ) set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopencv_java3.so) add_compile_options(-std=c++11) # Creates and names a library, sets it as either STATIC # or SHARED, and provides the relative paths to its source code. # You can define multiple libraries, and CMake builds them for you. # Gradle automatically packages shared libraries with your APK. add_library( # Sets the name of the library. native-lib # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). src/main/cpp/native-lib.cpp) # Searches for a specified prebuilt library and stores the path as a # variable. Because CMake includes system libraries in the search path by # default, you only need to specify the name of the public NDK library # you want to add. CMake verifies that the library exists before # completing its build. find_library( # Sets the name of the path variable. log-lib # Specifies the name of the NDK library that # you want CMake to locate. log ) # Specifies libraries CMake should link to your target library. You # can link multiple libraries, such as libraries you define in the # build script, prebuilt third-party libraries, or system libraries. target_link_libraries( # Specifies the target library. native-lib -ljnigraphics lib_opencv # Links the target library to the log library # included in the NDK. ${log-lib} ) </code></pre> <p>And my gradle file regarding c++ code:</p> <pre><code>defaultConfig { minSdkVersion globalConfiguration.getAt("androidMinSdkVersion") targetSdkVersion globalConfiguration.getAt("androidTargetSdkVersion") applicationId globalConfiguration.getAt("androidApplicationId") versionCode globalConfiguration.getAt("androidVersionCode") versionName globalConfiguration.getAt("androidVersionName") testInstrumentationRunner globalConfiguration.getAt("testInstrumentationRunner") testApplicationId globalConfiguration.getAt("testApplicationId") externalNativeBuild { cmake { cppFlags "-frtti -fexceptions -Werror -fexceptions -std=c++11" abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips', 'mips64' } } multiDexEnabled = true } externalNativeBuild { cmake { path "CMakeLists.txt" } } sourceSets { main { jniLibs.srcDirs = ['src/main/jniLibs'] } } </code></pre> <p>I would appreciate if someone would help me with this</p>
0non-cybersec
Stackexchange
I'm trying to recreate Etho's Llama elevator but the slime blocks won't stick to any pistons... there's no blocks for it to catch onto. Any suggestions?.
0non-cybersec
Reddit
Digging up soil near a former gas station.
0non-cybersec
Reddit
invalid_scope error in access token for client credential flow. <p>I am getting invalid_scope error in access token request for client credential flow. The error log states that "cannot request OpenID scopes in client credentials flow". I haven't requested for the open id scope. I don't know from where it came from. I need to generate access token using client credential flow.</p> <p><strong>Issue / Steps to reproduce the problem</strong></p> <p><strong>API Resource definition.</strong></p> <pre><code>public IEnumerable GetApiResources() { return new List { new ApiResource { Name = "WidgetApi", DisplayName = "Widget Management API", Description = "Widget Management API Resource Access", ApiSecrets = new List { new Secret("scopeSecret".Sha256()) }, Scopes = new List { new Scope("WidgetApi.Read"), new Scope("WidgetApi.Write") } } }; } </code></pre> <p><strong>Client Definition;</strong></p> <pre><code>return new List { new Client { ClientId = "WidgetApi Client Id", ClientName = "WidgetApi Client credential", RequireConsent = false, AllowedGrantTypes = GrantTypes.ClientCredentials, ClientSecrets = { new Secret( clientSecret.Sha256()) }, // scopes that client has access to AllowedScopes = { "WidgetApi.Read", "WidgetApi.Write"}, AccessTokenLifetime = 3600 }; } </code></pre> <p><strong>Access token request body (key - value) using postman</strong></p> <pre><code>grant_type client_credentials response_type id_token scope WidgetApi.Read WidgetApi.Write client_secret xxxxxxxxxxxxxxxxxxxxxx client_id WidgetApiClientId </code></pre> <p><strong>Relevant parts of the log file</strong></p> <pre><code>dbug: Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerConnection[4] Closing connection to database 'IdentityServer4Db' on server 'localhost\SQLEXPRESS'. dbug: IdentityServer4.EntityFramework.Stores.ResourceStore[0] Found PssUserMgtApi.Read, PssUserMgtApi.Write API scopes in database fail: IdentityServer4.Validation.TokenRequestValidator[0] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx cannot request OpenID scopes in client credentials flow fail: IdentityServer4.Validation.TokenRequestValidator[0] { "ClientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "ClientName": "xxxxxxxxxxxxxxxxxxxxxxxxx", "GrantType": "client_credentials", "Scopes": "xxxxxxxxxx.Read xxxxxxxxxxxxx.Write", "Raw": { "grant_type": "client_credentials", "response_type": "id_token", "scope": "xxxxxxxxxxxx.Read xxxxxxxxxxxxx.Write", "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 5292.2873ms 400 application/json dbug: Microsoft.AspNetCore.Server.Kestrel[9] Connection id "0HL51IVGKG792" completed keep alive response. </code></pre>
0non-cybersec
Stackexchange
How do I use unittest.TestResult?. <p>I've only been using unittest for a short time. I am using Jython 2.7.10 "final release"</p> <p>In the Python 2.7 docs explaining TestResult it says:</p> <blockquote> <p>The following methods of the TestResult class are used to maintain the internal data structures, and may be extended in subclasses to support additional reporting requirements. This is particularly useful in building tools which support interactive reporting while tests are being run.</p> <p>startTest(test) ... stopTest(test) ... startTestRun() ... stopTestRun()¶</p> </blockquote> <p>That's what I want to do... but I can't work out how you use TestResult. Here's an SSCCE...</p> <pre><code>import unittest class TestResultX( unittest.TestResult ): def startTest( self, test ): print( '# blip') unittest.TestResult.startTest( self, test ) def stopTest( self, test ): print( '# blop') unittest.TestResult.stopTest( self, test ) def startTestRun( self ): print( '# blep') unittest.TestResult.startTestRun( self ) def stopTestRun( self ): print( '# blap') unittest.TestResult.stopTestRun( self ) class TestCaseX( unittest.TestCase ): def test_nonsense(self): print( '# wotcha' ) self.assertTrue( False ) def run( self, test_result=None ): print( '# spoons starting...') test_result = TestResultX() unittest.TestCase.run( self, test_result ) print( '# ...spoons ended, tr %s' % ( test_result, ) ) unittest.main() </code></pre> <p>Results in:</p> <pre><code># spoons starting... ---------------------------------------------------------------------- Ran 0 tests in 0.015s OK # blip # wotcha # blop # ...spoons ended, tr &lt;__main__.TestResultX run=1 errors=0 failures=1&gt; </code></pre> <p>Questions:</p> <ul> <li>Why does it say <code>0 tests</code>?</li> <li>Why are <code>blep</code> and <code>blap</code> (start and end of run) not printed?</li> </ul> <p>On a more general note:</p> <ol> <li><p>Can someone possibly point to a good tutorial/book explaining "proper use"/"good practice" when it comes to TestResult, TestRunner, TestLoader, etc. I got "TDD with Python", but it doesn't seem to explain any of this.</p></li> <li><p>Can someone possibly tell me why unittest2 often seems to be used instead of unittest?</p></li> </ol> <p><strong><em>addendum</em></strong></p> <p>Following Omar Diab's efforts at looking at the source code I tried this:</p> <pre><code>def run( self, *args, **kvargs ): result = self.defaultTestResult() startTestRun = getattr(result, 'startTestRun', None) logger.info( '# calling superclass run... startTestRun? %s' % ( startTestRun, )) unittest.TestCase.run( self, *args, **kvargs ) logger.info( '# ... superclass run ended') </code></pre> <p>Unfortunately each test_XXX method then gave:</p> <pre><code># calling superclass run... startTestRun? &lt;bound method TestResult.startTestRun of &lt;unittest.result.TestResult run=0 errors=0 failures=0&gt;&gt; setUp for test_that_stuff_happened (__main__.xx_FT) tearDown for test_that_stuff_happened (__main__.xx_FT) end tearDown... . # ... superclass run ended </code></pre>
0non-cybersec
Stackexchange
zfs one pool error. <p>I have zpool with name zroot and zroot has 4 pool when electricity down system reboots and than i saw some error with 1 pool:</p> <pre><code>Solaris: Warning: can`t open object for zroot/var/crash log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement Solaris: Warning: can`t open object for zroot/var/crash log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement log_sysevent: type19 is not emplement </code></pre> <p>System FreeBSD 8.2, zfs v28 How i can destroy zroot/var/crash with out default tool zfs/zroot because it`s not work, just freeze.</p>
0non-cybersec
Stackexchange