It's common practice in C to use:  #define FOO() do { /* body */ } while (0)   While this is fine, it's also possible to do:  #define FOO() { /* body */ }((void)0)     {...}((void)0) has many of the same benefits: you can't accidentally merge logic, and a ; is required at the end of the line, so odd expressions like this don't go by un-noticed: FOO() else {...}.  The only difference I've noticed is it means you need to use braces in if-statements.  if (a)     FOO(); else     BAR();   Must be written as:  if (a) {     FOO(); } else {     BAR(); }   Other then this quirk, it seems to work well, preventing the same kinds of problems do/while method is typically used for.  Are there any significant differences between the 2 methods?  Said differently, if you see a code-base using {...}((void)0), are practical reasons to switch to using do{..}while(0), besides the one difference already noted?
In many C/C++ macros I'm seeing the code of the macro wrapped in what seems like a meaningless do while loop.  Here are examples.  #define FOO(X) do { f(X); g(X); } while (0) #define FOO(X) if (1) { f(X); g(X); } else   I can't see what the do while is doing.  Why not just write this without it?  #define FOO(X) f(X); g(X)
having bracket in front of an item What is the maximum number of Locations Discovered that one can achieve in Skyrim? How to remove lines included in one file from another file? I have two lists, a complete list and a partial list. I want a bash script that will search the complete list for any lines that are in the partial, if there are, they will be removed from the complete list. Can anyone help? To install the graphics driver I need to exit GUI / Gnome and go to the terminal. How can I do this in Ubuntu 18.04? Ctrl(STRG)+Alt+F1...F7 does not work, neither on the desktop, nor on the login screen... $a+1,a-1$ invertible for nilpotent element Given a ring $R$ (with unity), prove that if $a \in R$ is nilpotent, then $a+1,a-1$ are both invertible.   Suppose $a^n=0$. Then $1=1-a^n=(1-a)(1+a+\ldots+a^{n-1})$, so $1-a$ is invertible.  If $n$ is odd we can use $1+a^n=(1+a)(1-a+\ldots+a^{n-1})$.  But what if $n$ is even? Should you use a plural verb if you refer to a fraction? has the following ability:     Whenever a creature you control with a +1/+1 counter on it dies, return that card to the battlefield under your control at the beginning of the next end step.   I had a number of creatures on the battlefield, including Marchesa herself, with one or more +1/+1 counters on them when  was played, destroying each creature on the board.  When Marchesa and several other creatures would be killed simultaneously,   Does Marchesa's ability trigger for herself? Does Marchesa's ability trigger for the other creatures under my control with +1/+1 counters?   In attempting to resolve the issue, we tried to look things up, leading to , which cites Rule 603.6d as proving that Marchesa's ability should trigger both for herself and for each other creature with +1/+1 counters.  Unfortunately, none of us could actually understand Rule 603.6d, aside from this example:     Two creatures are on the battlefield along with an artifact that has the ability Whenever a creature dies, you gain 1 life. Someone plays a spell that destroys all artifacts, creatures, and enchantments. The artifacts ability triggers twice, even though the artifact goes to its owners graveyard at the same time as the creatures.   The example certainly seems analogous to me, but without understanding the actual rule, rather than just the example, we weren't too sure.  A complete answer has to not only answer the question, but back up that answer with citation and explanation of the official rules on the matter. How can you depend on test code from another module in Maven?    Example, I have 2 modules:   Base Main   I would like a test case in Main to extend a base test class in Base.  Is this possible?  Update: Found an , which involves creating a test jar. Have Google index different languages at the same URL instead of just the default (English) I have a multilingual PHP site. I have set English as the default language.  The language changes automatically according to the browser settings. If it is French, the site will be seen in French.  However in the Google search results, even if I have the browser in French, the English language appears in the results. How can I fix that?  To be clear I don't want to use subdomains or URLs like www.example.com/fr/. I would like it to work like Facebook. When defining a method on a class in Python, it looks something like this:  class MyClass(object):     def __init__(self, x, y):         self.x = x         self.y = y   But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "this" keyword without declaring it as an argument in the method prototype.    Was this an intentional language design decision in Python or are there some implementation details that require the passing of "self" as an argument? How to avoid overflow using \IEEEpubid on the first column? I am trying to write a journal paper using the IEEEtran.cls template.  My problem is that the Publication ID Mark overflows into my thanks section.  This is the bottom of the title page:    From the documentation of IEEEtran.cls we see that:    I included the command \IEEEpubidadjcol into the second column. This prevents the overflow in the second column as you can see in my previous image, but lets the first column run freely.  I tried including \IEEEpubidadjcol into the first column aswell, but that causes compilation errors.  Please, could you give me some hint on how to solve this problem without doing something illegal with respect to the IEEE modus operandi?  EDIT:  As the answer suggests, the problem can be solved using the \IEEEpubidadjcol command twice. When I tried this, I got an error:  Infinite glue shrinkage found in box being split   In spite of this error a correct pdf is produced. The error goes away when I do not include packages fixltx2e and dblfloatfix. Python function attributes - uses and abuses Not many are aware of this feature, but Python's functions (and methods) can have . Behold:  &gt;&gt;&gt; def foo(x): ...     pass ...      &gt;&gt;&gt; foo.score = 10 &gt;&gt;&gt; dir(foo) ['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__get__', '__getattribute__', '__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'func_closure', 'func_code', 'func_defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name', 'score'] &gt;&gt;&gt; foo.score 10 &gt;&gt;&gt; foo.score += 1 &gt;&gt;&gt; foo.score 11   What are the possible uses and abuses of this feature in Python ? One good use I'm aware of is 's usage of the docstring to associate a syntax rule with a method. But what about custom attributes ? Are there good reasons to use them ? Merging two incoming broadband lines for faster Internet We have a broadband line coming into our building which delivers around 8-10Mbps, which is okay but not great. Fiber is available in our area (30-100Mbps) but it's not available where we are just yet.   Is there some way we could connect two lines (which we would take from two different providers so we would have redundancy if one failed) and merge them into one signal which we could distribute?  Is there some sort of setup that can do this?  Of course we have the option of a leased line but for 12Mbps symmetrical upload/download we'd be looking at around £500 per month compared to £15 per month for normal or fiber broadband.  I made a small pseudo flow chat of the setup below: Why can't we use entanglement to defy Heisenberg's Uncertainty Principle? In principle, it is possible to entangle any property of two particles, including speed and momentum. Surely then, this could be used to defy the Uncertainty Principle, which states that the momentum and position of a particle cannot be together measured with accuracy, but the more accurate one gets, the less accurate the other becomes:  $$\Delta x\Delta p=\dfrac{\hbar}{2}.$$  If one was to set up an experiment where two particles are entangled, one could then measure the position of one particle with great accurary at the same time as measuring the momentum of the other particle with great accuracy, which would mean that, as the two particles are entangled, one would then know the momentum of the particle they measured the position of.  Therefore, the Uncertainty Principle would have been defied, as both momentum and position have been measured with a high accuracy.  However, this can't be true, as someone would have thought of this before.  So why wouldn't this work? I have inserted an image in my LaTeX document and the image always displays with the file path of the image directly above it.  How can I prevent this file path from displaying?  I am inserting the image like this:  \begin{figure} \centering     \includegraphics{C:/Users/Name/Pictures/image1.png} \caption{a caption} \label{fig:reference} \end{figure}   Here is a working example of document that produces this behaviour:  \documentclass{article}  \usepackage{graphicx} \begin{document} \begin{figure} \includegraphics{C:/Users/Name/Pictures/image 1.png}  \end{figure}  \end{document}   The image was inserted using the TeXnicCenter Insert>Picture function.  When I generate the pdf document, directly above any image (I have inserted multiple images using this technique) the file path displays above the image, in the case above it would show: "file\path\of\image", how can I prevent this from displaying? There should be a notification when a moderator reviews or looks at a post which you've flagged.  The notification could show the status (helpful, declined, disputed, or something else) of your flag.  Edit  The reason for doing this is so that you would be able to see when a post which you have flagged has received moderator attention, at which point you could go back to the post. This would be good, for instance, if:   you flagged a post for migration to another site; after migration occurs, you could answer the question, since  that only unanswered questions should get migrated you flagged a post for removal of spam or otherwise nonconstructive content, and the content removal has to be carried out in batches Removing nodes from an XmlDocument Define functions in structs What is difference between the different 'flavours' of neutrinos? I have an unusual problem with Chrome when I try to open PDFs. If I have already downloaded a PDF and try to download it again, I can open it by tapping its name; in the screenshot below, I could tap "pdf.pdf" to open the file.   The issue is that tapping this link actually opens RollerCoaster Tycoon Classic! If I choose to download again, Chrome redownloads and opens the PDF correctly, so it's not a huge issue, but still an inconvenience.  In Settings, it says that RollerCoaster Tycoon Classic has no defaults, and I am unable to change the "open supported links" setting.    How do I stop RollerCoaster Tycoon  trying to be a PDF reader?