I have an IEnumerable called day.  I am trying to get all the elements from the IEnumerable and convert them to a string.  Using   string day = day.First().ToString()   I am able to get the first element.  I have tried using .ToList() and .ToArray() both do not print out the elements.
Is there a way to convert a List(of Object) to a List(of String) in c# or vb.net without iterating through all the items? (Behind the scenes iteration is fine – I just want concise code)  Update: The best way is probably just to do a new select  myList.Select(function(i) i.ToString()).ToList();   or  myList.Select(i =&gt; i.ToString()).ToList();
Number of functions from n-element set to {1, 2, …, m} I've gotten stuck at the following exercise;     There are m functions from a one-element set to the set {1, 2, …, m}.   How many functions are there from a two-element set to {1, 2, …, m}?   From a three-element set? Give a recurrence for the number of T(n) of   functions from an n-element set to {1, 2, …, m}. Solve the recurrence.   I'm not sure how to begin solving it? Should questions having lots of downvotes be downvoted further? Is down-voting an already heavily down-voted/closed question kind of like kicking a dead horse? Is this bad practice? How to check if jQuery.ajax() request header Status is "304 Not Modified"? I wanted to try out different desktop environments so I installed XFCE, KDE, GNOME, etc on top of Unity in Ubuntu 12.04  After a while I decided that I didn't like those other DEs and would stick to Unity. So I changed my default DE to Unity by configuring gdm.  sudo dpkg-reconfigure gdm   Now I am able to choose my DE at login time and all of DEs are working properly.   But the strange thing is that my boot up screen says 'lubuntu', my login screen is KDE, and my desktop is Unity.   How and why is this happening? Why didn't my gdm configuration have any effect? Does login and boot up screen need to be configured separately from the DE?  There are other similar questions here but they are not the same as this one. I do not want to remove the other enviroments I'm quite happy with having a list of DEs to select from. I want to know how to set proper defaults. How do I install the latest Python 2.7.X or 3.X on Ubuntu? I want to install the latest Python tarball on Ubuntu, downloaded from .  Is this is a correct way to install?  ./configure make make install   If not, how do I do that? Let $g_n= {2^2}^n +1 $. Prove $g_0 · g_1 · · · g_{n−1} = g_{n} − 2$.    I'm not sure how to start this proof, if it should be done algebraically or if I should try to use a proof by induction. Where are some good places to find royalty free stock images? How can I donate to Ubuntu without PayPal? When I wanted to download Ubuntu 12.10 from ubuntu.com, I was asked to make a donation. However, there is only a PayPal option to make the payment. But I don't use PayPal. Is there any other option to make the payment? In C++/CLI, what does the hat character ^ do? I was reading Ivor Horton's Beginning Visual C++ 2008 and many of its CLR examples have this definition for main:  int main(array&lt;System::String ^&gt; ^args)   I went back, page by page, to the beginning of the book to find the first such instance with an explanation what it really means, but couldn't find one.  Obviously it means the same as the standard int main(int argc, char *argv[]), but I'd like to know when and why that ^ is really used, and why it even exists (does it do something that pointers * and references &amp; cannot represent)? I am using 15.04.   So I'm working with git and I installed the standard version. I set up the ssh keys and was able to clone one of my repositories to the correct folder. Everything was working great and then I decided it was a good idea to install more packages. I ran sudo apt-get install git-all. I'm looking at error codes now having to deal with upstart.  start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused No apport report written because the error message indicates its a followup error from a previous failure. dpkg: error processing package runit (--configure):  subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of git-daemon-run:  git-daemon-run depends on runit; however:   Package runit is not configured yet.  dpkg: error processing package git-daemon-run (--configure):  dependency problems - leaving unconfigured Errors were encountered while processing:  runit  git-daemon-run E: Sub-process /usr/bin/dpkg returned an error code (1)   This is what happens when I even update/upgrade my system. At this point all I'm looking to do is be able to install software and update my current software. Is there any way I can potentially reverse this issue or at least correct it?   Edit: Thankfully this issue was solved only a day or two after it happened. The accepted answer worked perfectly and took care of my issue How do I make the method return type generic? Consider this example (typical in OOP books):    I have an Animal class, where each Animal can have many friends. And subclasses like Dog, Duck, Mouse etc which add specific behavior like bark(), quack() etc.  Here's the Animal class:  public class Animal {     private Map&lt;String,Animal&gt; friends = new HashMap&lt;&gt;();      public void addFriend(String name, Animal animal){         friends.put(name,animal);     }      public Animal callFriend(String name){         return friends.get(name);     } }   And here's some code snippet with lots of typecasting:  Mouse jerry = new Mouse(); jerry.addFriend("spike", new Dog()); jerry.addFriend("quacker", new Duck());  ((Dog) jerry.callFriend("spike")).bark(); ((Duck) jerry.callFriend("quacker")).quack();   Is there any way I can use generics for the return type to get rid of the typecasting, so that I can say      jerry.callFriend("spike").bark(); jerry.callFriend("quacker").quack();   Here's some initial code with return type conveyed to the method as a parameter that's never used.   public&lt;T extends Animal&gt; T callFriend(String name, T unusedTypeObj){     return (T)friends.get(name);         }   Is there a way to figure out the return type at runtime without the extra parameter using instanceof? Or at least by passing a class of the type instead of a dummy instance. I understand generics are for compile time type-checking, but is there a workaround for this? How do I view 'git diff' output with my preferred diff tool/ viewer? When I type git diff, I want to view the output with my visual diff tool of choice (SourceGear "diffmerge" on Windows). How do I configure git to do this? Are all multiplicative functions additive? Suppose $cf(x)=f(cx)$ and $f:\mathbb{R}\to\mathbb{R}$. I believe it follows that $f(x+y)=f(x)+f(y)$.   Proof: There is some $c$ such that $y=cx$. Then  $$f(x+y)=f\left((1+c)x\right)=(1+c)f(x)=f(x)+cf(x)=f(x)+f(cx)=f(x)+f(y)$$  QED.  I wonder if the same thing holds for when $f:\mathbb{R}^n\to\mathbb{R}^n$? I can't use the same trick, because all vectors are not scalar multiples.  I tried thinking of it in terms of basis units, but didn't get anywhere. I"m studying normalization and have been reading through descriptions and examples online. One Concept that isn't clear to me is if the process can be automated at any point. I understand that a system can't tell you if you schema makes any real-world sense, but it seems likely to me that if you feed a program some arguments say, the functional dependencies, it would be able to do some steps for you.  Say you have a relationship R(A,B,C,D)  and you tell your program that A,B->C and A->D and that the primary key is (A,B)  Now if my understanding serves me correctly it should be possible for a program to identify that A->D violates 2NF because D depends on A and A is a subset of the primary key. That the proper decomposition would be R1(A,B,C) and R2(A,D).   The main book i'm learning from and my instructor indicate these normalization's are done all by hand. Is this correct or can some parts be automated? Suppose I have a document with multiple include or input statements  \input{fileA} \input{fileB}   etc.   Is there an easy way to generate a single .tex file where \input{fileA} is replaced by the actual content of fileA etc. without copying it manually? What are the guidelines for reviewing? About reviewing The review queues contain posts that possibly need further action from the community, like improvement, closure or deletion. By presenting those posts for peer-review, the system aims for higher quality content. Some user actions, such as suggesting an edit, casting a flag, close vote or reopen vote, or posting for the first time, can trigger the inclusion of a post on a review queue. There are also posts included on the queues algorithmically, such as the contents of Late Answers and Low Quality Posts. General guidelines  Always read the full post you are reviewing. Don't rush. Take the necessary time to read the post carefully. If you don't care about a post, just click Skip or Not sure. When you need more context, open the post link to see the question and all answers. Most posts coming up for review can be improved. Use the Edit option, and edit thoroughly. If you're unsure how to review a post (perhaps it's outside your areas of expertise), skip it. Someone who understands it better will review it later.  Guidelines for specific review queues         (Stack Overflow only) How to control a motor with only relays and push button? Hello I´ve been working in this project for some days, I need to make a circuit with only relays that can make a dc motor start, stop and a reverse. The thing is that when you push the start or the reverse button the motor need to keep running, I can´t keep it pushed.  This is as far as I can get. SW1 turns the engine on, SW5 turns it off and SW7 reverse the motor but only if it is already running. What i need is that the reverse button also turns the engine on. Please help.  notes: -i can only use three push buttons and as many relays as needed. Yes is a school assignment.  THANKS! Show that the Sorgenfrey line does not have a countable basis. I am trying to understand this proof from Munkres' book which shows that the Sorgenfrey line does not have a countable basis. His proof is:  Let $\beta$ be a basis for $\mathbb{R}_l$. Choose for each $x$ an element $B_x \in \beta$ such that $x \in B_x \subset [x, x+1)$. If $y$ is not equal to $x$ then $B_y \neq B_x$ since inf($B_x$) = $x$ and $y$ = inf($B_y$). Therefore $\beta$ must be uncountable.   I am new to topology so I am probably just missing a simple point but I do not see why $\beta$ must be uncountable according to this argument. I agree that $B_y \neq B_x$ but isn't it possible that $y \in B_x$ (and thus the set $B_y$ is not needed as part of the basis)? Thanks in advance for your help. What is rank deficiency, and how to deal with it? I know it is so weird, but last night I set an image on my desktop background and delete the image, then I right-click on the desktop and press the desktop properties to change the style of background (center, stretch and etc) then the desktop properties stopped something like hanging on Windows.   Then a black window alerted something and I press yes without reading it. after that with right-click on the desktop I just see this:    Even some system applications don't work now. for example, I cannot take a screenshot.  Also, my pcmanfm-qt is dead completely, with the command line or clicking on the icon nothing happens.  I don't know what happens. and I have no idea how to fix it.