I am trying to get the table name from the dbset property.  When a change is made I get the name of the class  Type myType = entry.Entity.GetType().BaseType; string name = myType.Name;   This gives me a string with the name of the class. In this example Employee.    public virtual DbSet&lt;Employee&gt; Employees { get; set; }   I'm trying to get the name of the table by sending the class to the following method.  public static string GetTableName&lt;T&gt;(this DbContext context) where T : class {     ObjectContext objectContext = ((IObjectContextAdapter)context).ObjectContext;      return objectContext.GetTableName&lt;T&gt;(); }  public static string GetTableName&lt;T&gt;(this ObjectContext context) where T : class {     string sql = context.CreateObjectSet&lt;T&gt;().ToTraceString();     Regex regex = new Regex("FROM (?&lt;table&gt;.*) AS");     Match match = regex.Match(sql);      string table = match.Groups["table"].Value;     return table; }   The problem is, these methods expect a class name and not a string.  How can I convert the string to a class name, or modify the method to accept the string.
What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod&lt;T&gt;() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod&lt;T&gt;()?         GenericMethod&lt;myType&gt;(); // This doesn't work          // What changes to call StaticMethod&lt;T&gt;()?         Sample.StaticMethod&lt;myType&gt;(); // This also doesn't work     }      public void GenericMethod&lt;T&gt;()     {         // ...     }      public static void StaticMethod&lt;T&gt;()     {         //...     } }
How would Voldemort restore himself from a horcrux? If Voldemort's body dies, what process would he use to restore himself from a horcrux? His plans seem sloppy for the pains he had taken. For example, why create horcruxes from pieces of jewellery when they dont have the agency to seek out a new body by themselves?  He needed Quirrel, a person with unlikely ambitions to seek him out to gain an useful body. When that body was gone, he needed Barty Crouch, someone with questionable agency (he could be imprisoned) to transport Harry and draw his blood.  Nagini and the diary seems the only horcruxes with agency, the others are mostly inert.  What plans were ever taken to restore Voldemort from his horcruxes? Has anyone successfully deleted the Windows Installer files successfully before? They are taking up 35.1% of my total hard drive space.  Which ones are needed and which ones can be purged?  In order to see this folder, I had to unhide system files by going to Windows Explorer > Organize (dropdown) > Folder and Search Options > view tab > uncheck ==> Hide protected operating system files (Recommended).  I used WinDirStat program to get these percentages. To see the image in full size, open it in a new tab.  I was told by someone that you should not delete these files, but then I found a utility--Windows Installer CleanUp Utility (very old version) that deleted these.  But it doesn't run on Windows 7.  If anyone has a later version that they found works, please let me know the path. How do you search for questions filtered by a particular user? I want to do a search on StackOverflow for a few terms, but also by user, since I know which user referenced the item I'm looking for. Design a custom Beamer theme from scratch SOQL: Comparing two custom relationship fields in a nested query Meaning of the buffers/cache line in the output of free Why does my server show              total      used      free   shared buffers    cached     Mem: 12286456  11715372    571084        0   81912   6545228 -/+ buffers/cache:  5088232   7198224    Swap: 24571408     54528  24516880   I have no idea on calculating the memory in linux. I think it says that 5088232 is used where as 7198224 is free, meaning it is actually consuming 5GB of RAM? How do I install Netbeans? I used NetBeans for Java development on Windows and remember finding it in the Ubuntu Software Center on Natty, but now it's gone. Is there a PPA I can use or will it be re-added to the official repos? What are valid values for the id attribute in HTML? Geometric interpretation of $\frac {\partial^2} {\partial x \partial y} f(x,y)$ Are there any geometric interpretation for the second partial derivative? i.e.  $$f_{xy} = \frac {\partial^2 f} {\partial x \partial y}$$  In particular, I'm trying to understand the determinant from  for determining whether a critical point is a minima/maxima/saddle points:  $$D(a, b) = f_{xx}(a,b) f_{yy}(a,b) - f_{xy}(a,b)^2$$  I have no trouble understanding $f_{xx}(x,y)$ and $f_{yy}(x,y)$ as the of measure of concavity/convexity of f in the direction of x and y axis. But what does $f_{xy}(x,y)$ means? Top of answer covered by sticky top bar after clicking direct link The "Very Low Quality" (VLQ) flag reason is really annoying me.   It is the analog to the mommy mommy flag (which my 1.5-year-old child raises quite frequently). It provides no real clue as to what the flagger really wants us to do with the post.   Does she want us to close the question?  Does she want us to edit it into shape?  Does she want us to delete the question?  Does she want us to ban the user?  Does she want us to jump around and have a party?    Should we get rid of this flag reason?   Is it just me? Should and can we replace it with something better?     EDIT I accepted Jeff's answer. The tougher wording has heavily decreased the amount of very low quality flags. We now see only about 25% of the amount we used to and they are usually valid. Additionally, we now only allow very low quality on posts with a score of 0 or lower. When I create a folder or copy files, after the operation finishes I have to manually refresh the Explorer window (F5). For example, when I create a folder, I don't see the "New Folder" until I hit F5.  Does anyone have any idea how to fix this? Site hosted on EC2 / Amazon held hostage with private key I have a new client whose previous developer has left her high &amp; dry with her site on Amazon/EC2. He holds the private key to the instance, and though she has full access to the Amazon control panel (she's paying $300/mo for a site that has like 3 visitors per week) she doesn't have any way to get her content off and move to a new host.  I'm not familiar with AWS and am not sure how to help her. The site's group/file permissions are screwed up on the server so exporting the content/database via her WordPress control panel isn't working.  Any ideas on how to help her? Thanks! extract the 4th column from a csv file using unix command I have a csv file formatted as below.  "col1","col2","col3","col4" "1","text1","&lt;p&gt;big       html      text&lt;/p&gt; ","4th column" "2","text2","&lt;p&gt;big2       html2      text2&lt;/p&gt; ","4th column2"   I want to extract the 4th column using.  I think that awk is the best tool for this ( let me know if I am wrong). I tried this   awk -F, '{print $4}' myFile.csv    but it fails.  I think because the 3rd column is multiline one.  How can I use awk or any other unix command to extract the 4th column.  I am looking for an efficient solution since my real file is big (> 2GB) The Borel-Cantelli Lemma in  seems to be a sort of "corollary" of the .  It says:  "Let $(E_k)_{k=1}^{\infty}$ be a countable collection of measurable sets for which $\sum_{k=1}^{\infty} m(E_k) &lt; \infty$. Then almost all x $\epsilon \ \mathbb{R}$ belong to at most finitely many of the $E_k$'s"  I don't get three things:   "Then almost all x $\in \ \mathbb{R}$ belong to at most finitely many of the $E_k$'s"   What does that mean? Since the Borel-Cantelli Lemma comes after the "almost everywhere" definition, I guess: $\exists \ Z \ \subset \mathbb{R}$ s.t. $m(Z) = 0$ and $\forall x \ \in \ \mathbb{R} \setminus Z$, x belongs to $(E_{j}, E_{j+1}, E_{l}, ..., E_{m})$.   In the proof, one can see the $m(\limsup \ E_k) = 0$ part, stated as $m(\cap_{n=1}^{\infty} [\cup_{k=n}^{\infty} E_k]) = 0$. For some reason, $m(\cap_{n=1}^{\infty} [\cup_{k=n}^{\infty} E_k]) = 0$ implies that "Therefore almost all x $\in \ \mathbb{R}$ fail to belong to $\cap_{n=1}^{\infty} [\cup_{k=n}^{\infty} E_k]$ and therefore belong to at most finitely many $E_k$'s"   Okay, why? What is the contradiction if almost all $x \epsilon \ \mathbb{R}$ belong to all the $E_k$'s? Or a countably infinite subcollection?   What is the significance of this? Why not just state the Borel-Cantelli Lemma as "Let $(E_k)_{k=1}^{\infty}$ be a countable collection of measurable sets for which $\sum_{k=1}^{\infty} m(E_k) &lt; \infty$. $m(\cap_{n=1}^{\infty} [\cup_{k=n}^{\infty} E_k]) = 0$"? Forgotten PostgreSQL Windows password Proof of $a^{\phi (n) +1} \equiv a \pmod{\! n} $ Carmichael generalization of Fermat-Euler's theorem. How permanent magnets work?Are they working with motion of electrons? Is there a way to take a screenshot of an Android device and save it as an image file? How to run scripts every 5 seconds?