What is Virtual DOM?

Question: Recently, I looked at Facebook's React framework. It uses a concept called "the Virtual DOM," which I didn't really understand.
What is the Virtual DOM? What are the advantages?
Comment: I agree with the above sentiments with regard to moderation. Moreover, I believe this is a very valid and useful question. "Virtual DOM" is often referenced, but rarely defined.
Comment: I believe Virtual DOM is talking about nodes that are not in the normal DOM.
Answer: React creates a tree of custom objects representing a part of the DOM. For example, instead of creating an actual DIV element containing a UL element, it creates a React.div object that contains a React.ul object. It can manipulate these objects very quickly without actually touching the real DOM or going through the DOM API. Then, when it renders a component, it uses this virtual DOM to figure out what it needs to do with the real DOM to get the two trees to match.
You can think of the virtual DOM like a blueprint. It contains all the details needed to construct the DOM, but because it doesn't require all the heavyweight parts that go into a real DOM, it can be created and changed much more easily.
Comment: It's basically abstraction over abstraction which in the end what react does it look for the the reference in its object model tree, select the real node in the html and tinker with it. The sound is great ```virtual dom```, but it's nothing fancy and overhype.
Comment: What do you mean by "it doesn't require all the heavyweight parts that go into a real DOM" - heavyweight parts ?
Comment: @AjayS manipulate real DOM is not very efficient, that's why it's called heavy API.  Manipulate objects in memory is much faster and more efficient, updating part of the DOM that changed is also more efficient and faster.
Comment: Can this be used for the entire DOM, instead of just a part of it?
Comment: So Virtual DOM is faster than updating normal DOM (not in terms of React/Vue, just in simple JS)?
Answer: Let's take an example — though a very naive one: If you have something messed up in a room in your home and you need to clean it, what will be your first step? Will you be cleaning your room which is messed up or the whole house? The answer is definitely that you will be cleaning only the room which requires the cleaning. That's what the virtual DOM does.
Ordinary JS traverses or renders the whole DOM instead of rendering only the part which requires changes.
So whenever you have any changes, as in you want to add another
 to your DOM then the virtual DOM will be created which actually does not do any changes in the actual DOM. Now with this virtual DOM, you will be checking the difference between this and your current DOM. And only the part which is different (in this case the new
) will be added instead of re-rendering the whole DOM.
Answer: A virtual DOM(VDOM) is not a new concept: https://github.com/Matt-Esch/virtual-dom.
VDOM is strategically to update DOM without redrawing all the nodes in a single page application. Finding a node in a tree structure is easy but the DOM tree for a SPA app can be drastically huge. Finding and updating a node/nodes in case of an event is not time efficient.
VDOM solves this problem by creating a high level abstraction of actual dom. The VDOM is a high level lightweight in-memory tree representation of actual DOM.
For example, consider adding a node in DOM; react keep a copy of VDOM in memory

Create a VDOM with a new state
Compare it with older VDOM using diffing.
Update only different nodes in real DOM.
Assign new VDOM as an older VDOM.
Comment: high label or high level?
Comment: "The VDOM is a high level lightweight in-memory tree representation of actual DOM." Where can I find more about this "representation" ? How is implemented? How the tree looks like?
Answer:
The virtual DOM is an in-memory representation of the real DOM
elements generated by React components before any changes are made to
the page.
It's a step that happens between the render function being called and
the displaying of elements on the screen.
A component's render method returns some markup, but it's not the
final HTML yet. It's the in-memory representation of what will become
real elements (this is step 1). Then that output will be transformed
into real HTML, which is what gets displayed in the browser (This is
step 2).
So why go through all this to generate a virtual DOM? Simple
answer — This is what allows react to be fast. It does this by means
of virtual DOM diffing. Comparing two virtual trees — old and
new — and make only the necessary changes into the real DOM.

Source from my blog Intro To React #2
Answer: All the answers are great. I just came up with an analogy which probably can give a real-world metaphor.
The real DOM is like your room, nodes are the furniture in your room. The virtual DOM is like we draw a blueprint of this current room.
We all have the experience of moving furniture, it's very tiring (Same concept as updating views in computers). Therefore, whenever we want to change the position/add furniture (nodes), we want to only do the very necessary change.
Blueprint came for the rescue to achieve it. We draw a new blueprint and compare the difference with the original one. This lets us know what part has been changed and what part stays the same. We then do the necessary change to the real room (update the changed nodes on the real DOM). Hurray.
(Some might think, why do we have to rely on the virtual one and don't directly compare the real DOM? Well, in the analogy, comparing the real DOM means you have to create another real room and compare it with your original one. It's just too costly.)
Answer: This is a brief description and reiteration of the Virtual DOM often mentioned alongside ReactJS.
The DOM (Document Object Model) is an abstraction of structured text, which means it is made of HTML code and css.  These HTML elements become nodes in the DOM.  There are limitations to the previous methods of manipulating the DOM.  Virtual DOM is an abstraction of the literal HTML DOM created well before React was created or used, but for our purposes we will use it in concert with ReactJS.  The Virtual DOM is lightweight and detached from the DOM implementation in the browser.  The Virtual DOM is essentially a screenshot (or copy) of the DOM at a given time.  A way to look at it from a developers perspective is the DOM is the production environment and the Virtual DOM is the local (dev) environment.  Each time the data changes in a React app a new Virtual DOM representation of the user interface is created.
The most basic method needed in order to create a static component in ReactJS are:
You must return code from the render method.
You must convert every class to className since class is reserved word in JavaScript.
Aside from the more major changes there are minor differences between the two DOMs including three attributes appearing in the Virtual DOM but not in the HTML DOM (key, ref and dangerouslySetInnerHTML).
An important thing to understand when working with the Virtual DOM is the difference between ReactElement and ReactComponent.
ReactElement

A ReactElement is a light, stateless, immutable, virtual representation of a DOM Element.
ReactElement - This is the primary type in React and resides in the Virtual DOM.
ReactElements can be rendered into HTML DOM
var root = React.createElement('div');
ReactDOM.render(root, document.getElementById('example'));
JSX compiles HTML tags into ReactElements
var root =
;
ReactDOM.render(root, document.getElementById('example'));

ReactComponent

ReactComponent - ReactComponent's are stateful components.
React.createClass is considered a ReactComponent.
Whenever state changes the component is rerendered.

Whenever a ReactComponent has a state change, we want as little change to the HTML DOM as possible so ReactComponent is converted to the ReactElement which can then be inserted to the Virtual DOM, compared and updated fast and easily.
When React knows the diff - it's converted to the low-level (HTML DOM) code, which is executed in the DOM.
Answer: It's a neat concept: instead of manipulating the DOM directly, which is error prone and relies on mutable state, you instead output a value called the Virtual DOM. The Virtual DOM is then diffed with the current state of the DOM, which generates a list of DOM operations that would make the current DOM look like the new one. Those operations are applied quickly in a batch.
Taken from here.
Answer: Virtual Dom is created one copy of Dom. Virtual dom is compared to dom, and virtual dom update only that part in dom which changed. it's not rendering the whole dom it's just changed the updated part of dom in dom. It's very time consuming and from this functionality, our app works fast.
Answer: Virtual DOM is a partial or full copy of the browser DOM tree structure. It is created by the frameworks like React and kept in the memory for manipulations via app code.
As and when necessary, virtual DOM is used by the app code to update the browser DOM – the DOM that actually represents the user interface.
Also, it is worth noting that Virtual DOM is just a design pattern and can be implemented by anyone even in plain javascript.
React batches the app state changes before pushing those to the real DOM. The latest virtual DOM diffing gives React all the impacted nodes. The impacted nodes of the virtual DOM are then pushed to the real DOM by a highly efficient process called reconciliation.
The below image demonstrates Virtual DOM diffing and reconciliation with real DOM in React

Read more here - React virtual DOM explained with examples
Advantage -
Note that when you add, delete or modify a node in the DOM tree, the browser needs to perform calculations and adjust the screen layout and content to sync the user interface with the app state. In highly complex, reactive, and interactive applications where you see a continuous stream of data and events, the DOM may require frequent updates.
Updating DOM (& repainting the browser screen) at a high frequency is a big problem and that is where Virtual DOM in React js comes to the rescue.
Answer: React's structural unit is component. Each component has a state. Whenever the state of a component is changed, React modifies the V-DOM tree. Thereafter latest version of the V-DOM is compared with previous version of the V-DOM. After this calculation(diffing) when React knows which V-DOM objects have been changed it modifies only those objects in the R-DOM.
In layman's terms,
Say I have added a div element in DOM, React creates a copy of V-DOM without changing the whole R-DOM. This newly created V-DOM is compared with older V-DOM. It updates only different nodes in real DOM. Now the newly created V-DOM is regarded as previous version for upcoming V-DOM.
P.S. 1. So Unlike plain js Whole new version of V-DOM is created and R-DOM is partly updated.
2. React does not update every single change in state, rather updates to the R-DOM are sent in batches.
Answer: According to React doc: https://reactjs.org/docs/faq-internals.html#what-is-the-virtual-dom
'In React world, the term "virtual DOM" is usually associated with React elements since they are the objects representing the user interface. '
import React, { Component } from 'react'; //You need to do this inside a module to import

class App extends Component{
   render(){
       return (
       <button>Hi</button> //This returns a virtual DOM
       )
   }
}

The code inside return is actually a call to function React.createElement:
//render can be rewritten like this:
render(){
   return [
            React.createElement(
                'button',
                {
                    key: null,
                    ref: null,
                },
                'Hi',
            )
   ]
}

which returns something like this:
{
  $$typeof: Symbol.for('react.element'),
  type: "button",
  key: null,
  ref: null,
  props: {
     children: 'Hi',
  }
}

and this is virtual DOM. It's an JavaScript object which costs much less to manipulate than the actual DOM element created by
document.createElement('button');

which is also a JavaScript object looks like this:
accessKey: ""
ariaAtomic: null
ariaAutoComplete: null
ariaBusy: null
ariaChecked: null
ariaColCount: null
ariaColIndex: null
ariaColSpan: null
ariaCurrent: null
ariaDescription: null
ariaDisabled: null
ariaExpanded: null
ariaHasPopup: null
ariaHidden: null
ariaKeyShortcuts: null
ariaLabel: null
ariaLevel: null
ariaLive: null
ariaModal: null
ariaMultiLine: null
ariaMultiSelectable: null
ariaOrientation: null
ariaPlaceholder: null
ariaPosInSet: null
ariaPressed: null
ariaReadOnly: null
ariaRelevant: null
ariaRequired: null
ariaRoleDescription: null
ariaRowCount: null
ariaRowIndex: null
ariaRowSpan: null
ariaSelected: null
ariaSetSize: null
ariaSort: null
ariaValueMax: null
ariaValueMin: null
ariaValueNow: null
ariaValueText: null
assignedSlot: null
attributeStyleMap: StylePropertyMap {size: 0}
attributes: NamedNodeMap {length: 0}
autocapitalize: ""
autofocus: false
baseURI: "http://localhost:3000/"
childElementCount: 0
childNodes: NodeList []
children: HTMLCollection []
classList: DOMTokenList [value: ""]
className: ""
clientHeight: 0
clientLeft: 0
clientTop: 0
clientWidth: 0
contentEditable: "inherit"
dataset: DOMStringMap {}
dir: ""
disabled: false
draggable: false
elementTiming: ""
enterKeyHint: ""
firstChild: null
firstElementChild: null
form: null
formAction: "http://localhost:3000/"
formEnctype: ""
formMethod: ""
formNoValidate: false
formTarget: ""
hidden: false
id: ""
innerHTML: ""
innerText: ""
inputMode: ""
isConnected: false
isContentEditable: false
labels: NodeList []
lang: ""
lastChild: null
lastElementChild: null
localName: "button"
name: ""
namespaceURI: "http://www.w3.org/1999/xhtml"
nextElementSibling: null
nextSibling: null
nodeName: "BUTTON"
nodeType: 1
nodeValue: null
nonce: ""
offsetHeight: 0
offsetLeft: 0
offsetParent: null
offsetTop: 0
offsetWidth: 0
onabort: null
onanimationend: null
onanimationiteration: null
onanimationstart: null
onauxclick: null
onbeforecopy: null
onbeforecut: null
onbeforepaste: null
onbeforexrselect: null
onblur: null
oncancel: null
oncanplay: null
oncanplaythrough: null
onchange: null
onclick: null
onclose: null
oncontextmenu: null
oncopy: null
oncuechange: null
oncut: null
ondblclick: null
ondrag: null
ondragend: null
ondragenter: null
ondragleave: null
ondragover: null
ondragstart: null
ondrop: null
ondurationchange: null
onemptied: null
onended: null
onerror: null
onfocus: null
onformdata: null
onfullscreenchange: null
onfullscreenerror: null
ongotpointercapture: null
oninput: null
oninvalid: null
onkeydown: null
onkeypress: null
onkeyup: null
onload: null
onloadeddata: null
onloadedmetadata: null
onloadstart: null
onlostpointercapture: null
onmousedown: null
onmouseenter: null
onmouseleave: null
onmousemove: null
onmouseout: null
onmouseover: null
onmouseup: null
onmousewheel: null
onpaste: null
onpause: null
onplay: null
onplaying: null
onpointercancel: null
onpointerdown: null
onpointerenter: null
onpointerleave: null
onpointermove: null
onpointerout: null
onpointerover: null
onpointerrawupdate: null
onpointerup: null
onprogress: null
onratechange: null
onreset: null
onresize: null
onscroll: null
onsearch: null
onseeked: null
onseeking: null
onselect: null
onselectionchange: null
onselectstart: null
onstalled: null
onsubmit: null
onsuspend: null
ontimeupdate: null
ontoggle: null
ontransitionend: null
onvolumechange: null
onwaiting: null
onwebkitanimationend: null
onwebkitanimationiteration: null
onwebkitanimationstart: null
onwebkitfullscreenchange: null
onwebkitfullscreenerror: null
onwebkittransitionend: null
onwheel: null
outerHTML: "<button></button>"
outerText: ""
ownerDocument: document
parentElement: null
parentNode: null
part: DOMTokenList [value: ""]
prefix: null
previousElementSibling: null
previousSibling: null
scrollHeight: 0
scrollLeft: 0
scrollTop: 0
scrollWidth: 0
shadowRoot: null
slot: ""
spellcheck: true
style: CSSStyleDeclaration {alignContent: "", alignItems: "", alignSelf: "", alignmentBaseline: "", all: "", …}
tabIndex: 0
tagName: "BUTTON"
textContent: ""
title: ""
translate: true
type: "submit"
validationMessage: ""
validity: ValidityState {valueMissing: false, typeMismatch: false, patternMismatch: false, tooLong: false, tooShort: false, …}
value: ""
willValidate: true

You can learn more about virtual DOM and React at https://indepth.dev/inside-fiber-in-depth-overview-of-the-new-reconciliation-algorithm-in-react/
Answer: React keeps a lightweight representation of the real DOM in the memory, and that is known as the virtual DOM. When the state of an object changes, virtual DOM changes only that object in the real DOM, rather than updating all the objects.
Answer: let's make order and sense in this matter.
React (or any other library) are a "layer" on javascript.
There is no such thing as virtual dom,
there is unattached dom .
let me explain in simple javascript :
 let vDom = {};     // this is a object that will be used to hold the elements

 let d = document.createElement('div');
 d.innerHTML = 'hi, i am a new div';

 vDom['newDiv'] = d;

at this point we have created a Div which is not shown on the dom , because it
  has not attached
but we can access it, add attributes, values, change etc..
once we call : (for ex,add it to body)
    document.body.appendChild(vDom['newDiv'])

then we will see it;
 for one how saw javascript libs come and go , i suggest to any one
 to do one simple thing : master JAVAscript, not layers :)

Comment: "There is no such thing as virtual dom" — There is. It's a core feature of how React works. The accepted answer on this question explains it quite well.
Comment: Your answer is actually describing a real DOM. The real DOM exists after you call document.createElement, doesn't matter whether it's been appended.

What is Virtual DOM?


Texworks syntax highlighting not working on windows 8 and 8.1

Question: any latex code I want to view in TexWorks 0.4.5 r.1280 (Miktex 2.9) won't show the syntax highlighting. It compiles just fine but everything line is written in black. On very long documents the highlighting shows for several seconds then the program freezes for short and the highlighting disappears again.
Windows compatibility modes did not improve the situation.
Does anyone have an idea what's going wrong here?
Comment: When the situation is, like you tell it in your comment to Harish's answer, then it is very probably an OS related issue and therefore off-topic on this site.
Answer: Go to Format → Syntax Coloring. In the list that appears, most probably you have None selected. Select LaTeX as in the following screen shot:

Bingo!
Comment: Thank you, but as I said, its does not work. I know how to switch it on. But that has no effects. Did you use win 8.1 for the screenshot?
Comment: It did work for me on both Windows 8.0 and 8.1. (I'm using TeX Live distribution though, which I highly recommend.)


How do I reset a Roland D-20?

Question: I wanted to know if there was any way I could reset a Roland D-20 back to all its original settings.
Comment: Not a novice to synths and midi and sysex files but this one is stumping me.
Just got a Roland D10 from eBay for a good price to add to my collection but I have a problem. I have managed to dump and save all the presets but as the performance patches are all mixed up to hell I wanted a clean fresh start. The trouble is it won't let me do a factory reset.
Pressing Tune/Function and Write while turning it on is doing nothing what so ever.
I changed the internal battery and even reseated the Intel chip and still nothing.
Confused to hell totally
Any help would be great.
Even tried leaving the bat
Answer: The Roland D-20 can be reset by following this procedure:

HOLD TUNE/FUNCTION AND WRITE WHILE POWERING ON.

According to a synth reset guide page.
Answer: If you need the factory patches, they exist as .MID files here:
http://www.rolandus.com/support/downloads_updates/eula.php?FileName=factorypatches.zip
You can dump them into your D20 with any freeware MIDI sequencer and a MIDI interface.

How do I reset a Roland D-20?


Clear Sonarqube Current Analysis

Question: I want to clear Sonarqube project current code analysis and make the project blank. Is it possible? I know we can clear all the previous analysis, but I want to clear the current analysis of Sonarqube project.
Answer: If you mean removing a "snapshot" of an analysis according to the most recent SonarQube documentation you should be able to this.  Also if you have access to the database SonarQube is using then you could remove the analysis directly from there.  That option may introduce other issues though depending on how SonarQube handles it.
Comment: I have gone through the latest document link which you attached in a comment. But there also they mentioned `Note that the most recent snapshot (labeled " last snapshot") can never be deleted`, but as per my requirenment I want to make my project blank so How can I do that?
Comment: It's not supported, but if you have access to the database you can remove the project data from there.  Beware though, this is unsupported and may break SonarQube depending on how you remove the data.
Comment: I have one more issue. Sonarqube is showing old bugs in new bugs. why?
Comment: Do you have any link from where I can find steps to delete Sonarqube analysis?

Clear Sonarqube Current Analysis


Why would someone be willing to sell BitCoins at substantially below market price?

Question: A local fellow in my area is will to sell BitCoins for below market price in exchange for cash.  I can't help be wonder if it's a scam.  Is there a reason why someone might be willing to do this?
Comment: Loosely related: http://bitcoin.stackexchange.com/q/13117/5406
Answer: Some possible reasons

He's an idiot/uninformed
He's willing to sell low because he wants to promote adoption
He's got a very low Net Asset Value (very early adopter)
He wants to unload a lot of coins quickly
He is trying to avoid records/taxes on this transfer
He's not willing to wait for the traditional fiat system (time preference)
He only has a high fee method of withdrawing fiat, so it is not actually a loss for him
He's got stolen/tainted coins
He's going to steal your cash

There is no official system in place to assign taint, but if they are from a highly publicized theft and not mixed before they are sold to you there may eventually be people in suits knocking on your door wanting to sieze them or asking awkward questions.
In 7 of these 9 reasons there is no real problem for the buyer, but if you want to avoid stolen coins or getting mugged you should ask some questions, get a copy of his ID, and do the deal in a public place with witnesses.
Comment: What are "tainted coins"?  I thought that concept was only a proposal.  Is there really such a list?
Comment: Also, considering the fees that he may need to pay to get the cash from an exchange it may actually not be bellow market price for him. Or he's willing to pay a premium to have cash "now".


Load XML containing 300 elements for each record into db

Question: So I have this large XML file containing 300+ elements for each record and I need to insert these records into a database table. The name of the nodes in the XML file are the same as the column names in the db. And they're all strings. Is there an automatic way to map them and insert the data or will I have to write out lines of code mapping each column to each element in XML file? Using SQL Server 2005.
Answer: I'd agree that with SQL server, using bulk load or SQL/XML is a good option.
If the database isn't SQL server and doesn't support xml natively, another option would be to use a basic xslt to transform the xml into csv or tsv; most databases can import delimited files.
Of course, another question would be: why have you got 300 columns?
Answer: What is the database engine are you using?
SQL server could import the data using bulk load, or import / export wizard, etc.
Microsoft KB, + Many Other Techniques
Answer: 300 columns? Not the way I read the question, but then again my english isn't that good. :)
As far as I know there's no auto mapping between Xml and database table/columns.  But it shouldn't be that hard to write a dynamic update? Get all the column names (nodenames) and add them to a string (column1, column2 etc.) and then iterate over the xml to produce the values (node1.Value node2.Value etc.). Or if you're using Sql Server 2005/2008 use the bulk insert.


How to capture Publish Transaction TCM URI in Custom resolver

Question: Can we capture the PublishTransaction TCM URI in custom Resolver while publishing?
Comment: Yes you can. TOM.NET API provides this capability.
Comment: would you please elaborate more info...
Comment: Have a look at the Tom.net API docs.  Otherwise share what you've read/tried to solve this and specifically where you got stuck.
Comment: Tridion.ContentManager.Publishing.PublishTransaction PT = new PublishTransaction(item.Id, context.Session);
Answer: It's not possible. The resolver doesn't know/care about the concept of Publish Transactions. To elaborate on this, the method signature Resolve has 4 parameters, none of which you can use to somehow trace back the ID you are searching for. Also, take the following scenario for example, when in the Publish dialog you click Show items to publish the resolver gets triggered, but there is no Publish Transaction yet because a Publish action is not yet saved. The Id is assigned upon saving.


Openid account validation without password reset

Question: I enabled Openid, and installed the OpenID selector module.  When a user logs in via openid, they have to validate their email, and the way to do so is by drupal sending them a one-time login link to reset their password.  Is there any other way to validate the email address?  Sending a password reset link is confusing for users.
Answer: If you want your users to be able to setup their own password, check out LoginToboggan. It adds password fields on the front-end user registration page and optionally links non-verified accounts to a "temporary" role on the site, if you want to limit their behavior/actions until they confirm the email.
It also features a lot of other goodies and tweaks, which make the registration/login process much easier.
Another option is Email Verification, which checks if the domain or host of the email address exist, and tries to validate the account by sending HELO/MAIL FROM/RCPT TO to the host's SMTP server.
Comment: Thanks for the module recommendations, but I guess I should have been more clear on my question.  What I really want to know if there's another way to validate a user account, without sending the user to the password reset page (e.g. send to a user confirmation page).  Sending them to a password change page might be a little confusing.


Could silicon-based lifeforms eat carbon-based food?

Question: Say a group of silicon-based aliens arrive on earth, would their bodies be able to extract any nutrients from carbon-based food?
Comment: Why would they need to eat organics?  All they have to do is scrape off a thin layer of debris to get at the yummy minerals.  Heck, they might not even notice the organics as their resilience would allow them to land hard enough to get down to the "true" surface of the planet.
Comment: two very different questions, ask them separately please.
Comment: This question could do with more information. How they normally get their energy and nutrients could make a big difference. Think for instance about how a human would struggle to extract nutrients from just eating soil put many plants are vey good at it.
Answer: Silicon bodies, carbon energetics.
from my answer here:
How could a pathogen feed on silicon while infecting humans?

Your opal creature uses silicon for its body, but has conventional
carbon energetics.
When we eat, we use our food for two things. We metabolize some for
energy and we use some for anabolic processes - building our bodies
There are creatures who split these functions. Iron oxidizing
bacteria, for example, have bodies made of the same sorts of carbon
molecules that we use. But for energy, they oxidize iron. They do not
use the products of their energy metabolism for any anabolic process -
the iron oxides are waste.
Your creatures use silicon to form their bodies. They are opalescent
creatures, their bodies laid down from layers of soluble silica.
Energetics however are much like ours - they oxidize oxidizable carbon
and retrieve the energy.

It is not so outre.  Consider our own bodies.  They contain a huge amount of calcium, as bones.  Can we "calcium creatures" eat glucose?  Sure!  We cannot use calcium containing molecules for energy.  We must obtain the calcium in our diets and then process it into bones, which costs energy to do but makes us awesomely bony.
So too your creatures.  Their bodies are made in large part of silicon and silicates or siloxanes.  Their energetic biochemistry is similar to Earth life, either reducing or oxidizing carbon containing molecules to release energy.  That energy is then used to do silicon chemistry just as we use energy to do calcium chemistry.
Comment: Interesting take, but would they then not be silicon based life forms? Just rather glorified coral?
Comment: @Gillgamesh I would argue it depends on _where_ the silicon is being used. The aforementioned iron-oxidizing bacteria use regular carbon biochemistry for _everything_ except their energy source. THere's no reason to think a silicon-based lifeform that uses carbon as an energy source would be any different (that is, using silicon for _everything_ except energy), and I would argue that such a creature is still 'silicon-based' (in contrast to real life stuff here on earth that uses silicates for shells but is otherwise ll carbon-based).
Comment: @Gillgamesh  Would you call iron oxidizing bacteria iron based life forms?  We have a lot of nitrogen in our bodies.  Are we nitrogen based life forms?    I think this is semantics.  A "silicon based life form" might use silicon for anabolism, for energetics, or both.  And let us have only good words and praise for the awesome silicate glass sponges!  Did you know they can live for hundreds of years?
Comment: I abase and myself in repentance before the ancient and mighty sponge.
However, it would chemically still be carbon based and using "silicates", not just semantics.  Which, if that is good enough for the OP it is good enough for me.
Aside note, most sci-fi depicts silicon based life forms as crusty rocky and rigid. I have a phone gel case, and uncle with an artificial heart valve, and stretchy sticky grabby hand that takes office at this stereotype.
Comment: @Gillgamesh I hope HR is ok with your stretchy sticky grabby hand at the office.
Answer: In general, as L.Dutch wrote, a silicon based lifeform will typically be unable to process carbon-based foods.
But since this is Worldbuilding, and you might need a different answer for your story purposes, let's look into ways to make it possible.
A hint in advance: I'm not a biologist. So I may be horribly wrong in what follows.
Our bodies, and those of any larger creature, are home to myriads of microbes, of which be benefit, as they do from us.
To the best of my knowledge, there are microbes on earth that are able to break down rocks.
On top of that, it seems that there is no (chemical) task you could think of without somebody somewhere finding microbes that already do that job. I'm probably exaggerating, but the general principle should hold.
So, your aliens are space-faring. That means they are technologically advanced, and by a lot, compared to us. They will surely know in advance what type of planets they will be visiting. It's unlikely they just stumble upon earth, Columbus-style or such. That means they will come prepared to facilitate their survival in the environments they encounter. Being technologically advanced, they may very well have bio-engineered some of their gut microbes so that those digest our carbon-based food and create silicon-based food as an end-product of their digestion, thus enabling your silicon-based aliens to benefit from carbon-based food.
Comment: I doubt that even alien gut microbes will be able to perform nuclear fusion. The aliens might have more luck eating rocks, many types of which contain lots of silicon.
Comment: Stretching the truth in just the right way, nice. They'd surely need lots of things other than just silicon, maybe even water, who knows.
Answer: Most likely not, in the same way no life form on Earth can extract nutrients from eating silicon based compounds. The closest thing I can call out of my mind is chicken eating stones to help them break food in their stomach and to get elements for the egg shell. But that's not made of silicon.
Moreover, a silicon based life form would be adapted to process silicon based compounds, with silicon adapted enzymes or equivalents. Enzymes are so specific that we are not able to digest cellulose, though it's made from chains of glucose. Imagine how big is the jump between carbon based and silicon based molecules.
Answer: Depends on what you mean by 'eat', and what you mean by 'life forms'. Silicon-based life could mean robots or otherwise mechanical creatures, they could take in the carbon-based items and burn it for fuel/energy. It's probably not going to be an efficient form of energy extraction unless they're built to harvest the joules that way, but it's certainly an option.
As for whether or not an actual living thing based in silicon instead of carbon eating carbon-based things, that's probably not going to work out. I don't think I've ever heard of something eating sand and getting nutrients from the sand itself. Maybe the tiny life forms in the sand but not the sand itself. I'm now envisioning a beach of carbon, the dark sand contrasting with whatever you have for oceans against the sunset, with a silicon crab seemingly eating the carbon sand only to spit it back out once it's done filtering what can sustain it out of the grains.
Answer: Different Nutrients:
This is implausible, since it's enzymatically unfavorable for a silicon organism to evolve enzymes to break down carbon organisms. After all, all the organic parts are immediately unusable for materials. But with a little manipulation, there could be benefits. There would also be large numbers of compounds in organics that would be poison to silicates, and the biological solvents would need to at least partly match up.

Plants are able to trap and decay animals to extract minerals like nitrogen from the animals, despite the plants not classically "eating" the animals. this is because the animal contains something useful to the plant. So if the silicon organism wants soluble iron, or sodium, or something like that, they COULD get it this way. It would be pretty inefficient, but not impossible.
I do agree (+1 Burki) that a hybrid organism (like a bacteria that is designed or evolved to use both carbon and silicon) could likely extract chemical energy and possibly some limited compounds (like ammonia) from the carbon-based food, then produce food usable by the silicon organisms. Again, this is likely to be pretty inefficient, but a species of great intelligence and limited imagination (or some other compelling reason like a genetic obsession to hunt and eat prey) could obtain at least partial nutrition from carbon-based food.
Answer: Vitamins
The silicon based organisms cannot survive by eating organics but organics carry trace elements that might be energy intensive to sift out of raw rock.  Thus, they often eat organics to gain a low cost source of those trace elements.
Getting High
Humans (and some other animals in Earth) often eat poisonous compounds to get high.  Organics may be poisonous to silicon based life forms.  However, in the right doses, they can cause various effects (getting a buzz, getting hammered, hallucinations) that they might enjoy.  "Gerbils make me jittery but oak is groovy..."
Answer: Actually, carbon and silicon can and do react with each other to form useful compounds, for example Carborundum and Silicones.
The former would probably be a good material for teeth (or skin scales or anything like that) and the latter could be used as analogues of blood, fatty tissue and for covering the bending parts of the limbs of your creatures.
So it could even be essential for silicon based creatures to ingest (at least some amount of) carbon or even carbohydrates.
Answer: Yes, given appropriate "circumstances", it could be the case.
This subject has been "entertained" in research and, in fact, relatively recently. The link points to an article (official scholarly reference here), which describes how scientists managed to slightly manipulate an enzyme from an extremophile bacterium and inject it into E. coli, which, given the "right" precursors, can catalyse the formation of carbon-silicon bonds. This is akin to carbon fixation (formation of organic carbon compounds from inorganic carbon).
Now, look at that! You get both elements at once, in living cells. These can be cultured in appropriate silicon-containing growth media and used as food by your aliens. If we are going to assume your aliens are like the "humans of their own environments", it is much more likely that they will have enzymes to break down such "organosilicon" compounds and suitably utilise that silicon, than to have the appropriate machinery for "silicon fixation" from "raw" inorganic silicon.


Can you get a refund of the application fee if your UK visa application is rejected?

Question: My friend has applied for a UK Family Visa which has been rejected.
Can he claim a refund of the application fee?
Comment: They stopped refunding the fee in 1991.  John's answer below is correct.
Answer: No, there are no refunds of visa application fees.  This is true in the UK and many other places as well.
In the UK the only times you may get fees back are if you voluntarily withdraw your application before it is processed, or if you are reapplying whilst concurrently appealing a prior rejection (in which case you may receive a refund of the second application fee but only if the appeal is successful).


Word 2007: Change the background to blue for all documents?

Question: I have a user who needs to have the page color set to blue due to retinal damage.  At best we can change the background to blue for the document he's currently working on but we need to set up Word so that all documents he opens are defaulted to a blue background.  This works great in Office 2003.  Any suggestions?
Comment: This feature of bluebackground/white text (to emulate WordPerfect) was removed in Word 2007.
Answer: Why don't you make use of the Accessibility features in Windows (e.g. a High Contrast colour scheme) or use colour inversion via the magnifier (at a factor 1:1)?
Changing the background colour of certain documents will affect all users who may have to view/process these documents.
Answer: You are best off changing the normal.dotm file located in %userprofile%\microsoft\templates.
When you save this, any new file will open with whatever settings were saved in this file.
Answer: When you say "all documents he opens" do you mean new documents (in which case normal.dotm as Wil says) or every document the user opens?
For the latter, I wonder if a macro could change the background colour when a document is opened?  You'd need to have the macro in all documents I suppose, and catch a BeforeSave event to change the background back from blue as the document was saved, so that other suers didn't get blue background.  Feels a bit hacky.
I guess the "proper" solution would be do do it as a Word Add-In, and somehow store the original background colour in the document properties and restore it BeforeSave.  Add-In development is beyond a simple bit of scripting or macro though.


How create DFA with multiple finished states for lexers?

Question: Is possible to create DFA directly from regular expression. But for lexical analyse is needed "joined" DFA with many finish states, for example one state for string, one for integers, one for floats etc. How do such DFA? Maybe convert many DFA's to one or join DFA's to one NFA and next convert it to DFA?
Comment: It depends on the definition of DFA you're using, but many authors allow a DFA to have several final states.
Answer: As Rick Decker rightly noted, real-world lexical analysers produce a DFA with multiple final states.
Lexical analysers created via Lex-like generators differ from theoretical DFAs in several respects, and this is only one of them. Another obvious difference is that they don't stop at the end of the input string.
Instead, lexical analyser generators generally work as if they ran all DFAs corresponding to the lexer rules in parallel (in practice using a DFA with multiple end states), and applying the following rules:

The DFA that "wins" is the one that proceeded the furthest (often called the "maximal munch" rule).
If more than one DFA would accept that maximal-length input, the one that occurred first in the specification file "wins" (the disambiguation rule).

The disambiguation rule is used, for example, to distinguish keywords (e.g. if, else, while) from identifiers. Ignoring underscores for the moment, an identifier is (typically) any lexeme that starts with an alphabetic character followed zero or more alphanumeric characters, but isn't a keyword. You could create a regular expression which matches this, but it's much easier to specify keywords before identifiers and let the lexical analyser generator do the disambiguation for you.


Consequences/Downsides of Allowing Ranged Defence (Dodge) with Fight?

Question: The House Rule Proposed
I'm intent on making the following rule addition/change in my campaigns:

In addition to parries and blocks in mêlée combat, the Fight skill also covers training in dodging projectiles and avoiding lines of fire. Thus it can be used to defend against both Fight and Shoot attacks. This doesn't require a Stunt.

The Question
I would like to know the consequences of such a change, particularly unintended and/or undesirable consequences, in order to predict whether it's a worthwhile house rule for my campaigns. Conversely, if there aren't any consequences I overlooked, I'd like confirmation.
I'm seeking answer that are one or more of:

Actual experience with making such a change and witnessing the actual, tangible results (Good Subjective).
Sound, logically constructed reasoning for why the change may be unbalanced or otherwise undesirable (as opposed to Bad Subjective feels-based statements, or dismissals of balance entirely, or appeals to contrived and/or rare situations that would significantly strain willing suspension of disbelief if encountered repeatedly).
Mathematical theorycraft that proves that the way things are is more balanced than the houseruled state of affairs.

Addendum: the Reasoning Behind the Change
This idea of mine didn't come out of nowhere, but rather is a consequence of analysing the incentives the system provides for skill distribution - both in theory and in actual experience. Explaining my reasoning behind the change may prove useful to constructing a better answer.
Right now, for a rounded combatant, Athletics is a must-have skill, which indirectly makes Shoot much more desirable than Fight. I'm trying to reduce the pressure on combatants to prefer Shoot/Athletics, make defences slightly more variable, and make getting by on Fight alone viable (for those hulking, slow combatants).
Key points that make Athletics a must-have and/or make Fight underwhelming in the RAW:

For rounded defence, everyone needs Athletics anyway: fighters need it to defend against ranged attacks, while shooters need it to defend against any attacks.
For slow, heavy, close-in concepts, Physique doesn't provide anywhere near as much protection as Athletics: extra stress boxes are drastically inferior to having a higher defence roll under the overwhelming majority of circumstances.
Close-in fighters also happen to need closing in before the attack more quickly (especially when facing shooters), and thus can benefit from Athletics for its movement effects. Also, even if Fight can be used to interfere with a shooter's aim while close in, by RAW one still needs Athletics to dodge while charging into close combat.
Sure, Fight can be used to Create Advantages, but so can Shoot and especially Athletics, so it's not a counterbalancing factor in Fight's favour.
Sure, unlike Shoot, Fight can be used to prevent an enemy from moving out of a zone you're in, that's a dubious benefit: Athletics can be used similarly, and someone with Shoot usually doesn't care that an enemy moves out of close combat.
Using ammo scarcity and/or disarming to bring Shoot and Fight in line requires being really heavy-handed to reach parity, and starts looking contrived fast in many (most?) settings.

I'm hoping my change will mitigate the first two points without breaking anything important.
Answer: "Defense" means "nothing happens".
There's a lot of rhetorical circling I could do, but that's the heart of it. I mean, a lot of times "nothing happens" is a good thing when it could be happening to you, but all the same. This will strictly increase defense rolls, and as a result nothing will be happening more often. Ultimately the impact is going to depend on your campaign variety.
It's more likely to be a good thing if your campaign is pretty eclectic - you've got a Face, a Driver, a Techie, and a Bruiser, and each of their respective domains gets approximately equal screen time - then the fight scenes will take a little longer, and full-pyramid antagonists built for fighting will take a little longer to wear down in them, which can make them feel more climactic when they do happen.
It's more likely to be a bad thing if your campaign is already heavily weighted toward physical conflict, with everyone being a fairly good bruiser or shootist. "Nothing" will happen proportionately more often; fights against full-pyramid antagonists built for fighting are routine and they're all just going to take longer to resolve.


Troubleshooting relevance in Low Search

Question: I have a simple keyword search, I would like for items with a match in the title to come up at the top of results. From reading other posts, it sounds like sorting by relevance is the default behavior for the results tag. I have my title weighted at 3 and all other searchable fields weighted at 1 and am not getting this result. I've upped the modifier, but haven't seen any effect. I'm looking for ways to troubleshoot this.
Answer: MySQL's Fulltext relevance calculation is a bit of a black box. I've tried to find out exactly how it calculates it when I built the add-on, but couldn't find anything useful. Instead, I found out through trial and error, you can influence the score calculation by repeating text in the same field, which is what the weighting does in Low Search.
So, whilst weighting fields in LS will influence MySQL's relevance scoring of a search result, I have no control over what an actual person might find more relevant.
That said, take a look at the keywords:match parameter:

If a valid field (native or custom) is given, entries where that field exactly matches the keywords given will be pushed to the top of the search results, regardless of score.

That won't apply to partial matches, but could help you nonetheless.
Comment: Thank you. This is very helpful - I thought I must be missing something obvious, so at least I can stop spinning my wheels. I added keywords:match for good measure, though it's not helping for the particular cases I'm testing. We'll have to get creative.

Troubleshooting relevance in Low Search


How do I find the approximate surface area of a chicken?

Question: I'm working on building a chicken army and I'm trying to find out how much metal or kevlar (still deciding) I need to make armor for the chickens. this measurement does not need to be exact I'm just trying to get an estimate for how much I will need. You will be spared when my chickens take over the world if you give me a working answer.
Comment: I'm voting to close this question because making clothes for animals is a solved problem that doesn't really involve any physics.
Comment: +1 vote for reopen. This is a completely legitimate and interesting physics problem. What if the chicken is a fractal ...
Comment: Please take further back-and-forth about the on-topic-ness of this question to [this meta discussion](https://physics.meta.stackexchange.com/q/13460/44126). Please do not vandalize this question.
Comment: Does this answer your question? [How do I experimentally measure the surface area of a rock?](https://physics.stackexchange.com/questions/512834/how-do-i-experimentally-measure-the-surface-area-of-a-rock)
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/121240/discussion-on-question-by-mason-latauska-how-do-i-find-the-approx-surface-area-o).
Answer: Assume a spherical chicken, of some radius $r$. The surface area of said bird would then be $4\pi r^2$, which would be a good approximation of the amount of metal required to cover it completely.
If you assume $r\approx 30\text{ cm}$, that would come to an area of around $$A \approx 1\text{m}^2/\text{chicken}.$$
If the metal has a thickness $h$, this would be a total volume of roughly  $V = 4\pi r^2 h.$ If $h\approx 5\text{mm}$, that means $$V \approx 5 \times 10^{-3} \text{m}^3/\text{chicken}.$$

How much would such an armour weigh? Unless you have some sort of "super-chicken" (though I immediately regret giving you the idea), you would require the weight to not be too substantial. If you are using some sort of metal (say, Aluminium or Steel) its density would be around $\sim 5 \times 10^3 \text{ kg/m}^3$. As a result, the mass of a metallic armour would be around: $$M = \rho \times V\approx 25  \text{ kg}/\text{chicken}.$$
Pretty heavy for the average chicken, I would think. Using Kevlar would reduce the mass by about a factor of $5$ (its density is around $1000 \text{ kg/m}^3$), so that would make it a slightly more bearable $5 \text{ kg}$ per chicken.
P.S: Come the revolution, my house will be the one flying the chicken flag. Inform the troops.
Comment: I disagree with the use of the phrase "said bird" after you assumed a spherical chicken.
Comment: A chicken of this size would be immense: $60$cm across.
Comment: @ZeroTheHero I was surprised myself to learn that [the average chicken stands $70\text{cm}$ tall](https://www.britannica.com/animal/chicken), which is what led me to choose $30\text{cm}$, though I admit I was thinking of an army or rather large roosters. A more reasonable estimate might be around $10-15\text{cm}$, granted.
Answer: The astrophysics answer.
Take a representative chicken, put it in a cold room that is lined with infrared detectors measuring the flux in several wavelength bands.
Assume the chicken is a blackbody and fit a Planck function to estimate both temperature and emitting surface area.
Comment: Now, all we need is an answer to this question using every field in physics. I'm stilling waiting for the answer where we use black hole physics to measure the surface area of chicken.
Answer: $\ldots$ another way is to use the physics of thermal radiation. Here the basic pieces of
physics we need are Kirchoff's law, the Stefan Boltzmann law, and some standard thermal
physics.
Kirchoff's law states that the absorptivity and emissivity are equal
(for a given body in a given internal state):
$$
\epsilon = \alpha
$$
This is useful because one can measure absorptivity $\alpha$ more easily than emissivity
$\epsilon$. Having done so (see below), one then uses that in thermal equilibrium the
radiative emission (power per unit surface area) is
$$
F = \epsilon \sigma T^4
$$
where $\sigma$ is the Stefan-Boltzmann constant.
Now here is the method. First, we will want to use the chicken in a state of thermal
equilibrium, so this is not possible for a live chicken. But if we are careful then
it may be possible to eat the chicken at the end. The first step is to kill and cook
the chicken. You have to cook it, because later on we do not want chemical processes
inside the chicken; they will introduce unknown amounts of internal energy changes
or an unknown internal state. So, having cooked the chicken (but see later for
some further measurements that have to be made) we place it in a fridge
and measure its temperature as a function of time. For best results, remove the air
so as to eliminate conduction and convection. Then the rate of loss of energy is
$$
\begin{array}{rcl}
P = \oint F dS &=& \oint \epsilon \sigma T^4 - \alpha \sigma T_{\rm fridge}^4 dS \\
 &=& \oint \alpha( \sigma T^4 - \sigma T_{\rm fridge}^4 ) dS \\
 &=&  \sigma (  T^4 - T_{\rm fridge}^4 ) \oint \alpha dS \\
\end{array}
$$
where in the second line I used
Kirchoff's law, and then I assumed the temperature was uniform across the chicken
and walls of the fridge. I am allowing that $\alpha$ may vary across the surface of
the chicken. This surface integral is going to give us the surface area
we want, but we should note what surface we will obtain: the area we will
get from this method is
in fact the area of the convex envelope of the chicken. This is the minimum
area that an elastic membrane wrapped around the chicken would need to entirely cover
the chicken. But this is just what we want to know. This method is good for getting a
lower bound for the chicken armour calculation.
I will explain how to measure $\alpha$ in a moment. First let's complete the argument.
The chicken temperature will fall as a function of time in such a way that the total
energy leaving the chicken equates to the loss of its internal energy:
$$
P = \frac{\partial U}{\partial t} = C_p \frac{\partial T}{\partial t}
$$
where one should take constant pressure as understood in the partial derivatives.
So we need to know the constant-pressure heat capacity of our chicken.
To find this out, we shall need to heat it up again, supplying known amounts
of heat and measuring the temperature. To supply a known amount of heat, one
way is to put an electric heater element near the chicken and thermally
isolate the whole. Here we must confront a food safety issue. Re-heating cold
chicken causes multiplication of any residual salmonella and consequently is
a bad idea if the chicken is intended to be eaten. So there are two options.
Option 1. Do not eat the chicken. In this case one can safely reheat the chicken,
measuring its heat capacity as a function of temperature, and also check that
it is fixed at any given temperature because chemical and biological
processes have ceased.
Option 2. We wish to eat chicken. To make this possible one could measure the heat
capacity during the cool-down. It is awkward because now there are two measurements
going on at once. At each temperature one must briefly isolate the chicken,
raise the temperature a little using a known amount of energy supplied to a heating
element, and then allow the cooling to continue. Thus one gets a series of heat
capacity measurements along with the overall time-constant for the radiative
cooling.
Finally, we have to measure the absorptivity $\alpha$. This can be done by
illuminating the chicken with infra-red radiation and detecting the scattered
(reflected) radiation if there is any. This may be one of the more difficult
parts of the method, from an experimental point of view. Absorptivity may
also be a function of temperature, but I think it will not be a strong function
of temperature for a cooked chicken. One can either measure the absorptivity
of each small region of the surface, or else measure the average over the whole
surface. It is just this average $\bar{\alpha}$ we need, for we
have
$$
C_p \frac{\partial T}{\partial t} = \sigma( T^4 - T_{\rm fridge}^4 ) \bar{\alpha} A
$$
so the area of the convex envelope of the chicken is
$$
A = \frac{C_p}{\sigma( T^4 - T_{\rm fridge}^4 ) \bar{\alpha} }
\frac{\partial T}{\partial t}.
$$
This is the minimum area of armour that will be needed to make similar such
chickens ready for combat.
P.S. While I was composing this answer the same concept was also proposed more briefly by ProfRob.
Comment: I don't understand why this answer was donvoted
Comment: @Andrew Steane: sorry but won't the cooking dehydrate the bird and make it shrink? This will lead to underestimates.
Comment: @Winston good point.
Comment: @AndrewSteane I think your arguement works even if chicken isn't in thermal equib [see here ](https://physics.stackexchange.com/a/584219/236734)
Comment: @Buraian The emitted flux is $\epsilon \sigma T^4$ for some but not all non-equilibrium states. Consider an LED or a laser for example, also bioluminescence and many chemical processes.
Comment: How does it fail there? (My understanding of the law is not very detailed, I found the paper by discussing with some friends who are actually taking physis course)
Comment: @Buraian when one learns about thermal radiation one is tempted to think that all electromagnetic radiation is thermal, but this is not so (I gave some examples). One could cool an LED down to near absolute zero and still have it produce lots of light, just by supplying it with the right electric current.
Answer: Archimedes' principle can also be used to measure rate of change of volume as the chicken is lowered into liquid.  Sedate the chicken before doing this. Plot a curve of volume vs depth.  This tells you the area of a cross section of the chicken at the surface of the liquid at each depth. Each cross-sectional part of the chicken can be approximated pretty well as a circular disk whose top surface has the corresponding area.  Calculate the area of the chicken as the sum of all the circumferences times the thickness of the cross sections. Of course the leg cross sections will need to be treated as pairs of disks; and you'll need to treat the wings separately.  Just make "gloves" that fit the wings, and measure the area of fabric required to make the gloves. You should end up with a surprisingly accurate estimate.
A possibly more accurate way would be to wrap a string around the chicken at different heights to get the length of the perimeter of whatever shape the chicken is at each height.  Plot those perimeters as a curve, with the height axis along the x-axis.  Calculate the area under the curve, as height times the spacing between the heights.  This would handle any convex cross sections, and give you the area of a soap bubble covering the chicken parts.  Again, wings would present an easily solvable problem.
And finally, if you plan to put the chicken in stew, first wring its neck, then wrap its body and wings separately with shrink-wrap plastic you can get from the butcher. Use a heat gun to shrink the plastic tight against the chicken.  With a razor blade, make a long cut so you can peel the shrink wrap off the chicken.  That has the area of the chicken, and even records the shapes of the parts you need to make for the armor.
Answer: Use the ancient Japanese art of Gyotaku. This method was used to record the catches of Japanese fishermen.  They would paint the fish with ink and then roll the fish onto rice paper to get a print.

Dye the chicken in harmless food coloring.
Carefully roll one side of the dyed chicken onto a large piece of paper.
Wash the chicken before returning it to the coop.
Estimate the area of the image on the paper using polygons. Multiply the result by 2 (to account for the other side of the chicken).

An advantage to this method is that it will also provide a template for stamping steel sheet to be formed on a rigid chicken armory dummy, or to cut the Kevlar prior to sewing.
I embrace my chicken overlords and submit to their rule!
Comment: For a rigid, concave body like a soup can, this method would vastly under-approximate surface area, since it wouldn't account for the surface on the interior of the can.  A fish has plenty of concavities, but it is somewhat flexible, so one can roll it on paper and still get most of the surface.  A chicken has even more concavities, so this method would also under-approximate surface area, but you could get a good "convex hull" approximation for armor estimation.
Comment: Isn't this method using that fish are convex, while chicken aren't?
Comment: Could you explain why this works only for convex bodies?
Answer: The trouble with existing answers is that they are subject to the classical limit of measurement precision. To get quantum-enhanced measurement precision you could illuminate the chicken with a specially-prepared light beam in a far-from-classical state such as a squeezed state or one of a class of entangled states called NOON states, or certain cleverly constructed superpositions of Gaussian states. I won't bother you with the technical details. In this way you are able to measure the distribution $|\psi|^2$ of the chickenfunction $\psi$ to improved accuracy.
You could alternatively gather many chickens and use classical averaging for the measurement, which can get, in principle, arbitrarily high precision for properties of an average chicken. But the above method, correctly carried out, causes minimal disturbance of the chickenfunction, and therefore it satisfies all the requirements of animal welfare legislation. But given your plans for world domination perhaps you don't care about that.
Comment: Given OP plan to make chicken take over the world, it seems they are more concerned with animal welfare than humans' and as such I believe your advice to be on point.
Answer: Use Archimedes' method to measure the volume of the chicken and then, assuming a spherical chicken (as suggested in the comments) you can calculate its surface:
$$
V=\frac{4}{3}\pi R^3, S=4\pi R^2,\\
S=\alpha V^{\frac{2}{3}},
$$
where $\alpha $ is a chicken-specific coefficient.
Comment: and how do you measure that coefficient? The coefficient is important, not a minor detail.
Comment: @user253751 It is a coefficient of order $1$, so as an *estimate* it is quite sufficient. Moreover, once the coefficient is known for one chicken, we will have a formula that will apply with great precision to all of them, even though they may ahve different sizes.
Comment: @Vadim Chicken don't vary in size by a significant amount - and if they do, the coefficient might well vary.
Comment: @NorbertSchuch they do vary in size. Now we can look for the data and analyze intra-species and inter-species variation for chickens... but it will only add the merit to the OP ;)
Comment: @NorbertSchuch no offense, but it seems to me that your claim about the chickens not varying in size or the objections against the use of scaling in this case are of just as low quality as the OP.
Comment: Getting $\alpha$ is the *only* important point here, and you say *nothing* about to get it. Your answer entirely misses the point of the question  (assuming there is one).
Answer: Gather the chickens, say 20 of them (the more, the merrier). Slaughter (oops!) and spread skin on graph paper. Of course, make cuts where the skin is joint as answer will be inaccurate if skin is not lay flat. Count graph paper squares.
If only I could explain how I roll as I say this...


German POW Camp records for WWI

Question: A British Prisoner was said to have been informed by the Commandant of Doberitz POW camp
of his award of the Victoria Cross..Where would I start to look for records from this camp ?
Comment: Welcome to Genealogy.SE! It is always helpful to include known names and dates in your questions so that others can help you to locate resources.
Answer: The Deutsche Dienststelle (WASt) holds

Approximately 1.500.000 files (residue) on foreign P.o.Ws. in German custody. (Assets of the Deutsche Dienststelle)

I wrote a little bit on using records from the Deutsche Dienststelle in my answer to How to find information on German soldiers from World War I and World War II?. In a nutshell: You'll send a request using the online form (available in German, English and French). You have to pay at least 8 Euro per answer page and wait for up to a year. They will answer you in German. You should give it a try.
The archives of the International Prisoners-of-War Agency are now available. They hold  500,000 pages of lists and six million index cards regarding prisoners of war (WW I).
Please see also The National Archives: Looking for records of a British prisoner of war c.1790-1919 for a general overview.
I can't comment on military sources in Britain, but I have serious doubts that there are other archives in Germany beside the Deutsche Dienststelle holding individual records.
When searching the internet for the camp refer to the query Gefangenenlager Döberitz for German results. Martin Conrath published several documents on the history of the Döberitzer Heide (Zur Geschichte der Döberitzer Heide), which can be found online and also contain information on the German barracks and POW camps. Maybe you'll discover your ancestor or his name somewhere. See also The Döberitz Gazette: An International Magazine for the Kriegsgefangene Interned at Döberitz. Additional information on this publication are available on doberitz.com
Comment: I have looked at Deutsche Dienststelle and even though they say they have information on POW.s their search form seems to be only for WWII soldiers. or am I not looking in the right place ?
Comment: @Iain I see no such limitation in their [request form](http://www.dd-wast.de/suchstart.html). You can detail your query using *purpose* and *additional information*.
Answer: You may be referring to https://en.wikipedia.org/wiki/Sidney_Godley:

Originally it was thought that he had been killed, but some time later
it was found that he was a prisoner of war in a camp called Delotz at
Dallgow-Döberitz. It was in the camp that he was informed that he had
been awarded the Victoria Cross. Godley left the camp in 1918 after
the guards fled their posts. He received the actual medal from King
George V, at Buckingham Palace, on 15 February 1919.

German POW Camp records for WWI


Why does metallicity increase the opacity inside stars?

Question: A vague answer I've seen is that it has something do with a greater number of possible excited states, but I don't know what this means for a partially ionized plasma - much less a fully ionized plasma - nor how this would allow the plasma inside a star to absorb more radiation.
Answer: Both free-free and bound-free absorption are strongly dependent on the atomic number $Z$ of nuclei in the gas.
For free-free absorption it is simply that the emissivity per unit volume of electrons accelerating in the field of an ion scales as $Z^2$ (there are $Ze$ electrons accelerating near a charge of $+Ze$). Since by Kirchoff's Law, absorptivity is directly related to emissivity then the absorption coefficient and opacity are also proportional to $Z^2$.
There is a similar argument for bound-free absorption, where since electrons are highly accelerated in the field of a strongly positively charged ion, there is a $Z^4$ dependence of the absorption cross-section.
These very strong dependences translate to weaker dependences on the mass-fraction of heavy elements because the total absorption coefficients must be averaged over all the constituents of the gas - most of which are hydrogen and helium with $Z=1$ and $Z=2$ respectively. Nevertheless there still ends up being a fairly strong, positive correlation between metallicity and opacity.
Even in the outer parts of stars where the opacity is dominated by H$^{-}$ ions, it is still metals that supply almost all the free electrons to make those ions and the opacity ends up being proportional to the metallicity.
Comment: Nevertheless, in the photosphere it is Na that supplies the free electrons.
Comment: Why do metals provide so many more free electrons than hydrogen? The most common metals don't have significantly lower first ionization energies than hydrogen. Is it just because metals have more electrons to give?
Comment: @zucculent actually hydrogen has a relatively high ionization energy. Most atoms have lower ionization energy than hydrogen. Judging from [Wikipedia: Ionization energy](https://en.wikipedia.org/wiki/Ionization_energy) only He, N, O, F, Ne, Ar and Kr have higher ionization energy that hydrogen. Li and Na have almost three times less ionization energy.
Comment: @Prallax that's true, but of the elements you mentioned, N, O, and Ne are some of the most abundant metals. Li and Na are much less so.
Comment: Oh so hydrogen's ionization energy is too high to contribute significantly to the free electrons?


Importing attribute sets into Magento programmatically? Magmi?

Question: Is there any way to import attribute sets into Magento? I'd like to be able to import products into attributes within new attribute sets. I've seen the Magmi import documentation but don't understand the requirements or required csv files to create new attribute sets.
Answer: For those who as I try to find an explanation with examples but without success, I'll try to explain my solution.
The main point is that everything is distributed in three files to work with attributes and the fourth file itself for importing products:

attributes csv - attributes file (new functionality);
attribute set csv - attribute sets file (new functionality);
attribute set association csv - a file with links the previously created attributes with the required group (new functionality);
product list csv - standard import file for magmi.

The problem lies in the fact that reading the documentation does not allow understand all aspects clearly.
Next, I'll try to describe a simple workflow with all the files. I'll create three attributes, one text and two drop-down lists available for filtering.
Entity type "Attribute" (import-attributes.csv)
attribute_code;frontend_label;frontend_input;is_visible_on_front;is_filterable;is_user_defined
frequency;Frequency;text;0;0;1
processor;Processor;select;1;1;1
ram;RAM;select;1;1;1

First line - the codes of fileds which can be find through firebug in Catalog - Attributes - Manage Attributes - Edit Attribute

attribute_code - unique attribute code
frontend_label - name to be displayed to users
frontend_input - attribute type:

text - Text Field
textarea - Text Area
date - Date
boolean - Yes/No
multiselect - Multiple Select
select - Dropdown
price - Price
media_image - Media Image
weee - Fixed Product Tax

is_visible_on_front - Visible on Product View Page on Front-end
is_filterable - Use In Layered Navigation
is_user_defined - Mark attribute as custom
other attributes can be checked in the documentation or directly in the Magento admin

Entity type "Attribute Set" (import-attribute-sets.csv)
attribute_set_name;magmi:groups
PC characteristics;General,Prices,Meta Information,Images,Recurring Profile,Design,Gift Options,Video

magmi:groups - if you skip this field, you get a blank set of attributes without groups

Entity type "Attribute to attribute set association" (import-attribute-association.csv)
attribute_set_name;attribute_code;attribute_group_name
PC characteristics;frequency;General
PC characteristics;processor;General
PC characteristics;ram;General

Magmi Settings

Then run "Run import" and check the Magento admin, everything should get tucked up correctly.


Death formalities done under wrong Gotra

Question: I want to know what happens if all the death related formalities ie, Puja, Antim Sanskar, Pind daan, Asthi Visarjan, etc are done unknowingly using wrong gotra. Are there any remedies mentioned in any Hindu texts regarding the same if later the correct gotra is known.
Answer: Any Pitru karma done should only given to Pradyumana, Sankarshna, Vasudeva form of lord Narayana on Vishnu pada only. This was demonstrated by Bhisma in Mahabharata, despite knowing that his fathers hand asking the Pinda he gave it vishnu pada only, only vishnu have right to give or take to concerned Pitrus, so gothra doesnt matter.. you have that Prachita mantras like aAbhrama sthamba paryantham deva rishi pitru manava, aAputr Gothraja mrithaaha suthra nishpedanethagam. while doing dharbha visharajanam. .the mantra i gave is from Rigveda i don't have full correct sentence.


Scraping Data From a Dynamic Website

Question: Background: The page has a table with data in it. There are several hyperlinks that when clicked, the data in the table is replaced with new data. Also, the page is an aspx page.
Goal: I want to scrape the data in the table for all hyperlinks pressed.
I have looked at what is going on via firebug and when a hyperlink is clicked, it generates an http post back to the server via ajax. The problem is that there are a lot of really garbage post parameters being sent. I assume this is because asp does some sessioning type things. I assume that even if I copied the exact parameters my browser sent, most of them won't be valid later anyway.
How do people usually write http scripts that deal with this kind of stuff?
Answer: Fool-proof method I use is to just interpret JS from the page in my scraping script and let it fill all these params itself. Quickiest way to do this is to use some ready engine, like WebKit, and build your scraper on top of it.
Harder, but more flexible way is to use Google V8 or Mozilla's Spidermonkey JS engines, and provide your own DOM context to them.
Comment: can you expand more on "provide your own DOM context to them" please?
Answer: Most of time I use WatiN for simple scrapes.  Only rarely do I write customer parser/scrapers anymore.
Answer: I will use irobotsoft web scraper to do this.  It should be very simple.
Answer: Here is a Python example that uses webkit to parse the JavaScript in a webpage and provide you with the final HTML

Scraping Data From a Dynamic Website


Is it possible to develop a game with Lua/Löve and have the source code compiled?

Question: I've been looking at Lua and Löve for developing simple 2D games. But since Lua is interpreted and I know it can be compiled to some point, but how secure is that to decompiling. Or is there a better way to distribute the game?
Answer: You can precompile lua using the luac tool in the standard distribution:
luac myluafile.lua -o mycompiledluafile.luac

To obfusticate the file, use the -s option to remove all the debug info.  This won't make you immune to decompiling, but why does that matter?
The -l option produces an annotated bytefile, which is really nice for learning how lua works deep down.
The main advantages of compiling are faster loading times and smaller disk space.  However you don't get a performance increase after that - the lua compiler does very little optimisations, even to the point of still including if(false) branches and the like.
Comment: Lua bytecodes are not specified to be portable, or even acceptable -- they are considered an implementation detail, not an actual part of the language. In particular, I believe that LuaJit-based runtimes will simply have nothing to do with them.
Comment: http://www.love2d.org/wiki/luac <- Löve wiki on luac'd bytecodes; note the policy about "we don't actually support it" was added by 'Bartbes' himself.


sending email through .onion

Question: If an email provider uses an .onion address, does the email exit their servers into the internet through a tor exit node?  Could a powerful adversary track it?
Answer: It depends, there are a few scenarios.

Internal mail, from: email@example.com to: firstname.lastname@example.com or from: firstname.lastname@example.com to: firstname.lastname@example.com

The email never leaves the foo.com server(s), there's no way to intercept it without compromising the mail server(s).

Onion to onion, from: email@example.com to: email@example.com

This is the same as internal except now either of the two servers would need to be compromised to gain visibility. It would need to be supported by both mail providers to work, which isn't common, I don't know of any that do.

External to onion, from: email@example.com to: firstname.lastname@example.com

This is mostly the same as onion to onion, since the outbound mail from foo.com connects over tor to bar.onion.

Onion to external, from: firstname.lastname@example.com to: firstname.lastname@example.com

Yes, this would traverse the internet in some way and would have to leave the Tor network.

Notes:

Onion to onion mail isn't widely supported, until it is this is mostly irrelevant.
Email is protected in-transit anyway, on any well configured mail service. The connection from foo.com to bar.com would be encrypted using TLS, taking it out of the reach of a passive man-in-the-middle adversary anyway.
Answer: I'm the operator of nextlinemail. I can share how our service operates, but it may not be true of other services.
Our webmail client is only available over TOR, via a .onion link. When you send email, however, we use a series of rotating relays to deliver the email to the clearnet. This email behaves exactly the same as normal email.
When receiving email, the same is true. Our servers are accessable via the clearnet for other email relays to access. Email is delivered to your @nextlinemail.com email address over clearnet. You then access your email via TOR, through our webmail client.
I believe this is a common pattern with other mail providers such as secmail, tutanota, and protonmail.

sending email through .onion


Difference between commands in bash script and commands in terminal

Question: Are there any differences between commands that you type into the terminal and commands you include in a script?
Comment: Absolutely not a dumb question! Check out [this](http://unix.stackexchange.com/questions/53839/is-a-shell-script-is-a-programming-language) (first), then [this](http://unix.stackexchange.com/questions/43882/using-to-execute-files-in-bash), and [this](http://unix.stackexchange.com/questions/52385/what-is-the-difference-between-script-and-script).
Answer: Your terminal runs a shell (most probably bash),  which is the one asking for your commands and runs them.
Besides of this interactive mode you can also use your shell to run commands from a file. To execute the commands in your file you can either call the shell directly like bash script or you can start your file with a "shebang" #!/bin/bash and make it executable (chmod +x script). Then you can treat the script like a binary and execute it for example as ./script or put it at a place where you shell is looking for it. (echo $PATH)
Most probably both your interactive shell and the shell used to run is bash.
From the perspective of a "first day learning linux" bash works exactly the same in both modes. - Much later you might stumble about slight differences. If you really want to know about in detail I would suggest reading man bash and search for places mentioning "interactive". (You can search a man page, by pressing /.)
One important thing to note is that the script is run as a new process. This especially means that variables set in the script are not visible in the calling shell.
$ export a=1
$ echo $a
1
$ bash -c 'echo $a;a=2;echo $a' # change the value in a script
1
2
$ echo $a # value not changed here
1
$

Without the export a is not even visible to the inner script.
Answer: In general, the answer would be "no", commands in shell are the same in scripts, in syntax and semantics.
But there is a bunch of small nuances related to configuration of environment (what variables are used and to what they are set).

the interactive shell of choice for Linux is bash, but scripting often uses other interpreters (sh, which is a predecessor of bash, ksh, which is on par with bash), so you have to take into account what shell is used (the current shell
s name is traditionally held in variable SHELL, try typing echo $SHELL).
there may be differences in configuration of the same interpreter for interactive session and for script execution.
Answer: No. A script is a list of commands you can type in the terminal.
You can paste the totality of a script in the terminal, and the result will be the same as running it.
Inversely, you can "save" your terminal commands inside of a file and turn it into a reusable script and share it with your family and friends.
Comment: No. Pasting the content is equivalent to sourcing the script. This will change all kind of options in the current shell, which would not be changed by simply running the script.
Comment: No. Even with `export` it is not possible for a script to modify any variables of the calling shell. The same goes for things like PWD, defined aliases, functions, and things like that. They can be changed only interactively or by sourcing a file. But yes, that is probably nothing someone will stumble upon the first day. :)
Comment: @michas: Well, it is still better to give the correct description. If the beginner is ambitious, and has work habits, he or she will pick up quickly. If we try to tell the child's tale, we'll just stumble upon our feet and make an incomprehensible impression -- besides, the beginner may be back, later. While I don't consider myself a beginner, there are a lot of things I don't know, and I would be insulted if anyone withheld anything answering my questions because "you're not there yet, junior".
Comment: you are correct. but as far as his questions goes. I think we can say it is quite similar. but yes, to translate what michas said in noob'er terms. pasting the content of the script is equivalent to do `source script_file`. which will edit ENV vars in the current context. while running the script as `./script_file` will not modify the ENV, unless `export` is used explicitly.


Subdivision surface modifier creates pinching at corners

Question:

mesh1.blend
I've only been 3D modelling for a few days now, so this may just be a newbie mistake:

However, because this model is for use in a game I am trying to stay away from proximity loops for performance reasons. Instead, I have used edge creases to maintain the structure of the model. It has led to certain vertices not being affected by the subsurf modifier, causing undesirable lighting at high subsurf levels.

Manually moving each point in a bit seems kind of sloppy but I'm not too sure what the best way to go about this is.

If any more information is needed I'll give what I can, thanks in advance :)
Comment: I don't get what's the desired result (smooth arc? quad-like window?) but if you're really modelling for a game then no subsurf. Model in mid-poly to create enough geometry for main forms but still not highpoly and export. Also please inclde images into the question body and not 3rd party service
Comment: Ah sorry first time posting, but yeah the desired result is exactly how it is at the moment, but without that weird pinch at the vertex.
Comment: Another solution would be to give the surrounding edges also weight. The two edges that are also connected to the corner should solve your problem without adding additional edgeloops. Or use a bevel modifier.
Comment: Thanks for the suggestion, unfortunately adding crease weight to those edges just creates a visible hard line from the vertex to the outer edges.
Answer: The issue is in your topology. I suggest you do something like this :

The idea is that you have to place the basis of topology which the subdivision modifier will follow :

If you do that correctly, you will have the right result.
Also, be aware that using mean crease really should remain as a temporary solution. It's handy for prototyping mostly; because it's fast and doesn't require more work, but it doesn't provide any precise control on the obtained shape and geometry.
I've seen some people using it to create quickly and roughly a basic shape. Once they are happy with the shape and volumes, they add a new object on top of it, add some shrinkwrap modifiers, snapping tools, and they to the final model and focus on topology and shape refining.
Comment: I concur with this. My hope was, that the Auto-Smooth Property might fix it, but, alas, no. Topology change it is.
Comment: AFAIK, Blender's Auto-smooth only changes the normals' orientations.
Comment: Thanks so much for the help, appreciate it :)
Answer: That usually seems to be the case for edge weighting instead of using holding edges. I've had this problem in other programs too (modo). Just add another loop between those windows to give it something to hang on to.
Comment: Thanks, I appreciate the response! I've tried implementing your solution but I'm not sure I've done it correctly as the issue persists. I've added a picture showing where I placed the loop, is this correct?
Answer: Just to make sure, try running "Remove Doubles". This will remove points that are in the same (or close to) location. They give similar artifacts to what you are seeing.
Comment: Thanks, I tried it but unfortunately there were no doubles in the mesh.
Comment: Can you upload the file?
Comment: I've added a google drive link, thanks for taking a look!


E1001: Failed to update System image latest Onplus 5T and other

Question: I downloaded the latest LineageOS for my latest Device, from Dumplings SF.
firmware, recovery, vendor files.
What I get all the time is that error message "E1001: Failed to update system image" and that he can't mount the vendor partition.
Any ideas ? PS: I can't even flash back to latest Oneplus ROM (or even older roms)....
Update:
Meanwhile I use TWRP from "cheeseburgerdumplings" for 8.1 on what lineageOS and the "/vendor" partition is no more tried to be mounted.
What I figure out as well, is that if I go with adbs command to know if the filesystem is encrypted or not:
adb shell getprop ro.crypto.state

tells me "encrypted"
Now the big question, which filesystems are encrypted, all ?
And which partition or FS does not have to be encrpyted?
Here is the "recovery.log":
https://pastebin.com/raw/tKMStdSF
Screenshot:
Comment: Hi, have you tried to reboot Recovery before flashing ?
Answer: I faced the same issue and solved it by setting the settings flag Unmount System before installing a ZIP to false. This is not documented or recommended anywhere, however.
For me, it was LineageOS+MicroG image serrano3gxx. If someone else finds this to solve this error, please leave a note so we can report it accordingly.
Answer: Solved!
Update to the latest official Oneplus 5T Oxygen OS, and use the official recovery and image, and everything goes without any problems.
Update must be done in "offline update mode", as online update server is no more available.


Installing Snow Leopard on Mac Mini with only a CD drive?

Question: I purchased Snow Leopard to install on my Mac Mini.  The package contains a single DVD for installation.  Trying to save money at the time, I purchased my Mini with only a CD player, so it can not mount the DVD.  I have a newer Mac Mini, which does have a super drive (DVD), where I've already installed.  Barring the purchase of a USB DVD drive, can I install Snow Leopard via some other media?  I have a 8Gb USB thumb drive for instance.  Could this work?
Answer: Yes, this seems to be possible.
Here's a couple of tutorials on how to do it. I haven't done it myself, but it seems fairly simple, and you seem to have all the required components to do it.
Comment: I'll give it a try.
Comment: A work in progress.  I've created the thumb drive.  Next I need a complete backup.
Answer: How old is this Mac Mini?  Snow Leopard only works on Intel machines, which started appearing in 2005.
Comment: It is Intel.  A Core Duo if I remember correctly.
Answer: Insert the SL DVD in your newer mac mini and boot it in target disk mode, then hook it up to the older mini via firewire.  The SL DVD should mount on the older mini and be bootable.
http://www.macworld.com/article/57005/2007/03/tdmoptical.html
http://support.apple.com/kb/HT1661
Answer: This seems odd.  Mac Mini's, even the PPC units came with Combo Drives minimum, and Superdrives as an add-on.  If memory serves me right, the Combo Drives, were CD-RW+DVD.  In otherwords, DVD readers...
So, unless you replaced the drive, you should have DVD read ability.
But the tutorials are correct.  You can either boot from an external DVD drive (eg Firewire or USB), or create a bootable USB thumbdrive.  What I normally do, is create a compressed DMG of the install media, and then restore it to the thumbdrive.  Much more reliable then trying to copy it....
Or, you could also use the Remote DVD tools now available...
Comment: You are right.  On closer examination with the System Profiler, it should be able to read/write DVDs.  It always spits them back out at me whether they are blank or otherwise.  CD reading and writing works.  Guess the DVD mechanism is broken.


Why does the cylinder with minimum surface area have a height equal to its diameter?

Question: I'm trying to understand as to why, with a given volume, the diameter and height of a cylinder need to be the same for the minimum surface area. This thread, shows how to derive the minimum surface area of a cylinder with a given volume, but doesn't explain why this is.
Answer: Volume $V=\pi r^2 h$.
Surface area $$S =2 \pi r h +2 \pi r^2$$
Now, the AM-GM inequality says
$$\frac{ \pi r h + \pi rh +2 \pi r^2}{3} \geq \sqrt[3]{\pi r h \cdot  \pi rh \cdot2 \pi r^2}=  \sqrt[3]{2 \pi V^2 }$$
with equality if and only if $ \pi r h = \pi rh =2 \pi r^2$.
Basically, it boils down to this simple principle (which is more or less AM-GM): if some expressions have a constant product, their sums is minimal if the functions are equal (if they can be equal).
Comment: See here http://www.artofproblemsolving.com/Wiki/index.php/Proofs_of_AM-GM for proof of the AM-GM inequality.The proof by Cauchy is the one I really like.
Answer: The thread you linked to shows that making the cylinder very tall or very short increases the surface area, so there must be an optimum somewhere in the middle.  It just happens in this problem that the height and diameter are equal.  If you did the problem for a can with only one end, as in the linked problem, the answer would change to have the height and radius equal.  The direction of the shift is easy to see.  If you have only one end, increasing the radius is cheaper in terms of surface area than if you have both ends, so you would increase the radius relative to the height.
Comment: Hmmm...I started editing your typo (that the radius and diameter are equal), but then I got confused by your reference to the two different problems. In brief, the current problem (for a can with both ends) has the height equal to the diameter; and the linked problem (for an open-topped can) has the height equal to the radius.
Comment: @TonyK:  I got confused between the two cases.  I believe it is fixed now.
Comment: That's better! In fact it's obvious, if you think about it, that the optimal shape for the two-ended case has to be two copies of the open-ended case stuck together.
Answer: I came up with this question and I'll try to give an explanation using basic calculus.
First, the volume for a circular cylinder is $ \pi r^2h $ where $ r $ is the radius of the cylinder, and $ h $, its height.
Second, the surface area of a cylinder is:
$$ 2 \pi r^2 + 2 \pi r h \tag{1} $$
Now, we want to find the minimal surface area for a cylinder of a given volume.
So the volume is a constant and we can the relation between the height as a function of the radius:
$$ h(r) = \frac{V}{\pi r^2} \tag{2} $$
If we replace (2)  in (1) we can obtain the equation for the surface area as a function or $ r $:
$$
SA(r) =  2 \pi r^2 + 2 \pi r \frac{V}{\pi r^2} \\
SA(r) = 2 \pi r^2 + 2 \frac{V}{r} \\
$$
Here's where calculus comes, to find the radius that gives us the minimal surface area, we need to find where the derivative of the surface area with respect to the radius equals to zero.
$$
\frac{d}{dr}SA(r) = 4 \pi r - 2 \frac{V}{r^2} \\
\frac{d}{dr}SA(r) = 4 \pi r - 2 \frac{V}{r^2} = 0 \\
4 \pi r = 2 \frac{V}{r^2} \\
2 \pi r = \frac{V}{r^2} \\
2 \pi r = \frac{\pi r^2 h}{r^2} \\
2 r = h \\
$$
Which means that the minimum surface area for any circular cylinder happens when the diameter is equal to the height.


What do we say when someone hears what has not been spoken?

Question: Imagine a situation when I'm standing with another person. The person hears something and responds back. In fact, I had not spoken anything. It is because of his faulty ears. So, what can I comment on his ears? I'm an Indian. In India, we say tere kaan baj rhe hain (Indian language), which literally means this in English: Your ears are striking/ringing. How do we say this in English when we want to say something about the ears of person which heard something which has not been spoken by anyone?
Comment: Forgive me, I must have confused "official" with "national". Is this article incorrect?  (second paragraph) https://en.m.wikipedia.org/wiki/Languages_of_India
Comment: I was nitpicking. But I knew there are over 100 major languages in India, some even used in universities.  But the article does say that only Hindi and English are official in the national government.  Anyway, I was curious about the literal translation of that saying—could you please include it in your question?
Comment: Just curious... Which Indian language is that saying from? And what is your translation? That would make your question more interesting, and help us to discern which nuance you need to replicate.
Comment: @BrianHitchcock It is Hindi (हिन्दी), the national language of India.
Comment: @BrianHitchcock That paragraph must be correct as it is saying that based on the constitution of India. I'm not much knowledgeable about whether Hindi is a national language or not. So, according to Wikipedia, Hindi is official language not national. Therefore, I was wrong when I said that Hindi was India's national language. Sorry!
Comment: @BrianHitchcock Yes, I've included it in my question's body. "Your ears are striking/ringing." or "Are your ears striking/ringing?"
Comment: I think you are looking for hallucination.
Comment: No, what I had been looking for is: "Are you hearing things?"
Answer: I think the general phrase in this situation would be:

Are you hearing things?" (AmE)

things is used as a general term, because you don't really know what the other person heard (unless they tell you).
But you have to be careful, because in some situations it could be considered critical or rude:

No that is not what I said. Are you hearing things?"

which implies someone acts like you said something other than what you said, for various reasons.
Comment: Wow! you're great, man! This is what I had been looking for.
Answer: Google Translate says that the Hindi phrase

tere kaan baj rhe hain
translates to
your ears are ringing

However, in English we use "ears are ringing" to describe a certain sound in one 's ears, that does not come from outside, but is caused by some defect in hearing.  (See tinnitus).This condition is likely to cause someone to NOT hear what you did say, rather than to "hear" something you did NOT say.
If they "heard" words not spoken, you could say they were
- hearing voices
This is technically called an auditory hallucination.
Some schizophrenics report  "hearing voices in their head". Some killers have even reported that the voice(s) in their head told them to kill.
So asking someone if they hear voices in their head suggests that you think they are mentally ill. Make sure they know you are kidding.


Get workflow associated list items

Question: I have one requirement to get all the list items which has associated with a particular workflow in SharePoint 2013. Like, I have a designer 2013 workflow with name "Test Workflow" which is added in a custom list. Tis workflow associated with around 70 items. In the same list I've added another workflow with name "Test Workflow 2". I need to fetch the ID of all the list items which are associated with the first workflow (all the 70 items ID).
Answer: I suppose a query can be built filtering
<code>taskItem["WorkflowListId"]
taskItem["WorkflowItemId"]
</code>
as discussed in this social technet article

Get workflow associated list items


Run a formula multiple times in same sitting

Question: I am trying to make a spreadsheet to keep track of the values of each upgrade in the game Reactor Idle. Each "level" increases the value by a certain percent. To predict the value after the next upgrade I created the formula =X+((X*Y)/100) where X is the current value and Y is the percent increase. i.e. if the Coal Burner is A1 then the formula =A1+((A1*25)/100) entered into the "B" column.
Problem is that there's no way to increase the value multiple times without just recreating the formula in separate cells or copy and pasting the values from one cell to another. The former ends up taking up too much space on the chart for my liking and the latter becomes time-consuming since the upgrades don't carry over to each new cell.
What I'd like to do is just recreate the Upgrade chart with It's values (maybe in/referenced by a separate sheet?) and as I increase the level number the resulting value is increased the same number of times. For example, the Coal Burner starts with a value of 380. If I increase it's level to 10, the result should be 3539.025784.
Is there a way to do this? I'm still relatively new to the more complex formulas and applications in spreadsheet so any help would be greatly appreciated.
Answer: The formula =A1+((A1*25)/100) can be written as =A1*1.25
Multiplying a number by 1.25 several times means multiplying it by a power of 1.25.
For example, =A1*1.25^10 returns 3539.025784, as you want.
In general, your formula could be like =A1*1.25^B1 where A1 has the original value and B1 has the number of upgrades.