Voice command when switching pages on home screen

Question: On the main home screen when I slide between the different pages, a voice says "page 1 of 2" "page 2 of 2" etc. This also happens when my phone is on silent mode and out of driving mode. How can I get rid of it, or at least make it silent while my phone is on the silent mode?
Very much appreciated!
Comment: Check to see if TalkBack is enabled under accessibility in the settings menu.
Comment: I can't post an answer yet even though I have a rep of 101. Anyway, I was having the same issue on my S2 - I found it was because I had LastPass installed and turned on under Services. Maybe if any Service (TalkBack, LasPass) is On the S2 talks when you turn pages. Turning both services to off on my S2 stopped the voice prompt.
Answer: A bit late I know, but I've just been having a similar problem with a Samsung Galaxy S3 Mini.
This is how I got rid of it. I tried other ways, but found that if I turned the phone on and off again, the speech would come alive again. This was the only way I could kill it off for good.
Go to Settings -> Accessibility -> Text to Speech and there will be a list of current text to speech providers (I had 2, Google and Samsung)

Go to Application Manager -> All
Find Google Text to Speech and disable it
If there is no disable button, you will have to click Uninstall All Updates first, then go back, and the button should now read Disable

You'll want to do the above step for each Text to Speech option you had in your list. I had 2, so I did it again for Samsung TTS.
Now if you go back to Settings -> Accessibility -> Text to Speech there should be nothing left in the list and your home screen will finally be silent. Hooray!
I also have driving mode and TalkBack disabled. I already had them turned off, but they didn't help.
Hope this helps.
Answer: Go to Settings>Voice input and output>Text-to-speech settings and check "Driving mode".


Book/Slides/Videos about points-topology-manifold-charts-riemannian manifolds etc

Question: My goal is to study some kind of nonlinear systems through differential geometry. I did an intensive meeting with my supervisor in which he tried to give me an introduction and a link between the following topics:

Points
Topology
Manifolds
Charts (coordinates)
Differential manifolds

Riemannian manifolds

Geodesics
Exponential maps
Logarithmic maps
$SO(d)$ case and hat-map vs v-map

Connections

Tangent bundle
Vector fields (flow of a vector field)
Christoffel's symbols
Levi-Civita's connection
Parallel transport
Link of the previous with the Rodrigues' formulas for rotation

Finally how to arrive from all this to Lie Brackets.
I followed during the meeting but you immediately understand that in 1 hour and a half you can't get all the details of the concepts we touched during the meeting. For this reason I would like to know if you can suggest me some books/slides/videos or whatever to get more understanding of these concepts.
I am going throught the book : Nonlinear control systems by A.Isidori.
Someone on this forum suggested to look into the work of John M.Lee: Introduction to topological Manifolds, Introduction to Smooth manifolds
I found out, reading the Isidori's book that it lacks a bit of graphical explanations which, in this context, I find really useful.
Can you help me?
Thanks a lot for the help.
Answer: For the first part I used: An introduction to manifolds - Loring W. Tu I like it a lot, in my opinion is a very good book with a lot of nice exercises.
For the Riemannian geometry I used the following notes
http://www.maths.tcd.ie/~dwilkins/Courses/425/RiemGeom.pdf


How to differentiate between a full node and an archive node while querying chain state?

Question: Is there a way to know whether the node you are querying is a full or an archive node? For example, assume you want to query the chain state at block 1000 for analytical purposes, to do this you need an archive node rather than a full node.
One differentiating characteristic I can see is database size. But I am unsure of a practical way to do this when writing code to query the chain state at a particular block.
Answer: I don't believe there is a specific RPC that exposes this config information as to RPC pruning state.


Can Genji deflect Brightwing's polymorph?

Question: I know Genji's deflect can bounce off basic attacks, but can Genji deflect Brightwing's polymorph ability?
Answer: No he can not. Simply put: Unless the ability in question is a projectile Genji should not be able to deflect it.
And to clearify I want to mention, that "deflect" for the abilities that can be deflected simply means, that genji is unaffected by them, and not like many people want to believe, that you return the ability to the sender. (Information might be partial wrong, since I haven't seen Genji in any match for a few months)
Answer: According to official's Deflect ability description:

Channel for 1.25 seconds, becoming Protected and blocking damage. Any
damage blocked while channeling causes Genji to throw a Kunai toward
the nearest enemy, prioritizing Heroes and dealing 55 damage. Total
Damage Deflected: N

Means that the only thing that Genji can Deflect is damage. He can't Deflect stuns, hooks, slowing effects, silence, or any other crowd control effect like sleep or dance, or polymorph, etc...
If the effect is Stun+damage like Uther's Hammer of Justice:

Deal 109 damage and Stun the target for 1 second.

Then Genji will deflect the damage but will be stunned anyways.


Is there a "shock collar" that doesn't actually shock the pet, but instead just makes loud noises?

Question: I don't want to get shock collars because I don't like the thought of hurting my pet, but what I'm looking for is a collar that instead of shocking the pet with electricity, just produces startling sound when they pass the perimeter. So it would be like a shock collar minus the hurting. Does such a thing exist?
Comment: Is it for training or barking?
Comment: It's for training, our cats is allowed outside and they don't wander far but they keep going to our neighbor's place and they don't appreciate it
Comment: Ok so the collars are for your cats to stay in the yard? (Just to clarify)
Comment: @RebeccaRVT yeah, well basically they can go wherever, just not that one particular neighbors'
Answer: You bet there is! PetSafe has a ton of products that will help you, I sold a lot of their products back in the day and people were really happy with the results.
1) In ground cat fence, this one has shock however you can change it to beep only. What this product normally does is beep first as a warning then shock if they continue to go out of bounds. They do learn quickly, so when they hear the beep they back off.
2) Wireless fence - same concept as above however no wires required and you can bring it anywhere.
3) Vibration remote trainer - this one is tone and vibration, only downfall is that you can only control 1 cat where as the two above you can buy additional collars. The weight indicated for this product is mainly for the size of the box on the collar, they can be a bit big.
Other than that there's the option of building a Catio, now it doesn't need to be as glorious as the one below but it's by far my top choice for outdoor cats.

Catiospaces.com has a ton of blueprints for sale so you can make your own. Or you can kind of figure it out yourself just by looking at the photos.
Here's a smaller version of the Catio I posted above (you can find the blueprint on the website above):

I love these as it prevents cats from killing native wildlife, being a pest to our neighbors (pooping and destroying gardens), getting into poisons (rat/mouse poison is common), being struck by vehicles or getting killed by a larger predator such as foxes, coyotes or large birds of prey.
Answer: I live in New Zealand and have had Labrador Retrievers for the past thirty odd years.
We lived in a rural area with a golf course surrounding the hill we lived on with 15 other homes.  No fences other than hedges were permitted which made it difficult to contain dogs.
We considered the collar type system which was not ideal because it didn't keep dogs from coming on to our property.
What worked beautifully was an electric fence as used by farmers to contain sheep/cattle etc..  It is inexpensive once you have purchased the unit which from memory was around US$300-$400 dollars.
Boss only got 'shocked' once.  ( you need to be cruel to be kind) He avoided the fence like the plague after that, so much so, that for his last 8 years we had no power running through it.
The beauty of the portable electric fence is that it is easily moved, you can have a small area, or you can have a big area, all run off the same unit. and can be run on batteries or normal power supply.
It won't contain cats however!


Is there a way to get the method how the location was processed?

Question: Experimenting with the W3C Geolocation API.
Is there a way to get the method how the location was processed? I mean GPS, IP, Cell IDs etc. I didn't find any object properties doing that.
Answer: Using the 'user agent' you can detect what device connected to the service to get the location.
Nokia use
http://www.developer.nokia.com/Community/Wiki/Series_40_web_apps_-_FAQ#Do_you_provide_an_API_to_query_user.27s_location.3F
"A user agent IP lookup also returns the IP of the data centre of Nokia Browser for Series 40 Proxy through which the network traffic is routed. "
Comment: Thanks Mapperz! Not exactly what I wanted but 1 step further maybe.
Comment: ´Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22´
Ok, I see this is a desktop computer probably without GPS, but how does this info help me to know if the phone user's location is an accurate GPS location or just a Cell ID or WiFi or sth else?
Thanks for helping!
Comment: http://dev.w3.org/geo/api/spec-source.html#geolocation_interface requires the user agent to determine user-agent specific algorithm & getCurrentPosition()
Comment: But what is this user-agent specific algorithm?


Distribution of transformation of normally distributed variable

Question: Apart from lognormal, is there any other convenient distribution that is obtained  from transformation of a normally distributed variable and has the support of [0,+infinity)?
Answer: For $Z\sim N(\mu,\sigma^2)$, $(Z-\mu)^2$ has a gamma distribution, $(\frac{Z-\mu}{\sigma})^2$ has a $\chi^2_1$ distribution.
$|\frac{Z-\mu}{\sigma}|$ has a chi(1)-distribution.
Of course, it depends on what class of transformations you'd consider. If $\Phi$ is the standard normal cdf, and $F$ is an invertible continuous CDF for a non-negative random variable, then $F^{-1}(\Phi(\frac{Z-\mu}{\sigma}))$ has distribution $F$, so in principle there's a very large number of them indeed.
Comment: Thanks for your response. It is a reasonable answer to the question but not exactly what I wanted. Here is a better wording of the question I had in my mind. Suppose for some transformation function "f", f(Z) is normally distributed where Z is a random variable with support [0,infinity). Apart from log what other forms for "f" leads to a "convenient" distribution for Z? Another way of asking my question: suppose I have some non-negative data. what transformation of the data could give a normally distributed variable while I also have a convenient distribution for the original data.
Comment: If you would like to modify your question, I could delete my answer (though the last paragraph could stand if I simply invert the transformation $Y=F^{-1}(\Phi(Z))$ to $Z=\Phi^{-1}(F(Y))$). Alternatively, you could post a new question.
Answer: Basically, you can transform any distribution $F$ with support on ${\mathbb R}$ by using an exponential transformation, leading to a log-$F$ distribution. In this line, you can transform any location-scale distribution such as the Logistic, Exponential power, Student-t, skew elliptical,  ... The use of other distributions than normal allows you to capture other features. For example, if you use the log-Student-$t$ distribution, you can model heavier tails. On the other hand, if you use the log-skew-normal, you can model different shapes around the mode, with tails close (but not equal) to the normal ones.
More specifically, you can create the distribution you want by taking any distribution $F$ with density $f$ with support on ${\mathbb R}$, and using the transformation:
\begin{eqnarray}
LF(x;\mu,\sigma) &=& F\left[\frac{\log(x)-\mu}{\sigma}\right],\\
lf(x;\mu,\sigma) &=& \frac{1}{\sigma x}f\left[\frac{\log(x)-\mu}{\sigma}\right].
\end{eqnarray}
If $F$ is the normal distribution, then you obtain the log-normal distribution. If $f$ is the Student-$t$, then you obtain the log-Student-$t$, and so on. The use of this sort of flexible distributions for positive data helps you avoid trying to find the right transformation that makes your data normal, which can be very difficult to find or may not be available in closed form. Instead, you focus on appropriately modelling the features of your data.


Is it poor form to win a drawn position on time?

Question: I was playing a 3-minute game, my opponent had around 15 seconds to my ~50 seconds when he managed to cancel out the last pawns to make it so we each had a king and a rook. I let his time run out and he accused me of poor form. Should that have been a draw?
Comment: You won fair and square. Had you used 30 more seconds, or had he used 30 fewer (with the appropriate change in game quality) it probably would not have been a draw.
Comment: In my opinion it is and it should have been a draw since obviously nobody of you played better than the opponent.
Answer: This is opinion based and therefore not a great fit for the Stack Exchange format, but here are my thoughts anyway.
The lower the time limit, the more acceptable it is from a sportsmanship view. In standard long time controls, this is really poor form. In 1-minute ("bullet"), anything goes, including this. The reasoning is that in these really fast forms of chess, the clock is as much a part of the game as the board is (so 15 vs 50 seconds is actually a type of winning position), whereas in slow chess the clock is more of a necessary concession to tournament organizers, not something equal games should be decided on.
I'm in doubt about 3 minute chess. It's very fast, but I'm not sure on which side of the fence it is, that'll be different from person to person.
Personally I always offer a draw when this position arises, but then I only play for fun, not for big bucks.
K + B vs K + B with bishops on opposite colors is even worse, it's hardly even possible to make a blunder in that. At least with rooks you have to watch out for skewers.
Comment: As @RemcoGerlich says, conventional courtesy in chess usually asks a player to offer a draw (though never a forfeit) to an opponent who can only lose because of the clock.  I do not know *why* conventional courtesy should ask this, though I assume that there is a good reason for it; but at any rate, this has long been the custom.
Comment: First game I won against a master. I was down to a king and a few pawns on their starting squares and his flag fell.
Comment: With K+B v K+B, opposite colored bishops, you can just keep your king on a square the enemy bishop cannot attack, and then premove bishop moves. This gives you a good chance of drawing on 50-move.
Answer: Though in long time controls, there is a slight courtesy, quick time controls is perfectly okay to win on time.


I have some money left

Question: I got a scholarship, which is more than what I need for the period of my studies. So, approximately 300 to 400 euro is in excess, what can I do with this money? I am 20.
Comment: Review the FAQ at https://money.meta.stackexchange.com/questions/2376/frequently-answered-questions-by-topic?cb=1 . I think the "getting started" section will help you sort out what your options are.
Comment: Related: [Oversimplify it for me: the correct order of investing](https://money.stackexchange.com/q/47856/10997)
Answer:
what can I do with this money?

Save it and pay fur future periods. Assuming you can eat and live without it, the best thing you can do is save it until you get through school (avoiding loans as much as possible).
Investing it in relatively safe investments isn't going to change your life in a good way, but ultra-risky investments (leveraged FX trades, etc.) can go horribly wrong, causing you to lose it and more.
Once you're out of school, then you can start thinking about investing it.
Comment: Thanks for the response! Why do you think that investing it on safe investments, won't affect my monetary supply in a good way?
Comment: @asdf safer investments generally pay lower interest rates. You might earn 1% in a savings account but you are not likely to lose that interest. You could earn 10-20% investing in foreign currencies but you could also lose everything.
Comment: @Freiheit okay, I get it. What do you think about realising your ideas. Like paying these 300-400 euro to people to create applications with your ideas? Do you think there is a possibility to go on profit with creating your ideas? Or should I just save my money and wait till I finish the university?
Comment: @asdf It might, but it might affect it in a bad way also. My main concern would be to get through school without having to take student loans.
Answer: Your answer should depend on how risk averse you are. If you are extremely risk averse, you should set aside the money in a savings account for an emergency fund. If you are less risk averse, then I would recommend investing all of it in a diversified mutual fund. Because you're only 20, your investment horizon should be pretty long, so you shouldn't have to worry about making extremely safe investments (bonds, CDs, and such).
Other options include: spending the money to travel or visit relatives (investing in personal relationships and your relationship with the physical world), using some of the money to buy books to learn how to invest that money (investing in knowledge), or even picking several stocks on your own and just investing with experience.
Comment: I think I am risk tolerant. Also, I do not think that I will be on a debt if I spend it since my family still gives me money and I am trying to find a job. I am considering investment because I am a finance student and would like to learn about economy and companies by involving emotions(like real money).
Comment: Spending money on travel and education is my favorite. I love traveling but because of problems with socializing I cannot do it, traveling alone is kind of broke. I am thinking of buying some courses and books, but they don't bring value right now. I need somehow make money to realize my ideas.
Comment: Also, I do not know any low fee trading platform. I am from Azerbaijan. Any advices on brockers would be appreciated.

I have some money left


Encrypt backups

Question: Is it better to encrypt the hard drive you will use for Time Machine backup with Disk Utility or with Time Machine itself? I have noticed the the dialogue is slightly different, wherein Disk Utility a hint is not required, but with Time Machine it is... are there any other differences under the hood?
Comment: See this older question: http://apple.stackexchange.com/q/94930/22003 .
Answer: The best answer is to try it yourself. From what I can recall, though, using the encryption option of Time Machine makes an encrypted sparse bundle (a file) on an unencrypted disk, whereas the Disk Utility approach encrypts the entire disk.
Both methods are pretty rock solid (especially for the needs of insignificant consumers), so pick whichever seems more useful.

Encrypt backups


Best string search algorithm around

Question: I have a code where in i compare a large data, say a source of a web page against some words in a file. What is the best algorithm to be used?
There can be 2 scenarios:

If I have a large amount of words to compare against the source, In which case, for a normal string search algorithm, it would have to take a word, compare against the data, take the next and compare against the data and so on until all is complete.
I have only a couple of words in the file and the normal string search would be ok, but still need to reduce the time as much as possible.

What algorithm is best? I know about Boyer-Moore and also Rabin-Karp search algorithms.
Although Boyer-Moore search seems fast, I would also like names of other algorithms and their comparisons.
Comment: Define "best algorithm".
Comment: fastest and worst case comparing time is not that worse...
Comment: Note that with string-searching algorithms, the algorithm with the better complexity can often not be the one with better real-world performance. It highly depends on your data-distribution.
Comment: Have you tried implementing BM and RK and compared them to a naive string search? Does the order of words matter?
Answer: In both cases, I think you probably want to construct a patricia trie (also called radix tree). Most importantly, lookup time would be O(k), where k is the max length of a string in the trie.
Answer: Note that Boyer-Moore is to search a text (several words) within a text.
If all you want is identifying some individual words, then it's much easier to:

put each searched word in a dictionary structure (whatever it is)
look-up each word of the text in the dictionary

This most notably mean that you read the text as a stream, and need not hold it all in memory at once (which works great with the typical example of a file cursor).
As for the structure of the dictionary, I would recommend a simple hash table. Works great memory-wise compared to tree structures.

Best string search algorithm around


How can we decode non CSS codes like XZZX code with Pymatching?

Question: I am trying to use Pymatching to decode some non CSS codes like the XZZX code. Pymatching is a perfect decoder for CSS codes, which can work effectively even of a large code distance. I have tried to decode XZZX code with Pymatching (circuits written with stim language), and certainly it gives wrong results (as d increases, logical error increases). I have learned that the algorithm in Pymatching (Sparse Blossom MWPM) performs well dealing with graph-like errors, while the correction operation of XZZX differs from that of CSS code, which leads to a wrong outcome. So my question is more technically:How could I modify the error-correction part in the Pymatching package and make it suitable for non CSS codes (e.g. XZZX code)?
Answer: Where are you getting the idea CSS codes are "more matchable"? That's not true. I'm not even sure why you'd think it's true.
The XZZX and CSS surface codes have identical decoding graph structures. Decoding one is decoding the other. If you're getting the wrong answer, it's because of a bug in how you make the decoding graph or in how you apply the corrections. It's somewhere in your glue code.
I recommend using pymatching.Matching.from_stim_circuit, as this will avoid several potential bugs with how you configure pymatching.
Comment: Thanks for your reply! Maybe I haven't made it clear that I'm doubting whether decoding process of CSS code can be directly applied to the XZZX code. I used Pymatching to decode in this way:   '''detector_error_model = circuit.detector_error_model(decompose_errors=True)\n
    matcher = pymatching.Matching.from_detector_error_model(detector_error_model)\n predictions = matcher.decode_batch(detection_events)'''  I know it will output a proper match for the XZZX code, but I'm wondering if the bit-flip operation from the match to the perdicted observable makes sense.
Comment: @QingweiWang Compare it to whether or not the observable was actually flipped and you'll see it tracks it just as well as in the CSS surface code.


How can I use an external SSD instead of the built in HDD on a Mac Mini Late 2014?

Question: I want to clone the HDD on a late 2014 Mac Mini onto a Samsung T5 or T7 portable SSD, and use that drive as the boot drive. Is that possible, and if so, how would I even start going about such a thing?
Answer: The two most common utilities for this are Bombich Software's Carbon Copy Cloner, and ShirtPocket's SuperDuper.  Both will allow you to create a bootable clone of your current OS on an external volume; then at next startup, hold down the Option key and choose the external volume.
Note that model Mac mini only supports USB 3.0, so while it'll be faster than the internal drive, you won't get the full performance from a Samsung SSD that supports USB 3.1 or greater.
Comment: While macOS ships with Disk Utility as well as the typical *BSD tools like `dd` you'll have a much easier time using a 3rd party utility like CCC.
Comment: Thanks. I understand from your answer that there is no built in cloning software by Apple. Is that true?
Comment: Searching around it looks like Disk Utility Restore can clone as well. Thanks again.
Comment: It can, but CCC and SD have a lot more functionality built into them to make it easier.  Disk utility is just not suitable for cloning a booted macOS system.


How do some writers manage to emulate the writing styles of others?

Question: What is the method that some writers use to emulate those before them? How do they emulate the way that their models sound? Do they write out their thoughts first and afterward revise them until they achieve the sound of their model? Or do they practice by writing something in the exact metrical form of their model (speaking of prose, not poetry)? What methods have been used in to past to accomplish this?
Answer: The most important aspect is to hear the voice. Some writers are easier to emulate than others.
John Grisham, for example, is an old man from the south. Once you pick up the voice you then study his exposition style. Forget all the advice and rules from the 'How to' - John Grisham does a lot of 'telling'.
BILLY RAY COBB was the younger and smaller of the two rednecks. At twenty-three he was already a three-year veteran of the state penitentiary at Parchman. Possession, with intent to sell. He was a lean, tough little punk who had survived prison by somehow maintaining a ready supply of drugs that he sold and sometimes gave to the blacks and the guards for protection. In the year since his release he had continued to prosper, and his small-time narcotics business had elevated him to the position of one of the more affluent rednecks in Ford County. He was a businessman, with employees, obligations, deals, everything but taxes. Down at the Ford place in Clanton he was known as the last man in recent history to pay cash for a new pickup truck. Sixteen thousand cash, for a custom-built, four-wheel drive, canary yellow, luxury Ford pickup. The fancy chrome wheels and mudgrip racing tires had been received in a business deal. The rebel flag hanging across the rear window had been stolen by Cobb from a drunken fratern
ity boy at an Ole Miss football game. The pickup was Billy Ray's most prized possession. He sat on the tailgate drinking a beer, smoking a joint, watching his friend Willard take his turn with the black girl.
Willard was four years older and a dozen years slower. He was generally a harmless sort who had never been in serious trouble and had never been seriously employed. Maybe an occasional fight with a night in jail, but nothing that would distinguish him. He called himself a pulpwood cutter, but a bad back customarily kept him out of the woods. He had hurt his back working on an offshore rig somewhere in the Gulf, and the oil company paid him a nice settlement, which he lost when his ex-wife cleaned him out. His primary vocation was that of a part-time employee of Billy Ray Cobb, who didn't pay much but was liberal with his dope. For the first time in years Willard could always get his hands on something. And he always needed something. He'd been that way since he hurt his back.
She was ten, and small for her age. She lay on her elbows, which were stuck and bound together with yellow nylon rope. Her legs were spread grotesquely with the right foot tied tight to an oak sapling and the left to a rotting, leaning post of a long-neglected fence. The ski rope had cut into her ankles and the blood ran down her legs. Her face was bloody and swollen, with one eye bulging and closed and the other eye half open so she could see the other white man sitting on the truck. She did not look at the man on top of her. He was breathing hard and sweating and cursing. He was hurting her.

He also prefers to 'bring things into focus'. He has no desire to make extremely clear. You need to read on to discover exactly what's going on. As a reader you need to put snippets of information together to confirm your suspicions.

" . . .watching his friend Willard take his turn with the black girl." - Take his turn doing what?

Grisham lets you stew for a while.

"She was ten, and small for her age." Yes - but what's going on?
"She did not look at the man on top of her. He was breathing hard and sweating and cursing. He was hurting her." - Oh right, that's disgusting! What bastards!

At no point does Grisham say, "The two rednecks were taking turns raping the little black girl."

So, you hear the voice and recognise exposition style, and follow from there.
Answer: Well, I don't have as long an answer as Surtsey, but I'll tell you what works for me. I analyze the text and see what the author does and jot it down/make mental notes. Then when I write, I use the things I noticed to shape my work. I can't emulate someone else, and I don't think you should either. Be your own voice. There's only one John Grisham, and there's only one you.


Is this a double exposure?

Question:
My wife took this pic of some plants using her Samsung Galaxy phone, and was surprised when these two bees showed on the photo. Not surprised at bees being near plants of course. But what's puzzling is that it looks like a double exposure - as if there was a single bee and an extra, more transparent image of the same bee appeared. Is that possible with a digital phone camera? Or is this just two bees?
Answer: Depends what you mean by "double exposure" - this is almost certainly the phone doing an attempt at hdr; this works well if the images don't change "much" between exposures, but sometimes the HDR algorithm will just fail and come up with something like what you've seen.
Comment: HDR as automatically implemented in smart phones involves two or more exposures at different exposure values, which are then blended to avoid excessive shadow and highlight values.

Is this a double exposure?


How to extract config/views while developing a package for composer/packagist?

Question: I am creating a stand-alone package at packagist.org, seen this article and it helped me a lot http://blog.jgrossi.com/2013/creating-your-first-composer-packagist-package/. Can you please help me out how can I generate views/config like I want to extract some files outside the vendor directory when someone install my package from packagist by composer command?
Comment: It has been 6 days and no-one answered my question. is it so hard? Please guys help me out. Thanks.
Answer: If you want to use views in your PHP package you should choose what view parser you want to use, or you can even create your own, using ob_start(), etc.
I suggest you to take a look how packages do that, maybe checking the Laravel View component. It's not difficult to do that, but once you're creating a package for PHP and not for a specific framework you have to choose how you're going to implement views, just that.
Cheers, JG.


XML serialization error on XBOX 360

Question: When try to save game on an xbox with xml serialization i get a code 4 error. I made sure t oadd all the xml referances and there is no errors until i run the game. Any suggestions?
Answer: Did you reference the correct xbox360 xml serialization namespace found in
C:\Program Files\Microsoft XNA\XNA Game Studio\v4.0\References\Xbox360\System.Xml.Serialization.dll ??
Code 4 is a generic error that is difficult to solve without more information on the xml serialization code you have. Paste it here if you need more help.

XML serialization error on XBOX 360


Are content previews important?

Question: What is the purpose of content previews?
An example of content previews is that you have a list of news articles all with different stories, in the list is the name of the article and then 2 lines of truncated content. An example can be seen on the LEFT side of the image below:

My context: We have a list of different reading material, right now we show the material title and the first 2 lines of material content. The user then has to tap on the content to open the full view. One stakeholder in my project thinks that we should save space and remove the 2 lines of content preview.
What is the purpose from a UX perspective does this content preview have and, to a further extent, what are the pros and cons of such a method?
Answer: It depends quite a lot, for example where I read my news I only have access to the title.
Lets take for example fairy tales on a fairy tales website. We have a title "The big bad wolf".
Showing a preview of "Once upon a time" won`t bring any value to readers. But an image will certainly do.
So it depends from case to case, what you really need to find is the root of this.
What kind of preview am I using and how it helps a user. Maybe you are publishing some documents and it would be useful to show as a preview the file type and size of it.
Another example would be listings, instead of showing a text preview under the title a image speaks more.
So yes, in my opinion you first need to figure if the user does really benefit in your particular case.
Answer: There are multiple types of previews and multiple values gained depending on your expectations as a business or of the user. Define your goals and you'll know how to argue for or against a feature.

Content previews in a news app serve a business purpose. News aggregators and content creators often make money based on views. Therefore anything that lets the viewer be lazy (not read) but still catches their attention and hopefully a click makes business sense.
From a process perspective, previews help guide the user into making the correct decisions. Will an audio file, video or PDF best accomplish the task I'm trying to do? Content previews in this would show the type of content and act as a guide.

Are content previews important?


Can I customize my Facebook layout?

Question: I know this got out of hand on MySpace and I don't think I've seen it on Facebook.  Do they provide any way to do this?
Comment: The way it got out of hand on MySpace is exactly why they don't allow it on Facebook. Uniform design is better for visitors.
Answer: Facebook does not directly provide a service to customize your layout; but there are some 3rd party services / plugins on the net to provide Facebook layouts to your profile. I have never tried them but Naevius is one of them.
A search for "facebook layouts" using your favourite search engine should turn up some more.
Answer: The option for Facebook layouts is through a third party app or plugin on the web.  I've tried FaceTheme and Webfetti but had issues so I decided to uninstall.  I am now using PageRage and I am finding that it works quite well.  They also give you the option to create your own layouts.
Answer: Not really customizing the layout, but a useful Chrome extension for hiding those annoying adverts https://chrome.google.com/extensions/detail/cbpaedifajkadcemkafopbniflgiimkd
Answer: You can customize how Facebook's layout is presented to you in your own browser, for instance if you have been switched to the new Facebook design that they are currently rolling out, but want to go back to the old design, you can do so either by using the Facebook provided switch to "go back to classic mode" or if they have taken that option away from you, you can use a simple browser extension to get the old design back
There are a couple of choices that i have tried and both work really well.
Revert Site:  https://revertsite.com This is a very simple and easy to use extension that lets you switch your facebook layout back to the old style one.
FB Purity: https://fbpurity.com This is a more advanced and feature packed extension with lots of Facebook customisation capabilities, including the ability to filter out posts containing words or phrases you are not interested in, hide all the ads, filter out pictures of babies or cats or dogs etc
Of course part of the new Facebook design is a new option to switch to "Dark Mode", so thats another thing you can do to customise your Facebook layout, but of course it only affects what you see when you login to Facebook, other people wont see your Facebook profile in dark mode, just because you switched your account to "Dark Mode"
So there is a fair amount of customisation you can do in your own browser to change what you see, but if you meant you want to change what others see when they visit your profile then I guess the only customisation you can really do there is to change your Profile Image and Cover image.

Can I customize my Facebook layout?


Are there studies that shows significant link between repetitive heading and brain injuries?

Question: Are there studies that shows significant link between repetitive heading and brain injuries?
Comment: Ram, any chances you could make this post a Q&A, because I think it is a Q&A. I'm trying to clear the unanswered tab for football tag and can't imagine a better answer to this question than the one provided below the horizontal bar in this question.
Comment: @gdrt OK, I will make it a Q&A and let's see responses to it. What happened was I tried searching for answer of this question but couldn't write one so added everything to the question.
Answer: Issue of link between repetitive headers and dementia has been bought up after retirement of striker Kevin Doyle over concussion problems but all started by the death of Spurs legend Danny Blanchflower from Alzheimer's disease.
Former West Brom and England striker Jeff Astle died aged 59 in 2002 and it was found that repeatedly heading heavier balls had caused the dementia which led to his death.
These articles 1st, 2nd suggest FA were warned 22 years ago about dangers of heading footballs but FA refused it saying there is no connection back then.

Baroness Elaine Murphy said she wrote to the FA in 1995 about the dangers posed to players in the sport, but claims the footballing body was 'very short and refuted any such association could exist'.

Recently FA announced to fund study of dementia among footballers and Uefa also has commissioned a research project that will examine the links between dementia and playing football.
This study mentions, dementia among retired footballers may be connected to repeated head 'impacts', caused by collisions and thousands of headers.

The study included post-mortem examinations on six players who suffered dementia, which reveal that all of them had suffered from a tearing to a brain membrane consistent with chronic, repetitive head impacts from playing football.

This study was initiated on 1980, and was done on 14 men with dementia and a significant history of playing football, monitoring them over time and carrying out post-mortem studies in six cases. So, not sure if this study is significant enough.
Other articles that might be of interest, 1st, 2nd, and 3rd.


How do I attach an external VMDK disk to a guest image, from within the guest image?

Question: I have a Linux guest image that starts up, with only the OS drive.  The actual ESX server has many VMDKs (I know the IDs of them).  In my workflow, I need to on demand, from within the guest, attach one of those VMDKs to the guest instance.  How can I do this?
Answer: From a high level perspective:

Pick your favorite language/tool to access the VMware API with and embed it in the image
Have a way for the image to get credentials needed to perform the action against VMware (embedded in the image or retrieved from a secrets vault). If the script is being run interactively, this could also just be from memory from the user.
Write your script that utilizes the VMware API and credentials to attach the VMDK

In other words, exactly the same way you would do it programmatically not from within the guest.


Magento 2.4 how to get first n characters from CMS page content

Question: I want to display certain CMS pages on categories and products, which the administrator assigns to the category or product. They would appear as cards. Somehow first the title of the CMS page and then as a description let's say 100 initial characters from the content. How to get those first 100 characters from page content?
Answer: You can Try and add this on your phtml. Please do inject the CMS Page model.
$cms = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Cms\Model\Page::class);
$page = $cms->load('home','identifier');

$pageTitle = $page->getTitle();
$pageContent = $page->getContent();
$pageContent = substr($pageContent, 0, 100);

echo '
' . $pageTitle . '
';
echo '
' . $pageContent . '...
';


What is the relationship between virtual address and physical address?

Question: I am recently studying the operating system, and I found the paging system a little bit confusing, for example, what will happen when there is a 52-bit virtual address and a 40-bit physical address, with 4KiB page size, so there are 2^40 pages and 2^28 frames, how pages are mapped in this case (the pages are more than frames) and how would the page table look like? Any help would be appreciated.
Comment: I suggest you refer standard textbooks of operating systems. Galvin a.k.a. dinosaur book is a good one.
Comment: https://en.wikipedia.org/wiki/Virtual_memory#Paged_virtual_memory,  https://en.wikipedia.org/wiki/Memory_paging
Comment: Thanks for the recommendation, I will check it out
Answer: Physical addresses refer to existing RAM memory. At any time, virtual pages can be mapped to physical pages (frames), or be swapped out on disk. Usually, just a subset of the virtual space is mapped (the rest being completely ignored by the process). That part is mapped to frames as long as they are available (possibly in competition with other processes). The rest is mapped to disk.
The mapping being quite dynamic, there is no particular relation between the virtual and physical addresses, and even less between their sizes. In theory, a single frame of RAM could be enough.
Comment: Do you mean the excess pages will not be mapped to the RAM memory but kept in the disk, when it is needed, other pages in the RAM will be swapped out (page replacement occurs), is that correct? If correct, what would the page table look like? Will there be some frames mapped by more than one page?
Comment: @Eric: A frame can be mapped to several pages in case of memory sharing between different processes.
Comment: So the page table will only map some pages to frames, if I want to calculate the size of the page table, it should be (frame number * entry size) instead of (page number * entry size), is that right?
Comment: @Eric: yes but the page table can also be paged.
Comment: Got it, many thanks!


Introducing evidence into trial in the US

Question: How does one introduce evidence into trial? Do all pieces of evidence have to be introduced into trial before trial starts? Can I bring additional evidence on the day of the trial and introduce it on the fly to the judge when I make my arguments? Why or why not?
Answer:
How does one introduce evidence into trial? Do all evidences have to
be introduce into trial before trial starts? Can I bring evidences on
the day of the trial and introduce them on the fly to the judge when I
make my arguments?

In general
The rules vary from court to court with the exact rules spelled out in general court rules for the particular kind of court in question, local rules of that particular court and standing orders of the presiding judge, and case specific case management and trial management orders of the judge.
Generally, less advanced notice is needed in courts of limited jurisdiction (e.g. limited to claims of $15,000 of less for money damages or misdemeanors only), and more notice is required in courts of general jurisdiction (which have authority over almost any civil matter or crime, subject to federal v. state court divisions). There are also differences between civil cases and criminal cases. These are discussed briefly at the end of this answer.
Evidentiary hearings on pre-trial matters (e.g. preliminary injunctions in civil cases, or evidence suppression hearings in criminal cases) are typically conducted with a process involving less pre-trial disclosure that is more similar to trials in limited jurisdiction courts.
Civil cases in general jurisdiction courts
Before trial
In a typical U.S. civil case in a court of general jurisdiction, the exact deadlines vary, but the existence of documents relevant to the case and of people with knowledge of the facts who could testify in the case has to be disclosed fairly early on in the court case, or in connection with "discovery" (such as depositions and written requests for documents) and expert witness disclosures in the middle of the case.
Then, there is typically a duty to disclose a trial witness list and proposed trial exhibits a few weeks before trial to the other parties. Detailed disclosures of what witnesses will testify to is typically not required, but there will have usually been an opportunity to take depositions of, or try to interview, witnesses during the discovery portion of the case in the middle of the pretrial process.
A party can object to anticipated exhibits or witness testimony before trial in what is called a "motion in limine" and sometimes a judge will resolve the question of whether that evidence may or may not be admitted in advance, and at other times, the judge will reserve ruling on that question until the question soliciting witness testimony is asked, or the exhibits is presented at trial.
At Trial
Once this has been done, when the trial actually commences, stipulated exhibits are often admitted immediately, and then you call witnesses when it is your turn to do so (plaintiffs go first, then defendants, then plaintiffs can bring rebuttal witnesses).
Non-stipulated exhibits (whose admissibility has not been ruled upon before the trial begins in connection with a motion in limine) are typically offered in connection with witness testimony one by one. When such an exhibit is offered into evidence, this is subject to evidence objections raised by the other side at the time that the exhibit is offered. If there is an evidence objection during the trial, the judge rules on the objection on the spot, either overruling it and admitted the exhibit into evidence, or sustaining the objection and not allowing the exhibit to be admitted. Objections are resolved based upon the applicable rules of evidence and a determination regarding whether it was properly disclosed prior to the trial.
Certain kinds of evidence (either witnesses or exhibits), such as "impeachment" and "rebuttal" evidence (i.e. evidence to show that testimony was false or that an exhibit shouldn't be taken seriously), can be admitted without prior disclosure, but other kinds of evidence needed to be disclosed in advance to be admissible at trial.
The rules of evidence about what can or cannot be admitted at trial are typically the subject of a one semester law school course and are beyond the scope of an open ended question asking the very basics like this one. They include rules about topics such as character evidence, relevance, evidentiary privileges, expert witness and opinion testimony, hearsay, and authenticity objections. The federal rules of evidence are typically and form a model for state rules of evidence in many states, although a few states like New York and California have their own rules of evidence that are structured differently but similar in substance.
Limited jurisdiction courts and criminal cases
Some courts of limited jurisdiction will have no pretrial disclosure requirements and no discovery. Others will require, at least, a disclosure of the exhibits to be used at trial and the witnesses who will testify at trial, and typically dispense with motion in limine practice.
While disclosure and discovery requirements in civil cases typically treat all parties equally, in a criminal case, the prosecution has very extensive pretrial disclosure and discovery obligations, while criminal defendants typically have only minimal pretrial disclosure and discovery obligations. Criminal defendants do, however, typically have to disclose in advance if they plan to make an alibi defense and if they plan to make an insanity defense.

Why or why not?

Evidence rules try to strike a balance between a "trial by surprise" that could cause the outcome of the trial to be due to something that the other side didn't have an opportunity to get evidence to respond to, and the cost of making pre-trial disclosures or discovery.
This balance is struck differently depending upon what is at stake. With lower stakes, accuracy is less important and cost is a bigger concern. With higher stakes, accuracy matters more and cost is less of a concern. In criminal cases, the 5th Amendment right not to self-incriminate yourself limits the discovery obligations of criminal defendants.
Common Law v. Civil Law Legal Systems Compared
Towering over this is the extreme level of finality that comes with trial results in common law system court cases. After the trial is over, there is almost no room for "do overs" or supplements to the evidence or make new legal arguments.
In contrast, in the civil law systems, for example of continental Europe in places like France and Germany and Italy and Spain, after a first trial is completed in a case, on a direct appeal of that decision new evidence as well as new legal arguments can be considered by a larger panel of more senior judges. So, getting it right the first time despite potential surprises in the first trial is not as much of an imperative.
The other big difference between common law and civil law trials is that common law trial procedures were designed around the possibility of a jury trial (even when cases are actually tried before a judge without a jury) with all evidence admitted in a single more or less continuous trial.
In contrast, civil law trials are before judges and often receive evidence piecemeal with one or a few witnesses testifying at each session and evidence taking sessions spread out over weeks or months, something that is possible because a small panel of full time judges can be reconvened much more easily than a common law jury.
Comment: **Comments have been [moved to chat](https://chat.stackexchange.com/rooms/151352/discussion-on-answer-by-ohwilleke-introducing-evidence-into-trial-in-the-us); please do not continue the discussion here.** Before posting a comment below this one, please review the [purposes of comments](/help/privileges/comment). Comments that do not request clarification or suggest improvements usually belong as an [answer](/help/how-to-answer), on [meta], or in [chat]. Comments continuing discussion may be removed.


How to switch motor outputs and use E1 as X, in Marlin firmware?

Question: I broke up my electronics and now the output for X is not working. The stepper is OK.
There is any simple solution to remap the output pins? I want the E1 output to act as the X output.
Comment: If the answer below fixed your problem could you please accept it, using the "Tick icon" next to it, in order to remove it from the [unanswered questions](https://3dprinting.stackexchange.com/unanswered) list?
Answer: When using Marlin firmware you could easily change the pin layout of the extra extruder (E1) with the broken X stepper pins by changing the pins_RAMPS.h file.
Download the firmware and open the firmware project in Arduino IDE. Navigate to the "Steppers" section of the pins_RAMPS.h file and replace:
<code>#define X_STEP_PIN         54
#define X_DIR_PIN          55
#define X_ENABLE_PIN       38
#define X_CS_PIN           53
</code>
for:
<code>#define X_STEP_PIN         36
#define X_DIR_PIN          34
#define X_ENABLE_PIN       30
#define X_CS_PIN           44
</code>
and also change:
<code>#define E1_STEP_PIN        36
#define E1_DIR_PIN         34
#define E1_ENABLE_PIN      30
#define E1_CS_PIN          44
</code>
to:
<code>#define E1_STEP_PIN        54
#define E1_DIR_PIN         55
#define E1_ENABLE_PIN      38
#define E1_CS_PIN          53
</code>
When the file is changed an saved, build and upload code to your board and plug the connector of the X stepper into the E1 header.
Answer: you can find pin.h in marlin directory and in pin.h file change # define pinout of z motor and extruder motor
Comment: This answer is very terse, and might not include enough details for some users. Perhaps you could improve it by including a bit more detail on what needs to be changed exactly?
Comment: Exactly! I found thease in pinsRAMPS.h thx for help!


How to determine the point at a set length along a given function (parabola)?

Question: Given a specific function, a parabola in this instance, I can calculate the length of a segment using integrals to sum infinite right angled triangles hypotenuse lengths. My question is, can I reverse the process? If this question has an obvious answer please forgive me as I have just started studying integrals. I am simply curious as to if I'm given a function, and told that a certain point is a set distance along it's length from a known point, can I find the coordinates of the point?
Comment: You can solve the integral parametrically and solve the equation.
Answer: This is the problem of finding an arc-length parametrization of a curve. While this can always be done in theory and is a great tool in several proofs regarding parametric curves, it is rarely possible to find a closed form solution.
The general method is:

Describe your curve by $\vec{r}(t)$, for $a \leq t \leq b$.
Find $\vec{r}\,'(t) = \frac{d}{dt}\vec{r}(t)$
Create the function $s(t) = \int_{a}^{t} |\vec{r}\,'(u)| \, du$, which will give you the arclength from $a \leq u \leq t$
Once you have $s(t)$, find the inverse function $t(s)$, with something like the inverse function theorem. The inverse will always exist for an appropriate parametrization $r(t)$, since $s(t)$ can be always increasing and positive.
Once you have $s(t)$, just use $\vec{r}(t(s))$ to get the position given the arc-length $s$.

The problem, of course, is that steps 2, 3 and 4 are generally hard to do analytically.
However, using a computer this can be done by simply making a table of arc-length $s$ per parameter $t$, and then reading it backwards, with some interpolation if necessary. So the problem is very simple numerically and, in principle, well behaved for general smooth curves. It's just the closed form part that's hard.
Comment: I believe this answer is the same as the one I marked as answering the question however the other was better stated for a beginner. I appreciate the time taken to answer anyway.
Comment: Oh well, I tried. :)
Comment: It is the same approach, even though it might look different. We even chose the same symbols $s$ and $t$. The table mentioned in the last paragraph is one way to do the numerical root-finding that I mentioned. You can only accept one answer, but you can give up-votes to others, too, if you want.
Answer: Filling in some of the unpleasant details hidden behind the Shabbeh hint.
For simplicity, let's use the "standard" parabola $y = x^2$.
The arclength $s(t)$ between the points $(0,0)$ and $(t,t^2)$ is given by
$$
s(t) = \int_0^t \sqrt{ 1 + \left(\frac{dy}{dx}\right)^2} dx  \\
= \int_0^t \sqrt{ 1 + 4x^2} dx  \\
= \frac{1}{4}\left(2t \sqrt{ 1 + 4t^2} + \sinh^{-1}(2t)\right)
$$
To find the integral in the last step, I used Wolfram Alpha. It's much better at this sort of thing than I am. So, if you want a point at an arclength $k$ from $(0,0)$, you have to find the value of $t$ that gives $s(t) = k$. In other words, given $k$, you have to solve the equation
$$
\frac{1}{4}\left(2t \sqrt{ 1 + 4t^2} + \sinh^{-1}(2t)\right) = k
$$
This is pretty nasty, and you'll almost certainly need to use a numerical solver to do this. The good thing, though, is that $s(t)$ is a nice smooth monotonically increasing function of $t$, so even a very crude numerical solver should work quickly and reliably. For an introduction to numerical root-finding, you can start here.
See also this question.
Comment: This is exactly what I was looking for! So it is as I excepted up to the final point. I have very little experience in numerical solving. I'll look into that. It's just using a computer to determine the answer right?
Comment: Yes. If you have some equation $f(t) = 0$, then, in the real world, outside of hoemwork problems, you usually can't solve it for $t$ by using algebra. Things like $t^2 -3t +2=0$ are easy, of course, but you usually are not lucky enough to get such simple functions. So, you use numerical methods (computer algorithms) to find "roots". The best-known one is called Newton's method. Details here: http://en.wikipedia.org/wiki/Root-finding_algorithm


Are these trees by the river maples, or liquidambars, or...?

Question: What kind of trees are those two in the photo? (I really don't have any better photo.)
Comment: Hi VividD! I'd like to use this to teach users the most helpful way to ask an identification question. A picture is always essential! The other criteria include: a title with a good description of the plant; a repeat of the descriptive features in the question; where you live, or where the plant was found. Other features are helpful too, like color of flowers; shape of leaves; and things like that. Here are the [instructions](https://gardening.stackexchange.com/tags/identification/info) for using the tag. Thanks!
Answer: Just by looking at branch organization, I would say they are liquidambars.
Consider following branch organizations:

They are called alternate and opposite organizations, respectively.
Of trees, only maples, ashes and dogwoods have opposite organization of branches. I don't see any traces of that in the pictured trees.
Since leaves tell us they must be maples or liquidambars, they are liquidambars.

An article from thespruce.com: 'Which Trees Have Opposite Branching?'
https://www.thespruce.com/which-trees-have-opposite-branching-3269791
Comment: Doesn't trust much about branches position. It can be misleading, both for wild plants (not ideal position) than cultivated plants. As you see, there are many scars in the trunks (and those plants doesn't seem so healthy, many branches without developed leaves.  In any case (but it is difficult to see on your photo), the top branches are still alternate, so you should be right.
Comment: Maybe sweetgums (  humor ).
Comment: @blacksmith37 I live in the area where liquidambars/sweetgums are not native, and local people call these trees "liquidambars". There is some other word, but it is generally not widely known, and very rarely used, in my area, in my language.
Comment: I knew about liquidambars before, but not until this autumn I noticed a tree in the distance from the window of my work place - and I was blown away by its color, or colors - and the shape was a sort of excellent, elegant. These two above are newly planted in public spaces in my city, I just wanted to confirm if they are sweetgums. And I already planted two in my yard since November! Last available space for large trees in my yard I spent on liquidambars - one on the East, one on the West, both very visible from the house. @blacksmith37
Comment: The seed balls are heck to walk on.
Comment: You are jealous.
Answer: Easy one to remember, maples have something called a samara, or winged seed they fall off in the wind and twist in the air, we used  to call them helicopter seeds as children. Liquidamber has tight dark brown like balls with seeds hidden inside- although from a distance they look similar, the leaves are quite different, maples are smooth and Liquids are not, the bark is also different depending on variety of maple, some are smooth, or peeling- the list goes on, liquids always have that mid grey rough looking bark only.  so to end- the picture is of a Liquidamber.


Non-linear differential equation I

Question: What is the solution to the non-linear differential equation
$$
\frac{d^2 y}{dx^{2}} = \left( \frac{2 y -1}{y^2 + 1} \right) \, \left( \frac{dy}{dx} \right)^2\ \text{ ?}
$$
I would suspect it has a connection to the inverse tangent function, but the trick of getting there seems to be elusive.
Answer: Let $z=dy/dx$ then we can rewrite the equation as,
$$ \frac{dz}{dx} = \frac{2y-1}{y^2+1} z^2,$$
and using the chain rule we can write $dz/dx = dy/dx \times dz/dy = z\times dz/dy$ ,
$$ z \frac{dz}{dy} = \frac{2y-1}{y^2+1} z^2,$$
$$  \int_{z_0}^z \frac{dz'}{z'} = \int_{y_0}^y \frac{2y'-1}{y'^2+1} dy'.$$
Once we have $z(y)$ from the above we can obtain $y(x)$ by integration of the equation $z=dy/dx$.

Non-linear differential equation I


Meaning of phrase

Question: What is meant by the phrase "Given x months to live" ?  It is invariably followed by something along the lines of " But he proved the doctors wrong and lived another 25 years." There must be a lot of doctors who should be given the sack either for being useless at medicine, or having a terrible bedside manner.  I really can't believe that a doctor would say to someone " I give you 7 months to live; not a day more not a day less." I have not been in a position to witness such a discussion, and these discussions are rarely publicised. I can believe that a doctor might say " You are UNLIKELY to live for MORE THAN another 7 months. But even then, to say the doctor " gives you 7 months" without the finer detail would seem incorrect. PLEASE HELP.    Jon B
Comment: It would be very unusual for a doctor in the US to say "I give you 7 months to live", or words of that nature.  What *might* happen is that someone (probably not the doctor but a "counselor" of some sort) *might* say "On average, people with your condition live 7 months", but even that is doubtful.  However, it's not at all unusual for someone to report that "The doctors gave me 7 months to live", rephrasing and "embellishing"  what they heard.  You can't control what people say in such circumstances.
Comment: Welcome to EL&U. This is not a community to decide what is right and what is wrong. If you are asking about "given x months to live" in terms of its meaning and grammatical correctness, please edit your question.
Answer: Your doctor is saying "Look, I can't promise that you'll survive more that seven months, so if you want one last trip to see your grandkids - don't put it off. If you need to get your finances / legal affairs in order - don't wait." But you don't hear a doctor saying "you WILL be dead in seven months". They will say, instead, that "most people in your condition survive at least 7 more months", or "the average expectancy based on statistics are that people at this stage of your condition live for 7 months". And the full detail of the discussion is rarely brought up because patients don't usually give transcripts of their conversations with doctors, and doctor's can't give details at all due to confidentiality.
"I give you 7 months to live; not a day more not a day less." ?  Never hear that! Well, unless you're on death row and that's your execution date....
Comment: *Doctors have/had given him seven months to live* is a well-known idiom, but a particularly unfortunate one in my view. What would be wrong with saying *Doctors have estimated that he/she might live another seven months, but nothing can be certain*
Comment: I agree that it is an unfortunate way things are put. Almost as if it were some gift bestowed by the doctor. I've always assumed it was a derivative of "I've got seven months to live", but ascribed to the doctor's expert opinion.
Comment: Yes, this is almost certainly a case of putting the patient's words in the doctor's mouth.
Answer: Communication between professionals, who have their own terminologies and their own ways of thinking about their fields, and laymen, who usually have a much more vague understanding (and lack either the time or the resources to acquire a professional level of understanding), is frequently difficult; laymen frequently prefer a simple message, and when the professional can't provide one, laymen often have no choice but to come up with their own.
I'm most familiar with this from my own field (software/computers), but to take another medical example: a surgeon friend gets annoyed when people say things like, "The doctors wanted to do surgery, but […]", because — as she explains it — doctors never really "want" to do surgery. They propose an option, and lay out the known risks and expected benefits, and often make a recommendation; but afterward, patients remember only the simple message that "the doctor wanted to do surgery".
Similarly, I'm sure that doctors don't say, "you have six months to live"; however, prognosis (predicting likely outcomes) is considered an important part of medicine, since it helps both patients and medical professionals to make informed decisions about treatment (and other aspects of their lives). If a patient is told that the majority of people in her condition die within six months, she could well be excused for summarizing that as "they gave me six months to live".

Meaning of phrase


Testing Retention Policies in SharePoint Online / Office 365

Question: Is there a way to test SharePoint Online retention policies without waiting a day? Tried to change the policy from Created to Date and Time + 1 day and even when I changed the calendar to a day before the workflow won't start. Any help will be greatly appreciated.
Answer: No there isn't. There are 2 timer jobs that run that we do not have control of.
The first timer job will identify things that have met their retention date and flag them as needing action. The next timer job runs through and handles the flagged items and does the required action (deleting the item, moving it, executing a workflow, etc).
Last I knew, and based on our testing, these were weekly timer jobs. On-prem, we had the ability to make them daily, but we do not have that luxury in SharePoint Online.
Comment: Then, I would have to wait a week from now to see if the retention policy starts the workflow?
Comment: Based on our previous testing, yes, up to a week, depending on when these timer jobs are scheduled to run in your tenant.


ant debug issueandroid app

Question: I'm new to android development, so I tried the first tutorial on android.com. The app I want to write for my HTC hero has android 2.1 eclair. So I made a new project with:
minimum sdk 2.0 eclair (API 5)

target sdk 2.1 eclair  (API 7)

compile sdk 2.1        (API 7)

I used the command android to make the build.xml:
android update project --name MyFirstApp -- target 1 --path workspace\MyFirstApp

then I go to the root folder of the project and run ant debug. result:
-build setup:
Project target: Android 1.5                   (que? I clearly configured 2.1, didn't I?)

API level: 3
WARNING: Attribute minSdkVersion in AndroidManifest.xml(5) is higher than the project target API level(3)

This warning would make sense if my target  API was indeed API 3. This is definitly not the case since I clearly configured API 5 in eclipse.

Ant continues and at the end, these errors kill it:

[aapt] C:\...\workspace\MyFirstApp\bin\AndroidManifest.xml:7: error: No resource found for attribute 'targetSdkVersion' in package 'android'

[aapt] C:\...\workspace\MyFirstApp\bin\AndroidManifest.xml:7: error: No resource found for attribute 'allowBackup' in package 'android'

BUILD FAILED

C:Program Files\eclipse\Android SDK\tools\ant\build.xml:645: The following error occurred while executing this line:

C:Program Files\eclipse\Android SDK\tools\ant\build.xml:683: null returned: 1

Answer: Solved: I needed to choose my target a little bit more carefully. It targets a specific installed android version. Type android list targets for more info

ant debug issueandroid app


Preservatives in food = preservatives in my fat cells?

Question: Is it logical to believe that if I eat foods with preservatives, the resulting fats within that food may also store within my fat cells with preservatives and thus make it more difficult to rid my body of those fat cells?
Answer: As far as I know, there's no logic behind that belief. Historically speaking, some preservatives have since been proven to have potential negative effects. We no longer pack our meat in cakes of salt. We know that burning the outside of the meat preserves it, but also produces carcinogens. And, of course, we now know that packaging our food inside lead containers has certain negative effects. That said, modern preservatives are consistently safe and the mechanics that make food preservatives work (retardation of bacteria and fungal growth) have nothing to do with the process of "burning" fat.


Should I replace this frame with a badly scraped chainstay?

Question: I crashed yesterday and damaged this aluminum frame. At first I thought I shouldn't worry, but giving it a second thought, I think I should just replace before it breaks while riding. I would say it's like one mm deep.
Comment: Looks like the bike is upside down in photo, and that's the underside of the downtube ?  Is this the common double-triangle frame or is it a single beam design like a folding bike ?
Comment: @Criggie I can see the rear brake and seat stays in the background, plus the chain, plus what looks like the RD cable. This may actually be the underside of the drive-side chain stay?
Comment: @WeiwenNg yeah excellent spotting - its the underside of the chainstay, straight below the saddle.  Which means its mostly a member in Tension.
Comment: Out of interest, HOW did you achieve this ?  Guessing the bike as on its side and sliding.
Comment: And how did you achieve such deep scratches without bending or braking anything?
Comment: Is the cable okay?
Answer: In the long term I think you've written off your frame.  Sorry.
We've figured out that this is the underside of a chainstay.
Chainstays live mostly in tension while being ridden - that means you're pushing down on the middle of the bike, and the two wheels "want" to roll apart, away from each other.
What you've got there is a weak point, which will act as a stress riser and the chainstay will eventually fail at that point.
The good side is you have two chainstays, so sudden failure of the damaged one will be bad but probably won't collapse your bike all at once.
I would continue to ride the bike, but keep a close eye on the area weekly and once it changes, then immediately stop riding.  During this time, look for a replacement frame or bike.  Take photos on your phone periodically to compare - the mind forgets as time goes on.
If you are attached to the frame, it may be worth getting a framebuilder's opinion.  Being aluminium its harder to fix than steel or carbon fibre due to heat treatment requirements and not damaging the rest of the frame.  But a chat and a quote is free, and gives you a possible dollar amount that is the "sunk cost" and the difference between that and the new cost of a new bike is the "opportunity cost" for justifying a cheaper upgrade.
Answer: Show a bike mechanic to be sure but the frame is likely to be OK unless you like to jump a lot.
Judging from plastic pedals, 9 speed or less chain, and V brakes, you probably have a relatively cheap frame which means thick straight gauge metal.
You could gently file or sand the surface of the scrape flush with the rest of the tube. I'd leave it unpainted or coat with clear nail polish so you can periodically check for any cracking.
Alloy frames can take quite a cosmetic beating, it's dents you need to be more careful with.
EDIT
If this is actually a higher end frame then the tubing will be thinner and the frame is probably dead and needs to be replaced.
Answer: That's pretty badly gouged.  Should be OK for the near term, but could fail down the road.
I've wondered if, in situations like this, it wouldn't make sense to wrap the spot with sheet metal of some sort, perhaps epoxying it in place in addition to using some spiral clamps.
Comment: For general interest: in the aerospace and defense industries, it seems that you can actually wrap damaged aluminum parts in *carbon* for a repair. https://www.youtube.com/watch?v=IjwHq6h-5Fk
Comment: Steel on aluminum would create galvanic corrosion, even if the joint never got wet. This would accelerate the rate of damage. Aluminum sheet wouldn't have that issue, but might not have the strength. The whole "wrap it" idea seems reasonable, yet fraught with unanticipated failure modes.
Answer: This may not add that much compared to the existing answers. However, here are some thoughts.

We don't really know how deep the scratches are. Just surface scratches are probably not worrisome. Also, we don't know how thick the chainstay is where it was scratched. If this were a racing bike with very thin tubes, I'd lean towards replacing it as soon as practical. If that were carbon in general, I'd take it in for a repair immediately. Thicker tubes would give you more safety margin, but again, we don't know how thick they are. Generally, a lower end bike will probably have thicker tubes.

We don't know exactly how much stress that area of the bike is under. I stated in comments above that this looks like the center of the chain stay on the drive side. Generally, the drive side is under more stress because that's where the drivetrain is, so the force from turning the cranks is being transmitted to the frame. Generally, I think that areas closer to the ends of the tubes are under more stress. Areas under more stress from riding will probably fail faster.

The concept of stress risers or concentrators is applicable here. Basically, the gouges probably act as stress risers, like Criggie's answer says. This is why everyone is saying that the frame could fail down the road.

Overall, I'd second Criggie's recommendation for watchful waiting. You do want to be looking for cracks propagating from the damaged area. If the chainstay fails, I agree that it shouldn't cause an immediate loss of control; in contrast, failures of a fork steerer, fork blade, or downtube would cause a loss of control. If the scrape is really 1mm deep at the worst point, then you're probably justified in trying to see if you can get a replacement bike or frame.
Answer: I've ridden scratched up frames for years with no problems and I don't see any cracks in yours, so you're likely ok, unless you're putting the frame under extreme duress on your rides.
Comment: Can you add some more details?  Were those frames aluminium?  Were the scrapes as deep as these (they appear to be most of the way through the frame)?
Comment: It is *possible* (although not guaranteed) that even though there aren't cracks propagating from the damaged area right now, the chainstay might crack later on. After all, the wall thickness has been compromised in this area. Basically, if there are no cracks right now, that doesn't guarantee that it won't crack *later* - that said, it does depend on the material thickness and how much stress that area of the chainstay is under.


How do I transfer data between two old PCs using parallel or serial?

Question: Recently, I found an old Gateway 2000 Colorbook laptop with MS-DOS6.22/Win3.1 that had no ports but PS2, parallel, and serial ports. My modern computer doesn't have any of these ports, so I am trying to use an old Optiplex 755 with a Vista/Kubuntu dual boot to try and send files over parallel port. The laptop's only removable media is a floppy disk, and unfortunately I don't have a spare floppy drive to put in any machine. Is there an easy way to accomplish file transfer using parallel or serial ports, or do I need to buy floppy disks?
Comment: Laplink used to be the gold standard for this.  You could connect over serial and parallel ports.  If your hard drive is too old to be compatible with the USB adapter as suggested in the answer below, dig up an old copy of Laplink.
Comment: Is this a one time task or you want the old computer working and exchanging files? Because if it is a one time task you can extract the HDD and mount it as a pen drive with a PATA-USB adapter. (it is reported to have 250mb hard drive... so few seconds in that way)
Comment: Have you looked into PCMCIA LAN cards? You'll need a fairly old one to get driver support - and you'll need a floppy disk with the driver. Same problem for laplink though - you need a floppy disk to set it up
Comment: @Brad Yes, I'd suggest Laplink via serial or parallel with a third machine that has one of these and also has an Ethernet port (assuming the ultimate target computer still has Ethernet)
Comment: @Brad My answer was about laplink, although i didnt specifcally name it.  the problem is you still have to purchase it.  the IDE to usb adapter is a better choice IMO
Comment: Not even a network or modem port? I've used networking before with old or USB crippled computers. But I guess getting networking going on dos or win3.1 might not be very easy either, but there is linux... Anyway, removing the data/drive is probably the easiest, +1 to Keltari's answer
Comment: You can create a TCP/IP connection between Windows computers using a parallel cable. The speed is around 1 Mbps, IIRC. However, I'm not sure if this is possible with Windows 3.1. I don't remember there being a TCP/IP stack in Windows 3.1, though, IIRC, Windows 3.11 for Workgroups had it. [Here are the instructions for doing this on Windows XP](https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/howto_conn_directparallel.mspx?mfr=true). I did it many times back in the 90s. It was much faster than phone modems or serial cables.
Comment: you may find some good information in https://retrocomputing.stackexchange.com/
Comment: Laplink would probably need a floppy to put on the machine, unless you can dig up an actual physical copy...
Answer: You can send data/receive data over the serial port using a null modem cable, or adapter with a serial cable.  However, odds are high that you dont have one.  On top of that, you will need to install software (such as a very old version of Laplink) on the laptop in order to use it.  Even if you do purchase the cable, floppy disk, and find and install the software, transferring files will be slow.
Your easiest solution would be to buy an IDE/SATA to USB adapter.  Simply remove the hard drive from your laptop and connect it to this device.  Then plug the USB end into your Optiplex and you will be able to transfer data.
Comment: >> "However, odds are high that you dont have one."   Neither null modem cable nor (according to OP) serial port to plug it into on the newer machine. Upvoting for the adapter suggestion. Very useful item to have around.
Comment: [INTERSVR](https://en.wikipedia.org/wiki/List_of_DOS_commands#INTERSVR_and_INTERLNK)... I used to do this *often*
Comment: @SteveRindsberg Yep these adapters always come in handy and for the price, there is no reason not to have one.
Comment: For what it is worth: UBS-to-serial adapters exist, but the transfer is cumbersome and slow. +1 for the IDE/SATA-adapter, will most likely need an external power supply for the old disk.
Comment: @Hannu those HDD adapters usually come packaged with that external power supply - as others have said: they're super handy :)
Comment: @Hannu many of the ise/sat to usb adapters come with a power adapter
Comment: Just note that you shouldn't pay more than $10 for these adapters.  If you can't find them, buy the cheapest IDE USB enclosure you can find and just take out the box.  That's essentially what it is.
Comment: Marek Rost/Keltari - the obvious isn't always obvious to everyone - so; make sure everyone understands the full problem.
Comment: Also worth remembering that 2.5" laptop IDE drives use the 44-pin connector, unlike 3.5" desktop drives that use the 40-pin one because of different power connectors. So unless one gets a "universal" style adapter with IDE 40/44-pin/SATA, etc adapters it's likely they have to get a 44 to 40-pin adapter too.
Comment: I wish that solution would work for my MFM/RLL drives...
Comment: @DocWeird I havent seen an IDE to USB adapter without both options on it.
Comment: I suggest you clarify slow, as otherwise no one who didn't live through the era will realize how slow you mean. Max rate is probably 115200bps, so that'd be 14 kilobytes/second, best case. AKA 50 megabytes *per hour*. Real rates after framing, error correction, etc. will be slightly less.
Answer: USB-to-serial adapters exist.  The transfer speed might be nothing to write home about, but how much data are you going to fit on floppy disks anyway?
A reasonable program for transfering files via serial line is Kermit.  Should be available for any operating system worth its salt.
Comment: "hyperterminal" or simply "terminal", I don't remember exactly. It's a tool that comes with windows XP (and that works under Windows 7 too).
Comment: Kermit under DOS exists : I have used it, a long time ago to retrieve data from a "XT Compatible PC", as we said at this time. The data were transfered via a null modem cable to a Windows XP machine, and I had the surprise to discover that hyperterminal knows the Kermit protocol.
Answer: Before trying out the "hardcore" no-extra-tools method I describe below, check if your Optiplex has a PATA port available inside - in which case, likely all you need is an adapter for a 2.5" PATA drive (the plugs are different in 2.5" vs 3.5"/5.25" PATA form factors...) and you can just remove the harddrive from the laptop and access it in the Optiplex. If anything nonessential (CD drive?) is already on the PATA bus, disconnect it unless you know what you are doing with PATA, the Master/Slave/CS mechanics could complicate things.
There were laptops that used harddrives on the ancient ST506 or ESDI interfaces - try to check that beforehand (google the model number on the harddrive and get a spec sheet), do not attempt to connect such a drive to a PATA machines.
Or, you could get a PATA to USB adapter, they are not expensive.
The ports are accessible as device files under DOS (COM1...x , LPT1...x), and can be used as a target for a COPY command or a redirected TYPE command. On the linux end, the ports are also accessible as device files (/dev/ttyS0..x, /dev/lp0..x), and can be read from, eg with "cat /dev/ttyS0 >> some.file.txt".
These will need a null modem cable for serial transfer (if you have a normal serial cable that you can physically connect, try swapping the wires to pins 2 and 3 on the 9 pin end), or a corresponding parallel cable (which is rare, most of them had a centronics plug on the other end which doesn't mate to a PC parallel port physically). Actually, any wire hookup connecting pins 2 and 3 crossed and pin 5 to pin 5 (assuming 9 pin pinout) should work on serial if you keep the wires short and close together. Let's ignore parallel for now, since you would need to set up STROBE/ACK signalling correctly to work with the DOS device drivers...
In case of using serial ports, you will need to configure the ports on both computers, with stty on the linux side and MODE on the DOS side. Note that these configuration settings are NOT persistent across reboots. I would suggest trying 115200,8,o,1 and downgrading the speed if it doesn't work - i'd keep the parity on, though, since it is there for detecting errors caused by electrical interference. Also, make sure that there is no kind of newline translation mechanism set active (I do not know if some DOS versions manage such via the MODE command).
If you need to transfer multiple files, your best bet is combining them into an archive - if PKZIP is available on the DOS machine, it can be unpacked with the "unzip" or "zip x" commands on the linux side. However, you might need to repeat the transfer in the worst case, serial communication can be not 100% reliable against interference.
Comment: This should be combined with the USB-serial converters mentioned by @
user814792.  The cheap ones often -- but not always -- work well and have mroe chance of working under linux.
Comment: The optiplex is likely to have a serial port, and a USB converter is unlikely to  have an integrated null modem cable :)
Comment: You could skip the optiplex with the right cable though. I think one of mine does actually have a built in null modem setting (as well as hardware loopback). Probably windows only. But that still wouldn't help - wrong gender.
Answer: Assuming you have the correct cable (either parallel or serial), you could install Virtualbox on the Optiplex, install MS-DOS as a guest, and use the serial or parallel port pass-thru to expose the port on the Optiplex to your guest OS.  You should be able to transfer your files to the guest OS that way.  After that, it's just a matter of using the shared drive feature to copy the files onto the host OS.
MS-DOS includes INTERSVR and INTERLNK, which you can use for the initial transfer.
Comment: It depends which software you use.  I don't recall for sure, but I think intersvr and interlnk only work with serial ports.  If the OP can get his hands on a copy of Laplink or some other commercial product, then the parallel port would likely be a better option.
Comment: Hm... I interpreted "no ports but PS2, parallel, and serial ports" to mean that it **does** have a serial port.  Maybe a clarification is in order?  P.S.  I found this image on a google search: http://img.auctiva.com/imgdata/1/6/7/0/4/3/3/webimg/827200326_tp.jpg   - looks like it does have one serial and one parallel port.


Machine learning: overfitting phenomena

Question: Please explain why we should avoid "overfitting phenomena" in training
a learning model and how to detect it?
Comment: Welcome to math.SE! This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level.
Comment: Read a book.  This one is free from the authors. http://statweb.stanford.edu/~tibs/ElemStatLearn/
Comment: Do you mean what many people call "the overfitting phenomenon"? It's a problem in many activities, not just machine learning. Presumably, if you are asking this question, you know what the overfitting  phenomenon is, which should give you a clue why we want to avoid it. If you don't know what it is, or are unsure of your understanding, perhaps your question should be, "What is it?" (But in that case be sure to say what you have heard about it and explain what appears to be missing or incomplete in those descriptions.)
Answer: While i fully agree with the previous comments, for example that book on statistical learning is great and if you google around you will find some really nice accompanying videos from the authors as well...I would just add this short thought to get you started - ideally one wants to train a model which would be good in predicting general cases - the generality is what makes it so useful right? Now, having a model which is overfitted or  over-trained basically means that it is good in predicting only particular cases. Now detecting it, depends strongly on what are you trying to do, there is no simple general look up table.
Answer: You can detect over-fitting by comparing training and test performance. For instance, you can divide the data $X$ into training and test sets and compute a loss function as the number of training samples increases. The distance between training and test loss will be proportional to the amount of over-fitting.
In order to avoid over-fitting (and do well on out-of-sample or test data), it is common to use cross-validation for model parameter tuning. Cross-validation divides the data into K folds and uses K-1 for training and 1 for testing averaging results over K iterations. This helps avoid over-fitting and selects the right parameters for the model.
Answer:
What is overfitting?

It's when your model has learned from the data it was given (and very well, usually), yet does very poorly on new data.
Example: imagine you have a noisy line $\{(x_i,y_i)\}_i$, where $x\in[0,1]$ and $y_i\sim \mathcal{N}(x_i,\varepsilon)$ for some small $\varepsilon$. Consider fitting the model $f_\ell(x)=ax$ versus the model $f_p(x)=\sum_{n=0}^{1000} a_nx^n$. Suppose you have only a few points, say, 10. Basically, in the former case you will get a nicely generalizing line, while in the latter case, you can perfectly fit the data - but what happens in between the points from the training data set will usually be terrible. Another example is to have a model that memorizes the training set, and if it does not know the input, outputs a random value; i.e., it works as follows: given an input $x_i$, if $x_i$ is in the models' training set, it outputs y_i; otherwise, it outputs $0$. Clearly, it will do perfectly on the training data, but fail miserably on any other data you give it.
More formally, in ML we want to do empirical risk minimization, meaning find a function $h^*: D\rightarrow \mathcal{Y}$ from data space to target space such that
$$ h^* = \arg\min_{h\in\mathfrak{H}} \int_D L(y,h(x)) P(x,y)\, dxdy $$
where $h^*$ is out of some hypothesis (function) space $\mathfrak{H}$. The problem is that in practice we only cover a small portion of $D$ with our training data; hence, our minimization of the expectation above may be rather poor for the areas of the data space that our model has not seen.

Why should we avoid it?

Generally, in ML, we train a model and then want to use it on different data than what we trained with. E.g., if I train a model to predict drug efficacy, I don't want it to run on chemicals I trained with (for which I already have the answer); I want to run it on new ligands, for which I do not. As noted above, overfitting implies (by definition really) doing poorly on data outside of the training sample (but well on in-sample data) - but out-of-training-sample data are exactly the ones we care about in practice the most!

How can we detect it?

Usually, the standard practice in ML is to have three data sets: a training set, a validation set, and a testing set. In cross-validation, the first two are intertwined. The use of the validation set is to prevent overfitting on hyper-parameters; the use of the test set is to test generalization capabilities.
In other words, you train the model on one set, then test it on another (that it has never seen before): this gives an estimate of the generalization error (i.e., the out-of-sample error or loss). If the training error is much smaller than the validation or test error, then you are overfitting the model. If the validation error is much smaller than the test error, then the hyper-parameters of the algorithm may be overfitting.

How can we fix it?

If you see that the model does very well on samples it knows, but poorly on samples that it doesn't, then the standard approach is to regularize the model. Mathematically, this usually involves restricting $\mathfrak{H}$, meaning we only consider functions that we think are good candidates for the task. (In a Bayesian sense, we essentially place a prior on the hypothesis space). For example, when we place an $L_2$ weight decay penalty on the parameters of a neural network, we are regularizing it by forcing $\mathfrak{H}$ (or at least the part of it we can feasibly reach) to shrink to the set of functions parameterized with low-value weights (a little like putting a zero-centered Gaussian prior on the weights ;) ). Adding noise, like dropout, also regularizes the network. One can think of it as
artificially expanding the parts of the data space seen by the network or lowering the capacity of the network by forcing it to "spend" part of its representational power handling the noise. Either way, it essentially "smooths" the behaviour of the network on unseen parts of $D$.
Lastly, I'll note the connection of overfitting to the famous bias-variance tradeoff. Note that here the variance refers to the variance in the model output as the training set changes, not the variance of the outputs within a particular training set, assuming a deterministic model anyway.
Weaker models tend to have high bias (meaning they underfit; they do not even learn the training set that well), but low variance (meaning they behave "reasonably" on unseen data, and hence do not overfit).
Powerful models (e.g., so-called "deep" ones) tend to have high variance: they essentially "learned" the noise and useless idiosyncrasies of the training data (meaning they overfit). In the latter case, if the training set changed, the predictions of the model on the same test data might change drastically, since it had overfit to the noise of the training set. A weaker (e.g, linear) model is less likely to have such unpredictable behaviour - but may do worse on the training data.
Since we are on the math SE, I'll just mention statistical learning theory as a good place to learn more from a theoretical point of view. For practical advice, any book on ML will talk about it.
Comment: This is a wonderful and thorough answer, thank you!

Machine learning: overfitting phenomena


How can I set up multi language admin ui?

Question: I will have two admin users, one of them only speaking italian and the other only speaks english. How can I setup multi-language admin user interface?
Answer: There are a couple of methods that this can be done without the overhead of plugins.
Method 1
The first method involves hooking to the load_textdomain_mofile filter.
(This must go into a separate plugin)
function wpse31785_change_mofile( $mofile, $domain ) {
    if ( $domain == 'default'
        and get_current_user() == 'riccardo' )
            return substr($mofile, 0, -8).'it_IT.mo';
    return $mofile;
}

add_filter( 'load_textdomain_mofile', 'wpse31785_change_mofile', null, 2 );

Method 2
This method involves modifying your wp-config.php file in order to conditionally set WPLANG.
// store the language in session
if ( isset($_GET['lang']) ) $_SESSION['lang'] = $_GET['lang'];

if ( isset($_SESSION['lang']) ) // pick the language conditionally
    if ( $_SESSION['lang'] == 'it' ) define( 'WPLANG', 'it_IT' );
    elseif ( $_SESSION['lang'] == 'en' ) define ( 'WPLANG' , 'en_EN' );

// the default fallback
if ( !defined( 'WPLANG' ) ) define ( 'WPLANG', '' );

With this in your wp-config.php you are able to provide an additional GET parameter to set the language for the session. http://yoursite.com/wp-admin/?lang=it will set the WPLANG constant to it_IT.
Alternatively you can store the chosen language in the cookies with setcookie() and get them from the $_COOKIE global instead of using the session variables.
Answer: There are some plugins that will do it for you.
I think one is called wp native dashboard'  allows user tochoose language from those installed
Another one called 'in their language ' is simple but effective - attempts to determine preferred language from the browser settings.
Of course you must also have the wp language files loaded for the languages that you want to support in the admin area.
 http://codex.wordpress.org/WordPress_in_Your_Language


can I substitute greek yogurt for sour cream for a topping for baked cheesecake?

Question: can I substitute greek yogurt for sour cream for the topping on a baked cheesecake?
Answer: It's difficult to say without considering the details of a specific recipe.
Both items have a sour dairy flavor.  Obviously the two products often also taste different, because they may use different bacterial strains and temperatures in fermentation.  But if you are using them as an ingredient in a topping that has other strong flavors, the taste difference may not be that noticeable.
In general, the main difference is going to be the fat content.  Full-fat greek yogurt typically has about twice as much fat as regular milk, around 10%.  Sour cream generally has around 18-20% milkfat (though some varieties may be higher).
Aside from less richness in your topping, the lower fat content of the greek yogurt could impact the texture, perhaps making it more runny.  On the other hand, the thickness of greek yogurt is due to a higher protein content (rather than fat) which could also impact texture.  You might need to make adjustments in quantity and/or add thickeners or liquid to obtain a similar texture to what you normally expect.
Comment: Good answer - I would add to double-check there's no sweeteners or flavors added to the yogurt. Straight-up plain greek is roughly compatible, especially as a topping.
Comment: @john3103 - absolutely right.  I was assuming the question was asking about plain greek yogurt since that's most similar to sour cream.  Yogurt with flavorings would add, well... flavorings.


Is Cloudflare unzipping gzipped dynamic content?

Question: I'm using Cloudflare for a small website that is frequently accessed from mobile phones where bandwidth usage is crucial. I used to gzip every php response and this reduced my bandwidth usage, however, since I'm using Cloudflare, dynamic content going trough Cloudflare isn't gzipped anymore. Is this a feature or bug?
Answer: According to their documentation, Cloudflare GZIPs resources:
https://support.cloudflare.com/entries/22064616-does-cloudflare-gzip-resources

"we will honor your GZIP settings as long as you're passing the
  details in a header from your web server for the files."