Execute a Linux Cron Job permission denied
How do I set up a Cron job?
Create Generic method constraining T to an Enum I'm building a function to extend the Enum.Parse concept that  Allows a default value to be parsed in case that an Enum value is not found Is case insensitive  So I wrote the following: public static T GetEnumFromString&lt;T&gt;(string value, T defaultValue) where T : Enum {     if (string.IsNullOrEmpty(value)) return defaultValue;     foreach (T item in Enum.GetValues(typeof(T)))     {         if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;     }     return defaultValue; }  I am getting a Error Constraint cannot be special class System.Enum. Fair enough, but is there a workaround to allow a Generic Enum, or am I going to have to mimic the Parse function and pass a type as an attribute, which forces the ugly boxing requirement to your code. EDIT All suggestions below have been greatly appreciated, thanks. Have settled on (I've left the loop to maintain case insensitivity - I am using this when parsing XML) public static class EnumUtils {     public static T ParseEnum&lt;T&gt;(string value, T defaultValue) where T : struct, IConvertible     {         if (!typeof(T).IsEnum) throw new ArgumentException(&quot;T must be an enumerated type&quot;);         if (string.IsNullOrEmpty(value)) return defaultValue;          foreach (T item in Enum.GetValues(typeof(T)))         {             if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;         }         return defaultValue;     } }  EDIT: (16th Feb 2015) Christopher Currens has posted  below, which is well worth a look, and an upvote. I will remove this edit if the solution bubbles further up the page. EDIT 2: (13th Apr 2021) As this has now been addressed, and supported, since C# 7.3, I have changed the accepted answer, though full perusal of the top answers is worth it for academic, and historical, interest :) How can I delete Facebook messages I've sent to other Facebook users from their inbox?  I have had a conversation with my friend but now I want to delete my messages from that conversation. Can I have them deleted from my friend's inbox? A standard document (e.g. scrreprt) uses roman font family for text and Sansserif font family for titles etc. It is the other way round in beamer. How can I switch the two font families? Or why do beamer define the font families in this way?  For the background: I think this is my problem when using formulas, because they use the Sansserif font instead of the roman version. Formulas using the euler package look really poor.  P.S.: I compile with LuaLaTeX using TeXlive 2013. YA dystopia novel of battle school with unusual military control scheme Pretty printing XML with javascript I was curious about how other people use the this keyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples:  In a constructor:  public Light(Vector v) {     this.dir = new Vector(v); }   Elsewhere  public void SomeMethod() {     Vector vec = new Vector();     double d = (vec * vec) - (this.radius * this.radius); } I keep hearing about tandem breakers, and how they won't work with 240V loads and how they should never be used for a multi-wire branch circuit.  Aside from those issues...  What is a tandem breaker?     (note: they can be thrown independently). What's the reasoning behind the delete:1 restriction for only content I own? I recently reached 10k reputation on Stack Overflow, and noticed that I now have the ability to view deleted posts with deleted:1 via the search bar. I'd like clarification as to why the restriction exists that prevents me from searching through all deleted posts?  I feel like this would be beneficial for several reasons:   , a bot that was designed to detect spam,  to help fight spam. Having deleted:1 as an option could offer a second link to show the amount of true positives, to determine if it's worth adding to a blacklist. In , the domain v-play.net was deemed as "Too many FP's". Having a check to see how many TP's there may be, may outweigh the number of false-positives, and would give a better view. Bots are currently unable to view deleted posts through the API (Even if the linked user account/API user has >10k reputation). I think that this is partially because of this restriction. I had brought it up , because I thought that having SmokeDetector log a (non-caught) rude/abuse or spam posts would be beneficial, so that we could adapt our methods to catch these types of posts in the future.  was posted earlier today. I remembered it was similar to another post I came across, but was unable to find it because . Being able to search deleted posts would have allowed me to catch this behavior, and bring it up to the mods (I was lucky that someone else had a link for it, and we were able to advise the user what to do in the future). As a member of , I come across a lot of posts that are borderline spammy (via ) which I have a vague recollection of seeing before. Instead of flagging as spam, I usually vote NAA as to not nuke a user, but by being able to search deleted posts for that user, I can see if he is habitually continuing to post links to his product/service, and flag for custom moderation attention in case.   Overall, I think it would add a lot more visibility that could be helpful in bringing problematic issues to dimaond moderator attention, something that was specifically mentioned in :     Make sure what is being deleted should have been deleted, and bring unnecessary or harmful deletions to the attention of the community and/or moderator team.   Additionally, I think that deleted:1 is almost useless in the current state it's in. If the restriction exists that I can already view my own deleted posts, why shouldn't it be available to all users (If it's limited to one's self), as I can already view my own deleted posts? Existence of minimal $\sigma$-algebra and transfinite induction What is the best book to learn probability? Question is quite straight... I'm not very good in this subject but need to understand at a good level. Possible Duplicate:          My reputation score has gone down, but the reputation tab in my profile does not indicate why. Is this a bug? What else could have caused it? Which one is correct, or are both of them fine?    "It would take the average person 10 days to read this novel"    Or    "It would take an average person 10 days to read this novel" I have a realm with a few of my friends and i want to play the creeper primed sound at him but i am afraid he will see the command and ignore it  Im using: /playsound minecraft:entity.creeper.primed block  Version: 1.14.2 I have this annoying problem in Gmail. Spammers are by-passing the Gmail spam filters and are so clever that I am not able to create a manual filter of my own to block them. They are sending me junk mails from e-mail IDs of the form:  Jewelskart@greatestjewels.in via watchstore.cleanmail.in  Shoppingkart@shoppers.in via watchstore.cleanmail.in   In general,  something@somethingelse.in via watchstore.cleanmail.in   Now, I cant set a filter for each and every mail as they are from different IDs. The common part is the via address which is watchstore.cleanmail.in. But when I try creating a filter with watchstore.cleanmail.in in From field, Gmail doesn't list these emails. In short, the filter is not able to detect via addresses.  Report Spam/Unsubscribe options aren't working.  How can I get rid of these annoying spammers? In "", Mark Lutz mentions "mixins". I'm from a C/C++/C# background and I have not heard the term before. What is a mixin?   Reading between the lines of  (which I've linked to because it's quite long), I'm presuming it's a case of using multiple inheritance to extend a class as opposed to 'proper' subclassing. Is this right?   Why would I want to do that rather than put the new functionality into a subclass? For that matter, why would a mixin/multiple inheritance approach be better than using composition?  What separates a mixin from multiple inheritance? Is it just a matter of semantics? Using property() on classmethods I have a class with two class methods (using the classmethod() function) for getting and setting what is essentially a static variable.  I tried to use the property() function with these, but it results in an error.  I was able to reproduce the error with the following in the interpreter: class Foo(object):     _var = 5     @classmethod     def getvar(cls):         return cls._var     @classmethod     def setvar(cls, value):         cls._var = value     var = property(getvar, setvar)  I can demonstrate the class methods, but they don't work as properties: &gt;&gt;&gt; f = Foo() &gt;&gt;&gt; f.getvar() 5 &gt;&gt;&gt; f.setvar(4) &gt;&gt;&gt; f.getvar() 4 &gt;&gt;&gt; f.var Traceback (most recent call last):   File &quot;&lt;stdin&gt;&quot;, line 1, in ? TypeError: 'classmethod' object is not callable &gt;&gt;&gt; f.var=5 Traceback (most recent call last):   File &quot;&lt;stdin&gt;&quot;, line 1, in ? TypeError: 'classmethod' object is not callable  Is it possible to use the property() function with @classmethod decorated functions? How do I check an iOS device's battery health? Do greenhouse gasses make the world habitable? An ageing gent says he does not accept this statement:  It's a fact that greenhouse gases, predominantly water vapour, keep the Earth  from being hostile and cold; that CO2 albeit in trace quantities is also a  greenhouse gas and therefore helps keep the planet warm...   I know no more about why he rejects this statement - maybe it is that water vapour alone would do the job. The gent in question has a first class degree and a doctorate in physics.    Is there a debate within the physics community over this or am I misunderstanding? Adding Custom Menu "Run Script" Button Causes Duplicate Is there a way to use the Blender Text Editor for adding a custom menu and not get a duplicate every time I click on "Run Script" to test the menu? For example, in the text editor, load the template like so:  Template -> Python -> UI Menu  Then notice every time you press "Run Script" you get another menu in your main menu bar. How can I update my menu without getting a duplicate?  I tried simply commenting out register() but then new updates don't show up. Counting the Lotto number draws which contain consecutive numbers