Shortest path from $s$ to $v$ in unweighted simple directed graphs

Question: Let $G=(V,E)$ be an unweighted simple directed graph. Some of the edges are colored red. Let $E'⊆E$ denote the set of red edges. Given a vertex $s∈V$,suggest an efficient algorithm for finding the length of a shortest path from $s$ to every other vertex in the graph, fulfilling the following condition: the path includes at most two red edges. In other words, every $v∈V$ should be labeled with the length of a shortest path from $s$ to $v$ in which there are at most two edges from $E'$ and any number of edges from $E\backslash E'$.
Answer: Create a new graph $G' = (W,F)$ as follows:

For every every $v\in V$, create three vertices $v_0,v_1,v_2$ in $W$. The index $i$ in $v_i$ represents the fact that any path to this vertex uses exactly $i$ red edges.
For every edge $(u,v)\in E\setminus E'$, create the edges $(u_0,v_0)$, $(u_1,v_1)$ and $(u_2,v_2)$ in $F$.
For every edge $(u,v)\in E'$, create the edges $(u_0,v_1)$, $(u_1,v_2)$ in $F$.

Now you just have to compute the length of the shortest path from $s_0$ to any other vertex in your new graph $G'$ (if the vertex is unreachable then let this distance be $+\infty$). The length of the corresponding shortest path from $s$ to $v$ in $G$ is then the minimum of the lengths to $v_0,v_1$ and $v_2$.
Answer: The problem you posted is a single source shortest-path which given a graph G(V, E) and a designated vertex $s\in V$, requires computing the shortest path from $s$ to all vertices $v\in V$ where the cost of a path $\omega(\pi)$ is defined as the sum of all edge costs in $\pi$.
For this specific problem in particular, I would highly recommend a straight application of Dijkstra's algorithm. Indeed, there is no need to replicate vertices and the problem can be optimally solved over the original graph without modifications. There is, however, a subtle question to take into account ...
There are two necessary modifications over the original implementation of Dijkstra's algorithm (here I'm referring to the implementation in the link given above under section "Practical optimizations and infinite graphs"):

For each vertex generated, keep track of the number of red edges that were taken in the path from $s$ to it. If a descendant is generated with a number of red edges that exceeds your threshold (2 in your case) then dismiss it, i.e., instead of if n not in explored (before last line in the pseudocode referred to above) you should say if n not in explored and number(red_edges)<=2
However, duplicate detection (which is implemented in if n not in explored) is tricky here: assume you find a shortest path from $s$ to a node $v$ after expanding 2 red edges. As Dijkstra's guarantees that this is the optimal path from $s$ to $v$ you certainly accept it, but it might happen that this path can not be extended to reach another vertex $u\in V$ because it is necessary to traverse another red edge. Hence, if $v$ is found again, it should be added to OPEN (called frontier in the pseudocode) even if the new path has a greater cost if and only if the number of red edges of the new path is less than the number of red edges traversed in the optimal path. This way, if the optimal path can not be extended to reach the vertex $u$ there is a chance for this sub-optimal path to reach it.

If memory is an issue for you, then the same problem can be solved using depth-first search strategies. Let me know if you are interested in these ...
Hope this helps,
PS - As you are a new contributor let me please emphasize the following: Tassle's response is definitely right and mine ain't better than his/hers. In addition (s)he was first to provide a correct answer to your problem, so please follow his advice and do not forget to accept her/his answer as it certainly closes the question. That is typical in stack exchange and it is a way to acknowledge the contributions of unknown people.
Comment: What DFS strategy can be utilized here?
Comment: Well, if DFS is to be used, then you should only take care of the first modification as DFS does not have any duplicate detection mechanisms, i.e., just make sure you are not going through one path that already violated your constraint


Why we sometime use some values of fixed point and floating point both in dsp?

Question: I have been writing kernels for a communication dsp device, which uses cmac/cmad operation on fixed and floating point numbers. I am not very clear why both types is used in the same operation.
Comment: usually because of external requirements, or because of that's the kind of data you have, or because of numerical stability or... Well, why does one use fixed or floating point? the same applies here.
Comment: i think it depends on what parts are available to you.  if you're using a SHArC, you got both fixed and float.  if you're using a Blackfin, you got only fixed and you'll have to adapt to it.
Comment: And if you're using a mix of code from various sources, you may be bound to the types because that's what was originally assumed.
Answer: The transition from text-book math to product code can be a lot simpler with floating point than with fixed point. The latter requires some specialized knowledge that, while not rocket science, may be more common for electronic engineers or embedded engineers than computer science or math people. Simple stuff tends to be a lot simpler in floating point than in fixed point.
If you really need to know the numerical behaviour of your code (as in certain recursive algorithms), it tends to be the other way around - the «cruise control» of floating point also makes it more tedious to figure out what is actually going on, while the explicit requirements of fixed point makes the details more plain sight.
Comment: "The latter requires some specialized knowledge ..." and even if your entire staff has that knowledge, every stage has to be carefully sized to match the data type, which is tedious.  And "tedious" translates to "engineering hours", and those aren't free.
Answer: One reason would be for the difference in how the quantization error signals are generated: a fixed point quantization error is a fixed level for all inputs within the allowable range between underflow and overflow ($-2^{b-1}$ to +$2^{b-1}-1$ for example for a signed fixed precision number with $b$ bits given here as signed integers, the peak to peak error is bound to be $b$). Floating point numbers in contrast have a quantization error that is proportional to the exponent: very large floating point numbers will have a very large peak to peak error in comparison to very small floating point numbers. This can cause stability issues in applications of pole cancellation where the fixed point solution can provide an exact cancellation while the floating point solution could have a residual error. Another application of fixed point is in the way it allows overflow and underflow conditions to wrap rather than create an underflow/overflow error as in floating point. See this recent post discussion how a CIC filter needs to be implemented in fixed point for these reasons.


What is done in a workshop? How does it differ from an academic conference?

Question: I have done some research on this, but I still don't know what is carried out in a workshop. What activities are arranged? How are they different from conferences?
Comment: According to [this PHD Comics](http://www.phdcomics.com/comics.php?f=1704), you need to call it a "Workshop" if you need to pay extra ;)
Comment: Somewhat relevant: as a PhD student in France I must obtain a certain number of "training credits". If I attend something called "conference" I get no such credits, but if I attend something called "workshop" (or "summer school" or whatever) I can get some, basically regardless of the actual content of the thing I'm attending. There may be such bizarre rules elsewhere, and I wouldn't be too surprised if some funding body agreed to fund something called "X" but not "Y" regardless of the content.
Answer: The reason why it is difficult to tell what workshops are about is because it is a catch-all category that many different types of academic meeting are labelled as. To illustrate, let me give examples of the nature of some of the events that I have attended in the last two years that all use the same word "workshop" to describe themselves:

A "baby conference" attached to a full-size conference, where the small meeting simply isn't large enough to meet on its own yet.
A project meeting for researchers who are all funded by the same large grant
A planning and discussion session aimed at helping determine the direction of a field
A joint industry/academia fact-finding meeting sponsored by an industry consortium
A specialty conference attended by around 100 people
A premier conference attended by several hundred people
A working meeting by a standards development group

The length of these meetings ranged from a single afternoon to a full week. Their programs ranged from nothing but loosely structured discussion to a full-on tightly packed conference schedule.  The level of peer review ranged from non-applicable to minimal to full-on single-blind review and revision.
In short: a workshop is whatever it wants to be, and different ones serve different purposes in the academic ecosystem.
Answer: In CS subfields related to HCI and related topics of communication between users and software, a workshop is almost the same as a conference, that is, there are speakers who give talks about their papers. However, the following differences can be observed:
Organisational:

A workshop lasts just one or half a day.
A workshop is "embedded" into a conference; it doesn't take place on its own, but it takes place at the day before or after the main conference. Sometimes, conference registration includes workshop registration.
The audience tends to be much smaller. This is partially because often, several workshops are scheduled at the same time, and partially, because not all conference guests attend any workshops (especially when the workshop needs to be registered and paid for separately). In any case, it is not untypical for smaller workshops to have just a handful of attendees, each of which will present something.

Contents:

There is less of an expectation of presenting fully finished work. Work in progress, or results based on a preliminary study, are usually accepted, if not explicitly invited.
Likewise, remarks about future work can be a bit more central than in normal talks, as the workshop may prove as an opportunity to find collaborators who would like to help tackle the suggestions for future work.
While conference sessions typically feature an opportunity for questions and answers on every single paper right after each talk, workshops sometimes schedule an additional (sometimes considerable in duration) wrap-up discussion that is supposed to provide some time for discussing everything that was presented during the workshop, identifying common issues and chances, and possibly developing ideas for further work together.
Answer: Sometimes, a workshop is just a conference, but the organizers decided to call it a workshop instead for one reason or another.
So while a lot of people will have some idea of what the difference should be, in practice the difference can be non-existent, so one will need to look at the details of each individual conference or workshop to decide which will be of interest.
(Note that my entire experience is from mathematics, so it might be different in other fields).
Comment: It is also my experiences from genetics that workshops and conferences can be indistinguishable. But I will add that workshops (might be) are more directed on concrete tools/methods at hand (albeit no practical training is done), while conferences stretches a bit further into the future with more focus on results and findings.
Comment: I generally agree, but I would add that the term "workshop" suggests an opportunity for learning around a specific theme.  For instance, a general AMS meetings with sessions on many different topics is rightly not called a workshop (though, as I recall, there may be specialized workshops as part of the Joint Math Meetings--at the least there are mini-courses).
Comment: @Kimball Right, but that is called a meeting rather than a conference. I have attended events that were practically identical apart from the speakers, but one was called a conference and the other a workshop.
Comment: Good point, the word "conference" is not officially in the title, though people do still use the word "conference" to refer to it sometimes, whereas no one would call it a workshop.  When I wrote that, I was trying to think of large conferences that could not be called workshops, and the Joint Meetings was the first thing that came to mind.
Answer: A workshop is designed to teach something or develop a specific skill while an academic conference is about presenting original research and getting feedback from peers. A workshop doesn't necessarily have to present original research; it is directed more towards teaching and learning in an interactive environment. Active participation from attendees is encouraged in a workshop, and small activities are often conducted to keep the participants engaged.
Comment: Could you specify your field? Because as can be seen from other answers, this is not a universal thing.
Comment: My field is Scholarly Communications.
Answer: Most workshops are there to teach you a skill, or set of skills. While a conference is mostly about passively listening to talks and reading posters, in a workshop you are actively engaged in doing something.
This can be learning a new piece of software, learning a mathematical method, how to use a specific machinery or an instrument, etc. There are also going to be talks about the subject: theory, applications and possible more.
Not all workshops are like that - I've been in a one day "workshop" where all we did was sit in a lecture hall listening to people talk about a common topic. In an ideal workshop you would hopefully be actively doing something.
Also, in conferences you are usually able (and expected) to present something, be it a talk or a poster. In workshop this is rarely the case, and the agenda is predetermined.
Comment: Could you clarify "in workshops (...) the agenda is predetermined", please? While it is true that many attendees of conferences (sometimes even most?) have at least one work to present, in my field, conference agendas are very much predetermined and everyone who presents something can find the exact time and location of the session they present in several weeks in advance.
Answer: A conference literally means "bring together" so it's just a big meeting of people. In professional life, a conference usually means going to presentations and meeting colleagues. Academic conferences usually mean that you write a paper and receive feedback to make it more publishable.
A workshop can be a conference (because it also "brings together") but as the name implies, it is about using a space as a place to build something hands-on. In the academic case, this typically means new research skills, improving papers, building knowledge and inevitably defending a research position because academics like to fight over ideas and theories. The upshot is that because you are building rather than presenting, it is quite common to see papers in very draft mode or even just some data looking for ideas on analysis. You are meant to help people learn by working collaboratively.
Other "conferences" include:

A Symposium is based on Greek drinking parties, but usually means a number of people try to answer a common question (drinking comes later). It is popular in the humanities.
Colloquium/Seminar is mostly an opportunity to discuss a topic.
A panel is a series of speeches, often moderated by a master of ceremonies.
A "camp" uses Open Space technology to moderate informal sessions about just about anything under a common theme.
A "hackathon" in the academic world usually involves trying to come up with a research question and a way to answer it in a short period of time.
A roundtable involves different experts all having equal time to discuss a particular topic.

Other ideas and definitions about types of conferences are available online as well.
Good luck!
Answer: A Workshop is as the name suggests a shop where we work to produce some products. Here the participants are workers, the methodology used like presentation of papers, question answer sessions, group discussions, debates, group and individual problem solving sessions are the tools/machinery in a workshop. The theme proposed by the organisers is the raw-material and the recommendations/models and answers arrived at is the finished product.
Col SK Mahapatra
Comment: A lot of workshops that I've participated in don't really have any intended products...


Regular languages, automata

Question: I want to ask about the definition of regular languages. My book says there has to exist a deterministic finite automaton that recognizes it. Does this mean the finite automaton recognizes exactly this language and nothing else or it can recognize possibly some other words not in the language?
Answer: It means the automaton recognizes exactly it. in fact, you can even build an automaton that accepts every word (try to do it yourself), so there would be no meaning in the other definition
Answer: You can think of it as of a correct implementation of an algorithm in different programming languages. No matter which implementation you choose they all do exactly the same thing described by the algorithm.
Regular expressions or deterministic  finite automata are just two different "programming languages" for implementing a regular language. If an automaton imlements the language correctly, it will recognize exactly the same set of words that are in the language.

Regular languages, automata


Pi Zero Cluster with Lan over Usb

Question: I want to buy some Pi Zeros and build a cluster. I wanted to ask if i add an Ethernet port through a mini-USB to Usb OTG Adapter and a RJ45 Adapter, then the Pi Zero would function like the standard Raspberry Pi?  So that i could use adapt an tutorial of the standard version to the Pi Zero ?
Answer:
I want to buy some Pi Zeros and build a cluster.

This may take some time, as a quick search implies to me that even the non-wifi version is still hard to get -- some distributors are currently out of stock, and most or all of them will limit you to buying one per order.  Meaning you would have to pay shipping separately for each pi.

I wanted to ask if i add an Ethernet port through a mini-USB to Usb OTG Adapter and a RJ45 Adapter, then the Pi Zero would function like the standard Raspberry Pi?

The processor is the same as the B+, albeit stamped with a higher frequency, and I believe inferior power regulation on the 5V rail, which has some consequences for USB (don't expect it to power much).  It also has the awkward "mini" (not micro) HDMI jack for which you will need an adapter if you need to debug something using a local display.  Which you will.
In the end you are not going to save anything much (taking shipping issues into account, you will pay more) -- if you pay $5 for the pi, $2 for the OTG adapter, and $10 for the ethernet adapter, you are almost halfway to the $40-$50 you would pay for a Pi 3, which has 4 (faster) cores and built in ethernet.  So in fact using zeros you would end up spending twice as much for the same processing power, and have to put up with all the hassles that come with the oddball form factor.
That's without taking into account what I mentioned about per unit shipping costs, vs. no such restriction on the Pi 3.
Comment: @FilipeRamalho you should identify the scope of your project. If it is for interest/learning then a cluster of 2 or 3 is enough to learn and the price difference between Pi0 and Pi3 is small. If you have an actual real-world problem and need hundreds or  thousands of them...  you should contact Raspberry Pi Foundation or major distributor to discuss volume pricing. You always have the option to wait  for zero to be more widely available.
Comment: Is there any other to "construct" cluster, because with the pi3 i would have to multiple of them and that would be "expensive" (Parantheses, because it is cheap compared to other stuff, but it would go over what i wanted to pay for first)
Comment: To re-emphasize an important point: I think you are assuming you can just order a box of Pi Zeros from somewhere at $5 each plus shipping for the entire box.  If that is *not* true, and the shipping cost per unit is *more than the price of the pi*, then probably you need to re-evaluate.  If it turns out you can order that box, great -- but I doubt it.
Comment: Time isn't a problem, i can buy it even in a year. The scope is mostly learning, a bit of real work, but that doesn't need even a full Pi3
Comment: I'm not trying to upsell you or anything, but IMO the zero is the worst choice for someone new to the Pi. If you already have a substantial linux background, things are considerably easier, but the Pi 3 is still the easiest choice.  None of them are very fast, but the Pi 3 is obviously the fastest, and it is reasonably priced. Taking into account the restrictions on distribution and need for various adapters the zero, OTOH, is a waste of money.  Honestly.
Comment: *But*, the basic answer to the question is yes you could use it for that.  They all can run the same software.

Pi Zero Cluster with Lan over Usb


Can I use brown sugar instead of white sugar in making fruitcake?

Question: Can I substitute light or dark brown sugar instead of white sugar in making fruitcake?
Comment: Almost certainly, yes.  The problem is, you will end up with a fruit cake :-)   Sorry, I had to.  You will have slightly more of a molasses edge, and more tendency to retain moisture, but that is probably in the noise.   Especially if large amounts of rum or bourbon are involved at any point.  If you want a precise answer, you will want to post your recipe as there are a broad range of fruit cake styles and recipes.  But no matter which one, you still end up with a fruit cake.  Arghhh! Can't stop!
Comment: Why so much hatred for fruit cake? I love fruit cake :)
Comment: All the fruit cakes I've ever made had brown sugar in the recipe anyway! And frequently black treacle as well. I like the dark ones.
Answer: When substituting brown sugar for white sugar, be mindful if you are measuring by volume. Brown sugar packs down a lot and you may end up using more (by mass) sugar than you intended.
Your cake will be tasty. You may notice a slight texture difference, but it should be fine.
Alas, it will still be a fruitcake.
Answer: It'll be fine as long as you're cool with the molasses flavor.
Answer: In addition to the slightly "darker" flavor, you should expect the result to be more moist than with ordinary sugar. You may find you'll need to reduce the moisture in the recipe, or cook it longer.


Issue using google-map polymer element multiple times in same page

Question: We are trying use google-map element from Iron Elements.
<google-map latitude="37.77493" longitude="-122.41942" api-key="XXXXX" version="3.exp" libraries="places" >    </google-map>

We are trying to load it dynamic/via ajax load. We are facing the issue regarding load of maps api multiple times. We realized its same issue when we use multiple instances of google-map element in same page.

You have included the Google Maps API multiple times on this page.
  This may cause unexpected errors.

Is there a workaround from this issue?
Edit:
google-maps-api element states:

Any number of components can use <google-maps-api> elements, and the
  library will only be loaded once.

If this is happening, I hope we should not face multiple load issue.
Comment: It's worked fine for me in the past. Please elaborate on "We are trying to load it dynamic/via ajax load." And perhaps include more of a code sample.
Comment: I the google map element is part of html which is loaded via javascript. It loads multiple in part of page.
Answer: This is a known issue with the google maps component. There is a workaround: you have to define the same libraries attribute to each  element you use.
https://github.com/GoogleWebComponents/google-streetview-pano/issues/15


RCD 310 : are steering wheel controls resistant?

Question: I want to change my RCD 310 (VW Passat CC 2011) by Android Device. Everything is working except steering wheel controls. I know that in some number of cars steering wheel control is working with rheostat. So there are two wires, say mass-wire (usually minus) and control-wire. The rheostat is placed into the wheel and these two wires connected to the device. So the device measure the resistance in this electrical circuit and make a decision about which button is pressed or nothing. But in the Internet I can't find whether RCD 310 have rheostat-technology or may be some other tech. By this PINs (see the picture) I can't determine it and even it's true I can't determine where is control-wire. Please help!)
Answer: Not sure what references you have regarding the "rheostat" device..
On these cars the steering wheel is connected to the Infotainment databus (a CANbus) and the stereo is also connected to the Infotainment CANbus on pins 9/10 (CAN high/low).
You'll need to check if you have connected the android head unit's CANbus connection, or if even it is compatible.
Update: The unit is compatible and even refers to "steering wheel control". This is connected to the car via the quad lock connector, pins 9-10. Very common across the VW/Audi range. So I am quite sure on this. The steering wheel sends messages on the databus with a certain address and the relevant button press data.
You need to trace the wires from those pins and make sure you have the wires connected up. Outside of that, engage the product support because it should 'just work'
Comment: This one) http://s.aliexpress.com/qQrINryi


How to prove you are a resident of a particular state

Question: I have 2 residences one in TX and the other in North eastern state. Our primary residence is in Texas where we spend more than 6 months.
The NE state has asked us why we are not filing taxes in that state. We told them that we live in TX.
What documents are needed to prove that? We have Driver's Licenses and Property Tax documents. I am sure thousands of people do this.
Comment: TX does not have income tax!
Comment: You have TX income tax returns? (Note that either way, you still generally have to file property taxes wherever the property is.)
Answer: You can easily prove your residence by showing power bills, water bills, etc with your name on it, but it might make no difference:
Many states require you to file and pay taxes if you have income while you are in the state, starting from 30 days in the year. This applies to business travellers even.
As a consequence, if you spend more than 30 days there, you might owe taxes there. Worst case, if you are on the road a lot, you could owe state tax in up to 12 states (for the same income!), unless they specifically have agreements to recognize already paid taxes. Welcome to independent state tax laws.
Comment: I wish that were true - if you are physically present in state XX, and you receive salary or pension in TX, it counts as _income in state XX_. That's what our HR teaches us. Feel free to not believe it, or ask your CPA.
Comment: Aganju. The important point is that if I did not earn any income in the state of non primary residence then I am not obligated to file a tax return. I earned all my income in TX. But the other state wants me to send them proof of residency.
Comment: @DEEM: What exactly do you mean by "I earned all my income in TX"?  Do you mean your employer's headquarters are located in TX?  Do you mean you were physically located in TX while you did all the work for which you were paid?
Comment: The income from 2 sources. One from my own LLC registered in TX and the other from my savings and investments
Comment: Aganju. My non resident state web site says you are required to file and pay state income tax only if you are a Primary resident  or  you have earned income in that state. Thousands of people have vacation homes all across US but they do not pay taxes in those states, do they? How about Time Share? How about just visiting  state more than a few weeks? As part of the company busness employees go visit other states for weeks at a time. I did that. In one particular year I visted AZ many times with a total stay exceeding 2 months. Did not pay taxes there. Was not required to,
Comment: @deem Actually if your employer sends you to another state to work, even if its just a few hours, they will require income tax.  Maybe only on the portion of income earned in the state, but they'll want it.
Comment: @deem also it seems odd az wouldn't expect nonresidents to pay income tax but still create forms for it https://www.azdor.gov/Forms/Individual.aspx
Comment: After doing research and talking to professionals (Tax experts) I have found the following info: 1   You only pay income taxes to the state where you have established "domicile" or primary residence as evidenced by Drivers Lic, Property, Voter registration, Utility bills etc.  2 If you earn income in a non domicile state then you pay them their share of IT as a non resident. 3  The income you earned exclusively in your domicile state is in most cases not taxed by the non resident state.
Answer: First a couple of items.
If a state knows about you, they will be interested in connecting your income to their state. If they can establish that you are a resident of their state they may even be able claim income you earn in another state. Many times two neighboring states will have a reciprocity agreement, where you only have to pay income taxes where you live. But if there is no reciprocity agreement they will give you a credit for the income you pay tax you pay to the other state. For you unidentified state X and Texas are involved. The unidentified state will be more than happy to credit you the $0 income taxes you will pay to Texas and then collect the rest.
You will have to contact the unidentified state to know what proof they need. The more that you have that point to Texas the better off you will be. Drivers license, voter registration, and the fact that all your bills are sent to Texas helps. Property tax bills aren't enough because you can own property in multiple states, but live in a place you rent.
Answer: It sounds like this is a question for a CPA or an enrolled agent.  It is not a question for the internet.  State tax codes have varying understanding of what is "residence."  You can be a resident, for tax purposes, in a state where you own no land, lack a driver's license, and are only present for work due to a long but temporary contract.  Likewise, you could owe tax on income earned in another state.  For that matter, under the current version of the US tax code, your "tax home," may not be where your home is.
I wouldn't respond to the state making the request until I had spoken with a CPA, enrolled agent or tax attorney.  I can think of one state that calculates taxes due on multiple factors.  It does NOT consider residency in the legal sense that you are thinking about it; it just provides a non-resident tax form.  You could add taxes to yourself by being a non-resident.  Go visit a CPA.
Comment: In my city in TX, there are many workers who have lived in the city for decades and do not own land and probably do not have driver's licenses either.


An ohmic contact

Question: It is claimed that Schottky type of contact between low work function p-type semiconductor and higher work function metal creates an ohmic contact in which current can flow both sides almost fluently with very low resistance. It is also claimed that electrons have tendency to flow (when no potential is applied) from low work function material to higher work function material. So, when low work function p-type semiconductor comes in contact with higher work function metal, a p-type semiconductor will not let electrons from metal enter into semiconductors and will push them back. It seems a bit counterintuitive to me, because how in this case could it be an ohmic contact? Doesn't p-type semiconductor with lower work function suppose to cause resistance when potential is applied to make electrons flow from metal to semiconductor? Furthermore, if electrons penetrate from metal to p-type semiconductor under applied potential, doesn't they suppose to recombine with holes and create a depletion zone poor for any charge carriers and further increase resistance?
Answer:
Doesn't p-type semiconductor with lower work function suppose to cause resistance when potential is applied to make electrons flow from metal to semiconductor?

If you apply a positive voltage to the p-type semiconductor, the holes in the semiconductor will want to flow into the metal. In this case, there isn't any barrier potential, since the electric field induced by diffusion opposes the flow of electrons into the metal, not holes, and thus the holes can flow freely. In the opposite case, where a negative voltage is applied to the semiconductor, the holes flow from metal to semiconductor and have to overcome the difference between the valence band energy and the fermi level, but this is small since the semiconductor is heavily p-type. This has the effect of making an Ohmic contact.

Furthermore, if electrons penetrate from metal to p-type semiconductor under applied potential, doesn't they suppose to recombine with holes and create a depletion zone poor for any charge carriers and further increase resistance?

When electrons leave the p-type semiconductor they don't leave behind ions because the p-type semiconductor is doped with acceptor ions. Instead, they leave behind a surface charge of mobile holes. This also induces a surface charge in the metal, which creates an electric field that opposes diffusion current. This causes band bending to match the fermi-levels of both materials. This happens as soon as the two materials make contact, and an applied potential isn't necessary.
Answer: 1) How electron holes can enter a metal? Does it mean that all the metals are hole conductors? Typicaly it is claimed that only some metals (for example bivalent metals) can conduct holes because they have energy overlap between s and p orbitals. What about monovalent metals such as Lithium and Sodium? There seem to be no such overlap in these metals. How can you inject a holes in the metal if it doesn't conduct holes?
2) If work function of P-type semiconductor is lower than that of a metal it contacts, it means that electrons will flow from semiconductor to metal when no potential is applied and recombination is energetically unfavorable. Does it mean there is some treshold potential you need to apply over which electrons start to fly from metal to semiconductor? For example, if work function of a metal is 2 eV higher than that of a P-type semiconductor, how many Volts do you need to make electrons flow from metal to semiconductor (what is energetically unfavorable under normal conditions)?
Answer: A conventional example tells that when two pieces of metal come in contact, electrons will flow from the metal with lower work function to the metal with higher work function until the later will get negative charge and the electron flow will stop. In my understanding it is assumed that electron holes (positive charge carriers) take no significant role in this process.
But what if we will bring in contact a two pieces of an intrinsic (UN-doped) semiconductors with sufficient difference in work functions? Electrons will start to flow from a semiconductor A (with lower work function) to semiconductor B (with higher work function). But if semiconductor B will start to charge negatively doesn't it mean that the holes suppose start to flow in the same direction been attracted by charge imbalance? If yes, how long will this process of the electrons and the holes flow will continue and will there be a principal difference from two metals brought in contact?

An ohmic contact


XNA Platformer Collision: PerPixel vs Rectangle

Question: I'm writing a platformer engine with XNA and was wondering what method for handling collisions I should use. Would I be seeing some performance issues if I were to try and have PerPixel collisions? Should I be using per pixel collision handling or rectangle collision handling?
Answer: In general, per pixel collision detection is much more expensive; so as much as possible, use rectangle collision handling. (Even for per-pixel, use rectangles first to check for overlap.) When I implemented collision detection in Radiant Wrench, this is precisely what I used.
Alternatively, you can try Flat Red Ball (which I used to use before), which uses polygons for detection (which is quite performant). You can use basic types (rectangle/circle) or create your own polygon from verticies. They don't support per-pixel collisions though.
Comment: The golden rule of performance is "don't worry about performance until you see a bottleneck happen." You *have* to use rectangles first, there's no real alternative. Rectangle bounds checking is very very trivial (because it doesn't support rotation).
Comment: Hmmm, yes I see... Would the performance still be an issue if I used rectangles first to check for an overlap? I'm thinking maybe I will only use per pixel collision for things like attacks and maybe enemies.
Comment: No problem. Let me know if you have specific questions about collision detection later.
Comment: @ashes999 "don't worry about performance until you see a bottleneck happen." - and thats the reason why there is so much of unoptimized software when hardware is so cheap right
Comment: @Tomas right. Hardware scales easily. Also, this is why we have so much slow software -- it was "optimized" by someone who didn't know the first thing about optimization.


What do the (Pali) suttas say about "sacrifice" in general (and why it's not necessary)?

Question: Requesting sutta references mentioning "sacrifice" along with pali words commonly (and uncommonly) translated as "sacrifice" along with thoughts and commentary please
Comment: Found this: There are some ascetics and brahmins who have this doctrine and view:
'Purity comes from sacrifice.'
But it's not easy to find a sacrifice that I haven't previously offered in all this long time, when I was an anointed aristocratic king or a well-to-do brahmin. via https://suttacentral.net/mn12/en/sujato?layout=plain&reference=none&notes=sidenotes&highlight=false&script=latin
Comment: "Master Gotama, we brahmins sacrifice and enjoin others to offer sacrifices. Now both one who himself sacrifices and one who enjoins others to offer sacrifices engage in a meritorious practice that extends to many people, that is, one based on sacrifice. But one who leaves his family and goes forth from the household life into homelessness tames only himself, calms only himself, and leads to nibbāna only himself. In such a case, he engages in a meritorious practice that extends to only one person, that is, one based on going forth." Then the answer via: https://suttacentral.net/an3.60/en/bodhi
Answer: The Buddha discouraged animal sacrifice, human sacrifice, and other extra extravagant ritualistic sacrifices (soma juice drinking etc.), of which I quoted only part of the sutta of AN 4.39 below.
The Buddha however praised non-violent sacrifices, which I think refers to giving gifts (or contributing necessities) to family members.
Based on the dictionary entry given below for "yañña" (sacrifice), it seems like this term is used both for animal sacrifices and charity.
A similar teaching is given in SN 3.9.

"Does Master Gotama praise sacrifice (yañña)?"
"Brahmin, I don't praise all sacrifices. Nor do I criticize all
sacrifices. Take the kind of sacrifice where cattle, goats and sheep,
chickens and pigs, and various kinds of creatures are slaughtered. I
criticize that kind of violent sacrifice. Why is that? Because neither
perfected ones nor those who are on the path to perfection will attend
such a violent sacrifice.
But take the kind of sacrifice where cattle, goats and sheep, chickens
and pigs, and various kinds of creatures are not slaughtered. I praise
that kind of non-violent sacrifice; for example, a regular gift as an
ongoing family sacrifice. Why is that? Because perfected ones and
those who are on the path to perfection will attend such a non-violent
sacrifice.
AN 4.39

From the PTS Pali-English dictionary entry on "yañña":

Yañña Yañña [Vedic yajña, fr. yaj: see yajati. The metric reading in the Veda is sometimes yajana, which we are inclined to look upon as
not being the source of the P. yajana] 1. a brahmanic sacrifice. — 2.
almsgiving, charity, a gift to the Sangha or a bhikkhu. The brahmanic
ritual of Vedic times has been given a changed and deeper meaning.
Buddhism has discarded the outward and cruel form and has widened its
sphere by changing its participant, its object as well as the means
and ways of "offering," so that the yañña now consists entirely in a
worthy application of a worthy gift to a worthy applicant.

The Buddha also taught to not sacrifice one's own welfare for others in Dhp 166. The commentary for this verse can be found here. Please also read this answer.

Let one not neglect one's own welfare for the sake of another, however
great. Clearly understanding one's own welfare, let one be intent upon
the good.
Dhp 166
Comment: The link to the Dhp-verses on The Self is really good, thanks.
Comment: The phrase "for example, a regular gift as an ongoing family sacrifice" is intriguing. What does it refer to?
Comment: Yes, what actually happened at a non-violent "ongoing family sacrifice" involving animals? Were they given to someone?
Comment: Also, are there other examples of non-violent sacrifices other than SN 3.9 and AN 4.39?


What is this wiry plant with thin leaves and white flowers that turn pink in spring?

Question: I think it's a type of shrub, but I was told it's a white poinsettia plant. It's very wiry and has green leaves all year round except for winter and spring. The white flowers come in during the winter and the leaves begin to fall off. When spring comes the white flowers turn pink. Some people keep them as bushes, but I've seen people grow them as trees that are 15-20 feet high.
Comment: "white poinsettia" because the large white "things" are bracts and not petals. (the true flower is the small daisy like flower in the center)
Comment: Whatever it is, its definitely NOT a poinsettia! https://www.rhs.org.uk/advice/profile?pid=146
Answer: I think Giacomo Catenazzi is right that some people may call this plant a "white poinsettia" because of its structural similarity to a poinsettia (the showy bracts surrounding the small true flowers in the center).
Additionally, from your photo, the leaves look like they might have a texture something like poinsettia leaves.
I was able to find a photo at "Proven Winners" Plant Nursery of what they call "Diamond Delight® Euphorbia hybrid". It looks a lot like your plant, and is in the same genus as poinsettias (namely "Euphorbia").

TopTropicals.com also has a picture of another Euphorbia that looks very much like your plant. This one is called Euphorbia leucocephala, and it even has those reddish stems:

I think your plant is a Euphorbia and pretty closely related to these two. I can see why someone might call your shrub a "white poinsettia", but it is a confusing name for it since regular poinsettias do also come in white. What people usually mean by "white poinsettias" look just like the Christmassy poinsettias we are used to with the large pointy jagged bracts, but white instead of red.


Why sorting is needed for Meet-in-the-middle attack

Question: The weakness of double DES, E (k1, E(k2, M)) is that Meet-in-the-middle attack is possible. When performing Meet-in-the-middle attack, we first need to build the table with the first column all the possible keys and the second column all the encryption with these keys, then second step is sorting the second column, why do we need to sort the second column? What do we base on when performing the sorting?
Answer: That's an optimization for the attack. It would work without it, but slower.
To do a Meet-in-the-middle attack, we need to encrypt a known plaintext with every possible key and save the resulting text (with the used key) in a list. Now we decrypt a known ciphertext with every possible key and look if we got the resulting text in our list.
We want to know the key for a specific ciphertext. Searching for a specific value in an unordered list is quite hard: We need to look at every single entry and see if it is what we search. That takes (on average) $\frac{n}{2}$ attempts (with $n$ = the key space of the algorithm, for DES it is $2^{56}$).
If we sort the resulting list before we do the decryption we can use the Binary Search. This reduces the search attempts to ca. $\log_2(n)$ (n = the keyspace). That's only 56 for DES, much less than with an unsorted list.
Small note: We sort the column with the key at the same time as we sort the column with the ciphertext. For example, the first key will be the key for the first ciphertext.
Comment: Small note: In practice, you probably wouldn't use a binary search, but rather you'd sort *both* sets and run a [list merge](http://en.wikipedia.org/wiki/Merge_algorithm) on them. In any case, though, you still end up doing about $O(n \log n)$ comparisons; without sorting, that would be $O(n^2)$, which is no more efficient than brute force.
Comment: @IlmariKaronen: Minor note: we can do rather better than $O(n \log n)$ comparisons (!); the data we're sorting on is uniformly distributed, and for data like that, approaches such as radix sorting have better asymptotic complexity.
Comment: @IlmariKaronen: I don't know how that works, so I can't insert it into my answer. Feel free to edit it, if you want.


Concept of Utility in demand systems

Question: I have seen that researchers use different utility function in demand systems estimation such as Stone Geary. What is the role of these utility functions? What are utility function other than stone Geary?
Comment: For examples of standard utility functions used in introductory courses see https://economics.stackexchange.com/questions/41980/utility-function-for-introductory-microeconomics, that should at least partly answer the second part of your question.
Comment: Utility function encode the preferences of economic agents so market basket $x_1$ is (weakly) preferred to market baske $x_2$ if and only if $U(x_1) \geq U(x_2)$ where $U$ is the utility function.
Answer: The utility function taken for estimating demand systems depends on several parameters:

The nature of theoretical models and definitions of the variables used in these models are quite different from the nature of data that is available to us for estimation. Standard microeconomic theory tells us that demand is obtained as a result of some form of utility maximization. Naturally, therefore, the structure of demand function would depend heavily on the structure of utility function used to specify the consumer's preferences. Therefore, when we are trying to estimate a demand system, we look at the data we have at hand and the structure of the data, the variables available etc. give us an idea of what kind of demand system would be suitable, and hence, what kind of utility function we should start with.

Sometimes, the nature of analysis we would like to conduct can only be done only with a particular demand system. And therefore, it is natural to start with a utility specification that yields that particular demand system. On other occasions, we might just want to "keep things easy" and therefore choose utility functions which yield "tractable" demand functions.  Stone-Geary is a good example of this. Stone Geary utility function yields what is known as the "linear expenditure systems". The analysis can then be carried out in terms of "product-wise expenditures", which is usually what is available to us in the form of data. CES-utility function is another such example.

Aggregation is also an important consideration. We might want aggregate the demand system and be able to say something about the properties of a more macro kind of economic entity. In that case, we don't really have many options, since aggregation requires very strict requirements. We then stick to some usual homothetic utility function (like Cobb-Douglas or Stone-Geary).

Finally, there are demand systems which have all the above listed nice properties. This is indeed what is usually done these days. Deaton and Muellbauer's (Linear/Quadratic - approximated) Almost Ideal Demand System (AIDS) is the state of the art demand system, inspired by the work of Stone and Geary on expenditure systems, as well as Gorman's work on aggregation. It's "easy" to estimate, requires lesser assumptions, has nice(est) aggregation properties, and can be made to fit usually available household-level survey data.

Hope it helps.

Concept of Utility in demand systems


How common were (are?) hydraulically driven fuel pumps?

Question: The XB-70 had a large number of fuel transfer pumps (something like 25) to transfer fuel from the 10 other tanks into the sump tank, and then three fuel "boost" pumps to pump it from that to the engines. These were hydraulically driven pumps. I.e. it was the hydraulic pressure in the corresponding hydraulic system that caused such a fuel pump to do its work. How common was that back in the days? Do such pumps exist on any current aircraft?
Answer: Not common in commercial aircraft.
For this comparative analysis I used a DOT/FAA study titled Commercial Aircraft Airframe Fuel Systems Survey and Analysis by P. G. Weitz.
Searching the whole document, I found only one other aircraft with hydraulically-driven fuel pumps; of 32 fuel pumps, two were hydraulically-driven on Concorde.

Thirty electrically driven centrifugal pumps and 2 hydraulically driven centrifugal pumps are supplied. Twelve of these run continuously and up to 18 are running during portions of the flight. The pumps have flow ratings of 2000 gal/hr to 12,000 gal/hr. No ejector pumps are used on this aircraft. [Weitz, p. 5-7]

Checking Concorde's flight manual, both pumps were transfer pumps in the aft tank (no. 11), and each was powered by a different hydraulic system; they were alongside two electrically-driven pumps for a total of four in tank 11.
The flight manual does not explain the reasoning, but another question here may shed some light on it: Could the Olympus 593 have been windmill-restarted during supersonic flight?
In an all-engine flame-out in supersonic flight, hydraulic-driven emergency power generation is used, and fuel is pumped forward from tank 11 to counteract the ensuing forward shift of lift as the plane goes subsonic. Since the engines will be windmilling, the IDGs may not provide the needed electrical output, whereas hydraulic pressure from at least the stored pressure in the hydraulic reservoirs will help provide the remaining necessary pumping power, at least until subsonic CG-trim is achieved for a worst-case scenario of gliding with no re-light.
Subsonic airplanes do not have this critical requirement of pumping fuel forward, which may explain why they are not common.
Comment: @JohnK Can RAT be used at supersonic speed?
Comment: @user3528438 At supersonic speeds, flamed out engines on Concorde would still produce full electrical power from windmilling down to around mach 1.1 and hydraulic power down to mach 0.7.  The RAT was designed for subsonic deployment when windmilling was no longer effective.  I recall a story about a concorde RAT being accidentally deployed at mach 2 (and surviving, seemingly ok) but don't have a reference handy.
Comment: I think the reason two fuel pumps were hydraulic was that the RAT drove two emergency hydraulic pumps to power the Green and Yellow hydraulic systems in an all-engine-out situation.
Answer: Not common, no:

The pumps mentioned in OP are fuel transfer pumps, necessary for the shift of Mean Aerodynamic Centre in supersonic flight. Subsonic aeroplanes do not require fuel transfer in longitudinal direction.1

A hydraulically driven fuel pump is subject to failures in the pump itself, plus failures in the hydraulic system driving it: leaks, dirty filters, burst pipes etc. Meaning an exponential increase in chance of failure of the hydraulically driven fuel pump.

So no, hydraulically driven fuel transfer pumps are not common. By way of comparison: the B737 has fuel pumps that are mechanically driven by the engines, plus AC driven electric pumps and gravity transfer to the centre tank as a backup option.
1 The A380 has a fuel trim tank in the horizontal stabiliser, if the transfer pumps fail fuel can be transferred back into the main tank via gravity.
Comment: The usage of horizontal stabiliser fuel trim tank dates is a classical on Airbus long-range models, at is was present on [Airbus A330/A340](https://aviation.stackexchange.com/questions/30400/will-optimising-the-weight-distribution-of-a-commercial-flight-save-fuel). Such a tank is also present on [at least on Boeing 747-400](https://www.boeing.com/commercial/aeromagazine/aero_09/figures_textonly/fuel_fig01_02.html)
Comment: @Tootea It's the shift in MAC that necessitates pumping fuel around in supersonic aeroplanes, not possible to trim it away, the CoG needs to shift accordingly.
Comment: The first Airbus with a trim tank was the A310. It then went on the A300-600 and as mentioned the A330/A340. The A350 does not. The MD-11 also has a trim tank.
Comment: (Also the fuel boost pumps in the XB-70, that pumped fuel from the "sump" tank to the engines, were hydraulically driven, although the snippet in my screenshot doesn't mention those.)
Comment: I suspect that even with the fuel trim tank inoperable in any way (full/empty), the stabiliser of an ordinary airliner is more than strong enough to compensate and keep the aircraft trimmed. Deltas like the XB-70 or the Concorde have no such redundancy.


Are there any academic articles on how people handle their passwords?

Question: Are there any academic articles on how people handle their passwords - how many they use in total, how often they change it, whether they commonly store it somewhere or just remember them and so forth?
Answer: Microsoft Research: A large scale study on password habits
http://research.microsoft.com/apps/pubs/?id=74164
Or google "password user habits" for examples.
Answer: This is not exactly about password management, it focuses on password creation. I thought that you could find it useful anyway: http://www.imperva.com/docs/WP_Consumer_Password_Worst_Practices.pdf
Answer: There is quite a lot of academic work in the area of password selection, prominent papers include:
Yan et al 2000,  Kuo et al 2006 and Bonneau and Preibusch 2010
Joseph Bonneau from Cambridge University has done a lot of work in this area including the final paper above and
http://www.cl.cam.ac.uk/~jcb82/doc/BS12-USEC-passphrase_linguistics.pdf,
he is a regular contributor to the Cambridge University Computer Laboratory Security Research blog which is a good source for papers on passwords and proposals for replacing them.
Answer: The book Security and Usability by Garfinkel and Cranor has relevant chapters from researchers in the field:

Chapter 1: Psychological Acceptability Revisited investigates the effort investment that passwords, patching etc require, and how much investment can be requested before people give up and try to subvert the system.
Chapter 6: Evaluating Authentication Mechanisms looks at the more general field of investigating the usability of authentication techniques.
Chapter 7: The Memorability and Security of Passwords is probably exactly what you want ;-)
Chapter 9: Graphical Passwords investigates that alternative.
Answer: You should probably get a good hash function and you can just store it, on a database. Because a good enough hashed password will tell you no information about your password.
Also attempted passwords you can count that, but the other information seems irrelevant imo.
Comment: The question is more about statistics on how users handle their passwords - how many of them use one password everywhere, how many of them vary it and so forth


YA book about a young girl who is kidnapped by fairy people

Question: I remember very little about this book, but I remember it featured a lot of eerie black and white pencil illustrations. I think it was about a young girl who is kidnapped by people who live under the hills. Its the story of her stay with them and how she escapes. I remember the illustration of a woman watching her from the woods. Any advice on what book this is?
Comment: When did you read it? Was it new then, or do you know when it was first published??
Comment: Was it a picture book or a novel with pictures?
Comment: If you want to thank Metamaterial girl for correctly identifying the book, mark her answer as "accepted" (click the check mark next to her answer to turn it green) so others can know that she correctly identified the book.  Both you and her will gain reputation for it.
Answer: Could it possibly be The Perilous Gard, by Elizabeth Marie Pope? The story is set in early Elizabethan England, and the main character, Kate Sutton, is given to the Old Ones after she learns of their existence. The story is based loosely on the story of Tam Lin, in which she saves her love interest from being sacrificed as a teind to the old gods. The version I have is only a paperback without illustrations, but it is a later printing; the original 1971 edition may have had pictures.
Comment: Should you return, @JenessaWillett, you can accept the answer by clicking on the checkmark beside it.
Comment: That does sound like The Perilous Gard. I have an older copy  with b&w illustrations by Richard Cuffari, one of which shows the Lady in the woods.
Comment: yes! Its the Perilous Gard! Thank you so much! I just bought the book and read it. It was amazing!


I thought my period started at sahoor,so i didn't make neeyat for the fast. Now i don't see any blood and discharge is white.Can make neeyat now and

Question: I was in doubt if my period came at sahoor. So I didnt make neeyah for the fast. Its afternoon and I don't see any blood, just the white discharge.  Can I make the neeyat now and keep the fast? Also can I pray namaz?
If yes do I need to take a shower before praying?
Comment: Actually I saw that my discharge was a bit pinkish brown in the toilet bowl, so I didn't keep the fast thinking period has arrived but now when I checked it with a tissue, it came out clean.
Comment: Salam and welcome to IslamSE the Q&A site about Islam. To learn more about our site and model consider taking our [tour] and checking our [help]. The topic of niyyah is covered on the site. What hinders you from praying and fasting if you don't see any discharge. In fact you should never base your acts on doubt. Stop fasting and praying if you see discharge not before.
Answer: For obligatory fasts you have to make the intention (niyyah) before fajr. An intention made at the beginning of Ramadan to fast for the whole month of Ramadan is also sufficient unless it's broken (by being sick, traveling, etc.), then you would need to make a new one. And what you experienced is most likely spotting before the period. So for that you can pray and fast as usual but you need to perform wudu before each salat.
Allah knows best.

Prophet (peace and blessings of Allaah be upon him) said: "Whoever does not have the intention of fasting before Fajr, there is no fast for him."

I thought my period started at sahoor,so i didn’t make neeyat for the fast. Now i don't see any blood and discharge is white.Can make neeyat now and


How to recover an ethereum account with the mnemonics ? And the other way around, namely to generate the right mnemonics from an account?

Question: No geth, or other command line tools, or clients like MetaMask and Mist. What I need is the exact algorithm to recover an account from mnemonics and the other way around.Appreciate implementations of any programming language, or just pseudo-code.
What I've already known is the algorithm to get an entropy and a seed from the mnemonics, and the algorithm to get the mnemonics from an entropy. How can I recover an account from the entropy or the seed? When an account is provided, how can I get the entropy to generate the mnemonics?
Answer: For ethereum most wallets use bip39 with 44'/60'/0'/0/0 as derivation path. You can use this tool https://github.com/iancoleman/bip39 to found the private key and seed from the mnemonics.
The other way around should be almost impossible. To go from the seed to obtain the mnemonic you need to reverse the HMAC-SHA512.


Why is stylesheet ignored if I call the "remote-page"?

Question: I'm playing around with node.js, right now. I like it a lot.
I have a weird error. If I start the test server with
node app.js

and navigate to http://localhost:3000, everything is fine. The stylesheet is loaded and everythings looks as it should. But if I navigate to the site via nginx, the site and the stylesheet is loaded, but it seems to be ignored. It's the same source-code. It parsed the same way. And I already tested, that the stylesheet is loaded properly. I really don't have an idea anymore. Anyone else?
Here is my nginx vhost-config:
server {
    listen 80;
    server_name expressapp.lc;

    root /home/matthias/Documents/webapps/expressapp/public;

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
        expires         15d;
    }

    location / {
        proxy_pass              http://127.0.0.1:3000;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        Host            $http_host;
        proxy_set_header        X-NginX-Proxy   true;
        proxy_redirect off;
    }

    gzip on;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_min_length  1000;
    gzip_disable     "MSIE [1-6]\."
    gzip_types text/plain text/css application/json application/x-javascript text/xml   application/xml application/xml+rss text/javascript;
}

Thanks for your help.
Comment: Have you tried disabling GZIP encoding?
Answer: To make things clear, you should:

remove the location section that allowing client cache.
turn off the gzip compression, e.g. comment out all the gzip staff
change the "proxy_set_header Host $http_host" to "proxy_set_header Host $host"


Creating a search box for a list (BasicTable View) - Only search that partilcar list

Question: How do you create a search box for a list in Basic Table view style? Preferably using the content editor web part or script editor.
Answer: I use this as a CEWP/Snippet occasionally when a 'search only this list' function is required.  It's like the simple list search that is default on a document library, but you can use this on lists to define a single or multiple lookup value.  It's a little old school with a 'search' and a 'clear' buttons; I'm sure someone more capable in css could tweak that.
You'll want to update the URL and Field Name values - The search is page relative, not list or library.
Get the object values for your field names from hovering over those attributed in List Settings, view in lower-left browser.
For example, if one of the site columns on my list is First Search Field, it would look like this in your browser preview area while hovering:
https://yourcompany.sharepoint.com/sites/_layouts/15/listedit.aspx?List=%7B84156346%2DBAB7%2D4FB8%2DB9B1%2DEFD5C2195901%7D&Field=First%5Fx0020%5FSearch5Fx0020%5FField"> Event Category
The bold area is the option value; the text after that defines what users will see for that value.

<code>"<script type=""text/javascript"">

function RedirectUrl() {
    var tb = document.getElementById(""tbSearch"").value;
    var cs = document.getElementById(""sfield"").value;
    var url = """";

    if (tb != """") {
        if (cs == ""Column2"" || cs == ""Column3"" || cs == ""Column4"" || cs == ""Column5"") {
            url = ""FilterField1="" + cs + ""&FilterValue1="" + tb;
            window.location.href = ""https://yourcompany.sharepoint.com/sites/pages/pagename.aspx?"" + url;
        }
        else {
            url = ""FilterName="" + cs + ""&FilterMultiValue=*"" + tb + ""*"";
            window.location.href = ""https://yourcompany.sharepoint.com/sites/pages/pagename.aspx?"" + url;
        }
    }
    else {
        return false;
    }
}
function ClearUrl() {
    window.location.href = ""https://yourcompany.sharepoint.com/sites/pages/pagename.aspx?"";
}
    </script>Search Field: <select id=""sfield"">
    <option value=""first%5Fx0020%5F search%5Fx0020%5F field"">First Search Field </option>
    <option value=""second%5Fx0020%5Fsearch%5Fx0020%5F field"">Second Search Field</option>
     </select>   Search text: <input id=""tbSearch"" type=""text""/>
     <input id=""btnSearch"" onclick=""return RedirectUrl();"" type=""button"" value=""Search""/>
     <input id=""btnClear"" onclick=""return ClearUrl();"" type=""button"" value=""Clear""/>"
</code>
Comment: I got the search box to appear on the list, however, when I type something in the box it does not conduct a search.
Comment: Which Field Name values have to be changed?
Answer: One of the approaches to do this is to simply have a separate search box in content editor and use a script to link that with the search box for the webpart itself. This only works if you show the search box in the web part in addition to the custom search box you are making.
I asked a similar question and have modified the answer to what I ended up using with additional explanations on what it is trying to do. Hope this helps.
<code>// Set up - wpqID was added since that can change based on the DOM of your wiki page
var wpqID = 4;
var searchInput = document.getElementById("inplaceSearchDiv_WPQ" + wpqID + "_lsinput");
var searchImgSpan = document.getElementById("inplaceSearchDiv_WPQ" + wpqID + "_lsimgspan")
var searchIcon = document.getElementById("inplaceSearchDiv_WPQ" + wpqID + "_lsimg")

// Click seems to be required on imgspan in order for proper inputting, if you don't do that, sometimes the text disappears on its own.
searchImgSpan.click();
searchInput.value = "******";

// Event using the latest javascript guidelines
var ev = new Event('input', {'view': window, 'bubbles': true, 'cancelable': true});
searchInput.dispatchEvent(ev);

// Runs the search using whatever event handlers that was originally attached to the image
searchIcon.click();
</code>


Has the black hole information loss paradox been settled?

Question: This question was triggered by a comment of Peter Shor's (he is a skeptic, it seems.)  I thought that the holographic principle and AdS/CFT dealt with that, and was enough for Hawking to give John Preskill a baseball encyclopedia; but Kip Thorne is holding out, as are others.  Why?
Answer: It is a matter of opinion, largely dependent on what you mean by settled:

Is information lost or is evolution unitary? There are arguments based on AdS/CFT which make it almost certain that the evolution of a system from pre-collapse matter to after collapse radiation is  unitary. This is because there is a dual description - an equivalent description of the system using different variables - in which unitary evolution is automatic. If this is true for black holes in AdS, it is hard to believe it is somehow different for black holes in flat space which are for all intent and purposes as close to their AdS cousins as we wish them to be. Based on that, most people I know are convinced what the right answer is.
How is the information preserved, what is the mechanism for the unitary evolution? In particular, what's wrong with Hawking's original arguments to support information loss? I think it is fair to say that we don't know the answer, at least we don't know how to phrase the answer in the original, gravitational, language. I think there is a lot to learn by making this answer, even if we don't dispute it, as explicit as possible.
As a subset of that, were the arguments given by Hawking, based on Maldacena's superficially similar arguments, convincing? Lots of people are skeptical, including myself. There are some technical and conceptual assumptions that don't seem quite right in that proposed solution.
Answer: Susskind complementarity has not solved nor settled the problem.
Susskind (first paper considereding firewalls correct) and Harlow (with a loophole) withdrew theirs papers.
(later Susskind, posted an amending proposition, but not conclusive)
Black Holes: Complementarity or Firewalls?
Polchinsk, et al.
"We argue that the following three statements cannot all be true: (i) Hawking
radiation is in a pure state, (ii) the information carried by the radiation is emitted
from the region near the horizon, with low energy eective eld theory valid beyond
some microscopic distance from the horizon, and (iii) the infalling observer encounters
nothing unusual at the horizon. Perhaps the most conservative resolution is that
the infalling observer burns up at the horizon. Alternatives would seem to require
novel dynamics that nevertheless cause notable violations of semiclassical physics at
macroscopic distances from the horizon."
...It is widely believed that an external observer sees this information
emitted by complicated dynamics at or very near the horizon, while an observer falling
through the horizon encounters nothing special there. These three properties | purity of
the Hawking radiation, emission of the information from the horizon, and the absence of
drama for the infalling observer | have in particular been incorporated into the axioms of black hole complementarity (BHC)...
...There would be an inconsistency if one were to consider a large Hilbert space that
describes both observers at once. Such a Hilbert space appears when quantum gravity
is treated as an efective field theory, but it cannot be part of the correct theory of quantum gravity if BHC holds...
...that it uses the naturally produced Hawking pairs rather than introducing ad-
ditional entangled ingoing bits. This leads us to a rather dierent conclusion, that the
thermalization time does not protect us from an inconsistency of BHC....

then throw the second (information is lost, non unitary evolution) or the third proposition (no drama infalling observer), in any case complementarity is not enough.
Answer: I would expect the resolution of this dilemma to hold no relation whatsoever to AdS/CFT, being it specific to anti de Sitter spaces, which makes it irrelevant to our universe (unless someone proves an analog version for de Sitter spaces, which seems unlikely)
I think the key to the resolution of this dilemma is the false assumption that quantum evolution is unitary everywhere and for all observers.
To explain why the above assumption is false, take for instance the process of measurement of quantum observables. Regardless of the philosophical doctrine of measurement one subscribes to, the fact is that part of the information of the measured state is lost forever to the party that obtained information from the measurement. Yes, when observers do measurements to quantum systems, the global superposition of the system observer-system is still there "somewhere", evolving under perfect unitary evolution. However, some of the information from the measured system that is accessible to the observer is lost forever, even in principle, because of apparent collapse. So, it should be clear in this case that even if evolution is unitary for outside observers, physical observer eigenstates involved in the measurement will observe violations of unitarity.
so, unitarity is clearly not an absolute property of a system evolution, but depends on the "frame" where it is observed, and how the system couples to the observational frame.
Let's speculate how to apply the above in the scenario of the black hole information paradox: an observer outside the black hole sends information inside it, when the information crosses the event horizon, the information is lost forever for him.
However, observers inside the event horizon still see the whole system behaving under unitary evolution; the information sent inside the event horizon is still reachable to them. In particular, all entanglement correlations between states in and out of the horizon are preserved from their point of view, of course, as long as the measurement devices keep sending data inside the horizon for these observers to measure the correlations.
The trouble arises because some people is naively expecting quantum unitary evolution to be an absolute property that is agreed on by all observers, but quantum measurements are a clear example how this is not true in general.
Comment: Not my downvote (but I think it's justified): The question of black hole unitarity can't be settled by an appeal to quantum measurement, because you can form and evaporate a black hole as an intermediate state, and the resulting evolution is either unitary or not regardless of observation. As far as throwing entangled particles past a horizon, this is resolved today, the particle you leave outside is entangled with horizon degrees of freedom of the black hole. AdS/CFT can be done in our universe by setting up extremal charged (or rotating) black holes, whose near horizon geometry is AdS.
Comment: @RonMaimon, but there is nothing that can evolve unitarily "regardless" of observation; observation breaks unitarity in every case for the observer doing the measurement/coupling with the observation system (unless you are doing clever stuff like those in the quantum eraser experiments, but those are just more cons of hands and cards that try to disguise measurement in reversible transformations). Give me some time to think in your other observations
Comment: I think the poster who uses the title Lurscher makes the most sensible comment I have ever seen on the so called black hole information paradox.


Permission option for unblock the selected users not listed

Question: I have created a user & assingned it role 'superuser'.I want to give only two permissions to superuser, block the selected user account & unblock the selected user account.I have given 'block selected user' permission from admin->people->permission but the option for 'unblock the selected user account' permission is not listed in admin->people->permission.How can i give this permission to superuser?
Answer: You can create a view and give access to superuser role.
Below links will help you.
http://blog.safwan.in/post/69263954822/add-unblock-user-action-to-views-bulk-operation-vbo
http://dropbucket.org/node/486
Comment: I tried with module in the link,but its not showing an option'unblock the user' for superuser role.
Comment: Create a page view of users,under Page settings give access only to superuser role.Under fields add users bulk operations and enable block and unblock users. HTH..
Answer: I have followed the same links and created the module at some extent it is working fine that is there is an option "Unblock the user" is appearing in views bulk operation and permissions. But the problem, is it is not Unblocking the user in actual.


How exactly YouTube make videos 2x speed?

Question: I think that it's possible for every 2 frames, only 1 frame is played and the second frame is ignored, therefore cost half the data, is that correct?
Answer: Very basically, it's not true what you're saying.
If you want to keep the video smooth and good looking you'll have to shorten the time you display each frame, which can lead to some frames neglected - but not every second one.
If you don't want to give up any frame, you can enlarge the FPS and by that have more frames in a each second.

Note: What you say can be achieved on server side, and would probably lead to less data transported. But it's not how YouTube works (cause they don't remove every one of two frames).
Answer: No, the entire video is still downloaded.
This is because videos aren't encoded full frame by full frame. If they were, then yes, it probably would be possible to only download half the frames when viewing it at 2x speed. However, in reality, videos aren't encoded like that. Instead they use a mix of full frames (called I-frames, which is basically a JPG image) and the so-called P-frames, which only tell you what changed relative to the previous frame (or, in case of B-frames, what changed relative to the previous and next frame). As such, the data usage for a video looks like this:

Source: https://people.xiph.org/~xiphmont/demo/av1/demo1.shtml
This breaks your assumption "half the frames = half the data" in two ways:

Most of the data sits in the I-frames, getting rid of every other P- or B-frame won't halve your data usage.
Getting rid of every other frame would also completely break the video, somewhat similar to this:


Is it possible to publish UPS between versions(2013-2016) of SharePoint?

Question: Does anyone know, if the cross farm publishing of UPS service is possible when
consumer is SharePoint 2013 and publisher is SharePoint 2016, both on premise.
Answer: Yes, this scenario is possible. More details can be found in Share service applications across farms in SharePoint Server 2016

Additionally, a SharePoint 2013 farm can consume services from a SharePoint Server 2016 farm but a SharePoint Server 2016 farm cannot consume services from a SharePoint 2013 farm. For example, a SharePoint 2013 content farm can access a SharePoint Server 2016 farm, but a SharePoint Server 2016 content farm cannot access a SharePoint 2013 farm.

There are some limitations special to UPS, so it is useful to fully understand the linked article before deployment.
Answer: Yes that is supported scenario, You can publish the UPA in SharePoint and 2013 can be consumer.
if you have MySite in both farm then some of the features will not work in SharePoint 2013 farm. as the official statement.

The User Profile service must reside in the same datacenter as the
  content it supports — The performance of social features require the
  User Profile service application to be located in the same datacenter
  as My Sites, team sites, and community sites.

If you have mySite in both then couple of Profile related active may affected. Also make sure all the farm in same domain.


Violating trespass warning - arrest after the fact?

Question: If you have a trespass warning and visit the place but are not arrested, can you be charged later from video evidence or a credit card transaction?
Comment: It would help more if you explained the type of trespass at issue, is this a run-of-the-mill stepping on somebodys land that doesn't want you there, or is it somehow related to the credit card transaction?
Comment: About 3 years ago I was involved in an altercation at the establishment with an employee. I was arrested and I assume given a trespass warning (although I have nothing in writing). I was never charged for this because many witnesses came to my defense after the fact. I had to meet a friend from out of town and they just so happened to be there. I was too embarrassed to inform this person of the tresspass warning and went inside and had a drink. Nobody said anything and the police were not informed.
Answer: Yes, you can be charged later.
Generally speaking crimes like trespassing have a statute of limitations that is in the months or years or duration, and charges can be pressed resulting in an arrest at any time within the statute of limitations.
Usually people are not arrested later on because it is hard to prove beyond a reasonable doubt that the crime took place, but there is no hard and fast requirement that an arrest for trespassing happen while the crime is being committed.
Also, usually only law enforcement officers are allowed to arrest people after the fact for crimes - citizen's arrests are usually only allowed when someone is in the process of committing a crime.
Comment: I have been in the actual position of issuing a trespass warning. The issue that led to this was serious, threatening misbehavior that had to be dealt with to protect the safety and security of others on our site. If we discovered that he had somehow snuck back in, behaved as a model citizen, and then left peacefully to spread love and joy throughout the world, I can't say that we would do much. Legally we probably could (seek an arrest warrant), but the motivation wouldn't be there, since the underlying *problem* would have been solved. Cf. [xkcd](https://xkcd.com/810/).


Craft 3 multisite - are entries accessible between sites?

Question: In multi-site is it possible to access entries between sites in the templates.  Like a feed?   ie. entry "a" on site "A" shows up in an index on site "B", and links back to the entry on site A, not a duplicate of the entry on site "B"?
Answer: Yes it is. Just include the site id of the the site in your query
set siteId = 2
set entries = craft.entries.section('foo').site(siteId).all()

if you want to get the current entry for another site
set currentEntrySiteB = craft.entries.id(entry.id).site(2).one()

If you want to search for disabled entries (for example in CP templates) for other sites you can do
craft.entries.id(entry.id).site(2).enabledForSite(false).one()

Comment: @StephenHamilton No you can't https://github.com/craftcms/cms/issues/2854
Comment: Is it possible to aggregate multiple site's content (for example, news stories) into one query? I don't seem to see a way to include multiple site IDs or handles in an entry query.
Comment: Thanks @Robin, gutted I didn't see that before getting this far with a build...
Answer: I needed to aggregate blog posts entries from ~20 schools (multi-sites) and display them on the main site. Like others, I realised way to0 late in the development that this wasn't an out of the box feature. However by using the Twig array merge filter you can build an array of aggregated entries from your multi-sites.
Then, using the superSort plugin you can subsequently sort the merged array into whatever order you like, chronological in our case.
On this particular multi-site setup, we use a lightswitch showOnMainSite that admin users can switch to the on position to select what entries are pulled through to the main site. In the example below, we use the search filter to filter the entries output accordingly.
Here's a simplified version:
{#-- create an empty array --#}
{% set multiSiteEntries = [] %}

{#-- fetch the multi-site IDS using the getSitesByGroupId method --#}
{% set sites = craft.app.sites.getSitesByGroupId(2) %}

    {#-- loop through the sites in groupId 2 using the site.id, searching for the showOnMainSite lightswitch field --#}
    {% for site in sites %}

        {#-- add retrieved site entries to the multiSiteEntries array --#}
        {% set multiSiteEntries = multiSiteEntries|merge(
            craft.entries().
            siteId(site.id).
            section('blog').
            search('showOnMainSite:1').
            all())
        %}

    {% endfor %}

{#-- loop through our populated array of multi-site enries and use the superSort plugin to sort them chronologically --#}
{% for entry in multiSiteEntries|supersort('rsortAs', '{{ object.postDate|date("U") }}') %}

    {#-- our multi-site entries output --#}

        {{ entry.title }} | {{ entry.postDate|date('jS F Y')}}

{% endfor %}

We limit each site output to 3 entries, so overall we are pulling ~60 entries in from 20 multi-sites to use as a landing page for end users to browse at a glance all the news across the 20 schools.
Comment: As of 3.2 (d017022) Craft supports this feature request in the op

  [1]: https://github.com/craftcms/cms/commit/d01702278bd84b84392e11da72aa4d0b6f4f0943
  [2]: https://github.com/craftcms/cms/issues/2854#issuecomment-471371467


Should I use creeping types of plants to cover walking paths in my veggie gardens?

Question: I'm wanting to suppress weeds in my garden with creeping plants, and am wondering if I should get varieties of short plants for my garden so they spread to cover the entire garden so I can go around on it bare foot.
Answer: There are a few problems with that idea:

Don't tread on any insects (e.g. ants) that will bite your feet.
Likewise, don't tread on any bird droppings etc!
The creeping plants won't stop at suppressing the weeds, they will also suppress your other plants when they are still small. If the creeping plants aren't strong growing enough to behave like "weeds" themselves, frequent walking on them will soon kill them.
They will also take nutrients and water away from your other plants.

If you really want to go this way, I suggest you change "creeping plants" to "grass". That might sound and look boring, and you will have to mow it regularly, but it won't have any unexpected bad side effects.
Comment: Grass is one of the worst garden weeds, in my opinion, since it spreads very very quickly into cleared soil. It also will do nothing to suppress major weeds (dandelions, creeping charlie, white clover) and could still harbor ants and bird droppings. If it got into your planting rows, it could easily out-compete any vegetable seedlings that are coming up. The only way I'd use it in a vegetable garden would be if I edged it to prevent its expansion. That's a whole lot of work, though, depending on the length and number of your rows.
Comment: I used creeping thyme as a groundcover once. Within three years it had invaded the lawn and began killing it - I never did manage to completely eradicate it over the following four years (I moved before it was gone). Six plants in 4" pots spread something like 24" each over two+ seasons. The thyme also appeared to reseed itself viciously. Wooly thyme might have been better in my situation, as it tends to be better behaved. As far as I remember, though, no variety of thyme is considered to be a very walkable groundcover. The fabric will also shade the soil and conserve water, BTW.
Comment: why wouldn't you want creeping plants like thyme, when they will provide shade for the soil to keep moisture under them, and with where the garden is going it'll have plenty of water (creek is next to it, and 2 feet lower)?
Comment: The amount of water your garden will get from the creek depends very much on the nature of the subsoil. It could any amount between "too much" and "zilch".
Comment: always wet creek = natural surface water table = plenty of water that soaked into the soil = happy plants that can drink to meet their growing desires.
Answer: Well, you could consider using some form of bindweed. It is a common hardy "weed" that usually grows white or blue flowers. It can be a great ground cover and requires very minimal maintenance. It's roots usually grow about 2-3 inches below the surface and are incredibly easy to remove, they usually grow straight down as well.
Another option would be a plant like Bishops weed or what is more commonly known as Snow on the mountains. Unlike bindweed, Bishops weed will take some maintenance on your part.
Keep in mind that while bindweed will never grow more than 2-3 inches above the ground, Bishops can get around 5-6 inches tall. Also, please note, that unless your garden is a squash, melon or tomato garden (big plants, large roots) I would never suggest growing a creeping plant inside it. There is always a chance that without proper maintenance and pruning these creeping "weeds" will choke your garden plants to death.
Comment: @blackthumb Sea bean would probobly grow too tall but the thyme could work.
Comment: that's why I'm thinking sea bean, and creeping thyme for the cover. Some people consider mushrooms weeds, but I like to hunt them.
Comment: so sea bean goes in a corner in a USDA zone 4A :D
Answer: One idea that works is to use high-grade landscape fabric between the rows—18-24" (50-60cm) usually is wide enough. I use this myself, with ground staples holding the fabric in place. This is not a perfect solution by any means — if you live in a cold-winter environment, the staples have a tendency to frost-heave, and the fabric when wet can be slippery. I've also had issues with moss growing on it and some weeds coming up in the staple-holes. I don't know that you'd want to walk on it with bare feet, either. Still, it's better than nothing, keeps weeds from growing on the paths, and, because you're not walking between the rows, it keeps the soil there from becoming compacted.
In my garden, I keep the paths "two sword lengths apart" - that is, 6 feet apart. I'm tall and have a good reach, so this allows me to reach the center of each vegetable bed by kneeling on the path on either side of it.
Comment: problem here is I have 1 foot of wood chips down for composting like https://www.youtube.com/watch?v=YCtafUgoCX0
Comment: I think the guy in the video got the cause of the improvement wrong. IMO he got two feet of good soil in the paths from 8 years of having earthworms in the raised beds. The woodchips were just a sideshow. FWIW I've just been doing some redesign on my own garden in the UK which used to be solid red clay (i.e. unbaked bricks) 20 years ago. There was a good depth of quality soil underneath paths made from concrete slabs, where originally there was only red clay and a bit of builders sand to bed the slabs into! No wood chips ever used anywhere.


Does my 1995 Cadillac incorporate ECM

Question: I own a 1995 Cadillac. Does it incorporate a module that adjusts ignition timing for octane?--At what interval?
Comment: A knock sensor probably that backs off the timing as and when...
Answer: It doesn't do it directly, but indirectly. It does, as Solar Mike suggests, have a knock sensor which detects knock (obviously) when it occurs. Knock can occur with lower octane fuels than what is called for or when there is carbon build up which causes hot spots in the cylinders/combustion chambers. When this happens, it can cause pre-ignition or knock. When that occurs, the ECU will pull timing (up to a point) to try and reduce or eliminate the knock. Like I said, yes it does have a module to do this, but only indirectly.

Does my 1995 Cadillac incorporate ECM


How do I create a VCF file of all known pathogenic mutations in a gene of interest?

Question: I would like to create a list (probably .vcf format would be good) of all known pathogenic missense mutations in a human gene of interest and then add other variants that could lead to the same pathogenic amino acid substitutions. I intend to search targeted sequencing data of my gene of interest for variants that would cause these particular substitions.
I'm very new to bioinformatics so I'm not so familiar with the appropriate databases and tools to use, but this is a rough idea of how it could be done:

extract all mutations listed in Ensembl within my gene of interest that are labelled with HGMD_MUTATION  (is there an option to download a vcf file with all HGMD mutations within my gene? I've only managed to do so for individual mutations.)
annotate list with reference and mutant amino acids for every mutation in the list
add additional mutations (which may not be present in HGMD) which could lead to the same substitution. E.g. I'm interested in the substitution Proline (reference codon: CCG) to Leucine (TTR or CTN) at AA position 102, so I would like to list all hypothetical mutations that would create a leucine codon in this position, not only the one given in Ensembl (which is CCG -> CTG).

Could you point me towards the best tools to use for these purposes? Unfortunately I haven't got a HGMD subscription. Many thanks!
Comment: Why HGMD specifically (not clear to me)? You can simply use the ClinVar database to find all pathogenic mutation within regions of interest/gene (you can check the genomic coordinates of any gene using either UCSC or ensemble).
Answer: I'm not sure how to generate the additional mutations, but I would say that HGMD is not the way to find all the pathogenic variants. I would probably filter this table by either Clinical significance or Evidence->Phenotype association.


Running air handler condensate drain into sump?

Question: The condensate drain from our air handler now runs across the wall and into the laundry sink. This is stopping us from attaching shelving to the wall. I noticed that the sump pump pit is right next to the air handler. Can I just route the pvc so it empties out directly into the sump?  There is a metal cover on it now with a little gap for the power cord so I would need to make another little hole for the pvc pipe and just run it down the wall then along the wall for a foot or so with a little bit of a downslope.
Comment: Where are you? The only possible reason it would be an issue is if there's a legal problem with doing so - it's certainly not going to break anything. Any my air handler has always been setup that way.
Comment: I am in Maryland
Comment: Another solution would be to notch the backs of the shelves so there's space for the drain to run behind them, or to extend/reroute the drain do it comes down alongside the shelves...
Comment: The problem is that in order to get to the laundry sink it has to go across the shelves. I don't have a lot of vertical drop to play with.  However, we're going to do the closet track system, and it occurs to me that we might be able to put the vertical standards against the wall, and then just put the PVC across the standards right in front of them, with possibly a couple of elbows to just make sure that we don't bend it too much.
Answer: Well, i don't really see an issue with this since the condensate water is basically distilled water with neutral PH. The legal issue with it may be due to furnace condensate water which contains carbonic acid. Using a neutralizer will take away almost all the acidity, however some municipalities still don't allow either condensate water to be piped to the sump to account for idiocy.
One possible solution, you can get a condensate pump, and have it pump the water though a tube to any sink, or drain you can run the tube to. The only downside is the sound of the pump turning on ever now and then.
Answer:
Can I just route the pvc so it empties out directly into the sump?

I hear that this is a code violation in Massachusetts although I'm not 100% sure why.  It may be:

Condensate can be mildly acidic which can eat away at metal fittings on the sump pump.  However, any sort of liquid in the sump should dilute this.
People worry that the sump pump might freeze if it is triggered on in the winter although there shouldn't be condensate in the winter.
People wonder if it makes no sense to have the sump evaporating into the house and the condensate output leading to the sump.

My furnace uses condensate pump to support my self-cleaning humidifier which may support the sump freezing case because it does run in the winter.  I've had to engineer a flow back system to stop it from freezing.  I have some portion of the pump output going to a T and back to itself which causes the line to empty after the pump stops.  Seems to work well.
Comment: The condensate from a furnace or boiler is the result of combustion and so can be acidic. But condensate from an HVAC air handler (cooling coil) or air conditioner is just plain water extracted right from the air.
Answer: If it were my home I would just do it. If there is some 'code' that disallows it I would sure like to hear the logic behind it.
Comment: Code may not require it, but might you want an air gap between the condensate drain pipe and any possible standing water in the sump?  I wonder if there are any conditions where there might be even moderate suction acting on the drain pipe.
Comment: Not if it has a trap, as it should. @Grunthos
Answer: I don't think there is anything wrong with this, but a downside to this approach is that your sump pump will run a tiny bit more, consuming electricity and producing noise.
Answer: Not only is it okay to drain it into the sump, in many localities it is against code to drain it into a sink (or anything else that connects to the sewers).
Answer: I would not pipe condensate in the sump pump.
It will make your sump pump turn on in the winter.
The water will freeze at 32degrees where people
 will slip on especially if it discharges into the
Driveway or street.
Comment: Hello, and welcome to Stack Exchange. Do people use their air conditioners when it's below freezing outside?
Comment: Since sump pumps are often well below the frost line nothing stops them from running in the winter.  It is always wise to design the discharge to handle freezing conditions outside.
Comment: I don't think AC condensate is likely to accumulate at all during cold months. Furnace / boiler - different story/


How do I call this interaction?

Question: There's this interaction on Airbnb (example page: https://www.airbnb.com/rooms/432044), where the section containing the price, "Request to Book" call to action, etc. on the right are scrolled with the content, but only until it reaches top of the screen. Can you help me with finding a good name for this type of interaction (whether on web or for mobile products/websites)? I'm looking to write an article about this type of interaction, and wouldn't want to describe it as I just did above each time I'm referring to it.
Answer: I would call it an affixed positioned element. This refers to its sticky positioning that activates after a certain amount of scrolling, in this case once the element hits to top of the viewport.
Answer: Specifically

Sticky Sidebar/Column
Fixed Sidebar/Column

More in General

Sticky/Fixed Element
Sticky Element by Scrolling

How do I call this interaction?