I'm trying to do the following:  foreach (var item in Assembly.GetExecutingAssembly()                              .GetTypes()                              .Where(i =&gt; i.GetInterfaces()                              .Contains(typeof(ITabItem)))) {     container.RegisterType&lt;ITabItem, item&gt;(nameof(item)); }   But I'm getting this error on item in the RegisterType method:   Error CS0118  'item' is a variable but is used like a type  I know that I'm passing an object type but how do I get around this?  EDIT: this is the non-dynamic way that works.  container.RegisterType&lt;ITabItem, AdminViewModel&gt;(nameof(AdminViewModel)); container.RegisterType&lt;ITabItem, OwnerViewModel&gt;(nameof(OwnerViewModel));
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 to stop reordering of the same kind multiple preview windows in task switching? Writing C# debug output to .txt file Real valued analytic function defined on a connected set is constant Let $G$ be a connected set and $f : G \rightarrow \mathbb{C}$ a real valued analytic function. Prove that $f$ is constant.    My idea to prove the result is to prove a subset $A \neq \varnothing$ of the connected set $G$ is both open and closed. So $G=A$ Take $f(w) = a$ $$A = \{z\colon z \in G, f(z) = a\}$$ Now I want to show that $A$ is infinite. How to do it? After that it is easy to prove $A=G$. rsync and symbolic links I want to backup my home directory to an external drive nightly using a cron job to execute rsync.  I am unsure of the exact behavior of rsync's symbolic link flags.   rsync's -a flag includes the -l flag (i.e. "copy symlinks as symlinks").  Does this just mean it will copy the link or that it will follow the link and copy everything in the link-to directory?  I want to avoid that because I have links to directories full of media files that would involve copying hundreds of gigabytes I don't need to back up. Fearing (but not certain) that rsync -a would copy all those media files I instead added the --no-links flag.  This does not seem to be behavior I want.  It just ignores copying any link which is problematic because I do have links I want copied (e.g. links to common header files from different project directories). Assuming #1 above (without the --no-links flag) is what I really want and it just copies the link without copying the linked-to files, will the links break when they are backed up?  For example I may rsync source directory /home/me/projects/misc to /media/extdrive/backup/home/me/projects/misc.  In this case I assume rsync is not smart enough nor does it try to correct the contents of symlinks for the relative directory changes.  Is this correct?  This is okay, it doesn't matter if the links are broken in the backup directories so long as they would be fixed and working if such time comes when they need to be restored. Suppose $\lim \limits_{n \to ∞} a_n=L$. Prove that $\lim\limits_{n \to ∞} \frac{a_1+a_2+\cdots+a_n}{n}=L$ A current I flows through a solenoid (with n turns). Self inductance is $L$. If the magnetic flux is $\phi$, I am taught that $-n\phi=LI$  I dont understand the part with $n$, why do we have multiply by $n$? $\phi$ itself represents the whole magnetic flux there, if $\phi$ implied the flux only occurred by one coil, then it would be correct.   Moreover, flux change by a coil ($n$ turns) in $dt$ time is $d\phi$, so the induced electromagnetic force is   $$dE=n \cdot \frac{d\phi}{dt}$$   Why do we multiply by $n$ here? If $\phi$ means the whole flux, then why multiply? Is there a size limit on external USB hard drives? The internal SATA hard drives have a limit on a lot of motherboards of 2TB and if I want to get a 3TB HDD then I need to connect it using a PCI card (or get a new motherboard).  But I wanted to ask: If I connect a 3TB harddrive to a external USB enclosure, will it work? The  I want to buy says it supports up to 3TB HDD but I want to make sure. Speed of light travel How not to show Universal Access menu Icon in task bar in Ubuntu 18.04? What is the purpose of a Windows Workgroup? In Microsoft Windows, what is the purpose of a Workgroup? I understand that a Domain allows the administration of security (user names, passwords, file access, etc.) to be centralized. But what does a Workgroup give you? Conky does not work properly on Ubuntu 16.04 GNOME I have this strange problem with conky. It doesn't show properly on the desktop:    I've tried everything from editing conky widget file to reinstalling conky and conky manager (v.2.4). Who knows how to fix it? I was running out of space for Windows 10, so I deleted my Ubuntu partition and then combined the free space and added it to the Windows 10 partition into a single partition (the boot partition was untouched). Now all I get when I turn on my computer is:  Error no such partition. &gt;grub rescue   I have tried rebooting, but it did not work. Is there any way to fix it? My idea is that if i reinstalled Ubuntu it may fix it, but I'm not sure. I don't have a Windows repair disk, and I can't make one, but I do have a 4GB USB flash drive. Is there a noun that doesn't have a plural in any of its forms? While attempting to answer  @ProgramFox has been trying to come up with an example of a noun with no plural.   The best I've come up with is egotism and Judaism.  ()  Some of the contenders I've already shot down are air, water, and money.  (Airs, waters, and monies are all legitimate plurals.)  My question is, a) Do my two examples have actual plurals?  b) Are there any other non-ism nouns that don't have a plural? Privacy/Security concers for setting up business email using Gmail app on Nexus devices I need to set up my business email*(non gmail email)* on the mobile devices (Nexus 5 and Nexus7). The business has its own private mail server. The way I can do it is by using Gmail app on these devices. The question I have is does Gmail app on the mobile devices store the IMAP emails(non gmail emails) on the gmail servers? Or Gmail app is just a client and does not bother storing the IMAP emails(non gmail emails) on its servers that are not gmail emails? Thanks for the insight... My desktop look is empty so all I have is a nice wallpaper. My Windows taskbar has the "Taskbar Appearance" setting to "Auto-hide the taskbar". Although hidden, it leaves a thin top layer so you can still see it a bit, and where the pinned shortcuts are. Is it possible to totally have it hidden without a trace? This is a serious question. It really bugs m. Show that the locus formed by z in the equation $z^3 + iz = 1$  never crosses the co-ordinate axes in the Argand plane. Further show that $$|z| = \sqrt{\dfrac{-\Im(z)}{2\Re(z)\Im(z) +1}}$$  Concept: $z=x+iy$ $z^3=(x+iy)^3=x^3-3xy^2+i(3x^2y-y^3)$ $iz=-y+ix$ Combined equation is $x^3-3xy^2-y-1+i(3x^2y-y^3+x)=0$ How do we proceed from here onward? Let $E=l^p=\left\{x=\left(x_n\right): x_n\in\mathbb{R}, \sum_{1}^{\infty}\left|x_n\right|^p&lt;\infty\right\}$ with $1\le p&lt;\infty$, $\left\|x\right\|_E=\left(\sum_{1}^{\infty}\left|x_n\right|^p\right)^{1/p}.$ Let $\left(\lambda_n\right)$ is a bounded sequence in $\mathbb{R}$ and consider the operator $T$ defined by $$T(x)=\left(\lambda_1x_x,\ldots,\lambda_nx_n,\ldots\right)$$ where $x\in l^p$. Prove that $T$ is a compact operator from $E$ to $E$ iff $\lambda_n\rightarrow 0$.  Can anyone give me some hints to solve this problem? Thank you! Android app "Unknown error" when uploading photo Spent a half hour on this. Android 5.1.1 latest version SE app (Play Store won't let me update so latest).   Tried to upload photo into an answer. "Something went wrong".  Did tricks to reduce photo size to 275k -- same.    45k rep on the stack.  Here is the photo..... oh wait.  How do I solve? How to change plot style or other options after it was created Site name gets cropped while looking at user profiles on international Stack Overflow sites