Synaptic Package Manager won't open at all

Question: I've just attempted to open Synaptic Package Manager several times, without success. After I go into the Preferences menu and click on it, my cursor briefly shows that it's waiting or loading, but then it stops and nothing happens. I haven't had this problem with other applications that I can recall. I haven't tried anything besides just clicking on it in the menu; is there anything else I can try or any way I might be able to fix this problem?
Answer: Start Synaptic:
synaptic-pkexec

An Authentication Required window for authenticating with your user password will pop up.
If that doesn't work start maybe the authentication-agent is not running. Run the following commands to run the agent and start Synaptic:
sudo /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
synaptic-pkexec

Comment: After entering the password I get the error "polkit-agent-helper-1: error responce to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie ==== AUTHENTICATION FAILED === Error executing command as another user: Not authorized" and "This incident has been reported."
Comment: The preinstalled command is `synaptic-pkexec`. Maybe Wayland related issue.


Get private key from terraform state?

Question: I used the terraform resource tls_private_key to generate a key and push that into AWS, but it didn't give me the private key to use to access the related resources. How can I recover that key?
Answer: If you need to use a value like this private key for later steps, the common answer is to return it as a root module output value. Since the private key is sensitive, you can mark it as such to prevent Terraform from showing it on the screen by default:
output "private_key" {
  value     = tls_private_key.example.private_key_pem
  sensitive = true
}

When you run terraform apply, Terraform will redact the value because it's sensitive. However, you can still access it from scripts by running terraform output -raw private_key, because the value is still stored in the state and the sensitive option only prevents it from showing in human-oriented output. (The -raw option is intended for use in scripts.)
Answer: The private key is stored in the terraform state. Typically you would show the resources with the terraform state command, but sensitive values are not shared on the screen. If you use the -json option, this restriction is removed, dumping the entire state in json format.
Then you can use jq to parse the output to find the value. This value will have quotes around it and escaped newlines that you'll need to clean up in order to get a properly formatted PEM key. The -r option to jq will handle that well by dumping the value in raw format.
terraform show -json | \
jq -r '.values.root_module.resources[].values | select(.private_key_pem) |.private_key_pem' \
> ~/.ssh/terraform_private_key.pem

In the above jq command, three are three sections. The first filters down to the values of each resource. The second selects only value sets with a privatey_key_pem key in them. The third prints the value of those specific key(s). The select prevents the printing of a null line for each value set without a private_key_pem key/value pair to show.
Comment: For the record, @Martin-atkins answer is better, but this will work in a pinch with code changes.
Answer: Using private_key_openssh
Another option is to use
terraform show -json |
  jq -r '.values.root_module.resources[] | select(.address=="tls_private_key.ssh").values.private_key_openssh'

This command also uses root_module.resources specifically, because that's where the key is created. This address corresponds to this in a main.tf,
resource "tls_private_key" "ssh" {
  algorithm   = "ECDSA"
  ecdsa_curve = "P384"
}

In your case the key may have a different name and resource. By any means, I'd rather not write it explicitly, you can find out what resource it's in with,
terraform show -json | jq -r | less

I choose not to use PEM because OpenSSH has its own key format which is different in some cases. For example, as of now OpenSSH can not read ed25519 keys in PKCS#9 (PEM).

Get private key from terraform state?


Visa to Finland

Question: I am a US citizen and have a long connection (23 hours)in Helsinki on my way back to New York from Paris. Do I need a visa? Can I leave the airport and stay overnight in Helsinki?
Comment: As jpatokal mentioned, you don't need a visa. The flight from Paris to Helsinki will essentially be like a domestic flight - you won't go through border control in Paris on departure or Helsinki on arrival. It is on the following day when you are departing from Helsinki for New York that you will exit the Schengen area.
Answer: As a US citizen, you do not need a visa to visit Finland, or anywhere else in the Schengen area for that matter, so you're welcome to leave the airport and stay overnight in Helsinki.
From the Finnish Ministry of Foreign Affairs:
https://um.fi/documents/-/asset_publisher/caSu4obBG5lW/content/yhdysvallat-matkustusasiakirjat-suomeen/385107?p_p_auth=TjAOgnNm&curAsset=0&stId=47307

Visa to Finland


Game where you play as the Nutcracker and swat fairies

Question: I remember playing, or at least spectating, a PC game in the mid-to-late 2000s set in the fantasy world of The Nutcracker. In it, you would play as the eponymous Nutcracker and swat/kill various fairies flying around you as if they were flies. The game was from a second-person perspective--the Nutcracker is looking directly at the player and is immobile save for its arms. Was this a simple flash game from the time or a more developed one?
Comment: What was the control mechanism? There was a Playstation 2 game using the Eye Toy (I think that's the name) camera, and the player actually moved to make the on-screen avatar move (that is, it didn't use the hand-held controller). I don't know the name of the game, however.
Comment: Terminology nitpick: first person is seeing through the character's eyes, second person is seeing through the eyes of the player, third person is any other perspective (eg a floating camera). The only games that qualify for 2nd person are AR (not VR). And I'm not sure AR even qualifies. The answer below is 3rd person. Not trying to criticize but it gave me a chance to explain an obscure term.
Comment: @SkySpiral7 I will adjust my terminology going forward (though I won't be editing my question so I can remember my mistake).
Answer: This is the Flash game Nutcracker vs. The Sugarplum Fairies by Jet City Games.
You play as the Nutcracker and swat fairies.
Comment: Wow, it's all coming back. What an era for gaming.


Really cute counting problem (Finding the $k$'th $n$-Champkowski number)

Question: A friend of mine gave me this problem I wanted to share. We call a positive integer  a $n$-Champkowski number if the sum of its digits in base $n$ is a multiple of $n$. Give the fastest method to find the $k$'th $n$-Chapkowski number you can.
Comment: My friend said the numbers had a different name, but he said it was something like Champkowski.
Comment: @DietrichBurde These aren't quite Harshad numbers. An $n$-Harshad number is divisible by the sum of its base-$n$ digits. An $n$-Chapkowski number has base-$n$ digits that sum to a multiple of the base $n$.
Answer: To find the $k$-th Champkowski number in base $n$:
Write $k$ in base $n$ and then right-append a digit to make the resulting number Champkowski.
Example: Find the $59$th base five Champkowski number:  $59=214_{\text{five}}$.  The $59$th base five Champkowski number is $2143_{\text{five}}$.
Reasoning: Any base $n$ number has a unique base $n$ digit that can be right appended to it to form a Champkowski number.  So the first Champkowski number will be $1*$, the second will be $2*$, etc. (where $*$ represents the Champkowski fulfilling digit).
Comment: Yup. Thats what I did.
Comment: @The Emperor: It is a nice problem!
Comment: Oh very nice! Way better than my solution, which is awesome because now I don't need to explain myself!
Comment: @Drew: Thanks!!
Answer: I'm guessing there is an easier solution because you called it "cute", but I would do a binary search to find the number of digits. Then a binary search to determine the leading digit. Then a binary search to determine the next digit, and so forth.
It's 4am here so I'll explain it tomorrow, but in short, we are searching for $k$ in the space of Chapkowski numbers, which are easily counted (by inclusion exclusion or generating functions) because they are simply nonnegative integer solutions to
$$ x_m + x_{m-1} + \ldots + x_1 = \lambda \,n$$
where each $0 \leq x_i < n$. Note $\lambda \leq m$. So first you double $m$ until you count more than $k$ Chapkowski numbers, then you binary search to find the exact $m$. Then you binary search on the digit $x_m$, which you know is between 0 and $n$ (exclusive). Then, given $x_m$, you subtract it off the right hand side and repeat for $x_{m-1}$.
A quick (probably wrong) calculation in my head gives an estimate for the computation to be a sum of about $(m^2 \log m + m^4 \log n) \lessapprox \log k \, (\log\log k + \log n)$ binomial coefficients that depend on $n$. So perhaps multiply that by $n^2$.


Where is coagulation factor v produced?

Question: My textbook (Physiology 9th edition, People's Medical Publishing House, Beijing) tells me that coagulation factor V is produced in endothelial cells and platelets, which is different from some other books (saying in liver). So where exactly is it produced? Or is it just not quite clear?
Comment: Not the downvoter, but I somewhat suspect the reason is that the question fails to demonstrate the basic biological knowledge to know that the liver is made of cells, including endothelial cells.
Comment: Why the downvote? Surely a very good question?
Answer: Factor V is indeed mainly produced in liver (Wikipedia), which releases it into blood plasma.
But platelets are also an important source of factor V and "may account for "~25% of the circulating factor V" (ref 1)
Platelet factor V is synthesized in megakaryocytes (ref 1), which of course are the bone marrow cells responsible for the production of platelets.
The following reference gives a much more detailed explanation of factor V
Reference (available as free pdf)
<code>Factor V Is Complexed with Multimerin in Resting Platelet Lysates and Colocalizes
with Multimerin in Platelet α-Granules *

Catherine P.M. Hayward
Emilia Furmaniak-Kazmierczak
Anne-Marie Cieutat
Michael E. Nesheim
John G. Kelton **
Graham Côté
</code>
Journal of Biological Chemistry (1995) Vol 270, pp19217-19224
Answer: The coagulation factor 5 is primarly produced in the liver, meaning that the liver isn't the only place where this factor can be produced (F5 can possibly be produced by megakaryocytes too). After it is manufactured it circulates in an inactive form and is then converted into the active form with the help of thrombin and is able to attach to platelets. However, as far as I know, factor v is not produced in endothelial cells, there are a few factors that are, like Von Willebrand factor (VWF), factor VIII, thrombomodulin, endothelin etc., but F5 is  not one of them.

Where is coagulation factor v produced?


Why is 1:144 scale used for plastic models?

Question: Why a modeler originally choose 1:144 scale to create a plastic model such as GunPla? Why not choose 1:100 or some other number that can easily determine the size of the model from the original size?
Comment: Is there any reason why *not* to choose 1:144? I think 1:144 is chosen because it is 1:12 squared, and there are 12 inches in a foot. (i.e. If you imagine a person, then make a 1:12 model of him, then a 1:12 model of that, you get a 1:144 model.)
Comment: @キルア Well dividing/multiplying by 144 is pretty cumbersome compared to 100. If something is 13 cm in scale, you would instantly know the original size, while with 144cm, that might require a calculator for some. It is also squared, so I don't even see a logical reason to use the 1:12 model to begin with. I guess historically speaking it probably came from the British imperial system, but it would be nice if this was confirmed somewhere. Neither the [1:144 wiki](https://en.wikipedia.org/wiki/1:144_scale) nor the [1:12 wiki](https://en.wikipedia.org/wiki/1:12_scale) seem to mention a reason.
Comment: I'd strongly suspect the in-ft conversion influenced the 1:12 scale, in the same way 1:100 is basically cm to m (moving from large unit to the next one down in your unit system).
Comment: @PeterRaeves You are only saying that because you happen to be used to do calculations in base 10. Somebody used to do calculations in base 12 would say exactly the opposite. Lots of different bases have been used historically, and though 10 is almost globally standardized now, it isn't even the most practical base for calculations since it doesn't divide by 3.
Comment: @kasperd Actually my comment would have been the same regardless of what base OP was using. Whether OP was using decimal, duodecimal or any other numeral system, multiplying or dividing by 100 would always be easier than multiplying or dividing by 144.
Comment: @PeterRaeves I don't know if you're being disingenuous or not, but when using base 12 (duodecimal), dividing by 144 (base 10) is substantially easier than dividing by 100 (base 10).
Comment: @Foon Yes, dividing by 144(10) in duodecimal is easier because it would be written as 100(12) and dividing by 100(n), in any base n, is easy, as you seem to agree. Much easier than dividing by 144(n), written in the same base n, as I said from the start. Am I missing something here?
Answer: (Didn't you ask this exact question of SF&F yesterday?)
Traditionally, toy makers have used a 1:12 scale when building scaled down model of real objects, such as dollhouses. This practice pre-dates the metric system, and made it easy to scale down measurements because, at 1:12, one foot becomes one inch.
Now, suppose you wanted to build a dollhouse, and inside it, you want to have a dollhouse. To do that, you'd have to scale down your 1:12 model house by another 1:12, to give you 1:144. This is why 1:144 is sometime's called the "dollhouse's dollhouse scale".
Since 1:12 and 1:144 were already well known and popular by the time anime miniatures came around, the first people to make such models were already familiar with it, and they used it. After that, it's mostly inertia.
Answer: It is likely an unofficial common standard based on tradition that is used for small models and figures. As キルア said, 1:144 is a natural way to scale down a 1:12 scale model, which is another historically popular scale.
Theoretically, you could use whatever scale you wanted. It could cause compatibility problems if you use an uncommon scale as other figures would not be the right proportion due to being based on a different scale, but it would work just as well in every other way.
Answer: 1:144 is often used for models of large aircraft like airliners.
1:144 is half 1:72 which is a very popular scale for scale model aircraft/tanks etc.
And thinking about it, as scale aircraft came first, I think it likely that Bandai etc adopted existing conventions.
Answer: Some of the more common modeling scales are based on the Imperial System, rather than the (base-10) Metric System. 1/12 for dollhouses is one foot per inch. The popular aircraft scales of 1/48 and 1/72 are four feet and six feet per inch, respectively. When it came time to produce models of larger subjects, in particular airliners, 1/144 made perfect sense. It is 1/2 the size of 1/72, and still an even division of units in IS (twelve feet to the inch). As a previous answer pointed out, Bandai most likely chose it because it was suitable to the size of their subjects and was already in popular use.
There have been efforts to popularize scales that are base-10, but they've had very limited acceptance; 1/50, 1/100 and 1/200 have all been used by various kit-makers, but none have gotten the customer buy-in that the other scales have. Other Imperial-based scales that have strong followings include 1/96, 1/192 and 1/720, which are popular in boat/ship modeling.
Then things get interesting in the world of scale. (Well, "interesting" if you're a model geek, I suppose.) Some scales don't really make that much sense, unless you know some of the history. While 1/720 is/was frequently used by U.S. model manufacturer Revell for ships (and later Italian manufacturer Italeri), the 1/700 scale used by Japanese manufacturers has become much more popular. And once 1/700 had a lot of appeal, 1/350 (2x the size of 1/700) came along a few years later for people who wanted larger-scale models. The 1/32 scale (3/8" equals one foot) that is popular in aircraft and has some acceptance in automotive and older armor kits, was mostly introduced by railroad modeling. It is also popular with slot car models. It's popularity with armor lost out over the years to 1/35 scale. 1/35 was made popular by the Japanese manufacturer Tamiya, largely so they could fit motorization gear into their models. Their models proved more popular than the 1/32 offerings from places like Monogram, and eventually 1/32 largely disappeared from the military miniatures landscape. Except for the realm of figurines, many of which are still sculpted to 1/32 (54mm) scale.
(I'm sorry... what was the original question...?)
Comment: Yes, I always wondered why 1/35 and not 1/36 as well. According to the Wikipedia page on 1/35, the scale came about because the first kit in that scale (a Panther tank) was designed to fit two batteries for the motorization. After it became popular, they decided to create more models to the same scale, and when they measured out the Panther it turned out to be 1/35 scale. The origins of 1/32 in railroading gives more sense as to how it became popular in other genres. Also-- though I suspect coincidence rather than design-- 1/32 is 50% larger than 1/48, which is itself 50% larger than 1/72.
Comment: Thank you.  Your post is interesting.  I think 1:36 (three feet per inch) should be more popular than 1:32.  And 1:35 is close to 1:36.


How gently could a comet/asteroid/meteorite "hit" Earth?

Question: Could an object from outer-space with the right velocity and orbit come into contact with the surface of our planet in a manner that wouldn't cause it to burn in our atmosphere?
Answer: It is difficult to see how. Most comets and asteroids would encounter the Earth on a crossing orbit and the encounter velocity would be roughly the vector sum of the Earth's velocity around the Sun (of order 30 km/s) and the individual velocity of the rogue object.  The individual velocity will vary from $\pm 30$ km/s for objects at a similar distance to the Earth from the Sun, to comets falling in from the Oort cloud on parabolic orbits which have roughly the escape velocity of the solar system at the Earth's distance from the Sun - i.e. $\pm 42$ km/s.
This however does not define the minimum velocity. Even if you were to arrange it so that the asteroid/comet was diverted by something else so that it "caught up" with the Earth from behind travelling at an initially low relative velocity, there is the additional influence of the Earth's own gravitational potential. This would accelerate the approaching object to something like the order of the escape velocity from the Earth's surface - about 11 km/s.
Thus the range of possible velocities as the object enters the Earth's atmosphere would be from 11 km/s (near-earth asteroid travelling in the same direction as Earth) to 30+42=72 km/s (head-on impact with a long-period comet).
This fairly authoritative site on calculating the effect of asteroid/comet impacts suggests a minimum impact velocity of 11 km/s, which is indeed the Earth's escape velocity.
These are the speeds at the top of the atmosphere. If the objects are smaller than 20-30m, then the atmosphere will basically take out most of that kinetic energy, so for small objects, a relatively slow impact at a terminal velocity of some hundreds of km/h is de riguer. But for anything larger than $\sim$50 m, it is basically the full 11 km/s or more. http://www.lsst.org/lsst/science/scientist_near_earth_objects_neoquant
Answer: I think you could possibly engineer such a collision between two bodies in horseshoe orbits.  The minimum mutual speed between the two bodies depends on their mass difference, with a limit that approaches zero speed if the bodies are the same mass. I haven't tried very hard to do this, but it's the only possible way around the escape-velocity argument put forward by John Rennie.
Two images lifted from Wikipedia:

The Lagrangian points are there to motivate an "effective potential" argument, which I'll let you go through on your own.  Here's another approach: suppose that there are two equal-mass Earths, both orbiting the Sun in zero-eccentricity circles at 1 AU with a period of one year. Gravity wants to pull the two Earths together, by slowing down the leading one and speeding up the trailing one. However the one that slows down no longer has enough kinetic for its circular orbit at 1 AU — it's now at the highest point of an elliptical orbit with semimajor axis less than 1 AU, and period less than one year. Likewise, the object that sped up is now at the lowest, fastest point of an elliptical orbit with period more than one year. They move apart! In a rotating reference frame which includes the central mass, the gravitational attraction between these two objects is effectively repulsive.
I'm not sure what constraints there are on the closest approach in a horseshoe orbit, which would determine whether a zero-velocity impact is possible for rocky bodies in our solar system.
It's not possible for Earth and rocky bodies in our solar system, since Earth does not fill its Hill sphere.
I'm pretty confident that there's some combination of relative masses and densities where two objects orbiting a common center could have their surfaces touch at zero velocity and then be gravitationally induced to move apart. That would still be a destructive interaction, though.
Answer: The problem is that the Earth's surface has a large and negative potential energy. Suppose we start with our comet a long way from the Earth and moving only very slowly i.e. we give it the lowest energy possible. The gravitational potential energy at the Earth's surface is:
$$ U = -\frac{GMm}{r} $$
where $M$ is the mass of the Earth, $m$ is the mass of the comet and $r$ is the radius of the Earth. If we let the comet fall from it's initial position to the Earth's surface the potential energy has to turn into kinetic energy otherwise energy won't be conserved. So the kinetic energy of the comet will be given by:
$$ \tfrac{1}{2}mv^2 = \frac{GMm}{r} $$
Plugging in the values for $M$ and $r$ we find the velocity at the surface of the Earth is around 11 km/s or about 25,000 miles per hour. And that assumes the comet starts off stationary. It's more likely the comet will have a considerable initial velocity and will hit the surface even faster.
Comment: The orbital velocity of the earth is $\sim 30$ km/s.
Comment: Is it worth factoring in Earth's orbital velocity?
Comment: I was wondering how much "Ballistic Interception" would change the speed. The article in the link below goes into detail about it. http://www.postandcourier.com/article/20150112/PC1002/150119875
Comment: @KieranHunt: the orbital velocity of the Earth is, as it happens, of a similar magnitude - it's about 8 km/s. The trouble is that I can't think of a way to have this cancel the velocity of the comet. However you mess with the original conditions, if you start far from the Earth and end at the surface your kinetic energy (in the Earth's rest frame) is going to increase.
Comment: About the only workaround I can come up with is for the comet to be a gigantic parachute made of some extremely strong material (or equivalently a self-stabilizing airfoil), but that's well outside the parameters of the question asked.
Comment: What about one or more gravity assists from the moon?
Comment: @fibonatic: the Moon is too far away. Even if the Moon managed to bring the comet to a complete stop wrt the Earth, falling from a quarter of a million miles would speed up the comet too much. You need some interaction far closer to the Earth - colliding with the ISS possibly :-)
Comment: @RobJeffries: hmm, I wonder where I got 8km/s from. Anyhow it is the same order as the escape velocity from Earth's surface.
Comment: @KieranHunt No. What John is doing is calculating the minimum impact velocity, which will happen when the comet and the Earth are initially moving at the same, "Earth orbital velocity" relative to the Sun. Now do your calculations from a frame moving with them.
Comment: That 8 km/s is the orbital speed of a body orbiting Earth, at ground level (with no atmosphere, of course). The escape velocity from Earth at the same altitude is $\sqrt2$ times that.
Answer: The Problem is the orbits.
The Earth is traveling in a nearly circular orbit about the Sun.
Comets and asteroids travel in highly elliptical orbits.
This means when their paths cross, the velocity vectors
are large, and they are not going in the same direction
as the Earth when they both try to occupy the same space
at the same time.
Very high velocities combined with in-compressibilities of
solids and liquids equals a vaporized comet or asteroid,
and a large impact crater with lots of ejecta sprayed
out radially ( conical ).
Only the very smallest of space rocks can slow down in earth's
atmosphere and land on the ground without making a dent.
Answer: A system with such massive masses is subject to non-trivial amounts of gravity pulls. The extreme theoretical and HIGHLY improbable case is for the comets path to be tangent to the event horizon of Earth and from that point on to be trapped into a geo-synchronous (with a slight offset) declining orbit around Earth eventually leading to a "touchdown".
The massive amount of variables needed to be fine tuned makes this quite the coincidence!
Comment: Could you outline the energetics of this scenario. Where does the original KE + GPE of the potential impactor end up?
Comment: @RobJeffries Your point with the Escape velocities is excellent. The KE, if you view them as a binary-mass system (which is what they would be after Ev.Horiz), is increased since mass (by virtue of combination) is increased. A geoSync orbit implies a GPE equal to the centrifugal on the object. Eventually the GPE will go to 0 when the object touches the ground. Now how fast (vertical velocity) will that happen is a mater of how "soft" does the object enters Event Horizon. An infinitely small vertical velocity at e.horizon would really mean that the asteroid could land softer than a feather!

How gently could a comet/asteroid/meteorite “hit” Earth?


A planet covered in sentient goo

Question: IIRC this is a relatively short story. A small group of human researchers encounter a planet (unknown if earth) absolutely covered in this sentient goo that also absorbs and transmutes organic matter into itself.  They try to study it until the goo accidentally escapes containment and absorbs some of the researchers whereupon it is revealed that the goo actually contains the living consciousness of every human being to have ever been absorbed by the goo ("hive mind"-esque).  This is sort of presented as a potential next step/misstep for humanity.
Comment: Four in one again? https://scifi.stackexchange.com/q/267955/136280
Comment: is a better word than "goo" employed?
Answer: The novel in question is Four in One by Damon Knight.  It is one of the most commonly asked for.
Comment: Can you explain how this matches the question?

A planet covered in sentient goo


AVD (emulator) won't start on Linux

Question: Running Ubuntu Lucid, 32-bit. Eclipse Galileo with Android SDK Tools installed.
After setting up an Android Virtual Device in the Android SDK and AVD Manager:
Name         Target Name      Platform   API Level
TestDevice   Android 2.2      2.2        8

...clicking the Start... button does nothing--no errors anywhere, no sounds, no window or dialog anywhere, nothing at all.
I've spent the last hour creating, trying, deleting devices and Googling. I can't find anything anywhere about a problem of the start button not working on Linux.
Note that the emulator will start if I simply right-click on an Android project, and choose Run As, then Android Application.
I've done this successfully on Windows for the last month+; I'm a Linux guy and decided to attempt to maintain a parallel development environment there rather than condemn myself to Windows-dependence.
Any comment would be appreciated.
Thanks,
Russ
Answer: Try doing a
mkdir -p /tmp/android
chmod 777 /tmp/android

I've also had the emulator get into a state where it wouldn't come back up without rebooting the Linux machine.

AVD (emulator) won't start on Linux


Better classification performance when using an RBF kernel function in high dimensional space?

Question: I'm learning about SVM's and understand that boosting something into a higher dimension can sometimes help separate the data better. However, if I were to perform 1 nearest neighbor with the RBF kernel, is it possible that the classification performance is better in the higher dimensional space than the lower dimensional space?
Comment: Does this answer your question? [How can kernelization improve the K Nearest Neighbour algorithm?](https://stats.stackexchange.com/questions/44166/kernelised-k-nearest-neighbour)
Answer: In general RRF kernels perform better but they are prone to over-fitting. In addition you must also perform free parameter selection. In the paper Kernel Nearest-Neighbor Algorithm that is to my knowledge the first paper on kernel -KNN the following is stated:

"If samples distribute arbitrarily, conventional nearest-neighbor algorithm may not obtain satisfactory result. However, mapping to a high dimensional space, the kernel nearest-neighbor algorithm can work better and obtain good results."

The paper used polynomial kernels due to free parameter issues but mapping to a high dimensional space was helpful.


Are "that's it" and "that's all" interchangeable?

Question: Are "that's it" and "that's all" interchangeable? Is there any specific case where I should use one instead of the other?
Comment: Can you provide some example sentences so we have a broader context for these expressions?
Comment: What about *"That's all it is?"*
Comment: I think the choice depends on the regional preferences of the people you are speaking to. I've noticed that in some places, saying "that's all" would invariably lead to a response of "huh?", "sorry?", "what did you say?".
Answer: That's it is an expression that means:

1 that is the main point or difficulty: "Is she going?" "That's just it—she can't make up her mind." 2 that is enough or the end: okay, that's it, you've cried long enough.
Ref: The OED

Or

used to say that something has ended
  Well, that's it, we've finished - we can go home now.
  That's it! I'm not putting up with any more of her rudeness.
used to say that something is correct
  You switch the computer on at the back. That's it.

Ref:Cambridge

That's all doesn't seem to be an expression all by itself, but means that there's nothing more to it, that's all you have to do, etc.
So in some cases, as in the second example from the Cambridge Dictionary, they could be used the same way with a slight difference in meaning.
Comment: "That's all doesn't seem to be an expression all by itself" -- You forget the Merrie Melodies Porky Pig signoff: "That's all, folks!" http://www.youtube.com/watch?v=aNEd0_rm6kU
Comment: What about "Well, that's all, we've finished"? Isn't that sentence correct?
Comment: Or, "is that all?"  "Yes, that's all."
Answer: They are more or less interchangeable when they indicate the peremptory end of a discussion. On most other occasions, they are not.
Answer: That's it - used when something has concluded
That's all - used to indicate "only" or "purpuse": "I wanted to talk to you, that's all.
Comment: Please add objective sources when answering questions.


Why before triggers are not recursive in Salesforce

Question: I know that after triggers can cause recursiveness. But why are before triggers not recursive?
Comment: Because you are not explicitly mentioning DML in Before triggers
Answer: It's not just after triggers that can be a problem, any trigger can have problems with recursion, though some are more likely than others to experience that problem.
Update triggers are the most likely to have recursion issues (especially after update), but Insert triggers can pretty easily be set up to recurse infinitely too.
I suppose that even Delete and Undelete triggers could have recursion issues, though I think that'd be harder to pull off under normal circumstances (you'd need to put some effort into making that happen).
gs650x's suggestion that not needing explicit DML is part of the equation here. If you edit an instance of an object contained in Trigger.new or Trigger.newMap in a before insert or before update trigger, no dml is required to persist those changes. This makes it less likely that a before trigger will cause issues with recursion.
It is still possible, however. Consider the following:
trigger BeforeRecursion on Account (before insert){
    List<Account> newAccounts = new List<Account>();

    for(Account acct :trigger.new){
        newAccounts.add(new Account(
            Name = acct.Name
        );
    }

    insert newAccounts;
}

While you're not operating on the same Account every time, this example trigger will recurse infinitely (well, it would, but Salesforce should put a stop to it after the 16th iteration or so).
The rule of thumb to determine if a trigger is going to have issues with uninhibited recursion is this: As part of executing this trigger, and any other code that is run because of it, do I perform the same DML as what my trigger handles?
If you insert accounts in a before insert trigger on Account, you're probably going to have issues.
This goes deeper than that though. If, at any point in a transaction after you run a specific trigger, you happen to perform DML on the same object, you can have recursion issues.


Registration to Rockstar gaming social club

Question: Is it possible to play Max Payne 3 without registering to Rockstar's social club?
Do I have to login to it every time I play?
Comment: From previous experience with the social club (especially in LA Noire) I can say that no, you don't have to, although there are usually benefits for doing so (in LA:N, a lot of hidden items were tracked there).  I did not have to log in each time, I was logged in automatically when the game started.
Comment: Agreed, you don't "need" to log into the social club for GTA4 either - I would assume 'No but some functionality may be restricted'.
Answer: Unlike some previous games you need to be logged in to the Rockstar Social Club if you want to be able to play, even single player. (This is for the PC steam version at least)


Can a program ever receive a software interrupt?

Question: Can a program ever receive a software interrupt? I understand that they can cause interrupts, but can they actually recieve a software interrupt? If so, please can you provide an example?
Answer: Quoting Wikipedia : "A software interrupt is caused either by an exceptional condition in the processor itself, or a special instruction in the instruction set which causes an interrupt when it is executed. The former is often called a trap or exception and is used for errors or events occurring during program execution that are exceptional enough that they cannot be handled within the program itself. [...] The operating system will catch this exception, and can choose to abort the instruction." If I understand correctly what you're asking, the answer would be no.


Could a C25519/ED25519 cryptographic module be FIPS certified?

Question: NIST algorithms include ECDH and ECDSA. NIST also specifies curves. Is the use of NIST curves required for FIPS certification or could other curves theoretically be certified if someone were willing to do the work?
Comment: I _think_ algorithms certified by FIPS 140-2 need to have either their own FIPS or must be (in) a NIST SP. I don't think Curve25519 / Ed25519 have any such standards from NIST (yet). Rumours suggest this will change. However, you can get your implementation certified for P-256 and make it generic so that you can also run Curve25519 on it.
Comment: NIST claimed in late 2017 that the upcoming draft of NIST SP 800-186 would include Curve25519 and Curve448 as approved curves, and the X25519 and X448 DH functions would be considered for the next revision to NIST SP 800-56A: https://csrc.nist.gov/News/2017/Transition-Plans-for-Key-Establishment-Schemes  Unclear whether this will cover the Ed25519 and Ed448 signature schemes; unclear what the status of the alleged NIST SP 800-186 draft; no mention of this in NIST SP 800-56A rev. 3 form April 2018.
Answer:
Could a C25519/ED25519 cryptographic module be FIPS certified?

Likely yes in the near future—although 'near' is measured relative to the pace of a US federal government bureaucracy.
On 2019-10-31, NIST submitted a request for comments to the Federal Register on drafts for FIPS 186-5 and NIST SP 800-186 that include the Montgomery and Edwards curve shapes; the particular curves Curve25519, Curve448, edwards25519, and edwards448; and the EdDSA signature scheme instantiated with them, as defined in RFC 7748 and RFC 8032.  Comments are due by 2020-01-20.
(The updates do not cover the X25519/X448 DH functions, but NIST's late 2017 announcement of the upcoming changes also mentioned future updates to NIST SP 800-56A, which covers key agreement.)
Answer: As of February 3, 2023
FIPS 186-5 has been published along with NIST SP 800-186 update that include Curve25519 and Ed25519
One thing that I noticed on the NIST late 2017 transition plan blog for key establishment is this paragraph.

In addition, NIST guidelines on Elliptic Curve Cryptography are also being revised to propose the adoption of new elliptic curves specified in the Internet Engineering Task Force (IETF) RFC 7748. The upcoming draft of SP 800-186, which will specify approved elliptic curves, will include the curves currently specified in FIPS 186-4 and two additional curves: Curve25519 and Curve448.  Their associated key agreement schemes, X25519 and X448, will be considered for inclusion in a subsequent revision to SP 800-56A.  The CMVP does not intend to enforce compliance with SP 800-56A until these revisions are complete.

Does that mean that there now that SP 800-186 and FIPS 186-5 are published we can still get CMVP certified for x25519 while they wait for the SP 800-56A update?
that's unclear I'll try emailing the blog post address to confirm.


Activity - Send a Copy Email

Question: When filing an activity in CiviCase, there's the option "Send a Copy" to people listed in Case Roles. The email is sent correctly. However, when I "reply" to the email, the address of the sender is a default system email. Is there an option to have the "reply" email be the user that send the copy?
Comment: would it be helpful if the email 'from' was an address which, when replied to, adds the reply to the Case? if so, this is possible, well at least having 'Inbound Emails' adding as Activities on to a Case by using 'caseid' in the subject
Comment: I think that might be a separate feature for a different problem. I just think that if a copy of the activity is sent to a user, replying to that email should correspond to the sender rather than the organization email address. Perhaps in some cases, the organization email is helpful but for the most part, my client doesn't have an organization email that gets checked frequently.
Answer: It used to be the logged in user but I guess some people didn't want that and it was changed in https://issues.civicrm.org/jira/browse/CRM-20308
So it now uses the order listed there:

The Reported by Contact's email address
System Default From Address
Default Organization Contact email address
Logged in user

Personally I think logged in user makes more sense, and you could have privacy and also antispam problems with the Reported By address if it's not the org's domain.
It looks like there was a setting added to allow the old behavior, but it's not clear how it's supposed to work. It looks like to prevent using the Reported By contact you would uncheck the setting "Allow Mail to be sent from logged in contact's email address" found at Administer->system settings->Outbound Email, except then it would always return the system/org-wide email address.
https://github.com/civicrm/civicrm-core/commit/4c981f371a6602cdfcda525895e0d0c40e9294d9#diff-be8afcc653a18926aabd2b40be8469f9
If you want a quick hack, try changing line 1407 in CRM/Case/BAO/Case.php from:
$receiptFrom = self::getReceiptFrom($activityId);

to
list($receiptUserName, $receiptUserEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
$receiptFrom = "$receiptUserName <$receiptUserEmail>";
Comment: I tried commenting out these lines and the email is still sent from the system email-address.
Comment: Did you check the box on the outbound email settings?
Comment: Yes! It is the default setting.
Comment: Ok I've edited my answer to a more direct replacement that specifically uses the logged in user id.

Activity - Send a Copy Email


Torque on part of one-dimentional pivoting rigid rod

Question: A one-dimentional rigid rod, at rest and initially horizontal,  is performing a rotational motion around fixed point O. I painted the last part of length l/3 with different color to focus on that. Given that $I_O = 1/3ml^2$, at $t = 0$, rod OA has a rotational acceleration $\theta ''= 3g/2l$ and AD part a center of mass acceleration $a_K = 5g/4$. To have an acceleration greater than $g$ , OA part must exert a force F to AD at point A downwards. But then, the sum of torques acting at AD around center of mass K tend to rotate AD counterclockwise. How do you explain that?
Answer: The rod OD is a rigid body. There are internal forces which act to maintain the shape of the rod whatever its state of motion.
Before the rod OD is released from an equilibrium horizontal position, there is an upward force $\frac13 mg$ acting on AD which keeps it from falling down, together with an anticlockwise torque which keeps it from rotating about an imaginary joint at A. If the only external force on section AD is its weight then these forces and torques come from the section OA.
When the whole rod is released so that it rotates about O these internal forces become more complex. The gravitational force on AD together with the forces and torques from OA cause the rotation of AD about O. The internal forces are different than in the stationary position. But they are always such as to keep the rod in a rigid structure which does not bend or extend.
In a more realistic structure such as an elastic beam which can bend and/or extend, it is necessary to take account of the internal forces. In rigid body problems they can be ignored.
Comment: So i can conclude that in Classical Mechanics model there is no solution for a one-dimentional rod given that at join point A all internal forces produce no torque?
Comment: No solution for what? You can calculate torques and forces acting on section AD. But is it worthwhile to do so? You might need to do so if there is a hinge at A, or (as I wrote) if the beam is elastic and you want to know how it bends, or if you want to know whether it will break. But if the rod remains rigid there's nothing to be gained by calculating internal forces.


RSS and Post edits

Question: I have a blog with "dynamic content" (one type of post data is changing (the date, too) based on some circumstances). If I give the feed to one RSS feeder and one chatfuel based chatbot will the changes also "shown" (for example if a post was published in 2th of January and today the date was changed to 15th of January) will it move in the post order in the RSS feeds, too?
Answer: It should since the RSS feed is based on the current instance of WP_Query. However by default WordPress has a longer interval for updating the RSS feed's cache. IIRC, it's about 12 hours. So if you make a change at 6am, the RSS feed won't reflect that until 6pm.
You can change this with the following code in your functions.php file or, even better, as a plugin.
function rss_update_feed() {
    return 60;  //Time in seconds
}
add_filter( 'wp_feed_cache_transient_lifetime', 'rss_update_feed' );

What this code does is sets the refresh time to 60 seconds. You will want to set it to something a bit more reasonable though. I only used 60 seconds as an example but you do not want to have your server keep doing unnecessary refreshes.
Comment: You're welcome. What interval did you end up using?
Comment: I made it to 5 minutes

RSS and Post edits


R library for matching similar names

Question: I'm trying to join datasets with names that partially match, ex. "John Smith" vs. "Jonathan Q. Smith". I'm familiar with the fuzzy joins package and am wondering if there are other libraries out there that can do better. Thanks!
Answer: I've never used it, but perhaps the RecordLinkage package, a research project from 2010 described in an article in R-Journal. Authors recommend to keep an eye on the NaturalLanguageProcessing CRAN Task View.
By the way, if what you want to do is "Address deduplication" I hear that many products apparently exist for this in the "Customer relationship management" space, or in the Email Marketing space

R library for matching similar names


Could stars like S2 near the galaxy's center have planets in a stable orbit?

Question: I read about one of the stars orbiting Sagittarius A* and according to Wikipedia, it reaches a maximum speed of 0.03c during its orbit. Would this (or any other factor) make it impossible for a planet to have a stable orbit around this star?
https://en.wikipedia.org/wiki/S2_(star)
Answer: Technically yes, but no.
Since the Wikipedia article regarding S2 notes an orbital period of 16.0518 years, with an eccentricity of 0.88466. A typical B0V star has a mass of ~18 solar masses while Sgr A* has a mass of 4.1 million solar masses. Applying Kepler's third law to  Sgr A* and S2:
$$\sqrt[3]{\frac{(16.0518 \text{ yr})^2 \cdot G(4.1\cdot10^6 M_\odot+18M_\odot)}{4\pi^2}} \approx 1014 \ \text{AU}$$
The Hill sphere formula is $r_H = a(1-e)\sqrt[3]{\frac{m}{3M}}$. Plugging in the masses, semi-major axis, and eccentricity in, we get $\sim 1.328 \text{ AU}$ as the Hill sphere. While objects orbiting at the edge of the Hill sphere may seem like they are stable, but long-term stability tends to indicate that objects orbiting at half of the sphere are stable, meaning that a planet could stably orbit at 0.5 AU.
That said, a planet probably could not form around this star (see Why don't we detect planets around OB stars and no terrestrial planets around A or early F stars?). Furthermore, like @JamesK said in his great answer, such as star's strong stellar winds would have blown away almost all its disk material early, so planets would not have time to form.
Assuming a bond albedo of 0.1 for our hypothesized rocky planet and a luminosity of $50000 L_\odot$ for S2, we have $T^4=1.08586\cdot10^{15} K^4$. Taking this to the fourth root gives 5740 Kelvin. This is way too hot - almost as hot as the Sun, which is enough to boil away the crust, mantle, and whatever is left of the planet. Therefore, while orbits could be stable, no planet could exist due to the tiny orbital radius, extreme temperatures, and unsuitable formation conditions.
Comment: The body of the question asks about the specific star S2, the title asks about stars like S2 near the galactic core.  Stars like S2 in being B0V stars would be too hot for close planets.  Stars like S2 in being near to the galactic black hole, but much less massive and several times as far away, which would still be really close,  could possibly form and keep planets.
Answer: In principle such a star could have a planet. Although the star is moving fast, a planet would also be pulled by the black hole's gravity, so you only need to consider tidal effects, and the "Hill sphere".  If the planet orbits in the Hill sphere, it can orbit safely.
A planet orbiting a 4 million solar mass black hole would at 120 AU would have a Hill sphere with a radius of about 1 AU. So planets would need to be nearer to the start than the Earth is to the sun to be in stable orbits.  This is possible. But note that S2 is a massive hot star. Any planet at that radial distance would be cooked!
It may also be that the powerful solar wind of a young 15 solar-mass star will clear material further than 1 AU, making it hard to form planets that close to the star.
I've also not taken relativity into account, nor the elliptical nature of the orbit of S2, nor do I need to.  Instead I've just used the periapse distance and Newtonian gravity. These should allow for a reasonable estimate of the Hill radius.  For longer term stability one should be conservative. So if the planet orbits at 0.5 au it will surely be stable, but even more cooked!
Comment: The periapsis distance of S2 is ~1400 times the Schwarzschild radius of Sag A*, so a Kepler orbit's a reasonable 1st approximation, both for it and any planets it may have. Wikipedia says that its Schwarzschild precession is ~12 arc-minutes; I presume that's per orbit.


How to implement Cloudways CDN on Magento2

Question: I have a website which is hosted on Amazon AWS EC2 and Domain is on 123-reg, I have pointed domain via AMAZON Elastic IP, Please see attached image, Now i want to setup CDN only for static files.
How to do that? Do I need to point whole DNS on cloudways?
Answer: You can configure separate domain for static content
Login to Magento Admin and
set "Base URL for Static View Files" and/or "Secure Base URL for Static View Files" in Stores > Configuration > Base URLs to the desired CDN domain, e.g. https://cdn.domain.com/static/
For base host configure CORS policy to allow access to cdn.domain.com from original domain
For example in Apache
<IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "https://cdn.domain.com"
        Header set Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"

</IfModule>

or for NGINX
location / {

        add_header 'Access-Control-Allow-Origin' 'https://cdn.domain.com';

        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';

...

See more details here https://sherocommerce.com/setting-amazon-aws-cloudfront-cdn-magento-2/


Why declare a variable or function static in C?

Question: I understand what static does, but not why we use it. Is it just for keeping the abstraction layer?
Comment: Duplication of http://stackoverflow.com/questions/572547/what-does-static-mean-in-a-c-program
Answer: There are a few reasons to use static in C.
When used with functions, yes the intention is for creating abstraction.  The original term for the scope of a C source code file was "translation unit."  The static functions may only be reached from within the same translation unit.  These static functions are similar to private methods in C++, liberally interpreted (in that analogy, a translation unit defines a class).
Static data at a global level is also not accessible from outside the translation unit, and this is also used for creating an abstraction.  Additionally, all static data is initialized to zero, so static may be used to control initialization.
Static at the local ("automatic") variable level is used to abstract the implementation of the function which maintains state across calls, but avoids using a variable at translation unit scope.  Again, the variables are initialized to zero due to static qualification.
Comment: I dont get it, if you add static to a function or variable in a .c file, isnt that file never included anywhere else and thus that function/variable is ALWAYS local indpenedent of wether you mark it as static? Wouldnt that make static irrelevant? can someone please explain?
Answer: The keyword static has several uses; Outside of a function it simply limits the visibility of a function or variable to the compilation unit (.c file) the function or variable occurs in. That way the function or variable doesn't become global. This is a good thing, it promotes a kind of "need to know" principle (don't expose things that don't need to be exposed). Static variables of this type are zero initialized, but of course global variables are also zero initialized, so the static keyword is not responsible for zero initialization per se.
Variables can also be declared static inside a function. This feature means the variable is not automatic, i.e. allocated and freed on the stack with each invocation of the function. Instead the variable is allocated in the static data area, it is initialized to zero and persists for the life of the program. If the function modifies it during one invocation, the new modified value will be available at the next invocation. This sounds like a good thing, but there are good reasons "auto" is the default, and "static" variables within functions should be used sparingly. Briefly, auto variables are more memory efficient, and are essential if you want your function to be thread safe.
Answer: static is used as both a storage class specifier and a linkage specifier.  As a linkage specifier it restricts the scope of an otherwise global variable or function to a single compilation unit.  This allows, for example a compilation unit to have variables and functions with the same identifier names as other compilation units but without causing a clash, since such identifiers are 'hidden' from the linker.  This is useful if you are creating a library for example and need internal 'helper' functions that must not cause a conflict with user code.
As a storage class specifier applied to a local variable, it has different semantics entirely, but your question seems to imply that you are referring to static linkage.
Answer: Static functions in C
In C, functions are global by default. The "static" keyword before a function name makes it static. For example, below function fun() is static.
static int fun(void)
{
  printf("I am a static function ");
}

Unlike global functions in C, access to static functions is restricted to the file where they are declared. Therefore, when we want to restrict access to functions, we make them static. Another reason for making functions static can be reuse of the same function name in other files.
For example, if we store following program in one file file1.c
/* Inside file1.c */
static void fun1(void)
{
  puts("fun1 called");
}

And store following program in another file file2.c
/* Iinside file2.c  */
int main(void)
{
  fun1();
  getchar();
  return 0;
}

Now, if we compile the above code with command gcc file2.c file1.c, we get the error undefined reference to fun1. This is because fun1 is declared static in file1.c and cannot be used in file2.c. See also the explanation here, where the codes come from.


Brownian motion and equilibrium

Question: I would like to know if when you consider a system in which you have Brownian motion if it is considered a system in equilibrium or far from equilibrium and why.
i.e., is Brownian motion considered as something in equilibrium?
Comment: Are you interested in a system of particles who are all individually undergoing Brownian motion? Or are you asking about a system whose parameters undergo Brownian motion? Only under the first of these is equilibrium a well-defined concept.
Comment: I am interested in this case: [link] (https://en.wikipedia.org/wiki/Brownian_motion#/media/File:Brownian_motion_large.gif)

Here we have one particle (the yellow one) performing a Brownian motion. The smaller particles (in black) are also performing Brownian motion due to the collisions with each others but I am interest in studying the yellow particle.
Answer: It would be in equilibrium, in particular a thermal equilibrium. A thermal equilibrium is one in which the things in contact with each other exchange no "heat energy."  The particles in Brownian motion as they crash into each other are exchanging kinetic (motion) energy all the time.  But "heat" is a statistical property, which can be characterized by the average kinetic energy.  The average can be taken over time, look at one particle in Brownian motion, and its kinetic energy goes up and down as it crashes into other particles, but on average it maintains a particular value proportional to the temperature of the fluid it is in.  Or the average can be taken over particles, at any instant, the average kinetic energy of a bunch of particles is some value which does not change (except for a tiny bit which can always be reduced by averaging over more particles) over time.
In a thermal equilibrium, the details of motion of any particular piece are quite complex and even fascinating.  The brilliance and purpose of thermodynamics is recognizing how many of those details can be ignored in what circumstances to still correctly characterize the motions of systems including vast numbers of particles.
Answer: Per the comments under the answer, we are concerned with the system consisting of a Brownian particle in contact with solvent molecules. The position and momentum of the particle seems to fluctuate randomly and constantly, but the average position of the particle at long enough times is stationary. Therefore, thermodynamically the particle is in mechanical equilibrium, and since this is the only concerning balance. The average velocity is a constant non-zero value at long times, too. So, the system attains a constant temperature; it is in thermal equilibrium with the solvent as a heat bath. The observed random motions, which in most cases is the concerning phenomena, is one of fluctuation near thermodynamic equilibrium. See https://en.wikipedia.org/wiki/Thermal_fluctuations for details.

Brownian motion and equilibrium


Independent and dependent claims relation

Question: Is it possible to infringe a patent by infringing dependent claims and not independent claims? Does that mean I just need to check independent claims of a patent to be sure I don't infringe the patent? Does this apply to US, Europe and other countries?
Comment: It you find one of the answers acceptable, it would be helpful for you to accept it by clicking the check mark.
Answer: In theory, you do not infringe a patent based on the scope of a dependent claim if you do not infringe the patent based on the scope of a respective independent claim.
In practice, it is possible to find granted patents in which the dependent claims undo a feature of a claim it depends upon and adds a different feature, they are sometimes called false dependent claims. In that case, you might infringe the patent based on the scope of a dependent claim but not of its independent claim.
Sometimes the patent law does not correctly specify that the dependent claims include all features of the claim they depend upon. The defendant could argue that, in theory, a dependent claim shall include all the features of the claim it depends upon, but what the outcome of that may be is unclear. It is not reassuring that the dependent claim, by definition, shall be more limited than the independent claim when you see granted patents with that type of claims: they are granted and they are problematic due to the uncertainty they produce. Reviewing the dependent claims to check if there are no false dependent claims is advisable.
Comment: I would never have thought a "false" dependent claim could get through, are there circumstances that are more likely to cause it, like multiply dependent?
Comment: This happens in the EPO ??
Comment: @GeorgeWhite Sometimes at the EPO, yes, but I have come across this situation more frequently in national patents. Multiple dependence does not seem to cause it. Sometimes it is due to examiners, patent attorneys or being are inexperienced. Sometimes experienced attorneys try to protect more with this kind of tricks.
Comment: @GeorgeWhite The main reason why this gets through, and this is acknowledged by examiners, is that examiners do not put much effort in the examination of dependent claims, so if the independent claims are deemed patentable, most of the times they skim through the dependents, if nothing catches their eye in that quick review, they grant the patent and move on to another file.
Answer: If you mean that your art mismatches the independent claim on which the dependent claim overtly calls out as its independent claim, then under all WIPO-signatory nations (and certainly the USA), your art does not infringe the dependent claim because it does not infringe the independent claim as well.  Each dependent claim is an implied logical-AND extension of the independent claim that the dependent claim overtly calls out as its basis.  Your work does not satisfy the logical-AND there, hence no possibility of infringement.
This assumes that the court & jury (e.g., in the USA) agree with your self conclusion that your work mismatches the independent claim on which the dependent claim depends.  Perhaps you are over-confident due to yearning for a particular outcome. To forestall that overconfidence, you should consult with a patent attorney to see if the patent attorney likewise as a rather neutral party also agrees that your work is a total mismatch to the metes & bounds carved out by the independent claim that is called out by the dependent claim that partially matches your work.
Comment: Good answer except "mismatch" might be misunderstood. In order to infringe a claim your product or activity needs to do or have everything positively required in a claim.
Answer: By definition, in all countries, dependent claims are a narrowing of independent claims. If you do not infringe an independent claim you cannot infringe a claim that depends from it. Period.
However, an independent claim might be hard to understand and apply to the alleged infringing product. A dependent  claim might add limitations that make it more clear what the invention is and therefore make a jury see more clearly  that you infringe.


Why is a text file taking up at least 4kB even when there's just one byte of text in it?

Question: For some reason, when I make a text file on OS X, it's always at least 4kB, unless it's blank. Why is this? Could there be 4,000 bytes of metadata about 1 byte of plain text?
Comment: 4096 bytes, not 4000.
Comment: @Mechanicalsnail 4095. You forgot the one byte of actual data
Comment: @Mechanicalsnail it's a leap year, isn't it? http://xkcd.com/394/ `:P`
Answer: The block size of the file system must be 4 kB.  When data is written to a file that is contained in a file system the operating system must allocate blocks of storage to contain the data that will be written to the file.
Typically, when a file system is created the storage contained in that file system is segmented into blocks of a fixed size.  This Wikipedia article briefly explains this process.
The underlying block size of the file system for this file must have a 4K byte block size.  This file is using 1 4K block and only one byte within that block contains actual data.
Comment: A comment: In Windows, the actual file size is displayed by default, and the size on disk is displayed in the Options pane.
Comment: so can a block accommodate different files?
Comment: @sudeepdino008 no, one block (at least) for each file (Linux' ext file system has/had(?) an option for putting multiple files in one block, but that is an exception to the rule)
Answer: All file systems have a cluster or block size, or the smallest amount of disk space that can be allocated to hold a file. Even if the actual file size is smaller than the cluster/block size, it will still consume one cluster, or 4K on your file system. The cluster size depends on the file system, and the file system options.
If it contains zero bytes, as Gilles pointed out, it uses zero blocks/clusters but one inode on typical *nix file systems, which better answers the caveat, "unless it's blank."
Comment: "Even if a file size is zero bytes, it will still consume one cluster." Actually, no: on typical unix filesystems, an empty file consumes one inode and zero blocks, and there is no notion of cluster that differs from blocks.
Answer: A little experiment to help illustrate this:
First, let's see what the actual block size of my root ext4 (LVM) partition is:
[root@fedora17 blocksize]# dumpe2fs /dev/mapper/vg_fedora17-lv_root | grep -i "block size"
dumpe2fs 1.42.3 (14-May-2012)
Block size:               4096

It is 4096 (4 KiB), as expected. Now, let's create three files: The first is zero bytes, the second is just one byte, and the third is 4 KiB (the block size):
[root@fedora17 blocksize]# touch 0_bytes.bin
[root@fedora17 blocksize]# dd if=/dev/zero of=1_byte.bin bs=1 count=1
[root@fedora17 blocksize]# dd if=/dev/zero of=4096_bytes.bin bs=1 count=4096

Now, we ls the directory. We use the -s option to see the allocated size (the left-most column), in number of 1024-byte "blocks."(ls doesn't know the real block size is 4096 -- we could specify --block-size but that scales everything by that value, and we want to see the actual file size in bytes, too).
[root@fedora17 blocksize]# ls -ls
total 8
0 -rw-r--r--. 1 root root    0 Jan 21 23:56 0_bytes.bin
4 -rw-r--r--. 1 root root    1 Jan 21 23:38 1_byte.bin
4 -rw-r--r--. 1 root root 4096 Jan 21 23:38 4096_bytes.bin

Two things can be noted here:

The zero byte file takes up zero blocks in the filesystem, confirming what Giles stated.
Even though the other two files have different file sizes, they both take up 4*1024 = one 4KiB ext4 block.

Sparse Files
Sparse files are files with large blocks of zeros. Because the data is known to be all zero, there's no point in storing it on the disk. In this way, a file's apparent size can actually be larger than the on-disk size.
Inline Data
Note that some filesystems allow the contents very small files to be stored in the inode itself. See Is it possible to store data directly inside an inode on a Unix / Linux filesystem?.
Comment: This is incorrect. File metadata like you mention do not "eat up" any of the 4KiB. Those structures are part of the filesystem formatting overhead. See my answer above for proof. If what you said was true, then my 4096-byte file would need more than one block.
Comment: I'm saying that *none* of the 4 KiB block size is used for metadata. I think my example proves that.
Comment: @pvn: Jonathon is right. Metadata is stored in the inode for the file, which is separate from the block used to store file data.
Comment: Yes you are quite correct the 4k is the size the file system uses to store information regarding the storage od the file inside the file system. Things such as the index of the file from the beginning of a block, index of the block and size of memory utilized by the file are stored which eat up 4k. This information is used to reference the text file from the file system.
Comment: Pointers to the file (segment no, blk no) in the file system are the things that have to be stored and require one block to be assigned. If the text file is has very less content that can fit in the first block already assigned to it, then it won't require second block allocation. I agree that the whole of 4k is not used for the metadata and some internal fragmentation arises.


Manga about guy going to jail island full of murderers after being framed of murder

Question: The main character was a delinquent boy with superhuman levels of strength. I think that he tried to go to a new high school because he got kicked out of the one he was at for fighting(?) and he has to take care of his younger sister. He gets a call (or something notifies him) that some people have his sister and he goes there and beats them up and leaves with his sister but someone murders the guys he beat up and they found his fingerprints on the murder weapon. As a result he gets arrested and goes to a jail on in island (can't remember if he got there by boat or plane) and when he is there it look like a classroom and is full of murderers and he is called the "murderer of love" or something similar.
He gets into a fight with some big dude that sits behind him and then breaks the handcuffs that he's in and throws the big dude into a chalkboard. The 'teacher' walks in and threatens to murder them if they don't follow the rules but then encourages them to fight. Then the main character declares that he will find a way out, clear his name and help raise his sister.

The main character is seen beating up some guys I think and then he goes home to his sister and somehow later he gets a call that they have his sister and he goes to the place and beats them up and gets his sister and leaves, but someone comes and takes the knife the mc was holding (he was holding it because he took it away from one of the kidnappers) and then killed the guys the mc beat up (there was 3 guys I think), but later he goes home and finds some police or FBI talking to his sister at the door of his house and then he talks to them and then he goes with them to prison but prison for murderers is on a island that is only accessible from boat or plane (the mc took one of those to get to the island) and then he was called the "murderer of love" or something and people say he has a sister complex.
When he gets to the island he is sat in a classroom looking place and everyone there is in shackles(maybe it was just the mc) and the guy behind him was a larger man and started to antagonize the mc and tried to fight him and then the mc grabbed his arm and threw him over his head into the chalkboard and broke the wall to an extent and then the person I think was the teacher walked in and told them that they can fight and encourage each other to try to kill each other( because he thinks they're scum because they murdered people) but he said that he will not stand to be interrupted and will kill anyone that interrupts him or disrupts him when teaching and the big guy goes and sits back down there was also a guy (also a murderer sitting close to the mc) encouraging the fight between the mc and the larger man.
Comment: Ultimate Legend Kang Hae Hyo sound familar to this
Answer: Murder lock: School of the killing
Comment: Hi, welcome to SF&F.  Can you describe this and explain how it matches the question?


Magento 2.2.5 Emails are not receiving

Question: I am using Magento 2.2.5. Order confirmation emails, Invoice emails and any of the custom emails are not receiving to the particular domain based email. Client has the server on go daddy VPS. Mails are receiving for the gmail and only domain based emails has this issue.
Comment: can you receive emails that are not from magento?
Comment: Yes, Other than Magento emails are sending/receiving fine.
Comment: check spam and promotion folder also
Answer: Firstly check cronjobs are enabled in the server. you can check this by using command crontab -l. If no crons are configured do the following.
create the Magento crontab:

Log in as, or switch to, the Magento file system owner.
Change to your Magento installation directory.
Enter the following command:

php bin/magento cron:install [--force]

For more information https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html
Comment: I have configured cron jobs and it is working fine without issues.
Comment: Did you try smtp?

Magento 2.2.5 Emails are not receiving


Why is Touya hiding a phone call from Yuki?

Question: Why is Touya hiding from Yuki that Rina called him? They didn't do anything wrong. It makes him look guiltier if he hides it.
Comment: Could you please tell us which episode (and season) and where this happened?
Answer: I'll try to answer this as a whole since no episode or season has been specified.
Touya feels bad throughout the entire series and knows he's not really up to much good. In fact, he pushes away the girls who has committed some form of "adultery" with away many times. For this reason, we can conclude there is at least some feeling of guilt brooded within him.
However, the most plausible explanation (note, we can only speculate as the series never says) is Touya has feelings for Rina and does not want Yuki to know they talk outside of business. Touya spends a lot of time with Rina on the job a few times during the season but it was supposed to be strictly that.
One can only assume out of guilt and uneasiness, the natural reaction was to hide personal relations with Rina so that Yuki would not think less of him.


"hagEfen" or "hagAfen"? what is the reason behind the enunciation difference?

Question: Why do some say "hagEfen", while others say "hagAfen"? Any difference?
Comment: Ashkenazim say GAFEN and Sefardim say GEFEN.  I read that the reason why Sefardim say GEFEN is that they consider the amen (or l'chaim that they say) that follows the blessing to be a part of the blessing.  Therefore, GEFEN is not the last word of the blessing and, as such, does not switch from GEFEN to GAFEN.
Comment: @MichaelKatz teimonim say jofan or gofen in your pronunciation
Comment: Related: http://judaism.stackexchange.com/questions/13709/how-come-sepharadim-say-boreh-peri-hagefen-but-shelo-asani-aved
Comment: The body is a duplicate of the question linked by @Scimonster, and the title is a completely different question. Perhaps [edit] the body to flesh out the question in the title?
Comment: Are you asking why some have the custom of saying gefen and others have the custom of saying gafen?
Comment: yes, why do some say gefen, and others gafen.
Comment: If you can follow the Hebrew, I very much recommend watching the following (very funny) video: https://www.youtube.com/watch?v=Zw1p213qb0M that happens to peripherally deal with this question.
Answer: The reason that there is a custom of saying gafen and gefen is both a grammatical, as well as a historical one.
The Grammatical reason is that there is a vowel switch when Hebrew words are in "Pausal Form"
Words marked with either an athnah or a silluq, or followed by a sof pasuq are "in pause." When a word is "in pause," the vocalization is slightly changed. The change is manifested by minor changes in the vowels of the word. Note the following four changes
that occur:
A qamats may change to a patah. For example, כָתָב becomes כָתַב.
A segol may change to a qamats in a segholate noun. For example אֶרֶץ becomes  אָרֶץ.
Words with the accent on the final (tonic) syllable may shift accent to the previous (pretonic) syllable. For example, as the accent shifts כָתָבָה becomes כֳתְּבָה.
The 2nd person masculine singular pronominal suffix retracts. For example, לְךָ becomes לָךְ which is identical to the 2nd person female singular pronominal suffix form.
Source: http://gericlements.edublogs.org/files/2011/12/41-Hebrew-Pausal-Forms-283zm8f.pdf
However, this is unique to Biblical Hebrew and stops by the time of Mishnaic Hebrew as Aramaic had by then totally influenced the language. So therefore when blessings are instituted by the Rabbis, they are never in this pausal form. So originally, both Ashkenazim and Sephardim used to say בּוֹרֵא פְרִי הַגֶּפֶן.
This is attested to by The Ashkenazi Haggadah, which is the 15th-century manuscript by Joel ben Simeon.

This is also attested in the Birds Head Haggadah, which is the oldest illuminated Ashkenazi haggadah in existence from the 1300s

Source: https://cja.huji.ac.il/browser.php?mode=set&id=1
As time went on, Ashkenazi scholars decided to make the Hebrew blessings more in line with biblical Hebrew, which would mean that since the word גֶּפֶן is at the end of the sentence, then its pausal form should be גָּפֶן. But the Sepharadim did not make these changes to their blessing, so it remained as it always was, גֶּפֶן.
Note: Recently Hacham Ovadia Yosef said that indeed גֶּפֶן is the correct spelling because according to him, the blessing does not end with גֶּפֶן, but rather it ends with אָמֵן, which means that גֶּפֶן does not need to take the pausal form.
Note: Yemenites also have a custom to say גָּפֶן. I'm ignorant as whether this was always their custom or whether they underwent recent grammatical changes as well.
Comment: Why is Borei Peri Hagefen coming after Shehechiyanu and Hamavdil in the Hagada?
Comment: You have examples of pause backward (pataḥ becomes qamats, כתְבה becomes כתָבה). Regarding pausal forms in Mishanic Hebrew: we have plenty! Just look for verbs spelled with an "extra" vav. But without surviving vocalisation from the Mishnaic Period, what makes you so sure that segol-qamats pausal didn't survive?
Comment: I know this is late, but there are a couple of things wrong with the answer: A) In the pausal form, a Patach becomes a Kamatz, not the other way around. B) A character vowel cannot be adjacent to a Shva in Biblical Hebrew. I think you meant to write כָּתְּבָה with a Kamatz Kattan, not כֳּתְּבָה.
Comment: No idea. But i think you can search through the entire manuscript here http://www.bl.uk/catalogues/illuminatedmanuscripts/record.asp?MSID=19214 if it would help. If the whole manuscript isn't there, let me know because i own a facsimile and can share it with you
Comment: @Aaron. Thanks for the great answer! Based on this answer, is there something wrong with this last sentence. "Recently Hacham Ovadia Yosef said that indeed גֶּפֶן is the correct spelling because according to him, the blessing does not end with גֶּפֶן, but rather it ends with אָמֵן, which means that גֶּפֶן does not need to take the pausal form." (If the blessing does not end with gefEn, then gefEn needs to take the pausal form, which is gAfen?)
Comment: does a word being in pausal form mean, the word in question is at the end of the blessing, or that the word in question is not at the end of the blessing?
Comment: @ninamag So, the last word of a sentence/statement takes the pausal form in Hebrew. If it's not the last word, it does not take the pausal form. According to Ovadia Yosef, the blessing over wine does not end with the word gefen, the blessing ends when people respond amen. So since the last word of the blessing is actually Amen, then according to him, Amen should take the pausal form, not gefen. Personally, i think he's just trying to protect a Sephardi minhag. And i have no idea if the word Amen even has a pausal form
Comment: With the brachot seemingly out of order, and an additional pointing mistake (קדושה needs a dagesh in the ש), what makes this manuscript trustworthy?
Comment: @magicker72 if you want to find old Ashkenazi manuscripts from this time period and see the vocalization I would implore you to do so.
Comment: @Aaron I don't disagree with your statement overall, but I'm not the one writing the answer. You're presenting this manuscript as evidence, so why did you choose this one? Why is it trustworthy, in spite of the visible issues?
Comment: @magicker72 I've added the oldest illuminated Ashkenazi Haggadah we have in existence, same vocalization of "gefen."

“hagEfen” or “hagAfen”? what is the reason behind the enunciation difference?


Can I use the same keystore file to sign two different applications?

Question: I have to upload a new application, It's just the design that's a little different. Yesterday I generated the keystore file to sign application. Can I use the same?
Comment: yes you can (also, did you try before asking?)
Comment: It will be useful for u have multiple applications in a certain organization and making custm permissions by securely but alias name should be different
Answer: You can use that keystore for any number of applications.
No need to generate a new keystore.
Comment: A keystore *CONTAINS* the public/private keypairs that make up a signing certificate. One keystore can contain many keypairs. An 'alias' is a reference to a particular keypair in the keystore. One keystore can hold all of your keypairs, but you should have one keypair per app. Use the name of the app you are signing as the alias. You can have separate passwords for your keystore and for each keypair within it. You can change these passwords and import/export keypairs from the keystore or add new keypairs to your keystore. This is all done with the command line 'keytool' command. Look it up.
Comment: And for 'Alias', what should i write?
Comment: @brycewjohnson Can new pairs be added to the keystore via a GUI?
Comment: In 2022 also you can use the same Keystore & allies for multiple apps, Playstore has no issue.
Answer: I'll make a counter argument to the consensus answer so far.
I agree that for most app authors most of the time, sharing the same keystore/certificate/password between your apps will work fine. The critical thing is to use "the same certificate throughout the expected lifespan of your applications" so the app can upgrade itself.
But I can think of one very good reason to have separate keystores for separate apps or families of apps. If you think you might ever want to sell an app to someone else for them to publish as an upgrade to the original, you'll have to share your one-and-only keystore and password with them to do so. Probably not a huge issue but a bit of worry to you and, perhaps, a due diligence issue to a big-enough buyer.
Also, I really don't read the same line in the documentation the same way as @ol_v_er does. I think the current line:

You should sign all of your apps with the same certificate throughout the expected lifespan of your applications.

(note the lack of a comma in the current version) is simply emphasizing that the 'lifetime' recommendation applies to all apps, not actually directing you to use the same certificate for all of your apps.
Comment: Keeping separate keystores for each app should be the way to go!
Comment: The recommendation is to use a different file for each app, right? What happens if you use the same keystore file for more than one app, though? It seems to cause some issues with Firebase/Google services. I guess it's impossible to use a new one (a different one for each app) if it's already done, right?
Answer: The official documentation tells us:

In general, the recommended strategy for all developers is to sign all of your applications with the same certificate, throughout the expected lifespan of your applications. There are several reasons why you should do so ...

https://developer.android.com/studio/publish/app-signing.html#considerations
So yes, try to sign all of your applications with the same certificate.
Comment: And for 'Alias', what should i write?
Comment: To make it simple, also use the same for all your apps.
Comment: The section in the documentation you quoted removed the terminology "all of your applications" and replaced it with "your app"
Comment: My question is now is there any problem to use different keystore and certificate for different application
Comment: @Lucian absolutely no problem to do that. It's just a bit more complex to manage. If you keep your certificates whith the source code, it's ok.
Answer: I want to add some clarification here, because this question and the answers provided lead to confusion for me. It is crucial to understand what a keystore actually is.
A keystore is just a means to securely store the public/private key pair which is used to sign your Android apks. So yes, you can use the same keystore to sign multiple apks, without a problem. You can also use the same alias (each alias is a certificate) to sign multiple apks, and it will work. It has security implications, however. If your single alias is compromised, then all of your apps will have been compromised.
However, if you intend to sell the rights to your apps one day, then using the same alias for all of your apps may not be a good idea. However, using the same keystore, provided you use a different alias for each apk, may not necessarily be a bad option. I'm sure there is a way that you can move a certificate from one keystore to another, so that you can securely give the necessary keys for only that certificate to your buyer.
To make it very clear, a keystore is just that, a storage medium for keys. It plays no actual part in the process of signing an apk, but only serves to store the keys which are actually used to sign the apk.
References:
Understanding keystore, certificates and alias
https://www.digitalocean.com/community/tutorials/java-keytool-essentials-working-with-java-keystores
Comment: Please don't post identical answers to multiple questions. Post one good answer, then vote/flag to close the other questions as duplicates. If the question is not a duplicate, *tailor your answers to the question.*
Comment: I don't have enough rep to vote for a duplicate. So if you would like to vote the following questions as duplicates, I feel this question is the most appropriate to be the non-duplicate. It is the first rank in Google for the relevant keywords, and has the most relevant answers.

http://stackoverflow.com/questions/13023509/same-keystore-for-different-app/
http://stackoverflow.com/questions/14973205/android-can-publish-different-apps-with-same-keystore-file-in-multiple-account/
http://stackoverflow.com/questions/10514597/android-multiple-apps-multiple-customers-one-keystore/
Comment: Apologies. I'm a noob to SO.
Comment: Wait! How can I use the same keystore but with different alias for each app?!
Comment: is this applicable for the app bundle too?
Answer: Of course! You can use the same keystore file as many times you want. It's always better to use the same keystore file for all the applications you develop. That will help if you want to update or modify the application. At that time you need to sign your application with the same key.
Answer: Recent Update
If you want to enrol in App signing by google you have to use new different key to sign your apk or bundle otherwise after uploading google console will give you error message saying

You uploaded an APK or Android App Bundle that is signed with a key
that is also used to sign APKs that are delivered to users. Because
you are enrolled in App Signing by Google Play, you should sign your
APK or Android App Bundle with a new key before you upload it
Comment: I think this error message may be due to [a different reason.](https://stackoverflow.com/q/54299273/2289835) Because I had the same issue. and it's not related to the keyStore file.
Comment: I was able to generate a new key inside android studio apk signing screen. Generate new keystore and alias and it may work. It worked for me.
Comment: can we opt out this?
Comment: I used the same Keystore file with the same alias & password, and Playstore has no issue.
Answer: I do sign all my apps using the same certificate (keystore). This gives an advantage if i change my mind and want my apps to share their data.
As you might know Android identifies each app with an UID. If all your apps are signed by the same certificate you can request android to assign same user id more than one app and inturn make them run in a single process and share the data.
From android doc android:sharedUserId

android:sharedUserId
The name of a Linux user ID that will be shared with other applications. By default, Android assigns each application its own unique user ID. However, if this attribute is set to the same value for two or more applications, they will all share the same ID — provided that they are also signed by the same certificate. Application with the same user ID can access each other's data and, if desired, run in the same process
Comment: Cool comment, didn't knew that thanks! :)


I don't understand that sentence, even though I know conditionals well

Question: "If David didn't give up smoking, Liza wouldn't marry him."
I only can see that sentence in the 3rd conditional (unreal past) - "If David hadn't given up smoking, Liza wouldn't have married him". But I don't understand its meaning in the 2nd conditional. Is it just me, or this sentence doesn't work in the 2nd conditional?
Comment: Hehe, ye, if you use it as the 1st conditional but in reported speech, it does of course. Thanks!
And why do you consider "o" a difficult part in neighbour?:D
Comment: @RrockCj - 'neigh' is the 'difficult' part in neighbour/neighbor, I think.
Comment: In the right context it works fine. His mother wanted him to get married but she knew that if David didn't give up smoking, Liza wouldn't marry him. She told her neighbour, "If David doesn't give up smoking, Liza won't marry him." "Hide his cigarettes," the neighbour said. ['Neighbor'? Is that how they spell it in the US? They leave the difficult bit but drop the 'u'? Sheesh!]
Answer: Let's look at this in the present tense:

If David does not give up smoking, Liza does not marry him.

To me, this sounds a bit informal, but not necessarily incorrect. I would say:

If David does not give up smoking, Liza will not marry him.

To illustrate the usage of the former, imagine a question and answer scenario, like this:

And what happens if David doesn't give up smoking?
Then Liza doesn't marry him. Now quit your worrying!

Again, what will happen and will not marry could be better choices, but dialogue is often imperfect.
With these insights, let's send the verbs back to the past. *time travel noises* Once more we have:

If David didn't give up smoking, Liza wouldn't marry him.

Let's imagine another question and answer scenario:

Why wouldn't Liza marry David?
He didn't quit smoking. Never had much self-control.

I 'reversed' the exchange because we can now distinguish between the cause (David did not stop smoking) and effect (Liza would not marry him). A cause and an effect can form an 'if-then' statement, which is what you are reading.

If [cause], then [effect].
If David didn't give up smoking, [then] Liza wouldn't marry him.

Hope this helps!
Comment: Well, the problem is even though you say "let's send verbs back in the past" it's not the past, is it? 3rd conditional is, 2nd conditional is not, it's present.
Say, "If I were smart, I would yada yada". "If I were smart means "I AM not smart", in the present. We don't talk about the past when using 2nd conditional.
Comment: @RrockCj School never taught me what 2nd or 3rd conditionals are, so if you're trying to become fluent in everyday situations or just trying to read the book, those things don't matter. I was simply trying to illustrate my intuitive understanding of the sentence as a native speaker.
Answer: The way I see it, the reason that sentence is in the SECOND Conditional is because THE OPPOSITE context happened, making the situation specified in your sentence IMPOSSIBLE to happen anymore.
So, if you say:
"If David didn't give up smoking..." <- the fact you mentioned the conditional clause in the simple past means that this is something unlikely to happen, which is what the 2nd Conditional is all about. Therefore what happened is the opposite, or:
David gave up on smoking and Liza married him.
Now, to your question: Yes, it also makes sense to work with the 3rd Conditional, but that would imply that David either didn't care about marrying Liza or he could not quit smoking. So currently, he still smokes. So now we use the 3rd Conditional to express that David REGRETS about his decision or misses Liza. That's what the 3rd Conditional is all about, expressing a past regret (or in other words, a regret about a decision made in the past). Therefore:
"If David had given up smoking, he would've married Liza".
I hope that helps you out.
Comment: Ye, "the situation specified in your sentence IMPOSSIBLE to happen anymore." - that should be the 3rd conditional right there


What is the exact process to get Moksha?

Question: Moksha is the aim of our life. But I don't find the exact way how to puruse Moksha. What is the process/blueprint to get Moksha ?
Comment: Does it help you https://hinduism.stackexchange.com/q/2179/26679
Answer: Yes, the most acceptable, and popular answer is - the blend of Gnana, Karma and Bhakti. However, there are controversies about this answer.
You must understand the meaning of Moksha first. Moksha is the release from the cycle of rebirth. Cause of Rebirth is the Karma. Karma creates bondage. And, till you have body, it is inevitable to do Karma. There are 2 ways to remove the bondage of Karma: do Karma without the expectation of reward OR offer the results to God. First solution is not practical (to implement in a 100% full-proof way). In second solution, you need to believe in God (that is Bhakti) which forces you to believe in something other than your Atma. That belief itself is Agnana. Till you have Agnana you cannot get Moksha.
Gnana is the most difficult path. But that is the only path which does not have any controversies. Even if you choose Bhakti or Karma path, the last stage before the Moksha is the Gyan, that is "I am the Bramha".
All the above points are based on philosophy of Vedanta. It is beyond the scope of this space to cover the topic. Please read following to get started:
https://en.wikipedia.org/wiki/Advaita_Vedanta,
https://en.wikipedia.org/wiki/Dvaita_Vedanta,
https://en.wikipedia.org/wiki/Vishishtadvaita
Note: These are millennium old debates. There are thousands of books written on it. Any discussion without the understanding of these philosophies will not help. Following any path without proper understanding will not lead to the desired results.
Answer: Kaivalya Upanishad.:

हृत्पुण्डरीकं विरजं विशुद्धं विचिन्त्य मध्ये विशदं विशोकम् । अचिन्त्यमव्यक्तमनन्तरूपं शिवं प्रशान्तममृतं ब्रह्मयोनिम्॥ तमादिमध्यान्तविहीनमेकं विभुं चिदानन्दमरूपमद्भुतम् । उमासहायं परमेश्वरं प्रभुं त्रिलोचनं नीलकण्ठं प्रशान्तम् । ध्यात्वा मुनिर्गच्छति भूतयोनिं समस्तसाक्षिं तमसः परस्तात्॥६-७॥
6-7. At the center of the lotus of the heart, meditating upon that which is pure, without passion, clear, without sorrow, unthinkable, unmanifest, infinite in form, auspicious, peaceful, eternal and the cause of Brahma. Without a beginning, middle or an end, who is one, all pervading, of blissful consciousness, without form, wonderful, seated with the goddess Uma, the Supreme Lord, the ruler, bearing three eyes, with a blue neck, ever peaceful - by meditating upon Him (Somah/Shiva with Uma/Ardhanareshwara) the sages attain the source of all creation, the witness of all and that which is beyond all darkness.
स एव सर्वं यद्भूतं यच्च भव्यं सनातनम् । ज्ञात्वा तं मृत्युमत्येति नान्यः पन्था विमुक्तये॥९॥
"He (Somah) alone is all that was, and all that will be, the Eternal; knowing Him (Somah), one transcends death; there is no other way to liberation".

I hope this clarifies all queries. Prd..


Are the creators and Lockdown related to Cybertron?

Question: Is Cybertron the only Transformers planet the creators had seeded?
If yes, does that mean Lockdown is a Cybertronian? Or is he an independent custom rendition of the Creators?
Comment: I suppose not, as Lockdown works for the creators, hence I'm curious about their origins.
Comment: Is there two different questions here?
Answer: Within Age of Extinction itself, there is no direct evidence that Cybertron was seeded.
There is, however, evidence of other planets being seeded - including Earth.

Cade: Wait. The Seed?
Tessa: Those nasty soldiers that were chasing us. I saw them board the ship and they took something that they called the seed.
Hound: Listen. Sixty million years ago, give or take an eon...
Optimus: Thousands of planets were cyber-formed with Seeds. They turned your organic life into our elemental metals. Our creators destroyed your world to make us.

Whether or not Lockdown is a Cybertronian is left unspecified within the movie, but he has one quote that makes it sound as though he at least pre-dates the two factions.

Lockdown: Autobots, Decepticons, like little children: always fighting, making a mess out of the universe. Then I've got to clean it up.


Unusual triplet in 13C-NMR

Question: Why is there a triplet at 46.7 ppm in the following spectrum of 2,2,2-tribromoethan-1-ol?
Comment: The spectrum is of really poor quality. We can't even see if the triplet is a $1:2:1$ or $1:1:1$ one. From the other (poor quality) spectra I can see on SciFinder, it looks as though that should be a singlet — but I can't see too much on $75~\mathrm{MHz}$ spectra at that resolution. Finally, it seems weird that both signals should be of similar height even though one is quarternary and the other is secondary …
Comment: I bet this is just a typo on the website.
Answer: So, there actually isn't a triplet in the spectrum shown. This is a 13C{1H}, and so proton coupling to carbons is not visible. Hence, the two peaks at 79.9 and 46.7 ppm are singlets. If you read the question carefully, on the left hand side it indicates what the multiplicity of that peak is i.e. how that peak would appear in the absence of proton decoupling. The peak at 46.7ppm, in this case, would appear as a triplet. This information helps you work out how many protons are attached to a particular carbon centre.
So for this example, one of your carbon centres will have no protons attached, and the other will have 2 protons attached, CH2. A CH2 carbon will split into a triplet, due to the normal 2nI+1 rule.
Multiplicities used to be determined by running off-resonance decoupled experiments, so that multiplicity could be seen clearly for 1J coupling. These days, multiplicity would usually be determined via a DEPT experiment, or preferably a phase edited HSQC.
Of course, that peak at ~77ppm is a 1:1:1 triplet, and that is because it is CDCl3, and a proton-decoupled carbon experiment won't remove coupling to deuterium, and so the chloroform carbon splits into 3 lines, again due to the 2nI+1 rule (2H has spin=1).
Important Edit
I've just had a quick look at the solution on your page link, and it actually appears that there is an error in their assignment of the multiplicities. The -CBr3 peak will come at 46.7ppm, and would be a singlet. The -CH2OH peak wil come at 79.9ppm, and this would be a triplet. They have these two multiplicities switched on the question page.
Comment: No, for some reason the website agrees that $46.7~\mathrm{ppm}$ is the $\ce{CBr3}$ group. Which would make sense if that is just a singlet. If you click on *solution*, it gives you the correct assignment.
Comment: @Jan - yes, this is what I mean. The error is on the question page, with the multiplicities. The solution page is quite correct.

Unusual triplet in 13C-NMR