Hoeffding's Inequality

Question: I am studying the feasibility of learning  from the book Learning from Data. The author uses a bin analogy to discuss the feasibility of learning in a probabilistic sense. I have certain questions to ask.

First, I will try to summarize what the author is trying to do:
Consider a bin containing red and green marbles, possibly infinitely many. The proportion of the red and green marbles is such that if we pick a marble at random, the probability that it will be red is $\mu$. We assume that $\mu$ is unknown to us. We pick a random sample of $N$ independent marbles (with replacement). Let $X_i$ be the indicator for the $i$th marble in the sample to be red. That is, $X_i=1$ if $i$th marble in the sample is red, $X_i=0$ otherwise. Define $\nu:=\frac{1}{n}\sum_{i=1}^N X_i$. By Hoeffding's inequality, $$\mathbb{P}(|\nu-\mu|>\varepsilon)\le 2\mathrm{e}^{-2\varepsilon ^2N}$$
In a learning problem, there is an unknown target function $f:\mathcal{X}\to\mathcal{Y}$ to be learned. The learning algorithm picks a hypothesis $g:\mathcal{X}\to\mathcal{Y}$ from a hypothesis set $\mathcal{H}$. We can connect the bin problem to the learning problem as follows.
Take a single hypotheis $h\in\mathcal{H}$ and compare it to $f$  on each point $\mathbf{x}\in\mathcal{X}$. If $h(\mathbf{x})=f(\mathbf{x})$, color the point $\mathbf{x}$ green, else color it red. The color each point gets is unknown to us, since $f$ is unknown. However, if we pick $\mathbf{x}$ at random according to some probability distribution $P$ over $\mathcal{X}$, we know that $\mathbf{x}$ wil be red with some probability $\mu$. Regardless of the value of $\mu$, the space $\mathcal{X}$ bow behaves like a bin. The training examples play the role of a sample from a bin. If the inputs $\mathbf{x_1},\ldots,\mathbf{x_N}$ in the data set $\mathcal{D}$ are picked independently according to $P$, we will get a random sample of red and green points. Each point will be red with probability $\mu$. The color of points $\mathbf{x_1},\ldots,\mathbf{x_N}$ will be known to us since we know $f$ on the data set $\mathcal{D}$. We define $E_{in}(h)$ to be the fraction of $\mathcal{D}$ where $f$ and $h$ disagree, also called in-sample error, and similarly out-of-sample error $E_{out}$. Thus $$E_{in}(h)=\dfrac{1}{N}\sum_{i=1}^N[[h(\mathbf{x_i})\neq f(\mathbf{x_i})]], E_{out}=\mathbb{P}(h(\mathbf{x})\neq f(\mathbf{x})) $$
Using the Hoeffding's inequality, we have $$\mathbb{P}(|E_{in}(h)-E_{out}(h)|>\varepsilon)\le 2\mathrm{e}^{-2\varepsilon^2 N}\qquad\qquad(1)$$
Let us consider a finite hypothesis set $\mathcal{H}=\{h_1,\ldots,h_M\}$ instead of just one hypothesis $h$. We can construct a bin equivalent in this case by having $M$ bins. Each bin still represents the input space $\mathcal{X}$ with the red marbles in the $i$th bin corresponding to the points $\mathbf{x}\in\mathcal{X}$ where $h_i(\mathbf{x})\neq f(\mathbf{x})$. The probability of red marbles in the $i$th bin is $E_{out}(h_i)$ and the fraction of red marbles in the $i$th sample is $E_{in}(h_i)$ for $i=1,2,\ldots,M$. Hoeffding's inequality applies to each bin separately.
The Hoeffding's inequality $(1)$ assumes that the hypothesis $h$ is fixed before you generate the data set, and the probability is with respect to random data sets $\mathcal{D}$. The learning algorithm picks a final hypothesis $g$ based on $\mathcal{D}$. That is, after generating the data set. Thus we cannot plug in $g$ for $h$ in the Hoeffding's inequality. A way to get around this is to try to bound $\mathbb{P}(|E_{in}(h)-E_{out}(h)|>\varepsilon)$ in a way that does not depend on which $g$ the learning algorithm picks.
$$\left(|E_{in}(g)-E_{out}(g)|>\varepsilon\right)\subseteq\bigcup_{i=1}^M (|E_{in}(h_i)-E_{out}(h_i)|>\varepsilon)$$
and hence,
$$\mathbb{P}\left(|E_{in}(g)-E_{out}(g)|>\varepsilon\right)\le\sum_{i=1}^M\mathbb{P}\left(|E_{in}(h_i)-E_{out}(h_i)|>\varepsilon\right)$$.
Applying Hoeffding's inequality to $M$ terms one at a time, we get $$\mathbb{P}\left(|E_{in}(g)-E_{out}(g)|>\varepsilon\right)\le 2M\mathrm{e}^{-2\varepsilon ^2N} $$

I have the following questions.

Why does Hoeffding's inequality requires that $h$ is fixed before generating the data set $\mathcal{D}$? Is it because $X_i$s, the indicator of $i$th point in $\mathcal{D}$ being red, are no longer independent after generating the data set, which is an assumption required for Hoeffding's inequality? For instance, after generating $\mathcal{D}$, knowing $X_i$ for some $1\le i\le N$ would give information for other $X_j$. Is this correct?
In the last step,for each term in the summation $\sum_{i=1}^M\mathbb{P}\left(|E_{in}(h_i)-E_{out}(h_i)|>\varepsilon\right)$, author states that Hoeffding's inequality applies to each bin separately and $\mathbb{P}\left(|E_{in}(h_i)-E_{out}(h_i)|>\varepsilon\right)\le 2\mathrm{e}^{-2\varepsilon ^2N}$ for all $1\le i\le M$. How is this possible? According to the previous question, the hypothesis $h$ must be fixed before generating the data set, but in this case we have a single data set $\mathcal{D}$ and we are later considering the hypothesis $h_1,h_2,\ldots,h_M$. How is the application of Hoeffding's inequality to each term in summation justified since the data set  is generated before hand i.e., before choosing a hypothesis?
If we could apply Hoeffding's to each term in the summation separately, why don't we say that $g$ is one of the hypothesis $h_1,h_2,\ldots,h_M$ and hence $\mathbb{P}\left(|E_{in}(g)-E_{out}(g)|>\varepsilon\right)\le 2\mathrm{e}^{-2\varepsilon ^2N}$?
Is the probability distribution $P$ on $\mathcal{X}$ independent of the hypothesis $h$, i.e., is $P$ chosen without bothering about the color of points in $\mathcal{X}$, which in turn is dictated by $h$?
Answer: I hope this answer can help:

Why does Hoeffding's inequality requires that h is fixed before generating the data set... Is this correct ?
How is the application of Hoeffding's inequality to each term in summation justified?

I would suggest you think of it like this.  You have M models, all trained on the same training data.  You also have a validation data set, with N samples, and now you want to select the best model by using accuracy on the validation set.  Hoeffding's inequality bounds the probability that the accuracy is indicative of real world performance.

If we could apply Hoeffding's to each term in the summation separately, why don't we say that g is one of the hypothesis h1, h2, ⋯, hm and hence ℙ(|Ein(g)−Eout(g)| > ε) ≤ 2e−2ε2N?

Because you don't know which one it is, it could be any of them, hence "or", hence sum.  If you see the inequality as a very crude and naive upper bound, it will help.  Look at it almost tautologically.

Is the probability distribution P on X independent of the hypothesis h?

P is the probability of the statement that |E_in(h) - E_out(h)| > ε.  If my hypothesis is that a coin is 60% vs 40% heads vs tails, then what is the probability that the estimate from 100 coin flips is more that 2% inaccurate.  It is over the same validation data set.  E_in and E_out are binomial distributions.

Hoeffding's Inequality


Asking about a patent drafting advice

Question: If am I going to use licensed technology to come up with a new patent, how should I mention it while drafting the application?
Comment: How do you mean you're using a licensed technology to come up with a patent? Do you mean you're using it in your implementation? Or does not invention rely on some other kind of technology?
Comment: I mean that in a certain part of the invention I am using a balloon which I have its license from its patent holder
Comment: my question is how should I mention this while drafting the patent application?
Answer: You don't.
The purpose of a patent application is to describe your invention. Whether you have a licence to some technology used in the implementation of your invention is irrelevant, because that doesn't relate to the invention itself.
However, if your invention is predicated on another piece of technology (whether licensed or not), and no other more generic technology could replace it, then you would need to refer to that technology in the description. This could be by referring to a patent publication for that technology, or failing that, to the manufacturer and brand name.

Asking about a patent drafting advice


How are the LEGO instruction manuals made?

Question: I wish to know how the LEGO instruction manuals are made. What is the process currently used?
Comment: Not a duplicate - the people making the manuals are not even the designers.
Comment: I'm about to self answer myself. It may deserve it`s own question... you tell me. but the sets are built using Autodesk Maya.  The instructions are rendered. I should have some material to show... Let me check.
Comment: possible duplicate of [How are Lego sets designed](http://bricks.stackexchange.com/questions/113/how-are-lego-sets-designed)
Comment: Is this specifically about making the _manuals_ (say, getting the breakdowns, printing, perhaps historically drafting), or about the whole conception-to-box product lifecycle? I read it as the former, which is not a duplicate.
Comment: Alright, agreed. Not a duplicate.
Answer: How lego does it today.
I found little information about Autodesk Maya being the 3D modeling software being used. Here`s a blurb about their current design process :

Primary concept and development work takes place at the Billund
  headquarters, where the company employs approximately 120 designers.
  The company also has smaller design offices in the UK, Spain, Germany,
  and Japan, which are tasked with developing products aimed
  specifically at these markets.
The average development period for a new product is around twelve
  months, in three stages.
The first stage is to identify market trends and developments,
  including contact by the designers directly with the market; some are
  stationed in toy shops close to holiday periods, while others
  interview children.
The second stage is the design and development of the product based
  upon the results of the first stage. As of September 2008 the design
  teams use 3D modeling software to generate CAD drawings from initial
  design sketches.
The designs are then prototyped using an in-house stereolithography
  machine. These are presented to the entire project team for comment
  and for testing by parents and children during the "validation"
  process. Designs may then be altered in accordance with the results
  from the focus groups.
Virtual models of completed Lego products are built concurrently with
  the writing of the user instructions. Completed CAD models are also
  used in the wider organization, such as for marketing and packaging.

Source : wikipedia
How people do it themselves
LEGO provide software that does just that. Check for "LEGO Digital Designer" which allows to create a model, save a building manuals and buy the LEGO parts online.
Also check up this related question :"Do any programs exist that allow you to build own LEGO plans?"
For more information on how to create high quality computer images of LEGO models, check this question : "How can I create synthetic imagery (rendering) of lego models?"
Comment: The http://designbyme.lego.com site doesn't work anymore,  but Lego Digital Designer can still be downloaded from https://www.lego.com/en-us/ldd


What Python package to use to calculate midpoint?

Question: I asked a question earlier about how to calculate a midpoint. I was wondering if there is a Python library that does this alreay?
Comment: arcpy from ArcGIS software installation, but I'm assuming your are looking for something open-source. There's probably a module from QGIS if that helps.
Answer: This python package
http://pypi.python.org/pypi/geographiclib
solves the direct and inverse geodesic problems for an ellipsoid.  In your case,
solve the inverse problem to get a distance and an azimuth at
the first point and then solve the direct problem from the first
point with the computed azimuth and half the distance.  For a quick
illustration of using this package, see
http://geographiclib.sourceforge.net/html/other.html#python
Here, for example, is the calculation of the point midway between JFK
and SIN airports
<code># Compute point midway between JFK and SIN airports
import sys
sys.path.append("/usr/local/lib/python/site-packages")
from geographiclib.geodesic import Geodesic

# Coordinates of airports
lat1,lon1 = 40.640,-73.779 # JFK
lat2,lon2 =  1.359,103.989 # SIN

# Compute path from 1 to 2
g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2);

# Compute midpoint starting at 1
h1 = Geodesic.WGS84.Direct(lat1, lon1, g['azi1'], g['s12']/2);
print(h1['lat2'],h1['lon2']);

# Alternatively, compute midpoint starting at 2
h2 = Geodesic.WGS84.Direct(lat2, lon2, g['azi2'], -g['s12']/2);
print(h2['lat2'],h2['lon2']);
</code>
On my system, this gives
<code>(70.34117458722292, 97.02347775257729)
(70.34117458722295, 97.02347775257725)
</code>
ADDENDUM
This calculation is a little simpler with Version 1.46 of the
GeographicLib python package
<code># Define the path from 1 to 2
l = Geodesic.WGS84.InverseLine(lat1, lon1, lat2, lon2)

# Compute the midpoint
m = l.Position(0.5 * l.s13)
print(m['lat2'],m['lon2'])
</code>
This gives
<code>(70.34117458722294, 97.02347775257721)
</code>
For documentation see http://geographiclib.sourceforge.net/html/python.
Answer: I've just come across nvector (http://www.navlab.net/nvector), which seems to do this nicely, including taking care of issues at the poles and the 180/-180 meridian. My code using their methods:
<code>import nvector as nv

class Vertex:
    def __init__( self, lat, lon ):
        self.lat = lat
        self.lon = lon

def GetGeodeticMidpoint(vert1, vert2):
    """Given two Vertices, return the geodetic midpoint of the great circle arc between them, on the WGS84 ellipsoid. Uses nvector."""
    # see http://nvector.readthedocs.org/en/latest/src/overview.html?highlight=midpoint#description
    wgs84 = nv.FrameE(name='WGS84')
    n_EB_E_t0 = wgs84.GeoPoint(vert1.lat, vert1.lon, degrees=True).to_nvector()
    n_EB_E_t1 = wgs84.GeoPoint(vert2.lat, vert2.lon, degrees=True).to_nvector()
    path = nv.GeoPath(n_EB_E_t0, n_EB_E_t1)
    halfway = 0.5
    g_EB_E_ti = path.interpolate(halfway).to_geo_point()
    lat_ti, lon_ti = g_EB_E_ti.latitude_deg, g_EB_E_ti.longitude_deg
    return Vertex(float(lat_ti), float(lon_ti))
</code>
Comment: @MikeT True about the dependency, but from my understanding it does the math differently, using 3-dimensional surface normal vectors instead of spherical lat/lon coordinates, and that's how it avoids problems at the poles. they *should* get the same results, too :)
Comment: Note that this library depends and uses GeographicLib internally, so they should get the same results
Answer: You could try the Angles library, which does bearing and distance between points on the unit sphere, but I think you'd still have to calculate the midpoint yourself.
Answer: GDAL/OGR (Geospatial Data Abstraction Library) has a centroid function.
The following script reads in a line shapefile and writes the midpoint out to a point shapefile (source):
<code>#script that finds the midpoint of transect.shp
#script then creates a point shapefile from the line midpoint

from osgeo import ogr
myDriver = ogr.GetDriverByName('ESRI Shapefile')

#create layer from transect shapefile
dataSource = myDriver.Open('transect.shp',1)
lineLayer = dataSource.GetLayer()

#get geometry from first line feature in layer:
lineFeature = lineLayer.GetFeature(0)
lineGeom = lineFeature.geometry()

#get midpoint of line and get x/y coords
midPoint = lineGeom.Centroid()
xMid = midPoint.GetX()
yMid = midPoint.GetY()

#Create a point shapefile for the midpoint
mySource = myDriver.CreateDataSource('MidPoint.shp')
myLayer = mySource.CreateLayer('layer1',geom_type=ogr.wkbPoint)
featObj = ogr.Feature(myLayer.GetLayerDefn())
point_object = ogr.Geometry(ogr.wkbPoint)
point_object.AddPoint(xMid,yMid)
featObj.SetGeometry(point_object)
myLayer.CreateFeature(featObj)

#close both shapefiles
mySource.Destroy()
dataSource.Destroy()
</code>


Is 40 minutes layover in Newark enough time?

Question: First time flyer. Flying alone. 7:00 a.m Flight from Boston, landing at 8:27 am. Both Flights United, and both bought on same itinerary. My flight is at 9:08 going to Sarasota, Fl. I assume I will be at the Same terminal, but I don't really have any idea.
Comment: Some UX flights use Terminal A.  If both flights are UA, you're likely to stay in C.  Your itinerary should spell out the airline name in full if you want to check.
Comment: Is your flight from Boston on United Airlines or United Express?
Comment: I think Just United Airline. What would be different if it was Express?
Answer: United has two terminals at Newark, A & C.  Your flights are both likely but not guaranteed to land at/depart from C.  Even if you do have to transfer, there's a shuttle that does not require you to go through security again.
The good news is that if United sold you that connection as a single ticket, it's a legal layover.  So even if you do miss the connecting flight, they'll put you on the next available flight for free.
Comment: Thank you very much, So should I bank on it being at Terminal C most likely ?
Answer: I give this 50/50 chance at best, especially this time of year. 40 minutes is tight even in the best of circumstances but Newark has lots of traffic, lots of delays and is prone to weather issues (as is Boston for that matter).
The United terminals are huge, so it can easily be a 10 minute hike between gates. I never had to go through security  while connecting, so I doubt that'll be an issue.
Get the United app installed on your phone: that's the quickest way of checking what gate your connection is departing and on whether it's on time or not. You can do this while your still taxiing after landing. If it's super tight you can sometimes beg the other passengers or the flight attendants to let you get off first. If your stuck in the back of the plane, that's going to be a problem.
I would call United ask for a change, perhaps an earlier flight out of Boston. 40 minutes in a massive airport like EWR seems unreasonable.
And don't check any bags!
Comment: Hey, Thanks. Their is a flight at 6:30 from Boston on United. I would like to change to that flight, but wont I have to buy  another ticket or could they somehow change it!?
Answer: I've had short layovers going to Beijing from orlando with a connection in EWR. Both flights are in terminal C with United. You can google both flight numbers (with departing and arriving airports) to see their terminal schedule for the year -- this is 2019's schedule for one of my flights: https://info.flightmapper.net/flight/United_Airlines_UA_617


AC Recharge Failed / Broke Compressor?

Question: The AC on my 2004 Subaru Outback Impreza as weak, so I picked up a 134a recharge bottle with gauge. The compressor turned on and stayed on and I checked the pressure, which read low. I shook the can and added refrigerant, though I briefly did this upside down accidentally. The pressure in the system did not appear to be going up, even after about 1 minute of charging (checked every 10-15 seconds), and now the 28oz bottle is pretty low. The compressor then shut off, the belt squealed, and the pressure reads very high, which I guess is normal if it's off. But now the compressor only comes on for a second or two before shutting back off, and the AC now blows completely warm air. So it's apparently broken. There was also a lot of water coming from under the car (like 2-3 oz or something). Perhaps the gauge just failed, and I overcharged it?
Answer: The pressure will look very high if the compressor isn't running.
There are two things that stop the Subaru AC system (three, if you include a serious problem like the compressor breaking).
The first is low pressure. I think you're OK there - because the compressor is coming on for a short time. That also seems (at first glance) to indicate that the actual compressor is OK.
The other issue that Subaru's are susceptible to is AC Clutch wear. On the front of the compressor is the drive belt pulley. Removing this (you probably need a small puller), you'll find a couple of very thin spacers (look like washers). Remove one those, and replace the pulley. This reduces the distance the AC clutch has to travel, and can often solve this issue.
If you've never done this before, it's about a one hour job, and can be done on the driveway without removing anything except the serpentine belt and the clutch pulley. Don't even need to jack the car up (because it's all on the top of the engine)
For more detailed information, google "subaru ac clutch", and look for the posts on how to adjust it. All Subaru models of similar years use the same AC compressor.

AC Recharge Failed / Broke Compressor?


Where did the phrase "used to" come from?

Question:
Why does "used to" mean "accustomed to"?
Why is "used to" used to indicate a recurring past event? In

I used to be used to using it.

there are three meanings of "use". I ask about the etymologies of the two bolded meanings.
Answer: AllExperts.com:

According to the Oxford English Dictionary, the earliest text using "used to" in the context you ask about is Robert Mannyngs "Handlyng Synne 1303."  The quote cited is "For ryche men vse comunly Sweryn grete othys grysly."  Translated: "For rich men used to commonly swear great, grisley oaths."
It was in "very common use" from around 1400 onward, but today only appears in the past form of "used to."  "wont to do" is another archaic expression that carried the meaning of "used to" in reference to habitual activity in the past.
Comment: @drm65: I think @Fumble's answer hasn't got many votes because it doesn't answer the question you asked.
Comment: @drm65 I can't say I care much about whether my answers are accepted or not :) I'd be glad if it was of some help to someone.
Comment: @Fumble: You can have a present habit.  That is common.
Comment: @drm65: Actually, I'm going to backpedal a bit and add an NGram to my answer, basically reflecting the underlying point in @Philoto's answer. It does seem that the modern usage became prevalent *and* decisively switched to past tense in the early 1800s.
Comment: @Rhodri: My question was, how did "used to" come to mean "accustomed to"? (which was answered) and how did "used to" come to indicate a past habit? (which was answered).  I wasn't really asking for the first sightings of the phrase, which @Philoto was kind enough to find for me.  I just thought @Fumble gave me a more coherent idea of the evolution of "used to".
Comment: @drm65: Weird.  I didn't think @Fumblefingers' answer did that at all.  Still, if it's useful to you, that's the important thing.
Comment: @Daniel Searching "use to do" in Google Ngram would include results with: (didn't) use to do, which alone doesn't prove that "use to do" was said/written to express the present tense as implied by Fumblefingers. Philoto's answer however, does.
Comment: I have also read that "used to" is defined as a defective verb, in as much as that it is employed to express habitual actions only in the past. To express habitual actions in the present a common expression would be: I usually drink tea in the morning (compared to "I used to drink tea in the morning")
Answer: I have no idea, but I will add that, given the long history (14th century onward), it's likely the phrase has undergone a "grammaticalization," much like going to/want to now have "gonna/wanna" for certain, specific uses.  I cannot say "I'm gonna the store." So "to be used to sth" might be an offshoot of the original "used to do sth."
Very good question, BTW.
Comment: Sorry--I'm new here and probably should have added this to the "comment" section, rather than the answer section.  Lesson learned!
Comment: voted up to toss a point or two - probably shouldn't have voted it up
Answer: This is explained by Columbia Univ Prof. John McWhorter PhD Linguistics (Stanford), in  Words on the Move (2016). I quote pp. 109-112 beneath.

Even the way we say used to gives away that more is
going on than our simply saying the word use. Imagine
someone pronouncing the used to in that sentence as "yuzed
to," the way we would pronounce used in She used a pen. But
no—to say "She yuuuzed to live in Columbus" would
sound distinctly oleaginous; no one would even venture it.
The thoroughly correct pronunciation of used to in the sense
intended in She used to live in Columbus is "yoosta." One
might venture "yoostu" to preserve the pronunciation of
the to, but the used part has to be "yoos," not "yooz."
  Used to is, then, something quite different from use. Spell-
ing gives away that used to ("yoosta") was once—used to
form of use. But it isn't now, and the difference is that
use is a "word" word while used to ("yoosta") is grammar.
use is a word meaning to utilize. used to is, on the other hand,
a tool we use to express that something happened on a
habitual basis in the past. It fulfills a function right along.
side the -ed suffix we use to express the simple past: simple
past is he talked; the past in a continuous way is he used to
talk. To anyone who has taken French or Spanish, this dif-ference will recall the two choices of past in those languages,
such as the preterite and imperfect in Spanish: he talked
once: habló; he was talking: hablaba. In an alternate universe,
English would also have an ending to indicate the 'imper-
fect" to parallel the -ed one, but that just happens not to be
the way things worked out.
  The path from use to "yoosta" begins with the kinds of
changes we saw in the previous chapter, Of the kind that
take "blessed" through "innocent" and "weak" to "silly."
When it comes to using something, chances are you don't
use it just once. Typically one makes use of something regu-larly, over a long period of time—use is something one most
readily thinks of as long-term: usage, as it were. That reality
hovered over use, to the point that long-term usage (habit)
became a secondary meaning of the word. A nice example
is Thomas Hobbes in The Leviathan intoning in 1651, "Long
use obtaineth the authority of a law," where use could be
substituted for by practice or habit. Set phrases of the period
such as use and custom and as the use is (which meant "which
is the usual") further indicated this new meaning.
  Aware of this meaning, we can more easily understand
Late Middle English sentences such as a record from 1550
that one Thomas Casberd has used to set his cart in the street,
(In the actual spelling: "Thomas Casberd hathe vsid to
his carte in the streate.") That meant, Mr. Casberd "used," as
had the custom of, parking in the street. Or John Milton, in
in,
1670, wrote in his history of England about "the English then
useing to let grow on their upper-lip large mustachio's."
  So, to an English speaker of this time, use could mean
"have the habit of," or to translate into modern slang, "has
this thing where he .. ." From here, the path to today's
"yoosta" is clearer than if we just start with the "utilize"
meaning. Over time, the meaning generalized, such that
one could say used to to refer not only to someone harboring
a habit, but also to habitual or ongoing things themselves,
regardless of who, if anybody, was responsible for them. In
1550, Thomas Casberd has used to set his cart in the street
referred to Casberd's having regularly executed an action,
and Milton's mustachioed men did that to their faces on
purpose. However, She used to live in Columbus doesn't refer
to the woman regularly executing the action of living in
Columbus, which wouldn't even make sense. It refers to her
having lived in Columbus ongoingly. One can now also say
something like Based on this data, she used to be the only person
with type O blood in the village, when the woman in question
didn't even know what her blood type was and/or certainly
wasn't performing the action of having that blood type once
a day. Her blood type just was what it was, and as some-
thing that didn't change, was an ongoing state—hence used
to. used to doesn't even have to be about a living being: My
cello used to have a richer sound. Cellos don't have customs.
  Used to has gone from meaning "was in the habit of doing"
to, well, "yoosta." We use "yoosta" whether the issue is a
deliberate action (He used to ski), a passive state of being (He
used to hallucinate), or anything that was ongoing in the past
(It used to be easier to find a mailbox, where the "it" in question
is too abstract to imagine practicing anything or having hab-its). I liked it the way it used to be—again, how could this abstract
"it" do anything habitually in the way that Thomas Cas-
berd did? Used to is now not a word but a tool, one that puts
a statement into the past habitual: a piece of grammar.*
*This new meaning, practice, yielded another development of use: to
practice was to become accustomed, or to accustom Someone else. The
mother seal will be seen, a book of natural history noted in 1783, to "use
her little ones to live under water," meaning to accustom them to it, not to
exploit them. When in 1826 a woman is said to have taken a man and
"used him in her company," it can seem rather bawdy unless we know.
that the writer meant "accustomed him to her company." Here, then, is
the source of the expression to be used to something, quite an oddity
meaning of "utilize."
Comment: Upvote for John McWhorter reference!
Answer: Each of the three meanings can be paraphrased...
I [was in the habit of being] [accustomed to] [employing] it.
I assume OP wonders about the first meaning, but in reality I think it's just a tautological overlap with the second. It makes for an ugly sentence, to say the least.
The association of used with acclimatised over time, through repeated exposure or use seems unremarkable to me. I imagine the usage could have been re-coined repeatedly before it became a familiar part of normal speech and writing.
The expression used to in the sense of was in the habit of, has been around a very long time, as @Philoto assiduously researched. But originally it was as likely to be the present tense form use to as past tense used to. I think any such present tense usage today is simply by mistake, not in an attempt to convey 'archaic' connotations.
For some reason I can't really explain, the past tense form shot to prominence in the early 1800s.
Comment: You should know better than to use pre-1800 Ngrams. Tsk tsk.
Comment: I think, OP knows what the phrase "to be used to" means. He asks why, not what.. Please correct me, if I'm wrong.
Comment: @fumble: I am wondering about both meanings; how did "used to" come to mean those things?
Comment: @Philoto: Yes, but he asked *why* about the first two meanings, which I said are basically just unjustified repetition of the same thing. The origin of which I've pointed out seems unremarkable to me. *Use, usage, habituation* - they're synonyms, not metaphors.
Comment: @drm65: I think *use* often implies *habitual use*, as opposed to *utilise* or *employ* which might be a one-time-only thing. So I see nothing odd about the *ongoing or regular habit* becoming more associated with the word over time (as we get used to the usage! :)
Answer: "Used to" comes from a French word "usage" meaning something customarily done. So like many French expressions which were co-opted and then corrupted as they were incorporated into English, the meaning became something in the past which was habitually or customarily done over a period of time which ultimately ended- a way to express the "past imperfect verb tense" which English does not have.
Comment: This would be a great answer with some supporting references.


Are Scheduled Jobs copied after Sandbox Refresh?

Question: Are Scheduled Jobs copied after Sandbox Refresh? I did a refresh of a full copy sandbox and looked at the scheduled jobs but not all of them are there. Anyone has any ideas of the criteria used to copy scheduled jobs?
Comment: [Update] After some help from @Jeff Bennett I found out that the CronJobDetail was there but the CronTrigger record wasnt. There were some CronTrigger records but for some reason their CronJobDetailId did not match any of the existing CronJobDetail. In my case I needed to make sure these jobs did not run so I run System.abortJob(id) on the triggers but it would still be nice to know what is happening.
Comment: We've already established there was something wrong with the way your sandbox was refreshed.  Therefore this could be caused by any number of undocumented things.  You're probably better off speaking with whoever is holding your Salesforce ticket.  Sorry I can't be more helpful.
Answer: They should all be there.  I had to open a ticket with Salesforce recently because a glitch during a full copy sandbox refresh meant that it was refreshed without all of the Scheduled Jobs listed on that page.
If you are trying to schedule a job and you receive an error message which states it has already been scheduled, try querying for CronJobDetail objects to see if there are any that have no CronTrigger objects associated with them.  If there are any, you will have to submit a ticket to Salesforce to have one of their techs go and clear it out.
Comment: Thanks for the CronJobDetail; they are there but don't appear on the UI.
Comment: Jeff, please see my updated message. Any ideas?
Answer: There are two Standard objects which records are required for Scheduled Jobs to be displayed on UI.
One standard object is "CronTrigger". Another is "AsyncApexJob".
CronTrigger records are copied upon sandbox refresh while AsyncApexJob are not copied.
So the solution is to copy them manually or reschedule on sandbox.
In the past I developed a package to copy scheduled jobs. Later I abandoned that project.


iPad notes to Pages

Question: Using my iPad Pro, I draft many notes using the well-known Notes app. Next, I would like to polish them and add more detail therefore on Pages, but I could not find yet an efficient way to "import" from Notes to Pages, apart from copy/paste, which produces awful results. Anybody knows how to do this?
Comment: Do you have a Mac or iMac computer?
Comment: @jmh , I have a MacBook with Mojave, why do you ask it?
Answer: You can save the notes you want as PDF's by using 'Export as PDF' under the file menu while in Notes. There is an app on the App Store called 'PDF to Pages Free'. This free version will convert up to 3 pages from a PDF to a Pages document. Once the file is converted you can edit it further in Pages.

iPad notes to Pages


CSS provides dark-on-dark for visited links on Similar Questions sidebar

Question: There's a cool new feature I just learned about while trying to write up a new Meta question. Now, I'm fond of dark backgrounds, but isn't dark text on dark background a bit on the Dark side of design practices?

This is also the case on the main Q&A, which took a while to test, but indeed, it also provides dark text for "visited" links, which means that they're very unreadable.
Comment: a fix is on the way.
Answer: This has been completed now. ♪


Why did federal taxes come out of my check when I elected 100% pre Tax 401k contribution

Question: I got a bonus check and elected 100% into a pre Tax 401K. I knew FICA would come out but was surprised when federal tax came out as well. The Gross was $2278. with $85.07 going to federal and $174.26 going to FICA. The total 401K contribution was $1937.74 O'ya and Phili Tax was $80.93. I don't understand why federal tax came out when the 401K is exempt from federal tax? Any input is appreciated....
Answer: I think that the answer lies in the fact that the portion of your check that was deducted for FICA does not lower your AGI.
Because FICA is deducted regardless of the 401(k) election, this causes the amount that actually goes into the 401(k) to be less than the gross amount.  And that difference is considered taxable income, even though it has been deducted as tax itself (source).
So a federal deduction is made as some percentage of the FICA deduction, but this now increases the difference between the gross amount and the amount going into the 401(k).  Thus the calculations must work out so that amount deducted for federal taxes is equal to some percentage of the total difference between the gross income and the tax-deductible portion of it.
Furthermore, I disagree with the other answers about your employer attempting to anticipate your income and split taxes evenly across all checks.  Although this may be the goal for your recurring paychecks, bonuses are (or at least, can be) treated as supplemental income for the purpose of calculating taxes, and can be taxed at a flat rate of 25% (source).
Indeed, if you examine the numbers presented in your question, you will see that the Federal deduction of $85.07 is (after rounding) equal to 25% of the difference between your gross bonus amount and the amount that was eventually contributed to the account (2278 - 1937.74 = 340.26).
As unfair as it may seem, ultimately you are paying federal taxes on the amounts deducted for other taxes.
Comment: As an aside, the local taxes you paid clearly factor into this as well.  I am from Texas, and therefore don't pay any state or local income taxes, so I'm not familiar enough with how this works to make blanket statements about the effect of local taxes in such a scenario.  Since that's the case, I did not mention the local tax in my answer, in order to avoid misleading anyone from a different locale with potentially different rules.
Comment: Perhaps one or both of you had your withholding miscalculated, but there should definitely be an impact on the amount of taxes owed, since this payment causes the OP's AGI to increase.
Comment: Yes, I meant "withheld for FICA" rather than deducted.  My mistake.  I understand that the retirement contribution does not increase the AGI. My point is that a portion of the check was never going to go to the 401(k), despite the election of a 100% contribution.  That portion does increase the AGI.
Comment: I deleted out my prior comments. I'm with you now under these additional constraints: (1) Pretty much everywhere you've said "deduction" you should probably edit and say "withholding." (2) The fact that this is a bonus seems to be critically important. For #2, it's too long for a comment, so I'm going to write a supplementary answer. Feel free to pull some of that into your answer if you agree.
Answer: The answer by Wesley Marshall seems to be basically correct (although I earlier disagreed with him in the comments based on some of the wording).  I'm writing to add only that the part about this being supplementary income is more important than the weight than I think he gave it in his original answer.
If this were a regular paycheck with an instruction to contribute "100%" to a traditional 401(k), then you would have $0 federal income tax withholding.  The small amount by which your AGI goes up in this case (unless you get a giant paycheck on a regular basis) for what's withheld for FICA will not reach the level where any withholding is necessary based on that one check.  Same for whatever bit gets withheld for state / local tax.
Because this is "supplementary income" (see the link in Wesley's answer), then the 25% flat withhold rule kicks in, and the employer had to withhold even though the income that went to FICA might still be under the usual limit for which it would have to withhold federal income tax.  Then you can follow through the calculation the Wesley did and see the see how it all balances out.


Can a Half-Elf pass for a Full Human, or a Full Elf, using a disguise kit?

Question: If a half-elf where to disguise himself with a disguise kit, would he be able to change his appearance enough to pass as a full human among humans, or as a full elf among elves? I'm assuming the character is trained in deception.
Comment: The human Orlando Bloom was able to disguise himself as an elf with makeup and costume, so I suppose if a disguise kit contains pointy ears...
Comment: related https://rpg.stackexchange.com/questions/62606/how-do-the-disguise-kit-and-forgery-kit-work
Answer: Almost certainly, but ask your DM.
The rules for disguising yourself are not as clear-cut in 5e as they were in previous editions.  The description of the Disguise Kit just says that it contains:

cosmetics, hair dye, and
  small props lets you create disguises that change your
  physical appearance

That's not very specific.  In addition, two of the stats mention disguises as something that the stat does.  Under Intelligence:

Pull together a disguise to pass as a city guard

Under Deception, which is under Charisma:

pass yourself
  off in a disguise,

So basically, what you're specifically able to do with a disguise kit is going to vary from campaign to campaign.
In general, I would be very surprised if a particular DM didn't allow you to disguise yourself as a similarly-sized humanoid with similar features.  There's not much difference, visually, between Humans, Half-elves, and Elves, so members of those races should almost certainly be able to disguise themselves as those three.  Your GM might allow you to disguise yourself as a more different similarly-sized humanoid, like a Dragonborn, Half-orc, or Tiefling, but that is much less assured.  You probably can't disguise yourself as a much shorter race, like a Halfling or Gnome.
Broadly speaking, the only way that D&D 5e handles making a particular opposed check harder or easier is through advantage and disadvantage.  Since spotting a disguise is an opposed check (DMG 238), your DM should apply advantage or disadvantage to a particularly easy or hard disguise.
For example, if you're a half-elf disguising yourself as an elf, but not any specific elf, that's probably a really easy disguise, and you should get advantage.  However, if you're a half-elf trying to disguise yourself as a tiefling, you're going to have some problems vis-a-vis horns and tail.  You'd probably have disadvantage on that roll.
Comment: I love the answer, I wonder if there's any DMG guidance on DCs here? To me this seems like a matter of degrees. A half-elf into a human is probably a 5 or something, but I feel like a skilled bard / rogue should be able to go Dragonborn given the right DC.
Comment: @GatesVP I looked into what the DMG says about disguises, and the answer is, apparently, nothing.  I added some notes about how to handle advantage and disadvantage in this context, since that's the appropriate 5e mechanic to use for differing difficulties on opposed rolls.
Answer: There are three points, I think, when trying to pass for another:

Your disguise must be good, if you have proficiency with the disguise kit, you are allowed to add your proficiency to your ability checks (+2 at level 1);
You have to be convincing, this means having to roll your ability checks (Deception check uses Charisma); if that roll fails, then your disguised did not work;
Also, someone may specifically say that they are suspicious and get a check to see whether they can see through your disguise (Investigation check, using Intelligence, see Hag's Illusory Appearance ability as an example.)

Each time you try something new*, you need to roll an ability check to make sure your disguise does not get discovered. This can make it difficult to go in disguise for days on.
If you try to deceive a large number of people, unless they cannot see you too closely, it becomes even more difficult. Any one of them could potentially discover your disguise.
According to RAW, there does not seem to be any specific limits other than the fact that you cannot make yourself look shorter or thinner, for example. Taller, fatter, different skin, etc. is certainly all part of the disguise kit. Of course, a Tiefling's tail could be a problem.
Now, to answer your question specifically, I think that you could offer either advantage or a bonus (i.e. +5) to an Half-Elf to disguise himself as an Elf or a Human. After all, the differences are small. This is assuming the character does not try to look like a specific person, just himself as a slightly different race. Although the Half-Elf may be a bit fat for an Elf.
Note, however, that RAW does not generally include such edge cases.

"something new" — this is difficult to define. If you are actively trying to gather information, for example, it certainly requires additional checks. If you are just being yourself, it is probably that you do not need an extra check. As the DM, you should be able to sense when a new check is required. Especially, a new check should be required for each person that meets you. Someone walking by may be given a check, depending on whether you are quiet/discrete or doing something making you quite visible.
Comment: Note that there is no 'Disguise ability' in 5e.
Comment: Yes, so the answer should say "Proficiency with the disguise kit", and not "Disguise ability". I wasn't saying there was no mechanism to be skilled at making disguises, I was saying there wasn't anything called the "Disguise ability".
Comment: @MarkCogan, actually, there is.  It's called tool-proficiency with the Disguise Kit.
Answer: Yes, that's what the disguise kit is for. To take on another identity. You could even pass off for a dragon born with a disguise kit so long as you didn't have to prove it beyond superficial appearance.
You pretty much just can't change your size or your general humanoid appearance. (I am including Dragon born as humanoid I this particular regard being roughly shaped as a largish human)
Comment: Did you draw your answer from the book or from experience as GM?


What happens if I don't use my Indian visa? Is it likely to cause problems in future?

Question: I am a British citizen. I recently applied for (and was granted) a multiple-entry 6-month Indian business visa. It looks likely now that I will not use it (the trips were cancelled for business reasons), but I wondered - will this have any repercussions on future travel to India or elsewhere? I can provide a reasonable explanation for why I never used it, of course - will that even be needed if I apply to visit India again (as a tourist or for business)?
Comment: I suppose you might be asked, but it must be fairly common for people's travel plans to change; cancellation of a trip for business reasons must be especially common.  That shouldn't keep you from being granted future visas.  My wife was accepted as a landed immigrant in Canada, but never moved there.  She got a raised eyebrow when she later applied for a short-term visa, but nothing more than that.
Answer: No, it's fine.  Unused visas are common for business travellers (I have several in my passports), and are not considered a problem for future visa applications, at Immigration, etc.
Answer: To elaborate on jpatokal answer:

Other countries do not care - at all. They often cannot even tell if you used the visa or not. Specially multiple-entry visa do not show on the visa page itself if they have been used or not. You would have to go through the whole passport and check for stamps that would fall into the timeline of the visa validity.
India does not care, either. Trips get cancelled all the time, specially in business. It's a normal thing. Even if someone at the immigration asks you (they have the right of course to ask you anything), simply stating that you were assigned to a project that was then cancelled is a perfectly fine reason. As always in business: Blame your boss. I would be very surprised however if they ever ask you. Immigration generally only cares when you do come into their country, not when you stay at home.
Answer: Its not an issues at all,its normal on business trips.will not affect in future if you are applying again as tourist or for business.you are asked to provide explanation is happened to be very rare situation.


bones on the right side affect the left side

Question: ok, so i was creating a character in blender for my game but when i parented the mesh to the bones with automatic weights, i quickly found that when i moved bones on the left side of the body it affected the right side but the right side had no affect on the left. when i redid it the same thing happened so i applied the mirror modifier and did it again and it work perfectly but then when i was doing the weight painting the weight painting wouldnt affect both sides because i didnt have the mirror modifier. can anyone explain what could have happened if you can understand what i am trying to say? thanks.
Answer: I guess what you want is to create symmetric vertex groups so you don't have to repaint for the left what you've already painted for the right? Once you have finished the weight paint on a side, stay in Weight Paint mode, go to the Properties > Data menu, then click on the button on the right of the Vertex Groups list, choose Copy Vertex Group, a new vertex group is created, then click Mirror Vertex Group, the group has been mirrored. But this method only works on a real symmetric object.
Answer: if you model used a mirror, apply it then do automatic weighting for your bones.


Which operations are done when key is turned to On position?

Question: I would like to know which operations or functions does the car do when I turn the key to On position (the key position before starting the engine) in gas engine and in diesel engine.
 For example, in a diesel engine I know that the engine got warm.
Answer: This varies a lot by model, era etc., but a general overview:
The first thing that happens is the ancilliary electrical systems are powered:

Lights
Radio (often the radio will be permanently wired, but this varies)
Windscreen wipers
Dashboard gauges
Fans
Anything that runs off switched ignition

but also the Engine control unit, or ECU, which is what controls the engine (spark timing, fuel flow, airflow etc) so that it is ready to start the engine
Many of these are then switched off when the starter motor is engaged, just to reduce the load on the battery, as the starter motor is the largest current draw in your entire car, but once the engine is running and the key is released it moves back to the on position.
In a petrol engine there is no need to preheat the cylinders like you have in a diesel.
Comment: Also, the ON position primes the fuel pump.
Comment: It also does the safety checks, like anti-lock brakes and airbags.


How do you copy a physical hard drive to a Vmware virtual hard disk?

Question: Is there any way to copy a physical hard drive to a virtual drive for use in Vmware Workstation?
Answer: You could use VMware vCenter Converter(free) or Paragon Go Virtual(free), both applications will convert your existing physical machines in to virtual machines.
I have only used VMware vCenter Converter with good results.
Comment: VMware vCenter Converter doesn't seem to be available for download **free** ly. And as for Paragon Go Virtual, the page says *"No operations can be applied physically on the hard disk"* for the demo version.......
Answer: VMware (and I think most VM vendors) have "physical-to-virtual" conversion tools that should do the job. It's been a long time since I've tried them, but when I did I had no good luck (I'm sure that's probably not the case anymore - it's been a very long time).
However, if you find they don't work for you, you can do what I usually do - attach an empty virtual drive to an existing virtual machine and use Ghost or Acronis (or any other drive imaging software) to image the physical disk to the empty VM disk.  This works great - just like if you wanted to copy a drive from one physical machine to another.
Comment: The program for VMware is the VMware vCenter Converter.
Answer: Sure is, you can make it an ISO and mount it on the system.  Beware, that it will take up as much harddisk space as the drive it's a copy of, so you'll want to do this on another drive.  There are far easier ways. For instance: Use "File->Import" on the Workstation to choose the harddrive as the source drive to mount.
Comment: +1 for "it will take up as much harddisk space as the drive it's a copy of"
Answer:
Create a new Virtual machine based on linux.
Make the drive size equal to the drive to be imaged
Connect the drive to be imaged (USB/eSATA)
boot the VM off the diskcopy CD/ISO link text
Make a disk copy using external drive as Source and vDisk as Destination
Change VM settings as appropriate
Comment: This method is the least difficult to implement. DiskCopy can be replaced by any utility which has a bootable CD e.g CloneZilla, Acronis TrueImage etc. or even any linux liveCD + dd
Answer: You can use:

VMware vCenter Converter Standalone -- As suggested by most users but I wonder it may subject to licensing requirement for existing customer, tho you can still download it freely from official site.
VMware vCenter Converter cold clone boot CD -- Discontinued but you can find it here. http://thatcouldbeaproblem.com/?p=584
Microsoft SCVMM -- Sth for large scale and scheduled conversion.
Sysinternal Disk2VHD by Microsoft -- My personal fav and the easiest one. http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx

PS. Only 2 allow you to have it done from "bare bone" level, most mehtods required agents to be installed in guest os which is going to be converted.
Answer: you can just 'dd' your /dev/hda or /dev/hda1 to a file.
i.e. if you are on a linux box.
on Windows get a windows dd, and use \DosDevices\DriveC ( or something like that
too lazy to look around).
Comment: Do you mean third-party or released by Microsoft?
Comment: `dd` is non-Windows.... What do you mean by "windows `dd`"?
Comment: Just Google for dd windows, and you'll find it. There is nothing Unix specific about dd or any other standard Unix utilities
Answer: easy.
Create a new virtual disk that is the size of the physical disk you want to copy.
on the Machines sidebar list in Vmware, go to settings, select the disk, map it to a drive letter on the host machine, use your favorite imaging software to copy the physical disk to the VM disk.
This is nice because it's a direct copy and does not require in image which would otherwise mean a third copy of the disk would be needed temporarily.
Answer: In VMWare Workstation, File->import supports a physical machine as the source
Answer: You can add a windows (samba) share on your hardware node, and go to it through your virtual node (\) to copy the files. Alternatively, you can use the network browsing feature to locate the files on the shared drive, and copy them.
Comment: I don't think you get it.  He wants to copy the drive, not the files.
Answer: You can attach a blank VMDK as a disk drive with SmartVDK and copy the files over to it.
If you want to preserve ACLs and all the NTFS metadata (make a perfect image,) use ImageX to capture an image of the physical disk.  And then immediately apply the image to the attached virtual disk drive.  You'll need enough space to have a complete backup of the source hard drive, though.
Answer: After a long research i found out that the only way to import the informations from your computer to the virtual machine is by sharing them folder by folder and giving full rights for them.Worked for me!
Answer: Use QEMU disk image utility. Available for Windows too.
On Linux:
qemu-img convert -p -f raw -O vmdk /dev/sda disk.vmdk

On Windows (run as Administrator):
qemu-img convert -p -f raw -O vmdk x: disk.vmdk


Does the amplitude of the RF pulse affect the NMR signal?

Question: I know that the NMR signal depends on the static magnetic field strength $ B_0 $ (by Boltzmann equation) and its gyromagnetic factor. While NMR occurs when the RF pulse frequency matches the equation:
$$ \nu = \frac{g}{h}\mu_{n}B_{0} $$
what about its amplitude? Does the amplitude of the RF pulse affect the NMR signal? For example, does it affect the signal strength?
Comment: Please be a little more clear. You write about "signal amplitude" and "pulse amplitude" in different sentences, but sometimes its not 100% clear which one you mean (such as immediately after the equation).
Answer: V. approx explanation. The rf pulse is at 90$^\text{o}$ to the static field $B_0$ and has the effect of moving the magnetisation (sum of spin vectors) away from alignment along $B_0$ (z-axis normally) into the xy plane where it rotates and cuts through detector coils and induces FID signal. The FID can only be detected with a magnetisation component in the xy plane. The size of the rf pulse's magnetic field $B_I$ is proprotional to angle $\theta$ moved away from z-axis as $B_I\sim \tan(\theta) $ and so via magnetisation's component in xy plane (arrow on axis in sketch) to the size of the FID.


Wiring bath lights that have two power sources

Question: I have a vanity light. Power comes into the light. A wire runs to the switch. I am planning on installing a bath fan that has fan/light/nightlight. The existing switch is mounted in a 1 gang box in beadboard. I would like to avoid cutting in a 2 gang box. I also have a 12-2wg romex unused running from the panel to the attic where the fan is going. I have a 1 gang stacked switch for fan/light/nightlight. I would like to just run a switch leg to the same box and switch both lights on this switch. Does the two power sources make this immpossible? Last resort, can I use the same swich with one light/the other light/ fan and eliminate the nightlight?
Answer: No to Q1, switching both lights, unless you get the same power that the existing light switches to be in parallel with the fan light.  That would mean running the same gauge 12 or 14 -2 (hot, neutral and ground ) to the fan light from the overhead light.
Combining circuits risks having 240 VAC across your fixtures.  It can be done, if neutrals and ungrounded (hots) are kept separate (from each other and not connected through a device section to another.
Maybe to question 2, if you mean using the one (original power source) to switch fan, light, fanlight together.  (this assumes the added device wattage doesn't exceed the wire capacity.
You would be better served by biting-the-bullet and put in a new switch box and use the separate power available and get all 3 functions separately   Am I guessing correctly that the bath outlet is on the same circuit as the light and they are 14 gauge??  One hairdryer-light-fan-fan light will likely overdraw a 15A breaker
Comment: Besides the 240 volt hazard, there is also the hazard that it unintuitively requires turning off *two* breakers to deenergize the bathroom circuits.  IMO that is way more dangerous than 240.
Comment: Electrical work requires that you REALLY understand what you are doing and test to prove your assumptions.  I've seen outlet installations daisy chain 240 down a row, breaking the common hot so that each half of the duplex was on a different side of the transformer.  A meter testing hot-to hot will show the 240.  Looking at the wiring will show (usually) a red for one hot and a black for the other and the common link cut.  I never assume a light switch cuts the power when replacing fixtures, in case the power feeds at the light.
Answer: There may be a solution, depending on if, where, and how power continues from the vanity light. You might be able to abandon the vanity light power and switch it in parallel with the fan light, using the fan power feed to power everything.
How many conductors run from the vanity light to the switch box, not including ground? Are there any other cables coming into the vanity light? The switchbox? How many conductors each?
Comment: I'll have to get back to you on those questions. It is enclosed in the wall. I have to figure out exactly what i have. I just know the power isn't coming though the switch. I am going to work in the attic on the 16th. I will see if I can see the setup then. If not, two gang box it is. Thanks.
Comment: One should be able to figure out the answers by examining the inside of each box after pulling the device out. You cannot easily determine conductors from the actual cable unless you have good eyes and lighting (and access). The function of each conductor can usually be deduced from these findings. Which color wire connects to what part of the device are also good clues, and cannot be determined from the cable alone. You need to pull out the devices. Turn the power off at the breaker before doing this.


Type of hinge I should use

Question: Can you please suggest what kind (type) of hinge / pins I should use to make the mechanism in the attached file. I was considering to use the pins shown in the second image. But I am not sure if it will work.

Comment: it would depend on many things such as materals , load , how many cycles do you need it to last, etc, etc.
Comment: correct. I will keep that in mind. But what kind of pin / hinge is shown in the red circle (in the above image)? What is it called?
Answer: What is shown in the picture is what people usually refer to as a pin connection. There are multiple ways you can design a pin connection as suggested in the comments above and there is no one right design for it. Disregarding practical considerations, such as materials, load cycles and etc, and in pure design engineering terms, you will need to find the shear strength of the items you have selected for your pin, and make sure it is reasonably stronger than what you have calculated for the shear load on the pin based on the configuration you have. The shear load on the pin can be determined from the normal force at the pin connection, and ut can be something less if you have double shear or triple shear mechanisms in your pin connection in question.

Type of hinge I should use


Red Blood Cell Size Vs White Blood Cell Size

Question: I have just found out that white blood cells are larger than red blood cells and now I'm confused due to something I learnt in class. Basically, I was taught that there were spaces between the endothelial cells lining the capillary and these spaces allow white blood cells to escape and enter infected tissues to help clear out the infection. Why don't the red blood cells escape then if they are smaller than white blood cells they should fit through the spaces as well right?
Answer:
there are several types of white blood cells (at least 4) and they vary greatly in size from type to type.
white blood cells are not rigid, they can squeeze through very small openings. it always buts me in mind of watching a octopus squeeze into a bottle.
Comment: I should point out that RBC precursors do need to extravasate through bone marrow endothelium to end up in the blood to begin with, but if you look at reticulocyte morphology, for example, there's a big difference compared to a terminally differentiated RBC.
Comment: Thank you for your comment CKM but I have no clue what your talking about lol. Your too clever for me :) Can you explain what you said in an easier way please? If not it is okay but I'm only in my first year of biology yet and so I don't know much other than the basics.
Comment: So are red blood cells rigid and thats why they can't go through the small spaces between the cells? Also what happens to the white blood cells once they get to the infection? Are they broken down or do they manage to enter the capillary again?
Comment: they are more rigid, but more specifically lack the mechanism that actually squeezes the cell through, it is not a passive process, the white blood cells is physically pushing itself through the gap similar to how an amoeba moves. The last question would be a great seperate question.


Bent's rule for Sulfur trioxide and Sulfur dioxide

Question: How is Bent's rule applied on $\ce{SO3}$ and $\ce{SO2}$?
Bond length of $\ce{SO3}$ < $\ce{SO2}$. Is this a direct consequence of applying the Bent's rule?
Comment: I really don't see why you would need to apply Bent's rule.
Answer: Here are structures of dominant resonance structure (only one of 3 and 2 differencing only by rotation) for sulfur tri- and dioxide. Despite common misconception, d-orbitals apaprantely play very insignificant role in chemistry of p-block elements, so the structures include formal charges.

As can be seen, the average order of sulfur-oxigen bond lowers with move from di- to trioxide from $1.5$ to $1.(3)$. However, average formal charges grows from $+1$ to $+2$ on sulfur and $-0.5$ to $-0.(6)$,  on oxygen, thus greatly increasing ionic bonding (roughly from $1*0.5 = 0.5$ to $2*0.(6)=1.(3)$) Generally, ionic bonding greatly outperforms covalent bonding, and here charges grown considerably so bond shortening may be attributed to that. The point, however, is, that in this particular structure more than one effect is in play, and their effects outperform whatever small effects are considered when Bent's rule is applied.
Comment: @shauryagupta I wouldn't. There are more significant factors in effect here.
Comment: But how would you apply Bent's rule here?
Answer: There are several factors which play a role in determining the bond length in a molecule.

Here, in $\ce{SO3}$, we have no lone pairs on the sulfur atom whereas, in $\ce{SO2}$, the central atom has a pair of lone electrons.
According to Bent's rule, the lone pairs tend to occupy the orbital with more s-character which in turn decreases the s-character in the $\ce{S-O}$ bonds and increases the p-character. Also, since there's an increment in p-character, there's an increment in bond length and thus S-O bond length in $\ce{SO2}$ > $\ce{SO3}$.
I hope this might get you on clear grounds of how Bent's rule can be applied in this case.


Pickles (cucumbers) came out a little soggy after canning

Question: I was very excited to use my water bath for the first time, as so far I have only made refrigerator (cucumber) pickles. This was also the first time I did not use sugar in the brine (just wanted to see the taste difference) but they came out NOT as crispy as my refrigerator pickles. Is this because maybe the water was too hot in the water bath? I only left them in for 10 or 15 minutes. Or is this because I did not use sugar this time? Also is there anything I can do at this point? By that I mean can I add something like pickle crisp to the now opened jar or is it too late?
Comment: @Mołot : OP talks about [watherbath canning](http://www.freshpreserving.com/tools/waterbath-canning) (= long-term preservation) as opposed to refrigerator pickles (short-term).
Comment: What's this water bath you talk about here? Link, maybe? Sugar helps, but AFAIK is not essential, full procedure I use under another of your questions.
Comment: @Stephie oh. Everyone I know do it using just a big pot, no special hardware. But I guess basic proecdure is just the same.
Comment: To have crispy pickles there is no hot water bath. Just heat your water with whatever spices you use and cool the water or just put the spices in cold water and put the pickles in it. Make sure you have a good and tight seal. After 2-4 days outside, maybe 5 depending on how cold the weather is, put in the fridge. Notice in the markets or shops, crispy pickles are in the fridge and not so crispy, limpy ones are on the shelf. I asked a few friends of mine and they all agreed with this answer. As for fixing what you have made, just enjoy and maybe cut them up in rounds and use them for sandwiches
Comment: I know using a water bath is not necessary for pickles you will eat within a month, but if you want to make some for long term storage you need to use a water bath
Answer: First off, processed and canned pickles are almost always going to be less crisp than refrigerator (acidified) pickles or those fermented at room temperature.  If you really like crisp pickles, I'd recommend against canning.  Recipes with proper levels of salt and acidity can keep for several months in the fridge without noticeable quality degradation.  Also, reputable traditional brined/fermented pickle recipes should maintain safety for a year or more in the fridge, though they too can begin to soften after a few months, depending on the exact processing and storage conditions.
If you don't have room to store in the fridge or want to can for some other reason, this page has some tips on maintaining crispness.  The lack of sugar in your batch should not have made a significant difference.  The temperature of the water is, however, important.  If you want to maintain crispness as much as possible, I'd recommend trying a low-temperature pasteurization bath (as described, for example, here), where you process for 30 minutes at 180F.  Please note that this method should only be used with recipes from reputable sources and is only recommended for people experienced in pickling; it does require very careful monitoring and exact temperature control to prevent spoilage.
As for what you can do now?  Not much.  Soft processed pickles have essentially been "cooked" by the processing.  There's no way to restore their crispness.  Personally, if the lack of crispness was bothersome, I'd consider slicing them up in smaller pieces where the lack of crispness would be less noticeable or chopping them and using them for relish or something.
Answer: unfortunately it is too late for you to do anything now. Cause any cooking of the pickle will further makes it more soft. So you want to avoid it.
Also to your first point of being soggy it is definitely not the sugar too. I am thinking that could either you missed to add vinegar or the vegetable must be of soggy kind. Sugar only helps staying it for long time along with vinegar.


What if someone got a demon slayer mark after they'd already turned 25?

Question: What would happen if someone got a demon slayer mark after they'd already turned 25? Would they die straight away?
Answer: According to what the wiki says:

Having the Demon Slayer Mark has its costs. Demon Slayers who have awakened the Demon Slayer Mark are said to die upon reaching the age of 25.

and also it is said:

Kokushibo speculated this to be because the mark exchanged the life span of its user for power.

if the first theory is the right one,

the user will immediately die after awakening the demon slayer mark if he/she is older than 25

but if what Kokushibo said is true,

they can live longer and become older than 25.

side note based on wiki:

Yoriichi was able to defy fate and lived to be 85 years old
Answer: As we know if mark appeared before age of 25 person dies at age of 25, but in some cases that's not true. So if anyone acquires the mark after age of 25 he/she may live. In other cases mark consumes life energy so he/she may die in fight or how much energy they use.


Should I include name of potential advisor on my statement of purpose (SOP)

Question: I am currently writing my statement of purpose (SOP) for top graduate schools in engineering majors in US. I am wondering should I include name of my potential advisor on my SOP (Is it a good idea to do that)? The problem is I am thinking if I do not include name of advisor it might be the sign I did not look at his/her research page and I am not very specific about my plan. On the other side, if I include name of potential advisor and my application is not competitive or he/she is not accepting any graduate student this might cause others not to look at my application since they might think I am not interested in their research.
Answer: Faculty at a top-10 school in aerospace engineering gave a former student of mine the advice of indicating several professors whose research he was interested in, for exactly the reasons you suggest: by showing too narrow a scope, it makes it harder for other researchers to gain interest, and by just submitting a "generic" SOP, you run the risk of looking like you're not doing your homework. Showing an interest in several faculty makes it easier for someone to advocate for you in the admissions committee.
Comment: Do you think including name of three professors in statement of purpose is bad and cause graduate committee to believe that we are not specific enough about our plan?
Comment: You're allowed to be uncertain about exactly what you want to do as a graduate student. So long as you have clear reasons for why you want to work with them, it should be fine.
Answer: I think it's standard to list some potential advisors.  It shows you know what you want and you have a good reason to be interested in the school.  And if none of the advisors you want are taking students, do you really want to attend the school in the first place?
(In the long run I think it's better to get rejected from a school than to go there and realize there's no one there who wants to work with you who you would also be willing to work with.)
I would also go into some detail about the area of research you are interested in.  This is a good chance to display your familiarity with the topic/maturity as a researcher, and it will help them assess whether they have spots for you.


Cooking with rancid flour

Question: I baked some cookies and did not realize the flour might have been too old.  It has been stored in my canister on the counter.  Can rancid flour make anyone sick?
Answer: How "old" are we talking about?
If the flour was white all purpose flour, was stocked in an airtight container, and your house gets not too hot in the summer I doubt the flour could have gone rancid. Rancidity is the deterioration of fats, and in wheat only the germ contains fat; white flour has been stripped off of wheat germ and therefore is very unlikely that it becomes rancid (anyway rancid flour is unlikely to make you sick)
Most flour deterioration comes from pests like meal moths, but you cannot miss them.
Nevertheless, if the cookies smell and/or taste bad you should throw them
Answer: Flour goes rancid primarily from the small amounts of fats present. At best rancid flour will contaminate the taste of anything you make with it. Worst case someone could experience a reaction from toxins introduced by different strains of bacteria.

Cooking with rancid flour


How does radiolabeling work?

Question: Protein turnover can be measured by calculating the "decay" or loss of radio-labeled proteins in the blood, for example, but I am confused at how this calculation works. Wouldn't the radioactive isotope that you're using be decaying due to being unstable and not just due to protein turnover? Would you have to account for that in your calculations?
Comment: Which calculation are you using?
Comment: A=Ao*e^-kt, where A = tagged protein at any time, Ao = tagged protein at zero time, t = time in days, and k = turnover rate as fraction of the protein pool turned over per day. By rearranging the equation you can get turnover rate (k).
Answer: Technically yes, but practically it depends on what the half-life of your isotope is relative to the half-life of your protein. For example, tritium has a half-life of a little over 12 years, but most protein labeling experiments take place over only a few days at most (it depends on your protein). So while technically the tritium is decaying during your experiment, the amount of decay will be below your detection limit, and therefore is negligible over the course of the experiment.
So basically it works best to choose an isotope that will not appreciably decay over the time course of your experiment so you don't have to worry about it. If this is not possible, then yes, you would need to correct for this.
Comment: I've read some papers that use Iodine 131 to label proteins, which has a half life of 8 days. So I have another question: how do people detect these isotope labels? Do people rely on their decay to measure it (for example the release of beta-minus and gamma emissions? In that case, wouldn't you want to use something as radioactive as I-131?
Comment: Detection depends on the isotope used. Tritium is a low energy beta emitter, so it would need to be removed from the place you are measuring and put into scintillation fluid or something analogous.For something that is higher energy, like P-32, you could use film or a geiger counter. For imaging in live organisms, I think you do need something fairly strong like I-131, unless you are harvesting samples from the organism. For I-131 you can do a PET scan, since it is a gamma emitter. Typically, this does rely on the decay of the particle. 8 days is still plenty of time for most imaging though.

How does radiolabeling work?


What happens to checking account monthly fees when you have a 0 balance?

Question: Many checking accounts charge a monthly fee if you don't maintain a minimum balance or other qualifications. However, what happens if you have a $0 balance and they can't deduct the monthly fee from your balance? (Similarly, some accounts have an early closure fee for closing an account within 6 months... but how can it be charged to you if you have a $0 balance?)
Comment: I had a friend back in college who had to go to the bank (two states away from where he was living at the time) and deposit money into the account to clear the negative balance so he could *close* the account. In other words, he had to pay the bank to make them stop charging him more money. Can you say, "CHA-CHING!!!!"? I knew you could...
Comment: My wife closed her account they said ok in Feb 2016 now we owe almost five hundred dollars in fees and overdraft fees cause there was no money now we our trying to back trace our steps to fined out who she talked to
Answer: Unless your agreement says otherwise, the bank is authorized to debit your account for the amount — and then charge you an additional fee for being overdrawn. If you do not add money to the account to bring it into a positive balance, they can pursue you for it just as they could any other debt. They may also choose to close your account instead.
Comment: Or they can just shut down the account.
Comment: @keshlam A good point. I'll add that option to my answer.
Answer: Under Federal and State Banking Regulations, the banking institution is not allowed to over draw an account for maintenance fees.
You should contact the Federal Reserve and the Banking Commission immediately and be sure to document these fees as proof.
Comment: Do you have a citation?
Answer: Not only did PNC bank overdraft my account due to monthly fees, they closed it because it was over drafted. I went into the bank to pay the fee and reopen my account and deposit my paycheck (from the same bank) they took their fees, would not let me re-open my account and charged me to cash my check.


Difference between hit the tennis ball in different positions

Question: Thinking of a traditional shot from the baseline, if the player has enough time to be able to hit the ball after the rebound in a higher position or lower one, what are advantages and disadvantages in the next shot?
Comment: By rebound, do you mean recovery? And what do you mean by higher and lower positions
Answer: Generally, if the ball is able to be hit from a higher position, more power can be put into the shot because the ball needs less overspin to clear the net, with the power of the shot going into the velocity of the ball instead. This increased power could however cause newer or less skilled players to be more likely to hit the shot into the net or otherwise miss.
There are not really any advantages to hitting the ball from a lower position. The ball requires more overspin to loop over the net and land in, thus reducing the velocity of the shot.


SharePoint Provider Hosted App stops working

Question: I am having problem in Sharepoint provider hosted app. I have created one app with CSOM for script injection in sharepoint online and hosted in azure. I took solution from GitHub PNP script injection.
But after every 12 hours my app stops working. I don't know the reason. It is a low trust app. I read many articles where it has been written that sharepointcontext.cs and tokenhelper.cs class files managing tokens. But I tried every work around but no luck. If some can help me out this, some thing in configuration like client ID or client secret key is missing or upgrade.
Answer: It sounds like the token is expiring, based on the 12 hour time span you mention. How exactly do you know it stops working after 12 hours? Are you actively using it and then all of a sudden you get an error? What does that error look like? Have you checked F12 (developer tools) console window to see what the error message is?
If the token is expiring, ensure you have logic in your access layer to catch expired token exceptions. In the event the token expires, you need to re-issue a token request, either by using the refresh token (lasts ~6 months), or by initiating the POST redirect flow that landed you a valid access token in the first place.
Good luck!


how do I fix loose tile on basement stairs

Question: we had our basement stairs tiled with ceramic tile, now the grout is breaking on some of them and the tiles are loose and coming off.  they were applied directly to plywood.  Can I fix them as they come loose or do I need to redo the who thing?  And what do I use and how do I do this so it doesn't keep happening
Comment: A Jensen, we'd need more information about the structure of your stairs, the subfloor arrangement, and anything else that was done to prepare for tile in order to answer properly. Ceramic needs a very rigid subfloor, and therefore stairs are notoriously difficult. Chances are you can't fix the problem without stiffening the stair framing and thickening the subfloor, which would require a total redo.
Comment: A problem with tiling stairs....they will come loose from,the abuse of walking. You don't step directly center and therefore the step moved. I would repair each as they come loose using a siliconized grout, that comes in a caulk tube, as your grout and thinset. This will allow the tile to move and flex as the floor does also. Ways to avoid this and have grout again....more subfloor, cement backerboard or most plywood. This will make your steps thicker but also stop the step from a lot of flex.
Comment: I know...meant it more as a question to the prep of the stair. But since they said directly to plywood, I guess I have an answer huh.
Answer: If you are in the US and have a traditional stringer staircase leading to your basement there is almost nothing that you can do to prevent issues with a tile installation.

There is too much movement in this type of staircase.
Dimensional lumber moves too much.
Unless there is a closed door at the top you have two climate zones hitting each other on the stairs.
Basement stairs are about as steep as possible in most cases causing more stress on the stairs.

To get tiles to work you would have to add in supports under the stairs and into the framing on each side, put concrete board over stairs, possibly plywood under concrete board, and then a membrane.  And even then you might still have issues.
Tiles look great on stairs if done right.  I have mentioned before that I have rehabbed houses in Europe.  I have gutted some 80 year old homes in France and never had to touch the tile floor/stairs - which after cleaning hold up better than a wood floor.  However the tile stairs were laid on top of concrete 100% of the time.
Meaning unless you want to pour concrete stairs, don't tile.  You can put some nice bullnose pine treads on the stairs with some oil based paint that will blend in just fine to tile and will hold up and look nice.  Whatever you do to temporarily fix the issue is just going to cost you time/money/frustration.  The tiles are a sunk cost, sink them.


What happens if internet get disconnected while mining ethereum?

Question: Does the mining process starts all over again and I loose all the work my machine has done or does it start from where it get disconnected and do I get the rewards for that?
Answer: If your internet cuts and you continue to mine you could fork the chain. That means your found blocks are irrelevant when you gets back to the network.
Even if your chain isn't forked after in a short cut your found block has a weak chance to be considered as an uncle.
Comment: So even if the internet gets back online in 5 minutes, will it still not be able to provide POW and get the reward?
Answer: Yes, the mining will continue even if the internet goes off. But if you don't have internet your miner will not be able to communicate to the network and submit the Pooof of Work hence it will create a fork in the network. So nobody knows that you have mined but you, which is useless and will not earn you reward.
Mining makes no sense if you are in a small office/personal purpose computer. It will mine, but you will not get any rewards because the process is computationally difficult and there are powerful machines doing the same task.
Check Mining 101 and Mining profit calculator


What kind of solvents favor elimination reaction?

Question: This question is confusing and I can't seem to find a answer to this. The question is what solvent promotes E2 and E1 reactions? My teacher says that methanol as solvent with strong base favors E2 over Sn2. But she never explained why. Also she keeps using methanol as the example which is confusing. Can anyone please elaborate on this?
Answer: This website gives good rules of thumb: http://www.masterorganicchemistry.com/2012/12/04/deciding-sn1sn2e1e2-the-solvent/
And so does this website: http://www.mhhe.com/physsci/chemistry/carey/student/olc/ch08substitutionvselimination.html
In addition, according to page 583 of "Physical Organic Chemistry" by Anslyn and Dougherty:

Almost all bases are also nucleophiles, and hence we expect competition between elimination and substitutions. In both $\ce{S_N2}$ and $\ce{E\text{2}}$ reactions, the nucleophile or base reacts in a single rate-determining step with the reactant. In both $\ce{S_N1}$ and $\ce{E\text{1}}$ reactions, the nucleophile or base reacts in a step after the rate-determining heterolysis...
An $\ce{E\text{2}}$ reaction requires the addition of a base, and can be performed in solvents of low or high ionizing power. Since most strong bases are also good nucleophiles, $\ce{S_N2}$ reactions are important competitors. However, elimination will dominate if the carbon with the leaving group is not susceptible to nucleophilic attack, such as a tertiary R group. Examples of this trends are given in Table 10.6.
$\ce{E\text{1}}$  reactions involve carbenium ion intermediates, and therefore are facilitated by all the factors that stabilize carbenium ions. These are the same factors that facilitate $\ce{S_N1}$ reactions. Strongly ionizing solvents and substitution of electron donating groups on the carbon undergoing heterolysis are necessary.
In highly ionizing solvents and with R groups that readily form carbenium ions, the ratio of substitution to elimination is typically independent of the leaving group. This evidence supports the notion that the substitution and elimination products are formed b branching from a common intermediate, and therefore the two reactions share a common rate-determining step. In contrast, in solvents of lower ionizing power, the ratio of substitution to elimination products does depend on leaving group, and indication that the two reactions do not share a common intermediate. Instead, contact ion pairs are formed, and either the leaving group or the solvent can remove the proton to give elimination products. The formation of a contact ion pair also has an influence on the stereochemistry of the elimination.

Table 10.6
<code>Reactant            Solvent   Base      Elimination
Tert-Butyl Bromide  Ethanol   NaOEt     100.00%
Tert-Butyl Bromide  Acetone   NBu4Cl    96.00%
isopropyl Bromide   Ethanol   NaOEt     75.00%
isopropyl Bromide   Acetone   NBu4Cl    0.00%
Ethyl Bromide       Ethanol   NaOEt     9.00%
Ethyl Bromide       Acetone   NBu4Cl    0.00%
</code>


How to set up a reminder for something of which I don't know when its going to happen?

Question: Assume I have to go from place A to B and bring something with me, but I don't know when it will be. I'll have to take the train, but I have a season ticket, so I don't specially need to buy one. I can basically step out the door and leave for B. How would an app work, that recognizes that now I'm leaving for B and then remind me that I should bring the item?
Comment: It's possible for an app to use GPS to guess where you're going. But it can only determine you're going to B at the point where the route to B diverts from all your other routes.  For example if you live in A, and you work in C which is halfway between A and B, your app won't indicate anything until you've passed C on your way to B. But then it's way too late to remind you you should bring your item.
Answer: One thing that works pretty well for me is putting something on/in in something else I cannot leave without : wrap a list of things around your train ticket; lock the door from inside and put the key next to the object not to forget, put a thing in your shoes...
Even better, as suggested by @papakias, you could stick a post-it on your smartphone.
Comment: A yellow sticker on the inside of the door.
Comment: Or on your mobile phone
Comment: @papakias I'll edit it in.
Answer: I don't know how an app (or anything else) could know where I'm going when I step out the door, unless I tell it. That's why I create documents on my computer with titles like "Packing for a Trip". Each time I travel, I open up that file and use it as a reminder of what to put in my suitcase and toiletries bag.
Unfortunately, I think what you want is something that recognizes where you are going when you leave the house. If anyone can provide an answer that addresses that, I'll give them a big upvote!
Comment: Actuall there are apps that know exactly where and what you are doing. [Google Now](https://en.wikipedia.org/wiki/Google_Now) is well known example. Actually most of applications you are using in your smartphone tries to do that, some of them with pretty [scarry results](https://www.businessesgrow.com/2016/12/06/big-data-case-studies/)
Comment: How would an app know where I am heading when I leave the house, if I don't tell it? The OP's question is asking about an event that can't be put on a calendar because he/she doesn't know when that event will happen.
Answer: The way I deal with similar cases, is by adding a periodic reminder. If the event is likely to happen in months, I set a monthly reminder (remember to pack x and y, if you are doing z this month). If it is possible to happen in weeks, I set a weekly reminder. Yes, sometimes the reminder is annoying, but it keeps me aware there are pending things to prepare/do before I carry out the action.
Answer: Attach your train pass and or keys to the object every time you come home so that you are forced to decide NOT to take it with you when you go elsewhere.
Answer: Fully automatic solutions require mindreading, and we're not that advanced yet. So there has to be a manual step.
At the start of each week, I create a plan for that week: what projects do I work on, do I need to travel anywhere?
That would be a good moment to include the reminder "if I go to B, bring X".
Answer: There needs to be another way to recognize the event happening in order for anything to occur on a device.  For example, will someone call you and tell you to leave in 5 minutes?  Use a generic task/notify app to send a notification when you get a call from that number.  Use it to notify it when you get an email on another program, when you pass a certian location, or whatever way that you know you are going to be going there.  If you will go there some day after you leave a job or school or classs, then set the notification to occur at the time or location of leaving that daily or weekly event.  Otherwise, you will have to put something like "Remind me once every theee days at 2pm" until you know the time of this travel trip...   Or until you know what another digital or location-based event will be required to happen first, that you can now put into that generic app.


Pre-populate Google Docs form field with incremental value

Question: I have a Google Docs spreadsheet that I use to track my jobs by job number. Is it possible to have the "job number" field pre-populated with the next job number? Currently I have to open the spreadsheet to obtain the next number and then input it into the form—which defeats the purpose.
Answer: Is there a reason you can't use the row number as the "job number"
Each Google Form submission is added on its own line, so each row of the spreadsheet should be a separate entry by the user.
If you really need to number your jobs outside of the scope of the row numbering, then you can also do this inside the Form without altering the Form itself.

Go to your Form responses (the spreadsheet that has recorded the input)
Insert a column on the left or right of the entire dataset and title the column "Job number"
Prepopulate the column with job number IDs and then use those to reference the job.

Note: when adding or inserting columns to your Form responses, you can only add columns, NOT reorder them. If you try to reorder the columns, you will break the logic of the Form (you will be presented with a warning message to proceed)