How could I have been clearer in my most recent question?

Question: I recently posted this question: How to handle hostility in interviews? which was marked duplicate and closed. I had also posted a similar question some time ago: Breaking the accent barrier in a telephone interview
The questions are similar to an extent and even though I answer in the comments and specify that the second question is centered on how I can be better prepared for hostility in interviews (in my scenario arising out of communication-al challenges), I wasn't clear enough for members of workplace.  How could I have been more clear in expressing the differences between both these questions?
Comment: When I read the question, my sense was it was more about the hostility aspect, than about the accent barrier. Perhaps I was wrong? It's hard to tell.
Comment: @JoeStrazzere Just the both of us who read it that way, I guess :) Based on the answers here, I have made some changes for greater general use of that question.
Answer: You could have removed the specific references that made everyone but you realize that the problem was that you were misunderstanding the interviewer due to his accent.  And just focused on how you were perceiving his words rather than the specifics.
When you focus on the specifics it can be perceived as a rant by the people reading the question, and those people start to focus on the specifics and trying to solve the actual problem instead of the question you asked.
Here is a way you could have phrased your question:

I had attended a Skype interview recently with a pretty known firm in
  a foreign country. Part of the interview involved a fairly easy task
  but the interviewer used a term I did not understand.  While trying to
  clarify the interviewer seemed to become hostile and made sarcastic
  remarks about people from my country.  Eventually I was able to
  understand what he wanted and the interview progressed.  But by this
  time the mood had soured and in the end the firm decided not to make
  me an offer.
What can I do to salvage an interview if it has turned based on a
  misunderstanding?

This becomes an answerable question... but I think you can probably also see that the new question is a duplicate of the question that your original version was closed for.

The other important thing to realize is sometimes you can not salvage a situation.  There are points of no return where no standard answer is going to have an effect.  There may be something you can do in the moment or very situation specific to save the interview.  But in this case chances are by the time you recognized this interview turned it was beyond any standard response.  So maybe you would be better of asking how you can better prepare for an interview to avoid it going south in the first place.
Comment: +1: `You could have removed the specific references that made everyone but you realize that the problem was that you were misunderstanding the interviewer due to his accent... Here is a way you could have phrased your question...` Great answer.
Comment: Ahh. The shades of ranting! Never ask a question while one is still grouching. Very nice answer. I do think that the question you phrased still talks about how a hostile interview can be saved instead of merely breaking the accent barrier
Comment: @happybuddha - Which leads you to the second half of my answer.  If you want edit your original question and see if it gets reopened
Comment: @happybuddha: If you accepted Chad's proposed revision in kind, I'd happily vote to reopen.
Comment: @Chad, I have used your suggestion and edited my question. Though yours is a fantastic answer, this time jmac's answer really cleared my thought process.
Answer:
How could I have been more clearer in expressing the differences between both these questions ?

I think the issue was the same in both questions, but you didn't realize it (and actually argued against it).
Comment: To me, the first question was about accents, the second question was about hostility. I didn't see them as the same. Perhaps it was just me.
Comment: How are the issues same ? One talks purely about dealing with accents and the other talks about hostility in interviews. I so wish to realize it, but I somehow don't see what most members around are seeing so clearly. If providing clarification seems argument to you, well, who can do anything about it. I hope you dont take this comment as an argument, I am merely providing clarification
Comment: +1: Bingo! Winner winner chicken dinner.
Answer: Executive Summary
If you want to make your questions clearer and more distinct:

Explain the situation objectively
Stop focusing on irrelevant details
Listen to constructive feedback

Explain the Situation Objectively
Your question was filled with your own bias:

It was a coding test and the person on the other end interviewing me was a person with a very heavy accent (The accent was middle Eastern/Asian but his enunciation of words was more in line with how Cantonese/Mandarin), and, in hindsight, subtle hatred towards the US in general.
When after 5 minutes of back and forth on 'Did you mean X/Y/Z' when I finally understood what he wanted, I said 'I see, you want an empty array created ?' to which he angrily replied "Is that how Americans call MTRI, huh ?". Some more subtle chiding and a few other sarcastic remarks were also passed during the rest of the interview.
As expected, very unfortunately, I did not make it through and lost an opportunity with a supposedly great Australian firm. However unjust I may think my technical evaluation was, what are some of the ways one can handle these types of situations in the future ?

The bold phrases show your personal bias toward the situation. It is natural to feel this way, but when you put it in the question, it taints the potential answers and implies that you are looking for people to agree with you, rather than inviting people to look at the situation objectively, and determine for themselves what types of strategies may work.
Stop Focusing on Irrelevant Details
You say the question is, "How to handle hostility in interviews?" so focus on that rather than trying to explain the details of why the hostility happened. You explain many details that are irrelevant to the actual hostility:

The accent was middle Eastern/Asian but his enunciation of words was more in line with how Cantonese/Mandarin
During the interview he wanted me to create an empty array of Strings in java. He said, "I want create MTRI (Em-tee arr-eye, literally pronouncing individual letters)"
Ironically, MTRI also is used commonly to point Mother Tongue/Regional Influence issues in accent/English correction classes
Some more subtle chiding and a few other sarcastic remarks were also passed during the rest of the interview.

These details are irrelevant. There was a miscommunication which caused friction in the interview. How can you overcome the friction in an interview after a misunderstanding?
Listen to constructive feedback
You have a habit of dismissing the feedback of people who comment on your questions. You try to convince them why your question is fine as it is, rather than accepting the constructive criticism as an opportunity to improve it.
Shockingly, this rubs a lot of people in the wrong way.
If you aren't writing objectively, and put in a lot of irrelevant detail, people have to parse through those parts and interpret them to get to the question. The more they have to wade through, the less likely they will come to the same conclusion you did in your question. So when they do wade through it and come away with a different message, this is great feedback on how to improve your message.
If someone comes away from your question with, "So you had trouble understanding an interviewer, this seems like the same problem as this other question" it means that you are probably focusing too much on the accent portion, and not enough on the hostility portion. Take comments as community willingness to help improve your question, not an opportunity to be defensive.
Revised Question
So following these comments, I would edit your question to read as follows:

How can I clear the air after a misunderstanding in an interview?
I was having a technical interview by phone when I had a misunderstanding with the interviewer causing friction that hadn't been there at the start. The interview went downhill and I didn't get the job.
Misunderstandings happen, and can't be entirely avoided. How can I clear the air after a misunderstanding in an interview to prevent it from turning the tone of the entire interview negative?

Note that this revised question:

Does not place blame (it is objective)
Does not focus on the details of the misunderstanding
Does not sound anything like the prior question about accents

I am not going to make this edit myself, but if it were to read something like the above, I would happily reopen, upvote, and answer it.
Comment: IMO, this is your first positive and a really constructive answer to my question which has made me see the mistakes I made. Thank you.


Resonating glasses

Question: When we collide two glasses they produce sound like not from one collision but from multiple. And frequency changes over time. Is this because they resonate with each other? But how this resonase happens?
Comment: "not from one collision but from multiple" Do you get this mostly when you collide them very gently? "frequency changes over time" A glass will vibrate with multiple frequencies ("harmonics"). The higher ones will die down quicker. Could that be what you are hearing?
Comment: What happens, if you **hear** two frequencies, which are similar?
Comment: If resonance happend then how would changing the frequency? I think if resonance happend then it should be a particular frequency.If the collision make change the structure i.e change the resonant frequency .Then Why are you so sure about resonance?
Answer: I believe the question can be rephrased (more clearly) as follows: "when we collide two glass balls (or two steel balls), we hear multiple collisions. The intervals between collisions change from long to short. Why?"
Take a look of this video https://www.youtube.com/watch?v=k1id4a4EU4M (Pay attention to time 1:01) when he casually collided the balls you hear such a phenomenon.
You can reproduce the phenomenon with two cups, to bowls, etc. Just hold them loosely in two hands so they naturally droop under your hands. Now move them close to make gentle collisions.
Why? Because when we collide two very hard objects, the first collision bounces both of them back a little bit so they separate from each other, only to allow the moving hands to push them back in to make the second collision. As they are pushed closer and closer, the intervals between collisions are shorter and shorter.
Answer: A vibrating object like a wine glass or a bell is a very complicated system. It is possible for a wine glass, for example, to exhibit multiple resonance modes in which the modes are weakly coupled i.e., energy in one mode is slowly shared with other modes. This means the quality of the perceived sound will shift perceptibly on a timescale of ~seconds.
Note also that the initial strike which sets the glass vibrating is a sharp impulse function which contains many harmonics. This means that many of the fundamental modes of the glass may get excited by the strike.
These two things mean that the decay of the sound emitted by a struck glass will be correspondingly complicated!

Resonating glasses


Assigning a value to Y for regression

Question: I'm creating a system to evaluate a risk level that grows as it approaches in time to the crisis event. This risk level ranges from 0 to 100, it's a self made index, totally arbitrary.  I have a matrix containing features (X) for  each time window. Is there any method to obtain the best model for the values of Y? I mean, knowing how Y should increase (linear, exponential, gaussian) according to the variables I have.
Comment: Why not use the objective, non-arbitrary measure of "time to crisis" as your Y value? Presumably you have a training dataset with that information, why replace that actual data with an uninformative mapping to a new scale?
Comment: How many instances do you have in your dataset? How many features do you have?
Comment: Can you describe what your time windows are? Do you have multiple timesteps of features between crisis events? If so you can predict time to next crisis event and then transform the output to the desired scale.
Answer:
it's a self made index, totally arbitrary

Therefore how it should increase is totally arbitrary too.  I think the best answer to your question is that you need to think about the behavior you want to see out of your Y variable, and then write an algorithm that exhibits that behavior.
Do you want the value to suddenly explode as you reach the crisis event? use an exponential. Do you want to gradually approach larger values? Use a linear model. Do you want a function that gets larger until you reach the crisis event and then slowly dissipates? Use a gaussian.
Answer: You might not want to model your data with a standard regression. It could be more useful to frame it as survival analysis.
Answer: First, you need to make a model to predict the crisis.
Second, you need to output be a probability of crisis instead of zero and one.

There are two kinds of algorithms (dependent on the kind of output it
  creates):
Class output : Algorithms like SVM and KNN create a class output. For instance, in a binary classification problem, the outputs will be
  either 0 or 1. However, today we have algorithms which can convert
  these class outputs to probability. But these algorithms are not well
  accepted by the statistics community.
Probability output : Algorithms like Logistic Regression, Random Forest, Gradient Boosting, Adaboost etc. give probability outputs.
  Converting probability outputs to class output is just a matter of
  creating a threshold probability.

So, choose an appropriate algorithm, and then the shape of output can be related to your policy. If you want a realistic, it should be linear so don't transform it. But if you want to be careful then use exponential transform.
Another way to be more precise is using the cost of a crisis and investigating in modeling. In this way just use 0,1 to decide to investigate or act as normal.
I suggest you use a combinational model.

Assigning a value to Y for regression


Offline Updates to Windows 7 and XP

Question: I have a number of clients that will never see an Internet connection, thus will never receive Windows updates that I need to somehow make happen.  I read a SuperUser suggestion from 2009 that spoke of Windows Server Updates.  I tried to download and install it on my Windows 8 (Internet connected one) and it said it was incompatible.  Any ideas as to where I can go to get the latest Win 7 and XP updates, burn them to disc and manually update my clients?
Answer: Microsoft produce an ISO file of the security updates each month. I don't know about the non-security updates.
Answer: The "Windows Server Updates" you heard of would have probably been Windows Server Update Services (WSUS). If you have a number of clients that are not connected to the internet, but can talk to a server than is on the internet, this would be a great option.
You will require a machine running a Windows Server OS, according to the system requirements you can go back as far as Windows Server 2003 (Windows 8 isn't a server OS so it won't work on there). I don't know if there are other requirements like DNS and Active Directory, and if any of that applies to your situation.
Use the links above and Google to figure out how to setup the server and clients. The end result is that the server downloads the updates from the Internet and the clients get their updates from the server.

As for downloading and installing them manually, David's answer is the best option.
Answer: You might want to try out WSUS Offline.
The basic idea is that it will create an offline copy of a previously selected set of updates for a variety of target Windows versions. You can then take that offline copy to the target machine and apply it.

After downloading, run UpdateGenerator.exe and select the packages you want to download.

This process will take a while...
Now you can copy the client folder to an external storage media (alternatively, you can use the USB medium options inside the update generator).
On the target machine, run UpdateInstaller.exe and pick what to update/install. "Normal" Windows updates will always be installed.
Comment: Note that unlike `WSUS`, `WSUS offline` is a 3rd party open source program.

Offline Updates to Windows 7 and XP


Eclipse Versioning Project

Question: We develop same project with my colleague. We do not use any team programs. Thefore, when i editting same class which is editting by my colleague at the same time but as i said there is no plugin like team development. Same project is developing two different eclipses. I want to do that to version my project which is located in my eclipse workspace. Then, my colleague also version his project and i want to combine them in my or his eclipse. Is there any plugins or eclipse function to do that? I hope i clearly explain what i want.
Answer: Learn and use a version control system, such as Subversion or Git. There are plugins for almost any version control system for Eclipse.
For example, there's Subclipse, an Eclipse plugin for working with Subversion, or EGit for working with Git.
Comment: I'd like to throw in Mercurial. It's a distributed version control system like GIT but 'easier'. My advice is to skip Subversion.
Answer: Use git.
It's a distributed code versioning system, and will help you in what you want to achieve. It does not need a central repository, so you do not need any server for it, you can just synchronize your private repositories with your colleague.
For integration with Eclipse, use EGit
If it's going to be open-source, you may consider creating an account on github.com and hosting your repo there. Github gives some first-class tools when working with git.
Answer: You use Github which works very finely and may be better than SVN in many cases.It has very handy tools like git gui and git pull commands which works very finely and without any complexity
Here is its official site
Answer: You should use a versioning system but if you do this:

when i editting same class which is editting by my colleague at the
  same time

You will still have an issue as each will code in its own version of the file and you will have to carefully merge the changes (my experience is with Clearcase)

Eclipse Versioning Project


When were the first links between Cain and vampirism made in literature?

Question: In the World of Darkness and Vampire: The Masquerade, books Cain is made the first vampire by Lilith. I know that parts of this have been taken from older ideas taken from translations of the Bible, but roughly when did writers start making the links between biblical Cain and vampire mythology?
Comment: It started with White Wolf's RPG *Vampire: the Masquerade"*. I will elaborate in an answer as soon as I have some time.
Answer: TL;DR: I could not  find the explicit declaration that Cain was a vampire prior to the release of a series of RPG books in 1991. The RPG is called Vampire: The Masquerade [note: when I first wrote this answer, the RPG was not mentioned in the question. The question was later edited to include it.] and was published by White Wolf. The books started the very same setting called World of Darkness in the question.
The RPG has a creation myth that has Cain as the first vampire, with vampirism being a curse God placed upon him (but not the very first curse).
The inspiration probably came from two sources:

The Bible itself;
The epic poem Beowulf.

From the Bible, Cain's curse was twofold: he would not gain sustenance from the Earth, and he would be protected against premature death (anyone who harmed him would receive the same harm sevenfold):

11 And so, cursed shall you be by the soil that gaped with its mouth to take your brother's blood from your hand. 12 If you till the soil, it will no longer give you strength. A restless wanderer shall you be on the earth." 13 And Cain said to the Lord, "My punishment is too great to bear. 14 Now that You have driven me this day from the soil I must hide from Your presence, I shall be a restless wanderer on the earth and whoever finds me will kill me." 15 And the Lord said to him, "Therefore whoever kills Cain shall suffer sevenfold vengeance." And the Lord set a mark upon Cain so that whoever found him would not slay him.

Then there is Beowulf:

Till the monster stirred, that demon, that fiend,
Grendel, who haunted the moors, the wild
Marshes, and made his home in a hell
Not hell but earth. He was spawned in that slime,
Conceived by a pair of those monsters born
Of Cain, murderous creatures banished
By God, punished forever for the crime
Of Abel's death. The Almighty drove
Those demons out, and their exile was bitter,
Shut away from men; they split
Into a thousand forms of evil-- spirits
And fiends, goblins, monsters, giants,
A brood forever opposing the Lord's
Will, and again and again defeated.
Cain had killed his only
Brother, slain his father's son
With an angry sword, God drove him off,
Outlawed him to the dry and barren desert,
And branded him with a murder's mark. And he bore
A race of fiends accursed like their father...

Apparently the authors of V:tM liked the idea of Cain being the progenitor of monsters from Beowulf. They had him become the original vampire and created a whole myth around it, in which Cain learns how to overcome the original curse with the help of Lilith. God then offered him salvation three times but Cain refused; finally God gave up on him and made him a vampire.
Comment: You might be a bit more clear that V:tM *is* the example given in the question, since the different ways it's referred to obfuscates it somewhat.
Comment: @DavidW I am a malkavian so obfuscation is kinda my thing
Comment: The RPG isn't even the earliest modern example.
Answer: George RR Martin wrote about Cain as the first vampire in the novel Fevre Dream, which was published in 1982. Not sure if anyone predated him.

I heard other things as well, legends that went beyond our oral history back to our ultimate origins in the dim dawn of time itself. Even there I saw the hand of your people, for our myths were taken from your Christian Bible. Brown, who had once posed as
  a preacher, read me passages from Genesis, about Adam and Eve and their children, Cain and Abel, the first men, the only men. But when Cain slew Abel, he went forth in exile and took a wife from the land of Nod. Where she came from, if the others were the only people in the world, Genesis did not explain. Brown did, however; Nod was the land of night and darkness, he said, and that woman was the mother of our race. From her and Cain are we descended, and thus it is we who are the children of Cain, not the black peoples as some of your kind believes. Cain slew his brother and hid, and so it is that we must kill our distant cousins and hide ourselves when the sun rises, since the sun is the face of God. We remain long-lived, as all men were in the first days described by your Bible, but our lives are accursed and must be spent in fear and darkness. So many of my people have believed, I was told. Others held to different myths, some even accepting the vampire tales they had heard, and believing themselves to be undying avatars of evil.
Answer: While it is not outright vampirism, the apocryphal text Life of Adam and Eve, or Apocalypse of Moses, dated from 1st century AD, included the blood drinking in a dream by Eve of the events.

And after this, Adam and Eve were with one another and while they were sleeping, Eve said to Adam her lord: 'My lord, Adam, behold,
I have seen in a dream this night the blood of my son Amilabes who is styled Abel being poured into the mouth of Cain his brother and he went on drinking it without pity. But he begged him to leave him a little of it. Yet he hearkened
not to him, but gulped down the whole; nor did it stay in his stomach, but came out of his mouth. And Adam said, 'Let us arise and go
and see what has happened to them. (I fear) lest the adversary may be assailing them somewhere.'

A depiction of the events appeared in the 1430 "Alba Bible"

Note that this is an apocryphal text, possibly one of the "older ideas taken from translations of the Bible" that you mentioned.
Answer: Another apocryphal link is the Book of Enoch

Others say that when the two angels, Shemhazai and Azazel, came down to earth, they were still innocent. But they were corrupted by the demonesses Na'amah and Lilith.
The children they bore were the giants of old, known as the Nefilim, or Fallen Ones. They bore six children at each birth, and in that very hour their offspring stood up, spoke the holy language, and danced before them like sheep. There were said to be sixty in all. These giants had such great appetites that God rained manna on them in many different flavors, so that they might not eat flesh. But the Fallen Ones rejected the manna, slaughtered animals, and even dined on human flesh.

Howard Schwartz, in The Tree of Souls, notes that these Nefilim, noted as eating of "the flesh of men" are also sometimes linked to Cain.

The primary mystery of Genesis 6 is the identity of the Sons of God. Anthropologists have suggested that they may have been a tribe of exceptionally tall and handsome men who appeared and were irresistible to women. But the ancient rabbis were certain that the Sons of God were angels, although an alternate version in Aggadat Bereshit identifies them as the Sons of Cain.

The Aggadat Bereshit is a 10th century commentary on Genesis.


Leaflet - how do you get individual markers from a featurelayer?

Question: In Leaflet, if I have a feature layer filled with markers, how do I get these markers back from the layer? I want to apply different popups to each individual marker, instead of the entire set. I can't find a method for this in the documentation.
Answer: The docs are great, look at the LayerGroup part. There is a method eachLayer that does exactly what you want:
featureLayer.eachLayer(function (layer) {
  // do something with marker layer

  // layer.feature is probably defined, to create marker, do something like this
  layer.bindPopup(createPopupContentFromFeature(layer.feature));
});

You can do similar things if you create L.GeoJSON layer with onEachFeature property. See the great tutorials on LeafletJS web.
Comment: No, that seems to bind the same popup to every feature in the layer. I want all the features in a layer individually. The code example there,

map.eachLayer(function (layer) {
    layer.bindPopup('Hello');
});

Binds the same popup to all markers. I need different popups for every marker in a layer.
Comment: You can do anything in the eachLayer(function(layer){...}) with each layer separately. As I suggest, your own function createPopupContentFromFeature(layer.feature) can create any popUp content you want based on feature data, that are unique for each marker.
Answer: You can try getting them all and then filtering, or using find() / findIndex().
let found = featureLayer.getLayers().filter(…)[0] ?? null;


How do I add options to Communication Preferences

Question: Is it possible to add to the Communication Preferences in contact profiles? At present we only have 'NO BULK EMAIL' (USER OPT OUT) we would like to create 'NO BULK EMAIL (ADMIN OPT OUT) or similar. Is this possible? We would rather not remove them from the various tags and groups as this is useful info for us.
Thanks in advance.
William
Answer: I do not think you can simply add a Communication Preference like you can add an option group as there is also quite some processing involved rather than 'just' a way to inform you about something. So if you would want that you would also have to influence the code. You can add a preferred communication method, but that is different because there is no processing related.
Answer: We have quite a few communication preference fields, and use a combination of two approaches (which of course each have their own pros/cons...)
1) Word Replacements to change an existing Communications Preference field name, and
2) A Custom Field Set for other communication preferences beyond what already exist.


A word for the thing that adds the last piece to something, making it complete?

Question: Each period has a start and an end. If we observe a period as a pair and from one pair either the start or the end is missing, how would we call something, that adds the missing part, making the period whole or complete. period completer or period finisher just doesn't sound right to me. Maybe period adder? In German, I would use the word Ergänzer.
Comment: With my limited German understand, does Ergänzer mean "whole maker"? I'm trying to ascertain whether you're looking for a word specific to **timespans** or any form of completion (e.g. the last person to join a party, the final piece to a puzzle, the last job for today, ...)
Comment: Something like the *ultimate* or *final* member of the set, or unit of time?
Answer: Do you mean period as "a span of time" or in the musical sense?  Based on what you have said, the best word I can think of is "complement".
It can be:

something that fills up, completes, or makes perfect
one of two mutually completing parts :  counterpart

See the full definition here:
https://www.merriam-webster.com/dictionary/complement
Comment: @k-christine-scarpinatto in mean it as in `span of time`. But I think complement is a good term for the actual missing part, like the start could be a complement to the end. I am looking of a word, which add the complement for the original item.
Comment: "Counterpart"  could refer to either member of a pair.   Is that any closer to what you need?
Comment: @AlexBG: Complement does usually imply that there are **two** elements in total. That's not always literally the case, though. A third employee can be said to complement the earlier team of two employees, but that is in essence comparing the past state to the new state (= two things). Complement also implies a **difference** (in a way that the pieces nicely fit together, a healthy balance). From your description I would assume that if you have to make 250 breads, and you already have made 249 breads, that the 250th bread is also an "ergänzer"? That isn't a correct use for "complement", imo.
Comment: Please note that I am looking for the term that describes the person or the thing that adds the last element, not the last element itself. So if we assume the laat element is complement, the it must be something like complementor or complement adder.
Comment: Ok, I see what you are getting at.  There is the word "capper", as in " the capper to the campaign rally was an appearance by the candidate himself" (https://www.merriam-webster.com/dictionary/capper).


catalog price rules in magento 2.1.4 and 2.1.5

Question: I tried to apply catalog price rules from Magento backend, But it did not work out in fronted.
I cleared cache, indexing still its not working.I think this is bug for Magento versions 2.1.4 and 2.1.5.
Please suggest.
Answer: Make sure you have applied the Created catalog price rules.
Follow the below steps :

Logged in to your magento admin panel
Click on marketing -> catalog price rules
Add your rules with proper condition !! it will only show if your
condition is matched .
Click on save and apply button .
if you have clicked on only save then rule is not applied
To Apply the rule click on Apply rules
The run command php bin/magento indexer:reindex
Comment: I tried it all pal !! but still did not worked for me..
Answer: It was related to improper installation or Magento as well as Sample Data.


Pricing of Fx Swap and Fx Forward in excel

Question: How to do pricing of FX Swaps and Fx Forward in excel can anyone show the same which will match the bloomberg.I am calculating by adding or subtracting the fx fwd points in fx spot rate to arrive at forward if anyone have abything else please share the same . I am also looking at bloomberg syntax for fx fwd and fx swaps . I am doing it by putting QRM and after that the foreign exchange .
Answer: You can check the prices of FX forwards on Bloomberg by typing EURUSD Curncy FRD<GO>
In Excel, you can use Bloomberg functions to get the prices (forward points or outright prices). For Example, to get the 6M FX Forward for the EURUSD, you can enter the formula:
=BFxForward("EUR";"6M";"midoutright")
Theoretically, an FX Forward can be calculated with the rate differential like so:
$$FX_{Forward} = FX_{Spot} \times \frac{(1+ r_{domestic} \times n)}{(1+ r_{foreign} \times n)}$$
or, if you have rates with continuous compounding:
$$FX_{Forward} = FX_{Spot} e^{[(r_{domestic} - r_{foreign}) \times n]}$$
The FX Swap will just be an FX Spot + an FX Forward of symmetric signs or two FX Forwards of symmetric signs if it's forward starting.
However, you should be aware that this is a theoretical formulation and if you try to replicate the market prices of FX Forwards with simple deposit rates, you will not arrive at the same result. And this does not represent an arbitrage because you can't really get financing and/or invest unlimited amounts at these rates if at all.
For example, consider you have a 6 month FX Forward on the EURUSD. If you try to replicate this forward using the USD Libor 6M and the Euribor 6M, you will NOT get the market price.
What you can do is given a price of an FX Forward and a rate on one of the currencies, get the market implied rate of the other one.
There is a Bloomberg function to get the implied rates: FXFA <GO>.


Algorithms and techniques for spell checking

Question: Can anyone suggest any algorithm and technique for spell checking?
After some googling, I found some interesting ones such as this one from Peter Norvig, http://norvig.com/spell-correct.html and few others. However, most of them were written many years ago. Therefore, I am trying to find out whether is there any newer/improved approach to tackle such problem.
Answer: Here is what I built...

Step 1: Store all the words in a Trie data structure. Wiki about
trie.
Step 2: Train an RNN or RNTN to get seq2seq mapping for words and
store the model
Step 3: Retrieve top n words with  levenshtein
distance with the.  Wiki about LD with the word that you are trying to
correct.

Naive Approach: Calculating the edit distance between the query term and every dictionary term. Very expensive.
Peter Norvig's Approach: Deriving all possible terms with an edit distance<=2 from the query term, and looking them up in the dictionary. Better, but still expensive (114,324 terms for word length=9 and edit distance=2) Check this.
Faroo's Approach: Deriving deletes only with an edit distance<=2 both from the query term and each dictionary term. Three orders of magnitudes faster. http://blog.faroo.com/2012/06/07...

Step 4: Based on the previous 2 or 3 or 4 words, predict the words
that are retrieved from Step 3 above. Select the number of words
depending on how much accuracy you want (Of course we want 100%
accuracy), and the processing power of the machine running the code,
you can select the number of words you wanna consider.

Check out this approach too. It's an acl paper from 2009. They call it - language independent auto correction.
Comment: Please elaborate how these steps work together: What is the input and the output in the NN in Step 2? Do you mean with "previous 2-4 words" the words in the text being corrected? In step 4 you predict the words from step 3 with the model from step 2. I guess you calculate their probability, is this right? What do you mean with "select the number of words depending on how much accuracy you want"? Is this an interactive approach where the final choice is left to the user?
Answer: Character level Recurrent Neural Network to the rescue here. Mainly you will build a character level language model using a recurrent neural network. Look into this github project. Github and also this medium blog to get a good understanding of the process.
Answer: I would assume you want to do this for the cleaning phase of your project. Microsoft Cognitive Services provides a spell check API https://www.microsoft.com/cognitive-services/en-us/bing-spell-check-api.
If you are trying to group words into embedding's, then I might suggest Word2Vec or Glove. Glove is pre-trained and has a different specified number of dimensions for each vector. However, both can potentially account for misspellings as well as similarities.
Answer: Might want to look at this using LSTM neural networks.
For bots and readers who need more text content here, I'm linking to a post that goes through a detailed development of an LSTM based spell correction algorithm.  It would be silly for me to rewrite what is clearly spelled out in the link so what follows is the post's own description of what it does.  Brackets are mine.
In this article, I will use bi-direction LSTM in the encoding layer and multi-head attention in the decoding layer [to write a program for spelling correction -- theory is explained and code is linked]. Basically, spelling correction in natural language processing and information retrieval literature mostly relies on pre-defined lexicons to detect spelling errors. Firstly, I will explain some other model architecture which is also used in Natural Language Processing task like speech recognition, spelling correction, language translation etc..
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).


How to add custom translations

Question: Can any one help me to, Where i have to include translated text for German in which csv file have to include ?
Find the below screenshot:
Comment: `Mage_CatalogSearch.csv` under german locale folder
Comment: Thanks for the response, i was tried in Mage_CatalogSearch.csv file but no luck.
Comment: After adding translation you require to refresh "Translations" cache.
Comment: Thanks, yes i did flush the cache but not effecting
Comment: Other translations are working but this one is not effecting
Answer: You have 3 different methods to add or change a translations in Magento:
1) Inline Translation :
The translations will be placed in the database (core_translate table). You can enable the Inline Translation for frontend or backend separately. To do it: System -> Configuration -> Developer -> Translate Inline. Also, you can use the Inline Translation method to add a new translation to the Default Config (all stores) or to the specific store view.
2) Theme translation :
It allows you to add a translation only to a specific theme. All changes will be placed in the CSV file in this path: app/design/{area}/{package}/{theme}/locale/{language_code}{country_code}/translate.csv
3) Module translations :
This kind of translation is used for Default Config (all stores). It is stored within: app/locale/{language_code}_{country_code}/{namespace}_{module}.csv
Wich one is better : ?

Inline Translation :

Plus: This method is easy and non-technical.
Minus: When you need to add a lot of changes, you have to be ready to spend considerably more time.

Theme translation :

Pluses and minuses depend a lot on your needs: It can be applied just to the theme where changes are added. The best solution is to make changes only in a current theme. And the worst course of events is when you have several themes and you need to add the same changes to all of them.

Module translation :

Plus: Adding a translation file to your own/core/ third party module is considered as a good method.
Minus: However, it is much more difficult than the Inline Translation.

How to add custom translations


upgrading ASP.NET website for IE8/Firefox

Question: I need to upgrade a ASP.NET website for IE8. it works fine in IE6, but not in IE8. I don't want to run it in any backward compatibility mode. I would like to make any code changes that are required to make it fully compliant with IE8/Firefox. what is the best and/or easiest way to do that? is it just a case of going through each of the things that are broken and fixing them one by one or is there a more efficient way to fix these issues (some kind of utility??). thanks in advance.
Answer: Well there is no tool or utility to fix cross browser compatibility issues. You can make use of firebug(firefox) and IE developer toolbar to identify the points where the website is breaking.
But the good part is that you are upgrading from IE6. I dont think there will be major hiccups or problems making the website compatible with IE8 since its much better in rendering HTML as compared to IE6.
Answer: If you have expression web, you could use SuperPreview: http://expression.microsoft.com/en-us/dd565874.aspx
THis is a great tool that allows you to compare you site in different browsers.
Answer: Yes, you do have to go through each browser incompatibility bug and fix it for that browser.  A bug can be fixed in 3 ways (listed in my order of preference):

Start with a very compliant browser, then look at the page in other browsers (I focus on Chrome/Safari/Firefox/IE6-7-8-9)
Use different CSS technique, that ends up rendering the same in all browsers
Use IE Conditional Comments to bring in another CSS for that browser leveraging the CSS "Cascade"
Use CSS Hacks as a last resort (usually only for Firefox or something)

But "go through each browser" can be the tricky part!  There are some tools to help.
@Brian mentioned SuperPreview for Expression Web (+1), but there's also a free version of SuperPreview for Internet Explorer for those who don't have Expression Web.
You can compare different versions of IE on the same machine (hard before this product).  Microsoft claims this sub-set of the Expression Web product will always be free (since they feel bad about IE6!).
IE6-7-8-9 tool is good enough for me, because I tend to focus on all versions of IE, but only the latest versions of Chrome/Safari/Firefox.
But if you must test against multiple versions of other browsers:

Expression Web SuperPreview
How to Use Multiple Browsers on a Single Machine
10 Helpful Resources for Cross Browser Testing

(Although Litmus seems to have dropped general web page support, and instead focuses on email client compatibility and campaign analytics.)


resolving IP address to FQDN effectively

Question: We use Netflow to control traffic, when i want to resolve the IP addresses from netflow's outside destinations list, i get local google cache server's IP address, never the web sites that users has visited, how do i find out the actual web site that user has visited?
Answer: The web site URL is not a network or transport-layer entity.  It is visible only at the application layer and may be encrypted anyway.  Don't forget that a URL can resolve to many IP addresses, and a single IP address may be used for multiple web servers.
The most reliable way to understand what sites are visited is to use a web proxy.
Comment: That makes sense, could you recommend any opensource web proxy?
Comment: @tylerdurden, product or resource recommendation are explicitly off-topic here.
Comment: There are also appliances that allow packet capture throughout your network (OK, anywhere a capture sensor is installed). This has the advantage of giving you more than just web traffic. Some may even do HTTPS proxy, which would allow you to see which web site HTTPS traffic is going to (and make you feel dirty for doing a man-in-the-middle attack).


Does stack (UNIX x86, x86-64, ARM) grow up or down, buffer overflow tutorials wrong explained?

Question: when I read something about buffer overflows on the stack, the most or some tutorials show me examples about overwriting local variables (pointers) and then overwriting pointers in the global offset table. But in some tutorials the stack grows upwards and in some it grows downwards, why? Is the architecture of every system in every tutorial different, I mean little-endian or big-endian. In the article of the Phrack magazine, the stack grows upwards and in the book the art of exploitation also. And in this article it grows downwards. But the operating systems in both tutorials are UNIX systems, so why there is such a difference?. And on my android phone the stack grows upwards and on my Ubuntu Desktop it grows downwards. It irritates me :(
Comment: Big-endian and little-endian is about bytes in a larger unit like a word, or sometimes bits in a byte (or word etc); it has nothing to do with stack direction. But the Phrack you link is for a downward-growing stack (on x86), not upward. Unix is based on C, and C doesn't actually require a stack at all, much less a particular direction. (C does require recursive activation records, and on nearly all platforms stack is a good way to do that, but it isn't _required_.) See http://stackoverflow.com/questions/664744/what-is-the-direction-of-stack-growth-in-most-modern-systems .
Comment: @dave_thompson_085 really interesting, I'd wondered (as any C programmer has) about alternative recursion schemes without stacks and your link blew my mind!
Answer: The direction of stack growth is hardware dependent.  On x86 architectures, it grows downward, but it may be different on other architectures.
Comment: IIRC, the Z80 has an upwards-growing stack.


I'm trying to put a ROM onto my SD card in my phone through USB storage?

Question: But i cant find the folder for my SD card anywhere, does anyone know where i need to put the ROM?
Comment: What type of phone? What version of Android? How are you trying to copy it over? What operating system are you running on the PC you are using (if relevant)? This is not enough information.
Comment: You should be able to mount your SD card to your computer, and it will show up as a separate drive from the internal storage.
Answer: Easiest option is to shut the phone down, remove the SD card, and put it into an SD card reader in your computer. You generally have to reboot into recovery or a bootloader anyway, right?
Typically the folder is /sdcard on the phone's filesystem. If you can put the phone in "Mass Storage" mode (as opposed to Kies or MTP mode or whatever stupid your manufacturer does), it should just be the /sdcard folder.
If you have to flash a recovery or a new bootloader first, you can flash from  /data/local as it is supposed to be user-writable.
If you have adb set up, you can use the adb push command.
Answer: For my samsung galaxy ace phone, i had to install samsungkies to be able to mount the sd card in the pc, didnt work alone. Maybe is the same with you
Answer: You should be able to drop the ROM image anywhere on the SD Card and then use, for instance, ROM Manager to install it; Just open ROM Manager and select 'Install ROM from SD Card' and browse to where you dumped the ROM REMEMBER TO BACKUP YOUR EXISTING ROM BEFORE PROCEEDING


I am a political activist, its likely that my computer will be compromised in the future, how can I secure my data?

Question: I have sensitive data to secure. My computer may likely be compromised physically in the future. How can I secure my date from various attacks like Evil Maid attacks and so forth. I have some basic knowledge of encryption and I can work with hidden Veracrypt volumes, but it doesn't protect me when attacker has physical access.
Comment: Well the thing is that a house raid and confiscation of my hardware for an undetermined amount of time is more likely than a remote attack.
Comment: Not to say you shouldn't protect yourself from them, but physical "hardware present" attacks are relatively rare. Make sure you don't forget to protect yourself more common remote attacks. Consider your email provider, messaging service, cloud storage service, etc. Beware of phishing or spearphishing attacks. Beware of shoulder surfers capturing your screen with a camera. Limit the software installed on your devices to the absolute minimum.
Comment: Depending on how much you trust the brand, Purism's [Librem 15](https://shop.puri.sm/shop/librem-15-v4/) might be worth a look. You can put Qubes on it pretty easily, which helps protect you from remote attack and really easily supports a _ton_ of features to protect against evil maids. If you buy their hardware token too, they claim it'll tell you at boot whether or not any part of your OS has been tampered with -- the security _looks_ legitemate, if their description is accurate. I'd write up a full answer but I'm not sure "buy this laptop" is really a good one...
Comment: @NicHartley Librem is really nice, but they don't mitigate rowhammer attacks and, unfortunately, don't consider it an issue due to their misunderstanding of the BIOS "rowhammer mitigation" feature which only doubles refresh rate. It would be necessary to use it with something like B-CATT which adds vulnerable address ranges to the e820 blacklist. Other than that, they're really good, especially with their experimental HEADS measured boot bootloader.
Answer: Tails is exactly what you want, being designed with activists in mind! It is a live Linux-based operating system that can run from a DVD or USB stick which is amnesic, meaning that any data that isn't explicitly saved to storage will vanish on reboot, including settings, metadata, and other information. Every time it boots up, it boots up fresh as if you have never used it before. Additionally, it forces all network connections through Tor, using a firewall to protect even from a compromised web browser.
Tails includes a variety of useful tools for document processing such as video and audio editors, text and document processors (generally compatible with the Microsoft Office suite), and a myriad of tools for cryptography, such as email clients supporting GnuPG encryption, chat clients supporting a wide variety of protocols (IRC, XMPP, AIM, etc) with chat encryption using OTR, and disk encryption utilities. It also contains Tor Browser, a browser designed for anonymity with use of the Tor anonymity network.
Basic evil maid attacks are prevented by keeping the Tails DVD or USB stick on your person, or downloading and verifying a fresh one if your primary copy was out of your sight for too long and may have been compromised. However, it is effectively impossible to protect from a sophisticated attacker who has prolonged access to your computer and is able to insert hardware backdoors.
Tails does

Prevent someone with your powered off computer from learning what was done on it.
Protect the content of your internet communications from a Wi-Fi or ISP-level attacker.
Allow you to visit websites without the websites knowing your location (anonymity).

Tails does not

Hide the fact that you are using Tails from an attacker on the network or a local adversary.
Protect your computer from prolonged physical access before or while it is on.
Prevent you from making OPSEC mistakes, such as accidentally publishing your identity.

For more detailed information on Tails' threat model, consult the design document.
Disclaimer: While not a core developer, I contribute code to Tails and as such could be considered associated with it.
Answer: Whole disk encryption, UEFI secure boot, with TPM hardware.
This won't stop an embedded key logger from capturing the credentials, but it's about as secure as you can get.
If you want to go even further, link the decryption to a Yubikey (or equivalent) in challenge-response mode and even a key logger won't work.
Just remember that Rubber Hose Cryptography doesn't have a technical solution.
Comment: UEFI secure boot is extremely limited. To protect against hardware attacks, the _minimum_ would be SRTM-based measured boot using a TPM, which is harder to achieve with minimal computer knowledge.
Answer: This is an important conversation, as the same thing needs to be considered with politicians and other possible higher-profile targets. While something like Tails (mentioned already) is great for your physical machine, it is also important to consider the email and online platforms that you use as they are often the target of phishing attacks. Not sure what the rules on here is about specific product endorsements, but if you are using a Gmail account then I would look into Google's "Advanced Protection" account. It takes your gmail account and forces you to do the following:

Password requirement is stronger
Requires a UFA key (like the Yubikey or Google's new Titain USB Key)
Restricts apps that can connect to the account
Strict rules about the devices that can log in
Etc, etc...

WIRED ran an article on this when it was first released and this quote really stuck out to me: "If John Podesta had been able to turn this on sometime last year, the world might be a very different place."
Even if you don't use Google, then make sure that you are using 2FA everywhere you can (UFA keys are great too if supported), and consider using a password manager to generate secure passwords and that you are not reusing those passwords anywhere else.
Answer: Protecting against Evil is very hard, especially if you are the target. I'll write some complementary solutions to user10216038's answer.
Use a Live CD so that your operating system cannot be modified. You can prepare yourself with the necessary software; Disk encryption, etc. (see user10216038's answer.)
There is also a Tempest attacks where the adversary may steal your information even giving any effect on your laptop/PC. To secure against Tempest attack you have to buy specialized hardware and power filters. In some cases, a secured room may be required.
Comment: Look into "Anti-Evil Maid" by the Qubes OS author. There are similar solutions too, like STARK/MARK (by the same guys who made the TRESOR kernel patch) and Heads (designed as part of a collaboration with the Purim Librem laptop guys). Any of those can efficiently mitigate evil maid attacks.
Answer: As a political activist whose computer may be of interest to local, unethical state operators, I suggest you really want something sort of deniable encryption.
Currently there is not a great deal of choice around implementations - but product recommendations are off-topic here. Googling the magic words "Deniable encryption" should take you to some potential sources, but do beware that the bad guys may also be watching your internet searches.
Answer: Make sure you already do routine preventive measures you have access to today, and its free.  Again, protection methods reduce the speed of penetration and requires more skill level of the perpetrator so it deters 'evil maids' from accessing your unattended laptop to try and plant malware.
Note, how these features prevent access varies by make and model.  Many 'high end' laptops have ways to bypass UEFI/BIOS locks, some easier than others.  However, if they bypassed locks they also erase your former passwords, you know you've been penetrated.  If you have UEFI with TPM and its required by your OS it may erase all Secure Boot keys as well as the ownership, and may stop, make it hard or alter the boot sequence, again showing something is not right.
Have you:
Set a UEFI or BIOS based password for both ADMIN and USER?  This prevents the operating system from loading so your device is stopped at the firmware level.  This is more secure in general in UEFI setting with TPM.
Disabled boot from anywhere but the internal HD?  This disables USB or any external ports, as well network boots.
Set a different hard drive password, if available?  This prevents the hard drive from starting up, and has firmware independent of the UEFI of your laptop, in case its bypass able, see first item above.  There maybe software to unlock the drive, but often it can be done by wiping it clean, or requires laptop disassembly, but if they managed to unlock it in situ, loss of password would betray its been penetrated.
Some manufacturers may have a hidden UEFI/BIOS reset to factory sequence built into their firmware accessible via the keyboard, such as Dell, the firmware is stored in a recovery partition on the HD.  Access can be halted by setting a HD password, if available, as this prevents the HD from booting and is independent of the manufacturer's firmware beyond the UEFI.  Regardless, with passwords reset it again reveals to you, something is not right.
Never sleep your computer, power down completely, versus cold boot, evil maid issues
Use Veracrypt as whole disk encrypt mode, and use the hidden operating system mode, which creates a decoy environment.  Do the same for containers.  Alternatively, use Windows bitlocker if on Windows, which is better is best left for another question.
Don't save sensitive files on your PC but on an encrypted card you take with you, if net access is variable quality or untrusted.


Why would water-serpents have multi-arched bodies?

Question: There are many depictions of sea-serpents and other similar creatures in a strange pose: The head (and often the tail too) is held above the water, with the body being arched in such a way that some of the body is out of the water. How and why would an animal hold itself in this way?
Comment: comment because its a bit short for an answer. They don't. its an exaggeration of how snakes actually swim.
Comment: @IT Alex - snakes swim with lateral movements.  Mammals swim with vertical movements.
Comment: This is not an answer, rather an explanation. These beasts were invented in medieval bestiaries. Often, the sea serpent is huge and has a dragon like head. Why would it be multi-arched ? well.. if you invent a spectacular water creature like this, you may as well show it off. When its body would be under water, it would look like any other Nessie. A medieval bestiary was intended for attribution of species. So my answer would be: it is multi-arched for aestetic reasons.. and to show all of it.
Comment: Not an answer to the worldbuilding question, but the reason *why they are drawn that way* might very well just be that this was the easiest way to fit a very long snake on a single page...
Answer: A few Thoughts:
There are a variety of reasons you can see sea serpents who look like this, so here are a few reasons:

Sexual display: Most sea serpents don't normally swim this way. In fact, you rarely see them at all. But they were once land animals, and reproduction is highly conserved. So males come out and perform this as a display for females, trying to impress them with how strong, buoyant and flexible they are.
optical illusion: From the shore or a boat, looking down, the serpent appears to be thrusting out of the water (and maybe they occasionally do, slightly) but in actuality, they are just doing the standard serpentine swim pattern common to all snakes. It just LOOKS like they are rising above the surface.
exotic swimming pattern: Perhaps the serpents have evolved a highly exotic swim stroke. Maybe they are really corkscrewing through the water. Perhaps their swimming style involves pushing internal air bubbles thought their boy, constantly changing location. but they end up thrusting out of the water.
exotic lung arrangement: These serpents are actually a kind of worm, and have multiple lungs along the length of their body. They roll which part of their body is out of the water so they can breathe, and rise up high to prevent waves from splashing into their lungs.
It's not really a serpent: These structures are not really from a serpent, but instead are something else. The creature actually has fins that APPEAR to be serpent segments thrust out of the water. Or these creatures are really using the buoyancy of trees to support them (especially when resting) like a swimmer with a float. Or these are really multiple different swimming creatures, each one which crests the water separately in a school.
Hunting Lure: These sea creatures scare away prey, so if they hold segments out of the water, prey mistakes them for many smaller fish and are less on guard. Or sea serpents prey on large predators (like sharks) and the multiple segments in water look like many prey animals, luring the predators close enough to kill.
Cleaning birds: A certain species of sea gull eats parasites off the sea serpent. When the sea serpent is infested with skin parasites/lamprey, they perform this display to attract the sea gulls, who gleefully flock to the happy serpent and pick the parasites clean.
Comment: sexual display is a good one, whenever you find something weird in biology start with the assumption it has something to do with sex.
Answer: Just change how they swim.
If they swim with vertical undulation instead of lateral, that is exactly the pattern you would expect to see while swimming on the surface. Although the loops would not come completely clear of the water like that but they would be on the surface.
snakes often hold the head clear of the water while swimming to improve vision or to improve the sense of smell.
this is even kind of ironic since the stories of sea serpents are probably just pods of whales seen at a distance, and whales swim with vertical undulation.
so more like this
Comment: because you get greater drag (and therefore traction) on the surface of the water, this sort of vertical undulation would outperform a fully submerged one, but underperform a horizontal undulation on the surface so you'd probably want to explain the vertical preference. Perhaps there was some pressure to reduce the amount of them visible from above or below (possibly due to predation by even larger creatures, or maybe overheating due to exposure to the sun)
Answer: Not a serpent.
It is improbable that an elongated creature would move like that.  There are two standard explanations.
1:  Many smaller creatures.

https://baleinesendirect.org/en/what-do-we-know-about-harbour-porpoises/
Depicted: porpoises.  They move in groups and they can move fast.  Seeing a clump of multiple humps (porpoise backs) emerging from the water can easily be interpreted as one single creature swimming along.
If you have bigger creatures swimming in this manner your eye could combine them into a very big creature.  Depicted: whales.

https://whalesanddolphinsbc.com/education-parent/humpback-whales-megaptera-novaeangliae/
2:  One big creature with humpy back.

source
The sturgeon is usually the creature invoked for this explanation especially as regards lake monsters.  They can get huge, they don't need to come up for air, they have bumps on their back, and they can go out to sea.  A big sturgeon cruising along under the surface might let its back hang out into the air and so would look like a series of moving bumps.  The bumps dont move up and down of course because like all fish the sturgeon is propelling itself with lateral movements of its tail.
Answer: Being gigantic, one of these fierce creatures only weaknesses is the tendency to overheat, particularly in the thermoactive seas it prefers to hunt in.
In order to keep cool following a hunt or during long trips, the serpents have evolved to extend alternating portions of their bodies out of the water to promote cooling in the ever present trade winds.
Some sub-species of these serpents have even evolved "sails" like those of the Spinosaurus to promote rapid cooling in the sea breeze with the most evolved of these specialists able to assist their great migrations using these sails as actual sails to harness the wind
Comment: With the thermal characteristics of water vs air it would make more sense if they cool down inside the water.
Comment: in the ocean the water is better at cooling than the air, if anything the parts out in the air will be slightly warmer, especially in sunlight. warm blooded animals in the ocean have the opposite problem, staying warm, since the ocean is so good at absorbing heat.
Comment: @Trioxidane Potentially, I'm not an expert in thermodynamics. I thought though that with large wet areas to promote cooling via evaporation the air might be a better cooler. I also hedged with that reference to the water being potentially heated.
Answer: Effort through the water
A giant snake will undoubtedly get a lot of friction with the water. To get a good speed with the least effort, it'll move much if it's body above the water line for the lower friction. This way it can "cruise" for longer, instead of requiring to swim constantly. The how is simple. Just with muscle power and buoyancy.
Comment: drag from the water's surface is much stronger than the drag below the surface, so raising some of the body out of the water would actually increase the amount of drag the serpent experiences (this may be worthwhile if the serpent depends on that drag for propulsion, but would be disadvantageous for cruising)
Comment: @Tristan a valid concern, but at these sizes I think it'll not matter as much. The air resistance is so much lower than the water that it should alleviate this concern. Older submarines used to surface for maximum speed. As far as I know, this is to reduce the drag of the water.  That seems enough to say the same for the snakes, unless there is something crucial I'm overlooking.
Comment: it's going to depend on how much of their cross-section they can get out of the water for a given length at the waterline. As this undulating shape actually introduces new cross-sections (each bend has to cut through the water, and even though there'll be a certain amount of drafting off the one in front, that's still extra drag) I can't see how this could perform better than lying flat partially submerged
Comment: @Tristan I cannot see advantages compared to just partially submerged either, but that's not the point of the answer. The point if the answer is explaining why a snake would be bend like this partially out of the water. Not the most efficient method.
Comment: @Trioxidane, the additional drag they'll experience vastly, vastly, exceeds any theoretical benefit they'll have moving part of their body through a less dense medium.
Comment: @KeithMorrison I would like some sources on that. I cannot find any articles talking about the surface tension of the water and the drag that has, compared to air or submerged vehicles. As such, it doesn't seem a big concern in water physics as far as I can see. I'll have a renewed interest in water tension if tension is so much greater than I think it is, but just telling me without further proof means we're just in a stalemate.


Intuitive understanding of SVD for a matrix

Question: Could any give an intuitive understanding of SVD decomposition of a matrix? I know it can be used for image compress. But how to understand the decomposition within linear transform?
Comment: See the related MSE question: http://math.stackexchange.com/questions/261801/how-can-you-explain-the-singular-value-decomposition-to-non-specialists/261814#261814
Comment: See  http://stats.stackexchange.com/questions/177102/what-is-the-intuition-behind-svd/179042#179042
Answer: So let's examine the SVD $A=U\Sigma V^*$ where everything is chosen to be square $n\times n$ matrices (by padding $\Sigma$ with zeros and completing $V$ to be a unitary matrix.)
In this case, it is exactly what it looks like: $A$ is expressed as a rotation, followed by a scaling, followed by another rotation.
Another useful interpretation is that if you view the effects of $A$ on the unit sphere in $\Bbb R^n$, it will in general be changed into some ellipsoid (often a lower dimensional ellipsoid.) The singular values are the measurements of the minor axes of the ellipsoid. This in effect displays the extent the sphere was stretched in different directions. The 0 singular values correspond to dimensions that were "crushed flat" by the transformation, rather than shrunk/stretched.
Answer: Generally, an $N\times N$ matrix can be seen as a point in a high dimensional $N^2$ space.
For instance, if any image would have only three pixels, we could've put any image on a point in a 3D space.
SVD gives the primary "directions" that this matrix represents. The center matrix gives the weight of each direction in descending order, ie if you want to get a single direction that your matrix "goes in" (maybe think of some high dimensional gaussian blob that has a distinct direction), you can take only this direction. The direction itself is found in the left-hand matrix.
You can try to play with simple matrices such as $\begin{bmatrix}0&1\\1&0\end{bmatrix}$,  $\begin{bmatrix}0&1\\1&1\end{bmatrix}$, $\begin{bmatrix}2&2\\1&-1\end{bmatrix}$ etc., and look at the center matrix and left hand matrix.


How long it takes until all dragons resurrect?

Question: According with the game, Alduin is reviving dragons buried in the dragon mounds. So, how long it takes until all of them are alive?
Answer: Alduin reviving dragons is just an in-universe explanation of where the dragons are coming from. No matter how long you play, there will always be more dragons to fight, even if you beat Alduin at the end of the base game. They simply keep spawning.
Comment: @Ramirez They are asking how long it takes for *all* dragons to revive. There is no "all dragons", because there's an infinite number of them.
Comment: The OP just may be under the misconception that since there is a finite number of burial mounds, there is a finite number of dragons that spawn
Comment: I'm not entirely sure this answers the question. The question seemed to be wanting to know how long it takes for the dragons to respawn, not how they are respawning.
Comment: @Wondercricket that's what I was thinking as well once I read this.
Comment: I'm not even sure the actual burial mounds change in game.  As I'm wandering around, I know you can see some that are empty, and some that are still full, but I've never noticed if a given mound will appear full at one point in the game and then appear empty later (with exception of the ones that actually play the resurrecting mini-scene with the named dragons, like Karthwasten, where the mound obviously changes after the mini-scene).
Comment: Actually I want to know if all dragons in burial mounds are resurrected by Alduin.
Comment: @Ethan No.  You only ever witness one resurrection.  The rest are assumed to be resurrected.  In terms of actual game-play mechanics, they either respawn via time or via a radiant quest.
Answer: Are you asking about dragons in general? – then Mge Xy's answer should do. But in case you are asking about their buried types (named ones), that Alduin is reviving with a shout, I think that if you follow the order on the map that is given to you by Farengar Secret-Fire you will get all the buried dragons revived. The first one was near Windhelm, between miners settlement and orsimer's stronghold. That's all I remember unfortunately for I've lost this map the next day after I received it (put it on a display in my Hearthfire DLC house and it fall through the textures while loading the next time I came).
In case You meant the exact amount of time between dragon attacks - my 105 lvl character (adept lvl difficulty) was always (through all the 105 lvls and 10k+ hrs of gameplay) attacked after 3-5 fast travels/visited locations as I was passing by random NPC spawn areas (dragons, bandits, paddlers, daedra, vampires and etc.). So I literally knew beforehand that this time it is ok not to save game and that time – I'd better save it in case dragon won't pick up the fight (those cowards x_X).
Answer: As noted, there are an infinite number of generic dragons. Once you flip the trigger to start their spawning, they'll never stop unless you use a cheat/mod/et cetera to do so. So in that respect, they will never "all" be resurrected.
That said, there are a fixed number of named dragons in the base game. Four of these are known be alive at the start of the story (one of whom does not appear in Skyrim). Five more have known burial sites and are brought back by Alduin during the course of the main quest. They are:

Sahloknir at Kynesgrove, during A Blade in the Dark.
Nahagliiv at Rorikstead, during A Cornered Rat.
Odahviing near Riften, during The Fallen.
Viinturuth, near Lake Yorgrim, after The Throat of the World.
Vuljotnaak, near Sunderstone Gorge, during Diplomatic Immunity.

Of these, Odahviing is the last you'll encounter during the course of the main quest. Thus, it takes until the event of The Fallen before all the dragons Alduin will wake up are, in fact, awake.
The remaining base-game dragon, Vulthuryol can be found in Blackreach and presumably has been alive since before the events of story.


Where can I find the linker(ld) in Sun Solaris Studios 12.2?

Question: At the moment I am using for linking purposes the pre-installed linker on my SPARC machine
in the following directory:
/usr/ccs/bin/ld

I wanna compile my application with the Sun Studios Compiler 12.2 and so I would also like to use the linker that should come with this package. However, when checking the bin directory of Sun Studios I can just find a c compiler (cc), but no ld (linker). Anyone an idea where
this has gone and how I can invoke it?
Many thanks,
Mike
Comment: The version of Solaris is irrelevant; the linker is in the standard location, is part of the OS and no different version is provided by the Studio Compiler Suite.
Comment: What Solaris version are you using (`cat /etc/release`) ?
Answer: By default (ie, unless you try very hard) Studio Compilers will use the version of the linker that is shipped with the operating system as a core (unremoveable) component.
It is not recommended at all to try to use the GNU linker on Solaris. There are lots of feature differences between the two.
If you want to delve more into the Solaris linker, read the doco at http://docs.oracle.com/cd/E26502_01/html/E26507/index.html, or blogs from the team - https://blogs.oracle.com/rie and https://blogs.oracle.com/ali.
Answer: # ls -lh /usr/ccs/bin/ld
lrwxrwxrwx 1 root root 12 2012-01-26 05:54 /usr/ccs/bin/ld -> ../../bin/ld

/usr/bin/ld is in
pkg:/developer/linker


How can I change the date format in the Lubuntu login screen?

Question: I'd like to set a different format for the long date string I get at the top of the login screen in Lubuntu (15.04). How do I do that?
Answer: The simplest way to modify LDM settings? Try LightDM GTK+ Greeter Settings GUI...
It should be capable of what you want to do.
LightDM GTK+ Greeter Settings is a small GUI written in Python which lets you modify various LightDM GTK+ Greeter settings, such as the theme, font, background, window position and more, settings which otherwise can only be set by modifying the greeter configuration files.
LightDM GTK+ Greeter Settings gives users access to the following settings:

Appearance: change LightDM GTK+ Greeter theme, icons, font (with DPI/antialias/subpixel rendering and hinting settings), change the background image or set it to a color, enable user wallpaper if available or change the default user image;
Panel: change the clock format and redefine indicators (enable/disable indicators or reorder them);
Window position: change the login dialog window position
Misc: enable/disable onscreen keyboard, set the timeout until the screen blanks.
sudo add-apt-repository ppa:kalgasnik/ppa
sudo apt-get update
sudo apt-get install lightdm-gtk-greeter-settings

Screenshots etc. here: http://www.webupd8.org/2014/10/lightdm-gtk-greeter-settings-gui.html
Or edit /etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
background=/lib/plymouth/themes/xubuntu-logo/wallpaper.png
......
clock-format=%d %b, %H:%M
.....

To your desired format...
EDIT:
From Ubuntu Wiki:
/usr/share/lightdm/lightdm.conf.d/*.conf
/etc/lightdm/lightdm.conf.d/*.conf
/etc/lightdm/lightdm.conf

System provided configuration is stored in /usr/share/lightdm/lightdm.conf.d/*.conf and is not user editable. System administrators can override this configuration in /etc/lightdm/lightdm.conf.d/*.conf and /etc/lightdm/lightdm.conf. Files are read in the above order and combined together to make the LightDM configuration.


Why are custom tabs not displayed correctly in contact summary?

Question: My users have reported seeing custom tabs not displaying correctly in the contact summary screen. Instead of wrapping, the tabs display as below. I can't reproduce the problem, although I have seen it in the past.  This is Civi 4.7.19  running with Drupal. Theme is 'Seven'
Comment: Andy - for interface type issues, usually worth mentioning your CMS and theme, and also confirming if the issue is evident on a demo site. That helps rule in/out whether it is unique to your configuration/set up
Comment: ok but you didn't mention theme. garland?
Comment: Oops, the theme is 'Seven'
Comment: i tried setting one of my sites to use Seven for civicrm and had no issue with the display of the Tabs. Do you know how to use your browser inspector to check for console errors?
Answer: Tried replicating the issue, but couldn't. Its working fine with Civi 4.7.19 on drupal 7.56 and theme 'Seven'. It maybe because of some conflicting css class.


How to set a keyboard shortcut to "Zoom" thunderbird window on Mac?

Question: I assigned keyboard shortcut Cmd-. to "Zoom" a window for all applications, it works fine except for Mozilla Thunderbird, I guess that is because Thunderbird has a menu item View -> Zoom -> Zoom in (out, reset, etc.).  How to assign a keyboard shortcut to do that?  Thanks.
Answer: In System Preferences > Keyboard. Click the Keyboard Shortcuts tab. In the left hand pane, at the bottom, there is a "Application Shortcuts" item. Choose that, and you'll see a new pane on the right and a "+ / -" control. You'll need to click the "+" and choose Thunderbird as the application, and then type in the exact menu item you'll want to activate with the defined keyboard shortcut.
Here's an example I use for VLC:
Comment: Thanks for the detailed step, my question was about shortcut for nested menu item, @Lri answered that quite well.
Answer: You could specify nested menu titles like >Window>Zoom on 10.7, but it stopped working on 10.8.
You could also use an application like Moom or BetterSnapTool or assign a shortcut to an AppleScript that clicks a zoom button.
Comment: I assigned `Ctrl+Cmd+.` to `>Window>Zoom` for Thunderbird and I see it appears in the right menu item, however it does not work either in 10.7.4.  I see enough information to solve this in other way.  Thank you!


Can playing sports bring us closer to God?

Question: In what ways can sports be used as a vehicle to serve God and thus, bring us closer to Him?
Comment: Working out and getting your body healthy can be a mitzvah if you do it l'shem shamayim. So by sports, if you do it to get in shape and keep yourself active and healthy that could be a mitzvah
Comment: If you have a friend or know some folk who are lonely and depressed, in need of exercise and fresh air, then organising a regular kosher sports match/team with a shtikel learning in half time, I can't see why that wouldn't be a huge chessed, but certainly CYLOR
Comment: Rephrase: can playing sports be in line with following God's commandments?
Answer: Maybe not directly an answer, but the Lubavitcher Rebbe would often compare sports, e.g. baseball for example, to our Avodas Hashem. In a Sicha, the Rebbe explained (Shabbos Parshas Shemini, 5740):

Chassidic teachings explain that the desire for victory pushes us to reach much deeper within ourselves and discover our hidden potential. Just as a king in wartime empties his treasury in order to win, it is the battle with the adversary that spurs us all to find new abilities.
This type of conduct is evidenced in sports, specifically in soccer,
where two teams oppose each other's efforts to score a goal. Ideally,
the players are not primarily motivated by the money they receive
(although of course they must be adequately compensated for their
training and effort). Rather, it is their personal desire for victory
that is the main motivator.
As in sport, in life one cannot move sluggishly. We must keep moving
with vitality, running and jumping to overcome the challenge. This
type of service is carried out not just with the brain or heart
(though thought and emotion are important) but with the action of the
feet. Only by means of putting our Jewish learning into vigorous
practice can we hope to emerge victorious in our quest to put the
globe in the "Gate of the King."
In mystical thought, the ball represents how our G‑dly activities must
encompass every aspect of our being. Aiming for the goal represents
jumping directly to the highest levels of spirituality, bypassing the
intermediate stages which would be achieved through incremental
growth.

See also this fantastic story, between a boy and the Rebbe, where a lesson is shared about baseball:

Shimshon, born and bred in the New World, was very much the "American Boy". Yet he had enjoyed a close and special friendship with the Rebbe prior to the passing of the previous Lubavitcher Rebbe — the Rebbe's father-in-law Rabbi Joseph Isaac Schneersohn — which continued on after the Rebbe accepted the mantel of leadership. He now introduced his friend and his friend's son to the Rebbe, who greeted them with his comforting and warm handshake, requesting them to please take a seat.
The Rebbe briefly blessed the boy that he should grow to become a
source of pride to the Jewish people and to his family. As they turned
to leave, Rebbe surprised the three Americans with the question he
addressed to the youngster: "Are you a baseball fan?"
The Bar-Mitzvah boy replied that he was.
"Which team are you a fan of — the Yankees or the Dodgers?"
The Dodgers, replied the boy.
"Does your father have the same feeling for the Dodgers as you have?"
No.
"Does he take you out to games?"
Well, every once in a while my father takes me to a game. We were at a
game a month ago.
"How was the game?"
It was disappointing, the 13-year-old confessed. By the sixth inning,
the Dodgers were losing nine-to-two, so we decided to leave.
"Did the players also leave the game when you left?"
Rabbi, the players can't leave in the middle of the game!
"Why not?" asked the Rebbe. "Explain to me how this works."
There are players and fans, the baseball fan explained. The fans can
leave when they like — they're not part of the game and the game
could, and does, continue after they leave. But the players need to
stay and try to win until the game is over.
"That is the lesson I want to teach you in Judaism," said the Rebbe
with a smile. "You can be either a fan or a player. Be a player."
Outside 770 father and son said goodbye to Shimshon, the three now
sharing a new admiration of a pioneer in Jewish education
Comment: Beautiful story, thanks!
Comment: Another one: https://www.meaningfullife.com/the-rebbe-baseball-story/


Capitulation in cyclotomic extensions

Question: Let $p$ be an irregular prime, which means that $p$ divides some Bernoulli number: $p \mid B_k$ (for some even $k\in[2,p-3]$). This implies that the class number of the field $K$ of $p$-th roots of unity is divisible by $p$. Let $L$ be the field of $p^2$-th roots of unity. What, if anything, is known about the capitulation of ideal classes in $L/K$ ( we say that an ideal class from $K$ capitulates in $L$ if an ideal generating this class becomes principal there)? It is possible to write down criteria in terms of units that are or are not norms from $L$, but this does not seem to help a lot. I am mainly interested in the question whether there is a connection between the index $k$ and the capitulation of the subgroup of order $p$ corresponding to $k$ via Herbrand-Ribet. I am pretty sure that classical algebraic number theorists did not do an awful lot in this direction but I am not familiar with any advances in Iwasawa theory: whether an ideal class capitulates in $L/K$ is encoded in the Hilbert class field, so the structure of the maximal abelian unramified $p$-extension of the cyclotomic Iwasawa extension of $K$ might contain relevant information. Does it?
Comment: Yeah: it is a nice image: those classes doing the best to survive, extension after extension until finally, well, they just have to give in and submit to principalization :P
Comment: I love the usage of «capitulation» :)
Comment: @Mariano: the word capitulation was coined by Arnold Scholz; the German word for principal (as in principal ideal) is Haupt, which is caput in Latin; but caputilation would sound silly in both German and English -)
Comment: I prefer that they give up, as in capitulation, rather than if they would be beheaded, as in enthaupted (=decapitation).
Answer: Assume $p$ is an irregular prime for which
Vandiver's conjecture holds, e.g. $p<12'000'000$. This conjecture asserts that $p$ does not divide the $+$-part of the class group.
Then there is no capitulation in the class group from the first layer of the cyclotomic $\mathbb{Z}_p^{\times}$-tower to any other in this tower. See Proposition 1.2.14 in Greenberg's book, which says that the capitulation kernel lies in the $+$-part. See also the discussion on page 102 where it is discussed what happens when Vandiver's conjecture does not hold.
Generally capitulations in Iwasawa theory are well studied. The capitulation is linked to the question of whether there are non-trivial finite sub-$\Lambda$-modules in the Iwasawa module $X$, here the projective limit of the $p$-primary parts of the class groups in the tower, or equivalently the Galois group mentioned in the question.
Comment: But I guess the main conjecture of Iwasawa theory does not say anything about this because we can ignore finite submodules. The advances in Iwasawa theory have only been on formulating main conjectures in more general situations and not very much on getting finer information about the Iwasawa modules (Kurihara's work on computing all Fitting ideals in some situations is an exception to this that I know but not enough for these kinds of question I think). Does anyone if ETNC says anything for such conjectures?
Comment: Slightly more is true (as I should have known): the whole minus part of the class group cannot capitulate. This leaves us with the question which eigenspaces of the plus class group may or may not capitulate. Since this is entirely a problem involving the structure of the unit group of the real subfield, I guess it is not wise to expect an answer one way or another.
Answer: The Greenberg Conjecture for the p-cyclotomic field has not been proved, but is widely assumed to hold. Personally I trust the Vandiver conjecture too, but opinions about this conjecture are divided. Assuming that Vandiver is false and Greenberg true, then you have capitulation for every positive, non - trivial eigenspace. In fact, the same can be proved also in general (without assuming Greenberg), for the eigenspaces with non trivial torsion subgroups. However, I speak here of capitulation along the Iwasawa tower (K_n)_(n in N), in which the p^2 extension L = K_2. It is not necessary that capitulation begin from the first extension K_2/K_1. Since Vandiver is true for all p < 12 000 000, little numeric evidence can help. I nbrief, I believe that the best we can say by now, is that capitulation depends on the existence of torsion modules in a given eigenspace; but it needs not start from the first extension. And Vandiver  denies its existence.

Capitulation in cyclotomic extensions


Extract keyphrases from text (1-4 word ngrams)

Question: What's the best way to extract keyphrases from a block of text? I'm writing a tool to do keyword extraction: something like this. I've found a few libraries for Python and Perl to extract n-grams, but I'm writing this in Node so I need a JavaScript solution. If there aren't any existing JavaScript libraries, could someone explain how to do this so I can just write it myself?
Answer: I like the idea, so I've implemented it: See below (descriptive comments are included).
Preview at: https://jsfiddle.net/WsKMx
/*@author Rob W, created on 16-17 September 2011, on request for Stackoverflow (http://stackoverflow.com/q/7085454/938089)
 * Modified on 17 juli 2012, fixed IE bug by replacing [,] with [null]
 * This script will calculate words. For the simplicity and efficiency,
 * there's only one loop through a block of text.
 * A 100% accuracy requires much more computing power, which is usually unnecessary
 **/

var text = "A quick brown fox jumps over the lazy old bartender who said 'Hi!' as a response to the visitor who presumably assaulted the maid's brother, because he didn't pay his debts in time. In time in time does really mean in time. Too late is too early? Nonsense! 'Too late is too early' does not make any sense.";

var atLeast = 2;       // Show results with at least .. occurrences
var numWords = 5;      // Show statistics for one to .. words
var ignoreCase = true; // Case-sensitivity
var REallowedChars = /[^a-zA-Z'\-]+/g;
 // RE pattern to select valid characters. Invalid characters are replaced with a whitespace

var i, j, k, textlen, len, s;
// Prepare key hash
var keys = [null]; //"keys[0] = null", a word boundary with length zero is empty
var results = [];
numWords++; //for human logic, we start counting at 1 instead of 0
for (i=1; i<=numWords; i++) {
    keys.push({});
}

// Remove all irrelevant characters
text = text.replace(REallowedChars, " ").replace(/^\s+/,"").replace(/\s+$/,"");

// Create a hash
if (ignoreCase) text = text.toLowerCase();
text = text.split(/\s+/);
for (i=0, textlen=text.length; i<textlen; i++) {
    s = text[i];
    keys[1][s] = (keys[1][s] || 0) + 1;
    for (j=2; j<=numWords; j++) {
        if(i+j <= textlen) {
            s += " " + text[i+j-1];
            keys[j][s] = (keys[j][s] || 0) + 1;
        } else break;
    }
}

// Prepares results for advanced analysis
for (var k=1; k<=numWords; k++) {
    results[k] = [];
    var key = keys[k];
    for (var i in key) {
        if(key[i] >= atLeast) results[k].push({"word":i, "count":key[i]});
    }
}

// Result parsing
var outputHTML = []; // Buffer data. This data is used to create a table using `.innerHTML`

var f_sortAscending = function(x,y) {return y.count - x.count;};
for (k=1; k<numWords; k++) {
    results[k].sort(f_sortAscending);//sorts results

    // Customize your output. For example:
    var words = results[k];
    if (words.length) outputHTML.push(''+k+' word'+(k==1?"":"s")+'	');
    for (i=0,len=words.length; i<len; i++) {

        //Characters have been validated. No fear for XSS
        outputHTML.push("" + words[i].word + "	" +
           words[i].count + "	" +
           Math.round(words[i].count/textlen*10000)/100 + "%	");
           // textlen defined at the top
           // The relative occurence has a precision of 2 digits.
    }
}
outputHTML = '

' +
              'Phrase	Count	Relativity
' +
              '

' +outputHTML.join("

")+
               "

";
document.getElementById("RobW-sample").innerHTML = outputHTML;
/*
CSS:
#wordAnalysis td{padding:1px 3px 1px 5px}
.num-words-header{font-weight:bold;border-top:1px solid #000}

HTML:

*/

Comment: I've updated the code to fix a bug in IE8. This bug was reported via mail, I've pasted the mail and my response (which offers the fix and includes a detailed explanation) here: http://pastebin.com/7Edx88Gp.
Comment: beautiful, several years later you are still helping people
Comment: would be nice to exclude so called stop words, like: the, a, they, is, etc.
Answer: I do not know such a library in JavaScript but the logic is

split text into array
then sort and count

alternatively

split into array
create a secondary array
traversing each item of the 1st array
check whether current item exists in secondary array
if not exists
  push it as a item's key
else
  increase value having a key = to item sought.
HTH

Ivo Stoykov
Comment: look here -> http://valuetype.wordpress.com/2011/08/24/keyword-density-with-javascript/ this is a sample with one word count but could be easily extended for 3 or 4 words
Comment: this doesnt not do what im wanting b/c it does not extract multi word ngrams... it works for single words only
Answer: function ngrams(seq, n) {
  to_return = []
  for (let i=0; i<seq.length-(n-1); i++) {
      let cur = []
      for (let j=i; j<seq.length && j<=i+(n-1); j++) {
          cur.push(seq[j])
      }
      to_return.push(cur.join(''))
  }
  return to_return
}

> ngrams(['a', 'b', 'c'], 2)
['ab', 'bc']


"I accept my fault." vs "I accept it was my fault."

Question: English is not my first language, but the first sentence (I accept my fault) doesn't sound very natural to me. I have looked up the word accept in several dictionaries and haven't found any similar example. It is often used with responsibility or blame. Another word that seems to convey the same meaning is admit, but that sounds a little formal and serious. What is the most natural way of saying that you are responsible for something wrong? Personally, the second sentence (I accept it is/was my fault/mistake.) sounds more natural to me.
Answer: "I accept my fault" implies that you are admitting that you were at fault at a given point.
As defined in Oxford English Dictionary:

An unattractive or unsatisfactory feature, especially in a piece of work or in a person's character.

"I accept it was my fault" indicates that a specific result was produced because of your mistake. It should also be noticed that, here, you might be trying to say that the said result was not caused by someone else's error and that you were responsible. The previous statement signifies characteristic while this one hints responsibility.
Another definition of the word "fault" in Oxford English Dictionary:

Responsibility for an accident or misfortune.

Source: https://www.lexico.com/en/definition/fault
Comment: Welcome to English Language & Usage. Do you have any references to back up your thoughts? These references would bolster your opinion and improve the quality of your answer.
Comment: Hello, Qumber."It was my fault and I accept it" doesn't sound natural to my ears, and would probably mean "It was my fault – I accept that", echoing the statement to show sincerity.
Comment: @Qumber It seems you misread the question. It's not "I accept it it was my fault". My second sentence is "I accept (that) it was my fault.".
Comment: @rajah9 Thank you.  I added a source as you suggested.
Comment: @EdwinAshworth You're right. I probably would say that a little differently too. I edited my answer to make things clearer. Thanks for pointing that out.
Comment: @KaptanSingh That was a typing error. I understand that your second sentence states that the person is admitting to have made a mistake. I edited my answer. Thanks for bringing it to my attention.


Neem leaf instead of hops substitute

Question: Can I use neem leaf for substitute of hops? Especially it's difficult to manage hops in our region. I found a lot of health benefit in neem leaf.
Answer: You can substitute any bitter herb for hops if you wish. Also given the fact it has anti-fungal and anti-bacterial properties, it will likely protect your brew from biological contamination, as hop alpha acids do.
As it is anti-fungal it may interfere with your yeast. Also, I do not know what off flavours yeast may produce when fermenting in the presence of Neem tea compounds. You may be fine, but experience with mead made from eucalyptus honey makes me consider this as a possible adverse affect.
If you do try this please report back.
Before hops a wide range of herbs are recorded as being used to bitter/flavour ale/gruit there are a few modern breweries doing this: https://en.wikipedia.org/wiki/Gruit
Answer: Okay, so I actually tried this. I made a simple gruit(Beer with herbs instead of hops), and I just used neem as the herb. It did not interfere with the yeast at all and created an interesting drink. It tastes a lot like neem tea, and is nice and bitter, but also tastes malty like beer. When warm and un-carbonated, it's not great, but when cold and carbonated in a keg, it's great! I feel if gives you a more floaty and euphoric buzz compared to normal beer.

Neem leaf instead of hops substitute


web scraping search results

Question: I need help solving the following issue:
I need to validate cached URLs by Google search engine for a particular site. In the case the url will 404 or the page will not render some necessary html elements (considered broken) I need to log those URLs and later 301 redirect to correct URLs. I know PHP and a little bit of Python but I'm not sure what approach to use to scrap all URLs from search engine results for given site.
Answer: http://simplehtmldom.sourceforge.net/ - a simple html parser. there is an example at this page; not sure if this still works with googles instant search etc.

web scraping search results