NULL imputation in training and testing data set
Imputation before or after splitting into train and test?
Difference between focusin/focusout and focus/blur, with example Forcing a SimpleXML Object to a string, regardless of context Let's say I have some XML like this  &lt;channel&gt;   &lt;item&gt;     &lt;title&gt;This is title 1&lt;/title&gt;   &lt;/item&gt; &lt;/channel&gt;   The code below does what I want in that it outputs the title as a string  $xml = simplexml_load_string($xmlstring); echo $xml-&gt;channel-&gt;item-&gt;title;   Here's my problem.  The code below doesn't treat the title as a string in that context so I end up with a SimpleXML object in the array instead of a string.  $foo = array( $xml-&gt;channel-&gt;item-&gt;title );   I've been working around it like this  $foo = array( sprintf("%s",$xml-&gt;channel-&gt;item-&gt;title) );   but that seems ugly.  What's the best way to force a SimpleXML object to a string, regardless of context? People seem to believe that one's consciousness is a "different" consciousness than that of others, but the "same" consciousness as the one that has been in one's body in the past and the one that will be in one's body in the future. How likely is this to be true and why?   Also, I have almost no knowledge about neuroscience, so please refrain from using neuroscience jargon if feasible. Since I am a regular Stack Overflow follower, I came across this and was shocked a bit regarding the design and user experience perspective.  Attaching picture 1 - it states that I can click any site and view a synopsis about it. Clear!!!    Attaching Picture 2 - you can see that when I clicked Webmasters, the design wants me to scroll horizontally to view all information and basically it hides information.    It would be nice, if it did something like below : Extracting extension from filename in Python "How big of a problem" vs. "how big a problem" Quite a few phrases in English are constructed like so:     How [adjective] a [noun]...?   This is the question form of the construction, which is often answered with the negative:     Not that [adjective] a [noun].   or the positive:     Quite [adjective] a [noun].   However, from time to time I'll hear the word 'of' inserted before the 'a', e.g.:     Not that [adjective] of a [noun].   This usually sounds wrong to me, with the exception of the case where the adjective 'much' is used.  So, this sounds fine to my ear:     Not that much of a problem.   whereas this doesn't:     Not that loud of a noise.   Why is it that 'much' should be used with 'of', and other adjectives not?  Is it because 'much' is seen as measuring a quantity (of something), whereas other adjectives that may be used in this construction are seen as measuring the quality of a whole thing? Remove blank attributes from an Object in Javascript How do I remove all attributes which are undefined or null in a JavaScript object?  (Question is similar to  for Arrays) Creating queries to select by attribute with arcpy I'm quite new with arcpy and I'm finding selecting by attribute a bit of a nightmare. There's a problem with my query on the script below [query = "\'Location\' = observer"], but I can't tell what it is. 'Location' is a field of the feature class I'm dealing with (fc_copy).  with arcpy.da.UpdateCursor(fc_copy,field_names) as cursor:        for row in cursor:         observer = row[0]         arcpy.MakeFeatureLayer_management(fc_copy, 'fl_copy_OBS')         arcpy.MakeFeatureLayer_management(fc_copy, 'fl_copy_TAR')         query = "\'Location\' = observer"         arcpy.SelectLayerByAttribute_management('fl_copy_OBS', 'NEW_SELECTION', query)         arcpy.SelectLayerByAttribute_management('fl_copy_TAR', 'NEW_SELECTION', query, invert_where_clause = 'INVERT')   This is the error I get => Invalid expression                            Failed to execute (SelectLayerByAttribute).  Is there any documentation to learn the rules to follow to build queries for arcpy? Add table row in jQuery Overdispersion and Underdispersion in Negative Binomial/Poisson Regression I was performing a Poisson regression in SAS and found that the Pearson chi-squared value divided by the degrees of freedom was around 5, indicating significant overdispersion. So, I fit a negative binomial model with proc genmod and found the Pearson chi-squared value divided by the degrees of freedom is 0.80. Is this now considered to be underdispersed? If so, how does one go about handling this? I have read a lot about overdispersion and believe I know how to handle this but information on how to handle or determine if there is underdispersion is scant. Can anyone assist?  Thanks. Feedback Request: New Timeline Question View Why do clocks measure arc-length? Apologies in advance for the long question.  My understanding is that in GR, massive observers move along timelike curves $x^\mu(\lambda)$, and if an observer moves from point $x^\mu(\lambda_a)$ to $x^\mu(\lambda_b)$, then his clock will measure that an amount of time $t_{ba}$ given by the curve's arc length; $$   t_{ba} = \int_{\lambda_a}^{\lambda_b}d\lambda \sqrt{-g_{\mu\nu}(x(\lambda))\dot x^\mu(\lambda)\dot x^\nu(\lambda)} $$ will have elapsed where $g_{\mu\nu}$ is a metric on spacetime with signature $(-,+,+,+)$.    Why is this so?     Here is how I would attempt to justify this fact in special relativity with $g_{\mu\nu} = \eta_{\mu\nu}$.  Consider an inertial observer $O$ in $\mathbb R^{3,1}$, and suppose that this observer sees a clock, which I'll call observer $O'$ moving around on a curve $x^\mu(\lambda)$.  If $O'$ were also an inertial observer, then given any event with coordinates $x^\mu$ as measured by $O$, observer $O'$ would measure the coordinates of the event to be $x'^\mu = \Lambda^\mu_{\phantom\mu\nu} x^\nu + x_0^\mu$ for some Lorentz transformation $\Lambda$.  If $O'$ is not inertial, then this is no longer true, and there is some more complicated family of transformations, say $T_\lambda$ between events as seen by both observers.  I would argue, however, that if we were to partition the interval $[\lambda_a, \lambda_b]$ into a large number $N$ of intervals $I_1=[\lambda_a, \lambda_i], \dots, I_N=[\lambda_{N-1}, \lambda_b]$ with $\lambda_n = \lambda_a+n\epsilon_N$ and $\epsilon_N=(\lambda_b-\lambda_a)/N$, then on each interval $I_n$, $O'$ is approximately an inertial observer in the sense that $$   T_{\lambda_n} = P_n + \mathcal O(\epsilon_N), \qquad (\star) $$ for some Poincare transformation $P_n$.  Then we would note that since $O'$ is stationary in his own reference frame, he measures his worldline to have the property $\dot x'^\mu(\lambda) = (\dot t(\lambda), \mathbf 0)$ so that $$   I_{ba}=\int_{\lambda_a}^{\lambda_b}d\lambda \,\sqrt{-\eta_{\mu\nu}\dot x'^\mu\dot x'^\mu} = \int_{\lambda_a}^{\lambda_b} d\lambda \, \sqrt{\dot t^2} = t(\lambda_b) - t(\lambda_a) = t_{ba} $$ On the other hand the integral on the left can be written as a Riemann sum using the partition above, and we can invoke ($\star$) above to get \begin{align}   I_{ba}  &amp;= \lim_{N\to\infty}\left[\sum_{n=1}^N \epsilon_N\sqrt{-\eta_{\mu\nu}\dot x'^\mu(\lambda_n)\dot x'^\nu(\lambda_n)}\right] \notag\\ &amp;= \lim_{N\to\infty}\left[\sum_{n=1}^N \epsilon_N\sqrt{-\eta_{\mu\nu}\dot x^\mu(\lambda_n)\dot x^\nu(\lambda_n)} + \mathcal{O}(\epsilon_N^2)\right] \notag\\ &amp;= \int_{\lambda_a}^{\lambda_b}d\lambda \,\sqrt{-\eta_{\mu\nu}\dot x^\mu\dot x^\mu} \end{align} Combining these two computations gives the desired result.  How do others feel about this argument?  I'm not completely comfortable with it because of the assumption $(\star)$ I made on $T_\lambda$.  I imagine that in GR a similar argument could be made by invoking local flatness of the metric. I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist? How to apply layer style to one object and apply it to multiple layers How does a graduate program's admissions committee operate? How does a typical graduate program's admissions committee operate? (In the US --- I understand that in Europe admissions are often structured differently.)  My mental model at the moment is several professors sitting in a conference room with a stack of printed applications and a few piles: accept, maybe, and reject. Three or so professors will read an application and then make a decision. If the volume of applications is large enough, multiple meetings might be required. This is purely my imagination --- I don't know how accurate this model is.  Of course, I'm sure that how admissions are handled depends greatly on the school, program, and department. I'm interested in a few data points to get a rough idea of what the average is.  A few more specific related questions:   How much time does a typical committee spend on each application? I suspect there's a distribution. Obviously unqualified applicants will probably have their applications tossed into the reject pile pretty quickly. Qualified applicants' applications might receive more attention. Do admissions committees look online for more information about an applicant? I've read some professors (in CS --- not my field) will look at a student's research/project website, but I have no idea how common this is. Sort a Map by values I am relatively new to Java, and often find that I need to sort a Map&lt;Key, Value&gt; on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way? Necessary condition for square integrable functions? I'm studying Quantum Mechanics and I came across this which I don't quite understand: For a vector space of functions $f(x)$ to be square integrable (i.e $\int{|f(x)|^2dx &lt; \infty)}$, the necessary condition is $\lim_{|x| \to \infty}f(x) \to 0$. Can someone help me understand why that must be the case? I sort of understand that it must not blow up at the infinities but can a (continuous or piece-wise continuous) function have a non-zero finite value at the infinities and still be square integrable? With regard to the theory that each time a wave function collapses the universe  so that each possible outcome really exists - where does all the energy required to create all the new universes come from? Find all $x$ such that $x^6 = (x+1)^6$. Two submit buttons in one form I have two submit buttons in a form. How do I determine which one was hit serverside?