I am trying to read an XML file which is generated by Matlab (a XML representation of Simulink Model). For the sake of question I have shortened it.  Below is the XML.   &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ModelInformation Version="1.0"&gt;   &lt;Model Name="MatlabToJenkinsIntegrationSample"&gt;     &lt;P Name="Version"&gt;9.0&lt;/P&gt;     &lt;P Name="SavedCharacterEncoding"&gt;windows-1252&lt;/P&gt;     &lt;GraphicalInterface&gt;       &lt;P Name="NumRootInports"&gt;3&lt;/P&gt;       &lt;Inport Name="Input1"&gt;         &lt;P Name="BusObject"/&gt;         &lt;P Name="OutputFunctionCall"&gt;off&lt;/P&gt;         &lt;P Name="SampleTime"&gt;-1&lt;/P&gt;         &lt;P Name="UnitExpr"&gt;inherit&lt;/P&gt;       &lt;/Inport&gt;       &lt;Inport Name="Input2 "&gt;         &lt;P Name="BusObject"/&gt;         &lt;P Name="OutputFunctionCall"&gt;off&lt;/P&gt;         &lt;P Name="SampleTime"&gt;-1&lt;/P&gt;         &lt;P Name="UnitExpr"&gt;inherit&lt;/P&gt;       &lt;/Inport&gt;       &lt;Inport Name="MultiplicationFactor"&gt;         &lt;P Name="BusObject"/&gt;         &lt;P Name="OutputFunctionCall"&gt;off&lt;/P&gt;         &lt;P Name="SampleTime"&gt;-1&lt;/P&gt;         &lt;P Name="UnitExpr"&gt;inherit&lt;/P&gt;       &lt;/Inport&gt;       &lt;P Name="NumRootOutports"&gt;1&lt;/P&gt;       &lt;Outport Name="Result"&gt;         &lt;P Name="BusObject"/&gt;         &lt;P Name="BusOutputAsStruct"&gt;off&lt;/P&gt;         &lt;P Name="UnitExpr"&gt;inherit&lt;/P&gt;       &lt;/Outport&gt;       &lt;P Name="ParameterArgumentNames"/&gt;       &lt;P Name="ComputedModelVersion"&gt;1.4&lt;/P&gt;       &lt;P Name="NumModelReferences"&gt;0&lt;/P&gt;       &lt;P Name="NumTestPointedSignals"&gt;0&lt;/P&gt;            &lt;/GraphicalInterface&gt;   &lt;/Model&gt; &lt;/ModelInformation&gt;   I had a look at it and it gave a clear Class and it's properties(for me). So I generated the classes as shown below  public class Model {     public string Name { get; set; }      public string Version { get; set; }      public string SavedCharacterEncoding { get; set; }      public GraphicalInterface TheGraphicalInterface { get; set; } }  public class GraphicalInterface {     public List&lt;InPort&gt; InPorts { get; set; }      public List&lt;OutPort&gt; OutPorts { get; set; } }   And Similarly for InPort and OutPort.  Now the question is that how do I parse it into these classes. I can not wrap my head around it. Creating classes looks logical but after that I am not able to progress at all.   Please provide the input and a solution. There are no values as there in normal XML file. I have looked at certain examples but not able to find a solution.
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 :-(
If the magnetic field doesn't polarize does it follow the electric field path of propagation? or does it vanish? Frequency Detection Circuit Design Expected value of subset of variables in Bayesian setting Assume we have $N$ random variables $X_1, \ldots, X_N$ with known (posterior) distributions that are easy to sample from. For simplicity, assume that I am interested in the expected value of the ten largest of these random variables. There will be some uncertainty surrounding this expected value as there is uncertainty with respect to the rank of a given $X_i$ in case the distributions of $X_1, \ldots, X_N$ overlap. I want to use simulation based methods. My approach is to simulate $M$ samples from the distributions of $X_1, \ldots, X_N$, where in each iteration, I construct a binary indicator of length $N$ indicating whether random variable $i$ is within the set of the ten largest samples or not. Averaging over these $M$ draws gives me the probability that random variable $i$ is member of the top ten group. Denote this probability as $\pi_i$. Define a binary random variable that indicates membership in the top ten group as $S_i$. $S_i$ follows a Bernoulli distribution s.t. $S_i \sim Ber(\pi_i)$. In a second step, I draw $L$ samples from the distribution of $S_i$ and from the distributions of $X_1, \ldots, X_N$. Given a draw of $S_i$, I can select the top ten out of the samples of $X_1, \ldots, X_N$ in each iteration and average the respective samples within the top ten group. I save this average, so the result after $L$ iterations will be the distribution of the average outcome within the top ten group, taking into account all relevant sources of uncertainty. My questions are: Is this simulation approach valid in general? From a Bayesian perspective, is this simulation valid or do I need to treat additional quantities (e.g. $S_i$ or $\pi_i$) as random variables that need a prior? Old Budrys(?) end-of-world/alien invasion of NYC story This one, from the late 1950s or early 60s (I think), features the last girl in NYC, who drives her jeep up the stairs of the main library (with the lions). She feels bad about breaking the lock, but what's a girl to do, if she wants something to read? In summertime, she drives topless and, the author writes, her bosom dances enchantingly on the steps. She lives in the boathouse on the lake in Central Park. Mysterious insect-like aliens are eating the buildings in the City.... I didn't recognize a title in Budrys or Bester's isfdb bibliogs, so I may be wrong about the author. But not about the story details: it's a memorable one. Thanks in advance for helping ID this one! I have been playing for almost 2 days, and today it is asking me to sign up again.  I have all my game saved in my google account, but I wonder if I just log in from a trainer account will I keep my progress? How to find $ \int_0^\infty \dfrac x{1+e^x}\ dx$ $\int_{0}^{\infty} \frac{\cos x - e^{-x}}{x} \mathrm dx$ Evaluate Integral Evaluate $$\int_{0}^{\infty} \frac{\cos x - e^{-x}}{x} \ dx$$ Solve $x^2$ $mod$ $23 = 7^2$ What is the procedure to solving $x^2$ $mod$ $23 = 7^2$? According to WolframAlpha, there is no integer solution but I am completely confused as to what steps was taken to determine that.  Before asking the question, I did try to solve this using brute force by plugging in some arbitrary numbers to see whether the square of that number mod $23$ gave me a remainder of $49$ but the procedure was quite tedious. Hence the reason I turned to WolframAlpha.   Going back to the question, I want to know how WoflramAlpha determined that there was no integer solution to solving for $x$. Why does bash show 'Terminated' after killing a process? Here is the behaviour I want to understand:  $ ps   PID TTY           TIME CMD   392 ttys000    0:00.20 -bash  4268 ttys000    0:00.00 xargs $ kill 4268 $ ps   PID TTY           TIME CMD   392 ttys000    0:00.20 -bash [1]+  Terminated: 15          xargs $ ps   PID TTY           TIME CMD   392 ttys000    0:00.21 -bash   Why does it show the [1]+  Terminated: 15          xargs after I kill a process, instead of just not showing it as it was just killed?  I'm using bash on Mac OS X 10.7.5. Make Windows 7 ignore WiFi when ethernet is available When I dock my Windows 7 laptop, I want it to prefer the wired ethernet connection over WiFi.  This is a pretty straightforward thing to do on my Mac - I just reorder my network preferences, and it "does the right thing." I just can't figure out how to achieve the same thing on my Win7 laptop.  So, when I'm docked, it connects to WiFi, and then fails to connect to servers on the local wired network. How do I fix this? Remove linux version 3.19.31 Excel to CSV with UTF8 encoding Uniform continuity of $\sin(x\sin x )$ for all $x\in (0,\infty)$ What is the limit of How to correctly add a path to PATH? Projection on the hyperplane $H: \sum x_i=0$ How do you uninstall wine 1.5? where do I use Database. Methods? How do I detach a process from Terminal, entirely? I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy.  However, I'm struggling with how to completely detach a process (e.g. Firefox) from the terminal it's been launched from - i.e. prevent that such a (non-)child process   is terminated when closing the originating terminal  "pollutes" the originating terminal via STDOUT/STDERR   For example, in order to start Vim in a "proper" terminal window, I have tried a simple script like the following:  exec gnome-terminal -e "vim $@" &amp;&gt; /dev/null &amp;   However, that still causes pollution (also, passing a file name doesn't seem to work). How to build a custom kernel?