theoretical basis for logistic regression

Question: Sorry if this is obvious but why does it seem that some papers/studies (usually in economics discipline) use utility theory as a basis for discrete choice models while others (often social science) do not? If what is being modelled is a binary choice, is a specification of the reasons why this choice is being made (as in, to maximise utility) and an accompanying utility model necessary? It just seems some use it and some don't, even when what is being modelled is essentially the same thing. Thanks
Comment: I think the theory behind it is the Boltzmann distribution and you can refer to this answer: https://stats.stackexchange.com/a/461851/103153
Answer: No, it isn't necessary. Economists like to get elbow-deep in mathematical hypotheses of how people make decisions, hence their frequent invocation of utility theory. But logistic regression can be justified in statistical terms without reference to utility, using the idea that a unit change in a predictor relates to an additive change in the log odds of a response.
Answer: There is no theoretical basis for logistic regression (in general as a choice vs. another model). Two things are arbitrary:

summing the influences of each variables, each influence being proportional to the variable (linear predictor)
the sigmoid link (logit)

The first assumption is similar to linear regression: a simple model that is very useful and often matches observations sufficiently well to make something of it.
The second assumption can't be justified either. It is similar to the assumption of normality of the noise in linear regression. Interestingly many other link functions produce very similar results: Difference between logit and probit models.
It is however interesting that logistic regression is equivalent to maximum entropy (in the case of binary/multinomial outcomes and independent observations), and that maximum entropy was stated as a principle by Jaynes in the 50s. I think people realized the two are equivalent much later (early 2000s as far as I known).
Comment: Sigmoid/softmax is how you convert logarithmic probabilities to probabilities.  Logarithmic probabilities are convenient because bayes' theorem simplifies to addition. Summing the influences of each variable amounts to assuming their independence, which is a weaker assumption than normally distributed noise. So IMO logistic regression has a pretty string theoretical basis.
Comment: "The second assumption can't be justified either. It is similar to the assumption of normality of the noise in linear regression."
The assumption of normality in LR is not completely arbitrary and can often be justified thinking of the additive noise as the result of a large number of independent small sources of error. By the CLT, their combined effect approaches a normal distribution.
Answer: You get an impression that economists do it because that's what they are forced to write in order to get published in microeconomics. Pure empirical studies are hard to publish.
However, this is changing, and not all economists do this. For instance, take a look at this work: "Analyzing the Risk of Mortgage Default." They use multinomial logit, and there's no utility function mentioned anywhere in the paper. And this is not even macroeconomics, where they don't feel pressured to shove the utility function in every paper
Answer: Other people have answered your question, let me explain a bit more the philosophy behind the different justfications for logit models.
The utility model used in economics is based on the grand idea to link general preference orderings over outcomes with the ordering of real numbers.
Less abstractly, what economists have tried to do is to show when any preference over some possible outcomes can be represented by functions that give a "maximum choice", and when this is not possible.
This fits very natural with logistic regression when there are only two choices, 0 and 1, and also very well with multinomial models where there are more choices.
Given distributional assumptions, the logistic regression therefore "arises" naturally out of a microfounded and very general model of human behavior. This is nice for economists, because many results they are after abstractly require the existence of such preferences to make sense more than just heuristically. The same is true for other social sciences that rely on choice, but their focus is often different.
One can posit a discrete choice model either as a utility model, or a latent variable model. The latent variable model (where $y=1$ if some $y*>t$) is also basically a choice model, only that it does not specify why this decision rule comes about.
Sometimes we are not interested in modeling this why. For example, we may simply not care, because some otherwise stable but complicated mechanism is behind it. It may also be the case that there is no actual entity making a decision, it is in a sense a purely statistical affair.
It would then be rather contrived to think about some hypothetic preference orderings by some non-entity.
So to answer your question: The utility model is not necessary at all. It depends on your research question. Is there an entity making a decision? If so, are you trying to learn something about this decisionmaking? If yes, then all approaches will sooner or later lead to a utility model, simply because you need to find stable or logical "preferences" in your research.
In other applications, utility is not necessary at all (especially outside of social sciences this may be the case, say a mechanical model) and it would be unnecessary and even harmful to argue with the utility model.
Answer: I'm not an economist nor do I know much utility theory, but I actually think there is some theoretical justification for logistic regression - at least at a high level. In real life, aren't decisions closer to existing on a scale like 0-100% rather than 0/1 binary? The ability to get 'probabilities' out of a logistic model makes it more attractive than some other classification methods. Of course, the fact that linearly separability frustrates logistic regression poses a problem for certain classes of theoretical justification.
Answer: The way I like to view logistic regression is that it's the simplest, most obvious, practical answer to the question "how do I model probabilities in two-class classification, given real, continuous predictors?", i.e., a series of common assumptions and simple choices naturally leads to the logit model:

We still assume a (generalized) linear model, i.e., we make the common assumption that the outcome is a function of a weighted sum of predictors.

We need to acknowledge and accept that there has to be a link function squishing the real line $(-\infty, \infty)$ to $(0, 1)$, so that a finite interval of probabilities can be estimated given an infinite range of predictors. (This is why a simple linear regression isn't admissible.)

The case of low probabilities (near 0) and high probabilities (near 1) should be treated symmetrically. The difference between $p = 0.1$ and $p = 0.01$ should be the same as the difference between $p = 0.9$ and $p = 0.99$. A simple log transformation of the probability won't therefore be adequate, since it stretches low probabilities and squishes high probabilities; furthermore, it's bounded from above (by 0), so it's not possible to achieve arbitrarily large (or even positive) values by log-transforming a probability.
The natural resolution of this problem is to take both the probability and its complement into account, balanced against each other, i.e., $\log(p) - \log({1-p})$. It is easy to see that this is symmetric around 0.5 and is exactly the logistic link function.
But why take the logarithm of anything in the first place? That is the answer to representing a quantity of which proportions are important. The log transforms multiplicative/proportional differences to additive/linear differences. I.e., by taking the log, we essentially assume that the difference between $p = 0.001$ and $p = 0.01$ is the same as the difference between $p = 0.01$ and $p = 0.1$. This may or may not be true, but this is again a common and convenient assumption to make, both conceptually (i.e., easy to understand and explain, familiar to people) and algebraically (the log is continuous, smooth, differentiable, has well-defined identities that make is easy to manipulate, etc.)


Jesus' power to forgive sins and to cure the sick

Question: If one is to answer this question which Jesus  posed to the scribes :  "..For which is easier, to say,  'Your sins are forgiven ', or to say 'Rise and walk' ?... "(Matt. 9:5)  one would opt in favor of the former for an answer. But, Jesus appears to have had the latter option in mind, as is forthcoming from the subsequent narrative. Is it true that the power to forgive sins was entrusted to a limited few, and those who exercised that power without authority were  treated to have committed blasphemy , thereby putting themselves at risk ?
Can someone enlighten me ?
Comment: See Mark 2, where they assert that "only God can forgive sins." Jesus doesn't seem to dispute this. For a Jewish understanding, you may wish to ask "who has the authority to forgive sins?" on [Judaism.SE].
Answer: It is not true that others were given the power to forgive sins on the Earth. Only Jesus had that authority. Forgiving sins is not a power it is an authority.
Matthew 21:23 and24 KJV  And when he was come into the temple, the chief priests and the elders of the people came unto him as he was teaching, and said, By what authority doest thou these things? and who gave thee this authority? 24  And Jesus answered and said unto them, I also will ask you one thing, which if ye tell me, I in like wise will tell you by what authority I do these things.
Only God himself can forgive sins, but he gave Jesus the authority to pass that forgiveness to others while on Earth. Jesus explained this relationship in the following passage:
John 5:24 through 30 KJV Verily, verily, I say unto you, He that heareth my word, and believeth on him that sent me, hath everlasting life, and shall not come into condemnation; but is passed from death unto life. 25  Verily, verily, I say unto you, The hour is coming, and now is, when the dead shall hear the voice of the Son of God: and they that hear shall live. 26  For as the Father hath life in himself; so hath he given to the Son to have life in himself; 27  And hath given him authority to execute judgment also, because he is the Son of man. 28  Marvel not at this: for the hour is coming, in the which all that are in the graves shall hear his voice, 29  And shall come forth; they that have done good, unto the resurrection of life; and they that have done evil, unto the resurrection of damnation. 30  I can of mine own self do nothing: as I hear, I judge: and my judgment is just; because I seek not mine own will, but the will of the Father which hath sent me.
Before leaving Earth Jesus gave his disciples certain authority, but not the authority to forgive sins.
Luke 9:1 KJV  Then he called his twelve disciples together, and gave them power and authority over all devils, and to cure diseases.
Even Peter did not pretend to forgive sin, but professed that the authority to overcome infirmities was of Jesus.
Acts 3:6 KJV Then Peter said, Silver and gold have I none; but such as I have give I thee: In the name of Jesus Christ of Nazareth rise up and walk.
Acts 4:10 KJV Be it known unto you all, and to all the people of Israel, that by the name of Jesus Christ of Nazareth, whom ye crucified, whom God raised from the dead, even by him doth this man stand here before you whole.
Hope this helps.
Comment: You start your third paragraph by writing _Only God himself can forgive sins, but he gave Jesus the authority..._; from a Christian perspective, Jesus **is** God, the second person of the Trinity, in the words of the Nicene Creed, _God from God, Light from Light, Very God from Very God, of one being with the Father._
Comment: @brasshat Not all believe that God is a trinity. There are even some who assert that God and Jesus are one and the same and not tripartite. My answer was formed to not assert that the Godhead is a trinity.
Answer: Is it true that the power to forgive sins was entrusted to a limited few, and those who exercised that power without authority were treated to have committed blasphemy , thereby putting themselves at risk ? Can someone enlighten me ?
The forgiveness of sins is a little confusing because there are two types.

Forgiveness of sins for salvation (judicial)
Forgiveness of sins (relational)

Jesus has the authority to forgive sins because it was given him by God. The reason being is that Jesus took on the sins of the whole world such that any sin committed has already been paid for by Jesus personally.

1 John 2:2  And he is the propitiation for our sins: and not for ours
  only, but also for the sins of the whole world.

The relational aspect of forgiving sins can be also seen in 1 John.

1 John 1:9  If we confess our sins, he is faithful and just to forgive
  us our sins, and to cleanse us from all unrighteousness.

Here the word confess is homologos (to say the same words) If we are able to say the same thing about what we have done as God would, we bring ourselves into alignment with truth and are able to have restored our relationship with God that our sin broke apart.
Christians are able to forgive these types of sins with each other also to restore relationships.
The ability to "forgive" sins in John may fall into the relationship category of forgiveness and be based on if the person has already received relational forgiveness from God or not.

John 20:22-23  And when he had said this, he breathed on them, and
  saith unto them, Receive ye the Holy Ghost:  Whose soever sins ye
  remit, they are remitted unto them; and whose soever sins ye retain,
  they are retained.

Here Jesus gives the disciples the first permanent indwelling of the Holy Spirit that is given to all believers at their salvation. The verb tenses in John 20:23 need to be more accurately brought over into the English. Weust is pretty good for this;

John 20:23 If the sins of any certain individuals you forgive, they
  have been previously forgiven them, with the present result that they
  are in a state of forgiveness. If the sins of any certain individuals
  you retain in not forgiving them, they have been previously retained
  and thus have not been forgiven, with the present result that they are
  retained and in a state of not being forgiven. - Weust

The disciples are not being given special powers but special responsibilities. This is similar to the verse about Peter;

Matthew 16:19  And I will give unto thee the keys of the kingdom of
  heaven: and whatsoever thou shalt bind on earth shall be bound in
  heaven: and whatsoever thou shalt loose on earth shall be loosed in
  heaven.

Once again Weust can be helpful in getting the verb tenses more accurate;

Matthew 16:19 I shall give to you the keys of the kingdom of heaven;
  and whatever you bind on earth , shall have been already bound in
  heaven; and whatever you loose on earth , shall have already been
  loosed in heaven . - Weust

We can see an example of how this worked in Acts.

Acts 15:19-20  Wherefore my sentence is, that we trouble not them,
  which from among the Gentiles are turned to God:   But that we write
  unto them, that they abstain from pollutions of idols, and from
  fornication, and from things strangled, and from blood.

Here the "binding" that was placed upon the Gentiles was that which was written in Leviticus to place upon the sojourner in Israel.
In this case one might see in John 20:23 the admonition that if a Christian has not had his relationship with God restored, the disciples would not be able to do so either.
The disciples in both Matthew and John are being told that they need to restrain their declarations to that which has already been established.
Answer: Jesus had the only authority to forgive sin as He is the 2nd person of the Trinity. "I and the Father are one". John 10:30
Answer: John 20 is interesting in this regard ...

21 Again Jesus said, "Peace be with you! As the Father has sent me, I
  am sending you." 22 And with that he breathed on them and said,
  "Receive the Holy Spirit. 23If you forgive anyone's sins, their sins
  are forgiven; if you do not forgive them, they are not forgiven."

Jesus sent the disciples, and breather the Holy Spirit on them and gave them the ability (authority/power) to forgive people's sins.
By inference, that same sending is given to us, with the same Holy Spirit and, I suggest, the same ability to forgive peoples' sins.
That healing is one of the gifts of the Spirit also suggests that we are able to heal as Jesus did.
My conclusion from this is that the healing and forgiving are both available to Christians.


CraftCMS 3 - Composer Update

Question: How can I update all the packages under craft/app/vendor for Craft CMS 3 (Yii 2)?
Answer: You can't.
The composer.json file (and the composer.lock file so you can't even reverse engineer composer.json) isn't shipped with the official release on purpose.
Craft 3 is still in development preview status (not even alpha release), but the next release will include updated Composer dependencies.

CraftCMS 3 - Composer Update


Limit the display of contour lines

Question: I have created a contour in QGIS based on a TIN interpolation.
The contour lines are displayed over the whole area of the TIN. Is there a way to limit the display to the layer of the outer border of the lot?
Comment: Will you be using other layers? Maybe a basemap behind it? If not, you can use a border polygon with the Inverted Polygon symbol set to white to "mask" out and hide anything but the area of interest.

Similarly, there is a Mask plugin you could use.
Answer: You can filter the features you want to display based on an attribute (like elevation in your case, I guess).
Set the layer to rule based rendering and define a rule when a feature should be visible. I have six lines with an attribute elevation with values 100, 200, 300, 400 500 and 600. To display only intervals of 200 m, I define a filter rule:  "elevation" % 200 = 0 to get only the red lines. % is the operator for remainder (modulo operation): I want to display the lines with elevation value that can be divided by 200 without remainder. Use any other filter condition that fits your needs: the whole complexity of QGIS expressions is at your disposal to define tailor-made conditions/filter rules.
Just for visualization purpose (to "prove" that the layer is really filtered and contains more lines), see the black dottet symbol for all other lines. Clicking the checkbox next to each symbol, you can hide every rule based symbol.
Answer: this problem is caused because of at the edge of the TIN there are invalid values or values that will out put errors due to no data beyond this point.
best option is to

create the contour layer little lager
and draw a extents of the required area in a new layer
then Vector Overlay > Clip the contour layer from the newly created raster via processing tool box

or
at the time of the creation of the contour with the use of GDAL > Raster Extraction > Contour please do not tick the box Advance Parameters > treat all raster values as valid

do not tick the box Advance Parameters > treat all raster values as valid as by not ticking this will eliminate blunders and gives a smoother contour lines.

example -

Limit the display of contour lines


Is SpatiaLite the only single file/db spatially enabled exchange format?

Question: I am trying to figure out if there are other viable exchange formats for spatially enabled data. So far, it seems SpatiaLite is the only one out there, but it has yet to be adopted by the industry.
Comment: Are you looking for an exchange format or a portable storage format? It would help to describe the problem you're trying to solve. GML is a great exchange format but you wouldn't use it as a datastore for a web app.
Answer: In terms of OGC Simple Feature SQL specifications, Spatialite is the only open source implementation on a single file basics. For this reason (and others!) it has major benefits compared to other flat vectorial formats like shapefile etc...
Being fully supported by GDAL as an "official" OGR driver [0], this is a warranty for future support of major GIS Desktop software (they all use the universal GDAL).
Currently only QGIS is able to read (and write) it, so if you want an exchange format directly readable/writable from your software without exports to other formats maybe it is still not your best option, if you are not using QGIS.
If you need an exchange forma though, as already suggested, you can use a whatever supported format from GDAL/OGR [0] and then import back to a spatial db.
Note that if Spatialite will implement topology, as I have heard, it will be have a major benefit compared to other plan formats (like shapefiles for example).
[0] https://gdal.org/ogr/drv_sqlite.html
[1] https://gdal.org/drivers/vector/index.html
Comment: As for development speed, I would characterize it as frenetic, not slow.  I would say that SpatiaLite is somewhat of a moving target because it still relatively young.  The SQL is quite standards compliant, so query code won't change much.  Version 2.4 is almost final, but isn't, as you suggest, compatible with the 2.3 client libraries.
Comment: I have heard rumblings that spatialite is still a moving target and development on is slow and that is why I am wondering if there are any other options out there.
Comment: So, how does the change from 2.3 to 2.4 effect the end user? If my current way to access it is through ogr do you think I will even know the difference?
Answer: It really depends of your needs. I also think geojson, gml, citygml, and the google kml could also be considered as spatially exchange formats.
Comment: As shapefile substitution format, indeed, I read that spatialite is *good candidate*. I never heard about other formats for that.
Comment: I am looking for something that can be used to replace shape files and that is sql querable. I think sqlite is a great platform but have heard some rumblings about the spatialite community and am wondering if there are other solutions out there right now.
Comment: The problem is that for something to be natively SQL queryable it must be specific to a particular database.  And with OGR everything is SQL queryable in some form.
Comment: I think it's great that this exchange format is built ontop of a heavily used sql format. sqlite is super... but is spatialite the only one out there using it?
Comment: It sounds like you are looking for SpatiaLite, but only if it isn't SpatiaLite.  I am curious what your bias is.  (Maybe you already answered it in your comment below.)
Comment: In the end I am trying to figure out if there are any alternative, I think highly of spatialite, but want to make sure it's the best option.
Answer: Although it lacks support outside of ESRI, Personal Geodatabase would be a good choice, and has industry adoption.  In terms of adoption AutoCAD formats could also be considered.
Answer: I think that the snag is when you say, 'adopted by the industry'.  There is value for the large proprietary GIS software companies to control the data format.
SpatiaLite works great with QGIS.  You can build map layers based on SQL queries.
If you want to combine spatial features and related tables all in a single file for exchanging, SpatiaLite is great.  If you just want to exchange features with attributes, a zipped shapefile is still your best bet.
Comment: It's more about having a robost standard that would allow you to use other tools to access your data through sql queries, hence the sqlite.
Comment: I want to move away from shapefiles for many reaons, including: it requires multiple files, it has field naming limitations, it only allows for one feature layer/class, it does not allow for direct sql queries
Comment: I don't think that many of us would mind moving away from shapefiles.  RE SQL Queries, is it the file format that doesn't allow direct SQL queries or is it the software that you are using that doesn't allow direct SQL queries?
Answer: For what its worth, my vote goes to Spatialite as the single file solution, exchangeable with everyone.  Esri personal geodatabases (.mdb) are great but don't work with a lot of GIS system stacks, primarily those that are Linux based, because the file format requires proprietary Microsoft database drivers that are unavailable to many.  The other single file remedies offer unique crutches to get your data from various places--online services, GPS devices etc. (KML, GPX) ..or from other GIS users who have collected data to share with you in shapefile format.  dxf and dwg and other CAD formats don't offer the functionality GIS users expect.  Ofcourse, if you are placing your data on a server to be fed out to many, then you don't need a single file format.  PostGIS would be the non-file database (server) solution.
Answer: Now OGC GeoPackage is the spatial database for vector features and raster tiles standard.  However, you can't do spatial operations/functions/queries on gpkg. You can create a virtualgpkg in spatialite and use spatialite for those spatial operations.
Answer: SQLite itself is somewhat spatial.  OGR support writing to it.  Besides SpatiaLite (which is poorly supported) there is Autodesk's SDF format.  The latest versions are actually SQLite files.
http://en.wikipedia.org/wiki/Spatial_data_file
Comment: With GDAL v >1.7.0, Spatialite is fairly well supported.  http://www.gdal.org/ogr/drv_sqlite.html  You can read/write.  Spatial indexes are not supported, but if the question is about only exchanging data, that shouldn't be a huge deal.
Comment: The FGDB has all the same problems as the SpatiaLite format, but for the opposite reason.  The library only works on Windows and a couple "proprietary" Linux systems (RHEL, SuSE).
Comment: Yea see that's my beef.  For a true interchange/exchange file format, it needs to be read natively by the most popular desktop and server applications.  While I have no problems rolling out OGR myself, my customers would never even know to do that.
Comment: I would like to point out that this question is directly related to a session that James had at WhereCamp PDX. His theory was that we don't need a exchange format and the only way to have a new exchange format would be to get said format adopted by major vendors.
Comment: @James - Then the file geodatabase it is! ; /  GIS industry=ESRI, right?  They released the API.  Throw in some 'layer packages' for the icing on the cake...
Comment: So.. does anyone use SDF? Do people use it in AutoCAD? Is SDF editable in autoCAD natively? I found that DWG with object data was the best native solution on AutoCAD.
Comment: From what I've heard, Autodesk is adding SDF compatibility to Autocad to hold database info.  DWG isn't going anywhere, but SDF should eventually replace everything else.


What are the reasons to use a web proxy at work?

Question: I recently installed a web proxy at my workplace. I don't understand why, should this be OK? What are the reasons to use a proxy at work?  IMO using a proxy at work is a wrong decision.
Comment: I'd love to know why you'd install something you didn't know the purpose of.
Answer:
Caching frequently accessed content
Controlling and/or monitoring site access to ensure conformance with internal or external regulations and usage policies
Enabling intrusion detection systems and groupware filters to trap viruses or other malicious payloads
Comment: +1 Pretty much hit the nail on the head.  We tend to recommend appliances such as IPCop or pfSense which do more than just proxy.  You'll find that with a few addons you can force everything through the proxy and then control (even with time controls) which websites are allowed, banned, etc.  You can also easily identify who is working and who is just surfing around all day.
Answer: Using a proxy at work is often very much the right decision.  Maybe not so much for [very] small companies with not staff and loose policies, but still good for caching at the very least.
Some things already mentioned

caching downloaded content, consumes less bandwidth to your ISP
content filtering, lets you implement HR policies
virus scanning, catches things before hitting client workstations

Some additional things

load distribution, allows you to take the load of content filtering, virus scanning, etc off of your primary firewall
better security, if you use a web proxy for access control inside of your firewall you can integrate it with your internal authentication mechanisms (AD, LDAP, etc) without having to connect your firewall to do the authentication.  Adds another layer between the outside and your internal authentication
traffic analysis and usage stats since many [most] firewalls don't log in formats that are recognized by web analytic packages
application level protocol filtering (although the gap is closing here), some proxies let you get inside the application level protocol to be able to filter things out more granularly (examples: blocking out WebDAV verbs from an HTTP request, blocking PUTs in FTP)

There are some drawbacks in running a separate web proxy from your primary firewall:

Different configurations for apps that use application level protocols other than HTTP, HTTPS, FTP if your proxy doesn't know about them.  This is especially apparent in the streaming media arena.
You will have a problem with [Java] applets that want to talk directly to their remote hosts outside the realm of HTTP
You will need to have a configuration mechanism for client applications (browsers, media players, etc) to use the proxy.  This is probably already the case if your Internet connection is coming in to a central location, but for smaller networks where the Internet gateway is the default route this will be an additional configuration to support.
It is an additional system to have to support and maintain
Answer: Because you don't want your developers spending all day on StackOverflow.com :)
Comment: True, luckily our proxies haven't caught on yet :-)
Answer: Repeat this mantra: "A single point of Internet access lowers your attack surface. A single point of Internet access lowers your attack surface. A single point of Internet access lowers your attack surface. A single point of Internet access lowers your attack surface. A single point of Internet access lowers your attack surface."
Otherwise, what everyone else said.
Answer: One of the reasons to use a proxy at work is so that IT can analyze the traffic going into and out of the proxy for security reasons and to block off certain websites from being accessible via a filter.
Answer: Traffic control, site locks and access control.
Answer: The proxy "fetches" resources from other servers you have requested, so it serves as a good filter between your network and the Internet. It can speed up access time and keep your machine anonymous.


If someone who has obtained a GRC 'detransitions', can they 'return' to their original gender?

Question: If an individual obtains a Gender Recognition Certificate, but then decides that they identify with the gender they were assigned at birth (so-called 'detransitioning'; cf the case of Bell v Tavistock), can that individual 'undo' the Gender Recognition Certificate and legally revert back to their original gender?  Since a GRC requires gender dysphoria, can they obtain that if they instead have the opposite problem (they identify strongly with the sex they were assigned at birth as opposed to their previously chosen identity)?
Comment: I'm not familiar with the law on this at all, but this sounds less like a case of the opposite problem than a second case of the first. If the person is now legally recognized as the second gender but identifies with the first, why wouldn't this be the same "gender dysphoria" as in the first case?
Comment: @bdb484 indeed.  I am not familiar with the criteria for gender dysphoria, but it seems plausible that it would include confused feelings about gender and indefinite feelings about gender in addition to definite feelings of having been assigned the wrong gender at birth.
Answer: The Gender Recognition Act 2004 makes no mention, as far as I can see, to "undoing" a GRC but it does require at s.2(1) an applicant:

(a) has or has had gender dysphoria,
(b) has lived in the acquired gender throughout the period of two years ending with the date on which the application is made,
(c) intends to continue to live in the acquired gender until death, and
(d) complies with the requirements imposed by and under section 3 [provide evidence etc]

The use of the emboldened present perfect tense could possibly infer that although the applicant no longer has gender dysphoria*, they have had it at sometime in the past and therefore satisfy this mandatory requirement - I cannot find any case law where this has been tested, nor any legal commentary on this particular subject but I have found this:

The change is permanent. It is possible to reverse a GRC but this would require applying for a new GRC which has requirements that would take several years to meet.
Source

*Edit: Gender dysphoria (GD) is the distress a person feels due to a mismatch between their gender identity and their sex assigned at birth - so if there is a mismatch between the identity on their GRC and their birth certificate, then it seems they may in fact have GD after all.


dvb-s to dvb-c direct transmodulation

Question: Is this possible to direct trans modulate DVB-S/S2 -> QI into -> DVB-C/C2 signals without doing it the way DVB-S/S2->Demodulator.ic-Transport Stream -> Modulator.ic-Transport Stream -> DVB-C/C2 ? Qpsk and Qam are similar, rf tuners the same, trouble within IQ. Direct conversion should be multichannel and cheaper within CATV systems.
Answer: This should be impossible in most cases due to different modulation and coding schemes.
For example, DVB-S2 uses single carrier phase modulation wheras DVB-C2 uses OFDM modulation. There is no way to convert single carrier to OFDM without going to the digital domain.

dvb-s to dvb-c direct transmodulation


Properties of the $\frac{1}{2}x^2$ function relevant for variational analysis in mathematical physics

Question: There is a theorem in mathematical physics that, by the looks of it, hinges on the nature of the function $f(x)=\frac{1}{2}x^2$
This question is about examining properties of the $f(x)=\frac{1}{2}x^2$ function, that is why I am submitting this question here, and not in physics.stackexchange.
Context of this question:
the theorem that by convention is referred to as: 'the principle of least action',
The expression for the kinetic energy of a mass is the function that I'm interested in:
Kinetic energy  $E_k$
$$E_k = \frac{1}{2}v^2$$
That is, the kinetic energy is proportional to the square of the velocity 'v'.
As an example the simplest application of 'least action':
A point mass is subject to a constant force 'F' acting downwards. In that case the potential energy $E_p$ function is linear. With the letter 'h' for 'height' the expression for the Potential Energy is Force * height: $Fh$
Under these conditions the trajectory of a point mass with an initial upward velocity will be a parabola, illustrated with the included diagram. Horizontal: time ; vertical: height

The following diagram displays two graphs, the red one shows $E_k$ as a function of time, the green one shows $-E_p$ as a function of time (note the minus sign). The two graphs are for the case of the true trajectory. (The choice of zero point for the potential energy is arbitrary; here the point of zero height has been chosen as point of zero potential energy.) Horizontal: time ; vertical: energy

At every point along the horizontal axis the two graphs are parallel to each other. At every point in time the rate of change of kinetic energy must be an exact match for the rate of change of potential energy, otherwise there would be a violation of conservation of energy. If the potential energy is increasing the kinetic energy must be decreasing in step.
In mathematical physics the integral over time of the sum of the two graphs is called the 'Action', the standard notation for the Action is 'S'. (I like the mnemonic S=Summation). In the diagram this integral is represented as the shaded area.
The Action has the following mathematical property:
for the Action between two points in time: for the true trajectory the Action will be least.
In the diagram the starting point is -1, and the end point is 1.
In mathematical notation:
$$ S = \int_{-1}^1  (E_k - E_p)dt $$
(The above is a minimized version of a discussion of Least Action on my own website.)
In mathematical physics it has been demonstrated that this is generally valid. This for-the-true-trajectory-the-action-is-least is valid for all functions for the potential energy. (Well, it's valid for cases where the potential energy is a function of position.) For any potential energy function: for the true trajectory the value of the Action will be an extremum (either minimum or maximum). Thus a problem that presents itself as requiring differential calculus has been restated in terms of a problem in variational calculus.
Since the function for the potential energy can by any function only one common factor remains: the function for the kinetic energy, $\frac{1}{2}v^2$.
With that I have arrived at my question:
Is this behavior unique to the function $f(x)=\frac{1}{2}x^2$?
Is there a very straightforward way to demonstrate what gives rise to that property?

The reason I'm submitting this question:
A recurring question on physics.stackexchange is: 'why on earth do you have to subtract the potential energy from the kinetic energy to find the true trajectory'. The presence of that minus sign is felt to be a very puzzling, inexplicable twist.
Physics textbooks do provide mathematical proofs that Newton's second law and the principle of least action are mathematically equivalent. However, these proofs proceed in a very indirect way (using, for example, integration by parts). As a consequence, these proofs do not shed light on why that minus sign is there, and why least action should give the true trajectory. To the puzzled physicist it is indistinguishable from magic.
That is my main purpose: can this area of mathematical physics made more transparent? An important contribution to that would be to demonstrate in a straightforward way that it comes down to a property of the function $f(x)=\frac{1}{2}x^2$.
General disclaimer:
It is widely known that the historical name 'least action' is awkward. For the sake of keeping the wording simple I have referred to the-action-is-least. Of course correct wording would have been the-action-is-an-extremum; depending on what the function for the potential energy is it can be either a minimum or a maximum.

[LATER EDIT] (10 hours after posting the question)
On my own webpage I discuss the least action mathematics in a purely visual/graphical manner. It's like proving Pythagoras' theorem with a purely visual/graphical proof. On my webpage several of the diagrams have a slider so that the reader can change a parameter's value and see what difference it makes.
An integral can be represented algebraically, but it can also be represented as a shaded area on a diagram. Is it possible at all to demonstrate the validity of least action mathematics in a purely visual/graphical manner?
Answer: If $S=\int_a^b L dt,\,L:=T(\dot{x})-V(x)$, then $S$ is stationary iff $T'(\dot{x})\ddot{x}=-V'(x)\dot{x}$, so $T+V$ is conserved. (Note that $T'(\dot{x})\ddot{x}+V'(x)\dot{x}=0$ is both an Euler-Lagrange equation and the energy conservation condition. The $-$ sign you're worried about essentially comes from $\frac{d}{dt}\frac{\partial L}{\partial\dot{x}}\color{red}{-}\frac{\partial L}{\partial x}=0$.) So no, the choice $T=\frac{1}{2}mv^2$ isn't unique in that respect. It does have the advantages, however, that (i) $T$ is minimised at $v=0$ and (ii) the equation of motion simplifies to $m\ddot{x}=-V'(x)$, provided $m$ is constant.


Way to extract Minecraft player coordinates in real time?

Question: I want to find the "file" or the data that has my current coordinates and use my real time coordinates to be read by a program I'm designing in an IDE. Is there a way to do find my player coordinates in real time? I've looked into NBTExploerer, but it looks like it only saves my coordinates when I quit the program.
Comment: I could be totally wrong, but I imagine there isnt a file that has this. If there was a file that constantly kept track of the players coordinates, it would need to constantly be written too every time the players coords change, even if its a decimal change. With players running or flying very fast, it would potentially be written too thousands of times a second which would probably destroy most computers and make the game very very laggy. Maybe its feasable if it was done on another thread, but again I feel like eventually if the user moved too fast for too long the cpu would still overload.
Answer: The game saves about every 45 seconds, so this would be the best accuracy you'd get reading the player.dat file. If you want real-time, probably the easiest approach would be to play on a server and plug your program into the communication, e.g. modifying an open-source tool like Bungeecord which acts as a proxy merging multiple servers. Extracting the player position from the client-server communication would provide you with best real-time accuracy.
Answer: I'm not sure if you need right-this-millisecond accuracy on the positions. Sampling the position once per second would be significantly easier, and probably less wasteful in terms of resources and data usability.
That being said though, there are two types of solutions that come to mind. Push, or pull. Either way would require the use of a custom mod. The mod could

Push

Sample the data and push it through a socket/RMI connection that you've opened in the IDE.

Pull

Have the IDE extension poll the current position at the frequency you want, making the mod just a "give me the position now" provider. The mod would then become either an RMI target, or a server socket, or something similar.

How to do those things I think might be a question better suited for game dev/stackoverflow.
Answer: I only use Java Edition, so haven't tried this, but Bedrock Edition appears to have a coding interface described here: https://minecraft.wiki/w/Code_Connection
Comment: That page is empty btw.


In AngularJS, why does putting presentation logic (such as jQuery) into controllers negatively affect testability?

Question: I'm new to Angular and to coding from a 'testing' mindset.  I understand that putting presentation logic into controllers is not the 'Angular Way,' but don't understand why it negatively affects testability.
Comment: that is a good question. I often wondered myself, but I do follow the rule. It should be in a directive, because you can compile a directive and test it.
Answer: Because it puts a reliance on there being a DOM to test. You should be able to test controller logic without needing to create a DOM because you should just be mocking the dependencies and then testing the data in the constructed view model.
Testing aside, controllers job in life is to marshal data, they do not know about views, all they know about is a view model and they should only call backend services and then shape that data to be presented to the view. If you are doing anymore than that in your controllers you are not following the design pattern properly.
If you find yourself writing business logic in controller you should think about refactoring that logic out into services. Controllers should be nice and lean, only marshalling the flow of data between services and the view model.
Answer: I would say it should be in a directive because you can test that easily with a unit test with a fragment of HTML being compiled. I hope someone has a better answer than that.


I can't color my shapes. How to make it work?

Question:
I can't color my shapes. I'm new and I don't know why it doesn't work. I need help.
Comment: Hi and welcome to GDSE! We need more information to be able to answer your question. Please edit the question and give us more information. At least tell us which application you are using (add the correct tag) and post a screenshot showing the entire screen instead of a photo of part of the screen. We probably need to see the entire shape and (depending on application) the layers and/or other relevant tool windows.
Comment: Based *solely* upon the cursor in the photo.. I'd guess Illustrator and Live Paint Bucket.. are the shapes (paths) selected? They need to be *selected* to use the Live Paint Bucket tool.
Comment: I only can sélect the shzpe but i can't color the interiour
Answer: I think Scott's right - based only on the cursor there, looks like a recent version of Illustrator and Live Paint.
And if so, Scott's comment is the only correct answer - you must select the items you're converting into a Live Paint Group - then it all works just as it says on the tin.
Two curves overlaid - both selected.

Live Paint tool hovering pre-click over selected curves.

First click defines them as a Live Paint Group.

Next click colours area beneath cursor with whatever is loaded in your colour palette.

Hope this helps.


Lifetime of a cursor in Oracle

Question: If I open a cursor and forget to close it, for how long will the cursor exist in Oracle?
Are there some settings to configure the lifetime of the cursor?
Answer: As well as DCookie's answer:
The general pattern of a cursor lifetime is
OPEN
BIND
EXECUTE
FETCH...FETCH...FETCH
BIND
EXECUTE
FETCH...FETCH...FETCH
...
CLOSE

That is a cursor can be re-used by binding fresh variables to it and re-executing it.
PL/SQL will also maintain a cache of cursors, at the session level, to avoid the overhead of re-opening a cursor you have recently closed. So a cursor you have programmatically closed may still be open. Oracle will close them behind the scenes when appropriate.
If a cursor goes out of scope, it can be closed. That is if a call or procedure is like:
DECLARE
  CURSOR c_1 IS SELECT ....;
BEGIN
  OPEN c_1;
  FETCH c_1 INTO...;
END;

then once it has finished executing, c_1 goes out of scope (and cannot physically be called again) and can be closed. This is especially useful for exception handling, since it is possible for an exception to be raised, jumping out of the procedure and bypassing all your 'CLOSE c_1;' code. By closing the out-of-scope cursors, you don't have to worry about adding exception handling code to do that.
If your cursor has a session scope (eg defined in a PL/SQL package specification or global level of a body or returned to a client through a ref cursor) it never goes out of scope in this way, so would never be automatically closed until the session disconnects or through a DBMS_SESSION.MODIFY_PACKAGE_STATE(DBMS_SESSION.FREE_ALL_RESOURCES);
Answer: I believe it lives until your session goes away or closes it.
You can configure the lifetime of the cursor by closing it when you're done with it ;-)
Seriously, relying on some setting to close your cursors for you just hides problems and promotes lazy programming. It could also have a detrimental effect on any process that legitimately needs to keep a cursor open a longer period of time.

Lifetime of a cursor in Oracle


How do I unpublish a user's content with rules?

Question: How can I unpublish a certain user's content when a certain rule triggers?
Answer: The configuration would look like this:

Build a view that, when given a user ID as input, lists all the
nodes that that user has posted.
Use view style bulk operations, and select the action unpublished
node.
Set up a rule that triggers on user updates. (Is there one? I'm not
sure...) As condition, compare the roles before and after user save
to see if anything should be unpublished. As an action, let it call
the view from.

Use this idea you can do that
Comment: Thank you for your comment. I am not very experienced with rules so I will have to look into this. But this seems like the right way to go.
Answer: Here is a summary of what you'll need to get it to work using the Rules module:

Keep track of all node IDs of a user that need to be unpublished later on (= "when a certain rule triggers"). For this add an entity reference to the user's profile (multiple values allowed). And each time a node gets saved, you need to add the reference to that node as an extra value in this entity reference field (= Rule 1). So basically this is the "queue" of nodes for a user that need "post processing" after your "certain rule triggers". It is will serve as your entry point starting from the user's id to "access (find) the exact node ids again later on".
Create a Rules component (= Rule 2, though of type "component") with parameter just a "node id". All this Rules component has to do, is to "unpublish" the node indicated in the parameter. But you can add any Rules "Conditions" also if you'd need any (already now or later on if requirements change). E.g: only for specific content types or user roles, etc.
Create a rule (= Rule 3) containing a Loop that should be triggered ""when a certain rule triggers". The goal of this rule is to loop over each of the nodes in the reference field from Step 1, and in each iteration of that loop you use an action which is to invoke the Rule Component as detailed in Step 2 (and which uses the node id as a parameter). By using a Rules Component, you'll be able to add any "Conditions" you might need inside the "Loop".

Video tutorials
If you're not familiar (enough/yet) with using Loops in the Rules module, then watch the video about List and loops.
For a video that is fairly similar to what's needed in step 2 and step 3, refer to the 2nd video (= Solution video) about Creating multiple back links. Some more details about how your scenario slightly differs from what is shown in that solution video:

You are creating an entity reference to nodes also, but from a user (not a node).
You only need the first parameter (= Node to link to) in your Rules component (you don't need the 2nd parameter).
Comment: Thank you for this answer. It will take me some time to work through learning rules well enough to be able to do this, but it does seem like something like this could work.
Comment: Great! It's really worth the investment to learn Rules ... trust me ... And when you look at the suggested videos, have a look at the entire series ... and/or look at some of my other answers to illustrate all the things you can do with rules. None of them require any (repeat any) custom PHP code ... read: pretty forward to upgrade to D8 also ...
Answer: Yes you can Unpublish the user content by Rules Module,
you can do by lot of possibilities, like: if user is deleted then Un publish the content of user, If user is In active then Unpublish the Content of the user.
Hope this one will help!!


How to prove that the trace of n-qubit matrices satisfies ${\rm Tr}(XY)=2^n\sum_{M\in\{I,X,Y,Z\}^n} x_M y_M$?

Question: It is known that for n-qubit matrices X, Y $\in \mathbb{C}^{2^{n}\times 2^{n}}$ (and Pauli matrices $I, X, Y, Z$) such that
$$
X = \sum_{M \in \{I, X, Y, Z\}^{n}} x_{M}M_{1}\otimes ... \otimes M_{n}
$$ and
$$
Y = \sum_{M \in \{I, X, Y, Z\}^{n}} y_{M}M_{1}\otimes ... \otimes M_{n}
$$
their trace is
$$
Tr(XY) = 2^{n} \sum_{M \in \{I, X, Y, Z\}^{n}}x_{M} y_{M}
$$
and we can thus use the trace to calculate the coefficients $x_{M}, y_{M}$, but how do we know that is true? I understand that for all tensor products where $M \neq I$ the trace is zero but where exactly does the $2^{n}$ come from, and why is there still a summation in the trace if the tensor product only yields a non-zero trace for one scenario?
Answer: Letting $\sigma_j$ for $j \in \{I, X, Y, Z\}$ denote a Pauli matrix, its easy to verify the identity
\begin{equation}
\text{Tr}(\sigma_i \sigma_j) = 2 \delta_i^j \tag{1}
\end{equation}
since $\sigma_i \sigma_j$ give the identity when $i=j$ but gives another non-identity Pauli operator (i.e. traceless) when $i \neq j$. Now its straightforward to show
\begin{align}
\text{Tr}(XY) &= \text{Tr}\left(\sum_{\mathbf{i}\in\{I,X,Y,Z\}^n} x_\mathbf{i} \sigma_{i_1} \otimes \cdots \otimes \sigma_{i_n}  \sum_{\mathbf{j}\in\{I,X,Y,Z\}^n} y_\mathbf{j} \sigma_{j_1} \otimes \cdots \otimes \sigma_{j_n}\right)\tag{2}
\\&= \sum_{\mathbf{i},\mathbf{j}\in\{I,X,Y,Z\}^n} x_\mathbf{i} y_\mathbf{j} \text{Tr}\left(\sigma_{i_1}\sigma_{j_1}  \otimes \cdots \otimes \sigma_{i_n} \sigma_{j_n}\right)\tag{3}
\\&= \sum_{\mathbf{i},\mathbf{j}\in\{I,X,Y,Z\}^n} x_\mathbf{i} y_\mathbf{j} \prod_{k=1}^n\text{Tr}\left(\sigma_{i_k}\sigma_{j_k}\right)\tag{4}
\\&= \sum_{\mathbf{i},\mathbf{j}\in\{I,X,Y,Z\}^n} x_\mathbf{i} y_\mathbf{j} \left(2^n \prod_{k=1}^n \delta_{i_k}^{j_k} \right)\tag{5}
\\&= 2^n \sum_{\mathbf{i},\mathbf{j}\in\{I,X,Y,Z\}^n} x_\mathbf{i} y_\mathbf{j} \delta_\mathbf{j}^\mathbf{i}\tag{6}
\\&= 2^n \sum_{\mathbf{i}\in\{I,X,Y,Z\}^n} x_\mathbf{i} y_\mathbf{i} \tag{7}
\end{align}
And so the $2^n$ comes from $\text{Tr}(\sigma_I)=2$ and the fact that every pair of terms between $X$ and $Y$ is either orthogonal or multiplies to $I_{2^n} := I \otimes \cdots \otimes I$ (with trace $2^n$). The sum remains because there are actually $4^n$ different pairs whose product is $I_{2^n}$. For example with three qubits, multiplying $x_{III} I_8$ with $y_{III} I_8$ results in an operator with nonzero trace, but so too does multiplying $x_{IXY} (I\otimes X \otimes Y)$ and $y_{IXY}(I\otimes X \otimes Y$), and so on.
Answer:
where exactly does the $2^n$ come from

If you have a term in the product where all the Paulis are the same from both the $X$ and the $Y$, then you're left with the $2^n\times 2^n$ identity matrix. This has trace $2^n$.

why is there still a summation in the trace if the tensor product only yields a non-zero trace for one scenario?

When you multiply $X$ and $Y$, there are two summations (better to use different summation indices to make it super-clear!). The fact that the trace identifies equal terms accounts for one of the summations, leaving your answer with one summation.


Filament lifts from the hot bed while printing

Question: I have a Tevo Tarantula 3D printer.
I'm trying to print a calibration cube.
The slicer is Cura and is set for a 1.75 mm filament extruded by a nozzle of 0.4 mm, with a heat bed temperature of 60°C and extruder 200°C.
As seen in the image I stopped the printer after a minute, when I noticed that the filament wasn't sticking to the hotbed.

I've also made other tests, but the result is the same - the upper right part of the print lifts and touches the moving nozzle.
How could I resolve this? Any advice?
Comment: Is the print bed clean? Is the print bed actually reaching the correct temperature? Have you manually calibrated the printer (at both the center and the edges), such that you can just about get a sheet of paper between the print bed and the hotend nozzle, at z = 0? This last check ensures that the first printed layer of extruded filament is actually touching and "presses on" to the print bed. Maybe the filament, for the first few layers, should be heated at a high temperature, than the rest of the print, to ensure adhesion.
Comment: The bed should reach the correct temperature, that is measured by a thermo resistor and displayed on the printer LCD as 60°C.
Yes, I've manually calibrated the printer, maybe I should check again doing this trial with a paper sheet.
A thing that I didn't do was to clean the bed, maybe this should do the trick.
Comment: What kind of filament are you printing? What is your first layer hight? What is your layer pattern? Did you clean your print bed with something to remove fingerprints, dust and oil?
Answer: Check the following:

Is the print bed clean? On glass, you can use a few squirts of window cleaner.
Is the print bed actually reaching the correct temperature?
Have you manually calibrated the printer (at both the center and the edges), such that you can just about get a sheet of paper between the print bed and the hotend nozzle, at z = 0? This last check ensures that the first printed layer of extruded filament is actually touching and "presses on" to the print bed. See the video #18:Calibration for a great explanation on the use of the paper. Whilst this video is for a Delta printer, it clearly demonstrates the height that the zeroed print head should be at, and how to check using a sheet paper.
Maybe the filament, for the first few layers, should be heated at a high temperature, than the rest of the print, to ensure adhesion.

If all of the above are checked and OK, then (as electrophile points out in their answer) try making the print head more grippy. This can be achieved by simply adding a thin coating to the glass with one of the following:

Wiping the glass with a glue stick or wood glue
Using hairspray

Both use PVA as an adhesive/stiffener.
Or by adding an additional print surface, such as:

Using blue painters tape
Using PEI tape
Using Kapton tape
Using BuildTak

If adding tape, then the printer may require a small re-calibration, due to the thickness of the tape adding a few microns to the print bed height. This can be done in the firmware.
Answer: I don't have this specific printer but this used to happen to me as well on my D-Bot. The reason being bed not being leveled properly. Ensure that your bed is leveled such that the distance between the nozzle and bed is about 0.2mm after homing. Also coat your bed with something sticky like glue or hairspray. You won't need this if you are using a PEI sheet.
Answer: I've cleaned the heated bed as suggested using ethanol,
then I've tested the Z distance of the nozzle from the bed with a paper sheet and it was ok. Lastly, I tried to raise the temperature of the extruder for the first layer to 215°C. I think that this did the trick.
Answer: With PLA I normally run the bed at 70 and the extruder at 190. Make sure the bed gets to temperature before you start and use gluestick on the bed.
Answer: material sticking problem can be due to following reason:

bed level
bed temperature
z motion calibration (ex if not calibrated layer height is 0.2 and z move 0.4 then material cant stick on bed)
bed surface (for sticking first layer on bed what you use)

remove all above reason step by step

first confirm bed level
bed temperature according to material (pla - 70 , abs - 100 )

all above option are good but warpping chance are higher
for last bed surface you have following option to use

use paper tape
use Kapton tape
glue stick
use paste  (accetone + abs) abs melt into accetone and it become like cream and you can apply on bed after bed heating

if you are using last option then just confirm bed level again before start print


Issue when running ionic cordova run android with Android Studio 3.0

Question: I'm having an issue when i run "ionic cordova run android" after updating Android Studio.
I already find how to work around this problem with this solution:
Unable to run Ionic app after update to Android Studio 3.0
However, when i do it this way, i have to run or build android and get an error, and after getting this error, change the file build.gradle in android studio in the way is suggested in the topic above.
I wanted to know if someone knows how to make "ionic cordova run android" command running as it did before, without having to enter in Android Studio to correct the build.gradle
Thanks for helping!
Answer: Ok, i found a solution.
I was using cordova-android: 6.3.0. I updated the version to 7.1.0 and then changed this line in the config.xml
before was:

<preference name="android-minSdkVersion" value="16" />

Now i'm using:

<preference name="android-minSdkVersion" value="19" />

This way, ionic cordova run android is working again!


Add multiple columns to the Master Problem in a column generation approach

Question: I have read several times now that with a column generation approach in the subproblem you do not necessarily have to look for the column with the lowest negative reduced cost, but only one with negative reduced costs. And that it is often worthwhile to add several columns with negative reduced costs to the master problem. I am now wondering if there is a guideline on how many to add and how to find several of these reduced columns at once
Answer: Usually, you should add as many columns as you can generate. It is better if columns are diversified, i.e., "cover" different constraints in the master. The best is to add sets of columns forming a complete solution of your problem, but this may be tricky to do and/or more time-consuming. Also, when you add many columns, you should definitely clean up master from non-promising columns, for example those with a high reduced cost.
The question how to generate many columns is problem-dependent, and this may be a research question for new problems. For example, if your pricing problem is solved by dynamic programming (DP), one way is to apply bidirectional search, thus you will have a lot of candidates when you perform the concatenation phase of the DP algorithm. In this view, solving the pricing problem by a MIP solver is not usually a good choice, partly because MIP solvers will not give you a lot of solutions.
Comment: Probably, "add as many as you can generation" is an overestimation. Usually, it depends on the time it takes to solve the pricing problem. If it is fast, then several dozens would be enough, if it is very slow then you can generate up to one thousand (if it does not hurt much the solution of the restricted master LP).
Comment: I would also note that in the '00s and '10s, it was common to have a fixed-size column pool, and you would add columns to it, but when it was full, you would remove columns. Common criteria were poor reduced cost (as Ruslan says) or removing columns that had not been basic for a large number of iterations. I don't see this used much nowadays, possibly because RAM is aplenty and solvers are better at disregarding bad columns without the user intervening.
Comment: Yes, the column pool may be used if adding all your columns to the master make it much slower. So, you can use the column pool to add more columns on each col.gen. iteration. It is important however, to use it only as a complement for running the pricing problem. If you add only columns from the column pool, this may hurt the convergence.


How do I breed a tame donkey?

Question: Ok so I have this town world and I own a horse pasture. I have two donkeys (both tamed) that I would like to breed; however, I have tried feeding them wheat, apples, carrots, etc but they will not even eat it, much less breed. The internet said carrots, but I have already tried that, as stated above. I'm not sure if it is just a glitch or what.
Answer: I found this info from here on how to tame horses. You can tame a donkey using the same method to tame a horse:

To tame a horse, approach it with nothing in your hand and right click on it. You will now be riding the horse&emdashfor a second or two, until it throws you off. Try again, and again, until finally you see some red hearts and the horse lets you stay on.
It usually takes 3–5 attempts, but you may be luckier or unluckier than that. You can make the process quicker by feeding the horse first.

In addition:

Only tamed horses can be bred. To make horses breed, feed them golden apples. They will go into "love mode" and make a baby.

I also found this information from the Minecraft Wiki, which states that two donkeys can be bred together in the same fashion as breeding horses:

Breeding two donkeys creates a donkey foal. Since all donkeys have the same texture, the offspring will look exactly like its parents when it is fully grown.
Comment: Yes, they are already tamed and in a fenced in area. I didnt think to try golden apples, the websites I looked on never mentioned them. Thank you
Comment: @Nerdgirl02 If you think this answer is the best answer, you can select it by clicking the green checkmark next to the answer, or if you do not, you can wait for more answers

How do I breed a tame donkey?


Add roles to accounts

Question: Is it possible to add different role to the accounts? I mean some accounts can do more things on the chain than other. How it is possible to do?
Answer: If you describe what you're trying to build it may help for me to give you a more concise answer.
Generally speaking, if you're building a pallet you could have a StorageMap in that pallet that holds role -> account. Just keep in mind that storage and storage iteration is expensive on blockchains and it is preferred that you abstract the role to a layer higher than the blockchain (if you can).
Another common pattern in Substrate is to define an Origin in your pallet config that have designated permissions e.g. AdminOrigin and when you configure your pallet in the runtime, you set the AdminOrigin. Example here.
You can also create custom origins and do origin checks.
Nice video here covering custom origins on Pallet Collective.
Depending on what you're trying to achieve a SignedExtension may be the way to do it.
Answer: There are many ways to achieve this. Burno has mentioned one.
You can even do this without defining an origin.
For example, the pallet-staking: after calling bond(), you become a staker. If you call validate() afterwards, you become a validator. And if you call nominate() after that, you become a nominator.
Furthermore, you can check the pallet-identity's code. Once you become a identity registration merchant, you have the ability to authorize other accounts.
Basically, all you need to do is define a storage for storing those special accounts. Once a user makes a certain call, you can check if they are in the storage. If yes, then perform the desired action; if no, return an error indicating insufficient privileges.

Add roles to accounts


Additional energy / matter from parallel universes

Question: If our universe was a zero-energy universe, what would happen if someone would transfer energy / matter or bring objects from parallel universes to our universe? What would be the consequences?
Comment: I highly recommend Dr. Asimov's excellent book " The Gods Themselves"  which in large part deals with exactly what your question asks.                                                     See: https://en.wikipedia.org/wiki/The_Gods_Themselves#:~:text=The%20Gods%20Themselves%20is%20a,If%20as%20three%20consecutive%20stories.
Comment: I recently asked a question about matter from another universe, the answers and comments may be of interest https://worldbuilding.stackexchange.com/questions/179105/is-there-any-guidance-how-my-matter-from-another-universe-should-behave
Comment: @Joe I totally agree, it is a brilliant book.
Comment: There is a theory that if we understand enough of the universe, it grows more complex. Maybe it happens here too. But as it's all unknown, any matter or energy will behave as you want it to behave.
Comment: It entirely depends on the nature of the other universe, and the laws of physics there, and the form that matter/energy takes there.
Comment: Fictional sort-of example: In the webcomic Narbonics, time-travel is possible, if you transfer the entire energy of a parallel universe to power it.
Answer: Since direct interaction with parallel universes is totally out of bounds for current science, you can basically do whatever you want. Make up your own laws, because we currently have no way of scientifically determining what would happen in such a scenario.
If you're completely stuck, here's an idea for a way to preserve the zero-energy property of separate universes while still allowing matter transfer:

The process of transferring matter from one universe to another requires as much energy as is stored in that matter, as calculated by the formula $E=mc^2$ (and this consumed energy is released into the universe from which the matter was taken).

Pro: this would mean that each universe maintains the zero-energy property, which is nice.
Con: moving even microscopic objects between universes will require an astronomical amount of energy, which probably isn't feasible.
Pro: although moving matter between universes will be hard, you can certainly transfer information much more easily. So you might be able to Zoom with someone in an alternate universe, but not meet them in person.
Answer: If you transfer it through a GR wormhole, the consequence is that the wormhole mouth on your end gains negative mass to balance the positive mass of the stuff you are bringing in, while the mouth on the source end gains positive mass. If you don't keep the flow of material roughly balanced in each direction, the source mouth will eventually be enveloped by a black hole, turning the destination end into a white hole, and you will only be able to send material and information one-way.
My recommendation would thus be to not try to import large amounts of energy, but merely to import sources of low entropy, and dump your high entropy waste back into the other universe to balance the books.


How can I export the developer story/CV as Markdown?

Question: There used to be an option to export the CV as Markdown (MD):

User's page - Edit CV - Settings - Create MD

I cannot find that link any longer - how can I get the MD export?
Comment: @Kit Any news on this topic? Any other possibility to export the "raw" text data?
Comment: This is not currently possible with Developer Story but we're looking at improvements to the export feature. I'll update you about the priority of it shortly.
Answer: It's possible to export a JSON copy of your Developer Story (CV) using the third-party tool https://developerstory.dev/stackoverflow.
The export includes Markdown formatted descriptions for each of the items in your timeline which you could then copy to use elsewhere.
Answer: It is possible to export your developer story as .json using the MAC format and docker in less than 5 minutes.
Use this command:
docker build -t getmanfred/dev-story-scraper https://github.com/getmanfred/dev-story-scraper.git#main && \
docker run -p3000:3000 -d getmanfred/dev-story-scraper && \
curl 'http://127.0.0.1:3000/?username=<profile_user_name' -X GET > MAC.json && \
more MAC.json

It works like a charm and is based on the opensource parser version used by Manfred, but you don't have to use their front-end, so your user and data will remain unknown.

Note: you should turn your profile public for the export to work.
MAC .json format is also a community based open source format for CV. And it is possible to import them directly in the creators website, and I hope in many others sites in the future. Information in MAC format will always remain in your control, and synchronized with github repository if you want.
You can read additional information in this blog post


Is heat released during work due to ATP breakdown or a increased blood flow?

Question: Is heating up of a body during work or exercise an effect of increased speed of blood or is it because of the extra energy released while harvesting energy from the ATP
Comment: @another'Homosapien' - I figure that increased blood flow is due to increased heart rate, which means burning more energy, which must involve ATP hydrolysis. I suppose I could have included those steps in my first comment...Does this make sense to you, though?
Comment: ATP breakdown is the major cause of it. The body can use 45-55% energy liberated by ATP hydrolysis, and the rest part dissipates as heat.
Comment: Additionally, increased blood flow occurs as a result of increased ATP hydrolysis.
Comment: @Forest umm I doubt it. Any reference for that?
Comment: @another'Homosapien' I'm not sure why the first suggested edit you made was automatically rejected, probably because I was editing my own post at the time. Could you please suggest that original edit again and I'll approve? Thanks!
Comment: @Forest as you say "increased heart rate, which means burning more energy" the only thing I can conclude from this is that increased heart rate leads to more ATP hydrolysis. So ATP hydrolysis seems more like a result than a reason for increased heart rate.
Answer: Is heating of a body the result of increased blood flow or extra energy from ATP?
It is mainly because of the breakdown of ATP (Adenosine Triphosphate, a type of nucleic acid with an Adenosine base, a Ribose sugar, and 3 Phosphate groups), alternatively and more formally known as ATP Hydrolysis. During hydrolysis by water, ATP splits into Adenosine Diphosphate (ADP) and an inorganic Phosphate (Pi), releasing some energy. I'll explain more below how exactly this works.
How or why does ATP Hydrolysis release energy?
If you take a look at a diagram of an ATP molecule, you'll notice that it has 3 phosphate groups, each with a Hydroxyl group (-OH) that has a net negative charge due to Oxygen being highly electronegative and hogging electrons from the Hydrogen bonded to it. Consequently, you have 3 molecules with slightly negative charges attached to each other. If you've ever played with magnets, you'll know that like charges repel. So overall, the ATP is highly unstable because of these repulsive forces that are situated so close to each other. When the bond between the 2 inorganic phosphates is broken, a large amount of energy is released. Here's a diagram from Campbell's Biology 9th ed (note that the Hydrogens in the phosphates are not shown for simplicity):

When the last phosphate is broken off, you are left with one molecule of Adenosine Diphosphate (ADP) and an inorganic phosphate group (Pi). Energy has been released. However, this is not the entire story. Generally speaking, ATP Hydrolysis does not occur without another component: an endergonic process. An endergonic metabolic process is any which requires energy input in order to proceed. Think of it with the following analogy: imagine a ball trying to roll uphill by itself. At the bottom of the ramp, the ball is very stable and has low potential for performing work. But uphill, the ball would have a higher potential energy. It is impossible for the ball to roll uphill from a state of low energy to a state of high energy. Thus, we first need an input of energy--say the mechanical energy of our hand pushing the ball--in order for it to move up.
Our endergonic process (such as in protein synthesis by a ribosome or the phosphorylation of glucose in glycolysis, the first step of cellular respiration) requires some energy input from ATP in order to proceed in an exergonic manner--that is, in order to release energy without any help. With our analogy, this is like pushing the ball to the top of the ramp and then letting go, allowing the ball to roll back down from a state of very high potential energy (and therefore instability) to a state of low energy. The energy that we had to input from ATP is known as "activation energy", because it's literally energy that we need in order to unlock or "activate" an endergonic pathway.
Example of ATP Hydrolysis releasing heat:
When you have an infection in your body, your hypothalamus will raise the body's set temperature point to induce shivering. Shivering consists of many muscle contractions, all of which require hydrolysis of ATP. The result is a release of a large amount of heat that increases body temperature to a point at which pathogens cannot survive.
What about blood flow?
Blood flow does not actually produce heat by itself, but it can direct heat to the surface of the skin, such as when the body needs to cool down. The main source of heat in the body remains the ATP.
EDIT: much of the information here can be reviewed in this wonderful YouTube video by Andrew Douch
Comment: I'm afraid this is not very accurate. ATP is only one form of energy in metabolism, and ATP hydrolysis is thought to be only about 1/3 of heat loss in typical oxidative metabolism; respiration itself, ion gradient dissipation, and ATP synthesis make up the larger part. Note that this concerns *heat*, for *free energy*, ATP utilization is indeed the major portion. The details of ATP structure and activation energy are not really relevant here, this is a question of thermodynamics.
Comment: My apology if the post is not helpful to the OP. I was just trying to be thorough so that I wouldn't have to explain various things in multiple posts. I felt like ATP structure was relevant, since structure is related to function and the OP's question was related to ATP function in heat production. Also, I'm about 99% sure that ATP's role in metabolism and activation energy are fairly relevant to thermodynamics. I was just trying to explain "how" exactly the heat is produced, since I've had far too many teachers who just tell me "well, it just does".
Answer: Is heat released during work due to ATP breakdown or a increased blood flow?
Short answer: neither. Most of the heat generated is due to poor efficiency of metabolism.
It is a common misconception that ATP is the same thing as energy when it comes to metabolism. ATP is certainly a very important energy carrier, but human metabolism is far from efficient at capturing the energy in nutrients in the form of ATP. A large fraction of the energy stored in sugar, fat, or other substrates is lost as heat already in the process of making ATP, much in the same way a car engine runs warm because most of the energy in gasoline cannot be captured in a useful form.
It is thought that most of the heat produced during oxidative metabolism (as in muscle contraction) occurs during respiration and ATP synthesis in mitochondria. This is probably because the mitochondrial respiratory chain involves physical pumping of protons across membranes (chemiosmosis) which causes a lot of "friction" (rougly speaking). This review estimates that only about 1/3 of the heat generated comes from ATP utilization and downstream processes, like actin-myosin contractions. It is difficult to quantify heat loss in metabolism, so I think all estimates should be taken with a grain of salt, but I think this general picture is correct.


Make some space in Sharepoint office 365

Question: "I have SharePoint office 365 online and there are few sites in the SharePoint and now I got the message that This site is almost out of storage space. To free up space, delete files you do not need and empty the recycle bin.So I deleted items from Recycle Bin to create the space, but it does not help me much except to create some Mb space in SharePoint.  So my question is that  I have many videos in my SharePoint site those I can move somewhere in SharePoint or in office 365 but I do not want to delete any of those videos and user can see anytime when they want. So how can I make the space in SharePoint.  Looking forward to have your ideas.  Thank you
Answer: Please try the following 2 methods to see if the issue can be solved.
Method 1. Change the site collection storage management to automatic(In SharePoint admin center > site collections, make sure you have enough space for your site. Then try below method):

Go to SharePoint admin center -> settings.
Set Site Collection Storage Management to Automatic.

Method 2. Use PowerShell to set the site collection's storage quota manually.

Set up the SharePoint Online Management Shell Windows PowerShell environment.

https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps

Run SharePoint Online Management Shell as administrator.
Run Connect-SPOService and enter your SharePoint admin center's URL and your admin credentials.
Run the following command to change the site collection's storage quota:
Set-SPOSite -Identity  -StorageQuota 1048576
Comment: Thank you so much for your replay.  My question  is the site is already managed and there are videos file which we want to move somewhere else so It cam make in our site but user should be able to see those files. Thanks again!!
Comment: You can create a new site to keep the files and allow anonymous access in this new site so that users should still be able to see these files.
Comment: Really good idea, Thansk again!
Comment: If you think my suggestion is helpful, you could accept it as an answer.


Video is playing in omxplayer - now how do I control it?

Question: I'm new to Pi and Linux.
I'm running Raspian on a Pi3 and have managed to play a video from the file explorer by entering omxplayer in the command line option.  Now my video is playing but I have no control over it or my system, I can't find a way to stop or kill the video. I can see the left and right edges of the gui (the video is 4:3 centred over the top of it) but have no idea what I can do to regain control.  I'm using a bluetooth mini keyboard/mouse controller but no key combinations seem to have any effect on the omxplayer.
Can someone give me any idea on a) how to kill the video, and/or b) how to launch omxplayer properly so I can control the video playback and quit when I want, and/or c) recommend another player?
Thx,
James
Comment: omxplayer key bindings shows hits.  Could you confirm which ones work and which one don't?
Comment: I use VLC for my pi, I never had a problem
Comment: Sorry, I'm not sure what you mean by "key bindings shows hits" ?  No keys seem to be having any effect on the omxplayer while the video is playing.
Answer: Late answer, but hopefully still useful:
The problem is that omxplayer needs to be launched from within a terminal window, so that the keyboard input can be directed from the terminal to the player.  Therefore, instead of specifying omxplayer itself for the command line, specify something like this:
xterm -e omxplayer -o hdmi -r %f
(If you don't have xterm installed, then install it: sudo apt-get install xterm)
This will launch xterm, and everything after -e will be passed as a command into xterm (%f is replaced with the filename of the video).
There are some other parameters to consider:  If the video is a different aspect ratio than your monitor, you'll likely see your desktop showing through the unfilled areas of the video. In this case, you can add:
xterm -fg black -bg black -fullscreen -maximized -e omxplayer -o hdmi -r %f
...which will maximize xterm and fill it with a black background, so that the desktop no longer shows through.  Alternatively, you might also try:
xterm -e omxplayer -o hdmi --aspect-mode fill -r %f
...which will zoom the video to fill the width or height of the display, whichever is larger.
Answer: It seems that you can control omxplayer from the keyboard but only if the terminal window from where you launched it is still active.  An inadvertent mouse click or other action can make the terminal window inactive.  You can still regain control by doing ctrl-tab multiple times until you have control.  For example you can terminate the video by doing alternate ctrl-tab's and esc buttons until it quits finally.


Determining Exact Reason for Facebook Error Code 100

Question: I am experimenting with facebook and trying to create an event, via the Graph API. I am using django and the python-facebook-sdk from github. I can successfully post to my wall pull friends etc.
I am using django-social-auth for facebook login stuff and have settings.py for permissions:
FACEBOOK_EXTENDED_PERMISSIONS = ['publish_stream','create_event','rsvp_event']

In the graph api explorer on facebook my request works so I know what parameters to use and, well, I am using them.
Here is my python code:
def new_event(self):
    event = {}
    event['name'] = name
    event['privacy'] = 'OPEN'
    event['start_time'] = '2011-11-04T14:42Z'
    event['end_time'] = '2011-11-05T14:46Z'

    self.graph.put_object("me", "events", args=None, post_args=event)

The code that is calling the facebook api is roughly: (also the access_token is added to the post_args which then is converted to post_data and urlencoded.
    file = urllib.urlopen("https://graph.facebook.com/me/events?" +
                          urllib.urlencode(args), post_data)

The error I am getting is:
Exception Value: (#100) Invalid parameter

I am trying to figure out what is wrong, but am also curios of how to figure out overall what is wrong so I can debug this in the future. it seems to be too generic of an error because I don't know what is wrong.
Comment: A python error or facebook graph api error? Can you post more of the trace if it's the former
Comment: Have you checked this http://stackoverflow.com/questions/2690971/how-to-add-a-facebook-event-with-new-graph-api ?
Answer: Not really sure how post_args works but this call did the trick
graph.put_object("me","events",start_time="2013-11-04T14:42Z", privacy="OPEN", end_time="2013-11-05T14:46Z", name="Test Event")
The invalid parameter most likely is pointing to how you are feeding the parameters as post_args. I don't think the SDK was ever designed to feed it like this. I could be mistaken as I'm not really sure what post_args would be doing.
Another way based on how put_object is setup with **data it would be
graph.put_object("me","events", **event)


What does "Knock on wood" mean?

Question: From the dictionary, it looks like it's some kind of ritual one does for luck, but I still cannot figure out when one would really knock on wood.
Comment: History of where the phraze come from would be nice.
Answer: Knocking on wood used to be a way of warding off suspected impending bad luck, and now it's used as a tongue-in-cheek sort of phrase for when someone has had a lot of good luck, meaning that the person should be careful to avoid the bad luck which may follow. The Phrase Finder says:

This phrase is used by people who rap their knuckles on a piece of wood hoping to stave off bad luck. In the UK, the phrase 'touch wood' is used - often jokingly by tapping one's head. The phrases are sometimes spoken when a person is already experiencing some good fortune and hope that it will continue - for example "I've been winning on every race - touch wood".
Origin
The derivation may be the association that wood and trees have with good spirits in mythology, or with the Christian cross. It used to be considered good luck to tap trees to let the wood spirits within know you were there. Traditions of this sort still persist in Ireland. See also - the darling buds of May.
The British version of the phrase - 'touch wood', predates the American 'knock on wood' and was itself preceded by a Latin version - 'absit omen', meaning 'far be that omen from us'. This dates from at least the early 17th century, when it is quoted by John Heywood in his collections of proverbs. It isn't clear when 'touch wood' began to be used as a token of good fortune but it must have been by 1850, when the academic correspondence magazine Notes and Queries published this:

There probably is some old English expression for averting evil, but it does not come to mind; "I touch wood," "Bar omen," "Bar ill-luck," seem clumsy.

'Knock on wood' is known from the early 20th century; for example, The Syracuse Herald, February 1905:

Neglecting to knock on wood may have been responsible for the weather's unseemly behaviour today.

Google Books shows a 1908 example:
Comment: By the way, *phrase* has an *s*, not a *z*.  Even Americans concede that.
Comment: In an ironic manner, not meant to be taken seriously. [The Phrase Finder](http://www.phrases.org.uk/meanings/tongue-in-cheek.html) has that as well.
Comment: Sorry but what does "tongue-in-cheek" mean?  I am pretty weak against such phrazes...
Answer: It basically means, "I know I might jinx myself". It reflects the awareness that what I say might be "famous last words". Some have considered it a way of "breaking the fourth wall". Great for describing sports predictions. To "jinx" refers to the power that spoken words have of counteracting the very thing they predict.
How to knock on wood:
Goofus: When the Rangers sweep the Canadiens, I'm going to take a week off work to watch the finals!
Uh oh! Goofus here is taking for granted the fact that the Rangers will sweep the Canadiens! But he is not protected from, either (1) the gods who hate hubris, (2) that life is but a stage, and has a penchant for dramatic irony, or (3) the magical power of spoken predictions to influence the world! He is in danger, in short, of being jinxed!
Gallant: When the Rangers sweep the Canadiens -- knock on wood -- I'm going to take a week off work to watch the finals!
See how, by knocking on wood and aknowledging those mysterious powers above, Gallant has not only insulated himself from those magical forces, but also the embarassing possibility of his freinds later bringing up this statement in his face! Huzzah!
Comment: How does it "break the fourth wall"?
Comment: It "expresses the awareness" that "what I say might be famous last words", "that life is but a stage, and has a penchant for dramatic irony", it is a nod to the "the gods [those who watch over us] who hate hubris". Keywords here: Stage, watch, awarenss

What does "Knock on wood" mean?


I have a questions about Pasta sauce spoilage

Question: After pouring a new  jar of sauce, I noticed dried sauce around the rim of the cover. Is it still safe to use?
Comment: Hi Kathy, welcome to the forum.  You'll have to provide more information.  Dehydrated/dried sauce, in and of itself isn't necessarily unsafe, but a lot depends on storage situation and time.  So, the more detail you can add the better response you will receive.
Comment: you can [edit] your question to add more details; also check [ask] and take the [tour] to learn more about the site
Answer: Here are some points to look at:

Was the air seal broken prior to use?
What is the printed shelf-life (or best-by date) in comparison to the date of use?
Are there any detectable (organoleptic) signs of spoilage?
Has the product been stored accordingly as instructed on the label?

Pasta sauce is typically high-acidity, which makes it less prone to spoilage, especially when still within shelf-life / BBD.  This doesn't rule spoilage out completely, and as others have pointed out, more details would definitely help make a more accurate determination.  Strictly speaking, most food packaging do not have zero air permeability, so it wouldn't be unusual to see change in water activity.  If this were for a commercial/industrial application, you could always send it out for lab sampling (or do so in-house), but i'm presuming that isn't likely the case here?


Forcing node traffic to local network

Question: We would like to force all our local node traffic to use the local network instead of the internet to communicate between eachother. Any best practice to do this?
Answer: To allow a node to connect to other nodes in the local network you will want to use the following flags:
--allow-private-ipv4: Always accept connecting to private IPv4 addresses.
--discover-local: Enable peer discovery on local networks.

As is explained in polkadot --help, those options are Enabled by default for chains marked as "local" in their chain specifications, or when --dev is passed".
Moreover if you want to restrict connection only to certain peers, you should look into the --reserved-nodes and --reserved-only flags.
Comment: As far as I know this doesn't prevent internet traffic as long as your node is reachable on a public IP.
Comment: Would this still allow external connections over the internet though? I would like the nodes we are running only communicate local but still want other nodes to connect across the internet.

Forcing node traffic to local network


Bra ket notation rigorous way

Question: I'm struggling to see how $\langle x|\Psi\rangle =\Psi(x)$.
I have read a few previous bra ket questions in here but still not clear.
Any good book for understand the bra-ket notation in more rigorous way.
Comment: I've removed a number of comments that were attempting to answer the question and/or responses to them. Please keep in mind that comments should be used for suggesting improvements and requesting clarification on the question, not for answering.
Comment: near duplicate of https://physics.stackexchange.com/questions/364208/understanding-diracs-notation/364219#364219
Answer: Consider the case of a vector space of countable dimension, with some orthonormal set of basis kets $\left\{\vert\mathbf{e}_i\rangle\right\}$. The orthonormality condition is stated as $\langle \mathbf{e}_i \vert \mathbf{e}_j \rangle = \delta_{ij}$, where $\delta_{ij}$ is the Kronecker delta. We can then expand any vector in this basis,
$$\vert \psi \rangle = \sum_i \psi_i \vert \mathbf{e}_i \rangle, $$
where the $\psi_i$ are the components of $\vert \psi \rangle$, i.e. they are the projections of $\vert \psi \rangle$ along the basis vectors $\vert \mathbf{e}_i \rangle$, which we can state more technically by noting that the identity matrix can be written as
$$I = \sum_i \vert \mathbf{e}_i \rangle \langle \mathbf{e}_i \vert,$$ in which case
$$\vert \psi \rangle = I \vert \psi \rangle = \sum_i \vert \mathbf{e}_i \rangle \langle \mathbf{e}_i \vert \psi \rangle,$$
i.e.
$$\psi_i = \langle \mathbf{e}_i \vert \psi \rangle.$$
Now we generalize this to an uncountable basis. For example, we define the position basis as the set $\left\{\vert \mathbf{x} \rangle \,\vert\, \mathbf{x} \in \mathbb{R}^3 \right\}$. Now the orthonormality condition is slightly modified (for technical details you can read about "rigged" Hilbert spaces), $\langle \mathbf{x} \vert \mathbf{x}' \rangle = \delta^{3}(\mathbf{x} - \mathbf{x}')$ where $\delta^3$ is the three-dimensional Dirac delta. Then we can expand the identity operator (it is no longer a matrix when the basis is uncountable) as
$$I = \int_{\mathbb{R}^3} d^3\mathbf{x}\, \vert \mathbf{x} \rangle \langle \mathbf{x} \vert.$$
Then, as before, we expand a vector $\vert \psi \rangle$ as
$$\vert \psi \rangle = I\vert \psi \rangle = \int d^3\mathbf{x} \, \vert \mathbf{x} \rangle \langle \mathbf{x} \vert\psi \rangle \equiv \int d^3\mathbf{x} \, \psi(\mathbf{x})\,\vert \mathbf{x} \rangle,$$
so the wavefunction $\psi(\mathbf{x})$ is simply the components of the vector $\vert \psi \rangle$ along the basis vectors $\vert \mathbf{x} \rangle$, just like in the countable case. The only difference is that now $\mathbf{x}$ labels the basis vectors instead of the discrete index $i$.
$$\psi_i \equiv \langle \mathbf{e}_i \vert \psi \rangle \leftrightarrow \psi(\mathbf{x}) \equiv \langle \mathbf{x} \vert \psi \rangle \quad\,\,$$
$$\vert\psi\rangle = \sum_i \psi_i \vert \mathbf{e}_i \rangle \leftrightarrow \vert \psi \rangle = \int d^3\mathbf{x}\, \psi(\mathbf{x}) \vert \mathbf{x} \rangle$$
For a pedagogical introduction, I recommend the notes found on this page, in particular "Block 1: Mathematical Foundations".
Answer: You can define $|\Psi\rangle$ as:
\begin{equation}
|\Psi\rangle=\int \Psi(y) |y\rangle d^3y
\end{equation}
With $\{|y\rangle \ \,|\,y \in \mathbb{R}^3\}$ the basis of the hilbert space $H$ of positions.
Since $\langle x|$ is the linear form such that $\langle x|(|y\rangle)\equiv \langle x|y\rangle=\delta^{(3)}(x-y)$ we have :
\begin{equation}
\langle x|\Psi\rangle=\int \Psi(y) \delta^{(3)}(x-y) d^3y=\Psi(x)
\end{equation}

Bra ket notation rigorous way


images/links in the gridview not shown/working from the production server using mvc2

Question: I am new to MVC2, I have populated a gridview with user details, which have Images and links to another page. On my development machine everything works fine, but on my IIS 7.5 nothing seems to come that easy, images are not displayed, when clicked on links they show 404.0 error page.
1) My published website shows the template and images on the main master page.
2) My Index.aspx has a grid which populates the images, by making calls to the database as follows:  '
                        Width="50px" Height="50px" />
3) It also has a hyperlink which on click should navigate to another page, but instead it shows a 404.0 error page.
My pre-requisites is as follows:
1) I have included all the DLL's needed in the bin folder.
2) My master page has the code of Url.Content to get the css/styles.
3) Have give permissions of IUSR, IIS_IUSR, Network to the folder.
Please help me asap in this regard.
Thanks,
Ravindranath
Answer: Replace:
ImageUrl='<%# Eval("VisitorMaster.ID", "/Visitor/showImage/{0}") %>'

with:
ImageUrl='<%# Eval("VisitorMaster.ID", "~/Visitor/showImage/{0}") %>'

Notice the ~/ which will be replaced by the name of your virtual directory.


Is there any model in statistical physics which has the ratio of specific heat exponent to correlation length exponent, $\alpha/\nu \approx 2.44$?

Question: I am simulating a disordered ising-like model in 2d whose phase transition is expected to be continuous, whose universality class is as yet unknown. By plotting the Specific heat scaling function, i.e., $C L^{-\alpha/\nu}$ vs $tL^{1/\nu}$, I find that the ratio ($\alpha/\nu$) is $\approx 2.44$. Is there a previously studied universality class which has this value for $\alpha/\nu$ ?
Comment: what is the accuracy and the precision of this simulation ?
Comment: This data comes from an "exact" recursive method for L=7 to L=12. So, the system sizes are indeed quite small. However, $\alpha / \nu$ can be tuned to the 2nd decimal digit  for a good scaling collapse of this data. So, I would bet on atleast the first decimal digit.
Answer: I made a very simple mistake of plotting Specific heat and not Specific heat per spin. It is specific heat per spin that scales as $L^{\alpha/\nu}$. And hence, the actual value from the data of my previous simulations is $2.44-2 = 0.44$. Using system sizes $10$ and $12$, one in fact gets a value $0.3$.