text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
AngularJS - rejected $http promise with $routeProvider:resolve. <p>I am trying to use <code>resolve</code> in a <code>$routeProvider</code> to display the new route only when a <code>$http</code> request is finished. If the request is successful, the promise resulting from the $http.post() is resolved and the view is rendered. But if the request fails (timeout or internal error for eg.), the promise is never resolved and the the view is never rendered. How can I deal with request failure using <code>resolve</code> ? </p> <p>The most important parts of the code is bellow :</p> <p>app.js</p> <pre><code>$routeProvider.when('/warrantyResult', { templateUrl : 'partials/warranty-result.html', controller : 'WarrantyResultCtrl', resolve : { response : [ 'Warranty', function(Warranty) { return Warranty.sendRequest(); } ] } }); </code></pre> <p>controllers.js</p> <pre><code>angular.module('adocDemo.controllers', []).controller('HomeCtrl', [ '$scope', function($scope) { } ]).controller('WarrantyCtrl', [ '$scope', '$http', '$location', 'Warranty', function($scope, $http, $location, Warranty) { $scope.submitWarranty = function() { $scope.loading = true; Warranty.setRequestData($scope.data); $location.path('/warrantyResult'); }; } ]).controller('WarrantyResultCtrl', [ '$scope', 'Warranty', function($scope, Warranty) { $scope.request = Warranty.getRequestData(); $scope.response = Warranty.getResponseData(); } ]); </code></pre> <p>services.js</p> <pre><code>angular.module('adocDemo.services', []).factory('Warranty', [ '$http', '$timeout', function($http, $timeout) { /** * This service is used to query the Warranty Webmethod. The sendRequest * method is automaticcaly called when the user is redirected to * /warrantyResult route. */ var isDataSet = false; var requestData = undefined; var responseData = undefined; return { setRequestData : function(data) { //Setting the data isDataSet = true; }, getRequestData : function() { return requestData; }, sendRequest : function(data) { if(isDataSet) { var request = $http.post('url/to/webservice', requestData); request.success(function(data) { responseData = data; }); return request; } }, getResponseData : function() { return responseData; } }; } ]); </code></pre> <p>I know i could use a promise around the $http call and resolve it even if the request is a failure, but I'm wondering if there is a simpler solution.</p> <p>Thanks for reading and, hopefully, helping :)</p>
0non-cybersec
Stackexchange
799
2,798
Hardware requirements for 100 virtualized high performance Windows 7 desktops?. <p>We are debating whether to add Client Hyper-V or VMWare Player Pro to new Windows 10 desktops later this year and have our developers run their developer tools in a Windows 7 VM on their local desktop. For security reasons, they will not have admin rights on their local workstation which will only be used to host their VM(s) and for office work not requiring admin rights such as email, web, Microsoft Office etc.).</p> <p>The developers would have admin rights on the VMs instead. The VMs would be on an isolated network VLAN and AD domain with no Internet access and no direct file transfer or network access between the VM and host. The users will do all their development and testing inside the VMs.</p> <p>I have not been able to find a true virtual machine "player" that only allows using existing VMs and not creating new ones when installed on a workstation. </p> <p>Client Hyper-V does not work at all unless the users have either local admin rights on the host machine or are members of the Hyper-V Administrators group which allows them unlimited configuring of VM settings which will make it pretty simple for them to get around restrictions even without admin rights on the host. VMWare Player is not just a player. It also allows creating new VMs even without admin rights.</p> <p>Is there any alternative vm software that allows use of existing VMs on their local workstation, but not adding or reconfiguring VM hardware?</p> <p>If that cannot be done, how can we build a highly available virtual server in Hyper-V that would have the performance needed for heavy software development, long queries and builds and debugging etc.. Many of the developers work with 10 or more applications running at the same time and have 16GB RAM on their current systems.</p> <p>So, I would guess we would need 2 very powerful severs with a huge amount of RAM to run 100 high memory VMs simultaneously and some kind of virtual SAN. It will also need the disk space and I/O to handle 100 busy workstation VMs. </p> <p>If there were 100 VMs, we could run 50 on each in a 2 member failover cluster. If one goes down, the other would need to be able to handle the load of all 100 without a problem. We could also do planned live migrations to do maintenance such a Windows Update reboots on the hosts. We would then need SCVMM to manage them and assign private cloud access to the users so they can access the VMs and also create/revert checkpoints on their software testing VMs.</p> <p>Since we have limited money, what would be a cost effective hardware design that could make this work (server specs etc.) and what ballpark price range would we expect to pay using hardware from a manufacturer like Dell or HP etc..? </p> <p>If the costs are astronomical, we would then go back to the plan of adding VMs locally on workstations and try to find ways to restrict the users from creating unauthorized VMs.</p>
0non-cybersec
Stackexchange
702
3,006
Changing parameters for GCP CLoud run with gcloud command. <p>When we change <code>labels</code> for existing <code>CLoud Run serivces</code> using <code>gcloud</code> command , it does a <code>deployment</code> as well as <code>revision</code> change</p> <pre><code> $gcloud run services update test --update-labels env=prod,test=test1 ✓ Deploying... Done. ✓ Creating Revision... ✓ Routing traffic... Done. Service [test1] revision [test1-00003-wik] has been deployed and is serving 100 percent of traffic at https://test1-ukliefksia-uc.a.run.app </code></pre> <p>Does it cause downtime during label only change without any code change ? It seems traffic is routed and so no downtime for application . Please confirm</p>
0non-cybersec
Stackexchange
227
798
SRP-6 vulnerabilities when N is small. <p>I'm one of the developers of an application which uses SRP-6 as the authentication mechanism. The authentication part of the code is very old and uses N with only 256 bits (all arithmetic is done in modulo N). After receiving reports of stolen passwords we upgraded to SRP-6a with the size of N 1024 bits.</p> <p>We are still investigating (both on the client and server side) how the passwords were stolen/broken. I know that SRP-6 with such a low N value is vulnerable to man-in-the-middle attacks and "two-for-one" guessing (<a href="http://srp.stanford.edu/srp6.ps" rel="nofollow">SRP-6 Improvements and Refinements</a> paper by Thomas Wu). The attacks were probably made only on the client side, but this made me very curious.</p> <p>Would it be possible for an attacker to launch an offline dictionary/brute-force attack on the B public key:</p> <blockquote> <p>B = (k*v + g^b % N) % N <br> N - 256 bits long <br> b - 152 bits long (random private key - generated using OpenSSL library)</p> </blockquote> <p>Is it possible with modern technology? Could the attacker somehow predict or find out the random value b, extract v=g^x % N, then perform a discrete logarithm and find x?</p>
1cybersec
Stackexchange
349
1,241
MVC controller API access in Blazor not working with .NET Core 3.0. <p>I am trying to setup a Blazor Server side app, but running into an issue with the app reading data from my MVC Controller API. I have a controller for my model Study called StudyController. I can access the json data for my GetAll() route "/studies" when I launch the Blazor app, but the Blazor app is not reading the data. Code below:</p> <p>StudyController:</p> <pre><code>[Route("studies")] [ApiController] public class StudyController : ControllerBase { private StudyRepository _ourCustomerRespository; public StudyController() { _ourCustomerRespository = new StudyRepository(); } //[Route("Studies")] [HttpGet] public List&lt;Study&gt; GetAll() { return _ourCustomerRespository.GetStudies(); } } </code></pre> <p>Razor page function section trying to access data:</p> <pre><code>@functions { IList&lt;Study&gt; studies = new List&lt;Study&gt;(); protected async Task OnInitAsync() { HttpClient Http = new HttpClient(); studies = await Http.GetJsonAsync&lt;List&lt;Study&gt;&gt;("/studies"); } } </code></pre> <p>Startup.cs configuration code:</p> <pre><code> public void ConfigureServices(IServiceCollection services) { services.AddMvc(options =&gt; options.EnableEndpointRouting = false) .SetCompatibilityVersion(CompatibilityVersion.Version_3_0); services.AddControllers(); services.AddRazorPages(); services.AddServerSideBlazor(); services.AddSingleton&lt;WeatherForecastService&gt;(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseMvcWithDefaultRoute(); app.UseEndpoints(endpoints =&gt; { endpoints.MapControllers(); endpoints.MapBlazorHub(); endpoints.MapFallbackToPage("/_Host"); }); } </code></pre>
0non-cybersec
Stackexchange
694
2,432
Compactness of $\ A= \{f: f$ is power series with infinite radius of convergence and is bounded by $1\}$. <p>Consider the set <span class="math-container">$\ K=C[0,1]$</span>, the set of continuous functions on <span class="math-container">$\ [0,1]$</span>, with the supremum norm. Let <span class="math-container">$\ A= \{f: f$</span> is power series with infinite radius of convergence and is bounded by <span class="math-container">$1\}$</span>. I am asked to prove or disprove whether A is compact or not.</p> <p>I tried noting a counterexample to show that the set isn't closed. <span class="math-container">$$ \sum^{\infty}_{k=0}\frac{(-1)^{k}x^{2k+1}}{(2k+1)!}=\sin(x) $$</span></p> <p>This is a power series which converges to <span class="math-container">$\sin(x)$</span> which isn't in the set. Does this work?</p>
0non-cybersec
Stackexchange
265
828
How to login into mysql shell from localhost instead of &#39;%&#39;?. <p>I need to grant a permission to a newly created user. I have access to root. But, i can't grant a permission to a new user. When I run:</p> <pre><code>grant all privileges on 'newuser'.* to 'newuser'@localhost; </code></pre> <p>I got this:</p> <pre><code>ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'newuser' </code></pre> <p>The part that I don't understand is why do I logged in as <code>'root'@'%'</code>? Since I logged in with this command:</p> <pre><code>mysql --protocol TCP -h localhost -u root -p </code></pre> <p>But this:</p> <pre><code>select user(), current_user(); </code></pre> <p>gives me this:</p> <pre><code>+----------+----------------+ | user() | current_user() | +----------+----------------+ | root@::1 | root@% | +----------+----------------+ </code></pre> <p>I know only <code>'root'@'localhost'</code> has grant privilege. Then I check <code>mysql.user</code> table which gives me output (only different columns shown here):</p> <pre><code>+-----------+---------+------------+-----------------------+ | Host | User | Grant_priv | authentication_string | +-----------+---------+------------+-----------------------+ | localhost | root | Y | | | % | root | N | NULL | +-----------+---------+------------+-----------------------+ </code></pre> <p>Other columns that is not included above for <code>'root'@'localhost'</code> and <code>'root'@'%'</code> are identical.</p> <p>So, back to my question: How to login into mysql shell from localhost instead of '%'?</p> <p><strong>NOTE</strong>: I run mysql version 5.5.21 on windows 10 machine.</p>
0non-cybersec
Stackexchange
533
1,764
After installing Linux Mint 19.1 on SSD_Caddy, it has not been recognised. <ul> <li><p>Linux Mint 19.1 is installed successfully on a SSD in Caddy in place of DVD driver, on a Laptop Toshiba Satellite C650</p></li> <li><p>But after installing, Linux Mint 19.1 is not been recognised.</p></li> <li>This SSD itself with the same Linux Mint 19.1, works fine when connecting it externally through an Enclosure USB.</li> <li>The SSD itself is able to be written or read files easily through the Caddy</li> <li>I tried with two Caddies, with the same result.</li> <li>I tried also two SSDs, with the same result. Any help is very appreciated</li> </ul>
0non-cybersec
Stackexchange
193
647
Beautyticket.com 50% off sale Wednesday 4/20-Friday 4/22. Personally I'm too broke right now to take advantage of anymore sales, but here's one more so I can live vicariously through you all! Take an extra 50% off your beautyticket.com purchase from Wednesday through Friday with the code **BIRTHDAY50**. Although the code won't work on items in the VIP room those items will also be discounted even further. The sale starts Wednesday 4/20 and goes through Friday 4/22. I usually find beautyticket's items to be meh, but you can find some real gems in there sometimes. Currently in stock, MAC eyeshadows in: Bright Sunshine, Warming Trend, Top Knot, Climate Blue, Nocturnelle, Dazzlelight, Stars'N'Rockets, Blanc Type, Rule, Scene, Newly Minted, Wondergrass (Atlantic Blue, Bitter, Contrast, Creme de Violet, Goldmine, Naval, and Print are in the VIP room) They also have lots of Pixi, Smashbox, and Too Faced items.
0non-cybersec
Reddit
253
924
Indicate command line activation successfully completed UWP. <p>I am working on a text-editor app that can be activated via command line. The argument provided is treated as path to file, i.e. <code>pad</code> launches the app but <code>pad &quot;C:\Sample.txt&quot;</code> launches the app and then displays the &quot;Sample.txt&quot; file. This works well in command prompt, but in power-shell after command is executed, the execution completes only after the app is closed. Also, the execution is recorded as failed. Is there any way I can notify the command to be completed successfully from my app itself??</p> <p>Example of the difference in command line activation of Windows Terminal in both command prompt and power-shell: <a href="https://drive.google.com/file/d/15gBiCcio3feGwxappgyBm68lezK5I0t2/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/15gBiCcio3feGwxappgyBm68lezK5I0t2/view?usp=sharing</a></p>
0non-cybersec
Stackexchange
275
942
Fractional ideals of maximal orders in quaternion algebras. <p>Let <em>D</em> be a skew field that is central and finite-dimensional over a number field <em>F</em> (in particular: a quaternion algebra over F). Let $\Delta$ $\subseteq$ <em>D</em> be a maximal $\mathcal{O}$$_{F}$-order. Let $\mathfrak{b}$ be a fractional left $\Delta$-ideal and say we have a $\mathbb{Z}$-basis $\omega_1, . . . , \omega_n$ for $\Delta$ with $\omega_1 = 1$. </p> <p>According to the definition of fractional ideals, we can find <em>d</em> $\in$ $\Delta$ such that <em>d</em>$\mathfrak{b}$ (or $\mathfrak{b}$<em>d</em>?) $\subseteq$ $\Delta$.</p> <p>Given this setting, what do we know about <em>d</em>? A paper I have recently read has led me to believe that <em>d</em> $\in$ $\mathbb{Z}$ but I don't see why that would be the case. </p>
0non-cybersec
Stackexchange
271
823
How I Keep the Snacking Reasonable.. On day 1, September 14th, I told myself that there would be no 'cheat days,' no 'cheat meals,' and no snacking on junk. healthy foods only. It's been working pretty well, but I must admit that I can't snack on half an avocado, piece of string cheese, and nuts all of the time. I began thinking of a reasonable snack that I could take once a week. After a few days the idea of buying a bag of popcorn kernels came to mind, and so I did it. It became obvious after the first round that the combination of high calorie / fatty oil would really get in the way of my 130 calorie snack. So I went out and purchased an air popper for $18 at Wal Mart. After the first round of that it became apparent that trying to add salt and extremely low calorie white cheddar seasoning would only result in them sliding off the popcorn to the bottom of the bowl. Dang! Fortunately, I was able to pick up a bottle of Crisco butter spray. It has no cals, no carbs, no protein, nothing. It tastes like movie theater popcorn, and it's great! I felt I should share this with /r/loseit in the event that anyone is looking for a light, 'healthy,' and affordable snack to munch on. I know, I know, the air popper is $18, but two bags of kernels, a bottle of crisco spray, and a small bottle of seasoning comes out to $9 and you can get about 60 snacks out of it so consider the air popper as an investment. I decided that thursday night will be popcorn night for me. I eat it while I'm watching 30 Rock and The Office.
0non-cybersec
Reddit
383
1,537
When is 2 a primitive root for a Sophie Germain prime $p$ or its associate $2p + 1$?. <p>A prime $p$ is a Sophie Germain prime if its associate $2p + 1$ is also prime.</p> <p>When is $2$ a primitive root for a Sophie Germain prime $p$ or its associate $2p + 1$?</p> <p>A previous question found that a Sophie Germain prime $p &gt; 3$ is of the form $6k - 1$: Frank Hubeny (<a href="https://math.stackexchange.com/users/312852/frank-hubeny">https://math.stackexchange.com/users/312852/frank-hubeny</a>), Show that a Sophie Germain prime $p$ is of the form $6k - 1$ for $p &gt; 3$, URL (version: 2016-02-21): <a href="https://math.stackexchange.com/q/1665580">Show that a Sophie Germain prime $p$ is of the form $6k - 1$ for $p &gt; 3$</a></p> <p>So far from the discussion there is an answer for the associate prime $2p + 1$. If $p \equiv 1 \pmod{4}$ then $2p + 1 \equiv 3 \pmod{8}$. This implies $2$ is a primitive root modulo $2p + 1$ since that would make $2$ a quadratic nonresidue of $2p + 1$.</p> <p>Can anything be said about the Sophie Germain prime $p$ itself given that $2p + 1$ is a prime?</p>
0non-cybersec
Stackexchange
399
1,110
Problem accessing web based email with Firefox. <p>I am running Natty Narwhal and all of a sudden I am unable to access any web based email (like Yahoo mail) I enter my user name &amp; password and hit the login button and the page that loads keeps resetting really fast and never finishes loading. the URL keeps changing with each reset. if I did not know any better I would assume that it was trying every user name/password combination to attempt to get illegal access to an/my account. However I have been able to bypass that using the Tor browser so I know that is is local to MY copy of Firefox but I do not know what files to replace/remove/edit to fix this problem. Yes I have done a virus scan with Clam Anti virus and found nothing. Please someone HELP!</p>
0non-cybersec
Stackexchange
177
769
JQuery - Call the jquery button click event based on name property. <p>I have one <strong>HTML button</strong> like,</p> <pre><code>&lt;input type="button" id="btnSubmit" name="btnName" class="btnclass" value="Click Me" /&gt; </code></pre> <p>I want to call <strong>JQuery button click</strong> event based on <code>id</code> property means, we use the code like,</p> <pre><code>$("#btnSubmit").click(function(){ //////// }); </code></pre> <p>as well as call <strong>button click</strong> event based on <code>class</code> property means, we use the code like,</p> <pre><code>$(".btnclass").click(function(){ ///////// }); </code></pre> <p>and My question is, I want to call the <strong>button click</strong> event based on <code>name</code> property means, How to do this?</p>
0non-cybersec
Stackexchange
259
793
student-teacher model in keras. <p>I'm converting student-teacher model in below url to keras one.</p> <p><a href="https://github.com/chengshengchan/model_compression/blob/master/teacher-student.py" rel="nofollow noreferrer">https://github.com/chengshengchan/model_compression/blob/master/teacher-student.py</a></p> <p>How can I give input to two model(student, teacher) and get one output from only student in keras? I'll set teacher's all tensors with trainable=false, and loss function as difference between student and teacher's output like below : </p> <pre><code>tf_loss = tf.nn.l2_loss(teacher - student)/batch_size </code></pre> <p>As I know, it is possible to give input to only one model when defining model.fit. But in this cases, I should it to both of teacher and student model.</p> <p>Thank in advance!</p>
0non-cybersec
Stackexchange
258
826
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
What is this method called - Abelization of a Group.. <p>Today, I wanted to make a post for this <a href="https://math.stackexchange.com/q/417691/8581">question</a>. There are some approach in which we can overcome the problem like <a href="https://math.stackexchange.com/a/417751/8581">this</a> and <a href="https://math.stackexchange.com/a/59314/8581">this</a>. According to my knowledge, I could solve the problem via the approach I had learned. Since I don't know <em>what is this way called</em>, so I refused to post an answer. I am very thankful if somebody tells me <strong>what is the method named?</strong> Here is some of the preliminaries but not the whole things because it is difficult for me to translate whole story (sorry).</p> <blockquote> <p><strong>Definition:</strong> Let $R=\{r_1,r_2,...,r_m\}$, $X=\{x_1,x_2,...,x_n\}$ and $G=\langle X| R\rangle$. And consider the abelian group $G/G'$. If $\alpha_{ij}$ be the sum of the powers of $x_j$ in relation $r_i$ so we can call the following matrix, the <strong>relation matrix</strong> of abelian group $G/G'$: $$M=\begin{pmatrix} \alpha_{11} &amp; \alpha_{12} &amp; ... &amp; \alpha_{1n}\\ \alpha_{21} &amp; \alpha_{22} &amp; ... &amp; \alpha_{2n}\\ \vdots &amp;\vdots &amp;\vdots &amp;\vdots\\ \alpha_{m1} &amp; \alpha_{m2} &amp; ... &amp; \alpha_{mn} \end{pmatrix}$$</p> <p><strong>Definition:</strong> Let $G=\langle X| R\rangle$, such that $|X|-|R|\le 0$. If we can make $M$ to have an standard diagonal form: $$D:=\begin{pmatrix} d_1 &amp; 0 &amp; ... &amp; 0 &amp; 0\\ 0 &amp; d_2 &amp; ... &amp; 0 &amp; 0\\ 0 &amp; 0 &amp; d_3 &amp;0 &amp; 0\\ \vdots &amp;\vdots &amp;\vdots &amp;\vdots &amp;d_k\\ 0 &amp; 0 &amp; 0 &amp;0 &amp; 0\\\vdots &amp;\vdots &amp;\vdots &amp;\vdots &amp;\vdots\\0 &amp; 0 &amp; 0 &amp;0 &amp; 0 \end{pmatrix}_{m\times n}$$ wherein $d_i\in\mathbb N\cup\{0\}$, by employing elementary row operations, then we can have $G/G'\cong\mathbb Z_{d_1}\times\mathbb Z_{d_2}\times...\mathbb Z_{d_k}$.</p> <p><strong>For example:</strong> Let $$G=\langle a,b\mid a^{2^{n-1}}=1, a^{2^{n-2}}=b^2, b^{-1}ab=a^{-1}\rangle$$ so $$G/G'=\langle a,b\mid a^{2^{n-1}}=1, a^{2^{n-2}}=b^2, a^2=1, [a,b]=1\rangle$$ Now we have $$M=\begin{pmatrix} 2^{n-1} &amp; 0\\ 2^{n-2} &amp; -2\\ 2 &amp;0\\ \end{pmatrix}\xrightarrow{R_3\leftrightarrow R_1}\begin{pmatrix} 2 &amp; 0\\ 2^{n-2} &amp; -2\\ 2^{n-1} &amp;0\\ \end{pmatrix}\to\begin{pmatrix} 2 &amp; 0\\ 0 &amp; -2\\ 0 &amp;0\\ \end{pmatrix}$$ So $G/G'\cong\mathbb Z_{2}\times\mathbb Z_{2}$.</p> </blockquote> <p>Thanks for your time reading my question. :)</p>
0non-cybersec
Stackexchange
1,022
2,639
Disable PDF preview for large files in vifm. <p>I have <a href="https://github.com/cirala/vifmimg" rel="nofollow noreferrer">combined</a> vifm with Ueberzug to preview PDF files in a pane. This is very useful for small files, unfortunately it is quite annoying with large files while scrolling across files is not smooth anymore. The chunk of code that enables preview functionality is as follows:</p> <pre><code>fileviewer *.pdf \ vifmimg pdfpreview %px %py %pw %ph %c \ %pc \ vifmimg clear </code></pre> <p><strong>Question:</strong> how to disable PDF preview for files larger than 10M? I experiment with</p> <pre><code>fileviewer *.pdf \ if getfsize(expand("%c")) &gt; 10 | echo File too large! | endif \ vifmimg pdfpreview %px %py %pw %ph %c \ %pc \ vifmimg clear </code></pre> <p>but without success.</p> <p>Any idea is appreciated.</p>
0non-cybersec
Stackexchange
285
877
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
What does the beam size represent in the beam search algorithm?. <p>I have a question about the <em>beam search algorithm</em>. </p> <p>Let's say that <code>n = 2</code> (the number of nodes we are going to expand from every node). So, at the beginning, we only have the root, with 2 nodes that we expand from it. Now, from those two nodes, we expand two more. So, at the moment, we have 4 leafs. We will continue like this till we find the answer. </p> <p><em>Is this how beam search works? Does it expand only <code>n = 2</code> of every node, or it keeps 2 leaf nodes at all the times?</em> </p> <p>I used to think that <code>n = 2</code> means that we should have 2 active nodes at most from each node, not two for the whole tree.</p>
0non-cybersec
Stackexchange
217
742
A restaurant offers 5 choices of appetizer, 10 choices of main meal and 4 choices of dessert.. <p>A customer can choose to eat just one course, or two different courses, or all three courses. Assuming all choices are available, how many different possible meals does the restaurant offer?</p> <p>So here is what I thought of. Since the question said that a customer can choose one, two or all of three courses, I would use a Venn diagram for this matter. </p> <p>First of all I created a situation where A would represent appetizer, B would be main meal and C would be desserts. So if I use a Venn diagram, the intersection in this case which can represent the customer choosing from one up to all three courses. The part where I got confused is will the intersection point between each 3 section of the Venn diagram have different unknowns? Help me out. </p>
0non-cybersec
Stackexchange
201
862
Why does summing up two inequalities alter the solution?. <p>Sorry for the basic question. But take for example:</p> <p>$$3x-8\leq 0$$</p> <p>$$-2+3x-x^2\leq 0$$</p> <p>If we sum these two inequalities we obtain: $$0\leq x^2-6x+10$$</p> <p>The solution of this inequality is of course any $x \in \mathbb{R}$. However, we can also attempt to solve them separetly and obtain: $$x \leq 8/3$$ $$(x-2)(x-1)\geq 0$$</p> <p>which of course implies that $x \in (-\infty,1]\cup[2,8/3]$.</p>
0non-cybersec
Stackexchange
196
488
How can I give temperature monitoring absolute priority over stress testing?. <p>I am trying to stress test my home-built NAS for cooling problems.</p> <p>Since neither <code>stress</code>, nor <code>FIRESTARTER</code> nor <code>mprime95</code> look after the temperatures, I want to write a small script that kills all of them (ie the one of them I am currently running) if the temperature goes up too much:</p> <pre><code>sudo renice -n -20 $$; \ maxitemp=0; \ while [ $maxitemp -le 40 ]; do sleep 1 maxitemp=$(s-tui -j | jq "[.Temp|.[]|tonumber]|max") echo "$(date +%Y-%m-%d_%H:%M:%S) Maximal Temperature $maxitemp" done; \ echo "$(date +%Y-%m-%d_%H:%M:%S) EMERGENCY KILL BECAUSE OF HIGH TEMPERATURE" | tee -a ~/stresstest.txt; \ killall stress; \ killall FIRESTARTER; \ killall mprime </code></pre> <p>However, if I boot up my Ubuntu live CD, connect it to the internet, install s-tui and jq and mprime and run it, prime95 starts the workers and the computer (a laptop, since I am testing the test before really running it on my precious NAS) <strong>stops responding</strong>, I cannot cancel prime95, no mouse moves any more, just the optical drive goes crazy. <strong>I have to stop it by pressing the power button long enough to switch the machine off.</strong> Even when I replace the script from above with a simple</p> <pre><code>sudo renice -n -20 $$; \ sleep 30; killall mprime </code></pre> <p>Why is that so? How can I give my monitoring and safety nets absolute priority over the stressing?</p> <hr> <h1>Update</h1> <p>It turned out that priorization was not the problem but mprime using too much RAM which pushed the swap/disk cache out of the RAM what made the drive go crazy and the system unresponsive. </p> <p><a href="https://www.mersenneforum.org/showthread.php?t=25429" rel="nofollow noreferrer">https://www.mersenneforum.org/showthread.php?t=25429</a></p> <p>I'll leave this question here because I think the answer of powerload79 can be very helpful to others!</p>
0non-cybersec
Stackexchange
649
2,010
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
$x^2+y^2=2z^2$, positive integer solutions. <p>Determine all positive integer solutions of the equation $x^2+y^2=2z^2$.</p> <p>First I assume $x \geq y$, and I have $x^2-z^2=z^2-y^2$. Then I have $(x-z)(x+z)=(z-y)(z+y)$, but from here, I don't know how it can help me to describe solutions (I know that there are infinitely many). </p>
0non-cybersec
Stackexchange
131
337
How to find out what causes user shell to be changed to /bin/false. <p>I have the case when one of my users are getting login disabled automatically.</p> <p>I was trying to find out what is causing this. Found that rkhunter app was monitoring changes in /etc/passwd and restoring saved version in case if change was detected. Now I have removed rkhunter completelly. But case is still there.</p> <p>I see in /var/log/secure the lines like 'change user xxx shell from /bin/bash to /bin/false'</p> <p>And thats all what I have found. Obviously, there is some app that are runing usermod command to do that change. But I unlikelly unable to find it.</p> <p>Does anyone had such cases in experience? How can I find source of the issue?</p>
0non-cybersec
Stackexchange
204
736
ping receives no packets, but tcpdump can see them coming in. <p>I'm migrating an old Ubuntu OpenVZ instance (Jaunty) to a new CentOS 6.3 host (using vzdump/vzrestore).</p> <p>Now networking does not work properly. Facts:</p> <ul> <li>It works just fine if a setup a new OpenVZ instance.</li> <li>I can connect INTO the old instance perfectly well, but it cannot connect to the outside.</li> <li>It cannot ping the host, nor anything else.</li> <li>I've cleared all iptables rules both on host and inside the VE.</li> </ul> <p>ping:</p> <pre><code>root@dolores:/# ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. ^C --- 8.8.8.8 ping statistics --- 11 packets transmitted, 0 received, 100% packet loss, time 9999ms </code></pre> <p>At the same time within the VE:</p> <pre><code>17:49:12.730360 IP dolores &gt; 8.8.8.8: ICMP echo request, id 59701, seq 1, length 64 17:49:12.735095 IP 8.8.8.8 &gt; dolores: ICMP echo reply, id 59701, seq 1, length 64 17:49:13.730305 IP dolores &gt; 8.8.8.8: ICMP echo request, id 59701, seq 2, length 64 17:49:13.735524 IP 8.8.8.8 &gt; dolores: ICMP echo reply, id 59701, seq 2, length 64 17:49:14.730411 IP dolores &gt; 8.8.8.8: ICMP echo request, id 59701, seq 3, length 64 </code></pre> <p>This output occasionally occurs with some delay, I believe because tcpdump tries to reverse-DNS the ips involved:</p> <pre><code>17:47:20.977819 IP dolores.40623 &gt; 213.133.98.97.domain: 60247+ PTR? 8.8.8.8.in-addr.arpa. (38) </code></pre> <p>I can run tcpdump on the host and get the same output immediately.</p> <p>Of course, <code>/sys/devices/virtual/net/venet0/statistics/rx_bytes</code> is updating, and none of the <code>/sys/devices/virtual/net/venet0/statistics/rx_</code> error files make a peep.</p> <p>What's the deal? Where would I look now? The problem must be related to the Ubuntu VE itself, I assume, since it works with newly created ones.</p> <p>Some more output in case it helps:</p> <pre><code>root@dolores:/# ifconfig -a lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1 RX packets:39652 errors:0 dropped:0 overruns:0 frame:0 TX packets:39398 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3344760 (3.3 MB) TX bytes:3303115 (3.3 MB) venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:78.46.236.xxx P-t-P:78.46.236.xxx Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1 </code></pre> <p>.</p> <pre><code>root@dolores:/# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default * 0.0.0.0 U 0 0 0 venet0 </code></pre> <p>On the host:</p> <pre><code>[root@olive ~]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface static.xxx.236. * 255.255.255.255 UH 0 0 0 venet0 78.46.236.xxx * 255.255.255.224 U 0 0 0 eth0 link-local * 255.255.0.0 U 1002 0 0 eth0 default gw-wan2.little- 0.0.0.0 UG 0 0 0 eth0 </code></pre>
0non-cybersec
Stackexchange
1,442
3,833
What does &quot;Throws&quot; do and how is it helpful?. <p>I am new to Java and have just came across a tutorial which uses the"Throws" keyword in a method. I have done a little research into this but still do not really understand it.</p> <p>From what I have seen so far, it is telling the compiler that a certain exception may be thrown in that particular method. Why do we need to tell the compiler this? I have made many programs using merely a try-catch statement in my methods and it has worked just fine - surely it is these try-catch statements which manage exceptions, right?</p>
0non-cybersec
Stackexchange
144
590
WIBTA if I asked my fiancé to not invite the mother of his son to our wedding?. Throwaway because fiancé knows my main account. My fiancé has a 14 year old son with another woman. They dated in high school, she got pregnant and they tried to make it work but it didn't. Now they have an agreement on 50/50 custody of the boy. I get along with their son very well, he's excited for the wedding and he's going to be our ring bearer. His mother is another story. In the past 5 years our interactions are not even interactions really. If she calls and I'm the one that picks it up, she just goes "I want to talk to \[son's name\]" or "Let me talk to \[fiancé's name\]". When I had to take their son to her place for the first time becasue my fiancé was busy I said a "Hello, good afternoon" and her response was to close the door once her son had entered the house without saying a word. Nowadays she still does it but I gave up on saying anything long ago. She also refuses to come to the birthday parties we throw for their son and throws her own parties instead where only my fiancé gets invited. Yesterday while looking through our wedding plans I went to check the guest list and I noticed that my fiancé had included her. He's not pleased with the way she treats me by any means but there are moments where keeping the peace for the sake of their son is the less troubled route. This being one of those. I get what he's trying to do, it is certainly easier for me to understand this than it is for their son. But I really don't want her at the wedding. It's going to be a small one just for us and those we truly care about and having here there just makes it lose the meaning.
0non-cybersec
Reddit
403
1,684
.htaccess File is being Ignored. <p>I have been following <a href="https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file" rel="nofollow noreferrer">this tutorial</a> for setting up my htaccess file. Mainly for SSL reasons and error document reasons <br></p> <ol> <li>First issue is this apache2 location:</li> </ol> <hr> <p>sudo nano /etc/apache2/sites-available/default <hr> When I use the above filepath it takes me to an empty file. However I figured that it is referring to my Apache2 config file, which is: <hr> /etc/apache2/apache2.conf <hr> Correct me if I'm wrong though.</p> <ol start="2"> <li>Secondly, within this file, the tutorial (and many other tutorials) are pointing me a directory. Once the directory is edited, it should look like this: <br> <code>&lt;Directory /var/www/&gt; Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all &lt;/Directory&gt;</code><br> However, my directory is not like this. This is mine: <br></li> </ol> <p><code>&lt;Directory /var/www/SalesChecker&gt; Options Indexes FollowSymLinks AllowOverride None Require all granted &lt;/Directory&gt;</code> <br> When I try to edit my own directory in any way, it seems to break the apache server and then I am unable to view any of my files from a browser. Also, why is my directory so dissimilar to the example's? <br></p> <p>My .htaccess file has an error 404 ready to go, but when a user enters an incorrect URL on my server, my error page is ignored (which isn't surprising considering I know that Apache isn't overriding All)</p> <p>Does anyone have any suggestions or ideas? Is my logic correct here? Am I looking in the wrong Apache folder? Or why when I try to edit my directory it breaks the website? <br></p> <p>My .htaccess file is in my main website folder.</p> <p>I'm a newbie to Apache and Linux work in general so any suggestions at all that would improve my knowledge would be appreciated. <br></p> <p>Thanks! </p>
0non-cybersec
Stackexchange
598
2,065
A morphism to the mapping cone?. <p>In the second part of the proof for the Proposition 2. in <a href="http://therisingsea.org/notes/DerivedCategories.pdf" rel="nofollow"><strong>Derived Categories</strong> by <em>Daniel Mufet</em></a>, one finds the following: </p> <blockquote> <p>A collection of morphisms $f^n:Q^n\to X^n\oplus Y^{n-1}$ with components $g^n:Q^n\to X^n$ and $\Sigma^n:Q^n\to Y^{n-1}$ defines a morphism of complexes $f:Q\to C_u[-1]$ if and only if $g:Q\to X$ is a morphism of complexes and $\Sigma$ is a homotopy $ug\simeq0,$ and moreover we can recover $g$ as the composite $kf.$ </p> </blockquote> <p>And my question is why is this true? </p> <p>When I compute the commutative diagram:<br> $$\begin{matrix}Q^n&amp;\overset{\partial_Q^n}{\to}&amp;Q^{n+1}\\ \downarrow f^n&amp;&amp;\downarrow f^{n+1}\\ C_u[-1]^n&amp;\overset{\partial_u^{n-1}}{\to}&amp;C_u[-1]^{n+1} \end{matrix},$$ I get the following two relations:<br> $$\begin{cases}g^{n+1}\circ\partial_Q^n=-\partial_X^n\circ g^n\\ \Sigma^{n+1}\circ\partial_Q^n=u^n\circ g^n+\partial^{n-1}\circ\Sigma^n\end{cases},$$<br> which differs from my expectations by some negative signs.<br> Since $g=kf$ is a morphism indeed, I guess I am missing something in the above calculations, but I don't see where I went wrong. </p> <p>Any help is appreciated. </p> <p>P.S. Here we wre working in an abelian category, $u:X\to Y$ is a morphism, $C_u^n:=X^{n+1}\oplus Y^n$ is the mapping cone of $u,$ and $k$ is the projection $C_u[-1]\to X.$</p>
0non-cybersec
Stackexchange
570
1,516
Which is better MAX function or ORDER BY column_name DESC with LIMIT 1. <p>I have one scenario where I want to have max value on date column,</p> <p>eg. for table</p> <pre><code>CREATE TABLE IF NOT EXISTS `sample_table` ( `id` TINYINT UNSIGNED NOTNULL, `name` VARCHAR(45) NOT NULL, `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARYKEY(`id`)) ENGINE = InnoDB; </code></pre> <p>So I used a query as below:</p> <pre><code>SELECT MAX(created_at) AS latest FROM sample_table; </code></pre> <p>But I was suggested to index created_at column and use following query for faster result</p> <pre><code>SELECT created_at FROM sample_table ORDER BY created_at DESC LIMIT 1; </code></pre> <p>I am clueless which is best way to do so? If second query is better, than why there is inbuilt MAX function</p>
0non-cybersec
Stackexchange
276
821
when I start Desktop Rstudio every time, I get an error message as:rstudio error yaml.load readlin con errorlevel errorlevel. <p>after I login the Desktop Rstudio, the following message will appear:</p> <pre><code>Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found and I try to reinstall R and Rstudio with the newest program,it still appear error again. when I start R program ,it can work with no error. Only Rstudio, and I try to rename the directory"C:\Users\Administrator\AppData\Local\RStudio-Desktop" in another name, Let it create when Rstudio launch,the error message again. And I can't knit some Rmd file working normal, it will appear following error: Error in yaml::yaml.load(string, ...) : 找不到对象'C_unserialize_from_yaml' Calls: &lt;Anonymous&gt; ... parse_yaml_front_matter -&gt; yaml_load_utf8 -&gt; &lt;Anonymous&gt; 停止执行 </code></pre> <p>Who can help me to slove the problem.Thanks very much.</p>
0non-cybersec
Stackexchange
457
1,443
C# Unit Testing with TestInitialize/TestCleanup in base class. <p>I am testing a module where every test class share the same behavior:</p> <ul> <li>Begin a transaction</li> <li>Execute SQL queries</li> <li>Rollback transaction </li> </ul> <p>I've decided to use TestInitialize and TestCleanup to execute the Begin and Rollback of transactions respectively.</p> <p>The strait forward approach would be writing the TestInitialize/TestCleanup in a parent class but that is not going to work with this testing framework.</p> <p>The <strong>work around</strong> for this was to use <strong>partial classes</strong>. This approach seems to viable in my case because my test classes are mainly stateless. Event not being the ideal solution it at least saved me a couple of copy/paste actions.</p> <p>Anyone knows a better way to do this?</p> <p>Here is a sample of the <strong>partial class</strong> solution:</p> <p>In my case I test each module separately and for this example I will use the <strong>Sales</strong> module:</p> <p><strong>SalesTest.cs file</strong>:</p> <pre><code>[TestClass] public partial class SalesTest { [TestInitialize] public void Setup() { //begin transaction } [TestCleanup] public void Cleanup() { //rollback transaction } } </code></pre> <p><strong>SalesTest.Order file</strong>:</p> <pre><code>public partial class SalesTest { [TestMethod] public void SaveOrder_OnlyRequiredValuesFilled_SuccessfullySaved() { //Run some SQL queries } } </code></pre>
0non-cybersec
Stackexchange
454
1,560
PHP in Aptana - function declarations?. <p>I was wondering if there is an easier (or just any) way to declare functions in PHP files. For example, let's say we have following function:</p> <pre><code>function myfunc($parama = '', $paramb = 0) {} </code></pre> <p>Would it be possible to add (as part of PHP bundle) a snippet to create:</p> <pre><code> /*** * * * @param $parama String * @param $paramb Integer * @return * @author * @copyright {current_date} */ </code></pre> <p>In case it's doable, the bundle would auto-add it just by typing <code>/***</code> above function.</p> <p>Any thoughts are warmly welcome. I managed to do that in TextMate a while ago, but can't figure out how to do it in Aptana.</p> <p>FYI: I'm referring to Aptana 3.0.6.</p> <p>Thanks! :)</p> <p>...</p> <p><em>(an hour later)</em></p> <p>Actually, I figured it out - created a snippet for this:</p> <pre><code>snippet 'Declare Function' do |s| s.trigger = 'docf' s.scope = 'source.php' s.expansion = '/*** * * * @param * @return * @author $6 * @copyright ' + Time.now.strftime('%Y-%m-%d') + ' */ function ${1:functionName}($2) { $0 }' end </code></pre> <p>Hope it's useful for other devs. :)</p>
0non-cybersec
Stackexchange
463
1,253
Get refunded orders and refunded order items details in Woocommerce 3. <p>I see when I look at an order it will show the specific item that was refunded if the whole order wasn't. </p> <p>Is there a way to find using the <code>WC_Order_Item_Product</code> if an item was refunded? Also, is there a way to get the discount amount that shows up below the item in the order view? </p> <p>I'm currently doing it manually but if there is a function for it already, I would rather use it.</p>
0non-cybersec
Stackexchange
139
491
is this right truth value. <p>Let $P(x,y)$ be the predicate $2x+y = xy$, where the domain of discourse for $x$ and $y$ is integers. Determine the truth value of each statement.</p> <p>$P(-1,1)$ : true</p> <p>$\exists xP(x,y)$ : true</p> <p>$\exists yP(4,y)$ : false</p> <p>$\forall yP(2,y)$ : false</p> <p>$\forall x \exists y(x,y)$ : false</p> <p>$\exists y \forall x(x,y)$ : false</p> <p>Have I answered correctly or have not?</p> <p>Please guide me if I'm wrong. thank you.</p>
0non-cybersec
Stackexchange
211
494
Why is dd so slow on a NVMe SSD?. <p>I recently watched <a href="https://www.youtube.com/watch?v=Zuwa8zlfXSY" rel="nofollow noreferrer">this video</a> and in it, the author explains that a ram disk is far faster than HDD/SSD when using <code>dd</code> command. I understand why this is the case. What I don't understand, however, is why I got a write speed of 220MB/s when I did his example command of <code>dd if=/dev/zero of=test.iso bs=1M count=8000</code> on a system with 16GB of RAM, a 12-core Ryzen 3600X CPU, and a NVMe SSD rated at up to 5GB/s write speeds.</p> <p>I understand RAM will always be faster, but this seems so slow that there must be something else at play here. Is it the way that he was using the <code>dd</code> command? I don't know the internals of <code>dd</code> but is this a situation where the system is limiting the performance, or has the command just been misused?</p> <p><em>Note: After running the exact same command a second time in a row, the second write was much faster at 1.4GB/s, but this doesn't clear up confusion for me.</em></p>
0non-cybersec
Stackexchange
324
1,078
Is it possible to access `WriterT`&#39;s partially collected `tell`s in case of exception?. <p>Is it possible to have a WriterT monad that is able to share its partially collected <code>tell</code>s in case of an exception? If I <code>try</code> outside of <code>runWriterT</code> the <code>w</code> seems to be discarded. If I try to <code>try</code> inside, I seem to need <code>MonadUnliftIO</code>. <code>MonadUnliftIO</code> sounds like it could help me, but that package says that it is only able to unlift monadic contexts and not monadic state which I guess Writer is. Has anyone done this with Writer or something similar?</p> <p>Example pseudocode:</p> <pre class="lang-hs prettyprint-override"><code>x &lt;- runWriterT $ do result &lt;- try $ do tell "a" tell "b" error "c" tell "d" case result of Left e -&gt; Just e Right a -&gt; Nothing x `shouldBe` (Just "c", "ab") </code></pre>
0non-cybersec
Stackexchange
297
926
AppleScript : searching for a tab on chrome and saving the tab as a variable. <p>I'm using this script which is finding the tab I want, then bring the tab to focus.</p> <p>set searchString to "Tab I'm Looking FOR"</p> <pre><code>tell application "Google Chrome" set win_List to every window set win_MatchList to {} set tab_MatchList to {} set tab_NameMatchList to {} repeat with win in win_List set tab_list to every tab of win repeat with t in tab_list if searchString is in (title of t as string) then set end of win_MatchList to win set end of tab_MatchList to t set end of tab_NameMatchList to (id of win as string) &amp; ". " &amp; (title of t as string) end if end repeat end repeat if (count of tab_MatchList) is equal to 1 then set w to item 1 of win_MatchList set index of w to 1 my setActiveTabIndex(t, searchString) else if (count of tab_MatchList) is equal to 0 then display dialog "No match was found!" buttons {"OK"} default button 1 else set which_Tab to choose from list of tab_NameMatchList with prompt "The following Tabs matched, please select one:" set AppleScript's text item delimiters to "." if which_Tab is not equal to false then set tmp to text items of (which_Tab as string) set w to (item 1 of tmp) as integer set index of window id w to 1 my setActiveTabIndex(t, searchString) end if end if end tell on setActiveTabIndex(t, searchString) tell application "Google Chrome" set i to 0 repeat with t in tabs of front window set i to i + 1 if title of t contains searchString then set active tab index of front window to i return end if end repeat end tell end setActiveTabIndex </code></pre> <p>This work fine, but how can I save the tab number as a variable so if I need to do more stuff in this actual tab I can just do something like this (imagining the tab number is saved as "TABNUMBER")</p> <pre><code>tell application "Google Chrome" set myTab to front window's tab TABNUMBER set URL of myTab to "https:..." end tell </code></pre>
0non-cybersec
Stackexchange
621
2,325
How to change the icon size of Google Maps marker in Flutter?. <p>I am using <code>google_maps_flutter</code> in my flutter app to use google map I have custom marker icon and I load this with <code>BitmapDescriptor.fromAsset("images/car.png")</code> however my icon size on map is too big I want to make it smaller but I couldn't find any option for that is there any option to change custom marker icon. here is my flutter code:</p> <pre><code>mapController.addMarker( MarkerOptions( icon: BitmapDescriptor.fromAsset("images/car.png"), position: LatLng( deviceLocations[i]['latitude'], deviceLocations[i]['longitude'], ), ), ); </code></pre> <p>And here is a screenshot of my android emulator: <a href="https://i.stack.imgur.com/mBejl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mBejl.png" alt=""></a></p> <p>As you can see in the picture my custom icon size is too big</p>
0non-cybersec
Stackexchange
286
970
Convergence of a sequence in $L^2(\mathbb R)$. <p>I have been stack with something which is perhaps just in front of my eyes but I just cannot get it. I have a sequence $(f_n)$ in $L^2(\mathbb R)$ which converges to $f$ in the $L^2$-topology. If I assume that $\int_{\mathbb R}f_n(x)dx=0$ for all $n$, then does it follow that $\int_{\mathbb R}f(x)dx=0$? Sorry if this too obvious.</p> <p>Thanks for answer.</p> <p>Math</p>
0non-cybersec
Stackexchange
149
426
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Does my graphics card support CUDA?. <p>I am running Ubuntu 17.10, and this is my graphics card:</p> <p><a href="https://i.stack.imgur.com/ogvSa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ogvSa.png" alt="screenshot"></a> <a href="https://i.stack.imgur.com/IqDvq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IqDvq.png" alt=""></a></p> <p>and I want to know if it is CUDA enabled. There is a NVIDIA GEFORCE sticker on my computer, so I thought it might be...</p>
0non-cybersec
Stackexchange
195
509
Is it true that smartphones could get compromised via their baseband chip?. <p>I read about this <a href="https://www.devever.net/~hl/nosecuresmartphone" rel="nofollow noreferrer">here</a>. </p> <p>If I understand this correctly, it states that a smartphones could get compromised via it's baseband chip and it's (potentially) unsafe and closed-source firmware.</p> <p>I also read <a href="https://news.ycombinator.com/item?id=10905643" rel="nofollow noreferrer">this</a> discussion about the mentioned article.</p> <p>But as I have no deep understanding of the low-level hardware used inside smartphones (or the security implications of different connection types between the GSM chip and other components, I do not really know what to believe.</p> <p>torproject.org's article "<em>Mission Improbable: Hardening Android for Security And Privacy</em>" states: </p> <blockquote> <p>Until phones with auditable baseband isolation are available (the Neo900 looks like a promising candidate), the baseband remains a problem on all of these phones. It is unknown if vulnerabilities or backdoors in the baseband can turn on the mic, make silent calls, or access device memory</p> </blockquote> <p><strong>How realistic is an attack scenario like this when thinking of an adversary capable of compromising the radio link (given a perfectly safe operating system on the smartphone)?</strong></p>
0non-cybersec
Stackexchange
360
1,396
Making mathematical expressions as balanced trees as possible. <p>I am having some trouble with turning the following mathematical expressions into as balanced binary trees as possible.</p> <p>This is what I have done so far, but is there a way to make them even more balanced?</p> <p>$(𝑥 − 3)(𝑦^2 + 𝑦 − 1)$</p> <p><a href="https://i.stack.imgur.com/k9w5k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k9w5k.png" alt="enter image description here"></a></p> <p>$4(𝑥 − 1)(𝑦 − 2)(𝑧 − 3)$</p> <p><a href="https://i.stack.imgur.com/Cs7sQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cs7sQ.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
261
681
React Handle interaction state between components. <p>I have a simple component who show element onClick:</p> <pre><code> class MyComponent extends React.Component { state = { isVisible : false } render() { const { isVisble } = this.state return( &lt;div&gt; {isVisble ? &lt;div onClick={() =&gt; this.setState({isVisble: false})}&gt;Hide&lt;/div&gt; : &lt;div onClick={() =&gt; this.setState({isVisble: true})}&gt;Show&lt;/div&gt;} &lt;/div&gt; ) } } </code></pre> <p>I use this component three times in other component :</p> <pre><code>class MySuperComponent extends React.Component { render() { return( &lt;div&gt; &lt;MyComponent /&gt; &lt;MyComponent /&gt; &lt;MyComponent /&gt; &lt;/div&gt; )} } </code></pre> <p>I need to pass isVisible at false for all other component if one of have isVisible to true</p> <p>How to do that ?</p> <p>Thanks</p>
0non-cybersec
Stackexchange
341
975
jQuery Drag and Drop on touch devices (iPad, Android). <p>We have a card game website that makes extensive use of jQuery Draggable &amp; Droppable and which has worked nearly flawlessly (when using a mouse) for almost a year.</p> <p>We would REALLY like to have the site work on touch screen devices, but we cannot seem to get jQuery's drag and especially drop functionality to work reliably.</p> <p>Dragging works "ok" unless the div being dragged is inside another dom element with any kind of offset, margin, padding, etc. If it is, the dragged element is also offset from the user's finger by a similar amount. May not sound like a big deal, but it makes the interface unusuable.</p> <p>Dropping just doesn't seem to work.</p> <p>We've researched various options presented here on SO (will try to update this post with links to some of them if I can), but none work for us.</p> <p>We've also researched jQuery Mobile but this is still in alpha and even so seems to be more of a framework for making a site emulate the UI of a phone vs what we're looking for.</p> <p>Most of the SO and Google posts on this topic seem to trail off in late 2010 which makes me think there is an obvious answer that maybe we're just missing.</p> <p>BTW, the functionality we're looking for is clearly technically possible because the YUI libraries for drag and drop work as expected. Unfortunatly, we can't justtify refactoring the site to switch from jQuery to YUI.</p> <p>Anyone out there have any ideas? We would settle for a answer that supports only iPad, but it really needs to not require we refactor the existing site.</p> <p>Thanks!</p>
0non-cybersec
Stackexchange
419
1,639
A question on Derangement Combinatorics. <p>Six cards and six envelopes are numbered <span class="math-container">$1$</span>, <span class="math-container">$2$</span>, <span class="math-container">$3$</span>, <span class="math-container">$4$</span>, <span class="math-container">$5$</span>, <span class="math-container">$6$</span> and cards are to be placed in envelopes so that each envelope contains exactly one card and no card is placed in the envelope bearing the same number and moreover the card numbered <span class="math-container">$1$</span> is always placed in envelope numbered <span class="math-container">$2$</span>. Then, what is the number of ways this can be done?</p> <p>Since card one is already fixed, I tried directly applying the Derangement formula for <span class="math-container">$5$</span> things.</p> <p>But it didn't work. I guess it's not so simple since the envelope no. <span class="math-container">$2$</span> is already occupied. </p> <p>I just need a hint on how to proceed. </p>
0non-cybersec
Stackexchange
293
1,015
Binomial Congruence (mod 5) Identity. <p>I've got a (hard?) Putnam-style problem that I've been given to look at . . . I've never worked any problem even vaguely like this, but my director thinks I should be able to do it. I doubt it (100% not my area or my taste in problem), so I need some help!</p> <p>The problem posed is to prove that 5 does not divide $\sum_{k=0}^{n} {{2n+1} \choose {2k+1}}2^{3k}$ for any $n$.</p> <p>I can interpret the summation well enough from a design or lattice path perspective, but a bijection-type proof seems futile. I've played around with some binomial identities trying to clean the expression up, but I don't have any real experience with that sort of thing and nothing seemed to "simplify" the problem.</p> <p>So, I'm just wondering if anyone has a nice proof, preferably without using generating functions - alternatively, what are the basic techniques typically used in this sort of problem, if there is any such thing? There seem to be a lot of ways to approach the problem, but not having any experience with this I don't know what direction to go, nor do I have background in most of those apparent directions =P</p> <p>Thanks a lot!</p>
0non-cybersec
Stackexchange
315
1,189
Residue of high order pole. <p>I'm trying to compute the residue $\displaystyle\operatorname{Res}\left(\frac{1}{(z^2+1)^7},i\right)$.</p> <p>I know that there is the formula: </p> <p>$$\operatorname{Res}(f,z_0)=\frac{1}{(m-1)!}\lim_{z\rightarrow z_0 }[(z-z_0)^mf(z)]^{(m-1)}$$</p> <p>for a pole with order $m$.</p> <p>But I'm pretty sure that I should not try to compute the 6th derivative of $\dfrac{1}{(z+i)^7}$.</p> <p>Is there another way to compute the residue beside this formula?</p>
0non-cybersec
Stackexchange
190
496
Using Easylist and leaving one entry bullet blank. <p>So I have a checklist using the checkboxes. I want to make occasional ones not have the check box because there are several indented checkboxes I want to choose from. I see <a href="https://tex.stackexchange.com/questions/187616/choosing-the-bullet-of-a-single-item-in-easylist">Choosing the bullet of a single item in Easylist</a></p> <p>Which gets me very close with the second one: <code>\ListProperties(Style1*=)</code></p> <p>So, how do I go back to the checkboxes? Google hasn't helped me find what the style name would be for the checkboxes again.</p> <pre><code>\documentclass[12pt,letterpaper]{article} \usepackage{multicol} \usepackage{multienum} \usepackage{comment} \usepackage[at]{easylist} \usepackage[english]{babel} \usepackage[top=.5in, bottom=1.5in, left=1.5in, right=1in]{geometry} \begin{document} \begin{easylist}[checklist] @ First thing @ Thing I want indented but no checkbox @@ Sub things I want with checkbox @@ Sub things I want with checkbox @ New thing I want with checkbox @ Another thing I want without checkbox @@ Another thing I want without checkbox @@@ Sub thing with checkbox @@@ Sub thing with checkbox @@ Another thing without checkbox \end{easylist} \end{document} </code></pre> <p>I've added the example latex with easylist. I've listed what I want to do I think...</p> <p>This is the current output</p> <p><img src="https://i.stack.imgur.com/8hlZk.png" alt="Current Output"></p> <p>This is what I want</p> <p><img src="https://i.stack.imgur.com/1pFXb.png" alt="What I want"></p>
0non-cybersec
Stackexchange
502
1,582
All I want to do is share 2 folders. <p>... on my home network.</p> <p>I've installed Ubuntu 20.04 on an SSD, created the 2 folders on an HDD in the Ubuntu machine, clicked the 'tab' on the local network share for each folder.</p> <p>One folder I want anybody on our home network to access, so I've 'ticked' "Allow others to create and delete files in this folder" and "Guest access" then changed the permissions tab to Owner, Group, and Others to "Create and delete files".</p> <p>The other folder I wish to have only accessible to me, so I've shared that then changed the permissions tab to Owner, Group to "Create and delete files", but Others have "None".</p> <p>On the Windows machine I add the network drive \ip-address\folder name for each folder. I was unable to access the first (supposedly open!) folder until I added the line "force user = myUbuntuID" under the global section of /etc/samba/smb.conf</p> <p>That has now enabled access from the Windows machine.</p> <p>I remain unable to access the second folder. On the Windows machine I add the network drive \ip-address\folder, I get user/password prompt and enter my Ubuntu ID and password, but it just says "Access is denied".</p>
0non-cybersec
Stackexchange
322
1,202
What's the most ridiculous rule your boss have ever given you? I'll start.... So, I worked at a jewelery store a year ago. One day, I was polishing watches while my manager helped some lady look at wedding bands (I wasn't really paying attention to them). It was early summer and I was suffering from some minor hay fever, so I was sniffling quite a lot. Anyways, after the lady left, my manager came up to me, looking concerned. Apparently the customer had asked her if I do crack, since apparently people who use it sniffle a lot. I laughed, thinking my manager had thought this comment was funny, and explained about my allergies. My manager was angry. She told me that I was no longer permitted to sniffle at work. When I told her that I was already using allergy medication, she told me to "use a stronger one". Dead serious. What's your story, Reddit?
0non-cybersec
Reddit
201
862
How can I track button click in google analitycs?. <p>I had register my website in the google analytics and I had put the script in my default index like this : </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta name="google-site-verification" content="****************" /&gt; &lt;script async src="https://www.googletagmanager.com/gtag/js?id=AW-7**4*7***"&gt;&lt;/script&gt; &lt;script&gt; window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-7**4*7***'); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; ... &lt;a class="" href="/Contents/Make-App"&gt; &lt;div class="text"&gt;Make app&lt;/div&gt; &lt;/a&gt; ... &lt;script src="/Content/assets/script/combined.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script async src="https://www.googletagmanager.com/gtag/js?id=UA-*4**0**6-*"&gt;&lt;/script&gt; &lt;script&gt; window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-*4**0**6-*'); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I want if I click button "make app", it will be listed on Google Analytics. so I can see how many people clicked on that button</p> <p>How can I do it? </p>
0non-cybersec
Stackexchange
497
1,301
Bibliography not showing up in Table of Contents with tocbibind package. <p>I'm trying to get the Bibliography inside my Table of Contents by using the tocbibind package, but only the List of Figures shows. I used the package like this: <code>\usepackage[nottoc]{tocbibind}</code>, and everything compiles without any errors, but the Bibliography is not in there. I saw in several forum discussions that people write the <code>\bibliography{bib}</code> command within the document class, after <code>\tableofcontents</code>, but if I try that, I get an error saying that the bibliography command can only be used in the preamble. I've also never seen how people using this package print the bibliography. I do it in the appendix like this:</p> <pre><code>\begin{appendix} \newpage \printbibliography \newpage \listoffigures \end{appendix} </code></pre> <p>The bibliography itself looks perfectly fine, it's just not listed in the contents. Does anyone have an idea what might be causing this? This is what it looks like, the Bibliography should be on page 50:</p> <p><a href="https://i.stack.imgur.com/US2TA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/US2TA.png" alt="Table of Contents showing only List of Figures" /></a></p>
0non-cybersec
Stackexchange
338
1,266
NSV: Will power and my pants are actual pants now!. Two NSV's today! This morning, I realized that my pants, which used to be pushed low by my little belly, now comfortably sit right where they should! And then, whilst eating lunch, I got about halfway through my salad and chicken breast when I realized... 'I'm full', and promptly stored the rest back in the fridge. Self control and inches lost for the win! Very small NSVs, but victories nonetheless! I've been working out about 5 times a week and watching what I eat. It's interesting to see how your body can change a noticeable amount without losing much weight. I am 25/F/5'6, SW 168, CW 164, GW 135.
0non-cybersec
Reddit
160
662
Unable to open terminal &amp; File Manager in Ubuntu 18.04. <p>Too descriptive question, please bear with me. Thank you I'm using Dell Atitude E7440, which has ubuntu 18.04. The alt+ctl+t is not opening any terminal &amp; clicking on "File Manager"(keeps on loading near Activities bar for few seconds) as well is not opening any window. I opened VS code and from there, I am able to access my terminal. So far, I have checked if there are any broken packages which seems of no issue. I have reinstalled nautilus &amp; it didn't help. When I try to right click on desktop &amp; open terminal , it as well is not opening window for terminal. Strange thing after I restarted laptop ,(File Manager broke, terminal broke &amp; Chrome asking for password out of nowhere) Please help me to open the nautilas &amp; terminal.</p> <p>I'm able to open nautilus from VS Code terminal using-</p> <pre><code>sudo nautilus Called "net usershare info" but it failed: Failed to execute child process “net” (No such file or directory) </code></pre> <p>Within Nautilus, I see two new mounted devices on the left side (efi &amp; the loaded drive to the laptop)<a href="https://i.stack.imgur.com/TajVN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TajVN.png" alt="enter image description here"></a></p> <p>Thank you</p>
0non-cybersec
Stackexchange
379
1,326
Solve for Y; don&#39;t understand Wolfram Alpha&#39;s solution. <p>Answering this StackOverflow <a href="https://stackoverflow.com/questions/28345621/converting-davenport-diagram/28352182#28352182">question</a>, I needed to solve this equation in terms of y:</p> <p>$$x = 6.1 + \log(\frac{{y}}{{0.03p}})$$</p> <p>Doing it by hand:</p> <p>$$y = 0.03p10^{{(x-6.1)}}$$</p> <p><a href="http://www.wolframalpha.com/input/?i=x%20%3D%206.1%20%2B%20log10%28y%20%2F%20%280.03p%29%29%2C%20solve%20for%20y" rel="nofollow noreferrer">Wolfram alpha</a> tells me it's:</p> <p>$$y = 3p10^{{(x-8.1)}}$$</p> <p>How are these equivalent?</p> <p><strong>EDITS</strong></p> <p>So the how is pretty straightforward, but now the why. Is this a simpler form of the equation or an artifact of Wolfram's processing?</p>
0non-cybersec
Stackexchange
341
804
Which was your first Apple product? Do you still have it?. This is more of a nostalgic post. So I came across this beauty the other day (http://i.imgur.com/5qnacAW.jpg). What a joy to use my beloved iPhone 4 was. I have literally so many wonderful memories with this little beast. Which was the first Apple product you guys ever owned? Do you still have it with you kept somewhere, and can you care to share some photographs? I was hoping we could all admire their sheer beauty, and maybe bring back the fond memories you might have had with yours.
0non-cybersec
Reddit
131
550
How can I use enum types in XAML?. <p>I'm learning WPF and I encountered the following problem:</p> <p>I have an enum type in another namespace than my XAML:</p> <pre><code> public enum NodeType { Type_SYSTEM = 1, // System Type_DB = 2, // Database Type_ROOT = 512, // Root folder Type_FOLDER = 1024, // Folder } </code></pre> <p>in my XAML I'd like to trigger an image with an integer</p> <pre><code>&lt;Image.Style&gt; &lt;Style TargetType="{x:Type Image}"&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding="{Binding Type}" Value="{NodeType: }"&gt; &lt;Setter Property="Source" Value="/Images/DB.PNG"/&gt; &lt;/DataTrigger&gt; &lt;DataTrigger Binding="{Binding Type}" Value="128"&gt; &lt;Setter Property="Source" Value="/Images/SERVER.PNG"/&gt; &lt;/DataTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/Image.Style&gt; </code></pre> <p>Is there a way to get an integer value and compare it with an enum type directly in XAML code?</p> <p>My enum is in namespace <code>AnotherNamespace.Types</code></p> <pre><code>&lt;DataTrigger Binding="{Binding IntegerType}" Value="MyEnumType.Type_DB"&gt; &lt;Setter Property="Source" Value="/Images/SERVER.PNG"/&gt; </code></pre> <p></p>
0non-cybersec
Stackexchange
450
1,431
Showing that the indicator/characteristic function is not a regulated function. <p>I want to show that the indicator function (aka. the characteristic function) is not a regulated function. </p> <blockquote> <p>\begin{align} \chi : \begin{cases}[a,b] &amp; \longrightarrow \mathbb{R} \\ x &amp; \longmapsto \begin{cases} 0, \ x \in \mathbb{Q} \cap [a,b] \\ 1 , \ x \in (\mathbb{R} \setminus \mathbb{Q} ) \cap [a,b] \end{cases} \end{cases} \end{align}</p> </blockquote> <p>The definition (Königsberger Analysis) uses seems to differ to other sources where such topics are discussed. </p> <blockquote> <p><strong>Def</strong>: A function $f: [a,b] \to \mathbb{R}$ is called a <em>regulated function</em> if $\exists (f_n)_{n \in \mathbb{N}}$ sequence of step functions $f_n: [a,b] \to \mathbb{R}$ such that $$ \lim_{n \to \infty}\|f_n-f \| =0 $$ where $\|. \|$ denotes the supremum norm.</p> </blockquote> <p><strong>My approach</strong>: I am having trouble with the 'elegant' formulation of the solution. Also I am not sure how to do the calculation.</p> <p>I want to show that for all step functions $\phi: [a,b] \to \mathbb{R}$ it follows that $\| \phi -f \| \geq 1$ or some other small value. </p> <p>So let $\phi : [a,b] \to \mathbb{R}$ be a step function and $a=x_0&lt; x_1&lt; \dots &lt; x_n =b$ a partition of $[a,b]$, since $\mathbb{Q}$ is dense in $\mathbb{R}$ I can always find $v_1 \in (a, x_1)\cap \mathbb{Q}$ and $v_2 \in (a,x_1) \cap (\mathbb{R} \setminus \mathbb{Q})$. Since $\phi$ is a step function it would also follow that $\phi(v_1) = \phi (v_2) = c_0 \in \mathbb{R}$ </p> <p>Now I want to use this for a calculation with the norm $$\| \phi - \chi \| = \sup_{x \in [a,b]} |\phi (x) -\chi(x) | \geq \max_{x \in [a,b]} | \phi (x) -\chi(x) | $$</p> <p>and now, sadly, I lack experience on how to argument with the maximum or the minimum. I tried to visalize it for easier functions than $\chi$ but I couldn't see how I could split up the maximum in order to make even use of my calculations above. </p> <p>I'd appreciate some insight on how to continue with my calculations, i.e. since I have partition of my interval, I can maybe split up the maximum for all these cases and always end up with states such as: $$ \geq \max(|\phi(v_1)-\chi(v_1)|, \dots , |\phi(v_n)-\chi(v_n)| \\ \geq \max(|\phi(v_1)-\chi(v_1)|, | \phi(v_2)- \chi(v_2)|) = \max (|c_0|, |c_0-1|) $$ but that just doesn't seem right to me.</p>
0non-cybersec
Stackexchange
876
2,445
Chrome “forgets” search engine integration. <p>When enabling the <em>Instant Extended API</em>, Chrome provides a rather nice integration of its search engine into the browser. Supposedly, this means that the Google Search website no longer displays the search text box, along with some other stuff:</p> <p><img src="https://4.bp.blogspot.com/-O5kQzNvJtRM/UgWHlheKRBI/AAAAAAABLhU/IjYy9pRIeoE/s640/chrome-new-tab-changes-3.png" alt="screenshot"></p> <p>(This screenshot is actually outdated, the actual result looked even slimmer.)</p> <p>After updating to version 30.0.1599.69, this did indeed work for me. However, for whatever reason, the setting silently reverted yesterday. Now I’m once again presented with this:</p> <p><img src="https://i.stack.imgur.com/YfGZO.png" alt="screenshot"></p> <p>Since I didn’t change <em>any</em> setting in the browser, I’m quite puzzled what might have caused this. I checked under <code>chrome://flags</code>, and “Instant Extended API” is still enabled.</p> <p>This might have something to do with the actual search URI, since it also changes search results: before the revert yesterday, searching for just “weather” would display the current weather at my location. Searching for “restaurants” would show nearby restaurants, etc. Now, searching for either of those terms doesn’t turn up relevant results, just the normal results list.</p> <p>Here’s my search engine string (needless to say, I also did <em>not</em> change it):</p> <pre><code>{google:baseURL}search?q=%s&amp;{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:omniboxStartMarginParameter}ie={inputEncoding} </code></pre> <p>How can I re-enable the search engine integration?</p> <p>(Other parts that use the Instant Extended API still work, e.g. the History still shows open tabs on my other devices.)</p> <p>In case it matters, I’m located in the UK. <code>{google:baseURL}</code> still seems to resolve to <code>google.com</code> rather than <code>google.co.uk</code> (see screenshot) but I’m reasonably certain it also did that before.</p>
0non-cybersec
Stackexchange
641
2,202
PS4's emulator for PS2 games needs anti-aliasing badly.. Okay, seriously now, with the release of the Jak games it is becoming even more clear that this emulator has no decent image quality whatsoever. There is nothing but some shitty post processing going on it seems like. Am I playing the wrong games? War of the Monsters looked terrible. And the jaggies are horrendous. Are there other games with better image quality? I was thinking about buying a couple but War of the Monsters put me off that notion. Whatever upsampling they are doing is not working, and I really have no idea why the PS2 emulator is not being improved at this point. Unless it is being improved? We never hear anything about it. Do you realize how nice it would be to play these games on a great emulator at least with better resolution with all the PS4 features? More and more I feel like I am still pushed to PCSX2 for emulation because the actual company that makes the games refuses to do anything about their own emulation. It kind of pisses me off. Do you think they will ever improve PS2 emulation on PS4? Do you have any information about any games that do look good? Are they always jaggy? https://arstechnica.com/gaming/2015/11/the-ps4-can-now-emulate-playstation-2-games/ Due to this article I thought all these games were going to look amazing. With the few I have this is certainly not the case.
0non-cybersec
Reddit
337
1,389
Ruth! (not sure if repost). A guy has a talking dog. He brings it to a talent scout. "This dog can speak English," he claims to the unimpressed agent. "Okay, Sport," the guys says to the dog, "what’s on the top of a house?" "Roof!" the dog replies. "Oh, come on..." the talent agent responds. "All dogs go ‘roof’." "No, wait," the guy says. He asks the dog "what does sandpaper feel like?" "Rough!" the dog answers. The talent agent gives a condescending blank stare. He is losing his patience. "No, hang on," the guy says. "This one will amaze you. " He turns and asks the dog: "Who, in your opinion, was the greatest baseball player of all time?" "Ruth!" goes the dog. And the talent scout, having seen enough, boots them out of his office onto the street. And the dog turns to the guy and says "Maybe I shoulda said DiMaggio?"
0non-cybersec
Reddit
228
829
Double summation index problem. <p>I often meet the following situation:</p> <p>$$\sum\limits_{n=0} ^\infty \sum\limits_{k=0} ^n f(k)g(n-k)=\sum\limits_{p=0} ^\infty \sum\limits_{q=0}^\infty f(p)g(q)$$</p> <p>While intuitively this is very clear to me, I'm having problems to rigorously prove this. Could somebody please help me out?</p> <p>So far my friends and I have come up with the map: $(n,k) \rightarrow (q,p) \text{ with } k\leq n$ where $q(n)=n-k$ and $p(n)=q+n=k$ Therefore we only need to prove bijection.</p> <p>Thanks</p> <p>EDIT: The original problem was motivated by:</p> <p>$$e^{(L_A+L_B)}=\sum\limits_{n=0} ^\infty \sum\limits_{k=0} ^n \frac{1}{k! (n-k)!} L_1^k L_2^{n-k}=\sum\limits_{p=0} ^\infty \sum\limits_{q=0}^\infty \frac{1}{p! q!} L_1^p L_2^q=$$</p> <p>where $L_A$ and $L_B \in \mathcal{B}$ and $\mathcal{B}$ is a Banach space. However, I encountered the same problem when dealing with double Fourier transforms</p>
0non-cybersec
Stackexchange
381
950
Why, when on Kubuntu I lose internet connection, am I unable to reconnect?. <p>Using Kubuntu 11.10. Sony Vaio computer. Network controller: Intel Corporation WiFi Link 5100.</p> <p>If I connect to a wireless network, and the signal drops, then I am unable to connect to any network without a reboot. I can assure that the issue has nothing to do with the computer going to sleep, as I have experienced the above while using my computer continuously.</p> <p>Here is exactly what happens:</p> <ol> <li><p>Connect to network (at University, where the connection is not so great).</p></li> <li><p>The connection is broken</p></li> <li><p>There are three other possible networks available, but none of them can be connected to. I have tried off and on sometimes for hours.</p></li> <li><p>I am always able to reestablish a connection after a reboot.</p></li> </ol> <p>I can only think of two explanations. The first is that a temp file is corrupted when the internet connection is abruptly dropped. The second is that my computer actually corrupts something before the loss of internet connection, which causes the loss in signal, and inability to reconnect. However, I am not confident that my explanations are complete, nor do I have any idea how to test these things.</p>
0non-cybersec
Stackexchange
326
1,279
c++ copy constructor with shared_ptr members. <p>From <a href="http://www.cplusplus.com/articles/y8hv0pDG/">cplusplus.com</a>:</p> <blockquote> <p>Rarely you will come across a class that does not contain raw pointers yet the default copy constructor is not sufficient. An example of this is when you have a reference-counted object. boost::shared_ptr&lt;> is example.</p> </blockquote> <p>Can someone elaborate on this? If we have a class containing a <code>boost::shared_ptr</code>, won't that get copy constructed when the class gets copy constructed - and hence won't the <code>shared_ptr</code> constructor do the right thing and increase the reference count? The following code, for example, copies <code>Inner</code> properly - why wouldn't this work for <code>shared_ptr</code>?:</p> <pre><code>#include &lt;iostream&gt; using namespace std; class Inner { public: Inner() { cout &lt;&lt; "inner default constructed" &lt;&lt; endl;} Inner(const Inner&amp; other) { cout &lt;&lt; "inner properly copied" &lt;&lt; endl;} }; class Outer { Inner i; }; int main() { Outer o; Outer p(o); return 0;} </code></pre>
0non-cybersec
Stackexchange
354
1,133
Will using the following logic work on solving the integral $A$?. <p>I have the following integral </p> <p><span class="math-container">$$ \int_0^{\frac{\pi}{3}} \cos(x)\tan\left(\frac{\pi}{6}-\frac{x}{2}\right)=A $$</span></p> <p>This integral can be solved directly with integration techniques however, for the sake of the question please assume i am not able to do so (find an anti-derivative). </p> <p>I will reflect the function on the Y axis such that </p> <p><span class="math-container">$$\int_0^{\frac{\pi}{3}} \cos(x)\tan\left(\frac{\pi}{6}-\frac{x}{2}\right) = \int_{\frac{-\pi}{3}}^{0} \cos(x)\tan\left(\frac{\pi}{6}+\frac{x}{2}\right)$$</span></p> <p>I, then subtract both integrals over the same limits of integration to obtain an antiderivative <span class="math-container">$P(x)$</span> and a value <span class="math-container">$K$</span></p> <p><span class="math-container">$$\int_0^{\frac{\pi}{3}} \cos(x)\tan\left(\frac{\pi}{6}-\frac{x}{2}\right) - \int_0^{\frac{\pi}{3}}\cos(x)\tan\left(\frac{\pi}{6}+\frac{x}{2}\right) = P(x)|_0^{\frac{\pi}{3}}=K$$</span></p> <p>Since the functions are reflections of each other I can say that the above is equivalent to </p> <p><span class="math-container">$$-\int_{\frac{-\pi}{3}}^0 \cos(x)\tan\left(\frac{\pi}{6}-\frac{x}{2}\right) + \int_0^{\frac{\pi}{3}} \cos(x)\tan\left(\frac{\pi}{6}-\frac{x}{2}\right) = P(x)|_0^{\frac{\pi}{3}}=K$$</span></p> <p>So based on this, can I use <span class="math-container">$P(x)$</span> to find the value of Integral <span class="math-container">$A$</span>? <a href="https://i.stack.imgur.com/im7pj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/im7pj.png" alt="enter image description here"></a></p> <p>Kind Regards, </p> <p>Thank you for your help and time. </p>
0non-cybersec
Stackexchange
660
1,789
delphi XE multi-unit namespace question. <p>I am reading RAD Studio Documentaion in Delphi XE. here a some texts.</p> <blockquote> <p>[ Delphi Reference -> Delphi Language Guide -> Programs and Units -> Using Namespaces -> Searching Namespaces -> Multi-unit Namespaces ] </p> <p><strong>Multi-unit Namespaces</strong></p> <p>Multiple units can belong to the same namespace, if the unit declarations refer to the same namespace. For example, one can create two files, unit1.pas and unit2.pas, with the following unit declarations: </p> </blockquote> <pre><code>// in file 'unit1.pas' unit MyCompany.ProjectX.ProgramY.Unit1 // in file 'unit2.pas' unit MyCompany.ProjectX.ProgramY.Unit2 </code></pre> <blockquote> <p>In this example, the namespace MyCompany.ProjectX.ProgramY logically contains all of the interface symbols from unit1.pas and unit2.pas. </p> <p>Symbol names in a namespace must be unique, across all units in the namespace.<br> In the example above, it is an error for Unit1 and Unit2 to both define a global interface symbol named mySymbol </p> </blockquote> <p>I tested this. code below .</p> <pre><code>----------------------------------------------------------------- program Project1; {$APPTYPE CONSOLE} uses SysUtils, Lib.A in 'Lib.A.pas', Lib.B in 'Lib.B.pas'; begin WriteLn ( TestValue ) ; ReadLn ; end. ----------------------------------------------------------------- unit Lib.A; interface const TestValue : Integer = 10 ; implementation end. ----------------------------------------------------------------- unit Lib.B; interface const TestValue : Integer = 10 ; implementation end. </code></pre> <p>This is not error. Why? I don't understand.</p>
0non-cybersec
Stackexchange
517
1,763
Categorical introduction to Algebra and Topology. <p>At the moment I am reading books on Algebra and on Category theory. More exactly, I started working through the book <em>Algebra</em> by Serge Lang. I have read the chapters on groups and rings, but then my motivation somehow disappeared and I turned to category theory.</p> <p>More exactly, I started reading <em>Categories for the Working Mathematician</em> by Saunders MacLane. I now feel comfortable with all the concepts discussed in the first five Chapters, i.e. categories and functors and the usual formulations of universal properties.</p> <p>I would really like to go on reading about algebra, but once I understood the strucutrual approaches to Mathematics, I can hardly imagine to continue doing all the awful calculations, basic Algebra books like Lang's are filled with, instead of using universal properties and so on.</p> <p>So basically, my question is, if there are books on Algebra, not assuming any algebraic knowledge, but extensively using category-theoretic methods. Of course, it is very non-standard to cover all the basic category theory before turning to applications in Algebra, but I hope someone knows a book or some lecture notes satisfying my needs.</p> <p>Furthermore, I would like to learn some topology. In this field I have even less knowledge than in Algebra, i.e. I don't even know the definition of a topological space. My question is the same as with Algebra: Is there a categorical/conceptional introduction to general topology?</p>
0non-cybersec
Stackexchange
344
1,531
Synchronise Google Drive when not logged in. <p>I have installed Google Drive on a server. When I login to the server, Google Drive starts automatically and synchronizes files, pulling changes down from the cloud. All good so far. However, I would like the sync to run even if I am not logged in.</p> <p>Is there any way to start the sync process automatically, maybe as a scheduled task?</p> <p><sub>Background: I have other jobs on the server which distribute the files by FTP so I would like the server copies of the files to be up to date.</sub></p> <p><sub>(Windows Server 2008 R2)</sub></p>
0non-cybersec
Stackexchange
157
600
Join multiple table using generic repository patten with Entity framework with unit of work. <p>I am developing a web application using MVC4 with Entity framework 5.</p> <p>I have created generic repository for accessing database with unit of work. </p> <p>Having the below two repository,</p> <ul> <li>CustomerRepository - Customer table</li> <li>LibraryRepository - Library table</li> </ul> <p>These two tables are not linked with each other( there is no foreign key relation ). </p> <p>Want to write a query by combining these repository. Is possible to write a query by combining two different repository?</p> <p>If yes, please let me know the way.</p>
0non-cybersec
Stackexchange
182
666
Odds of outcome with P probability repeated N times. <p>If I have 100 hard drives, and the odds of a hard drive failing on a given week are 1%, what is the probability of 8 (or more) hard drives failing on the same week?</p> <p>I realize this is a fairly basic probability question but I can't quite figure out how to approach the problem and which combinations/permutations/binomials/products etc to use to "Frame" the problem mathematically.</p> <p>The best I can come up with is a more generalized statement of the problem: "Given an event with probability P, what is the probability Q of the event occurring <em>at least</em> N times out of T trials?"</p>
0non-cybersec
Stackexchange
168
662
Is changing upper case to lower case URLs bad for SEO?. <p>When building an new website with same URL structure: if the old website has URLs appearing as e.g. www.example.com/ServicePage, what, if any, effect will changing the URLs to www.example.com/servicepage have on the site's SEO, given that there are probably links pointing to the existing URLs with the first format? </p> <p>I would not have thought any, since when typing the second format into the browser, it resolves to the first format with no apparent redirection. But I want to be clear before doing anything. </p> <p>Thank you for the advice. </p>
0non-cybersec
Stackexchange
156
617
Transaction records?. <p>Can you track your payment if you do a transaction from person to person for a house rental if the seller doesn't follow through with their end of the deal and doesn't send the keys can you get your money back? </p> <p>Or in other words is there a record of your transaction so you can claim a dispute or track down the person who didn't follow through? </p> <p>What safety do i have in this aspect for example i am applying for rental house but i found out they're in the states and I'm in Canada so they have to send me they keys but they want the payment first through btc wallet so if i do this and send the bitcoins and he doesn't send me the keys and i find out it was a scam is there a way for me to recover my payment? </p>
0non-cybersec
Stackexchange
187
760
Why take full backups when you can do COPY_ONLY?. <p>With a SQL Server 2012 availability group, you can only take <code>COPY_ONLY</code> full backups on replica. You can make regular <code>BACKUP LOG</code>.</p> <p>As <a href="http://sqlmag.com/blog/breaking-backup-chain-redux-or-eating-crow" rel="nofollow noreferrer">it's possible to restore logs backups</a> after a database restoration from a <code>COPY_ONLY</code> dump, do we really need to take full (non-<code>COPY_ONLY</code>) backups?</p> <p>Yeah, it creates a new LSN sequence, but if we're not doing <code>DIFFERENTIAL</code> backups, is it something we have to think about?</p> <p>By using only <code>COPY_ONLY</code> backups, I would hope to gain the ability to perform all backups on the read-only replica. My AG is asynchronous, so the backups might be behind the primary, but that is an acceptable risk.</p> <p>I do take log backups. According to my tests, I'm able to restore any log backup on a database (restored from a <code>COPY_ONLY</code> or not) as soon as the log backup LSN is more recent than the full backup. The full backup changes the <code>database_backup_lsn</code>, the <code>COPY_ONLY</code> doesn't, but it seems it doesn't affect log restore. It seems I just can't restore DIF backups, but I don't need that.</p> <p>There's a good explanation in the dba.se Q &amp;A:</p> <p><a href="https://dba.stackexchange.com/a/37071/35661">SQL Server 2008 R2 Restore COPY_ONLY full backup with transaction logs</a></p> <p>...but it does not answer my question. For now, my conclusions are: Except for the first backup (without which you will not be able to take log backups), we just can work with <code>COPY_ONLY</code> backups if we don't use differentials.</p> <p>My (general) question is: Do we really need non-<code>COPY_ONLY</code> backups if we don't take differentials, and if yes, why?</p>
0non-cybersec
Stackexchange
577
1,883
Asterisk test ISDN card. <p>I have an AVM ISDN controller C4 plugged into an asterisk machine.</p> <p>It shows up in the PCI device list as:</p> <p><code>Digital Equipment Corporation StrongARM DC21285 (rev 04)</code></p> <p>How can I test this card to see its working from Asterisk, if possible without plugging actual phones into it?</p> <p>Anybody knows a command for it inside Asterisk's CLI?</p>
0non-cybersec
Stackexchange
128
405
Razor will not render hidden accurate PK in HiddenFor. <p>Running into a weird problem in my ASP MVC 4 site. If the user opens the <code>create</code> form and attempts to add an agent to our database, we naturally run validation on the fields first. If there is an error, we save the agent in incomplete status, and redirect the user back to the create page. </p> <p>The error comes when the user attempts to re-save the agent. On the first post-back, the agent is saved into the database and a PK is generated. On the second post-back, however, the PK is being sent to the server with a value of <code>0</code> instead of what was just auto-generated.</p> <p>I've added a <code>HiddenFor</code> on the <code>Create</code> view, however this renders with a value of <code>0</code> each and every time. </p> <p>I've also stepped through the code to make sure that the PK is being generated after the <code>.Save</code> is called, is still present when <code>return View</code> is called and also ensured that the <code>Model.ID</code> property contains the same value when the view is being rendered. </p> <p>Regardless, if I right click the page and view the source, the hidden field renders like so: </p> <pre><code>&lt;input data-val="false" data-val-number="The field ID must be a number." data-val-required="The ID field is required." id="ID" name="ID" type="hidden" value="0" /&gt; </code></pre> <p><strong>Model</strong></p> <pre><code>public partial class AgentTransmission { public int ID { get; set; } . . . } </code></pre> <p><strong>View</strong></p> <pre><code>@model MonetModelFromDb.Models.AgentTransmission @{ ViewBag.Title = "Create new Agent"; } @Html.HiddenFor(model =&gt; model.CreatedDate, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.CreatedOperator, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.ReferenceNumber, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.Region, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.INDDist, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.LastChangeDate, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.LastChangeOperator, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.EditTaxId, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.ParentId, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.IsSubstat, new { data_val = "false" }) @Html.HiddenFor(model =&gt; model.ID, new { data_val = "false" }) </code></pre> <p><strong>Rendered HiddenFor Section</strong></p> <pre><code>&lt;input data-val="false" data-val-date="The field CreatedDate must be a date." id="CreatedDate" name="CreatedDate" type="hidden" value="" /&gt; &lt;input data-val="false" id="CreatedOperator" name="CreatedOperator" type="hidden" value="" /&gt; &lt;input data-val="false" id="Region" name="Region" type="hidden" value="NM-834" /&gt; &lt;input data-val="false" id="INDDist" name="INDDist" type="hidden" value="834" /&gt; &lt;input data-val="false" data-val-date="The field LastChangeDate must be a date." data-val-required="The LastChangeDate field is required." id="LastChangeDate" name="LastChangeDate" type="hidden" value="4/8/2015 10:43:30 AM" /&gt; &lt;input data-val="false" id="LastChangeOperator" name="LastChangeOperator" type="hidden" value="TYPCLS" /&gt; &lt;input data-val="false" data-val-required="The EditTaxId field is required." id="EditTaxId" name="EditTaxId" type="hidden" value="False" /&gt; &lt;input data-val="false" data-val-number="The field ParentId must be a number." id="ParentId" name="ParentId" type="hidden" value="" /&gt; &lt;input data-val="false" data-val-required="The IsSubstat field is required." id="IsSubstat" name="IsSubstat" type="hidden" value="False" /&gt; &lt;input data-val="false" data-val-number="The field ID must be a number." data-val-required="The ID field is required." id="ID" name="ID" type="hidden" value="0" /&gt; </code></pre> <p><strong>Controller</strong></p> <pre><code> [HttpPost] [MonetAuthorize] public ActionResult Create(AgentTransmission agenttransmission, bool andAddAgent = false) { . . . //Determine if this is first POST or not if (agenttransmission.ID &gt; 0) { db.Entry(agenttransmission).State = EntityState.Modified; } else { db.AgentTransmission.Add(agenttransmission); } db.SaveChanges(); //Send back to view if errors pressent if (!String.IsNullOrWhiteSpace(errorMsg)) { return View(agenttransmission); } } </code></pre> <p><strong>EDIT</strong></p> <p>If I remove the <code>HiddenFor</code> helper and simply cut/paste the rendered <code>input</code> tag, I'm able to capture the corret PK value. However, this is a little hacky so I was hoping to find a more elegant solution (if possible)</p> <pre><code>&lt;input data-val="false" id="ID" name="ID" type="hidden" value="@Model.ID" /&gt; </code></pre>
0non-cybersec
Stackexchange
1,599
5,051
Regarding Ubuntu 13.10 upgrade. <p>I am planning to install Ubuntu alongside Windows 7 (both fresh as I am buying new laptop) by doing separate installation partition for both OS. I have two ques:</p> <p>1) For Ubuntu 13.10 it says 9 months support. Does it mean I can't be able to use after 9 months?</p> <p>2) If I have to update in future to 14.XX LTS system, then will my Windows 7 be affected? I don't want to loose any data and don't want to do fresh installation in future. Please help me. I am going to use Ubuntu first time.</p>
0non-cybersec
Stackexchange
149
540
Setting network namespace when GDM / graphical login is done. <p>I am trying to get two different users that share a system to have independent network stacks. I think that I can achieve that thanks to namespaces.</p> <p>At first, I thought of using <code>pam_namespace.so</code>, but that seems to be only for filesystem namespaces.</p> <p>I am not sure where to "hook" the namespace isolation. It is a multiseat environment, and I am not sure if I can "attach namespaces" according to loginctl or according to who logs in, or some other mechanism.</p> <p>Is there a standard way of manipulating namespaces on login / on user / on seat?</p>
0non-cybersec
Stackexchange
171
645
Windows security popup first time a user logs in to webserver with windows authentication. <p>Windows Authentication has been enabled on the virtual directory for the website. First time a user logs in with Domain authentication a Windows Security popup window appears. All the user has to do is close it and it won't show up again until a iisreset has been done. The site already have a login screen, so I don't really need that, to be honest, annoying popup. How can I make that popup not show up ever when Windows authentication is enabled? </p> <p>IIS7 Web server is running on windows 2008 R2 Server.</p>
0non-cybersec
Stackexchange
140
611
Ubuntu 18.04 configure Terminator Shell. <p>I can use the default terminal on Ubuntu for software development but prefer Terminator. </p> <p>On Ubuntu 16.04, I just installed Terminator and it ran the same way as the normal terminal but on Ubuntu 18.04, I installed Terminator but it seems to default to the bash shell that keeps giving me <strong>Permission denied</strong>.</p> <p>I tried <code>Preferences -&gt; Profile -&gt; Command</code> and checked both <strong>Run command as a login shell</strong> and <strong>Run a custom command instead of my shell</strong>.</p> <p>Then put <code>/bin/sh</code> in the window and "Hold the terminal open." <br> This gives me just a "$ " prompt and the same <strong>Permission denied</strong> response to sudo and the title bar still has <code>/bin/bash</code> </p> <p>What am I doing wrong?</p>
0non-cybersec
Stackexchange
237
845
What does %5B and %5D in POST requests stand for?. <p>I'm trying to write a Java class to log in to a certain website. The data sent in the POST request to log in is</p> <p><code>user%5Blogin%5D=username&amp;user%5Bpassword%5D=123456</code></p> <p>I'm curious what the <code>%5B</code> and <code>%5D</code> means in the key <strong>user login</strong>.</p> <p>How do I encode these data?</p>
0non-cybersec
Stackexchange
146
395
NSNotificationCenter selector not being called. <p>In my iPad app, in one class I register for a notification:</p> <pre><code>NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(selectedList:) name:@"TTSelectedList" object:nil]; </code></pre> <p>My <code>selectedList:</code> method looks like this:</p> <pre><code>- (void)selectedList:(NSNotification*)notification { NSLog(@"received notification"); } </code></pre> <p>Then in another class (a <code>UITableViewController</code>) I post that notification when a row is selected:</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"posting notification"); [[NSNotificationCenter defaultCenter] postNotificationName:@"TTSelectedList" object:nil]; } </code></pre> <p>I can confirm that the notification is being posted, because "posting notification" is logged to the console, but "received notification" is never called, meaning that the notification isn't received and the selector hasn't been called. I can't figure out what's causing this.</p> <p>Thanks</p>
0non-cybersec
Stackexchange
312
1,151
Emails sending with the wrong name on Outlook 2011 Mac. <p>Our client has 6 Macs. We recently set up Outlook 2011 with an exchange account for all of the users.</p> <p>On one of the Macs, I had setup the profile for another user (Person B), before removing it and adding the correct person (Person A).</p> <p>Now what is happening, is when Person A sends an email to anyone, the recipient receives an email from Person A's email address, but with the name of Person B. Like this:</p> <pre><code>Person B &lt;[email protected]&gt; </code></pre> <p>I can see in the address book, that Person B is indeed next to the email address of Person A, We've removed this several times but it comes back.</p> <p>Does anyone know why this keeps happening?</p>
0non-cybersec
Stackexchange
211
754
I can&#39;t get OS prober to find Ubuntu Server 16.04. <p>My computer was configured to triple boot Ubuntu Server 16.04, Arch Linux, and Gentoo Linux.</p> <p>After starting the Linux from Scratch project, (I know, I have a problem) I'd inadvertently made it to where my computer wouldn't boot. I was stuck in GRUB Menu. I used my Arch ISO to mount the boot and root partitions for Arch, Chroot into the system, and re-install Grub (In Arch, the package GRUB actually installs GRUB2, so this is NOT grub-legacy). I can now get Arch to boot, but when I run OS-prober, it can't find Ubuntu or Gentoo anymore. At one point, I could get Gentoo to boot, but after some tinkering, I managed to make that break too. In fact, the Grub entry for Gentoo shows the Gentoo kernel using the root partition for Ubuntu instead of the root partition for Gentoo. </p> <blockquote> <blockquote> <blockquote> <p>inb4 post to Arch/Gentoo. I'm at a loss and I'm unsure where to post this question, so I've decided to post this to forums for all three distros.</p> </blockquote> </blockquote> </blockquote> <p>From what I understand, GRUB should be installed on one distro, then use os-prober to find the others. Initially, it was Ubuntu that held the GRUB installation. Now it's Arch. Is it for this reason that Ubuntu won't boot? And if so, how do I fix it? I am trying very hard to figure this out and troubleshoot the issue rather than re-installation. </p> <ul> <li>sda2 is boot</li> <li>sda3 is swap</li> <li>sda4 is Ubuntu</li> <li>sda5 is Arch</li> <li>sda6 is Gentoo</li> </ul>
0non-cybersec
Stackexchange
479
1,592
How To Replace Unity with Gnome Shell via Ubuntu Software Center?. <p>IMHO, Unity is just as productive and functional as Gnome Shell, and since for me, Gnome Shell looks a lot more stylish, I would like to replace Unity in Ubuntu 11.10 with Gnome Shell.</p> <p><strong>EDIT:</strong> Without a further thought, I opened the Ubuntu Software Center > searched "Gnome Shell" and installed it. And since I use auto-login, Ubuntu logs-me-into Unity.</p> <p>To prevent that...</p> <ul> <li><p>I want to uninstall Unity completely. How do I do that?</p></li> <li><p>After doing the above, Gnome Shell loads by default right?</p></li> </ul>
0non-cybersec
Stackexchange
188
637
Fibonacci Calculation using a larger matrix. <p>So the formula to generate the fibonacci sequence in matrix form is: $$ \begin{pmatrix} 1 &amp; 1 \\ 1 &amp; 0 \\ \end{pmatrix}^n = \begin{pmatrix} F_{n+1} &amp; F_n \\ F_n &amp; F_{n-1} \\ \end{pmatrix} $$</p> <p>So, is there a way to generalize it to a larger matrix, a 4x4 for example?</p>
0non-cybersec
Stackexchange
142
361
Is there a cross browser event for activate in the browser?. <p>Is there a cross browser event that can be used to show a message to the user returning to their web page? </p> <p>For example, a user has ten applications or tabs open. They get a new notification from our app and I show a notification box. When they switch to our tab I want to begin our notification animation. </p> <p>The activate event is common on desktop applications but so far, on the <code>window</code>, <code>document</code> and <code>body</code>, neither the <code>"activate"</code> or <code>"DOMActivate"</code> do anything when swapping between applications or tabs but the <code>"focus"</code> and <code>"blur"</code> do. This event works but the naming is different and the events that <em>should</em> be doing this are not. </p> <p>So is the right event to use cross browser or is there another event?</p> <p>You can test by adding this in the console or page and then swapping between applications or tabs: </p> <pre><code>window.addEventListener("focus", function(e) {console.log("focused at " + performance.now()) } ) window.addEventListener("blur", function(e) {console.log("blurred at " + performance.now()) } ) </code></pre> <p><strong>Update:</strong><br> In the link to <a href="https://stackoverflow.com/questions/1060008">the possible duplicate</a> is a link to the W3 Page Visibility doc <a href="https://www.w3.org/TR/page-visibility/#sec-visibilitychange-event" rel="nofollow noreferrer">here</a>. </p> <p>It says to use the <code>visibilitychange</code> event to check when the page is visible or hidden like so: </p> <pre><code>document.addEventListener('visibilitychange', handleVisibilityChange, false); </code></pre> <p>But there are issues: </p> <blockquote> <p>The Document of the top level browsing context can be in one of the following visibility states:</p> <p>hidden The Document is not visible at all on any screen. visible The Document is at least partially visible on at least one screen. This is the same condition under which the hidden attribute is set to false.</p> </blockquote> <p>So it explains why it's not firing when switching apps. But even when switching apps and the window is completely hidden the event does not trigger (in Firefox). </p> <p>So at the end of the page is this note: </p> <blockquote> <p>The Page Visibility API enables developers to know when a Document is visible or in focus. Existing mechanisms, such as the focus and blur events, when attached to the Window object already provide a mechanism to detect when the Document is the active document.</p> </blockquote> <p>So it would seem to suggest that it's accepted practice to use focus and blur to detect window activation or app switching. </p> <p>I found this <a href="https://stackoverflow.com/a/38710376/441016">answer</a> that is close to what would be needed to make a cross browser solution but needs focus and blur (at least for Firefox). </p> <p><strong>Observation:</strong><br> StackOverflow has a policy against mentioning frameworks or libraries. The answers linked here have upvotes for the "best" answer. </p> <p>But these can grow outdated. Since yesterday I found mention of two frameworks (polyfills) that attempt to solve this same problem <a href="https://www.sitepoint.com/introduction-to-page-visibility-api/" rel="nofollow noreferrer">here</a> for visibly and isVis (not creating a link). If this is a question and answer site and a valid answer is, "here is some code that works for me" but "Here is the library I created using the same code that can be kept up to date and maintained on github" is not valid then in my opinion it's missing it's goal. </p> <p>I know above should probably go to meta and I have but they resist changing the status quo for some reason. Mentioning it here since it's a relevant example. </p>
0non-cybersec
Stackexchange
1,046
3,895
PSTricks: Remove trailing zeros in axis labels. <p>Consider the following example:</p> <pre><code>\documentclass{article} \usepackage{pst-plot} \begin{document} \psset{xunit = 2} \begin{pspicture}(3,1) \psaxes[Dx = 0.5]{-&gt;}(3,1) \end{pspicture} \end{document} </code></pre> <p><img src="https://i.stack.imgur.com/43anZ.jpg" alt="output"></p> <p>Is it possible to get <code>1</code> and <code>2</code> instead of <code>1.0</code> and <code>2.0</code> (as with <code>0</code>) as axis labels?</p> <p><strong>Update</strong></p> <p>I've also asked this question on <a href="http://latex-community.org/forum/viewtopic.php?t=24334" rel="nofollow noreferrer">LaTeX Community</a> (and now added <a href="https://tex.stackexchange.com/a/153663/15874">Marco's answer</a>).</p>
0non-cybersec
Stackexchange
313
780
Linux Kubuntu booting into dead screen on exactly every second boot. <p>I hope you can help me. I tied a few solutions to similar problems, but none seemed to have worked for me.</p> <p>My set-up:</p> <ul> <li><strong>OS</strong>: Linux Kubuntu 19.10</li> <li><strong>MB</strong>: ASUS PRIME B350-PLUS</li> <li><strong>CPU</strong>: AMD Ryzen 3 1300X</li> <li><strong>GPU</strong>: ATI Radeon HD 5450 (Dual Monitors, 2 x DVI 1920x1080)</li> <li><strong>RAM</strong>: 2x4GiB DDR4</li> <li><strong>SSD</strong>: Boot drive is a Western Digital M.2 SSD</li> </ul> <p>This setup worked flawlessly until 2 weeks ago. I updated my BIOS around that time. After that the problems kept coming. The problem manifests itself as follows:</p> <p><strong>Boot number 1:</strong></p> <ol> <li>BIOS information is showing</li> <li>GRUB comes up, I select Kubuntu and hit enter</li> <li>The screen turns black, the keyboard and mouse turn off (backlight and mouse light)</li> <li>The 2 monitors go into power-saving mode, usb devices turn back on</li> <li>Nothing happens, HDD_LED stays on permanently</li> </ol> <p>Then I press the reset button after a few minutes.</p> <p><strong>Boot number 2:</strong></p> <ol> <li>BIOS information is showing</li> <li>GRUB comes up, I select Kubuntu and hit enter</li> <li>The screen turns black, the keyboard and mouse turn off (backlight and mouse light)</li> <li>usb devices turn back on</li> <li>Login screen appears</li> </ol> <p>Note that the screens never go into power saving mode. There is no splash screen as I turned that off with nosplash.</p> <p>I tried booting with nomodeset. This seems to work every time so far. But that cannot be the permanent solution to my problem, since that mode lacks the necessary support for two screens with that resolution.</p> <p>What I would like to know is, do you know any solution for this problem? And is there a way to read the boot messages from the previous boot? Maybe they can tell me more.</p> <hr> <p><strong>UPDATE</strong></p> <p>I finally managed to get dmesg of a failed boot (I waited on a failed boot for several minutes, to ensure that dmesg is written to /var/log/dmesg, then after the next successful boot, I found the log in /var/log/dmesg.0). This caught my eye:</p> <pre><code>[ 22.864019] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 22.864030] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 27.868014] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 27.868024] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 27.868032] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing BE9E (len 821, WS 0, PS 0) @ 0xBEFB [ 32.872012] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 32.872021] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing CB6C (len 72, WS 0, PS 0) @ 0xCB9B [ 37.876016] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 37.876025] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 42.880011] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 42.880020] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 47.884011] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 47.884020] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 52.888015] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 52.888024] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 52.888095] kernel: [drm:cypress_dpm_set_power_state [radeon]] *ERROR* rv770_restrict_performance_levels_before_switch failed [ 57.892010] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 57.892019] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 57.892028] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing BE9E (len 821, WS 0, PS 0) @ 0xBEFB [ 62.896010] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 62.896019] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing CB6C (len 72, WS 0, PS 0) @ 0xCB9B [ 67.900011] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 67.900020] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 72.904010] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 72.904018] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 77.908011] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 77.908020] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 82.912010] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 82.912018] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 87.916009] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 87.916018] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 92.920008] kernel: [drm:atom_op_jump [radeon]] *ERROR* atombios stuck in loop for more than 5secs aborting [ 92.920017] kernel: [drm:atom_execute_table_locked [radeon]] *ERROR* atombios stuck executing C79C (len 62, WS 0, PS 0) @ 0xC7B8 [ 93.142085] kernel: EXT4-fs (nvme0n1p2): mounted filesystem with ordered data mode. Opts: (null) </code></pre> <p>This must be the problem. But only on some boots. Now I need to find out how to fix it.</p> <hr> <p><strong>UPDATE</strong></p> <p>I remembered that I updated my BIOS a few weeks before I noticed the problems. Within these few intermittend weeks I barely used the computer, so maybe the problem was already there, I just did not see it.</p> <p>I was running "Version 5220 2019/09/24". So I reverted back to "Version 5216 2019/09/09". I did so by putting the .CAP file on a stick and "upgrading" the BIOS from within the BIOS menu. This took some time, but worked.</p> <p>After that I just booted and had no problem since. So maybe the last BIOS update was the problem. The changes for that version contain (according to ASUS):</p> <ol> <li>Update AGESA 1.0.0.3ABBA to improve system performance.</li> <li>Removes Gen 4 support when using Ryzen 3000 CPUs.</li> </ol> <p>Maybe one of these things broke Linux? Windows had no problem. BTW: If you have a similar problem with Linux sporadically not booting on this motherboard try "iommu=soft" as a parameter in the boot item for linux in GRUB.</p>
0non-cybersec
Stackexchange
2,597
7,542
why do these inequalities hold?. <p>I don't get it why the parts I circled in red hold </p> <p>I know that both $A_k$ and $\mathcal{I} - A_k$ are positive but I don't think that information let us conclude directly what's in the red boxes. </p> <p>can someone please give more details why those inequalities hold ?</p> <p>by the way a positive operator is an operator whose associated quadratic form is positive definite and in addition to that is self adjoint.</p> <p><a href="https://i.stack.imgur.com/pQlrj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pQlrj.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
194
636
Fix bash script expecting path input with / at the end breaking when path doesn&#39;t end with /. <p>I have this code : </p> <pre><code>for file in "$@"*png; do echo "$file" done </code></pre> <p>It works only if you provide a path that ends with / like <code>/root/</code>. </p> <p>What would be the correct way to add / to the path input, in situations like this, without breaking my script? </p> <p>If you give a path input without / at the end, it just does this : </p> <pre><code>File: /root*png </code></pre> <p>If I modify it to be <code>for file in "$@"/*png; do</code> and input <code>/root/test/</code> it works but the result looks ugly : </p> <pre><code>File: /root/test//sample2.png </code></pre>
0non-cybersec
Stackexchange
245
719
Missing artifact com.sun:tools:jar. <p>I've been following the getting started tutorial, but am stuck after I imported the playn project using Maven. I am using Eclipse Indigo running on 64bit Windows 7.</p> <p>All the imported projects have the same error:</p> <pre><code>Missing Artifact com.sun:tools:jar in all the pom.xml files. </code></pre> <p>After a couple hours of searching forums I have tried:</p> <p>Installing the latest Java 1.6.029 Changing my <code>JAVA_HOME</code> environment variable to point to <code>\program files\Java\jdk1.6_029</code> Changing my Eclipse Java preferences to use the JRE <code>jdk1.6_029</code>.</p> <p>I would really like to experiment with playn, but why there are a few posts I can't seem to find a consenus answer on the solution. Some people say Sun removed something from the 64bit jdk, others say you must edit your xml files, many people have said you have change your <code>JAVA_HOME</code>, and another said you have to change your VM options for Eclipse.</p> <p>Any help on clearing this up would be appreciated, and possibly useful for many, since I do not have a particularly odd setup here.</p> <p>(edit) Here is the pom.xml in the first project. Eclipse flags error in the line which says:</p> <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;parent&gt; &lt;groupId&gt;com.googlecode.playn&lt;/groupId&gt; &lt;artifactId&gt;playn-project&lt;/artifactId&gt; &lt;version&gt;1.1-SNAPSHOT&lt;/version&gt; &lt;/parent&gt; &lt;artifactId&gt;playn-android&lt;/artifactId&gt; &lt;name&gt;PlayN Android&lt;/name&gt; &lt;packaging&gt;jar&lt;/packaging&gt; &lt;repositories&gt; &lt;/repositories&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;com.googlecode.playn&lt;/groupId&gt; &lt;artifactId&gt;playn-core&lt;/artifactId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- needed because Android uses the same JSON code as playn-java; that should be factored into a library shared by both backends --&gt; &lt;dependency&gt; &lt;groupId&gt;com.googlecode.playn&lt;/groupId&gt; &lt;artifactId&gt;playn-java&lt;/artifactId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.google.android&lt;/groupId&gt; &lt;artifactId&gt;android&lt;/artifactId&gt; &lt;version&gt;${android.version}&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit&lt;/artifactId&gt; &lt;version&gt;4.8.1&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt; &lt;/build&gt; &lt;/project&gt; </code></pre>
0non-cybersec
Stackexchange
1,102
3,173
Decrease space between normal text and the footnote. <p>I use approximately this code:</p> <pre><code>\documentclass[a5paper,12pt,twoside]{book} \usepackage[inner=2.5cm,outer=1.8cm,top=0.8in,bottom=1.in]{geometry} \fancypagestyle{standard_intro}{% \renewcommand{\headrulewidth}{0.5pt} \fancyhead[LE]{} \fancyhead[RE]{\scriptsize\textbf{\RUNTITLE}\\\ Introduction} \fancyhead[RO]{\scriptsize\textbf{\RUNTITLE}\\\ Introduction} \fancyhead[LO]{} % \vspace{-1cm} \fancyfoot[CE,CO]{\footnotesize $-\;$\thepage $\;-$ } \singlespacing } </code></pre> <p>For my taste the spacing between the text and footnote, which is the page number is too large. How can I decrease it? The vspace at the position I indicated did not work. I hope you can already work with this less than minimal example.</p> <p>Thx a lot Paul</p>
0non-cybersec
Stackexchange
286
844
aiohttp - exception ignored message. <p>I'm running the following code which makes 5 requests via aiohttp:</p> <pre><code>import aiohttp import asyncio def fetch_page(url, idx): try: url = 'http://google.com' response = yield from aiohttp.request('GET', url) print(response.status) except Exception as e: print(e) def main(): try: url = 'http://google.com' urls = [url] * 5 coros = [] for idx, url in enumerate(urls): coros.append(asyncio.Task(fetch_page(url, idx))) yield from asyncio.gather(*coros) except Exception as e: print(e) if __name__ == '__main__': try: loop = asyncio.get_event_loop() loop.run_until_complete(main()) except Exception as e: print(e) </code></pre> <p>Output:</p> <pre><code>200 200 200 200 200 Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: </code></pre> <p>Note: There is no additional information as to what/where the exception is.</p> <p>What's causing this and are there any tips to debug it?</p>
0non-cybersec
Stackexchange
359
1,142
Test port reachability from a remote host even though the port is not bound to a service?. <p>I need to check whether a remote host is able to reach a specific port. At the time of test the service bound to that port will be down. </p> <p>The possible issues that the test would address would be :</p> <ul> <li>The network allows the remote host to reach the port.</li> <li>The firewall on the host ( receiver ) allows the remote host to connect to that port.</li> </ul> <p>I've tried telnet. However telnet returns non-zero exit code if a service is not bound to that port. What could be the possible options?</p> <p><strong>UPDATE</strong> :</p> <p>Can't we have an nmap way to do this? Any output with the filtered state should mean a red flag.</p> <p>Sample command: $ nmap -v 120.114.24.56 -P0 -p 8080</p> <p>Ref: <a href="http://nmap.org/book/man-port-scanning-basics.html" rel="nofollow noreferrer">http://nmap.org/book/man-port-scanning-basics.html</a></p> <p>The six port states recognized by Nmap – ( the ones marked in red should ideally be a red flag to us )</p> <p>open</p> <p>An application is actively accepting TCP connections, UDP datagrams or SCTP associations on this port. Finding these is often the primary goal of port scanning. Security-minded people know that each open port is an avenue for attack. Attackers and pen-testers want to exploit the open ports, while administrators try to close or protect them with firewalls without thwarting legitimate users. Open ports are also interesting for non-security scans because they show services available for use on the network.</p> <p>closed</p> <p>A closed port is accessible (it receives and responds to Nmap probe packets), but there is no application listening on it. They can be helpful in showing that a host is up on an IP address (host discovery, or ping scanning), and as part of OS detection. Because closed ports are reachable, it may be worth scanning later in case some open up. Administrators may want to consider blocking such ports with a firewall. Then they would appear in the filtered state, discussed next.</p> <p>filtered</p> <p>Nmap cannot determine whether the port is open because packet filtering prevents its probes from reaching the port. The filtering could be from a dedicated firewall device, router rules, or host-based firewall software. These ports frustrate attackers because they provide so little information. Sometimes they respond with ICMP error messages such as type 3 code 13 (destination unreachable: communication administratively prohibited), but filters that simply drop probes without responding are far more common. This forces Nmap to retry several times just in case the probe was dropped due to network congestion rather than filtering. This slows down the scan dramatically.</p> <p>unfiltered</p> <p>The unfiltered state means that a port is accessible, but Nmap is unable to determine whether it is open or closed. Only the ACK scan, which is used to map firewall rulesets, classifies ports into this state. Scanning unfiltered ports with other scan types such as Window scan, SYN scan, or FIN scan, may help resolve whether the port is open.</p> <p>open|filtered</p> <p>Nmap places ports in this state when it is unable to determine whether a port is open or filtered. This occurs for scan types in which open ports give no response. The lack of response could also mean that a packet filter dropped the probe or any response it elicited. So Nmap does not know for sure whether the port is open or being filtered. The UDP, IP protocol, FIN, NULL, and Xmas scans classify ports this way.</p> <p>closed|filtered</p> <p>This state is used when Nmap is unable to determine whether a port is closed or filtered. It is only used for the IP ID idle scan.</p>
0non-cybersec
Stackexchange
963
3,796
How loop edge set the arrow type?. <p>When we use <code>-&gt;</code> tha arrow type can be overwritten by <code>&gt;=Arrow</code>, before or after the <code>-&gt;</code> . Or by putting after the <code>-&gt;</code> another <code>-Arrow</code> style.</p> <p>For a <code>loop</code> edge, we can overwrite the arrow type by <code>&gt;=Arrow</code> but not by <code>-Arrow</code>. <strong>Why ?</strong> </p> <pre><code>\documentclass[varwidth,border=7mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[scale=5, very thick] \draw[green] (0,0) edge[loop, -latex] (); % -&gt; \draw[xshift=3mm] (0,0) edge[loop, &gt;=latex] (); % -latex \draw[green, scale=-1] (0,0) edge[-latex, loop] (); % -&gt; \draw[xshift=3mm,scale=-1] (0,0) edge[&gt;=latex, loop] (); % -latex \draw[yshift=3mm,blue] (0,0) edge[&gt;=latex, -&gt;, -Ellipse] (.3,0); % -Ellipse \draw[yshift=-3mm,red] (0,0) edge[&gt;=latex, -Ellipse, -&gt;] (.3,0); % -latex \end{tikzpicture} \end{document} </code></pre> <p><img src="https://i.stack.imgur.com/XxF7c.png" alt="enter image description here"></p>
0non-cybersec
Stackexchange
476
1,185