Is there any planet/star bigger than VY Canis Majoris?

Question: Compared to VY Canis Majoris, our Sun is more like a speck of space dust. Is there any planet or star which is known to us that is bigger than the VY Canis Majoris?
Comment: Note: There is no way for a planet to be that big. At that size, the object either collapses into a black hole, or resists collapse due to pressure from internal heat generated via the normal fusion in stars. It has to be a star, actively producing heat, in order to avoid collapse. As for stars bigger than that, it's possible (barely), but I'm not aware of any examples. At that size, even stellar objects cannot live very long, and therefore must be pretty rare.
Comment: See [here](http://en.wikipedia.org/wiki/List_of_largest_known_stars) and [here](http://en.wikipedia.org/wiki/List_of_most_massive_known_stars). None are known exactly, and there's some debate on the subject.
Answer: Part 1: Assuming "larger" means greater in diameter.
Stars
Estimates on the size of stars are just that, estimates, and estimates based on rather fuzzy observations. VY Canis Majoris has been bumped down to size. The current thinking is that there are seven known stars larger than VY Canis Majoris, the largest of which is UY Scuti.
Current models indicate that the first generation of stars were much, much larger than anything we see now. It will be quite some time before we can resolve a first generation star. So far, they are just theoretical objects.
Planets
Jupiter-mass planets are about as large as a planet can get. There are some exoplanets that are larger than Jupiter, but that's because they orbit much closer to their parent star than does Jupiter. This makes them puff up a bit. The reason Jupiter-mass planets are deemed to be the largest possible is that planets of this mass are presently assumed to have a core of degenerate hydrogen. A funny thing happens to degenerate masses when mass is added to them: They shrink in diameter. (The shrinkage becomes catastrophic as the mass approaches the Chandrasekhar limit.)
This means that assuming all other things are equal (temperature, composition), a planet more massive than Jupiter will be small in diameter than Jupiter is. Even if all other things aren't equal, a Jupiter-diameter planet is (give or take) about as large as planet can get.
Part 2: Assuming "larger" means greater in mass.
Stars
In terms of mass, VY Canis Majoris doesn't even make the top ten, not even close! The most massive known star is R136a1. Again, these are estimates, but mass is a bit easier to pin down than is radius (or diameter).
As is the case with physical extent, the first generation stars are presently modeled as being much, much more massive than anything we see now.
Planets
There's not much difference between the largest planet and the smallest brown dwarf. I would argue there's very little difference. It's a spectrum with no distinguishing characteristic that lets one say "this is a planet" and "that is a brown dwarf". Ignoring the distinction between super-Jupiters and brown dwarfs the largest is about 80 Jupiter masses. V1581 Cygni C is 79 Jupiter masses. (More massive than that and they start burning hydrogen, thus making them a small red dwarf.)
The current factor that is used to distinguish between brown dwarfs and super Jupiters is mass. Anything larger than 13 Jupiter masses is a brown dwarf, anything smaller, a planet. That boundary is very arbitrary.
Comment: I thought the boundary between Jupiter-likes and brown dwarfs was deuterium fusion.  That doesn't seem particularly arbitrary to me.  Wikipedia says this definition is under debate, though I don't know much about that personally.  I suppose an unsettled definition can be called arbitrary.
Comment: @zibadawatimmy it's arbitrary because it's hard to detect.   The heat of formation is greater than the heat from limited fusion.    23 PPM D to H ratio.   https://en.wikipedia.org/wiki/Deuterium#Abundance   isn't much and at the cutoff, about 13 Jupiter mass, the fusion process proceeds slowly.
Comment: It's funny than in the top 6 heaviest stars, 4 are from the same region 2 parsecs across! At least according to [this wikipedia article](https://en.wikipedia.org/wiki/List_of_most_massive_stars).
Answer: Looking at the primary literature  (and the source of the wikipedia information), it appears that Arroyo-Torres et al. (2013) have estimated a radius of $1708\pm 192R_{\odot}$, using an interferometric angular diameter and a highly uncertain distance (where I'm not sure the distance uncertainty has been adequately included). Using similar methods Wittkowski et al. (2012) estimated a radius of $1420\pm 120 R_{\odot}$ for VY CMa.
Taking these numbers at face value then UY Scuti is probably larger than VY CMa. However, I wouldn't take these numbers at face value.  I don't believe the distances to these stars are known to better than 10% as claimed in these papers (they soon will be with Gaia trigonometric parallaxes). You also have to bear in mind that these are pulsational variables (hence the variable star designations), so their radii are variable.


"No administrator was found" in Startup Security Utility

Question: My friend got a new MacBook Pro from office, later on he resigned and in a hurry erased the "Macintosh HD", now we are trying to install Mojave using Bootable USB but it won't allow because "External Boot" is not allowed, also when we try to access "Startup Security Utility" it shows an error saying no administrator was found, so we can't enable "Allow booting from external media". Somehow online installation from recovery mode is also not working and throws 202 error at the end.
Is there any luck?
Comment: @SteveChambers He was given boxed pack MacBook Pro, so he's the first user.
Comment: The system was probably a part of a managed system and needs to be removed from that system. Presumably by their former workplace IT folks.
Comment: @ankiiiiiii thanks! but as I mentioned there is no OS on MacBook right now, so how would it boot to "Single User Mode"? Or will it?
Comment: Hey there, Welcome to Apple.SE! [I don't have administrator account on my mac](https://apple.stackexchange.com/questions/164331/i-dont-have-administrator-account-on-my-mac) is it helpful?
Comment: Solutions mentioned below do not work for M2 that came with Ventura.
Answer: I just came into the same situation. But I was lucky enough to workaround it last night. It took me 2 nights searching around to figure out what to do.
Here's what you need:
*. A functioning Mac(Better without a T2 chip), mine is the 2014 Mac Mini.
Edit: For T2 chip devices, you could temporarily set the security options to allow boot from external devices.(Reboot and then Command + R,not personally tested)
*. An SSD for a fresh install.
*. Create a bootable macOS USB drive.
I will make it short. You could search for tutorials if you don't know what to do for a certain step.

Plug in both SSD and bootable USB drive(with Mojave installer).

Reboot your mac and press Command + R.

Install a fresh Mojave on your SSD, and stop when you see the welcome screen where it asks you to select your country.

Power off and unplug the SSD off your functioning Mac.

Plug your SSD onto your MBP and turn it on.

Press Command + R and enter the recovery mode.

Disk Utilities -> Restore. Here select your SSD and it will copy your SSD's files onto your MBP. And then you can unplug your SSD.

You could try select your internal drive as start up disk but it doesn't let you to. So reboot your MBP. And press Command + R. In my case it failed to boot the macOS and it just reboot into the recovery mode again.

Select Install Mojave. After a couple of minutes, your screen turns black and it reboots.

You will see the lovely Welcome screen again.
Comment: Downvoted: As described, External Boot is not allowed, so steps 2+3 don't work. Cmd+R brings up a message that External Boot is not allowed. I'm working through the same problem right now.
Comment: Great answer!  worked like a charm when i thought I was dead in the water cuz i had already erased my Macintosh HD.  After step 7 i was able to change my startup disk and it booted up!   Thank you
Comment: Hi, Drew. You need another functioning Mac(models without T2 chip) or someone to help install a fresh OSX for you(Stop at welcome screen) and start from #6. And then you use the Disk Utilites to clone the whole fresh system to your Mac. It looks like that the T2 security chip blocks external disk boot or installation.
Comment: Hi. Just trying to work out what the "TL;DR" is on this answer.. Essentially, is it simply installing macOS on a different Mac (without the same boot restrictions) and then swapping the disks?
Comment: Hi, yes. You just need a fresh install before setting up personal information on a disk.  So that the T2 chip won't block you again.
Answer: I had to boot into recovery mode and reinstall High Sierra (the initial shipped version of macOS). Installing HS gave an administrator account. With the administrator account I was able to allow booting from any external device and finally booted from mac USB stick macOS mojave. After that I could remove HS.
Comment: Just did the same thing, in my case the default was Mojave and I installed Monterey from external disk. Had to then re-install Monterey *again* (so 3 installs in total) from recovery after creating a temp admin account, re-enabling external protection and wiping to remove the temporary admin account. Bonus: reset the NVRAM (option, command, R, P on startup) to give a completely clean startup to the "welcome" screen for the next user.
Comment: You don't have to install the original. Even if you can't boot from an external drive, you can boot the Internet Recovery system, then plug the drive and run the installer from Terminal.
Answer: I had a similar issue with my 2018 Mini: I had to delete the .AppleSetupDone file and run the "Welcome to Mac" routine, creating a new admin user there before I could alter SecureBoot, even though the disk had been imaged with an admin user.
Peter Thorn's answer here gets to the exact cause of the problem and provides the solution for a working Mac that has MacOS installed.
If you don't have MacOs installed, you could try booting it in Target Mode from another Mac, which I understand bypasses the Secure Boot! (Though if the drive is encrypted, you'll need the password, unless you're wiping it anyway.)
Alternatively, take it to an Apple Store. The SecureBoot settings can't be changed unless there is a valid admin user, so you can't boot to an external. Recovery is another option, but you say that's not working.
PS. I'd love to work somewhere where you get to keep your laptop when you resign!
Comment: First part doesn't help for wiped systems as in this case (and my case). Target Mode may be worth trying. Darkwonder's response below, which for some reason got the least votes (zero), is the most appropriate.
PS When I left my job at a small company after 3 years, I got to keep my laptop..
Comment: This did not work for us — on an M1 Mac with Monterey — it actually broke the Setup Assistant. When it came to the step of "Create a computer account", we got an error "Your computer account could not be created with the name and password specified. Please try again." (Regardless of name & pw.) We had to wipe the boot drive & reinstall.
Answer: To my experience, it is a question of Secure Tokens, if it doesn't accept the admin even though it has the shipped (old) macOS installed from the recovery partition.
Even though you have created an admin account, you need it to have a Secure Token and update the preboot, for the recovery partition to accept it.
I did the following (when logged in as the local admin account) (both commands run in Terminal):
sysadminctl interactive -secureTokenOn [admin user shortname] -password -
(you will be asked to authenticate).
diskutil apfs updatePreboot /
Comment: Yes, this is the best answer. Gets to the nub of the problem and shows the solution.
Comment: It doesn't have the shipped macOS installed - the OP (and me) are trying to install an OS. And there is no created admin account - the boot drive is wiped.
Comment: sysadminctl doesn't exist in the recovery mode.
Comment: diskutil:  `UpdatePreboot: Exiting Update Preboot operation with overall error=(ZeroMeansSuccess)=-69567
Error: -69567: An Open Directory user database record is missing a data field required by EFI`
Comment: To fix error above read this and create "recovery key and do not use icloud":  https://twocanoes.com/fixing-authentication-failure-in-startup-security-utility/
Comment: To fix an error turning on FileVault temporarily:  add a full name, like "Adam Minister" to your account.
Answer: I managed to get around this by using Disk Utility (from recovery mode) to "restore" my internal drive with the image on my external bootable drive. Voila, your bootable drive is no longer "external" and you can boot from it. You'll probably want to create a separate partition on your internal drive for the bootable partition to install to; ideally your second partition is the installer so that you can delete it later without the "you can't remove the first volume on the disk" error.
Answer: A friend of mine got one of those corporate-managed MacBooks I think it was Meta so it will always go back to being managed by Meta. Anyhow with the T2 chip and security enabled so cannot boot from external devices. So the MacBook is a brick - re-installing it with any version of MacOS will will make it Meta controlled and she cannot log in as it's linked to Meta corporate accounts. So the only solution was to install Linux on it to make it useful.
This is how I achieved disabling the security:

Start with command + R
At the start up utility go to Utils and select Terminal
Either dd /dev/disk1 or #rm -rf /
Start the Mac and it will go for internet recovery, connect it to your Wi-Fi and let it do its job
It will install Mojave whatever it is called. At the next start, just DO NOT connect it to the internet and just select not connected, the installation will go ahead and it will create a new admin user
Once logged in, don't connect to the internet yet.
Shutdown and restart with command + R
This time you can just go to startup security and enter your password and disable the security and you can now boot from an external USB and install your Linux distro.

ME 1 Meta IT 0
Answer: I was able to get to recovery mode by starting to select a start up disk and then quitting with Command - Q. Took me back to recovery mode and I was able to install Mojave on the internal drive.
(I had this exact issue and foolishly wiped the drive not realizing that the security was set to only internal drives.)
William Tong's answer is great, but similar to commenter, I could still not boot into recovery with the blank Mojave's SSD. It would prompt that it couldn't boot from external drive and to choose a startup disk or restart.
Comment: Welcome to Ask Different! Please refrain from adding comments in the Answer section, this is for answers to the questions. Once you have sufficient [reputation](http://apple.stackexchange.com/help/whats-reputation) you'll be able to add [comments](http://apple.stackexchange.com/help/privileges/comment) and ask follow-up questions. To gain reputation, [answer questions that are clear and concise](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead).   - From Review
Answer: After referencing this article on Apple: https://discussions.apple.com/thread/8509743 and going through all three of that thread's recommendations:

Enable secure token in Terminal using the command:
sysadminctl interactive -secureTokenOn <user name> -password <user password>
This threw the following error:
2022-10-20 11:00:27.406 sysadminctl[1137:7904] setSecureTokenAuthorizationEnabled error Error Domain=com.apple.OpenDirectory Code=5101 "Authentication server refused operation because the current credentials are not authorized for the requested operation." UserInfo={NSUnderlyingError=0x600000c41350 {Error Domain=com.apple.OpenDirectory Code=5101 "No existing unlock record" UserInfo={NSDescription=No existing unlock record}}, NSLocalizedDescription=Authentication server refused operation because the current credentials are not authorized for the requested operation., NSLocalizedFailureReason=Authentication server refused operation because the current credentials are not authorized for the requested operation.}

Toggle FileVault on and then off again. Filevault would not enable, so the first part of that sequence can't be completed.

Use the MacOS Setup Assistant to create a new admin account by deleting /var/db/.AppleSetupDone This was the first thing I tried, but the resulting admin account either didn't generate the token or could not set it to On as it should have.

After all three of those failed, since I didn't need anything on the MBP's internal SSD, just get it deployable, I booted into Recovery, deleted the Boot volume, created a new Boot volume, and installed Monterrey into the new APFS volume. This apparently corrected whatever was at fault in BridgeOS, as the 501 admin account was recognized by the Startup Security Utility as an admin, and FileVault could be enabled normally.


Find all integral solutions to $a+b+c=abc$.

Question: Find all integral solutions of the equation $a+b+c=abc$.
Is $\{a,b,c\}=\{1,2,3\}$ the only solution? I've tried by taking $a,b,c=1,2,3$.
Comment: Is this a special case for ABC conjecture
Comment: What about $0,1,-1$?
Comment: This is directly related to perfect numbers.
Comment: Related https://math.stackexchange.com/questions/1411393/integer-solutions-to-ab-ab
Answer: If at least one of $a,b,c$ is $0$ (i.e. $abc=0$), then $(a,b,c)$ satisfies the equation iff $\{a,b,c\}=\{t,-t,0\}$ for some $t\in\mathbb Z$.
Let $abc\neq 0$.
If WLOG $a=b$, then $(ca-1)^2=c^2+1\iff c=0$, but $abc\neq 0$, contradiction.
(or simply observe: $2a+c=a^2c\iff a^2c-2a-c=0, \Delta=4+4c^2=k^2, k\in\mathbb Z$
$\,\Rightarrow\,  c^2+1=l^2, l\in\mathbb Z\iff c=0$, contradicting $abc\neq 0$).
If WLOG $a=-b$, then $c=-a^2c\iff c=0$, contradicting $abc\neq 0$.
Let WLOG $|a|>|b|>|c|>0$.
$$|abc|=|a||bc|=|a+b+c|\stackrel{\text{Triangle ineq.}}\le |a|+|b|+|c|< 3|a|$$
$$\iff |a|(|bc|-3)< 0$$
$|a|>0$, so $|bc|< 3$, and $(b,c)\in\{(2,1),(2,-1),(-2,1),(-2,-1)\}$.
Checking all of these only gives the solutions $(a,b,c)=(1,2,3),(-3,-2,-1)$.
Answer: $\{a,b,c\}=\{1,2,3\},\{-1,-2,-3\},\{t,-t,0\}$ for any $t\in\mathbb Z$.
Answer: Note that if $a\ge b \ge c\ge 2$ you have $$3a\ge a+b+c=abc \ge 4a$$So for solutions with $a\ge b \ge c \ge 0$ you have $c=0$ or $c=1$
$c=0$ gives $a+b=0$, or $a=-b$. A non-negative solution has $a=b=0$. Note also the general solution $r, -r, 0$
$c=1$ gives $a+b+1=ab$ which can be rewritten $(a-1)(b-1)=2$ so $a=3, b=2$. We see also the solution $a=0, b=-1, c=1$ given by the factorisation of $2$ into negative factors.
Changing all the signs in a known solution gives another solution, so we can assume $abc\ge 0$, and we can also now assume that none of the numbers is $0$ or $1$.
Our computation for $1$ therefore gives the solutions for $-1$ too just by changing signs.
To test for further solutions we can change signs and choose $abc\gt 0$ with $a\gt 0\gt-2\ge b\ge c$. But then the inequalities at the top of this answer both hold, and there are no additional solutions.
We find all solutions by applying the symmetries of permuting values or sign change to the solutions already found.
Answer: The solutions with $abc=0$ obviously are of form $0,b,-b$.  And since $a,b,c$ is a solution iff $-a,-b,-c$ is, we find all solutions with $abc\neq 0$ by finding all with $abc>0$. We show the only such solution is $1,2,3$.
If $abc>0$ then at least one of $a,b,c$ is $>0$ and the other two are alike in sign.  But if that sign was negative then the sum would be less than the greatest of $a,b,c$ while the product would be greater, so this would not give a solution. So if $abc>0$ then $a,b,c$ are each $>0$.
If $a=b$, apply the quadratic formula to find $a$ in the equation $2a+c=a^2c$.  You find $a$ is a positive integer iff $c=0$ which is a case we already know.
So we can assume $0<a<b<c$.
For fixed $0<a<b$ consider
  $$f_{ab}(c) = abc - a-b-c=(ab-1)c-(a+b)$$
as a linear function of $c$. We want an integer solution $f_{ab}(c)=0$ with $c>2$.  The slope of $f_{ab}$ is $ab-1$ which is $>0$, so there is at most one $c$, and indeed for $a=1,b=2$ there is the known solution $c=3$.  When $a=1$ and $b>2$  the smallest value of $c$ we need consider is $c=b+1$. For that value of $c$ the function is already strictly positive and since it has positive slope there is no solution with any greater value of $c$.
When $a>1$ then again  $b>2$,  the smallest value of $c$ we need consider is $c=b+1$ and for that value of $c$ the function is already strictly positive and since it has positive slope there is no solution.
Comment: I don't understand the end of your first paragraph.  If $\text{max}(a,b,c)$ is greater than zero, why is it necessary that all three of them are greater than zero?
Comment: @Ryan I have split that paragraph so the now-second one answers your question.
Comment: Ah, I see now.  Thanks!
Answer: Of course, if one of $a,b,c$ are zero, then you can only have $\{a,b,c\}=\{0,k,-k\}$ for some integer $k$. So suppose none of $a,b,c$ are zero. Since $a,b,c$ satisfies $a+b+c=abc$ if and only if $-a,-b,-c$ satisfies $a+b+c=abc$, we can assume that either exactly one of $a,b,c$ is negative or none are negative.
Now dividing $a+b+c=abc$ by $abc$ results in the equation $$\frac{1}{bc}+\frac{1}{ac}+\frac{1}{ab}=1.$$

If one of $a,b,c$ are negative, so say $a<0$, (and so $b,c\geq 1$) then we have $\frac{1}{bc}\leq 1< 1-\frac{1}{ab}-\frac{1}{ac}=\frac{1}{bc}$, an impossibility.
If $a,b,c>0$, then  at least one of $ab, ac$ or $bc$ is at most $3$, and all are greater than $1$. Without loss of generality, we can say $1<ab\leq 3$. This can only be the case if $a,b\in \{1,2,3\}$, with exactly one of them equal to $1$. So say $a=1$. Hence $1+b+c=bc$ with $b=2$ or $b=3$. If $b=2$ we get $c=3$; if $b=3$, then $c=2$.

In summary, the integral solutions of $a+b+c=abc$ are $\{0,k,-k\}$ for any integer $k$, and $\{1,2,3\}$ and $\{-1,-2,-3\}$.
Answer: This feels a little clunky, but here goes.
Let's start by looking for positive integer solutions ordered $0\lt a\lt b\lt c$.
If we set $a=1$, the equation $1+b+c=bc$ can be rewritten as
$$(b-1)+2=(b-1)c$$
which implies $b-1$ divides $2$.  This leads quickly to the known solution $(a,b,c)=(1,2,3)$.
If $a\gt1$, let's write $b=ar+d$ and $c=as-e$ with $s\gt r\ge1$ and $0\le d,e\lt a$.  (It will soon become clear why we choose to write $b$ and $c$ this way.)  Substituting these in, we find
$$a(1+r+s)+(d-e)=a(ar+d)(as-e)$$
which implies $a$ divides $d-e$.  But since $0\le d,e\lt a$, this happens if and only if $d=e$, so the equation now becomes
$$1+r+s=a^2rs+ad(s-r)-d^2$$
But from the various inequalities, we have
$$\begin{align}
1+r+s&\le 2s\\
&\le2s+2(s-2)\\
&=4(s-1)\\
&\le a^2(rs-1)\\
&\lt a^2rs+ad(s-r)-d^2
\end{align}$$
The final strict inequality, which comes from $0\le d\lt a$, gives a contradiction, which implies there are no positive integer solutions with $1\lt a\lt b\lt c$.
Let's now consider the possibility that two variables are equal.  By symmetry, we may as well assume $b=c$.  In this case the equation becomes
$$a+2b=ab^2$$
This implies $b$ divides $a$, so writing $a=bk$ leads to
$$k+2=kb^2$$
which implies $k$ divides $2$.  The two (positive) possibilities for $k$ each lead to a contradiction.  Thus $(a,b,c)=(1,2,3)$ is the only solution with $0\lt a\le b\le c$.
As for solutions with non-positive integers, symmetry allows us to look for solutions with $a\le b\le0\le c$.  (I.e., if $(a,b,c)$ is a solution, then so is $(-a,-b,-c)$ and its permutations.)  If $b=0$, we have $a+c=0$, so we get solutions of the form $(-c,0,c)$.  If $b\lt0$, then we get the contradiction $abc\ge c\ge0\gt c+(a+b)$.
Answer: Well if you are asking about only integral solutions then there are infinitely many because we can take any positive number $\times$ then its additive inverse and zero will always add up to zero and their product will also be zero.
Few examples are:
$$0+(-2)+2=0×(-2)×2=0$$
$$0+(-3)+3=0×(-3)×3=0$$
and so on
Answer: a+b+c=abc then first of all (a+b+c)>=3*(abc)^1/2 so (abc)^2>=9abc so abc>=9 which shows that a+b+c>=9 which is strictly impossible to satisfy for integer.
Other way is to think that first of all 0 being obvious solution and for other solution let a+c=0 then
b=-aab
Which again gives 0 as the only solution
a+b+c=abc
(1/ab)+(1/bc)+(1/ca)=1 which is only possible for ab=2,bc=3,ca=6 which again yields no solutions.I mean different solutions i.e another equal to b & so on.
Comment: If you are trying to apply AM/GM inequality then your exponent needs to be $\frac 13$
Comment: Sorry I am just like that.
Answer: If you are looking for a general solution (not necessarily restricted to integers), here is one $(\tan \theta_1, \tan \theta_2, \tan \theta_3)$ where $\theta_1+\theta_2+\theta_3=\pi$.


Is there a way to tame bats or ocelots?

Question: I've been doing an experiment of taming animals  which animals can and can not be tamed to follow and attack for you. Bats don't seem to respond to any type of food I use, and ocelots have hearts above them when I feed fish to them, but does not tame them. Is there a way to tame ocelots or bats?
Answer: Yes and no, there is a way of taming an ocelot, you would do this by feeding it raw fish.  You must be very careful when feeding the ocelot because it scares very easily.  When the ocelot becomes tamed it will change color, so you will know when it's tamed.
As for taming a bat I don't believe there is a way in vanilla Minecraft.  There are ways to catch a bat and place it in your house so it looks tame, but that would be for looks.
Answer: I don't believe you can tame bats, but you should be able to tame ocelots with fish. Reference the Minecraft Wiki for more information.
Answer: Ocelots used to be tamable. Once cats were put in the game, the Ocelots would turn into a breed of the cats in the game now but now they're both separate things.
Answer: I know in normal minecraft you cane tame bats by giving them pumpkin pie, but I play minecraft demo and for some reason it does not work. I don't understand why.
As for ocelots, they can't be tamed but if you feed two ocelots fish that are next beside each other they will get a baby ocelot.

Is there a way to tame bats or ocelots?


Why does the change in the speed of a moving electron not change the current?

Question: If electrons are flowing through a conductor, then we have a current.
During my study, I've learnt that increasing the speed of electrons increases the current.
If those electrons pass through some resistor, their speed will drop.
Yet, I hear all the time that the current after the resistor is the exact same as it was before the resistor. How could it be the same if electron speed diminishes?
Comment: I'm not qualified to give you a full physics explanation, but electrons try to repel each other very strongly so it only takes a small reduction in distance between to cause a very large change in potential energy. Electrons are repelled from each other in all directions which helps cover up differences. You don't get "air pockets" like you would in a water pipe. Also note that the same current can be accounted for with higher speed and lower density, or lower density, and higher speed. These differences are very small and easily ignored in electronics and circuit analysis.
Comment: It is just an analogy, so don't take it too seriously. Imagine you are driving on a street. If the cars in from of you are moving fast then you can also move fast, but the moment they start decelerating you have to decelerate too. You can't just pass through them. Analogously, The electrons passing through the resistance affect the electron behind them, as they repel each other.
Comment: The speed does not drop in resistor
Comment: see https://physics.stackexchange.com/questions/43782/current-in-series-resistors-and-voltage-drop-in-parallel-resistors
Answer:
Why does the change in the speed of a moving electron not change the current?

First, let's consider an electron beam in a vacuum, such as in a cathode ray tube.
In a cathode ray tube, there is a strong electric field between the cathode and anode. As a result, electrons accelerate as they travel from the cathode to anode. Because of this acceleration, the charge density (the number of electrons in a given volume) decreases as one moves from a region of lower speed to a region of higher speed. However, the current, i.e. the number of electrons passing by a point (actually passing through a surface perpendicular to the direction of motion) per unit time, will be the same regardless of where we measure that.
[One can use the analogy of cars passing through an area where they go slow (say a toll booth) and then accelerating. In a steady state, the rate of cars passing a point some distance from the toll booth will be the same as the rate of cars passing through the toll both. The acceleration changes the distance between the cars, i.e. the car density, but not the rate of cars passing by.]
Now let's consider current in a wire. When electrons move in a non-super-conducting wire, they will interact with the atoms in the wire in such a way as to randomize their motion. Think of this interaction as a physical collision, with the electrons ricocheting off in random directions. Random motion of electrons does not contribute to net current. Net conduction current, or less formally, just current, is the net motion of charges in a given direction. An electric field will cause a net motion of electrons in a given direction. However, the "collisions" of the electrons with the atoms in the wire will cause a net motion of electrons to decrease.
If conduction current (or less formally, just current) decreases as one moves along the wire, then electrons will accumulate at the point where that decrease is taking place. [Think of cars arriving at a traffic jam!]. The increase in charge density will result in an increase in an electric field. This electric field will decrease the flow of electrons into that area, and will increase the flow of electrons out of that area. In an extremely short time, a steady state will be reached where current is constant throughout the length of the wire and there is no change in charge density with time throughout the length of the wire.
Although the mechanism is very different, we arrive at the same result as the case of an electron beam in a vacuum. That is, in a wire, the current is constant throughout the wire even though the average speed of the electrons may be different in different places.

During my study, I've learnt that increasing the speed of electrons increases the current.

We need to unpack this. As is already demonstrated, the current in a circuit, either in a wire, or in a vacuum, is constant throughout the circuit. So, in one sense, the idea that

increasing the speed of electrons increases the current.

is wrong.
However, there is another sense in which it is right. If we increase the electromotive force applied to a circuit, (Less formally, "the voltage") the average velocity of electrons in direction of current (the drift velocity) will increase. At the same time, increasing the electromagnetic force applied to a circuit will (usually) result in more current flowing through that circuit. Indeed, when the electromagnetic force is 0, there is (generally) 0 current. So, when applied to a whole circuit,

increasing the speed of electrons increases the current.

is true, even though when applied to parts of a circuit, it is wrong.

I hear all the time that the current after the resistor is the exact same as it was before the resistor.

This is correct. (In steady state, which takes only an amazingly small time to establish).

How could it be the same if electron speed diminishes?

The drift velocity, (average electron velocity in the direction of current) is likely to be the same on both sides of a resistor, although it may be different within the resistor.
[As mentioned, an electric field tends to accelerate electrons in a given direction, while the "collisions" of the electrons with atoms in the wire (or resistor) tend to randomize the motions of electrons. To maintain a constant current along a circuit, the electric field must have the same strength at any two points that have the same resistivity and the same cross-sectional area. So, if the "collision" rate is the same (for example because the wires are made of the same material at the same temperature), and the electric field is the same, (because the current is the same and the wire thickness and resistivity are the same) then the drift velocity will also be the same.]
Addendum:
If I have done my math correctly, the relationship between current and drift velocity is given by the equation
$$I = \rho v A$$
where $I$ is the current in a conductor of cross-sectional area $A$. $\rho$ is the density of mobile charges in the conductor, and $v$ is the drift velocity of those mobile charges.
Given the above formula, in a circuit which has the same current uniformly throughout, it is possible for the drift velocity $v$ to increase when the cross-sectional area of the conductor $A$ decreases, or when the density of mobile charges $\rho$ decreases. Either or both of these effects may occur in a resistor. Hence, the drift velocity in a resistor may be higher than the drift velocity in the wires connected to that resistor.
Answer: The current can be the same before and after the resistor and still have dropped over time. You are comparing a change over time with a change over location.

The unrestricted, fast-moving electron will, in this rough model, slow down when reaching a resistor. All the electrons behind it will now have to slow down as well and "queue up".

When exiting the resistor, the electron continues with the speed it was slowed down to. The speed - the current - is now the same in front of as after the resistor.

There is no disconnect here. Current in must equal current out. This is called Kirchhoff's Current Law: If more current enters than exits each second, then charge would accumulate within the resistor - which clearly doesn't happen in steady state conditions. If more current exits than enters each second, then where would the extra exiting charge come from?
The fact that the resistor is present slows down the current overall, but that overall current still must be constant along any series-connected path since the steady state will be reached very quickly. Meaning, it must be constant across all locations, all points, but not necessarily constant in time.
Comment: Actually, the drift velocity in a resistor may be higher than the drift velocity in the wires it is connected to. This may be true if a) the cross section of the resistor is smaller, requiring a higher current density, and hence higher voltage, or b) the number of mobile charges is smaller in the resistor, requiring a higher drift velocity for a given current.


How many run should we implement on the machine learning model?

Question: Theoretically, we can implement fix seed on the machine learning model to get the same results every run  (reproducible)but it may leads to bias. So, in order to prevent bias, I gonna run the model for several times without fix the seed/state. How many time should I run the machine learning model or normally done by researchers to get the result (10 runs,20.. or more)?
Answer: It depends on your problem, start with a big number (32 ?) then decrease if the model is stable / when you deal with stability.
You need to know that having multiple runs may be part of the solution: you can create an ensemble of models to get more stable models. Here again, the way to create an ensemble and the number of models you need to run to build an ensemble is determined experimentally. The main alternative to add stability to your model is trough regularisation (that really depend on the model you want to use).


Use of file with '.dat ' extension

Question: I dowloaded the climate data from this site http://catalogue.ceda.ac.uk/uuid/3f8944800cc48e1cbc29a5ee12d8542d and they have the extension .dat .
I'd like to import the information in QGIS as raster data.
Comment: What do you see if you open the .dat file with text editor?
Comment: From the menubar, go to: `Layer > Add Layer > Add Raster Layer...` and try selecting the `ZMap Plus Grid (*.dat *.DAT)` extension.
Answer: From the More Information page:

The CRU TS 3.00 data (i.e. climate variables) are available in both
  compressed (.gz extension) ASCII ".dat" and netcdf ".nc" file formats.
  CRU TS 3.00 metadata files (i.e. stations) are available in ASCII. To
  understand how to read the CRU TS 3.00 data and metadata files, please
  refer to the CRU_TS_3.00_File_Formats_explained PDF documentation
  (under Linked Documentation below).

So you have an ASCII file - that means you can open it with a text editor or on unix do something like head file.dat to see what it looks like. It may well be
0 0 139392.2
0 1 3082792.2
....

Which is an XYZ file or it might be:
ncols         4
nrows         6
xllcorner     0.0
yllcorner     0.0
cellsize      50.0
NODATA_value  -9999

which is an ESRI style Ascii Grid.
QGIS can open either of these and many other variations.

Use of file with '.dat ' extension


Should I assume that my users are computer literate?

Question: These days, most people have some kind of technology device, wether it be a cell phone, tablet, laptop, or desktop computer. So is it safe to assume that all of my users are computer literate? (i.e. understand most of the "computer-y" terms such as windows, dialogs, modals, menus, etc.)
Comment: Always assume that your users are not that computer literate!
Comment: Who are your users?
Answer: Short answer: no.
I don't know about your parents, but mine each have a smart phone and they have a Windows laptop at home. I wouldn't say they're computer literate, though. They know how to do the things they need to do: read email, make a phone call, send a text. But beyond that, they get frustrated and give up. (My mom has seven Facebook accounts. Just yesterday couldn't figure out how to reply to a text I sent her.)
They're not idiots. They just have much better things to do than monkey around with their devices all day to learn the way things work. And I'm not referring exclusively to the 70+ demographic. I've seen working people have the same kind of problems.
Get to know your users. Get to know users in general. Watch your friends and parents and coworkers as they use their technology. I often see people lose confidence when they have to do something out of their ordinary routine.
Comment: In fact, I'm an ex-electronic engineer turned programmer. I don't want to monkey around with my devices either and my sons both make fun of me for how I have my phone set up along with the occasional problem I have.
Answer: Definitely not - it is generally safe to assume NOTHING about your users until you have talked to them directly.
Answer: NO.
I argue for the sake of devil advocating and promote a different school of thought.

Do not include 'being nice' when it comes to logical decisions. 'Illiteracy' is a state of knowing, not an accusation.
Most people, including the younger generation, follow a set of instructions - an illusion they know what they are doing. Just because they are on social media, it does not mean they are computer literate.
Putting the audience literacy rate to low, allows you to discover better ways to implement user experience.
I do believe most people have better things to do than monkey around their devices, but often they simply stay ignorant and prefer screaming at a customer service staff instead.
I think it's much safer to assume the audience are made of idiots. Most people will tell you "make it friendly for everyone". Every time the word 'everyone' pops out, you have to make it dumb proof. So-called 'literates' have a random set of literacy anyways.
Most UX guides will ask you to use the most simple, basic words, or other elements anyways, suitable for "everyone". Google and other large service providers use this method.
People will learn what they need, and find the easiest way to do so. Even literates. Everyone wants fast, useful, and simple applications.
To be honest, I have no idea why it is not safe to think this way. If you found out that your audience are really computer-literate, would you purposely make everything harder, or ignore a large chunk of UX? If you cannot explain anything simply, you are not so good at it.

I do not go out and call people stupid, but your personal morals do not matter here. I just think it's safer to assume users don't even know how to read. I know the logical answer is "do research!", but if you are on a smaller scale, there is a lot to assume.
Answer: It's not safe to make assumptions like this, based on broad generalisations. Certain data about your specific users can sometimes translate into informed assumptions, which you can then validate. You should also consider what you mean by "computer literate" and how you believe that should inform your design. It's not really precise enough to be a useful data point IMO.
In UTs I have seen that many people are confused by an unfamiliar interface, even those who are comfortable / experts with specific systems or devices. On one project I had a user base of specialist staff members who would be using the system daily, after receiving training, and even with those users (relatively homogenous / known quantity) I found material differences in style (e.g. mouse vs keyboard), experience and competence.
Answer: Dont Assume.
Study your users and draw conclusions.
If user base is too wide then check what % of user base you 'Assuming' are computer literate.
If this is major of user base then definitely assumption is not advised.
Answer: "Computer Literacy" -  is a very broad term covering a very wide set of skills.
You really have to break it up into experience using an Operating System (and version) and specific skills for each bit of applications software (email, wordprocessor, spreadsheet, any programming skill etc etc).
Trying to recruit people by 'computer literacy' for testing is really difficult as I've found to my cost !


How long do expansion anchors last?

Question: I have a wall sconce in my room, which is attached to the wall with two expansion anchors (dowels). They look well-fixed, but, AFAIK, they are about 20 years old. Do you know, how long dowels last, and whether I should replace them because of their age?
Comment: Are these wooden dowels? Plastic? Do you know anything about the brand or trype that was used?
Comment: If an expansion anchor is installed properly and sized correctly for the load (and dry) I haven't seen one fail. If the load has high vibration that is a diferent story also if it is a wet location wood can rot steel rusts. But if properly installed I have found wood plugs that were over 100 years old even lead in cement that was fine after 70-80 years when the lag bolt rusted off.
Comment: @Sean, they are metallic!
Answer: I found the Wood kind of my Grandfather in my House. They are just fine. The plastic once should last even longer. Don't fix them if they don't need fixing!

How long do expansion anchors last?


How to implement countdown timer class in TDD?

Question: I'm learning to do TDD in practice in small project. I want to create a countdown timer class, how to implement it in TDD(Red, Green, Refactor), and it has the delegate callback as well.
Answer: I am not sure of your exact question, but I think you want to know how you can write tests first for your countdown timer?
If so start with writing one of the primary tests, say Start, Stop, or Reset. These are your action events and will be the ones you invoke first (most likely). Code these tests first and execute them. They should be red because they can't actually run the countdown timer.
Then add dummy code to one of the functions in your countdown timer. For instance, add the Start() function which starts the countdown timer. Leave the function empty for now. The test should still be red
Now we need to add a way to get the current time remaining. Add a "Remaining" property where we can check the time remaining. Update the test so that it captures this property, starts the timer and then checks the property again to see if it changed. The test should be red still since we have no code to change the property.
Update the start method to kick off your countdown process and update the internals of your countdown timer. Rerun your test now and it should be green since the value is changing.
Now it's time to refactor. Look through your code and clean things up. Simplify where you can and then reexecute your tests. If all is good everything should be green and you can move on to your next test.
Hope that helps.
Answer: Generally I don't test things like that in unit tests.  Instead, I'll keep that code as small as possible, and have it call the class that does the work with either the time I want it to be, the elapsed time, or just a general "Do work now" kind of message.


Is someone nitpicking?

Question: Are my questions really so bad or is it possible that a particular user is extremely nitpicking on my questions, say, mithilfe+Genitiv OR mithilfe+von+Dativ? ?
Comment: Now that the linked questions are deleted, it's not longer possible to give a proper answer. Hence VTC.
Comment: @Marzipanherz Users over 2000 rep (10000 on matured sites) can see deleted posts. Typically, in similar cases a screenshot of the deleted post(s) are inserted retroactively into the question.
Answer: The StackExchange question & answer model has a great advantage over other sites in that a post is not only judged by the community but that it is also many users who - with their votes - make clear which posts are great, which posts are mediocre, or which posts need an edit for improvement.
It also is the community who with their votes decide on the on topicness of questions asked here. To do so we had a lot of Meta posts to define what topics we accept and what not. Sometimes the line is not so clear-cut and sometimes there still is debate where to draw the line for off topicness. This lively discussion is a good thing.

Still, it is not a single user but the community to decide this.

So from your many posts so far there are both, well received questions with many upvotes, and questions where the community felt an edit was needed. Often you will be asked for this in comments. From these comments the level of politeness is very different amongst our user base as much as our users come from very different cultural backgrounds. Please also keep in mind that for most people here English is not their native language, and language skills are hugely different. Nevertheless, if you don't follow the advice given or explain otherwise why you prefer to leave your post unchanged there is very little hope that the community members involved will change their mind on the quality of your post.
In the end it is you who came here seeking for an answer to your question, and it is the community members who with their spare time voluntarily try to give you an answer to the best they can. This deserves all our respect, including our good will to follow the rules this community had defined regarding the scope they are willing to contribute.
So my advice to keep having fun in our community would be to try your best to help people help and to stay away from people that made you feel bad.
Oh, and yes, do continue to flag rude comments because only then we will be able to take the necessary action for people who show continued rude behaviour.
Comment: @LangLangC: that's an issue and that's why I recommend to ping the commenter, provided we will promise to remove this comment later. Contrary to your observation it is my impression that we do have quite a good vote review ("unvote") rate for posts that underwent a substantial improvement. If a post stays poor (this sadly happens too) then of course there is no reason to undo a vote.
Comment: Seem factually wrong. "many users who - with their votes - make clear […] which posts need an edit for improvement." As far as I can see the *vast* majority of votes are cast and then left at that. "Unvotes" are rare after edits, my guess for HNQ-votes almost unheard of? Comments indicate, well *should* indicate, and even here sometimes do indicate need for improvement; and in which way. But as long as there is no notification system for voters that an edit was made, I suspect things will stay that way.

Is someone nitpicking?


Good portfolio to be accepted internationally

Question: I work as a graphic designer ( package) and I want to apply for abroad, what should I do to make a very good portfolio, which will be accepted internationally . I am aiming for UK,  Canada and Australia.. Please help me about this matter
Answer: A good portfolio is already international; good design is good design no matter where you are.
Just focus on showcasing what you consider to be your best work, which highlights your style and your skills.


separate a file into several small files according to columns

Question: I have a data file, which can have N rows, and each row is composed  M elements separated by white space. Currently, I want to separate each row into several segments. In other words, assume the number of segments is 3; then the original file will be separated into 3 files, each of which has N rows and each row has M/3 elements. Besides writing C++ or Java program, Is there any efficient approach that can fulfill this task on Unix/Linux?
Comment: This title could use a rephrasing to be easier to find by search.
Answer: Is this what you are looking for?
awk '{ print $1 $2 $3 > file1; print $4 $5 $6 > file2; print $7 $8 $9 > file3 }' originalfile

Or did you want something more general?
awk -v 'n=3' -v 'prefix=pref' '{
    for (i = 0; i < n; i++) {
        for (j = 0; j < NF / n; j++) {
            printf("%s ", $(i + j + 1)) > prefix i
        }
        printf("\n") > prefix i
    }
}' originalfile

Note: this relies on the assumption that all rows have the same number of columns.
Answer: If your file is clean, I would advice to use the standard application cut
cut has three flags that you should know at least

-d to define the delimiter (TAB is the default
-f to select the field
-c to select a character range

You can choose to either use the combination -d -f, or -c
If your file is not TAB delimited, but nicely delimited by space, you can do
cut -d' ' -f1-3

to select the first three columns.
If you want to select the 4th column, that is in between character 25 and 36, you can do
cut -c25-36

Answer: This caters for a varying number of fields in the same file, and the last segment being only partialy filled, ie less fields than specified (per segment).
Note though, that if the number of fields in a line  results in fewer segments than specified, nothing is written to the output file for those shortfall segments.
awk -v 'ncol=5' -v 'pfix=file' '{
    fldn = 0
    sfix = 1
    segs = NF/ncol
    # round up if number of field is not evenly divisible by number of columns
    segs = (segs == int(segs)) ?segs :int(segs)+1
    while (fldn != NF) {
        fmod = (++fldn) % ncol
        printf "%s%s", dlim, $(fldn) >> pfix sfix
        if (fmod == 1 ) { dlim = " " }
        if ((fmod==0 ) || (fldn==NF))  {
            printf "\n" >> pfix sfix
            dlim = ""; sfix++
        }
    }
}' infile

Answer: sep_file.ksh
#!/bin/ksh

FILENAME=$1
SEG=$2

SEG_NO=1

while [[ $SEG_NO -le $SEG ]]
do
  awk '{CL=NF/'"$SEG"';CL=(CL==int(CL)?CL:int(CL)+1);LS=(('"$SEG_NO"'-1)*CL)+1;LE=LS+CL-1;if(LE>NF)LE=NF;for(i=LS;i<=LE;i++)printf("%s ",$i);printf("\n")}' $FILENAME > ${FILENAME}_$SEG_NO
  SEG_NO=`echo "$SEG_NO + 1"|bc`
done

Usage: ./sep_file.ksh <file_name_to_read> <no_of_segments>


On IIS 7.5, can a classic ASP page share session variables with an ASP.NET application?

Question: If you have seen my previous questions, you're aware that I'm in the process of updating some existing ASP pages, in an effort to move them from a Windows 2000 environment to a Windows server 2008 R2 environment.  One of the pages offers the end-user the ability to upload a file to be processed later.
I re-wrote the original page that handled the uploading, using ASP.Net's file upload object.  It works fine, but I'm running in to a snag when trying to integrate the new aspx pages in with the existing asp pages.  The new aspx pages live in a subdirectory of the main application, along with a few other asp pages, but in order for the asp.net pages to function, I had to use the "convert to application" option on on the folder.  When I did that, I think it broke the ability for the new aspx pages (and any other asp pages in the folder containing the aspx pages) to use the Session variables that the parent pages use.
I tried creating an application pool for the new folder's application, but that didn't make any difference.  I also changed the managed pipeline from Integrated to Classic, both on the parent folder and on this folder with the aspx pages, but that also doesn't appear to have made any difference.
If anyone can shed some light on this, I'd be very grateful.
The main asp files live in folder named "dcn".  There are several child folders in the "dcn" folder, many of which contain asp pages.  Asp pages in those folders continue to work correctly.  The folder which contains the aspx pages is called "CNAM", and it has now been converted to an application.  Any asp page in this folder no longer seems to see the session variables that are available to the other folders/pages.
Thanks in advance for any insights or suggestions regarding this.  Again, I really appreciate any assistance.
Mitchell
Answer: How to Share Session State Between Classic ASP and ASP.NET


Switch to other theme at URL

Question: I want to switch to another theme at when a user visits www.mysite.com/m/. Then, redirect mobile users to www.mysite.com/m/ with htaccess based on their user-agent.
I have the htaccess redirect rules and it is working for me. But how do I switch to mobile theme based on the URL?
The Virtual theme plugin is a great solution for me, but unfortunately it doesn't work for mobile browsers.
Answer: Given that this is an older question and the mention plugin is very much depreciated, both the WordPress core and themes have changed greatly since then.
Nowadays, most themes are mobile-friendly and will conform based on the amount of screen space is being used to visit a website.

Switch to other theme at URL


Doubt over Kelvin-Planck statement of thermodynamics' second law

Question: I have a doubt over the Kelvin and Planck's statement of thermodynamics' second law, in particular applied to a cycle. Let's take a Carnot cycle as an example, and let's call the first two transformations (the isotherm and the adiabatic) done. Now, isn't it obvious that the machine has to give up heat to go back to the initial state? Isn't it something that follows from the fact that the cycle has to be continuous?
Comment: Can you explicitly write the statement of the second law you are using?
Comment: Sure. "It's impossible to realise a process which has as the sole result the transformation in work of the heat given by a reservoir at a uniform temperature"
Comment: Right so in the Carnot cycle, the engine takes some heat $|Q_H|$ from a hot reservoir, and transforms *some* of it into work $W$ and the rest into exhaust heat $|Q_L|$ which is given up to a lower temperature reservoir.  The exhaust heat is precisely what causes the law to not be violated.
Comment: Thank you. My doubt was just that a general cycle, once has done work, has to close itself in *some* way (I'm thinking of it in a p-V diagram), and I couldn't think of any plausible way in which a cycle could close without giving up some exhaust heat. The engine would have to "jump" in some manner to go back to the initial state. But as I understood from your comment, that's precisely what the Kelvin and Planck's statement says, right?
Comment: Yeah that's basically right.  Any cycle is going to have to give up some exhaust heat to satisfy the Kelvin statement.  I'm going to make this a bit more precise in an answer.
Answer: Every thermodynamic system satisfies the first law during a given process;
$$
  \Delta E = Q-W
$$
Here $\Delta E$ is the change in its internal energy, $Q$ is the heat transferred to the system, and $W$ is the work done by the system.  For a system undergoing a cyclic process, namely one for which it starts and ends in the same thermodynamic state, one has $\Delta E = 0$, and the first law then tells us that
$$
  Q = W
$$
Now, suppose that the system is taking some heat $Q_H>0$ from a reservoir, and turning it into some work $W$.  Let's define
$$
  Q_\mathrm{exhuast} = Q-Q_H
$$
then we can write
$$
  Q_H + Q_\mathrm{exhaust} = W
$$
The Kelvin statement tells us that we must have $Q_\mathrm{exhaust}\neq 0$ because otherwise, we would have $Q_H = W$; the sole result of the process would have been to transform the heat it took in into work.  The symbol $Q_\mathrm{exhaust}$ is what one commonly calls the exhaust heat.
Comment: Thank you very very much. Too bad I can't give you reputation. :(
Answer: in simple words we can expain kp statement as it is impossible to completely convert heat into work in a cycle(*).
while in case of a single process say a isothermal expansion as dt=0 therfore ineternal energy which is a function of temp so dE = 0 neglecting k.e and p.e so from 1st law we get dq = dw .
in isothermal expansion we are able to get work but only  till the pressure of the gas do not becomes equal to the atmospheric pressure in which we can convert heat into work but not infinitely.
hence the kp statement is that we cannot completely convert heat into work in a cycle of infinitely.....


Data dump: Are vote ids in chronological order?

Question: The timestamps of the votes in the data dump are all at time 00.00.00. Are the ids of the vote rows in chronological order? I mean, did the vote with id 1 arrive before the vote with id 2?
Answer: No, I don't think they are but it would need an SE developer to confirm. Here are my thoughts:
There are two things at play here:

The generation of the id's
Transactions to record events

The Id's are generated by the database engine used by Stack Exchange and that happens to be Sql Server. If I assume the Id's are generated by using an IDENTITY column the current implementation states Each new value is generated based on the current seed & increment. and Each new value for a particular transaction is different from other concurrent transactions on the table.. It doesn't state anything of the values being chronological for transactions that run concurrently but have different start times.
Posts are hardly ever locked for a single user. So anyone can take every available action for them on a single post and the system will take it. As opposed to money transfer/bank transactions it isn't that import in which order the exact events took place. And this might lead to an effect were the creationdate of higher ids are prior to events with lower ids.
You stated correctly that the Votes table doesn't record timestamps so instead let's look at the posthistory table at Meta Stack Exchange with a query that finds records where the creationdate and it's id are not chronological.
This is some result:

When visiting the timeline for Answers with external references;... you'll see near the bottom an edit event and an answer posted. Those two transactions were so close together their id's and recorded creationdate were no longer chronological. There are more case like that, even were it differs days but that was a migration case.
tl;dr;

Did the vote with id 1 arrive before the vote with id 2?

In a lot of cases, yes but there is no guarantee this is always true and sometimes this can be way-off. Depending on your use case ignore this fact or allow for a margin of error.


What is a Module over a Lie algebroid?

Question: Let $\alpha: \mathfrak g_A \to T_{A/k}$ be a Lie algebroid over a $k$-algebra $A$. Numerous facts about and its universal enveloping algebra comes from the theory of ring differential operators on $A$. A generalization of theory of D-modules has been used to characterize modules over $\mathfrak g_A$ (eg. Sophi Chemla paper on Inverse image functor for Lie algebroids). But I couldn't find is a good reference for the notion itself. What is a $\mathfrak g_A$-module?
Comment: I don't know this stuff, so I will leave only a comment.  I think that there is some disagreement over the correct notion of module.  In particular, my friend Alfonso Garcia-Saz http://www.math.toronto.edu/alfonso/ has some papers where they look towards a more general notion of module.  The test is whether the Lie algebroid is a module over itself; in some older definitions, it is not.
Comment: Yes, the adjoint action will not give a a module structure over the Lie algebroid itself because it is not $A$-linear. Thank you for the paper--
Answer: A $\mathfrak{g}_A$-module $M$ is a $k$-module endowed with structures of $A$-module and $\mathfrak{g}_A$-module satisfying the compatibility equations $(ax)m = a(xm)$ and $x(am) = x(a)m + a(xm)$ for any $a\in A$, $x\in\mathfrak{g}_A$, and $m\in M$.  Here $x(a)$ denotes the action of $\mathfrak{g}_A$ in $A$, while the three other actions are denoted by $ax$, $am$, and $xm$.
A $\mathfrak{g}_A$-module is the same that a module over the enveloping algebra $U_A(\mathfrak{g}_A)$.
Answer: Since Leonid already gave the definition, let me give a reference: Beilinson and Bernstein's A Proof of the Jantzen Conjectures.

What is a Module over a Lie algebroid?


Elasticsearch: enable debug logging on standalone node client

Question: Can anyone point out how one can enable debug-level logging for discovery on a standalone client using the Node client? I have the following code, trying to join a single-node remote cluster. The discovery times out after 30 seconds (yet transport works fine, and starting a bootstrapped ES node on this same host with master=false, data=false works perfectly).
val settings = ImmutableSettings.settingsBuilder().
put("discovery.zen.ping.multicast.enabled", false).
put("node.data","false").
put("node.master","false").
put("discovery.zen.ping.unicast.hosts ", "myeshost").
build

val node = nodeBuilder().
loadConfigSettings(false).
settings(settings).
client(true).
node.
start

But this only results in:
...
[run-main-0] INFO org.elasticsearch.node - [Hebe] starting ...
[run-main-0] INFO org.elasticsearch.transport - [Hebe] bound_address {inet[/0.0.0.0:9301]},publish_address {inet[/10.60.35.37:9301]}
[run-main-0] WARN org.elasticsearch.discovery - [Hebe] waited for 30s and no initial state was set by the discovery
...

I found this doc article talking about dynamic changes to logger.discovery values, but this likely doesn't work on a standalone client since discovery happens well before the HTTP listener is started to even receive the update request. Adding 'put("logger.discovery","DEBUG")'  to the settings builder above didn't help either.
Any pointers are sincerely appreciated.
Answer: You can try to access the Log4J logger factory directly using this:
import org.elasticsearch.common.logging.log4j;

// add this before creating your client node.
Log4jESLoggerFactory.getLogger("discovery").setLevel("DEBUG");


Is it possible to have same mass and volume for a solvent and its solution

Question: Is there any solute-solvent interaction possible, in such a way that a solvent with mass X grams and volume Y litres, and a solute with mass A grams and volume B litres, to form a solution that has exactly the same mass and volume as that of the solvent (X grams and Y litres)?
Comment: Not exactly *exactly*, but if $X \gg A$ ... ;-)
Comment: I think you wrote this down wrongly, because the mass does of course not change . Do you mean you want to add something to 1 litre of solvent, and still have exactly one liter of solution? Or do you want that the volume of the solution is exaclty the sum of the volumes of solute and solvent?
Answer: As Klaus suggests above, you can't add mass to another mass without it increasing.  That would defy the first law of thermodynamics that energy cannot be destroyed since mass and energy are directly linked.
However, much of this depends on what degree of precision you're measuring to.  If you're working with a cubic metre of water and only measuring to the first two significant figures, mass would be 1000kg and volume 1000l, and you add 40kg of sodium chloride to make a 4% saline solution, you would still only have 1000kg and 1000l because you're not counting the third significant figure.
It's all about context ;-)


Mathematical relation between aperture and DOF

Question: I know that aperture and DOF are inversely proportional. But, can anybody explain to me the Physics/Optics behind that? What's the mathematical relation that relates aperture with DOF?
Comment: It's primarily a *geometric* relation that explains it. Of course that geometric relationship can be expressed in mathematical terms, but it is first and foremost a geometrical relationship.
Answer: Wikipedia has all of the DoF formulae you probably ever need. You may now begin to see why optics is a field of physics unto itself.
You aren't going to be able to learn these equations and do them in your head to map an ƒ number to a depth of field in, say, feet. This is why there are so many DoF calculators floating around. I wrote one of many.


Performance - using Guid object or Guid string as Key

Question: When using a Guid as an index for a Dictionary, is it better to use the Guid object, or the string representation of the Guid?
I just refactored some code which was using string to use the object, because there were new Guid() calls all over the place. But that left me wondering what the performance issues might be. (The collections are fairly small, but they get iterated lots of times.)
Answer: The Guid should be quicker, as the comparison is simpler - just a few direct bytes. The string involves a dereference and lots more work.
Of course - you could profile ;-p
Evidence:
Searching for 7f9b349f-f36f-94de-ad96-04279ddf6ecf
As guid: 466; -1018643328
As string: 512; -1018643328
Searching for 870ba465-08f2-c872-cfc9-b3cc1ffa09de
As guid: 470; 1047183104
As string: 589; 1047183104
Searching for d2376f8a-b8c9-4633-ee8e-9679bb30f918
As guid: 423; 1841649088
As string: 493; 1841649088
Searching for 599889e8-d5fd-3618-4c4f-cb620e6f81bb
As guid: 488; -589561792
As string: 493; -589561792
Searching for fb64821e-c541-45f4-0fd6-1c772189dadf
As guid: 450; 1389733504
As string: 511; 1389733504
Searching for 798b9fe5-ba15-2753-357a-7637161ee48a
As guid: 415; 779298176
As string: 504; 779298176
Searching for 12ba292e-8e59-e5d0-7d04-e811a237dc21
As guid: 457; 558250944
As string: 564; 558250944
Searching for 05b3ce14-dfbf-4d3a-1503-ced515decb81
As guid: 413; 1658205056
As string: 504; 1658205056
Searching for 8db4a556-0a65-d8cb-4d0d-0104245d18b8
As guid: 415; 696231936
As string: 506; 696231936
Searching for c49cf80c-5537-fba5-eebd-8ad21bba09c4
As guid: 459; 2100976384
As string: 557; 2100976384

based on:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
static class Program
{

    static void Main()
    {
        Random rand = new Random(123456);
        int COUNT = 1000;
        Dictionary<Guid, int> guids = new Dictionary<Guid, int>(COUNT);
        Dictionary<string, int> strings = new Dictionary<string, int>(
            COUNT, StringComparer.Ordinal);

        byte[] buffer = new byte[16];
        for (int i = 0; i < COUNT; i++)
        {
            rand.NextBytes(buffer);
            Guid guid = new Guid(buffer);
            int val = rand.Next();
            guids.Add(guid, val);
            strings.Add(guid.ToString(), val);
        }

        for(int i = 0 ; i < 10 ; i++) {
            int index = rand.Next(COUNT);
            Guid guid = guids.Keys.Skip(index).First();
            Console.WriteLine("Searching for " + guid);
            int chk = 0;
            const int LOOP = 5000000;
            Stopwatch watch = Stopwatch.StartNew();
            for (int j = 0; j < LOOP; j++)
            {
                chk += guids[guid];
            }
            watch.Stop();
            Console.WriteLine("As guid: " + watch.ElapsedMilliseconds
                   + "; " + chk);
            string key = guid.ToString();
            chk = 0;
            watch = Stopwatch.StartNew();
            for (int j = 0; j < LOOP; j++)
            {
                chk += strings[key];
            }
            watch.Stop();
            Console.WriteLine("As string: " + watch.ElapsedMilliseconds
                   + "; " + chk);
        }
        Console.ReadLine();

    }
}

Comment: Oh, you won't do it for me? ;)
Comment: Wow, you did! The answer is yours, sir!
Comment: @FlyOn: umm, yes. Almost 4 years on... :-)
Comment: String is slower, not faster.
Comment: Actually, the figures *only* cover the lookup times. The add is not profiled.
Answer:
The collections are fairly small, but they get iterated lots of times

If you are iterating, there are no key to key comparisons. If you are adding/modifying or looking up by key, then keys will be hashed and the hashes compared; only if the hashes are equal will the keys be compared.
Therefore, unless you are performing a lot of key based operations on huge dictionaries with many hash collisions the speed of key to key comparisons will not be a major factor.
Comment: Yeah, bad wording on my part. There's not much point having a dictionary if there are no lookups!
Comment: A Dictionary ensures keys are unique and O(log n) insertion; this can be very useful even if you are only going to iterate.
Comment: (see reply to your comment on my post)
Comment: If you don't need key/value semantics but want to ensure uniqueness, a HashSet is probably a better way to go.
Answer: My first thought would have been, that Guid objects are faster, but if you get some input as string and have to search it in a small collection (hashset) of GUIDs (which aren't changing often), it might be faster to store them as strings, because:

For searching a string in a GUID-Dictionary, you have to parse the string (including error checking etc.), create the Guid structure, get the hash code, do the hash lookup and one final comparison of the GUID bytes.
For searching a string in a String-Dictionary, you have to build the hash of the string (possibly faster than building the Guid struct), lookup the hash and do one string comparison. If, for instance, you expect many GUIDs not to be in the collections, the hash comparison will fail often an you don't even have to do the string comparison (which takes slightly more time than the GUID-comparison from point 1 above)

If you already have Guid-structures as input (e.g. because you did some validity-checking on the input strings) of course it's far better to reuse them as index in the dictionary.
BUT: From point of view of design clarity (which is far more important than performance in 99% of all code) you should use Guid structures and only change that, if you really run into performance troubles (and profiling shows that you get an advantage out of the string solution).


Can the referee give a red card for an incident that happens after the end of a match?

Question: In football, if team A wins and a player from team A mocks team B for losing (call them a idiot team, non-fair-play attitude, etc.) can the referee give a red card to that player after the match ends?
Comment: The impact of a red card on a tournament is not something within the LOTG; different competitions assign different penalties for a card (or a set of cards) and even for different reasons for the card(s).
Comment: In the English Premier League, it sometimes happens that players or even coaches are given yellow or red cards for incidents that take place after the final whistle - including in the tunnel when leaving the playing area.
Answer: Yes, definitely.
Referees can take action as long as they are still on the pitch after the game has ended. This is covered in Law 5: The Referee

[The referee] has the authority to take disciplinary action from
entering the field of play for the pre-match inspection until leaving
the field of play after the match ends (including kicks from the
penalty mark). If, before entering the field of play at the start of
the match, a player commits a sending-off offence, the referee has the
authority to prevent the player taking part in the match (see Law
3.6); the referee will report any other misconduct.


Citation undefined on input - citation appearing as question mark

Question: I am quite new to using LaTeX and Mendeley. I am using the most up to date version of MacTeX and Mendeley desktop. I created a library.bib file (I checked the option 'create 1 BibTeX file for my whole library' which looks like this:
Automatically generated by Mendeley Desktop 1.17.13
Any changes to this file will be lost if it is regenerated by Mendeley.

BibTeX export options can be customized via Preferences -> BibTeX in Mendeley Desktop

@article{Lipson2017,
abstract = {Ancient DNA studies have established that European Neolithic populations were descended from Anatolian migrants who received a limited amount of admixture from resident hunter-gatherers. Many open questions remain, however, about the spatial and temporal dynamics of population interactions and admixture during the Neolithic period. Using the highest-resolution genome-wide ancient DNA data set assembled to date$\backslash$---|a total of 177 samples, 127 newly reported here, from the Neolithic and Chalcolithic of Hungary (6000-2900 BCE, n = 98), Germany (5500-3000 BCE, n = 42), and Spain (5500-2200 BCE, n = 37)$\backslash$---|we investigate the population dynamics of Neolithization across Europe. We find that genetic diversity was shaped predominantly by local processes, with varied sources and proportions of hunter-gatherer ancestry among the three regions and through time. Admixture between groups with different ancestry profiles was pervasive and resulted in observable population transformation across almost all cultural transitions. Our results shed new light on the ways that gene flow reshaped European populations throughout the Neolithic period and demonstrate the potential of time-series-based sampling and modeling approaches to elucidate multiple dimensions of historical population interactions.},
author = {Lipson, Mark and Sz{\'{e}}cs{\'{e}}nyi-Nagy, Anna and Mallick, Swapan and P{\'{o}}sa, Annam{\'{a}}ria and St{\'{e}}gm{\'{a}}r, Bal{\'{a}}zs and Keerl, Victoria and Rohland, Nadin and Stewardson, Kristin and Ferry, Matthew and Michel, Megan and Oppenheimer, Jonas and Broomandkhoshbacht, Nasreen and Harney, Eadaoin and Nordenfelt, Susanne and Llamas, Bastien and Mende, Bal{\'{a}}zs Guszt{\'{a}}v and K{\"{o}}hler, Kitti and Oross, Kriszti{\'{a}}n and Bond{\'{a}}r, M{\'{a}}ria and Marton, Tibor and Oszt{\'{a}}s, Anett and Jakucs, J{\'{a}}nos and Paluch, Tibor and Horv{\'{a}}th, Ferenc and Csengeri, Piroska and Ko{\'{o}}s, Judit and Sebok, Katalin and Anders, Alexandra and Raczky, P{\'{a}}l and Regenye, Judit and Barna, Judit P. and F{\'{a}}bi{\'{a}}n, Szilvia and Serlegi, G{\'{a}}bor and Toldi, Zolt{\'{a}}n and Nagy, Emese Gy{\"{o}}ngyv{\'{e}}r and Dani, J{\'{a}}nos and Moln{\'{a}}r, Erika and P{\'{a}}lfi, Gy{\"{o}}rgy and M{\'{a}}rk, L{\'{a}}szl{\'{o}} and Melegh, B{\'{e}}la and B{\'{a}}nfai, Zsolt and Fern{\'{a}}ndez-Eraso, Javier and Mujika-Alustiza, Jos{\'{e}} Antonio and Fern{\'{a}}ndez, Carmen Alonso and Echevarr{\'{i}}a, Javier Jim{\'{e}}nez and Bollongino, Ruth and Orschiedt, J{\"{o}}rg and Schierhold, Kerstin and Meller, Harald and Cooper, Alan and Burger, Joachim and B{\'{a}}nffy, Eszter and Alt, Kurt W. and Lalueza-Fox, Carles and Haak, Wolfgang and Reich, David},
doi = {10.1101/114488},
file = {:Users/zzzz/Documents/mendeley{\_}papers/Parallel palaeogenomic transects reveal complex genetic history of early European farmers.pdf:pdf},
issn = {0028-0836},
journal = {Nature},
pages = {114488},
publisher = {Nature Publishing Group},
title = {{Parallel ancient genomic transects reveal complex population history of early European farmers}},
url = {http://biorxiv.org/content/early/2017/03/06/114488},
year = {2017}
}

And my latex file looks like this (after having chopped out some stuff for brevity):
\documentclass[11pt, oneside]{article}      % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                          % ... or a4paper or a5paper or ...
%\geometry{landscape}                       % Activate for rotated page geometry
\usepackage[parfill]{parskip}           % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}               % Use pdf, png, jpg, or eps§ with pdflatex; use eps in DVI mode
                                % TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{subcaption}
%SetFonts

%SetFonts

\title{zzz}
\author{zzz}
\date{}                         % Activate to display a given date or no date

\begin{document}
\maketitle
\section{Abstract}

zzzzz \cite{Lipson2017}.

\bibliographystyle{IEEEtran}
\bibliography{/Users/zzzz/Documents/mendeley_papers/library.bib}

It compiles fine, but the reference is just a question mark within the text. And there is an error saying:
LaTeX Warning: Citation `Lipson2017' on page 13 undefined on input line 183.

LaTeX Warning: There were undefined references.

Is there something obvious I am doing wrong? I've looked through all the other help threads but none of them solve my issue.
Comment: The standard answer is that you probably forgot to run BibTeX: https://tex.stackexchange.com/q/63852/35864 If you did run BibTeX and still nothing works, please check the `.blg` file for warnings or errors.
Answer: in the line where you call the bibliography file,
\bibliography{/Users/zzzz/Documents/mendeley_papers/library.bib}

you need to remove ".bib" from the end of the path. Then it should work!
Comment: thanks it helped.


Looking for a short science fiction story about a computer defeated by a paradox?

Question: This is a short science fiction story about a computer that is put out of action by being presented with a paradox.  The computer runs a space station on a distant planet and is supposedly failsafe.  A visitor makes a bet that he can bring the computer to a standstill.  He does this by giving it a paradox.  The computer shuts down in order to concentrate on the insoluble paradox.
Comment: probably the same as https://scifi.stackexchange.com/questions/245457/trapping-a-weather-computer-in-a-logical-loop-condemns-the-station-staff-to-deat (which is newer but has an accepted answer)
Answer: "The Monkey Wrench" by Gordon Dickson, first published in Astounding Science Fiction, August 1951, available at the Internet Archive. From Wikipedia:

In this story, Lowland society lawyer Cary Harmon drops in unannounced on the weather station of meteorologist Burke McIntyre, high in the Lonesome Mountains, a jagged chain of the deserted shorelands of Venus's Northern Sea. Curious about Burke's hermit's existence, Cary queries to gain knowledge of how Burke works. The Brain, a newly installed computer, does all observations, and Burke, by himself, just sits at the desk and prepares weather data for transmission to the Weather Center down at the Capital City.
Cary tries to find fault in the machine, but Burke proudly argues that the Brain, "A big tin god", is invulnerable, that it can never break down. Along the debate, Burke claims that any bank out of the twenty could handle any situation, and if a situation too big for one to handle arose, it just hooked in with one or more of the idle banks until it was capable of dealing with the situation.
Theoretically, it's possible for the machine to bump into a problem that would require all or more than all of its banks to handle. For example, if this station suddenly popped into the air and started to fly away for no discernible reason, the bank that first felt the situation would keep reaching out for help until all the banks were engaged in considering it, until it crowded out all the other functions the machine performs. But even then, it wouldn't overload and burn out. The banks would just go on to considering the problem until they had evolved a theory that explained why we were flying through the air and what to do about returning us to our proper place and functions.
Despite that, Cary happily makes a bet that he could gimmick the machine in one minute. He successfully does so by throwing at the machine a metaphoric monkey wrench - a paradox:
You must reject the statement I am now making to you, because all the statements I make are incorrect.
With the Brain dedicating all of its banks to working on the paradox, the consequence of Cary's action finally bears down upon the pair, as the harsh negative temperatures of Venus rapidly sets in.
Comment: Why didn't the machine solve the "paradox"? Evidently, Cary makes correct statements and incorrect statements. This statement is one of the incorrect ones.
Comment: I don't know who's the bigger smuck, the guy that told it the paradox, or the programmers involved with its creation
Comment: I remember reading this story in some anthology in which the editor had added a comment after the story ended. He pointed out that by the 1980s, it was quite common for people to have a computer accidentally get stuck in an endless loop -- but it was also easy to fix. If necessary, you simply rebooted the computer to start all over from scratch.
Comment: @PaulDraper Computers aren't good at "evidently". But yeah, it really should be "You must reject the statement I am now making to you, because it is incorrect".
Comment: If this is the correct answer to the question, please mark it as such so the question is shown as having been answered.


Honda nx250 timing problem

Question: Would it matter if the crank shafts on top dead center on the exhaust stroke? What does it have to be on the compression stroke? Because if I put the timing marks in line with the top of the engine, it's always starting off on the exhaust stroke unless I flip the lobes around. Any help would be awesome on the timing
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: It will never be at top dead center (TDC) on the exhaust stroke, because the exhaust stroke starts at bottom dead center (BDC) and finishes at TDC (approximately). If you tried to align the cam(s) this way, you're going to have collisions between the piston and the valves on any interference engine, which I assume your Honda has.
EDIT: What I'm getting at by saying this is, if the only way your timing marks line up is with the cams being on the exhaust stroke (I'm assuming your exhaust valves are open?) when the piston is at TDC, I'm thinking you've got something wrong. Considering you've already stated the only way you can get it right is by swapping the cams ... are you sure you don't have them backwards in the first place?
Comment: They have marking on each valve lobe for intake and exghast so there on the right sides I just been trying to time this bike and idk what I'm doing but another of people show pics of where the timing marks should be at tdc on the compression stroke but the exhaust opens first the valves not stuck open I think something is wrong in the time I just don't know what

Honda nx250 timing problem


What's the difference between get_home_path() and ABSPATH?

Question: What's the difference between get_home_path() and ABSPATH?
Isn't the point of both to point to the WordPress install root?
Answer: They should do the same thing, but under certain conditions, may not.
First of all note:

that the codex entry description is misleading
that wp-admin/includes/file.php must be included in context else calling get_home_path() will lead to calling an undefined function.

Regarding the codex entry,

Description
Get the absolute filesystem path to the root of the WordPress installation.
Return Value
Full filesystem path to the root of the WordPress installation. If you install wordpress in subfolder, it will show subfolder location
Examples
$path = get_home_path();
print "Path: ".$path; // Return "Path: /var/www/htdocs/" or "Path: /var/www/htdocs/wordpress/" if it is subfolder

It states that the return value will return the path of the subfolder if you have installed WordPress in a sub-directory. This is in fact, incorrect.
get_home_path() will return the root directory of your WordPress installation, even if it's installed in a sub-directory. That is the purpose of the function.
Assume your WordPress installation is within a sub-directory called /dev,

http://www.example.com/dev (site_url) (e.g. /var/www/htdocs/dev)
http://www.example.com/    (home_url)

If you log a call to ABSPATH, then the result of which will be, /var/www/htdocs/dev which is not the root of your installation. The root of your installation is /var/www/htdocs.
ABSPATH is first defined in wp-load.php which will be located at /var/www/htdocs/dev/wp-load.php hence this is where ABSPATH will take its definition from.
If you inspect the get_home_path() further you will note that if the site_url and home_url differ, then a sub-string is taken of the path governed by the position (first occurance) of the sub-directory found within the string.
function get_home_path() {
    $home    = set_url_scheme( get_option( 'home' ), 'http' );
    $siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );

    if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
        $wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
        $pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );
        $home_path = substr( $_SERVER['SCRIPT_FILENAME'], 0, $pos );
        $home_path = trailingslashit( $home_path );
    } else {
        $home_path = ABSPATH;
    }

    return str_replace( '\\', '/', $home_path );
}

Therefore, as a result of this, get_home_path() and ABSPATH may return different results if you have WordPress installed in a sub-directory.
Secondly, calling get_home_path() must be done in a context where the afortmentioned wp-admin/includes/file.php has already been included.
As an example using get_home_path() within the admin_init hook is fine where as using it within init is not.
Seeing as this file only gets included from within the admin (dashboard) context, if you absolutely need it outside of this context you will need to include the file yourself before calling the function,
require_once(ABSPATH . 'wp-admin/includes/file.php');
Ironically (or not) which uses ABSPATH :D
Comment: This solution was well explained and worked exactly as desired after WP was throwing the "not defined" error. Thanks ;)
Comment: Well explained, all though I think third party developers should neither use the constant nor the function. Because [WordPress can be located anywhere](https://stackoverflow.com/questions/31042543/), placing it outside the document root causes both the constant and the function to return e.g. `/var/apps/wordpress` instead of `/var/www/htdocs`. Rather use `$_SERVER['DOCUMENT_ROOT']`, at least if you can assure that the document root wouldn't change.
Comment: @Fleuv Indeed this is a tricky one... even `$_SERVER['DOCUMENT_ROOT']` has its issues... e.g.may not be set or set correctly and so on. There's other ways I can think of too to handle this... Each with their own caveats. Much fun :)
Answer: Nicely explained by Adam but he didn't give solution to avoid using ABSPATH.
That is when we need to get wp-admin path and wp-admin/includes/file.php is also not included such as in init hook or execution on frontend.
We can avoid calling ABSPATH in require_once(ABSPATH . 'wp-admin/includes/file.php');
By copying get_home_path() definition into a file in your project and include that file if following condition meets like
    if ( ! function_exists( 'get_home_path' ) ) {
      require_once MY_PLUGIN_DIR . 'includes/helpers/admin_functions.php';
    }

and inside your MY_PLUGIN_DIR . 'includes/helpers/admin_functions.php' copy the get_home_path() from 'wp-admin/includes/file.php'.
WP Update will also not cause the problem since this function depends only on php functions some minor include functions. So we are avoiding ABSPATH when needed.
Answer: I am using home_url() for linking to the "Home" page of WP. Sometimes, site_url() may not be really your home_url(). You can define a spesific page as homepage in Wordpress.


ANCOVA or not? Non continuous covariate

Question: I have done an experiment with an independent and dependent variable. I repeated the experiment 5 times. Obviously all the repeats will be different from one another, some of them significantly so. However it is the pattern which I am interested in and therefore want to control for the repeats. I was going to do an ANCOVA but the covariate isn't continuous. What shall I do?
Comment: I am using SPSS. Any help with how I could do this there would help. Also if my covariate was not significant do I remove it from the model completely?
Answer: Under the assumption that you sampled your subjects from the same population (e.g. you repeated your experiments in the same subject pool), you could treat your data as one experiment. You could even include in your model a replication factor that tests whether there were differences between your replications. The results of the test on your independent variable would be saying that on average across all your studies was the effect of the IV significant.
That's the easy way, but probably not best since it is hard to say you randomly sampled from the same population (and that there was no one in more than one of your studies). The hard but better way is to conduct a meta-analysis of your experiments. In short, you'll get the effect size of your IV and its standard error from each experiment and analyze that as new data (e.g. with an n of 5 is the average effect size different from 0). There are a lot of other considerations that make it different from regular ANOVA/General Linear Models. This provides a good tutorial. There are plenty more on Google
Comment: I'm not sure what you mean by "variation may be lost." Meta-analysis takes variation into account (i.e. the standard error). If you mean variation in effects, that is exactly what it is testing. The big picture problem is there has to be reason for all the variation. It could be due to sampling, in which case you *want* to know the average effect. It could be because something changed between experiments. If you figure out what that is, you could include that in your model, which would make your results more rich.
Comment: Apologies, I pressed enter before I had finished. That makes sense, thank you.
Comment: No apologies necessary. Now go have fun with your models.

ANCOVA or not? Non continuous covariate


why is predicting child criminals bad for the child

Question: Predicting child criminals have become a useful method in preventing child from becoming criminals like in minority report. The one question is that what if they don't want to be "cured" and like/accept who they are. It seems to me that this is a grey area.
Comment: The question presupposes the answer, and doesn't delve deep enough into the issues for it to be apparent that this is a philosophy question as opposed to a question of child psychology or law enforcement.
Answer: It's harmful because it supposes three items of knowledge which we do not, and arguably cannot have:
1 Accurate predictions of future behavior
2 Knowledge of the right way to "fix" a criminal inclination
3 The larger social implications of "fixing" criminals in childhood
1 - Assuming that people make any significant choices in life, we have to believe that future criminal activity is not fully determined by childhood characteristics.  At most, we could determine that some people have a greater probability of criminal action.  Are we justified in tampering with people in the case it's only a probability, not a certainty?
2 - At one time, an accepted and alarmingly common medical procedure for mental issues was to remove part of the brain --often with disastrous results.  How sure are we that we know the correct way to correct criminal inclinations?
3 - New research suggests that (for instance) the extreme lack of empathy we associate with sociopathy can in some cases lead to high-achievement, not criminal behavior --for instance, many CEOs are somewhat sociopathic.  How do we know that fixing child criminals might not have unforeseen negative consequences for society as a whole?
Answer: Because those in charge of "predicting and correcting" bad behaviour often pursue their own selfish purposes in "predicting and correcting".
This documentary highlights several ways how American public schools consistently harming the kids attending public schools by putting numerous vibrant kids on dangerous mind-altering drugs, by vilifying kids for harmless behaviour, etc. Many "predicting and correcting" policies imposed by the teachers' union serve nobody but the teachers, making their lives less stressful, and simultaneously destroying the kids.
The drugs pushed on American kids temporarily make the kids easily manageable in the classroom vegetables, but lead to long-term behavioural and medical problems. Most of the school shootings in the US was done by kids that took Ritalin or other psychotropic drugs at one time or another, ironically imposed by the school they later shot at. And yet US public schools are almost forcibly pushing these drugs on the kids at rates higher than in other civilized country by orders of magnitude.
The only reason for that: while diagnosing and "treating" the kids the school-employed psychiatrists pursue the interest of the public schools, not the kids. The teacher doesn't want to deal with a vibrant kid because a quiet complacent class is less stressful. The teacher reports her "concerns" to the school; the school psychologist refers the kid to a psychiatrist; the psychiatrist is motivated in a number of ways to prescribe Ritalin, and the vibrant kid, one of those who would later make a dent in the Universe, ends up flipping burgers for the rest of his life, trying to cope with severe lifelong side effects.


PDF reader with split screen feature?

Question: Is there a PDF viewer that supports split screen à la Word?
The following apps don't seem to:

SumatraPDF
Foxit Reader
Acrobat Reader DC

Thank you.
Answer: PDF X-Change Editor from Tracker Software Products will do exactly what you want.  You can split the screen horizontally or vertically, and adjust the split ratio at any time.
There is even a "spreadsheet split" mode, useful for examining pages that don't fit well on a single screen.
All of this functionality is available from the View ribbon.  Simply use the Split button on the View ribbon.
From personal experience, I can say that PDF X-Change Editor is a piece of very high quality software.  It is available as portable and installer-based software.
According to their website:

More than 60% of the features in PDF-XChange Editor do not require a
  license to use. The remaining features, which are clearly identified,
  will place a 'trial' watermark on output if they are used without a
  license.

Current licensing prices are available here: https://www.tracker-software.com/pdf-xchange-products-comparison-chart

PDF reader with split screen feature?


Finishing a PhD that I started abroad, in the USA?

Question: I studied in Europe some times ago but didn't finish my PhD dissertation. Recently I finished it and I published in a math journal. I never studied in the USA, but I have been living and working there. Is it possible to finish this PhD with the same results that I have found, or I have to start all over again?
Comment: Some retired professors are still able and willing to finish up with their students. It depends on both the person and the university, however.
Comment: And when your advisor first told you he was retiring, and you asked him whether he would continue advising you—and if not, how to complete your PhD—how did he respond?  (You did ask, didn't you?)
Comment: Contact your supervisor or find a new one prepared to take you and the dissertation on.
Comment: Why not finish it where you started?
Comment: My adviser is retired!
Answer: I disagree with the other answers. Virtually all reputable US graduate schools have a residency requirement. Further, they will have little interest in a "pass-through" candidate who feels that they have already earned a PhD elsewhere and wants to obtain it as quickly as possible.
Your best bet is to follow up with your old program / contacts. Even retired professors might be willing to work with you. Perhaps someone knows someone who will take a special interest in you. With a professor on your side, rules can be bended or special arrangements made.
If that is a strict no-go, then you would essentially have to start over at a new institution. You could shop for an institution that will minimize the additional work you will need to do, but I would still expect it to take multiple years.
Answer: There are some US universities whose requirements are (a) pass the qualifying examinations and (b) write a dissertation acceptable to the faculty. You need to find such a place by searching and talking to people. You need to find a supervisor who is happy with your work and may accept it as is or with some additional work. But you probably also need to pass a set of qualifiers in several math areas. This may be easy for you or not.
But finding the supervisor who thinks this is a good idea is the main step. Best will be someone interested in becoming a collaborator and who has a definite interest in what you have already done.
But there will be more than paperwork involved.
Answer: If your completed work is not enough for a PhD dissertation in a US program, it's likely that you would need to take at least some exams and fulfill other requirements like any other student in a math PhD program in the US. But if your work is (1) enough for a PhD and (2) really exceptional, it is possible that some programs would grant the PhD with a minimum of additional requirements. The only way to know is to ask.