Minecraft how to testfor when a point gets added to a scoreboard?

Question: How would I testfor if a point gets added to a scoreboard, and not when it reaches a certain point? Example, if score x goes up to 5 points, how would I testfor if it went up to 6 WITHOUT having a timer testing for score_x_min=6?
Comment: Fill clocks aren't evil, and they won't severely lag a server.  [Redstone dust is evil](http://lemoesh.com/best-practices/eliminate-redstone-dust/), and should never ever be used for clocks in maps.  Really, the only reasonable solution is to use a fill clock.
Answer: You can't do this without using a clock.  At least, it can't be done reliably without a clock.  If you know when the scoreboard changes (i.e. if it's incremented every time a pressure plate is pressed), then you might be able to run the check along side the command that changes the scoreboard value, but often this isn't the case.  If not, then your only real choice is to use a clock.
And this is really something that should be on a clock anyway.  Maybe even the fastest clock available.  A fill clock.  If you are using command blocks in a map, then there is no reason at all for using anything other than fill, setblock, and falling sand clocks.  Your apprehension to using a clock or timer is probably because traditional redstone clocks caused a lot of server lag.  But redstone dust itself is evil, and not the clock it made up.  Fill clocks do introduce some lag, but it's not nearly as much as traditional redstone dust clocks.  At this point, pretty much every command block heavy map runs on fill clocks.  If you are making a map that uses at least a dozen command blocks, you're probably going to need a fill clock.
So, now that I've hopefully established that you really do need a clock, and that it should probably be a fill clock, let's get to the solution.  In a command block that will be triggered by the clock, use the command testfor @a[score_x_min=6] and use a comparator to output a success to another command block.  Alternatively, if you want to run a command that takes a player or entity as a variable, simply have that command be in a command block triggered by the clock.
Comment: Yes, I am a big fan of the fill clock, and the only reason I would need to be able to test for when a score is updated is non-dummy scores, such as stat.TalkedToVillager or something like that. What I think I might do is just have a command block running on a clock and when the score updates I'll have command blocks do what they need to do, and then reset the score back to 0. Thanks for the help though.
Comment: Resetting a score to 0 is very common.  If you need to track both changes to a score as well as the total at the end, you basically need to have 2 scoreboard objectives.  There might be ways now to do this without resetting, but I haven't explored that (and you still need 2 objectives).


Can a doorbell transformer sit loose inside main panel?

Question: Can a low voltage transformer for a doorbell sit loose (not screwed to anything) inside the main panel or does it have to be affixed somehow? It came with holes but I'd need to drill holes in the panel to attach it, unless I can just wire it and sit it on the bottom of the panel.
Comment: Just a story to show how bad some work can be -- When I moved into my current house I found the doorbell transformer had no knockout adapter. It was bolted to the outside of the service panel with the primary wires fed into the box through a clamp fitting. That's right, clamped right down onto the unsheathed stranded wires. And the hot shared a breaker screw with an existing wire The electrical inspector didn't say boo. I tore the whole thing out and installed a door knocker.
Comment: @A.I.Breveleri Some breakers allow multiple conductors, see [this answer](http://diy.stackexchange.com/a/85932/33).
Comment: @Tester101: Thanks. My breakers aren't marked either way. And this was almost 25 years ago, long before the miracle that is HI SE.
Answer: You won't want to install the transformer inside the panel. Instead you'll install it on the panel.

Remove the retaining nut from the threaded fitting on the other side of the transformer (the bit in your hand).
Feed the wires and threaded fitting through an appropriately sized knockout in the panel.
Thread the wires through the retaining nut, and tighten the nut down on the threaded fitting.
Connect the primary wires from the transformer to the proper terminals in the panel.
Connect the low voltage wires to the terminals on the secondary side of the transformer.
Comment: @ratchetfreak, no, the finger nut on the inside provides the support. the screw tabs are only used if you don't use the finger nut.
Comment: That transformer looks to be installed upside down. The bracket should be facing the wall and screwed in place I think.
Comment: Also wouldn't a fuse be advisable for the low voltage side? If the red and green short then there is a very high amperage required before the breaker on the high side will trip (5 times as much assuming it's a 120v to 24V transformer)
Comment: @ratchetfreak Modern doorbell transformers have a self-resetting thermal switch internally - if the transformer starts heating up, then it disconnects the primary.  Decades ago they had small fuses on both legs of the primary, but thermal detection performs the same overcurrent protection as well as thermal protection.
Answer: For safety's sake you should mount the bell transformer in a manner that the low voltage wiring does not come into the same enclosure as the mains wiring. There are available bell transformers that come already mounted on a electrical box cover. The transformer is on the outside with the low voltage leads exposed. The transformer primary leads project down through the plate so that they end up inside a box where then can be safely attached to the mains wiring.
So unless that transformer already has a threaded mount for an electrical box knockout then you should set that transformer aside and get one of these:
Answer: No.  The NEC requires a distinct separation of low voltage wiring and high voltage wiring, so you cannot have any part of the low voltage wires or the transformer itself inside the electrical panel.

National Electrical Code 2014
725.136(A) General. Cables and conductors of Class 2 and Class 3 circuits shall not be placed in any cable, cable tray, compartment, enclosure, manhole, outlet box, device box, raceway, or similar fitting with conductors of electric light, power, Class 1, non-power-limited fire alarm circuits, and medium power network-powered broadband communications circuits unless permitted by 725.136(B) through (I).

If it's a proper doorbell transformer, then it will include safety features internally to protect it from overcurrent and overheat conditions, and it will include a fitting on the primary (household voltage) side that allows it to be properly installed into a knockout on an AC electrical box.  It is permitted to use a knockout on the electrical panel itself for this purpose, as long as the transformer and all low voltage wiring are outside the electrical box or panel.
Answer: I think it shouldn't be inside the main panel at all. And it shouldn't be rattling around loose anywhere. At least bolt it to the outside of the panel.
See also this related question for advice on connecting it.
Answer: NEC says no. Going beyond this requires some common sense.
Question: Your circuit breaker panel is flush mounted with the sheet rock then what?  Answer: Do not bury the transformer behind sheetrock. Use a Junction box and ensure to mount it  in a location which provides access , yes it will fail. Annotate on circuit breaker panel its location.
Electrician for 30+ years says some idiot will try to connect the low voltage 12/24 to the high 120/240
Comment: Heck, you could even punch a KO in the deadfront and mount the transformer to *that* if you really, really wanted to. Also, if you are mounting a transformer to a box faceplate, terminate the primary leads in a luminaire disconnect and then connect the incoming hot/neutral to the other side of said disconnect -- that'll make it easy to get apart in the future :)
Comment: Hello, and welcome to Home Improvement. Thanks for the answer; keep 'em coming. And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to contribute here.


On a multi-city route, is there a limit to the number of people who can book tickets from any one of the cities?

Question: For example, consider a flight from Los Angeles to Moscow via New York. Is there a limit to the number of tickets that can be bought from either Los Angeles or New York?
Comment: It can be very complex and quite specific. A non-US airline may for instance not be allowed to sell LA-NY tickets at all (only LA-Moscow or NY-Moscow). Or, there could be rules forcing them to sell at least X seats on the Moscow-LA route to be able to stop in NY (don't think that applies here, but see Emirates for the Dubai-Sydney-Canberra flight for instance). Do you have a specific reason for the question?
Answer: In general, no. Each airline manages their tickets and fare pool as they see fit. For example United will manage something  "LAX to FRA" as a route with its own set of fare rules. They may route this through EWR, but also through any other suitable United hub (ORD, IAD, SFO, ...) or a codeshare with Lufthansa. That's typically done dynamically, i.e. when you book the ticket, they route you through the "cheapest" hub at the time.
"Cheap" and "empty" are often related. As a a certain flight fills up, the airline typically yanks up the prices, whereas prices will generally stay low, if the flight remains empty. Hence picking the "cheapest" route helps balancing load at the same time.
Your specific example may be different. The only airline that flies between New York and Moscow is Aeroflot and the only LAX->JFK->MOW route is with JetBlue and Aeroflot. These are two loosely  affiliated airlines and I don't know how they manage their shared ticket pools. Aeroflot also offers a non-stop to LAX which seems very attractively priced, so that would be the way to go here.
Answer: In a generic domestic multi-city flight, operated by a single domestic airline, there is usually no such restriction.
When it comes to international flights or codeshares, then it may become a lot more complex, due to restrictions on the "Freedoms of the Air", associated negotiations, or commercial agreements. There could also be operational reasons.

Consider a flight A-B-C, where B and C are in a single country, but the flight is operated by an airline of the country where A is.
The country where B and C are may allow the internal flight, but may either forbid sales on that segment taken alone (i.e. the airline can sell tickets between A and B, or between A and C, but not between B and C). That one is actually quite frequent (or at least it used to be, not so sure nowadays).
Or it may allow it, but set limits on the number of seats sold that way.
Consider an airline which wants to add more flights between A and B. But the country where B is wants the airline to serve another minor city C, while the airline feels the city is too small to operate a dedicated flight between A and C. They may end up with a deal that allows the airline to add a flight to B, provided they then continue to C.
This may then result in the country setting a limit to the number of passengers stopping in B, or trigger the case below.
The airline may feel there aren't enough people on one of the segments, and not use a full crew (especially if the flight is one very long haul segment followed by a short haul segment). This would then result in a limitation on the number of passengers they can actually carry (there are rules which state you need X crew per Y passengers).
Of course, in that case, if they frequently hit the limit, the airline will adjust its roster and add a full crew!
When multiple airlines codeshare a flight, depending on their agreements and their reservation systems, they may either shared the same pool of seats, or pre-assign a number of seats to each of the codeshare partners. The number of seats for each partner may not be the same on all segments (actually, not all segments are necessarily shared by the same partners). I honestly hope that current reservation systems are not encumbered by such limitations, but as will all legacy systems...
Comment: For #3: This might vary by country, but for the US, I believe the rules specify that you need one flight attendant per 50 **seats**, regardless of how many of those seats are occupied by passengers.  Of course, it could be that the airline normally has more FAs than the minimum, for better customer service, but cuts it to the legal minimum when the passenger count is low.


Good explanation of a real image?

Question: Okay well I've started to study phys chem in school recently and I honestly can't get my head around what a real image actually is I've asked my teacher to demonstrated it but she's quite lazy, and then I got this sudden flashback of something I learned about renaissance art in primary school. Its the camera obscura painters used to use it or something I don't know but I just wondering does this explain what a real image is or am I just a idiot, here is a picture : http://upload.wikimedia.org/wikipedia/commons/a/a2/Camera_obscura_1.jpg
Comment: Possible duplicate: http://physics.stackexchange.com/q/2658/2451
Answer: The best way to differentiate between a real and virtual image is, if you put a sensor (e.g., your eye) at the location of the image, does it actually see the image?
In the case of a virtual image, the place where it is when you draw the ray diagram, if you put your eye there, you won't see the image, because it's usually behind the mirror or whatever is creating it.
With a real image, if you put your eye where it is when you draw the ray diagram, you will definitely see something.
Comment: if you put your eye at the location of a real image, all you'll see is a bright glare.  Unless you mean to remove your cornea and lens and allow the real image to fall directly on the retina (Don't try this at home!)
Answer: With a real image, there are continuous rays of "light" or other radiant energy propagating from the object point to the real image point.
With a virtual image, no rays go continuously from a point on the object to the corresponding image point on the virtual image.
Adding some of the side bar questions.
Yes you can photograph the virtual image with a camera pointed so as to see through the optical system producing the virtual image.
And as to why can't we see real images.   Well in fact you do see a real image that is projected on your retina, and if you put a screen at the position of a real image, then you just look at the screen to see the real image.
With a simple magnifying gass type of lens, the real image will be inverted from the object, as if all the rays were passing through a pin hole.   With the virtual image fromed by the same lens the image is not inverted.  (the geometry of course is different from the real image case.)
Perhaps the easiest way to grasp the concept of a "virtual" image, is to simply look in an ordinary plane mirror.   You are looking at a virtual image; possibly of yourself.  Clearly you can point your camera at the mirror, and take a picture of yourself; and the camera too.
But you think there is another you, with another camera BEHIND the mirror.   Clearly no light is coming from anything behind the mirror.

Good explanation of a real image?


What kind of aviation careers could I pursue?

Question: I really want to be involved with airplanes and airports, but I'm not sure what the best career to go into is. I have thought a lot about air traffic control, piloting, and flight dispatching, but is there any other careers that I should think about?
Answer: Aviation is a large field,
You can work for an Airliners manufacturer, a Military plane manufacturer, Business Jet manufacturer, Small planes, ....
You have also opportunities in the safety field, like Flight Simulator manufacturer, Authorities, .....
The question is more about what are your competencies and what do you like to do. Because flying and air traffic control are really two different kind of jobs.
Answer: You don't have to have a precise plan to get started.
You didn't describe your age or education level, but you can probably find basic aviation classes at your local community college or flight school.  Start with some ground school, and lessons aimed at just a First Solo.   As you learn more about aviation, you'll see what appeals to you.
Some other related fields you might like are: A&P maintenance, Line Service, Aircraft Sales, Aviation Insurance, Aviation Law, Avionics.  (and probably many others)


Have there been long-term studies on the effects of separating twins at school?

Question: I have toddler twins that are currently in the same class at school. What research has been done so that I can decide whether or not to separate them next year?
Answer: This really depends on your twins. There is no generic answer that fits every twin couple. It all depends on the competitiveness of the children. If you see that one is constantly overruled by the other, splitting up might be good. If they really develop well and they like the others company, let it be in one class. We have kept our twins together, but we continue to assess the situation.
Comment: I can't imagine a study that could give a better answer than this. It really is the sort of thing that will depend on the kids.
Comment: It seems that the answer to most question about raising kids start with "It depends on the kids . . . ." :)
Answer: Don't separate unless there's a good reason to.
Here's my story, and the reasons behind it:
I spent several years in the same class as my twin, but later (as we moved to a new country) we were put in separate classes. Much later, we were again in the same class.
We were separated because my brother relied too much on me; he didn't make notes on what homework was required, so if I didn't write it down or remember, we were both screwed. By separating us, my brother learned to get by alone, and so it wasn't a problem that we were in the same class again later.
But the separation had social downsides because the two classes were not on speaking terms so we were isolated from each other also during breaks, and having class friends over was always difficult. The teachers knew about this class "war" in advance but didn't think it would matter. It did.
So if there is a good reason to separate, and there are no serious known downsides, then do go ahead. But consider when and how to join them again if other issues arise.
At the same time, make sure they get opportunity to spend enough "twin time" together away from that "split-class" context, like in a sports club or scouts club.
Comment: That sounds like a somewhat uncommon situation to me... though I could be wrong; it certainly sounds like others have underestimated this before me! I don't think I'd take away that "you shouldn't separate unless there's a good reason to;" rather I'd take away that if you are considering separating twins for class you should make sure they have the time and closeness they need together in other formats.
Comment: No, I meant - the situation you describe, of "class wars" so fierce that having a brother in the opposing class is a real problem, sounds uncommon.
Comment: It's not uncommon at all. Twins are often not equally strong in all fields; there's always one more prominent twin, but it varies depending on the topic (say, math vs. sports). I updated my answer based on your comment.
Comment: Ah; yes I hope such strong rivalry is uncommon. Still, your input is valid: make sure there's time for "twin time" somewhere.
Answer: It used to be common for schools to insist twins be separated in school, regardless of the parent's views. Thankfully, this seems to be less common these days. My school district has never pushed to override a parent's preference. After all, they know the kids best, and they have to live with the results. I don't.
That said, I've had twins together, twins with me but different periods, and twins separated to different teams of teachers. I have a set of triplets in the same room this year. My anecdotally supported opinion is that there can be no general advice. Kids are different. Somebody's got to know the kids as individuals and make a decision.


Updating Ubuntu, Unmet dependencies

Question: When trying to open Ubuntu Software center getting this:
This error could be caused by required additional software packages which are
missing or not installable. Furthermore there could be a conflict between software
packages which are not allowed to be installed at the same time.

When trying to execute: sudo apt-get -f install getting this:
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 leap : Depends: libgl1-mesa-glx (>= 7.7.1) or
                 libgl1-mesa-glx-lts-precise (>= 7.7.1) but it is not installable or
                 libgl1-mesa-glx-lts-quantal (>= 7.7.1) but it is not installed or
                 libgl1-mesa-glx-lts-raring (>= 7.7.1) but it is not installed or
                 libgl1-mesa-glx-lts-saucy (>= 7.7.1) but it is not installed or
                 libgl1-mesa-glx-lts-trusty (>= 7.7.1) but it is not installed
E: Unmet dependencies. Try using -f.

Can someone help me with this?
Comment: Did you tried `sudo apt-get -f install` as it said?
Comment: it's the answer, when I try to do it
Answer: Good Luck!

sudo dpkg --configure -a
sudo apt-get -f install
sudo dpkg --configure -a
sudo apt-get update
Answer: Try sudo dpkg --purge --force-all leap

Updating Ubuntu, Unmet dependencies


What is the password if we put blank in type password,retype password coln in the option of password change?

Question: I have installed ubuntu 12.04,encrypting home folder.Later I wanted to remove password.Earlier I used windows OS.There was an option for without password in windows.
In ubuntu,while resetting password,I put nothing in the type password,retype password and I pressed enter key.After reboot ubuntu is asking password.I put my earlier password,without punnting any letter,just pressed enter and I tried all other options to login.But ubuntu says wrong password. What should I do to open my system?
Answer: You can try following solutions :

If you have set password for root access then login as root and set
  new password directly for your administrator login.... If you don't
  set password for root just try it with blank.

OR

If you boot from a LiveCD/USB and create a new user with a known
  password you can copy the password hash from /etc/shadow in the live
  filesystem to the shadow file in your usual file system on the disk,
  then reboot and use the known password you copied across.

else follow this thread http://ubuntuforums.org/showthread.php?t=1860583.
Hope this will helps.


Primers in "Blood Meridian" — an unmentioned/overlooked detail?

Question: This somewhat recapitulates my question about making gunpowder which was so brilliantly answered yesterday.
Basically, my question is, given that the gang in Blood Meridian certainly had primers, which I understand to be small metallic containers which are full of, importantly, a high explosive -- probably mercury fulminate. Such devices could not be made in the wilderness. Acid and mercury are required -- I think temperature also matters and the small containers have to be made in such a way that the firing pin of the weapon detonates the explosive.
My belief is that a weapon which uses primers simply could not effectively be used without them -- they have no other way of causing the gunpowder charge to go off.
Prior to primers, a spark from flint or even an open flame was used. Far less reliable.
So is the failure to mention primers in the lengthy gunpowder creation segment of Blood Meridian an indication that their weapons did not use them (at that time -- Tobin is recounting a story that occurred prior to the Kid joining the gang) or that, of course, they had literally thousands of primers because they were out of luck when the ran out away from a bigger town or is it just an omission on Cormac McCarthy's part?
Or the remote possibility that some pistols could work with or without primers? I note that primers were one of gifts that Glanton with uncharacteristic generosity/kindness bestowed upon the men trapped in the fortress -- I assume he would not have given them had they not been absolutely necessary.
Answer: They mention repeated times throughout the book including during the gunpowder making scene that someone Caps or capped the cylinder or piece, this is referring to priming the charge with a percussion cap which is the primer, these are small and often in tins by the hundreds so are easily carried in large quantities, so it is assumed and shown through the text that the band has caps at that point but only lack the gunpowder during that sequence in the story.


frequency of millions of data values in a csv column

Question: I have a long list of numbers (a single column that has 5 million rows), that are not all unique from one another. I want to see which thousand of them are the most frequent occurrences in the list. Any ideas on how I could do this easily? I could use excel or a python script or other means too.
Comment: Read each line. Use a `dict` to count occurrences. Sort by count.
Comment: Python could do this quickly but share us a sample of the data (I assume it is a CSV-file)
Answer: In Bash:
sort filename | uniq -c | sort -nr

Comment: Or just `sort < filename |` etc.
Answer: Here's one way with Python using csv.reader and collections.Counter:
import csv
from collections import Counter
from itertools import chain
from io import StringIO

mystr = StringIO("""1
2
3
3
1
1""")

# replace mystr with open('file.csv', 'r')
with mystr as fin:
    # define lazy reader object
    reader = csv.reader(mystr)
    # flatten, convert to int, feed to Counter object
    c = Counter(map(int, chain.from_iterable(reader)))

# calculate 2 most common items, return number and counts
print(c.most_common(2))

[(1, 3), (3, 2)]

Comment: thanks for the explicit example. i'm a little confused though; where are inputting the csv file that's to be sorted/counted?
Comment: Thanks again and apologies for the oversight. I used the above code and encountered this error. Any idea what it means? Is it saying that there's a data element that is not an integer?:

ValueError: invalid literal for int() with base 10: '\x1a'
Comment: argh. sorry for all the messages but i figured out that that error was because python can't read the EOF character so i just deleted that row. but now i am getting the problem that the numbers that the script is writing to the output CSV file are all in scientific notation. how can i make it so that the script doesn't do that and instead writes the integer and just the integer in standard notation to file? like fir example the first row of output i am currently getting is of the form: 2.202384070000000000e+08,3.700000000000000000e+01. Thanks again.
Answer: Tom's approach in Python:
d = dict()

import sys
for filename in sys.argv[1:]:
    file = open(filename, 'r')
    for line in file.read().splitlines():
        if line not in d:
            d[line] = 1
        else:
            d[line] += 1
    file.close()

import operator
print "Item,Count"
for line in sorted(d.items(), key=operator.itemgetter(1)):
    print line[0] + "," + str( line[1] )

Usage:
python linesorter.py filename1.txt filename2.txt filename_...

Comment: thanks so much. i tried this but received an error. what i did is place the script into a file called linesorter.py in my directory that has the csv file. then i opened CMD in windows and tried this line:

C:Users\username\Desktop\hs-2> cat test.csv | python linesorter.py

Which gave me this error:

'cat' is not recognized as an internal or external command, operable program or batch file.

And advice? Thanks and much appreciated...
Comment: by the way -- i don't know if this is the correct way to do it but for the character between test.csv and python in the command, i used the character that's SHIFT+Backslash.
Comment: @user2047228, you entered everything right, you're just on windows so you don't have cat installed by default. I updated the program so it'll open your files directly.


This task requires "all conditions to be met" or "that all conditions are met"?

Question: This text is a "hint" that is shown for a task in a task management app.
I want to indicate to a user that this specific task is only created when all conditions from a list are satisfied.
Please help me to put it in a grammatically correct way.
Comment: The first one seems ok, only without "to".
Answer: I find the phrases "this task requires" and "is only created" somewhat elliptical. What is it about the task that requires those conditions to be met?  Can the task not be performed or executed until those conditions are met? Can the task not be scheduled until those conditions are met? Can the task not be created until those conditions are met? If created is what you want, then "created" could be put in the blanks here:

All conditions on the list must be met before this task can be _____.
This task cannot be _______ until all conditions on the list have been
   met.

Is the task explicitly (i.e. manually) created by the user only after those conditions are met? Or is the task automatically created by the app when those conditions are met?
If the user creates the task manually, then the active voice would be preferable if there are other tasks which do get created automatically:

All conditions on the list must be met before you can _________ this task.
You cannot  _______  this task until all conditions on the list have been
   met.
Comment: Thanks for putting effort in this. The app logic is that conditions are here to indicate when task is necessary at all. Otherwise it will be skipped / not created. Example: "CFO Approval" task is only needed when "Purchase amount" is more than $10,000.
Comment: I think you mean to say "allowed" or "permissible", not "necessary".  A task may have prerequisites, but when those prequisites are met, the task does not necessarily become obligatory.


MSBuild, NAnt and Unicode symbols

Question: %username%.
I have a problem with Unicode symbols while building my custom C++ files with MSBuild and NAnt.
Overview:
I write my own extension for MSVS10. In MSBuild scripts I implemented Build, Rebuild and Clean targets. For example in Build target I want to call NAnt.exe with parameters of NAnt build target file and some UNICODE parameter (for example some symbols - ㅇㅀㅇㅀ.cpp). When I call it in MSBuild target with Exec task in Output Window log is OK, I see ㅇㅀㅇㅀ.cpp, but if I use echo target in NAnt target I get ????.cpp in log.
I think that this problem in MSBuild, because when I debug my own functions for NAnt written with C# and MSVS10 and in debugging I start NAnt.exe with UNICODE parameters I get normal UNICODE string to my functions.
What do you think about this problem?
Comment: This is confusing.  You seem to be saying that it works when you call from an MSBuild Exec task, but then say it doesn't work when you use echo in NAnt, then say you suspect it is an MSBuild problem.  How can it both work and not work?
Answer: Which version of NAnt are you using?
NAnt v0.91 now has the ability to specify the encoding to use when calling the  task.
http://nant.sourceforge.net/release/0.91/help/tasks/echo.html
<code><echo message="ㅇㅀㅇㅀ.cpp" encoding="unicode" />
</code>

MSBuild, NAnt and Unicode symbols


What exactly happened to Thranduil's face while he was arguing with Thorin?

Question: In the heated discussion between Thranduil and Thorin, for a moment, Thranduil's face suddenly turned very deeply scarred & wounded and then immediately returned to normal. What was this about? Is it a reference to anything that was cut out of the movies? (I have not read the books, sadly, but am very curious about this.)
Comment: Look at that. You only have to wait a million minutes and someone'll come along with a [canon](http://scifi.stackexchange.com/a/125777/20774) answer...
Comment: I always assumed that he was scarred by dragon fire but some kind of elven magic conceals the wounds and in this scene he was choosing to show what his face really looks like.
Answer: I found this source but I don't know whether it is what you are after.

Thranduil's sudden scars reflect a little emphasized of Tolkien's lore: elves'  "Fëar" (a metaphysical concept analogous translatable as "soul") occasionally  influences the "Hröa" (the fleshly, physical body), particularly under moments of  extreme stress. This can manifest as extreme physical changes that reflect the mind's state, in this case deep war scars.

Source
I have also found this reference which seems to state that Tolkien made no reference to the Scars on Thranduil's face in the books.

Thranduil's scars are decidedly non-canon. According to Tolkien's texts, the last battle Thranduil saw (up to setting in The Hobbit) was that of the last alliance at the end of The Second Age. However, in the 1900's of the Third Age, according to text, the "serpents of the north" were fought and mostly slain. In all likelihood, Peter Jackson is taking creative liberty with the story. On a more symbolic note, the scars could represent the pain Thranduil has endured in war (he watched his father die in the battle of the last alliance).

Source
Comment: Pretty sure this was during the scene where they were talking about Dragons and how dangerous they were...  perhaps something about Dragon fire... And he gets angry saying Don't you dare tell me about dragons / dragon fire.  I believe that Thranduil ACTUALLY has a scarred face due to battling dragons and that he uses some sort of illusion magic to hide his scarred face.  If they took the lore from Tolkien regarding Fear and Flesh that's a plausible theory as well.
Comment: @DoctorWho22's theory is what I took away from the scene. Whether or not it's in the books (I need to re-read them, it's been *years*), I believe Thranduil was scarred in battle with a dragon, and that he now uses "elf magic" to keep his scars hidden. In arguing with Thorin, he either loses his focus in his rage or, to emphasize his point, he deliberately "turns off" the illusion; either way, what we briefly see in that scene is the scars his body actually bears from "dragon fire", as he is speaking of at this moment. Won't post this as an answer, though, because I have nothing to back it up.
Comment: I'll have to check HoME later on to see if the first statement can be corroborated: even if so, Jackson wouldn't be legally allowed use it, so I highly doubt if it's in reference to anything like that.  The latter, more prosaic explanation seems most likely: maybe there'll be something in the EE or the 3rd movie?
Comment: An illusion! What are you hiding??
Comment: That is a good discussion. It is what I was looking for.. Rather, I came across this while Googling the same, but there are a lot of speculations in it. I was looking if someone over here could give a more specific answer based on the books or so...
Comment: Please See my Edit
Comment: so was it his fear or anger showing up on his face, or was it a past scar that was simply resurfacing because of the topic of a Dragon?
Comment: I cannot begin to scribe how often in fantasy novels do elves use illusion magic to alter their appearance, particularly those of royal blood. @DoctorWho22's theory was what I assumed as well, mostly because I've encountered the situation so many times in so many books.
Answer: This is discussed in the Director's commentary. Thranduil's prior encounter with dragons (which the Director happily admits is not from the books) was included to explain his deep isolationism and the reason why he wouldn't help the dwarves. There's also the suggestion that a firedrake killed his wife, explaining her absence from the film.
As to the sudden appearance of his scars, the implication is that he normally uses Elven magic to disguise them. To emphasise his little speech, he allows this 'glamour' to drop momentarily.

Peter Jackson: What's interesting is that Thranduil's had this encounter with dragons before ... and his wife was ...
Boyens: There's a conceit we came up with. Actors need that. They need to feed on that backstory. Where did this isolationism come from?
I also like the notion that this very 'closed off' character is also one
of the greatest fighters on Middle Earth.
Answer: Thranduil mentions that (Paraphrasing because of memory) "Do not talk to me of Dragon Fire, I have felt is wrath and ruin. I have faced the Serpents of the North". Although I don't think Tolkien made any canon mention of these fights, or none that I've found. I think Peter Jackson did this to add some common ground between Thranduil and the Dwarves that I'm sure will play some part in the third film.
Comment: He said: > Do not talk me of dragon fire. I know its wrath and destruction. I have faced the great serpents of the north. And in the PC game _Battle for Middle-Earth_ there are fire breathing serpents called wyrms. I think Thranduil mentions this when he said it.
Answer: I read the Silmarillion many years ago, and I immediately assumed, when Thranduil mentioned the serpents of the north, that PJ concocted a history where Thranduil had a run-in with one of the dragons from Angband somewhere in the First Age, when he still lived in Doriath. It is plausible.
I did not think the scars were real; I thought he summoned the memory of the wound and it manifested on his face briefly. But I really think the 'scar' was the illusion, not the reality as so many others think.
Comment: Interesting theory..
Comment: I read G Wilson's first comment and agree with it - the soul affecting the body. That's what I meant.
Answer: The book does not refer to any scar or to Thranduil being somehow disabled, but the movie makes it seem so ´cause the Movie!Thranduil has an extensive scar and an apparently blind eye as a result of the scarring (caused by the dragon fire).
What does it mean in the movie? I dunno, I was baffled, too. But I understand it in two ways:

he battled the dragon, it scarred Thranduil for life, and now he is forced to wear a glamour on his face to hide the ugly mark. But it probably reveals itself after a period of stress or in times of anger.
he battled the dragon, it scarred Thranduil for some time, and the resulting mark on his face really did look like this for an unspecific long period of time. However, the scar got already healed somewhere in the past, and now, when it revealed itself again, it must be just a manifestation of the venomous anger that Thranduil holds inside of him.
Answer: My guess is that PJ took the fear/hroa concept one step further to expose the hubris of Elven arrogance/beauty.  Translation:  dragon's fire is the one thing elves cannot fully heal and scars permanently.
Answer: There is a trope common among many fantasy stories that Elves have a special power called Glamour, which is a kind of magical make-up.
In the Sandman comics, an Elf girl is given to the Dream Lord, and he tells her that she doesn't need to use her Glamour in the land of Dream; she suddenly becomes much shorter, older, and uglier. I seem to recall something similar in Spencer's The Fairy Queen (the distinction between Elves and Fairies has not always been so clear, cf. Fairies by Brian Froud).
Under this interpretation, the scars are real, and Thranduil's normal fair appearance is an enchantment or spell that he casts over himself.
Comment: Our word "glamour" comes from an old scots term for faery illusion, so this has very deep roots in folklore.
Answer: I think somewhere along the line Thranduil did face 'the serpents of the North', and instead of his scars appearing in moments of anger he chooses to have them be shown to prove to Thorin of his hardship.
Answer: Thranduil is a survivor of Doriath, which was destroyed, in part by fire drakes, in 506 FA; it was here that he was burned by a dragon (the 'serpents of the north' he mentions). He hides the burn scars with illusions but they're still there which is why he tells Thorin he knows all about dragon fire. He got burned by one and it was permanent. I'm pretty sure it's in the Silmarillion book by Tolkien, the history of middle earth.
Comment: Nope, it's nowhere in Tolkien (there weren't even any dragons in the Last Alliance as they were dormant from the end of the First Age to late Third Age).  I do believe you just made that up.
Answer: I think he was scarred by a dragon sometime in the past and that the gems he seeks (which he asks Thorin for in exchange for there freedom) somehow allow a spell of illusion to hide the scar. Watch again and you'll notice he is wearing a ring with a white stone in it... is this the same gem he is seeking? We know that elves are obsessed with outward appearance and beauty... for one to be so scarred would be a terrible thing.
Comment: Is there any canon support for this? Thx


What is cosmic ray albedo neutron decay (CRAND)?

Question: I need a small description of what is cosmic ray albedo neutron decay (CRAND), where it comes from and what effects they have?
Comment: For anyone that is intrested in that subject area, i found that link which may be helpfull : https://www.nature.com/articles/nature24642
Answer: I've never heard the specific acronym CRAND.
However, cosmic rays which reach Earth's ground level lose energy by, among other processes, spallation on the heavy nuclei in the soil and rock.  Some of these spallation neutrons will leak back out of the surface of the ground, having partially thermalized$^1$.
These neutrons basically form a very tenuous part of Earth's atmosphere, with a scale height somewhat higher than the nitrogen/oxygen/ozone parts of the atmosphere, because the neturons' temperatures are comparable to the other gas species, but the neutrons are less massive.
I think an astronomer might consider these "albedo neutrons from cosmic rays" (your CRAN).
A thermal neutron at the ground, with average speed $v\sim 2\rm\,km/s$, can certainly reach the ionosphere/exosphere within its 1000 second half-life.  The fraction that decay above the atmosphere will contribute to the population of electrons and protons trapped there.
My dumb Google search also finds solar proton albedo neutron decay, which sounds like the same effect but triggered by the solar wind rather than by cosmic rays.
That would be more important on a planet without an atmosphere or magnetosphere to modulate the solar wind protons.
My slightly less dumb search finds this 2017 Nature paper
that says I mostly guessed right, but that my involvement of the ground rather than the upper atmosphere was some terrestrial chauvinism on my part.

$^1$ One of the early papers describing these neutrons has a great comparison between the detectable neutron flux in St. Petersburg in a boat in the harbor (where the spallation neutrons from the seabed are mostly captured in the seawater), over bare ground (poorly thermalized), and over a meter of snow (well-thermalized). All I'm finding today are balloon flights:
Flerov et al., JETP 9, 511 (1959); Kopff, Phys. Rev. 59, 949 (1941).
Comment: *::chuckles::* I nominate the use of *"very tenuous"* here for understatement of the year.
Comment: @dmckee I'd like to have a number in my head for the cosmic ray neutron number density, to compare to e.g. the [metal ion atmosphere of Mercury](https://en.wikipedia.org/wiki/Atmosphere_of_Mercury), but I couldn't do it in fifteen minutes. That seems too homeworky for a followup question, though.
Comment: Unfortunately, the resources that come to my mind immediately are for fairly deep neutrino detectors, so they don't give you the near-surface production rates or the fraction that wander back to emerge above ground. But I think you can get some sense of the scale from the lack of a line-item for this process in background radiation source charts.


MySQL 8.0.24 Windows 10 crashes [not] resolved by reboot, [requires mySQL optimizer tweak]

Question: MySQL 8.0.24 on Windows 10 (10.0.18363.0) crashes near the same point when running a final results query, but only after data input queries with many more records have been run.
A restart of the MySQL service does not resolve the crash, and it's repeatable.  After a full reboot of Windows (via shutdown /r /t 1, to ensure a hard reboot) no crash; the final results query runs and completes in 4 minutes.
I suspect Windows memory resources are consumed or corrupted by my large initial data load process are not restored until reboot, but the error only manifests its presence when I run a downstream query.
What could be getting corrupted in Windows by MySQL that would be restored with a reboot?  The details below are specific to this instance, but my question is general:

Do large (6Gb) load into Windows/mySQL using new parallel tools
Attempt simple query on results, crash mySQL
Same simple query succeeds only after Windows reboot, mySQL restart does not fix. How can I avoid breaking Windows mySQL with large data loads where the only (and reliably repeatable) fix is a hard reboot?Question is not 'require reboot', but why crashing on large queries?

Details
Much of the detail following below turns out to be irrelevant, see accepted answer for explanation.

The data loading queries run before "final result" are using the mysqhsh util.importTableutility (introduced 8.0.17), an enhanced shell command that invokes LOAD DATA INFILE across parallel threads. This cuts the data load time from a couple of hours to about 50 minutes.  I have 6Gb of data, most of it in two tables with 1-2 million rows each.  Data is loaded with PRIMARY KEY in the parallel utility, then indexed with ALTER TABLE ADD INDEX.

All of that runs without any error, consistently, with data sets that change and grow slightly daily.

The results query that fails takes values from other tables created during the data loading and post-processing, then UNIONs them to have a data header, and writes out the result to a couple of files.  The two queries yield < 100K records and usually many fewer, as they're deltas.  That's all it does.  All the complexity and big joins are in the data load and process .sql scripts, and all of those run without error but appear to be corrupting Windows.

I have tried various settings on the InnoDB family, including different number of buffer pool extensions, hash index on/off, innodb_flush_neighbors, innodb_lru_scan_depth, etc.  These do have an effect on performance, but do not affect this problem.

During initial data load, I set ALTER INSTANCE DISABLE INNODB REDO_LOG (new as of 8.0.21) to speed up initial data loading, but restore ALTER INSTANCE ENABLE INNODB REDO_LOG before running the query that fails.  Off-topic note: If you use this don't forget to re-enable, as any system glitch or crash that affects MySQL will result in a corrupted instance. BTDT. Only use during initial input, as recommended.  I have not yet tried running the input process leaving REDO LOG enabled.  That's my next test.

---

No triggers or stored procures are set up in this schema, and nothing else is running. No triggers at all in this MySQL instance, actually.

### Log and .ini settings

The error log (.err) from the crash is below.  The first three lines are warnings during input, where I am toggling the redo logging (note the times are spread out), before any trouble.   The last of those is an ENABLE (as it should be).  Next line SQL has crashed and mySQL80 service is not running.  At 2021-05-01T23:17:49 I have restarted the mySQL80 service manually:

none ! 2021-05-01T22:20:43.437169Z 1905 [Warning] [MY-013601] [InnoDB] InnoDB redo logging is enabled. Data is now safe and can be recovered in case of a server crash. !    2021-05-01T22:35:52.244860Z 1966 [Warning] [MY-013600] [InnoDB] InnoDB redo logging is disabled. All data could be lost in case of a server crash. !    2021-05-01T23:03:05.731314Z 1966 [Warning] [MY-013601] [InnoDB] InnoDB redo logging is enabled. Data is now safe and can be recovered in case of a server crash. !    23:14:04 UTC - mysqld got exception 0xc0000005 ; !    Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware. !    Thread pointer: 0x280d9a167e0 !    Attempting backtrace. You can use the following information to find out !    where mysqld died. If you see no messages after this, something went !    terribly wrong... !    7ff686461930    mysqld.exe!?set_compression_level@Zstd_comp@compression@transaction@binary_log@@UEAAXI@Z() !    7ff68646104a    mysqld.exe!?set_compression_level@Zstd_comp@compression@transaction@binary_log@@UEAAXI@Z() !    7ff684fa32d7    mysqld.exe!?ha_rnd_next@handler@@QEAAHPEAE@Z() !    7ff685295e71    mysqld.exe!?Read@TableScanIterator@@UEAAHXZ() !    7ff6854616f7    mysqld.exe!?Read@FilterIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461757    mysqld.exe!?Read@FilterIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685461916    mysqld.exe!?Read@NestedLoopIterator@@UEAAHXZ() !    7ff685460b99    mysqld.exe!?MaterializeQueryBlock@MaterializeIterator@@AEAA_NAEBUQueryBlock@1@PEA_K@Z() !    7ff685460118    mysqld.exe!?Init@MaterializeIterator@@UEAA_NXZ() !    7ff685304938    mysqld.exe!?filesort@@YA_NPEAVTHD@@PEAVFilesort@@PEAVRowIterator@@_K3PEAVFilesort_info@@PEAVSort_result@@PEA_K@Z() !    7ff6854302ae    mysqld.exe!?DoSort@SortingIterator@@AEAAHXZ() !    7ff68543063a    mysqld.exe!?Init@SortingIterator@@UEAA_NXZ() !    7ff68545fcb4    mysqld.exe!?Init@AggregateIterator@@UEAA_NXZ() !    7ff685460b5a    mysqld.exe!?MaterializeQueryBlock@MaterializeIterator@@AEAA_NAEBUQueryBlock@1@PEA_K@Z() !    7ff685460118    mysqld.exe!?Init@MaterializeIterator@@UEAA_NXZ() !    7ff685460b5a    mysqld.exe!?MaterializeQueryBlock@MaterializeIterator@@AEAA_NAEBUQueryBlock@1@PEA_K@Z() !    7ff685460118    mysqld.exe!?Init@MaterializeIterator@@UEAA_NXZ() !    7ff6852f99be    mysqld.exe!?ExecuteIteratorQuery@Query_expression@@QEAA_NPEAVTHD@@@Z() !    7ff6852fb0d6    mysqld.exe!?execute@Query_expression@@QEAA_NPEAVTHD@@@Z() !    7ff68543a51d    mysqld.exe!?execute@Sql_cmd_load_index@@UEAA_NPEAVTHD@@@Z() !    7ff68543a1ca    mysqld.exe!?execute@Sql_cmd_create_table@@UEAA_NPEAVTHD@@@Z() !    7ff685179a71    mysqld.exe!?mysql_execute_command@@YAHPEAVTHD@@_N@Z() !    7ff685174c2f    mysqld.exe!?dispatch_sql_command@@YAXPEAVTHD@@PEAVParser_state@@@Z() !    7ff685173a4c    mysqld.exe!?dispatch_command@@YA_NPEAVTHD@@PEBTCOM_DATA@@W4enum_server_command@@@Z() !    7ff68517500e    mysqld.exe!?do_command@@YA_NPEAVTHD@@@Z() !    7ff684fc64a8    mysqld.exe!?modify_thread_cache_size@Per_thread_connection_handler@@SAXK@Z() !    7ff6863ddbe1    mysqld.exe!?set_compression_level@Zstd_comp@compression@transaction@binary_log@@UEAAXI@Z() !    7ff685fc1d1c    mysqld.exe!?my_thread_join@@YAHPEAUmy_thread_handle@@PEAPEAX@Z() !    7ffb255d10b2    ucrtbase.dll!_beginthreadex() !    7ffb280d7c24    KERNEL32.DLL!BaseThreadInitThunk() !    7ffb286ad721    ntdll.dll!RtlUserThreadStart() !     !    Trying to get some variables. !    Some pointers may be invalid and cause the dump to abort. !    Query (280e085ec78): CREATE TABLE `active_fan_export`  !    SELECT !    `2021 Web Fan Acct Name`, `fan_profile_acct_name` , `Fan Profile`, `fan_id`, `account_type`, `Account Name` !    , `Account ID`, `Agree Name`, `agree_id`, `postal_code`, `state`, `svid` !    ,`>1 yr`,`GA`,`f enroll`,`Discount`,`oe name`,`disc value` !    ,`mobility enterprise type` !    ,`email domain count`,`email domains` !    FROM !    ( !      SELECT  !      -1 as `Rank`    /******************** verbatim headers ********************************************************************/ !      ,'web_fan_acct_name' `2021 Web Fan Acct Name`,'fan_profile_acct_name' `fan_profile_acct_name` ,'Fan Profile' `Fan Profile` !        ,'fan_id' `fan_id`,'account_type' `account_type`, 'Account Name' `Account Name` !         !        ,'Account ID' `Account ID`, 'Agree Name' `Agree Name`,'agree_id' `agree_id`,'postal_code' `postal_code` !        ,'state' `state`,'svid' `svid` !         !        ,'>1 yr' `>1 yr`,'GA' `GA`,'f enroll' `f enroll`,'Discount' `Discount`,'oe name' `oe name`,'disc value' `disc value` !        ,'mobility enterprise type' `mobility enterprise ty !    Connection ID (thread ID): 1141 !    Status: NOT_KILLED !     !    The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains !    information that should help you find out what is causing the crash. !    2021-05-01T23:17:49.000709Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. !

Also here's my .ini with various parameters. This is on a 512GB SSD, 16 GB RAM Dell Precision 3551 laptop: https://pastebin.com/Kz0y3zFD

This reminds me of the bad old days of Windows blue screens and inexplicable crashes.  Windows 10 is much improved but even with 16 GB it's still possible to permanently exhaust resources (for example: open too many concurrent applications or windows, and things still break and require a reboot).  I think I may be pushing those same limits with the parallel threads, giant memory buffers, etc.  Things I will try as time permits:

- reduce innodb buffer size
- mess with numbers of parititons
- use fewer than 11 threads (Intel i7-10850H supports 12 on 6 cores)
- turn on REDO LOG during load
- enable double-write buffering
- run load and final queries with Office 365, chat, etc. shut down
- try on Ubuntu or RHEL host
- other ideas from answers/comments here

---

### More information

["dev.mysql.com/doc/mysql/en/crashing.html"][1] has the following suggestions from mySQL's official documentation. I will respond to each in italics:

* The MySQL server or the server host was killed in the middle of an update. Updates not applied; generally avoid killing server during update

* You have found a bug in mysqld that caused it to die in the middle of an update. Possible

* Some external program is manipulating data files or index files at the same time as mysqld without locking the table properly.No, this is a desktop and only other processes running are Office and a chat client

* You are running many mysqld servers using the same data directory on a system that does not support good file system locks (normally handled by the lockd lock manager), or you are running multiple servers with external locking disabled.Using stock installation on NTFS volume with file locks, not running second server anywhere, no replication ever

* You have a crashed data file or index file that contains very corrupt data that confused mysqld.Yes, crash = confused

* You have found a bug in the data storage code. This isn't likely, but it is at least possible. In this case, you can try to change the storage engine to another engine by using ALTER TABLE on a repaired copy of the table.
Possible, but wondering if the "bug" is in Windows memory management and not mySQL

* Start mysqld with the general query log enabled (see Section 5.4.3, "The General Query Log"). To do: will try General Query Log, other suggestions though some are specific to Linux host

---

To elaborate on "effect on performance", for example, @@innodb_flush_neighbors set to 0 instead of 2 reduced the time spent by the 11 threads in "waiting for handler commit" status, as observed in Workbench.  The effect of that change on the actual time was minimal, about 45 seconds off of a 12 minute load time.  I tried COMPRESSED tables on this data and it slowed down input by about half.

The source table for the query that fails is

 !CREATE TABLE `active_fan_export` ( !  `2021 Web Fan Acct Name` varchar(255) NOT NULL DEFAULT '', !  `fan_profile_acct_name` longtext NOT NULL, !  `Fan Profile` longtext NOT NULL, !  `fan_id` varchar(30) DEFAULT NULL, !  `account_type` varchar(12) DEFAULT NULL, !  `Account Name` longtext, !  `Account ID` varchar(15) DEFAULT NULL, !  `Agree Name` longtext, !  `agree_id` varchar(30) DEFAULT NULL, !  `postal_code` varchar(30) NOT NULL DEFAULT '', !  `state` varchar(10) NOT NULL DEFAULT '', !  `svid` varchar(30) NOT NULL DEFAULT '', !  `>1 yr` varchar(5) CHARACTER SET cp850 NOT NULL DEFAULT '', !  `GA` varchar(2) CHARACTER SET cp850 NOT NULL DEFAULT '', !  `f enroll` varchar(8) CHARACTER SET cp850 NOT NULL DEFAULT '', !  `Discount` varchar(15) NOT NULL DEFAULT '', !  `oe name` varchar(255) NOT NULL DEFAULT '', !  `disc value` varchar(15) NOT NULL DEFAULT '', !  `mobility enterprise type` varchar(30) NOT NULL DEFAULT '', !  `email domain count` varchar(21) CHARACTER SET cp850 NOT NULL DEFAULT '', !  `email domains` varchar(200) NOT NULL DEFAULT '', !  KEY `fan_id` (`fan_id`), !  KEY `agree_id` (`agree_id`), !  KEY `Account ID` (`Account ID`), !  KEY `mobility enterprise type` (`mobility enterprise type`) !) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; !
The cp850 is a surprise; I have no idea where that came from.  I need to go back through the logic to the initial data load.

The importTable multi-thread processing is I/O bound unless indexes are defined.  With indexing included in table definition, the Mb/S on import drops from about 15 to 1, and the 20 minute load time goes up to about 30.  Indexing post-load takes 3 min 30 sec, so I do not include the indexes on these tables when I create them.  Even with 12 threads, the CPUs are all in the 50% range and GUI response (browsers, Outlook, etc.) is barely affected.  The index creation is CPU intensive. It does not use multiple CPUs, but it does bog down response in the GUI (browsers, Outlook, etc.)

A note about I/O intensive: This db formerly ran on an HP Z-book with an i7-6820HQ CPU, with 4 fewer threads and slower benchmarks.  The Z-book came with a SATA M.2 drive and an empty M.2 nVME slot.  I added a WD750 gamer nVME card and moved the mySQL installation and data to it.  That made a 30% speed improvement on loading the tables.  The replacement Dell has only one M.2 slot and the corporate image is on it and can't be touched.  That drive is an nVME KIOXIA 512 GB with benchmarks at about 75% of the WD Black's numbers.  Even with a faster CPU and 2019 mobo tech vs 2016, the slightly slower nVME drive yields load times 5-15% greater for the 6Gb data.

  [1]: https://dev.mysql.com/doc/refman/8.0/en/crashing.html
Comment: I have refined the general question, the details are for the curious but not necessarily applicable to what's asked in the top section (1) large data input (2) mysql crashes on smaller subsequent query (3) windows Reboot fixes, mySQL restart does not
Comment: Your column names include a space character such as `Agree Name` and `>1 yr`,  Please review this URL content and reconsider your column names.  https://anandarajpandey.com/2015/05/10/mysql-naming-coding-conventions-tips-on-mysql-database/ - Also, I notice you have no PRIMARY key for your innodb table named active_fan_export - innodb can reduce overhead when you have a primary key.  Data space required for index storage can be reduced when you have a Primary Key.
Comment: @Wilson Hauck: The output goes to users who require those column names. I could change the headers internally to get rid of spaces and non-standard characters, but I'm trying to keep the code readable for the end user who verifies the logic.  I did ultimately predefine all tables with primary keys (rather than just create by CREATE/SELECT)
Answer: Consider these my.ini [mysqld] section changes
innodb_thread_concurrency=0  # from 25 to allow Windows autosizing
thread_cache=size=10  # from 30 for your 6 core cpu to leave 2 for other purposes.

The error log appears to be having trouble with thread management.
Comment: Good news, bad news: Bad news is this did not solve the crashes.  Good news is that the `innodb_thread_concurrency-0` setting greatly smoothed out data writing to the disk.  Writes observed in the the Workbench Dashboard jumped from intermittent bursts of 2-10Mbs to a steady 40-50 Mbs, which approaches the SSD's maximum
Comment: Please post last 100 lines of your error log after a crash and maybe we can provide further suggestions.  Thanks for your positive news on innodb_thread_concurrency.
Answer: An apparent solution (as in no crashes for several runs, will mark solved if this stands up over time) was found in this post,  where similar text was found in the .err log.
By disabling specific entries in mySQL's optimizer_switch system, no crashes were observed with multiple runs.  The data increases by 10-25K rows per week, so the more recent runs have had slightly larger data sets.  With the newer data sets, crashes were observed even after a clean reboot.  This negates the reboot fix theory from the original post.
optimizer_switch flags
These switches where changed from their default settings, based on this post:
SET GLOBAL optimizer_switch=
'derived_merge=off,
subquery_to_derived=off,
prefer_ordering_index=off,
semijoin=off';

The crashes stopped happening, and there was no measurable decrease in performance. The query takes about 550 seconds to complete either way (though without these switches turned off, it does not complete and crashes more often than not).
Workbench caution: flags are fixed for duration of Workbench session
Workbench appears to read these switches once at start up and they will not change until the tool is fully exited and restarted.
For example, these commands can be issued from inside a Workbench window

but the value reported by the system

does not reflect the changes:

Be sure to confirm the settings from Workbench itself before running a query from the tool.  The REDO_LOG setting is shown as a reminder that a mySQL crash with this flag disabled can wipe out the instance, which happened here. (Fortunately I had recent backups of my instance at hand). Update: I had another crash with Workbench running, then ran the completion after shutting it down.  I won't be running this query with Workbench active, as it seems to be related to either causing the crash or ignoring the optimizer_switch session settings set in my SQL script.
Changes made from the shell work intuitively as expected:  GLOBAL takes effect on restart, and SESSION changes the value in the current session:
Comment: I have run this solution five times with increasing data sizes with no crashes, so I am marking this as a solution.  It is important to make sure Workbench is not running when this script is running.


Finding the chi-squared distribution of a squared difference of two independent normal variables

Question: Given two independent random variables $X\sim N(0, \sigma^2), Y\sim N(0, \sigma^2)$, what is the distribution of a variable $Q = (X-Y)^2/4$ ? What would be the expected value and variance of $Q$?
Comment: @Galaxy Usually, a normal distribution with variance $\sigma^2$ is written $N(0, \sigma^2)$. If you write $N(0,\sigma)$, do you really mean that the variance is $\sigma$ and not $\sigma^2$, i.e. you use the symbol $\sigma$, that is usually used for the standard deviation, as the symbol for the variance?
Comment: The distribution of $Q$ depends on the joint distribution of $(X,Y)$, not just their marginal distributions.
Comment: That's surely not what you intended at all. $X - X$ is identically zero, and so $P(Q=0)=1$. I wasn't asking you to change *notation*. I was asking you to talk about the joint distribution of the two underlying variables in your question. Perhaps you intended that they be independent?
Comment: Sorry for the confusing notation, hopefully my edit makes things more clear? $Q$ is proportional to the difference of two independent instances of the same distribution, not two separate distributions
Comment: Ah ok sorry, maybe now it's cleared up? I did intend them to be independent
Answer: Below, I presume that you actually want X and Y to have variance $\sigma^2$, and not $\sigma$.
Since $N(0, \sigma^2)$ is symmetric over zero, the random variable $Y$ is equal to the random variable $-Y$. Thus $X-Y$ is just the sum of two independent normal distributions $N(0, \sigma^2)$. Using the general formula for the sum of two independent normal distributions $A\sim N(\mu_A, \sigma_A^2), B\sim N(\mu_B, \sigma_B^2)$:
$$
A+B \sim N(\mu_A + \mu_B, \; \sigma^2_A + \sigma_B^2)
$$
we get for $X-Y$:
$$
\begin{align}
X-Y &\sim N(0, 2\sigma^2),\\
\frac{X-Y}{\sqrt{2}\sigma} &\sim N(0, 1).
\end{align}
$$
Next, the square of a $N(0, 1)$ variable has a $\chi^2$ distribution of degree one, i.e. $\left(\frac{X-Y}{\sqrt 2\sigma}\right)^2$ is $\chi^2_1$-distributed. Furthermore
$$
\begin{align}
\frac{(X-Y)^2}{4} &= \frac{1}{4}\left(\frac{\sqrt 2 \sigma (X-Y)}{\sqrt 2 \sigma}\right)^2\\
    &= \frac{\sigma^2}{2}\left(\frac{X-Y}{\sqrt 2 \sigma}\right)^2.\\
\end{align}
$$
Thus, it is a scaled $\chi^2_1$-distribution, and the scaling factor is $\frac{\sigma^2}{2}$. Now, the $\chi^2_1$ distribution has mean equal to one, and variance equal to two. Since the expectation is linear, we have:
$$
\begin{align}
E\left[\frac{(X-Y)^2}{4}\right] &= \frac{\sigma^2}{2}E\left[\left(\frac{X-Y}{\sqrt 2 \sigma}\right)^2\right]\\
    &=\frac{\sigma^2}{2}.
\end{align}
$$
The variance is quadratic, thus
$$
\begin{align}
Var\left[\frac{(X-Y)^2}{4}\right] &= \left(\frac{\sigma^2}{2}\right)^2 Var\left[\left(\frac{X-Y}{\sqrt 2 \sigma}\right)^2\right]\\
    &=\frac{\sigma^4}{4}\cdot 2\\
    &= \frac{\sigma^4}{2}.
\end{align}
$$
Comment: @Galaxy $Z = (X-Y)/(\sqrt 2\sigma)$ is a single $N(0,1)$ random variable, so its square is $\chi^2_1$, i.e. of degree 1 (by definition, the degree is the number of random variables you sum the squares of). Note, that your $Q$ is a square of a sum, not a sum of squares. And if you multiply $Q$ out, this doesn't give a sum of squares of independent random variables.
Comment: Thank you! If you have the time, would you mind explaining why $Q$ only has one degree of freedom? My intuition tells me there should be either two since $Q$ is a function of two independent variables $X$ and $Y$, or three since if you multiply out the squared sum you would get $Q=(X^2+Y^2-2XY)/4$ which is a sum of three chi-squared distributions


Showing existence of a fixed point

Question: So, I have a continuous function $f$ from $\left[0,1\right]$ to $\left[0,1\right]$ such that : $$\forall \, x_1,x_2\in\left[0,1\right]:\; \mid x_1-x_2\mid\;\leq \;\mid f(x_1)-f(x_2)\mid$$
It's easy enough to prove that $f$ is both surjective and injective so $f$ is a bijection, and also $\{f(1),f(0)\}=\{0,1\}$. Now I'm trying to prove that $f$ must have a fixed point. When drawing an example it seems obvious, but I'm not sure how to go about the proof, setting aside the trivial case when $f(1)=1$ and $f(0)=0$. Since $f$ is a bijection and if we assume we're in the case $f(1)=0, f(0)=1$ then $f$ is strictly decreasing but not sure how that would help.
So could anyone give some kind of hint or an observation I might have missed ? Thanks.
Answer: Assume that we are in the case $f(1)=0$, $f(0)=1$. Consider the function $g:[0,1]\to\mathbb{R},\; x\mapsto f(x)-x$. Then, $g$ is also continuous. Note $g(0)=f(0)=1$ and $g(1)=f(1)-1=-1$. By the intermediate value theorem (Bolzano's theorem), there exists a $x\in[0,1]$ such that $g(x)=f(x)-x=0$, which completes your proof.
Answer: Think of of the link between a fix-point and the function $g: [0,1] \rightarrow [0,1], x\mapsto x$. If you were to find a fix-point what kind of equality would hold? Try to link that to $g$ and $f$.
In the end you should use the intermediate value theorem.
Answer: You have already shown that $f(x)$ is bijective.
Take a look at $g(x)=f(x)-x$ for the case $f(1)=0$, $f(0)=1$.
If $g(x)$ has a zero, we are done by definition of a fixpoint.
Now $g(1)=-1$, $g(0)=1$, so by continuity, there exists a $t\in[0,1]$, for which $g(t)=0$.
Comment: Ok now I wish I had thought of that, it was really not that hard and I had done it before. But I don't see why the fact that $f$ is bijective matters ? Even if it's not bijective, a continuous mapping from $\left[0,1\right]$ to $\left[0,1\right]$ will still have a fixed point. Am I missing something again ?
Comment: If $f : [0,1] \rightarrow [0, 1]$ is coninuous it will have a fixed point whether bijective or not.

Showing existence of a fixed point


User answering twice for a single question. Bug or feature?

Question: I just saw a question in which the same user answered twice. The two answers are however slightly different. Why is this possible and is there a limit to the number of answers one can give?
Check for the Question, User Answered Twice
Comment: Waiting on someone to answer this twice...
Comment: @Bart how much max answer we can give?
Comment: As many as one wants. There is no built in limit. Why should there be one?
Comment: Confusing? Why? An answer is an answer - doesn't matter if it is the same person answering.
Comment: Sure this is possible. Even [three times](http://stackoverflow.com/a/6963591/488657). :)
Comment: Until you run out of them. But seriously, I'm not sure there even is a hard limit. (at least I'm not aware of one) If they are good answers and having them in one answer could be confusing, then perhaps it's even better to split it up. But in general I would say, why not combine them and add a note that you're presenting two solutions.
Comment: @Oded it will be confusing. even i got confused :P
Comment: will it be kind of spam , what i think , nyway there are features, which mods only knows :-/, hope we will come to know all features soon ;)
Answer: It's a feature, not a bug. Users are allowed to write more than one answer; each time they do this, they get a dialog box that asks they are sure they don't mean to edit their previous answer.

Apart Community Wikis, there are cases where answering more than once makes a sense.
Suppose that somebody is giving two different options as an answer to a question. If both the options would be in the same answer, who agrees with an option, but not with the other one, would have some problems voting the answer (+1 for the first option, −1 for the other option; the total is: no votes); if the options are separated in two answers, it is easier giving a vote, and it is easier for who see the answers understand what the community thinks (e.g. both the options are valid, one of the options is very bad).
Clearly, as the dialog box reminds, the second answer could be avoided, especially if it is the carbon copy of the first answer, with some changed words. In that case, it is better to improve the existing answer, as the new answer doesn't add anything new.
Answer: Both answers were originally the same; he only edited one of them later, without bothering to delete the other one. So I trashed the other one (and berated the author for not already deleting it himself -grumble-).
Now, I don't understand why there isn't a limit in place to prevent identical double-posted answers, since there's no reason for anybody to post two identical answers besides accidentally clicking submit twice. (Twitter has such a safeguard against duplicate tweets, which is pretty effective against spam and accidental double postings.)
It's fine to provide more than one answer to a single question provided the answers actually differ from one another, of course.
Comment: And in the process you also cleaned up my "three times" example? Awesome. :)
Comment: And it's back: http://stackoverflow.com/a/9398669/488657 :)
Comment: @Bart: That's funny.
Answer: I do not believe that there is a limit.  As long as your answers are valid and don't attract any moderator flags for abuse.  However I think that this behavior could be viewed as gaming the system as each answer can be voted on separately hence doubling the chances of upvotes for a user (if both the answers are valid). IMO, If you have two solutions then list them both - there is really no need for two answers.
It would be recommended to simply add details to your original answer though - adding more details, adding an "alternative solution" header and detailing your additional solution there...etc...


What license should I use for an open source Android app that has no third party libraries outside of ones provided by the Android operating system?

Question: I made a simple app for Android and I want to make it open source, What license should I use, how should I implement it in the project files, and is there anything else I need to take into consideration.
Comment: Your question is hard to answer: you need to tell us what you want people to be able to do with your work.
Answer: I believe you can choose any license you want, it is written by you. You'd have to check if the libraries you use (or even Android as a platform) has some say in this, but I doubt it very much.


How to put reflectbox in newtheorem correctly?

Question: Firstly: sorry for my English, I hope, that you'll understand me.
Secondly: I have to use \reflectbox in my newtheorem environment. Problem is, that when I put for example \reflectbox{D}, letter D is inclined to wrong direction (to the left). Is it possible to fix it?
Comment: [Welcome to TeX.SX!](http://meta.tex.stackexchange.com/q/1436) Please add a [minimal working example (MWE)](http://meta.tex.stackexchange.com/q/228) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with `\documentclass{...}` and ending with `\end{document}`.
Comment: That's what happens if you reflect something. You could (depending on your TeX engine) apply some kind of PostScript or PDF sheer transform to a D but perhaps you could give more indication of your system and your actual use case.
Answer: As David says in the comments, it's in the nature of the \reflectbox command to make a right-leaning D lean instead to the left. It would be nice if there existed a "reverse italics" font where italicised letter leant to the left, but I don't know of such a thing.
If you're only working with the particular letter "D", then you could exploit the vertical symmetry of that letter, and rotate it 180 degrees instead of reflecting it (when inside an italicised environment like a theorem, that is).
Here is some code to show that.
\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}

\newcommand\D{\reflectbox{D}}

\begin{document}

\noindent $\D$ is true.
\begin{theorem} $\D$ is true.\end{theorem}

\newcommand\DD{\rotatebox[origin=c]{180}{D}}
\begin{theorem} $\DD$ is true.\end{theorem}

\end{document}

Another option is to stop your theorem environment from italicising its contents. This can be done by adding the following two lines to my example code, immediately after the \usepackage{amsmath} line:
\usepackage{amsthm}
\theoremstyle{definition}

Comment: Great, glad to help. Please consider marking this answer as "accepted" by clicking the tick mark at the top left. This way, this question can be recorded as "solved". `:-)`


Bind and Open Ports

Question: I recently installed Bind on a CentOS box.  Everything appears to be working with only port 53 open.  However, I noticed in the config file that there is a line in rndc.conf that says "default-port 953;"  I don't have port 953 open and Bind appears to be working.  Can I keep 953 closed?  What is the point of RNDC listening on 953?
Answer: What does this print?
$ sudo netstat -ntlp | grep ':953\>'

It should print something like:
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      1234/named

or this if you have IPv6 enabled:
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      1234/named
tcp        0      0 ::1:953                 :::*                    LISTEN      1234/named

Because it uses only the loopback address, the port is only accessible to users logged on to the server itself, not from elsewhere on the network.
rndc is used to manage the name server, for example "rndc reload" is the preferred way to tell BIND that you changed a zone file and it should re-load them.
On my Debian server (not sure about CentOS) it is also required by /etc/init.d/bind9 to start and stop the service.  I think CentOS calls that file /etc/init.d/named.  I wouldn't disable it or block it without checking how that script works first.
The full list of commands you can run is in the BIND 9 Administrator's Reference Manual - Administrative Tools.
As to why it uses a TCP port, run "man rndc" for the details:
   rndc communicates with the name server over a TCP connection, sending
   commands authenticated with digital signatures. In the current versions
   of rndc and named, the only supported authentication algorithm is
   HMAC-MD5, which uses a shared secret on each end of the connection.
   This provides TSIG-style authentication for the command request and the
   name server's response. All commands sent over the channel must be
   signed by a key_id known to the server.

   rndc reads a configuration file to determine how to contact the name
   server and decide what algorithm and key it should use.

So if you're looking to secure it, look into details of the key and the key file.  For example, /etc/bind/rndc.key (or /etc/named/rndc.key) should have restricted permissions.
Comment: Thanks for the clarification.  My netstat output looks similar to yours in that it is listening on 953 but only on the loopback.  My only issue now is that when I run nslookup directly on the server, it says "No answer".  However, when I run netstat from somewhere else, the results are correct.  Any idea why that might be happening?
Comment: That sounds like a different problem.  Make sure /etc/resolv.conf is correct.  Probably best to create a new question if that doesn't help.
Answer: RNDC is the remote administration port. Do not open it to the outside world. Unless you use the rndc utility, it's not necessary for this port to be open at all, you can safely firewall it off.
Bind needs UDP 53 to service normal requests. You should also open TCP 53 if (and only if) this server is the master for a zone and a secondary server needs to transfer from it.
Comment: I'd also note that TCP 53 may need to be opened even if you don't have an external secondary requesting zone transfers.  If a DNS request is too large to fit into a UDP packet, it will be sent via TCP.  Likewise, if a received response is too large, it will be truncated and the requester will resubmit the request via TCP to get the full response.  This will happen more as DNSSEC becomes more widespread.
Comment: I'm not sure that's correct.  On Debian at least, /etc/init.d/bind9 relies on it.  If you disable rndc, you can't start or stop the service.
Comment: Looks like Fedora (and so I assume CentOS) calls /usr/sbin/named to start it, so you might be able to get away without it.  Try it and see.  That's assuming you don't want to use any of the administration commands (see link below).
Answer: Add the following at the end of /etc/named.conf (RedHat compatible, Debian??)

controls { };

to disable it. I see no point having this open on a slave DNS server.
Source: https://www.linuxquestions.org/questions/linux-server-73/bind-and-rndc-problems-how-do-i-remove-rndc-597478/#post2949852
Answer: Usually there is no need to forward requests for 953 port on your border firewalls, but it is fruitful to keep it open on DNS server as a local service (of course if you have ssh access to this server). Properly configured rndc is a great tool to manage named.
Answer: Actually it's BIND that listens on TCP port 953 of the loopback interface. RNDC is a client utility that can be used to control BIND. RNDC talks to BIND over TCP port 953. It's totally safe to leave it open.

Bind and Open Ports


Does Van Eck Phreaking work?

Question: Does Van Eck phreaking perform as described, i.e. allow a person to observe what is being displayed on a given computer screen (notably a LCD) from a distance without having any physical connection to the machine being monitored, and without the knowledge of the person being observed?
Comment: It seems to me the linked Wikipedia page provides enough details about how exactly this works, including a link to the originla Van Eck paper. I am not sure what better answer do you expect to get?
Comment: With CRT monitors the screen image can sometimes be reconstructed just by observing the light levels in the room.
Comment: You can also try asking this at [security.se], some pros there have analyzed and/or designed these things - whether the phreaking attacks, or countermeasures such as Faraday cages.
Answer: Yes it does. VGA or keyboard cable has side effect of acting as antenna.
Both eavesdropping and countermeasure techniques are widely knows as TEMPEST (which was codename used by NSA). It's described with details and numerous references here. Example from above source:

It is standard to use TEMPEST protected terminals in military (NATO standard requirement), banks, embassies, government installations etc. The buildings themselves are usually also TEMPEST protected. TEMPEST protection of hardware is basically shielding equipment and cables with metal, which acts as Faraday cage. Which also has another side effect — it gives some protection against EMP attack.
BTW. the question gives away the answer. Van Eck's paper was published and peer reviewed.
Comment: "The paper was published and peer reviewed" is a very useful shorthand for saying "Not only was this treated seriously enough by a serious scientist to write it up for a serious academic journal, but other serious scientists took it seriously enough to try and knock holes in it and didn't find any noteworthy ones; this is as close to 'this is true' that you're going to *get* from a scientist."
Comment: One wonders how this would work in a typical office with 15+ computers, screens, keyboards...
Answer: This video (2:10 onwards) shows Van Eck phreaking working with a CRT monitor, although it claims that the process works through the cable, not the monitor itself; if that is true, then it would work regardless of the display technology.
It also claims that keyboard data can be captured too. I find that difficult to believe.
Comment: I love how the video opens by referring to Van Eck phreaking as a "new type of cyber terrorism" despite the fact that Neal Stephenson uses it as a plot point in Cryptonomicon, which he wrote in 1999.
Comment: @John Yea, I agree - it's quite typical of media hysteria.
Comment: @John it's worse than that, TEMPEST attacks / van eck phreaking have been known in the intelligence community since the 1950s and 60s.
Comment: i thought this only worked with crt monitors because of the EM Signature giving off by the tubes cabling would give off much lower em fields and there fore harder to detect
Comment: Nah, it's *easier* with a CRT monitor because the monitor itself uses a very powerful magnetic field to bend the electron beam, and that field puts out a signal that's likely much easier to read at a distance, but even without that the cable still functions as an antenna.

Does Van Eck Phreaking work?


What tasks can be performed faster on a raspberry pi cluster?

Question: I've recently seen that some companies use raspberry pi clusters as supercomputers. For example, Los Alamos National Laboratory has a supercomputer with 750 Raspberry Pi 3. And I was thinking if you can increase the number of cores so easily with a raspberry pi cluster why don't more people use them? The problem is that I don't know what applications allow multithreading. My browser for example does, so I could get a better browsing experience by using a couple raspberry pis. But what other common tasks could be performed faster on a raspberry cluster?
Comment: Multithreading is not the same as clustering.  This is just a list question, a type not well suited to SE.
Answer:
"what applications allow multithreading. My browser for example does, so I could get a better browsing experience by using a couple raspberry pis"*

No.  A cluster is not equivalent to one big computer for any purpose.  For starters, they can only share information over a network connection, which is orders of magnitude slower than the CPU communicates with RAM.  So, a cluster of pis would be faster than a single Pi for performing some analysis of a large number of web pages at once, because each pi could analyze a page at a time and pool the results.  But it would almost certainly cause your web browsing experience to become unbearable (unresponse, stuttering, etc)., not better, which is why no one in their right mind would try to implement that.
The relationship between "multi-threading" and "clustering" is not a simple one.  Generally, interactive graphical applications use multi-threading so that the interface remains response while another thread is (eg.) loading stuff from the network.  It can be used to improve performance speed wise, but there are limitations WRT when this is true and when it isn't.
If your question is, what would a cluster of pis be faster for than a single pi, there will be lots of answers like that, but the answer is not anything and everything.

"why don't more people use them?"

They are mostly (perhaps only) used for educational purposes.  It is a cheap way for people to learn about clustering hands on. But this is because they are cheap, period, for a single system that can run a normal OS with standard network and peripheral interfaces.  It is not because they are economical pound for pound, by which I mean $1000 worth of Pis clustered will not be better than a $1000 x86-64 system -- it is very much the other way around, which is why no one sells pi clusters for cutting edge gaming, etc.  There may be some tasks for which this is not true but they would be very unusual especially in the context of conventional end user purposes.
Comment: Couldn't the network speed limitation be fixed by using some other board to connect the Raspberry Pis? For example, does the Turing Pi board use bus or network for communicating the pis?
Comment: @ajr-dev There's nothing with comparable speed exposed on the board -- without digging, I'd guess there's nothing comparable exposed on the SoC itself, so you could not even build a special board using a that SoC for that purpose.  Something has to have the fastest transfer rate, and it makes no sense for it to be something *other than* the CPU <-> RAM bus (hopefully the logic there is obvious).  With regard to systems involving multiple processors (as opposed to just processors with multiple cores), these are on the same board or a boards meant to interface them but that is not a cluster.
Comment: Generally the connections between computers is slower than the connections between parts of a single computer (like the RAM to CPU bus). This applies for Pis as well as supercomputers running the latest CPU/GPU tech. Now even if you magically fix the network bottleneck, I don't think Raspberry Pis can match ordinary CPU/GPUs on performance per dollar. So you're always going to be better off networking ordinary computers into a cluster.
Comment: That said, (to contradict myself a little) there may be [DMA interfaces](https://en.wikipedia.org/wiki/Direct_memory_access) on the SoC that could be fitted to the purpose of a faster than 1 Gbit  rate -- but I suspect incredible speed is actually not a major goal with those.  There's the 4K HDMI but I don't think that could be used because it is seriously asymmetrical -- the pi could only send from there.  The best possibility might be combining the CSI and DSI connectors for a unified I/O stream.
Answer: The pi has a slower cpu, slower network, slower memory, and slower disk devices than a conventional computer.  The network device on the pi3 can't even keep up with a regular desktop's network, and is slower than 1G.  It is designed to be cheap and robust, not fast.  There is nothing a pi cluster can do faster.  In some circles, a pi cluster is considered a joke -- although a pretty cool one.  Several pi clusters have been built for demonstration purposes.
The pi has more readily available I/O pins than a regular computer, so at a stretch, a pi cluster could do a lot more gpio.  This might actually be useful of the pi's were distributed over a wide area; they could act like cheap (and slow) distributed I/O extenders, but this is not a conventional cluster. by any stretch of the imagination.
Los Alamos National Laboratory's Pi cluster's purpose is not to be fast.  It is to test cluster algorithms.   Sometimes you want a slower computer when testing code, because if it is too fast, things happen too quickly to debug.  But also, 750 pi's is a lot smaller and cheaper and uses a lot less power than 750 conventional servers.  Speed isn't everything.


Bacteria location in food poisoning?

Question: Where is the majority of bacteria located in food that leads to food poisoning?
I.E in most cases is it on the surface, or deep within the food (i.e in the case of "cooked" meat, or balanced?
Comment: Here is some more information about cured meats: http://www.foodsafetynews.com/2012/09/cured-meat-is-in-but-is-it-safe/
Answer: This is a complex question and I can't cover it all.  Different countries may sell meat and other food products processed  in different ways. In the case of meat, it can be deep within the food in the case of ground meat. Use caution with ground meats, you should probably cook well done.  Even cured  meat can harbor listeria and other germs  (follow the storage instructions on the package).
What about salads?  Many counties include vinegar in the dressing, and this can help. The mayonnaise dressings can present more of a problem, keep refrigerated until ready to eat.
Meat cooking temperature, follow label directions. What about rare roasted (intact) meat? :)  This is relatively less dangerous than ground meat. Follow instructions in a recent cookbook and/or information provided by your government for cooking.
With our complex grower, processing, and distribution networks today, there are simply no guarantees.  Keep up with the news regarding recalls. Wash your vegetables and fruits well.  Don't use a cutting board/ knife for both meat and vegetable preparation. Follow good kitchen sanitation. Practice frequent handwashing using plenty of soap and water.
Here is some information from the   Univ. Mich. State. Primarily about salads but it has some good general information at the beginning. http://msue.anr.msu.edu/news/it_must_have_been_the_potato_salad
U.S. Govt. Meat, final internal temps.  (Meat thermometer) https://www.foodsafety.gov/keep/charts/mintemp.html Using Fahrenheit.
This answer is not intended to be comprehensive.

Bacteria location in food poisoning?


Complementary solution to $y'' +4 y = \sin^3(x)$

Question: I'm not looking for an answer to the whole question, but I'm just stuck on the beginning of the problem, finding the complementary solution. I'm almost certain that it wouldn't be $y_c = C_1\cos^3(x) + C_2\sin^3(x)$. Any ideas?
Comment: You are really asking about the complementary solution? You want help in solving the homogeneous equation $y''+4y=0$? Is that your question?
Comment: Ah, thanks Amzoti. I also made a stupid technical error in denoting the auxiliary equation as: m^2 + 4m = 0. Regardless,  I wasn't sure if the power of sin(x) would change the complimentary solution to C1cos^3(2x) + C2sin^3(x)
Answer: Try it !
$$(\cos^3x)''=(-3\sin x\cos^2x)'=-3\cos^3x+6\sin^2x\cos x=6\cos x-9\cos^3x.$$
$$(\sin^3x)''=(3\cos x\sin^2x)'=-3\sin^3x+6\cos^2x\sin x=6\sin x-9\sin^3x.$$
So a term like $\sin^3x$ contributes to the solution. To get rid of the $\sin x$, a complementary $\sin x$ term will do.
$$y=C_1\sin^3x+C_2\sin x,$$
$$y''+4y=C_1(6\sin x-9\sin^3x+4\sin^3x)+C_2(-\sin x+4\sin x).$$
Solve
$$6C_1+3C_2=0,\\-5C_1=1.$$
Answer: Note that:
$\sin 3x= \sin x \cos 2x + \cos x \sin 2x= \sin x (1-2\sin^2 x)+2\sin x (1-\sin^2 x)=3 \sin x - 4\sin^3 x$
Which is by way of saying $$\sin^3 x=\frac 34 \sin x -\frac 14 \sin 3x$$
You may be more familiar with the test functions for the form on the right hand side.
Comment: You are answering a different question. The question asks for help in finding the **complementary** solution.
Comment: @bof I am responding to what OP put in the question, and assuming that a particular solution for the right-hand side was what was wanted (given the test form exhibited). I may be wrong, but I assumed this might be the help really wanted.
Comment: @Amzoti: and I was thinking I might be wrong! There is a little bit of confusion in the question, and it would likely have been better to wait,
Comment: @MarkBennet: This does confirm my solution to another problem that arose throughout the question. Though my derivation for that identity was different. Thank you. Not sure if this is the place to ask, but you made the assertion that $sin(3x) = 3sin(x) - 4sin^3(x)$, then with that logic, you can make the assertion that $\sin^3(x) = 3/4sin(x) - 1/4sin(3x)$ I'm just curious of that logic.


Find my iPhone can "online, location services turned off" show if someone has not turned off location services manually?

Question: Can "online, location services turned off" show if someone has not turned off location services manually? Is there any time that the location is unidentifiable, such as in a downtown area where GPS signals are not reliable?
Answer: If location services are enabled and the location can't be obtained by the device because there's no GPS, etc, it will say so: 'location unavailable'.
The fact that it says the location services are off means literally that: the location services have been switched off.


Recover address wallet

Question: How do I recover address wallet by use private-key?
Following solana doc, it just showing recover address by seed phrase, and I want to recover by private-key
Answer: Code Snippet
Step 1: import lib:
import { bs58 } from "@project-serum/anchor/dist/cjs/utils/bytes";
import { web3 } from "@project-serum/anchor";

Step 2: Call function:
const getKeypair = await web3.Keypair.fromSecretKey(bs58.decode("private-key"));
console.log(`public key: ${getKeypair.publicKey}`);

Also, you can just simply import the private key in your Phantom Wallet and you are good to go. You will see your public address and digital assets right away.
Comment: oh, I want to recover by code as nodejs
Comment: ops let me edit my answer then

Recover address wallet


Facebook PHP SDK - Questions about accessing information / logging out

Question: i want to connect a customer's website to Facebook using the PHP sdk (newest version). Visitors should be able to sign up using their Facebook account in order to be logged in automatically on the page itself if they are already logged in at Facebook, being identified by their profile ID which is saved in my database.
Here are my questions:

If I visit a website (which is using Facebook Login) for the first time, will this website be able to recognize whether I am logged in in Facebook or not, if I have not granted the permissions to the corresponding Facebook app yet?
If I have granted the permissions to the app and the page recognizes me as being logged in at Facebook, what does happen if I call the logout function of the PHP sdk? Will I only get disconnected from Facebook on the current page or will I get logged out on Facebook, too?
Answer:
This was the case a year or so ago, but now - without permissions - you don't know who the user is. (Facebook authentication)
You will be logged out of Facebook too. (Facebook getLogoutUrl)


Is exchanging Indian currency at premium legal?

Question: Is exchanging/selling Indian currency notes, like the ones which have special sequences numbers or are extra old (antique), at premium legally allowed?
Comment: Why would it not be legal?
Answer: Appears to be legal; many people sell antique Indian currency or currency with special numbers on eBay: http://www.ebay.in/sch/?_sacat=11116
And the Indian Coinage Act of 2011 does not appear to outlaw it: https://www.rbi.org.in/Scripts/OccasionalPublications.aspx?head=Indian%20Coinage%20Act
Comment: eBay quicky removes illegal items, and that's the East Indian version of eBay, so I assume it is monitored. And I say _appears_ because IANAL, and this site is not legal advice, even though many new and low rep users assume it is.
Comment: "People do it on eBay" isn't much support for "it appears to be legal".
Comment: Fair enough. Proving the negative is usually a difficult question without explicit legislation to call on.