Second fundamental form and embeddings

Question: Let $\Sigma$ be a smooth hypersurface of a $d$ dimensional smooth Riemannian manifold $(\mathcal M, G)$;
we may see $G_x$ as a mapping from $T_x(\mathcal M)$ into $T_x^*(\mathcal M)$ so that
$$
\langle G_x X, X\rangle_{T^*_x(\mathcal M), T_x(\mathcal M)}=G_x(X).
$$
 Working in a neighborhood of a point of $\Sigma$ we may consider a parametrization from a chart $U$ of $\Sigma$ into a chart $W$ of $\mathcal M$,
$$
\mathbb R^{d-1}\supset U\ni u\mapsto x(u)\in W\subset\mathbb R^d, \quad \text{rank $x'(u)=d-1.$}
$$
We define the first fundamental form $g_u$ as
$$
\langle g_u T, T\rangle_{E^*, E}=\langle G_{x(u)} x'(u)T, x'(u)T\rangle_{F^*, F}, \quad T\in \mathbb R^{d-1}=E, \quad F=T_{x(u)}(\mathcal M),
$$
and $g_u$ is obviously a positive definite quadratic form on $E$. We introduce $N(u)$ as a normal vector to $\Sigma$ at $x(u)$ and that vector $N(u)$ belongs to $F$ and is such that
$$
\langle G_{x(u)} x'(u)T, N(u)\rangle_{F^*, F}\equiv 0.
$$
We define the covector $\nu(u)=G_{x(u)} N(u)$ and we have
$
\langle \nu(u),x'(u)T\rangle_{F^*, F}\equiv 0,
$
so that
$$
\langle \nu'(u) T,x'(u)T\rangle_{F^*, F}+\langle \nu(u),x''(u)T^2\rangle_{F^*, F}=0.
$$
I want to define the second fundamental form in the direction $N$  as
$$
\langle\omega_u T, T\rangle_{E^*, E}=\langle \nu(u),x''(u)T^2\rangle_{F^*, F},
$$
and the Gauss curvature as
$$
K=\frac{\det(\omega_u)}{\det (g_u)}.
$$
The above description is standard when $\mathcal M$ is the Euclidean $\mathbb R^d$.
Is it correct in this more general case ?
Answer: To be honest, I find your formulas hard to follow. I hope the following is useful:
I define the second fundamental form for a submanifold $\Sigma \subset \mathcal{M}$ of any codimension as follows: Let $X \in T_x\Sigma$ and $Y$ be a tangent vector field along $T_*\Sigma$. There are two different connections, the Levi-Civita connection $\nabla^\Sigma$ induced by the metric on $\Sigma$ and the connection $\nabla^{\mathcal{M}}$ induced by the metric on $\mathcal{M}$. It is straightforward to check that $\nabla^{\mathcal{M}}_XY$ is well defined, even though $Y$ is defined only on $\Sigma$. Then $\nabla^{\mathcal{M}}_XY$ can be decomposed into two components, one tangent to $\Sigma$ and the other normal. It turns out that the tangential component is $\nabla^{\Sigma}_XY$ and the normal component is the second fundamental form (viewed as a normal-vector-valued symmetric tensor on $T_*\Sigma$), which I'll denote by $H$:
$$
\nabla^{\mathcal{M}}_XY = \nabla^{\Sigma}_XY + H(X,Y).
$$
It is also straightforward to show that $H(X,Y) = H(Y,X)$. Since the definition of $H$ shows that $H$ depends only on the value of $X$ at the point $x \in \Sigma$, the symmetry of $H$ implies it is a tensor.
In codimension $1$, the standard second fundamental is simply $\nu\cdot H$, where $\nu$ is a unit normal vector$. It is also easy to see that the definition above is the same as the standard one using the Gauss map.
Also, as Oliver Nash points out, the second fundamental form can be viewed as a bundle map $H: S^2T_*\Sigma \rightarrow N_*\Sigma$ (this is the adjoint of Oliver's ap) or, equivalently, a section of the bundle $N_*\otimes S^2T^*$.
Comment: Maybe worth adding that $H$ is often usefully viewed as a family of quadratic forms on the tangent space, parameterised by the conormal bundle. I.e., we can regard $$H : N^* \to S^2T^*\Sigma$$ over $\Sigma$ (using the metric to identify $T^*$ and $T$). Also, it can also be obtained as the derivative of the Gauss map.
Comment: Oliver, thanks for pointing that out. Also, is there an easy way to use the Gauss map when the codimension is greater than $1$? I've been wondering about that. In principle, the Gauss map can be defined using Grassmannians, but it gets complicated. I learned how to handle this using moving frames from a paper by Griffiths, but is there an easier way?
Comment: IIUC, the way I think about this is if $f : X \to Y$ is an immersion of smooth manifolds, $\dim X = k$ and we have a fixed parallelization $TY \simeq Y \times V$ (for some vector space $V$). Then we can regard $df \in \Omega^1(X, V)$ as a map: $$\mathcal{G} : X \to Gr(k, V).$$ Since the tangent space to the Grassmannian at $U \in Gr(k, V)$ is naturally $Hom(U, V/U)$, we have a natural decomposition of the pull back: $$\mathcal{G}^*TGr(k, V) \simeq T^*X\otimes N$$ where $N$ is the normal bundle of $f$.
Comment: Thus we can regard $d\mathcal{G} \in \Omega^1(X, T^*X\otimes N) = \Omega^0(T^*X\otimes T^*X\otimes N)$ but since this is a second derivative and partial derivatives commute, it is symmetric and so in fact we obtain an element of $$\Omega^0(S^2T^*X\otimes N).$$
Comment: Maybe worth emphasising that what I describe above obviously only works when $Y$ is flat. Presumably your question was what about when it isn't, so this might not be of interest to you after all. This POV also works for projective varieties but that may be as far as it goes. (It's a long time since I've read that lovely Griffiths and Harris paper.) ¯\\_(ツ)_/¯

Second fundamental form and embeddings


Acceleration and motion can be in different direction?

Question: I'm not getting what acceleration concept is and how it relates to motion and how motion and acceleration can be in different direction? And what's behind the concept of negative and positive acceleration?
Answer: Let's say that we move along the straight line. Acceleration shows how fast velocity changes, it doesn't matter how fast you move:

If velocity increases, acceleration is positive
If velocity doesn't change, acceleration is 0
If velocity decreases (slows down), acceleration is negative

So when you're in the car and you step on brakes, you keep moving forward for some time, but acceleration is negative (points backwards) - it opposes the forward motion.
If you want an image in you head - instead of brakes think of Hulk stopping the car - he pushes it into opposite direction, the car keeps moving but slows down.
Comment: The complexity of an answer should correspond to the level of a question. Otherwise only people who know the topic anyway would understand the explanation.
Comment: You don't seem to know that acceleration is a vector...
Comment: Am I dreaming or did you edit OP's question to add "And what's behind the concept of negative and positive acceleration"???
Comment: I added words "And what's behind" instead of just "what" to make it grammatically correct. Why?
Answer:
How motion and acceleration can be in different direction?

This isn't surprising. Hitting the brakes on your car is not the same as putting it in reverse.
Answer: Think of a satellite in orbit. At any point in time it is moving "horizontally" (tangential to the earth). However, its acceleration is always directly towards the centre of the earth, in other words, at $90^{\circ}$ to its direction of motion.
"Motion" is how the object is currently moving. Acceleration can be in any direction; it depends on the direction of the force. For a satellite, the only force is the earth's gravity, the direction of which is towards the centre of the earth.
Answer:
The plus/minus sign of position, velocity, and acceleration are applicable only to one-dimensional motion.

Position vector's sign refers to the object's location relative to the reference point;
velocity's sign refers to the object's direction of movement;
acceleration's sign refers to the direction of the net force $(F=ma)$ causing the object to accelerate.

҂Incidentally, displacement (change in position, i.e., final position vector $-$ initial position vector) has the same direction as average velocity.
(Position might be denoted by $x$ or $r,$ while displacement by $s.)$

To see how velocity (motion) and acceleration can be in opposite directions, consider a ball travelling upwards while its acceleration (due to gravity and air resistance) is downward.

To dispel a common misconception: an object having a negative acceleration is not necessarily undergoing retardation! Retardation is the rate of decrease of speed, not velocity.
To wit: define the positive direction as upward, and consider a ball in free fall. Then its acceleration (due to gravity) is negative but it is not retarding (it is speeding up).

The term 'deceleration' is best avoided due to potential ambiguity; however, it is often defined as retardation instead of as negative acceleration, which is not a meaningful concept outside of one-dimensional motion.
As such, in the previous example (#5), the ball's acceleration and deceleration are both negative; in the first example (#4) where the ball is slowing down, if we define the positive direction as downward, then the ball's acceleration and deceleration are both positive.
Here, while acceleration is a vector whose sign refers to its spatial direction, retardation/deceleration is merely a signed scalar whose sign refers to the direction of speed change (positive deceleration corresponding to decreasing speed).

҂ (i) position $$= \int v\:\mathrm dt;$$
(ii) displacement = average velocity $\times$ time elapsed $$=
\int^{t_2}_{t_1} v\:\mathrm dt;$$
(iIi) distance travelled = average speed $\times$ time elapsed $$= \int^{t_2}_{t_1} |v|\:\mathrm dt.$$
Answer: Try to remember the following things in short which will help you to develop this idea of your own.
(A) Acceleration is in the direction of motion, when you are increasing the speed of the car moving along a straight line.
(B) Acceleration is against the direction of motion, when brakes are applied to the car in motion.
(C )Acceleration is uniform, when an object is under free fall.
(D) Acceleration is non-uniform when a vehicle is driving through a busy city road.
Hope this will help.
Comment: Don't judge it from a complete physical or mathematical point of view the answer is based on our daily life experience, you may say an intuitive answer


What does host% mean in command line?

Question: I see this a lot in terminal commands and didn't understand what does it mean. also the terminal doesn't recognize it.
Comment: When have you seen this? I don't think I've seen it... And I've seen... Things.
Comment: I've just google it, and found [this](http://www.stlinux.com/install/getting-started/building-linux) as example. Here `host%` it is just bash prompt. You can google about **bash prompt** if you don't know what is it.
Comment: @c0rp It's actually a [csh](https://en.wikipedia.org/wiki/C_shell) prompt, not a bash prompt.
Comment: @c0rp Makes sense. You should post that as an answer.
Comment: Where did you see this?
Answer: I assume you're seeing this host% in documentation.  It stands for the shell prompt.  ("Shell" is the program that reads the commands you type; "prompt" is the little bit of text that this program displays on your screen to say that it's ready to read your next command.)
If you look at a terminal window on your computer you'll probably see something like
my-computer-name%
on the last line, where "my-computer-name" is of course your computer's name.  This is prompting you (i.e., inviting you) to type a command.  So now you go and type ls and carriage return, and the shell prints some output.
Linux documentation typically uses host% to indicate the prompt ("host" is another name for "computer").
This host%  It's not meant to be typed: it just indicates that what follows in the document is to be typed.
Answer: I open this question because it is got me interested. I did't know what is host%. But the answer is more easier then I was thinking.
I'v google it and found this tutorial, where we can see this magically host%.
This is so called Shell Prompt. Thing that usually appear before each command in terminal emulator. It is usually provide some information to user. Previously it has been used to show host name, that's why you can see host% it some documentation and tutorials. Imagine that you have opened a few terminal sessions to a different hosts. There is a chance that you get confused and type some command to the wrong terminal. I think that's why Prompt is exists.
In Ubuntu it is usually look like this:
username@hostname:path $

Where:

username - Currently logged in user login
hostname - This host's name
path     - Showing path to the folder. The  current  working  directory,  with $HOME abbreviated with a tilde
$     - End of prompt, and start of new command

You can customize Bash Prompt if you want. Here is my prompt:
22:33:16 - (~/Downloads)$

current_time - (path)$

Here is nice tutorial for customizing it
Answer: Host% is nothing but a prompt with host name (your computer name) saying that the shell is ready to accept commands. This prompt can be set to username or it can show time or date etc.

What does host% mean in command line?


What happens if you transfer real tokens to a test account?

Question: What happens if you transfer real tokens to a test account?
The Ethereum wallet says that you shouldn't do it, but it doesn't say why.
Answer: As long as you have the private key and therefore access to that account, you will be able to transfer the tokens to another account.
Great way to test it, is to load that account using the Metamask addon (MetaMask.io) and then to switch the Net you are on:

You can see the balance of the account on every network.
Why the warning:
I think the warning comes, because for a test account you would possibly be less careful in handling the private keys, than with a main account.
Comment: Addition: a Token Contract could theoretically exists on more networks or on just one. Either way, those contracts would not know anything about each other. This means, having a token on a net, does not affect your balance on another net.
Answer: Real tokens live on the mainnet.
You're testnet account address does not exist on the mainnet.
So when you send real tokens from the mainnet to this testnet address, you will lose them. It's like sending money to a wrong bank account.
That's because mainnet and testnet are two completely different networks.
Comment: This is incorrect. A testnet address is a valid mainnet address. If you did accidentally send coins to a testnet address, it would not be difficult to retrieve them.
Comment: That's correct.
Comment: ok sorry, is the same private key valid for an address on mainnet and testnet? So value in addresses is the same even though the tx-history and contracts of both ledgers are completely different?


How to fix Visible white lines of grid (hairline) after exporting pixel art on Illustrator?

Question:
I made a pixel art piece on Adobe Illustrator, painting singular squares of a generated grid. I turned off the stroke so no grids are visible, but when I export, there are very faint hairlines. How do I fix this?
Comment: Why are you making pixel art in Illustrator? It's a vector image editor.  Use a raster image editor instead.
Comment: Export to what?
Answer: Lock your grid in the layers panel so that it cannot be selected. Hopefully you have them in one layer which doesn't contain other objects.
If it happens that there's still unexpanded rectangles (=the color is still an effect) select all, expand the appearance and ungroup all as many times as needed to get all groups disassembled. See the progress in the Layers panel.
Select one brown item, then select the rest of them by applying Select > Same > Fill Color. Insert 1 px wide brown stroke.
Do the same to Orange and grey items with their colors. The big idea is to generate overlaps which prevent the background being visible through the narrow transparent gaps which are left by the inaccuracy of your colorizing method and the general rendering to the raster screen.
Not asked: I have thought a bitmap drawing program is the tool for pixel artists. It's no problem to scale say 100px x 100px bitmap image bigger, say to 2000px x 2000px and still keep it sharp. If you can show some real but not so easy to understand benefits that your vector approach offers many of us surely are interested in hearing them.
Comment: Another artist was doing a similar method and it worked for them. I understand and use a pixel program myself, though I wanted to give Illustrator a shot if it can work out
Answer: Illustrator could be used for pixel art. If you feel it gives you some benefits then why not? I assume you want to export raster images to PNG format.

The example you show doesn't really look like pixel art to me though. You have several places where the rectangles of the two used colors doesn't seem to follow the same grid. Or at least the grid has a pretty high resolution.

You should work at the actual size where one pixel in your drawing is a 1×1 px square and follow the pixel grid.

You can of course make something more similar to your example with larger rectangles, but you still need them to snap to the pixel grid.

If you export a PNG at the actual size (72 ppi), the unwanted lines between pixels wouldn't be possible (since in raster graphics no line can be thinner than 1 px).

To save as a PNG use File > Export > Export As. Set Save as type to PNG You probably
want to check Use Artboards to get a file exactly the size of your artboard.

Then set Resolution to Screen (72 ppi), Anti-aliasing to None and choose the Background Color you want.

If you want to scale up the drawing on export, set the resolution to a multiplication of 72 ppi (72, 144, 216, 288 etc.) so each pixel of your original image will be rendered with a whole number of pixels.


Can I vent a basement bathroom into a semi-enclosed crawlspace under an attachment?

Question: I'm refinishing my basement bathroom and installing a vent. I can easily vent out to this wall, but the thing I'm worried about is it's semi-enclosed. In the winter we put up tarps and store wood here, in the summer we keep garden tools here. Should I have anything to worry about in this? Is the moisture hittig the cold air there going to condense and leak back inside or anything? Am I going to get unexpected results that are going to make me hate myself for thinking it could be so easy? Additionally, I was wondering if I could just continue the duct work along the floor joists of this attachment and put the vent all the way on the exterior wall? We've been using that space to store 2x4s as you can see in the photo, but I can spare some for a duct. I'm just concerned that the pipe will get cold and when hot wet air is pumped through it, I'll have water buildup in the duct. Another option I have is venting it under the outside stairs, but that's very similar to letting it out under the attachment
Answer: The warmer air exhausted from the bath entering a cold environment will condense and create moisture. It will create high humidity which will lead to mold growth. this will become a health issue as well as rot the wood. You want to vent it to outdoors, never indoors.
Comment: At first I was going to question you on what your definition of "indoors" and "outdoors" was, since I'm not sure what this space qualifies as.. but regardless, your concerns are the same as mine are - moisture.
Comment: The problem is it is an enclosed area, even if it is somewhat open. The vented air will tend to linger in the area, rather than dissipate in open air. That trapped air, from the bath, if the temperature differential is big enough and there is enough humidity in the air will cause condensation to form. Weather or not you have sufficient air flow in that room is questionable. You may get away with it, or not. You could try venting it there, and watch it closely, if it is a problem you will need to move it to outdoors. If it were me, I would just go for venting outdoors, and be done with it.
Answer: I concur with SteveR. You have access to the ceiling joists in this area, so I would just buy an extra 10-15' of 4" rigid vent line and extend the vent out to the eaves beyond this enclosed porch area. The reason is exactly as SteveR said; regardless of your definition of "inside" vs "outside" with regards to this space, it is an enclosed "cold zone" which has more limited airflow, and so the exhausted air will not have much opportunity to exit this area before becoming too cold to hold its moisture, which will cause condensation onto various surfaces in the room. Some are designed to handle that (like your siding), others aren't (like the firewood, joists and sheathing).


Why are there 14 electrons in the third shell of iron atom?

Question: The third shell must contain at least 18 electrons. But in iron there are 14 electrons in third and 2 electrons in 4th. Why are there 14 electrons in the third shell of iron atom?
Comment: The figure shows 12 in the 3rd and 2 in the 4th.  The term shell is probably inappropriate as there was a model of Bohr which used the term "shell" to correspond to "periods" in the periodic table.  As for the reason?  There is nothing that requires an energy level to fill up before another one starts to fill.  Its all about stability and energy.  It depends on many factors.  Transition metals will almost always have 1 or 2 electrons in the s sublevel above the d sublevel that corresponds to its place in the d block
Answer:
The third shell must contain at least 18 electrons.

This statement is wrong. In fact, the third shell is only able to contain up to 18 electrons. This is a mathematical result of quantum chemistry that is, in principle, derived in every introductory quantum chemistry course. The reason being that there are three different subshells in the third shell (called s, p and d orbitals) which can contain 2, 6 and 10 electrons, respectively. After 18 electrons have been added to the third shell, there is no combination of quantum numbers to allow for a 19th electron within that same shell.

On to the question of why there are two electrons in the 4s orbitals (the fourth shell) although the third shell is not full yet. This is because the subshells in every atom with more than one electron have different energy levels. In general, the energy levels follow what is known as the aufbau principle: 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, … However, this is more of a general observation. It works very well for general chemistry classes, but there are quite a number of edgy cases that these same classes will have to introduce special rules for.
A great general reference to check out would be this question. But I would also like to point you to this chemguide.co.uk guide, which explains the entire complication in more details. The gist is that the energy levels of 4s and 3d are so similar in an innocent case such as argon that depending on how many protons and additional electrons are added a different orbital may be the one lower in energy and leading to the more stable electronic configuration.
If, when coming from argon you add exactly one proton and exactly one electron (generating a potassium atom), the energy levels will shift relatively to each other in such a way that the 4s orbital is lower; thus, potassium's electronic configuration is $\ce{[Ar] 4s^1}$. If you add another proton without an electron (generating $\ce{Ca+}$), the picture remains the same. Calcium(I) has the same electronic configuration. If you add a third proton to generate scandium(II) ($\ce{Sc^2+}$), the 3d orbitals will suddenly move below the 4s orbitals in energy so its configuration is $\ce{[Ar] 3d^1}$. (This is because the 3d orbitals are less diffuse or 'closer to the nucleus' and therfore get stabilised more.)
If you thought you could now easily add a second electron into another d orbital when generating scandium(I) ($\ce{Sc+}$), think again. Due to electron-electron repulsion (or more generally, the Hund rule), this additional electron is placed in the 4s orbital leading to $\ce{[Ar] 3d^1 4s^1}$. And the final electron to generate a neutral scandium atom would again be added into the 4s orbital to give $\ce{[Ar] 3d^1 4s^2}$.
(In reality, you do not simply 'add electrons' and all the electrons of an atom are indistinguishable. What you can do, however, is calculate or measure the electronic structure of all these atoms and ions to determine which levels are populated by how many electrons. And that will give you the result discussed above.)

Tl;dr: It's complicated, but an easy rule of thumb would be to fill the next shell's s electrons before filling up a given shell's d electrons. Thus, for iron the 4s level is filled first, before an additional six d electrons are added. Read above as to why it is not that simple.
Answer: Your doubt is - Total number of electrons in 3rd shell  (i.e. electrons from 3s + electrons from 3p + electrons from 3d) is not yet 18 but still how we filled up the 4th shell?
You have a general misconception than atomic orbitals always follow the 2,8,18... electron filling rule. According to this 2,8,18.. electron filling rule, 2 electrons should get filled up in 1st shell, then 8 electrons in second shell, then 18 electrons in 3rd shell........
Remember this rule mentioned above is completely elementary! Just remember 2,8,18... electron filling rule is actually a waste. Simply I would recommend forget about that 2,8,18... rule. It is very elementary rule... simply forget it. In 2,8,18... electron filling rule, "lower energy level orbitals gets filled up first"- this statement is not considered in that elementary 2,8,18..rule. But this statement which that elementary rule doesn't consider is very important statement to be followed while filling up of electrons. So remember 2,8,18... electron filling rule is an elementary rule for beginners who  just start to read about atoms and orbitals! Forget about that rule.
Its not necessary that 3rd shell has to have 18 electrons for 4th shell filling up to start.
The electron filling depends upon the energy levels of the orbitals. Lower energy orbitals get filled up first.
Iron's configuration is: 1s2 2s2 2p6 3s2 3p6 4s2 3d6. You can note from the configuration, 4s gets filled up before 3d . The reason behind this is lower energy orbitals are filled up first. Even though 4s belongs to 4th shell, still its energy is less than 3d which can be reasoned out by (n+l) rule. 4s energy is less than 3d, hence the two electrons which you expected to be going to 3d goes to 4s before 3d filling starts. Hence you end up having 14 electrons in 3rd shell and 2 electron in 4s. Remember 4s got filled up before 3d and the reason is 4s energy is less than that of 3d.
Comment: While the 2-8-18 shell model is elementary, the Aufbau filling is also a flawed concept.  I won't vote down because Aufbau is consistent with 4s2 3d6, but the 4s electrons present in Iron are actually higher energy than the 3d electrons and will ionize first and enter last.  It is still generally true that the 3d will "get full" after the 4s as you move across the periodic table, but it doesn't fill last in a given transition metal.  Iron is now typically shown as having a configuration of 12s 2s2 2p6 3s2 3p6 3d6 4s2  http://www.tabulka.cz/english/elements/configuration.asp?id=26 and others
Comment: So "filling first" is ambiguous.  In Iron, 4s is full while 3d is not.  4s tends to be occupied and or also full while 3d is not full as you move across the transition metals.  The electrons that are IN the 4s orbitals of a given transition metal are higher than the electrons in the 3d orbital.  http://www.chemguide.co.uk/atoms/properties/3d4sproblem.html

Ultimately the reason is that the 4s and 3d sublevels are close to each other in energy and depending on the nuclear charge and the exact number of electrons, different orbitals become relatively more or less favorable for the next e-.
Comment: Yes IN IRON (and almost all transition metals) the 3d gets its electrons first and then the 4s if you are literally looking at the energy of the electrons, or stripping electrons and putting them back.  Modern electron configurations now show Iron as 3d6 4s2.

This is not the same as saying that 3d FILLS first because 3d is not FULL for Iron, but the 6 3d electrons in Iron are lower energy, ionize later, refill preferrentially to the 2 4s electrons in Iron.

The misconception comes from thinking that since Mg has 4s2 and no 3ds, that the 4s are lower energy for transition metals.
Comment: You answer the question but include additional information that is wrong, in part because the Aufbau is an oversimlification and in part because Aufbau is WRONG in terms of placing energy levels in a given element.  The best way to correct it is to say that the 3d does not have to have all of its orbitals full for some electrons to go into the 4s.  The ones that are in the 3d still are lower energy than the 4s present in transition metals.  Some sources will still list the 4s below the 3d in Iron.  It depends somewhat on what the order means to you-bookkeeping electrons or ordering energies.
Comment: Transition group is such a fascinating dilemma lol
Comment: So do you mean to say in Iron 3d fills first and then 4s? Can you please elaborate where you think I went wrong.
Answer: Electronic configuration of $\ce{Fe}$ : $\mathrm{1s^2 \ 2s^2 \ 2p^6 \ 3s^2 \ 3p^6 \ 3d^6 \ 4s^2}$
Add the electrons of 3rd shell $\mathrm{3s^2 + 3p^6 + 3d^6} = 14$  electrons
And 4th shell $\mathrm{4s^2}$ contains $2$ electrons.
Answer: According to the Bohr model of atoms, the maximum number of atoms which can  be accommodated in the outermost shell is 8. That's why in the atomic shell diagram the 2 electrons are in the outermost shell.


Having trouble with a simple selection of a layer

Question: I'm trying to select a layer so I can run select > modify, but the modify option is never enabled. Here's a screenshot:
(Oh, and I'm a complete noob to photoshop ... obviously)
Comment: It also looks like you've got your layer mask selected instead of the actual layer...
Answer: To modify something, you need to first have it selected (the animated marquee will show).
To select the shape you must ctrl/cmd click on the layer mask. This will select the layer for you. From there, you can use all the options!
Comment: Yes... and then I stated how you can select it (that's my second sentence)
Comment: I've tried that and it doesn't seem to work. My whole question was about HOW to select and you answered saying 'you first need to select'...
Comment: Thanks. For some reason though that isn't working for me. Aarrg!
Comment: its not working coz you already selected wrong option...
Answer: Your Problem :
Dont select direct selection tool which is this
see in your tools panel left hand side it is selected, when you have to work with paths you can use this, right now you are doing the same and when paths are active you can not modify any shape...in your screen shot your path is active, so you can not modify/can not see the modify option.

When there is marching ants(Marquee Selection) around your shape/layer/anything, you can use your modify
  option, else you can not, so always remember this...

Your Solution :
Select Move tool shortcut key is v icon is this
than go to your layer pallet  ctrl+click on the shape then a automatically selection will appear, see my screen shot.

and for your information by modify option you can not change shape or anything you can change only selection.you can only increase decrease selection  then you have to fill with your desired background
Hope this is clear....
Comment: down voter cant explain reasons?
Answer: Johannes' answer will get you to your goal.  Some more detail is worth noting though.  There is a huge difference between selecting a shape (which you have done in your screenshot) and making a Selection (which will select an area of your canvas).  You ask how to "select a layer" but this is a misnomer because what you really need to do is make a selection with the same shape as your layer.
When you have a vector object "selected", it is just allowing you to move the object or its points.  It is not actually selecting any area of the canvas, just the anchors.
The Select ⇒ Modify command is used to modify a Selection and has nothing to do with vector objects in a layer.  In fact, it has nothing to do with pixels or masks or even layers at all.  A Selection, in this sense, is simply a scoped area of the canvas that you are currently working on.
Making a selection is basic Photoshop and can be done many ways:

Use the Marquee (M) tool and drag out a shape between two points.
Use the Lasso (L) tool and draw a shape between many points.
Holding Ctrl/Cmd and clicking on a thumbnail image (either layer or mask) in the layer's toolbox will make a selection that has the same shape as the layer or mask's contents.  (This is Johannes' answer and the easiest way to make a selection from a layer.)
Pressing Ctrl + Enter when a vector Shape is selected will make a selection with the same shape as the Shape.

You'll know you have a proper selection because there will be "marching ants" animating down and right from any northwest vertex.  If you have a selection and want to hide this animation, press Ctrl + H to temporarily disable the animation.
When you have a Selection, all of the actions you perform will only affect the area of the canvas that you have selected.  Filters, adjustments, drawing, etc. will only affect those pixels within the selection on the current layer or mask.


Dapper and user defined database types

Question: Let's say I have a user defined data type in the database:
MySuperType which as two bigint properties in it (Id + Code)
And I have a stored procedure which takes in those parameters:
@MySuperType, @Price, @dateModified, etc...

Now in my code, I am using Dapper like this:
using (var connecion = new SqlConnection(_connectionString))
{
    result = connection.Execute("SP_name",
                new {mySuperType, price, date},
                commandType: CommandType.StoredProcedure);
}

But I keep getting an error

Type Operand clash: Dapper is not able to map the user defined type: MySuperType from the parameters to the stored procedure.

Changing the stored procedure or replacing the user-defined type isn't an option
Does anyone have an idea what I can do to map the types and send the parameters (all of them) to the stored procedure?
Answer: Tha names of parameters must correspond to parameters defined in procedure:
using (var connecion = new SqlConnection(_connectionString))
        {
            result = connection.Execute("SP_name",
                new {MySuperType = mySuperType, Price = price, dateModified = date},
                commandType: CommandType.StoredProcedure);
        }

Dapper is case sensitive in mapping in 2 directions (as parameters and as results).
If you want to avoid specifying names of the parameters, make sure you have it exactly same in variables in c# and stored procedure.

Dapper and user defined database types


What's the difference between WLED and RGBLED displays?

Question: On Dell's website, it lists displays as being "WLED" or "RGBLED". What is the difference between these two types of displays?
Comment: WLED: ugly colors. RGBLED: flashy colors. :)
Answer: White LED's are actually blue leds with a yellow phosphor, and thus creating an white impression. This technique allows a colour gamut slightly wider than sRGB, but not very "colourfull".
RGB leds consist of 3 individual colour leds, red, green and blue. These allow an enourmous colour gamut that covers most standards like AdobeRGB and NTSC. Panels with RGB LED's are much more expensive, as they need much more calibration logic. It is very hard to tame extreme gamut for say sRGB use, and the ballance of the colours is constantly monitored. RGB LED displays are doing twice the price of WLED's with ease.
Answer: Okay, I'll take a stab at the RGB question. The backlight of the screen used to be cold cathode type bulbs. Think super thin flourescents. The problem is that they were power hungry. The next generation used a white light LED to save on power. The problem is that there is no such animal as a white LED. The LED is actually a yellow LED with a blue coat. Sometimes that creates a slight shift in color. Slight yellow or yellow green tones are common. You display may show this shift with slightly off color images.
RGB uses pure color Red/Green/Blue LED's. When you focus them together, they create a true white light and this focused through the display should create brighter, truer colors.
Comment: It's a blue led with a yellow phospor. Blue is the higher energy light type, and can be converted to the lower energy yellow light, not the other way around.
Comment: RGB is still no true white. It is still producing a peaked spectrum instead of the continuous daylight spectrum. White leds have 2 peaks, a yellow and a blue one, the rgb leds produce a 3 peaked spectrum. A normal (5500K temperature) light bulb still makes the best real white light.
Comment: See http://ledtele.co.uk/whatisledtv.html
Comment: The energy saving on current LED types is still questionable. Most LED monitors have a lower light output, more like 300cd/m2 instead of 400-500 in most modern CCFL screens, and thus having the max output as main reason for energy saving.
Comment: Mixing red, green, and blue together does not really produce white light, it only produces a light that looks white to human beings (not necessarily to other animals) because our eyes only have receptors for these three colors and if all three receptors are equally lit, we "see" white, as real white light would also do that with our receptors, yet this is basically just an illusion for our eyes.
Answer: WLED or RGBLED Displays are misnomers, the pixels are not LEDs but LCDs. So to be correct, we should have (if abbreviation must be used) LED b-l LCD Displays where b-l stands for back-light. Soon we should have 'true' LED Displays. What do you think?
Comment: OLED displays are already here, although it is a very small part of the market so far.  One of my closest friends is a scientist who has been researching the problems with the blue component for the last decade, at DuPont.
Comment: They are no misnomers, as these terms only talk about the backlit and the backlit are true LEDs, either those that emit white light (through a trick but that doesn't matter) or those that mix red, green, and blue light together to give the impression of white light. Nobody every claimed that these terms talk about the pixels on screen.


Control device labels in /dev

Question: I have an HP xw8200 workstation running linux with two small, fast SCSI drives hooked up to the onboard LSI SCSI controller.  The drives get labeled /dev/sda & /dev/sdb in /dev, respectively.  I have a large SATA disk that I want to add to the system to store data, but every time I connect it, it's /dev gets assigned sda & the two scsi drives are assigned sdb,c, which messes with the boot procedure.  How can I get this SATA drive to use sdc?
Comment: Why are you not using labels or UUIDs for boot?
Comment: @churnd You can modify fstab to use UUID or labels, UUID=[uuid] and LABEL=[label] respectively. The UUID can be detected with `blkid` (run it as root). The label can be found with `ls -l /dev/disk/by-label/`
Comment: I am using LVM & that is how fstab was generated.
Answer: You could attempt to use udev (that daemon that controls the /dev filesystem) to write some rules that change the /dev entry for the SATA, and then modify your fstab to accomidate this.
You can find out how to write a udev entry (the page mostly covers USB devices, but that and the man pages should help you get a good idea on how to do it) by following the link above.
HackADay might expand your knowledge on udev rules a little bit as well.

Control device labels in /dev


How to prove two matrices unitary equivalent?

Question: A= $$ \left[
    \begin{array}{ccc}
      2&1&4\\
      0&1&2\\
0&0&1
    \end{array}
\right] $$
and B=$$ \left[
    \begin{array}{ccc}
      2&0&3\sqrt2\\
      1&1&\sqrt2\\
0&0&1
    \end{array}
\right] $$
Is there any method to find if they are matrix equivalent? Or we need to find a matrix S by trial and error such that $$S^*AS=B$$
Comment: First off, apply a permutation similarity to bring $B$ to the form
$$
\pmatrix{1&1&\sqrt{2}\\0&2& 3 \sqrt{2}\\ 0&0&1}
$$
Comment: It seems like the answer will be yes, which I find surprising
Comment: A common trick is to compare $tr(w(A,A^*))$ and $tr(w(B,B^*))$ where $w$ denotes a word on two letters.  So far, $tr(A^nA^{*n}) = tr(B^nB^{*n})$ up to $n=3$.
Answer: Guess: try calculating $S^*BS$ with
$$
S = \frac 1{\sqrt{2}}\pmatrix{1&1&0\\1&-1&0\\0&0&\sqrt{2}}
$$
The idea is that I begin by upper triangularizing $B$ to match the form of $A$, with $2$ as the first eigenvector.


How to list open ports and application using them in windows?

Question: I have trouble identifying the application using port 25 on my Windows-10 system. Any useful hints to list used ports and using applications without 3rd party applications ?
Answer: Without the use of any external software. Open a command prompt:

netstat -abn

OR

netstat -a -n -p tcp -o

Within Task Manager -> Processes/Details Tab
You can match the PID against the result of the second netstat command above, you can then find the image name/end the process etc if required.
There's also plenty of third party applications that can simplify the process and make the information easier to read, simple Google search if you want to find them.
Answer: A GUI solution would be to use the Resource Monitor of Windows. You can start it by pressing START and entering this command: Perfmon /Res
Then you can click on the Network tab to view all network connections, listening ports, etc.
Here is a screenshot of what it looks like:
Answer: Open a command shell and run
netstat -a -n -p tcp -o

No need to run as administrator.
The last column is the PID. You can look up this PID in the task manager. Be sure to activate "show processes of all users" there.
See the documentation for netstat.
Answer: All of you were way behind. A far easier method (was, & still is in 2023) is first to open the Command Prompt.
(can do this by holding the windows logo key on your keybard+Cut&Paste, or just type in these 3 letters> cmd.
So, Winlogo+cmd)
Than type in or Copy(Ctrl+C), & Paste(Ctrl+V)
*To terminate running process:
cmd>TASKLIST
[choose the task you want to terminate,than:]
cmd>taskkill /IM [program name ie:]mswebview2.exe /F
*Typing help in cmd gives options after running something
too.  Sometimes, it may even provide an example,
that's how the above EASY method was obtained-
after very minimal tial & error.
So the very easy way after the tidbits above:

windowslogo+cmd

            TASKLIST

            taskkill /IM [program name ie:]mswebview2.exe /F

EASY METHOD + no "3rd.party" software .)
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: netstat -n from the command line will show you a list of IP addresses and open ports on your computer. A web search would probably be best in determining what is running on a particular port, but here's a few resources you could check open ports against:

https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml

EDIT: user544199's netstat arguments looks to put out some more useful information than mine. I would use that.
Answer: The post requests responses without third party apps, however, others reading this may be more inclined toward a GUI.
For those looking for an application, TCPView seems to work best.
It is microsoft recommended and has a clear and easy to use GUI.
https://learn.microsoft.com/en-us/sysinternals/downloads/tcpview
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: Old now, but I use this powershell (saved as simplens.ps1):
$procs = Get-Process

$ports = netstat -ano
$ports[4..$ports.length] |
    # First column comes back empty, so we set to "ProcessName" as a placeholder for later
    ConvertFrom-String -PropertyNames ProcessName,Proto,Local,Remote,State,PID  |
    where  State -eq 'LISTENING' |
    foreach {
        $_.ProcessName = ($procs | where ID -eq $_.PID).ProcessName
        $_
    } |
    Format-Table


Why is absorption spectrum a line spectrum?

Question: The minimum energy required to excite a hydrogen electron is 10.2 eV. When photons of energy spread over a continuous range of wavelengths fall on a sample of hydrogen, why are only those photons absorbed which have energies corresponding to exact energy differences between the allowed states? For a transition requiring energy $E=h\nu_0$, a photon with frequency $\nu>\nu_0$ can be absorbed, with the remaining energy $\Delta E=h\nu-h\nu_0$ appearing as kinetic energy of the atom. This would result in a continuous spectrum, however - with no missing frequencies.
Comment: From my deleted answer - [The Formation of Spectral Lines](http://wps.prenhall.com/wps/media/objects/610/625137/Chaisson/CH.00.002/HTML/CH.00.002.s6.htm)
Comment: Photons are not only absorbed at exact energies corresponding to exact energy differences between allowed states. Photoionisation happens for energies above 13.6 eV in cold hydrogen.
Comment: If I understand your question correctly, the main point is why a transition at frequency $\omega_0$ cannot accept light at frequency $\omega=\omega_0+\Delta>\omega_0$, with the remainder energy $\hbar\Delta$ being spent to accelerate the atom. The question is a bit unclear and this point is relatively hard to get from it, so it would help if you modify the question to make this clearer.
Answer: What you're describing does happen to some extent.  It's called "Doppler broadening": absorption and emission lines in hot materials are wider (in wavelength) than absorption and emission lines in cool materials, because atoms in the hot material occupy a broader range of velocities.
An atom at rest can't absorb any old photon and convert the extra energy into energy of motion, because such collisions must conserve both energy and momentum.  Let's start with the decay of an excited atom by photon emission.  An $n=1$ excited hydrogen atom at rest has energy
$$E_\text{excited} = m_\text{ground}c^2 + \Delta E \approx \rm 1\,GeV + 10\,eV$$
and decays to a ground-state atom nearly at rest and a photon, with energies
$$
E_\text{ground} = mc^2 + \frac{p^2}{2m} \approx \rm 1\,GeV
 \qquad \it E_\gamma = h\nu \approx \rm 10\,eV
$$
Conservation of energy tells us that
$$
\Delta E = \frac{p^2}{2m} + h\nu
$$
By conservation of momentum we must have the same magnitude of momentum $p$ for the atom and for the photon.  The photon's momentum is $p_\gamma = h\nu/c$, so we get
$$
\Delta E = \frac{1}{2m} \left(\frac{h\nu}{c}\right)^2 + h\nu = h\nu \left( \frac{h\nu}{2mc^2} + 1 \right) \approx h\nu
$$
So you can see that the atom does get a kick from emitting the photon, but it's at the parts-per-billion level of the photon's energy.
You're asking about absorption.  In the center-of-mass reference frame, every absorption must look exactly like the process we've just gone through, only with the initial and final states switched.  If you want your ground-state hydrogen atom to absorb a 12 eV photon, it must be "running away" from the photon so the the Doppler-shifted energy in the center-of-mass frame corresponds to 10 eV.
This is different from elastic collisions between billiard balls, because there is no photon in the final state, and different from inelastic collisions like the "ballistic pendulum" because the atom can only absorb energy from the electromagnetic field, and thus momentum from the electromagnetic field, in specially-sized lumps.

We can be even more specific.  Let's start with an incident photon of unspecified energy and a ground-state atom at rest,
$$
E_\text{ground} = mc^2 \qquad E_\gamma = h\nu
$$
and try to end up with a "kicked" excited atom,
$$
E_\text{excited} = mc^2 + \Delta E + \frac{p^2}{2m}.
$$
From conservation of energy we have
\begin{align}
E_\text{excited} &= E_\text{ground} + E_\gamma \\
\Delta E + \frac{p^2}{2m} &= h\nu. \tag{A}
\end{align}
By the same logic as above we have $|p| = h\nu$ (though now the directions are parallel, rather than antiparallel, since we are not in the center-of-momentum frame), which gives
\begin{align}
\Delta E &= h\nu \left( 1 - \frac{h\nu}{2mc^2} \right)  \\
0 &= \Delta E - h\nu + \frac{1}{2mc^2} (h\nu)^2 \\
h\nu &= mc^2 \left(
1 \pm \sqrt{ 1 - \frac{2\Delta E}{mc^2} }
\right)
\end{align}
This quadratic equation has exactly two solutions: $h\nu \approx 2mc^2$ (a relativistic photon interaction that we're not interested in) and the one we expected, $h\nu \approx \Delta E$.  If we keep two terms in the binomial expansion for the square root we get
\begin{align}
\frac{h\nu}{mc^2} &\approx 1 - 1 + \frac12 \frac{2\Delta E}{mc^2} + \frac18 \left(\frac{2\Delta E}{mc^2} \right)^2
\\
h\nu & \approx \Delta E \left( 1 + \frac12 \frac{\Delta E}{mc^2} \right),  \tag{B}
\end{align}
which is more than the "transition energy" by an extra amount $\epsilon = (\Delta E)^2/2mc^2$.
That's the only extra energy that you're allowed to impart to the atom at rest, and it's required by momentum conservation and small enough to usually be negligible.
Comment: The extra factor of energy is negligible if one visualises this as being gained as kinetic energy by the atom. What if the $\epsilon$ appears partially as kinetic energy of another photon, and partially as kinetic energy of the atom? Writing energy of that photon as $h\nu'$, the momentum conservation gives $\frac{h\nu}{c} = \frac{h\nu'}{c} + p$ (I am retaining symbols apart from $\nu'$ from your answer) and energy conservation $h\nu = h\nu' + \Delta E + \frac{p^2}{2m}$. The solution is the almost the same as yours, only now $h(\nu - \nu') \approx \Delta E$.
Comment: This means photon of any frequency can be absorbed, with release of another photon simultaneously?
Comment: @Charles Sounds like you are asking now about atom-photon scattering, as in [Rayleigh scattering](https://en.wikipedia.org/wiki/Rayleigh_scattering) (without exciting the atoms) or [Raman scattering](https://en.wikipedia.org/wiki/Raman_scattering) (involving low-energy excitations in molecules or bulk materials).
Comment: If you can articulate it a little more clearly, that might make a good follow-up question.
Comment: Does this phenomenon of scattering also occur when atoms are irradiated with light spread over a continuous range of wavelengths? And does this (in accordance with the equations in the above comments) contradict the actual laboratory absorption spectra observations - considering that the absorption spectra observed are line spectra (meaning that only photons of specefic frequencies are absorbed), whereas the equations predict that a photon of any frequency can be absorbed when accompanied by release of another photon?
Comment: Rayleigh scattering occurs for photons of all wavelengths; Raman scattering is more complicated and not really within my expertise.
Answer: The minimum energy to photoionise a hydrogen atom depends what energy level it is in. If it is in the ground state ($n=1$), then that energy is 13.6 eV. If it is in the first excited state ($n=2$) then it is 3.4 eV. Photons with energies higher than this are capable of interacting with the atoms through photoelectric absorption and this does lead to a continuous absorption spectrum with sharp edges at the energies corresponding to the photoionisation energies of the atom in its various states.
For example in "cold" hydrogen, with all the atoms in the $n=1$ level, then there is continuous photoelectric absorption of photons with energies higher than this.
If the hydrogen is warmer, so that an appreciable fraction of the atoms are in the $n=2$ level then there is a continuous absorption spectrum up to the first ionisation edge at 13.6eV (91 nm), then a drop and then more continuous absorption that rises to the second ionisation edge at 3.4 eV (365 nm).
Your reference to 10.2 eV may be confusion with Lyman alpha absorption corresponding to photons that instigate a transition from the $n=1$ to $n=2$ levels. This resonant process is caused because photons at that energy have a high probability of interacting with the atom and causing this transition. Such photons would also be capable of causing photoionisation of atoms in the $n=2$ level. So one would have continuous photoelectric absorption plus a sharp line absorption.
However, if the hydrogen is "cold" such that all the hydrogen atoms are in the $n=1$ state then the absorption spectrum would be (i) a sharp spike at 10.2 eV (121 nm, Lyman alpha), then a gap until 91 nm and then continuous absorption at higher energies (smaller wavelengths). So probably your real question is why is there a gap in the absorption spectrum? The reason for this is quantum mechanics and conservation of energy. The energy levels in a hydrogen atom are quantised. The electron is not allowed to have any old energy. Therefore unless the atom is being excited almost exactly into one of the other allowed energy "eigenstates" or the electron is being photoionised into a continuum of free energy states outside the atom, then the absorption simply doesn't take place and the hydrogen atom is "transparent" to the radiation.
Or, I may have misinterpreted your question. If you are asking why 10.2eV of the photon energy cannot be absorbed with the rest converted into the KE of the atom, then as Chris White says, you cannot conserve energy and momentum simultaneously apart from a unique photon energy that is very close to 10.2 eV. If we let the atom be at rest initially, then conservation of energy and momentum give
$$ E + mc^2 = mc^2 + 10.2 + K$$
$$ \frac{E^2}{c^2} =  2mK = 2m (E-10.2),$$
where $E$ is the photon energy in eV, $K$ is the atomic kinetic energy after the interaction and $m$ is the atomic rest mass.
This gives a quadratic
$$E^2 - 2mc^2 E + 20.4mc^2 = 0$$
with solutions
$$E = mc^2 \left[ 1 \pm \sqrt{1 - \frac{20.4}{mc^2}} \right]$$
For a H-atom with $mc^2 \simeq 939$ MeV, this says that only a photon with energy very close to 10.2 eV  (10.2005 eV) can be absorbed.
Comment: The OP says "with the remaining energy being left over as its kinetic energy" so I think they're envisioning Ly-alpha absorption + giving the whole atom a kick with whatever energy remains in order to conserve energy. This particular scenario isn't forbidden by quantum mechanics but by conservation of momentum.
Comment: To be honest I was hoping you'd work out the details, because I didn't ;) Intuitively I think this is just an overconstrained system (the kick velocity can come from energy conservation or momentum conservation, but they might disagree). If there is no problem, then the question becomes much deeper, because something more subtle must prevent this process.
Comment: @ChrisWhite Backtracking - think I have it.
Comment: There's no relativistic reason that forbids the absorption, cf. [this question](http://physics.stackexchange.com/q/53427). Suppose an atom of mass $m$ is struck by a photon of energy $\hbar\omega$ and momentum $\hbar k=\hbar \omega/c$. Its final momentum will be $p=\hbar k$, its final rest energy will be $mc^2+\hbar\omega_0$ to account for the transition, and its final energy will be $\sqrt{(mc^2+\hbar\omega_0)^2+p^2c^2}$. Energy conservation then demands$$mc^2+\hbar\omega=\sqrt{(mc^2+\hbar\omega_0)^2+p^2c^2}.$$ Some algebra will then give a unique allowed frequency $\omega$...
Comment: given by $\hbar\omega=\hbar\omega_0+\frac{\hbar^2\omega_0^2}{2mc^2}$. Here $\omega$ is the photon frequency measured in the lab frame, and $\hbar\omega_0$ is the energy of the transition in the new rest frame.
Comment: @EmilioPisanty That *is* what I've done. The frequency is of course almost identical to the frequency of the atomic transition.
Comment: Apologies, I misread that part, and then spent more effort into making sure I wasn't wrong than really understanding what you had done. If I understand the differences correctly, you are doing the nonrelativistic approximation of my approach, which surprisingly has more square roots than the relativistic side.
Comment: Oh, bummer, you beat me to it.
Answer: From your question,

An photon with energy equal to or more than 10.2 eV can be absorbed - with the remaining energy being left over as its kinetic energy.

it seems you're asking: if there's an atom with a transition at frequency $\omega_0$, and you have a photon at frequency $\omega>\omega_0$, why can't the atom absorb the photon anyways to excite the transition, and take the extra energy $\hbar(\omega-\omega_0)$ as kinetic energy?
I will address this and not the reason for the existence of discrete lines in the first place. There are two things going on here:

When the atom absorbs a photon of frequency $\hbar\omega$, that photon also has a momentum $\hbar k=\hbar\omega/c$ and the atom also needs to absorb it. This does always happen, but the absorbed momentum is typically very small and the atoms need to be very cold, and hence slow, for this to matter. Indeed, the way you get them that cold is via Doppler cooling, which exploits exactly this mechanism.
For more details on how to describe the momentum kick in photon absorption, in what situations it's relevant, and why it's not in other cases, see How does one account for the momentum of an absorbed photon?
Having absorbed this amount of energy, the atom then cannot absorb any more. It would be conceivable to have a sort of two-step process, where the atom first absorbs the main chunk into its electronic state (plus a bit of kinetic energy), and then deals the rest of the energy into kinetic energy. However, this cannot happen, for two reasons:

The centre-of-mass motion cannot engage with the electromagnetic field, because it is not charged. You need to split the atom up into its charged constituents to get it to interact with the field, and this means exciting internal, electronic transitions. More importantly, though,
even if it were charged (like, say, if you had a $\mathrm{He}^+$ ion), it still cannot absorb any energy from an electromagnetic field. This is fundamentally because of relativistic reasons: a free particle simply cannot absorb the light-like four-momentum of the photon (which means that the photon has no mass, so its energy $E$ and its momentum $p$ are related via $E^2-p^2c^2=0$) without changing its internal state.

This last bit is really the crucial part. If you have a particle with rest mass $m$ and you hit it with a photon of energy $\hbar\omega$ and momentum $\hbar k=\hbar\omega/c$, you'll get the particle going away with a momentum $p=\hbar k$ and a new rest energy of $mc^2+\Delta E$, where $\Delta E$ is the change in internal energy of the particle. The total energy of the system is then
$$
mc^2+\hbar\omega=\sqrt{(mc^2+\Delta E)^2+p^2c^2}.
$$
Doing some algebra, you get that the photon's energy must be
$$
\hbar\omega=\Delta E+\frac{(\Delta E)^2}{2mc^2},
$$
which is bigger than $\Delta E$ by a term which directly describes the kinetic energy from the absorbed momentum. If there is no change in the internal state, on the other hand, then $\Delta E$ and the atom cannot absorb any energy from the photons, which prevents the second step of our clever one-two plan from taking place.
Answer:
(Source.)
Find above the spectrum of hydrogen (without fine structure).
Hydrogen (and all other atoms) can absorb or emit electromagnetic radiation (photons) of energy $E=hf$ that corresponds precisely to the (total) energy difference $E_n-E_m$ between the Quantum Mechanically allowed hydrogen energy levels, which are given by:
$E_n=\frac{-13.6\:\mathrm{eV}}{n^2}$ where $n$ is the Principal Quantum Number.
So if you illuminate hot hydrogen gas with white, visible light, only photons that correspond to allowed total energy transitions are absorbed, in this case belonging to the Balmer Series. These absorptions show up as dark ('missing') parts of the originally white light.
As you can see, the $10.2\:\mathrm{eV}$ (transition from $n=1$ to $n=2$) you mentioned actually belongs to the Lyman Series, which lies in the Ultraviolet part of the electromagnetic radiation spectrum.
Comment: If I understand the OP correctly, he's asking why a transition at frequency $\omega_0$ cannot accept light at frequency $\omega=\omega_0+\Delta>\omega_0$, with the remainder energy $\hbar\Delta$ being spent to accelerate the atom.
Comment: @EmilioPisanty: it's not really how I understood but I could be wrong. I have to admit the photoelectric effect didn't really occur to me, in the context of OP's question.
Comment: Emilio's suggested version is certainly more interesting.
Comment: @RobJeffries: no contest.
Answer: You can understand everything that the hydrogen atom does if you solve the Schroedinger equation in the presence of a weakly oscillating electric field. The solution shows that for a random oscillation frequency (below the ionization frequency), almost nothing happens. But for certain critical frequencies, the wave function ocscillates strongly in resonance with the field. You can interpret this as an oscillating charge cloud.
Now you have to use Maxwell's equations to understand what happens next. An oscillating charge density in the presence of an oscillating field will both absorb and emit energy (electromagnetic radiation) depending on the phase relationship between the oscillating field and the oscillating charge cloud.
Maxwell's equations will then give you the correct rates of energy exchange for both the emission and absorption effects. The hydrogen atom behaves exactly like a tiny classical antenna. It is not necessary to make any ad hoc assumptions about quantization of energy levels.
Answer:
why are only those photons absorbed which have energies corresponding to exact energy differences between the allowed states?

The observation of spectral lines was a surprising observational fact.. The quantum mechanical theory of atomic physics developed slowly, and is a self consistent one, and  describes and predicts a lot more data than spectral lines.
So the answer to "why" is "because" the model fitting innumerable data describes the transitions by photons  of fixed energy equal to  the difference of the atomic levels as the other answers have explained.

An photon with energy equal to or more than 10.2 eV can be absorbed - with the remaining energy being left over as its kinetic energy.

If you are thinking of kicking an electron completely out, ionizing the atom, you have the wrong energy. In this case there can be a continuum absorption , the extra energy of the photon transferred to the kinetic energy of the electron, as another question has answered.

Since its energy changes, so should its frequency.

The interacting photon completely disappears. If it raises the energy level of the electron nothing is left over, and the same if it kicks the electron out, no photon is left over to change frequency.

This would result in a continuous spectrum, however - with no missing frequencies.

There will be a continuum of absorption frequencies over the ionization energy, the electron can be kicked out with continuum photons once their energy is larger thant 13.6 ev
Answer: In simple terms, an electron is both a particle and a wave. Therefore, an electron in an atom must sit in one of a determined number of orbitals.
The same is observed with sound waves. Any frequency is possible for a travelling wave, but a sound wave in a cymbal reflects and "loops back on itself" so it must correspond to one of the cymbal's resonant frequencies. See here https://en.wikipedia.org/wiki/Vibrations_of_a_circular_membrane It's a very rough analogy, yet it has very clear parallels with the various orbital shapes (s,p,d) found in atoms.
In a cymbal, each vibrational mode has continuously variable energy. In an atom, where each orbital is occupied by exactly one electron (or two of opposite spin) the energies are fixed.

A photon with energy equal to or more than 10.2 eV can be absorbed with the remaining energy being left over as its kinetic energy.

Kinetic energy of what? The atom cannot suddenly and arbitrarily change its velocity, as this would violate the law of conservation of momentum. On the other hand, a molecule is able to change the kinetic energy of its atoms by entering a different vibrational state. As vibrational states are also quantised, this results in vibrational fine structure, where the line is split into several lines (which are very close together.) https://en.wikipedia.org/wiki/Molecular_vibration
There is also some broadening of the lines for doppler reasons. An atom moving toward the light source will absorb slightly lower frequency light, and one moving away from it slightly higher frequency light. From the atoms' points of view / frames of refernece, though, all are absorbing at the same frequency.
Comment: `The atom cannot suddenly change its velocity, as this would violate the law of conservation of momentum`, if one completely forgets that the photon also has momentum, that is.
Comment: @Rob Jeffries I already changed to suddenly *and arbitrarily.* The momentum of a photon is entirely dependent on its frequency, so the atom does not have the freedom to dissipate arbitrary excess energy as kinetic energy. That was my point.


Word that means support (in the sense of thinking they will win)

Question: What is a word that means support, in a sense of not actually doing any cheering or rooting for, but thinking that they are the best and will therefore win?
For context, I'm translating a WEBTOON (about a fighting tournament), and one of the characters declares that another character, in terms of strength, is a league above the competition. However, that character gets knocked out in a single blow from the main character. The text that I'm translating is basically a side note kind of thing explaining that that character is embarrassed that the one they were supporting got knocked out in a single punch.
My first thought was 応援, but that's more along the line of cheering/rooting for, and is a bit different. The other is 支持, but that's used more for support for a person's idea/claim. I was also thinking 推薦, but that's more along the lines of nominate, and the character didn't explicitly nominate the other character for anything position, just declared the characters strength is above the rest, and is therefore a strong candidate for victor.
Are there any words that would make sense in this scenario? It's not necessary that it be one word, but ideally, due to space constraints , I'm trying to have the translation be something along the lines of "第三話で----していた[character name]がワンパンされたことを恥じらっている, where ____ is the word I'm looking for.
Comment: Does it have to be one word?
Answer: I doubt there is a single Japanese verb that means "to think they will win", but you can say 勝つと思っていた側, 勝つはずだった方, etc. Or you can perhaps rephrase the sentence and say something like "あいつが勝つと思ってたんだが、まさかワンパンで破れるとは".


As a user, is there any way to change the "confinement" of a snap package?

Question: At least go to "classic". I don't want to sidestep the issue with links or bindmounts...
Comment: It's unclear if you're asking from the perspective of a user or a developer. Please add more details.
Comment: AS a user, added to questoin
Comment: Let's assume that you are asking about changing the confinement only, not about switching channels which is quite easily done.
Comment: @karel Yes, as far as I understand the concepts
Answer: As a user, you have a limited amount of flexibility over how you want individual snaps confined. You can install a confinement: strict snap in devmode, for example:
$ sudo snap install --devmode <snap name>

You can also install a confinement: devmode snap in "jail" mode (i.e. treat it as strictly confined):
$ sudo snap install --jailmode <snap name>

What you cannot do, however, is install a confinement: classic as anything other than classic, or similarly a confinement: <not classic> snap as classic.
This limitation isn't to be annoying, it's because confinement: classic snaps are built entirely differently than confinement: <not classic> snaps, and in virtually all cases running them under another model would result in a segfault or something similar. This has to do with the fact that confinement: classic snaps do not use the core snap as its rootfs/execution environment like the other types of confinement, so it finds things like libc in a totally different place.
In general, I don't recommend taking advantage of the ability to install snaps under different confinement models unless you're utilizing them as a developer testing out your snap. Otherwise you'll be using the snap in a way that is probably completely untested by the snap author, and may or may not work properly.


Is SPIE proceedings publication a real scientific publication?

Question: I have some SPIE proceedings publications. However, in a scientific context does proceedings publication count as a publication?
Comment: In an academic context I would definitely say NO. However, at the research non-profit institute I am at now, they do count Proc SPIE as "peer reviewed manuscripts" when they as the local government and EU for money.
Answer: The SPIE proceedings volumes are generally fairly loosely peer-reviewed conference proceedings volumes.  The quality of the peer-reviewing can vary depending on the organizers of each particular conference.
People do cite papers from these volumes and they're indexed by some research databases including Scopus and Google Scholar, but not Thompson's Web of Science (at least not the last time I checked.)  Like any conference proceedings papers, you'll have to take some responsibility for deciding whether the material is good enough to be worth citing.
You haven't explained exactly what you mean by "count as a publication."  Here are several answers:

Will tenure and promotion committees consider these as publications?  Probably not at the same level as publications in top-tier peer-reviewed journals, but they probably will be considered as conference proceedings papers.
Can you submit a paper for journal publication after publishing it in an SPIE volume?  Probably not, unless the journal paper is significantly expanded.  Publication in one of these volumes typically would count as "prior publication."
Should you cite a paper from an SPIE conference proceedings volume?  Yes, if the paper has useful information.  Readers of your paper should generally be able to obtain these papers if they want to look into the references further.
Is the SPIE a predatory publisher?  I doubt that anyone would argue that it is a predatory publisher.


Does Linux screen slow down a process running remotely?

Question: I am running a process that is uploading a large file to Amazon S3 in a Linux screen (byobu). The programs outputs progress of the upload as it runs (s3cmd). Since the process is running remotely, and outputting to a screen on my local machine, will it run slower?
Answer: It shouldn't (but it could). If all of the buffers between the process and your screen fill up, then it will pause the next time it goes to write data to the console, but that's usually not an issue unless it's absolutely flooding you with output.


need help for alarm

Question: recently i have switched to ubuntu from windows just because i like to explorer new areas but sticked here at ubuntu but there is a problem that i am a heavy sleeper and need alarm that wakes me in morning for my uni i have tried my alarms in ubuntu but couldnt find anyone that wakes my computer from sleepmode or from hibernation is there any software that does that thing
need help please
Comment: An advice please switch off your pc while sleeping ,buy a separate alarm clock or use alarm feature in your mobile phone
Answer: If you don't mind some scripting you can check my answer to a similar question here.
UPDATE: Actually, searching Ubuntu repositories for "wake" found the following application:
wakeup

This package has a complete graphical front end with which a user can
  set an alarm to wake the computer - from poweroff if possible - and
  read a user-defined text. This text can grab relevant information
  (date, time, weather, Evolution schedule and tasks, news from an rss
  feed, number of new email messages, etc.) and speak that as well, or
  play music, all as defined by the user. More capabilities can be added
  to the alarm via a complete and simple plugin system. Supports
  multiple alarms.

Looks like exactly what you want
You can install it using
sudo apt-get install wakeup

or just via Software Center
Comment: That does not seem to work with recent Ubuntu versions anymore. [https://apps.ubuntu.com/cat/applications/quantal/wakeup/]
Answer: Try this link Alarm clock pseudoberries They have a good one on this site.

To get started, press Ctrl – Alt – T on your keyboard to open Terminal. When it opens, run the commands below to install:
Enter code here:
sudo apt-get install alarm-clock-applet

Enjoy!
Comment: But this program is not able to wake up a hybernated/sleeping computer as far as I'm aware...
Comment: Yeah i think Sergey has a good point that you would have to input some code maybe into an API/Kernel to get that to work as i was reading your intro at the top, it looks like your new to linux. So you may have to do some reading, if your not new to it all then you should find what your looking for. :)

need help for alarm


What is the best way to create a database diagram for SQL Azure without having to install SQL Server?

Question: I have a database on SQL Azure and want to create a database diagram for that, but don't want to have to install SQL server and copy the database etc.  Is there any way that I can do it that anyone knows of?
Answer: UPDATE: The database diagrams were added back into SSMS 18.1(link)
UPDATE: the database diagram feature

Deprecated and removed features in 18.0 (GA)
  ...
  Database Diagrams
  https://learn.microsoft.com/en-us/sql/ssms/release-notes-ssms

The feature was also removed from Visual Studio 2019 SSDT.
Original Answer
The latest version of SSMS (as of v16) supports creating database diagrams for Azure SQL databases. You can download it here:
https://msdn.microsoft.com/en-us/library/mt238290.aspx
Comment: The database diagrams were added back into SSMS 18.1
Comment: +1, as does v17.x Tends to be quite slow when adding a large number of tables to a diagram, though.
Comment: _Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission. (Microsoft SQL Server, Error: 15517)_
Comment: I still get same error in 18.1
Answer: SQL Azure databases do not support diagrams in the same way 'normal' on premise SQL Servers do, so you are looking at workarounds or third-party tools.  For example, you could install SQL Server Data Tools (SSDT), pull your model down, deploy to a local 'normal' dev server, create the diagram there.  This would not involve much data so would be lightweight.  Alternately use Viso, Powerpoint, dbForge, Erwin, RedGate, Apex ... paper and pencil etc : )
A little additional research shows Red Gate have recently added more support for SQL Azure and have a free trial, and SQL Power Doc which looks useful and could plug into NodeXL for example.
In summary, the tooling hasn't quite caught up but  you have a few options.


Black Hole / Hawking Radiation: Why only capture anti-particle?

Question: I may have some specifics wrong here.  If so, don't focus on those.  Just focus on the general thrust of my question.
I "understand" (cough) that particle/anti-particle pairs form spontaneously in space.  I understand that they can form near the event horizon of a black hole, and that one particle can fall in, where as the other particle can barely escape.  I understand that an anti-particle will annihilate with a particle.  What I don't understand is why only the anti-particles of these virtual particle pairs fall into the black hole, while the other ones just manage to escape.  Shouldn't both particle and anti-particle have equal chance to be the one to fall in, or just manage to escape?
It seems that there should be an equal chance of either the particle, or the anti-particle, would be captured while the other "ejected."  So it seems that the black hole should be somewhat steady-state as far as mass change with respect to virtual particles.
Explain?
Comment: Your premise is wrong. Particle type doesn't matter whether mass is added or removed.
Comment: I've wondered this for ages.
Comment: I thought that the anti-particle was annihilating with "normal" mass inside the black hole?  No?
Answer:
I thought that the anti-particle was annihilating with "normal" mass inside the black hole? No?

No. First, both particles and anti-particles have "normal" mass (should they have mass in the first place) and "normal" (positive) energy. The distinction between them is either a matter of convention or a question of which type is more common in the universe. Furthermore, for typical-massed blacked holes, the bulk of Hawking radiation would be made of photons, which properly speaking do not even have anti-particles, though one could also say that they are their own anti-particle.

Shouldn't both particle and anti-particle have equal chance to be the one to fall in, or just manage to escape?

Yes, and uncharged ones do. A smaller black hole would radiate both neutrinos and anti-neutrinos, assuming all neutrinos are massive (otherwise, all black holes would do it already), and a sufficiently small (and thus sufficiently hot) one would radiate both electrons and positrons. Very roughly, a black hole will radiate non-negligible amounts of massive particles when the temperature of the black hole is on the order of the particle mass or greater, in natural units.

It seems that there should be an equal chance of either the particle, or the anti-particle, would be captured while the other "ejected."

Correct, with a minor exception that if a hot black hole has electric charge, it is more likely to radiate particles of the same sign of charge.

So it seems that the black hole should be somewhat steady-state as far as mass change with respect to virtual particles.

If either a particle or an anti-particle falls into a black hole, its mass will go up. It doesn't matter. Fundamentally, the "reason" for Hawking radiation is that the vacuum state in quantum field theory is a state of lowest energy, but different observers can disagree about which state is the vacuum. Thus, since particles are fluctuation on top of the vacuum, they can disagree about whether or not there are particles.
I don't think there is a good way to repair the "antiparticle falls in" story except some roundabout appeal to energy conservation: if the escaping particle is real and have positive energy, the one that fell in must have negative energy, and would therefore decrease the mass of the black hole. Unfortunately, that only shows what must happen for the situation to be consistent, not that it does actually happen.
Although with some knowledge of general relativity, one can motivate this slightly further--e.g., for the Schwarzschild black hole, there is energy conservation given by a Killing vector field, which goes from timelike to spacelike at the horizon--so what an external observer considers time/energy would be space/momentum inside the black hole, and momentum is allowed to be negative.
Comment: @Py-ser: I'm saying that whereas an electron an a positron may annihilate each other, that has nothing to do with why a black hole decreases mass through Hawking radiation. A hypothetical particle/antiparticle annihilation inside the black hole would do nothing to the mass, since both have positive energy. You're treating antiparticles as something special in regards to this process, but this is a mistake. A better (though slightly handwavy) view is that *whichever* particle falls in, it has negative energy rel. to an observer at infinity. That's completely different from m/am annihilation.
Comment: I do not understand very well your answer, but most of all your first one: are you saying that an electron and a positron do NOT annihilate each other?
Comment: Thanks @StanLiou, so you've clarified the misunderstanding that both me and the OP made.  So both matter and anti-matter both have positive mass/energy, of which is borrowed very temporarily from quantum fluctuations.  So where does the -ve energy come from when one of the particles falls in?
Comment: @ChrisWalsh I would assume that it comes from the decrease in mass of the black hole.  But one thing that is still unclear in my mind - is this answer saying that a (small enough) black hole radiates matter and anti-matter evenly, or is it preferential one way or another?
Answer: First, I'd like to point out and commend @user83692435's reply which came first and is correct.  Expanding on it:
The image of a virtual particle/anti-particle pair being created and then one of the pair being swallowed by the event horizon leaving the other as real is an analogy which provides a picture of what is happening, but is definitely not correct. Popularizers continue to use it because what is really going on is extremely complex and not easily explainable in words. (And I won't try!)  But here's a link to a technical paper on the subject.
But perhaps the most telling point against the simple explanation is that Hawking radiation doesn't come from the event horizon which the analogy requires, but from the space outside it!
A second point against the Hawking analogy is that the event horizon is enormously deep in the black hole's potential well. For a particle or photon to escape the BH (which Hawking radiation must) it must be created with enough additional energy to escape the BH -- and a BH can be thought of an an object with an escape velocity greater than the speed of light. Wimpy little virtual particles which lost their partner to the BH  would never make it out.
If you'd like to dig a bit deeper, I recommend Sabine Hossenfelder's blog Backreaction which has a long post with many links  to further information. Backreaction is one of the best of the frontier physics popularizing blogs going these days, in significant part because Hossenfelder is an active researcher and a good writer.
Answer: You have slightly misremembered a common (though bad) way of describing Hawking radiation.  Physics popularizers sometimes describe it as a pair of particles being created, one of which is matter and the other of which is negative matter. Or one of which is antimatter and the other of which is negative antimatter.  So your proton escapes and your negative-matter-proton is absorbed. Or your antiproton escapes and your negative-antimatter-antiproton is absorbed. The negative matter (or negative antimatter) shrinks the black hole.
Although this is a common way to describe things for non-physicists, it's a bad way to describe it. It's confusing because it suggests the exact question that you raised: why doesn't the negative matter fly outward, and shrink the first star or planet it hits? Also, negative matter has never been detected. There is no particular reason to think it's a useful construct for understanding black holes. (Though if it did exist, you might be able to use it to stabilize wormholes, which could be very useful).
It's better to describe Hawking radiation as the other answers here have done, without resorting to virtual negative particles.
Comment: "Negative-matter" - what's that then?
Comment: @adrianmcmenamin - all known matter has positive mass. Negative matter would have negative mass and theoretically negatively curve spacetime. It's highly theoretical...like, completely speculative level theoretical. Basically just a "what if?" type thing.
Answer: This explanation of Hawking radiation as virtual particles forming and one particle falling into black hole is an incomplete one. Stephen Hawking originally imagined a path from distant past to distant future and and null geodesic(path of light) travelling it. A black hole is formed in the path of the geodesic just before it passes the place where black hole is formed. It is the last geodesic to do so.
The vacuum is not empty. It consists of some vibrations because of uncertainty principle. This vacuum field is made up of many frequency modes. They keep creating virtual particle anti-particle pair annihilating each other. The anti particle can be thought a vibration in the quantum field having negative frequency, ie, travelling back in time. The black hole formed nudges some frequencies of the geodesic that passed. So the geodesic creates it's fields from remaining frequencies. And as anti particle can be thought of as particle with frequency travelling backwards in time its frequency is always lost to black hole and the field creates a virtual particle from remaining frequency modes.


Initializer vs Constructor

Question: I have heard that the __init__ function in python is not a Constructor, It's an Initializer and actually the __new__ function is the Constructor and the difference is that the __init__ function is called after the creation of the object and the __new__ called before. Am I right? Can you explain the difference better and why do we need both __new__ and __init__?
Comment: Check this link: http://stackoverflow.com/questions/674304/pythons-use-of-new-and-init
Comment: `__init__` *is* a direct equivalent to what other OO languages (especially Java and C++) tend to call a 'constructor'. AFAIK those languages don't really *have* any direct equivalent to `__new__`. But probably exactly because the 'constructor' equivalent doesn't really construct anything (and neither do C++ or Java 'constructors'), Python tends to refer to these both as the actual method names rather than calling *either* "the constructor".
Answer: In essence, __new__ is responsible for creating the instance (thus, it may be accurate to say that it is the constructor, as you've noted) while __init__ is indeed a way of initializing state in an instance. For example, consider this:
class A(object):

    def __new__(cls):
        return object.__new__(cls)

    def __init__(self):
        self.instance_method()

    def instance_method(self):
        print 'success!'

newA = A()

Notice that __init__ receives the argument self, while __new__ receives the class (cls). Since self is a reference to the instance, this should tell you quite evidently that the instance is already created by the time __init__ gets called, since it gets passed the instance. It's also possible to call instance methods precisely because the instance has already been created.
As to your second question, there is rarely a need in my experience to use __new__. To be sure, there are situations where more advanced techniques might make use of __new__, but those are rare. One notorious example where people might be tempted to use __new__ is in the creation of the Singleton class (whether that's a good technique or not, however, isn't the point).
For better or worse, you basically get to control the process of instantiation, and whatever that might mean in your specific situation.
Answer: __init__ is called with an already built up instance of the object as first parameter (normally called self, but that's just a parameter name).
__new__ instead is called passing the class as first parameter and is expected to return an instance (that will be later passed to __init__).
This allows for example __new__ to return an already-existent instance for value-based objects that are immutable and for which identity shouldn't play a role.
Comment: Which class do you refer to when you say that `__new__` is called passing the **class** as the first parameter?
Comment: @HelloGoodbye: the class of the object being built. This can be the same class where you place `__new__` or a class derived from it (in case neither the derived nor other bases listed before this class defined a `__new__`)
Answer: Considering documentation on class customization to more details.
According to that these methods are used in these way: __new__() to create object, and __init__() to customize it.
And as 6502 noticed, __new__ is the special case of static method and gets class as its argument, while __init__ gets object produced by __new__

Initializer vs Constructor


How can I calculate the correct fees for a blockchain transaction?

Question: How can I calculate the correct fees for a blockchain transaction? I use https://bitcoinfees.earn.com/api/v1/fees/recommended. I got hourfee - 88. How can i calculate bytes of transaction?
Comment: Corollary, the Earn.com fee estimates flatlined almost a year ago: https://twitter.com/murchandamus/status/1453367595076407298. You should use something else.
Comment: @Murch ty. so. what should i do?
Comment: You should pick a better source for feerate estimates, e.g. https://mempool.space/api/v1/fees/recommended perhaps?
Answer: For the most part, your wallet software should take care of all this. You should only determine how urgently you need the transaction to be confirmed and pick the feerate, the wallet would take care of the rest. The 88 you mention would likely refer to a feerate of 88 sats/vbyte here, although that sounds like a gross overestimate at the current market conditions.
If you want to manually build a transaction, you need to know a bit more.
Before you build a bitcoin transaction, you know which transaction outputs you are aiming to create. The recipients addresses tell you how much data it'll take to specify each output in the transaction. The transaction header is also mostly constant size, it's 10 bytes for non-segwit transactions and 42 weight units for segwit transactions.
The input side is a bit more complicated, as you usually do not know in advance how many inputs it'll take to fund your transaction. Your wallet may also be able to spend Unspent Transaction Outputs (UTXOs) of various output types which take different amounts of data to include in a transaction.
So, you'll either need to pick the inputs first, then determine their size and calculate the fees, or you can do both in concert, by calculating the cost for each input and deducting in from the UTXO's values before considering them for inclusion.
The actual sizes for some popular output types can be seen in this table:
Comment: I try to do it with python. So, i know only minimal fee and amount of money.
Comment: The minimal feerate for a transaction to get relayed is 1 sat/vbyte. The estimate on earn.com seems to be off by a factor of 20, so I would suggest that you don't use that.
Answer: For Python, may I suggest using the Mempool.space API. You can use their public API or run an instance of their software locally.
Here's is a sample code I've used in the past that should point you in the right direction.


How do I remove quantcast from my sites?

Question: When I use ghostery on chrome, it finds Quantcast, wordpress stats and google analytics on my sites (nathanblack.com and knuckletattoos.com). I have jetpack and google analytics installed, but where is quantcast coming from and how do I remove it?
Comment: Disable all plugins and switch to TwentyEleven. Does it still happen?
Comment: I was looking at nathanblack.com and I did not find any quantcast code in your source (found wordpress stats and GA).
Answer: Quantcast is coming from the Stats component of JetPack.
You can:

Disable Jetpack Stats
Directly block Quantcast, such as via the DoNotTrack Plugin
Answer: I found out Quant.js is also in Jetpack Comments because of the iFrame. What is your opinion about this blogpost of me and do you think I have to look out for other commenting system because I assume they are going to insert it back again (don't know for what purpose)....
So answer to question: also deactivate Jetpack Comments, check out  this post .
Kind regards,
Comment: Hi, Willem, nice catch. Would be better if you included a summary of that forum thread. A Q&A site works differently from a forum, check the [about] page to get the general picture. Welcome to [wordpress.se]!


QuickLook Preview Panel

Question: I'm looking for some examples on how to use the QuickLook preview feature. I have an URL for a file on the hard drive and want to achieve the same functionality as pressing the 'Space' key in finder on a file or folder and get a preview windows on top of all windows.
From what i've read in the quickLook API, QLPreviewRequest returns a preview of the file.
Now the question raises, do i have to design my own window/panel for presenting the preview in or is there a way to do that automatically ?
Answer: The QLPreviewRequest stuff is for writing a QuickLook plug-in.  To present a QuickLook panel from an app, look at the QLPreviewPanel class.
Comment: thank you, will look over that and get back to you with my progress
Comment: Note: QLPreviewPannel is included in Quartz.Framework and not in QuickLook.Framework
Comment: Hi Vlad, I'm looking for a similar solution but am stuck on generating thumbnails when the panel is showing multiple items. Would you mind saying how you tackled that part?
Comment: I only did it for a single item. User was unable to select more than one for preview

QuickLook Preview Panel


moving a used refrigerator

Question: I bought a used refrigerator from a used appliance store.  It was running when purchased, unplugged, and loaded upright onto the truck and has been that way since Friday.  Once it is brought inside the house, does it need to sit for a time before plugging in?
Answer: As it was never on its side, you should be able to use it without waiting.
If it was laid on its side, the manuals tend to say leave it upright for 24 hours before plugging it in.
Comment: I agree, when fridges are laid down the oil in the system migrates out of the compressor an can cause compressor failure, it can also plug capillary tubes. As long as it is moved upright no wait time is needed.+

moving a used refrigerator