When should I prefer @classmethod over a @staticmethod and vice versa? Note: this question is not about  &quot;How can I use @classmethod and @staticmethod?&quot; or &quot;What is the difference between @staticmethod and @classmethod?&quot;   In the following classes,  both @classmethod and @staticmethod can access a class attribute. neither of them can access instance attributes.  MyClass1.py class MyClass1:     __module_attr: str = &quot;initial text value&quot;      def __init__(self):         self.__instance_attr: str = &quot;instance text value&quot;      @classmethod     def cls_modify(cls):         cls.__module_attr = &quot;class text value&quot;      @staticmethod     def stat_display():         print(MyClass1.__module_attr)   if __name__ == '__main__':     my_obj = MyClass1()     my_obj.stat_display()     my_obj.cls_modify()     my_obj.stat_display()  MyClass2.py class MyClass2:     module_attr: str = &quot;initial text value&quot;      def __init__(self):         self.__instance_attr: str = &quot;instance text value&quot;      @classmethod     def cls_modify(cls):         cls.module_attr = &quot;class text value&quot;      @staticmethod     def stat_display():         print(MyClass2.module_attr)   if __name__ == '__main__':     my_obj = MyClass2()     my_obj.stat_display()     my_obj.cls_modify()     my_obj.stat_display()     print(my_obj.module_attr)     print(MyClass2.module_attr)  So, I can't see any advantage of one type over another. When should I prefer @classmethod over a @staticmethod and vice versa?
Difference between staticmethod and classmethod What is the difference between a function decorated with  and one decorated with ?
Should the network use thousands separators in numbers? I have just upgraded my system but it boots to Low Graphics mode by default. I have seen questions on how to solve this problem and they all suggest to run a couple of commands from a command-line interface.  But there isn't any command-line console by default in Low Graphics mode and hence, I cannot run those commands. And, the answers I saw to solve the problem doesn't explain this situation either.  How to switch to a command-line console in order to run the commands in Low Graphics mode? How to get all Perfect or Near-Perfect Matchings of a graph Are these intended activities legal to do in the USA under the VWP? I'm a British citizen traveling to the USA next month with an ESTA to see my fiancee. I'm traveling there to plan our wedding, talk about a location to get married, and probably finalise a date and a booking with my fiancee (US citizen). This is the primary reason for my trip to the USA. Am I allowed to do this as a tourist? I would like to know for when the CBP officer asks me if this thing is allowed.  Am I allowed to enter the USA, on a separate trip (probably later this year), for the sole purpose of marrying my fiancee, provided I can persuade the CBP officer I intend to leave at the end of my trip? My fiancee and I are moving to the UK next year. Show that the polynomial $X^5 + X^3 + \bar{1}$ in $(\mathbb{Z}/2\mathbb{Z}[X])$ is irreducible Show that the polynomial $X^5 + X^3 + \bar{1}$ in $(\mathbb{Z}/2\mathbb{Z})[X]$ is irreducible. (Hint: if it were reducible, it would either have a root or be of the form $g(X) \cdot h(x)$, where deg$g(X) = 2$ and deg$h(X) = 3$) Recall that $\bar{a}$ is shorthand for the coset $a + 2\mathbb{Z} \space $in$ \space (\mathbb{Z}/2\mathbb{Z})[X]$ (for any $a \in \mathbb{Z}$)  This question is worth $7$ marks out of a possible $75$, this is my solution..  $f(X) = X^5 + X^3 + \bar{1}$ is irreducible in $\mathbb{Z}/2\mathbb{Z}[X]$ iff it has no roots in $\mathbb{Z}/2\mathbb{Z}$. Since $f(\bar{0}) = \bar{1}$ and $f(\bar{1}) = \bar{1}$, it follows that $f(x)$ is irreducible in $\mathbb{Z}/2\mathbb{Z}[X]$.  Would this be a sufficient answer? am I missing something? Can I make a custom node from a group and have that available in other projects? I've found some neat combinations of nodes to create certain effects, so I'd like to make them a group and then have that node available on my list of available nodes, even when I reload the startup file. How would I do that? How to add greek polytonic with setxkbmap I want to add greek polytonic keyboard layout under Lubuntu (so in LXDE). I already realized there is no easy tool to do it with the graphic interface, so I need to use setxkbmap executing something the like of:  setxkbmap pl,gr   Now, how to make setxkbmap set the greek polytonic variant? How can the Next Generation's unfamiliarity with the Borg be explained after Archer's encounter? In  Starfleet learns about a culture that we (as audience) know as The Borg. According to TNG, the Federation doesn't seem to know anything about these beings when . Although Archer's crew doesn't learn the name of the Borg, it would be reasonable that the Federation would inherit the information about such a menacing enemy and it would also be reasonable to assume the crew of the Enterprise-D to be able to match their encounter with their databases' information.  Obviously, out-of-universe the explanation is that the scripts weren't written in chronological order, but how can the apparent obliviousness about the Borg be explained in-universe? Why does Sass change the format of my colors? How to change the monitor's refresh rate? How do I change the monitor's refresh rate in Oneiric?   There is no option to do it in the Displays dialog now. By default it's 60Hz, but I need 75Hz on my monitor.  In previous releases there used to be such an option in the Displays dialog.  Edit - Half baked solution  The best I could do so far was:  xrandr -s 1280x1024 -r 75   This is perfect, but my problem is that it isn't permanent. It defaults back to 60 Hz after logging out and back in.  Perhaps this should go into some script and added to startup? I just don't know how to do that. What is the plural of "cottage tariff"? Repeating “will” for two verbs with “and” How to Silence the read command The read command is useful when reading data from the user . I am trying to read a number from 1-5 from the user. How can I make it so the input of the user does not show up in the log Does a character with 10 Constitution only need to eat every 4 days? According to the food rules,     A character can go without food for a number of days   equal to 3 + his or her Constitution modifier (minimum   1). At the end of each day beyond that limit, a character   automatically suffers one level of exhaustion.   A normal day of eating resets the count of days   without food to zero.   According to this, a character with a Constitution modifier of 0 can eat normally every 4th day*, and get no penalties from hunger despite only eating twice a week. This seems a tad ridiculous, and I'm wondering if there are other rules that I'm missing that make it a bad idea to eat less often like this, or if eating every 4th day is a totally fine thing to do, by the rules.  * They can get away with four days, because they'll only get the exhaustion penalty if they don't eat by the end of the fourth. This is even assuming the 'minimum 1' doesn't apply to the con mod portion. After creating some hi-poly model, i'm always creating low-poly model by approximating that hi-poly mesh with triangle-by-triangle LP mesh - with snap to face mode turned on.   So the process looks like CTRL + RMB (x times), and hitting F on keyboard, so the new face was made.  Then I'm using this low poly model to texture baking, mainly for gamedev purposes.  This method is very time consuming, so how to make retopology process easier and quicker? How is Mono magical? I'm learning C#, so I made a little C# program that says Hello, World!, then compiled it with mono-csc and ran it with mono:  $ mono-csc Hello.cs $ mono Hello.exe Hello, World!   I noticed that when I hit TAB in bash, Hello.exe was marked executable. Indeed, it runs by just a shell loading the filename!   Hello.exe is not an ELF file with a funny file extension:  $ readelf -a Hello.exe readelf: Error: Not an ELF file - it has the wrong magic bytes at the start $ xxd Hello.exe | head -n1 00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000  MZ..............   MZ means it's a Microsoft Windows statically linked executable. Drop it onto a Windows box, and it will (should) run.  I have wine installed, but wine, being a compatibility layer for Windows apps, takes about 5x as long to run Hello.exe as mono and executing it directly do, so it's not wine that runs it.  I'm assuming there's some mono kernel module installed with mono that intercepts the exec syscall/s, or catches binaries that begin with 4D 5A, but lsmod | grep mono and friends return an error.   What's going on here, and how does the kernel know that this executable is special?    Just for proof it's not my shell working magic, I used  (aka sh) to run it and it still runs natively.    Here's the program in full, since a commenter was curious:  using System;  class Hello {   /// &lt;summary&gt;   ///   The main entry point for the application   /// &lt;/summary&gt;   [STAThread]   public static void Main(string[] args) {     System.Console.Write("Hello, World!\n");   } } Large braces for specifying values of variables by condition Alien invasion movie, giant robot aliens with long legs capturing people How to use a file in a jar as javax.net.ssl.keystore? I'm trying to do something like   URL clientks = com.messaging.SubscriptionManager.class.getResource( "client.ks" ); String path = clientks.toURI().getPath(); System.setProperty( "javax.net.ssl.keyStore", path);   Where client.ks is a file stored in com/messaging in the jar file that I'm running.  The thing that reads the javax.net.ssl.keyStore is expecting a path to the client.ks file which is in the jar. I'd rather not extract the file and put in on the client's machine if possible. So is it possible to reference a file in a jar?  This doesn't work as getPath() returns null. Is there another way to do this? Resize multiple layers around their respective anchor points