Ideal difference in the training accuracy and testing accuracy

Question: In a data classification problem (with supervised learning), what should be the ideal difference in the training set accuracy and testing set accuracy? What should be the ideal range? Is a difference of 5% between the accuracy of training and testing set okay? Or does it signify overfitting?
Answer: Theoretically speaking, in a perfect scenario, training and test data both represent the distribution of your problem accurately. Therefore, in an ideal case, training and testing should not have any significant differences in accuracy. This becomes more and more true when you have lots of data.
A difference of 5% is perfectly fine. In practice, it is common that training accuracy is slightly better than the test accuracy. I will say that the difference may not be the best indicator. What you should look at is correlation. Meaning that, as long as training and testing accuracy improve together at a similar rate, you're in the clear, regardless of how far apart they are. You can investigate that by training and evaluating on increasingly bigger subsets of the data. Ideally, training and testing should both improve as you add data. If test data starts decreasing, you have overfitting.
Answer: A difference of 5% is fine. Try using cross-validation and verify with mean accuracies.
Empirically good settings for performing k-cv
k=10
stratify the dataset on the target attribute.
Also please try to see if your dataset is balanced.


Why is the US president allowed to grant a pardon?

Question: So I was reading today and I read for about the thousandth time about a presidential pardon, and I started to wonder:
Why is the president allowed to grant a pardon? What are the limits of a presidential pardon? What happens to people barred from prison or execution etc. who are granted a presidental pardon?
Answer: Pardons have three major benefits:

By explicitly giving one person the power to overrule punishments, they make the law less impersonal.  If public opinion concludes that an injustice has been done, a particular politician can be convinced to grant a pardon.
It makes it easier to end civil wars.  A common provision of civil war settlements is an amnesty for participants in the civil war.  Such an amnesty can be implemented using pardons.  This can help end the cycle of vengeance that tends to make civil wars drag on.
It makes it easier for a president to hand over power at the end of their term of office -- or earlier, in the case of impeachment or other coup d'etat.  It has become traditional for presidents to pardon a number of people at the end of their term.  These pardons are often done at the suggestion of major political donors.  Part of the resolution of the Watergate scandal was that Nixon was pardoned by Ford.  This may not have been a quid pro quo, but it did help resolve the situation, without further degrading the former president.

There are some limits on presidential pardons:

A pardon can only be granted for an alleged crime that has already allegedly been committed.  It does not grant immunity for future alleged crimes, nor does it grant immunity for current alleged crimes to the extent that they continue to be committed.
A presidential pardon is for federal crimes.  The president cannot pardon someone for a state crime (or a crime committed subject to a local jurisdiction whose power is derived from a state).
Unless the pardoner presents strong evidence for the pardonee's actual innocence, a pardon tends to convict the recipient in the court of public opinion.  Thus, it tends to harm the reputation of the pardonee.
As cpast points out, a defendant can decline the benefits of a presidential pardon.

Presidential pardons are reinforced by the constitutional prohibitions against double jeopardy and ex post facto laws.  Once a person has been pardoned for a federal crime, the federal government (and any territories or districts that derive their power from the federal government) cannot re-try the pardonee for that crime.
Presidential pardons could theoretically have enormous power: "a power of summary execution."  In Tom Kratman's fictional Caliphate, a dystopian United States opposes the Caliphate.  President Buckman's party passes a law granting the federal government exclusive jurisdiction over, among other things, political murders.  (This is arguably constitutional under the "guarantee of a republican government" clause.)  This meant that Buckman could credibly threaten a person's life by offering to pardon any future murderer of that person.
Comment: @cpast The right to decline a pardon was indeed assessed in *US v. Wilson*, but this ruling was overturned in *[Biddle v. Petrovich](https://supreme.justia.com/cases/federal/us/274/480/case.html)*. The President may grant pardon unilaterally, without the beneficiary's consent.
Comment: Interesting that you should ask. The findings of *Wilson* were extended in *Burdick v. US*, wherein justice McKenna opined that **acceptance** of a pardon was both 1) indeed, an admission of guilt and 2) necessary, to benefit from the pardon. *Biddle* would go on to overturn the second part of this ruling, but doesn't really speak to the first. It's my opinion that, to reconcile *Biddle* with earlier jurisprudence, one should treat a pardon as neither a consequence of guilt nor as an acquittal. It's not for the Executive to determine guilt, only to manage *outcomes* that serve the public good.
Comment: Other limits: Pardons are only for criminal cases, and don't remove civil liability (you can still be sued). Also, pardonees have the right to decline a pardon; it can't be forced on someone.
Comment: @eikre So a president could grant a pardon to someone who had committed no crime to destroy their reputation?
Comment: To be fair, though: Gerald Ford disagreed with me. He would quote *Burdick* when people challenged him about pardoning Nixon. On the other hand, part of the reason that a lot of people were angry about that pardon was because they thought it was supposed to indicate *innocence*. All that goes to show: If the President wants to impugn someone's good name, he has far more straightforward ways to communicate his accusations, and either way, plenty of people are going to refuse to take his word for it.
Comment: This answer discusses the benefits of the existence, in a government, of a power to pardon. But it does not really explain how, historically, that power came to be granted to the US President. Nor does it provide any reason why the US President should have that power (rather than, say, the US Senate).
Comment: @sampablokuper -- The first bullet point explains why it should be "one person", not a committee (like the Senate).  There are only two persons whose jobs are defined in the Constitution who are elected nationally -- the President and Vice President.
Comment: @Jasper, thanks. Your comment makes clearer what the opening sentences of the answer were intended to communicate. I have made an edit to the answer accordingly, and will remove my downvote if that becomes possible.
Comment: @sampablokuper -- Thanks for your good-faith edit.  I rolled it back, because this phrasing is simpler, and also applies to U.S. governors.  In the U.S., most criminal convictions are under state jurisdiction; governors can pardon state convictions for the same reasons that presidents can pardon federal convictions.  The phrase "particular politician" means "one person who is a politician".
Comment: @Jasper, as a result of the edit, the software has now allowed me to remove my downvote, so I have done so. Thank you for explaining your rollback, and for the additional clarifications in your latest comment. If you can find a way to transfer the clarifications from your comments into your answer, I think that would be worthwhile. I would consider upvoting the answer if that happens. Thanks again.
Answer: Since time out of mind kings have been allowed to grant Royal Pardons. They are still available in some european monarchies, but they don't get handed out very often because they have been replaced by appeal courts and the like.
The authors of the US constitution couldn't and didn't reimagine absolutely everything from scratch; some royal prerogatives they just gave to the new head of state, the president.
As for restrictions, there are none whatsoever. Unlike any other presidential power, the president can give pardons to whoever they please, for any or no reason.
Comment: Presidential pardons are for federal prosecutions and/or convictions, not state prosecutions and/or convictions.
Comment: There actually is one restriction: the person who is issued a pardon is free to decline it, and it can't be forced on them. Once they've accepted the pardon no one can revoke it (not even the president who issued it), but the president can't pardon anybody against their will. (it's not just idle speculation: there are actual cases where people have declined pardons, and courts have ruled that they have the right to do so)
Comment: Good point. OP asked if there were any limits to presidential pardons, by that I interpreted if his pardons could be overturned by anyone.
Answer: To add to Jasper's fine answer...
Fourth major benefit of pardons:
Presidential pardons are about checks and balances. The legislative system has determined a law, the judicial system has determined an infraction of that law, and with a pardon the presidential system can react to a mistake made by either the legislative or judicial branch.
Additional constraints on pardons:
There are no formal constraints on the president to pardon federal crimes, but there are many informal reasons why a president will not pardon a convicted person. These may be personal beliefs and moral constraints as well as the repercussions viewed by giving a pardon. For instance, people may come to dislike the President's pardon and penalize the administration or his/her party by not voting for them in future elections or helping finance the opposition. There are many reasons why people may come to dislike a pardon, including conflicting beliefs about the type of crime committed or framing by other political parties.


Fastest way to put a lot of files togheter into 1 big chunk

Question: I want to avoid the creation of an archive because it takes a significant amount of time and CPU power, since i have to transfer a big folder among different filesystem i would like to have all the data in just 1 file.
Comment: I don't get it: You want to create an archive ("just 1 file") without creating an archive?
Comment: @ohno the archive is usually compressed, i don't care if the resulting file is big, i just do not want the data to be fragmented.
Answer: You need tar. Read the funny manpage:-) tar does not compress (unless you tell it to).
tar cf tarname.tar the_directory_you_want_to_archive/ will create one file: tarname.tar. You can extract with tar xf tarname.tar later.
If the files you wish to archive reside in different directories, simply add each one to the command line like so: tar cf tarname.tar dir1/file1 dir2/file2 dir3/file3. This will create an archive containing the files 'file1', 'file2' and 'file3'.
Comment: agreed
but also I think Gzip desktop can do this with GUI if any one is intrested
Answer: In all of the ,buntus, I always install 7z file compression. It is freeware, and can handle RAR compression if you need it.  Best of all, it is a Graphic User Interface program, so nO fAnCy CoMmaNd lInE fussiness and intolerance.
Both ZIP & 7Z file compression are recognized by most operating systems. TAR, etc tends to be just Unix-type operating systems. 7Z also compresses to smaller file sizes. The 'time' compressing is small, compared to the transfer-time to another computer or storage drive.


Browsers idling before they send the POST-body

Question: I have some very interesting behaviour from seemingly random clients on a website.  What I see is that random POST-requests to the server result in a bad request to the backend.  I've tracked down why the request is bad - but I still don't know WHY this occurs.

Client connects to webserver with HTTP.
Client sends the headers of an ordinary POST-request (not the body)
Five seconds pass.  The cache server passes the request to its backend, because it took too long to complete the request.
The cache server replies to the client, with an error message - indicating that the request was bad.
The client sends the POST-body - a few seconds after the reply has been received.

I have no problem accepting that the cache server can be reconfigured to wait longer.  My problem is; What can be the reason for clients to wait several seconds between the headers sent, and sending the POST-body? I don't know of any cases where this behavior makes sense.
This is a fairly ordinary Magento eCommerce website, with a setup of Haproxy -> Varnish -> Nginx -> php5-fpm.  Varnish is the component that ships the request to Nginx when five seconds of idling has passed.

I have verified with tcpdump/wireshark that the server does not receive the POST-body from the client within the time (before Haproxy as well).
I have verified that this occurs across user agents, and across the kind of requests (Being ordinary login forms, to ajax callbacks)

Does anyone have any clever ideas?
NOTE: I wasn't sure if this was a question for Stack Overflow or Serverfault, but I consider this an HTTP question that requires developer-knowledge.
Answer: The server is buggy-- you shouldn't send partial requests from the front-end to the backend. It's possible that the client is waiting for a HTTP/100 Continue response for the server before transmitting the POST body. It's also possible that the client is generating the POST data and that's taken some time for some reason.
Comment: It's not a bug, it's a configured threshold.  Also, the client did not send 'Expect: 100-continue'.  I have also verified that this occurs on ordinary login forms - where the POST-data should be supplied immediatly.
Comment: My current best hypothesis is that the client is waiting for an ack, and that it's eaten by a firewall.


Git workflow - when exactly do you need dedicated branch for release

Question: I have worked with Git workflows where we release from dedicated branch specifically used for release (e.g. Gitflow's master/main branch).  In such workflows, there will be multiple (at least 2) long living git branches. One for development (called develop), and one for releases (called master/main/release/production). Lots of variations in the details, but the general idea is for feature branch to come out of develop, and also merged back into develop. And when it's time to make release, we merge develop into a release branch. Tags typically are made on the release branch.
I have also worked with workflows where we only have one long living branch (e.g. Github flow). The single branch is called develop, and is used for both development and release. Tags, if used, would only go on develop branch.
Of course, there's many differences between these 2 classes of workflows.
I just want to focus on the release process. What advantage do you get from a dedicated release branch?
For what I can see, the advantages are as follows.

good for long release cycle. Maybe release cycle is long (like extra testing). You can basically do your release in peace, with hotfixes if necessary, without being disturbed by code getting merged into the develop branch. Develop branch would get new code merged in all the time - that's just the nature of having a develop branch. Having dedicated release branch guarantees you won't "accidentally" pick up new code that someone else merged into develop.

good if you need to maintain multiple releases for your customers. In which case, you may have a release-1.1 branch, and a release-1.2 branch...etc. All these branches are stable branches that your customer may need. Obviously, you can't do that with a single develop branch.

If neither these 2 scenarios apply to you, is there still a point to have dedicated release branch? Let's say my release cycle is instant, and let's say I don't need to support multiple releases.
It seems to me that for my case, having a single branch and tagging it at important times would be sufficient.
To rephrase the question - if all I do is tag important times in my develop branch, what release related functionality am I missing out on?
Comment: There's another fairly widespread version where a new branch is created for every release, which is sometimes used as a variant of trunk based development.
Answer:
To rephrase the question - if all I do is tag important times in my develop branch, what release related functionality am I missing out on?

Nothing.
As you noted yourself, a flow like git-flow with two long-lived branches (develop and master) is mostly useful if your release process takes a bit longer and you don't want to block merging of new features while making a release.


Xbox One Account Transfer To PS4

Question: I had a Xbox One with a GTA V account on it, but now I have a PS4. Can I transfer my Xbox One account over and get it on my PS4?
Comment: @JeffS for future reference, it is considered bad form to VTC a question AND answer it. your effectivley just making it harder for the mods
Comment: @Timelord64 I'll keep that in mind for future reference. I also had a hard time finding the duplicate on mobile app so I had to switch and then flagged. Should I remove answer?
Comment: @JeffS, its entirely up to you. I am trying to find the relevant meta on it, to give you more information.
Answer: No, you cannot. Both consoles are completely different platforms both in terms of physical disc copies, online community hubs and (especially) distribution services. You cannot use an Xbox account with a PlayStation as they are both entirely different.
As such, you will need to repurchase your games to accommodate the new platform.
Comment: @Lew657 If you found my post helpful, you should probably mark it as accepted by clicking the little tick mark underneath the vote arrows.
Answer: No, you cannot transfer between current gen consoles on GTA V. You can only transfer from previous generations, ie. xbox 360 to ps4. If you wanted to transfer from a current generation console like Xbox One the only option would be to transfer to PC.
Straight from Rockstar Support
https://support.rockstargames.com/hc/en-us/articles/202892778-Transferring-Your-Previous-Grand-Theft-Auto-Online-Characters-and-Progression-to-PlayStation-4-Xbox-One-or-PC

Xbox One Account Transfer To PS4


Does rolling friction depend on area of contact?

Question: We know that forces of static or kinetic friction do not depend upon the area of contact of the two surfaces, is it applicable to rolling friction as well?
Answer: If you would have a rigid wheel and surface rolling without slip, then you would have no have a line contact between the wheel and the surface parallel to the axis of the wheel, which has zero surface area. This would not yield no rolling friction forces.
In the real world nothing is completely rigid and would deform due to stresses. These deformations will lead to resistance against rolling. One example formula which can be used to approximate rolling resistance is,
$$
F_r = \frac{N b}{r},
$$
where $F_r$ is the magnitude of the force of the rolling resistance, $N$ the normal force between the wheel and the surface, $b$ the rolling resistance coefficient and $r$ the radius of the wheel. One way of intuitively understanding this equation is that the smaller the radius of the wheel, the "sharper" it is thus it would cause a larger/deeper deformation for the same normal force.
Answer: You would think that Rolling Friction (or just friction in general) would depend greatly on the area of contact with the surface (and to some extent this is true), I mean, using logic, you could expect to think that if there are is a board of nails and you scrape your hand along it, it would hurt more to scrape your hand across more nails rather than less of it.
In it's sense it is true, and false at the same time. The microwelds that exist on both surfaces determine the coefficient of resistance/friction, and although it is not even everywhere, it could be determined that overall, it would be the same. But hey, that's just my theory.
Comment: Again, I'm not a downvoter, but this is not a very careful answer. Rolling friction has no intrinsic relationship to sliding friction. "true and false at the same time"? Please try to learn from others on this site, who try to give real answers.
Comment: I was trying to give a real answer, it's just my knowledge and my experience on this site just isn't broad enough yet to give an explanation as in-depth as many other members of the site have given. And above all, it just seemed like a good answer to give.


What is this plant with clusters of pink flowers with red centers, and waxy leaves?

Question: I would be grateful if you could identify this plant please. It has clusters of star-shaped pink flowers with dark red centers. The leaves feel waxy. I live in Northumberland, England.
Comment: Thanks for taking the trouble to reply. Embarrassingly I live in Northumberland!
Comment: I had to look up Northumberland. It looks like a cool place! We have some very brilliant users here from England. Just to let you know, I added that information into the question because it's easier for people to see it all in the same place, and our comments don't stay around forever. I also moved the text above the picture because I find it easier to see. Lastly, I added detail to your title so people have a better idea what to expect when they read it. I hope all that is okay with you!
Answer: This plant is Hoya carnosa the wax plant.  It is a member of the Asclepiad species and native to East Asia and Australia. The plant is named after Thomas Hoy who was an 18th century botanist and gardener to the Duke of Northumberland. Identification keys are:

clusters of star shaped flowers with a red eye
a unique scent which some like and others abhor
light off white stippling on the leaves
climbing habit
thick leaves with a waxy covering

It prefers bright light but will do with less.  I cannot find references for this but my personal experience is that plants that are pot bound in small pots are more likely to be consistent in flowering.
Insect problems are most common during flowering and include mealy bug and scale. Control with soap and water at 5 ml soap/liter water sprayed and wiped off at 6 day intervals for at least three times is usually effective.
These plants do not need to be re potted frequently.  A half strength flowering plant fertilize once a year is more than adequate.
Do not over water.  When out of flower the leaves will become less plump and this is your signal to water.
Answer: To add to kevinsky's answer, mealybugs and other insects are attracted to the sweet honeydew exuded by the flowers.  Mine actually dripped and was the consistency of thin liquid honey. Make sure to check around the area by your plant and regularly wipe down any stickiness you find.
When the flowering panicle is finished, a long spur is left. Don't remove it! New flowers form from the spur left behind.

You can see it on this flower cluster too.


Password-Changing Password

Question: I want to create a public (password given out to everyone) gmail account that anyone can use (for subscriptions, using useful websites that require your real email but spam you, etc.) and that's the easy part (I think anarchy might erupt in the account at some point). The hard part is implementing a secret password only I know that is used for changing the account's password. This is to prevent people from abusing the system by changing the password so that nobody else can use it. How can I implement this in gmail? If it's not possible in gmail, how about elsewhere?
Comment: Can you be the one that logs people in for the first time, physically?
Comment: This is not possible in Gmail. It is designed to be used by a single user. You are attempting to fix a problem that doesn't exist. If you want to disseminate information then there far easier ways to do it.
Answer: What you want to do makes no sense as far as I can see.
It's also not possible with gmail.
How about using a service designed for exactly the use cases you mention, such as https://www.mailinator.com/ ?
Answer: You can do this in gmail by using application specific password. Drawback is that the users cannot use webmail but instead must use desktop mail application. However, the problem with having a single, shared junk mail address is that everyone will be able to see everyone else's emails. This is usually unwanted, due to privacy reasons (I don't want other users of the email to know what sites I signed up for) and volume reason (I want to see my own registrations, instead of having to trawl through of hundreds of other people's junks).
An actual throwaway/disposable email provider like mailinator.com would be more suitable for this purpose than what you're proposing.
Comment: You're right about the privacy and volume part. However, for the privacy part, people must expect that their information will be public so that they don't post private information.

Password-Changing Password


What is the status of the Yad we use to read from the Torah?

Question: Does the Yad for reading Torah has the status of tashmish mitzvah or tashmish kedusha?
Background to the question:
Our shul has a BIG yad in extremely bad shape. Impossible to fix anymore. It is sterling silver. Can the shul give it as a gift to the gentleman who has done all sorts of Torah accoutrements (yad, crown, breastplate) fixings for us for free in the past ten years? Gentleman is not Jewish, would probably melt the silver.
Comment: Note that this site makes no guarantee of validity, and does not offer professional (particularly rabbinic) advice. Treat information from this site like it came from a crowd of your friends. For a definitive ruling, please contact your rabbi. You might also want to see "[Why is it necessary to ask a rabbi?](//judaism.stackexchange.com/q/9146)" for more info. We hope to see you around!
Answer: The Aruch Hashulchan (154:5) (as cited here) writes that technically a yad would not have been considered a tashmish kedusha if that had been its sole function. However, the custom is (and was) to also hang it from the Torah as a decoration. Therefore, it is considered a tashmish kedusha with all the attendant restrictions, such as requiring "sheimos geniza" as well as a prohibition banning it's use for a less sacred function. Since I assume this was also the case with the silver Yad you describe, it seems pretty clear the Aruch Hashulchan would prohibit your suggestion. But, as usual, AYLOR.

והעצים או עצם שעושים כמין יד, להראות להקורא מקום הקריאה של חובת היום – אין בהם אף קדושת בית הכנסת, שאינן לא לנוי ולא למלבוש רק לסימן בעלמא. ולכן אין עושים מהכלונסאות שתולים בהם הפרוכת היד הלזו, שאין מורידין אותם מקדושתן, וה"יד" מקרי ירידה נגדם. ונראה דזהו אם אין תולין היד על הספר תורה. אבל אצלינו שתולין אותה על הספר תורה לנוי, יש לומר דהיא נקראת "תשמיש קדושה" וגדולה מקדושת הכלונסאות.
Wooden sticks or bone that is fashioned as pointers to indicate to the reader the place of the obligated reading of the day does not have even the sanctity of a synagogue since they are neither intended as an ornament or dressing, just as an indicator. Therefore, one may not fashion this "Yad" from the poles that held up the parochet, for it is forbidden to demote them from their sanctity, and the "Yad" is considered a demotion relative to them. But this appears to only be the case if the "Yad" is not hung for the Torah scroll. However, in our communities where we hang it on the Torah scorll as an ornament, one could say that it is considered a tashmish kedusha, and even a greater sanctity than the (parochet-supporting) poles.
Answer: This article, 1st paragraph says:

Tashmishei kedushah are objects which serve a holy object (such as a
  Sefer Torah), They contain a holy object or cover it and are in
  immediate contact with it. The law of tashmishei kedushah applies even
  to objects which are used more to protect than to show respect for a
  holy object (e.g. the ark in which a Sefer Torah and other sacred
  writings are placed, even if they are printed rather than handwritten
  by a scribe. According to most poskim, sacred texts that are printed
  have a sanctity comparable to the handwritten text.). Ornaments that
  are placed upon a Sefer Torah are also considered  tashmishei kedushah
  even though they do not actually touch the Sefer Torah itself.

I have bolded the 2 sentences that I consider most relevant to your question. The yad both serves the usage of reading the Torah and is an ornament. Based on this definition, the next paragraph in that article states:

Tashmishei kedushah that are worn out and unsuitable for further use
  must be put aside in a safe place. It is forbidden to use them for any
  other purpose and it is forbidden to burn them. The prohibition to
  burn them is implied in the verse "Do not do so to Hashem, our G-d."
  In contrast, tashmishei mitzvah do not have kedushah after the mitzvah
  has been done.

Thus, in short, no, you can't have the Gentile melt it down.
The rulings regarding Tashmishei Mitzvah & Kedusha as well as a list are mentioned in Talmud Megilah 26b. The yad is not listed, there, as it was a much later invention.
Comment: In your article it discusses redeeming a bookshelf. Is this different? Couldn't the yad be redeemed for money to buy a new one and then be usable for mundane purposes?
Comment: @Yishai My understanding of that last paragraph - it can be redeemed or exchanged for another yad. Whether it can be exchanged for something else, I think there is a general rule that exchanges of *tashmishei kedusha* must go towards equal or higher holiness, but not lower (based on my recollection from Shulchan Aruch, I think in laws of *Bet K'nesset*). It does not look like the money can be used for mundane purposes, no matter what. Again, my understanding of what's in the article.


Detect if CGPoint within polygon

Question: I have a set of CGPoints which make up a polygon shape, how can I detect if a single CGPoint is inside or outside of the polygon?
Say, the shape was a triangle and the CGPoint was moving hoizontally, how could I detect when it crossed the triangle line?
I can use CGRectContainsPoint when the shape is a regular 4-sided shape but I can't see how I would do it with an odd shape.
Answer: You can create a CG(Mutable)PathRef (or a UIBezierPath that wraps a CGPathRef) from your points and use the CGPathContainsPoint function to check if a point is inside that path. If you use UIBezierPath, you could also use the containsPoint: method.
Answer: For that you need to write one method that implements a point inside polygon algorithm.
This method will take an array with N points (the polygon) as an argument and one specific point. It should return true if the point is inside the polygon and false if not.
See this great answer on S.O.
Answer: Here is the implementation in Swift:
extension CGPoint {

    func isInsidePolygon(vertices: [CGPoint]) -> Bool {
        guard vertices.count > 0 else { return false }
        var i = 0, j = vertices.count - 1, c = false, vi: CGPoint, vj: CGPoint
        while true {
            guard i < vertices.count else { break }
            vi = vertices[i]
            vj = vertices[j]
            if (vi.y > y) != (vj.y > y) &&
                x < (vj.x - vi.x) * (y - vi.y) / (vj.y - vi.y) + vi.x {
                c = !c
            }
            j = i
            i += 1
        }
        return c
    }
}

Answer:
Swift 3

A simpler way using Swift 3, is using UIBezierPath contains method.
When creating an instance of CAShapeLayer, make sure to set the accessibilityPath
shapeLayer.path = bazierPath.cgPath
shapeLayer.accessibilityPath = bazierPath

Checking if path contains touch location.
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    guard let point = touches.first?.location(in: self) else { return }

    for shape in layer.sublayers ?? [] where shape is CAShapeLayer {
        guard let layer = shape as? CAShapeLayer,
            let bazier = layer.accessibilityPath else { continue }

        // Handle touch
        print(bazier.contains(point))
    }
}

Detect if CGPoint within polygon


What is the best book to learn probability?

Question: Question is quite straight... I'm not very good in this subject but need to understand at a good level.
Comment: @pete-l-clark oh cum man! I believe you're in a bad day. I asked a question because I don't know anything about the subject if I knew how to be more precise I wouldn't ask THIS question which is very clear and simple.
Thanks @GEdgar for your viewpoint, together with @wnoise and @PEV I can now form some strategy to START SOMETHING - and that's is all what I need for the moment. Cheers, mate!!
Comment: @GEdgar: yes, but even more the **questioner** should make more precise what he is looking for.  It is very inefficient and a waste of people's time to ask for a spray of all possible answers.  In fact I think this is as yet *not a real question* and I am voting to close...
Comment: As noted, there are different sorts of "probability". (1) a branch of finite combinatorics (2) assuming knowledge of Riemann integral (maybe even Riemann-Stieltjes integral) (3) presupposing measure theory.  Answerers should explain which of these they are talking about.
Comment: I meant a statistics subject and I want a level that make easier to do exams. The books I have always gaps on explanations and that's make me crazy...
Comment: what do you mean by probability and to what level do you need it?
Comment: @Eduardo: it is hard to say what will work for each individual, but for an admission exam, probably previous test papers will be most useful.
Comment: @EduardoXavier People can't help you if you're being vague. "a level that makes it easier to do exams" does not tell us anything at all. Other people who ask this same question post a link to the types of probability questions they want to be able to answer. What level of exams are you talking about? A first or second year undergraduate university course? A PhD qualifying exam? An actuarial exam? (And no offense, but deliberate mis-spellings of words is looked down upon on StackExchange forums.)
Comment: @picakhu Do you believe a cook-book will help me with a Msc admission exam? I wish something that make understanding easy with clear explanations. What do you think?
Comment: "make easier to do exams", it sounds to me like you want a cook-book type of book, perhaps a solution manual is what you need?
Answer: For probability theory as probability theory (rather than normed measure theory ala Kolmogorov) I'm quite partial to Jaynes's Probability Theory: The Logic of Science.  It's fantastic at building intuition behind the rules and operations.  That said, this has the downside of creating fanatics who think they know all there is to know about probability theory.
Comment: What are readers of this book missing in their understanding of probability theory?
Comment: @Hatshepsut: On the probability side proper, rigorous handling of infinities that don't derive from limiting trends of finite cases, (e.g. measure theory, Borel subalgebras, and all that goodness).  It also doesn't cover in any depth several applications that are generally treated as standard, such as Markov chains, random walks, characteristic functions, etc.  It certainly doesn't cover enough to say, prepare for a course on stochastic differential equations.
Comment: Just from the introduction the author claims himself as a partisan of Bayesianism and supports Kline against Bourbaki. Is there something to read for the "other side" of these lines?
Answer: A First Course in Probability by Sheldon Ross is good.
Comment: I second this, and would like to mention "Probability Theory: A Concise Course" by Y.A. Rozanov
Comment: @Kurapika I'm working through "First Course". There are some questions in there that are quite difficult, so I think this book is more targeted toward an advanced undergraduate. I haven't looked at the Probability Models book, though I would presume it has a lot of overlap with First Course.
Comment: There is also Introduction to probability models by Ross. Out of the two Ross books which one would you recommend for better understanding and problem-solving skills? I know this is from long ago but if someone could answer it would be helpful.
Comment: @Kurapika I took a quick look at both books. Seems the "Models" book is more oriented towards teaching probability for application in engineering, while "First Course" is more 'pure probability'. More precisely, "First Course" seems to be more rigorous, while "Models" seems to cover more ground in roughly the same amount of pages, e.g., including Markov chains. In the Applied Mathematics bachelor in my university, "Models" is used.
Answer: If anybody asks for a recommendation for an introductory probability book, then my suggestion would be the book by Henk Tijms, Understanding Probability, second edition, Cambridge University Press, 2007. This book first explains the basic ideas and concepts of probability through the use of motivating real-world examples before presenting the theory in a very clear way. I found a nice feature of the book the fact that simulation is deliberately used to develop probabilistic intuition. The book also discusses more advanced topics you will not easily find in other introductory probability books. The more advanced topics include Kelly betting, random walks, and Brownian motion, Benford's law, and absorbing Markov chains for success runs. Another asset of the  book is a great introduction to Bayesian inference.
Answer: I wouldn't know which book is the best, because I've only used two when I was taking a course in probability, but if you'd prefer videos , I'd suggest:
MIT 6.041SC Probabilistic Systems Analysis and Applied Probability course , which is available in MIT OpenCoursWare for free :
https://www.youtube.com/playlist?list=PLUl4u3cNGP60A3XMwZ5sep719_nh95qOe
Answer: Here is a list of great books to own to learn probability & statistics. Some on the list like programming in R are great add-on stuff to know.
Answer: I happened to take an introductory course on probability and statistics on two different universities. In one they used a horrible book, and in the other they used a truly amazing one. It's rare that a book really stands out as fantastic, but it did.
Probability and Statistics for Engineers and Scientists
by Ronald E. Walpole, Raymond Myers, Sharon L. Myers and Keying E. Ye.
The version number doesn't matter, just find an old version second hand.
It is really thorough, takes one definition at a time, and builds on top of that. The structuring and writing is top class, and the examples are well chosen.
Don't worry if you are not an engineer. When using examples they have taken them from the domain of engineering, eg "A factory produces so and so many items per hour, and only so and so many can be broken, ...", instead of using examples from fx social science or economics. But they don't involve engineering science such as statics, aerodynamics, electronics, thermodynamics or any such things. This means that everyone can understand the book, it does not even help to have an engineering background. Perhaps the examples are more appealing/interesting to engineers, but that's all.
Comment: I've used this book briefly. It is quite 'mathematical' for a book aimed at engineering students, but it's more oriented towards application than a pure maths text would be. Can recommend!
Answer: While not a book, Sal Khan's site: http://www.khanacademy.org/ offers dozens of short videos that provide introductions to probability and statistics.  Many of the videos even have problem sets associated with them.  Khan provides accessible and often intuitive explanations.
He also has extensive video lessons on algebra, linear algebra, calculus, and geometry as well as physics.
All for free.
Find a discussion on this forum which explores pro's and con's about Khan at:
What does Khan Academy have to offer? Depth? Rigor?
Answer: "Lectures on probability theory and mathematical statistics" by M. Taboga. While pretty elementary, it provides proofs of all the main results in probability theory, something you would not find in most other elementary textbooks. It also has plenty of solved exercises and examples. There is a free digital version of this book available at https://www.statlect.com
Answer: An Introduction to Probability and Random Processes by Kenneth Baclawski and Gian-Carlo Rota is very good, though it does require the reader to have or develop mathematical maturity.
Answer: The best book that I have ever read for undergrad and grad students is Intuitive Probability and Random Processes Using MATLAB.
Answer: I found that nobody has pointed out Joe Blitzstein's fantastic book and lectures. the lectures are intuitive and professor Blitzstein does a really good job of explaining the causes behind certain phenomenons in probability, not just mentioning the phenomenon itself, like why do we care about specific distributions, what is the interpretation of a number between 0 and 1 as a probability. he also provides context to each problem for example he mentions how the problem arose? was it a historical problem about gambling or was it a computer science problem or an information theoric one or...?
you can find both the book and lectures in here.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: A bit surprised that neither of these have been mentioned. Grinstead & Snell's Introduction to Probability is a good comprehensive introduction, and after that Feller's Introduction to Probability Theory and its applications is a very good serious treatment after introductory probability.
Answer: Two books.
Firstly, the book that provided the axiomatised basis for the subject.
"Foundations of Theory of Probability" by Kolmogorov.
Second, the book that I bought on instinct but have a mixed reaction to. It is aimed at a larger audience with focus on examples.
"An Elementary Introduction to Theory of Probability" by Gnedenko and Khinchin.
Besides, if you want more rigorous approach, check this awesome stack post.


Does it make sense to appeal the reject decision made by the journal editor?

Question: A manuscript that my supervisors and a collaborator and I have been working on for so long recently got rejected twice by different journals, the main reason being that the findings are considered as "nothing new" and didn't "add anything to the field". However, we do think that our findings contribute to the field and can justify this major reason for rejection. I am thinking about whether we should appeal against the decision. I know it is risky and most likely won't be successful. But I would like to hear what you think about this.Thank you!
Comment: Do the journals provide some appeal mechanism? Appeal to whom, exactly?
Comment: Better ask if you can resubmit the paper after making substantial changes to your explanation/manuscript
Comment: Readers, even if you think the answer is "no", this doesn't make it a bad question, so please do not downvote just because of this.
Comment: @Mark thank you. the journal doesn't accept resubmit manuscripts unfortunately...
Answer: You're starting at the wrong end. If four or more reviewers plus two editors have found that your paper has "nothing new", but you think that "our findings contribute to the field", then you haven't made your point well enough in the paper.
The most pragmatic approach to dealing with rejections is to assume that the failure lies with your writing and not ignorant reviewers and editors: If someone doesn't see your point, then you haven't made your point well enough. Any appeal will not change that you haven't written your paper well enough.
So: go back to the drawing board. Read through your introduction and try to understand whether, from the perspective of a reader, you've made it clear enough where the current knowledge has deficits, why we should care about these deficits, and how your paper addresses these deficits. If you make these points clearly and easy to find/understand for a reader, and your papers will get accepted. If you make it difficult for readers to understand the point of the paper, you will get rejections.
Comment: Thank you so much for this! Would you recommend writing to the editor about how we will improve our paper and address reviewers' comments (i.e. to make our point well enough)? The idea of appealing was brought up during an email exchange between me and my collaborator, not including my supervisors. So I'm still thinking about how to bring this up with my supervisors..
Comment: @JoseeLuis Then talk to your advisers. They presumably have much more experience in writing papers, and might be able to see what needs to be done. Separately, when you read papers in the future, ask yourself not just about the content but also whether you thought that the paper was well written and why. Then copy what you thought worked well in your own papers.
Comment: Thank you very much for your advice! This is really helpful.


pairwise (linear) distance between points of the same shapefile

Question: Given a set of points representing villages stored in a .shp file, is there a way to compute the pair-wise distance (Euclidean) between them? What I would like to come up with is a sort of symmetric matrix to be further analysed statistically.
I am using ArcGIS 10.1 with an Advanced license.
Answer: Alternatively you can use the Generate Near Table tool to do the same thing as GISGe's suggestion, but with some additional attributes (such as xy of the near feature and the angle between source and near features) if those would be useful in your study. It also allows you to specify a number of nearest matches so it isn't all or just nearest.
Answer: Use the Point Distance tool to do this, with your point shapefile as input features and near features parameters.
Comment: Thank. Do you mean using the same shape file as input in the two fields? I tried this solution, but arcGIS does not complete the task, reporting "999999 : Error executing function". Any idea?
Comment: Yes that's what I mean, how many points do you have in your shapefile? And what is its coordinate system?
Comment: The number of points is 15. As for the second question, here are the details: Projected Coordinate System: ED_1950_UTM_Zone_33N; Projection: Transverse_Mercator
Comment: Weird, can you upload the shapefile somehow so we can make a test? Do you have the same issue with the Generate Near Table tool mentioned by @ChrisW?
Comment: Hello. I am wondering how can I upload something here....
Comment: Put in on DropBox, WeTransfer or any ftp server site.
Comment: https://dl.dropboxusercontent.com/u/82297408/sites.zip
Comment: There's nothing wrong with your shapefile, I could create the table without any problem. Make sure you use the right tool and the right parameters... I've added a screenshot of the tool's interface to my answer.
Comment: thank you. Yes, I was using the same tool. Maybe there is something wrong with my arcGIS....I will try and search for the cause. Thanks for taking the time to test the data.
Comment: I tested the tool on another PC (running ver 10.1) and it did not work either. But, at least, I was successful in using the Generate Near Table as @ChrisW suggested. Thanks to both.
Answer: I'm sorry, I would reply to previous comments but I don't have 50 points on my profile (new member) and I'm getting blocked. Since your "Input" and "Near" feature classes are both the same, why not make a copy of your original FC and use the original as the "Input" and the copy as the "Near" for the tool? This might circumvent the issues you're having with using the same feature class as Input/Near.
The Near tools and Point Distance tools require an Advanced license, so it seems you have the necessary license level. For those who have Basic/Standard, ESRI's Near algorithm isn't too hard to implement yourself in Python. This answer is similar to one that I posted in Calculate nearest distance in ArcView, XY coordinates. But since you want all pairwise comparisons (not just the nearest feature), the tool will create a table with all pairwise comparisons. It will also create a "plumb lines" feature class that connects all pairs and has the same info as the table (this output is more useful IMO). For the Target and Source ID Fields, you can use "OBJECTID" or any other unique ID of your choice. It will work on any license level. If you don't have luck with the above suggestions, try this script.
<code>__author__ = "John K. Tran"
__contact__ = "email@example.com"
__version__ = "1.0"
__created__ = "7/1/15"

"""Compares all target point features to all source point features and populates
the ID and distance of all pairwise comparisons between each target to each source.
Can optionally create plumb lines to visualize the links between source and target featues."""

import arcpy
import os
import math
import random

arcpy.SetProgressor("Default", "Firing up script...")

# Set up initial parameters for script.
source = arcpy.GetParameterAsText(0) # Point feature class.
target = arcpy.GetParameterAsText(1) # Point feature class.
outputtable = arcpy.GetParameterAsText(2) # Table feature class that stores distance and ID info.
sourceIDfield = arcpy.GetParameterAsText(3) # Field to identify unique ID of Source values.
targetIDfield = arcpy.GetParameterAsText(4) # Field to identify unique ID of Target values.
createplumblines = arcpy.GetParameterAsText(5) # Optional output location for plumb lines. HIGHLY suggest you specify a path for this!
arcpy.env.parallelProcessingFactor = "100%"

#Convert arcpy field types for "Field Type" argument in AddField_management.
fieldtypedict = {"Blob":"BLOB", "Date":"DATE", "Double":"DOUBLE", "Guid":"GUID", "Integer":"LONG", "Raster":"RASTER", "Single":"FLOAT", "SmallInteger":"SHORT", "String":"TEXT", "OID":"LONG"}

# Get the field type for the source ID field, so we can make analogous field for NearID in target.
sourcefields = arcpy.ListFields(source)
targetfields = arcpy.ListFields(target)
sourceIDfieldtype = fieldtypedict[[field.type for field in sourcefields if field.name == sourceIDfield].pop()]
targetIDfieldtype = fieldtypedict[[field.type for field in targetfields if field.name == targetIDfield].pop()]

# Get the spatial references for source and target and make sure they're the same.
sourcespatialref = arcpy.Describe(source).spatialReference
targetspatialref = arcpy.Describe(target).spatialReference
assert sourcespatialref.name == targetspatialref.name, "The source and target must have the same coordinate system. Ensure both data are in an identical projected coordinate system."

# Create a Point class with a distance method. More efficient than native arcpy.Geometry class.
class Point(object):
    def __init__(self, x, y, ID):
        """Create the constructor to initialize the point."""
        self.x = x
        self.y = y
        self.ID = ID
    def GetDist(self, OtherPoint):
        """Determines the distance between two points using Pythagorean Theorem."""
        return math.sqrt((self.x-OtherPoint.x)**2+(self.y-OtherPoint.y)**2)

# Create a list of source points to compare with each target point.
scount = 0
sourcepoints = list()
with arcpy.da.SearchCursor(source, ["SHAPE@XY", sourceIDfield]) as sourcecursor:
    for row in sourcecursor:
        arcpy.SetProgressorLabel("Gathering Source Points: {0} features complete".format(str(scount)))
        sourcepoint = Point(row[0][0], row[0][1], row[1])
        sourcepoints.append(sourcepoint)
        scount += 1
del sourcecursor

# Create several startup variables if creating plumb lines was enabled.
if createplumblines:
    arcpy.SetProgressorLabel("Making Plumb Line Feature Class")
    plumblines = list()
    arcpy.CreateFeatureclass_management(os.path.dirname(createplumblines), os.path.basename(createplumblines), "POLYLINE", None, "DISABLED", "DISABLED", targetspatialref)
    arcpy.AddField_management(createplumblines, "SourceID", sourceIDfieldtype)
    arcpy.AddField_management(createplumblines, "TargetID", targetIDfieldtype)

# Create a table to store distance info.
arcpy.SetProgressorLabel("Making Distance Table")
arcpy.CreateTable_management(os.path.dirname(outputtable), os.path.basename(outputtable))
arcpy.AddField_management(outputtable, "SourceID", sourceIDfieldtype)
arcpy.AddField_management(outputtable, "TargetID", targetIDfieldtype)
arcpy.AddField_management(outputtable, "Distance", "DOUBLE")

# Create a list to store each comparison, so we can add it into the table afterwards.
distlist = []

# Loop through each target and compare with each source and populate ID and Distance fields in table.
count = 0
with arcpy.da.SearchCursor(target, ["SHAPE@XY", targetIDfield]) as targetcursor:
    for row in targetcursor:
        arcpy.SetProgressorLabel("Computing Distance: {0} features complete".format(str(count)))
        targetpoint = Point(row[0][0], row[0][1], row[1])
        for sourcepoint in sourcepoints:
            currentdist = targetpoint.GetDist(sourcepoint)
            distlist.append((sourcepoint.ID, targetpoint.ID, currentdist))
            if createplumblines:
                plumblines.append((sourcepoint, targetpoint))
        count = count + 1
del targetcursor

# Update the table with the info from the distlist.
tnum = 0
with arcpy.da.InsertCursor(outputtable, ["SourceID", "TargetID", "Distance"]) as tablecursor:
    for row in distlist:
        arcpy.SetProgressorLabel("Adding distances to table: {0} features complete".format(str(tnum)))
        tablecursor.insertRow(row)
del tablecursor

# Create the plumb lines if the option was enabled.
if createplumblines:
    plnum = 0
    plumbcursor = arcpy.da.InsertCursor(createplumblines, ["SHAPE@", "SourceID", "TargetID"])
    for sourcepnt, targetpnt in plumblines:
        arcpy.SetProgressorLabel("Generating plumb lines: {0} features complete".format(str(plnum)))
        plumbarray = arcpy.Array([arcpy.Point(sourcepnt.x, sourcepnt.y), arcpy.Point(targetpnt.x, targetpnt.y)])
        plumbline = arcpy.Polyline(plumbarray)
        plumbcursor.insertRow((plumbline, sourcepnt.ID, targetpnt.ID))
        plnum += 1
    del plumbcursor

# Done!
arcpy.ResetProgressor()
</code>
Let me know if you have any issues running the script. It works for point-to-point geometry comparisons. A more challenging exercise is writing an algorithm to compare the higher geom types to each other.
Best of luck!


Like button comments not placed correctly

Question: I am using the wordpress facebook plugin by facebook. When somebody clicks the like button, the  "add a comment" box pops up. Filling that one it is placed correctly in the news overview. In the timeline or profile page, the content is replaced by three or four lines with the letters "N/A". Checking this with other sites, the same thing happens. Is this a known bug? does anyone know a way to solve or work around it?
Answer: Maybe it's a problem with you web browser.


What are the requirements of a new computer to run code?

Question: My brother is getting a new laptop and wants to get into coding. I just need to know the specs of the type of system needed to just run code, as in stuff like the processor, RAM and anything like that.
Answer: If he is just getting into coding, any computer will do. At the beginning, the tasks are very simple for the computer and you wouldn't see a difference between an intel celeron or a xeon.
Once he gets to an advanced state, I would consider a more powerfull computer, but not before.
Answer: While I would echo what A.Barth says about 'any computer will do', I would just caution that you don't want a completely crap computer.
You don't need a super powerful machine, or a good GPU etc.
However, as programming does require a quick feedback loop, it's incredibly tedious if you're having to wait a couple of seconds for things to run etc.
That said - I'm a professional web developer, and I was able to get by fine with a second hand laptop that I bought for about $US500 a couple of years ago.
At a minimum I would suggest that the computer has a SSD, at least four cores,  at least 8GB RAM, preferably 16, and if they're running Windows, use Windows 10.
There are plenty of second hand (Look at ex-commercial) laptops you can get for around $US500 that fit this.


FOV got too narrow in solid or wireframe view ! (can't toggle it back to normal)

Question: I am not new to Blender but it's been a while and I am not familiar with the most recent versions. So, sorry for the trivial question. I was editing a solid and suddenly everything disappeared except few nodes close to my editing area. I tried to zoom out, close the file, reopen. No way to get the rest in view. It looks like some kind of "fog of war" effect which I do not know how I toggled (probably clicking some key by mistake). Could you please help me restore the proper settings? See my screenview in wireframe mode and rendering mode for comparison. thank you in advance.
clipped FOV, FOV in rendering mode
Comment: Does this answer your question? [What is this 'view only the selected area' mode I am in, in the 3D viewport and how do I out of it?](https://blender.stackexchange.com/questions/185971/what-is-this-view-only-the-selected-area-mode-i-am-in-in-the-3d-viewport-and), [View Port Guide/Grid Broke? Front, Back and Side Cameras](https://blender.stackexchange.com/questions/200285/), [Gray cone obscuring/clipping the 3D Viewport](https://blender.stackexchange.com/questions/18783/) etc.
Comment: Hello, @livio.. this question does look like a duplicate. If it turns out not to be, edit to explain, and we can re-open it for you.
Answer: OK, I figured it out. I inadvertently pressed Alt+B and toggled the clipping view.
Navigating to View > View Regions > Clipping Region, solved the problem!


Can't access my site due to fatal error

Question: I tried to access my site after a months break and can't even get the admin page to login. site is www.puncturecallout.com
seems to mention the paypal plugin as the problem? Will be painfully simply to some i apologise, layman's terms would be appreciated. Site not backed up computer so no idea how to access it.
thanks
robbie
Comment: Do you try to disable the plugin via database?
Answer: The "White Screen of Death" (which I assume is your issue, since you provided minimal details) can usually be diagnosed starting with the error.log file for you site.
This is available via your hosting Control Panel, File Manager, or via FTP access.
The latest error will usually show a folder/file that is causing the problem. If it is in the 'plugins' folder (like wp-content/plugins/plugin-name/something.php), then rename the 'plugin-name' to something else (again, via your hosting File Manager or FTP). (You don't need to disable the plugin via the database; renaming the bad plugin's folder will disable it.)
Then, try to get to the site, and log in as an admin. Install all updates (look in Dashboard, Updates after admin login) and continue from there.
Lots of answers if you do ask the googles for "WordPress White Screen of Death". But the above should get you started.
Comment: Thank you for that information. I didn't know that it is so easy to deactivate a plugin by changing the the folder name. thx :)
Comment: Yep...standard troubleshooting when you get a 'white screen of death' or fatal errors is to assume that a plugin is at fault. So renaming the plugin's folder effectively disables the plugin that is (probably) causing the problem. You can disable all plugins by renaming the wp-content/plugin folder.   (If my answer is correct, use the checkmark to mark it so.)

Can't access my site due to fatal error


Can I use the function menu_tree() in Drupal 7 to customize a menu and add CSS classes?

Question: Can I use the function menu_tree() in Drupal 7 to customize a menu and add CSS classes? I've tried to customize a main_menu by adding CSS classes: Is it the right way?
Answer: The easiest way to add custom classes to menu items in Drupal 7 is the Menu Attributes module.
If you really want to do this programmatically, then you can override the theme_menu_link() function in your theme's template.php file. Be sure to read the drupal.org documentation on Overriding Themable Output.


Which has a higher lattice energy CaO or NaCl?

Question: I know that as charge increase the lattice energy increases as well. However when the size increases, the lattice energy decreases. Can you please explain this to me? I think it is CaO but i'm not sure. Thanks!
Answer: Lattice enthalpy of an ionic solid is the minimum thermal energy required to completely convert one mole of that ionic solid to isolated gaseous ions. Here "isolated ions" in the sense that the distance between the separated ions is sufficient to reduce the electrostatic interaction between them to zero practically.
It is also the energy released for the reverse process of  settling of isolated  ions into the solid lattice.
Greater the charge densities of ions higher the electrostatic interaction and so higher the lattice energy by magnitude. A smaller anion/cation with more charges will have higher charge density. Here calcium ion (114pm)is  not only smaller than sodium ion(116pm) but also having twice the charge as that of sodium ion.
Similarly oxide ion(126pm) is much smaller than chloride ion(167pm). Former is doubly charged where as latter has only single charge. For both these reasons CaO has a much high lattice enthalpy (3414kJ/mol) compared that of NaCl (787kJ/mol)
Comment: https://chemistry.stackexchange.com/questions/104805/comparing-the-lattice-energy-of-different-compounds/104864#104864May be of use as well


Are photon energies universally quantized?

Question: Is it theoretically possible to have a photon of any energy/wavelength? I have a vague memory in my mind of something like there being a minimum energy level for a photon and then the possible energy levels jump up in discrete but ever decreasing amounts, so that near e.g. the visible spectrum photon energies are for practical purposes continuous.
Answer: There is a minimum energy level $h \nu$ (corresponding to a single photon) for light of a given frequency $\nu$.  But there is no absolutely minimum amount of energy for light, because you can have a photon with arbitrarily low frequency $\nu$ (ignoring the possibility that the universe is finite in size).
Comment: But $h\nu$ isn't just the minimum, right? It is the actual energy of a photon of frequency $\nu$
Comment: @coconut Yes, each photon with frequency $\nu$ has energy *exactly* $h \nu$, and the minimum possible *total* amount of energy carried by a light beam is that of one single photon.
Answer: The photon is a quantum mechanical particle in the standard model of particle phyisics. Classical electromagnetic radiation emerges from a confluence of innumerable photons.
The photon is characterized by its zero mass and its energy which is equal to h*nu, where nu is the frequency of the emergent classical wave.
What you are referring to are photons from transitions in energy levels of atomic or molecular or lattice bound states. There the photon comes in quanta, but these transitions are different for different atoms/molecules/latices . Once emitted they can be redshifted or blue shifted depending on the emitting source's velocity, so there are spectra , but no real constraints on the possible energy carried by a photon. So yes, even though the photons may be coming from individual spectra, the frequency can seem continuous because of the great multiplicity of atomic/molecular/lattice sources.
In addition, charged elementary particles emit photons when accelerating or decelerating. In an antenna for example, the accelerated and decelerated electrons emit an electromagnetic wave: this is the confluence of individual photons emitted by individual electrons within the antenna, and the frequency is variable and constrained only by the possible dimensions of the antenna.
In conclusion photons are only constrained to have zero mass, but can have any energy, i.e. any nu. This is true for massive particles too, which are constrained to have their fixed mass but can have any energy.
Answer: It is possible.  The discretization you're thinking of comes from talking about the photons emitted/absorbed by systems with discretized energy.  For those specific systems, yes, the photons that they specifically emit/absorb will be found with discrete energies.
Answer: The introduction of photons comes from the empirical fact that energy transfer happens in portions. Einsteins famous explanation of the photoelectric effect had underlined the theoretical work from Planck about the quantization of the black body radiation. Photons are indivisible units from their emission until their absorption.
The emission of photons is associated with energy losses. Every photon carries energy. Furthermore through double slit experiments the spectrum of light was associated with wavelengths and using the speed of light with frequencies. From thermic sources (non-modulated electromagnetic radiation) one get radiation from gamma, X-ray, ultraviolett, visible to infrared. The named radiations are less and less energetic per photon. The minimum level for photons lay in the range of infrared respectively microwaves.
Now somebody says that radio waves have lower frequencies, longer wavelengths and by this radio waves a lower energy level. This is nonsense. Radio sources are modulated radiation where electrons periodically get accelerated and by this emit EM radiation in the range from IR to X-rays. Please consider that for the same radio frequency the source can have very different energy content which depends from the wave generator.
Providing spectroscopic experiments it was find out that atoms and molecules emit photons of some wavelengths and by this always in the same relation of the emitted wavelengths. The shift in the energies of the emitted wavelengths depends from the energetic level of the emitting body.
As long it was not measured any quantum behavior of the energy emission. Changing the energy content of the emitting body the spectral lines changes continuously. This does not mean that there is no quantisation of possible photon states, but it is not observed until now. A mathematics based not on statistical properties but on the existence of smaller particles as constituents of photons would be a task for the future.


Buying a Cornwall to London Night sleeper ticket from Canada, for May, 2020

Question: How to book and pay for ticket from Canada For this May
Comment: also look into britrail passes. They can only be bought by foreigners and may be cheaper than one single ticket bought the usual way.
Comment: I second the railpass idea. Not sure if it covers the sleeper but if you plan on travelling by train a lot it's good value.
Comment: The rail pass covers the seated sleeper (though you still need a free seat reservation), the usual supplement is payable (£55 for a berth in a shared compartment/£80 for a solo occupancy compartment) for a bed. So if this is the only train journey you're making I find it unlikely that the pass would be better value. In addition, buying a supplement on its own is hard when you're abroad; I believe it is impossible online, so you'd have to buy it over the phone (and I'm not even sure if that is possible). This is why I didn't bother to mention it in my answer.
Answer: You can book sleeper tickets through the GWR website. Enter your origin and destination stations (London Paddington is the correct London terminus for the Cornish sleeper), and set the time to late in the evening. The sleeper train will be highlighted in the search results. The fares which allow berths (beds) to be purchased will also be highlighted — note that flexible fares like Super Off-Peak Singles/Returns have a supplement that must be paid for a berth, whereas inflexible fares will either be for a seat or for a berth. Make sure you know whether you're paying for a berth in a compartment (ie a bed), or just a seat. If you have an odd number of people, you also may be given the option to share a compartment with a stranger of the same gender (a compartment has two berths arranged as bunk beds), or to pay more to get solo occupancy of a compartment. Note that the sleeper does not run on Saturday evenings.
As for delivery options for people living abroad, GWR have e-Tickets, which you can pick up using their mobile app, or if you prefer you can instead opt to print a physical ticket from a machine at your station of origin when you arrive for your train — bearing in mind you will need your original payment card to pick it up. I don't think GWR will post tickets abroad but I might be wrong.


Choice of factor model based on correlation

Question: I have a portfolio of assets.
Each assets have been discretionally (based on investment manager experience) related to economic factors like (like exchange rate inflation spread etc). Now for each asset I want to see if effectively those fator are relevant in order to make a regression and find the betas (coefficient of regression). My question is: what correlation should I use? Pearson which is only a linear based approach or Spearman which can also deal (I am right) with non linear relations and outliers? I did both but clearly I get different results so I need to choose among them. Thanks.Luigi
Answer: Indeed Pearson correlation coefficients measure only linear relationships. Spearman correlation coefficients measure only monotonic relationships
There is a comprehensive article there.
Comment: Thanks. Indeed i am aware of the characteristics of both, but my question was more: based on the financial literature on this subject, and considering that a factor model based on macroeconomic factor is not something new but instead well known, what is the typical approach? choosing factor based on high Pearson or high spearman? Also taking into account that some regression like lasso already set some coefficient to.zero based on correlation, my way of proceed is correct or is better to take all the factors and let the lasso the job of removing some of them?
Answer: Assuming you're going to be fitting a linear regression, creating a correlation (Pearson) matrix of all assets is a common first step to filter endogenous (or multicollinear) variables from your test set.
Comment: thanks for confirmation. However, if I use a Lasso, is this correlation step redundant? as the lasso drops some features to zero or not?
Comment: @Luigi87, maybe not exhaustively but if you're using LASSO you likely don't need the correlation matrix as well


Nice way to print_r arrays

Question: So you know how Drupal has functions in modules like Devel that allow you to output arrays in a nice format like dsm($array) or krumo($array)... Does WordPress have an equivalent or a nice way of displaying print_r($array)?
Comment: krumo allows users to print arrays into a formatted list that expands on click. So instead of having -wrapped print_r output everywhere, you end up with some very nice dropdown lists instead. Much nicer to display!
Comment: what is wwrong with var_dump() or print_r() ? what exactly are you aiming for ? (i am sorry, I do not know druppal so well ..
Answer: I created a Kint plugin that works really well. I also integrates with the Debug Bar plugin. You can download it at: http://wordpress.org/extend/plugins/kint-debugger/
There are a few functions to help you out with WordPress specific globals:

dump_wp_query()
dump_wp()
dump_post()

For printing arrays in a styled, collapsible format you would do the following.
$foo_bar = array(
    'foo' => 'bar',
    'bar' => 'oof',
    'rab' => 'foo'
);
d($foo_bar); //Styled
s($foo_bar); //Un-styled

Comment: What a great idea, cheers.
Answer: You can install and use Krumo with WordPress (or any PHP app really). There's the Hikari Krumo plugin that simplifies use, though check the comments there, there's an error that you'll need to manually fix to get it working with latest WP. There's also the WordPress Debug Bar plugin which you might find useful.
EDIT- Another option I've recently discovered, Kint; screenshot:
Answer: For this kind of stuff, I wrote REF (requires PHP 5.3). Among many other features, it displays contents of DocBlock comments and linkifies PHP-internal classes, methods and functions (links point to the PHP manual). It also handles WordPress functions (links point to queryposts.com).
Here's the output of $GLOBALS at the setup stage of WordPress in HTML mode (r($GLOBALS); in functions.php):

Comment: +1 for DB user `root` and an empty password.
Comment: lol never thought WP would actually store that too :)
Comment: One Trick, the image went missing.
Comment: Seems to show up for me. I added a new one to reflect the last updates to this script
Comment: This is incredible!! SO needed.
Answer: If you just wrap the print_r() in
 tags it will output beautifully. If you're looking for a bit better diagnostics than that, black box and the debug bar posted by @Milo are my gotos.
Answer: Also you can use the plugin Debug Objects; list also scripts and styles.
The Plugin has many more options for dev and debugging, but also this feature.
Alternative is this source, you find informations and the post about this topic here:
add_action('wp_footer', 'fb_urls_of_enqueued_stuff');
add_action('admin_footer', 'fb_urls_of_enqueued_stuff');
function fb_urls_of_enqueued_stuff( $handles = array() ) {
    global $wp_scripts, $wp_styles;
    // scripts
    foreach ( $wp_scripts -> registered as $registered )
        $script_urls[ $registered -> handle ] = $registered -> src;
    // styles
    foreach ( $wp_styles -> registered as $registered )
        $style_urls[ $registered -> handle ] = $registered -> src;
    // if empty
    if ( empty( $handles ) ) {
        $handles = array_merge( $wp_scripts -> queue, $wp_styles -> queue );
        array_values( $handles );
    }
    // output of values
    $output = '';
    foreach ( $handles as $handle ) {
        if ( ! empty( $script_urls[ $handle ] ) )
            $output .= $script_urls[ $handle ] . '
';
        if ( ! empty( $style_urls[ $handle ] ) )
            $output .= $style_urls[ $handle ] . '
';
    }
    echo $output;
}

Answer: Why not just use xdebug?
Looks pretty neat to me, by default.

There is also Kint, http://code.google.com/p/kint/ but I found the dropdowns more confusing, then the full output of xdebug.
Comment: +1 And don't forget to configure it in your `php.ini` file to avoid those nasty `...` for nested stuff.

Nice way to print_r arrays


Can we automate Post-deployment steps (Manual Activities) on Salesforce Environment?

Question: I have 50 post-deployment steps and I need to perform on UAT, Pre_Production, and Production. Is there any way that we can automate the steps?
Comment: what kind of postdeployment steps? few config records or profile fls?
Answer: Large numbers of post-deployment steps usually reflect a weak source control or change control program. Unfortunately, that means that the solution is architectural: there will be a need for a significant investment in product, and possibly tooling as well, to eliminate these steps.
For example, if post-deployment steps include making manual changes to Page Layouts, the solution is to make those changes as part of development, version control them, and deploy them to production alongside other application changes.
However, if the organization is used to being able to make page layout changes directly in Production, this could be a significant, and potentially disruptive, shift.
Many tools, both commercial and otherwise, are available to facilitate a comprehensive source control/continuous integration/continuous deployment strategy. It's essentially always going to be a fact, though, that none of these tools will provide a push-button fix to correct a specific problem, like this one, that is representative of a fundamental weakness in architecture. You're going to have to make some level of change to your development strategy, org pipeline, source control, etc., in order to achieve a genuine fix.
Comment: Yeah, the model I'm seeing so far is skeleton Profile (with no FLS) to do assignments, and then the PSG holds everything else.
Comment: I do agree most can be scripted or part of the deployment package, but I do find few things not available for source control or in fact deployable(Omnichannel, chatbots amongst the few). Plus deploying profile is nightmarish. it's impossible to resolve conflicts in 10k+ line profiles. it's better to do these as post-deployment steps by an admin. Selenium or any automation tools do help. If there is 1 thing that I want SF Santa is the ability to split profiles in a different subfolder like they did for object in dx.
Comment: Good points. For undeployable metadata, orgs have to make a call: are you going to be deploying this once, or many times as part of a process? If the latter, it calls for automation with Selenium or Robot or similar. I just hate Profiles. Permission Set Groups are the future.
Comment: We are trying to move toward the permission set group, the experience has been a quite nice, less hassle. But it might not be fully functional as default record types, page layout, lightning Flexi pages assignment are still profile-based.  We still have to create different profiles just for page layouts and lightning page. Once SF finds something to replace, I believe transition to PSG would be smooth.
Answer: We've used the SandboxPostCopy interface to create a script that runs after the sandbox is created.
Documentation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_System_SandboxPostCopy.htm
One potential gotcha: the script runs as the "Automated User".  So make sure any test records you create have a specified owner.
Some things can't be updated easily via apex.  I'd be interesting in knowing what specific steps are being done.  But in any case, you may be able to cut your 50 steps down to <5.
Answer: I doubt that any product out there provides one click solution to automate the post deployment steps. You could explore paid solutions likes AutoRABIT, BlueCanvas etc., but they won't provide complete automation either. If the post deployment steps are something that can be performed by APEX or LIGHTNING, then you could develop custom solutions.


Why is the linearity of a sensor a desirable feature?

Question: I mean, a sensor can have a characteristics like Y=X^2 (X = the input, Y=the output).
That is, I can easily find X if I know Y.
Why is the linearity so important?
Comment: Because when it is not linear, its sensitivity and resolution varies with input variable
Comment: It was much more important when everything was analog.  These days, when you can do math on your data, or interpolate to a look up table, linear sensors are a nifty convenience, not quite a necessity
Comment: If you have to do the calculation in your microcontroller you might take less clock cycle when linear.
Answer: A lot of stuff still uses relatively low-powered or cheap microcontrollers, 8-bit micros haven't gone away.
The upshot is that:

Maths is expensive (in CPU cycles)
Floating-point and/or signed maths is even more expensive
Doing maths introduces errors / adds to error bounds
Type conversion can introduce coding errors
Having to handle more bits than your CPU is natively capable of gets very expensive in maths terms.
Having to do any of this means having to include maths libraries (more code, more space, more RAM, more storage)

If you look at the hoops a CPU has to jump through (in machine instructions executed to achieve one mathematical operation) to do signed floating-point maths, and the resulting output precision, you might decide that just using a linear sensor is a more attractive prospect.
Comment: Most of this type of math can actually be INTEGER math.  Indeed, the numbers coming in through the ADC are integers to start.  There are, of course, quantifiable errors when you do this, but not as big as many think they are if done correctly.  Yes, there are many parameters we can optimize around.  Sensor linearity is one, clock ticks is another, and memory one more.  Every problem will point to different principle concerns when the numbers are crunched.
Comment: Scott - true, but the moment you do much more than add, subtract, or bit-shift in a basic micro you are into "hard maths". I found an integer MOD operation was taking about 20+ instructions to complete, replacing with a check-and-subtract loop actually made the code run a lot faster.
Answer: Yes, you could have a sensor that responds like that (Y=X^2)  Your sensor must still reliably do that.  In a typical sensor, Y=cX+d where c and d are ideally constants.  Due to various factors, they usually aren't simple constants.  How close c and d are to really being constants is what is referred to as linearity.  In your example, you would probably have something like Y=(cX+d)^2 , which  would cause all kinds of fun.
Linearity as in "linear response" isn't the problem.  Linearity as in "the Y values closely fit the expected linear response" is what you want.  In your example, you wouldn't be concerned with whether the a plot of Y and X is a straight line.  You would want your plot to closely match the expected parabolic curve.  It most likely won't perfectly match. For a sensor with a linear response, you would say that the linearity is poor.  For one like your proposed sensor (Y=X^2) I don't know what you'd call it - maybe just "poor response."
Poor linearity in a typical sensor means that you have to do more work to get X if you know Y.  With an ideal sensor with a linear response, you can calculate X eaisly if you know Y.  With real sensor with good linearity, you can (with in reasonable limits) determine X from Y.  With a real sensor with poor linearity, you have to go to greater lengths to determine X when you know Y.  Maybe its response varies greatly with temperature, so you have to track temperatur as well and use it when determining X from Y.  Maybe it just isn't very linear, and you have to use some funky curve to relate X and Y.  In either case, your job as an engineer is much easier if the sensor closely approximates the expected straight line.  Often times this works out to making a system simpler to calibrate and more reliable - but also more expensive since a better sensor usually means more expensive.  Sometimes you'll want to go with a cheaper and less linear sensor, and compensate for its failings in software.
Comment: "Poor linearity in a typical sensor means that you can't tell exactly what X is if you know Y" is simply not true.  So long as Y is an increasing or decreasing function of X (i.e., a horizontal line on a Y vs X graph can cross only one point on the function_, there is a one to one mapping.
Comment: You are correct if the response of the sensor is known (you have a mapping for all points.)  Since the inputs are analog, however, you don't have a perfect one to one mapping.  Also, some of the effects (temperature especially) can cause one input value to report different output values.  Also, some parts of the curve may be so steep that you can't really resolve the input - you get the same output for a range of inputs.
Comment: You're nitpicking.  A strain gage is not a linear sensor, and people use single arm strain gages every day.  Same for a thermistor, and many other sensors.  You can list the trouble spots to watch out for, but in many cases, they simply don't apply.  I don't understand your point about analog inputs at all.  Your post is largely correct, but with a clear error that is easy to fix
Comment: I think I see what you are getting at.  Maybe I've phrased it poorly.  What I mean is that without some kind of compensation (remapping) you can't tell exactly what X is from Y - you can't just apply some linear function to Y and get back to X.  Later in the same paragraph it goes on to explain that you can compensate, but that poor linearity makes it more difficult.
Comment: You're getting there.  Poor linearity "can" make compensation difficult in some extreme cases, but those cases don't come up as often as your answer seems to imply, especially if there's a microcontroller in the loop.  When issues do come up, its usually because you're too resource starved to do the necessary calculations (often starved for clock ticks), not because the sensor is too nonlinear to handle with simple math.
Answer: Many monitoring circuits for sensors are purely analogue and therefore the complication of mapping a value measured via a square root law is really not trivial. If the measurement is digitized then using math inside the CPU is fairly trivial in comparison but, like I said, many circuits are purely analogue.
Comment: @vladimir who mentioned "chip"? There are plenty of sensors that do not and should not use a chip such as straingauges, thermocouples RTDs, accelerometers, microphones etc..
Comment: I really can't think of a modern sensor chip that does not include an ADC and a digital interface...
Answer: Linearity minimises the influence of imperfections later in the circuit. For instance, say there is a small constant level of noise introduced by a preamplifier. If you need to correct for the response of that Y2 sensor of yours, the effective noise level (SNR) is proportional to the inverse function's derivative, i.e.
∂X/∂Y = d/d X √Y = 1/2 √Y ∝ 1/X.
At low levels of X, this effective noise tends to infinity (equivalently, the SNR approaches zero). In reality, it's not quite as dramatic since the pertubations aren't infinitesimal, but the problem is real: where the output voltage is only weakly correlated to the measured value, the maximum attainable accuracy suffers.
You might now think to filter the noise somehow, but there comes another problem: frequency filtering is basically linear, and to work well it assumes the signal itself has come linear – to use the physics terminology, you'd like filtering to commute with measuring. That's not given with a nonlinear sensor, for instance if you have a high-frequency signal in your X quantity around some X0, and filter the resulting Y signal, you'll get a constant offset above the corresponding Y0 value, because the square-nonlinearity "bends the pertubation upwards".
Now if you say then let's first digitally correct the nonlinearity. Next problem: you can only take discrete samples. PCM-sampling is very well under control mathematically, but guess what: it assumes everything is linear! Nonlinearities cause aliasing artifacts.
To wrap up: yes, you can somehow correct it if sensors aren't linear. But each such correction brings new problems with it; if everything is linear in then first place you can be most confident to actually get the signal you want.
Comment: On a related note, many kinds of unwanted parasitic effects can be modeled as either linear filters; or as time-independent non-linearities (harmonic distortion).  Any combination of linear filters may be modeled as a single linear filter, parameterized with a single function that maps a real to a real, and any combination of chained sources of harmonic distortion can be modeled as a single source, also mapping a real to a real.  Combining the two kinds of effects, however, yields something that is *much* harder to model.


New Mac User needs help installing Picasa and then importing all i photos into picasa with correct titles

Question: Have i photo with pictures in named folders. Want to install Picasa. When I did this picasa imported all the iphotos with goofy names, not like the iphoto names. would like to install picassa then put the iphotos into picasa the same as it looks in i photo. BTW, i am a new mac user, and recently copied all my photos from picasa to i photo. now i want to put picassa back on new mac. I prpbably should have installed picassa first on to the mac and put the photos from thePC to picassa on the mac. Now iam stuck. So, how to put picassa on mac and then put all (4,000 pictures in named files)from the iphot back into picassa for mac. Help
Answer:
Delete the photos from Picassa
Export the photos from iPhoto to a folder named by titles (or as you like)
Import from the filesystem to Picasa


Easiest way to convert list to a comma separated string by a Specific Property?

Question: I have a list of Custom objects ,Actually those are entities I am storing in an IEnumerable collection. I want to convert the list  to a comma separated string, but  I want only one specific property,  How do I build a comma separated string with a specific property from a custom object list?
I know i can build a comma separated list by using a "Foreach / For (int i .... "
but I think there is a easy and a better way for this
So what would be that easy way?
This is my list
IEnumerable<BAL.Category> categories = chklCategories.CheckedItems.Cast<BAL.Category>();
            //Category object has a property called Name , I want the list from that property

Answer: This is very easy , Isn't it ?
string sCategories = string.Join(",", categories.Select(x => x.Name));

Answer: Just try with this.
By using this version of the string.Join<string> method, you can reduce copies of your collection before joining.
static string CombineList(IEnumerable categories)
{
  return string.Join<string>(",", categories.Select(x => x.Name));
}


Is there a way to import extensions from Chrome to Safari

Question: I had downloaded some extensions like Competitive Programming Calendars on my Chrome. So I prefer to use the Safari and I wanted to know if I could import the exact same extension to Safari? And if there is any link to that calendar extension to the Apple Calendar?
Answer: In a word, no.
Safari Extensions and Chrome Extensions are designed for two different web browsers. Just like you can't (natively) run a Mac app on Windows or Linux, you can't run a Chrome Extension on Safari.
Some developers write extensions for multiple browsers (Chrome, Firefox, Safari, etc.) but they must be written for the browser they run in. Which is why browser extensions that have versions for each browser have different versions for each browser.
One thing of note here is the browser extensions are usually not specific to Windows/Mac/Linux. So if you see a browser extension you used on Chrome on a PC you can still use it on Chrome on the Mac.
Answer: Apple has made converting a Chrome extension to Safari possible as of Big Sur. It requires their developer tools (Xcode) and Terminal use.
See the article
Converting a web extension for Safari.
And see How to Convert Chrome Extension to Safari on Mac? for a walkthrough.
The converted extension may or may not work (after all, it's an automated code conversion from one platform to another, so results will vary).


Blog link at foot of security.se pages has incorrect address

Question: At the foot of security.stackexchange.com there is a link marked (new) BLOG. Currently this links to blog.stackexchange.com, but I'm thinking it should be to security.blogoverflow.com or possibly just blogoverflow.com. Any thoughts?
Answer: This has been amended. ♪
The links to your blog, in both the footer and the header, will now redirect to your blog as expected, and will provide apt notice of new blog posts as well.
Answer: @Rebecca has mentioned a few times, that since our blog is still in "beta", the link will still point to the main SE blog.
They will agree to change the link to out blog, when the blog goes "live". (When that is or what that means, I do not know...)
Comment: But isn't blog live now? We have full theme, it is front page at blogoverflow etc
Comment: ** Guess you'd have to ask @RebeccaC.


What syntax references Pipeline parameters in the where clause of a SQL query of 'Import Data' modules in Microsoft Azure Machine Learning designer?

Question: I have created a pipeline in Microsoft Azure Machine Learning designer.  I have added a Pipeline parameter myNumber in the pipeline settings, with a valid default value, to accept the unique ID of the asset in our DB so that the pipeline can return only the asset-specific data for use as our model input.  Specifically I want to reference that pipeline parameter in the where clause of the SQL query in the  'Import Data' module that connects to our Azure SQL server.
I cannot find a reference in the documentation on how to do this.  I have tried the methods specified for accomplishing this task in Azure Data Factory, using  where RowId = @pipeline().parameters.myNumber or where RowId = @{variables('myNumber')} but the experiment fails with SqlException error code '137', variable not defined.
Can you please tell me the necessary syntax to reference Pipeline parameters in the where clause of a SQL query of 'Import Data' modules of Microsoft Azure Machine Learning designer?
Answer: The following documents may be helpful to you.

Create Azure Machine Learning pipelines
Transform data in Azure Machine Learning designer
Import data into Azure Machine Learning designer


I lost my crosshair and my hotbar in minecraft

Question: I lost my crosshair and hotbar in Minecraft. When I press F1 they come back, but then all the things like coords come out and I don't know how to get it to go away.
Comment: I would personally recommend facerolling across your F-keys. I actually recognize the issue and I do remember having it and solving it myself but I don't actually remember how so I'll refrain from giving an answer. I am certain it's a button to hide the interface for screenshots and whatnot.
Answer: Have you tried pressing F3? Pressing that toggles the coordinates display. You can also try logging out then logging back in.