How to forge a signature with fixed Z value

Question: I want to forge a signature with a fixed z value, what is the formula to do that
Comment: To the best of my knowledge, the only way to produce a "forged" signature that passes basic scrutiny is to successfully guess the actual private key and sign the message…—@TM: You showed up as an "interpreter" both on that related question by Guest34122123 and now this one again. If you know these people, could you please explain to them that they're wasting our time, and perchance suggest that they come up with a more fruitful pastime?
Comment: And when you say "forge", do you want to forge a signature on a given `z` under a specific public key (for which you don't know the secret)? Or just create a signature under any key on that given `z`
Comment: Hi! What do you mean by the z value? Do you mean the hash of the message being signed? It would be helpful to have a bit more info
Comment: Yes hash of the message being signed
Comment: I think he wants to know if it is possible to forge a signature for a fixed z or double sha256 of the unsigned transaction, without knowing the private key.
Answer: Try applying Occam's Razor. People are storing immense wealth on the Bitcoin network. If it were possible to create a valid-appearing signature for a given message without knowing the private key, any attacker using this technique would be able to steal any funds in bitcoin at will.
Which is the more likely explanation: a) ECDSA is not susceptible to the attack you propose, or b) such an attack exists, knowledge is widespread enough that you can just ask on a Q&A platform to learn about it, but people still keep piling more and more value into Bitcoin, and yet there are no reports of any thefts that fit the characteristics?
Answer: To add to the other answers...
It is obvious that you can't actually forge a signature on a message of your choice, under a public key you don't own. Otherwise the signature scheme is broken and useless.
However, there are some things you can do with ECDSA.
Firstly, given a public key Y for which you do not know the secret, you can choose two random numbers a,b and compute R = [a]G + [b]Y. I'll denote the x-coordinate of R as R.x. Then let s = R.x/b, and you have a valid signature (R.x, s) under public key Y on a z value z = R.x * a/b. Obviously, though, you won't feasibly be able to find a preimage for z under SHA-256 or whichever hash function used, so you haven't really found the message itself, just the hash of it. That is why the hash function is an important part of the scheme, and why you can't trust signatures on random hashes. This was described by Pieter Wuille here.
Secondly, given a valid signature (R.x, s) on a message under a public key Y, you can malleate that signature in certain ways so it is still valid but isn't the same as the original signature. The most obvious way to do this is by simply negating s modulo the order of G, because (R.x, -s) will also be a valid signature. BIP-66 and BIP-141 both discuss malleability of Bitcoin transaction signatures.
Comment: There is a generalization of the s negation: if you have a valid signature (r,s) for pubkey P and message z and r=R.x, then for every value `a`, if r'=(aR).x, it holds that (r',r's/(r'a)) is a valid signature for P and message hash z'=r'z/r. With a=-1 this gives the normal malleability formula. For other values of a, this gives signatures "valid" for message hash without known preimage.
Answer: When third party C wishes to forge A's signature and sign the message m with it, they should follow these steps.
First, it must select an integer k ∈ [1, n - 1] and compute the integer r, as described in the ECDSA algorithm.  Next, it must solve for s the parity s ≡ k − 1 (h (m) + xr) mod n.  However, to achieve this it is absolutely necessary to know the x and the discrete logarithm point Q based on the point P.
The hash function h must be one-way.  Alternatively, an attacking C user could forge a digital signature in the following way:
(A) User C selects an arbitrary integer l and calculates r from the x-coordinate of Q + lP (mod n).
(B) User C sets s = r and calculates e = rl (mod n).
If C can find the message m such that e = h (m), then (r, s) is a valid signature for m.  In addition, the hash function h must be free of coincidence.  Otherwise, user C is forged as follows:
(A) First finds two messages m and m ′ such that
h (m) =  h(m′).
(B)) Next, Ask user A to sign the message m and so this signature will be valid for m ′.
Your question is unclear.


Role of forces in this collision?

Question: Consider two identical objects of equal mass collide with eachother with equal opposing accelerations. Wouldn't  the forces of the objects cancel each other resulting in the objects both comming to a stop? If this is true how can a collision of this nature be elastic if the forces always cancel and the objects come to a stop?
Comment: If they bounce off, it's an elastic collision;  if they stick it's inelastic.
Answer: Take the concept of conservation of momentum.Here, it means that the momentum of the two objects remains constant before and after collision.
i.e.,
m1*v1 + m2*v2 =const
where m1, v1 and m2, v2 are the masses and velocities of the two objects in consideration.
You have stated that the two of them have equal masses and velocities, with the velocities in the opposite directions.
i.e. m1=m2=m
and v2= -v1
initial momentum= mv1 + m(-v1) = mv1 - mv1 =0
so, conservation of momentum states that the final momentum will also be zero.

Case 1:
Elastic collision : If the objects collide perfectly elastically, then both will retrace the path which they came in. Since they have equal masses, by symmetry, they will have equal velocities.
thus again, final momentum of the two objects is
m*(-v1) + m*v1 = 0

Case 2:
Inelastic collision :If the collision is perfectly inelastic (putty is very good for this experiment), they stick together and by symmetry (since they had equal masses and velocities) they would come to rest at the place of collision rather than moving along one of the two direction. (if they did move along a path, it would mean than one of the objects had a higher momentum than the other, which is not the case here.)
So, final momentum here is zero because of the zero velocity of the compound object so formed.
Now, in the question, you should have been clear as to whether the objects had uniform velocity or if they were accelerated.
If they were accelerated, and both by equal forces in opposite directions, such as to increase their relative velocity, use F=ma and v=u+at to obtain the velocity at the instant before the collision.
Even then, the conservation of momentum will hold as it is simply like using a different value for "v"
Answer:
Wouldn't the forces of the objects cancel each other resulting in the objects both coming to a stop?

Kinematics is solved simply by using the conservation laws . In this case conservation of momentum and conservation of energy are active, as you have not introduced angular momentum.
Let us consider the instantaneous impact. The momenta are equal and opposite so they add to zero, the energy is equal and of the same sign so it will add up to twice the energy of one of them. Conservation of energy requires that the energy should go someplace. In an elastic collision this is taken up by each mass going off with an opposite momentum and an equal energy.
This is the elastic case.

If this is true how can a collision of this nature be elastic if the forces always cancel and the objects come to a stop?

They only come to an instantaneous stop and bounce off due to the conservation of energy, unless the objects are breakable or can be deformed. In this case, they may be deformed and the energy is taken up (conserved)  as heat , they may break up into pieces setting up another problem of conservation of energies and momenta, or do both.
Momentum and energy have to be conserved. Conservation  laws are the result of innumerable observations and they have to hold.
Answer: Your mistake is to think that the forces cancel.
You are quite correct in thinking that when you have two objects of equal mass colliding there are two equal in magnitude and opposite in direction forces acting on the two objects.  That is Newton's third law in action.  However those two forces are acting on different objects.  So one object has one of those forces acting on it causing that object to accelerate whilst the other object has the other force acting on it causing that object to accelerate.
In the case of your example because the two masses of the two objects are the same the magnitudes of the accelerations will be the same but opposite in direction.
What happens during and after the collision depends on the objects but during the collision the kinetic energy that the object had must be converted into other forms of energy because there will be a time when both objects are not moving.  The kinetic energy is stored as elastic potential energy - think of the bonds between molecules being little springs and also converted to heat and sound and permanent deformation of the objects in which case the bonds (springs) between the molecules are permanently broken.
In an elastic collision all the energy is stored as elastic potential energy and is recoverable so that after the collision the kinetic energy of the objects is the same as before.  The other extreme is for the objects to stick together after the collision when a lot of the kinetic energy the objects had is converted into heat, sound and permanent deformation.  Obviously there are a whole range of possible collisions between these two extremes.
Because the two forces acting on the objects are equal and opposite and occur for the same time they must apply equal but opposite impulses (forces $\times$ time) on the two objects and this results in the change in momentum of the two objects being equal and opposite.
Looking at the two objects together as a system those forces the objects experience during the collision are internal forces and do not count as external forces.  If there are no external forces acting on the two objects then their total momentum will not change - the law of conservation of momentum - however the momentum of one of the objects can change provided the other object has an equal but opposite change in momentum.

Role of forces in this collision?


What is the difference between realism in locality, and counterfactual definiteness?

Question: I understand the EPR-experiment and the Bell inequalities. I can see how dropping 'locality' solves the issue, and how dropping 'realism' solves the issue (e.g. there are really no hidden variables until you measure them)
But the third option, counterfactual definiteness, I don't understand. What is the difference between counterfactual definiteness and realism exactly?
Comment: @Danu, this is a valid topic here in the *foundations of quantum mechanics* category though not in the *shut up and calculate* category.
Comment: This is a philosophy rather than physics question, and as such it does not belong on this forum. You could try philosophy stack exchange!
Comment: The question reads literally: what is the difference between counterfactual definiteness and realism exactly?
Distinguishing between these two *philosophical* concepts in a matter of philosophy, and philosophy only. This does not mean it is forbidden for physicists to think about it, but I do persist in my opinion that this is off-topic.
Answer: I disagree with Danu. This is a serious question being considered by theoretical physicists involved with the foundations of quantum mechanics.
Counterfactual definiteness is an epistemological property that essentially allows you to ask what-if questions about experiments. For example, in a forensic analysis of a car crash, it might be important to know "Had the driver been going the speed limit, would the accident have happened?" or something of that nature. In essense, as per its name, a theory that possesses counterfactual definiteness allows you to use the information from an actual experiment to determine what would have happened had you changed X or Y about the setup.
Realism is a metaphysical property of a theory, which says that the objects of the theory actually exist in the world. This is in contrast to instrumentalism which says that theories are merely useful tools for predicting results, but we shouldn't take their objects too seriously. As a common example, lets take electricity: does an electron exist? A realist would say yes, and go on to define its properties and experiments that support those properties. An instrumentalist would say no, that the electron is a useful concept that we attach to a particular phenomena, but it has no independent existance. The key difference is in attitude: instrumentalists see theory as the development of ever more pragmatic tools of prediction, while realists see theory as as a series of ever more accurate representations of reality, with each "paradigm shift" (per Kuhn) providing a more nuanced picture.
Answer: This is a profound question at the heart of science.  Indeed no little effort has been devoted to trying to understand whether the mathematics of quantum mechanics are simply a contrivance or reflect reality.  Surprisingly, Bell discovered an experimental method to answer the question and the result is that quantum weirdness is an intrinsic aspect of nature.  God does play dice and determinism cannot be rescued by hidden variables, which do not apparently exist.
Realism is the belief that nature exists independent of anyone's conscious thought or knowledge or observation.   A falling tree in a deserted forest still makes a racket.   The moon is still there when no one is looking.
But in physics, we need more precise definitions.  So to rephrase realism, we postulate that material objects exist independently and also have definite properties which can be measured [in quantum mechanics any individual property can in principle be determined to any arbitrary precision].  And more than that, these properties have only one value at any given place and time and that fact is independent of whether or not we measure them.  Thus even though we don't measure them, they have the single precise value they would have had, if we did measure them.  This is CFD.
We go through this mental torture because the equations of quantum mechanics and the experimental verification of Bell say exactly the opposite.   That is to say generalized realism is still assumed to be correct but CFD is explicitly refuted.   The devil is in the details.
The light from distant stars dims in proportion to the inverse square of the distance as the electromagnetic radiation spreads out along the surface of an expanding sphere.  But photons emitted have exactly the same energy at any distance [hv, where v is the frequency].  We understand the expanding sphere is the wavefunction which is related to the probability of finding a photon.  The photon exists EVERYWHERE on the sphere until it is measured.  So at greater distances we still get constant energy photons, which are detected by single atoms at discrete points, just fewer of them.
The results of shooting electrons at two slits in only predicable is we assume the electron exists simultaneously at many locations at the same time [like ripples on a pond after dropping in a pebble].  A single electron goes through both slits and the single electron, existing at many locations at the same time, repels/interferes with its many selves.  But when the position is finally measured [as a point of light on a fluorescent screen], the electron is always at a particular point.  Indeed, electrons are never measured to be more than point particles but unless we assume they are waves [many simultaneous locations] before that, our predictions don't match experimental results.
And the details are not philosophy but SCIENCE.
Comment: two milleniums of scientists would consider it absurd, that you imply, that philosophy is not science :)
Comment: @Ilja philosophers may think it absurd, but scientists understand how hard it is to experimentally verify a philosophy.
Comment: I don't mean modern philosophers; but I think till Newton, and maybe also a century later, they were proud to call themselves a philosopher; consider it as a joke :)
Answer: Entanglement is a tricky and very subtle concept. Consider a pair of non-entangled electrons.  Each electron is associated with quantum mechanical property called 'spin'. The spin of each electron can be up or down.  If one has no prior information before taking a measurement the probability of electron #1 being spin 'up' would be 50%.  The same for electron #2.  A system that is composed of two unentangled electrons, mathematically, can be considered a formal system that is composed of two discrete, and independent, random variables.
The mathematical equivalent to two entangled electrons would be a system of two discrete random variables, except in this instance the two discrete random variables are not independent. Rather their states must be described in terms of conditional probabilities.
If entanglement is thought of in this manner, much of the 'weirdness' associated with the topic disappears.
Comment: How does it disappear? You are arguing the realist route of dealing with the trickiness, but that is only one way to deal with the issue. The goal of the question was to understand the other ways too. So yes, when thought of in this manner, a lot of the weirdness disappears. But there are other ways to think about it, which were the ones I'd liked to understand with this question.


How to handle questions about reconciling the Bible to history?

Question: In one of my old answers, I challenged the accuracy of Luke with references.  However once could say that Luke is right and the calculations and other references are either wrong OR there was a divine intervention.  When answering questions which can be answered with extra-biblical empirical information, how do we handle the "fundamentalist" rebukes?  I am not picking on fundamentalist specifically, but they were an easy practical example - sorry if I offended.
Comment: OR you can take a different approach altogether, as Narnian's answer did.
Comment: @Mr.Bultitude while I respect Narnian for his intelligence and knowledge on this and other subjects, I find his answer lacking in that it is basically a link only answer with some highlighted information.  I do not believe that you can derive an answer from reading the text that he placed - without following links, etc.  Other obviously disagree with me on this as he has +15.
Comment: Actually, I hadn't followed the links when I upvoted his answer in December. I only did just now when you mentioned them. He summarized the information contained in them in his own words (several paragraphs worth). And it comes down to this: "there is ample evidence to resolve this apparent discrepency when we pull back from the assumption that there was only one census that must be connected between Josephus and Luke." I think he spells out the answer just fine.
Answer: Don't answer questions asking how a contradiction can be reconciled by saying it can't be reconciled. There are some Christians who believe that every contradiction can be reconciled. If you're not one of them, then don't answer the questions directed to them. That's not a valid answer for those types of questions.
Comment: @TheFreemason I don't thing so. That's like answering biblical basis questions with the basis for the opposite belief. There are some Christians who believe that every contradiction can be reconciled. If you're not one of them, then don't answer the questions directed to them.
Comment: @TheFreemason: If there is no answer to the question, the proper answer is not to answer, and let the absence of the answer speak for itself. The absence of an answer *now* does not mean there will always be an answer. Humanity makes new discoveries all the time, and it's a *very common occurrence* that questions on SE *become* answerable months or years after they are initially asked. Even in areas of Biblical research this is possible.
Comment: If there is no reconsiliation, then that is a valid answer if it is backed with facts explaining why.
Comment: Antinomy anyone? Actually, there are plenty of irreconcilable contradictions that Christians admit to, but I know what you're talking about.
Comment: I'm slightly put off by this stance as someone could answer a question without information needed to correctly answer.  For example, without my research on the various eclipses, etc as found in my answer, someone could answer the question blindly.  I'm not exactly sure how to make my argument against this being an acceptable method.  Maybe we need more meta questions for a specific question to reveal more of the problem?  (I'm suggesting that my answer should be in meta)
Comment: @Flimzy did you mean "does not mean that there will always be no answer"?
Comment: @WalterMitty: Yes, I did.


How a takeoff decision point(TDP) for vertical takeoff vehicle is defined?

Question: For a vertical takeoff vehicle like a helicopter, how the takeoff decision point is defined or computed? Look at the snapshot below, seems the height of TDP is related to the rejected takeoff distance?  What is its relationship with obstacles and rejected takeoff distance?
Answer: Short answer
The TDP is part of the takeoff profiles provided by the manufacturer for any category A helicopter. Its height is selected based on helicopter performances determined by flight testing. Profiles includes a back-up takeoff used for small takeoff areas:

Source
In this profile, the helicopter first moves backward to get away from obstacles, following a slope which angle is provided by the manufacturer. Height of the TDP can be increased up to a maximum, in order to meet both the minimal rejected takeoff distance and the minimal clearance for one engine out climb (amber curve), provided the rearward flight is remote from obstacles below (safety zone):

Source

Performance class and helicopter category
Helicopters are required to operate under a performance class, which determines how safe the operation is in case of single engine failure (OEI = one engine inoperative). TDP is associated with performance class 1 (PC1), which imposes a safe takeoff phase, with a safe climb in OEI after passing the TDP, and a safe rejected takeoff (RTO) prior to the TDP.  PC1 TDP plays a role similar to V1 for in balanced field takeoff for planes.

Source
PC1 operations are usually required by local regulation for 20+ passenger helicopters  and/or IFR operations.
Helicopters belong to two certification category: A and B. A helicopters are those able to perform in PC1. For these aircraft the manufacturer provides takeoff profiles including a TDP. There are often three profiles: Runway takeoff where the helicopter leaves the ground in a short vertical climb before flying forward over a clearway, back-up takeoff where it flies up and backward until reaching the TDP, and then flyes forward above obstacles, and a vertical profile to takeoff from elevated helipads (like tower roofs) with low visibility on the lift off area.
The principle with these profiles is the pilot is always able to abord the takeoff before reaching the TDP, and always able to climb after passing the TDP.
By using the back-up profile (example), the helicopter can increase its height while maintaining the RTO distance to the FATO (final approach/takeoff area). After reaching the TDP, the helicopter can fly forward clear of obstacles to gain speed and reach VTOSS.
Regulation for Category A in the US
As an example of regulation requiring the TDP to be defined, let's take US/FAA. This regulation is based on recommendations from ICAO Annex 6, Part 3, from which this diagram is taken (10.7m = 35ft):

From FAA AC29-2C:

Category A takeoff performance must be scheduled so that:
(1) If an engine failure is recognized at the Takeoff Decision Point (TDP) or at any point in the takeoff profile prior to attaining TDP, the rotorcraft must be able to land safely within the established rejected takeoff distance.
Flight testing to determine the Category A rejected takeoff distance is very similar to height-velocity testing and should be approached with caution.
(2) If an engine failure is recognized at the TDP or at any subsequent point in the Category A takeoff profile, a continued safe climb-out capability must be assured. The continued takeoff for conventional Category A runway profiles is designed to allow acquisition of the takeoff safety speed (VTOSS) at a minimum of 35 feet above the takeoff surface and a positive rate of climb
Comment: Thanks for clarifications, if I understand correctly that higher obstacles requires higher TDP to clear the obstacles, higher TDP requires longer reject distance, so how the reject distance could be computed then?
Comment: TDP is part of the manufacturer takeoff profiles. For an [example see page 7](https://www.icao.int/APAC/Meetings/2016%20Annex14VII/ICAO%20Bangkok%202016%202-Physical%20Char-Surface-Elevated.pdf). The height can be increased, and a back-up takeoff can be used if this is not sufficient. With the later, the TDP can be moved along a slope, which angle is given in the profile. This allows to find the location meeting both obstacle clearance and rejected take off distance. [More examples](https://www.casa.gov.au/sites/default/files/advisory-circular-133-01-performance-class-operations.pdf).
Comment: Excellent answer, but really isn't the graphic and explanation contained in the question a condensed version of this?  (you even included three very similar versions of the same profile view!)
Comment: @MichaelHall: Thanks for the feedback. I've restructured the content.


Does a Lich need spell books to relearn all spells after rejuvenating?

Question: If someone takes the phylactery of a Lich, and carries it off, and then someone else "kills" the Lich, it reappears near the phylactery.  But if the Lich is basically a wizard, then wouldn't it have to relearn all the spells?  In that case, if the spell books weren't around (the phylactery wasn't in the lair after all), then what powers does the rejuvenated Lich have?  Would it then have to go back to the lair for the books?  When a Lich travels, it must at least carry a copy of the books, right?  Those books would be left behind with the newly destroyed Lich, I would imagine.  Just trying to think through how all this might play out.
Answer: No, the rejuvenated Lich should still remember all its prepared spells
There is no rule that states that a character forgets their prepared spells if they are killed, and no rule that states they cannot remember them upon being resurrected, either. A wizard's list of prepared spells only changes if they decide to prepare a new list after a long rest or some other effect specifically alters the list - dying, and coming back to life, has no effect on the list. Likewise, when the Lich rejuvenates into a new body, it should remember all the spells it had prepared before it was destroyed, since there's no rule that states it forgets them. It should even retain any unused spell slots it had when it was destroyed.
Previous editions did have some rules to this effect, specifically that in 3/3.5e a spellcaster revived by raise dead has a chance of forgetting some of their prepared spells:

A character who died with spells prepared has a 50% chance of losing any given spell upon being raised [...]

But language like this is notably absent from all the resurrection-type effects in 5e.
Answer: No
Once you have prepared a spell it stays prepared. Death doesn't change this either in general or for a lich specifically. A lich would only need their spellbook if they intend to change their prepared spells.
Comment: thanks!  now this would have been different in versions prior to v5, right?  there the Lich would have to re-memorize any spell cast, but might not have any spell books handy.  am I thinking about that right?


How to preview files using Gloobus-Preview?

Question: I'd like to preview files using Gloobus-Preview in Ubuntu 11.10 but I can't figure out how to do it. And I don't want to use gnome-sushi...
Comment: i tried the same thing today without any luck so far.
nautilus integration was no success, i tried defining keyboard shortcuts, thought i could maybe just "open with" /usr/lib/gloobus-preview or just gloobus-preview with no luck. i also tried installing marlin (which worked) and defining the default previewer with dconf-editor (apps/marlin/preferences/previewer-path) both paths as above, no luck either. the only thing i can do with it is launch it straight from the terminal. =/
if anybody could help out that'd be great.
Answer: It appears a solution was just posted over at Web Upd8. Gloobus-Preview now has a new package called gloobus-sushi meant for this purpose.
In summary, you'll need to run the following commands:
sudo add-apt-repository ppa:gloobus-dev/gloobus-preview
sudo apt-get update
sudo apt-get install gloobus-preview gloobus-sushi libgdk-pixbuf2.0-dev

Answer: if you have Thunar file manager you can use gloobus-preview by setting a custom action:
first, download gloobus-preview:
sudo apt-get install gloobus-preview

then, in thunar set a custom action in menu -> edit -> configure custom actions
Name: Preview file
Description: preview the file using gloobus
previewCommand: gloobus-preview %f
In the appearence and conditions tab select all the checks.
For access to gloobus preview unfortunately you need use right click
menu in the latest options. Now if you want to preview a file right
click it and select the custom action.
Comment: is there no way to just tap a key on the keyboard a la `quicklook` on macos?


Do any powers use the percentile dice anymore?

Question: The "percentile", or "10d10" dice are still found as a standard component of most polyhedral dice sets.  But, I've yet to see use of them in my (albeit limited) experience with D&D 4e.  Are there powers or other rules I'm not aware of, that still use these?
Comment: I've seen it written as **d%**
Comment: I've never seen the 'tens' d10 called a 10d10 (cuz that means roll 10 ten-sided dice and sum them).

I realize you mean a regular d10 plus a d10 labeled 00, 10, 20, 30, ... 90.
Answer: Nope, not in the WotC books, anyhow. It's possible that someone slipped a percentile dice requirement into a third party supplement, but there aren't even tables that use percentile dice in WotC's stuff. The new red box Starter Set comes with six dice -- no d10 with extra 0s after the digits to serve as the 10s digit.
Comment: Koplow Double Dice! Check it: http://www.koplowgames.com/page31.html
Comment: Somehow I hadn't realized that.  It's kind of sad, although I suppose Platonic solids purists are happy.
Comment: Sadly I can't use my nifty nested percentile die now.
Comment: @C. Ross: Nested percentile die?
Comment: Those are totally geektastic!
Comment: :-( I'm gonna miss d100.
Answer: The Official Dungeons And Dragons Dice Set only comes with 1d10, so... I think that's a pretty good sign that it's officially depreciated from use.
Answer: I played the new Gamma World 7th ed.(at Amazon) as a one-shot this weekend and I had to roll percentile dice for the first time in a very long time, possibly since 2nd ed. Gamma World is based on D&D 4e, but quite scaled back (no healing surges, no daily powers, no bull rush) and a little weird. From WotC:

The D&D Gamma World Roleplaying Game offers hours of rollicking entertainment in a savage land of adventure, where the survivors of some mythical future disaster must contend with radioactive wastes, ravaged cities, and rampant lawlessness. Against a nuclear backdrop, heroic scavengers search crumbled ruins for lost artifacts while battling mutants and other perils....[Gamma Wold] is a complete, stand-alone roleplaying game that uses the 4th Edition D&D Roleplaying Game system as its foundation.

The percentile rolls were part of rolling for my equipment during character creation. I rolled a '1' on the random equipment table which meant "roll twice on the Ancient Junk table" and the Ancient Junk table needed a percentile roll. So I rolled a 70 and a 12 and acquired:

12 - a twenty pound dumb-bell
70 - a gas grill (with a tank of propane)

I wound up playing an 8' tall stuffed teddy bear that threw the dumb-bell as its heavy two-handed ranged weapon and gave bear hugs to bad things. I had a blast. :)
Answer: The explanation of "Game Dice" on p8 of the PH includes the following,

You can use d10s to roll percentages,
  if you ever need to. Roll 1d10 for the
  "tens" and 1d10 for the "ones" to
  generate a number between 1 and 100.
  Two 10s is 100, but otherwise a 10 on
  the tens die counts as 0—so a 10 on
  the tens die and a 7 on the ones die
  is a result of 7 (not 107!).

I'm still searching for an example of where they are needed though!  Good question :)
Answer: I still use them behind the screen for a lot of things but nothing that I can think of in front of my players.  In the few cases were I might want to represent a random effect, I can "round" the odds to fit within one of the standard dice types.
Answer: Not an official use, but our DM rolls percentage dies on all critical failures(PC and monster, weapon and skill checks). If he rolls a 90+ you get to reroll the die. 10% and below something bad happens. It adds a bit of randomness...and gives the percentage die some love as they do often feel neglected.


Does it affect our credit score if we refinance one mortgage and apply for a new one within a short span?

Question: We're considering moving from our current home by purchasing a new one prior to selling the old one. However, we refinanced the loan on our current home less than a full year ago (approx 9 months ago). Since we will need to take out another loan for the new home prior to selling our old home (and using the proceeds to pay off the old loan, of course), would this affect our credit score in any way?
Answer: Anytime you have a hard pull on your credit, it will negatively affect it, but the impact is fairly minor compared to other things.
http://www.myfico.com/crediteducation/questions/inquiry-credit-score.aspx
Comment: Interesting, it says "Time since credit inquiry(ies)" is a factor though it is not clear how significant. Thanks.
Comment: Credit inquiries fall off your credit report after 18-24 months. Unless you applied for 10 credits in the last two years, it is nothing to worry about. A hard pull reduces your credit score by a few points. Since your credit worthiness is in a range... unless those few points put you in a lower bracket, it is nothing to worry about.


How do I find the recurrence equation solution for $T(n) = T(n-1) + n + 2?$

Question: Okay so I am supposed to find the recurrence equation of $T(n) = T(n-1)+n+2$, where $T(1) = 1$. I know the answer should come out to be $\dfrac12(n(n+5)-4)$ but I don't understand how to get that answer.
Answer: You have
$$T(k)-T(k-1)=k+2$$
Summation of both sides from $2$ to $n$ gives you
$$T(n)-T(1)=\sum_{k=2}^n(k+2)=\sum_{k=4}^{n+2}k=\frac{(n+6)(n-1)}{2}$$
$$T(n)=1+\frac{n^2+5n-6}{2}$$
$$=\frac{n^2+5n-4}{2}$$
$$=\frac{n(n+5)-4}{2}$$
Comment: What is k? why is it equal to 2? I am having real trouble understanding it, but that's mainly because I suck at math, thanks for the quick response though!
Answer: Hint: Consider $a_n=T(n)-T(n-1)$ for $n\geqslant 2$. How can you express $T(n)$ in terms of $a_n$, $a_{n-1}$, $\dots$, $a_2$?
An alternative, since you know the solution, is to prove the formula by mathematical induction. That's less satisfying since you may not know the solution next time you'll face a similar problem.


Prove projection of a computable function is computable without using Church-Turing Thesis

Question: Let $R(x,y)$ be a computable relation. I want to prove that for any fixed $y$, the set $S_y$ defined by $S_y := \{ \; x\;  | \; R(x,y) \; \}$ is computable. I know this can be reasoned with the Church-Turing Thesis, that is take a total TM $M$
which computes $R$ and create another TM with $y$ hardwired that then simulates $M(x,y)$. However, I was wondering if a more formal proof is possible.
Answer: This is fairly trivial. For a fixed $y$, we can clearly produce a Turing machine $T_1$ which, given an input of $x$, will write out $x, y$ on the tape. Because $R$ is decidable, there is a Turing machine $T_2$ which, given $x, y$ on the tape, decides whether $R(x, y)$. Then $T_2 \circ T_1$ will, given $x$, decide whether $x \in S_y$.
I do not understand how the Church-Turing thesis, which is a non-mathematical claim, is relevant here. All that is required is a straightforward application of the definition of "computable", a term which is mathematically well-defined.
Comment: However, this depends on the machine $T_1$ having ""knowledge" of $y$ built into it. I'm wondering if there is a way to establish that $S_y$ can be computed independent of such a construction, that is independent of composition with $T_2$.
Comment: @Ari I do not understand your comment. Obviously, our Turing machine will need to have knowledge of $y$, since $S_y$ depends on $y$. Furthermore, your second sentence indicates you have an issue with $T_2$, but this is the part of the construction which does not require knowledge of $y$. I'm unsure what it would mean for the computation to be "independent" of another computation.
Comment: My point was this: I totally agree with you. I'm just interested in if there is another proof that does not use simulation to show that derived language $S_y$ is computable for any $y$. An analogy for what I am after is like finding a proof that non-computable sets exist through a method that does not rely on the diagonal argument of the Halting Problem. And there is one in that case: A counting argument (countably many Turing Machine programs vs. uncountably many subsets of $\mathbb{N}$). The diagonal proof gives more insight but the counting argument is still good enough in this case.
Comment: @Ari Your example doesn't make much sense to me, since the proof that $2^\mathbb{N}$ is uncountable is itself a diagonal argument. You're just pushing back the diagonalization one step.


Is F even or odd, what is the period of it?

Question: $$F(\theta)=\sin(\theta)\int_{-l}^{l} e^{-ikz\cos \theta} h(z)\,dz$$
We know that $F(\theta)$ is defined on $0\le \theta \le \pi$ and $h(z)$ is defined on $|z|\le l$
What is the period of $F(\theta)$?
Is $F(\theta)$ even or odd?
What if we change the dummy variable $z$ in the integral? does it affect the aspect of being even or odd of the function?
Is the function $e^{-ikz\cos \theta}$ standalone even or odd for variable $\theta$?
I know the even function is $F(\theta)=F(-\theta)$ and odd function is $F(\theta)=-F(\theta)$ but I am confused in this particular example!
Thanks in advance
Comment: @charlotte: please ask such questions.
Comment: @FreeMind: For $F(\theta)$ to be even or odd, it must be defined on a domain symmetric about $0$ since questions about oddness and evenness depend on comparing $F(\theta)$ and $F(-\theta)$. This cannot be done on $[0,\pi]$.
Comment: is z a real or a complex variable?
Comment: $z$ is real, but it might be complex, don't ask such questions, suppose we're not sure, answer in both cases!
Comment: @FreeMind: "don't ask such questions"? It seems reasonable to assume that $z$ is real, but prudent to ask (since $z$ is often used for a complex variable). However, if $z$ is complex, then issues of the path of integration arise that will need to be answered.
Answer: The integral, being a function of $\cos(\theta)$, is an even function of $\theta$. Multiplying an even function by an odd function, $\sin(\theta)$, gives an odd function. Therefore, if the domain were extended to $[-\pi,\pi]$, then the function would be odd.
Since $\sin(\theta)$ and $\cos(\theta)$ have a period of $2\pi$, $F(\theta)$ will have a period which is an integral divisor of $2\pi$.


Big capacitor near input power connector

Question: I observed that every brushless motor controller has a big capacitor in the design. (1000uF to 3300uF). How is this value choosen and what happens if I eliminate the capacitor in my design ?
Comment: On such a "cheap Chinese" module as in the photo, the capacitor choice was probably a compromise between: price / works with most motors / price / fits on PCB / price. Yes I know I mentioned price 3 times. So not really a real "design choice". Making a proper design choice isn't even possible without full details of: the motor, load on the motor, supply feeding this module and maybe some other requirements.
Comment: What is the input power, voltage and current requirements for that inverter? Without a circuit or a decent specification, this is pointless answering.
Comment: 36V,300W and around 5Amps
Comment: That's only 180 watts - maybe link to a data sheet.
Comment: If you don't understand the purpose and choice of this cap, you should not be designing this. A motor rating does not include the typ. 10x current start surge so RdsOn DCR, ESR must be computed with care.
Comment: Critical parameters for Cap characteristics  ultra-low ESR, 105'C rating min , ripple current rated  for rapid speed changes at RMS surge value.  C value depends power source
Answer: Most motor controllers are switching 10's to 100's of Watts of power. To avoid voltage drops on the line input from wire inductance, it's advisable to have some kind of energy storage on-board to smooth out voltage switching noise.
You can calculate how much filtering is needed
Comment: You mention 2 reasons for a capacitor: to avoid voltage drops and to smooth out noise. But I think you don't use an "energy storage" cap to smooth noise. You would use small low ESL/ESR caps for that.
Comment: I wasn't quite clear on that, I wasn't suggesting that an energy storage cap should be used, but that caps are for energy storage as they are one of the two circuit elements the can store energy. We don't have voltage and ripple requirements or how much current is switching.
Answer: In addition to the other answers regarding supply line filtering, the energy storage function of the capacitor also operates if the motor controller is capable of "braking" the motor. In that case, the motor kinetic energy is dumped onto the supply rail.
If there is enough inductance in the supply leads, this energy can drive the input voltage level above the rated operating voltage of the module, and potentially damage the module.
The capacitor absorbs that dumped energy, protecting the module.
Nanotec and Moog, for example, specify such a large capacitor externally on the rails of some of their motor controllers for this purpose.


How to identify what type of request is coming

Question: I have a class with @restresource. To which a request is coming to insert the record. How can we identify what kind of request is coming in. Is it XML or JSON format. Is there any way to identify incoming request. Please help me if is possible.
Comment: Have you checked content-type of request?
Comment: Why do you want to know  ?  The abstraction salesforce offers implies that you shouldn't be needing to look at the low-level technical stuff. By explaining what you're trying to do, we can usuelly give you a better answer.
Answer: Unless you are working with the raw content, any parameters that your REST method has Salesforce will automatically attempt to de-serialize from the request body, so you wouldn't need to know the content type in that scenario.
If you do want to work with the raw content, then to determine the type you'd need to inspect the request object:
<code>RestRequest req = RestContext.request;
String contentType = req.headers.get('Content-Type');
</code>
See Apex REST Methods and RestRequest Class documentation for more info.
Answer: Not sure about the method but type of request, JOSN or XML, should be predefined in data contract itself.


How does backpropagation learn convolution filters?

Question: I've understood how the backpropagation algorithm uses the partial derivatives of the weights to train a normal neural network. However, I cannot quite understand how the algorithm changes the filters. Is it in the same way i.e. does the backpropagation algorithm find the derivates of the filters?
Answer: First of all: 1) The filters are the weights, 2) As justin pointed out, backpropagation is simply a method for computing gradients. You update the weights using another optimization algorithm such as gradient descent. Gradient descent updates the weights at each time step. It updates the weights using the negative gradient of the loss function. The partial derivatives that are being calculated are not those of the weights, but of the loss function with respect to the weights:
$$
w_{t+1} = w_{t} - \epsilon \frac{\partial \mathcal{L}(w)}{\partial w} \\
$$
Comment: Nit pick: even though back propagation has been used with gradient descent all the time, it is actually an efficient way to calculate the gradients. Whether gradient descent is performed afterwards or conjugate gradient or rmsprop or whatever is not important.
Comment: You're right. It depends on whether he was using backpropagation to mean only the calculation of the gradient for later use in gradient descent, or another optimization algorithm as you've suggested. Or, if he was using it in a more casual and general sense as a learning algorithm. Either way, I've updated the post to clarify.


Best graphics card brand/ drivers for gaming on Ubuntu?

Question: I'm making up plans for when I eventually want to build my own gaming desktop with Ubuntu installed and use the steam client Linux version. The only thing I'm having problems with is what are the best type of graphics cards/drivers for Ubuntu? Other words, which company has the best support for developing the graphics cards/drivers that are used on Ubuntu? Should I choose AMD,Intel,or Nvidia for my graphics card?
Comment: This question appears to be off-topic because it is asking for shopping recommendations.
Answer: I'll try to answer, knowing I risk flames because this is mainly based on personal experience. I tried to approach all GPU providers with an open mind when I was evaluating them though...
This is my understanding at the moment:

Intel supports open source drivers for Linux (which is nice), but the HD2500/HD4000 graphics on the CPUs is only good enough for low settings or "facebook games".
AMD GPUs are good value, but have problems with drivers. They've only recently in the past few years started (actively?) supporting open source drivers (which is nice), but the open source driver isn't quite "there" yet. The proprietary driver(s) also have problems: I fought with them for a couple of weeks with a HD7770, but in the end I gave up because I couldn't get it to work properly. Other people's mileage seems to vary though.
nVidia doesn't support open source (to my knowledge), forcing the "nouveau" open source driver to be reverse engineered. As such, it lacks some access to certain processing features on the cards. The proprietary driver, while not perfect in that it still has tearing and things, is easy to install and is pretty close to "just works".

I'd really, really wanted the AMD card to work, but it broke me. I've settled on nVidia because of the convenience...for now.
Comment: I only have one complaint with this and that is Intel HD 3000/4000 graphics, though considered low end on today's standards, are actually efficient for gaming. That aren't very graphic intensive, so no "crysis 2 or skyrim" style graphics. However, playing the average game, to use valve examples: Portal 2, gmod, counter-strike, they are plenty effective. I just wanted to offer a bit of insight, seeing as portal 2 and a "facebook game" are two totally different things when it comes to gaming. Otherwise, though this is based on personal experience, I find it fairly accurate.
Comment: @Casey: I did say "low settings _or_ facebook games". Perhaps "low-med settings and/or low resolution games" would be preferable?
Comment: I apologize, that's my fault. I misread it as "low settings facebook games" I seemed to have missed the "or" in your statement, but medium or low-medium settings seems more accurate, but that actually varies on the game. Otherwise, +1 in my opinion.
Comment: I may stand corrected too: Haswell's HD4600 may be a reasonable option on a budget: http://semiaccurate.com/2013/06/10/intels-hd-4600-graphics-another-review/


Regex Function in salesforce

Question: Could any of you pls explain the following code. For eg., Why D,d is used for?
<code>NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
</code>
Answer: The double backslashes are used because of Java's string escaping rules. The pure regex means:
<code>\D*?   # Match any number of non-digit characters (the "?" is useless here)
(      # Match...
 \d    # a single digit
 \D*?  # optionally followed by any number of non-digits (again, useless "?")
){10}  # Repeat the previous group 10 times.
</code>
So this regex matches any string that contains exactly ten digits (plus any number of other, non-digit characters).
Answer: If you're using the REGEX from the example in Salesforce, it's useless. It matches "this1234567890that" where "this" and "that" can be any value. I used: NOT( REGEX(Phone, "\([0-9]{3}\) [0-9]{3}-[0-9]{4}|\d{10}")) to accomplish the desired behavior.
My version translates to:
<code>\\(      # Match '('
[0-9]{3} # Match 3 digits
\\)      # Match ')' followed by a space
[0-9]{3} # Match 3 digits
-        # Match hyphen
[0-9]{4} # Match 4 more digits
|\\d{10} # or match 10 digits instead of all the previous
</code>

Regex Function in salesforce


In your experience, how well do NPN SPICE models replicate real DC current gain

Question: Title, I'm currently running some simulations and noticed that my DC current is in the very rough ballpark of datasheet parameters. Is this normal or does it indicate there may be something wrong with the circuit itself. This is not a question on any particular circuit I am just trying to expand my knowledge on simulations vs. reality.
Comment: What transistor? If you identify it and post the SPICE model it would be useful.
Comment: Say what.. the simulation matches the datasheet and therefore you think something is wrong? Or is this some alternate-universe meaning of "in the right/same ballpark"?
Comment: @pipe I mean the DC current gains are wrong for the biasing but never exceed or dip below the max and min expected. Like at X bias it'a 300 and at Y bias it's 30 but they aren't really correct at the bias points I set it to. But never leave that range.
Answer: Look at the datasheet of a typical transistor, for example the P2N2222A
Notice look at the specified value of the DC current gain.
See how only minimum values are specified. Only for Ic = 150 mA, Vce = 10 V is there a typical value specified. For that condition the DC current gain is guaranteed to be higher than 100 and is expected to be typically around 300.
That's a factor 3 change !
This is "normal" for most transistors. The DC current gain is largely determined by Base thickness and Base / Emitter doping concentrations. These are all somewhat difficult to control in manufacturing!
Only if the manufacturer would measure each transistor and sell it as having a DC current gain being within a certain range could you get a more predictable value. This "binning" isn't usually done as it is expensive resulting in expensive components.
Furthermore: it is simply not needed !
It is much easier to just design the circuit such that it can support even the minimum DC current gain. If the transistor then has a higher gain the circuit design would be such that this will not change anything.
I'll be blunt: a circuit which relies on one or more transistors to have a specific (a value within a narrow range) DC current gain isn't a good design. Almost all common circuits only need a DC current gain above a certain value, as long as the transistors meet that requirement, the actual value of the DC current gain is irrelevant.
Most transistor models just model the typical value of the DC current gain. There might be an option in your model and/or simulator to simulate the extreme ("corner") values as well. But again, if your ciruit, even in the simulator is dependent on a transistor's DC current gain, you should consider changing the design such that it does not rely on this transistor property.
Example: you could amplify a current using an NPN, then the amplification factor will change "all over the place". A current mirror using many transistors in parallel (with emitter resistors) will be much better. Next step better: an opamp based circuit using resistors to do accurate current amplification.
Comment: Consumer electronics often uses binned transistors, to save a bit of money. For example 2SC1815Y where the Y indicates hFE of 120-240 ('only' a 2:1 range). They have good enough control over the parameters that there is not a significant price premium for that level of selection.
Comment: I see thank you, this is the sort of confirmation I was looking for. This particular situation wasn't critical for any design just something I've noticed and I've been told time and time again to be wary of simulation results as they don't always reflect reality. I was just looking for some insight into how I should interpret the datasheet.
Comment: @Bimpelrekkie Well said.


When do I need to use ViewState

Question: I am confused in how to use ViewState in C#, for example what is the benefit of using:
ViewState["VST"]="Value1";

Lable1.Text= ViewState["VST"].ToString();

Whereas I can use:
string container= "Value1";
Lable1.Text= container;

Answer: Your ViewState consists of variables that are kept with the post-backs of your page, because they are sent to the client and the client sends them back with the entire page.
Hence, if you do:
string container= "Value1";
Lable1.Text= container;

Then the users sees the page and hits the submit button, your container string will not exist.
If however you uses the ViewState, ViewState["VST"] will still have the value as it will be "refreshed" when the user submits and sends the page back.
Read more here and also understand the ASP.NET page life cycle.
Answer: As per documentation:
View state is used automatically by the ASP.NET page framework to persist information that must be preserved between postbacks. This information includes any non-default values of controls.
You can also use view state to store application data that is specific to a page.
For details see a link:http://msdn.microsoft.com/en-us/library/bb386448(v=vs.100).aspx
Answer: If you want to persist the values after postback also than ViewState is the best option.
Answer: Every time your application do postbacks current values of your controls are being wiped out. So in order for you to store any values WITHIN THE PAGE you can save them in ViewState. Of course you must set the EnableViewState property first to true. Additional info, if you want to store any value or state while jumping into multiple pages you can use Session instead.

When do I need to use ViewState


What is this circular icon that keeps appearing/dissapearing?

Question: This keeps appearing/dissapearing on my icon bar, and I can't find any reference to it.  Can anyone shed some light on this mystery?
Answer: This means that the audio you are playing at this moment is supported by the "DolbyAudio" sound-enhancement. Seems like you are using a HTC ONE M9 then - it is a replacement for the BeatsAudio engine to enhance your music.
I found the explanation on a german site. Credits go to them.
Comment: Oh wow, good to know! Looks like a stove/hotplate, I already thought it meant your CPU is burning through :) I'd never connected that with audio – but right you are.
Comment: Hmmm. Thanks.  It is an HTC M8, and the icon randomly appears/disappears when I am on my home screen not using sound.  I guess it is probably a glitch.  Thanks.
Comment: @Izzy you're right it looks like a stove :D thankfully there is the google image search!
Comment: Indeed – good point, almost forgot about that! :)
Answer: This icon comes from BoomSound, installed on your HTC device. Android Central forums has a thread about it. This icon pops up when there is sound to play on anything active on the device. Web pages, messages, anything including something with sound.
Quoting from one entry:

The thing about BoomSound that it is set so that it automatically works whenever any sound is played through the built-in speakers.
It never really bothered me, however, it would've been nice if they made it possible for the user to turn-off BoomSound, this way users can choose to use it or not.
So even receiving a phone call or a notification will trigger the BoomSound to work.

Here's a page that describes settings available for it, even if it is describing the M9.


Single transaction to transfer everything?

Question: Is it possible (with MyEtherWallet or otherwise) to create a single transaction that moves all ether and tokens from one account to another in the interest of saving as much gas as possible?
Answer: The short answer is no.
The long answer is that it would be possible to build a smart contract that does just that, but gas costs of deploying the contract and executing that function would be probably higher than just doing it separately.
Comment: You are right, you can use the constructor trick to save some deploying gas, but it is unlikely you will save much, because you have to previously approve the contract for every token you want to move.


Alter Esri geoprocessing environment settings with C#

Question: I maintain an extension to ArcMap (currently at 10.2.2) for coworkers' internal use.  Several people lately have been tripped up by un-set spatial grid settings when trying to export data into a file geodatabase from our non-SDE SQLServer database. My extension isn't involved in the export itself--rather that happens using standard Esri tools. Consequently I need to set the "Output Spatial Grid" size settings once universally. I'd like to include a check at startup that will look at these settings as they are stored on disk and change 0,0,0 to some useful values.  No user involvement is needed or wanted.  I've perused the ArcObjects doc, scoured my registry, and Googled for an entire afternoon and ended up having to ice my Googler . . . no luck.  Can anyone provide information on either:

Where on disk the "Output Spatial Grid" settings are stored, and/or
ArcObjects references for how to change them

I've tried the following with no luck.
    var gp = new ESRI.ArcGIS.Geoprocessing.GeoProcessor();
    gp.SetEnvironmentValue("spatialGrid1", 50);
    gp.SetEnvironmentValue("spatialGrid2", 200);
    gp.SetEnvironmentValue("spatialGrid3", 800);

But even if that works, I believe it would only alter the settings for the current session.  What I'd prefer is to write the values to disk as if the user had made the settings changes manually in ArcCatalog.
Answer: How about doing away with the user having to make a choice? You could call the
Calculate Default Spatial Grid Index (Data Management) tool and according to the Help file the output of this can feed into the Add Spatial Index tool?
If you want to read from an existing FeatureClass the spatial grids then these can be accessed via the IGeometryDef Interface.
Comment: This solution seems to require knowledge of when the export happens, yes?  My extension can't do that ... or at least I want to avoid setting an event listener.  I've made an edit to my question explicating that requirement. Thanks!


Playing Live RTP streams on android

Question: I am trying to build a client on android that will receive RTP streams and play it.
I have searched on stackoverflow and Google, and found that MediaPlayer class can be used for this. But the MediaPlayer is used when a URL or a file is used as data source.
In my scenario, my streaming server send RTP streams on a particular port of my client.
So, is there any way to play MediaPlayer to play this stream without writing it into a file.
Answer: Have you tried it out?
Your 'data source' for MediaPLayer is your rtsp link - rtsp://127.0.0.0:550/mystream.3gp
I have done this with a VideoView, MediaPlayer is jsut an abstraction of this, so it shouldn't be too different.
The MedaiPlayer will parse the rtsp url and start the Android RTSPEngine which will communicate with the RTP Server an establish the relevants ports to transfer the data.
Answer: The method described above works - you need to supply the rtsp link (you likely won't need the port since RTSP defaults to port 554, not 550).
rtsp://se.rv.er.ip/mystream
Essentially an RTSP conversation occurs between the client and server (DESCRIBE, SETUP, PLAY) which will contain the information a .sdp file for an RTP broadcast would have.
You cannot receive an RTP stream unless the server sending it supports RTSP.
If you need more details, I'd recommend just running wireshark on a streaming client or server.  I found that helped supplement reading the RFCs.
Good luck!

Playing Live RTP streams on android


Am I required to glue together non-metal conduit

Question: I have an outdoor run that will use THWN wires in gray PVC electrical conduit. I plan to seal around and inside the conduit at the (above-ground) building penetration. This is for energy efficiency and to keep the critters out. But along the rest of the outdoor run, is there any code requirement to seal together the conduit pieces? I'm thinking in particular the bits that will be buried. I find in practice that these pieces assemble quite tightly together. By the time I have attached the far end to a junction box mounted on a wall and put in any supports along the conduit it's near impossible to take the pieces apart. So is there any point in gluing it all together?
Comment: There is NEC 352.48
Comment: Thanks. But what are the "approved methods" for making these joints and who has approved them (UL?).
Answer: Yes, the NEC instructs to follow the product instructions:

110.3(B) Installation and Use. Listed or labeled equipment shall be installed and used in accordance with any instructions included in the
listing or labeling.

Sometimes finding the instructions requires a bit of diligence, but they are out there.
And then there's this:

352.48 Joints. All joints between lengths of conduit, and between conduit and couplings, fittings, and boxes, shall be made by an
approved method.

And Article 100 defines approved:

Approved. Acceptable to the authority having jurisdiction.

So even if you can't find where instructions say you must, you will still have your Inspector to deal with.
Answer: It's not glued, it's solvent-welded.  What you call "glue" melts the PVC, causing the joined pieces to become the same piece of plastic.  Then the solvent evaporates, leaving continuous plastic.

But along the rest of the outdoor run, is there any code requirement to seal together the conduit pieces? I'm thinking in particular the bits that will be buried.

Oh my gosh, are you kidding me? That's what needs gluing the most!
You must assemble the conduit route complete before pulling any wire into it.  Some people think you assemble the conduit over the cable stick by stick, but this is bad for a variety of reasons.   You get the wire in there using a technique called "pulling", which also requires the conduit route to be constructed to be "able to be pulled".  That is a Code requirement in any case.  We regularly have questions on here where the fix would be easy if the person could pull in replacement or additional wire - but often they cannot because of prior idiocy.
Anyway, the reason PVC needs gluing is that the pulling forces can be considerable.  If the joints were not glued, then pulling forces could pull the conduit apart underground (and you'd never know) - and then you have a big gap and the wires are being pinched.
Comment: Good advice. I won't bury the conduit until after I pull the wire. But it could pull apart when someone pulls another wire in down the road. Anyway, generally I apply PVC cement to all the joints that have any freedom of movement. But there are usually a few joints that can't go anywhere because they are locked in by the others. Those I leave alone if they are already jammed in too tight to spin the conduit in the joint.


How to detect the active app in salesforce App menu Programatically using API

Question: I  have an appexchange application which is going to be installed in customer orgs. I need to show a sidebar component if the app selected from app menu is   my installed package. When I change the app menu from the installed package to something else I need to hide the side bar component.  I know this can be done by   javascript depending  on the DOM structure of salesforce app menu but it is dangerous as Salesforce can change at any time. So please let me know is there any work around to detect the salesforce active app / change in active app.
Answer: You can use the describeTabs method to list the current applications and determine if the selected app is the one your looking for. I created a HTML side bar component with an IFRAME containing this page, when i switch applications it updates with accordingly.

<apex:page controller="MyAppController" showHeader="false" sidebar="false">{!message}</apex:page>

The following displays the message accordingly..
public with sharing class MyAppController {

    public String getMessage()
    {
        String appName = 'Sales';

        // Get tab set describes for each app
        List<Schema.DescribeTabSetResult> tabSetDesc = Schema.describeTabs();

        // Iterate through each tab set describe for each app and display the info
        boolean selected = false;
        for(Schema.DescribeTabSetResult tsr : tabSetDesc) {
            if (tsr.getLabel() == appName) {
                selected = tsr.isSelected();
                break;
            }
        }

        // Selected?
        return selected ? 'Sales selected' : 'Sales not selected';
    }
}

Comment: Your welcome, been looking for a good way to play with the describeTabs API since it was added, thanks for the chance! :-)
Answer: When you select an App from the drop down the App ID is included in the query string against tsid parameter. E.g.

/home/home.jsp?tsid=02u300000000vNR

Maybe you could check for this query string parameter and ID with the 02u (TabSet) keyprefix in you side bar component. When it is detected set a cookie to remember the last known app value. Then have a custom setting that indicates which TabSet/App Id your component should be active for.


What qualifies a valid private key?

Question: The title pretty much sums up the question - say (for instance) I have a string of letters or numbers committed to memory, how hard would it be to convert that into a private key? Or similarly, how hard would it be to construct a private key based upon a sentence, mnemonic or otherwise?
Comment: Not an answer to your question, but a warning: people are very bad at estimating how "random" something is. If you generated a string of characters actually randomly (by a computer), you're probably safe if it is long enough (I wouldn't recommend anything below 128 bit of entropy). Realize that the whole world gets to try an infinite amount of times now and in the future to crack it.
Comment: Thanks for the heads up. I don't intend to use a string of characters, my question was actually a subversive look into the realities of constructing one private key from another (known and randomly generated) key. I had a look at blockchain.info which lets you import a private key with a single modified character, implying that any string is okay, but with a bit more research I found that there is a checksum to ensure validity, and so it isn't as simple as just changing a number.
Answer: Check out http://brainwallet.org/ for an example.
A bitcoin private key is just a 256-bit number. Any algorithm that can convert arbitrary text to a number of that size ought to do.
A rather simple algorithm would be to consider your string as a base 63 number (a-z, A-Z, 0-9 and spaces) and write in binary, take the number modulo 2256, and write in hex.
Or, you take the base 63-to-binary number, raise it to the power ten, bit shift left 20 times, multiply by 8, add 4, bit shift right 50 times, take modulo 2256, convert to hex, and you have a private key.
Or whatever. Try to make it so that the number generated before you calculate it modulo 2256 is much larger than 2256. Otherwise, many of your generated addresses will just be a bunch of zeroes followed by a relatively short hex string.
Comment: @gsp92: But yeah, if you take a private key and plug it into brainwallet, you get another private key :)
Comment: @gsp92: yep, pretty much. You lose a bit of entropy since the character set is decreased, but other than that you're fine since the number of characters is huge.
Comment: Random question, does brainwallet take the SHA-256 hash of the passphrase to get the secret exponent?
Comment: @lurfjurv: I think so. No clue, I tried reverseengineering the code but it's minified and complicated. I may try later.
Comment: Thank you - I hadn't seen that website before. So if I had an existing (valid) private key in import format, what would it take to manipulate it into another valid WIF key with a different bitcoin address?
Comment: @gsp92: what's WIF?
Comment: Wallet Import Format - and I didn't think of that. That gives the potential to spawn a potentially unlimited number of addresses from a known base key - I like it.
Comment: Another question: say I generate a brainwallet private key and address pair - is this inherently less safe than a randomly generated one? If so, at what point does the length of the passphrase negate this?
Comment: Brainwallets typically take a sha256 hash of a phrase that becomes the private key (simply because they are the same size). From that the public key and address can be calculated. They really should use key strengenthing. If your original phrase can be bruteforced, it isn't safe.
Comment: What if my original phrase was a string similar in strength to a randomly generated private key?
Comment: @gsp92: It can be _anything_ (well maybe not something with wacky characters)
Comment: I understand that, am interested in how secure a brain wallet generated from a 50 char key would be. I'm thinking as secure as any other random key?

What qualifies a valid private key?


Can a Summoner Wizard theoretically fill the Defender role?

Question: I'm DMing a 4e dnd game. The party is level 2 and contains a Dragonborn Warlord, Shifter Ranger (Two-Blade) and a Dwarf Summoner Wizard. As you can see, no defender. I'm aware that the Warlord is defenderish and I think that the Wizard may be able to sufficiently fill this role that the addition of an NPC is unnecessary. Thoughts?
Answer: No, a summoner wizard cannot replace a defender.
Summons won't even come close to replacing a defender. First, summon powers are all dailies, so at level 2 unless the party is only having 1 fight per day then the wizard is not going to have a summon for every fight. Second, summons lack any method of actually defending. They have no marks, and they usually can't make opportunity attacks, so they have no way of getting monsters to actually attack them.
That said, while the dwarf wizard is probably going to be mostly dead weight, the warlord & ranger should do quite well for themselves. You shouldn't toss in any NPCs to help defend for a level or two; just use the standard XP budgets for a 3-person party and see how they do. You should only toss in a defender NPC if they're taking too much damage and are having trouble making it through 3-4 encounters per day without running out of surges.
Comment: Agreed, nothing short of a defender class can fill the defender's roll simply due to the nature of defenders (unique punishment mechanics, and either super high AC or super high health).
Comment: @JoshuaAslanSmith: Actually there are a few striker builds that can do a decent job of filling in for a defender; they're not as good as an actual defender, but they have the basic pieces. Iron Soul monks are probably the easiest to do it with.
Comment: I concede that you can build very defender-y strikers (my Retrovenger went this route) but was simply stating that if you are looking for a true defender ability its best to go with something like a knight, fighter, or paladin in 4e simply because of the strength of their class features.
Comment: @JoshuaAslanSmith: Almost any defender can do a good job of defending (except cavaliers, they're useless), though some (like wardens and battleminds) take a little more optimization.
Comment: Sorry, wasn't trying be snippy but I see defenders like Warden and Battlemind as being more offtanks (which are really great at what they do) than the more punishment focused classes I mentioned.


Realbasic widget similar to workflow view in automator

Question: Is there any kind of RealBasic/Real Studio widget which looks similar to the workflow view in Automator or GameSalad?
Answer: Nothing out there that I know of.  But the way to do it is to subclass the canvas control.  I suggest you take a look at the Custom Frames example at http://homepage.mac.com/alexrestrepo/indexmain.html is it will give you some decent ideas on how to do that and have 'objects' in the canvas.


Can a puppy chew through a 10-gauge power extension cable?

Question: I have multiple 10-gauge, heavy-duty extension cords in my house powering industrial grade computers for cryptocurrency mining- could a puppy chew through this strength of cable?  The only reason why I ask is because there are products like CritterCords marketed for pet-owners to protect pets from chewing through standard electrical cords.  It would seem like a 10-gauge power cable would afford the same protection claimed by a CritterCord.  Thanks!
Comment: Given enough time and boredom, a puppy can claw and chew its way through a wooden door. A cable is no big challange. You need to keep in mind that the dog doesn't even have to chew the cable in two. Just piercing through the insulation and slobbering into the cable is enough to cause a short.
Comment: If you have a puppy, keep it a) supervised at all times and b) offer enough mental stimulation and physical exercise and c) remove dangerous objects from their reach. Everything else starts after that.
Comment: And looking at some customer reviews, the scent-based deterrent in your question is also not working in all cases.
Comment: @Elmy: causing a short (wire-to-wire) is the happiest thing that can happen. The desirable thing, actually, thinking that OP considers electricity a hack-able joke.
Comment: @Stephie, Agreed.  I've taken precautions- instead, I'm keeping secluded on one side of the house that is completely wire-free.  Thank you for all of your constructive answers and commentary.
Answer: Yes a puppy can chew through a power cable and so can most other pets and critters.
The only safe thing to do is to put the cable in an area where your pet are unable to reach it,or to keep your pet away from the danger area.
The main reason for different products to work keeping pets away is because they have chemicals in them that has a unpleasant taste or smell like the crittercord has,it is not because the products can withstand chewing from sharp teeth.
Comment: What about adding Keep Off spray to the 10-gauge cables- would that afford comparable protection to something like a CritterCord?
Comment: The problem with all deterrents is that they sometimes really "work" only after the first taste - which can be too late for a curious puppy. And when they are teething, they will gnaw on *everything*, trying to soothe the discomfort.
Answer: Anything that has teeth, and enough determination and patience, can (and will) chew through anything.
The only safe way is to place the cables wherever the place of the cables is. Anyway far enough and well protected from living beings.
About chemicals with repelling effect: on the long run, they might be dangerous for the health of your dog, and maybe for other living beings in the house too.
Rather than "hack and hope", please do the right thing and hide those cables.
What will happen if the dog is still connected to the electrical wire (alive or not-any-more - the dog, I mean) and someone will jump and grab the dog, trying to save it?

Bottom line: there is no hack for proper safety. Please do the right thing and do not mingle with the "experts" for the internet. They will not return anyone's life back.
Answer: Make no mistake...puppies can chew through almost anything. You essentially have to puppy proof a home the way you'd baby proof a home. They explore the world with their mouths and if they're bored they'll find something to chew on! If you're not sure about something then the best bet is to get it out of reach of your puppy.
Comment: Maybe you are a bit extreme with "puppies can chew through *almost anything*" :D But not *very* wrong wither, on the other hand...


What is the difference between S4, S4A & S5 public order offences?

Question: Please explain the differences between these three similar but distinct offences from the Public Order Act 1986.
Answer: Section 4 of the Public Order Act 1986 requires a person to:

use threatening, abusive or insulting words or behaviour towards another person, or
distribute or display to another person any writing, sign or other visible representation which is threatening, abusive or insulting
with the intent of:

causing that person to fear immediate unlawful violence (e.g. getting punched, stabbed, etc.) against him or someone else by any one else, or
to provoke that person or someone else into immediate unlawful violence, or
cause that person to be likely to believe that such violence will be used or
it is likely that such violence will be used

Basically, S4 requires conduct with intent that violence (or the prospect of some form of violence) immediately follow. This could be something like "Beat up all gay people" or "I'm going to kill all Muslims".
Section 4A of the Public Order Act 1986 concerns itself with intention to cause harassment, alarm or distress. This is similar to Section 4 but requires intent to be proven and does not require any violence: just that someone is intentionally harassed, alarmed, or distressed by the conduct.
Section 5 of the Public Order Act 1986 is almost identical to S4A except there is no requirement to prove intent, or prove that anyone was actually harassed, alarmed, or distressed by the conduct.
The punishments for the offences are also different. S4 and 4A have a maximum punishment of six months imprisonment or a level 5 (standard scale) fine, or both, whereas S5 has a maximum punishment of a level 3 (standard scale) fine.
So S4 and 4A are treated as more serious offences than S5. S5 is easier to prove as it doesn't require any intention or that anyone actually be offended by the conduct.
Answer: S5 is just shouting things that are commonly offensive. S4 and 4a are shouting them at someone or a group of people.
As explained by an officer on the street, S5 would be shouting fuck fuck fuck. S4A would be saying to someone or a group of people "fuck you". S4 is saying to someone "I'm going to fucking kill you".


How do I strongly type criteria when using NHibernate's CreateCriteria method?

Question: I'm currently using NHibernate, for the first time, with Fluent NHibernate. I've gotten everything setup nicely, however now I've come to actual doing some data retrieval, it seems to have fallen short.
I was expecting NHibernate, to allow me to do something like:
session.CreateCriteria<TblDocket>()
    .Add(Restrictions.Eq(x=> x.DocketNumber, "10101"));

However, this doesn't appear to be the case and I seem to have to write:
session.CreateCriteria<TblDocket>()
    .Add(Restrictions.Eq("DocketNumber", "10101"));

That'll be less-than-wonderful when I rename any properties! I've always though hard coded strings in code is bad, especially when the strings relate to property names.
Is there any way I can strongly type these restrictions? I had a look at this blog post, but it seems quite messy, is there a nicer solution?
Answer: I decided to use NHibernate.Linq instead. I found a brilliant tutorial here.
Comment: Take a look at http://www.tobinharris.com/past/2008/8/17/linq-for-nhibernate-examples/
Answer: You can't using out-of-the-box NHibernate.
There is a project called NHibernate Lambda Extensions which allows you to do this with some limitations.
Answer: since NHibernate 3.0 there is also QueryOver available which are a nice typesafe wrapper around the criteria API.
session.QueryOver<TblDocket>()
    .Where(x => x.DocketNumber, "10101");

Answer: For anyone who comes along this post and doesn't like linq or isn't too familiar with lambda you can still safely use ICrierta's such as
session.CreateCriteria<TblDocket>().Add(Restrictions.Eq("DocketNumber", "10101"));

what you need is helper classes so you can remove the magic strings such as "DocketNumber" so that if you do change your property names or column names these are taken care of for you or will atleast produce a build error so you know before you publish your code.
Anyone wanting to see an example can have a look at NhGen ( http://sourceforge.net/projects/nhgen/ ) and the query examples at https://sourceforge.net/projects/nhgen/forums/forum/1169117/topic/3789112 which show how helpers classes can be used like.
// Find using a simple entity query
IList<IMessage> messageList3 = messageDao.Find( new [] { Restrictions.Le(MessageHelper.Columns.Date, dateLastChecked) } );

Note that this project also created entity wrapper classes which group all your common CRUD methods into one class (xxxDao as show above) so you don't have to keep copying the same code over and over again.


Is there any reason for the wires in a PCI-e and CPU power cables to be separate?

Question: These are the connectors they are for:

So as you can see, the PCI-e connector uses either 3x12v + 3xground or 3x12v + 5xground wires in the cable. I've red that optionally some of the wires can be used for some sort of regulation signaling but nobody really uses this functionality and as far as the power supplies and graphics cards are concerned, its fine if they are just 12v and ground.
For the 8P CPU connector, its always just 4x12v and 4xground as far as I know.
Now the reason I'm asking is because I've built some 8P CPU connector -> 2x 8P PCIe adapters which work well and I'm looking to build a whole bunch more.
What I want to do is to not bother with all the separate wires and just use a pair of 15AWG wires for the cable which I then split up for the separate pins in the connectors. The max current would be 25A which both the connectors and wires are able to carry.
From the PSU's that I've opened, I've seen that the 12v and ground wires all get soldered together anyways so there shouldn't be a reason why this would be bad.
Before I go ahead and do it, do you guys know of any reasons to keep the wires separate?
Answer: A bigger single wire will be less flexible and harder to work with. It's also not trivial to split it up into multiple parts for the crimp terminals in a safe and easy way.


VNC using MobaXTerm Client

Question: On Raspbian, I just enabled VNC using the sudo raspi-config command and tried to use MobaXTerm to connect, but it gave me the error "No configured security type is supported by 3.3 VNC Viewer". I know most people use RealVNC but I'd prefer not to because even the standalone exe adds some /appdata and registry files. Is there any way to get the Raspberry Pi working with MobaXTerm VNC, or are there any portable VNC clients that are compatible with the Raspberry Pi?
Answer: So it seems like the VNC server bundled with Raspbian is the RealVNC server, which uses an authentication protocol that isn't compatible with many VNC clients, including MobaXTerm and TightVNC. Seems a little ridiculous for Raspbian to bundle proprietary software that uses it's own special protocols.
The good news is it's possible to reconfigure the RealVNC server to use the normal authentication protocol. We basically just need to change the "Service Mode" configuration to use "VncAuth", and add a password.
First, make sure you enable VNC using sudo raspi-config, going to interfacing options, and then for VNC select yes. Then follow the instructions below.
Graphical Method
If you have a keyboard+mouse+monitor connected to the Raspberry Pi, you can just

click the Vnc icon in the top bar, open the hamburger menu, and select "Options..."
Under the "Security" tab, for "Authentication" choose the "VNC password" option
Under "Users and Permissions" tab, select "Standard User" and click "Password..." to set your VNC password
reboot the RPi, and you should now be able to use your preferred VNC client to connect!

(disclaimer: I haven't tested this method, just stuff I read online, so if you find issues/corrections please let me know in the comments!)
Command-Line / SSH
If you're SSHing into the RPi like me, you can

modify the config file: sudo echo 'Authentication=VncAuth' >> /root/.vnc/config.d/vncserver-x11 (might need to be logged in a root to do this)
add the password to the config file: sudo vncpasswd -service (will prompt you to set a password)
sudo reboot
you should now be able to use your preferred VNC client to connect!

References and Docs
graphical method
command-line configuration
Authentication parameter and Password parameter
Comment: The command line method did not work on new Raspberry Pi OS on Raspberry Pi 5
Comment: I have resorted to RealVNC Viewer which works fine if you do **not** follow these instructions
Answer: I would like to Add in for Graphical methode

"Option" --> "Security" --> Pop up - Windows with a link in Text Feld
                        "User & Authorization" (German VNC: "Benutzer& Berechtigung")
Click "User & Authorization" in text Field --> Popup-windows with Highlighted "Standard User"
Click "Password- Button"  --> Popup- window for changing password.

I use MobaXterm: you need only to set up the IP-Adress of Raspberry.
It is working both  in RASPI 3B+ and RASPI 4.
Have fun!

VNC using MobaXTerm Client


What does the Assault End Time mean in HoxHud?

Question: I recently got HoxHud and love all the extra information it gives you, especially the assault waves, but was wondering what the 'ASSAULT END TIME:' meant? It shows a number but no units. Does that number mean the number of seconds until the assault ends from that point or the number of seconds from the start of the assault?
Answer: It indicates the timer to when the assault ends. So when the timer is out, the phase ends.
<code>self.assault_phase_text = "Assault Phase: "
self.assault_spawn_amount_text = "Spawns Left: "
self.assault_time_left_text = "End Time:
</code>
Pulled from the code for the mod.
Comment: Please clarify. The asker asked what the timer indicated. The timer just indicates numbers. Is this the time in seconds? Minutes? Hours? Milliseconds?


How do I comb hair in python?

Question: I am creating particle systems using python.  I'd like to be able to comb the hair using python (iterate through the control hairs and set their control points).  What are the APIs for doing this?
Comment: I'm pretty sure you can't, the operator depends on 3D View and mouse input and I haven't seen a low-level way yet (in contrast to grease pencil strokes).
Comment: While it probably won't give the control you want you can setup curves in python and give them a [curve guide force field](http://wiki.blender.org/index.php/Doc:2.6/Manual/Physics/Force_Fields#Curve_Guide) With the max distance you can have several curves controlling 'clumps' of hair.
Comment: in the latest Blender on the footer, where you can find the different views, you now can find the "particle Edit" view, They have added an interactive "comb" for blender... Have fun!
Comment: The interactive combing of hair is old news.  That is why I specified "using python".  Also because I want to comb the hair according to mathematical formulas, not frobbing about imprecisely with the mouse.
Answer: The python API for combing hair is not very complete.  You can adjust the control points for individual hairs using code like this:
def comb1(obj):
    ps = obj.particle_systems[0]
    dx =10
    dy = 10
    for i in range(dx):
        for j in range(dy):
            idx = i*10+j
            particle = ps.particles[idx]
            dz = len(particle.hair_keys)
            for k in range(dz):
                x =  k*0.1*i
                r = math.pi*dy/(1+j+1)
                theta = k /r
                y =  (1-math.cos(theta))*r
                z = math.sin(theta)*r
                particle.hair_keys[k].co_local = (x,y,z)

That is an intermediate result from my research.  It successfully sets the control points for the parent hairs.

It does not update the UI.  You have to toggle between Particle Edit and Object modes for the UI to refresh.
You can not really adjust the position of the root using python.  While there is a "location" property on the python particle object, it is just a computed value.  The real value is a barycentric coordinate "fuv" for the face indexed by "num", and both are only accessible from C (or a version of blender with hacked dna).  Using "displaced" values in co_local works for the parent hairs, but child hairs will not be interpolated correctly.

As of blender 2.71 the python API for editing particle systems has some shortcomings.  A chat with some folks in #blendercoders came up with a reference to some past work on editing the point cache, although the previous work was with the cloth sim and significant work would have to be done to adapt it for the particle cache (and it requires that you enable Hair Dynamics).
Comment: i think it's possible to update UI.
obj.data.update()
Answer: Possibly, the root can be moved too using ParticleHairKey.co.
particle.hair_keys[k].co = (x,y,z)

Comment: Is this stable if the mesh is adjusted (if vertices are moved in space)?  Are the child hairs computed properly?

How do I comb hair in python?


What are the options for a prepaid SIM card in Montevideo, Uruguay?

Question: What are the options for pre-paid SIM cards in Uruguay (Montevideo)? What are the options for pre-paid data plans/packages?
Answer: Data via cellphone is one of the most competitive marketplaces in Uruguay.

Vendors are shifting from 3G to 4G, starting in the area around
  Montevideo. From a consumer's standpoint the only discouraging trend
  in this market is the adoption of data volume caps by all vendors. As
  of August 2012 no vendor web-site offered an unlimited mobile internet
  data plan (the closest was an "unlimited during nights and weekends"
  from Claro.)

In terms of prepaid data plans, there are several available, from Claro, Antel or Movistar.  I won't copy and paste verbatim as I'm sure they're likely to change with time, but an up-to-date wiki is maintained at
Uruguay Prepaid Plans on APNCharger.org.
Comment: Will these prepaid SIM cards work for a Mifi as well?
Comment: @DanishKhan, in theory, I guess, as they just take regular sims, right?
Comment: Yea, I figured as long as the SIM has a data plan it should work. I was just curious if anyone knew.


The requirement of a relatively weak coupling for the application of the rotating wave approximation to obtain the Jaynes-Cummings model

Question: In order to obtain the Jaynes-Cummings Hamiltonian, the RWA is applied to the Rabi Hamiltonian:
$$H=\frac{1}{2}\hbar\omega_0 \sigma_z+\hbar\omega \hat{a}^{\dagger}\hat{a}+\hbar g(\sigma_{+}+\sigma_{-})(\hat{a}+\hat{a}^{\dagger}),$$
under two conditions: the near-resonance $\omega_0\approx\omega$, and the relatively weak coupling strength $g\ll \text{min}\{\omega_0,\omega\}$. While the requirement for the first condition is reasonable (the terms $\sigma_{+}\hat{a}^{\dagger}$ and $\sigma_{-}\hat{a}$ become rapidly oscillating for $|\omega_0-\omega|\ll \omega_0+\omega$, as seen in the interaction picture w.r.t. the free Hamiltonian, where they acquire phase factors $e^{\pm i(\omega_0+\omega)t}$), the condition for the weak coupling is not so evident and usually is not explained in the introductory quantum optics textbooks. So, why is it needed?
Comment: This is a good question. I don't think I've ever seen a really quantitative analysis of the conditions under which the RWA work, much less an analysis of the error in various limits. This issue is of particular interest to me because of [this experiment](https://arxiv.org/abs/1606.05721).
Comment: @DanielSank possibly linked to the non-inertial nature of the rotating frame?
Comment: @ZeroTheHero The rotating wave approximation appears in first order differential equations, such as Hamilton's equations of motion in classical physics or the analogous Heisenberg equations in quantum mechanics. Neither of these cases have inertia, so I'm not sure what you mean by non-inertial nature.
Comment: Could you give a source where the condition $g \ll min\{\omega_0,\omega\}$ is clearly stated ? Indeed to my knowledge, which might be wrong, in order to move from the Rabi Hamiltonian to Jaynes-Cummings Hamiltonian, you first go to Interaction Picture with $\hat{H}_{int} = \frac{1}{2}\hbar\omega_0\sigma_z + \hbar\omega\hat{a}^{\dagger}\hat{a}$, then neglect the terms $\propto e^{\pm i (\omega_0 + \omega)t}$, then finally move back to the Schödinger Picture. I seems to my that the weak coupling-strength does not play any role here, or maybe I missed something ...
Comment: Okay it seems that my comment was wrong, look at my answer below !
Answer: I will not go into much detail here, but rather give you the link to this answer.
In order to sum it up very quickly let us simply state that the RWA which gives rise to the Jaynes-Cummings Hamiltonian is an on-resonance perturbative theory, where we neglect the fast rotating terms in the Rabi Hamiltonian when written in the interaction picture.
In the answer, a simple model was given where an atom is classically driven by a field. The coupling constant is thus proportional to the driving field, and it is stated that :

It is essential to emphasize that, as the applied field increases, this approximation becomes even less reliable and it is just the leading order of a perturbation series in a near-resonance regime.

This is a direct analogue of the $g \ll min\{ω_0,ω\}$ condition.
Hence one could say that the Rabi and Jaynes-Cummings Hamiltonian describe the same physics as soon as both conditions (near-resonance and weak coupling) are verified. If the coupling becomes strong (as in superconducting qubits for instance), the Jaynes-Cummings Hamiltonian no longer describes completely the physics, since higher order terms start to play a role. (cf.  Bloch-Siegert shift and/or AC Stark shift).
An interesting paper on this topic : A modern review of the two-level approximation by Marco Frasca.
Edit : Also, a very elegant way to look at these light-atom interaction problems, is through the dressed-atom formalism (Atom-Photon Interactions - Chapter 6 The Dressed Atom Approach by Claude Cohen-Tannoudji , or any introductory ressource that builds the dressed-atom approach starting from the Rabi Hamiltonian and not the Jaynes-Cummings one).
Comment: So, briefly speaking, the need for small $g$ can be seen when expanding the time evolution operator in interaction picture (Dyson series). For JC model the higher order terms are negelcted when $g$ is much smaller than $\omega_0$ and $\omega $ (i.e. $\mathcal{O}[g^2/(\omega_0+\omega)^2]$). And in combination with $\omega_0\approx \omega$, the counterrotating terms can be negelcted .
Comment: Exactly, you got it !
Comment: I also insist on the fact that when $g$ is no longer small with respect to $\omega_0 , \omega$, you do not describe completely the physics (*i.e* Bloch-Siegert shift and/or AC Stark shift) with the JC model.
Comment: Experimental example : [THz driven quantum wells: Coulomb interactions and Stark shifts in the ultrastrong coupling regime](https://arxiv.org/abs/1012.4448v2), Zaks et al.
Comment: Don't forget to accept my answer, if it answers your questions completely of course ! :)


Main Menu Missing from Ubuntu Unity

Question: The Unity "main menu" in the upper left corner, which has been present for quite some time, just up and vanished. The Launcher still works, as do its menus, but the Main Menu button is gone. How do I get it back?
Answer: I solved it. It has to do with a glitch when two monitors are in use. My laptop monitor alone displays it fine, but my external monitor does not for some resolution-related reason.

Main Menu Missing from Ubuntu Unity


Parents deceased but still owe for refinance loan

Question: My mother and father refinanced their home but they both passed away before it was paid off. My name is listed on the deed along with my mother. Am I responsible for the loan because my name is on the deed but not on the loan?
Comment: Jurisdiction?  Country, possibly state or province?
Comment: You are not "responsible" for the loan in the sense that no one can _compel_ you to pay it off completely right away or even _assume_ the loan and pay it off in monthly installments. But, the loan is presumably a _mortgage_ on your parents' home. If so, the mortgage holder can intervene in the probate court proceedings and foreclose on the house if the mortgage is not paid off or assumed by you. Even if your name is on the deed (with your mother) as a joint owners with right of survivorship, you cannot assume sole ownership of the property without dealing with the mortgage first.
Comment: What kind of loan is it? Mortgage/secured against the home?
Answer: Heirs do not inherit debts, so no. You (or any other heirs) are not responsible for the mortgage.
However, assets of an estate can be sold to cover the debts of the deceased.  In this case, the bank could force the sale of the house in order to pay the outstanding mortgage balance. "Could" becomes the operative word as whether they choose to go after the estate depends on many things. Here only a lawyer in your particular jurisdiction can advise you.
Are you the executor of the estate? Did they have a will?
Sorry for your loss, but you probably need to seek legal assistance.
Comment: The mortgage company "could" go after the house (that is, force a foreclosure), but it's probably to their advantage to either have you assume the loan, or cooperate in selling it.  I think just talking to them first would be better than spending money on a lawyer before you need to.
Comment: The first sentence is misleading. If you inherit a house worth $300,000 with a $290,000 mortgage, you only become $10,000 richer. If you are supposed to inherit a house worth $200,000 with a $290,000 mortgage, you can refuse the inheritance, but you can't inherit the house without responsibility for the mortgage.