Invincible body or body of a doll?

Question: In Child's Play (1988), when Chucky goes to see Dr. Death, he mentions the pain he is able to feel and the fact that he's bleeding. He says "I didn't think anyone could hurt me." Is he confused by the pain and blood because he thought he'd be invincible after using Death's voodoo magic to come back or because he's in the body of a doll?
Answer: Chucky is becoming more human
The longer Chucky's soul remains in the doll, the more human he becomes.  At the beginning his doll body was fairly immune to injury.  But as more time goes by, the more Chucky is turning into a real boy.  And of course, a real body is prone to injury, especially by projectile.

[Chucky goes to visit John.]
Chucky: Hi! It's me, Chucky! What d'you think? The grigri work?
[John nods awkwardly.]
Chucky: You know, when you were telling me all that stuff about how to beat death I thought maybe you were pulling my chain. But not now, uh-uh. Only one problem.
John: What?
Chucky: This. (Points to a wound below his shoulder) I didn't think anybody could hurt me. But last night I got shot. And you know something? It hurt. It hurt like a son of a bitch, it even bled! Now why's that, John?
John: You're turning human.
Chucky: What?
John: The more time you spend in that body, the more human you become.
Chucky: You mean, I have to live out the rest of my life in this body? NO FUCKIN' WAY! You got me into this, you get me out!
John: I can't do that, Chucky.
Chucky: Why not?
John: Because you're an abomination. AN OUTRAGE AGAINST NATURE! You've perverted everything I've taught you, and used it for evil! AND YOU HAVE TO BE STOPPED!

(source)  Emphasis mine.
So yes, he is confused because he thought he'd cheated death, but is now discovering he's still mortal.
Answer: At first, technically Chucky was meant to be immortal, although once he told Andy he was Charles Lee Ray, he had somehow become mortal again with the same weaknesses as any other human to an extent. As Dr. Death said, "You must possess the first person you tell your secret" (I'm paraphrasing).
Chucky even states he must become a kid again. This means that once he possesses Any he shall be an immortal being in a human form (Unless he tells someone else his secret while within the new form). In Child's Play 3 (1991), Chucky implied that since he was in a new Chucky doll (form) he could simply tell Tyler his name and possess him instead.
I assume that since he wasn't already immortal in that new form he must have to switch into another form originally to become an immortal being. Long story short: The more time he spends in the doll form, the more human and weak he becomes.

Invincible body or body of a doll?


Was it possible for a young Japanese woman to end up enslaved in Great Britain in the mid-1600s?

Question: I'm inspired to ask this by the horror visual novel The Letter, which chiefly regards a haunted building called the Ermengarde mansion, in the fictional English town of Anslem, near the equally-fictional city of Luxbourne.  The mansion is stated to have been standing "since the 1620s."
The mansion is haunted, primarily, by the ghost of a woman who was tormented and made to be burned at the stake by the lady of the house, Charlotte Ermengarde, who took ownership of the mansion after her parents died.  The plot says that the woman, named Takako, was a slave who was publicly freed by Charlotte (along with other slaves) and put to work as a maid in her mansion, until various things happened that gave Charlotte the motive to want her dead.  While it's never specified, Takako is presumably Japanese, as her name is Japanese and she speaks of seeing "chrysanthemums and cherry blossoms" in her home country.
My question, then, is two-fold:

Could there have been young Japanese women in Great Britain in the mid-1600s?
The apparent timespan puts Takoko's presence directly at the beginning of Japan's Sakoku, their period of severe isolationism, and in fact Britain had cut off all trade with Japan in 1623.  This seems to indicate it would be exceedingly unlikely that a Japanese woman would ever be seen on British soil, much less a first-generation immigrant.  But does that mean it's impossible?
Could she have been enslaved?
Wikipedia seems to indicate that internal slavery in Britain was unheard of by 1200.  As an American, the idea of abolition six hundred years before the American Civil War is amazing, to say the least.  One assumes the British would stick to their domestic policies, but 1200 to 1650 is a long time.  Were there slaves (and markets where one could publicly free them) in Great Britain in the mid-17th century?  And were there Asian slaves specifically, Japanese to be even more specific?
Comment: I made some edits to tone down the speculative elements, as History.SE generally considers hypothetical questions off topic.
Comment: I'd be tempted to support Kentaro's closure but truly, the Question is not about the book; rather, the historical background. Doesn't that make it legitimate?
Comment: I voted to close this question because it is not the historical question at all (and no source is available) but it is based on the complete fictional book.
Answer: No.
At least, not to any practical intent or purpose.
Japanese in Britain
Significant numbers of Japanese were actually sold into slavery overseas during the 16th century, mostly through Portuguese merchants. Aside from chattel slavery, Portuguese sailors also bought young Japanese women as concubines, and it would not have been unthinkable if one subsequently ended up in Britain.
In fact, in 1588, two Japanese slaves did reach England after the explorer Thomas Cavendish captured a Spanish ship they were enslaved on. They were originally sold into slavery by Portuguese merchants in Philippines. Cavendish brought the two back England, where they probably even met Queen Elizabeth, before departing on a failed expedition for Japan in 1591.
However, this trade was suppressed by Japan in 1587 on Toyotomi Hideyoshi's orders, and outlawed by Portugal in 1595, even before the Tokugawa sakoku went into effect. While by then significant numbers of Japanese were enslaved in Europe, it is doubtful that any could've survived to the 1650s, or be considered "young".
Of course, some Japanese also left their home country as free people. A very select few, notably the members of the 1586 Tensho Embassy even reached Europe, but the vast majority were merchants who stayed well within the Asia-Pacific region. The lengthy journey to Europe was too arduous to be undertaken lightly, especially since Japanese ships were not capable of such a feat. With the imposition of sakoku in the 1630s, such emigration (which mostly consisted of men anyway) was quickly ended.
So while it was not altogether impossible for there to be a young woman of Japanese descent in 1650s Britain, there is no realistic path by which a native-born Japanese woman could reach England by then.

British Slavery
Chattel slavery was indeed long extinct in Britain by the 1650s. One judge, writing in 1637, cites an earlier case of a slave bought in Russia and notes that "it was resolved, That England was too pure an air for slaves to breath in." Likewise, serfdom was dead in England by the 1650s - the last English serfs were freed only in 1574 - although the institution lasted till 1799 in Scotland.
Since serfdom was a status of birth, a native-born Japanese could not have became one in Britain. It may be theoretically possible for a Scottish serf to procreate with a Japanese person to produce a serf of Japanese descent, but this seems exceedingly unlikely.
That's not to say "slavery" was entirely abolished in the 1600s - other forms of bonded labour persisted 'til much later, and could be described as slavery from a modern perspective. For example, apprentices were contractually obliged to work for their masters, and many orphaned or abandoned children were bound to serve families who agreed to raise them. This was a form of indentured servitude which would be considered slavery today, although they had rights and were not considered property, and their status was temporary.
It would not be impossible for a native born Japanese child, if one were to be magically transported to England, to find herself in such an arrangement. She could also be freed from her obligations before the contract expired. But as unlikely as it would be for a Japanese adult to reach England in the 1650s, it would be inconceivable for a child.

Realistically, legality and reality are not identical. It would've been quite possible for someone to end up as a de facto slave in Britain, as many Africans were in an later age, despite the legal situation. However, the chances of this being a native Japanese is virtually non-existent.
Comment: "[the trade of japanese slaves was] outlawed by Portugal in 1595" - so interesting! Thanks for the accidental tip. :)
Answer:
1: Could there have been young Japanese women in Great Britain in the mid-1600s?

This seems extraordinarily unlikely.
According to the British Chamber of Commerce in Japan

1600 William Adams, a seaman from Kent, becomes the first Briton to arrive in Japan.
1832 Three sailors from Aichi Prefecture—Otokichi, Kyukichi and Iwakichi—cross the Pacific Ocean from Japan. After arriving in the United States, they join a trading ship that travels to the UK and, later, Macau. Believed to be the first Japanese to set foot on British soil, Otokichi becomes a British citizen and adopts the name John Matthew Ottoson. He later pays two visits to Japan as a Royal Navy interpreter.

(my emphasis)
A 1997 PhD thesis by Andrew Cobbing says:

Some communication with overseas traders was thus possible during the Edo period, but the sakoku. edicts also included a ban on overseas travel, and this severely curtailed opportunities for cultural contact with the outside world. The ban was imposed in 1635 and stipulated the death penalty for anyone leaving the country without permission from the bakufu. A number of Japanese returning from abroad at the time were summarily executed. Before the imposition of the sakoku edicts, the Japanese had been active in East Asian waters.

This suggests very limited opportunities, likely none, for a young Japanese female to leave Japan during the 1600s.

2: Would she have been a slave?

Very unlikely in England at that time.

Wikipedia seems to indicate that internal slavery in Britain was unheard of by 1200.

I see no reason to doubt this. The feudal roles of serfs, cottars and others probably provided the invading Norman lords with all the control they wanted over their subjugated workforce.
The Atlantic slave trade
 started in the 16th century, first by the Portugese and later by the British and others. But that was transporting slaves from Africa to America not to Britain and initially the victims of the trade had the rights of indentured servants.
So there certainly wasn't any well established system capable of enslaving citizens of Japan and transporting them from Japan, or elsewhere, to Britain.

Were there slaves (and markets where one could publicly free them) in Great Britain in the mid-17th century?

There were no slave markets where slaves were openly traded.
A few slave owning people moving to Britain from America could have brought some slaves with them and continued to treat them as slaves. This status would almost certainly not have been supported in English or Scottish law.
As we know today, you can still be a slave in a country where slavery is illegal. Just not openly.
Answer:
Question:
  Was it possible for a young Japanese woman to end up enslaved in Great Britain in the mid-1600s?

Possible? I would say yes.   While it's true Japan's official slave system from the Yamato period (3rd century A.D.) through the Toyotomi Hideyoshi was abolished in 1590; the Western definition for slavery is perhaps broader in nature than that which is employed and banned in Japan in the late 16th century.
see Japan's encounter with Europe, 1573 – 1853
Forced or "Non - Free labor", described as Gotōke reijō (Tokugawa House Laws) article 17, identifies a form of slavery of the immediate family of executed felons.  This practice persisted in Japan from 1597 and 1696. While uncommon there are over 600 documented occurrences of this practice over 101 years of the seventeenth century.
Likewise while it's true, all Portuguese were forbidden from entering Japan in 1639,  after a failed Christian uprising.  The Portuguese were not the only Europeans in Japan.
The Dutch had arrived in Japan in 1600, and remained in Japan after the Portuguese ban had taken effect.
see Slavery in Japan
It is not impossible for dutch trade to have included a Japanese slave in the 17th century.   The Dutch were active in the African slave trade from 1612 and 1872, and did provide slaves to British colonies.   While Britain never technically legalized slavery domestically,  worst case one could say slavery was widely tolerated in the domestic UK in the 17th century while of coarse being mandated in it's colonies.
Admiral Sir John Hawkins of Plymouth is widely acknowledged to be "the Pioneer of the English Slave Trade" (from 1554–1555).   In the 18th century slavery became a major component of the British economy, and in the mid 1700's Owners of African slaves in England would advertise slave-sales and rewards for the recapture of runaways.
Cromwell in the mid 1600's sold large swaths of the UK Gypsy population into slavery,  as many as 50,000 Irish were sold into slavery after the Irish rebellion of 1641.  It's "possible" a Japanese slave transported by the Dutch could have found his or her way to the UK in the mid 1600's.
see Slavery in Britain
Sources:

Japan's encounter with Europe, 1573 – 1853
Slavery in Japan
Slavery in Britain
Comment: Yes, +1 it is "possible". But there is no proof available from the British side.
Comment: But I am sorry I have to downvote. Because you mention the "Dutch" slave, which was officially allowed by Tokugawa Shogunate **only at Nagasaki** was strictly monitored. So your line "It is not impossible for dutch trade to have included a Japanese slave in the 17th century." is hard to believe.
Comment: @Kentaro  yes the Dutch were isolated and monitored in Japan after the Portuguese were banished.  But the Dutch were there to trade.  The Japanese permitted them because they valued the trade.  There is no reason for the suspicious Japanese to have objected or interfered with the Dutch purchasing  "non-free labor".  It's not like these folks were afforded protection under 17th century Japanese law.
Comment: That the "Dutch were there" doesn't support your claim. It is because the each today's called "Han", which is each Daimyo's sphere, had a tax system according to "宗門人別帳"(Shu-Mon-Nin-Betsu-Cho), which is virtually the family census under the control of each rural Buddhist temples. If anyone banishes, the head of the village and villagers are strictly punished.
Comment: @kentaro that European country with a long history in the slave trade was active in Japan throughout the period does support a possible finding.  Claiming Japanese culture of the 1600s would not tolerate separation of families due to religious concerns seems illogical. (1) the people in question were the relatives of executed prisoners. (2) during this period  all Japanese were called upon to renounce there religions.
Comment: What on earth are you talking about? I'm talking about each Daimyo's governing system, not culture. Nagasaki was operated strictly by the Tokugawa shogunate directly. No ordinary people could go to Nagasaki back then.
Comment: https://en.wikipedia.org/wiki/Irish_slaves_myth, https://www.snopes.com/fact-check/irish-slaves-early-america/, https://www.thejournal.ie/readme/irish-slaves-myth-2369653-Oct2015/
Answer: Short Answer:
That story is not impossible in the sense of violating laws of physics, but extremely improbable, especially as some of the characters may have violated the laws of one or more nations and risked severe punishment by doing so.
Long Answer:
in the 17th century (1601-1700) a number of English persons were slave owners, of a sort.  They were investors in various large or small companies that participated in the Atlantic slave trade.  Those companies sent ships to Africa to buy African slaves and ship them to North or South America to sell as slaves.
Technically those companies owned the slaves that they bought and sold.  Individual investors would not own the property of the company as individuals, they would have a share in the company which owned property.  If a company was owned by one person that one person would own all the property that the company owned, including slaves.
But slaves were purchased in Africa for the purpose of being sold in various colonies in the Americas, and not for being used in Britain or England.
Of course, there were a number of English colonies in the Americas.  Slavery was legal in those colonies during that period and until 1833.  And some of those English colonies, full of English colonists, the ones in what is now the southern USA, and in the Caribbean, had plantations with large slave work forces.
Most of those plantations were owned by English colonists.  An English colonist who became wealthy and successful in the colonies, or their child, might move back to England and enjoy a wealthy lifestyle there.  And they might take their personal house servants back to England with them, including slaves.  But anyone who took a slave to England would run the risk of having that slave declared free, so I don't know if that was ever done.
I do know that some English aristocrats in that era had black servants, and I don't know if they were legally slaves or legally free.

During and following the Renaissance, it became fashionable for black boys and young men to be decorative pages, placed into fancy costumes and attending fashionable ladies and lords. This custom lasted for several centuries and the "African page" became a staple accoutrement of baroque and rococo style.[5]

https://en.wikipedia.org/wiki/Page_(servant)1
If the fictional character Takako was old enough to remember cherry blossoms and chrysanthemums when she left Japan, she would probably be at least three.  If she was still young when killed, she would have been under forty, so she should have left Japan no more than 37 years before being killed.
The latest time that Takako left Japan legally would be before it was forbidden.  The Japanese policy of isolation was establish by several edicts between 1633 and 1639.  The edict in 1636 established the death penalty for Japanese leaving Japan. So if Takako left Japan before 1633 or 1636 at the very latest, she should have been killed by 1670 or 1673 at the very latest.
So it is possible that Takako left Japan by 1633 or 1636 at the very latest, if she left legally and not as a criminal, perhaps fleeing from the law, and possible that she left Japan as a young child, even though it would be unusual for children to sail overseas.  And possibly Takako was enslaved somewhere, and sold to Mr. Ermengarde somewhere in Asia, and Takako might have been a companion to Charlotte Ermengarde if they were children of a similar age.
One romantic possibility for Takako fleeing Japan after 1636 would be if she was a relative of Amakuso Shiro or someone involved in the Shimabara Rebellion of 1637-38.
And the Ermengarde's might have returned to England after successful trading in Asia, perhaps in British trading posts in India.  And after her parents died, Charlotte Ermengarde might have declared Takako legally free, since after all Takako's status as a slave would be legally dubious in England.  If Takako worked for Charlotte as a servant after being set free, Charlotte would have had a large amount of power over Takako according to the customs of the day.
Of course no mistress of a household had the legal right to order someone, even a servant, executed.  Only a magistrate could order someone executed after they were convicted of a capital crime in the magistrate's court.  And presumably there were no female magistrates in 17th Century England.

Edward Wightman, a Baptist from Burton on Trent, was the last person burned at the stake for heresy in England in Lichfield, Staffordshire on 11 April 1612.[78] Although cases can be found of burning heretics in the 16th and 17th centuries in England, that penalty for heretics was historically relatively new. It did not exist in 14th-century England, and when the bishops in England petitioned King Richard II to institute death by burning for heretics in 1397, he flatly refused, and no one was burnt for heresy during his reign.[79] Just one year after his death, however, in 1401, William Sawtrey was burnt alive for heresy.[80] Death by burning for heresy was formally abolished by King Charles II in 1676.[81]
The traditional punishment for women found guilty of treason was to be burned at the stake, where they did not need to be publicly displayed naked, whereas men were hanged, drawn and quartered.
There were two types of treason: high treason, for crimes against the sovereign; and petty treason, for the murder of one's lawful superior, including that of a husband by his wife. Commenting on the 18th-century execution practice, Frank McLynn says that most convicts condemned to burning were not burnt alive, and that the executioners made sure the women were dead before consigning them to the flames.[83]
The last person to have been condemned to death for "petty treason" was Mary Bailey, whose body was burned in 1784. The last woman to be convicted for "high treason", and have her body burnt, in this case for the crime of coin forgery, was Catherine Murphy in 1789.[84] The last case where a woman was actually burnt alive in England is that of Catherine Hayes in 1726, for the murder of her husband.

https://en.wikipedia.org/wiki/Death_by_burning#England2
So if Takako committed heresy (before 1676) or petty treason against her superior, she could have been legally sentenced to be burned at the stake.
As someone from Japan, Takako might have been raised as a non Christian (though being a Christian would have given her a strong motive to flee from Japan during that period when Christianity was outlawed) and her Christian beliefs might thus have been rather heretical, or might have been a Roman Catholic and thus a heretic in English law.
Once a girl from Japan gave a talk to my high school class. She said that her family were Christians.  I wish that I had asked her whether they converted after Japan was opened up to the world, or if if they had been secret Christians for centuries when Christianity was persecuted in Japan.  For all I know, she might have been related to Japanese Christian Martyrs. https://en.wikipedia.org/wiki/Martyrs_of_Japan3
As a servant, even a free servant, it would have been petty treason for Takako to kill her employer, and perhaps she killed one of Charlotte Ermengarde's parents, accidentally, in self defense, or murder..
But Charlotte Ermengarde would not have the legal right to sentence anyone to any form of execution.
So maybe Charlotte Ermengarde was torturing Takako with fire or red hot irons as punishment or to get her to confess to something, and Takako's clothing took fire and burned her to death before the fire could be put out.  That would have been very extreme but probably not totally unheard of in 17th century England. Thus Takako might have been more or less accidentally burned to death.
Or maybe Takako was lynched at the orders of Charlotte Ermengarde, who thus would be getting away with murder for a longer or shorter time due to being rich and powerful.  And perhaps Charlotte Ermengarde justified the lynching to herself and her accomplices by saying - accurately or not - that Takako was guilty of heresy or petty treason and would have been sentenced to burn by the courts anyway, so they were just saving the courts time and money.
In a comment Exal says that in the story Charlotte Ermengarde had the local court convict Takako of witchcraft.  As wealthy estate owner she might have had a lot of influence on the local courts.  Thus she would not be taking any risk by persuading the local court that Takako was a witch and getting them to execute Takako.
But the laws against witchcraft in England in the 1600s were the laws of 1563 and 1604, which made witchcraft a felony, which was thus tried by secular courts and not by ecclesiastical courts.

This provided, at least, that the accused persons theoretically enjoyed the benefits of ordinary criminal procedure. Burning at the stake was eliminated except in cases of witchcraft that were also petty treason; most convicted were hanged instead. Any witch who had committed a minor witchcraft offence (punishable by one year in prison) and was accused and found guilty a second time was sentenced to death.

https://en.wikipedia.org/wiki/Witchcraft_Acts#Witchcraft_Act_16044
So Takako would have been hanged if convicted of causing someone's death by witchcraft, or for a second offense.
But if Takako was convicted of killing someone in authority over her, she would be guilty of petty treason, and that would be legal grounds for burning her at the state.
Otherwise the magistrate who sentenced Takako would have greatly exceeded their legal authority by ordering death by fire and would face some possibility of being punished for it.
Thus it is seen that the account in the story is not impossible in the sense of violating any laws of physics, but is extremely improbable.  Furthermore, some of the characters may have violated laws of Japan, or England, and/or other countries during the story, which is not impossible of course but does lessen its probability of happening.
Comment: I hadn't mentioned it because it wasn't relevant to my actual questions, but Charlotte had gotten the local judiciary to burn Takako (who had displeased her in several ways) at the stake as a witch.  The timing is right for witch-hunts in Britain.
Comment: @Exal   I have modified by answer to acknowledge the witchcraft trial.  However, the details of what particular witchcraft crimes Takako was convicted of would determine whether her sentence was within the law or the magistrate greatly exceeded his legal authority.
Answer: The Answer: Maybe, maybe not.
The name Takako seeems to be a modern name. Women in Middle Ages Japan mostly had 2 (or 1) Japanese syllables in their names. For example, see the register of names from the official investigation conducted in 1671 below:

A sampling of the first 5 names from the top row: A-Ki, Ka-Me, Fū, Man, and Ka-Me. Out of 127 women in a Middle Ages village, only 10 women have 3 syllables in their name.
Ta-Ka-Ko sounds to me like a modern name after Japan "opened" and revolutionized in 1868, when Japan officially allowed peasants to have names. (Prior to that, some Japanese peasants did not even legally have a "name".)
But it is true many Japanese peasants were "traded" to Europe by the merchants who came to Japan with Jesuits in 16th century.
And regarding what you mention in the quest:

The apparent timespan puts Takoko's presence directly at the beginning of Japan's Sakoku, their period of severe isolationism, and in fact Britain had cut off all trade with Japan in 1623.

I don't know where you got that information, but on 8th January 1614, the Tokuguwa shogunate officially announced the complete ban on the spread of Christianity anywhere in Japan. It is called 伴天連追放之文 (Bateren-no-Tsuihō-no-Bun), per this Japanese Wikipedia article; the corresponding section of this English Wikipedia article translates it as the "statement on the 'Expulsion of all missionaries from Japan'".
P.S.: The "official" but last "English" advisor, Willam Adams from Britain, had already died in 1620.
P.S. 2: Already before the Tokugawa family seized power, 26 Japanese were crucified by Hideyoshi Toyotomi on February 5, 1597; they became known as the 26 Martyrs of Japan.
Comment: While still not really what I asked, the information on names is genuinely interesting!
Comment: @Exal. It would be because I am native. But how could I "prove", a woman traded by Portuguese merchants, to Europe around 1543-at least 1590, have been to re-traded to Grate Britain. May be could be, may be not.


Show pdf differences on GitHub

Question: Is there any way to show differences (on commits info) between two versions of pdf (or doc, odf) file? Now I can only download any version on it ("view raw" button).
Answer: PDF, DOC, and ODF files are binary formats, and don't contain plain text.  Git doesn't really support human-readable diffs for binary files - it can generate binary diffs, but it won't make much sense without additional processing.
See this answer for more info handling binary diffs: https://stackoverflow.com/a/4705537/247763
As far as I know, the only binary format that GitHub can display diffs for is images.  Image diffs are custom parts of GitHub that were written to compare the two different image versions in the repository, but this is not a native Git feature.
If you need to see the differences between two versions of a binary file, see what functionality the standard editor already has.  Recent versions of Microsoft Word can display differences between two DOCX files, but that has to be performed on your machine only - not on GitHub.
Answer: You're still going to have to download the two PDF files to your computer. Even if you wrote an extension for chrome/firefox to view the diff in-browser, you'd still have to download the files.
As for doing the actual diff, you can try DiffPDF or the xdocdiff plugin for WinMerge.
If you want to view the diffs on the GitHub website, make a suggestion to GitHub to add that feature. The only way you can avoid downloading both PDFs is to have GitHub servers generate the diff.

Show pdf differences on GitHub


How to connect IBM Voice Gateway or voice agent to other APIs

Question: I am working on voice agent solution by IBM. I need to understand how can I connect it to database to do verification example policy number. When I created voice agent service it bind it-self with other services like speech to text, text to speech, conversation. Now how can I create a layer in between to get the intent and invoke outside API or connect to database. Is there any way to connect and get data from other api with conversation dialogs. it would be great if some one can guide. I want voice agent to connect to other api to retrieve insurance values and so-forth. Please advise. Thanks S
Answer: The architecture you're looking for is the following:
Service Orchestration Engine (SOE)
Essentially its a sort of proxy that stands between the Voice Gateway and the Watson Conversation service.
We have a few samples on our Github repository that will help you get started: https://github.com/WASdev/sample.voice.gateway/tree/master/soe
In the Voice Agent service there should be an option to choose a Service Orchestration Engine - https://console.bluemix.net/docs/services/voice-agent/managing.html#managing


formal definition of "fractal" or standardized categories?

Question: fractals are many decades old and come up in a wide variety of contexts and can be generated in so many different ways. however, a formal definition of fractal seems really slippery/ difficult. are there any authorities/ experts who analyze this question and try to come up with formal or informal definitions/ categories more than a sentence long, and maybe attempting more formal definitions? or maybe some attempt at general categorization? (note that a naive attempt to define fractals by their fractal dimension might not seem to succeed, because wouldnt it also come up with fractal dimensions of pure randomness/ noise? etc)
Comment: @EricTressler Self-similarity is perfectly well defined - a compact set is self-similar, if it is the invariant set of an iterated function system. Also, I'm not sure what the court case reference is about - though, it is interesting.
Comment: There is no widely accepted formal definition. Informally, a fractal is any mathematical structure that exhibits self-similarity on different scales. Self-similarity is also not defined. Cf. Jacobellis v. Ohio
Comment: @MarkMcClure It's possible to define self-similarity, but it always misses key examples, and so I would argue that it is a "know it when I see it" definition, and not formal, if it is to include everything we would like.
Comment: @EricTressler It's not just "possible" to define self-similarity - it's simply a term that is already in wide spread use with a very specific meaning in the context of fractal geometry. Of course, there are obvious variations just as there are variations on the definition of, say, a group from abstract algebra. But a group is a group and a self-similar set is a self-similar set.
Comment: @Eric think you have a start at _one_ definition or broad category, but wonder about necessary vs sufficient conditions. are _all_ invarant sets of iterated function systems fractals? and are _all_ fractals invarant sets of iterated function systems? one would at least have to show that all classic fractals can be converted. 2 test cases: sierpinski triangle, mandelbrot set. etc. ps Wolfram has a lot of writing/ analysis & relating to classifications etc.
Comment: @vzn It is precisely this kind of imprecision that leads me to say that fractals are difficult to define. We want to include a lot of disparate things, and thus no strict definition contains all of them.
Answer: As far as I know (I've heard so many years ago), fractal is supposed to be defined as a set (in Euclidean space, I guess it could be extended to some other kinds of spaces) whose Hausdorf dimension (= fractal dimension) is grater (not equal) than its topological dimension (it's never smaller).
Fractals are not necessarily self-similar at all, but it seems that they have to be (non-formally speaking) infinitely detailed, infinitely intricate, because something in its structure has to (when scaled up) make it increase more than its topological dimension would suggest, e.g. Koch's snowflake has topological dimensiopn 1 (it's a line) but scale it to factor 3 and it will be 4 times bigger. Such things are easy to see with self-similar fractals.
Also, self-similar set is not necessarily a fractal. Let's take a square. Cut it into 4 little squares. You've just divide it into pieces that are similar to the whole set. So it's self similar. (Or a line segment, just cut it into 2 or more pieces.) Its Hausdorf dimension is 2, just like it's topological dimension. So Google's definition is just a whole load of ...
Of course, how do you construct or define a fractal that is not self-similar? You can imagine constructing Koch's snowflake by adding a spike to a each line segment at each step. And with a different self-similar fractal, you do something else (into infinity, to make it infinitely intricate). If you repeat the same process, you will get a self-similar structure. So you need to do different things. The process has to be irregular. But if you use finitely many ways to do the next step (and just stick to irregular pattern of how you apply them, kind of like decimals of an irrational number versus rational), then again it will appear self-similar (you'll zoom in and keep seeing familiar patters that will remind you of what you've seen before). I could go on and on, but I'll let you ("you" = "whoever reads this at the time") have a good think about it yourself.
For the reason briefly explained in the last paragraph, the fractals studied happen to be mostly either self-similar or at least appear self-similar (in the sense that details seem to repeat, they kind of look like what you've seen before while zooming in). That's why they are thought of as "intricate objects that look like their parts".
About the definition of fractal function in Zach466920's answer: the problem is that not all fractals (or other sets we consider whether they are fractals) are functions. I guess Koch's snowflake is (you can describe it easily with a parametric equation, and the function used is nowhere differentiable). But what can you do with Cantor set or Sierpiński triangle?
However, the objects with Hausdorf dimension greater than their topological dimension surely deserve some name. Give them a name or not, but start studyng them and you will end up studying fractals. So it seems the only sensible way I see to formally define fractals is with Hausdorf dimension. (By all means disagree with me.) I used to think that that was the official definition in maths. But now ...
Answer: There's a couple of things going on here.
Deterministic Fractals:
These are fractals constructed in a algorithmic way.

In the above example, you can clearly see what makes the fractal self-similar. It's also readily apparent that it has a Fractal Dimension different from the topological dimension. These fractals, are created by defining a self-similarity relation, that's why it's no surprise that they are self-similar, they are quite literally defined to be so!
Non-Deterministic Fractals

You can clearly see that the Mandelbrot Set boundary depicted above is a fractal, the boundary is quite complicated!  However, what you can't place is exactly how the boundary is self-similar. This is because there is inherent randomness in the process of making the fractal. Although, the process itself is deterministic, inherent properties of numbers prohibit a simple formula for the boundary. It's much like how we can deterministically find primes, and find their distributions, yet still the primes themselves have an element of randomness. Perhaps most interesting, is the fact that the Fractal Dimension of the boundary is $2$.
So it's really the Non-Deterministic fractals that make for a hard time. This also includes fractals with a deterministic creation, but with non-obvious self-similarities.

This is a deterministic fractal, but the actual nature of it's self-similarity is less than obvious. And of course, that doesn't even scratch the surface of what fractals are in reality/nature. For instance there are DLAs, Hofstadter's Butterfly, and so many other things that are fractal, but hard to point out why.
What is a Fractal?
Michael Barnsley presents a definition in Fractals Everywhere. He gives a formal treatment on page 356. Informally, it's a set that is invariant under a certain transformation.
Others say that a fractal's Haussdorff dimension must be strictly greater than it's topological dimension. I believe Falconer discusses that in a book here.
Google says, "a curve or geometric figure, each part of which has the same statistical character as the whole". Pretty much what the average person thinks.
Personally, I couldn't care less about using notions of self-similarity and fractal dimensions to define what a fractal is. In that way, I'm closer to the statistical point of view. In my opinion, a function is fractal if and only if it is bounded, continuous, and nowhere-differentiable in some region $R$. This is closer to the pathological function view of what a fractal is. Surprisingly relevant in the Path Integral Formulation of Quantum Mechanics.
With respect to your objection about random phenomena, yes they are fractal. A white noise plot is fractal by 2 out of the three definitions discussed above. However, if it helps, my definition yields it as not a fractal.


Why is it that in DDO (Dungeons & Dragons Online), paralyzed characters still "move"?

Question: This has been annoying me for the past months, well since I've been playing Dungeons & Dragons Online, that paralyzed characters still move around when getting "paralyzed". Not sure if it's the game, my client installation, my connection, or God punishing me for playing so much. Anyone have a clue?
Comment: For reference, by the D&D third edition rules (http://www.d20srd.org/srd/conditionSummary.htm#paralyzed), paralyzed means a character cannot physically move or take actions, although it can take purely mental actions like concentrating on an existing spell. At one point in my campaign, a player was effectively paralyzed by Strength-draining poison, dropped to the ground under the weight of his own clothing, then skidded from the room using his own Fly spell like a ragdoll pulled by a string.
Answer: Its a known long standing bug. Devs have mentioned that they "finally fixed it" a few times but it still happens quite often especially if you paralyze them when they are moving. It used to be more common though, so they are improving.
Comment: While I didn't know it was a bug it certainly looks like one--paralyzation doesn't always abort existing movement.
Answer: Part of the problem is lag between the player using an effect that causes paralysis, that instruction being sent from the client to the server, then the server updating the monster, and finally the server sending the updated data back to the client.
This is why the monsters appear to 'slide' to their updated position.
There's no real way to cure lag problems without letting the client override the server update, and that would open up endless avenues for hacks.
Comment: Not quite, they simply get caught in run animation. You can do this in the lobster via tumble. If you start a tumble when you get paralyzed then you will finish the movement even though yous till have the effect. Going one step further you can do the same thing and add in an attack and continue attacking while paralyzed.


When is the "Match Finish" XP actually awarded?

Question: Can you quit during the Play of the Game and still get it? Or when the cards are shown, but before the XP screen? Or do you have to wait past everything?
Comment: Pretty close, if not duplicate: [At which point does a game count towards my stats?](http://gaming.stackexchange.com/q/270627/108003)
Answer: XP and SR is awarded the moment the Victory/Defeat animation plays.
At this point, you will appear as "In Game: Match Ending" to friends. This is the moment where the "Open Lootbox" option appears, assuming the game you've just played resulted in a level up. In competitive, it is also the moment where quitting no longer results in penalties.
After quitting, it is possible your state will still be "In Game: Match Ending" for a moment longer than your client, especially on faster computers. If you queue again immediately, your first attempt might automatically cancel when you transition from "In Game: Match Ending" to "In Menus". This is more noticeable if you've brought a group with you when you leave. Just wait a few seconds and try again. This is still significantly faster than waiting through PotG, MVP, and award animations.
Comment: Assuming this, one can safely exit the game with all points being awarded properly even before POTG starts to play? Will he/she be able to start searching for a new game while the previous match is in summary state? You might want to add this to your answer.


Auto-zero chopping op amps & ADC conversion

Question: In our project, we developed and tested a auto-zero chopping op amps coupling with Sigma-delta ADC for low-frequency voltage signal measurement. Below is the FFT spectrum from the 1-bit data stream of the ADC. Now, I am designing a decimation filter to convert 1-bit to high-precision data word. I noticed that there are several noise peaks around our chopping frequency. I wonder if I have to design a notch filter to take care of those peaks or just a regular sinc3 filter would suppress the noise and do the conversion efficiently.
Thanks in advance.
Comment: What delta sigma converter and auto zero amp? need a part numbers. What is your signal bandwidth?
Comment: Does the chopper frequency change with temperature or from opamp to opamp? If it comes from an on-chip oscillator, it is likely to be quite variable, which is not compatible with a notch filter...
Comment: Hi, this is a customize ASIC which is not available on the market and we don't have the data sheet for it yet. The chopping frequency is generated by external circuit using a phase-locked-loop
Comment: worked with some people who developed AutoZero opamps. The onchip surge currents, of analog switches and switch drivers and FlipFlops and oscillator, transitioning in a few nanoseconds (even with reduced VDD) would make the GND and VDD rails ring, and that ringing comes thru the large output analog FETs to induce the ringing and spikes into the analog output. At about the 10 millivolt level. Thus you need to attenuate that 10 milliVolts down to << 1 microvolt?
Answer: Standard practice with analog clocked filters chopper amps is to analog filter to take out the clock frequency (don't forget that Nyquist criteria apply to these filters and amps!)
Standard practice for decimation is to digital filter below the new Nyquist frequency.
Answer: When you're designing a decimation filter, the purpose of the stopband is to reduce that part of the input signal spectrum below the level that would cause you problems if aliased down to baseband.
If your approach was only to design sufficient stopband to suppress the noise-shaping rise, then you would be short of attenuation for the noise peaks around your chopping frequency. Whether you go for additional attenuation by means of notch filters, or simply a more aggressive general stopband, is up to you. Note that if the chopping frequency were to change, perhaps due to substituting a different amplifier, then you would have to redesign the notch filter to cope.
My general strategy is to do limited sinc decimation to get the data rate down, followed by further polyphase FIR decimation to flatten the passband.
Comment: Thank you for your detailed answer. It helped me to confirm my thought. I was thinking the same too to flatten the passband and give more attenuation for the noise peaks around my chopping frequency.


Medical expenses tax deductions - billed vs. paid

Question: In the USA, total medical expenses above a threshold may be deducted from taxes. If a medical expense occurs in December and the bill is paid in January, for tax purposes, does this expense occur in the December year or the next (January) year?
Comment: And right now the floor is changing: it is 7.5% for 2018, but 10% starting in 2019 (except for 65+). But with the TCJA-increased standard deduction, fewer people (perhaps many fewer) will get any benefit from itemizing.
Comment: @dave_thompson _085 Are you sure about the 7.5% floor in 2019 for people over 65?  My Google search said the floor is going to 10% for everybody.
Comment: @ab2: you're right. The new pub 502 isn't out (and the 2017 one was 'printed' while TCJA was still under consideration) so I just assumed it would go back to 2016 rules, but on checking [the nearly-official source](https://www.law.cornell.edu/uscode/text/26/213) (see (f) at the end) it does go 'back' to 10% for everybody. Down with the geezers!
Answer: The expense occurs when you pay it, so the expense would be deductable for the year of that January. (Source: working with a tax accountant last year when I was in a similar situation.  Disclaimer: I am not an accountant.)
Additional source, IRS pub 502, at the end of page 2:

You can include only the medical and dental expenses
  you paid this year, regardless of when the services were
  provided.


VPN block by nation states

Question: If possible, how would a nation state prevent a SSH connection to a US visitor's home IP in the United States?  Assume that the visitor is not a dissident, journalist or of any particular interest to the nation state and just wants the freedom to view (not send) his messages.
Answer: One option is to just blacklist residential IP ranges. Other option is packet inspection. An SSH tunnel can be distinguieshed from standard https
Answer: If you are asking how the foreign nation state would block the connection from their country back to the US, it of course is done on the nation state side. Many foreign networks including China inspect traffic and block VPNs, SSH and other encrypted remote access connection methods by default.  They may also do geo-location blocking where they block access to large IP blocks that are registered to US companies.

VPN block by nation states


HTML5 iframe in HTML4 document

Question: Is it possible to include iframe with HTML5 format inside HTML4 document?
Then, will HTML5 features work as expected?
Or, will root document restrict the HTML5 features?
Answer: The doctype declaration will not restrict the elements if the browser needs to support the element.
https://html5test.com/results/desktop.html
 Source: HTML 4 Iframe with HTML5 content
So, answering your questions:

Yes it is possible to do this.
Yes all features will work, if the browser supports it.
No there will be no restrictions because of the document.
Comment: Thanks! I thought there was no post on this. Thanks for the reference!
Answer: Normally, it will be. Frame rendering is independent of the parent page, so I think you will be able to load almost any page, even HTML5, in a frame on a root page with an older !DOCTYPE.

HTML5 iframe in HTML4 document


Is a freestanding bag effective for honing your strikes?

Question: Heavy bags and speed bags are too expensive because they require some kind of stand/platform. So I have to use a freestanding bag. Is a freestanding bag effective for training (honing your strikes?)? If not, is there an alternative that does not require any bag? (The alternative should not require building, making, etc.)
This image is the kind of freestanding bag that I have.
Comment: Do you mean the kind of punching bag which you fill the base with water or sand? And it has a kind of cylindrical part sticking up with padding on it that you punch?
Comment: Yes. Also, it is the kind where the bottom is also some kind of bag/padding, and not solid.
Answer: There are several benefits you get from punching and kicking a hanging heavy bag. Primarily you do it to condition your body to make that impact. It's absolutely vital for being able to punch hard in real life. Without that conditioning, you can easily hurt yourself if you do have to punch someone for real. Same with kicking and other strikes.
Other benefits are:

Training full body mechanics.
Being able to drill combinations.
Training proper distancing.
Focus and precision targeting.
Speed.
Footwork.
A good workout.

Whereas a free-standing bag like the question mentions is less heavy and probably not as tall. It will give you some resistance, but not as much as you would get in a hanging heavy bag. Is it enough resistance to be able to condition your punch to impact properly? It's much better than punching the air, but you're going to need a heavy bag if you want to do proper conditioning. The heavier the better.
Another down-side of using a free-standing bag instead of a heavy bag is that it might be too short to practice face/head level punches and kicks. Some are high enough, but they're the weakest at those locations due to being the furthest away from the ground. It means you feel less resistance up high than down low.
The free-standing bags also typically have padding all around them and are pretty soft. Heavy bags are made using canvas and have no padding. Depending on what you fill it with, it can feel like hitting a brick wall.
That's another advantage of heavy bags. They let you fill them with whatever material you want. You can determine how soft or hard you want it. It just depends on your experience level and how strong your conditioning is.
So conditioning is the biggest disadvantage of a free-standing bag. You'll get some conditioning, but not the same as a heavy bag.
On the plus side, most other things you get from a heavy bag also apply to a free-standing bag. You can practice combos, distancing, targeting, etc.
A free-standing bag also is far more portable. You can just set it up anywhere. Pour water or sand into it. If you want to transport it, dump it out. Take it anywhere you want. It's a pain having to do that, though. In my experience, once you set it up somewhere, you won't want to go through the hassle of emptying it out and moving it again. So this is a minor advantage.
Whereas a heavy bag either requires installing an extra support beam in your ceiling just to handle the load, or you need some kind of heavy metal frame to hang it from and weigh down the metal frame with barbell weights or sandbags. It takes a lot more effort.
You could keep the free-standing bag and just work on conditioning with some other apparatus that doesn't involve setting up a heavy bag. Some like makiwara training. I think makiwara are limited in terms of which techniques you train, so I would look at maybe wrapping a big tree in blankets and padding and using that. Get some bungee cables, some blankets, and buy some yoga or gymnastics mats or something to wrap inside of it. Now you just need to find a big, thick tree somewhere and have at it. Easy to set up and take down. You get to determine how soft or hard to make it. Also, make sure you're not destroying the tree. Trees need love, too. :)
Hope that helps.
Comment: Agree - you can hit a heavy bag hard (to get the conditioning effects mentioned) or light (for beginning / aiming techniques). But I regretted getting a freestanding bag - no satisfying impact or associated benefits (like making you learn to hold your wrists straight, and knuckle conditioning), and my jab would make it recoil far enough that a subsequent cross ("reverse punch") would not make contact.
Comment: @AmorphousBlob Yes I think those free-standing bags always felt disappointing to me, too. But I kept thinking there was a way to maybe fill up the core of the cylindrical part of it. Maybe you can fill it with sand or rocks to make it more firm. Another comment mentioned that it makes a weird angle as it recoils away from your punch. A hanging bag does the opposite angle, which targets the top knuckles instead. It's maybe not the end of the world, but kind of irritating I guess.
Answer: A free standing bag is a very useful training device. It may not provide the movement offered by a heavy hag, but in the absence of anything else, it offers an excellent way to gauge range and power, and - to an extent - footwork.
Never forget though, to train your strikes without a bag. Shadow sparing will improve your core stability, balance, retraction speed and posture more effectively than a bag. It trains you to miss without losing balance or composure.
When you train with a bag, the bag acts as a support, a brace against which to lean and from which you can more easily retract your strikes. If you do not train without a bag, you will likely become dependent to some degree on this support, which will make you more vulnerable in a fight.
Answer: In Taekwondo, we mainly use standing bags for our training. This allows us to kick over the bag if needed and allows for moving of the bags for different drills. These are 6 foot bags that weigh from 105lbs of sand (Versys VS1) on the base to over 270lbs or sand or water (Wavemaster 2XL Pro) making it quite hard to knock over. The base on that Wavemaster holds better to impact than the older 400lbs bases.
The standing bags can be just as effective as a heavy bag if you have a good one. Things that constitutes a good bag is one that does not fall over easily and does not move very much when hit. Using a plastic base on a wooden floor for example may not be your best option as it will cause the bag to slide every hit.
While on the road, I use a sand weighted bag that isn't very sturdy. This is the Century Vesys VS1. It's a great bag but not for delivering power. This is for portability and it is effective enough for training on the road. If you have someone hold the bag, it can take a considerable amount of power but it will fold under heavy loads.

While at home or in my dojang, I use a water weighted standing bag that takes a lot of power to knock down like the Century Wavemaster 2XL Pro. These are my bags of preference when training strikes as I can practice delivering punches and kicks at full power without protection and they can withstand them. A truly solid roundhouse, or sidekick, back kick, or other truly heavy power kick will still knock these bags over when full. It is recommended to have someone hold the bag for repetition training on these types of strikes. I find that tipping point on these bags to be a good measure of a truly powerful strike and will often only count a kick in a repetition of power training if it knocks it over.

Depending on the discpline, training style, and your ability, the bag is just a tool to develop your skills. A heavy bag provides an irreplaceable resistance to strikes but is not mobile. These stand up bags are soft to the touch, but a strong blow will cause damage. Depending on what you are training, a stand up bag can be utilized effectively to give you what you need. If you want to harden your punches, you can always punch wood. We train our techniques on these stand up bags and then develop striking endurance by hitting canvas, trees, and other harder materials. You can most certainly learn and practice with these bags as long as you train with good integrity and discipline.


The OLE DB provider "MSDASQL" for linked server "(null)" reported an error. The provider did not give any information about the error

Question: I need to import multiple files with a varying number of columns into SQL Server through a script. I am trying to use OPENROWSET for this. I have done the following.

Installed driver on the client X64 PC.
Execute below commands.

EXEC sp_configure 'show advanced options', 1;
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;

When trying to read the file through
SELECT * from OpenRowset('MSDASQL','Driver={Microsoft Text Driver (*.txt;*.csv)};DefaultDir=c:\Delme\;','select * from input.csv' )

I am getting the following errors.

Msg 7399, Level 16, State 1, Line 17 The OLE DB provider "MSDASQL" for
  linked server "(null)" reported an error. The provider did not give
  any information about the error. Msg 7303, Level 16, State 1, Line 17
  Cannot initialize the data source object of OLE DB provider "MSDASQL"
  for linked server "(null)".
Comment: Why have you tagged Oracle?
Answer: Check in ODBC Data Source Administrator that the name of your driver is correctly written in your OpenRowset call. If you're using Microsoft Text Driver it's likely that the name is actually
Microsoft Text Driver (*.txt; *.csv)

Note that this name has a space after the semicolon.
Personally, I don't have Microsoft Text Driver - I have Microsoft Access Text Driver and have to specify it as
Microsoft Access Text Driver (*.txt, *.csv)


Example of strictly increasing discontinuous function with intermediate property on non compact set

Question: I know that strictly increasing function with intermediate value property on compact set is continuous .I wanted to find counterexample if I remove compactness condition.Any help will be   appreciated
Answer: There is no such counterexample: the assumption that the domain is compact is unnecessary.  Indeed, suppose $A\subseteq \mathbb{R}$ and $f:A\to\mathbb{R}$ is strictly increasing and has the intermediate value property.  Let $a\in\mathbb{R}$.  If $a$ is not in the image of $f$, then by the intermediate value property the entire image of $f$ is greater than $a$ or the entire image of $f$ is less than $a$.  Thus $f^{-1}(-\infty,a)$ is either empty or is all of $A$.  If $a$ is in the image of $f$, let $b\in A$ be such that $f(b)=a$.  We then have $f^{-1}(-\infty,a)=(-\infty,b)\cap A$ since $f$ is strictly increasing.
Thus in all cases, $f^{-1}(-\infty,a)$ is open in $A$.  Similarly, $f^{-1}(a,\infty)$ is open in $A$ for any $a\in\mathbb{R}$.  Since intervals of this form generate the topology on $\mathbb{R}$, it follows that $f$ is continuous.


Nexus 4 download issue

Question: I own a nexus 4 and since then i am unable to download anything via 2g/3g.
I am able to download content only through wi-fi.
The same applies for PlayStore. I have even tried in safe mode.
I have tried to clear data of Download Manager and even Playstore but in vain
Please help.
Comment: What kind of content are you trying to download? Is it only through Google Play, or something else as well?
Comment: Any app from playstore and also general content like images,songs etc...The same can be accomplished via wi-fi.
Comment: This might be obvious, but did you pay your phone bill?
Comment: lol...I have paid..:D
Answer: I finally solved the issue. It was related to my APN. My Access Point allowed only browsing. I changed it to another access point, and it worked!

Nexus 4 download issue


Non-Equilibrium Statistical Mechanics

Question: Can anybody please explain what is the difference between equilibrium state and steady state, as quoted by book by Degroot and Mazur. Also, does violation of Principle of Detailed Balance means the system will not reach equilibrium?
Answer: The meaning of the word equilibrium depends on its context; it occurs in, inter alia, biology, chemistry, economics, and physics.
In physics, a good definition is that interaction rates are time symmetric - a process occurs just as fast forwards as backwards. As a consequence, the system's macroscopic properties do not change with time.
A steady state is a state with properties that do not change with time, but it isn't necessarily time symmetric.
Answer: The difference between steady state, equilibrium, and nonequilibrium can be understood using the diagrams given by D.Chowdhary et. al in the book Stochastic Transport in Complex Systems.

a) Steady State: The total probability current into 1 is exactly balanced by total probability current out of the site 1. Hence, rate of proabability current at 1 is 0. Or mathematically it means that $P_C$ is independent of time: $$\sum_{C'}W_{CC'}P_{C'} = \sum_{C}W_{C'C}P_C $$
b) Detailed Balance or Equilibrium: The existence of equilibrium demands much more stronger condition: $$W_{CC'}P_{C'} = W_{C'C}P_C$$
for all configurations $C$ and $C'$. The net probability current must be balanced in the forward and reverse direction by the members of each pair of configuration.
c) Nonequilibrium steady states:  When detailed balance is violated, then the condition of pairwise-balance holds which mainly means that
$$W_{CC'}P_{C'} = W_{C''C}P_C$$
It implies that for every configuration $C'$ which can be reached directly from C a unique configuration $C''$exists. In fig (c), you can see that probability current from $1\rightarrow 2$ is exactly balanced by $2 \rightarrow$ 3, and similarly current from $2 \rightarrow 3$ is balanced by $3 \rightarrow 1$. At each site, the rate of change of probability current is zero.
In particular, the difference between steady state and equilibrium can be seen in this experiment on MIT website:Difference between steady state and Equilibrium
Answer: When looking at gas dynamics in particular, it is also possible that the steady state is not in equilibrium because the flow has become frozen. In other words, the energy is locked in each molecule and unable to transfer to others for various reasons, usually because the time between collisions is too large.
This is in obvious contrast to an equilibrium state.
An example of the difference between equilibrium and frozen flow for a rocket nozzle shows that the two are bounding cases for the real situation. The flow is in equilibrium in the subsonic region, non-equilibrium through the throat and eventually becomes frozen as the flow accelerates considerably through the nozzle.
To answer the second part, a violation of detailed balance does not mean that it will not reach equilibrium, just that it is not yet in equilibrium. Detailed balance is valid only at equilibrium -- if the system is not yet in equilibrium, it is not possible for the processes to be reversible.

Non-Equilibrium Statistical Mechanics


Whatsapp only partially restored

Question: Phone got stolen and got a replacement today. Restored Whatsapp It had stuff going back 2 years, but it didn't have the last 7 weeks of chat, I checked the settings and it's supposed to backup everyday...Is there something I'm missing?
Comment: Can't say for sure without having the old device but maybe it was not backed up to Google Drive? Even if it did, such problems have been widely reported. All I can suggest is uninstall and try restoring again
Answer: If the backup went all the way till %100 but you didn't get the past 7 weeks, this would mean that WhatsApp wasn't backing up for the last 7 weeks.
Being that the phone is now lost, there is no way to know why this is so. The fact that Google drive backup setting is set to do it every day, doesn't mean that this is the setting you had on your old phone. Because, WhatsApp backups do a full backup on your messages and media, but not your WhatsApp settings.
So it's very possible that on your old phone the setting was changed 7 weeks ago by mistake. Also possible that Google drive wasn't making backups for another reason. No real way to find the reason without checking on the old phone.

Whatsapp only partially restored


Does the fighter's Action Surge work with ranger's Dread Ambush?

Question: On the tabletop when you have dread ambush (lv3 ranger) you get 1 extra attack when you use your action to attack on your first turn, this means when you use action surge (lv2 fighter) to get another action to attack with you get another extra attack. Does this work the same on Baldur's Gate 3? I'm planning on making a 3 lvs in assasin rogue, 3 lvs in gloomstalker ranger and 2 lvs in fighter build.
Answer: To the best knowledge, all bonuses work independently, so you can't get a bonus triggering a bonus.
If you have a Dread Ambusher feat from the Gloom Stalker class:

On the first turn of combat:
Movement Speed increases by 3m.
Gain an additional attack that deals +1d8 damage.

and the Action surge from the lvl 2 fighter

Immediately gain an extra action to use this turn.

Assuming you have only one regular attack, you can:

Get the bonus attack from Gloom Stalker, but only on the first round
Attack
Use action surge and attack again.

BUT, saying all that, your build is very sub-optimal, as you won't get the "Extra attack" feat, which is available for

Barbarian at level 5
Fighter at level 5 and level 11
Monk at level 5
Paladin at level 5
Ranger at level 5
College of Valour at level 6
College of Swords at level 6

So you would do much better if you get either 5 levels of a ranger or 5 levels of a warrior. There is a similar build for Astarion here with 5 Gloom stalker, 4 Rogue (thief is better than assassin) and 3 Battle master fighter.
With the build above you can get up to 5 attacks in the first round (more with certain weapons and feats)
Comment: @Yasskier It's a semantics thing. In BG3 you "can make an additional attack on your first turn", but in DnD 5e you "make an additional attack when you take the attack action on your first turn", meaning you can make an additional attack each time you take the attack action.
Comment: The gloom stalker/thief/fighter build should be getting 8 attacks in the nova round, not 5.  2x Dread Stalker + Extra Attack, 2x normal action attack + Extra Attack, Action Surge, 2x normal + Extra Attack, and then two bonus action attacks with the off hand.
Comment: @LessPop_MoreFizz umm, how do you get two dread attacks? Is that DND 5 version? Because I'm 99% sure that you just get one Dread Stalker as a bonus action, then you have your regular attack + extra attack from lvl feat. Power surge resets the regular + extra attacks. I admit I'm not sure about the offhands, since I rarely use them.
Comment: @Yasskier an error on my part; Dread Striker doesn't work with Extra Attack; still, 5 in the first round is low. 1 from dread striker, two from the attack action, with extra attack, two more from action surge providing the attack action with extra attack again, and two more bonus action attacks, for a total of 7 attacks in one round before factoring in options like Haste or Elixir of Bloodlust.


onload not firing in Chrome

Question: Loading a PDF in an <object> tag, I want to show an indicator while the document is being loaded instead of just an empty element, so I positioned a Load Panel over the <object>. I added a function to hide the panel:
function documentLoaded() {
    // Code to hide panel here.
}

And set it to fire in the onload event of the <object> tag:
<object type="application/pdf" data="/documents/sample.pdf" onload="documentLoaded();"></object>

This is working exactly how I want it to in Firefox and in Edge, but when I tested it in Chrome the Load Panel never went away. When I debugged it I saw that the documentLoaded() function was never called at any point.
Is there another way to get this to work with Chrome, or another way completely to call a JS function once the PDF is ready?
Answer: document.querySelector('#load_panel').onload=documentLoaded()

Comment: Hi Leonid, Can you elaborate on your answer? Right now, your answer is just a line of code with no explanation.

onload not firing in Chrome


Setting event date as "preferred" in Gramps

Question: In Gramps, if I have three different sources stating three different years for the same person's birth year, is there a way to identify one of those dates / sources as "preferred", while keeping all three dates / sources attached to the person?
Answer: In Gramps you can create a custom event type.
I have created, alongside the built-in Birth type, a custom Alt-birth type.
By adding the details of your preferred record to the Birth it will always be shown first as the birth event.
By adding the details of your other records to the Alt-birth event(s), these display in the individual's timeline according to their date.  But they are not selected when sorting/searching/displaying a family's Births.
Answer: I am not aware of an explicit "preferred" setting, but I noticed that the first event of a given type seems to be displayed in contexts where it is required  (e.g. the tree view). Maybe this can help you, but alas, this would help only a little bit when you (or someone) else looks at a specific person and tries to figure out which of the events is the "right" one.
Answer: You can use a different "Role" for the other "Birth" events.
The preferred should still use the default (which is "Primary") for the role. You could use a custom type of role (such as "Unproven", "Disproven" or "Questionable") for the other Birth events.
Only the event with the Role as "Primary" and 1st in the list of Events will be considered as the Birth Date.
Since Baptism and Christening are "Fallback" events for Births, multiple instances of those event types follow the same pattern.


Android: Alarm app best practices?

Question: I'm writing a simple alarm clock app to introduce myself further to android development.
I've looked at the android tutorials for alarms; for starting services and activities. In my case I want to set an alarm time, then start something that runs for say 1/2 hour after the alarm is fired.
During this 1/2 hour there will be background tasks happening but also on-screen information being displayed.
I am mostly curious as to what is best practice in this case. Should I run the background tasks as a service and the foreground as an activity? As the on screen activity is running at the same time as the background tasks would it be better just to run it all in an activity?
Cheers!
Answer: I'd say the best way is the way Google does it.
Take a look.

Android: Alarm app best practices?


How to create a API user in Marketing Cloud Org

Question: I want to connect my Marketing cloud org and Salesforce org using the marketing cloud managed package. In the documentation for installing the app it is mentioned that I need to create a API user in the marketing cloud Org but I'm not able to create a user as the create button on users is non-clickable.
Also, the currently active users are also not showing the any checkbox of API user.
How can I create this API user and why is it not giving me the permission to create new users?
Answer: Check your user roles/ permission. You need to be a Marketing Cloud Admin to create/ edit user details.
Comment: how can I check my user roles/permission in marketing cloud?
Comment: Admin > My Users > UserName. Then check the username box then select Manage Roles. The API Access is on the User screen. Click the name link on the My Users screen. The field is API User Yes/No.


Is it general for such laptops to be loud?

Question: I have AMD A10 with 4 cores, AMD Radeon HD 8670M. (Asus x550ze) It's fan is loud. Is it normal for such powerful laptops to be loud or I made a bad purchase ?
Answer: Laptops have small fans because of the space restrictions. If those small fans want to produce a larger amount of air, they have to turn very fast which makes them loud.
In addition you are dealing with an AND CPU which produces more heat than a comparable Intel CPU.
One thing you can try is a cooling pad. They lower the temps by 5 to 10 degrees according to my experience. But get a unit with it's own power supply - not USB powered.
http://www.bestbuy.com/site/laptop-accessories/null/pcmcat238900050004.c?id=pcmcat238900050004
Comment: Replacing the fan is probably counterproductive. The solution is a desktop in a nice big box with big fans that turn slowly.
Comment: Can I replace fan with maybe more quiet one ?
Comment: *AMD and @GeorgeJ, you can... but they don't get very quiet :(
Comment: @GeorgeJ quieter fans will almost always have a lower airflow and result in less cooling going on when what you really need is more.  It's a matter of blade surface area and blade speed and at the fan size you need most of the noise is caused by the fan cutting through the air. All the fans with similar airflows will be almost equally loud.  As whs says the best thing you can realistically do is to get more cool air to the existing coolers and hot surfaces by using a cooling mat.  I would do that *before* drilling holes into the laptop as suggested in the other answer.
Answer: As @whs says, laptops fans DO get very loud...
Some advice:

According to the Amazon reviews, a few people drilled holes into their cases:

-Tends to overheat with a 35w CPU. I had to drill holes in the case just to get more air to the fan. It doesn't overheat now.

[http://www.amazon.com/X550ZE-DB10-15-6-Inch-Graphics-Windows-Upgrade/dp/B00YR6BJLC]
[http://www.amazon.com/gp/customer-reviews/RIFIKNVUNLUOU/ref=cm_cr_pr_rvw_ttl?ie=UTF8&ASIN=B00YR6BJLC]

You can also try replacing the fan, though it doesn't seem to be easy to do on your device and I'm not sure how effective that is...
On Windows, make sure no background processes/apps are using up too many resources by going to the task manager.
You can also try a Cooler Pad
You can also clean your laptop... Dust buildup often blocks airflow and leads to heating
Comment: Please do yourself a favor and check where your drilling... You DON'T want to end up with a processor with a hole through it... :P


JMeter: I have to run scenario where I am loading the api

Question: I have to start with 100 users and keep increasing them gradually until they reach 1000 and I have to run it for some duration.
I am trying threads as 1000 and ramp up as 10 that means 100 users will hit in 1st second and 200 in another and so on.
I am not sure on:

How to run it for particular duration?
After that reaches 1000 users would it become stable like the load will be for 1000 users only?

I want the thread to start with 100 users and 200, 300 then reach 1000. How could I achieve that? Currently with number of threads= 1000 and ramp up of 10 I see it starts with 0 and reaches 1000 instantly .
Answer:
You can specify your test desired duration via "Duration (seconds)" input of the Thread Group

If you want to have "stable" load of 1000 concurrent users after the ramp-up time make sure to tick "Infinite" box next to "Loop Count"

You can observe how many virtual users were online in this or that period of your test execution using Active Threads Over Time listener (can be installed using JMeter Plugins Manager)


I am a track athlete, Does gymnastic help a track and field athlete, in terms of getting faster, pole vault and throwing?

Question: I do the decathlon and am very weak in the pole vault, do you guys think that gymnastic will aid in strength and help increase my athletic ability. Does it aid in speed also I want to really know
Comment: FYI, GSP does it for MMA and this cool guy on Endomondo (https://www.endomondo.com/profile/7595642) could probably answer the speed relationship as he routinely does 1 hour workouts of ten miles and posts gymnastics workouts.
Answer: I'd say absolutely yes.
Gymnasts perform some of the most impressive feats of physical strength of all time. This is because at all times, they perform feats using only their own bodies as resistance. That gives them an amazing ratio of strength to bodyweight.
Since it will generally improve your lean muscle gain, I believe it will decidedly aid you in improving other athletic endeavours, especially track and field type events, such as pole vaulting, shot putting, discus, hammer and javelin throwing.
As for running speed, I can't really say. It will entirely depend on what type of gymnastics you will be doing. Bar work engages mostly upper body for movement, and lower body only for balance. However, tumbling will have it distributed more evenly. Here you'll be looking for explosive leg work, which is more general and not gymnastics specific.
But overall, I'd recommend anyone to try gymnastics. It's a fun and diverse way of training, and will yield amazing physiques to those who try it long enough.
Comment: I personally think the bigger issue is "Will the gains from this cross-training be worth the extra time?" but that's such a subjective question...
Answer: Yes. but not necessarily in the way that you think.
It will have some impact on the pole vault in being able to possible improve body position, but the larger part of the pole vault is technique and core/upper body strength to get the twist/push off of the pole correct. You may get some effect from ring work, but you're more likely to see better results from specific weight training solely for the pole vault.
Where you are possibly more likely to notice improvements are the long jump, javelin and high jump. One of the core concepts in gymnastics for the floor and vault routines is called blocking. Blocking is basically just taking horizontal momentum (The runup) and turning it into vertical momentum. Mastering that will give you definite gains in the high jump and long jump, as you will get better at the launch point, and possibly in the javelin as well. You might think that blocking would help in pole vault, but there really isn't a definite "stop" point, you tend to run a bit through the plant of the pole to produce the tension/bend in the pole before pushing off the ground.


How to release one's work into the public domain?

Question: How can I show that my self-published work is in the public domain? Simply by stating something like "Released into the public domain"? Or using the public domain symbol ?
Comment: https://creativecommons.org/share-your-work/
Comment: @wetcircuit Creative Commons licenses are different from Public Domain.
Comment: I'm afraid you don't understand what public domain means: https://en.wikipedia.org/wiki/Public_domain#Public_domain_books. **Your published work will have a copyright whether you like it or not.** Creative Commons allows you to declare – unambiguously – how others may use your work, while it is still under your copyright.
Comment: @wetcircuit Yes, I know that by not declaring something as ©ed, it's considered ©ed by default.
Answer: Laws are complicated. Consider releasing your work under CC0, which was developed by professionals to make it as easy as possible to get you work released "completely as possible in the public domain":

[W]hile no tool, not even CC0, can guarantee a complete relinquishment of all copyright and database rights in every jurisdiction, we believe it provides the best and most complete alternative for contributing a work to the public domain given the many complex and diverse copyright and database systems around the world.

(See the full description for a better explanation.)
I've seen this license used on Stack Exchange, announced in user profiles. It's important to understand a little more about why this works here: SE content is automatically licensed as CC BY-SA, but it's a non-exclusive license, so the author can dual license it. (There's no reason for your audience to not take advantage of the most permissive license when there's more than one.) Check the terms of where you're publishing to ensure that this type of licensing is possible for you. It should be possible if you're self publishing.

As for how to show this, the CC Wiki has a tool to generate HTML to announce your license. Or you can just have "Copyright and related rights waived via CC0" displayed in the description for your work.
Answer: As the author of an original piece, you can declare it is in the public domain in lieu of declaring your ownership of copyright. The phrase you used is fine. An article at stanford.edu recommends the phrase "Dedicated to the Public Domain" (search the link for the word 'Dedication' to see for yourself)
Once it is in the public domain, anyone can do anything with the text, including producing a derivative work and claiming it as their own, or selling it.
If you want others to use your work without restrictions and don't care about making $$ then you could publish it under Creative Commons License. This makes it free for anyone to use and replicate, but restricts them from selling or claiming authorship. They can extend the work, creating a kind of co-authorship situation, but the derivative works are also bound by the Creative Commons License.


Install a LetsEncrypt certificate with no DNS access

Question: A client of mine has a domain, and pointed the A record of his domain to my machine, so I can develop a site. Usually, when I have the control of the DNS it's pretty easy to get the LetsEncrypt certificate and the https working. However, I'm not able to do this now that he has the DNS and it's pointing only the A record to my IP, and I'm not sure why. Any clue?
Answer: Let's Encrypt supports multiple ACME challenge types. If you cannot use DNS-based domain verification, your alternative is to use the HTTP challenge, i.e. the --webroot option in certbot.
In this mode, CertBot just needs to place a specific file in your web directory so that the Let's Encrypt server can successfully download it – for which, the existing A record is sufficient. However, you need a web server to be already running on port 80.

Configure the webserver to serve e.g. /var/www at this domain, over plain HTTP.
certbot certonly --webroot -w /var/www -d example.com
Certbot puts a file under /var/www/.well-known/acme-challenge/, Let's Encrypt downloads it
Now finish the webserver's configuration to also serve the domain over HTTPS.

(Note that you need to keep the plain-HTTP port-80 access working for every renewal as well. It's okay to redirect it to HTTPS, but the challenge file still needs to be accessible.)
Answer:
Usually, when I have the control of the DNS it's pretty easy to get the LetsEncrypt certificate and the https working.

If you are using DNS-01 to validate a site, then TXT records are added temporarily to the DNS zone during that process. Assuming DNS-01 is being used, it seems likely that Certbot cannot add the necessary TXT records for validation.
The simplest alternative is to use HTTP-01 validation instead with the --webroot options (as pointed out in the answer by @grawity). You cannot be issued a wildcard domain certificate with this method (e.g. *.example.com), but you should be able to use Subject Alternative Names (SANs) with it (assuming you need a certificate that also covers subdomains, etc.).


How did Ram and Krishna become the dominant Gods in Hinduism?

Question: Hinduism is traditionally a polytheist religion with a wide variety of Gods. In contemporary times, I find that, Ram and Krishna have come to be perceived as the primary Hindu Gods, atleast in certain parts of India. This is reflected in worships, temples, also in festivals such as Diwali, Holi which are central to Hinduism.
How did these 2 Gods emerge to be central deities in Hinduism?
Comment: Could you edit your question to clarify where you've searched and what you found already, complete with links and references, and context if applicable? In particular, please let us know what you find missing or unclear about the Wikipedia entry on the topic, if one exists. This allows those who might want to answer to do so without needing to redo the work you've already done. You might find it helpful to review the site [tour] and [help] and, in particular, [ask].
Comment: I can see this question being answered here, but it may be more appropriate for [Hinduism.SE](https://hinduism.stackexchange.com/).  History will provide a sociopolitical analysis; Hinduism would, I hope, provide a more informed answer with reference to concepts specific to Hinduism.  Recognizing that my studies of Hinduism are both casual and years out of date, I think @Manu's answer is good, but strives to fulfill both viewpoints, and falls short of fully satisfying either.  Which kind of answer are you looking for?
Answer:
Hinduism is traditionally a polytheist religion with a wide variety of gods.
  Wrong.
  Hinduism is often misunderstood that it is polytheistic. This is extremely inaccurate. We are polytheistic, monotheistic, and nontheistic. All of us who have souls and hearts (athma), no matter who we are, are a part of the embodiment of Bhagavan. Bhagavan is defined as the combination of all our Athma (souls). While praying to Bhagavan, you are praying to all living things. We have no god in the traditional sense, but we worship Bhagavan. Bhagavan has an equal good and bad side. When you come down to earth, you have good and bad. If you have almost all good, then you can attain Moksha, when you never come back down to earth. This means you will never have to deal with evil, and you will be happy. Now, since everyone is part of Bhagavan, everything is God. So we have over a trillion gods, since we count microbes and bacteria as well. So, we are polytheistic as well. But then, Bhagavan is just the combination of souls, and it is only based on the 4 principles (Karma, Dharma, Samsara, and Moksha), so we are non-theistic as well!

Major Gods are different parts of Bhagavan. So, although me and you are both "gods", one good quality in all of us could be categorized as a major god who Hindus worship.
Rama and Krishna are not major gods at all, they are avatars of the major god Vishnu who has 10 avatars. Shiva, Brahman and Vishnu are the 3 most major gods.
However, before praying to any other gods, we pray to the lord Ganesha, the removal of troubles.
To answer your question, Rama and Krishna both have the most great festivals. Other great festivals include Navarathri, but that is dedicated to all female gods, not just one singular god. Other great festivals include Pongal, but that is dedicated to the harvest, not a god at all!
When talking about festivals, please note that I am talking about Tamil celebrations more than the other variations of Hinduism.
Try to check out the book "Sri Rudram" by Swami Dayananda Saraswati to learn more, or go to your local sage. If you want to, you can learn Sanskrit and read directly from the Vedas.
All in all, we are still polytheist, in the framework of being monotheist, which is in the framework of being nontheist. We are not, and we were never, duo-theist.
Hope this answers your question.
Comment: Where is the starting citation you include from? Is that from the book you mention later on?
Comment: Yes, the book is quite large and includes lots of aspects of Hinduism. I am a devout Hindu as well, and I learn about this and much more of Hinduism from Ashrams (monasteries), and discuss this. I also have my personal copy of Bhagavat Gita and many other books related to Hinduism.


Is there a way to list keys in context.Context?

Question: So, I have a context.Context(https://golang.org/pkg/context/) variable with me, is there a way I can list all the keys this variable holds?
Comment: Yes, with reflection.
Comment: @leafbebop You're correct it doesn't, if it did you would not need reflection. With reflection however you can inspect the internal structure that implements the Context interface including its fields, if there are any. So given this https://github.com/golang/go/blob/master/src/context/context.go#L479-L482 you can do this https://play.golang.com/p/zGDb6ZkogSX
Comment: If you just want to see the keys (but not process them from code), just print the context like `fmt.Println(ctx)`: https://play.golang.org/p/lPaOTM-nV6b
Comment: No there is no real way to list the keys, because context is an interface and it depends on the implementation.
Comment: @mkopriva would you please elaborate it? It seems to me that the `context.Context` does not provide an API for looking up keys.
Comment: Oh, I get it, thanks. But I should say, there is a chance of breaking your code if the `Contex` interface is not implemented by the standard library or if the standard library changes its implementation.
Comment: @leafbebop that applies to all cases where one uses reflection to inspect the unexported details about a type. The provided example is just that, an example, it has more problems than the ones you've pointed out and therefore it is not inteded to be used as a robust solution to the problem.
Answer: It is possible to list the internals of context.Context using unsafe reflection and using that information to figure out the keys and/or see if the information you want is in the context.
There are some pitfall such as if the context implementation returns a hardcoded value for a key it wont show up here, and it can be quite unclear on how to actually access the values using keys.
This is nothing I run in production. But in my case I needed to be able to inspect the context.Context to understand better what information it contains.
func printContextInternals(ctx interface{}, inner bool) {
    contextValues := reflect.ValueOf(ctx).Elem()
    contextKeys := reflect.TypeOf(ctx).Elem()

    if !inner {
        fmt.Printf("\nFields for %s.%s\n", contextKeys.PkgPath(), contextKeys.Name())
    }

    if contextKeys.Kind() == reflect.Struct {
        for i := 0; i < contextValues.NumField(); i++ {
            reflectValue := contextValues.Field(i)
            reflectValue = reflect.NewAt(reflectValue.Type(), unsafe.Pointer(reflectValue.UnsafeAddr())).Elem()

            reflectField := contextKeys.Field(i)

            if reflectField.Name == "Context" {
                printContextInternals(reflectValue.Interface(), true)
            } else {
                fmt.Printf("field name: %+v\n", reflectField.Name)
                fmt.Printf("value: %+v\n", reflectValue.Interface())
            }
        }
    } else {
        fmt.Printf("context is empty (int)\n")
    }
}

Examples:
func Ping(w http.ResponseWriter, r *http.Request) {
    printContextInternals(r.Context(), false)
    /* Prints
        Fields for context.valueCtx
        context is empty (int)
        field name: key
        value: net/http context value http-server
        field name: val
        value: &{Addr::20885 Handler:0xc00001c000 TLSConfig:0xc000001c80 ReadTimeout:0s ReadHeaderTimeout:0s WriteTimeout:0s IdleTimeout:0s MaxHeaderBytes:0 TLSNextProto:map[h2:0x12db010] ConnState:<nil> ErrorLog:<nil> BaseContext:<nil> ConnContext:<nil> disableKeepAlives:0 inShutdown:0 nextProtoOnce:{done:1 m:{state:0 sema:0}} nextProtoErr:<nil> mu:{state:0 sema:0} listeners:map[0xc00015a840:{}] activeConn:map[0xc000556fa0:{}] doneChan:<nil> onShutdown:[0x12e9670]}
        field name: key
        value: net/http context value local-addr
        field name: val
        value: [::1]:20885
        field name: mu
        value: {state:0 sema:0}
        field name: done
        value: 0xc00003c2a0
        field name: children
        value: map[context.Background.WithValue(type *http.contextKey, val <not Stringer>).WithValue(type *http.contextKey, val [::1]:20885).WithCancel.WithCancel:{}]
        field name: err
        value: <nil>
        field name: mu
        value: {state:0 sema:0}
        field name: done
        value: <nil>
        field name: children
        value: map[]
        field name: err
        value: <nil>
        field name: key
        value: 0
        field name: val
        value: map[]
        field name: key
        value: 1
        field name: val
        value: &{handler:0x151cf50 buildOnly:false name: err:<nil> namedRoutes:map[] routeConf:{useEncodedPath:false strictSlash:false skipClean:false regexp:{host:<nil> path:0xc0003d78f0 queries:[]} matchers:[0xc0003d78f0 [GET POST]] buildScheme: buildVarsFunc:<nil>}}

    */

    printContextInternals(context.Background(), false)
    /* Prints
        Fields for context.emptyCtx
        context is empty (int)
    */
}

Comment: This function was extremely helpful to me. SAML claims attributes were getting swallowed by the SAML package this helped me find them immediately.
Comment: @Robin this looks super helpful! But can someone please explain the `inner` parameter? It's not immediately obvious to me what it does.
Comment: @fIwJlxSzApHEZIl it just prints the package name and struct name in the initial call ("Fields for context.valueCtx" in my example)
Answer: No there is no way to list all the keys of context.Context. Because that type is just an interface. So what does this mean?
In general a variables can hold a concrete type or an interface. A variable with an interface type does not have any concrete type informations on it. So it would makes no difference if the interface is empty (interface{}) or context.Context. Because they could be a lot of different types which are implementing that interface. The variable does not have a concrete type. It is just something abstract.
If you use reflection you could observer the fields and all the methods of the type which is set to that variable (with interface type). But the logic how the method Value(key interface{}) interface{} is implemented is not fixed. It does not have to be a map. You could also make an implementation with slices, database, an own type of an hash table, ...
So there is no general way to list all the values.
Comment: "it makes no difference if it is interface{} or another interface" is really misleading. It makes a huge difference what interface type an interface value is. That's the whole point of defining interface types.