Is there anything that emulate static interface? I would like to ensure that a bunch of classes all have this particular static function with the same name to be called on.  The best way to do so is to have every class implement my interface.  But alas, interface don't do static, is there anyway to get around this?
Why Doesn't C# Allow Static Methods to Implement an Interface? Why was C# designed this way?  As I understand it, an interface only describes behaviour, and serves the purpose of describing a contractual obligation for classes implementing the interface that certain behaviour is implemented.  If classes wish to implement that behavour in a shared method, why shouldn't they?  Here is an example of what I have in mind:  // These items will be displayed in a list on the screen. public interface IListItem {   string ScreenName();   ... }  public class Animal: IListItem {     // All animals will be called "Animal".     public static string ScreenName() {         return "Animal";     } .... }  public class Person: IListItem {      private string name;      // All persons will be called by their individual names.     public string ScreenName() {         return name;     }      ....   }
How to keep Heading together with text? I use a very custom style (not mine) and very frequently I get a heading  on the bottom of a page and the next paragraph on the top of the next page. Sometimes this paragraph may be a list or similar. The same is true for listings and the listing description.   Is there a general way how I can adjust the "badness" of these events? Or can I adjust when a section heading would be on the last, say, 3cm of a page it should go to the next page? Or can I say, if a *listing description" is on the top 3cm of a page pull 5 more listing lines from the last page onto this page?   The style I use does not use standard structure tags and environments. But lets call them section, subsection, listing and I will try to migrate them to my lingo. How to get the list of predefined colors in xcolor such that the list can be used in foreach looping? InDesign CS5 tables: Can I automatically fit rows or columns to the size of content? You know how Excel has the function "Autofit," where you select a whole row or a whole column and it resizes the entire thing to the height or depth of the largest content item? I want to do that in an InDesign table, but with one click. (I know I can drag the column out until the overflow box goes away, but I want to know if there's some automated function I'm overlooking.) Does this automatic function exist anywhere? WinForms DataGridView font size How do I change font size on the DataGridView? Is there a way to have two copies of  app in Ubuntu each with a different account?  It seems copying the app in another folder does not work. Do Legendary Pokemon Respawn After The Elite Four? Best lens for taking pictures of surfers How do I install iTunes? I have an iPhone and run Ubuntu on all of my personal computers. Since I did not want to keep a separate partition with Windows on it for the sole purpose of running iTunes, I attempted to install It using Wine.   I installed Wine 1.4 from the Software Center and installed iTunes 10.6.3. When I tried to run it I got a slew of error messages. I hopped over to google where it was suggested that I install it through PlayOnLinux. I did so with the same result. Further googling revealed that iTunes 10.6.x is confirmed to work with Wine 1.5.1 and up.   I installed Wine 1.5.1 following the instructions I found and was unable to get it to open. I did the same with 1.5.9 with the same results. I opened the Package Manager and installed the Wine 1.5.9 packages through it, and it appears to have installed properly.   When trying to install iTunes I got he error "This iTunes installer requires Windows Vista 64 bit or later". Realizing that Wine uses XP as a default I ran winecfg and changed it to Windows 7. This changed nothing and I tried changing it through winetricks to no avail. I even changed it to Vista with the same results.   Does anyone know what is going wrong here and how to fix it? Thanks Italics markup not working in comments If I enter the following mark-down source:  “*blah*”   into a question or answer, then it works, but in a comment it doesn’t. The asterisks remain literal and don’t turn into italics. How to manipulate a CSV file with sed or awk? How can I do the following to a CSV file using sed or awk?   Delete a column Duplicate a column Move a column   I have a big table with over 200 rows, and I'm not that familiar with sed. Exposing database IDs - security risk? Under the U.S.'s Copyright Law, is it an act of copyright infringement if we changed the color of another artist's image to black and white? Etiquette on sending a thank you e-mail to respondents who gave me helpful information Ways to Install and uninstall programs in deb format What is vertex and edge shading? While the etiquette of dealing with duplicate answers , there hasn't been a great way to deal with these, "Uh, yeah, I said this, too" types of behavior than the almighty downvote.   It would be nice to have a "Duplicate Answer" option on the flag menu. Five flags auto-deletes the answer, as with any other flag. In order to prevent abuse, the flagged answer would have to have the last owner edit (including original post) be younger than the original answer's original posting by at least 2 minutes.  Also, this ability should be a 5,000+ rep privilege, since we currently have no fanfare of rep from 3,001 to 9,999, and a power like this has a bit more umph than closing a question.  Thoughts? Was Voldemort a Better Wizard Than Dumbledore? Pursuant to , I have a somewhat related question. The majority of Harry Potter readers automatically assume that Dumbledore must be a better wizard than Voldemort, because Dumbledore is &quot;good&quot; and Voldemort is &quot;evil.&quot; However, would Tom Riddle's prematurely developed skills demonstrate that Voldemort was inherently a better wizard than Dumbledore? In chapter 17, The Heir of Slytherin, Harry challenges Tom Riddle when he claims to be the greatest sorcerer in the world, retorting that Albus Dumbledore is the greatest sorcerer in the world. Harry reminds Tom Riddle that Voldemort is frightened of Dumbledore. Conversely, in Half-Blood Prince, Dumbledore himself states that Voldemort knows perhaps more magic than any other wizard alive. Yet, as Harry is J.K. Rowling's most direct voice, do we conclude that Dumbledore was, in fact, the superior wizard? Who was the better¹ wizard: Voldemort or Dumbledore? ¹Better meaning on a technically skilled level. No Time in Top Panel (Gnome Classic) I've been using Ubuntu with Gnome Classic for a while and I've noticed recently that in the "Indicator Applet Complete" in the Top Panel, my name and the clock have disappeared.    I think it happened a while ago when I was messing around with packages. Every time I did apt-get... it would say "the following packages can be removed by apt-get autoremove", so I did it and then the clock and my name stopped appearing.   Can anyone help me? Thanks. It would be greatly appreciated. So, somehow over the weekend, my 1GB USB flash drive has managed to become write-protected.  There is no switch on the stick, so I'm concluding that something has corrupted at some point.  Obviously I can't format it or remove.  The output from dmesg | tail is:  Buffer I/O error on device sdb1, logical block 328168 lost page write due to I/O error on sdb1 sd 73:0:0:0: [sdb] Unhandled sense code sd 73:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE sd 73:0:0:0: [sdb] Sense Key : Data Protect [current] Info fld=0x0 sd 73:0:0:0: [sdb] Add. Sense: Write protected sd 73:0:0:0: [sdb] CDB: Write(10): 2a 00 00 05 08 00 00 00 01 00 Buffer I/O error on device sdb1, logical block 328200 lost page write due to I/O error on sdb1   I think the second and final lines are a giveaway to corruption, but I don't know how to interpret this output.  Could someone help to see if this output gives any indication?  I usually eject the drive before removing it, but I may have been lax once or twice.  The data isn't critical, it's just bugging me.  Any suggestions on how to fix it (if the drive even can be) would be greatly appreciated. I used to work as a consultant and have been spoiled with nice looking slides. For instance, being able to create slides that have 2, 3, or 4 graphs (perfectly positioned and with nice headers!) at the click of a mouse button via macros.  Similarly, there are many other kinds of word slides that had multiple columns, etc. that would be nice to recreate as well as objects like "main point" boxes at the bottom that summarize a main point and ways to add a transparent highlight to any part of the screen.  Is this kind of functionality far beyond anything that LaTeX presentations can do or is there an archive somewhere of code for making more intricate presentations?