text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
LPT Request: How to prevent fruit flies from becoming roommates?. I know how to trap/kill them once they move in, but how do I keep them from taking up residence in my kitchen in the first place? We don't let food sit out, only produce that doesn't belong in the refrigerator. I vacuum and wipe down surfaces daily, our litter box is cleaned twice a day, the trash is taken out regularly. Is there anything else I can do?
0non-cybersec
Reddit
Passing error messages through flash. <p>What is the best way to push error messages on redirect to?</p> <p>I've previously used couple of approaches, but both of them has issue.</p> <p>(1) Passing the entire object with error on flash and using error_messages_for:</p> <pre><code> def destroy if @item.destroy flash[:error_item] = @item end redirect_to some_other_controller_path end </code></pre> <p>I found that this method causes cookie overflows.</p> <p>(2) Passing a single error message:</p> <pre><code> def destroy if @item.destroy flash[:error] = @item.full_messages[0] end redirect_to some_other_controller_path end </code></pre> <p>This way I only send a single error message, what if there are many? Does Anyone knows a better way?</p>
0non-cybersec
Stackexchange
Prove $f(0_n)=0_m$. <p>If $f: \mathbb{R}^n\rightarrow \mathbb{R}^m$ is a linear map, prove that $f(\boldsymbol{0}_n)=\boldsymbol{0}_m$</p> <p>Can someone explain how I would prove this? I understand that to be a linear map it must satisfy...</p> <p>1) $F(x+y)= F(x)+F(t)$ for all $x,y\in \mathbb{R}^n$</p> <p>2) $f(cx)=cF(x)$ for all $x\in \mathbb{R}^n$ and all scalar $c \in \mathbb{R}$</p> <p>But I understand how to apply this information into proving $f(\boldsymbol{0}_n)=\boldsymbol{0}_m$. </p>
0non-cybersec
Stackexchange
HDMI to VGA somehow zooming computer screen in. <p>So i recently purchased an Acer AL1916W from a garage sale (about 50 cents) and I planned to use it as a dual monitor to my computer (with an Staples-branded HDMI to VGA converter as my computer does not have a second VGA port). It worked fine for a while until I accidentally set it to a different resolution than its native 1440x900, and so now when I set it back the screen is very noticeably zoomed in (as in, the taskbar is only halfway visible and you cannot see to the right of the minimize button, i have windows). I was wondering if i could do anything about this? And what makes it even weirder is the fact that upon checking the "Info" section of the monitors menu, it originally said it was a 1440x900 resolution but now it says its 1400x1050. Also when i plug the computer in directly to the monitor it works fine (to be expected), and the same when i reverse it (plugging the first monitor into the HDMi converter, second into the VGA) it also works fine (my first is an Acer E202HL).</p> <p>edit 9/13: so its working fine now but only when on the "extend" mode, any other mode (duplicate, second screen only, etc) has the same problem described before</p>
0non-cybersec
Stackexchange
Does $\sum\limits_{n=1}^{\infty}\frac{\cos^{2}(n+1)}{n}$ converge?. <p>The original question, given to my Calculus II recitation class, was:</p> <p>Determine if the series <span class="math-container">$$\sum\limits_{n=1}^{\infty}\frac{(-1)^{n}\cos^{2}(n+1)}{n}$$</span></p> <p>converges absolutely, conditionally, or diverges. I can kind of see a comparison with the alternating harmonic series here, but making that formal is tough. With the absolute series <span class="math-container">$\sum\limits_{n=1}^{\infty} \frac{\cos^{2}(n+1)}{n}$</span>, I'm not sure what test to apply.</p> <p><strong>What I've Tried:</strong> No tests (in the classical Calc II curriculum) work. I've tried expanding <span class="math-container">$\cos^{2}(n+1)$</span> into a power series within the series in question, but I'm not really sure where to go from there. My intuition tells me this series will diverge, since it seems "close" to the harmonic series; but <span class="math-container">$\cos(x)$</span> is less than <span class="math-container">$1$</span> infinitely often. </p>
0non-cybersec
Stackexchange
How to insert a big brace, arrows crossing etc. <p>As english is not my primary language, I don't know how describe my problem the right way. But I have a picture of what I want to type.</p> <p>This is how far I have made it:</p> <pre><code>\documentclass[a4paper]{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} Cr &amp; 3\downarrow \arrow[rd] &amp; 2Cr: &amp; 6\downarrow \\ C &amp; 2\uparrow \arrow[ru]&amp; 3C: &amp; 6\uparrow \end{tikzcd} \end{document} \ </code></pre> <p><a href="https://i.stack.imgur.com/vGVb6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vGVb6.jpg" alt="enter image description here"></a></p> <p>Background: At my school we use this to show how to align(?) a redox-reaction.</p>
0non-cybersec
Stackexchange
Does anybody know what car this is?.
0non-cybersec
Reddit
Unexpressibility of a property in first order logic. <p>We can give a very general notion of what is to iterate a function. Given a set $\mathcal U$ and a function $f:\mathcal U \rightarrow \mathcal U$, then, <em>to iterate the function $f$</em> will mean to compose f with itself. We can also define $f_0=f$ and $f_n = f \circ f_{n-1}$for any $n \in \mathbb N$. With this notation, an <em>iteration of $f$</em> will be any of the functions $f_n$.</p> <p>Now comes the question. We are given a nonempty set $\mathcal U$, an elemtent $\alpha \in \mathcal U$ and a function $f:\mathcal U \rightarrow \mathcal U$. Can we express in first order logic the property that for any $x \in \mathcal U$ there exists an $n \in \mathbb N_0$ with $f_n(x)=\alpha$?</p> <p>More precisely: given a first order language $\mathcal L = \langle\mathcal U, =, c,f\rangle$ where $c$ is a constant symbol and $f$ is a unary function symbol, is the class of models with the aforementioned property definable in first order? That is, does there exists a first order sentence $\phi$ such that its satisfied only by the models of $\mathcal L$ with the property?</p> <p>I've been thinking about this for a while but nothing came out. I guess that the property is not definable in first order and that this can be proved using the compactness theorem, but I don't know how.</p> <p>If the property turns out to be undefinable it may be useful to construct models with unbounded $n$ to get a proof. For example, I took $\mathcal U = \mathbb N$, $c = 1$ and $f$ defined by $f(1)=1$ and $f(x)=x-1$ for any $x$ grater than $1$.</p> <p>Thanks</p>
0non-cybersec
Stackexchange
Shkodran Mustafi signs for Arsenal.
0non-cybersec
Reddit
Existence of an injective continuous function $\Bbb R^2\to\Bbb R$?. <p>Let's say $f(x,y)$ is a continuous function. $x$ and $y$ can be any real numbers. Can this function have one unique value for any two different pairs of variables? In other words can $f(a,b) \neq f(c,d)$ for any $a$, $b$, $c$, and $d$ such that $a \neq c$ or $b \neq d$? I don't think there can at least not if the range of $f$ is within the real numbers. Could someone please offer a more formal proof of this or at least start me off in the right direction.</p>
0non-cybersec
Stackexchange
China experts: North Korea not on war footing, fighting unlikely.
0non-cybersec
Reddit
Entity to DTO Usage. <p>Been trying to come up with a flow for a basic tiered web application, and have been reading conflicting information online. What I'm trying to figure out is if there is an advantage to still using DTO objects from your DAO to Service layer through the use of some sort of mapper. </p> <p>The basic flow I foresee is as follows:</p> <ol> <li>UI Model / Form --> Controller</li> <li>Controller converts Model into Domain Object (Entity)</li> <li>Domain Object --> Service Layer</li> <li>Domain Object --> DAO</li> <li>DAO --> Domain Object(s)</li> <li>Service --> UI</li> <li>UI converts Domain into UI models</li> </ol> <p>If DTO was followed DAO would pass back a DTO not the Entity. After doing some reading it seems like DTO has become slightly defunct since (at least in Java) entities have become annotated POJOs meaning their memory footprint has become very small.</p> <p>Is this the case, or should DTOs be used to completely encapsulate the domain objects within the DAO layer, and, if this is the case, what would the service layer pass to the DAO?</p> <p>Thanks a bunch!</p>
0non-cybersec
Stackexchange
Why is $n_i \frac{\langle \alpha_i , \alpha_i \rangle}{\langle \alpha , \alpha \rangle}$ an integer?. <p>I'm stuck in this question and I would like some help.</p> <blockquote> <p><strong>Question:</strong> In a <a href="https://en.wikipedia.org/wiki/Root_system" rel="nofollow noreferrer">reduced root system</a> let <span class="math-container">$\alpha= n_1 \alpha_1 + ...+ n_k \alpha_k$</span> be a root such that each <span class="math-container">$\alpha_i$</span> is a simple root. Show that <span class="math-container">$$n_i \frac{\langle \alpha_i , \alpha_i \rangle}{\langle \alpha , \alpha \rangle} $$</span> is an integer.</p> </blockquote> <hr> <p>I tried things like writing</p> <p><span class="math-container">$$n_i \frac{\langle \alpha_i , \alpha_i \rangle}{\langle \alpha , \alpha \rangle} = n_i \frac{2\frac{\langle \alpha , \alpha_i \rangle}{\langle \alpha , \alpha \rangle}}{ 2\frac{\langle \alpha , \alpha_i \rangle}{\langle \alpha_i , \alpha_i \rangle}}, $$</span></p> <p>and somehow try to conclude that <span class="math-container">$\left.2\frac{\langle \alpha , \alpha_i \rangle}{\langle \alpha_i , \alpha_i \rangle}\right| n_i\cdot 2\frac{\langle \alpha , \alpha_i \rangle}{\langle \alpha , \alpha \rangle}$</span>. But this led me to anywhere.</p>
0non-cybersec
Stackexchange
VPN can access network drives by IP but not by computer name. <p>I have a VPN set up on my laptop. When I take it out of the office I can't access mapped network drives. I noticed that all my network drives went something like <code>\\THE-FILE-SERVER\Data</code>, but when I changed the computer name with actual local IP address so it became like this <code>\\192.168.1.5\Data</code> then I can access those shared drives via VPN.</p> <p>Why is that? Is there a way to make it so my netowrk drives that are mapped using file server's computer name instead of IP work both in the office and remotely via VPN? At the moment I have two same shared drives but one uses computer name (in the office it works) and one uses LAN IP(remotely on VPN works).</p> <p>I have "Use remote network default gateway" checked under TCP\IP 4 and 6 advanced settings.</p>
0non-cybersec
Stackexchange
Reference assembly in sqlproj not being deployed to server. <p>I have a Visual Studio 2013 Database Project which takes <a href="https://fastjson.codeplex.com/SourceControl/network/forks/zippy1981/SqlClr/contribution/6596" rel="noreferrer">a modified version</a> of <a href="https://fastjson.codeplex.com/" rel="noreferrer">fastJSON</a> as a reference. I selected Generate DDL in the reference properties as shown in this screenshot:</p> <p><img src="https://i.stack.imgur.com/U32k7.png" alt="fastJSON property panel"></p> <p>And in the .sqlproj msbuild file:</p> <pre><code>&lt;Reference Include="fastJSON"&gt; &lt;HintPath&gt;..\..\fastjson\output\net40\fastJSON.dll&lt;/HintPath&gt; &lt;GenerateSqlClrDdl&gt;True&lt;/GenerateSqlClrDdl&gt; &lt;/Reference&gt; </code></pre> <p>However bin/debug/Project.sql does not contain a line for <code>CREATE ASSEMBLY fastJSON . . .</code>. Adding the assembly manually works and my project will then deploy and run. What do I do to get Visual Studio to deploy my assembly?</p>
0non-cybersec
Stackexchange
Doorkeeper resource owner credential flow for multiple models. <p>The problem I'm having is that I'm using doorkeepers <a href="https://github.com/doorkeeper-gem/doorkeeper/wiki/Using-Resource-Owner-Password-Credentials-flow">resource owner credential flow</a> to authenticate a user from an iOS app. My project has two separate user models though (let's call them User and Admin). My code looks like this:</p> <pre><code>resource_owner_from_credentials do |routes| user = User.find_for_database_authentication(:email =&gt; params[:username]) user if user &amp;&amp; user.valid_password?(params[:password]) end </code></pre> <p>It works but how do I do a check for admin also? In other words I don't know if the person logging in is a user or admin - how do I check for both?</p>
0non-cybersec
Stackexchange
Get Spacemacs/Emacs GUI version to recognize nix-shell environment. <p>I do my development in a Nix shell (create a default.nix file in my project root and then run <code>nix-shell .</code> to give me a shell with access to the project dependencies).</p> <p>Spacemacs is my main editor, but when I try to run the GUI version via <code>emacs &amp;</code> I don't have access to the programs in my nix-shell (if I were in a Ruby on Rails project for example, and Ruby was declared as a dependency in my <code>default.nix</code>, I would have no syntax highlighting in Spacemacs because the GUI version of Emacs doesn't see my Nix-shell dependencies). If I run <code>:!which ruby</code>, it can't even find the <code>which</code> command.</p> <p>Right now, I'm running spacemacs via <code>emacs -nw</code> and just using it from the console, but I would really like to be able to use the GUI editor and get the full colorschemes available rather than being limited to the ones that look nice in 256 color mode. It's also quicker for me to switch between the terminal and the editor than between tmux panes or terminal splits to get to my CLI editor.</p> <pre><code>with import &lt;nixpkgs&gt; {}; { cannyFreeRadicalEnv = stdenv.mkDerivation rec { name = "rails-project-env"; version = "0.1"; src = ./.; buildInputs = [ stdenv ruby_2_2_2 bundler zlib postgresql94 sqlite zsh git nodejs-0_12 ]; }; } </code></pre>
0non-cybersec
Stackexchange
Ignoring redefined label. <p>How can I make LaTeX ignore a <code>\label</code> that is re-used? That is, if I define a label twice, and then cross-reference it, I would like the reference to indicate the first definition of the label.</p> <p>For example, in this MWE:</p> <pre><code>\begin{document} \begin{equation} x^2=2 \label{l1} \end{equation} \begin{equation} x^2=3 \label{l1} \end{equation} See the equation in \eqref{l1} \end{document} </code></pre> <p>Then I would like the sentence to read '... in (1)' and not '... in (2)'.</p>
0non-cybersec
Stackexchange
We should not “feel like.” We should argue rationally, feel deeply and take full responsibility for our interaction with the world..
0non-cybersec
Reddit
How to decode HTML entities in Rails 3?. <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/1600526/how-do-i-encode-decode-html-entities-in-ruby">How do I encode/decode HTML entities in Ruby?</a> </p> </blockquote> <p>I would like to convert strings like this:</p> <pre><code>"I&amp;#39;m working" </code></pre> <p>to</p> <pre><code>"I'm working" </code></pre> <p>(i.e. decode HTML entities)</p> <p>What Ruby/Rails function does the trick ?</p> <p>I want to use this function in the model.</p>
0non-cybersec
Stackexchange
Why didn't the skeleton cross the road?. Because he didn't have the guts to do it!
0non-cybersec
Reddit
LOIC. Hey guys, Anyone have any experience using the low orbit ion cannon and if so, what did you think? Just want some general feedback here before even attempting to experiment with it Thanks -ed
1cybersec
Reddit
copy files created in one folder to multiple other folders on linux. <p>I'm looking for a way to copy photos that are uploaded to one folder to many other folders and visa versa. </p> <p>Example: a photo is uploaded to folder 1, it is then copied to folders 2-5. And if a photo is uploaded to folder 2 it is copied to folders 1 and 3-5. </p> <p>I'm running CentOS 5. All of these folders are on the same server. </p> <p>I came across another post on here that talked about incron, but that type of programming is over my head. </p>
0non-cybersec
Stackexchange
This game would have just been more mindblowing on Xbox One with Kinect 2.0.
0non-cybersec
Reddit
With Android P's new gestures, how long until the back button is a thing of the past?.
0non-cybersec
Reddit
Milani rose powder blush. Which shade of the range would look best on very fair skin?
0non-cybersec
Reddit
Why can&#39;t I convert an object (which is really object[]) to string[]?. <p>I have a field that is of type 'object'. When I inspect it within the Watch window of visual studio I see its Object[] and when I drill into the elements I see each element is a string.</p> <p>But when I try to cast this to a String[] I get this error:</p> <blockquote> <p>Cannot cast 'MyObject' (which has an actual type of 'object[]') to 'string[]' string[]</p> </blockquote> <p>Any reason why I can't do this cast? What is the best way to convert this object to a string array?</p>
0non-cybersec
Stackexchange
Motherboard has one HDMI port but supports three monitors. How can it?. <p>I am looking at an <a href="https://www.asus.com/Motherboards/Z87MPLUS/specifications/" rel="nofollow noreferrer">Asus motherboard</a> and it says :</p> <pre><code>Integrated Graphics Processor Multi-VGA output support : HDMI/DVI-D/RGB ports - Supports HDMI with max. resolution 4096 x 2160 @ 24 Hz / 2560 x 1600 @ 60 Hz - Supports DVI-D with max. resolution 1920 x 1200 @ 60 Hz - Supports RGB with max. resolution 1920 x 1200 @ 60 Hz Maximum shared memory of 1024 MB Supports Intel® InTru™ 3D, Quick Sync Video, Clear Video HD Technology, Insider™ Supports up to 3 displays simultaneously </code></pre> <p>Having read the manual it's not clear if the three monitors it supports are {1 HDMI + 1 DVI-D and 1 RGB} or {3 HDMI covering the 4096*2160 area}.</p> <p>I'd ideally like to support three HDMI monitors (without buying a graphics card), ie, to get the 4096 * 2160 split over two or three monitors with HDMI .</p> <p>I'm noting looking to do any gaming, I just want a really good home set up for web dev and general computing. As I'm not going to be gaming I'd rather not get a separate graphics card.</p> <p>Am I unaware of an obvious trick to support three monitors from a single port? Or do I have to get a graphics card to support multiple monitors via the same interface? Or (given that I have only one monitor at present) aim to get the subsequent ones over different interfaces? Although I have read that <a href="https://superuser.com/a/407152/325591">using a VGA port with a modern monitor is a waste of time</a>.</p>
0non-cybersec
Stackexchange
Hey /r/cars... any love for old 4x4 SUVs? I just restored the 1982 Ford Bronco that I've had since I was 16! Given to me by my grandfather after he passed away..
0non-cybersec
Reddit
The context is being used in Code First mode with code that was generated from an EDMX file for either Database First or Model First development. <p>I m trying to migrate a project initially developed using EF4 to EF6, to take advantage of EF6 transactions management.</p> <p>The problem I m facing is that the project has been created using the Database First approach, so when I m using code like <code>context.Database.UseTransaction</code>, I m encountering the following error:</p> <pre><code>The context is being used in Code First mode with code that was generated from an EDMX file for either Database First or Model First development. </code></pre> <p>This exception triggers inside the <code>OnModelCreating</code> method of my <code>DbContext</code> class.</p> <p>Any idea ?</p> <p>Thanks</p> <p><strong>EDIT:</strong></p> <p>The thing is that it's legacy code using EDMX with database first approach. I have to implement EF6 transactions inside this project, so it should now be more like a code first pattern.</p> <p>In addition, here's the context class:</p> <pre><code>public class MyContext : BaseDbContext { public MyContext (DbConnection existingConnection, bool contextOwnsConnection) : base(existingConnection, contextOwnsConnection) { } } </code></pre> <p>And the connection string:</p> <pre><code> &lt;add name="CS" connectionString="Data Source=MyServ;Initial Catalog=MyDBName;User Id=MyUser;Password=MyPwd;Pooling=True;Min Pool Size=5;Max Pool Size=20;Persist Security Info=True;MultipleActiveResultSets=True;Application Name=EntityFramework;Enlist=false" providerName="System.Data.EntityClient" /&gt; </code></pre> <p>I tried setting the <code>providerName</code> to <code>System.Data.SqlClient</code> but it doesn't change anything.</p> <p>Please note that the original connection string was in the database first format:</p> <pre><code>&lt;add name="OrderManagement" connectionString="metadata=res://*/MyManagementModel.csdl|res://*/MyManagementModel.ssdl|res://*/MyManagementModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;Data Source=MyServer;Initial Catalog=MyDBName;User Id=MyUser;Password=MyPwd;Pooling=True;Min Pool Size=5;Max Pool Size=20;Persist Security Info=True;MultipleActiveResultSets=True;Application Name=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt; </code></pre> <p>If I try to open a connection whilst I keep the connection string in the database first format, I m facing the exception <code>Keyword metadata not supported</code>, and when I put the connection string on the code first format, I m facing the error <code>The context is being used in Code First mode with code that was generated from an EDMX file for either Database First or Model First development.</code></p>
0non-cybersec
Stackexchange
Five Steps To Tyranny (2001) - A documentary that shows how those in positions of power may cultivate the conditions of tyranny in any population by demonstrating how easily ordinary people may be manipulated into compliance with “authority"..
0non-cybersec
Reddit
I feel like I'm a terrible person. but I can't help but hating my stepson. He's 6, just a kid and dumb as a brick. He has the personality of his mother, lies, and has no social skills. I cannot stand spending time with him. Unfortunately we do not get him for long enough periods of time to do any real progress. I feel like a terrible person, because I genuinely do like kids, for the most part. The awful ones I'm not a fan of. He happens to fall under that category. I've tried for so long to look past the reasons I don't like spending time with him and I'm ashamed that I could feel this way about a child. I can't tell my husband because he feels like since he is a part of him, I should love him, but it just doesn't work like that. Unless I really am the worst person in the world (not just the worst stepmother)
0non-cybersec
Reddit
Waka Flocka - Gucci Gang (remix).
0non-cybersec
Reddit
@Blogmarketing_L : https://t.co/XTu6IGBgis - Affiliate Zone Thrift Store.
0non-cybersec
Reddit
Do Cisco ACL need to be configured in both directions to allow traffic?. <p>I'm not sure how Cisco ACL works on a SF300 managed switch. </p> <p>I have the switch in L3 mode and with different VLANs configured. </p> <p>Each VLAN has couple of ports in Access mode assigned to it. </p> <p>For each VLAN, I wanted to apply some ACL rules. For example, one VLAN should only be able to access the internet to browse websites, so allowing ports 80 and 443.</p> <p>The ACE rules I tried look like this:</p> <pre><code>permit tcp 10.0.100.0 0.0.0.255 any any www ace-priority 100335 permit tcp 10.0.100.0 0.0.0.255 any any 443 ace-priority 100355 </code></pre> <p>But this alone will not let the clients access the web. To do that, I had to allow the traffic in opposite direction as well:</p> <pre><code>permit tcp any www 10.0.100.0 0.0.0.255 any ace-priority 100375 permit tcp any 443 10.0.100.0 0.0.0.255 any ace-priority 100395 </code></pre> <p>Which is something I don't like because I want to only allow connections requested by the clients in the VLAN. I don't want to allow unsolicited connection from outside.</p> <p><strong>So my question is whether there's a way to allow web access without having to use both sets of rules on this Cisco managed switch.</strong> </p> <p>My only guess is that what I try to achieve is not a job for a switch but instead for a firewall, which the SF300 is not. Or maybe I miss some keyword, like "established", which I found in some manuals but it doesn't seem to apply to the SF300 switch as there's no such keyword.</p>
0non-cybersec
Stackexchange
How to use merge hints to isolate complex queries in SQL Server. <p>I can understand that if I join individual queries that are "individually fast" the combination may become slow because the default execution plan may be non-optimal. However when I know the number of rows for one query is very small I think I should be able to use hints to control the joins.</p> <pre><code>select cj.a, cv.b from (select distinct a from complexJoin) cj -- 2 rows inner loop join complexView cv on cj.a = cv.a order by cj.a, cv.b </code></pre> <p>If cj is &lt;1s and cv &lt;1s expect this to be &lt;~2s but using any hint (merge/hash/loop) it is often > 1min.</p> <p>I also tried to use CROSS APPLY because the docs claimed that the inner select is executed exactly once for each outer row. The query takes ~100x longer than running the inner query twice manually so perhaps I don't understand the docs.</p> <pre><code>select cj.a, cv.b from (select distinct a from complexJoin) cj -- 2 rows cross apply (select * from complexView where a = cj.a) cv order by cj.a, cv.b </code></pre> <p>If I populate a temp table with results from "cj" and then join _with_no_hint_ or use the cross apply it is fast but do I really have to resort to that? If I use the temp table and attempt "any" of the join hints (loop/merge/hash) it is slow so maybe that is a key point.</p> <p>I don't believe diving into the depths of the query plan (both are complex to begin with) are required to solve this type of problem in general: I just want guaranteed isolation without resorting to a temp table--is that really not possible?</p>
0non-cybersec
Stackexchange
Always use MVVM in a WPF app, or are alternative patterns still practical/useful?. <p>On page 374 in the book <a href="https://rads.stackoverflow.com/amzn/click/com/073562609X" rel="noreferrer" rel="nofollow noreferrer"><strong><em>Microsoft .NET Architecting Applications for the Enterprise</em></strong></a>, there is a chart regarding the evolution of patterns for the presentation layer and their impact on platforms (figure 7-14).</p> <p>In addition to showing the evolution from the original MVC pattern, to the more modern variants, that chart also shows that the following modern patterns can be applied across the following technologies:</p> <ol> <li><strong>Model2</strong> (MVC) <ul> <li>Web Only</li> </ul></li> <li><strong>Passive View</strong> (MVP) <ul> <li>Web</li> <li>WinForms</li> <li>WPF</li> </ul></li> <li><strong>Supervising Controller</strong> (MVP) <ul> <li>Web</li> <li>WinForms</li> <li>WPF</li> </ul></li> <li><strong>MVVM</strong> (Presentation Model) <ul> <li>WPF Only</li> </ul></li> </ol> <p><strong>Note:</strong> One other recent pattern of interest lately not in that chart is <a href="http://www.atomicobject.com/files/PresenterFirstAgile2006.pdf" rel="noreferrer"><strong><em>Presenter First (MVP)</em></strong></a> which was envisioned to be more accommodating of TDD. </p> <hr> <p>From what I understand if one develops with WPF, then the <em>MVVM</em> pattern is the de facto choice (kind of like <em>Model2</em> is for web development). That said, it appears nothing prevents one from using <em>Passive View</em>, <em>Supervising Controller</em>, or <em>Presenter First</em> in a WPF app. Such an approach would result in an application that doesn't really care if the front end is WPF, WinForms, or the Web. It appears that these MVP variants allow more flexibility.</p> <p>However, does aiming for UI-platform-agnostic flexibility (that might not be needed) come at the cost of making WPF development much more difficult and lose out on a portion of the features/power that WPF offers? So much so that the costs outweigh the benefits?</p> <p>In other words, is MVVM so great that one shouldn't consider other alternatives in WPF applications?</p>
0non-cybersec
Stackexchange
TIFU by requesting $23625 worth of drug money over Google Wallet. So sometimes when I show friends or people how you can request money over Google Wallet, I'll send a request for a few thousand bucks to close friends with a note saying something like "for my ransom" or "need crack". They know whats up, they read it, chuckle and reject the request, it's all good. Except today I got this [email](http://i.imgur.com/4rm3YVC.png) from Google... EDIT: All out of inbox invites, /u/herrsergio and /u/3sidedpolygon and /u/OLDDAZE enjoy your inbox, everyone else go bother those guys :)
0non-cybersec
Reddit
How easy is it to solo-mine new altcoins?. <p>It seems to be pretty clear that CPU/GPU mining is obsolete for the big fellas (Litecoin, Bitcoin, Ethereum, arguably Dogecoin). This is a bummer for beginners like myself cause I'm keen to dive in and get my PC grinding away at the digital coalface like it's 2009.</p> <p>I've decided that I want to mine a bunch of altcoins and completely disregard short-term profitability (mining BTC wasn't profitable in 2009, but look at how much it's worth now!). </p> <p>My actual question: Exactly how does one go about solo mining altcoins? Is the process the same as mining bitcoin, litecoin, dogecoin, ethereum etc? What program do you need to download and how easy is it to configure? I ask because I have had zero luck even getting set up with mining these more mainstream coins. I was really hoping for a "download program, punch in your wallet code and go" situation, but instead I've had to muck around with mining pools and heaps of complicated settings and I can never get it working. Some guidance would be appreciated</p>
0non-cybersec
Stackexchange
Michael Wolff: Book sold a million copies in 4 days.
0non-cybersec
Reddit
How to prevent selectedindexchanged event when DataSource is bound?. <p>I have ComboBox control(WinForm project).</p> <p>When I bind DataSource to the ComboBox control combobox_selectedindexchanged event is fired.</p> <p>Any idea how to prevent selectedindexchanged event when DataSource is bound?</p>
0non-cybersec
Stackexchange
Why is final the only modifier for local variables in Java?. <pre><code>class Test { public static void main(String[] args) { private int x = 10; public int y = 20; protected int z = 30; static int w = 40; final int i = 50; } } </code></pre> <p>The <strong>only applicable modifier is final</strong> here; <strong>for other modifiers</strong>, the program gives <strong>compiler errors</strong>. Why is that? Please explain in detail. </p>
0non-cybersec
Stackexchange
Advice on removing and/or replacing waterlox finish on wood countertop?. Have a wood countertop finished with waterlox about 4 years ago that did pretty well except where a soap dish was set for several months. There are dark blotchy areas where I presume soapy water and associated soap residue accumulated. [Pic](https://photos.app.goo.gl/xK4SahjeXW7MUAQ76) Can I get some advice about how I might best either salvage/reapply the waterlox finish or perhaps strip and use an alternative finish? This is unstained oak, would like to keep it a similar naturalish color. Thanks
0non-cybersec
Reddit
how to catch angular ng-include error. <p>When I use <code>ng-include</code> as a title, how do I catch the error when the address (file path) does not exist?</p> <p>I finished a <code>ng-include router</code> inside a <code>ng-view(with ng-route)</code>, It's a little bit like this:</p> <p><strong>ContentCtrl</strong>:</p> <pre><code>var content = $route.current.params.content, tmplArr = content.split("_"), tmpl = {}, personId=$route.current.params.personId||$scope.persons[0].id; $scope.personId=personId; tmpl.url = "content/"; for (var i = 0, len = tmplArr.length; i &lt; len; i++) { tmpl.url += tmplArr[i] + "/"; } tmpl.url = tmpl.url.substring(0, tmpl.url.length - 1) + ".html"; $scope.template = tmpl; </code></pre> <p><strong>ContentView</strong>:</p> <pre><code>&lt;div ng-include="template.url" class="ng-animate"&gt;&lt;/div&gt; </code></pre> <p>when I use the addr is not exist like:/home/#/content/profile_asdfa, the angular just fetch the resource in a loop. So I need to catch the ng-include error,when there is no template file in the hash. Can anybody Help me ? Thx!</p>
0non-cybersec
Stackexchange
Any two points in a Stone space can be disconnected by clopen sets. <p>Let $B$ be a Stone space (compact, Hausdorff, and totally disconnected). Then I am basically certain (because of Stone's representation theorem) that if $a, b \in B$ are two distinct points in $B$, then $B$ can be written as a disjoint union $U \cup V$ of open sets where $a \in U, b \in V$. </p> <p>However, I can't seem to prove this directly. The proof should be fairly straightforward, so I am sure I'm missing something obvious. (As an exercise for myself, I'm trying to prove Stone's representation theorem, and I need this as a lemma.)</p>
0non-cybersec
Stackexchange
Why is the VPN switch sometimes missing from settings on my iPad?. <p>There is a VPN switch in settings that often appears below the wifi option in settings on iOS: <img src="https://i.stack.imgur.com/NzpIl.png" alt="enter image description here"> (the above image is from a website and not my iPad, as I can't seem to get my iPad to show VPN right now)</p> <p>The trouble is, it seems to be missing: <img src="https://i.stack.imgur.com/enMUt.png" alt="enter image description here"> (this image is from my iPad)</p> <p><strong>VPN switch present:</strong></p> <ul> <li>in all circumstances prior to installing an AT&amp;T sim card, including when a Telus sim card was installed</li> <li>while using wifi with an AT&amp;T sim card installed but in a region with no AT&amp;T coverage and no data roaming disable by AT&amp;T (ie. "searching..." shown in connection status area)</li> </ul> <p><strong>VPN switch missing:</strong></p> <ul> <li>while connected to AT&amp;T LTE/4G using iPad sim</li> <li>while connected to my AT&amp;T iPhone using personal hotspot (via either Bluetooth or wifi) even though VPN is available from the settings screen of my iPhone whether or not cellular data is enabled on iPad</li> <li>while connected to WIFI whether or not cellular data is enabled on my iPad</li> </ul> <p><strong>What is going on here? Does the connection/sim card/network somehow determine whether VPN is available? Is there something else altogether I need to check?</strong></p>
0non-cybersec
Stackexchange
TIFU by letting my waistline go..
0non-cybersec
Reddit
1 Analytical Model and Topology Evaluation of Quantum Secure Communication Network Qiong Li, Member, IEEE, Yaxing Wang, Haokun Mao, Jiameng Yao, Qi Han Abstract—Due to the intrinsic point-to-point feature of quan- tum key distribution system, it is inevitable to study and develop the Quantum Secure Communication Network (QSCN) technol- ogy to provide security communication service for a large-scale of nodes over a large spatial area. Considering the quality assurance and expense control, building an effective analytical model of QSCN becomes a critical task. In this paper, the first analytical model of QSCN is proposed, which is called flow-based QSCN (F-QSCN) analytical model. In addition, based on the F-QSCN analytical model, the research on QSCN topology evaluation is conducted by proposing a unique QSCN performance indicator, named Information-Theoretic Secure communication bound, and the corresponding linear programming based calculation algo- rithm. Plentiful experimental results based on the topologies of SECOQC network and Tokyo network validate the effectivity of the proposed analytical model and the performance indicator. Index Terms—Quantum secure communication network, quan- tum key distribution, analytical model, topology evaluation. I. INTRODUCTION W ITH the rapid development and increasing applicabilityof quantum key distribution (QKD) technology [1]– [4], the intrinsic feature of point-to-point (P2P) [5] has become one of the major bottlenecks which limits its application scale. In order to overcome the limitation of node quantity [6] and communication distance, it is an inevitable development trend to construct the Quantum Secure Communication Network (QSCN) with multiple QKD devices. The QSCN in this paper is defined as a network that provides secure communication service utilizing the keys generated by QKD devices [7]. In order to explore the physical feasibility of QSCN networking, many practical QSCNs [8]–[13] have been constructed in recent years. The node quantity of the existing QSCNs has expanded from 6 nodes [10], [14] to 56 nodes [15], and the communication distance has extended from 19.6 kilometers [16] to 2000 kilometers [15]. With the growing coverage and complexity of QSCNs, effective modeling become crucial for the functional verification, quality assurance, expense control, cycle shorten, etc. [17], [18]. Simulation model and analytical model are the two ma- jor approaches of network modeling. Unlike the traditional communication networks, the relevant research of QSCN has not drawn many attentions [7], [19]–[22]. In 2017, Mehic et. al. designed a QSCN simulation model, QKDNetSim [22], based on the classical Network Simulator-version 3 (NS-3) [23] to evaluate and validate the network solution at a low Q. Li, Y. Wang, H. Mao, J. Yao and Q. Han are with the School of Computer Science and Technology, Harbin Institute of Technology, Harbin, China (e- mail: [email protected]). cost. Although QKDNetSim can simulate the key generation process and secure communication process, it could not reflect the practical performance of a QSCN well due to their neglect of the actual key generation capability and volatile communi- cation demand of the QSCN. In order to reflect the practical network state, we designed a practical QSCN simulation model in our previous work [7]. In the model, the actual P2P key generation capability was modeled by the GLLP theory and the volatile end-to-end (E2E) communication demand was modeled by the poisson stochastic process. Although our previous work has enhanced the accuracy of simulation to a great extent, the inherent shortcomings of simulation approach still exist, such as the empirical results, the impossible global optimal solution, and so on. In contrast, as the general mathematical abstraction of the QSCN, an analytical model makes it possible to evaluate the performance of QSCN theoretically and obtain the global opti- mal solution, etc. During the modeling of traditional communi- cation network, the problems of congestion control, congestion prevention, queue schedule, and etc. are focused. While the study results of our simulation model [7] demonstrate that the performance of a practical QSCN has neglectable relationship with those problems, but mainly depends on how its key generation capability satisfies the communication demand. Accordingly, we are motivated to study the analytical model of QSCN and its applications concentrating on this characteristic. To the best of our knowledge, this is the first time that the analytical model of QSCN is proposed. • In this paper, the flow-based QSCN (F-QSCN) analytical model is presented. In the model, a QSCN is abstracted as a graph G= (V,E,F), with the node set V , the edge set E and the QSCN flow set F . According to the analysis of QSCN characteristics, the detailed attributes of node and edge are designed. What is more, the QSCN flow is defined referring to the generic traffic flow [24], [25], which is a unique component of a QSCN comparing to a classical network. • Based on the F-QSCN analytical model, the research on QSCN topology evaluation is conducted by proposing the indicator, Information-Theoretic Secure (ITS) communi- cation bound, and the corresponding linear programming based calculation algorithm. The indicator is defined as the theoretically optimal quantitative performance of the QSCN topology [26]. The calculation of ITS commu- nication bound is inspired by the linear programming algorithm. • In order to verify the validity and necessity of the ar X iv :1 90 9. 02 46 3v 1 [ qu an t- ph ] 5 S ep 2 01 9 2 proposed analytical model and performance indicator, a typical topology planning task based on the existing topologies of SECOQC network [16] and Tokyo network [14] is designed and analyzed. The experimental results demonstrate the advantages of F-QSCN analytical model and ITS communication bound. The remaining parts of this paper are organized as follows. In Section II, some related works are introduced. In Section III, the F-QSCN analytical model is presented in details. Based on the F-QSCN analytical model, a unique QSCN performance indicator and the corresponding linear programming based calculation algorithm are proposed in Section IV. In Section V, the experiments of topology evaluation based on the F-QSCN analytical model are designed, and the results are analyzed. In Section VI, some conclusions are drawn. II. RELATED WORKS In this section, some related works are reviewed and ana- lyzed. Except for the construction modes, application modes and architecture models of QSCN, the generic MFP, which is usually used for the task allocation, is introduced as one of the theoretical basis of F-QSCN analytical model. A. The Construction Modes of QSCN The construction modes used in the existing QSCNs are mainly divided into three categories: optical switching, quan- tum relay and trusted relay [27]–[30]. Since the optical switch- ing device cannot break the scale limitation [31] and the core technique of quantum relay is still far from mature [32], the trusted relay is the most common construction mode at present. B. The Application Modes of QSCN The application modes used in the existing QSCNs mainly include key-by-key (also called as key relay) [21] and data- by-data (also called as hop-by-hop) [22], where the main difference is how the communication is established. The key- by-key mode, used in the Tokyo network [14], can retain the classical network protocol as much as possible. However, in this mode, the number of key pools configured for each communication node is proportional to the number of potential communication parties. It leads to a huge memory pressure which is intolerable in a large-scale QSCN. The number of key pools for each node is only related to the degree of the node [33] in the data-by-data mode, which was used in the SECOQC network [34]. It can greatly reduce the memory pressure and then enhance the availability of a large-scale QSCN. Therefore, the data-by-data is the more appropriate application mode at present. C. The Architecture Models of QSCN Compared to the traditional communication network, the main difference of QSCN is that its secure communication process between the E2E communication parties needs to con- sume the quantum keys generated by the P2P links. Therefore, the two-layers architecture model of QSCN is proposed in our previous work [7], which is shown in Fig. 1. In the model, the Fig. 1. Two-layers architecture model of QSCN [7] E2E secure communication and P2P key generation proceed in the classical layer and the quantum layer, respectively. Because the P2P key generation capability of QKD device is extremely limited by the length of quantum channel [35], [36] and is markedly lower than the capacity of the classical channel [37], the performance of QSCN is determined by the matching degree between the communication demand and key generation capability. Referring to our previous work [7], the P2P key generation capability of quantum layer can be obtained according to the common calculation method for the secure key rate of QKD device, such as the GLLP theory [38], [39] and the universal composable framework [40]. Assuming that the double decoy state protocol is adopted in QSCN, considering the use of Chernoff bound [41] to estimate the finite code length effect [42], [43], the key generation capability can be calculated as (1), Rkey = max { freqRL,0 } , (1) where RL represents the lower bound of the key generation capability for a photon, calculated as (2), RL =−qQµ fecH ( Eµ ) +qQL 1 [ 1−H ( eU 1 )] . (2) The specific description of the relevant parameters in (2) can be found in our previous work [7]. D. The Generic Maximum-Flow Problem Let G = (V,E) be a directed graph with node set V and edge set E. The graph G = (V,E) is a flow network [44] if it has two distinguished nodes, a source s ∈V , a sink t ∈V , and a positive real-valued capacity c(u,v) for each edge (u,v)∈ E. Definition 1: A traffic flow f on G is a nonnegative function, ranging over all edges (u,v) ∈ E, satisfying the following constraints [45]: (i) Capacity constraint f (u,v)≤ c(u,v) ,∀(u,v) ∈ E. (3) (ii) Flow conservation ∑ v∈V f (u,v)−∑ v∈V f (v,u) = 0,∀u ∈V −{s, t} . (4) 3 The value of traffic flow, [[ f ]], is the total difference between the flows into the sink t and the flows out of it [46], i.e., [[ f ]] = ∑ u∈V [ f (u, t)− f (t,u)]. (5) The MFP aims to compute the maximum value of [[ f ]] for a given network, and it is commonly discussed in the fields of the task assignment, the logistics network, the urban planning, and so on. With regard to a communication network, there are usually multiple communication pairs concurrently, in the form of calls or connections [47]. Therefore, the performance evaluation of a communication network is much more complicated than the MFP solving. The classical solving algorithms for MFP, such as Ford-Fulkerson [48] and Edmonds-Karp [49], cannot be directly applied. III. FLOW-BASED ANALYTICAL MODEL With the increase of the coverage and complexity of existing QSCNs, it is urgent to design an effective model for the func- tional verification, quality assurance, expense control, cycle shorten, etc. In this section, a flow-based analytical model is proposed. The “flow” does not mean the generic traffic flow, but the QSCN flow, which will be discussed in III-C. By abstracting the communication party and trusted relay as node, communication link as edge, and the amount of traffic as QSCN flow, the definition of QSCN is given below. Definition 2: A QSCN is modeled as a graph G = (V,E,F), where V , E and F are the sets of nodes, edges, and QSCN flows respectively. A. Node Attributes As a communication network, the most important task of QSCN is to satisfy the communication demand between node pairs. The concept of connection is used to mathematically describe the communication demand. Definition 3: In the QSCN G = (V,E,F), a connection ki j = (si, t j) (si ∈V, t j ∈V ) indicates the communication demand between the node pair (si, t j) [50], where si is a source and t j is a sink. Let K = { (si, t j) |si ∈V, t j ∈V } denote the all desired con- nections in the QSCN. In general, the number of keys con- sumed by the communication demand is determined by the communication demand and the key consumption ratio. The node attributes are illustrated in Table I. TABLE I ATTRIBUTES OF NODE si Attributes Symbol Value Communication demand d ( si, t j ) [0,+∞) Key consumption ratio β ( si, t j ) [0,1] Communication demand d (si, t j) means the average com- munication rate required by the connection (si, t j). Moreover, the communication demand of the node si is denoted by d (si) = { d (si, t j) |t j ∈V } . Key consumption ratio β (si, t j) means the ratio of the key length to the plaintext length in the adopted encryption algorithm. In particular, when the value of β (si, t j) is 1, it means that the one-time-pad (OTP) algorithm [51] is adopted to achieve the ITS secure communication. When the value of β (si, t j) is 0, it means that the adopted encryption algorithm does not require the keys generated by QKD devices. Accord- ingly, the key consumption ratio of the node si is denoted by β (si) = { β (si, t j) |t j ∈V } . B. Edge Attributes For a given channel, since there always exist upstream and downstream communication sharing the channel bandwidth [52], the edge in the QSCN is considered to be undirected. The undirected edge formed by connecting node um ∈V and vn ∈V is denoted as (um,vn) ∈ E. The main peculiarity of QSCN lies on the fact that the key generation process requires the participation of quantum channel and the key generation rate is very limited by the length of quantum channel. In order to mathematically de- scribe this characteristic, several important attributes of edge are extracted. Their symbol representations and value ranges are shown in Table II. TABLE II ATTRIBUTES OF EDGE (um,vn) Attributes Symbol Value Classical channel capacity c(um,vn) [0,+∞) Key generation capability r (um,vn) [0,+∞) Classical channel capacity c(um,vn) represents the capabil- ity of classical channel to transmit information. In particular, when the c(um,vn) is 0, there is not a classical channel on the edge (um,vn), resulting in the infeasibility of the secure com- munication process. Meanwhile, because the classical channel is indispensable to transmit supplementary information in the key generation process [53], the key generation process also cannot proceed on this edge. Key generation capability r (um,vn) is related to the pa- rameters of the QKD device configured on the edge (um,vn). Suppose DVQKD devices are configured, according to (1), the key generation capability of the edge (um,vn) is calculated as (6), r (u,v) = { Rkey, c(um,vn) 6= 0 0, c(um,vn) = 0. (6) C. Flow Conditions Although the concept of traffic flow is referred in this work, the flow in QSCN has many unique features due to the obvious difference between QSCN and generic flow network. For example, there exist many connections, the edge 4 is undirected and owns two types of capacities. Definition 4: In the QSCN G = (V,E,F), a QSCN flow f ∈ F is a nonnegative function ranging over all connections (si, t j) ∈ K and all edges (um,vn) ∈ E, which is represented by the symbol f (si, t j,um,vn). Obviously, the QSCN flow set F can be rewritten as F = { f (si, t j,um,vn) |(si, t j) ∈ K,(um,vn) ∈ E } . Since the se- cure transmission process is organized in packets, the value of f (si, t j,um,vn) must be the integer multiples of the packet size P, which is given as (7), f (si, t j,um,vn) P ∈ N,∀(um,vn) ∈ E,∀(si, t j) ∈ K, (7) where N is the set of natural numbers. In particular, when the value of f (si, t j,um,vn) is 0, it means that there is no flow of the connection (si, t j) on the edge (um,vn). In addition, due to the secure communication process is directed, f (si, t j,um,vn) is considered to be a directed flow. Therefore, f (si, t j,um,vn) and f (si, t j,vn,um) are different. The special conditions of QSCN flow are analyzed as below. (i) Capacity constraint - For all (um,vn) ∈ E, the total flow on the edge (um,vn) and its reverse edge (vn,um) must be non-negative and less than or equal to its classical channel capacity. In addition, as an undirected graph, classical channel capacity is shared by upstream and downstream flows. So (8) should be satisfied. 0≤ ∑ (si,t j)∈K [ f (si, t j,um,vn)+ f (si, t j,vn,um)] ≤ c(um,vn),∀(um,vn) ∈ E. (8) - For all (um,vn) ∈ E, the total key consumption on the edge (um,vn) and its reverse edge (vn,um) must be non-negative and less than or equal to its key generation capability. Considering the key consumption ratio β (si, t j), the relationship between the total flow on the edge (um,vn) and its reverse edge (vn,um) is given as (9), 0≤ ∑ (si,t j)∈K β (si, t j) [ f (si, t j,um,vn)+ f (si, t j,vn,um)] ≤ r (um,vn) ,∀(um,vn) ∈ E, (9) (ii) Flow conservation - For all connections (si, t j)∈K and all of the non-source and non-sink nodes um ∈ V − { si, t j } , the total flows into the node um must equal to the total flows out of it, i.e., ∑ vn∈V f (si, t j,um,vn)− ∑ vn∈V f (si, t j,vn,um) = 0, ∀um 6= si, t j,∀(si, t j) ∈ K. (10) As the theoretical foundation of topology evaluation and design, routing protocol evaluation and design, QKD devices selection, expense control, the F-QSCN analytical model can not only be used for the construction of a new QSCN, but also for the optimization of the existing QSCNs. IV. F-QSCN BASED TOPOLOGY EVALUATION To construct a high performance QSCN, designing a precise topology evaluation scheme is one of the most important tasks. Based on the F-QSCN analytical model, the research on QSCN topology evaluation is conducted. Firstly, the ITS communication bound indicator is designed to describe the quality of QSCN topology mathematically. In addition, a linear programming based calculation algorithm is proposed to obtain the quantitative quality. A. The Description of Topology Quality For the sake of eliminating the influence of encryption algorithm on topology evaluation, the OTP algorithm [51], which can provide ITS communication service, is adopted in this section. In other words, for all (si, t j) ∈ K, the value of β (si, t j) is set to 1. The quality of QSCN topology is measured by the proposed performance indicator, ITS communication bound. Definition 5: For a QSCN with the given topology, the ITS communication bound is defined as the theoretically optimal flow assignment to achieve the maximal satisfaction degree for all connections in K. Similar to the traffic flow, the actual value of a QSCN flow f of a given connection (si, t j), [[ f (si, t j)]], is the total difference between the flows into the sink t j and the flows out of it, which is represented as (11), [[ f (si, t j)]] = ∑ um∈V,vn=t j [ f (si, t j,um,vn)− f (si, t j,vn,um)]. (11) Let symbol M (si, t j) represent the satisfaction degree for the given connection (si, t j), which means the ratio of the actual value of QSCN flow to the communication demand, i.e., M (si, t j) = [[ f (si, t j)]] d (si, t j) . (12) M (si, t j) ≥ 1 means that the communication demand is sat- isfied, otherwise it is not satisfied. Accordingly, the ITS communication bound B is defined as (13a), B = max F ρ, (13a) ρ = min (si,t j)∈K M (si, t j), (13b) where ρ is the worst satisfaction degree of all connections. Obviously, the communication demands of all connections are satisfied only when the value of B is greater than 1. The larger value of B means the higher satisfaction degree. Even more noteworthy is that, the gap between the simulation 5 max X ρ (17a) s.t. 0≤ ∑ (si,t j)∈K x(si, t j,um,vn)+ ∑ (si,t j)∈K x(si, t j,vn,um)≤ c(um,vn) P ,∀(um,vn) ∈ E, (17b) 0≤ ∑ (si,t j)∈K x(si, t j,um,vn)+ ∑ (si,t j)∈K x(si, t j,vn,um)≤ r (um,vn) P ,∀(um,vn) ∈ E, (17c) ∑ vn∈V x(si, t j,um,vn)− ∑ vn∈V x(si, t j,vn,um) = 0,∀um 6= si,t j,∀(si, t j) ∈ K, (17d) ρ P − ∑ um∈V,vn=t j [x(si, t j,um,vn)− x(si, t j,vn,um)] d (si, t j) ≤ 0,∀(si, t j) ∈ K, (17e) x(si, t j,um,vn) ∈ N,∀(um,vn) ∈ E,∀(si, t j) ∈ K, (17f) ρ ∈ R+0 . (17g) performance of a QSCN with specific network protocols and the ITS communication bound of this QSCN can be used to evaluate the performance of the network protocols. B. The Calculation of Topology Quality To calculate the indictor B, it is necessary to explore the optimal assignment of the QSCN flows, which is defined as multi-connection flow problem (MCFP) in this paper. Although the MCFP seems to be a combination of several MFPs, the solutions of MFP fail to work due to the interaction among multiple MFPs [54]. According to the definition of QSCN flow, the flow must satisfy the capacity constraint and the flow conservation. Therefore, the MCFP can be formulated as (14), max F min (si,t j)∈K ∑ um∈V,vn=t j [ f (si, t j,um,vn)− f (si, t j,vn,um)] d (si, t j) , (14a) s.t. (8),(9),(10),(7). (14b) In (14), F = { f (si, t j,um,vn) |(si, t j) ∈ K,(um,vn) ∈ E } are the set of decision variables. The formulation is very similar to that of the linear programming problem. However, due to the issues of non-linear objective function and non-standard data type of the decision variables, the MCFP is not a standard linear programming problem, leading to the solving difficulty. In order to transform this problem into a standard linear programming, the original decision variable f (si, t j,um,vn) is converted into a new variable x(si, t j,um,vn) by (15), x(si, t j,um,vn) = f (si, t j,um,vn) P . (15) Therefore, the X = { x(si, t j,um,vn) |(si, t j) ∈ K,(um,vn) ∈ E } becomes the new set of decision variables. In addition, the original objective function is replace by a new objective function ρ , by adding the ρ as a new decision variable and adding two constraint conditions of ρ , which are shown as (16), ρ P − ∑ um∈V,vn=t j [x(si, t j,um,vn)− x(si, t j,vn,um)] d (si, t j) ≤ 0,∀(si, t j) ∈ K, (16a) ρ ∈ R+0 , (16b) where R+0 is the set of nonnegative real numbers. According to the above operations, the MCFP is trans- formed into an equivalent standard mixed integer linear pro- gramming problem (MILP), which is formulated as (17). In order to solve this MILP, a linear programming solver [55] Gurobi [56], is adopted. In the formulation, r (um,vn) represents the key generation capability of QKD device. It is worth to mention that all kinds of existing QKD devices can be adopted in the QSCN, the corresponding topology quality will be obtained just by changing the calculation of r (um,vn). V. EXPERIMENTAL RESULTS AND ANALYSIS A. Experiment Design In order to fully verify the validity and necessity of the proposed analytical model and performance indicator, two existing QSCN topologies, SECOQC network and Tokyo network, shown in Fig. 2 and Fig. 3, are selected in the experiment of topology evaluation. Fig. 2. Topology of the SECOQC network [7] In addition, in order to compare with the simulation perfor- mance of the literature [7], the same packet size P = 500 byte 6 TABLE III PARAMETERS OF QKD DEVICES [7] freq q α ηBob edet µ ν φ Y0 e0 fec Nµ Nν Nφ ς 1 GHz 0.9 0.2 db/km 0.1 0.01 0.4 0.1 0 2.1E-5 0.5 1.15 1.6E10 2E9 2E9 5.73E-7 Fig. 3. Topology of the Tokyo network and the same parameters of QKD device shown in Table III are adopted in the experiment. Moreover, the same communication scenario is considered, where the communication demands between any two different nodes are set to be the same. That is to say K = { (si, t j) |si ∈V, t j ∈V,si 6= t j } , (18a) d (si, t j) = { d,(si, t j) ∈ K, 0,(si, t j) /∈ K. (18b) Considering the classical optical fiber communication tech- nology has reached a quite high-level [57], [58], the classical channel capacities of all edges are set as 100 Mbps, i.e., c(um,vn) = 100Mbps,∀(um,vn) ∈ E. (19) B. Topology Evaluation In the network topology planning, it is a typical task to find out how to enhance the network performance effectively by adding just one device to the existing topology. In the context of QSCN, the equivalent task is to find out how to enhance the QSCN performance effectively by adding a QKD device to an existing QSCN topology. When the new QKD device is placed, a modified topology is actually formed. As we all know, the key generation process relies on the optical fiber. Therefore, the QKD device can function only by placed on the existing edge. In addition, adding a QKD device to the edge (um,vn) means the increase of the key generation capability of this edge and its reverse edge, r (um,vn) and r (vn,um). In order to find out the best placement scheme, a QKD device is placed at all possible edges of SECOQC network respectively to form 8 modified topologies. To quantitatively evaluate different placement schemes, the ITS communication bound of the original SECOQC topology and 8 modified SECOQC topologies are calculated, as shown in Table IV. As seen from the Table IV, only when the QKD device is placed on the edge e1, the ITS communication bound is increased and the communication demand is switched from unsatisfied to satisfied. That is to say, the edge e1 is the TABLE IV PERFORMANCE COMPARISON OF THE ORIGINAL SECOQC TOPOLOGY AND MODIFIED SECOQC TOPOLOGIES (d = 50Kbps) Placement none e1 e2 e3 e4 e5 e6 e7 e8 Bound 0.96 1.92 0.96 0.96 0.96 0.96 0.96 0.96 0.96 bottleneck edge in the topology of SECOQC network, which is consistent with the simulation results in the literature [7]. From the topology in Fig. 2, it can be seen that the length of the edge e1 is 85 kilometers, which is markedly longer than other edges, leading to its poor key generation capability. However, as a “bridg” [59] in the topology, the traffic of edge e1 is heavy. Therefore, the validity of the F-QSCN analytical model and the ITS communication bound indicator are verified. Considering the conclusion of e1 is located as the bottleneck edge in the topology of SECOQC network seems a trivial solution, another experiment based on the topology of Tokyo network is designed to further verify the necessity of the pro- posed analytical model and indicator. For the same topology planning task, the results of ITS communication bounds of the original Tokyo topology and 6 possible modified Tokyo topologies are calculated as shown in Table V. TABLE V PERFORMANCE COMPARISON OF THE ORIGINAL TOKYO TOPOLOGY AND MODIFIED TOKYO TOPOLOGIES (d = 500Kbps) Placement none e1 e2 e3 e4 e5 e6 Bound 0.92 0.92 0.992 0.92 1.296 0.92 0.92 As seen from the Table V, when the QKD device is placed on the edge e2 or the edge e4, the ITS communication bound is improved. In addition, only when the QKD device is placed on the edge e4, the communication demand can be satisfied. This conclusion cannot be intuitively inferred or directly obtained through simulation. The necessity of the F-QSCN analytical model and the ITS communication bound indicator are verified. VI. CONCLUSIONS In this paper, the analytical model of QSCN is proposed for the first time. The major contributes include: (I) The F-QSCN analytical model is proposed by modeling a QSCN as a graph with nodes, edges and QSCN flows; (II) Based on the F-QSCN analytical model, a unique QSCN performance indicator is proposed and the corresponding linear programming based calculation algorithm is designed; (III) The validity and ne- cessity of the proposed analytical model and the performance 7 indicator are verified through the subtly designed experiments on typical topology planning task. We will continue to study the topology design, the routing protocol design, and etc. of QSCN in our future work. Through this study, we try to explore a new possibility on the research of QSCN and promote the developing process of QSCN technology. ACKNOWLEDGMENT This work is supported by the Space Science and Tech- nology Advance Research Joint Funds (6141B06110105), Na- tional Natural Science Foundation of China (Grant Number: 61771168, 61702224). REFERENCES [1] H.-L. Yin, T.-Y. Chen, Z.-W. Yu, H. Liu, L.-X. You, Y.-H. Zhou, S.-J. Chen, Y. Mao, M.-Q. Huang, W.-J. Zhang et al., “Measurement-device- independent quantum key distribution over a 404 km optical fiber,” Physical review letters, vol. 117, no. 19, p. 190501, 2016. [2] S.-K. Liao, W.-Q. Cai, W.-Y. Liu, L. Zhang, Y. Li, J.-G. Ren, J. Yin, Q. Shen, Y. Cao, Z.-P. Li et al., “Satellite-to-ground quantum key distribution,” Nature, vol. 549, no. 7670, p. 43, 2017. [3] Z. Yuan, A. Plews, R. Takahashi, K. Doi, W. Tam, A. Sharpe, A. Dixon, E. Lavelle, J. Dynes, A. Murakami et al., “10-mb/s quantum key distribution,” Journal of Lightwave Technology, vol. 36, no. 16, pp. 3427–3433, 2018. [4] Y. Zhang, Z. Li, Z. Chen, C. Weedbrook, Y. Zhao, X. Wang, Y. Huang, C. Xu, X. Zhang, Z. Wang et al., “Continuous-variable qkd over 50 km commercial fiber,” Quantum Science and Technology, vol. 4, no. 3, p. 035006, 2019. [5] C. H. Bennett and G. Brassard, “Quantum cryptography: public key distribution and coin tossing.” Theor. Comput. Sci., vol. 560, no. 12, pp. 7–11, 2014. [6] M. F. Tüysüz and H. A. Mantar, “A local estimation of node quantity and channel density for voip applications over ieee 802.11 e wlans,” in ICIMU 2011: Proceedings of the 5th international Conference on Information Technology & Multimedia. IEEE, 2011, pp. 1–5. [7] Y. Wang, Q. Li, Q. Han, and Y. Wang, “Modeling and simulation of practical quantum secure communication network,” arXiv preprint arXiv:1904.10710, 2019. [8] C. Elliott, A. Colvin, D. Pearson, O. Pikalo, J. Schlafer, and H. Yeh, “Current status of the darpa quantum network,” in Quantum Information and computation III, vol. 5815. International Society for Optics and Photonics, 2005, pp. 138–149. [9] C. Elliott and H. Yeh, “Darpa quantum network testbed,” BBN TECH- NOLOGIES CAMBRIDGE MA, Tech. Rep., 2007. [10] A. Poppe, M. Peev, and O. Maurhart, “Outline of the secoqc quantum- key-distribution network in vienna,” International Journal of Quantum Information, vol. 6, no. 02, pp. 209–218, 2008. [11] R. Alleaume, F. Roueff, E. Diamanti, and N. Lütkenhaus, “Topological optimization of quantum key distribution networks,” New Journal of Physics, vol. 11, no. 7, p. 075002, 2009. [12] M. Fujiwara, H. Ishizuka, S. Miki, T. Yamashita, Z. Wang, A. Tanaka, K. Yoshino, Y. Nambu, S. Takahashi, A. Tajima et al., “Field demon- stration of quantum key distribution in the tokyo qkd network,” in International Quantum Electronics Conference. Optical Society of America, 2011, p. I403. [13] S.-K. Liao, W.-Q. Cai, J. Handsteiner, B. Liu, J. Yin, L. Zhang, D. Rauch, M. Fink, J.-G. Ren, W.-Y. Liu et al., “Satellite-relayed intercontinental quantum network,” Physical review letters, vol. 120, no. 3, p. 030501, 2018. [14] M. Sasaki, M. Fujiwara, H. Ishizuka, W. Klaus, K. Wakui, M. Takeoka, S. Miki, T. Yamashita, Z. Wang, A. Tanaka et al., “Field test of quantum key distribution in the tokyo qkd network,” Optics express, vol. 19, no. 11, pp. 10 387–10 409, 2011. [15] M. Razavi, An Introduction to Quantum Communications Networks, ser. 2053-2571. Morgan & Claypool Publishers, 2018. [Online]. Available: http://dx.doi.org/10.1088/978-1-6817-4653-1 [16] M. Peev, C. Pacher, R. Alléaume, C. Barreiro, J. Bouda, W. Boxleitner, T. Debuisschert, E. Diamanti, M. Dianati, J. Dynes et al., “The secoqc quantum key distribution network in vienna,” New Journal of Physics, vol. 11, no. 7, p. 075001, 2009. [17] M. Dianati, R. Alléaume, M. Gagnaire, and X. Shen, “Architecture and protocols of the future european quantum key distribution network,” Security and Communication Networks, vol. 1, no. 1, pp. 57–74, 2008. [18] E. Diamanti, H.-K. Lo, B. Qi, and Z. Yuan, “Practical challenges in quantum key distribution,” npj Quantum Information, vol. 2, p. 16025, 2016. [19] O. Maurhart, C. Pacher, A. Happe, T. Lor, C. Tamas, A. Poppe, and M. Peev, “New release of an open source qkd software: design and implementation of new algorithms, modularization and integration with ipsec,” in Proc. Qcrypt. Citeseer, 2013. [20] Q. Han, L. Yu, W. Zheng, N. Cheng, and X. Niu, “A novel qkd network routing algorithm based on optical-path-switching,” Journal of Information Hiding and Multimedia Signal Processing, vol. 5, no. 1, pp. 13–19, 2014. [21] C. Yang, H. Zhang, and J. Su, “The qkd network: model and routing scheme,” Journal of Modern Optics, vol. 64, no. 21, pp. 2350–2362, 2017. [22] M. Mehic, O. Maurhart, S. Rass, and M. Voznak, “Implementation of quantum key distribution network simulation module in the network simulator ns-3,” Quantum Information Processing, vol. 16, no. 10, p. 253, 2017. [23] T. R. Henderson, M. Lacage, G. F. Riley, C. Dowell, and J. Kopena, “Network simulations with the ns-3 simulator,” SIGCOMM demonstra- tion, vol. 14, no. 14, p. 527, 2008. [24] A. Schrijver, “On the history of the transportation and maximum flow problems,” Mathematical Programming, vol. 91, no. 3, pp. 437–445, 2002. [25] S. Han, Z. Peng, and S. Wang, “The maximum flow problem of uncertain network,” Information Sciences, vol. 265, pp. 167–175, 2014. [26] K. L. Calvert, M. B. Doar, and E. W. Zegura, “Modeling internet topology,” IEEE Communications magazine, vol. 35, no. 6, pp. 160– 163, 1997. [27] P. D. Townsend, “Quantum cryptography on multiuser optical fibre networks,” Nature, vol. 385, no. 6611, p. 47, 1997. [28] P. D. Kumavor, A. C. Beal, S. Yelin, E. Donkor, and B. C. Wang, “Comparison of four multi-user quantum key distribution schemes over passive optical networks,” Journal of lightwave technology, vol. 23, no. 1, p. 268, 2005. [29] L. Ma, H. Xu, and X. Tang, “Polarization recovery and auto- compensation in quantum key distribution network,” in Quantum Com- munications and Quantum Imaging IV, vol. 6305. International Society for Optics and Photonics, 2006, p. 630513. [30] R. Alleaume, M. Riguidel, H. Weinfurter, N. Gisin, P. Grangier, M. Di- anati, M. Godfrey, G. Ribordy, J. Rarity, M. Peev et al., “Secoqc white paper on quantum key distribution and cryptography,” Tech. Rep., 2007. [31] P. Toliver, R. J. Runser, T. E. Chapuran, J. L. Jackel, T. C. Banwell, M. S. Goodman, R. J. Hughes, C. G. Peterson, D. Derkacs, J. E. Nordholt et al., “Experimental investigation of quantum key distribution through transparent optical switch elements,” IEEE Photonics Technology Let- ters, vol. 15, no. 11, pp. 1669–1671, 2003. [32] L.-K. Chen, H.-L. Yong, P. Xu, X.-C. Yao, T. Xiang, Z.-D. Li, C. Liu, H. Lu, N.-L. Liu, L. Li et al., “Experimental nested purification for a linear optical quantum repeater,” Nature Photonics, vol. 11, no. 11, p. 695, 2017. [33] C. Bettstetter, “On the minimum node degree and connectivity of a wire- less multihop network,” in Proceedings of the 3rd ACM international symposium on Mobile ad hoc networking & computing. ACM, 2002, pp. 80–91. [34] M. Dianati and R. Alléaume, “Architecture of the secoqc quantum key distribution network,” in Quantum, Nano, and Micro Technologies, 2007. ICQNM’07. First International Conference on. IEEE, 2007, pp. 13–13. [35] Q. Li, X. Wen, H. Mao, and X. Wen, “An improved multidimensional reconciliation algorithm for continuous-variable quantum key distribu- tion,” Quantum Information Processing, vol. 18, no. 1, p. 25, 2019. [36] H. Mao, Q. Li, Q. Han, and H. Guo, “High-throughput and low-cost ldpc reconciliation for quantum key distribution,” Quantum Information Processing, vol. 18, no. 7, p. 232, 2019. [37] Q. Li, B.-Z. Yan, H.-K. Mao, X.-F. Xue, Q. Han, and H. Guo, “High- speed and adaptive fpga-based privacy amplification in quantum key distribution,” IEEE Access, vol. 7, pp. 21 482–21 490, 2019. [38] D. Gottesman, H.-K. Lo, N. Lutkenhaus, and J. Preskill, “Security of quantum key distribution with imperfect devices,” in Information Theory, 2004. ISIT 2004. Proceedings. International Symposium on. IEEE, 2004, p. 136. [39] Q. Li, Q. Zhao, D. Le, and X. Niu, “Study on the security of the authentication scheme with key recycling in qkd,” Quantum Information Processing, vol. 15, no. 9, pp. 3815–3831, 2016. http://dx.doi.org/10.1088/978-1-6817-4653-1 8 [40] A. Leverrier, “Composable security proof for continuous-variable quan- tum key distribution with coherent states,” Physical review letters, vol. 114, no. 7, p. 070501, 2015. [41] M. Curty, F. Xu, W. Cui, C. C. W. Lim, K. Tamaki, and H.-K. Lo, “Finite-key analysis for measurement-device-independent quantum key distribution,” Nature communications, vol. 5, p. 3732, 2014. [42] X. Ma, B. Qi, Y. Zhao, and H.-K. Lo, “Practical decoy state for quantum key distribution,” Physical Review A, vol. 72, no. 1, p. 012326, 2005. [43] X. Ma, C.-H. F. Fung, and M. Razavi, “Statistical fluctuation analysis for measurement-device-independent quantum key distribution,” Physical Review A, vol. 86, no. 5, p. 052305, 2012. [44] A. V. Goldberg, É. Tardos, and R. E. Tarjan, “Network flow algorithms,” PRINCETON UNIV NJ DEPT OF COMPUTER SCIENCE, Tech. Rep., 1989. [45] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to algorithms. MIT press, 2009. [46] A. V. Goldberg and R. E. Tarjan, “A new approach to the maximum- flow problem,” Journal of the ACM (JACM), vol. 35, no. 4, pp. 921–940, 1988. [47] N. Brownlee, C. Mills, and G. Ruth, “Rfc 2722: Traffic flow measure- ment: Architecture,” IETF, Tech. Rep., 1999. [48] L. R. Ford and D. R. Fulkerson, “Maximal flow through a network,” in Classic papers in combinatorics. Springer, 2009, pp. 243–248. [49] J. Edmonds and R. M. Karp, “Theoretical improvements in algorithmic efficiency for network flow problems,” Journal of the ACM (JACM), vol. 19, no. 2, pp. 248–264, 1972. [50] K. Cai and P. Fan, “Link decomposition of network coding,” in 2006 Asia-Pacific Conference on Communications. IEEE, 2006, pp. 1–5. [51] S. Watanabe, R. Matsumoto, and T. Uyematsu, “Security of quantum key distribution protocol with two-way classical communication assisted by one-time pad encryption,” arXiv preprint quant-ph/0608030, 2006. [52] B. Sklar and F. J. Harris, Digital communications: fundamentals and applications. Prentice-hall Englewood Cliffs, NJ, 1988, vol. 2001. [53] Q. Li, D. Le, X. Wu, X. Niu, and H. Guo, “Efficient bit sifting scheme of post-processing in quantum key distribution,” Quantum Information Processing, vol. 14, no. 10, pp. 3785–3811, 2015. [54] W. Dai, X. Sun, and S. Wandelt, “Finding feasible solutions for multi- commodity flow problems,” in 2016 35th Chinese Control Conference (CCC). IEEE, 2016, pp. 2878–2883. [55] B. Meindl and M. Templ, “Analysis of commercial and free and open source solvers for linear optimization problems,” Eurostat and Statistics Netherlands within the project ESSnet on common tools and harmonised methodology for SDC in the ESS, vol. 20, 2012. [56] G. Optimization, “Inc.,gurobi optimizer reference manual, 2015,” 2014. [57] J. Hecht, “Ultrafast fibre optics set new speed record,” 2011. [58] W. Idler, F. Buchali, L. Schmalen, E. Lach, R.-P. Braun, G. Böcherer, P. Schulte, and F. Steiner, “Field trial of a 1 tb/s super-channel network using probabilistically shaped constellations,” Journal of Lightwave Technology, vol. 35, no. 8, pp. 1399–1406, 2017. [59] J. A. McHugh, Algorithmic graph theory. Prentice Hall Englewood Cliffs, NJ, 1990, vol. 68056. Qiong Li received the B.S., M.S., and Ph.D. degrees in instrument science from the Harbin Institute of Technology, in 1997, 1999, and 2005 respectively. In 2015, she was a Visiting Scholar with the Electri- cal and Computer Engineering Department, Toronto University. Since then, she has been a Professor with the School of Computer Science and Technology, Harbin Institute of Technology. She has authored or co-authored two books, more than 50 articles, and holds more than 20 authorized patents. Moreover, she has received the third prize of army scientific and technical progress award once, and the second prize of ministerial scientific and technical progress award once. Her research interests include post processing of quantum cryptography, quantum communication network, multimedia security, and biometrics. Yaxing Wang received the B.S. degree in computer science and technology from the Southwest Jiaotong University in 2015. She is currently pursuing the Ph.D. degree in cyberspace security with the School of Computer Science and Technology, Harbin In- stitute of Technology, Harbin, China. Her research interests include quantum communication network and quantum cryptography. Haokun Mao received the B.S. and M.S. degrees in computer science and technology from the Harbin Institute of Technology, in 2010 and 2013, respec- tively. He is currently pursuing the Ph.D. degree in cyberspace security with the Harbin Institute of Technology. His research interests include post processing of quantum cryptography and multimedia security. Jiameng Yao received the B.S. degrees in computer science and technology from the Harbin Institute of Technology, in 2017. She is currently pursuing the M.S. degree in cyberspace security with the School of Computer Science and Technology, Harbin In- stitute of Technology, Harbin, China. Her research interests include quantum communication network and quantum cryptography. Qi Han received the B.S. degree in fluid power transmission and control, the M.S. degree in instru- mentation science and technology, and the Ph.D. degree in information security from the Harbin In- stitute of Technology, in 2002, 2004, and 2009, respectively. Since 2004, he has been an Associate Professor with the School of Computer Science and Technology, Harbin Institute of Technology. His research interests include multimedia security and signal processing. I Introduction II Related Works II-A The Construction Modes of QSCN II-B The Application Modes of QSCN II-C The Architecture Models of QSCN II-D The Generic Maximum-Flow Problem III Flow-based Analytical Model III-A Node Attributes III-B Edge Attributes III-C Flow Conditions IV F-QSCN based Topology Evaluation IV-A The Description of Topology Quality IV-B The Calculation of Topology Quality V Experimental Results and Analysis V-A Experiment Design V-B Topology Evaluation VI Conclusions References Biographies Qiong Li Yaxing Wang Haokun Mao Jiameng Yao Qi Han
1cybersec
arXiv
Questions re: syncing iPad2 to MacBook, specifically having to do with Apps and how not to erase them when syncing. I want to sync the iCal entries on my MacBook with my wife's iPad2, but it seems that if I select the Apps option on the iPad2 when I am connecting the devices, the only option I have is to erase all the Apps on the iPad2 and replace them with the Apps on my MacBook. I think this is really kind of weird, and I don't quite understand it... what will happen to all the apps I bought and/or downloaded onto the iPad2 that are not on the MacBook? Will they be gone? Am I missing something here, besides a clue?
0non-cybersec
Reddit
No Miner can connect to RPC Server. <p>I'm new to this BitCoin, as in read about it yesterday started with it today. This technology has intrigued me to the level I cannot explain, its truly genius!</p> <p>Back to my problem, I have a <strong>NVIDIA NVS3100</strong> with approx <strong>48 GFlops speed</strong>. I am using it to mine. I have taken part in different pools, but the problem is that miner is not connecting to the RPC server. This is the error:</p> <pre><code>Could not retrieve work from RPC Server CURL Return Value = 1 </code></pre> <p>I'm using <code>rpcminer-cuda</code> made by <strong>puddinpop</strong> on <strong>Windows 8</strong>.</p> <p>Would I have to make rules in firewall? or something like that?</p>
0non-cybersec
Stackexchange
automated mysql maintaince. <p>Is there a script doing mysql maintenance ?</p> <p>or</p> <p>how can i make it manually, using cron tab ?</p> <p>and</p> <p>what steps should a good mysql maintenance run ?</p> <p>(MyISAM)</p>
0non-cybersec
Stackexchange
&quot;Additional Drivers&quot; program crash help on 12.04?. <p>When I select the "Additional Drivers" program, it searches for available drivers but becomes unresponsive shortly after. I tried closing it, to try again, but now it just blinks 3 times when I select it. Any ideas to work around this? I'm unsure if there's a driver I need. My network connection seems fine, though.</p> <p>Edit: When I use the command <code>jockey-gtk</code>, I get an error message that ends with:</p> <pre><code>Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. </code></pre>
0non-cybersec
Stackexchange
Which cable will work with my headset?. <p>Today my audio/mic splitter cable broke, and I'm looking to buy a new one, however I'm scared I'm going to buy the wrong one. <br></p> <p>The headset description for the cable is the following: <br> <em>3.5mm 4 Pole Audio/Mic</em> <br> <em>3.5 mm Audio Splitter Cable</em> <br></p> <p>The following link is the link to where I purchased the headset (so you can get a better idea on what I'm talking about / specifications): <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16826140142&amp;cm_re=gaming_headset_detachable-_-26-140-142-_-Product" rel="nofollow noreferrer">Gaming Headset</a></p> <p>So I've been searching around, and I found the following item: <a href="http://www.gearbest.com/cables-adapter/pp_160521.html" rel="nofollow noreferrer">Audio Splitter Cable Dual 3.5mm Male to Single Female</a> <br> I'm not sure whether this is the correct cord to buy or not, and I don't want to buy it not knowing 100% if it will work or not.</p> <p>If someone could help me out and tell me if that's the correct cord, and if it's not, help me find the correct one, I would greatly appreciate it!</p> <p>Thanks guys. I hope I wrote my question correct. Have a good night.</p>
0non-cybersec
Stackexchange
TeamCity Nuget install build step not working with multiple sources, one of them TC&#39;s private NuGet feed. <p>I receive the following error in NuGet Install build step when setting sources to TeamCity's NuGet server:</p> <pre><code>Step 1/4: NuGet install (NuGet Installer) (3s) [15:11:19][Step 1/4] scan: Searching for nuget.config files [15:11:19][Step 1/4] install: Installing NuGet packages for packages.config (3s) [15:11:19][install] NuGet command: C:\TeamCity\buildAgent\tools\NuGet.CommandLine.2.2.0.nupkg\tools\NuGet.exe install C:\TeamCity\buildAgent\work\a4b9de5be22a981\packages.config -OutputDirectory C:\TeamCity\buildAgent\work\a4b9de5be22a981\packages -Source http://localhost:9090/guestAuth/app/nuget/v1/FeedService.svc [15:11:19][install] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script96367186180319830.cmd [15:11:19][install] in directory: C:\TeamCity\buildAgent\work\a4b9de5be22a981 [15:11:22][install] The remote server returned an error: (404) Not Found. [15:11:22][install] Process exited with code 1 [15:11:22][Step 1/4] Step NuGet install (NuGet Installer) failed </code></pre> <p>If I leave sources field blank, it will find the NuGet packages from the default feed (NuGet community feed) but not the ones that are built and packaged locally and hosted within TC's NuGet feed.</p> <p>How do you use both the default feed and the internal TC's NuGet feed within the NuGet installer build step?</p>
0non-cybersec
Stackexchange
How do I get Ubuntu Budgie using the terminal?. <p>I would like to upgrade my Ubuntu installation to Budgie from the OS presently on my computer (Ubuntu 17.04). How do I get the upgrade using the command line? I tried <code>sudo apt-get ubuntu</code>, but received an error message stating that "ubuntu" is an unrecognized (invalid) command. What is the correct syntax for upgrade requests using the terminal?</p>
0non-cybersec
Stackexchange
Stack of blueberry pancakes layered with candied bacon [1080 × 1349].
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
QVariant to QObject*. <p>I'm trying to attach a pointer to an <code>QListWidgetItem</code>, to be used in the slot <code>itemActivated</code>.</p> <p>The pointer I'm trying to attach is a <code>QObject*</code> descendant, so, my code is something like this:</p> <pre><code>Image * im = new Image(); // here I add data to my Image object // now I create my item QListWidgetItem * lst1 = new QListWidgetItem(*icon, serie-&gt;getSeriesInstanceUID(), m_iconView); // then I set my instance to a QVariant QVariant v(QMetaType::QObjectStar, &amp;im) // now I "attach" the variant to the item. lst1-&gt;setData(Qt::UserRole, v); //After this, I connect the SIGNAL and SLOT ... </code></pre> <p>Now my problem, the <code>itemActivated</code> slot. Here I need to extract my <code>Image*</code> from the variant, and I don't know how to.</p> <p>I tried this, but I get the error:</p> <blockquote> <p>‘qt_metatype_id’ is not a member of ‘QMetaTypeId’</p> </blockquote> <pre><code>void MainWindow::itemActivated( QListWidgetItem * item ) { Image * im = item-&gt;data(Qt::UserRole).value&lt;Image *&gt;(); qDebug( im-&gt;getImage().toAscii() ); } </code></pre> <p>Any hint?</p> <pre><code>Image * im = item-&gt;data(Qt::UserRole).value&lt;Image *&gt;(); </code></pre>
0non-cybersec
Stackexchange
Beat down block.
0non-cybersec
Reddit
University of Georgia's atheist club holds "Stone a Heathen Day”.
0non-cybersec
Reddit
How to use Oaxaca cheese?. I unexpectedly acquired a whole blob...block of fresh "oaxaca" cheese. Any ideas on something easy I can do with it? What's it used for?
0non-cybersec
Reddit
PsBattle: Red Cross officer in Thailand dressed up for Halloween.
0non-cybersec
Reddit
Our Idiot Brother impressions/mini-review.
0non-cybersec
Reddit
Guy jumps off a cliff....
0non-cybersec
Reddit
Are there any security implications in creating an SSH key for the root user?. <p>I've written an install script on a server to quickly set up new sites in the /srv directory. It needs to do a <code>git clone</code>, and has to be run via <code>sudo</code> in order to have the permissions to do all the things it needs to do (create directories in /srv, create a new VirtualHost, restart Apache, etc).</p> <p>The question I have is simply this: at the moment the root user has no SSH key, but I'll need one in order to <code>git clone</code> from BitBucket. Are there any security issues with generating one? That is, if I run <code>ssh-keygen</code> as root so I have public and private keys for the root user, will I be making the server less secure in any way?</p> <hr> <p>Incidentally, this is a script that is already in use and has been working fine, but until now the repo I'm cloning from has been a local one, hosted on the same server. I've recently switched to hosting it remotely (on BitBucket), so I need a "deployment key" in order to git clone it.</p>
0non-cybersec
Stackexchange
Minecraft with my GF episode 5.
0non-cybersec
Reddit
Come play some tracks in the HHH plug.dj room. https://plug.dj/rhhh It's lonely in here.
0non-cybersec
Reddit
C++ preprocessor token pasting for namespace qualification. <p>I am having trouble with the preprocessor token pasting operator in gcc 4.7.1 (std=c++11). Namely, consider the following code:</p> <pre><code>// Create a name for a global map (this works) #define GLOBAL_MAP(name) g_map_ ## name // This works fine // Now, namespace qualify this map (this fails to compile when used) #define NS_QUAL_GLOBAL_MAP(name) SomeNamespace:: ## GLOBAL_MAP(name) </code></pre> <p>Usage scenarios - first the map definitions:</p> <pre><code>std::map&lt;std::string,std::string&gt; GLOBAL_MAP(my_map); namespace SomeNamespace { std::map&lt;std::string,std::string&gt; GLOBAL_MAP(my_map); } </code></pre> <p>Now the usage:</p> <pre><code>void foo() { bar(GLOBAL_MAP(my_map)); // This compiles fine baz(NS_QUAL_GLOBAL_MAP(my_map)); // This fails to compile with: // error: pasting "::" and "NAME_MAP" does not give a // valid preprocessing token } </code></pre> <p>What I believe might be happening is that it is interpreting <code>GLOBAL_MAP</code> after <code>##</code> as a token for pasting rather than a macro to be further expanded. How do I get around this?</p>
0non-cybersec
Stackexchange
Plot dash chart side by side. <p>i have 2 charts and i want it to display side by side . Barchart and piechart side by side and probably the same barchart below these 2 charts.i have tried a lot and i would really appreciate some help.</p> <p>this is the below code </p> <pre><code>import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from dash.dependencies import Output, Input, State import numpy as np import pandas as pd import plotly.figure_factory as ff from pandas import read_excel import plotly.io as pio # external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] # app = dash.Dash(__name__, external_stylesheets=external_stylesheets) # app = dash.Dash() external_stylesheets = ['https://codepen.io/amyoshino/pen/jzXypZ.css'] app = dash.Dash(__name__,external_stylesheets=external_stylesheets) # app = dash.Dash() file_name = 'samplePop1.csv' df = pd.read_csv(file_name) print(df.head()) colors = {     'BLACK' : '#000000',     'TEXT' :  '#696969',     'PLOT_COLOR' : '#C0C0C0',     'WHITE' : '#FFFFFF',     'GOLD' : '#EEBC35' ,     'BROWN' : '#53354D' ,     'GREEN' : '#42CE90' ,     'RED' : '#F87861' ,     'YELLOW' : '#F1F145' ,     'SKY_BLUE' : '#A3DBE1' ,     'SILVER': '#CCCCCC' ,     'LIGHT_BLACK' : '#374649'      } #status options for dropdown status_options = [] for status in df['Status'].unique():     status_options.append({'label':str(status),'value':status}) # print(status_options) #Pie chart static function def pop_pie():     pie_data = df.groupby('Status')['Population Census 1991'].count()     pie_dataframe = pie_data.to_frame().reset_index()     # print(pie_dataframe)     # print(df['Status'].unique())     # print(pie_data.tolist())     # print(type(pie_data.tolist()))     # print(pie_data['Status'].tolist())     # print(pie_data['Population Census 1991'].tolist())     trace1 = go.Pie(                 labels = pie_dataframe['Status'].tolist(),                 values= pie_dataframe['Population Census 1991'].tolist(),                 textinfo='label+percent',                 name='population 1991 status wise',pull=[0,0,0,0,0,0,0,0,0]                 )     data = [trace1]     layout = go.Layout(             title='piechart',             )     fig = go.Figure(data=data)     return fig ''' #Barchart static function def pop_bar():     trace1 =go.Bar(y=df['Population Census 1991'],                          x=df['Name'],name ='1991',                         marker = {'color' : colors['GREEN']}                         # orientation='h'                         )     trace2 =go.Bar(y=df['Population Census 2001'],                          x=df['Name'],name ='2001',                         marker = {'color' : colors['RED']}                         # orientation='h'                         )     trace3 = go.Bar(y=df['Population Census 2011'],                          x=df['Name'],name ='2011',                         marker = {'color' : colors['YELLOW']}                         # orientation='h'                         )     data = [trace1, trace2, trace3]     #layout = go.Layout(barmode='group', xaxis={'categoryorder':'array', 'categoryarray':df['District']})     # layout = go.Layout(barmode='group', xaxis={'categoryorder':'total descending'})     layout = go.Layout(     title='Population Census',     paper_bgcolor=colors['LIGHT_BLACK'],     plot_bgcolor=colors['LIGHT_BLACK'],     font ={'color' : colors['WHITE']},     xaxis_tickfont_size=14,     yaxis=dict(showgrid=False,         title='Population',         titlefont_size=16,         tickfont_size=14,     ),     legend=dict(         x=0,         y=1.0,         bgcolor='rgba(255, 255, 255, 0)',         bordercolor='rgba(255, 255, 255, 0)',         orientation="h"         ),     barmode='group',     bargap=0.15, # gap between bars of adjacent location coordinates.     bargroupgap=0.1, # gap between bars of the same location coordinate.     xaxis={'categoryorder':'total descending'})     fig = go.Figure(data=data, layout=layout)     return fig ''' app.layout = html.Div(children=[     html.Div(             [         html.H1("Test Dashboard",         style = {                      'textAlign' : 'center',             'color' : colors['SILVER']         }         ),         html.Div('Developed by Centroxy Solution pvt.ltd',                 style = {             'textAlign' : 'right',             'color' : colors['SILVER']         }         ),         html.Img(         src="https://i.imgur.com/CIxE22f.png",         className='three columns',         style={             'height': '9%',             'width': '9%',             'float': 'right',             'position': 'relative',             'margin-top': '-91px',         }),             html.Br(),             html.Br()             ],style={'backgroundColor': colors['LIGHT_BLACK']}             ),         html.Div(              dcc.Dropdown(id='status_picker',options=status_options,                           placeholder="Select Status",                                style = {'color' : colors['LIGHT_BLACK']},                                multi=True,                                clearable=True,                                searchable=True                             )                             #,style={"background-color": colors['LIGHT_BLACK']}                             ,style={'backgroundColor': colors['LIGHT_BLACK']}         ),           html.Div([             dcc.Graph(id='Bar-Chart')         ]),              html.Div([             dcc.Graph(id='pie-chart', figure=pop_pie())         ]),             ]) @app.callback(Output('Bar-Chart','figure'),             [Input('status_picker','value')]) def update_figure(selected_status):     print(selected_status)     if selected_status == [] or selected_status == None:         trace1 =go.Bar(y=df['Population Census 1991'],                              x=df['Name'],name ='1991',                             marker = {'color' : colors['GREEN']}                             # orientation='h'                             )         trace2 =go.Bar(y=df['Population Census 2001'],                              x=df['Name'],name ='2001',                             marker = {'color' : colors['RED']}                             # orientation='h'                             )         trace3 = go.Bar(y=df['Population Census 2011'],                              x=df['Name'],name ='2011',                             marker = {'color' : colors['YELLOW']}                             # orientation='h'                             )     else:         filtered_df = df[df['Status'].isin(selected_status)]         print(filtered_df)         trace1=go.Bar(y=filtered_df['Population Census 1991'],                              x=filtered_df['Name'],name ='1991',                             marker = {'color' : colors['GREEN']}                             # orientation='h'                             )         trace2=go.Bar(y=filtered_df['Population Census 2001'],                              x=filtered_df['Name'],name ='2001',                             marker = {'color' : colors['RED']}                             # orientation='h'                             )         trace3=go.Bar(y=filtered_df['Population Census 2011'],                              x=filtered_df['Name'],name ='2011',                             marker = {'color' : colors['YELLOW']}                             # orientation='h'                             )     traces= [trace1,trace2,trace3]     '''     for status in filtered_df['Status'].unique():         df_by_status = filtered_df[filtered_df['Status'] == selected_status]         traces.append(             go.Bar(y=df_by_status['Population Census 1991'],                          x=df_by_status['Name'],name ='1991',                         marker = {'color' : colors['GREEN']}                         # orientation='h'                         ))         traces.append(             go.Bar(y=df_by_status['Population Census 2001'],                          x=df_by_status['Name'],name ='2001',                         marker = {'color' : colors['RED']}                         # orientation='h'                         ))         traces.append(go.Bar(y=df_by_status['Population Census 2011'],                          x=df_by_status['Name'],name ='2011',                         marker = {'color' : colors['YELLOW']}                         # orientation='h'                         ))'''     return {         'data' : traces,         'layout' : go.Layout(             title='Population Census',             paper_bgcolor=colors['LIGHT_BLACK'],             plot_bgcolor=colors['LIGHT_BLACK'],             font ={'color' : colors['WHITE']},             xaxis_tickfont_size=14,             yaxis=dict(showgrid=False,                 title='Population',                 titlefont_size=16,                 tickfont_size=14,             ),             legend=dict(                 x=0,                 y=1.0,                 bgcolor='rgba(255, 255, 255, 0)',                 bordercolor='rgba(255, 255, 255, 0)',                 orientation="h"                 ),             barmode='group',             bargap=0.15, # gap between bars of adjacent location coordinates.             bargroupgap=0.1, # gap between bars of the same location coordinate.             xaxis={'categoryorder':'total descending'})             } if __name__ == '__main__':     app.run_server(port =  '8080' , debug ='True') </code></pre> <p>Also the background colour is not completely the one i specified , please help Attaching an image below <a href="https://i.stack.imgur.com/KiZpq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KiZpq.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
Oh well....
0non-cybersec
Reddit
SV: 100 pounds down, [42/F/5'6"/258-154] with progress pics.. So I decided a while back that i would post my progress pics when i hit 100 pounds down since it also matched perfectly with me hitting normal BMI for the first time in over 30 years! I've been overweight since I was a child and my father put me on my first diet when I was around 7 or 8 and many more were to follow until I turned obese at 14 and just got bigger and bigger ever since. I've always hated being so big, but I had no idea of what to do to fix it. All my diets growing up had been failures and my father eventually gave up. My biggest wish all my life was to lose the weight, but I did nothing to help, I continued to eat, I got depressed and I stopped going out. My BMI was 42, same as my age. In october last year I broke a rib. It made it really difficult to wipe my butt cause of the pain, but a thought occured, if you keep this eating up soon you wont be able to wipe your butt even without a broken rib. I knew I had to do something, but what? I literally had no idea about what to do to lose weight. So I started reading up, and being a redditor i found loseit and after reading i realised it's actually simple math. All my life weightloss had seemed like this impossibly hard thing and now I was told it was all about math. Well, I decided to give myself a year of counting calories before considering surgery. I now have one month left of that year and I've lost 104 pounds and 14 pounds from my goal. Being female and not very tall i started eating 1400 calories a day and the pounds flew off, after about two months I got impatient and lowered it to 1200 and they flew off even faster. I'm still at 1200 calories and even though the pounds aren't flying off just as fast anymore they're still going a a decent pace. I have not cheated, but I count my calories weekly and at the beginning of the week i "collect" 100 caloriest from each day, these 700 calories i can use whenever I want that week for eating out or maybe some wine or some extra snacks. This means I feel like I'm cheating when I'm not and I can indulge some days, but work it back on other days without making it too hard for myself. I have become more active as the weight has decreased but I haven't been excercising, it's just so much easier and more fun to be active without carrying all the extra weight around. I walk a lot more than before simply because I'm out and active instead of sitting inside, but I haven't excercised as a mean to lose weight, only counting and logging my calories. I will start at a gym next month when i have money, I wan't to build muscle now I'm getting closer to my goal, and then I will be removing the excess skin on my stomach. I have lots, but I really didn't expect anything else at my age. Luckily I live in a country where I will get the surgery for free if it's bad enough, and in my case it really is. [Here's my album for pictures!](http://imgur.com/a/56XKc) I didn't take a full body before picture before I started which is sad, but 2 months in and allready 20 pounds down I took my before pictures. Since all the pictures I have from before are of my face only it wasn't that hard to find a before picture for the face-progress pic. I feel like my life has changed with the weight loss and I know not everyone feels this way after weight loss, but I have never felt better or been happier in my life. Apologizing for any spelling errors and bad wording, not my first language.
0non-cybersec
Reddit
MyBatis: Getting affected rows number using java interface mapper. <p>Reading MyBatis tutorial I understood that using session in order to execute query is old practice and it's much better to use java interface mapper. I mean that is a good practice :</p> <pre><code>mapper=session.getMapper(mapperClass); mapper.updateFoo(boo); </code></pre> <p>I started using interface mappers and now I need to get the number of affected rows. All examples I've found are with <code>int number=session.update()</code></p> <p>My question how to get number of affected rows using mapper?</p>
0non-cybersec
Stackexchange
Seeking advice on paying off debt if unemployed, broke, and being sued. Well, let me explain my situation here. I'm 22 years old. I went to college for 1 year after high school, and then I made the mistake of "staying home a semester." Yeah, and here I am now, still not back in college. I do plan on taking more college courses in the future, but I hope to first get myself more financially stable. For awhile I ran a local pool hall in the town I live in. Sadly, we slowly started to get less business and our overhead became more than what we could support, so we had to close the business. We (my cousin and myself, co-owners) left behind some debt as well. I'm currently unemployed, but will soon be getting a job with PAM Transport as a truck driver. I know it's not very good money by any means, but it's still a job that gives me a paycheck, and plus it gets me out of my norm and out to see some of the world. Now on to the debt... * I have a college loan (Stafford) of $2,803.07 with a 5.6% interest, payed in monthly installments of $50, $150 of which is currently due. * I have a credit card that has been so severely overdue, it'd been turned over to prosecuting attorneys. They sent me a letter stating I owe $820.38, and if I don't pay the lump sum within 30 days, they will take action. * I have personal property tax for the business of $82,41. * There's state taxes (business) that's currently $353.87. It's overdue to the point that they currently have a tax lien on the personal and real property of the business. * AT&T bill of $328.00 is due, and has been turned over to a debt collector. * An electric bill of about $600 last time I looked at it. Needless to say it's been shut off for awhile now. * Also, when we started the business, we took out a loan from the bank to help with starting capital. Current monthly payments are at $350/month. Now, I do realize this isn't *serious* debt like I see others on this subreddit are, but then again I'm just looking for general advice here. I know that once I get this job, I just need to start making payments on everything. But is there any certain order these bills need to be paid in? Does it even matter? Also, even though I'm being sued for the outstanding bill, I have no non-exempt property for them to take. I have no house, land, vehicle, or basically anything. What else could they do? I have also been looking at YNAB and mint.com for money tracking and budgeting options to help give me a little more solidarity here. If you need any more info, just ask. This is my first time posting in this subreddit, and first time also asking for advice about any of this stuff, so I'm not really sure what all is needed to give someone enough to advise me with. Also, my current credit score is 611. What would be the best way to raise this score back up? **TL;DR** I'm in some debt, currently unemployed, being sued. Halp?
0non-cybersec
Reddit
What is up with the various “pills?”. By this I mean the [blue pill](https://www.reddit.com/r/TheBluePill/), [red pill](https://www.reddit.com/r/theredpillright/), [pink pill](https://www.reddit.com/r/PinkpillFeminism/), etc. I know they’re political and that they’re references to The Matrix, but I have no idea what any of them mean or why they all seem to hate each other.
0non-cybersec
Reddit
Error message &quot;console.error in react-test-renderer&quot; (although test still passes). <p>This is my root component:</p> <pre><code>const App = () =&gt; ( &lt;Provider store={store}&gt; &lt;PersistGate persistor={persistor} loading={&lt;LoadingView /&gt;}&gt; &lt;MainTabNavigator /&gt; &lt;/PersistGate&gt; &lt;/Provider&gt; ) export default App </code></pre> <p>And a pretty simple snapshot test for it:</p> <pre><code>describe('Testing root App component', () =&gt; { test('Renders as expected', () =&gt; { const tree = renderer.create(&lt;App /&gt;).toJSON() expect(tree).toMatchSnapshot() }) }) </code></pre> <p>When I run the test, it passes but I get this error message under it:</p> <pre><code>PASS __tests__/App.test.tsx ● Console console.error node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5190 The above error occurred in the &lt;TabView&gt; component: in TabView (created by withCachedChildNavigation(TabView)) in withCachedChildNavigation(TabView) in Unknown (created by Navigator) in Navigator (created by NavigationContainer) in NavigationContainer (created by App) in PersistGate (created by App) in Provider (created by App) in App Consider adding an error boundary to your tree to customize error handling behavior. Visit (url) to learn more about error boundaries. </code></pre> <p>Because the test passes, does this even matter? What's going on?</p>
0non-cybersec
Stackexchange
Do you know the brand or model of this safe [this is the only photo, no other info].
0non-cybersec
Reddit
Reading all process memory to find address of a string variable c#. <p>I have 2 programs written in c#, first one called "ScanMe" contains a string variable that contains value "FINDMEEEEEEE", and a double variable that has the value of 1546.22915487. And the other program called "MemoryScan" reads all the memory of the first program. I want to get the memory address of the string variable of that process</p> <p>When i execute "MemoryScan" and reads all the memory of "ScanMe" process, then i try to find the byte array of the string in all the data scanned and i get nothing. If i try to find the double i get the specific memory address and also i can change its value, but when i try to do that with the string variable i cant cause i dont even get the address of that string variable.</p> <p>ScanMe and MemoryScan Code:</p> <pre><code>class Program { public static string FindMeString = "FINDMEEEEEEE"; public static double FindMeDouble = 1546.22915487; static void Main(string[] args) { while (FindMeDouble == 1546.22915487) { System.Threading.Thread.Sleep(2000); } Console.WriteLine(FindMeDouble.ToString()); Console.ReadLine(); } } using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace MemoryScan { class MemoryController { // REQUIRED CONSTS const int PROCESS_QUERY_INFORMATION = 0x0400; const int MEM_COMMIT = 0x00001000; const int PAGE_READWRITE = 0x04; const int PROCESS_WM_READ = 0x0010; readonly Dictionary&lt;IntPtr, byte[]&gt; Regions = new Dictionary&lt;IntPtr, byte[]&gt;(); readonly List&lt;SearchResult&gt; _results = new List&lt;SearchResult&gt;(); // REQUIRED METHODS [DllImport("kernel32.dll")] public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId); [DllImport("kernel32.dll")] public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint dwSize, ref int lpNumberOfBytesRead); [DllImport("kernel32.dll")] static extern void GetSystemInfo(out SystemInfo lpSystemInfo); [DllImport("kernel32.dll", SetLastError = true)] static extern int VirtualQueryEx(IntPtr hProcess, IntPtr lpAddress, out MEMORY_BASIC_INFORMATION lpBuffer, int dwLength); public enum ProcessorArchitecture { X86 = 0, X64 = 9, Arm = -1, Itanium = 6, Unknown = 0xFFFF } // REQUIRED STRUCTS [StructLayout(LayoutKind.Sequential)] public struct SystemInfo { public ProcessorArchitecture ProcessorArchitecture; public uint PageSize; public IntPtr MinimumApplicationAddress; public IntPtr MaximumApplicationAddress; public IntPtr ActiveProcessorMask; public uint NumberOfProcessors; public uint ProcessorType; public uint AllocationGranularity; public ushort ProcessorLevel; public ushort ProcessorRevision; } [StructLayout(LayoutKind.Sequential)] public struct MEMORY_BASIC_INFORMATION { public IntPtr BaseAddress; public IntPtr AllocationBase; public uint AllocationProtect; public IntPtr RegionSize; public uint State; public uint Protect; public uint Type; } public void FindProcessMemory(int processId) { // getting minimum &amp; maximum address SystemInfo sys_info; GetSystemInfo(out sys_info); uint max_Address = (uint)sys_info.MaximumApplicationAddress; // opening the process with desired access level IntPtr processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_WM_READ, false, processId); IntPtr current = IntPtr.Zero; int bytesRead = 0; // number of bytes read with ReadProcessMemory int dwLength = Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION)); while ((uint)current &lt; max_Address &amp;&amp; VirtualQueryEx(processHandle, current, out MEMORY_BASIC_INFORMATION mem_basic_info, dwLength) != 0) { // if this memory chunk is accessible if (mem_basic_info.Protect == PAGE_READWRITE &amp;&amp; mem_basic_info.State == MEM_COMMIT) { byte[] buffer = new byte[(int)mem_basic_info.RegionSize]; // read everything in the buffer above if (ReadProcessMemory(processHandle, mem_basic_info.BaseAddress, buffer, (uint)mem_basic_info.RegionSize, ref bytesRead)) { Regions.Add(mem_basic_info.BaseAddress, buffer); } else Console.WriteLine($"Error code: Marshal.GetLastWin32Error()"); } // move to the next memory chunk current = IntPtr.Add(mem_basic_info.BaseAddress, mem_basic_info.RegionSize.ToInt32()); } byte[] data = System.Text.Encoding.Unicode.GetBytes("FINDMEEEEEEE"); foreach (IntPtr address in Regions.Keys) { foreach (int i in ByteSearch.AllIndexOf(Regions[address], data)) _results.Add(new SearchResult(IntPtr.Add(address, i), data)); } Console.ReadLine(); } } public static class ByteSearch { static int[] createTable(byte[] pattern) { int[] table = new int[256]; for (int i = 0; i &lt; table.Length; i++) table[i] = pattern.Length; for (int i = 0; i &lt; pattern.Length - 1; i++) table[Convert.ToInt32(pattern[i])] = pattern.Length - i - 1; return table; } public static bool matchAtOffset(byte[] toSearch, byte[] pattern, int index) { if (index + pattern.Length &gt; toSearch.Length) return false; for (int i = 0; i &lt; pattern.Length; i++) { if (toSearch[i + index] != pattern[i]) return false; } return true; } public static bool Contains(byte[] toSearch, byte[] pattern) { return FirstIndexOf(toSearch, pattern) != -1; } public static int FirstIndexOf(byte[] toSearch, byte[] pattern) { int[] table = createTable(pattern); int position = pattern.Length - 1; while (position &lt; toSearch.Length) { int i; for (i = 0; i &lt; pattern.Length; i++) { if (pattern[pattern.Length - 1 - i] != toSearch[position - i]) break; if (i == pattern.Length - 1) return position - i; } position += table[Convert.ToInt32(toSearch[position - i])]; } return -1; } public static int LastIndexOf(byte[] toSearch, byte[] pattern) { int ret = -1; int[] table = createTable(pattern); int position = pattern.Length - 1; while (position &lt; toSearch.Length) { int i; bool found = false; for (i = 0; i &lt; pattern.Length; i++) { if (pattern[pattern.Length - 1 - i] != toSearch[position - i]) break; if (i == pattern.Length - 1) { ret = position - i; found = true; } } if (found) position++; else position += table[Convert.ToInt32(toSearch[position - i])]; } return ret; } public static int[] AllIndexOf(byte[] toSearch, byte[] pattern) { List&lt;int&gt; indices = new List&lt;int&gt;(); int[] table = createTable(pattern); int position = pattern.Length - 1; while (position &lt; toSearch.Length) { int i; bool found = false; for (i = 0; i &lt; pattern.Length; i++) { if (pattern[pattern.Length - 1 - i] != toSearch[position - i]) break; if (i == pattern.Length - 1) { indices.Add(position - i); found = true; } } if (found) position++; else position += table[Convert.ToInt32(toSearch[position - i])]; } return indices.ToArray(); } } public class SearchResult { public SearchResult(IntPtr add, byte[] value) { Address = add; Buffer = value; } public IntPtr Address { get; set; } public byte[] Buffer { get; set; } } </code></pre> <p>}</p> <p>Why i cant find the string and when i try to find the double i find it with no problem and even also i can change its value with the extern writeprocessmemory? Thanks.</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
This dog loves the giant slide.
0non-cybersec
Reddit
The ESA (European Space Agency) has slapped Creative Commons licences on its pictures and videos, adopting an open access policy for its trove of media footage!.
0non-cybersec
Reddit
Let $K \subset F$ fields. Proof that $F^n$ and $F \,\otimes K^n$ are isomorphic as $F-$vector spaces. <p>Let $F$ and $K$ be fields such that $K \subset F$. We can consider the tensor product $F\, \otimes \, K^n$ as $F-$vector space with the operation: </p> <p>$$ \lambda (a \otimes v) = (\alpha a \otimes v), \, \forall a \in F, \, \forall a\otimes v \in F\,\otimes \, K^n. $$</p> <p>How one can show that $F^n$ and $F \,\otimes K^n$ are isomorphic as $F-$vector spaces?</p> <p>I've tried the canonic way $\lambda \otimes (x_1,...,x_n) \in F \, \otimes \, K^n \mapsto (\lambda x_1,...,\lambda x_n) \in F^n$. However, I couldn't proof that this transform is isomorphism.</p> <p>Help?</p>
0non-cybersec
Stackexchange
TIL the "cheerleader effect", the theory that girls look more attractive in groups, is scientifically proven.
0non-cybersec
Reddit
Paul Rustchynsky - Design Director on DRIVECLUB: Driveclub is free of Microtranscations! (Twitter).
0non-cybersec
Reddit
Are We Living in a Simulation? – 8-Bit Philosophy.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
How to get rid of widow in List of theorems. <p>In my PhD thesis I have 31 definitions in my List of Definitions. The last definition does not fit on the page, and becomes a widow on the next page.</p> <p>How can I get one or more definitions to be moved to the next page as well?</p> <p>In the following MWE Bernard's suggestion <code>\enlargethispage*{\baselineskip}</code> works, placed after <code>\listoftheorems</code>. However, in my thesis the widow remains on the next page. </p> <pre><code>\documentclass[10pt,twoside,openright]{book} \usepackage{geometry} \geometry{ vmarginratio=7:5, hmarginratio=1:1, papersize={170mm,240mm}, total={130mm,190mm} } % twee packages voor betere fonts \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern,textcomp} % package voor de laatste versie van het standaard lettertype \renewcommand{\familydefault}{\sfdefault} \usepackage{amsmath,amsthm,thmtools,thm-restate} \newtheoremstyle{mydef} {\topsep}{\topsep}% {\itshape}{}% {\bfseries}{} {\newline} {% \rule{\textwidth}{0.4pt}\\*% \thmname{#1}~\thmnumber{#2}\thmnote{\ -\ #3}\\*[-1.5ex]% \rule{\textwidth}{0.4pt}}% \theoremstyle{mydef} \newtheorem{definition}{Definition}[chapter] \declaretheorem[name=Definition,numberwithin=chapter]{thm} \renewcommand\listtheoremname{List of Definitions} % \usepackage[defaultlines=3,all]{nowidow} \begin{document} \frontmatter \listoftheorems[ignoreall,show={thm}] \enlargethispage*{\baselineskip} \mainmatter \chapter{Some definitions} \begin{restatable}[One]{thm}{one} This is a definition. \end{restatable} \begin{restatable}[Two]{thm}{two} This is a definition. \end{restatable} \begin{restatable}[Three]{thm}{three} This is a definition. \end{restatable} \chapter{Some more definitions} \begin{restatable}[Four]{thm}{four} This is a definition. \end{restatable} \begin{restatable}[Five]{thm}{five} This is a definition. \end{restatable} \begin{restatable}[Six]{thm}{six} This is a definition. \end{restatable} \begin{restatable}[Seven]{thm}{seven} This is a definition. \end{restatable} \begin{restatable}[Eight]{thm}{eight} This is a definition. \end{restatable} \begin{restatable}[Nine]{thm}{nine} This is a definition. \end{restatable} \begin{restatable}[Ten]{thm}{ten} This is a definition. \end{restatable} \begin{restatable}[Eleven]{thm}{eleven} This is a definition. \end{restatable} \begin{restatable}[Twelve]{thm}{twelve} This is a definition. \end{restatable} \begin{restatable}[Thirteen]{thm}{thirteen} This is a definition. \end{restatable} \begin{restatable}[Fourteen]{thm}{fourteen} This is a definition. \end{restatable} \begin{restatable}[Fifteen]{thm}{fifteen} This is a definition. \end{restatable} \begin{restatable}[Sixteen]{thm}{sixteen} This is a definition. \end{restatable} \chapter{And more definitions} \begin{restatable}[Seventeen]{thm}{seventeen} This is two. \end{restatable} \begin{restatable}[Eighteen]{thm}{eighteen} This is a definition. \end{restatable} \begin{restatable}[Nineteen]{thm}{nineteen} This is a definition. \end{restatable} \begin{restatable}[Twenty]{thm}{twenty} This is a definition. \end{restatable} \begin{restatable}[Twenty-one]{thm}{twentyone} This is a definition. \end{restatable} \begin{restatable}[Twenty-two]{thm}{twentytwo} This is a definition. \end{restatable} \begin{restatable}[Twenty-three]{thm}{twentythree} This is a definition. \end{restatable} \chapter{Even more definitions} \begin{restatable}[Twenty-four]{thm}{twentyfour} This is a definition. \end{restatable} \begin{restatable}[Twenty-five]{thm}{twentyfive} This is a definition. \end{restatable} \begin{restatable}[Twenty-six]{thm}{twentysix} This is a definition. \end{restatable} \begin{restatable}[Twenty-seven]{thm}{twentyseven} This is a definition. \end{restatable} \begin{restatable}[Twenty-eight]{thm}{twentyeight} This is a definition. \end{restatable} \begin{restatable}[Twenty-nine]{thm}{twentynine} This is a definition. \end{restatable} \begin{restatable}[Thirty]{thm}{thirty} This is a definition. \end{restatable} \begin{restatable}[Thirty-one]{thm}{thirtyone} This is a definition. \end{restatable} \end{document} </code></pre> <p><a href="https://i.stack.imgur.com/5AkaF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5AkaF.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
Lateral surface area of a frustum of a cone. <p>A cone is divided into two parts: upper part is a small cone and the lower part is a frustum. Given: Radius of frustum( R) =10, radius of upper cone( r)= 5, slant height of frustum (S)= 12, Slant height of whole cone= 20, slant height of upper cone (s)= 8 I tried to find the lateral surface area of a frustum of a cone. First I used: phi X (R+r) X s. Then I used another method: lateral surface area if big cone minus that of small cone. But the results are different. The first is 3.14 x (10+5) x 12= 565.2. The second is (3.14 x 10 x 20) - (3.14 x 5 x 8)=502.4 Please help!</p>
0non-cybersec
Stackexchange
Feds raid downtown Oakland pot university.
0non-cybersec
Reddit
General form for mapping one disk onto another?. <p>Say I have two disks $A$ and $B$, with two points $a\in A$ and $b\in B$. Is there a way to explicitly construct a linear fractional transformation from $A$ onto $B$ that sends $a$ to $b$?</p> <p>I know a linear fractional transformation is determined by its image on 3 distinct points, and that they sends circles and lines to circles and lines. Would it then be enough to map $a\mapsto b$, and then choose two boundary points on $A$ to map to two arbitrary boundary points on $B$, or does more care need to be taken? My worry is that the boundary points may map onto a circle which isn't the boundary of $B$.</p>
0non-cybersec
Stackexchange
how to use different version of firefox using webdriver?. <p>how to set Firefox version in web-driver? I just want to user different version of Firefox.</p> <p>like different version 19, 20 , 21....</p> <p>please provide a generic solution which help for other browser also.</p>
0non-cybersec
Stackexchange
College Students will understand.
0non-cybersec
Reddit
Cat leaves inky paw prints on a 15th century manuscript.
0non-cybersec
Reddit
How to fix graphical glitch in Chromium?. <p>I am using Chromium 45 on Ubuntu 15.04 on a Thinkpad X230. Each time I am opening a new tab, I am presented with the following graphical glitch:</p> <p><a href="https://i.stack.imgur.com/IAxFc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IAxFc.png" alt="enter image description here"></a></p> <p>Has someone experienced this irritating glitch and knows how to remove it?</p>
0non-cybersec
Stackexchange
When does the browser execute Javascript? How does the execution cursor move?. <p>I was wondering if there are any available resources that describe how a browser's cursor executes Javascript.</p> <p>I know it loads and executes tags when a page loads, and that you can attach functions to various window events, but where things get fuzzy is when, for instance, I retrieve a remote page via AJAX and put its contents into a div.</p> <p>If that remote page has got to load script libraries such as <code>&lt;script src="anotherscript.js" /&gt;</code>, when is "anotherscript.js" being loaded and its contents are being executed?</p> <p>What happens if I included "anotherscript.js" on my current page, and then I load some remote content which has a duplicate include of this script? Does it overwrite the original one? What if the original "anotherscript.js" has a var in it whose value I altered, and then I reload that file... do I lose the original value or is the second inclusion of this script ignored?</p> <p>If I load some procedural Javascript via AJAX, when is it executed? Immediately after I do <code>mydiv.innerHTML(remoteContent)</code>? Or is it executed before that?</p>
0non-cybersec
Stackexchange
Ant target calling. <p>I would like to call target backup.yes only if the condition is true.</p> <pre><code>&lt;condition property="directory.found.yes"&gt; &lt;equals arg1="${directory.found}" arg2="true"/&gt; &lt;/condition&gt; &lt;antcall target="update.backup"/&gt; </code></pre> <p>Is there any way to do this.</p>
0non-cybersec
Stackexchange
Southeast Asia Travel Tips.
0non-cybersec
Reddit
Keeping tables / figures (floats) on either the current even (left) or odd (right) page. <p>I'm writing a two sided <code>LaTeX</code> document and would like tables / figures (floats) to be depicted</p> <p>) in the best case, immediately after the end of the sentence in which the float is referred to with <code>\ref{...}</code> for the first time and</p> <p>) in the worst case, still on either the current even (left) or odd (right) page.</p> <p>To elaborate, </p> <p>) if the float is referred to on the even (left) page number <code>x</code>, the float is to be depicted on that even (left) page with number <code>x</code> or on the odd (right) page with number <code>x+1</code> and </p> <p>) if the float is referred to on the odd (right) page number <code>x+1</code>, the float is to be depicted on that odd (right) page with number <code>x+1</code> or on the even (left) page with number <code>x</code>.</p> <p>How do I achieve this? Is there perhaps a way to put <code>\FloatBarrier</code>s just before the next even (left) page?</p> <p>Minimum working example:</p> <pre><code>\documentclass{book} \usepackage{lipsum} \usepackage{showframe} \usepackage{tikz} \begin{document} \lipsum[1-6] Figure~\ref{float1}. \lipsum[1] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 1.} \label{float1} \end{figure} Figure~\ref{float2}. \lipsum[2] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 2.} \label{float2} \end{figure} Figure~\ref{float3}. \lipsum[3] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 3.} \label{float3} \end{figure} Figure~\ref{float4}. \lipsum[4] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 4.} \label{float4} \end{figure} Figure~\ref{float5}. \lipsum[5] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 5.} \label{float5} \end{figure} Figure~\ref{float6}. \lipsum[6] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 6.} \label{float6} \end{figure} \end{document} </code></pre> <p>Here, float 6 is referred to on the odd (right) page 3 but placed on the even (left) page 4. It should be restricted to being placed no later than the odd-even page set 2-3.</p>
0non-cybersec
Stackexchange
Shovelling some snow.
0non-cybersec
Reddit
Modifying viridis colormap (replacing some colors) in matplotlib. <p>I've searched around and found things that came close to working but nothing exactly suiting what I need.</p> <p>Basically, I really like the viridis colormap as a starting point. However, I would like to replace the purple at the lowest end of the map with white. </p> <p>I tried using <code>set_under()</code> but that doesn't suite my needs. I need to simply replace purple with white. </p> <p>For example, I tried the following (from here <a href="https://stackoverflow.com/questions/14777066/matplotlib-discrete-colorbar">Matplotlib discrete colorbar</a>) -</p> <pre><code>cmap = plt.get_cmap('jet') cmaplist = [cmap(i) for i in range(cmap.N)] cmaplist[0] = (1.0,1.0,1.0,1.0) cmap = cmap.from_list('Custom cmap', cmaplist, cmap.N) </code></pre> <p>Which works perfectly and does exactly what I need with 'jet' but when I replace 'jet' with 'viridis' I get the following error</p> <pre><code>AttributeError: 'ListedColormap' object has no attribute 'from_list' </code></pre> <p>How can I get around this and simply do what I want?</p> <p>Any assistance at all would be greatly appreciated.</p> <p>Thank you!</p>
0non-cybersec
Stackexchange
MRW someone on reddit says that making gifs from movies is the same as pirating..
0non-cybersec
Reddit