I just discovered something really surprising. I can compile a simple C# hello world on my windows computer using csc (from Visual Studio), copy the resulting exe file to my Linux computer, and execute it with mono helloworld.exe. So far, everything makes sense to me: according to , on Windows, helloworld.exe is basically just a trick that ends up starting the C# runtime, and the CIL bytecode is just read from some data section later on in the exe file. Likewise, I imagine that, on Linux, doing mono helloworld.exe just starts the C# runtime and directly reads the bytecode without bothering with the exe trickery. For posterity, here is the source, which I got from : //--------------------------------------------- // FirstProgram.cs (c) 2006 by Charles Petzold //--------------------------------------------- class FirstProgram {     public static void Main()     {         System.Console.WriteLine(&quot;Hello, Microsoft .NET Framework!&quot;);     } }  But here's where things get interesting: on Linux (uname -r on my machine gives 4.14.188-1-MANJARO) I can simply do ./helloworld.exe and it works! I started doing some sleuthing, and here are the first few lines from running strace ./helloworld.exe: execve(&quot;./hw.exe&quot;, [&quot;./hw.exe&quot;], 0x7fffae8e6070 /* 61 vars */) = 0 [ Process PID=3381 runs in 32 bit mode. ] brk(NULL)                               = 0x7eedb000 arch_prctl(0x3001 /* ARCH_??? */, 0xffb19948) = -1 EINVAL (Invalid argument) readlink(&quot;/proc/self/exe&quot;, &quot;/usr/bin/wine&quot;, 4096) = 13 mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7faa000 access(&quot;/etc/ld.so.preload&quot;, R_OK)      = -1 ENOENT (No such file or directory) openat(AT_FDCWD, &quot;/usr/bin/../lib32/tls/i686/sse2/libwine.so.1&quot;, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat64(&quot;/usr/bin/../lib32/tls/i686/sse2&quot;, 0xffb18e00) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, &quot;/usr/bin/../lib32/tls/i686/libwine.so.1&quot;, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat64(&quot;/usr/bin/../lib32/tls/i686&quot;, 0xffb18e00) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, &quot;/usr/bin/../lib32/tls/sse2/libwine.so.1&quot;, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat64(&quot;/usr/bin/../lib32/tls/sse2&quot;, 0xffb18e00) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, &quot;/usr/bin/../lib32/tls/libwine.so.1&quot;, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat64(&quot;/usr/bin/../lib32/tls&quot;, 0xffb18e00) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, &quot;/usr/bin/../lib32/i686/sse2/libwine.so.1&quot;, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat64(&quot;/usr/bin/../lib32/i686/sse2&quot;, 0xffb18e00) = -1 ENOENT (No such file or directory)  I would have expected some error saying &quot;this file is not a valid executable&quot;, since I only expect the Linux program loader to understand ELF files instead of Windows's PE format. Instead, it seems that somehow the system is smart enough to start looking for wine (in the strace output, you can see it start to look for wine libraries, and because I've installed wine on my Linux machine, it does eventually find them later on). So what's going on? Is the execve call smart enough to try using wine if it detects a PE file, or is this something that bash is doing? Or is it something else entirely different?
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");   } }
What's an idiom for doing something in an unnecessarily complicated way? For an example, I'll quote C.S. Lewis' The Voyage of the Dawn Treader:     One day the cat got into the dairy and twenty of them were at work moving all the milk out; no one thought of moving the cat.   Is there an idiom for this type of situation? Regarding the sum $\sum_{p \ \text{prime}} \sin p$ I'm very confident that  $$\sum_{p \ \text{prime}} \sin p $$  diverges. Of course, it suffices to show that there are arbitrarily large primes which are not in the set $\bigcup_{n \geq 1} (\pi n - \epsilon, \pi n + \epsilon)$ for sufficiently small $\epsilon$. More strongly, it seems that $\sin p$ for prime $p$ is dense in $[-1,1]$.   This problem doesn't seem that hard though. Here's something that (to me) seems harder.      If $p_n$ is the nth prime, what is $$\limsup_{n \to +\infty} \sum_{p \ \text{prime} \leq p_n} \sin p?$$   What is $$\sup_{n \in \mathbb{N}} \sum_{p \ \text{prime} \leq p_n} \sin p? $$   Of course, we can ask analogous questions for $\inf$.   I'm happy with partial answers or ideas. For example, merely an upper bound. I am taking a course in Differential Topology right now, but I know of another Subject called "Riemannian Geometry" which studies Riemannian Manifolds. The definition of a real smooth manifold and a Riemannian Manifold are very similar except for the detail that makes them Riemannian (having a inner product on the tangent space of every element which varies smoothly with respect to this element of the R. Manifold).  So my question is: is there any example of a Smooth Manifold that is NOT a Riemannian Manifold?  Thanks. Is there a specific term for the association of certain verb(s) with certain nouns (as direct objects)? Or vice versa. Or perhaps a name for the pair itself?  For example:   hold an opinion make a complaint offer an apology   Also, where might I find a list of such pairs?    EDIT: I chose my title wording randomly. I have no idea whether 'cognate verb' is the correct term for these things. However, I've just found out that 'cognate objects' are a defined class in linguistics, so perhaps my choice of words was inappropriate. I'm going to leave the title as it is, anyway. Why does $k/m=\omega^2$ for harmonic motion? Can anyone please give me a proof for $k/m=w^2$ in simple harmonic motion?  I have tried energy conservation and Newton's laws as follows :  In the case of a mass-spring system,  $$F=ma =-kx\\ F=ma = mr\omega^2 $$  hence   $$\frac km  = \omega^2$$  Or   $$\frac12 mv^2 = \frac12kx^2$$  $$\frac km  =  \frac{V^2}{x^2}   =   \omega^2$$  therefore $k/m  =  \omega^2$  Are these valid and correct? I have been stuck in this for the  entire day. "Those who qualify will be awarded a certificate" or "those who qualify will be awarded certificates"? Probability of a player winning before another Given a 7 sided dice, 2 players roll it independantly simultaneously and when a player rolls a '6' he gets a prize.  What is the probability of the first player getting a prize before the second?  So my solution is to sum over all the turns j in which player 1 could win, and make the second player lose all these turns:  $$P(A) = \sum_{i=1}^{\infty}(6/7)^{j-1}*(1/7)*(6/7)^j = 0.461$$ My question is if my solution is correct, and if so, why is the probability so low? It seems to me that either player 1 wins before the 2nd or the other way around, and the probability of them playing forever is 0, so it should be 0.5? How do I take the limit as $n$ goes to $\infty$ of $\frac{\sqrt{n}}{\log(n)}$? How do take this limit:  $$ \lim_{n\to\infty} \frac{\sqrt{n}}{\log(n)}$$  I have a feeling that it is infinity, but I'm not sure how to prove it. Should I use L'Hopitals Rule? Is taking the CUA (certified Usability analyst) certification worth it? I see a lot of people taking this  nowadays and I wonder if its actually worth it and how is it received by the industry and does it really help in bringing you up to speed with UX and usability best practices. Can anyone who has taken the exam before provide inputs on its benefits and also its cons if any.  I did see the question  and David's answer did mention that he found it useful but I would like to get more context in what sense people might find it useful and how it could potentially supplement or enhance a career. Does anyone know how to find the radius of convergence of the series $\sum\ z^{n!}$, where $z$ is a complex number?  I tried to use the definition: $$\frac{1}{R}=\limsup\left|\frac{a_{n+1}}{a_{n}}\right|$$ but I wasn't successful. Why does the default Object.toString() include the hashcode? How to know if my GPU supports CUDA? How can I know from the terminal or something whether my hardware supports CUDA? trigger AccountReplicate on Account (after delete, after insert, after update) {     if ( trigger.isInsert ) {         for ( Account acc : trigger.new ) {             AccountOne__c ac = new AccountOne__c();             ac.Fax__c = acc.Fax;             ac.Phone__c = acc.Phone;             ac.Name =acc.Name;             insert ac;         }     }      if ( trigger.isUpdate ) {         integer  i = 0;         list&lt;AccountOne__c&gt; a2 = new list&lt;AccountOne__c&gt;([SELECT Id                                                         FROM AccountOne__c                                                         WHERE Name =: trigger.old[i].Name ]);         for ( AccountOne__c c1 : a2 ) {             c1.Name = trigger.new[i].name;             c1.Fax__C = trigger.new[i].Fax;             c1.Phone__C = trigger.new[i].Phone;             i++;         }         update a2;     } }   I tried bulk trigger for the update operation, but it's not working can anyone help me? vim-clang-format: clang-format is not found Is it OK for OSB3 boards to get wet during construction? As an online shopper, I regularly use Amazon to purchase lots of stuff.  When I reconcile my credit card spending, I use Mail.app to search all mailboxes for specific dollar figures (e.g. command-option F, then type 24.95). Prior to Big Sur, finding dollar figures in Mail.app worked perfectly, whether the email messages resided &quot;On My Mac&quot; or on iCloud.  However, since Big Sur, doing a global Mail.app search for numeric strings, especially with a decimal point, doesn't work reliably. For example, I'll do a global search in Mail.app for 65.88 and I'll get one result from a locally archived message from years ago, however a very recent message in my InBox containing that figure is not found.  When I do a single message search (command-F) looking for 65.88, the value IS found. Unsurprisingly, using Spotlight delivers the exact same results. Using mdutil, I've manually erased and rebuilt the Spotlight index, rebuilt my Mail.app mailboxes, deleted all ~/Library/Mail/V8/MailData/Envelope* files to force the Mail.app to re-import everything, and reinstalled Big Sur.  I've also confirmed all my Spotlight settings to assure that Mail and Messages are included in searches, and that the volume where my mail resides is not excluded.  Nothing worked. I should note that I am using one SSD for macOS, and a separate SSD for my Home directory (c/o &quot;Advanced Options&quot; under Users &amp; Groups).  I've had this setup well before Big Sur, again, without any issues. Interestingly, I tried using the Spark email app, which DID successfully find dollar figures without any issue.  I suspect that Spark is not relying on Spotlight to obtain search results, and that's why it works.  (I would use Spark, however it doesn't support local mailboxes.) I've already sent Apple a report using the Feedback Assistant, and I can only hope something will get fixed. Can anyone else confirm this issue with Mail.app on Big Sur?  Any ideas on what else I can do? Punctuation of direct speech, edge cases I recently learned that I have developed a consistent, but entirely wrong approach to punctuating direct speech in fiction. I am in the unenviable position of trying to relearn.  Previously I wrote such things as:     "I'm done." She said.   when the quoted speech was definitely, absolutely the end of a sentence. So now I know I need.     "I'm done," she said.   This follows the rule that a period is only allowed when the end of the spoken sentence is also the end of the sentence in the narrative. For example:     "I'm done." She slammed the door on the way out.   So, it now looks odd to me when there are multiple sentences in the speech:     "I can't take her. I'm done," she said.   Can you reassure me that is correct, or give the correct form? Please don't suggest rewriting the sentence to put 'she said' in the middle - I'm aware of that: I'm specifically asking about the punctuation rules.  The other odd case is speech ending with an ellipsis. Do sentence terminating ellipses (four periods normally) become:     "I can't take her. You know, ...," she said, nodding towards Jane.   If so, are non-terminating ellipses dealt with the same way?     "I can't take ...," she nodded towards Jane, "any more!"   or can non-terminating ellipses be used unadorned?     "I can't take ..." she nodded towards Jane, "any more!"   I'd be very grateful if you could point me at references as well as answers. For the record I am a British writer writing for both British and US publication, so any variation is also interesting to me! Normalization of basis vectors with a continuous index? I have an infinite basis which associates with each point, $x$, on the $x$-axis, a basis vector $|x\rangle$ such that the matrix of $|x\rangle$ is full of zeroes and a one by the $x^{\mathrm{th}}$ element. The book on Quantum Mechanics by Shankar says that the inner product between a basis vector and itself is not one, why not? Why can't these basis vectors be normalized to one, only to the ? Is it grammatical to omit the subject from "I did my work"? Why isn't Harry Potter punished for using magic outside of Hogwarts in Prisoner of Azkaban?