{             &quot;Name&quot;: &quot;John&quot;,             &quot;Email&quot;: &quot;John123@gmail.com&quot;,             &quot;XMLObj&quot;: &quot;&lt;Root&gt;&lt;Organization xml:space=\&quot;preserve\&quot;&gt;&lt;Language&gt;&lt;string&gt;EN&lt;/string&gt;&lt;/Language&gt;&lt;Description&gt;&lt;string /&gt;&lt;/Description&gt;&lt;TypeCode&gt;&lt;string&gt;Type 123&lt;/string&gt;&lt;/TypeCode&gt;&lt;/Organization&gt;&lt;/Root&gt;&quot;  }  I know how to deserialize the JSON into an object. I can even get the XML data into its own field that way, however what I'd like to do is convert the XMLObj into elements upon deserializing that tie to Name and Email fields. I can ignore &lt;Root&gt;&lt;Organization xml:space=\&quot;preserve\&quot;&gt; and the ending &lt;/Organization&gt; and &lt;/Root&gt; tags. And a field is just &quot;&lt;/string&gt;&quot; when it is empty. I need a function parse the XML Object, convert to JSON, and keep it with the corresponding data to that record. So, result would look like this: {    &quot;Name&quot;:&quot;John&quot;,    &quot;Email&quot;:&quot;John123@gmail.com&quot;,    &quot;Language&quot;:&quot;EN&quot;,    &quot;Description&quot;:&quot;&quot;,    &quot;TypeCode&quot;:&quot;123&quot; }  How do I accomplish this?
How do I Deserialize this XML document:  &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Cars&gt;   &lt;Car&gt;     &lt;StockNumber&gt;1020&lt;/StockNumber&gt;     &lt;Make&gt;Nissan&lt;/Make&gt;     &lt;Model&gt;Sentra&lt;/Model&gt;   &lt;/Car&gt;   &lt;Car&gt;     &lt;StockNumber&gt;1010&lt;/StockNumber&gt;     &lt;Make&gt;Toyota&lt;/Make&gt;     &lt;Model&gt;Corolla&lt;/Model&gt;   &lt;/Car&gt;   &lt;Car&gt;     &lt;StockNumber&gt;1111&lt;/StockNumber&gt;     &lt;Make&gt;Honda&lt;/Make&gt;     &lt;Model&gt;Accord&lt;/Model&gt;   &lt;/Car&gt; &lt;/Cars&gt;   I have this:  [Serializable()] public class Car {     [System.Xml.Serialization.XmlElementAttribute("StockNumber")]     public string StockNumber{ get; set; }      [System.Xml.Serialization.XmlElementAttribute("Make")]     public string Make{ get; set; }      [System.Xml.Serialization.XmlElementAttribute("Model")]     public string Model{ get; set; } }   .  [System.Xml.Serialization.XmlRootAttribute("Cars", Namespace = "", IsNullable = false)] public class Cars {     [XmlArrayItem(typeof(Car))]     public Car[] Car { get; set; }  }   .  public class CarSerializer {     public Cars Deserialize()     {         Cars[] cars = null;         string path = HttpContext.Current.ApplicationInstance.Server.MapPath("~/App_Data/") + "cars.xml";          XmlSerializer serializer = new XmlSerializer(typeof(Cars[]));          StreamReader reader = new StreamReader(path);         reader.ReadToEnd();         cars = (Cars[])serializer.Deserialize(reader);         reader.Close();          return cars;     } }   that don't seem to work :-(
I would like to set a maximum execution time for sql queries like set_time_limit() in php. How can I do ? Recently I answered two questions on SO: The  is a completely trivial answer to a really basic question (kind of "read the manual and follow the one liner example there"). On the other hand, my  is a much more complicated answer that requires much more specialized knowledge of a very specific domain (happens to be related to my PhD research).  Clearly, the first answer could have been given by many SO users - I just happened to be the first to pick up the glove on this question. However, this is not the case for the second answer.  In contrast, when it comes to reputation - the first answer instantly got upvoted (everyone can relate to a simple question/answer), while the second one - I don't believe it will get much upvotes...  So, life isn't fair: for the one answer that really very few people could provide (the second answer) and is much harder to find and get -- is not rewarded, while the trivial answer is rewarded fast and strong...  How can we amend this? How can we encourage rare and specialized answers for difficult and deep questions?  Do we want SO to turn into a pool of trivial and superficial questions?    Update: Thanks to many meta-users who took the time to read through this question and ponder its implication, both answers I used as examples got exposed far beyond their fair-share. So, despite the fact that my original claim that the specialized answer get less reps is no longer valid, this does not change fact that in general my claim is stil valid: specialized answers requiring expert knowledge will recieve less attention at first.    Bottom line: (following my wish to have some sort of ). Indeed it sometimes seems like life isn't fair, but this is only in the short term. In the long run high quality answers do get their proper credit and exposure and their fair share of reputation. The reputation system of SO works quite well balancing and accounting for many factors and parameters. It would require a really strong argument backed up with serious research to change this mechanism.   Thank you all for the lively discussion and for showing me that life is fair after all. How do I add newlines between lines printed on the command line? Mail logs are incredibly difficult to read. How could I output a blank line between each line printed on the command line? For example, say I'm grep-ing the log. That way, multiple wrapped lines aren't being confused. Recently, there was some news that said that the researchers at NASA have come across some impossible kind of space engine which does not require any fuel. I have read at a few places like ,  and . They all say that this engine seems to violate the laws of physics including conservation of momentum.  The original paper is .  Is the statement that it violates conservation of momentum true? Precise connection between complexification of $\mathfrak{su}(2)$, $\mathfrak{so}(1,3)$ and $\mathfrak{sl}(2, \mathbb{C})$ Get name of caller function in PHP? How to install multiple versions of the same software? I manage phone systems for multiple clients. Each system uses the same administrator software, but it runs on different versions depending on what version of firmware is installed on the system controller.   The software is downloaded directly from the system controller so it's the right version. For example, if the controller runs on version 5.0.2, you have to run version 5.0.2 of the administrator software. You can't administrate a 5.0.2 controller with a later versions of administrator software.   Bottom line, you have to have the right version of software to log into the controller. The software is not executable on its own, you have to install it. So every time I want to log into a different controller, I have to reinstall the right software.   Any way to get around this?   I'm running Windows 7 Enterprise x86. Can “due to” and “because of ” be used interchangeably? Is it fine to use due to in place of because of ? How about the other way around? Are any of these sentences ungrammatical?   He was lost because of the storm. He was lost due to the storm. He lost his way due to the storm. He  lost his way because of the storm. Too many of your edits were rejected, try again in 7 days First time I've got the following message on SO:     Too many of your edits were rejected,   try again in 7 days.   Although, I have made ~50 accepted edits this day.  I'm sure that should outweigh the ~5 rejected edits, right?    My suggestion:  bool allowEdit(USER u) {     if(u.rejected * 5 &gt; u.accepted)         return(false);     else         return(true); }   Think of it this way: if I do a 1000 accepted edits, and mess up on 5 [rejected], does that mean I should get banned for 7 days?    Hmmm... There seems to be a bug; the message only appears when clicking edit from review.  But otherwise, I can't edit , even when going to it from the homepage. can't login as mysql user root from normal user account in ubuntu 16.04 I just installed Ubuntu 16.04 LTS along with the packages php, mariadb and nginx. I ran mysql_secure_installation and changed the root password.  Now when I try to login to mysql using the root account while logged in Ubuntu as normal user account I get access denied.   When I login using sudo mysql, mysql doesn't even ask me password. If I run mysql_secure_installtion I see that old settings never got set permanently.   What am I doing wrong? Can I visit the US for tourism on a previously unused B1/B2 visa? Note: This is NOT a duplicate of  Difference: In both other questions, the posters traveled once to the US for the original purpose for which the B1 visa was obtained. Their question is about visiting again using the same visa. However, I've not traveled to the US yet, and I'm planning my visit. What I want to understand whether I can use this visa for a visit whose purpose is not the same as what was submitted along with the application.  Can I use a B1/B2 visa for tourism that was originally obtained for business purposes BEFORE I actually visit the US even once? I had applied for a business visitor visa for a valid business reason but by the time I got it stamped, my plan changed. So I've not visited the US even once. Can I now use this visa to visit as a tourist without having used that visa for its original intended purpose? PS: I live in India. Pronoun immediately following its antecedent Is placing a pronoun immediately after its antecedent in a sentence valid grammar?  Is there a term for this construction?  Some examples are:   President Obama, he gave a speech last night. The speech, it was about the financial system.   I hear this on the Planet Money podcast at least once per episode. Most vexing parse Find all integer solutions to $x^2+y^2+z^2=2xyz$ In Hitchcock's Vertigo, there is one part of the film that has never made sense to me and I believe that it was a cheap ploy to mislead the audience until the ultimate reveal (I won't spoil it here).    In this scene Jimmy Stewart watches Kim Novak enter a rooming house and afterwards sees her standing by the window on the 2nd floor.  When he enters the house and talks to the inn-keeper, she tells him that Kim Novaks's character positively never came in and even shows him her room key that is still behind the front desk.  They go up to the room and find it empty.   This scene seems to imply that the Kim Novak character may have had a ghost like quality. But given the reveal at the end she clearly does not and there was no way for her to enter the room without a key and without being seen by the inn-keeper.  If this was done by some other director I probably wouldn't have given this much thought but Hitchcock was a perfectionist (especially for this film) so I never understood the significance of this scene other than to mislead the audience (with a cheap ploy IMO).  Does anyone who is familiar with this film have a different explanation/perspective about this scene in an otherwise brilliant movie. is_active_sidebar() Always Returns False How do I configure internet connection for Terminal on Ubuntu 14.04? I've installed on Ubuntu 14.04 and with I've Broadband connection setup, Browser connection is OK,  but Terminal not connection via internet, when command type "sudo apt-get update" by terminal then showing me Error, see screenshot, How I can fix this ? Why are high white balance temperatures redder when warmer objects are bluer? I know it's dumb to ask this type of questions. But, I still don't get this. I've read the "Black body" story and know that when it's heated, it gives off colors; 'warm' colors (red→orange→yellow..) that have low color temperatures, at low temperatures, (I mean, when it is cooler than afterwards) right? And, the black body gives off 'cold' colors (white→blue..) that have high color temperatures at high temperatures (when it is hotter than before), right? Correct? So there're two, yes, very dumb, questions and the latter one is dumber..     Why are that 'warm' colors said to have low temperatures? And 'cold' colors vice versa? So the redder colors have lower c/t and bluer colors have higher c/t, then   why does the camera's color temperature - adjusting slider has the bluer colors on the left, and the redders on the right?       Please, forgive me for my ignorance... Proof that $\bigcap_{a\in A} \bigg(\, \bigcup_{b\in B} F_{a,b} \, \bigg) = \bigcup_{f\in ^AB} \bigg(\, \bigcap_{a \in A} F_{a,f(a)}\,\bigg) $ general solution sum of two uniform random variables aY+bX=Z? is there a general solution to that? I have seen simple examples for Y+X=Z but I was wondering how this would be with rescaling?