There is a simple class:  namespace ConsoleApp5 {     class Program     {         static void Main(string[] args)         {             Test test = null;             int? t;             t = test?.i;  // in this place the overloaded method "operator! =" is NOT called             if (test != null) // in this place the overloaded method "operator! =" is called             {                 t = test.i;             }         }     }     public class Test     {         public int i = 5;         public override bool Equals(object obj)         {             return true;         }         public static bool operator ==(Test test1, Test test2)         {             return true;         }         public static bool operator !=(Test test1, Test test2)         {             return true;         }     } }   In this line:  if (test != null)   called  public static bool operator !=(Test test1, Test test2)   but in this line:  t = test?.i;   none of the overloaded methods are called  How to overload operator "?."
Is it possible to overload the null-coalescing operator for a class in C#?    Say for example I want to return a default value if an instance is null and return the instance if it's not. The code would look like something like this:     return instance ?? new MyClass("Default");     But what if I would like to use the null-coalescing operator to also check if the MyClass.MyValue is set?
I've got a simple Leaflet map with a basemap and one map-layer coming from my own hosted GeoServer.  I made the layers show up nicely in a map.  Now I want to add popups on the point layer showing information stored in MapService.  I couldn't find too much information about that topic.   There's one link to a working example but the link seems to be broken. I found another example which I addopted. You can see it on . I'd like to display the content of the name field in the attribute table but nothing happens when the user clicks the map.  Any idea? How to reference generic classes and methods in xml documentation I read through all the related answers, but they do not apply to Ubuntu 14.04.  I have no .gnome2 folder and no Passwords and Encryption keys item in the system settings. I tried to crawl through every possible menu, but I could not find out how to do it.  The popup usually pops out when I start Chromium. Find the limit of $\lim\limits_{(x,y)\to (0,0)} \frac{x^2y^2}{x^2y^2+(x-y)^2}$ Ubuntu 16.04 sftp and vscode ssh not working Let $S$ and $W$ be subsets of a vector space $V$. Show that if $S$ is a subset of $W$, then $\mathrm{span}(S)$ is a subspace of $\mathrm{span}(W)$ Let $S$ and $W$ be subsets of a vector space $V$. Show that if $S$ is a subset of $W$, then $\mathrm{span}(S)$ is a subspace of $\mathrm{span}(W)$.  Ok I'm finally understanding what each of these things mean.. but I'm running out of ideas on how to actually show it without using arbitrary vector space examples like Rn. Since sets and subspaces are kind of new its hard to figure out how to write correct proofs with them.   I can see how if $V = \mathbb{R}^3$ and $S = \{(1,1,1)\}$ and $W = \{(1,1,1), (1,1,2)\}$ then $\mathrm{span}(S) = R1(line), span(W) = R2(plane)$ and that R1 is a subspace of R2... im just having trouble showing this officially when all vector spaces and sets are completely in general....  I could get as far as writing out $S=(u_1,u_2,\dots,u_n)$, $u_i \in V$ and same with $W$, but I can't really figure out what else to do in this sort of proof. Basically I have a setup like the following:  Array (  [0] =&gt; Array ( [0] =&gt; stdClass Object ( [nid] =&gt; 1 [title] =&gt; title1 [uid] =&gt; 1 [parent] =&gt; 0 [weight] =&gt; -15 [name] =&gt; name1 [value] =&gt; 0 )                [1] =&gt; stdClass Object ( [nid] =&gt; 2 [title] =&gt; title2 [uid] =&gt; 1 [parent] =&gt; 0 [weight] =&gt; -7 [name] =&gt; name2 [value] =&gt; 100 )                [2] =&gt; stdClass Object ( [nid] =&gt; 3 [title] =&gt; title3 [uid] =&gt; 2 [parent] =&gt; 0 [weight] =&gt; -1 [name] =&gt; name3 [value] =&gt; 0 )                [3] =&gt; stdClass Object ( [nid] =&gt; 4 [title] =&gt; title4 [uid] =&gt; 2 [parent] =&gt; 0 [weight] =&gt; 1 [name] =&gt; name4 [value] =&gt; 80 )               )   )   What I need is a way to sort all the arrays inside the parent array by the [value] key in the Object. I've been trying for about 2 days now with usort and different methods but I just can't seem to get my head around it. The [value] key will range anywhere from 0 to 100 and I need all of the arrays sorted in decreasing order (IE: 100 down to 0). Java inner class and static nested class I've got a bunch of files named with a the pattern 99 - DescriptiveName.txt and I'd like to remove the number from the front so I just have DescriptiveName.txt.  How can I do this? Can I do it from the command line or is there a utility that can do this? Proof that there are infinitely many prime numbers starting with a given digit string To prove the following fact: given any sequence of digits in any base, eg 314159265358979323 base 10, there are infinitely many primes that start with these digits,eg when expressed in decimal they start with 314159265358979323. I think using a prime number theorem will be helpful . But I am still not getting a point of how to start the proof. Break a long command to multiple lines I got a shell script and inside I got the command as below #!/bin/sh sh ../jboss/bin/standalone.sh --server-config=standalone-full.xml -Djboss.node.name=node1 -b 0.0.0.0 -bmanagement 0.0.0.0  How can I break the line to multiple lines for better understanding and management #!/bin/sh sh ../jboss/bin/standalone.sh    --server-config=standalone-full.xml   -Djboss.node.name=node1   -b 0.0.0.0   -bmanagement 0.0.0.0  Tried with backslash at the end of each line and it doesnt work. I'm working with Beamer and I would like to create boxes with round corners. I use \ovalbox, but I would like to control the thickness of the line. How can I do this? I also tried \thinlines, but I still not understand the sintax since I didn't find a minimal example. How is money held in escrow for a home purchase from a IRA treated by the IRS? To my amazement I just discovered that the C99 stdint.h is missing from MS Visual Studio 2003 upwards.  I'm sure they have their reasons, but does anyone know where I can download a copy?  Without this header I have no definitions for useful types such as uint32_t, etc. Why can't Python's raw string literals end with a single backslash? How do I get label of the selected item from a lightning:select drop down list? I would like to get the value of the label of the selected drop down item.  In this case, the label is the Name of the Contact.  &lt;aura:component&gt;  &lt;aura:attribute name="contacts" type="Contact[]"/&gt;  &lt;lightning:select label="Contact" aura:id="contactList" name="contactList"&gt;     &lt;aura:iteration items="{!v.contacts}" var="c" indexVar="index"&gt;        &lt;option value="{!c.Id}"&gt;{!c.Name}&lt;/option&gt;    &lt;/aura:iteration&gt;  &lt;/lightning:select&gt;  &lt;/aura:component&gt;   I know how to get the value:  component.find("contactList").get("v.value");   But how do I get the label? Understanding 74LVC245 datasheet and current source/sink I'm using a SN74LVC245A () to shift 5V TTL down to 3.3V so I can read the signals with a Raspberry Pi.  However I am getting really weird results (a 60Hz input signal is picked up by the Pi at anything between 110Hz and 320Hz) and I'm really confused about how to read the datasheet to figure out whether I need pullup or pulldown resistors.  The datasheet says on page 4 the "high-level output current" is -24mA, and the "low-level output current" is 24mA.  So to me this means that when the device is outputting a high signal, it is able to sink 24mA of current (since outputting a negative amount of current suggests the current is going into the device instead.)  But then if you're outputting a positive voltage, isn't that sourcing current?  Why is the figure listed as a negative value?  Is anyone able to explain what these figures actually mean?  When I disconnect the 74LVC245 output from my GPIO pin, I still get weird signals from the floating input pin so I am assuming this means the 74LVC245 output is also floating in one state, but I don't know in which state it is (i.e. is it left floating on a high output signal or a low one?)  It doesn't really make sense to be floating on a high output signal since it's a level converter and the whole point is to maintain the correct 'high' voltage, so do I need pulldown resistors to handle the low output?  If so, why does the datasheet seem to suggest the chip can both source and sink current?  (In my mind, source current means the device can output a current with a positive voltage, while sinking current means the device takes in anything and connects it to GND, so perhaps that is where I am going wrong.)  Anyway I'm quite confused so any clarification would be much appreciated! I want to create a circuit that can detect audio frequencies and flash RGB LEDs different colors depending on the detected frequency. The frequency range will be from 20 Hz to 12 kHz, after looking at the chart below.   (source: )    So my question is: what circuit design should I choose to make a good frequency detector? I suppose I would need    Preamp for the microphone (is it necessary for the ADC?) Band pass filters (active or passive?) A microcontroller with an onboard ADC that has a sampling rate of at least 24 kHz.   Before I get too excited, are there any circuits out there that already do this? How is light emitted by an incandescent lamp How to check if a number is a power of 2 Today I needed a simple algorithm for checking if a number is a power of 2.  The algorithm needs to be:   Simple Correct for any ulong value.   I came up with this simple algorithm:  private bool IsPowerOfTwo(ulong number) {     if (number == 0)         return false;      for (ulong power = 1; power &gt; 0; power = power &lt;&lt; 1)     {         // This for loop used shifting for powers of 2, meaning         // that the value will become 0 after the last shift         // (from binary 1000...0000 to 0000...0000) then, the 'for'         // loop will break out.          if (power == number)             return true;         if (power &gt; number)             return false;     }     return false; }   But then I thought, how about checking if log2 x is an exactly round number? But when I checked for 2^63+1, Math.Log returned exactly 63 because of rounding. So I checked if 2 to the power 63 is equal to the original number - and it is, because the calculation is done in doubles and not in exact numbers:  private bool IsPowerOfTwo_2(ulong number) {     double log = Math.Log(number, 2);     double pow = Math.Pow(2, Math.Round(log));     return pow == number; }   This returned true for the given wrong value: 9223372036854775809.  Is there a better algorithm?