I have to following classes:  public class NominalValue {    public int Id {get; set;}    public string ElementName {get; set;}    public decimal From {get; set;}      public decimal To {get; set;}        public bool Enable {get; set;}       public DateTime CreationDate {get; set;}    public int StandardValueId {get; set;}  //FK for StandardValue }  public class StandardValue {    public int Id {get; set;}    public string ElementName {get; set;}    public decimal From {get; set;}      public decimal To {get; set;}        public bool Enable {get; set;}       public DateTime CreationDate {get; set;} }    User wants to fill nominalValue object properties. filling the nominalValue properties can performed in 2 way:   User fill values for nominalValue manually. User Load values for nominalValue from a standardValue object and then change some values or not.   sometimes I need to know if some property of nominalValue objects for a specified Element are equal to corresponding standardValue or not?  I don't want to load standardValue from Db for checking this equality, so I decided to define a HashValue property in NominalValue class:  public class NominalValue {    public int Id {get; set;}    public string ElementName {get; set;}    public decimal From {get; set;}  //&lt;-- 1st parameter for generating hash value    public decimal To {get; set;}    //&lt;-- 2nd parameter for generating hash value    public bool Enable {get; set;}   //&lt;-- 3rd parameter for generating hash value     public DateTime CreationDate {get; set;}    public int StandardValueId {get; set;}      public string HashValue {get;set;}      //&lt;-- this property added }    when user fill nominalValue properties using standardValue properties, I calculate its value based on 3 properties(From, To, Enable) and save it with other properties, and when I check if that nominalValue fill with standardValue or not, I calculate hash code for From, To, Enable and compare the result with HashValue (instead loading standardValue from Db).  Is there any mechanism to calculate a unique hash code based on 3 property values(From, To, Enable)?
In .NET, the  is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality.  Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes so I don't degrade performance?
How is evolution possible in contemporary humans? I would like to know if evolution is continuing to happen in modern humans, assuming things like existence of the nuclear family structure, fidelity to one partner, etc. It seems to me the answer would be NO because evolution depends on differential reproductive rates, but in the modern world, all male humans have roughly 2.5 (or whatever the number) kids. Add in the process of culturally modified selection pressure, and it seems to me that even an "unfit" male would end up having a couple of offspring. The fittest male (or female) is no better off than his or her contemporaries because of this "leveling" effect.   However, the impression I get from the popular science media is that scientists think evolution is continuing to happen. I would like to know what the actual scientific consensus is, and why. Thanks. Create buffer in meters? I'm very new to the GIS world, so my problem could be very stupid, but I'm going to try anyway.  Objective  Given a list of coordinates in longitude/latitude, stored as a .csv file, I want to create a buffer with distance of x km around those coordinates. (In case this is relevant, these coordinates are locations of the societies in the . These societies scatter all around the world.)  Problem  I'm only able to create buffers with distance in radial degrees, but I want to do them in (kilo)meters. I'm aware of the following Q&amp;A's, but following what's suggested therein doesn't seem to solve my problem:          What I have tried...   I start QGIS (v2.4), and Add delimited text layer  choose my .csv file and the x/y fields, click OK select WGS 84 as my CRS (also tried NAD83 but didn't make a difference), click OK right-click on layer and select Save As..., in the dialog box, choose the following and click OK:  add sccs_meter.shp as layer to the current project Select Vector > Geoprocessing Tools > Buffers > set buffer distance as 10   The result is a buffer with radius of approximately 1068km, which suggests that buffer distance is 10 degrees rather than 10 meters.  What did I do wrong here? I have a bash script which must call another bash script which varies per-user in order to get some configuration information, like so:  somescript:  #!/bin/bash ${HOME}/.ssconfig echo "Hello, ${VARIABLE}!"   ~/.ssconfig  #!/bin/bash VARIABLE=world   Which, instead of giving me Hello, world! as expected, gives me Hello, ! How can I pass variables up from a script to the one that called it? Updating a field programmatically, hook_node_update Currently trying to update a field every time a node is created or updated. However the value is not being populated within the node, do I have access to the node object with this particular hook? What could I be missing?    function vbtoken_node_update($node) {         entity_get_controller('node')-&gt;resetCache(array($node-&gt;nid));         $types = node_type_get_types(); //What are the current Node Content Types?       $yes = ($types['volunteer_project']-&gt;type);        if($node-&gt;type === $yes){           $hash = md5($node-&gt;title . $node-&gt;nid . $node-&gt;nid);         $hashed = substr($hash, 0, 6);         $node = node_load($node-&gt;nid);         $node-&gt;tcode[$node-&gt;language][0]['value'] = $hashed;         node_save($node);          watchdog('vbtoken', 'Added a new Token code to %nid', array('%nid' =&gt; $node-&gt;nid));          }         else          {           dpm('not working dude');         }      } Express symmetric polynomial $\prod_{i < j} (X_i+X_j)$ in terms of elementary symmetric functions Exercise: Define a polynomial $\Sigma(X_1,\ldots,X_n)$ as \begin{align*} \Sigma(X_1,\ldots,X_n) = \prod_{i &lt; j} (X_i+X_j) \end{align*} This is a symmetric polynomial, quite clearly. I want to express $\Sigma$ as a polynomial in the elementary symmetric functions, for $n=2,3,4$. Case $n=2$ is trivial: $\Sigma(X_1,X_2)= \sigma_1 = X_1+X_2$. Case $n=3$ is easy. I write $\Sigma$ as follows: \begin{align*} \Sigma(X_1,X_2,X_3) = (\sigma_1 - X_1)(\sigma_1 - X_2)(\sigma_1 - X_3), \end{align*} then apply  formally, obtaining \begin{align*} \Sigma(X_1,X_2,X_3) = \sigma_1^3 - \sigma_1 \sigma_1^2 + \sigma_2 \sigma_1 - \sigma_3 = \sigma_2 \sigma_1 - \sigma_3. \end{align*} The case $n=4$ seems harder to me, and I'm unable to work it out. I hope there is some trick to avoid unnecessary computations. My attempt is to write down $\Sigma$ completely: \begin{align*} \Sigma = (X_1+X_2)(X_3+X_4)(X_1+X_4)(X_2+X_3)(X_2+X_4)(X_1+X_3) \end{align*} and then multiply factors in groups of two, obtaining: \begin{align*} \Sigma = (\sigma_2 - X_1X_2-X_3X_4)(\sigma_2 - X_1X_4 - X_2X_3)(\sigma_2 - X_2X_4-X_1X_3), \end{align*} but it doesn't seem to help much. How can I solve the exercise? How to set English as default language instead of Tamil? The default language used in our laptop is Tamil. We don't know how to switch back to English. If we type something we are getting something.   We don't know the font name or version. Even the Menu bar and task bar contents are in Tamil. Is there a $(6,9,3)_2$ code? Does there exist a $1$-error-correcting binary code with block length $6$ and $9$ codewords?   The Hamming bound says that for any code $C$ with those parameters, $|C| \le \frac{2^6}{1+6} \approx 9.14$. So, we can't rule out the existence of such a code using the Hamming bound. The Singleton bound says that for any code $C$ with those parameters, $|C| \le 2^{6-3+1} = 16$, so we can't rule out the existence of such a code using the Singleton bound. Also, this can't be a linear code, since $\log_2 9$ isn't an integer. That rules out the possibility of just enumerating the possible generator matrices.   I feel a bit silly asking this, but the direct approach (assume $000\ 000$ is in the code, then all others must have Hamming weight $\ge 3$, ...) becomes unmanageable quickly. How else can I go about this? Will grammar errors become correct after enough people use them for enough time? First let me state the obvious—based on my own experience—that hordes of people are confused about certain basic grammar principles. For example, I so often see mistakes in choosing the pronoun to use with direct objects, especially when introduced by and with another person, as in "Joe talked about the book with Anna and [I/me]." Another one is the near 100% usage of "lay" instead of "lie" (and "laid" instead of "lay") nowadays, even in published sci-fi books that most certainly had professional editors proofread them.  Do you see these kinds of changes as predictors of the future? Will they become correct after enough people have used them long enough?  Both of these problems drive me bonkers, and I fight my own little battle against them when possible.  I know that dictionaries are descriptive rather than prescriptive. They're technically history books. But grammar and style books seem less so, to me. Those seem as though they ought to be prescriptive in order to reduce the erosion of structured and meaningful language.  In this tension between "what people are doing" and "what people should be doing," are we doomed to forever bear these errors just because too many people don't know the proper way? Is it worth fighting against them? Do I capitulate to the people who are quick to accept any mass public usage as a fait accompli?  Update  I don't imagine for a second that my own writing is error free. The difference with me is that when I do learn I have something wrong in my mind, I immediately change once I clearly understand it.  I also am not imagining that language is static or ignorant that today's correctness is all too often yesterday's error. The whole point of my question here, then, is: is there value in slowing the change, and if so, how is that done and how effectively?  Another way to look at what I'm trying to ask is that in a way I am hoping to define the limits of pedantry. If being pedantic is slavish adherence to outdated rules in the face of actual and foregone changed reality, then when do we conclude that a change is a foregone conclusion?  Poking fun at my own errors to highlight supposed pedantry on my part is to miss everything I am trying to say.    Update 2  It may not be an easy question, but since language change actually does or does not happen, and every person acts with more or less intention in regards to language change, there must be an answer. What I wanted to explore is the value in efforts to teach the "proper way" vs. the opposite end of the spectrum where any new usage is not just accepted but welcome or even sought out. You know, I'm reminded of something: the conservative/liberal scale:     |------+------+------+------+------+------| radical              moderate             radical liberal                                 conservative   The funny thing about those at the ends of the spectrum is that they both want things to change. The radical liberal wants language to change to something new quickly, just for the sake of newness or evolution or some other not-necessarily-realistic ideal. Similarly, the radical conservative wants things to change just as much, but back to the way it used to be, just for the sake of sameness or continuity or some other just-as-not-necessarily-realistic ideal.  I'm not particularly asking where we should be on this scale as that's purely subjective. I'm trying to ask about something purely practical and real-world: what is actually effective? Is language change inevitable, and how fast? Are efforts to reduce its rapid morphing either effective or worthwhile in any measure? All these things considered, what position with respect to language evolution is livable, practical, and sensible?  Feel free to edit my grammar. No comment necessary.  Update 3  Something that may be of interest to both my supporters and detractors: . I enjoyed it. I don't disagree with him, but I am not sure I am wholehearted in this lack of disagreement. Here are some options I thought of, not sure which is the right one.   There was an I/O error reading from the pipe. The process writing to the other end of the pipe died with a failure. All processes who could write to the pipe have closed it. The write buffer of the pipe is full. The peer has closed the other direction of the duplex pipe. Writing failed because there are no processes which could read from the pipe. A system call returned the EPIPE error, and there was no error handler installed. Is there an efficient way to copy text from a PDF without the line breaks? How to calculate overlap between empirical probability densities? I'm looking for a method to calculate the area of overlap between two kernel density estimates in R, as a measure of similarity between two samples. To clarify, in the following example, I would need to quantify the area of the purplish overlapping region:  library(ggplot2) set.seed(1234) d &lt;- data.frame(variable=c(rep("a", 50), rep("b", 30)), value=c(rnorm(50), runif(30, 0, 3))) ggplot(d, aes(value, fill=variable)) + geom_density(alpha=.4, color=NA)     A similar question was discussed , the difference being that I need to do this for arbitrary empirical data rather than predefined normal distributions. The overlap package addresses this question, but apparently only for timestamp data, which doesn't work for me. The Bray-Curtis index (as implemented in vegan package's vegdist(method="bray") function) also seems relevant but again for somewhat different data.  I'm interested in both the theoretical approach and the R functions I might employ to implement it. Can I use Class.newInstance() with constructor arguments? I have several std::vector, all of the same length. I want to sort one of these vectors, and apply the same transformation to all of the other vectors.  Is there a neat way of doing this? (preferably using the STL or Boost)?  Some of the vectors hold ints and some of them std::strings.  Pseudo code:  std::vector&lt;int&gt; Index = { 3, 1, 2 }; std::vector&lt;std::string&gt; Values = { "Third", "First", "Second" };  Transformation = sort(Index); Index is now { 1, 2, 3};  ... magic happens as Transformation is applied to Values ... Values are now { "First", "Second", "Third" }; I want to calculate the derivative of $|x|^\alpha$ with respect to $x$, where $1&lt;\alpha&lt;2$.  $\frac{d|x|^\alpha}{dx}=\alpha|x|^{\alpha-1}\mathrm{sign}(x)$  Is it correct?  And is it true that  $\lim_{x \to 0} \alpha|x|^\alpha\mathrm{sign}(x)=0$?  What with the following derivative $|x|^\alpha\rm{sign}(x)$. I would be grateful for any hints. How to avoid pressing Enter with getchar() for reading a single character only? What is the mechanism by which magnetic fields do work? I've seen some conflicted answers to this question in texts and on the web, in the case of a dipole, for example.   Do magnetic fields do work directly, or is it their induced electric fields that do work? What's the fixed size of the suggested edit queue? I am using lightning:recordEditForm and lightning:inputField for creating a new record. this component is being used inside a lightning community builder. When i click the submit button, i am able to create a new record in my custom object. However i need the created record ID as i need to pass it in the URL for the next page. Endnotes do not be superscript and add a space If object A is moving at velocity $v$ (normalized so that $c=1$) relative to a ground observer emits object B at velocity $w$ relative to A, the velocity of B relative to the ground observer is  $$ v \oplus w = \frac{v+w}{1+vw} $$  As expected, $v \oplus 1 = 1$,  as "nothing can go faster than light".  Similarly, $v \oplus -1 = -1$. (same thing in the other direction)  But what if object A is moving at the speed of light and emits object B at the speed of light in the exact opposite direction? In other words, what is the value of $$1 \oplus -1?$$ Putting the values in the formula yields the indeterminate form $\frac{0}{0}$. This invites making sense of things by taking a limit, but $$ \lim_{(v,w)\to (1,-1)} \frac{v+w}{1+vw}$$ is not well-defined, because the limit depends on the path taken.  So what would the ground observer see? Is this even a meaningful question?  Edit: I understand $1 \oplus -1$ doesn't make sense mathematically (thought I made it clear above!), I'm asking what would happen physically. I'm getting the sense that my fears were correct, it's physically a nonsensical situation.