How can I handle a daughter who says she doesn't want to stay with me more than one day?

Question: I got divorced in 2019 and have a daughter who will be 10 in 4 months. Yesterday I went to their house to pick her up for holidays and she all of a sudden said "dad, I don't want to stay with you more than one day. I've grown older now and I have my own system at my own home". On top of that, she said "I even don't want to stay at my friend more than one night" to which I responded with "that's your friend, I'm your father". Obviously, this made me very sad and I let her know that. I said "no, I see you every two weeks and you don't want to stay with me more than one day?". I don't want her to grow away from me. Please advise as to what I should do.
Comment: "I have my own system at my own home".  I'd ask her what she means by having a system.
Comment: Because maybe you can replicate the system at your house.
Comment: Mod here. Comments are neither for answers nor for extended side discussions.
Answer: Well, not like that.
Your daughter voiced a perfectly reasonable sentiment (being away from home is disruptive, and some people really don't like disruptions like that). She even tried hard to make clear that this is not a rejection of you, but just her preference regarding stable conditions. [Which I find pretty great in a 9 year old!] You reacted by trying to guilt-trip her. Not cool.
So what should you do?
First of all, recognize her desire to avoid longer absences from home as legitimate. This doesn't mean giving up on your holiday plans with her, that just means recognizing the downsides for her. Importantly, it is ok that she feels like that. Understand this, and then convey to her that you do.
So, she has her system at home. Ask her about it! Taking an interest in what is important to her is a basic act of maintaining a connection for her. Even better, there may be something the two of you can do to make staying with you less disruptive for her (eg buying her usual breakfast cereal, giving her more me-time, switching around where her tooth brush is). Even if you don't really find something good to do about this, trying with her is a way of showing that you genuinely care about her having a good time with you (where "her" is your actual daughter, not the abstract idea of a daughter).
Comment: Would you recommend bringing up the previous conversation and apologizing for the guilt-trip argument (with some more palatable phrasing)?  Like "Last time we talked about this, in hindsight I wish I'd answered differently.  With some time to think about it...". Or would you just start fresh on another attempt at the conversation without directly bringing up the past?  Maybe indirectly, like just the part about having had time to think about it and wanting to discuss again.  (Perhaps it depends on how good a memory the kid has, and if she tends to hold onto previous poor interactions?)
Comment: Also consider that she may be not neurotypical. For some people interrupting a usual routine may be more stressful than you think.
Comment: @PeterCordes Difficult to say. In principle I'd say that demonstrating how to recognize having been wrong and then apologizing for it is an important thing for parents to do for their children. On the other hand, this is a complicated issue, and for OP to not only understanding the subtelties himself but to be able to express it for a 9 year old may take enough time that apologizing then would be too late anyway. I'd probably go for "apologize if she brings it up, but not bring it up proactively".
Comment: I'd say "trying to guilt-trip her" greatly depends on the context of the situation. It is constructive to understand the differences in relationship between friends vs. family. I don't really think there was enough detail in the Q to determine that context.
Comment: A 9 year old has the foresight of a child.  Their prefrontal cortex is completely undeveloped, and the prefrontal governs planning.  She is expressing what she feels and attributing it to how she feels about spending the night with a friend.  A friend is not a father and should not exist in the same category at her age.  She says what she says without understanding the far reaching consequences of such actions.  This father is not guilt-tripping his child and shouldn't be attacked for that.  This father is asking the community for assistance, not for badmouthing.
Comment: **Comments have been [moved to chat](https://chat.stackexchange.com/rooms/147264/discussion-on-answer-by-arno-how-can-i-handle-a-daughter-who-says-she-doesnt-wa); 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.
Answer: I upvoted @Arno's answer because the advice is sound. I'd like to take a different approach. It will sound harsh, but please know I don't mean it to be harsh. I just mean it to hopefully be a better way to look at it.

I don't want her to grow away from me.

Two things about this statement: 1. although it's perfectly understandable and a normal reaction, first, it's only about you (I understand it's not everything you might feel) where it should be about her as well. 2. She will grow away from you, which is also normal, and while it does hurt, you need to make your feelings your responsibility, not hers.

...it should be about her as well.

A different way to look at it is "I want my daughter to feel good about being at my place, too."
What would that take? It means a conversation (or five or ten) about what makes her happier to be at her mother's house (without your hurt feelings being on display) and any adjustments you can (both) make to make it easier to be at yours. While it may be more complicated than breakfast cereal or toothbrush placement, it should be doable. How much time does she spend in her room at her mother's house? What is her room set-up like there? What are her favorite activities at her mother's house? They may or may not have anything to do with her mother. They might be time on social media, they might be playing games (irl or on a device), etc. If you know your daughter's interests, you can plan accordingly.*

She will grow away from you...

Kids become adults, and depend less on their parents as they age. It's called independence. They like autonomy and are seeking it out. The vast majority love their parents as much as ever, and they aren't doing it to hurt them; they're doing it because it's an innate desire they have, and it's practice for adulthood. At some point, many kids do become disrespectful (hopefully temporarily) towards their parents, but that's yet to come. Handling this behavior well will prepare you to better handle that behavior if and when it comes.

...you need to make your feelings your responsibility, not hers.

She feels what she feels, and whatever you feel (not think) about that, both of your feelings are valid. But how you act on your feelings, your response/behavior, is your responsibility, as is her behavior her responsibility. So you don't tell her her feelings cause you pain. It's fair to tell someone that their behavior upsets you, but not their feelings. For example, if she spends all day in her room on her phone, it's fair to say, "I think it's okay to spend time on your phone, but I would like to see you more when you're here, since I don't see you everyday. Can we spend more time together?" (Then explore options.) That's much different than, "I'm hurt that you prefer to spend time on your phone instead of with me, since I only see you four days a month." That's making her responsible for your feelings, implying that her preferences are bad and her behavior needs to change in order to make you feel better. It's blaming her for your feelings. Reserve that for only the most serious violations, those where her intent is to hurt you.**
I hope that if you try hard to see things from her perspective, the empathy-deficient words she says will cause you less pain.
*It would be perfectly normal to want to restrict screen time on her visits with you. But if you do so, make the time irl interesting to her. Find out what she likes and do things oriented towards that. Be creative. My kids liked nusic, so we went to a lot of live performances, both locally and sometimes on a trip to a big city. Etc.
**If she tells you you're an idiot and a complete failure as a father, it's fair to tell her that her words wound you to the core. Then, what you do about that is your responsibility.
One of my kids picked up on my despair at my failure in a medical case I had spoken with my then-husband about. At a later time when I was discussing their behavior with them, they compared it to my medical failure (e.g. "It's not like I killed my best friend." ([not the case but the same intent]) Since that was such a departure from their normal behavior, my response was surprise and a simple recognition: "You're trying to hurt me." My child burst into tears, and I comforted them. What they felt - defensive - was normal, however what they said was not kind. But I knew my child to be a kind soul, so I was not hurt. That was a good day. (They weren't all good days.)
Comment: @nick012000 - Those are responses to a feeling. You cannot control the initial feeling(s) you have on encountering a situation. Those are called primary emotions, and while, with therapy or other helpful tactics, you might be able to change the lens through which you perceive things, you cannot control your primary emotions. If you think you can, you're deceiving yourself.
Comment: _"If she tells you you're an idiot and a complete failure as a father, it's fair to tell her that her words wound you to the core. "_ => This is still her _behavior_, not her feelings, hurting her father's. Apart from that, I agree with the premise: people can't control their feelings, blaming those is unproductive and can only lead to negative emotions (guilt, anger, ...). Conversely, people do control (to a degree) their behavior, and it's productive and constructive to let them know how their behavior affect you, and reprimand them when they intentionally wound you.
Comment: @MatthieuM. "people can't control their feelings" People absolutely can control their feelings. You can take deep breaths to calm yourself down when you're angry (or rapid breaths to deliberately make yourself angrier), you can use cognitive behavioural therapy techniques to derail negative emotions, etc.
Comment: I wish I could accept both answers, but SE only allows 1. I'll definitely ask her about her system and try to replicate it in my flat. Thank you both.
Comment: Hmm. If other users give advice based upon at least their own experience, that's anecdotal and downvoted [even if the science backs it up]. There's a veritable monograph here and not one reference.
Comment: I downvoted Arno's advice because it is harsh.  While I don't agree completely with this answer (see my own) I didn't downvote it because it does have some great advice that while not completely in line with my own is reasonable.  Independence should not be acquired at 9 or 10.  Independence in most social history was acquired sometime after 12 or 13.  Law now says 18 in most states.  You are her father, and you have a right to be her father for 2 days every 14 days.  In fact, you have responsibility to be her father 14/14 days.  Her spending the night isn't a request, it is a court order.
Comment: @Araucaria-Nothereanymore. - What would you like me to post a source for?
Answer: Former Child Abuse/Neglect Investigator (AKA Children's Social Worker Aka Children's Service Worker 9.5 years exp.) Says:
People don't like my other answer, so I will add a second specific answer.  The other answer teaches you to fish, here is the answer that gives you the fish.

Follow the Court Order.
If you don't feel the court order is best, modify it.
Discuss the issue multiple times with your daughter and try to figure out ways to alleviate her feelings, be they temporary or not.
Your feelings are valid.
Your fatherhood and involvement is important, otherwise there wouldn't be a court order giving you time with your daughter.
Your daughter is not old enough to make the decision not to visit you, and even if she was, the court has control.
You are probably paying child support and will be until she is out of college.  Make the most of the tiny bit of time you have been granted.
Seek outside help for yourself and your daughter if you are unable to find an answer on your own (aka counseling or bringing in another outside entity such as a friend/grandparent/pastor/etc.)
Answer: Former Child Abuse Investigator says:
A few things to ask yourself:

What were the conditions of the Divorce?
Was she like this before the divorce?
What is your relationship with the mother?
What do you do with your daughter while she is present?

The first question comes down to fault/blame in your daughter's eyes and your own personal feelings about it.  It is about how the divorce was handled by each person.
The second question comes down to your daughter's natural behavior and outlook on life.  For example, is she an extrovert or an introvert?  Did you spend time with her before the divorce, does she like spending time with you?  Is she chronically depressed?
The third question involves the post-divorce conditions that may be affecting your daughter's stress and capacity to handle the divorce.
The fourth question involves making it fun for your daughter to be around you.  If, you are that parent who sits on a couch doing nothing fun with your daughter, is it really surprising that she doesn't want to be with you?
I am not Hope In the Night, and no one should be able to answer such a deep question in a single couple paragraphs without knowledge. However, with these tools, you may be able to start to do it.
If your relationship is not good with your daughter, perhaps it is time to build it by doing fun things with her and being careful not to criticize her too much.  If your daughter is a natural introvert or likes things just so, perhaps it is time to look at a change in custody that will allow her to have a day or so with you to calm down and then stay for awhile, or maybe it is time for her to stay more often but in shorter spurts.
The thing is, you can't just let her do what she wants without having a reason to let her do so, because her decisions can impact the rest of her life, and what she decides can impact her decisions later.  There are places for that, but this isn't one of them.  For example, if her plan is to never see you, that may become a problem now, later, and when she has kids and needs support for that family.
But that kind of decision doesn't stop there, because by making such a decision, her own children will possibly make the same decisions, resulting in children's children's children, aka your progeny that have historic divorce and lack of male presence that results in more divorce and poverty (look at those correlations).  However, if you never had a great relationship with her, perhaps you need to give her space and work on that relationship first.
Ultimately, a calm conversation is in order with your daughter and then possibly your ex-wife, and perhaps options can be discussed.  I know that many children want to spend time at home with their things and with their friends.  So, not having that thing at your house whether it be an addictive Oculus or her favorite dolls, can result in her just not having fun.
For Example: I know of one such woman who decided she did not want to visit her father simply because she didn't want to be gone long from her mother or be gone long, aka it was a hardship.  The relationship between that woman and her siblings became poorer for it. The woman wound up divorced twice, widowed twice, and married 5 times in all.  The woman later wound up remarkably fond of her father, and constantly needed to ask for money, but not really in a great relationship with him partially due to his aloofness.  The woman's eldest child's ex-boyfriend wound up raising the woman's grandchildren.  The second eldest child wound up fine, but the third lost their children to their wife and wound up in prison, then dead.  The fourth lost an adopted child to the state but finally found his feet.  The fifth seems to be doing fine.  See the long term generational effect?  Meanwhile in the short term (back in the past), the woman's sister made the same decision not to visit her father when she was 16 or so and able to make that decision, partially wrecking sibling relationships.  Both women live near the line of poverty.  Although that younger sister wound up divorced only once, and her children seem to be doing ok so far, only time will tell.  So, the consequences of such decisions are far reaching and impact more than just you and your daughter.  The father of the women sat on the couch resting most of the time when he got home from a busy week of travel.  Although their father's divorce was due to infidelity, the impact of the mother's infidelity and divorces impacted her children's children's children.  I am showing a real example of how divorce impacts families generationally, and you have to do things to actively mitigate divorce because the consequences can be horrible; the Government knows this well and has laws that give you time with your daughter because they have special counsels, family divisions, and research put into these things.
If no resolution can be found I suggest a few sessions of counseling with your daughter.
Answer:
How can I handle a daughter who says she doesn't want to stay with me more than one day?

You 'handle' her by respecting her wishes and letting her spend time wherever and however she sees fit. As you would with anyone else whose personhood you respect.
Certainly not by guilt-tripping her.
Answer:
I don't want her to grow away from me.

Senseless phrase.
If you don't want her to grow away, let her grow from you without awaying.
Your side? - you can't take her side? or atleast don't go on another side of the road?
No one forces you to go another side except your selfish motives. She still needs your care, she told to you about her problems, listen to her and try to solve her problem. Why do you say: no! it is not my problem! I don't want to hear you, listen to me!
And i think that all your problems with women is in case of your deaf position to woman's problems. The highest level of woman trust to a man - not a sexual addiction, but to  share (herself) problems. Love from man to woman is not to give sex or pleasure, but to solve her problem.
And your daughter confesses to you that she has a problem.
She is begging you to help.
So, what your actions will create the new sense of Her-Home?
And yes, she grows up to teen girl.
And yes, she started to produce problems like every woman does.
And yes, you should to be able to solve at least half of her problems if you want to be a good father to her.
That is only the way of love.
And you don't have to drag her to your home again, can you take her  a journey? Take her in park, walk, circus, theatre, museum, concert? Why you force her to spend time at Your Home all days? Why have you to be a boring father, but not a cool daddy?
Your Cinderella told you that she is afraid that her chariot turn back into a pumpkin after 12 and she doesn't want to stay after midnight anywhere except her Home-System - she is a newbe, she is a teen now, she hesitates to do things, that she did before, old rules are not enough for her...
She is New, and she needs new sense of home with old-cool daddy, not pumpkish one with boring old-father.
Comment: **Comments have been [moved to chat](https://chat.stackexchange.com/rooms/147265/discussion-on-answer-by--how-can-i-handle-a-daughter-who-says-she-doesn); 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 increase industrial demand in Sim City 4?

Question: What I want to know is how to increase industrial demand in my city, I also want to know how to get more commercial demand, and jobs in general. Thank you in advance for you answers!
Comment: Dirty Industry will go just about anywhere. Decrease the taxes and it should boom!  This will also attract low income families, and in turn, more crime though.
Comment: thats odd, because I do that, and the demand still seems to be low
Comment: Is the land value too high?
Answer: This is from the Sim City 4 Wiki  http://strategywiki.org/wiki/SimCity_4/Zoning_and_Demand#Industrial:
"As for actual industry, the demand cap is raised by the freight leaving your city, therefore the industrial demand cap should be self-sustaining if you have any neighbor connections. Note that due to a bug, seaports do not count towards the industrial demand cap. There are some reward buildings which raise the demand cap as well.
To make only high-tech industry, which doesn't pollute and can get you new buildings if you have enough, go to The Monthly Budget menu and raise the taxes for Manufacturing and Dirty Industry to 20.0, which is the highest it will go. The demand for them will get really low and now if you make industry in a high desirability zone it will develop as High-Tech Industry. If it doesn't, to help lower taxes for High-Tech a little or build parks and commercial all around it, but note that you will need to provide a well educated population as well as a supply of water."


Game requiring gamepad instead of tilt controls

Question: When i start a game it starts with gamepad controls as default, i can't play the game .
How to change settings in Mobile to change input from controller to default tilt.
Answer: That's not a global setting, it's specific to the game. You'll need to look in the settings inside the game and see if it has tilt controls. If it doesn't support tilt controls you're out of luck.


How can the Brønsted-Lowry theory be valid?

Question:
How can an element accept a proton? Isn't this practically impossible? An atom can take an electron and place it in its valence shell to complete its octet or duplet, but, the proton sits back in the nucleus with the neutron. So, it must be impossible for an atom to take a proton and bring it in the nucleus which sits deep in the centre.
Comment: Look at your equation and think: if the nitrogen atom would take the proton to its nucleus, would it still be nitrogen? Did the hydrogen atom count change?
Answer: Hydrogen is nothing but a proton with an electron about it, so H+ is just a proton.
Therefore it is not the element that accepts the proton, it is the molecule.
Answer: The Brønsted-Lowry theory is valid. When indicators are used in titration for example, the color of the solution, depends upon how many H's are bonded to the chemical indicator which is related to the acidity or basicity of the solution. Generally, the Brønsted-Lowry theory would tell you that the molecule with the most H's would donate it's proton (H) to the molecule with least H's when this happens NH4+ becomes NH3 upon losing an H, and NH2- becomes NH3, so you got two equivalents of NH3.
But that is not quite the best model as the Lewis-base model is better where the base is the electron donator (NH2-), and the acid is the electron receiver (NH4+). I might have to shift into my virtual machine to draw you a diagram. But anyway, what is happening is NH2- has two lone pairs of electrons and an negative charge, while NH4+ has no lone pairs of electrons and a positive charge ... so there is electrostatic attraction between the two molecules. A lone pair of electrons on NH2- desires to form a stable molecular orbital (as a lone pair orbital is not as stable as a molecular orbital in a bond between two atoms) so the lone pair of electrons abstracts a free H from NH4+, and as this happens a bond breaks from the H being abstracted to its N on NH4+ as H doesn't like to form two bonds, so NH4+ becomes NH3 and NH2- by gaining an H becomes NH3, as well.
Keep in mind that the bond between N-H, C-H, O-H, etc is polarized (not strong) because there is a large difference in electronegativity of the elements N and H, so it's easy to lose an H from whatever element it's bonded to if it feels a pull of free electrons.
New molecules form by the flow of electrons between atoms on one molecule and atoms on another molecule. It's possible to form monatomic ions like when you dissolve H-Cl in water and get the free chloride ion with a full octet of electrons. However, atoms within molecules usually get their full octet by bonding to other atoms from other molecules and sharing the electrons covalently.
Anyway, here is the electron-flow diagram. Those arrows show the movement of electrons. Note that Any of those H's of NH4+ is up for grabs.


Why does pressure behave exponentially in the atmosphere?

Question: I wonder why the pressure is exponentially within the atmosphere but (almost?) linear in the sea?
Answer: Let us consider the differences between the sea and the atmosphere. The atmosphere is a layer of gas, while the sea is a layer of (nearly)-incompressible fluid. We can use the properties of these to deduce the pressure variation with depth.
In both situations, we need to balance the forces from air (water) pressure and gravity.
Consider the air first. Because air is (approximately) an ideal gas, the density is given by $\mu p / RT$ where $\mu$ is the average molar mass of the air. The force from air pressure on a thin "slab" of air at height $z$ with thickness $\Delta z$ and area $A$ is $( p(z) - p(z + \Delta z) )A$, where up is considered positive. The force of gravity is equal to the density times the volume, or $ - \left( \frac{\mu p g}{RT} \right) (A \Delta z) $. The force balance reads
$$ (p(z + \Delta z) - p(z))A = - \left( \frac{\mu p g}{RT} \right) (A \Delta z) $$
$$ \frac{dp}{dz} = \frac{ p(z + \Delta z) - p(z) }{\Delta z} = -\frac{\mu p g}{RT} $$
in the limit as $\Delta z \to 0$. Because $dp / dz$ is proportional to $p$, we have an exponential dependence, $p \propto \exp(-\frac{ \mu  g z }{ RT })$.
Now, consider the water. Because water is an incompressible fluid, the density is constant throughout, let it be $\rho$. Then, the force balance reads, at depth $z$,
$$ (p(z) - p(z + \Delta z))A = - (\rho g) (A \Delta z) . $$
Note the difference in signs: by convention, we let $z$ be the depth beneath the surface of the water, as opposed to the height above the bottom of the sea.
Thus, we can write
$$ \frac{dp}{dz} = \frac{ p(z + \Delta z) - p(z) }{\Delta z} = \rho g . $$
Since the derivative is constant, we can write $p = p_0 + \rho g z$, which is a linear gradient.
Summary. The difference in the types of pressure gradients arises due to the fact that density is (nearly) constant in the sea, whereas density is linearly proportional to pressure in the air.
Comment: Well, if you have $dp/dt = -cp$, you can write $dp/p = -cdt$, so by integrating $\ln(p) = -ct + d$, so that exponentiating gives $p = Ce^{-ct}$, where $C = e^d$.
Comment: Thanks a lot for the detailled answer! Just one aspect I didn't get: Why depends p exponentially on the conditions? When I integrate both sides I do not need an exp term respectively when I derive the exp term the exp cannot vanish. What am I misunderstanding?
Comment: @valerio I have edited.
Answer: Gasses are compressible; so as the weight from the layers above applies pressure on the gas; the gas will have a tendency to compress itself as well.
This means that as you get a thicker atmosphere; the weight doesn't just increase because there is more fluid above it; it also changes because the more fluid above it; the greater the density of the fluid, as it gets compressed more by the weight.  This all relates to the ideal gas law.
Water is practically incompressible at moderate pressures, so it doesn't behave this way and approximately only has the linear effect of hydrostatic pressure.
Comment: More mathematically, (ignoring the variation in gravity as height increases) the density is proportional to the weight of air above, and the derivative of the weight above with respect to height is proportional to the density. So the derivative of the weight above is proportional to the weight above, which gives an exponential function.
Answer: Nitrogen and oxygen molecules are not bound to each other and move independently. Their height distribution is given by the Boltzmann factor:
$$P(E) \propto \exp\frac{mgh}{kT},$$
where $mgh$ is the gravitational potential energy of an air molecule and is $kT$ the thermal energy at the temperature $T\approx 260$ kelvin. This exponential distribution is in reasonable agreement with the barometric formula and the scaling height of the atmosphere.
Water molecules stick together. Gravitation acts on the condensed liquid as a whole. The density is high and almost constant because the compressibility of the liquid is low. With pressure as the weight of the material above, this gives a linear pressure increase.


magento attribute display in product page

Question: i want to display a attribute just below to the price in product view page and should be dependable with price. that is I select one from attribute price should change.
Comment: So, do you tried so far?
Answer: This sounds like a case for configurable products.
For example, you create three simple products "T-Shirt M", "T-Shirt L" and "T-Shirt S" with the respective "size" attribute.
Then you create a configurable product, select "size" as configurable attribute and choose the three simple products from above as associated products. For each simple product you can choose a price difference at this step.
Comment: can you make it clear as step by step
Comment: step by step: http://docs.magento.com/m1/ce/user_guide/catalog/product-configurable.html
Answer: You can do this from custom option also.
Ex. You can add multiple option in product custom option and set price for that. You can set it required / Non Required according to your need.


What good mentoring programmes are there?

Question: For people looking to get into UX, what mentoring programmes are out there? Have you tried any and if so, what were/are they like?
Answer: HI Philip
IAI have a mentoring program for members. Not used it myself but have seen some good feedback.
I'm hoping to work with Chris Avore from UX Show and Tell to arrange some events which could act as a mentoring type program based on practical skills.
What do you think? Please leave a comment below.
Matt
Comment: Matt, I believe Jane Austin from IG Index is also looking to get UX Show & Tell off the ground in London (think she posted to the London IA Ning group the other day) - she hosted a Show & Tell for Personas last year that was great.
Comment: That's excellent news - i'll help to promote them here if she sends me over the details.
Answer: Here are the programs and sources I'd recommend for ux mentoring:
1) Associations:

The IAI (mentioned by Matt Goddard above): I worked with a mentor for a short time via the IAI mentor program that Matt Goddard mentioned above. One thing to note about the IAI list is that, though there are quite a few mentors on the list, there may be few or none physically located near you (there was only one for my location at the time I looked) so you may end up having an online or phone mentor relationship rather than in person one if you go that route.
IxDA Toronto held a speed mentoring event in Toronto this year. Contact your local ixda group to see if they are/would consider doing the same

2) Networking: Getting involved in ux networking events and groups will allow you to meet other uxers. Through those, you may find someone more experienced who might be willing to mentor you or at least folks whom you could ask for recommendations. For example, here in Toronto, interested uxers have been able to connect with mentors/mentoring groups via the local UXIrregulars group.
3) Educational institutions: Schools, universities, etc that offer ux-related classes and programs may have formal mentor programs or be able to recommend someone.
Answer: I've been using the IAI mentoring program for the past 3 months. I'm very happy with it so far.  I expect that this entirely depends on your mentor, but fortunately mine is very responsive and extremely helpful.
The selection of mentors (at least in the UK) is superb, and I would highly recommend taking advantage of the program.
Comment: Is that programme just for IA though? Does it cover UX as well?
Comment: I guess that entirely depends on who you choose as a mentor. In my case, my mentor is a UX Designer, as are most of the mentors in the UK. This may vary in other areas.


Choosing an algorithm for classification

Question: What determines what classification algorithm you should use for a certain classification problem?
e.g. If there is >5 features or you only have 1000 training examples, or there is multiple class's or it's binary classification use; logistic regression, SVM, ANN etc.
Answer: This flow chart is limited, but boils things down well for people new to the field. Beyond that, the dominating factors tend to be

What's available in my libraries?
What am I comfortable with?
Which models have assumptions that match my data?

That last one is quite a deep question, and the ability to answer it effectively only comes with a lot of study. If you've got a good grounding in linear algebra and multivariable calculus, a general ML book like Machine Learning: A Probabilistic Perspective would be a good place to start.
Comment: Is there certain algorithms that are optimized for more or less features? Such as logistic regression for 4 features, but neural networks for >10 features etc.
Comment: Not so much 'optimized for' as 'suited for', but yes. *k*-means for example has problems with lots of features due to the curse of dimensionality. I can't think of any kind of model that's explicitly bad on small numbers of features, but there are lots that would likely be 'overkill'.
Comment: Thanks Andy for the reply. When it comes down to choosing does the amount of data you have or how many features come into play at all with regards to choosing an appropriate algorithm?
Comment: Both sample size and number of features are important, yes.
Answer: It is pretty reasonable to start with a simple linear model and then work from there. Analysis of results will reveal the shortcomings of your features and/or algorithm. A significant advantage that you can get started quickly which is rather important in many practical applications.
The second step would be to start to use domain knowledge. Good analysis should result in a set of features that even a liner classifier might work satisfactory enough.
Comment: What linear model would you recommend?
Comment: @frog1944 Just start with a plain logistic regression or with linear SVM. The learning algorithms for linear models are blazingly fast, something that is important when playing with large dataset.


Is fibre an essential nutrient?

Question: Inuits' diet consists almost entirely of meat. As per my understanding, meat does not provide us with fibre and fibre is obtained from plant products only. Do the Inuits suffer from any malnutrition or digestion issues because of a lack of fibre in their diet? Have their digestive systems adapted to their diet or does the climate they live in have a role to play? If so, what would happen if an Inuit person changes to a "mainstream" diet that includes cereals and vegetables? What if a "mainstream" person goes vice versa?
Comment: Inuit diet of mainly meat to is fiber an essential nutrient is a bit of a stretch.
Answer: Essential nutrient means any substance normally consumed as a constituent of food which is needed for growth and development and/or the maintenance of life and which cannot be synthesized in adequate amounts by the body (fao.org).
Dietary fiber does not meet the criteria of being needed for life/growth, so, strictly speaking, it is not an essential nutrient. Anyway, according to some authors "dietary fiber is essential for a healthy diet" (Mayo Clinic), for example, insoluble fiber may help maintain bowel regularity and soluble fiber may contribute to intestinal health and lower cholesterol levels. Fiber may also slow down digestion and thus help to control blood sugar levels (PubMed).
Inuits do not eat only meat but also plant foods, such as berries, tubers, roots, seaweed...(Wikipedia: Inuit Cuisine) and, according to the documentary The Last Ice Hunters, some commercial food delivered from Denmark.
Results of a 1930 experiment, in which 2 men were eating exclusively meat (no plant food and hence no fiber) for a year:

At the end of the year, the subjects were mentally alert, physically
  active, and showed no specific physical changes in any system of the
  body.
The control of the bowels was not disturbed...
...the clinical observations and laboratory studies gave no evidence
  that any ill effects had occurred...

From this very small experiment it is not possible to reliably predict long-term effects of lack of fiber in humans, though.
Conclusion: While not essential for life, fiber can be good for health, especially for bowel regularity.
Comment: Pretty good answer, and yes by strict definition.  But  It's hard to define what's essential when some sequelae of diet take decades to manifest.  If you look at the hormone spikes and pro-inflammatory cytokines associated with meat consumption, meat may not be so benign. and I'll definitely highlight the fiber = good for health.  That 1930's experiment was just a case study with an n=2, I wouldn't make dietary changes based on that.  If we're talking anecdotes, I have dozens of patients with severe constipation, like 99% of which have low fiber and fluid intake that improves by changing it.
Comment: I edited it a bit. I never want to emphasize the benefits of fiber beyond its role in maintaining bowel regularity and reducing blood glucose fluctuations after meals. The evidence about the effect of fiber on cholesterol levels and intestinal health is not convincing enough, so far. They don't do crazy studies like that 1930 one any more and all you have now are some epidemiologic studies: a lot of participants, but unconvincing.
Comment: Most people only get about 15 grams of fiber a day, the RDA is 40 grams a day, while indigenous populations typically get 80 to 100 grams a day. If your diet is mainly a whole food plant-based diet that can include a bit of meat and fish, your fiber intake is bound to be above 60 grams a day, simply because most whole energy rich foods have a fiber to calorie ratio between 2 to 3 grams per Kcal, and fruits and vegetables will typically have a much higher ratio. A 2500 Kcal diet that contains significantly less than 60 grams of fiber a day is almost by definition an extremely unhealthy diet.
Comment: @CountIblis, less than 60 grams being extremely unhealthy - was that a typo? Adequate intake for adult men is 38 g and for women 25 g ([NationalAcademics](http://nationalacademies.org/hmd/~/media/Files/Activity%20Files/Nutrition/DRI-Tables/5Summary%20TableTables%2014.pdf?la=en)). And Daily Value (in 2,000 Cal diet) is 25 g ([FDA](https://www.accessdata.fda.gov/scripts/InteractiveNutritionFactsLabel/dietary-fiber.html))
Comment: Well, how does someone eating 3000 Kcal get to less than 40 grams of fiber? Your diet needs to include a substantial fraction of non-whole foods. The health effects of not eating mostly whole foods have yet to be rigorously established. Now, if you give the normal Western diet the benefit of the doubt and demand rigorous evidence that it's unhealthier compared to an alternative, then you'll end up with the current recommendations of 38 grams of fiber a day. I'm not going to take that gamble as it's not just fiber but also magnesium and many other nutrients that you'll be getting a lot less of.

Is fibre an essential nutrient?


the cardinality of all finite subsets of real numbers

Question: I do realise this question has already been answered here, but I want a more direct answer in the form of defining an injection.
The first injection is trivial, from real numbers to the set of all finite subsets of real numbers, it assigns each real number a set that contains only that number.
But how to form the injection the other way around? I tried classifying the finite sets by their cardinality but can't find an injection to the set of real numbers.
Comment: This might help: https://math.stackexchange.com/a/611645/389703. And consider the injection from the set of finite substet of $\mathbb{R}$ to $\mathbb{R}^\mathbb{N}$ by mapping every subset to an ordered sequence containing its elements, with trailing zeros.
Answer: Map first to finite subsets of $(0,1)$ by mapping each member $x$ of the set to $(\tanh(x)+1)/2$.
Then map $\{t_1, \ldots, t_n\}$ to
$n + 0.t_{11}t_{21}\ldots t_{n1} t_{12} t_{22}\ldots t_{n2} \ldots$
 where $t_{ij}$ is the $j$'th decimal digit of $t_i$.
Comment: Assuming that $\{j\in \Bbb N: t_{ij}\ne 9\}$ is unbounded (infinite) for any $t_i$ so that $\{t_{ij}:j\in \Bbb N\}$ is uniquely defined................+1


ASUS UX330UA Fn key for Brightness

Question: I have a ASUS ux330ua and the problem is that the fn shortcut for the volume works but the other shortcuts don't. Can somebody help me with this?
Answer: Screen Brightness Keys
I have the same problem on a UX305FA, and here's what I did to address it. Rather than pulling my hair out over the issue,

I installed xbacklight, a command line program for changing screen brightness
<code>sudo apt install xbacklight
</code>
Then I set custom keyboard shortcuts that run xbacklight to increase/decrease the brightness. I couldn't get Fn+F5/F6 to work as a binding, so I use
+F5/F6 instead.

I don't remember the exact commands I used with xbacklight, but the man page should have enough to get you going.
As for the other keys, I didn't attempt to get any of them working, but you might be able to work out something similar with those as well.

ASUS UX330UA Fn key for Brightness


Can you pick up a Sixt rental car after the start time?

Question: I have a rental car from Sixt booked for a day (9am–9pm) in an upcoming holiday to Greece. However my plans have changed meaning I'll pick up the car at 1pm instead of 9am. Is it typical to have some flexibility in picking up the car after the reservation start time without any problems? I don't want to have the reservation cancelled because I didn't turn up right on the start time and neither do I really want to pay the fee to change the reservation. My only experience is with short term car hire (eg Zipcar) where you can pick up a car late without a problem. I've read the rental agreement and they seem strict ("the rent already paid will be fully retained if the booked vehicle is not collected/not collected at the agreed time."). But I'll be calling their office once they open, hence I'd like to hear your experience if you have any, between now and then.
Comment: Note: Sometime email work better then a call (language barrier: do not expect they will understand you well). And a warning depending when it is "upcoming holidays": I saw some problems about time zones, and change to summer time. The time you write in the request may not be the same as the time they receive from the system.
Comment: @GiacomoCatenazzi: Thanks, I did email in the end. International calls are also expensive. Good point with summer time, fortunately my holiday is before the clocks change so no complication here.
Answer: Unfortunately this varies greatly from one provider to the next, and even between individual rental offices of the same chain. Calling them is probably the best choice. Ideally, get a confirmation in writing.
Personal experiences with Sixt:

I have picked up cars several hours late at airports without problems.
I picked up a car maybe 90 minute late at a downtown location and got a stern talking to because I was late. They still gave me a car though.
I returned a car a day early and called ahead to let them know. Because of my call the waived the "early return fee" which they claimed I would have incurred otherwise (but wasn't mentioned in the contract).

I had totally different experience with other providers. Asking is good.
Officially they cancel after three hours if you don't call. What happens if you call remains to be seen.
From https://www.sixt.global/php/terms/view?liso=GR&rtar=000&view=EPP&tlang=en_GB&style=typo3

In case the renter fails to collect the vehicle on the rental start date and time without any written or telephone conversation, Sixt will cancel the reservation after 3 hours.
Comment: Airport sites tend to be more familiar with people being late, because flights are late quite often and nobody can guarantee being on time. So I'd expect them to have procedures for that (although it may depend on giving them your flight number so they can track it).
Comment: Anecdotically, a downtown rental in a city nearby to where I live would have a bad time if you are late in picking up the car. Parking space close to the office is so limited that they have to juggle cars all day from the main parking lot to the pickup location. Definitely give them a call and they'll sort it out.
Comment: @VladimirCravero: interesting, thanks for sharing. I'm picking up the vehicle from a downtown location and was wondering where they keep the vehicles because from Street View there didn't seem to be a car park nearby. Makes sense for them to bring it in from another location and have a collection time limit.
Answer: They will have a limit in their contract how long they wait, and afterwards they are free to give the car to someone else. When you show up after that, you are out of luck.
In practice, they might still give you a car (if they have one!), but I wouldn't rely on that. You should simply call them and tell them you will be late - you won't get any money back for the first hours, but your car will still be there.
Answer: I have asked this exact question to the Sixt representatives some years ago in a similar situation.
Their answer was that they will always keep your car reserved for one hour after your time. After that, unless you have paid in advance, they will try to keep it around, but if there is high demand and they run out of vehicles, they might give it to someone walking in.
Unless you notify them. If you let them know that you are coming later, or at an airport rental if they have your flight number and can see that the flight is delayed, they will also keep your car waiting for you.

tl;dr
Simply give them a heads up. It costs you one phone call and will avoid trouble.
Comment: "After that, unless you have paid in advance, they will try to keep it around", do you mean "**if** you have paid in advance, they will try to keep it around"? Not sure why they would keep it around if you haven't paid.
Comment: No, I mean if you haven't paid in advance, they'll try. If you paid in advance, they will definitely keep it (you paid already, they don't much care if you actually use it).
Comment: Ah ok, thanks. I was thinking if you hadn't paid in advance, they would not try to keep it around and rent it out to someone else.
Comment: @Wing well, by "try" I mean they'll not give it to the first person who comes in, but if they are running out of cars, then yours will go. They'll give other cars first, but they won't let someone willing to pay walk out when they don't know if you'll show up or not.
Answer: In the end, I emailed to let the office know that I'd be picking up the car later in the day. There were okay with it and didn't even apply the charge for amending the reservation.
I also reread the rental agreement and found the following which I missed in earlier readings:

The requested pick up time is binding (max grace period of 60 minutes within opening hours).

This means you'd need to check the specific rental location office's terms which may modify the countrywide terms linked in @Hilmar's answer.


How do I track known contact who clicked a link from EXM

Question: Created a Sitecore 9 form on which activates an EXM with a link redirecting to site's page. During form submission I am saving the contact. How do I track the same contact after clicking the link inside the email?
Answer: Each link in the email is rewritten to the url <code>/sitecore%20modules/Web/EXM/RedirectUrlPage.aspx</code> and the contact identifier is encrypted and added to the url in the ec_eq parameter. This means that as each user clicks the link, when the make it to the Sitecore site they are identified as the user the email was sent to. From that point forward, the user is known.
I think the answer to your question is that it is already done in EXM.
Answer: Depends on the version of Sitecore. In earlier versions of Sitecore 9 (9.0.X and 9.1), Sitecore Forms did not have a built-in way of associating the contact filling out the form and creating a known contact.  Many solutions needed to create a custom submit action in order to fully Identify the contact filing out the form prior to sending an Email Campaign through the Sitecore Forms Submit Action.
It wasn't until Sitecore 9.2 when Sitecore updated the Send Email Campaign submit action to include fields to identify the user as shown below:

Prior to Sitecore 9.2, if you needed to Identify the user, you had to create a custom submit action and do the Identification yourself. The snippet of code is below, but here is a larger example of creating a submit action for Sitecore Forms.
<code>    protected override bool Execute(UpdateContactData data, FormSubmitContext formSubmitContext)
    {
        Assert.ArgumentNotNull(data, nameof(data));
        Assert.ArgumentNotNull(formSubmitContext, nameof(formSubmitContext));

        var firstNameField = GetFieldById(data.FirstNameFieldId, formSubmitContext.Fields);
        var lastNameField = GetFieldById(data.LastNameFieldId, formSubmitContext.Fields);
        var emailField = GetFieldById(data.EmailFieldId, formSubmitContext.Fields);

        if (firstNameField == null && lastNameField == null && emailField == null)
            return false;

        using (var client = CreateClient())
        {
            try
            {
                var emailIdent = new IdentifiedContactReference("IdentifiedEmail", GetValue(emailField));

                //Identify with Email
                CurrentTracker.Session.IdentifyAs(emailIdent.Source, emailIdent.Identifier);

                var expandOptions = new ContactExpandOptions(
                    CollectionModel.FacetKeys.PersonalInformation,
                    CollectionModel.FacetKeys.EmailAddressList);
                var contact = client.Get(emailIdent, expandOptions);

                //Set Fields
                SetPersonalInformation(GetValue(firstNameField), GetValue(lastNameField), contact, client);
                SetEmail(GetValue(emailField), contact, client);

                client.Submit();

                return true;
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message, ex);
                return false;
            }
        }
    }
</code>


VS Code Code Navigation inside haml files

Question: I have been playing around with VS Code hoping to switch over from the pricier Jet Brains option. However "you get what you pay for" may hold true here.
I have a rails project that uses haml templates and I have some inline javascript in these haml files. Like so:
<code>- content_for :head do
  :javascript
    $(document).ready(function () {
      initializeCurrencyFormattingOnAllCurrencyElements();
      if (typeof table_manager === 'undefined') {
        table_manager = new DatatableManager();
      }
      var sales = new AsyncDatatable('sales', '#sales', 100, {}, false, true, 1);
      sales.handle_form_submit();
      table_manager.add(sales);
      table_manager.init_all();
      table_manager.draw_all();
    });
</code>
In the JetBrains IDE it was no problem ctrl/command hovering over these javascript definitions inside the haml file and I could use code navigation to go straight to the definition of things like "AsyncDatatable", "handle_form_submit()", etc. However I cannot get this to work in VS Code. I struggled for a while to get code navigation working for ruby as well (my installation came with a blank settings.json file for some reason) So I don't know whether I just don't have the right extensions, settings, or whether this just is asking too much from a free IDE.
Has anyone succeeded in doing this either with haml or erb? Any tips would be greatly appreciated even if the answer is that this isn't currently possible.
Answer: Personally i have been using VScode for a while and what i do is copy the phrase i want to find e.g. "AsyncDatatable" and then using search (shift+command+F for mac) that shows that phrase even if it appears multiple times inside your code.


How can I play the opponent team in a FIFA 13 career?

Question: In FIFA 12 you could select whether it is possible to select both sides in a match when setting up a new career. We used this with two players in front of one box to level a Pro. Since it's now possible to get the Pro even higher because the difficulty achievements have been removed, this seems to make a lot more sense. But the option seems to have gone. I cannot switch to play the opponent. How can I do that?
Answer: There is definitely an option to select "Allow AI Control" (or something to that effect) when you set up a new career. I started a new Manager Career the other day and the option was definitely there for me. I haven't confirmed yet if the same option is available in "Player Career". It would be logically if this wasn't available because if you are meant to be a particular player, then you cannot swap and play for the opposition team.
Another thing worth mentioning. In Fifa 13, you can no longer use your career pro in other game modes. They seem to have restricted him to the mode he is created in. So whatever improvements you unlock can no longer be taken into the on-line world, you have to create a separate player for that.
Comment: Thanks for your reply. This sounds like I have overseen it. I will check later today. I know about the online pro thingy. There just is no way to use him in quick offline matches. I loved to have the pro own my friends when we were playing at the same box in Fifa 12.


Comparing results of surveying two different groups (of the same size)

Question: I have surveyed two groups of people. They had option of answering one of three questions. Both groups picked one of the answers around 50 and 51 percent of time. How do I compare if this difference of 1 percent is significant? I would do margin of error and build confidence interval, but that's for the same group, right? I would like to conclude that one group is not different (in terms of picking certain anwer) from another statistically. Just forwarding me to a suitable method would be great.
Comment: How have you sampled the two groups? Stratified random sampling? Or are they subdomains of the same sample stratum?
Answer: Have you looked at this?
Basically you define a contingency table where you have you observed counts (O), where the entries are each group sample and their response.
Then the statistic is simple, you find the expected counts (E) under the hypothesis that there's an indipendent choice (simply multiply rows and cols totals), and calculate:
\begin{equation}
      \sum(O_i - E_i)^2/E_i = \chi^2
 \end{equation}
Then you are looking at the Chi-Squared distribution to find your threshold of rejection.
I think that the example I linked could be transalted to your case.
Look closely at "Example: Political Affiliation and Opinion and Tax Reform".


Example of key fishing with OllyDbg logging?

Question: I'm new to reverse engineering. Can you give an example of a crackme to do "non-hardcoded" key fishing and how to log the x86 registers to spot the generated key?
Comment: Nearly any crackme is what you'd call "non-hardcoded" one.
Answer: It doesn't work like that, unfortunately. I'm going to be drastically oversimplifying the topic, but the 10,000-foot view is that you have two ways to reverse engineer:
Static Analysis: Studying a binary without running it. Programs like IDA can be used to disassemble a binary to automagically lay bare what it can of the binary's workings. This does A LOT for you if you know what you're looking at. Otherwise, prepare to be 100% overwhelmed. There's an amazing introduction to IDA on YouTube that you can watch here.
Dynamic Analysis: Studying the behavior of a binary while it's executing. This is when you use debuggers like OllyDbg, x64dbg, WinDbg, Cheat Engine, etc.
There are really complex things you can do via other applications/plugins/libraries/frameworks, but you tend to discover those during threads of research. There's likely a plugin or something out there for Olly that will profusely log events/tracing, but the reason what you're interested in won't really work is the amount of data you'd be logging would be insane. You'd still have to search through it all to make sense of everything. Consider there are registers, memory, on-disk, and off-site (which gets you into network protocol land).
For what you're interested in, there's a really, really good video tutorial that uses OllyDbg and IDA to reverse a crackme (video here). For a different approach for the same crackme via dynamic analysis, (here is a video) where I use Cheat Engine, which is an unorthodox tool for the job but that I think a beginner such as yourself would learn a lot from (there's memory scanning, patching, writing custom Assembly and creating a script, etc.). Full disclosure: the tutorial using Cheat Engine is from me.
You have a lot of learning ahead of you, but try to enjoy the ride!
Comment: Thanks for your answer! Yes, I was talking about dynamic analysis. Do you think that a logging script like this: https://github.com/deresz/funcap , which is for IDA Pro, can track the x86 registers values for a non-hardcoded generated key? What I'm trying to understand is "unique key generation" vs "generation of lots of compatible keys". And if a unique generated key can be tracked among the x86 registers values.
Comment: The best answer I can give you is "maybe." Your hands are now dirty enough that you can dive in and see what you come up with. There's just a lot of nitty-gritty details on an individual binary basis where no generic answer can apply. If you're trying to reverse the algorithm used for a dynamically-generated key, then there's no telling what kind of algorithm you're dealing with. By all means, find an automated solution and churn your binary through it, but with what you're asking for, there's not a one-size-fits-all solution. Also, again, registers aren't the only thing to keep track of.
Comment: I'm a total newbie. I just want to find a crackme to see an example of x86-register-value logging when the key is unique and generated, not hardcoded.
Comment: Try inquiring on the Tuts4You forum. Someone there may be able to satisfy exactly what it is you're looking to achieve: https://forum.tuts4you.com/


X-ray mode problem

Question: For a ray sensor, I want it to detect object without a specified prop. I will put it as invert. If I use invert with x-ray mode, it will invert the x-ray mode. How can I use x-ray mode to detect an object without a prop?
Answer: You can do that by a logic operation and two ray sensors :
1- the first ray sensor detects objects with prop
2- the second ray sensor detects any objects
the objects you  want to detect are any object except the ones that have prop so use the expression :  Ray_2 and Not Ray_1
Comment: Thanks, never thought of this this way. I have another issue: I have the ray > python. You have an expression. For this scenario, I'm assuming I put the expression in the script. How would I do this? (**I have it where an object will track to the ray.hitObject, *the reason I need python***) My code is in this problem: http://blender.stackexchange.com/questions/32729/allow-ray-to-see-through-properties
Comment: Would this new issue be another question or would you like another answer to your current problem?
Comment: @blackhole you should have specified that either in the the question or its tags,BTW you already have the right code :   **if (ray.hitObject and not 'prop' in ray.hitObject):**
Comment: Well, I also thought that was the right code. The problem is, if an object is inside/behind an object with the prop, the ray will *not* track to it. Thus, I needed x-ray mode but I was using invert, so I had to think of something. I thought of this [question] in hopes of it solving it. Anyways, the code is good but I need x-ray. If I toggle it, it won't work as I have it as invert.
Comment: @blackhole X-Ray depends on the prop to decide if it should pass through or stop at this object , i think the easy way would be to add a prop2 to all other objects that don't have prop and set the ray-sensor to look for prop2 in X-Ray mode
Comment: I, at first, didn't want to do that as I would have to put a prop on every game object. After some time, I decided to. For some reason, it cannot detect enemies **that have to prop**. I looked all over it, and I have no idea why.

X-ray mode problem


Can a Shimano BL-M425 brake lever be used with a BR-M615 caliper?

Question: As the title says, can a Shimano BL-M425 brake lever be used with a BR-M615 caliper? I have an old BR-M447 caliper that I want to replace, and I was wondering if it would be possible to exchange it for a BR-M615 while still keeping the old levers.
Comment: Could you flesh-out your question more?  This got flagged as low-quality because of length or content.
Comment: In addition to whether the oil displacements are the same, this is also asking what the consequences are of using a mismatched hose, since BL-M425 uses BH59 and BR-M615 uses BH90. I think the brake hose mismatch probably makes this a no-go, but I can't say I know what would actually happen if you tried.
Answer: Because the hose attachments are the same, you can do it, but the performance of the brake is going to suffer for the following two reasons:

As pointed out by Nathan, the hose inner diameter is different for the recommended hose for each component
The desing of the levers of both types of brakes are a bit different as well, the newer master pistons at the levers push a bit more oil.

So you can assemble the brake and it will work, but the feeling at the levers is going to be a bit weird, and you migth not get the full stopping power out of them.
Finally, you migth also want to update the rotor, the newer ones are designed for the narrow type rotor, you can check the "Disc brake caliper and Rotor compatibility" on the following link:
Shimano docs


Why do we assume that a photon has encountered only a single collision with an electron in Compton scattering

Question: For explaining the experimental results of Compton scattering theoretically we consider a collision between a photon and a free electron and then calculate the new wavelength of photon after collision which is dependent on the angle of deviation. Why do we assume here that the photon reaching the detector has encountered only one collision with an electron, it could have reached the detector after multiple collisions with different electrons which would give different $\Delta\lambda$ for same angle. Is it because a photon colliding with multiple electrons no its path is very unlikely? Also what is the reason for non zero intensity at $\lambda$ other than the two peak ones?
Comment: It's not an assumption, it's an approximation (small-coupling expansion). Are you asking why it's a good approximation?
Comment: @ChiralAnomaly can you recommend some resource regarding that small-coupling expansion and also why it is a good approximation?
Comment: I don't have any references handy that treat collisions with multiple electrons, and now that I'm revisiting your question, I think my original comment about the small-coupling approximation may have missed the point of your question. The small-coupling expansion I referred to is an approximation we use in the case of a *single* electron. Going beyond that approximation for a *single* electron still doesn't (by itself) describe what happens with *multiple* electrons.
Answer: This is basically called the "thin target approximation". The experimental detection rate depends on the product of the photon flux, the target areal density, and the cross section. The achieve a suitable rate, it's better to have more photon flux than more target atoms. Indeed, if the target is too thick, there will be multiple scattering events, and the analysis will be more difficult.
Comment: "Is it because a photon colliding with multiple electrons [on] its path is very unlikely?" = thin target approximation.
Comment: OP is asking about the Compton scattering, no thick target participates in such scattering. Are you sure you didn't misinterpret the question?
Comment: Maybe I'm misunderstanding something, but isn't the target a simple electron? Isn't the right answer "this is just a leading order diagram, other diagrams contain more interaction vertices"?
Answer: Quoting one sentence from the wikipedia page,

The interaction between an electron and a photon results in the
electron being given part of the energy (making it recoil), and a
photon of the remaining energy being emitted in a different direction
from the original, so that the overall momentum of the system is also
conserved. If the scattered photon still has enough energy, the
process may be repeated.

I suspect your confusion here is that the wavelengths received after multiple collisions are well outside the range of wavelengths received after a single scattering event.  Keep in mind that, because Compton scattering is defined as acting on bound (or loosely bound) electrons, the event is inelastic. Some of the source photon's energy goes to breaking the electron bond; the remainder can be derived from momentum conservation rules.


Could a sleeping bag be warmer if you are naked inside?

Question: I have heard conflicting theories about the best way to keep warm in a sleeping bag in the winter.  Some people say you should bundle up in your sleeping bag and another theory says that you should be naked, because the warmth of your body will create a microenvironment of very warm air right next to your skin, since the sleeping bag and pad reflect heat very efficiently, and there is no way you will get that warm if clothes block contact with the air.  Does this "naked" theory make any sense according to Physics?
Answer: short answer: No, the more insulation between a hot body and a cold body the slower the movement of heat from hot to cold.
long answer: If the clothes themselves are cold then bringing them into the sleeping bag requires them to be heated as well as the air/skin (which is what produces the warm feeling), so short term, go naked, long term keep dressed.
Comment: I don't think its necessarily this simple. E.g., tight socks could restrict blod which means colder feet, tight clothes could perhaps increase the convection of heat from your skin and clothing takes up space otherwise occupied by air, which could in some degree negate the isolating effect of the sleeping bag.
Comment: well yeah there is a longer answer, but I've tried to keep the complexity of the answer similar to the complexity of the question.
Comment: A wet layer on your skin provides a good heat flow to the microenvironment inside the bag. Sweating (e.g. in cotton cloths) and the change of aggregate state chills your body: The microenvironment has a air exchange to the outer environment: It's not a simple plastic bag with air insulation!
Answer: Let's start by assuming the sleeping bag is perfectly reflective and impermeable to heat, and that your body remains at a constant temperature (which it generally will unless you're very ill or in danger of dying from being too hot or too cold).  In this situation, thermodynamics tells us that everything inside the sleeping bag will eventually come into thermal equilibrium with your body, reaching the same temperature as it. When this happens you will feel nice and warm (if not too hot) and will not be losing any heat to the outside world.
However, the time taken for this to happen is very dependent on what's inside the sleeping bag with you.  If your clothes start out cold and have a high heat capacity then they will have to absorb a lot of heat from your body before they reach its temperature, which will take time. So if your sleeping bag is a perfect insulator then you should definitely be naked, because that way you'll feel the benefit of the sleeping bag more quickly.
However, even a very good sleeping bag isn't a perfect reflector of heat and will let a little bit of it through, especially if it's very cold outside. In this case the temperature will still reach a steady state, but it won't be a thermal equilibrium.  Instead the system will reach a state where your body is constantly emitting heat, at a rate that's balanced by the rate at which your sleeping bag leaks heat to the outside world.  The slower the leaking of heat, the higher the temperature next to your body will be.  Your clothes are insulators and slow down the leakage of heat, so in this case keeping them on is a good idea, even though it will take a while for you to feel the benefit.
So I guess the tl;dr version is, you should be naked if your sleeping bag is very good and/or it's not too cold outside, and/or you won't be there for very long.
Answer: The relevant issue is that the clothes you wear (unlike the down or synthetic fibers of the bag) hold moisture next to your body. Changing both the thermal conductivity of the medium surrounding your skin allows energy transport to the environment. The evaporative heat loss dynamics of the body-bag system is described by another thermal conductivity.
I propose the effects of creating a moist fabric layer allows a more efficient heat flow from the body than an air insulator. Water transport through your fabric should be best in your sleeping bag, naked a should feel colder and you will freeze in wet cotton cloths.
Comment: As physicists we also assumed that we were alone in the sleeping bag. And neglected any perturbation to the work then done if we were naked and not alone.
Comment: @MartinBeckett There are sleeping bags for two people?
Comment: @JoeZ. there are special sleeping bags for 1 person which are designed to be able to be zipped together with another similar bag, turning it into a "double" sleeping bag
Comment: -1. Not clear. Is is better to be naked, or to keep your moist clothes on?
Answer: Physics occasionally misses human experience. When we get cold, our hands and feet become frigid while our torso and heads1 stay relatively warm. Our bodies' tendency to reduce blood flow to the extremities is an evolutionary adaptation to the fact that high surface area to volume things (such as hands and feet) radiate heat faster, and we can survive without fingers, but not without brains and hearts. Unfortunately, this trend also self perpetuates; we must feel warm for our bodies to allow blood flow to return to the extremities, and our hands and feet occupy a proportionally large portion of our sensory cortex2.
If we are naked in the sleeping bag, there are no layers of insulation keeping heat from our hands and feet. Further, if we put socks on in the sleeping bag, we may be insulating our feet from the warm air inside the bag. If you are truly cold, get your hands and feet touching the warm parts of your body.
If you are warm when you get into your bag, dress however you want - be comfortable, and if your bag is rated for the temperatures, get those hopefully not too wet clothes into your bag to warm and dry.
If your bag is not rated for the cold temperatures, a layer of clothing may insulate your torso from the cold enough to survive the night, but your feet and hands will be frigid. They will also have a difficult time figuring out what is wet - problematic for all the reasons mentioned in the other answers. I'd strongly consider putting your clothes under your torso to supplement your sleeping pad - if your body touches the ground through the pad, you lose way more heat to the ground through conduction than the air through blackbody radiation. If your clothes are wet, under the pad is a better option, though you will be pretty upset in the morning when you try to put them back on.
The last things to remember are more personal. If your sleeping bag is tight around any part of your body, you will get less insulation there. More clothes could exacerbate that unless you're wearing a girdle. Smaller people in bags that are too large should definitely put their dry clothes below their feet to fill up some of that space. The shape of a sleeping bag is very important, and if your toes aren't near the end, they will get cold.
Having done it both ways, I'd rather bring just enough clothing and too much sleeping bag on any trip ever. Being cold during the day is part of the game, but a lack of sleep because of cold will ruin you.
1 Heads radiate quite a bit, but they also get us out of trouble, so our bodies don't shut down circulation to them.
2 See sensory humunculus, possibly nsfw, and yes, google, humunculus is spelled right


Collector current saturation on BJT

Question: I took a look at a few answer such as this and this, where they say the collector saturation current is entirely dependent on an external source. What happens if the source is 1kV or 10kV? doesn't the transistor has its own collector current saturation? For reference, I want to design a NOT gate and need to choose the values for R and R2 (see here).
Comment: The main idea about BJT saturation (not FET) is that the base-collector junction becomes increasingly forward-biased, the collector increasingly "looks like" a voltage source instead of a current source, and the ratio between collector current and base current (\$\beta\$) declines rapidly as the base-collector junction draws substantial current. To design a NOT gate like that, you need to know how many other gate inputs you want to hook up to your NOT gate output. 1? 10? 100? It matters. Try reading [this](https://electronics.stackexchange.com/a/281320/38098) about RTL design.
Comment: You need to know the output impedance of the source (plus any load impedance between it and the transistor's collector ; R2 in your linked schematic).
Comment: is this along the lines of what you are asking? https://i.postimg.cc/ZKSBxWdG/Collector-current-in-saturation.jpg
Comment: @SredniVashtar yes
Answer: The definition of saturation is that the base emitter and base collector junctions both are forward biased. This means that for an NPN BJT, Vbc will be positive. So the real answer is that as soon as you apply 1kV or something to the collector, the transistor will not be in saturation any more.
Answer: You can connect voltage sources of 1kV or 10kV but you have to limit the current flowing in the base of the BJT by a resistor R.
R is not an ordinary resistor because it has to work at 1kV or 10 kV.
Alternatively, you can use 10 ordinary resistors in series.

To answer your question:
It's not strictly correct saying that a BJT has its own saturation current. There are actually many saturation currents.
Every BJT has a family of Vce and Ic curves, as a function of Ib, within which we define saturation regions.
Given a reference circuit with fixed Rb and Rc, Vce and Ic are functions of Ib.
Let's increase Ib. We assume that the BJT has saturated when Vce goes below a certain value, typically 50 mV.
If you increase Ib, the BJT will go into deep saturation and Vce will reach its limit. It will never go to zero Volt though.

I got my own rule to put small signal transistors into saturation: set Ib to 1 mA or more.
If Ib goes below 1 mA small signal transistors may work in the active region.
BC847, 2N4904 are widely used small signal transistors and if they all go into saturation with Ib = 1 mA.
BJT power transistors go into saturation with currents bigger than 1 mA. You should read the datasheet.
Example
VCC = +3 V
Ib = 1 mA
LKV:
3 - Rb*Ib - 0.7 = 0
Ib = 2.3 V / 1 mA = 2.3 k
Since I assume that the BJT has saturated, I know write the second LKV:
3 - RC*Ic - VceSat = 0
Assume VceSat = 0
I got now 2 degrees of freedom: Rc and Ic.
Open the datasheet. Find the VceSat curve as a function of Ic.
Figure 6, Page 8
https://assets.nexperia.com/documents/data-sheet/BC847_SER.pdf
Ic = 1 mA is fine in that figure.
Rc = 3 V / 1 mA = 3 k Ohm
Comment: I don't think this really answers the question.
Answer:
... they say the collector saturation current is entirely dependent on an external source.

Not only... If the transistor is saturated, its output collector-emitter part can be thought as a short connection - a closed switch or just a piece of wire with zero resistance and zero voltage across it.
Then the output circuit consists only of a voltage source (Vcc) supplying a resistor (Rc)... and it obeys the well-known (since the 19th century) Ohm's law.
So the (saturation) current Is depends both on Vcc and Rc:
Is = Vcc/Rc

doesn't the transistor has its own collector current saturation?

No, the (saturated) transistor does not have "its own collector current"... The current in the output circuit does not depend on the transistor if it stays saturated.
This is an extremely simple electrical concept since the 19th century that answers the general question, "Does the current in an electrical circuit depend on the closed switch with which we have switched on the power supply?"
Of course, the current will not depend on the closed switch... if it really is a switch with zero resistance and zero voltage across it. The current will depend only on the supply voltage and load resistance.
But if for some reason (for example, significant current, overheating, damage, etc.), the contact resistance and, accordingly, the voltage drop across the switch begins to increase, the current will begin to depend on it as well…
Similarly, the collector current Is of the saturated transistor does not depend on the transistor if the base current is sufficient (> Is/beta) to provide this collector current.

What happens if the source is 1kV or 10kV?

Nothing bad will happen at such a high voltage if Rc is high enough (for example, if Rc = 100 k, only 10 mA current will flow) ... and, of course, if the transistor stays saturated. Otherwise, it will be damaged by too much power dissipation (when it is semiconductive) or by too high voltage (when it is off). But we need both on and off states...
Comment: Just for clarification (and to avoid misunderstandings): It is the VALUE of the collector current in saturation mode which depends on Vcc and Rc. Another question is under which conditions the BJT would be in this saturation mode. This depends. of course, on the base-collector pn junction which must be forward biased (like the base-emitter junction).  As a good indication for this mode: A base current which is much larger than in "normal" quasi-linear amplification mode (at least 10% of the collector current).
Comment: A saturated transistor does not have "zero voltage across it". You need to be more careful with the language here.
Comment: @Elliot Alderson, You forgot to mention that the supply conductors do not have zero resistance and zero voltage drop across them...
Comment: The important consideration is that I **did not** say "the supply conductors and connectors will have no resistance".

Collector current saturation on BJT


Can your cell phone transmissions reveal your identity?

Question: Is it feasible for hackers sitting near you to have some sort of RF listening device that uses your phone's transmissions to identify your name or other information that could be used to determine who you are? Would this be through the network, wifi, and/or bluetooth? If so, are there any protective measures that people can take that don't involve simply turning off transmissions?
Comment: Probably yes, and "it depends". For example, if your "hacker" is has access to government resources to request records for your carrier, they would just use your phone's unique ID to find out who it is registered to.
Answer: AS Hugo stated, yes the phone can act as a tracker via it's IMEI & SIM card IMSI numbers. These are sufficient for a telco to identify the phone owner, but a third party can still identify the unique phone without necessarily knowing the registered owner. Even without actively using the phone, it pings towers to let the network know where you are in order to handle call routing for you.
Additionally with many modern smart phones, turning it off doesn't really turn it off, you need to physically remove the battery to make sure it's actually off. This can be problematic with many phones (Apple).
Putting the phone into "airplane mode" will stop it from talking to cellular towers. Unfortunately many smart apps collect WiFi SSIDs that they've seen and will report that information later after you come back online, providing an historic trail of electronic bread crumbs.
Faraday bags and such will only make your phone spike its power levels to punch through, rapidly killing the battery in the process.
Comment: I was under the impression that airplane mode usually shuts off all transmitters, including the WiFi chip. Wouldn't that imply that these "smart apps" would not be able to passively collect SSIDs since they would only be presented with a dead WiFi interface? For Android at least, I thought airplane mode actually deletes (brings down) the virtual network interface.
Comment: Forest, you can test this yourself in about 30 seconds. While connected to WiFi, place your phone in Airplane Mode. Now check your WiFi connection, it should still be connected.
Comment: Oh that's creepy. Well, thanks for telling me! I'll look into it more.
Answer: Your phone could be used as a tracking device. If you have bluetooth or wifi on, "someone" could track you around using the unique numbers those interfaces provide.
Even now, with some fake cellular towers they can track your unique number signaling from the phone.
From that to reveal your true identity is a little more complicated. They should intercept your communications to extract valuable information, like email,  not only the unique numbers to track you.
So, you should turn off your phone to not been tracked.
Comment: email? Should have SSL.
Comment: @JBis, I'm not referring to the content of emails, but sure, **all** communications should be encrypted. Apple products beacon the name of the product and the owner trough DNS, in Spanish is something like _iphone-de-Hugo_


Volatility Swap Variance swap

Question: Why do two different products trades as vol swap and var swap. Are these products not inter-convertible?  I know Var swap has convexity and vol swap does not have but i don not understand how it helps in risk management. Can we calculate Vol of Vol if we know about vol swap and var swap? Is there any product like vol-var swap, i have seen this term being used?
Answer: At the begining, there were only variance swaps who were traded for vega hedge purpose or to speculate directly on the volatility. They were famous products thanks to the formula that links the variance to european call and put prices.
As for volatility swaps, they appeared because of the convexity of variance swaps but they are more complex to price. A common method is to price them using Heston model and Fourrier transform in order to get the expected value of volatility as function of heston parameters.
The vol of vol means the the volatility of a vol index like VIX which is a measure of expected implied volatility for S&P 500 options.
Now, there are many volatilty products that appeared like variance options, volatility options and so on.
Comment: You said the volatility swap appeared because of the convexity (with volatility, right?) of variance swap. Could you elaborate more, for example, what is the problem if the market has only products which are convexe with volatility?

Volatility Swap Variance swap


Crewing from Vancouver to Mexico

Question: Can a crew member ineligible to enter the US enter US waters and stay onboard during transit?
Comment: No, as entering US territorial waters requires you to be admissible to the United States.
Comment: @BurhanKhalid If you have a reference for that it would be an answer.
Comment: The boats are coast guard, but the agents are ICE + Coast Guard. The Coast Guard doesn't enforce immigration laws.
Comment: Combined with your other post, can you not simply fly from Vancouver to Mexico and avoid US territory all together?
Comment: thanks all. Over $100 extra not going through US, and if B. Khalid is correct I won't be sailing unless Halifax direct to Bermuda then south.
Comment: Reference is that when you disembark, you are either checked by ICE or are required to report to the port master (where you are checked for cutoms/duties and immigration) - this is especially true on ports frequented by international vessels. ICE officers often board vessels that are anchored off coast to check for weapons, etc. So trying to avoid this by anchoring off shore wouldn't help.
Comment: @BurhanKhalid I think it's the coast guard that boards vessels in territorial waters, not ICE.
Answer: Whatever it is you're crewing is probably governed by the Pleasure Boat Reporting Requirements, and if not language similar to this would be found in whatever governs it no doubt:

operators of small pleasure vessels, arriving in the United States from a foreign port or place to include any vessel which has visited a hovering vessel or received merchandise outside the territorial sea, are required to report their arrival to CBP immediately ... an application to lawfully enter the United States must be made in person to a CBP officer at a U.S. port-of-entry when the port is open for inspection.

So, no. Entering territorial waters is entering the country far as CBP is concerned.
Comment: Because that's the meaning of "territorial", that those waters are subject to the country's laws, please refer to the Law of the Sea which is what defines the concept. As you see in the quote, "required to report their arrival to CBP immediately" is the law of the US, there is no granted right of passage. If you need more detail, read UNCLOS the  United Nations Convention on the Law of the Sea.
Comment: "Entering territorial waters is entering the country far as CBP is concerned." Source?
Comment: Read the link. There's no provision for avoiding the need to lawfully enter, the various waiver programmes are for only people prequalified.
Comment: It says "arriving in the United States". I don't see anything that defines it as including transiting US territorial waters.

Crewing from Vancouver to Mexico


Is there a way to put a 2010 Prius into neutral with the P-Lock engaged

Question: Is there a way to put a 2010 Toyota Prius into neutral with the p lock engaged?
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Comment: Is this relevant to your question? https://mechanics.stackexchange.com/questions/793/is-there-a-way-to-put-prius-with-dead-battery-into-neutral?rq=1
Answer: First you should consider how a Prius works.
There is no clutch. No torque converter.
Instead, there is a planetary gearset. The wheels and motor-generator 2 (MG2) are directly connected to one shaft. Another shaft goes to the internal combustion engine. A third shaft goes to motor-generator 1 (MG1).
Activating neutral in Prius means that all electric current to motor-generators is stopped. They are left to rotate at whatever speed they want. If the engine was running when activating neutral, it can stay running. But if the engine wasn't running in the first place, the Prius is unable to start the engine in neutral since you need the motor-generators to do that, and the definition of neutral in Prius is "no current to electric motors".
The parking position, on the other hand, stops the rotation of wheels and MG2 with a parking mechanism, and allows whatever current the car computer wants to use at MG1. So it's possible that the internal combustion engine is rotating MG1 which is used to charge the high-voltage NiMH battery. It's also possible the high-voltage battery supplies energy to MG1, which is used to start the internal combustion engine running.
As far as I know (I don't have a 2010 Prius but 2016 RAV4 hybrid), there is no position that would both have neutral and parking mechanism active. However, you can come close by using the parking brake and switching to neutral. If you do so, the car won't move, and the engine can't be started and the HV battery can't be charged.
It's beyond my understanding why you would want to do that. If you leave the car unattended, it may turn off, since there's no way for the engine to be started once the NiMH battery runs out of energy. And if the engine was running in the first place, there's no way to charge the battery.
Use the car in a way it's intended to be used. If you park, leave it in "park", which means the car is able to start the engine if the NiMH battery runs out of energy, and able to charge the NiMH battery. All the extra the emulated "neutral" gear would do is to prevent the engine from being started and prevent the battery from being charged.
And if you don't want the engine to be started automatically, just turn off the power. Then a relay switches off all current of the HV battery, meaning it will hold its charge for months.


MS Project - How to use global calendar to each human resource?

Question: On MS Project, how can I set a calendar with local holiday/day off for a specifics resources located in different countries, for example, Australia and Ireland?
Answer: Each resource has his/her own calendar that is, in turn, based upon a base calendar. Create a new calendar (Project > Change Working Time, New) for each different company.  Enter the holidays.  Then when you create the resources, select the correct calendar from the Base Calendar drop down in the Resource Sheet view.  By creating a calendar for the different national or regional holidays, you can then apply that calendar to any number of resources.
Comment: So, basically it is possible to create as many calendars as needed for each country (with its holidays) and associate one of them with the resource on Resource Sheet. Is that it?


How extract TileMatrixSet from GeoServer in order to pass it to create WMTSTileService?

Question: I am trying to mock GetMap requests and had an issue on how to create valid BBox values for the requests so they would HIT the cached layer. I got an answer from Ian Turton How properly calculate BBox for mocked GetMap request? on how to calculate valid BBox but I. However I need to automate this process and parsing WMTS capabilities document is not what I would like to do. Ian's suggested usage of WMTS instead of WMS has a drawback - I need to know rows and columns for each zoom level I want to hit and I want to hit specific area only. I see no easy way to automate correct zoom level/column/row combination selection.
  What I think is the best way to generate correct BBox parameters for GetMap requests is to call org.geotools.data.wmts.client.WMTSTileFactory.findTileAtCoordinate(...) with the random coordinates I can easily generate. Later I would get ReferencedEnvelope from the Tile and would ask for the lower and upper corner coords and that would be it but... findTileAtCoordinate(...) needs parameter of type org.geotools.tile.TileService and in order to create WMTSTileService object I need to pass a bunch of parameters among which is org.geotools.data.wmts.model.TileMatrixSet. Now I don't want to manually parse WMTS capabilities document to create TileMatrixSet object. I would expect there should be a way to create service which needs only GeoServer address and a layer name so it could fetch all the data about layer (BoundingBox, EPSGCode, TileMatrixSet and so on) so I could pass them to WMTSTileFactory.findTileAtCoordinate(...). Is there a such service? Maybe I am doing wrong approach?
Answer: IIRC (and I was supposed to document this last year) you need to create a WMSTSTileService which takes the base URL of the server. You can then either issue a getTiles request or grab the TileMatrixSet from it using getTileMatrixSet().
    String serverURL="http://localhost:8080/geoserver/gwc/service/wmts?"
    WebMapTileServer wmts = new WebMapTileServer(serverURL);
    WMTSCapabilities capabilities = wmts.getCapabilities();
    WMTSLayer layer = (WMTSLayer) capabilities.getLayer("topp:states");

    request.setLayer(layer);

    request.setRequestedWidth(800);
    request.setRequestedHeight(400);

    String format = "image/png";
    List<String> formats = layer.getFormats();

    if (!formats.contains("image/png")) {
        format = (String) formats.get(0);
    }
    request.setFormat(format);

    ReferencedEnvelope re = new ReferencedEnvelope(-180, 180, -90, 90, CRS.decode("EPSG:4326"));
    request.setRequestedBBox(re);

    // System.out.println(request.getFinalURL());
    Set<Tile> responses = (Set<Tile>) wmts.issueRequest(request);

    for (Tile response : responses) {
        // System.out.println("Content Type: " + response.getContentType());
        // System.out.println(response.getTileIdentifier());
        BufferedImage image = response.getBufferedImage();
        //do what ever you want with the image.
    }

Comment: Is it possible to get capabilities of a single layer (without removing "Advertised" flag for unwanted layers)? I am asking this because when current capabilities document is being parsed I get `Parsing failed for MinTileRow: java.lang.IllegalArgumentException: Value '-3' must be non-negative (0 or above).` I have checked - a number of layers have negative values for `MinTileRow` in the current capabilities document.
Comment: that sounds like a bug on the server, negative tile numbers seem to make no sense. But, no there is no way to get layer info without parsing the whole capabilities document.
Comment: Uh, one problem after another.....


Advanced Custom Fields Image Crop

Question: When a user uploads an image using the ACF Image field, and a maximum height and width is set, is there a way in which an image menu could appear (like the one WordPress already has in the media library)? So that the user can crop the image?
Answer: There's a plugin with an additional field typ with which you can force the user to crop the image to a specific size: https://github.com/andersthorborg/ACF-Image-Crop
It's not clear if it's still under active development so you'd have to test it with newer ACF versions.
There's also one with aspect ratios instead of sizes if you need that: https://wordpress.org/plugins/acf-image-aspect-ratio-crop/

Advanced Custom Fields Image Crop


'Update' like behavior for Google Datastore

Question: Is there a way to make query for Google Datastore that behaves the same way as SQL 'Update' query with conditions. Or should I perform this task in two parts - retrieve stored entities that match specified conditions, change appropriated property and make batch request to save changed entities?
Answer: You cannot make such a query in Google App Engine. You need first to get the entities you want to update and then modify them and store them back to datastore.


Arrayify error, when passing a string as an argument to a transaction

Question: I have been having this problem with the web3 library for a while now and I am not sure how to solve.
I am encoding a transaction within a react app. So far, all contract interactions inside the app with the same contract are going smoothly, this problem seems to have arisen when I am using a string as a method argument.
Here is the method I am calling in my contract:
function sendShardToShardOwner(address _shardOwner, string memory _shardURI) public onlyOwner
    {
        require(shardHolders[_shardOwner], "Not a valid Trustee");
        nftContract.distributeShard(_shardOwner, _shardURI);
    }

The contract takes two parameters as arguments, an address and an IPFS URL as a string.
When calling the below method to encode the ABI, I receive the offending arrayify error.
const recoveryContract = new this.web3.eth.Contract(RecoveryContract.abi, this.recoveryContractAddress);
const data = recoveryContract.methods.sendShardToShardOwner(address, "QmbSo373odJ8HosMNYgsFGw5bfkKrG5GhkZwJX9KYNL4zu").encodeABI()

Log:
Error: invalid arrayify value (argument="value", value="516d62536f3337336f644a38486f734d4e5967734647773562666b4b72473547686b5a774a58394b594e4c347a75", code=INVALID_ARGUMENT, version=bytes/5.0.11)
    at Logger.makeError (index.ts:205)
    at Logger.throwError (index.ts:217)
    at Logger.throwArgumentError (index.ts:221)
    at arrayify (index.ts:136)
    at toUtf8Bytes (utf8.ts:242)
    at StringCoder.encode (string.ts:15)
    at array.ts:62
    at Array.forEach (<anonymous>)
    at pack (array.ts:54)
    at TupleCoder.encode (tuple.ts:23)
    at AbiCoder.encode (abi-coder.ts:106)
    at ABICoder.push../node_modules/web3-eth/node_modules/web3-eth-abi/lib/index.js.ABICoder.encodeParameters (index.js:121)
    at index.js:439
    at Array.map (<anonymous>)
    at Object._encodeMethodABI (index.js:438)
    at RecoveryContractManager.recoverPublicKeyFromUser (RecoveryContractManager.js:387)

Upon investigation, the value "516d6...a75" is the hex representation of the string I have passed as a parameter. From looking at the call stack, the error is being thrown within a web3 dependency "@ethersproject/bytes". I tried to reproduce the error in an isolated environment by encoding the transaction with identical parameters and I have had no luck reproducing it.
I am posting to see if anyone has had a similar error and if anybody has been able to fix it. So far I've tried the classics: isolating the error, downgrading my web3 a few times, redeploying my contracts, reinstalling node modules, all with no luck.
Comment: I have the same error too, but mine's in Waffle from unit testing: `Error: invalid arrayify value (argument="value", value="abcdefg", code=INVALID_ARGUMENT, version=bytes/5.1.0)`.
Answer: Convert string to byte32:
   function web3StringToBytes32(text) {
        var result = ethers.utils.hexlify(ethers.utils.toUtf8Bytes(text));
        while (result.length < 66) { result += '0'; }
        if (result.length !== 66) { throw new Error("invalid web3 implicit bytes32"); }
        return result;
    }