Given a generic class definition BaseClass&lt;T&gt;, is it possible to test this condition?  if (myvar is BaseClass&lt;&gt;)  I would like to know if myvar derives from the generic class, but I do not know (or care) what T might be.  I assume the answer is no... my backup plan is to caveman this via myvar.GetType().ToString().Contains("BaseClass&lt;"), or something.
I have a generic class in my project with derived classes.  public class GenericClass&lt;T&gt; : GenericInterface&lt;T&gt; { }  public class Test : GenericClass&lt;SomeType&gt; { }   Is there any way to find out if a Type object is derived from GenericClass?  t.IsSubclassOf(typeof(GenericClass&lt;&gt;))   does not work.
I setup my Nginx conf as per  , and now http2 is available...  But in Chrome (Version 54.0.2840.98 (64-bit))  Dev tool, it's always on HTTP 1/1 :  NAME             METHOD  STATUS  PROTOCOL shell.js?v=xx..    GET    200     http/1.1   my server is running Ubuntu 16.04 LTS which supports both ALPN &amp; NPN , and the openssl version shipped with it is 1.0.2g  I checked http2 support with and the result is :    Yeah! example.com supports HTTP/2.0. ALPN supported...   Also checking with curl is OK   $ curl -I --http2 https://www.example.com   HTTP/2 200    server: nginx/1.10.0 (Ubuntu)   date: Tue, 13 Dec 2016 15:59:13 GMT   content-type: text/html; charset=utf-8   content-length: 5603   x-powered-by: Express   cache-control: public, max-age=0   etag: W/"15e3-EUyjnNnyevoQO+tRlVVZxg"   vary: Accept-Encoding   strict-transport-security: max-age=63072000; includeSubdomains   x-frame-options: DENY   x-content-type-options: nosniff   I also checked with is-http2 cli from my console  is-http2 www.amazon.com × HTTP/2 not supported by www.amazon.com Supported protocols: http/1.1  is-http2 www.example.com ✓ HTTP/2  supported by www.example.com Supported protocols: h2 http/1.1   tested with openssl from my localhost  $ echo | openssl s_client -alpn h2 -connect www.example.com:443 | grep ALPN  depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3  verify return:1  depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3  verify return:1  depth=0 CN = example.com  verify return:1  ALPN protocol: h2  DONE   why Chrome is left behind it ? How can I check it also with Safari (v 10.0.1) Send urgent mail in Gmail Is it possible to set the "urgent" flag in Gmail for outgoing mail? I'd like to be able to flag time-sensitive emails as such. How to Solve this Arithmetic Progression Question? Please help-  Four different integers form an increasing AP.One of these numbers is equal to the sum of the squares of the other three numbers.Then- find all the four numbers.  I assumed the numbers to be $a,a+d,a+2d,a+3d$ and wlog let $a+3d$ this number and according to question-  $a^2+(a+d)^2+(a+2d)^2=a+3d$  but I could not solve the above equation. Why is it better to use "#!/usr/bin/env NAME" instead of "#!/path/to/NAME" as my shebang? I notice that some scripts which I have acquired from others have the shebang #!/path/to/NAME while others (using the same tool, NAME) have the shebang #!/usr/bin/env NAME.  Both seem to work properly.  In tutorials (on Python, for example), there seems to be a suggestion that the latter shebang is better.  But, I don't quite understand why this is so.  I realize that, in order to use the latter shebang, NAME must be in the PATH whereas the first shebang does not have this restriction.  Also, it appears (to me) that the first would be the better shebang, since it specifies precisely where NAME is located.  So, in this case, if there are multiple versions of NAME (e.g., /usr/bin/NAME, /usr/local/bin/NAME), the first case specifies which to use.  My question is why is the first shebang preferred to the second one? I've made a drush install of drupal 7.28 on my AWS server. I can confirm that the memory is set to 128M, all green on the reports -> site status page. The website will function normally and sporadically return no data, looking at the logs a tremendous amount of memory is trying to be allocated (assuming an infinite loop somewhere). Given that this is a basic install, no modules have yet been added what might be causing this?  PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 140008587493184 bytes) in Unknown on line 0 My overall upgrade went well, but I am left with a critically lingering issue of mysql-server not being able to install itself, and nothing I am trying gets it to work.  This is the error I see when trying to install/reinstall it:  Setting up mysql-server-5.7 (5.7.11-0ubuntu6) ... Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. invoke-rc.d: initscript mysql, action "start" failed. dpkg: error processing package mysql-server-5.7 (--configure):  subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server:  mysql-server depends on mysql-server-5.7; however:   Package mysql-server-5.7 is not configured yet.  dpkg: error processing package mysql-server (--configure):  dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure.                    Processing triggers for systemd (229-4ubuntu4) ... Processing triggers for ureadahead (0.100.0-19) ... Errors were encountered while processing:  mysql-server-5.7  mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)   I've tried completely removing it, though doing so attempts to install MariaDB because of dependencies (?). Any suggestions on what I can do to fix this would be most welcome.  EDIT: Looks like I'm not the only one: I am in the process of completing some homework and have come across a question that says: "What is the steady-state current?" It is asking in reference to a circuit that includes two capacitors in parrallel and a DC source of 24V and an AC source given by $\epsilon = 20 \cos(120 \pi t)\ \text{V}$, where $t$ is in seconds. I assume that it is asking when the current is constant. Because naturally the current is not constant due to the AC source, would I just consider the DC source for this? Populating cascading dropdown lists in JSP/Servlet Divisibility is transitive: $\ a\mid b\mid c\,\Rightarrow\ a\mid c$ As the title says, if a number is divisible by a number, is it always divisible by that number's factors?  An example being that $100$ is divisible by $20$, it is also divisible by $10, 5, 4, 2$ as well?  Does this always apply? Prove equation with binomial coefficient Proof that Epicycloids are Algebraic Curves? Epicycloids are most commonly described by the parametric equations,   $x(t) = (R + a)\cos(t) – a \cos \left(\frac{R + a}{a} t \right),$  $y(t) = (R + a)\sin(t) – a \sin \left(\frac{R + a}{a} t \right).$  Where $R$ is the radius of the fixed circle and $a$ is the radius of the rolling circle.   With $R = ka$ we also have,   $x(t) = a[(k + 1)\cos(t) - \cos((k + 1)t)],$  $y(t) = a[(k + 1)\sin(t) - \sin((k + 1)t)].$  Several books discussing epicycloids mention that if the ratio of the radii of the circles $\left( \frac{R}{a} = k \right)$ is rational, then they are algebraic curves. However, I’ve only been able to find the Cartesian equations for the cardioid, nephroid and ranunculoid. With the cardioid being,   $(ax + x^2 + y^2)^2 = a^2(x^2 + y^2).$   The nephroid,   $(-4a^2 + x^2 + y^2)^3 = 108a^4y^2.$  And the ranunculoid,   $-52521875a^{12} – 1286250a^{10} (x^2 + y^2) – 32025a^8 (x^2 + y^2)^2 + 93312a^7 (x^5 – 10x^3y^2 + 5xy^4) – 812a^6 (x^2 + y^2)^3 – 21a^4 (x^2 + y^2)^4 – 42a^2(x^2 + y^2)^5 + (x^2 + y^2)^6 = 0.$  Clearly this doesn’t cover all epicycloids where $\frac{R}{a}$ is rational.   What is the proof that shows that epicycloids, where the ratio of the radii are rational, are algebraic curves? I have the following data structure (a list of lists)  [  ['4', '21', '1', '14', '2008-10-24 15:42:58'],   ['3', '22', '4', '2somename', '2008-10-24 15:22:03'],   ['5', '21', '3', '19', '2008-10-24 15:45:45'],   ['6', '21', '1', '1somename', '2008-10-24 15:45:49'],   ['7', '22', '3', '2somename', '2008-10-24 15:45:51'] ]   I would like to be able to   Use a function to reorder the list so that I can group by each item in the list. For example I'd like to be able to group by the second column (so that all the 21's are together)  Use a function to only display certain values from each inner list. For example i'd like to reduce this list to only contain the 4th field value of '2somename'    so the list would look like this   [      ['3', '22', '4', '2somename', '2008-10-24 15:22:03'],       ['7', '22', '3', '2somename', '2008-10-24 15:45:51'] ] For an architectural visualization, I would like to use MakeHuman models, but:   Only get them to render white with a black outline (on reflection surface too, if possible). Interact with light like normal human bodies in the scene (cast shadows, etc).   I can do the outline in freestyle, but any in-Cycles solution would be appreciated (OSL?) So light travels slower in glass (for example) than in a vacuum. What causes light to slow down? Or: How does it slow down? If light passes through the medium, is it not essentially traveling in the "vacuum" between the atoms? I've read some great on-topic example questions on Area 51.  My questions:   Should a proposed site's "Great On-Topic Example" questions be automatically included in its beta? Will a proposed site's "Great On-Topic Example" questions be automatically included in its beta? Contour method to show that $\int_0^\infty\frac{x-\sin x}{x^3} \, dx=\frac\pi4$ Show that $$\int_{0}^{\infty} \frac{x - \sin(x)}{x^3} \, dx = \frac{\pi}{4}$$   My attempt is as follows: Let $$f(z) = \frac{z - i e^{iz}}{z^3}$$ and consider the contour on $[\epsilon, R]$ followed by a semicircular arc in the counter clockwise direction, then on $[-R, -\epsilon]$, then the semicircular clockwise contour avoiding the origin. We have, then, that  $$0 = \int_{\Gamma} f(z) dz = \int_{[\epsilon, R]} f(t) dt + \int_{C_R}f(Re^{it})Rie^{it}dt + \int_{[-R, -\epsilon]}f(t)dt + \int_{C_{\epsilon}}f(\epsilon e^{-it})\epsilon i e^{-it} dt$$  Then the first and third integrals ( $I_1$ and $I_3$) combine so that  $$I_1 + I_3 = 2\int_{\epsilon}^R \frac{t - \sin{t}}{t^3}\,dt$$  Further,   $$|I_{C_R}| \leq \int_0^\pi \left|\frac{Re^{it} - ie^{-R\sin{t}}e^{iRcos{t}}}{R^2 e^{2it}} \right|dt \rightarrow 0 \text{ as } R\rightarrow \infty$$  (I've omitted the details, it isn't too bad to bound)  However, I'm having trouble computing the limit  $$\lim_{\epsilon \rightarrow 0}\int_{C_{\epsilon}} f(\epsilon e^{-it})\epsilon i e^{-it} dt$$  No matter which way I look at it, it seems like this limit does not exist. Perhaps I'm seeing something wrong or have I chosen a bad $f(z)$? How to turn particle emission on/off? Is there a way to animate whether or not a particle emitter is emitting particles at a given point in time?  I'm using the particle system to animate bullets, so basically I'm trying to find a way to say: at frame 150 the gun fires a burst until frame 170, at frame 240 it fires a burst until frame 265, and so on.  I've tried key framing the particle render setting between "object" and "none", but the problem with that is that the hidden particles are still there, so when the render setting switches to "object", the particles that were initially hidden suddenly appear.  I've also thought of putting a plane (not rendered) with a collision modifier in front of the emitter and then moving it when I want the emitter to start emitting particles.  Is there a better way? Are getters and setters poor design? Contradictory advice seen I'm currently working on a simple game in Java with several different modes. I've extended a main Game class to put the main logic within the other classes. Despite this, the main game class is still pretty hefty.  After taking a quick look at my code the majority of it was Getters and Setters (60%) compared to the rest that is truly needed for the logic of the game.  A couple of Google searches have claimed that Getters and Setters are evil, whilst others have claimed that they are necessary for good OO practice and great programs.  So what should I do? Which should it be? Should I be changing my Getters and Setters for my private variables, or should I stick with them? Definition of complex number In many situations (problems as well as solutions) I encounter the complex number $i$ which many times is defined as $i^2=-1$ instead of $i=\sqrt{-1}$, since it is "more preferred". Does anyone know why? Is it because there are two solutions to the equation $x^2+a=0, \ \ a&gt;0$? Local BLAST Copy Number per Hit I generated a series of local BLAST databases using makeblastdb of metagenomic data and am searching for the presence of a particular gene. While I can do the normal BLAST analysis looking at e-values, % identity, etc. I haven't been able to figure out how to determine how many times a given sequence exists in the database.  So: given a BLAST database of metagenomic data where a particular gene may exist multiple times, how do I determine the copy number of a given BLAST hit?  Thanks in advance.