How can I get two value per get request from a List&lt;&gt;, For example, I have a Person List&lt;&gt; with six Person Ordered by ID in that List&lt;&gt; now in every get request using JQuery ajax() I want to get only two item from the list&lt;&gt;, first request will return Person with ID 1 &amp; 2, second request will return Person with ID 3 &amp; 4, and so forth.  I've tried   public IEnumerable&lt;PersonViewModel&gt; GetAllStudents()     {         IEnumerable&lt;Person&gt; dbPersons = _repo.getPersons().OrderBy(s =&gt; s.ID).Take(2);          List&lt;PersonViewModel&gt; persons = new List&lt;PersonViewModel&gt;();         foreach(var p in dbPersons)         {             persons.Add(MapDbPieToPersonViewModel(p));         }          return persons;     }   But this only return first two item.
What is the most preferred and easiest way to do pagination in ASP.NET MVC?  I.e. what is the easiest way to break up a list into several browsable pages.  As an example lets say I get a list of elements from a database/gateway/repository like this:  public ActionResult ListMyItems() {     List&lt;Item&gt; list = ItemDB.GetListOfItems();     ViewData["ItemList"] = list;      return View(); }   For simplicity's sake I'd like to specify just a page number for my action as parameter. Like this:  public ActionResult ListMyItems(int page) {    //... }
Order of "not" with infinitive Do you need to erase the memory of *watching* a memory in a Pensieve? You remove your memory from your brain to store in a Pensieve (as Snape or Dumbledore did). Then, you re-watch the memory (e.g. as Dumbledore re-watched his memories of Voldemort's investigations with Harry) in the Pensieve.   Does that mean that you now re-created the memory in your brain (because you remember watching it) and thus you'll need to extract/erase it from your brain again if you don't wish to keep it there for security/capacity reasons (which was why you stored it in the Pensieve in the first place?  Canon answers only please. What is the purpose of LongLength for .Net Arrays? What is the purpose of the LongLength property for arrays in .Net.  Using a standard integer for length, you could accommodate up to 2 billion indices.  Are there really people using .Net to maintain a single array with more the 2 billion elements.  Even if each element was a single byte, that would still be 2 GB of data.   Is it feasible to use such a large array in .Net? Removing intercept from GLM for multiple factorial predictors only works for first factor in model I am running a binomial logistic regression with a logit link function in R. My response is factorial [0/1] and I have two multilevel factorial predictors - let's call them $a$ and $b$ where $a$ has 4 factor levels  $(a_1,a_2,a_3,a_4)$ and $b$ has 9 factor levels $(b_1,b_2,\dotsc,b_9)$. Therefore:  mod &lt;- glm(y ~ a + b, family = binomial(logit), data=pretend) summary(mod)   The model output would then show all the information about the model as well as the coefficients.  There is a factor level for both a and b missing (a1 and b1) from the summary output. I understand that it is constrained in the "intercept" of the model. I have read that if I want to remove the intercept term and see the estimates for those factor levels I can just add -1 to the model formula, i.e.:  mod2 &lt;- glm(y ~ a + b - 1, family=binomial(logit), data=pretend) summary(mod2)   In the new model (mod2) the intercept term is then gone and variable a's factor-level a1 is given amongst the list of coefficients. But, variable b's factor-level b1 is still missing and given that there is no intercept term anymore, how can I interpret the odds-ratio for that factor level then?  Could someone please explain to me how to get the coefficient for b1 too and why this is happening? Comparison between integrals Let's say - $F(x) &gt; G(x)$ for all $x$ in $E$.  So is it true that ?  $$\int F(x)\,dx  &gt; \int G(x)\,dx$$ or I can use this statement only when the two functions are non-negative functions.  Thanks! Suppose $u\in W^{1,1}$ and $\partial u$ is $C^1$. I want to prove the following: $$\int_{\partial\Omega}|u-\bar u|\leq A\int_{\Omega}|\nabla u|$$ where $\bar u=\frac{1}{|\Omega|}\int_{\Omega}u$ and $A&gt;0$. Note that unlike Poincar&eacute; inequality, the left integral is over $\partial\Omega$ and not $\Omega$. How can I do that?  I tried to prove in a similar way to Poincare inequality proof (arguing by contradiction), but with no success. I think I am missing something because of the  $\partial\Omega$ issue. Importing Nodes to D7 with all custom fields I've got a Drupal site with an obscene about of content that has been given to me in CSV format. I'm toying with the idea of building a module to let me do this but if there's one already out there that I can use to just get this site out of the way that would be awesome.  My question is: Is there anything out there that allows you to import a CSV file into D7 that will populate the node table and all the custom fields tables as well?  Thanks. Passing variable arguments to another function that accepts a variable argument list Integral of $\sin(e^t)dt$ Let $f(x) = \int_x^{x+1} \sin(e^t)dt$. Show that $$ e^x|f(x)| &lt; 2 $$ and that $$ e^xf(x) = \cos(e^x) - e^{-1}\cos(e^{x+1}) + r(x) $$ where $|r(x)| &lt; Ce^{-x}$ for some constant $C$.  I can do the first part easily. Integration by parts gives us $$ f(x) = \frac{\cos e^x}{e^x} - \frac{\cos e^{x+1}}{e^{x+1}} - \int_{e^x}^{e^{x+1}} \frac{\cos u}{u^2}du, $$ so substituting $\cos u = 1$ and $\cos u = -1$ gives \begin{align*} \cos e^x - 1 + \frac{1}{e}\left(1- \cos e^{x+1}\right) &amp;\leq e^xf(x) \leq \cos e^x + 1 - \frac{1}{e}\left(\cos e^{x+1} + 1\right)\\ -2 &amp;&lt; e^xf(x) &lt; 2 \end{align*} So that $e^x|f(x)| &lt; 2$.  I get stuck on the second part, though. From integration by parts, I have $e^xf(x) = \cos e^x - e^{-1}\cos e^{x+1} - e^x\int_{e^x}^{e^{x+1}} \frac{\cos u}{u^2}du$, so it reduces to showing that $$ \left|\int_{e^x}^{e^{x+1}} \frac{\cos u}{u^2}du\right| &lt; Ce^{-2x} $$ for some constant $C$. However, I always end up with a constant for $Ce^{x}$ rather than for $C$. Alternative to LibreOffice Base for Ubuntu Allow more than one @name notification per comment Now this is probably a surprise to many since I always see thousands of comments like :  @Sarfraz, @balpha just told you they did in the first comment he wrote. Also, allowing only one Stack Overflow user to be logged in per IP address would be problematic for networks with shared IPs.  What's surprising is that apparently the notification will trigger only for Sarfraz and not for balpha. As you can see from the :  Only one person can be replied to at a time in a comment. The first one in the string wins.  I propose to increase the limit to let's say 3 or 5 people; it won't hurt (never seen that feature being abused) and especially many people believe it already works that way. Recover data from hard drive with partitions (but not most data) overwritten I have a 500GB hard drive I've been keeping around to recover data from that I removed from a failing NAS drive that got sort of... erratic at the end. I finally got rid of the NAS when during a firmware update it removed the partition table.  Fast forward to a week ago, when I was building a new PC, and a mixup resulted in me placing the hard drive in question in the new PC and installing Windows XP on the first 100GB. I'm presuming any data on that first 100GB is now gone, but for the rest of it, is there any way I can recover it at home, as professional data recovery is currently too expensive?  I have a blank 1TB HDD if I can store any images of that hard drive on. The problem was definitely with the NAS and not the hard drive, as the hard drive had a successful install of Windows when mistakenly place in the new PC, and there were capacitors in the NAS's circuitry clearly broken.  The data I want to recover (in order of priority) is:   High: Some jpgs of family photos. Medium: Some RAW files. (There are also jpg versions of all of these) Low: Some mp3s, avis and ISOs, I can re-rip most of these if need be, but it'd be handy not to have to.    (I don't need a backup lecture, and if you can hold it in from nagging Jeff Atwood for it, you can hold it in from nagging me for it)  In short:   The partition tables are gone and overwritten. The data is not overwritten, except for an amount equal to the size of a Windows XP SP3 installation. I am confused by the behaviour of Currency fields in Multi-Currency environments. My app does a calculation on day X and stores its result in a record.  The custom page which displays a SUM of those values should always display the same as a database query. But...it does not. If I change Exchanges Rates those values change.  Was it wrong to store currency values in a Currency field, am I querying incorrectly or do I need to display a values that is manually calculated?  How does Multi-Currency and Currency fields work together? When are currency values converted and which conversion rate is taken into account?  I am confused?! "No such file or directory" when trying to remove a file, but the file exists? A friend of mine misplaced his passport while staying in Jeju island. Normally I would advise him to just travel to Seoul, get an emergency passport from his embassy and fly back home without issues, but I know that Jeju island has a special immigration regime.   Are there any immigration checks on the way from Jeju island to Seoul? If not, can one travel that route without a passport? This is maybe a duplicate like , but the error still appears.    When I try to click "mark as duplicate" a HTTP 404 error occur.  I'm using Firefox 16.0.2 with Firebug on Mac OS X 10.5.8 Windows 7 stuck on CLASSPNP.SYS I'm running Win 7 x86 on a Lenovo Thinkpad Z61m in dual boot mode with Win XP, both OSes are running on separate partitions. I have a faulty battery and if left unplugged my laptop shuts usually down within 10 minutes. Last night, it shut down due to this, but after plugging in AC power and starting back up I'm stuck at the "Starting Windows" screen, I'm unable to boot into safe mode or into recovery mode(XP boots fine).  I believe I had installed some Win 7 updates the same/previous day. From one of the boot options I was able to see that Windows 7 is getting stuck on CLASSPNP.SYS  How can I go about fixing this?  I do have a complete Win 7 Restore CD that I created after setting up my machine, I'm unable to boot into this either.  Please help! Polynomials with integer coefficients such that $p(a)=b,p(b)=c,p(c)=a$ While studying polynomials a question struck in my mind that  To have a polynomial $p(x)$ with integer coefficients and $a,b,c$ are three distinct integers, then is it possible to have $$p(a)=b$$$$p(b)=c$$$$p(c)=a$$ Ability to view your own questions The app doesn't have a way to show your own questions. It would be nice to get a quick handle to those. I can't install VMwarePlayer 4.0.3 on Ubuntu 12.04 64Bit. For Version 4.0.2, I found a script that I have to run to patch VMware Player for it to work on my system to properly, and after that I could install 4.0.2.  Is there an similar solution for Version 4.0.3?