How can I inject an oscillator output into the RF input to my radio?

Question: I have a Bodnar GPS disciplined oscillator, and I would like to inject its output into the antenna input to my HF rig. This will allow me to compare the frequency of received unknown signals to the highly accurate Bodnar signal. There are a couple of problems here. First, the Bodnar output is far more powerful than the antenna input and so must be attenuated. Second, simply joining the two wires doesn't seem appropriate because at the very least it will cause an impedance mismatch. I'm only interested in receiving in the rig, not transmitting. How would I go about doing this?
Comment: Is this Bodnar device connected to a computer (USB?) as well? I would verify that while connected, the receiver's noise floor doesn't increase...a computer is a noisy device. Noise coupling from computer/Bodnar to receiver might benefit by having no common ground connection. If you're only interested in HF, then your attenuator might be designed for *very great* attenuation below 3MHz and also above 30 MHz., while more modest attenuation over the HF range.
Comment: @glen_geek It's usually not, you only program it via one; see [product page](http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=107&products_id=301); I have too much equipment I'm not using anyway, but these have been high on my list of want-to-haves.
Comment: @MarcusMüller I have a LeoNTP and I quite enjoy it. Only one output (not programmable, 10MHz) but that's sufficient for my radio stuff, plus it's an NTP server, and a UTC clock right where I need it in the shack. Worth the price for its sheer set-and-forget reliability.
Answer: HF receivers and antennas are usually sensitive enough to receive signals when light bulbs are used as transmit antennas, even if attached to RF sources of around 10 to 20 dBm (typical digital outputs).  Instead of a light bulb, you can attach a generic 50 Ohm dummy load to the output of your signal generator.  If the dummy load isn't too far from the receiver or its antenna, the receiver might pick up the signal generator signal as well as signals off of the antenna, allowing you to compare their frequencies.  This "air gap" connection both attenuates the digital signal, and reduces the possibility of ground loops or other DC offsets and low frequency AC noise getting coupled into your receiver.
Comment: This worked just fine. Nice, simple solution!
Answer: First, to get this off my chest: The most "proper" way to be able to measure frequencies is of course to use an oscillator derived through ratio-guaranteeing ways from the GPS clock. That way, what your HF gear says is 30.0001 MHz is indeed 30.0001 MHz +- GPS receiver frequency error. Now, this requires a radio with a reference oscillator input that internally uses some locked-ratio synthesizer (e.g., most likely, rational or fractional-N synthesizers and/or DSP synthesis of the local oscillator). I have no idea whether that is a common feature on HF rigs. Maybe feeding in an LO directly is an option on your rig? If so, do that! Your Bodnar GPS device can generate LOs  between 400 Hz and a couple 100 MHz.
Now, you're right:

First, the Bodnar output is far more powerful than the antenna input and so must be attenuated.

Luckily, SMA screw-in-line attenuators are cheap, and if you just need attenuation, and not precise attenuation, can be bought used / cheap.

Second, simply joining the two wires doesn't seem appropriate because at the very least it will cause an impedance mismatch.

Right, and you'd also be emitting your reference clock from your antenna!
So, honestly, as the simplest method, I'd probably use a coax / RF relay, to quickly switch between clock and antenna input.
Alternatively, you need a directive coupler, which isolates the antenna port from the oscillator port, but connects both to your rig's input. The Wilkinson Divider is probably the design of choice on HF:

Wilkinson power divider. Source: wikipedia page on the topic, image in public domain
You'll probably need to modify it, though! Say, in the above picture, your rig is at P1, your antenna at P2 and your clock source at P3. We know that fields in transmission lines superimpose linearly, so we can look at the different signals in isolation first and then add up our results.
Let's assume clock source and antenna reception are on the same frequency, which has wavelength $\lambda$. Look at the clock signal fed in from S3: it has to travel half a wavelength to get to P2. Which means the exact opposite phase arrives at P3 compared to P2! "Opposite phase" just means "negative amplitude"; and in other words, the voltage between P3 and P2 is always twice the voltage of P3 in itself; so, to match a load to terminate that pair, you need twice the wave impedance. Lo and behold: that's what $2\cdot Z_0$ is. So, at that port P2, the currents and E-fields from P3 coming through the termination resistor completely cancel with the half-a-wavelength-delayed version travelling around the ring.
For symmetry reasons, the same happens to antenna-originating (i.e., coming in from P2) signals at P3. However, at P1, both of these signals just add up. For the impedance matching to work, you need that ring to be $\sqrt{2}$ the impedance of the lines going to your rig, coming from the antenna and the oscillator source. Luckily, 75Ω line is a thing, and matching 50Ω to 75/$\sqrt 2$ Ω = 53 Ω at 10 to 30 MHz takes only little effort (if you can't live with the mismatch, which reduces the isolation).
One thing, though: As you can see, the cancellation here works because the wavelengths of the signals. They don't have to be identical – all that needs to happen is that the ring's circumference is an odd multiple of half the wavelength of each. So, you need to find the least common odd multiple of both half-wavelengths.
This becomes impossible to do when these frequencies change – sure, a 1 ‰ change in frequency (say, observing the band from 30 MHz - 30 kHz to 30 MHz + 30 kHz) will only slightly affect isolation, but it will. Because the radio signal is the weaker one, and there's also a lot of attenuation on P3 to "swallow" reflections, it's more important that the ring lenght is a perfect odd multiple of the GPS oscillator's half-wavelength. So: keep that constant, otherwise you'll be emitting a nice clean reference tone on HF, and I don't think your ham neighbors want you to provide a frequency standard on the ham bands!
Another corollary of this is that you must not have even multiples of the fundamental frequency of your reference oscillator. But guess what: Your Bodnar GPS outputs a square wave; a square wave luckily is composed of only odd harmonics,
$$s(t) = \frac{4}{\pi} \sum_{\ell=1}^\infty \frac{\sin\left(2\pi(2\ell - 1)ft\right)}{2\ell - 1}.$$
Since you still don't want to have high odd multiples (and even multiples, due to physics forbidding any square wave to be perfectly square) leaking around your system, you'd want to not only keep your GPS frequency fixed, but also have a good low-pass filter that filters out anything above the fundamental frequency (i.e., the frequency you want to compare to). The good thing is: this is relatively low-frequency, low power, and hence, a simple RC low pass filter with a a cutoff frequency slightly above your desired frequency can do that. As a bonus, you can design that filter to "as a byproduct" match 50Ω to 53Ω!
Comment: A lot of good information in this answer. Thanks!
Comment: You're welcome! I was afraid I might be overloading you with information. If anything remains unclear, don't hesitate to ask for clarification, here, or even open up a new question post :)
Answer: The really simple option: make a coil out of a few turns of wire and connect it to the coax with the 10MHz, then lay the coil right on top of your radio's case. I bet you'll get enough signal leaking into the radio to serve as a marker, without the danger of overloading the radio, blowing up the Bodnar GPSDO, or radiating any noticeable amount of power out the antenna.
Feel free to experiment with the specs of the coil, but a starting point might be 4 turns of the thinnest insulated/enameled wire you have on hand, in a loop with a diameter of 5cm or so, and the turns laid right on each other (negligible "length"/"thickness" to the coil). You can either strip a piece of coax and connect it to the loop directly, or use one of those cheap ubiquitous BNC to binding-post adapters.
Comment: I got the Bodnar to inject into the rig input just by turning it on, but if that hadn't worked, doing the connection inductively as you suggest would be my next approach.
Answer: What you need is a crude splitter (or combiner, same thing) with a very unequal ratio.
I suggest something like this:

simulate this circuit – Schematic created using CircuitLab
Here the signal generator voltage is attenuated by about 100 x (40 dB) and the antenna signal is not attenuated at all. Normally a splitter would have resistors in all the paths, to maintain 50 ohms everywhere, but in this high ratio case you can easily work out that the matching is not compromised much by the parallel connection of the two paths. An equal fraction of the reference signal will also leak out of the antenna, but at these levels it should not matter.
You might find that 40 dB is not enough - in that case you will probably need to add SMA attenuators to the reference signal source, rather than increasing the value of the 5 k - the capacitive coupling in the board will leak at the -40 dB level anyway. It might not matter too much if the GPSDO signal is a lot stronger than the signal on the air, the AGC will adjust the volume. There's even a small benefit in that you won't have to switch, just let the reference tone dominate, when it's on.
Construction can be as messy as you like, but being careful with the ground will improve the isolation. Here is an example of a low pass filter I built recently - plain copper-clad PCB, copper tape and a sharp knife. You could adapt this to have three SMA connectors.
.
You could also buy a small RF splitter / mixer board on ebay and modify it to build the combiner you need:

Finally you could buy a real coupler with as large a ratio as possible, and add attenuation to the reference signal path. (These are from mini-circuits):
  and one of these
As has been mentioned, to measure frequency you might do better to lock the rig to the GPSDO and then measure the audio frequency of the received signal. Leo Bodnar sells coupling devices for some radios, or you may be able to inject the clock into the master oscillator somehow.
You could switch between reference and unknown signal, adjusting the GPSDO until it's close, and then use a smartphone app to measure the audio frequency of the two tones. This will be more accurate than your ear.
For reference, the amateur satellite hunters routinely measure the frequency of X-band (8 GHz) signals from deep space, to an accuracy of a few Hz, using a LeoBodnar GPSDO as a clock source for an Ettus SDR.
Comment: I definitely learned a few things from your answer. Thanks.


What portal do the other goblins have a chance to open/do they open a portal?

Question: I already got to the weird land that Rainbow Goblins and I got to The Vault, but what does the other Goblins open portal to? Or do they open one?
Btw I'm talking about these guys:
(Image courtesy of Diablo 3 Blog)
Answer: They have a small chance of opening a portal to The Vault.
The red one is a Blood Thief, he drops Blood Shards.
The green one is an Odious Collector, he drops Crafting Materials.
The white on is a Gem Hoarder, he drops Gems.
Answer: As mentioned on diablowiki (see Through the Portal), all types of treasure goblins except rainbow goblins have a change to open a portal to the vault.

Goblins not in a Rift will sometimes leave a golden portal behind when they die, granting players in the game access to Greed's Domain, a treasure level full of gold and gems. This portal to The Vault occurs randomly; it is not affected by allowing a Treasure Goblin to live longer, or trying to kill a Goblin just before it escapes through the portal it opens during the combat.
Rainbow Goblins are a special type of Treasure Goblin that may leave open a rainbow portal that takes players to a bonus area called Whimsydale, which is identical in size and layout to the rainbow-themed Whimsyshire easter egg level. Whimsyshire vs. Whimsydale are not the same level -- players who enter this portal and Whimsyshire the normal way in the same game will clear out two different areas -- but the monsters found there and the rewards earned are effectively identical.
As of Patch 2.1.1, the new types of Goblins, the Blood Thief, Odious Collector, Gem Hoarder, and Malevolent Tormentor, may also leave open a golden portal to The Vault just like a normal Treasure Goblin. The secret level is the same in all cases, and the portals opened by the new types of Goblins are the same golden color, though fans have suggested their portals should be palette shifted to match the color of the different goblin types.


Is it right about an example of bilinear map $e$?

Question: The equation for the elliptic curve is $y^{2} = x^{3} + x$ and is defined over the field $F_{q}$ for some prime $q\equiv 3 \pmod 4$, and set $q=307$. Choose random generator $g=[182, 240]$. My question is that how do I construct a bilinear map $e$ and compute $g_{1} = e(g, g)$?
Comment: I am currently writing a detailed answer, but using a different curve from yours.
Comment: $g$ has order $77$, this is probably not what you want.
Comment: In general, this curve is bad because the largest prime factor of the order of its group is $11$. You want a point of large prime order.
Comment: Yes, I know. I am just wondering how to construct a bilinear map e?
Comment: Okay, Could you please send me the detailed answer? many thanks.
Comment: I will post it here. ;)
Answer: The simplest construction that I know of is given in Section 6.9 of the book by Hoffstein, Pipher and Silverman (5.9 in the first edition). I also talk about it in Section 3.3 of this (but I do not claim that it matches the book's quality of exposition).
First, you need a prime $p$ with two properties:

You want $p\equiv 2\pmod 3$, this allows you to easily construct a supersingular curve over $\mathbf{F}_p$ (as $Y^2 = X^3 + b$ for any $b \ne 0$). Remember that a supersingular curve is one which has $p+1$ points.
You want $p+1$ to have a large prime factor, ideally $q = (p+1)/6$ should be prime. This allows you to pick a point of large prime order. In fact, it is best to first choose a prime $q$ of appropriate size, and then look for a suitable $p$.

For this example, I take $p = 587$ and $b = 1$. Then $q = (p+1)/6 = 137$ is prime, and the point $P = [332,103]$ has order $q$ on the curve $E$ with equation $Y^2 = X^3 + 1$ over $\mathbf{F}_p$. I note $E(K)$ the goup of points of $E$ with coordinates in $K$ ($K$ will be either $\mathbf{F}_p$ or $\mathbf{F}_{p^2}$.)
The basic tool is the Weil pairing, which I will note $e_q$. All you need to know about it is that it is a bilinear map from the group of $q$-torsion points of the curve (i.e., the group of points $P$ such that $qP = \infty$) to the group of $q$th roots of unity in $\mathbf{F}_p$ (i.e., the group of all $x\in \mathbf{F}_p$ such that $x^q = 1$). You can use many computer algebra systems to compute the Weil pairing, I use Pari/GP:
gp > p = 821;
gp > p%3
2
gp > isprime(p)
1
gp > q = (p+1)/6
137
gp > isprime(q)
1
gp > E = ellinit([0,1]*Mod(1,p));
gp > until(ellorder(E,P) == q, P = random(E));
gp > P
[Mod(332, 821), Mod(103, 821)]
gp > ellweilpairing(E,P,P,q)
Mod(1, 821)

However, the Weil pairing is not suitable as is for cryptographic purposes because it is also alternating, meaning that $e_q(P,P) = 1$ for all $P$, so we need to modify it. What we do is consider the curve as being defined over $\mathbf{F}_{p^2}$, and apply the Weil pairing in this curve. More precisely, it we let $\zeta$ be a primitive $3$rd root of unity in $\mathbf{F}_{p^2}$ (prove that it exists), then for any point $P = [x_P,y_P] \in E(\mathbf{F}_p)$, the point $P' = [\zeta\cdot x_P,y_P]$ is in $E(\mathbf{F}_{p^2})$. Moreover, if $qP = \infty$, then $qP' = \infty$ as well, which means that $P'$ can be an "argument" of $e_q$. Hence, finally, we define our "modified Weil pairing" $\hat{e}_q$ on the original curve (over $\mathbf{F}_p$) as follows: for a point $Q = kP$ (for some integer $k$), we let
$$\hat{e}_q(P,Q) = e_q(P,Q'),$$
where $e_q$ is the ordinary Weil pairing, but applied on the curve over $\mathbf{F}_{p^2}$. In practice:
gp > u = ffgen(p^2, u);
gp > until(z != 1, z = random(u)^((p^2-1)/3));
gp > E2 = ellinit([0,1],u);
gp > ellmodweilpairing(E,P,Q,q) = ellweilpairing(E2,P,[z*Q[1],Q[2]],q);
gp > ellmodweilpairing(E,P,P,q)
562*u + 172

We can see that this pairing is bilinear:
gp > Q = ellmul(E,P,99);
gp > ellmodweilpairing(E,P,P,q)*ellmodweilpairing(E,P,Q,q)
693*u + 108
gp > ellmodweilpairing(E,P,elladd(E,P,Q),q)
693*u + 108

Comment: Chapter 5.1 from [here](http://www.craigcostello.com.au/pairings/PairingsForBeginners.pdf) seems to give a simple example of the Weil pairing. I don't have the background to fully understand it, but maybe you could spell it out for the rest of us :)
Maybe it could be more interesting if I ask a new question regarding this?
Comment: +1, although it would be nice a brief explanation of how the Weil pairing is constructed, which was one of OP's questions.
Comment: I agree, but sadly I don't know any (and yes, this makes my answer not entirely satisfactory).


Industry Standards for Network Infrastructure Labeling

Question: Are there any current industry standards IEEE, ISO, ANSI.... available that state how a buildings physical infrastructure should be labeled at the rack and jack and how the documentation should be laid out? I know there is IEEE Std 200, but that is out of date, and I found a ASME standard for electrical stuff but I can't actually read it.
Answer: I don't know that there are industry standards, but there are plenty of options.  Some have been discussed here:
https://serverfault.com/questions/64259/what-is-the-most-effective-solution-you-used-to-label-cables
https://serverfault.com/questions/127454/whats-the-best-way-to-label-cables-in-a-data-center
I think the "standard" is Pick a labeling methodology for your site. Document it. Follow it. Kill anyone who deviates from it in a grisly and public way as an example to those who would break from the one true path of cable identification.
Comment: String the bodies up, using cables of the color that is documented to indicate heretics.
Answer: The standards you are looking for are the
TIA/EIA-568 Structured Cabling Standards
These standards determine everything from precise dimensions of peripherals to their physical properties to labeling criteria. It has various sub sections that deal with particular areas in a structural cabling topology like Horizontal cabling, vertical cabling etc.
Comment: Here are some links that you may find interesting

(http://www.mohawk-cable.com/support/ansi-tia-eia-606-a.html)

http://www.ense.be/PDF/2060.pdf
Comment: It does not deal exclusively with cables but all aspects of structured cabling, ie, patch panels, punchplates, connectors, cable trays etc etc. It also places emphasize on the size, color coding of labels to be used and labeling systems to be used for structured cabling. Various subsections of TIA/EIA 568 deals with all these aspects.
Comment: I see Wikipedia confirms that this standard includes definitions for all aspects of inside wiring. I'd love to read the actual standard, but, since the TIA are a bunch of jerks that charge for access, I'll award the bounty if someone can link to a reasonable interpretation of the standard. I found this PDF ( http://www.usfsp.edu/computing/documents/network_wiring_standards.pdf ), but it looks like a very limited interpretation.
Comment: Does the TIA standard include labeling? AFAIK it only deals with the cables themselves, not how the hell you figure out what they are a year later :)
Answer: It appears the most relevant standard is EIA/TIA 606-A. A summary of this standard can be seen here: www.flexcomm.com/library/606aguide.pdf
Since this standard isn't widely used/accepted, I'm awarding the bounty on this question to the highest rated answer.
Answer: I've seen even the largest companies get away with "Building-Switch-Card-Port" type labeling.
e.g. B1-S8-C3-P46
Which then patches over to your "Floor-Room" building wiring
e.g. F4-R253
Comment: This is a pretty standard scheme and usually works out well. Not sure if it's "standardized", but it probably should be...


Coordinates to Lat Long in Leaflet

Question: I'm here because I'm trying to create a GTA V map with Leafletjs API. In deed, I've got my tiles that are ready. But the aim is to put markers on the map by using GTA V in-game coordinates. To achieve it, I need to convert the coordinates to LatLong but after many researches, I can't find a solution.
Example :

Thanks in advance.
Comment: Maybe this could help you: http://stackoverflow.com/questions/10886406/leaflet-js-with-a-non-real-world-map-coordinates
Comment: A more recent answer: https://stackoverflow.com/questions/34638887/leaflet-custom-coordinates-on-image/34640343#34640343
Answer: Your coordinates are coming from different map projections. The Leaflet ones are most probably standard WGS 84 (SRID 4326). GTA V coordinates are obviously based on a different projection.
Coordinates can be transformed from one projection to anothers. But you need to know, which projection your coordinates are coming from, to do the math.
Here is an online converter provided with some common projections, and i tried your coordinates, but had no luck in coming close with these projections.
Comment: If you are downvoting, please leave a comment with a reason. I'm just trying to help.
Comment: First, it's 4326 and not 4236. Secondly, this does not address the OP's question. He knows the projection of the data (it's image coordinates in pixels for a game map) but this is not a real world projection and he won't find anything useful on the site you provide.
Comment: The answer is correct, don't know who would downvote it.
Comment: hmm wouldn't it work if you converted it to cartesian and then calculate the multiplier needed to convert between GTA V and map

e.g. multiplier = gtaXPosition / mapXPosition and then just do mapXPosition * multiplier to convert back to GTA V position

that would probably work if you wanted to do leaflet -> GTA V position and you knew the real in-game position
Comment: then just do gtaXPosition / multiplier to get leaflet map position or something like that
Answer: I tried this:
var latlng = new L.latLng(-43.1731, 6.6906);
var point = L.Projection.Mercator.project(latlng);
console.log(point);
// o.Point {x: 744794.1851014761, y: -5309112.129212381}

It is not close to your GTA V coordinates, but I'm not sure it were just for example.
Answer: You can use L.latlng function
http://leafletjs.com/reference.html#latlng
Comment: Thanks for the answer but it doesn't solve my problem, I already look in the docs. There is no method for it. It's more a math problem that I have to solve.

Coordinates to Lat Long in Leaflet


What is the difference between 'asm', '__asm' and '__asm__'?

Question: As far as I can tell, the only difference between __asm { ... }; and __asm__("..."); is that the first uses mov eax, var and the second uses movl %0, %%eax with :"=r" (var) at the end. What other differences are there? And what about just asm?
Comment: you should chose peter's answer, it's far superior.
Comment: @kennytm *_asm is a synonym for __asm*, according to here: https://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.120).aspx
Answer: There's a massive difference between MSVC inline asm and GNU C inline asm.  GCC syntax is designed for optimal output without wasted instructions, for wrapping a single instruction or something.  MSVC syntax is designed to be fairly simple, but AFAICT it's impossible to use without the latency and extra instructions of a round trip through memory for your inputs and outputs.
(MSVC __asm{ ... } syntax is also supported by clang -fasm-blocks, with one difference that MSVC supports leaving a value in EAX and falling off the end of a non-void function; clang -fasm-blocksdoesn't.  Presumably clang-cl doesn't either.)
If you're using inline asm for performance reasons, this makes MSVC inline asm only viable if you write a whole loop entirely in asm, not for wrapping short sequences in an inline function.  The example below (wrapping idiv with a function) is the kind of thing MSVC is bad at: ~8 extra store/load instructions.
MSVC inline asm (used by MSVC and probably icc, maybe also available in some commercial compilers):

looks at your asm to figure out which registers your code steps on.
can only transfer data via memory.  Data that was live in registers is stored by the compiler to prepare for your mov ecx, shift_count, for example.  So using a single asm instruction that the compiler won't generate for you involves a round-trip through memory on the way in and on the way out.
more beginner-friendly, but often impossible to avoid overhead getting data in/out.  Even besides the syntax limitations, the optimizer in current versions of MSVC isn't good at optimizing around inline asm blocks, either.

GNU C inline asm is not a good way to learn asm.  You have to understand asm very well so you can tell the compiler about your code.  And you have to understand what compilers need to know.  That answer also has links to other inline-asm guides and Q&As.  The x86 tag wiki has lots of good stuff for asm in general, but just links to that for GNU inline asm.  (The stuff in that answer is applicable to GNU inline asm on non-x86 platforms, too.)
GNU C inline asm syntax is used by gcc, clang, icc, and maybe some commercial compilers which implement GNU C:

You have to tell the compiler what you clobber.  Failure to do this will lead to breakage of surrounding code in non-obvious hard-to-debug ways.

Powerful but hard to read, learn, and use syntax for telling the compiler how to supply inputs, and where to find outputs.  e.g. "c" (shift_count) will get the compiler to put the shift_count variable into ecx before your inline asm runs.

extra clunky for large blocks of code, because the asm has to be inside a string constant.  So you typically need
  "insn   %[inputvar], %%reg\n\t"       // comment
  "insn2  %%reg, %[outputvar]\n\t"

very unforgiving / harder, but allows lower overhead esp. for wrapping single instructions.  (wrapping single instructions was the original design intent, which is why you have to specially tell the compiler about early clobbers to stop it from using the same register for an input and output if that's a problem.)

Example: full-width integer division (div)
On a 32bit CPU, dividing a 64bit integer by a 32bit integer, or doing a full-multiply (32x32->64), can benefit from inline asm.  gcc and clang don't take advantage of idiv for (int64_t)a / (int32_t)b, probably because the instruction faults if the result doesn't fit in a 32bit register.  So unlike this Q&A about getting quotient and remainder from one div, this is a use-case for inline asm.  (Unless there's a way to inform the compiler that the result will fit, so idiv won't fault.)
We'll use calling conventions that put some args in registers (with hi even in the right register), to show a situation that's closer to what you'd see when inlining a tiny function like this.

MSVC
Be careful with register-arg calling conventions when using inline-asm.  Apparently the inline-asm support is so badly designed/implemented that the compiler might not save/restore arg registers around the inline asm, if those args aren't used in the inline asm.  Thanks @RossRidge for pointing this out.
// MSVC.  Be careful with _vectorcall & inline-asm: see above
// we could return a struct, but that would complicate things
int _vectorcall div64(int hi, int lo, int divisor, int *premainder) {
    int quotient, tmp;
    __asm {
        mov   edx, hi;
        mov   eax, lo;
        idiv   divisor
        mov   quotient, eax
        mov   tmp, edx;
        // mov ecx, premainder   // Or this I guess?
        // mov   [ecx], edx
    }
    *premainder = tmp;
    return quotient;     // or omit the return with a value in eax
}

Update: apparently leaving a value in eax or edx:eax and then falling off the end of a non-void function (without a return) is supported, even when inlining.  I assume this works only if there's no code after the asm statement.  See Does __asm{}; return the value of eax?  This avoids the store/reloads for the output (at least for quotient), but we can't do anything about the inputs.  In a non-inline function with stack args, they will be in memory already, but in this use-case we're writing a tiny function that could usefully inline.

Compiled with MSVC 19.00.23026 /O2 on rextester (with a main() that finds the directory of the exe and dumps the compiler's asm output to stdout).
## My added comments use. ##
; ... define some symbolic constants for stack offsets of parameters
; 48   : int ABI div64(int hi, int lo, int divisor, int *premainder) {
    sub esp, 16                 ; 00000010H
    mov DWORD PTR _lo$[esp+16], edx      ## these symbolic constants match up with the names of the stack args and locals
    mov DWORD PTR _hi$[esp+16], ecx

    ## start of __asm {
    mov edx, DWORD PTR _hi$[esp+16]
    mov eax, DWORD PTR _lo$[esp+16]
    idiv    DWORD PTR _divisor$[esp+12]
    mov DWORD PTR _quotient$[esp+16], eax  ## store to a local temporary, not *premainder
    mov DWORD PTR _tmp$[esp+16], edx
    ## end of __asm block

    mov ecx, DWORD PTR _premainder$[esp+12]
    mov eax, DWORD PTR _tmp$[esp+16]
    mov DWORD PTR [ecx], eax               ## I guess we should have done this inside the inline asm so this would suck slightly less
    mov eax, DWORD PTR _quotient$[esp+16]  ## but this one is unavoidable
    add esp, 16                 ; 00000010H
    ret 8

There's a ton of extra mov instructions, and the compiler doesn't even come close to optimizing any of it away.  I thought maybe it would see and understand the mov tmp, edx inside the inline asm, and make that a store to premainder.  But that would require loading premainder from the stack into a register before the inline asm block, I guess.
This function is actually worse with _vectorcall than with the normal everything-on-the-stack ABI.  With two inputs in registers, it stores them to memory so the inline asm can load them from named variables.  If this were inlined, even more of the parameters could potentially be in the regs, and it would have to store them all, so the asm would have memory operands!  So unlike gcc, we don't gain much from inlining this.
Doing *premainder = tmp inside the asm block means more code written in asm, but does avoid the totally braindead store/load/store path for the remainder.  This reduces the instruction count by 2 total, down to 11 (not including the ret).
I'm trying to get the best possible code out of MSVC, not "use it wrong" and create a straw-man argument.  But AFAICT it's horrible for wrapping very short sequences.  Presumably there's an intrinsic function for 64/32 -> 32 division that allows the compiler to generate good code for this particular case, so the entire premise of using inline asm for this on MSVC could be a straw-man argument.  But it does show you that intrinsics are much better than inline asm for MSVC.

GNU C (gcc/clang/icc)
Gcc does even better than the output shown here when inlining div64, because it can typically arrange for the preceding code to generate the 64bit integer in edx:eax in the first place.
I can't get gcc to compile for the 32bit vectorcall ABI.  Clang can, but it sucks at inline asm with "rm" constraints (try it on the godbolt link: it bounces function arg through memory instead of using the register option in the constraint).  The 64bit MS calling convention is close to the 32bit vectorcall, with the first two params in edx, ecx.  The difference is that 2 more params go in regs before using the stack (and that the callee doesn't pop the args off the stack, which is what the ret 8 was about in the MSVC output.)
// GNU C
// change everything to int64_t to do 128b/64b -> 64b division
// MSVC doesn't do x86-64 inline asm, so we'll use 32bit to be comparable
int div64(int lo, int hi, int *premainder, int divisor) {
    int quotient, rem;
    asm ("idivl  %[divsrc]"
          : "=a" (quotient), "=d" (rem)    // a means eax,  d means edx
          : "d" (hi), "a" (lo),
            [divsrc] "rm" (divisor)        // Could have just used %0 instead of naming divsrc
            // note the "rm" to allow the src to be in a register or not, whatever gcc chooses.
            // "rmi" would also allow an immediate, but unlike adc, idiv doesn't have an immediate form
          : // no clobbers
        );
    *premainder = rem;
    return quotient;
}

compiled with gcc -m64 -O3 -mabi=ms -fverbose-asm.  With -m32 you just get 3 loads, idiv, and a store, as you can see from changing stuff in that godbolt link.
mov     eax, ecx  # lo, lo
idivl  r9d      # divisor
mov     DWORD PTR [r8], edx       # *premainder_7(D), rem
ret

For 32bit vectorcall, gcc would do something like
## Not real compiler output, but probably similar to what you'd get
mov     eax, ecx               # lo, lo
mov     ecx, [esp+12]          # premainder
idivl   [esp+16]               # divisor
mov     DWORD PTR [ecx], edx   # *premainder_7(D), rem
ret   8

MSVC uses 13 instructions (not including the ret), compared to gcc's 4.  With inlining, as I said, it potentially compiles to just one, while MSVC would still use probably 9.  (It won't need to reserve stack space or load premainder; I'm assuming it still has to store about 2 of the 3 inputs.  Then it reloads them inside the asm, runs idiv, stores two outputs, and reloads them outside the asm.  So that's 4 loads/stores for input, and another 4 for output.)
Comment: For what it's worth, [here's how I would write the function in inline asm for MSVC](http://pastebin.com/YJaN3zeH). At the bottom shows the disassembly. I compiled the function with `__stdcall`, but `__cdecl` works just as well. Don't use `__vectorcall` or `__fastcall`, they only pessimize inline asm. Notice that the output is pretty much identical to GCC's, except for the need to explicitly load the parameters from the stack into registers. That's the hard limitation of MSVC's inline asm, completely unavoidable and inevitably leads to sub-optimal code.
Comment: I'd say Microsoft's inline assembly is less forgiving. It was never very reliable and it was always a bit of crap shoot whether a new compiler version wouldn't break your code. Apparently it's also a huge maintenance nightmare for Microsoft, trying to ensure new compiler versions don't break existing code, and that's why they dropped support for it for their most recently supported architectures (IA-64, AMD64, ARM). In particular your MSVC example is dangerous, as it mixes a register based calling convention with inline assembly: https://msdn.microsoft.com/en-us/library/k1a8ss06.aspx.
Comment: @PeterCordes Yah, for your specific example it should work. The fact that the problem exists demonstrates just how crudely inline assembler is  implemented in Microsoft's compiler. I don't think the compiler even warns you that you're using a register that it needs for something else.
Comment: Note that this whole business *does* get inlined by the compiler, inline asm and all. [Here's an example of that, with a stub function that exercises it](http://pastebin.com/pTbfid3g). Again, the only horribleness is the way that parameters get passed *in* to the block. If you write it correctly, you can avoid all penalties for return values *out* of the block. Of course, the compiler doesn't parse the inline asm instructions, so it doesn't know enough to elide the setting of the remainder, even though the `Test` function never uses it. But I'm not sure that GCC does this, either.
Comment: Yes, totally supported and totally optimizable. Now, if you were to ask me to produce some documentation supporting this claim...I'd have to hunt around. There isn't something I can point to off the top of my head. Most of my knowledge comes from actually writing code, tweaking it, analyzing disassembly, and actually using it in projects that have extensive assertions for correctness validation. But I think the fact that it used to emit a warning but no longer does is compelling evidence that it's recognizing the idiom. Not hard to see how it could, since all calling conventions work this way.
Comment: @Ross: I assumed they dropped it for amd64 because it can't create good code, and vector intrinsics were good enough.  Thanks for the heads up.  Not that I ever would have recommended that anyone use MSVC inline asm for anything in the first place.
Comment: @Ross:  Hmm, from my reading of that link, my specific use is *not* dangerous, because both register parameters are inputs to the inline asm (so they get stored to the stack).  The general suggestion that this is a good example to modify into other code is dangerous, though.  IDK how the compiler can check what regs you use and not see it should save args / restore args that will be clobbered by the asm, or put them in regs the asm doesn't use.  "because a function has no way to tell which parameter is in which register" is nonsense.  Compilers have to know this to make code from C source...
Comment: Unfortunately, as far as I'm aware, there is no intrinsic that will do this operation. There is a nice intrinsic for [32-bit multiplication, producing a 64-bit result](https://msdn.microsoft.com/en-us/library/windows/desktop/aa383703.aspx), and a variety of other arithmetic and bit-shifting operations, but none for division. There is [`MulDiv`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa383718.aspx), but that's an API, not an intrinsic, and saddled with certain legacy behaviors for edge cases. MSVC supports a 64-bit int type for 32-bit builds, and it works sensibly for some...
Comment: ...operations, but multiply, divide, modulo, and shift are not among them. These always result in calls to CRT functions (`_allmul`, `_alldiv`, `_allrem`, `_allshl`, `_allshr`, and their unsigned equivalents). Worse, those CRT functions are not as efficient as I'd like, even though they're implemented in assembly. They're never inlined, no matter what (which is apparently fairly common; GCC and Clang don't generally inline their lib functions, either), so you can't possibly do worse by writing your own inline asm. Especially because it avoids a function call, and here, can be much simpler.
Comment: @CodyGray: Thanks for the clarification.  So falling off the bottom of a non-void function after inline asm leaves something in EAX is a supported idiom that MSVC can optimize around?  (ah, you [commented on that here](http://stackoverflow.com/questions/13661285/generating-cmov-instructions-using-microsoft-compilers/41144749?noredirect=1#comment69562768_41144749))  That does make it a lot less horrible than I thought.  I'll have to revise some of this answer.
Comment: @CodyGray: The thing that's weird for me is that it's "inline" asm, not necessarily "whole function body in asm".  So there's no way to take advantage of this without wrapping each block of inline asm in a separate inline function (which I'd probably want to do anyway, but still).  You couldn't write a second inline-asm block inside a function and use EAX as an input register, could you?  (Maybe you could, but it sounds like a terrible idea :P)  I guess supporting this makes sense as an optimization after they realize they didn't design any clean and efficient way to communicate results.
Comment: I think I mentioned this in another comment, but the thing to keep in mind is that this is a very old feature from Microsoft's (or perhaps Lattice's?) first C compilers, where it was primarily used to call BIOS interrupts and stuff like that. So it was "inline", and often was only one or two instructions rather than an entire block, but no one cared about optimization, or returning values, or whatever. They've entirely let it languish, and don't even support inline asm on 64-bit targets. Yes, I always use it in an inline fxn. Two inline asm blocks in a single function => bad results.
Answer: Which one you use depends on your compiler.  This isn't standard like the C language.
Comment: Uhm, yeah.  The whole point of those leading underbars is to make it clear that this is non-standard.
Comment: @AyberkÖzgür: OP wanted to know which one to use.  The answer is that he doesn't have a choice in the matter, he has to use the one his compiler supports.  You can't use GCC inline asm in Visual C++ and you can't use MSVC inline asm in gcc.
Comment: @StevenSudit no, the leading underscores mean "reserved", see https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier?focusedCommentId=88031790
Comment: @Sapphire_Brick: In particular *reserved for the use of the implementation*, which means that when you see them, you know that implementation-specific behavior is involved.
Comment: This answer should be a comment, it's not actually an answer
Comment: I think this is a concise answer.
Answer: asm vs __asm__ in GCC
asm does not work with -std=c99, you have two alternatives:

use __asm__
use -std=gnu99

More details: error: 'asm' undeclared (first use in this function)
__asm vs __asm__ in GCC
I could not find where __asm is documented (notably not mentioned at https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Alternate-Keywords.html#Alternate-Keywords ), but from the GCC 8.1 source they are exactly the same:
  { "__asm",        RID_ASM,    0 },
  { "__asm__",      RID_ASM,    0 },

so I would just use __asm__ which is documented.
Comment: The OP is asking about `__asm { ... };` (with braces, not parens), so it's definitely not GNU C inline asm.  Clang and MSVC support MSVC-style inline asm, but gcc doesn't.
Comment: @PeterCordes thanks for the info. Partly answering this here because of GCC tag, and partly because of the Google hit theory. Now looking at history the GCC tag was not added by the OP, but not by me either ;-)
Comment: @PeterCordes can you also add the appropriate microsoft compiler tag to the question in addition to `gcc`? I don't know which one it is thankfully :-)
Comment: visual-c++ is the tag for Microsoft's dialect of C++, implemented by MSVC.
Answer: With gcc compiler, it's not a big difference. asm or __asm or __asm__ are same, they just use to avoid conflict namespace purpose (there's user defined function that name asm, etc.)


Where do meteors usually spawn?

Question: On Terraria I mined a shadow orb thus getting a meteor. When I destroyed another shadow orb today I couldn't find the new meteor. The first time it was located in the Left ocean. Where could it be now ?
Comment: Did you destroyed the shadow orb did you get the message? you don't get a Meteor every time you destroy a Shadow Orb, i know from experience as before entering Hard Mode i was destroying all the shadow orbs to farm loot and after beating the Eater of Worlds like 5 times i only ever gotten like 3 meteor messages, however you will always be guaranteed one on the first orb you destroyed (theory is that the Eater of Worlds "lands" in your world on it)
Answer: They can land almost anywhere, but never within 25 blocks of a player, an NPC or a chest.

This event always occurs off-screen, so the player will only see a message and the resulting crash site, but never the impact itself.
[...]
Meteorites can land anywhere, including Floating Islands, inside of a Chasm, or the Dungeon. Meteorites can even land at the bottom of a body of water. The Meteorite replaces dozens of blocks deep with Meteorite in a crater pattern. -- Source
Answer: It could have landed on a floating island. They are usually high enough in the sky that you'd not even notice. If you've walked from ocean to ocean and didn't see a meteor AND got the message that the meteor has landed, try looking up ^^
Answer: Most commonly  if a section of the world is not discovered, the Meteor has a higher chance of landing there, if it did not... Sky Island would be your best bet. BEWARE! If it did land on a sky island most of it may get destroyed.

Where do meteors usually spawn?


Do I need a copy stand to digitize negatives with a Sony Mirrorless Camera

Question: I want to digitize negatives with a Sony mirrorless camera. Do I need a copy stand?
Comment: Someone is not liking the question or the answers and seems to have downvoted everything. It is true that the question is oddly formulated. It more practical to ask *What do I need to digitize negatives with a Sony mirrorless camera?' rather than assuming that a copy stand may be involved.
Answer: No. There are other ways. You can use a tablet or phone, light table, lens adapter, etc.  Google 'digitize negatives with digital camera` for options. Among top results you can see one that uses a tablet and another with a light table. Nikon makes a lens adapter for negatives too and it may fit some Sony lenses or you can use an adapter to fit a Nikon lens onto the Sony mirrorless.
Answer: Copy stands are for duplicating prints and documents, not film. While you can use a copy stand with macro lens and light box, using a slide copier is far easier and cheaper.
Except for the film carrier, capture with a slide copier is the same for slides and negatives. The images also need to be processed differently. For negatives, the orange mask needs to be neutralized and colors inverted.
See Using a 35mm Slide Copier with a Crop Sensor


What's is new in Mail app in Lion compared to Mail app in Leopard Snow?

Question: I find Mail app (in Leopard Snow) very limited for my needs. I need something like Thunderbird but before switching I just like to know what's is new in Mail app in Lion compared to Mail app in Leopard Snow.
Is it really any better?
Comment: Actually, this is not a real question as it does not aim to a specific answer, but to a collection of answers. Nevertheless I'm also interested, I'd recommend making this community wiki.
Comment: What are the things in Thunderbird you need?
Comment: This is a bit off-topic as it relates to my experience with Mail.app in Mountain Lion. At least in the current version OS X 10.8.2, Mail.app has some rather annoying bugs if you use it with an Exchange mail server. 1: Sometimes Mail thinks a message has "no content". If you restart the app, then the content is displayed. Difficult to reproduce, seems to happen randomly. 2: Sometimes the message stays "unread" even after you have read it. You have to mark it "read" manually. Again, this happens randomly. And, sometimes if you mark a message "read", it stays "unread". You have been warned :-) Le
Answer: The Apple Web site on Mail in Lion summarizes the most important new features. If it's "really any better" or not, depends entirely on your personal taste: I do like Mail.app's new list view where the list appears as a side bar, with chunks of message text in addition to the subject/sender information. You can further unclutter the interface by hiding the Mailboxes tree when you don't need it.
The search feature has also got better: things that used to require "Smart Mailboxes" (multi-condition filters) you can now do with a quick search in the search bar. Apple also seems to have stolen some good ideas from Google Mail – like Thread view, which is activated in Mail for Lion by default, and groups together messages that belong to the same thread. A thread shows up only once in the message list, showing the number of messages. It's very convenient to move/delete a whole thread in this way.
Also a neat feature copied from Google: the quoted text of original emails in replies is hidden by default, but you can unfold it by clicking "show more" (with a nice visual effect of unfolding paper).
However, if you love Thunderbird's special features, Mail.app is probably not for you. It's missing the Thunderbird's superb Tabs feature, i.e. you can only view one email folder / search result at a time (this might actually bring me to consider switching to Thunderbird again).
Personally, I like Mail.app because it's much better integrated with the other OS X apps I use, such as Address Book, iCal and iChat. Example: I get an email from a colleague, and if she's currently online in GoogleTalk/Jabber or Bonjour (local network chat), a green dot appears next to her name directly in Mail. Can't have that with Thunderbird... Other example: dates, times, addresses and phone numbers are recognized automatically in email text and can be added in one click as iCal event or to complete an Address Book entry. Also, I'm not sure whether Thunderbird's email database is indexed and searchable with Spotlight. Wouldn't want to miss this feature: searching for an email by subject or even message text without opening Mail in the first place.
Comment: thanks, I'm also using Mail because of its integration and simplicity. But I need to many of the features that Thunderbird has. I hope that Mountain Lion improves it.
Answer: It now has a setting to configure which headers to display. The only step towards professionalism in Lion:


List the system calls used in an application

Question: Is there any way to get a list of all system calls used in an application without running through all possible scenarios in the app?
Comment: did you checkout strace command?
Comment: Short answer: no
Comment: For sure, that gives only a list of _used_ syscalls during current run. It won't give me all of _possibly_ used syscalls which any part of application code could use. The latter is what I'd want to get.
Answer: In theory, if the application obeys certain constraints, yes. In general, no.
The most common way to invoke system calls is via the standard-library wrappers for the same.  So for example, read(fd,buf,BUFLEN) compiles to assembly call read, and in amd64 object code that would be e8 00 00 00 00 (where the zeroes are covered by a symbol-table entry for read). Build a table of all the syscalls used by the standard library, read through the object code looking for calls to the standard library, use that to look up the possible syscalls.
However, a program could also use syscall directly. The first argument is a syscall-number.  It could read that number from a file, a command-line argument, standard input, a network socket, or do some lengthy computation (attempt to factor a prime number, sequentially search for input that produces a certain SHA2 hash, run a universal Turing machine until it halts, etc.) to generate it.
A program could also use dlopen/dlsym to call a standard-library function, and it could get the name to call from a file, a command-line argument, standard input, a network socket, or after some lengthy computation.  In fact, the standard-library function it might look up could be syscall itself.
So there are programs for which the answer would be, "it might call anything".


Ubuntu and Interactive Media Installations

Question: I'd like to create an interactive media experience powered by Ubuntu, incorporating projected video, music, and assorted strange input devices. Has anyone used Ubuntu to orchestrate something like this? Can you recommend any specific software/hardware?
Comment: Can you please elaborate further?
Comment: I don't have a problem per se. I want to take a room, paint the walls and ceiling white, aim projectors at the walls and ceiling, plug in speakers, and add sensors, so that when people walk through the room, the rooms exhibits lights and sounds parameterized by the "input" of people in the room. I am looking for some good tools for this that are open source and run on Ubuntu.
Comment: I second George. Can you elaborate your problem a bit?
Answer: Here are instructions for getting Ubuntu to detect a Wii remote, which could easily be hacked into an artistic prop or some inconspicuous object.
You could use Motion to detect the movement of people walking through your installation.
I haven't used it personally, but here is an interesting DIY project for an automated NERF turret, which detects a moving target, tracks it, shoots and plays sounds.
Comment: Awesome! This is exactly the kind of stuff I'm looking for.
Answer: Are you talking about setting a machine as a Media Center / DVR (Digital Video Recorder, aka PVR)?
Here are three interesting solutions for this:

Mythbuntu:
Mythbuntu is an Ubuntu derivative containing MythTV which is an open source DVR. It is very complete and has a growing community.
You can watch/record/manage your TV shows, movies, music, etc... It has a very full-featured media library.
Official website: www.mythbuntu.org
Moovida (aka Elisa)
Moovida is a media center application that allows you to easily create your digital library and watch any of your media (DivX, h264, avi, asf, wmv, mkv, flv, mov, ogg, and almost any audio format...) on your TV.
It has a Youtube Feature, covert art for your music, Last.fm support. You can play your music by genre, rating and even acoustic similarity. Moovida 2.0 is available in over 20 languages.
Official website: www.moovida.com
Enna
Enna is a Media Center application and is based on the powerful Enlightenment Foundations Libraries (EFL) as for its graphical user interface and GeeXboX libraries as for multimedia playback and information retrieval.
Its main features are Music/Video playing, Bookstore (GoComics and OneManga), Photo gallery, Weather, Media database...
Official website: enna.geexbox.org


Relate a record with Create record Publisher action

Question: I have created a custom object called meeting summary, and I have a lookup from an event to this object.
I want to have a publisher action which creates a meeting summary record related to the event I'm on.
So i have managed to create the Global Action which creates the summary record and I have added it to the Event layout BUT when I create a new Summary record via the event action the Summary record and my event are not related.
How can I specify that the action will associate the two records and not only create a Summary record not related to any Event?
Answer: An Event is always related to something else, as in another object record, by a WhatID and possibly to a contact or lead by a WhoID. What record Id are you associating the Meeting Summary Action with, the Event or the Object that the Event is associated with?
If it's the Event, you also need to create a related list on the Event Page Layout so it has a place for those records to appear. Without the related list, they have no place to be displayed. If you've done that and its not appearing, then you may need to create an Object Specific Action on Event rather than a Global Action in order to get the Meeting Summary Custom Object Action to show up on the Event Record Page Layout.
Answer: You would need to create an object-specific action to do this. Object-specific actions are contextual and have access to the record on which they are bein executed. Global actions don't have that contextual context (except for a handful of standard objects that are magically handled by Salesforce, like Account > Contact).
Unfortunately the standard Event object doesn't support object-specific actions; it only inherits the global publisher layout and global actions. So you won't be able to do this with a standard Create a Record global action.
Comment: So basicly your saying I cannot do this with an action and I need to write a button?
Comment: Yes, unfortunately.


Removed python3, cannot bring back Gnome desktop

Question: I accidentally did apt-get remove python3 and didn't look at packages APT was about to remove.
Then Gnome Desktop Environment started to misbehave, I rebooted and it ended up in tty1 with no GUI.
I installed lightdm (just what found first in internet), it complained after I typed password Failed to load session "cinnamon". I installed cinnamon. GUI appeared but it was, of course, Cinnamon not Gnome.
Then I googled more and installed gdm3 and gnome but I'm still in Cinnamon desktop and don't know how to get from it to Gnome.
In sudo update-alternatives --config x-window-manager I don't see Gnome.
I tried to remove cinnamon and ended up with same Failed to load session "cinnamon" on login.
Tried to purge and reinstall, but no success.
How do I get Gnome desktop environment back?
Answer: There was Gnome set in
 sudo update-alternatives --config x-session-manager

I was 10 minutes before I found the solution. Just looked into /etc/alternatives/.


Why was Scarlet Witch outcast from the Avengers

Question: I know that the Scarlet Witch was the reason behind M-day and the loss of most mutant powers but is this the reasoning behind Vision's cold response(see Avengers vs Xmen #0) to her showing up at Avengers Mansion?
Answer: This answer contains spoilers from Avengers Disassembled:

 In Avengers Dissasembled the Scarlet Witch becomes dominated by the entity inside of her. She becomes insane and starts attacking the Avengers. She manipulates the Vision into crashing the Avengers Mansion with a Quinjet. He is later destroyed by She-Hulk due to these actions. The Scarlet Witch is eventually stopped and turned over to Magneto.

Not to mention the Scarlet Witch and Vision were married. The Vision was created using the brain patterns of Simon Williams (A.K.A. Wonder Man), who also had a thing with the Scarlet Witch -she even left the Vision on the Heroes Return saga for Wonder Man (who was presumed to be dead but is brought back by her)- so you know, he might also hold a grudge about that stuff too.
Answer: The Scarlet Witch did something even worse then that.

"Decimation" is a story line event published by Marvel Comics in 2005, spinning out of the events of the House of M limited series. The event started with a one-shot issue and took place in a number of various series all carrying the "Decimation" logo on the cover. The 2005 mini-series Generation M, Sentinel Squad ON*E, X-Men: Deadly Genesis**and X-Men: The 198 were all launched specifically for the "Decimation" story line. The various stories were collected in five trade paper backs.
The story line focuses on the ramifications of the Scarlet Witch stripping nearly all of the mutant population of their powers, thereby reducing a society of millions to one of scant hundreds. This event, which occurred on November 2 according to X-Men (vol. 2) #191, is known as "M-Day" in the Marvel Universe.

Where the Scarlet Witch helps Magneto and the US government "depower" nearly all of the mutants alive at the time.
There are at least "around 300" with 198 depowered by the US government and Magneto with 102 being depowered or killed by the Scarlet Witch and a 199th mutant (Mutant Zero) having disappeared "off the record". Over 198 mutants have already been identified post M-Day with at least 30 of said mutants have died since the mutant Decimation hit.
Comment: Welcome to SFF! I've edited in quotes to the parts of the text you copied verbatim, I'm not sure how much of the rest is your own words paraphrased from the source or your own words completely though.
Comment: "I know that the Scarlet Witch was the reason behind M-day"
Comment: Yeah true some of it I made up to make the Scarlet witch look bad yeah but YOLO right?


Running RSpec on Google App Engine via JRuby

Question: I'm trying to write some tests (RSpec) against the AppEngine and its datastore. I've tried to load the environment and tests via:
appcfg.rb run -S spec app/tests/

And I end up with the following error:

spec:19: undefined method `bin_path'
  for Gem:Module (NoMethodError)

I can run non-appengine specs just fine by running:
spec app/tests/

Any suggestions on how to get RSpec up and running with JRuby and Google App Engine would be greatly appreciated. Thank you.
Some versions numbers for your face:
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 6586) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
rspec (1.3.0)
appengine-apis (0.0.12)
appengine-jruby-jars (0.0.6)
appengine-rack (0.0.6)
appengine-sdk (1.3.1)
appengine-tools (0.0.10.1)
dm-appengine (0.0.7)
dm-core (0.10.2)
Answer: spec:19: undefined method `bin_path' for Gem:Module (NoMethodError)
looks like
http://www.ruby-forum.com/topic/205780


What would be the effects of longer seasons and a longer year

Question: If all other things were the same, how different would the earth be if it took 4 of our years (365*4 days) to travel around the sun?
Comment: This seems a little broad to me. Can you narrow it down to what exactly you are looking for? Societal impacts, military impacts, etc.
Comment: @DJMethaneMan There's considerably more to it than that. Orbital mechanics would require the Earth to be farther from the Sun to maintain the longer orbit. If the Earth slowed in its current orbit, it would decay into the Sun. Life may not ever exist on Earth as a result (either scenario).
Comment: It also occurs to me that the only difference would be when we celebrate New Years and how we measure the lifespan of people. Average lifespan would be 10-20 years in this scenario. A kid would be sexually mature in 2 1/2 years and other similar things.
Comment: @Frostfyre I'm pretty sure the asker wants a planet with all the things adjusted too - so a brighter star to move the goldilock zone etc.
Comment: @eimyr If the asker wants us to adjust not just the length of the sidereal year but also everything else to keep Earth's environment more or less unaffected except for the longer year and seasons, then that should be stated in the question. Since the question now has two answers based on Frostfyre's interpretation of it, such an edit would however now invalidate those answers, which is something we strive to avoid.
Comment: Mark, if you meant to ask something more along the lines of eimyr's interpretation of your question, then I would recommend that you post *a new question* in which you spell that out explicitly. I expect the answers to such a question would be rather uninteresting, however. Also, *especially* for such a question, it would help if you can focus the question on a particular aspect as DJMethaneMan suggested in a previous comment.
Comment: Thanks guys. Much food for thought here. I will raise a more specific question when I have digested the input. It was my first post of this type and I probably could have made it more specific. I certainly can with the feedback here.
Answer: It's important to note that you can't just drop a planet in an orbit at an arbitrary distance from its sun, and expect things to just work. So, we will instead try to find the orbit that has an orbital period of four Earth years, and see what happens. If you don't care about the mathy and orbital-mechanicy stuff, then just scroll down for the TL;DR and answer.
Technically, you are looking to quadruple the sidereal orbital period of Earth, changing it from approximately 31,558,149 seconds to approximately 126,232,598 seconds (bear with me!), while leaving the masses of both the Sun and the Earth unchanged, and you are asking what effects such a change would have.
According to Kepler's Third Law, in the case of a small body orbiting a large central body (which is good enough for modelling the Earth in an orbit around the Sun), the orbital period can be calculated as $$ T = 2\pi{}\sqrt{\frac{a^3}{\mu{}}} $$ where $T$ is the orbital period in seconds (there we go), $a$ is the orbit's semi-major axis in km, and $\mu$ is the standard graviational parameter using the mass of the larger body which in our case works out to $1.32749351 \times 10^{11} \text{ km}^3 \text{ s}^{-2}$. Earth's orbit has a semi-major axis of 149,598,261 km (just about exactly 1 AU). In order to keep the calculations managable, I'm going to ignore the orbital eccentricity and just pretend that the Earth's orbit is perfectly circular; this simplification is unlikely to have any real effects on the outcome.
Plugging in the Earth's orbit around the Sun, we get $$ 31~558~149 = 2\pi{} \sqrt{\frac{149~598~261^3}{132~749~351~000}} = 2\pi{} \times 5~021~964 $$ which as we can see works out quite nicely (the error is less than 0.05%).
Now, we want to plug in the longer orbital period and solve for $a$, the semi-major axis of the orbit. In our case, the masses of both bodies remain the same so $\mu$ is unchanged. Hence, we know that $$ 126~232~598 = 2\pi{} \sqrt{\frac{a^3}{132~749~351~000}} $$
Solving for $a$:
$$ \begin{aligned}
\frac{126~232~598}{2\pi} = 20~090~542 &= \sqrt{\frac{a^3}{132~749~351~000}} \\
20~090~542^2 &= \left( \sqrt{\frac{a^3}{132~749~351~000}} \right)^2 \\
4.036298779 \times 10^{14} &= \frac{a^3}{132~749~351~000} \\
132~749~351~000 \times 4.036298779 \times 10^{14} &= a^3 \\
a = \sqrt[3]{a^3} &= \sqrt[3]{132~749~351~000 \times 4.036298779 \times 10^{14}} \\
a &\approx 376~997~587 \text{ km}
\end{aligned}
$$
Let's plug in this semi-major axis, and see what orbital period comes out.
$$ T = 2\pi \sqrt{\frac{376~997~587^3}{132~749~351~000}} \approx 126~232~596 $$
We wanted an orbital period of 126,232,598 seconds, and even with all this rounding everywhere, we got 126,232,596 seconds. I'd call that close enough.
Your planet's orbit has a semi-major axis of a shade under 377 million km, or 2.52 AU. For comparison, Mars has a semi-major axis of 1.524 AU, and most of the asteroid belt is concentrated around a distance of 2.2 to 3.2 AU from the sun.
In effect, you'd be placing Earth in the middle of the asteroid belt.
That's hardly "leaving all other things the same" and just giving the orbit a gentle nudge.
Since sunlight intensity obeys the inverse-square law and consequently drops with the square of the distance, you're looking at $\frac{1}{2.52^2}$ or less than 1/6 the amount of sunlight compared to Earth's current orbit.
Even if we handwave away the asteroid belt itself, it seems safe to say that life on Earth would not take kindly to such a scenario, and it's probably a safe bet that Earth would quickly freeze over from the much lower solar input received.
Answer: Well since the orbital period is dependent on the distance from the sun, we would be orbiting outside of Mars (1.9 years) though a bit closer than Jupiter (11.9 years), I'll leave someone else to do the math for the exact distance.
but looking at this

the planet would be outside of our sun's goldilock's zone.  So in our solar system it would likely be a frozen ball.  So we would need a larger/hotter sun to push the zone out farther or we would be dealing with a completely different type of life.
Whether that is all underwater which could be the case of Europa, a body that heats the water under the ice crust to keep it liquid, or a completely different type of chemistry that doesn't need liquid water.
I would also expect that should the sun provide a similar living conditions to earth, with similar declination of the poles, that the poles would have much more severe extremes, with a lot more migration of animals into and out of the regions for the seasons.  I would also expect a much larger number of animals to be hibernators of some kind, to at least sleep through the worst few months of the long winter.
the farther north or south you go I would expect more grassland/tundra since it would be harder for perennial plants to survive the long harsh winters.
Comment: I did the math... you end up in the middle of the asteroid belt, which sounds plausible to me. It's cold out there, though. :-)
Answer: For our sun, as stated previously, it wouldn't be an Earth-like planet.  But I presume, you want an Earth-like planet, so let's give you a new sun that works.  Note: this is obviously speculative, and I'm also going to hand-wave that we've got Earth-like systems and life.
TL;DR
You have a very tumultuous and changing (exciting) 'Earth' around another star, in both climate, weather, plant, and animal activity.
Climate
Temperatures - Seasons are now four times as long, so your temperatures will be more extreme.  Very cold winters, and very hot summers.  Long transitions between them.
Sea Level / Coasts - Your poles melt and freeze; If one of your poles accumulates significantly more ice, then that pole's summer, the sea level will rise significantly.  The Antarctic has a lot more ice than the Arctic, so the southern summer will see sea level rises.
EDIT Rivers - Oh yeah, your rivers will likely freeze/go dry each year depending on size and location.
Oceans - You would have very dramatic global streams as very warm, shallow water surges towards the poles and cold, dense, deep waters return.  This would make early seafaring much faster, but:
Storms - With incredible warming along the equator for half the year (each hemisphere's summer), bringing tremendous hurricanes.  Also, in the extreme summers, very high equatorial pressure will push warm moist air into the low pressure zones in the north bringing more tumultuous weather.
Flora & Fauna
Assuming 'Earth-like'
Plants - Obviously adaptability to extreme temperatures will be stronger than what we see on our Earth; hardier trees and plants, longer germinating season for seeds.  Your plants may evolve to have two types of growing seasons: a type of surface feature during the winters, and another during the summers - or maybe even four.
Animals - Most likely, this is highly nomadic for air, sea, and land dwellers (where possible), due to the extreme weather and lack of plants during the winter / abundance of plants during the certain seasons.  Your lake & river dwellers will have to be ready for very hot or very cold (or both) temperatures.  Because of extreme temperatures, your greatest variety of life will be those isolated (on islands or in lakes/rivers), where they have much different plants and climates.
There is a lot of activity going on here at Earthv2!


Is there a tool to remesh an object such that it contains a specified number of vertices?

Question: I am currently making a classifier for 3-D objects that uses vertex data as input, and I am using Blender to create a dataset of 3D objects. For the classifier, I need all the objects to have equal amounts of vertices. Hence I want to know if Blender has a tool for remeshing any object such that it has a specific number of vertices?
Answer: Soooorrrttt oooff.  It will require some math on your part.  And it only works one direction (down, removing verts).
You can tweak the Decimate modifier to collapse to a ratio of vertices kept.  If you know the number of vertices you want and the number you have is look-up-able, then you can directly calculate the ratio:
for target vertex count $t$, vertex count $v$, and ratio $r$ , it is simply
$t/v=r$ .
Remember, Blender can remove vertexes all day, but it can't add any.


Archimedes Principle $\Delta M$ formula

Question: i'm trying to determine a formula for $\Delta M=M-M_{apparent}$ in terms of $\rho_o , \rho_w , M$ for a fully submerged object and I have no idea where to begin. I have attempted to draw a force diagram but it did not help.
Answer: Use density = mass/volume
The most important thing here is finding the volume of the object, which is mass of the object divided by density of the object.
I think you can find the answer now, you have to work on it. Solving all of the problem is not allowed, and not good for you.
Answer: Just to correct you, there is no such thing as apparent mass.  Mass is a constant here.  The correct term used should be weight.
Let the mass be $M$.  Then the weight will be $Mg$, and the apparent weight $Mg-\rho_{w}Vg$, where $V$ is the volume of the water displaced by the object.
Do take a look at the following diagram.  The image here shows how the forces act.

Hence, $\Delta W$ is equivalent to the buoyant force, $\rho_{w}Vg$.
Comment: Thank you, that makes more sense, I think I was just getting confused with the term 'apparent mass'.

Archimedes Principle $\Delta M$ formula


Is the sum of a Fourier series periodic?

Question: If a Fourier series converges, will it converge to a periodic function? It seems logical since it is a trigonometric series. But often we are told to derive the Fourier series of functions like $x^2$, which are not periodic.
Comment: When you derive the Fourier series of $x^2$, what you are actually doing is deriving the Fourier series of the periodic function whose restriction to $[-\pi, \pi]$ equals $x^2$. If you want to do Fourier analysis with non-periodic functions defined on $\mathbb R$, you need the Fourier transform.
Answer: The sum of a Fourier series is periodic. As said in a comment, when people talk about the Fourier series of $x^2$,  they actually mean the Fourier series of this function:

which is the result of restricting $x^2$ to the interval $[-\pi, \pi]$ (or whatever interval you use for Fourier series), and then extending that periodically.
Comment: @HritRoy This is why the word "restricting" is there. Initially, the function defined for all $x$. We _restrict_ it to $x\in [-\pi, \pi)$. Then we extend it periodically.
Comment: "or whatever interval you use for the Fourier series" - how does one specify that when writing a series?
Comment: See [Fourier series on general interval $[a,b]$](https://math.stackexchange.com/q/1399900)
Comment: In the very beginning he says $f:[-π,π] →ℝ$. But isn't $f$ defined for all $x$? Like we define $f(x)=x^2$ in $(-π,π]$ and $f(x+2π)=f(x)$ for all $x$.
Comment: Oh I missed the last part. Restrict, then extend. Makes sense.


Why won't my bus show up on Greyhound's live tracker website?

Question: My fiancé is currently on a bus coming to where I am but every time I go to search for the bus on the tracker, it shows that there are no results.  I'm getting the schedule codes directly from his ticket so I'm not understanding why they aren't showing the bus.  its frustrating me because I'm worried he won't be able to make it to where I am from where he's getting dropped off if he gets here too late.
Comment: What do Greyhound customer services say?
Comment: Are you certain that you've read the ticket correctly?  Can you post an image of it (with any identifying information blacked out, of course).
Comment: Did your fiance board a different bus?
Answer: It's hard to pinpoint the exact reason without more details. Here are some possible reasons.
Broken onboard tracker
If Greyhound doesn't have data from the tracker, for instance because it is broken, they will list the bus with this note:

We're sorry, but the expected times of arrival of this bus are currently unavailable. Scheduled times are below.

Different company operating the bus
The bus may not actually be run by Greyhound, rather by a partner company. It should be noted on the ticket if the bus is run by a partner. Some partner bus companies have their own tracking sites where you can track the bus, for example:

Jefferson Lines https://www.jeffersonlines.com/bus-tracker/
Adirondack / Pine Hill / New York Trailways https://trailwaysny.com/?vh_other_services=wheres-my-bus

Different country
Depending on what country the bus travelling in, Greyhound has different tracking sites:

http://bustracker.greyhound.com

Within the USA
Between the USA and Mexico
Within Mexico
Between the USA and Canada (or vice versa)

http://bustracker.greyhound.ca

Entirely within Canada
Comment: Another possibility is that the tracking system on this particular bus is simply not working.
Answer: There could be several reasons why your bus is not showing up on Greyhound's live tracker website:
Technical Issues: There might be a technical glitch in the system. The live tracking system relies on GPS devices installed on the buses, and sometimes these devices can malfunction or lose signal, particularly in areas with poor reception.
Delay or Change in Schedule: If the bus is significantly delayed or if there has been a change in the schedule that has not been updated in the system, it might not show up on the live tracker.
Incorrect Information: Ensure you have entered the correct information for tracking. You may need the bus number, confirmation number, or other details to track the bus accurately.
Browser or App Issue: Sometimes the issue might be with the device or browser you are using. Try refreshing the page, using a different browser, or restarting the app.
Bus Not in Service: In rare cases, the bus might be canceled or not in service, and this information might not have been updated on the website yet.
If the bus is not showing up on the live tracker and you are concerned about your trip, it is recommended to contact Greyhound customer service or check for updates at the bus station.
Comment: GPS is a receive-only technology. It might be that the bus knows exactly where it is, but cannot communicate back out (via the on-board cellular modem) to tell the rest of the universe where it is.


Why is my 2002 VW Passat battery going dead?

Question: I recently replaced my alternator and battery. I also repaired a faulty cable between the two.  Now I'm having the problem of my battery going dead after a few days of it sitting and a lot of my fuses have power going to them what could be causing this?
Comment: Why did you replace the alternator and battery in the first place? Not exactly sure what you mean by "*a lot of my fuses have power going to them*". It is normal for a fuse block to have power. **You need to double check your work. There is a possibility you have a loose connection, wire crossed or something shorting out.**
Comment: Was this a problem before you replaced the alternator and battery?
Comment: No never happened before
Comment: Does this **ONLY** happen when the car sits? If you get it running, does it start to give indications (dimming lights will be the most noticeable) that the battery is draining? You can try driving a bit at night or even idling with you high beams on pointed toward a wall and see what it does. If it does start to loose voltage, and the lights dim, then there's something wrong with the alternator. If not, then you can start moving to the fuses to try and see where the draw is coming from. (NOTE: All this testing and debugging will be ***MUCH*** easier with a multimeter.)
Answer: Measure the current which is drained from battery when everything is turned off. Common multimeter with 10A fuse should handle this. If it is high current (higher than hundreds of mA), then something drains power and remains turned on even if it shouldn't. If the current is high, try to go through fuses one after one until you find the fuse with high current flowing through it. You can investigate further based on what it is.
If there is no drain, then measure voltage generated by alternator when engine is running. It should be something over 14V. If it gives less, it might be faulty.
Comment: Although I would recommend checking the alternator first since it is a simpler test to eliminate.
Answer: In addition to the excellent suggestions to check for drains when the car is "off" and also that the alternator is producing the correct voltage when running I think this stands out:

I also repaired a faulty cable between the two

I'd be checking that cable out to make sure the repair is solid and that it isn't shorting or providing a poor connection.


Is there any reason a charcter with enough movement should not always approach enemies from the rear, gaining +2 to attack rolls?

Question: I am a little bit confused about the combat rule concerning rear attacks from the Player's handbook. If I have enough movement, why wouldn't I go straight to the rear side of an opposing creature to gain that nice +2 bonus to my attack roll (Revised, p. 180; original, p. 90)? Humans, Elves and Half-Elves have plenty of movement, why would they ever stop before they reach the backside? I'm also not entirely sure if you can charge straight to the backside when you're in front of a creature, gaining +4 to the attack roll.
Answer: Charging
Last one first: you can't "charge" someone's back when they're facing you, because charging has to be a relatively straight, well, charge at the intended target. It's definitionally not charging if you're not running straight at them. A charge can't involve stopping to turn around.
(If you're coming to AD&D 2e from D&D 3.5e, this may seem unintuitive — where does it say that a charge has to be in a straight line? AD&D 2e doesn't work that way: it expects readers to read words to mean what they say. "Charge" isn't redefined by the core game anywhere as something more flexible than its real-world meaning, so it isn't and it has to be an actual, factual charge as we understand it in the real world.)
Flanking and attacks from behind
Movement in combat is limited by two things: your movement speed and engagement with the enemy. As soon as you are within striking range of an enemy you are "in combat". (Again, this is definitional of the English words that the game expects readers to understand, it's not specially-defined by the game to mean what it already means in English.) The only way to get out of combat is to use one of the retreat movement modes (p. 97 of my classic blue-and-black first printing): fleeing or withdrawing. Both can only be done when you haven't already moved for the turn, and both require moving more-or-less directly away from your opponent.
This has a few interesting, emergent consequences, among which are:

It is impossible to walk up to someone and walk past them, if they are armed and consider you an enemy.
Once within melee combat range of an opponent, you still can't get past them no matter how you try to move, since you can only move by going directly away from them.

What this does is make melee opponents "sticky" — once engaged in melee combat with someone, they limit your movement (and you theirs). It makes a front-line of AD&D 2e combatants (durable Warriors on your side, hopefully!) extremely effective at locking down melee enemy movement. This emergent outcome is something that is widely emulated in other games by using more complex rules, but is "free" and relatively simple in AD&D 2e due to withdrawal/fleeing being the only legal movement options once in melee range of an opponent.
Getting around your enemies
So, to get around your enemies, you have to have enough space and movement to move all the way around them without them turning to face you.
That means you either have to

have enough movement and space around the melee to circle wide around all enemies and still reach the desired target's back (unlikely, when the average human/elf/half-elf can only move 60 linear feet in a round and still attack)
have enough space and time to circle wide around them over two or more rounds while they stay facing the way you want them to, either due to your allies keeping them occupied or due to your own stealth preventing them from knowing to turn to stay facing you

In other words, you have to flank them for real, with real tactics and movement. You can't just brush past them, turn, and stab them in the back. In general, attacking someone from behind is either the result of an opportunistic attack on someone who already has their back turned to you for some reason, or something you have worked hard to set up.
Comment: I vaguely recall there was also a line in the 2e PHB that said a character tends to turn to protect their back, making it hard to attack someone from behind. Alas, I don't have my books on me right now.
Answer: The main reason is avoiding attacks of opportunity. You can't pass through an area within reach of your opponent without provoking an attack of opportunity. This means with an opponent with a reach of 5 feet, starting just out of reach you have to travel 16 feet just to go around them. IF you are already in melee you have to leave melee, which again provokes an AoO.

Attacks of opportunity occur when a threatened character or creature ignores the enemy next to it or turns its back on a foe

-AD&D Combat and Tactics
You can't charge through an opponent to get both bonuses because it doesn't make sense. Charge gives you a +2 to attack because of your furious momentum, if you don't use it, charge through and switch direction to stab your opponent in the back it doesn't make much sense to give you that bonus does it. This isn't explicitly stated in the rules but any DM I know would rule 0 it that way. +4 to your attack roll is a lot for no additional consequences beyond that of the charge. At the very least you provoke an AoO by moving through your opponent's occupied space with the full disadvantage that you get from charging.
Comment: Thanks for the detailed answer. I thought about the AoO (they're not named that, if i recall correctly, in AD&D, but they are mentioned), but I thought with the massive amount of movement (12 squares on a grid for a human) you could easily avoid the attack, but I guess in many actual combat situations there wouldn't be enough room anyway to do so. I'm fairly new to DM, have so far only played 5e and Cthulu as DM so i'm still mostly looking for answers in the books or on forums rather than common sense, so thanks for the charge-clarification!
Comment: AD&D second edition rules are worded fairly broadly. The only reference to Attacks of Opportunity in ADD2e are in a book called Player's Option: Combat and Tactics, which isn't a core rulebook but introduces them as a concept.
Comment: Early editions of Dungeons and Dragons leave a lot up to the Dungeon Master to decide. The guiding rule for allowing a tactic like that is "Does this make sense in my narrative?" If the optimal solution to combat requires people to run around their enemies that will mess with believable storytelling and should be fixed by the DM. The removal of facing in 3E was great.


Exchange 2013 SMTP reply error not being sent

Question: We are scanning to our exchange 2013 server from a scanning application that uses smtp, in the past when the mail exceeded the smtp size limit it would send an email with a link instead of the scanned file, this stopped working possibly after an exchange update, from what I can tell using wireshark the exchange server accepts the job there are no failure codes sent back in the SMTP communication yet an email is sent to the user scanning saying it has exceeded the limit although this is no good for our purpose, why would exchange not sent a exceeded mail limit back during smtp communication?
So to summarize: where it used to fail during SMTP comms it now appears to accept and queue the mail then fail it after its queued instead of failing during the SMTP message exchanges.
Thanks
Answer: Exchange only rejects emails that are too large on the SMTP level if you set the size limit in the individual receive connectors instead of on the global level.
Open the Exchange Control Panel, go to the "Mail Flow" option located on the left pane and in the right pane, click on "Receive Connectors". Select the "Default Frontend" receive connector and click on the pencil icon. The "maximum receive size" is right there on the "General" configuration page of the receive connector.
Now if an email is larger than that maximum receive size your Exchange will again reject it directly during the SMTP communication and your scanning application should be able to react correctly.


Showing that a proper cycle will remains connected after removing one edge.

Question: This just seems way to simple to me to be able to put into words. Essentially what I want to say is that since we know that we are able to hit all the vertices in the graph without hitting any of the edges/vertices more than one, removing one of the edges means that we are removing an edge that is only traversed once. Since the edge was only traversed once, we know that removing it still allows for all the vertices to be walked to from any other vertex. Any help on how to strengthen this argument would be really appreciated :)
Answer: Suppose we have a proper cycle with vetex set $V=\{ v_i \mid i=1,2, \cdots ,n \}$ and edge set $E= \{ e_{i,i+1} =(v_i,v_{i+1} \mid i=1,\cdots,n-1 \} \cup \{e_{n,1} =(v_n,v_1) \}$. Now suppose one of these edges is removed, can you write down a path from any pair of vertices ?
Further hint :
Assume we remove the edge $e_{i,i+1}$, a path from $v_j$ to $v_k$ where $j \leq i$ and $i+1 \leq k$ can be constructed by $ v_j e_{j,j-1} v_{j-1} \cdots v_0 e_{0,n} v_n e_{n,n-1} \cdots v_k $.
There are other cases that need to shown but to write out the path explicitly is quite easy.
Comment: Yeah, you can. I'm just not sure how to necessarily prove that you can.


Problem with derivative of $x^{x^x}$

Question: I was recently watching blackpenredpen's video (found here: https://m.youtube.com/watch?v=UJ3Ahpcvmf8) where he found the derivative of the the function $y = x^{x^x}$. Before watching the video, I decided to try it myself, and I didn't it this way: Firstly I decided I would use the chain rule and define two functions, $u(x)$ and $v(x)$, both of which are $x^x$, so I could show the function as $u(v(x))$. Using the chain rule, the derivative would be: $u'(v(x))\cdot v'(x)$. We can find the derivative of $x^x$ (as shown on Quora here: https://www.quora.com/What-is-the-derivative-of-x-x-How-could-I-derive-it-as-well) as $x^x\cdot(\ln x+1)$. Now using the chain rule to get $u'(v(x))$ we get ${(x^x)}^{(x^x)}\cdot(\ln {x^x}+1)$ or $x^{x^{x+1}}\cdot(\ln {x^x}+1)$. This wasn't the answer that blackpenredpen arrived at though. In the video, he arrived at $x^x\cdot x^{x^x}\left({\frac{1}{x}+\ln x+(\ln x)^2}\right)$. I can't see how he did it, and I'm sure that it is right. If anyone could confirm my answer or show where I went wrong it would be greatly appreciated.
Thanks.
Comment: note that $u(v(x))=v(x)^{v(x)}=(x^x)^{x^x}$, what is not the same function. Instead try the following: $x^{(x^x)}=\exp(x^x\ln x)=\exp(e^{x\ln x}\ln x)$, now use the chain rule.
Comment: @Masacroso Are you sure? Exponentiation is left associative so $\alpha^{\alpha^\alpha}$ = $\alpha^{(\alpha^\alpha)}$. So wouldn't ${(x^x)}^{x^x} = {(x^x)}^{(x^x)}$?
Comment: Yes, that is right. But the way I (tried) to find $\frac{d}{dx}\left[{x^{x^x}}\right]$ lead me to get a ${(x^x)}^{(x^x)}$ in my answer, this is probably where I've gone wrong. Note: this was in response to another comment, which seems to have been deleted.
Answer: For differentiating expressions of the form $u(x)^{v(x)},$ I've always found it easiest to take logarithms and then differentiate implicitly. However, rather than work with the more general form $y = u^v,$ I'll work with $y = x^U$ (i.e. use $x$ for the base), which is sufficient to deal with $x^{x^x}.$
Taking the logarithm of both sides gives
$$ y = x^U \;\; \implies \ln y = \ln\left(x^U \right) \;\; \implies \;\; \ln y = U \cdot \ln x $$
Now differentiate both sides with respect to $x$:
$$ \frac{d}{dx}\left(\ln y\right) \;\; = \;\; \frac{d}{dx}\left(U \cdot \ln x \right) $$
$$ \frac{y'}{y} \;\; = \;\; \frac{d}{dx}(U) \cdot \ln x \; + \; U \cdot \frac{d}{dx} (\ln x) \;\; = \;\; U'\ln x \; + \; \frac{U}{x}  $$
$$ y' \;\; = \;\; y \cdot \left[ U'\ln x \; + \; \frac{U}{x} \right] \;\; = \;\; x^U \cdot \left[ U'\ln x \; + \; \frac{U}{x} \right] $$
Using this result for $U(x) = x,$ we get
$$ \left(x^x\right)' \;\; = \;\; x^x \cdot \left[ 1 \cdot \ln x \; + \; \frac{x}{x} \right] \;\; = \;\; x^x(\ln x + 1)  $$
Using that same result for $U(x) = x^x$ along with what we just found for $\left(x^x\right)',$ we get
$$ \left(x^{x^x}\right)' \;\; = \;\; x^{x^x} \cdot \left[ \left(x^x\right)' \cdot \ln x \; + \; \frac{x^x}{x} \right] $$
$$ \left(x^{x^x}\right)' \;\; = \;\; x^{x^x} \cdot \left[ x^x(\ln x + 1) \cdot \ln x \; + \; \frac{x^x}{x} \right] $$
$$ \left(x^{x^x}\right)' \;\; = \;\; x^{x^x} \cdot x^x \cdot \left[ (\ln x + 1)\ln x \; + \; \frac{1}{x} \right] $$
$$ \left(x^{x^x}\right)' \;\; = \;\; x^{x^x} \cdot x^x \cdot \left[ (\ln x)^2 \; + \; \ln x \; + \; \frac{1}{x} \right] $$
Answer: You can apply the method given on quora to your problem:
$$\left(x^{x^x}\right)'=\left(e^{x^x\ln x}\right)'=e^{x^x\ln x}\cdot \left(x^x\ln x\right)'=\\
=e^{x^x\ln x}\cdot \left(e^{x\ln x}\ln x\right)'=\\
=e^{x^x\ln x}\cdot \left[\left(e^{x\ln x}\right)'\ln x+e^{x\ln x}\cdot \frac1x\right]=\\
=x^{x^x}\cdot \left[e^{x\ln x}\left(x\ln x\right)'\ln x+x^x\cdot \frac1x\right]=\\
=x^{x^x}\cdot \left[x^x\left(\ln x+1\right)\ln x+x^x\cdot \frac1x\right]=\\
=x^{x^x}\cdot x^x\left[\ln^2 x+\ln x+\frac1x\right].$$
P.S. I could not watch the referenced video on Youtube, because it is not opening here (it might be blocked).
Comment: Sorry about the video, he did almost exactly the same thing that you did, but might I ask, would you be able to show me where I went wrong?
Comment: If $u(x)=x^x, v(x)=x^x$, then $u(v(x))=(x^x)^{x^x}=x^{x^{x+1}}$, which is a different function.
Comment: Oh, I see, $u(v(x))$ would have been $x^{x^x}$ of course. That's a bit embarrassing...

Problem with derivative of $x^{x^x}$


what if someone tries to finish public keys by non-stop creating

Question: Lets say one big company or country start a war against bitcoin and they have very powerful machines. What happens if they starts to create public key all the time? Is it possible to finish all the public keys?
Answer: Yes, in theory but it would take so long that neither you, nor I will still be alive by a long shot.
At about 10,000 key pairs per second, with an address space of 2^160, it would take you 50 tredecillion years to finish.
Thats 50,000,000,000,000,000,000,000,000,000,000,000,000,000,000 years
To put that into perspective, the age of the universe is about 13,000,000,000 years
Answer: yes, it will just take more energy, than the sun can currently provide :-)
Or otherwise: how to store 2^160 addresses...
Here is a discussion on bitcoin forum:
https://bitcointalk.org/index.php?topic=1164265.0
Answer: This is technically impossible and economically illogical. If you could check this many addresses, you could also mine bitcoins.
Here are a couple of fun vids:
Bitcoin 101 - Quindecillions & The Amazing Math Of Bitcoin's Private Keys
Ever wonder how Bitcoin (and other cryptocurrencies) actually work?
Both discuss the 'size' of the bitcoin address space.


Textbox text not retrieving due to encoding

Question: I'm using a chinese mobile device which has windows mobile 6.1 to run my .net CF 3.5 application.The problem I'm having is, when I enter text in a custom textbox, I see empty spaces in textbox.text in the code. Can anyone tell me how I could encode the text that is displayed in the textbox?
Comment: You mean it's "spaces" on the device, or in Studio?
Answer: If your device is built with the Chinese version of Windows Mobile, it may only have Chinese characters defined.
I have not seen a way on WinMo devices to change the language, so you may be stuck with that.
I don't know if you can read Chinese (I can't), but have you tried using a Chinese version of Visual Studio? Chinese versions of VS and WinMo are difficult to find here in the US (for obvious reasons).


Can Kerdi board be painted instead of tiled?

Question: can Kerdi board be painted? I want to use it on the walls in my bathroom instead of sheet rock.
Answer: Yes you can paint over Kerdi board but you will need to give it a light coat of joint compound and do a little sanding.
Comment: Painter here, that's what I was going to say, you can paint anything if paint will stick, prime it first and do enough fairing... (joint compound, bondo, etc)


Tensor double dot product

Question: I have two tensors that i must calculate double dot product.
matrix A is rank 2
and matrix B is rank 4.
I want to multiply them with Matlab and I know in Matlab it becomes:
A : B = trace (A*B)
but it has one error and it says: Inner matrix dimensions must agree
So how can I solve this problem?
anybody help me?
Thanks
Comment: What size are A and B?
Comment: A is 3*3 and B is 6*6
Answer: I think you can only calculate this explictly if you have dyadic- and polyadic-product forms of your two tensors, i.e., A = a b and B = c d e f, where a, b, c, d, e, f are vectors. Beware that there are two definitions for double dot product, even for matrices both of rank 2: (a b) : (c d) = (a.c) (b.d) or (a.d) (b.c), where "." is the usual single-dot scalar product for vectors. One possible answer would thus be (a.c) (b.d) (e f); another would be (a.d) (b.c) (e f), i.e., a matrix of rank 2 in any case. Of course A:B $\not =$ B:A in general, if A and B do not have same rank, so be careful in which order you wish to double-dot them as well.

Tensor double dot product