Magento 2.4.3-p3 security scan failed XS Vulnerability (APPSEC-1539)

Question: Our Magento 2.4.3-p3 site failed the XS Vulnerability check. Does anyone know how this can be fixed?
Answer: The XS Vulnerability (also known as Cross-Site Scripting Vulnerability) in Magento 2.4.3-p3 can be fixed by following these steps:

Update Magento to the latest version - Magento released security patches for this vulnerability in its latest version. It's recommended to upgrade your site to the latest version of Magento 2.4.x, which has the security patch for XS Vulnerability.

Install the security patch - Magento also released a security patch (SUPEE-116459) for older versions of Magento 2.4.x, which includes the fix for XS Vulnerability. You can download the patch from the Magento security center and apply it to your site.

Disable HTML tags - You can also disable the use of HTML tags in user-generated content such as product reviews, comments, and contact forms. This will prevent attackers from injecting malicious scripts into your site.

Use Content Security Policy (CSP) - Implementing CSP headers in your site's HTTP response can help prevent XSS attacks by restricting the sources from which your site can load scripts, stylesheets, and other resources.

It's important to note that fixing XS Vulnerability is crucial for maintaining the security of your Magento site. You should take action as soon as possible to prevent any potential security breaches.
Comment: Mm.. I can't find that patch... Where can I find the security patch SUPEE-116459? Do you have a link related to that patch? My installed version is: Magento Open Source 2.4.3-p3


How to calculate correlation between multiple?

Question: I do have some 10-12 independent variable, I want to know how these 10-12 variables are related to a single variable(X). so I can decide that some variables are positively correlated to X and some are negatively correlated. I thought of doing correlation between X and one of the independent variables individually and decide. is there is a way to calculate multiple correlation.
Comment: check this [page](http://en.wikipedia.org/wiki/Multiple_correlation)
Answer: As @Analyst's answer implies, the level of measurement will matter, but if you have continuous data, you can calculate the multiple correlation ($R$) of a set of predictors with the dependent/outcome variable (your $X$) by performing multiple regression. The Wikipedia article @user603 linked specifies:

[$R$] is measured by the square root of the coefficient of determination, but under the particular assumptions that an intercept is included and that the best possible linear predictors are used, whereas the coefficient of determination is defined for more general cases, including those of nonlinear prediction and those in which the predicted values have not been derived from a model-fitting procedure.

There are many ways to accommodate categorical data in general linear models that may work for you as well, depending on the specific nature of your data.
Answer: You could try calculating partial correlation coefficients if you have at least interval scale measured variables.
Here is link for the implementation in R.
http://www.statmethods.net/stats/correlations.html
You can find it at the bottom of the page.


I need the site to display any changes made to a "linked" document

Question: We have multiple sites in our company which are very similar.  In all our sites we have an embedded link to a document on another company site. I would like to update the source document and have it automatically updated on all sites so that I don't have to edit each site individually. Is this possible?
Answer: Yes, this is possible using the workflow.
I believe in all other sites document library has hyperlink type column to display the link, if not create it.
Develop a simple workflow on source site document library /list and trigger this workflow on item creation and updation.
The logic of the workflow action should be update the list item column (hyperlink) for all the sites. So, in this way whenever you update something in the source list, automatically workflow will update in all other sites.
Answer: 1.If you want to update the content of source document, you don't need to updated links on all sites.
2.If you use hyperlink type column or quick links web part to display the source document, I don't think it's possible to updated links on all sites.


Why quasistatic doesn't imply reversible process?

Question: Quasistatic process are almost always in equilibrium. We know that equilibrium implies zero entropy change. And zero entropy change implies that the process is reversible. So why quasistatic doesn't imply reversible?
Comment: Possible duplicate of [Is there a quasistatic process that is not reversible?](https://physics.stackexchange.com/q/297386/)
Comment: because *almost always* is not *always*, and thus entropy is generated between the almost equilibrium steps.
Answer: All reversible processes are quasistatic process because they're all slow enough for the system to remain in equilibrium.
But all quasistatic processes aren't reversible this is because some involve entropy production. Change of entropy of a cyclic process is only zero.
Answer: Consider the case of a gas expanding slowly against a piston, which has friction.
The friction will dissipate some energy into heat, and this will happen no matter now slowly you move the piston; the dissipation is always going to be at least $\mu N \, \Delta x$. This dissipation increases the entropy, so quasistatic doesn't imply reversible.


Can you determine if an email has attachments from just the email header

Question: Can you determine if an email has attachments from just the email header.
If I call the Pop3 command "TOP 1 0" can I determine from the data returned if message has attachments.
If not is there anyway of find this out with downloading the whole message and counting the attachments.
Answer: POP3 does not provide attachment information in the header so no, unfortunately, I'm pretty sure you have to read and parse the entire message.
In any cases, not all POP3 servers provide the TOP command.
Comment: Thanks, I'll need to add to my doco that the POP3 must support the TOP Command
Answer: Does that command give you the full headers of each message? If so, you could rule out messages without attachments by reading the Content-Type. If it's not a multipart message then it doesn't have an attachment. However, I do not believe you can prove that a message does have an attachment without downloading the contents of the message.
Comment: Yes I have the Content-Type but your right about it doesn't prove it has attachments as I dont count the "body.eml" as a attachment
Answer: If content type is "multipart/mixed" then there is an attachment in the Email.


Does the generator (base point) is preshared between the sender and receiver in elliptic curve cryptography?

Question: Or the elliptic curve and the generator point are known to everyone?
Answer: Yes.
The curve and generator point are part of the domain parameters and therefore made explicit if you use a named curve.
Comment: Everybody knows the named curves, and the name of the curve and the domain parameters are considered public. Only the secret (usually $s$) of the private key is required to be secret. The point of the public key, well, I guess you can figure that one out :) - it's not necessarily known to everyone, but it's not secret either.
Comment: Is the generator is known to everyone in the network or only between the sender and the receiver?
Answer: Yes, base point is public parameter in elliptic curve cryptography. Suppose that, your base point is G and your private key is k. In this case, your public key would be kxG. Calculating kxG (by multiplying k and G) is fast whereas extracting k from public kxG is slow. In other words, you can calculate kxG in seconds wheras extracting k from kxG last almost infinite with brute force attack. There are approaches to calculate kxG fast such as double and add method (aka binary method).
That's the power of the discipline.


English idiom for 'Fry the fish using fish's own oil'

Question: Please help me to find out the appropriate English idiom for Fry the fish using fish's own oil. This is a Bengali proverb/idiom whose word meaning 'When you are frying some sea fish, initially cook use some oil for frying but within few minute fish emit it's own body oil, and the remaining frying is done by this oil. Literally, this means Somebody has invested some amount of money in some particular purpose but get some extra benefit, as an add-on that save his/her initial investments. Please help me. If I'm not clarify well please ask me. Thanks!
Comment: As well as idioms, there's a term for that in the context of investing money: ["seed funding" (aka "seed investment", "seed money" or "seed capital")](http://en.wikipedia.org/wiki/Seed_money). It's the term most commonly used to describe things like crowdfunding (e.g. Kickstarter) or microfinance/microcredit (e.g. [Grameen Bank](http://en.wikipedia.org/wiki/Grameen_family_of_organizations)).
Answer: After (as rileywhite says) you have 'primed the pump', the enterprise will hopefully carry on under its own steam.
But avoid mixed metaphors even more than 'hopefully' as a pragmatic marker.
Answer: You may be looking for something along the lines of "prime the pump", meaning that you put some intial investment into something to get it started, and then it can continue on its own. This is often used in reference to Keynesian economics, but it can be applied more generally, as well.
Literally, it is an expression referring to adding water into a water pump so that water can be extracted from, for example, a well. See this instructional guide.
Answer: You might want a to use an actual, well-known economics term:

R.O.I: "Return On Investment"

Or

"Pays for itself"

You would then explain how the subject does this.
Or you might want

"you can't make an omlette without breaking a few eggs"

suggesting that a price MUST be paid to get the intended benefit.
or

"Killer app", short for "killer application"

which refers to the fact that the very first spreadsheet program for a personal computer allowed accountants|book keepers to justify the entire cost of purchasing an entire expensive PC system because it would divide their workload by a factor of 10 or more.  If the computer ONLY ran a spreadsheet, it was worth the price to them.  But a computer also does much, much more, like print layout for documents, art, e-Mail, etc..
You might want:

"Get the ball rolling"

Which conjures the image of giving a boulder a tiny initial push to start it rolling down a hill, after which gravity will take over & keep it rolling.
Comment: +1 for get the ball rolling. "can't make an omelette..." implies that something was destroyed, or that some cost was paid. I'm not sure using a little oil to get going is quite the same.
Answer:
The gift that keeps on giving.
Answer: An approaching idiom is "Wilful waste makes woeful want" [willful in USA], meaning that if you don't spare enough you are going to ruin.
The idea is similar but expressed in the reversed way.
Comment: This may be a familiar saying in the US.  Apparently it originated in Scotland.  It certainly isn't a saying which an English person would recognise though - we can see the meaning clearly enough, but it isn't a familiar phrase.  And it's the exact opposite to what the OP asked for.  Some questions are best answered by an opposite, but not ones like this.
Answer: Pull yourself up by your bootstraps.
This expression is also the origin of the idiom of booting a computer, since a computer starts itself incrementally in a manner much like this.
Answer: These will surely be too general, but I'll mention them anyway.

Know what side your bread is buttered on.
  (know where your best interests lie)
There are tricks in every trade.
  (self-explanatory)

Tricks are all nice and good, but remember, there is no free lunch.
All right, that's that. Good luck with cooking, and, naturally, if you can't stand the heat, get out of the kitchen; you don't want to stew in your own juice.
Comment: Not the same meaning as the OP asked for.


What was the inheritance tax rate in the UK during WWI and WWII?

Question: I've read somewhere that rich people were heavily taxed during World War I and World War II. What was the inheritance tax rate like in the UK at the time?
Comment: "I've read somewhere...". Please cite your source. This will help people trying to answer your question.
Comment: I did some research on the internet, and this is what some people have been saying. I have no source in particular, which is why I would like more details about this tax.
Comment: @LarsBosteen: For my generation at least, OP's presumption I believe to be a widely held belief at least in regards to WW2. I suggest we let this instance go. If it's correct we verify, and if it's incorrect we debunk.
Answer: This graph illustrates the top inheritance tax rates since 1900 for four major Western governments: U.K., U.S., France, and Germany.

For the U.K. in regards the two world wars it shows the top rate changing:

in 1915 from from 15% to 20% and again in 1919 to 40%;
in 1940 from 55% to 65% and again in 1945 to 75%


Autosys job testing

Question: I am new to autosys.. does anyone know how to perform positive and negative test on particluar job
Answer: Not sure what you want to test. First get the command or script you want to run working outside of Autosys. As part of that, test the command or scripts error handling. Autosys will report any zero exit code from a a command as a success, so make sure your script sends out a non-zero exit code on any exit from error. Then you can test that the autosys jobs run on schedule by using dummy commands or scripts, like a sleep command. Then you can test using live command or scripts.
To test a particular job, A positive test would be if you force started the job, it ran to sucess and the logs generated by the command ran by autosys indicated that the command was successfull. To do a negative test for a command job would depend on the comand or script being ran. Change something outside of the job to make the command or script fail.
Answer: Autosys seems to be painfully limited. You can create a condition in JOB2 that depends on the success of JOB1 e.g. SUCCESS(JOB1). But there seems to be no support for a condition that is the inverse of SUCCESS. Autosys provides a RUNNING and a NOTRUNNING condition, but for some reason they unfortunately omitted to include a NOTSUCCESS.
The best workaround I've come up with so far is to use the following JIL configuration:
<code>insert_job: 0AM-7AM_BOX
job_type: b
start_times: "00:00"
description: "Succeeds if JOB1 succeeds, TERMINATED if JOB1 does not succeed"
term_run_time: 419

insert_job: CHECK_THE_CONDITION
job_type: c
box_name: 0AM-7AM_BOX
command: date
condition: success(JOB1)
description: "Succeeds if JOB1 succeeds"

insert_job: ACT_ON_THE_CONDITION
job_type: c
command: [put the command you want to execute here]
condition: SUCCESS(CHECK_THE_CONDITION)
description: "Run the run between midnight and 7am if the condition is true"
</code>
So, if JOB1 enters the state "SUCCESS" between midnight and 7am, then ACT_ON_THE_CONDITION will immediately run. Since the command is just a dummy call to "date" this should run immediately and also become "SUCCESS" and therefore the 0AM-7AM_BOX box will also become "SUCCESS".
The other possibility is that JOB3 does not enter state "SUCCESS" before 7am. In this case, the "term_run_time" setting will cause the box to enter the state "TERMINATED".
Summing up,

If JOB1 is SUCCESS, 0AM-7AM_BOX -> SUCCESS
If JOB1 is anything except SUCCESS, 0AM-7AM_BOX -> TERMINATED

This is useful because you can then set up dependent jobs that test the success condition or the terminated condition (since TERMINATED is a valid test you can put in a condition).

Autosys job testing


What comes first, window trim or stucco?

Question: We have some new windows in new construction with only lath around them and some existing windows with existing stucco around them. At what stage would be the best time to install wood window trim?
Comment: Are you asking whether the wood casing goes over or next to the stucco? I don't think I've seen wood trim with stucco. Kinda defeats the purpose of the long-term, low-maintenance nature of stucco. Maybe a photo of the idea would help.
Comment: Interior or exterior? "Wood trim" sounds more like an interior thing while "stucco" sounds like you're talking about exterior surfaces...in general, trim would go on after the wall surface(s)...Are you using plaster/stucco interchangeably? I have trouble picturing exactly what you mean... Pictures are essential I think in this case.
Answer: First the window goes in then the stucco on the outside and trim on the inside. We usually leave finish trim for last just in case someone drops a ladder through a window while stucco is being put on (it happens) .


How do I configure SSH so that OTP can be used with ssh-copy-id and then only keypair authorization is accepted?

Question: Is there a way to tell the SSH daemon, "when a remote device attempts to connect via SSH, verify against authorized_keys, but if there is no key offered, accept a one-time password so the user can use ssh-copy-id to provide it for subsequent attempts"?
context:
I would like to be able to set up a linux server so that a user can SSH into the box, but I want to use RSA keypairs for authentication.  I also have several devices that I want to be able to connect from, so that means providing multiple key-pairs (not a problem).
Essentially, I want to add entries to authorized_keys using OTP and ssh-copy-id, from a device that, currently would be denied access (because it hasn't presented a public key yet).  I currently have to SSH in from a machine that can connect, edit the sshd_config file to allow passwords, then copy over the id with a static password, turn password authentication off and reboot the daemon.  I would prefer a way to get a OTP from the system and then just use that and keep working...
Comment: You might want to write a [PAM module](https://www.digitalocean.com/community/tutorials/how-to-use-pam-to-configure-authentication-on-an-ubuntu-12-04-vps) for SSH that gets run if key auth fails. PAM is generally how you configure alternative auth mechanisms; that having been said, I don't know if there's already a better way out there, so I'm not giving that as an answer.
Answer: Public key authentication is turned on by default and has higher priority then password authentication (handled by PAM or directly).
You can set up in sshd_config option UsePAM yes (by default on Red Hat), which will defer authentication to PAM -- this is configured in /etc/pam.d/sshd (can differ a bit on some systems).
For OTP you can use google_authenticator, or some other open implementation of one-time passwords. There are many how-to's around here. You can try to search for two-factor authentication, but basically it is adding one line like this
 auth            required        pam_google_authenticator.so

in the /etc/pam.d/sshd and do some configuration: Arch has nice instruction for this: https://wiki.archlinux.org/index.php/Google_Authenticator
Using only one-time passwords, without the second factor can be potential risk if the one-time password or token gets lost -- I recommend you not to go this way and implement rather the two factor authentication than only one-time password.


How can non-indie devs stop reinventing the wheel?

Question: It seems like the status quo in the games industry is to write most software in-house, maybe excluding the engine if you use one of the dozen or so big ones. Before working here I was mostly an open-source developer, so this mindset seems downright crazy to me. Is there any good way we can all stop building things like log viewers, network diagnostics, and patching systems?
Answer: We can stop reinventing the wheel by... ceasing to reinvent the wheel. Use external libraries, game engines, etc.
I get the sense that people do reinvent the wheel to:

Avoid copyrights, royalties, etc on libraries or borrowed code
Avoid paying for a game engine (for a full on AAA game, this can be enormously expensive)
Maintain intimate familiarity with the entire codebase--adding external libraries, linking to game engines, etc just means more code to become familiar with and possibly maintain
Writing all your code yourself means that you can optimize it specifically for your game
That code can then be licensed to others if desired, reuse it for other projects, etc while you maintain proprietary control
Comment: You've missed out actually being able to wade in and fix problems in libraries during release crunch without having to factor in a third party's turnaround time on their closed source, and to optimise the libraries for your precise use case. Those can be pretty valuable.
Comment: I agree with all that!
I myself had to re-invent some stuff to avoid patented code, also I had to avoid paying for a game engine, and finally, I often have problems that are not my fault (like my current game that has 3 defects, one is that the physics engine has counter-intuitive behavior... this mean I will need to read its source deeply... the other is that the mixer seemly has some arbitrary way to choose priorities, and finally, the game engine itself with map editor, randomly segfaults when I unload a map... Again this mean code sweeping...)
Comment: The question is more a social one, how can we encourage that? Are there, for example, tools for patching that are game-agnostic? There are some underlying algorithms and libraries for data manipulation (rsync algorithm, zlib) but I don't know of anything that goes as far as a UI.
Answer: It depends. I think there is actually a fair amount of middle-ware out there, that gets used, ... if you are willing to pay of it.
At the same time sometimes it is easy to hack something to get really fast without that many external dependencies, if the scope is small.
I think on the highend, you have to compare companies like EA and Ubisoft to other large software companies, like Apple, Google, Facebook, what have you.
They all write a very large amount of custom code, when there are existing alternatives, because they want to get a competitive advantage.
As @Sean James said there are legal reasons and host of other reasons, but I think even if there were no road blocks, inventive software companies would still develop custom alternatives to common existing software components if they thought they could make them better.
However I also agree that there is always room to start some projects we all could benefit from. For instance, I think we need to replace COLLADA with something much simpler that is JSON based. Maybe something that only handles arbitrary meshes, but nothing else. I think we really need a better mesh format.
Comment: There's not only the competetive advantage to writing your own 'middleware' but it also means in-house support. That can come in handy at times of major crisis, or when a bug is impossible to reproduce without handing over your entire game.
Comment: Not too mention if the game engine company gets bought, or their code is pirated, the list goes on. Depending on someone else code is a liability that can be hard to quantify it there are not many users, which is the case with a lot of specialist middleware
Comment: I don't think custom code will every go away, but the lack of a workable format(s) for sharing data is not helping the development of tools.
Comment: A lot of time, at my company at least, people would rather re-build stuff in house just because headcount is already budgeted for and buying commercial middleware isn't (and its easier to ask programmers to work 10 hour days than it is to get HQ to authorize big capital expenses). Wouldn't the benefits from freer collaboration be a bigger boon than the competitive advantage from proprietary tools?
Comment: I think it can be improved, but it think it is a problem that extends beyond game companies. There is much less code reuse then there should in general, not just with games. On a personal level I would love to help get some projects going.
Answer:
Is there any good way we can all stop building things like log viewers, network diagnostics, and patching systems?

In my experience, these things are treated as simple extras that can be bolted on alongside your 'real' programming. Of course, they turn out to be far from simple and far from 'extra', being complex and important parts of the system, but by then there's already too much investment in the bespoke version.
Are there good open-source or commercial libraries that provide this type of functionality? I am not sure there are, and until someone steps up and provides one, it'll stay this way. The business developers often aren't able to produce libraries that are suitable for games ("what, you mean you can't completely remove all the calls in a Release build?!") and game developers are often uninterested in making this sort of thing as a standalone package when they have a game to be getting on with.


Cover letter for mid-career application in mathematics

Question: I am in my seventh year after my PhD, and am applying from a tenure-track position in Mathematics.  I am working with a job coach, who is suggesting a 2.5 page cover letter for tenure-track mathematics positions.  This seems long to me, I always thought that in math 1 page was max, but are the rules different when applying mid-career?
Comment: This sounds ridiculous. Is this job coach a mathematician? Cover letters in math hiring (at least in the US) are an anachronism, I would find it extremely strange to see one that's more than 2-3 paragraphs long.
Comment: Which country is this and what does the job announcement ask for?
Answer: I think that the length of the cover letter is the type of thing that differs greatly between research institutions and small liberal arts colleges.
At the small liberal arts college where I work, 1-2 page long cover letters seem to be pretty common. (I'm also in math.) There's no length requirement of course, but it's expected that in addition to the normal stuff (who you are, a bit about your teaching and research experience, potentially stuff about working with undergrads if it is relevant) applicants say a bit about what makes them a good fit for the school. Basically, small liberal arts colleges tend to have their own distinctive personalities, and it can be a major problem if your cover letter comes across as super generic. Also, remember that a lot of small schools don't really have research groups in any particular area. Thus, if they're hiring an analyst one year there is an excellent chance that it's because the previous analyst just left / retired. People will read your research statement of course, but many won't make it past the first page or two. In contrast, every member of the department will read your cover letter. So if the cover letter you send to our small liberal arts college looks like you could have sent it to a large state school as well, that'd be an issue. Having said all of this, it's not like you need to be super long winded in your cover letter. If you can say everything that you need to in less than a page that's totally fine! It's just that a lot of people will be reading your cover letter, so if you want to explain why you're committed to working at a small school like ours or explain the context of your decision to apply to our school (which could very well be the case if you're applying mid-career), this would be the place to do so.
I don't have any direct experience with being on a hiring committee at a research department, but my impression has always been that the cover letter is considerably less important at these sort of places. (Perhaps it's even seen as an unnecessary formality? I've always found it weird to read 'Enclosed you will find...' when it's just a PDF file on MathJobs and not even a physical letter.) For example, when I was a postdoc I had a number of friends that used a computer script to insert the names of the schools they were applying to into a generic cover letter. It's not clear to me that this affected any of their searches in the least. Hopefully someone with some experience at these sort of places will respond to your question, but I think that at research schools there are much more likely to be well-defined research groups with members that are going to be able to read your research statement carefully and already know your letter writers, and that these sort of things are likely to vastly outweigh anything you could write in your cover letter.
Answer: As someone who has chaired several search committees in the last five years, I can tell you that there's very little chance that I'd read a cover letter that was longer than 2 pages long. I've got hundreds of applications to read on mathjobs.org, so there just isn't time for this.
The cover paper can be helpful in explaining why you're particularly interested in our position (a spouse working in a nearby city, family who live in the region, interest in research collaboration with faculty in other departments.)  It shouldn't take more than a couple of paragraphs to explain that kind of stuff.
You will have a separate CV, research statement, and teaching statement, so those aspects of your application don't belong in your cover letter.
What is your coach suggesting you put into this 2-3 page long cover letter?


Simple example of a ring which is normal but not CM

Question: I try to keep a list of standard ring examples in my head to test commutative algebra conjectures against. I would therefore like to have an example of a ring which is normal but not Cohen-Macaulay. I've found a few in the past, but they were too messy to easily remember and use as test cases. Suggestions?
Comment: Isn't there a theorem that says that a normal semigroup ring is always CM? So that puts a lower bound on the complexity of an example.
Comment: Yes, there is. We definitely need to get beyond semigroup rings here. One idea I had was that one might be able to take a product of curves, in some particular projective embedding, and cone on that. But all suggestions are welcome!
Comment: I guess you are requiring normal rings to be Noetherian, so that that isn't an easy example?
Answer: Another family of examples is given by the homogeneous coordinate rings of
irregular surfaces (ie  2-dimensional $X$ such that $H^1({\mathcal O}_X) \neq 0$);
these surfaces cannot be embedded in any way so that their homogeneous coordinate rings
become Cohen-Macaulay. Elliptic scrolls (such as the one in the previous answer)
 and Abelian surfaces in P4, made from the sections of the Horrocks-Mumford bundle, are such examples.
The point is that sufficiently positive, complete embeddings of any smooth variety (or somewhat more generally) will have normal homogeneous coordinate rings, and they will be Cohen-Macaulay iff the intermediate cohomology of the variety vanishes. All the examples above fall into this category. It's an interesting general question to ask how positive is "sufficiently positive".
Comment: Just to clarify this answer: the (normalization of the) cone over a smooth projective variety X is CM iff the middle (i.e. of degrees $0<d<\dim X$) cohomology of the sheaves $O_X(k)$ is zero, for all $k\in\mathbb Z$. Vanishing for $O_X$ only is insufficient. (Reference: D. Eisenbud, Commutative algebra with a view towards algebraic geometry, the section on local cohomology).
Comment: @VA: Nice reference!
Answer: Segre products of normal CM N-graded K-algebras A, B are always normal (since they're direct summands of the normal ring A\otimes_K B), but rarely CM.
A particular example is here:
http://www.math.purdue.edu/~walther/research/segre.ps
or also here:
http://www.mathstat.dal.ca/~faridi/research/enescu-faridi.pdf   (Corollary 35)
Take A=k[x,y,z]/x^3+y^3+z^3 to be the Fermat cubic, and B=k[a,b]. Then the Segre product A#B is not CM, since the a-invariant of A is non-negative.
Answer: MJ Bertin en Anneaux d'invariantes d'Anneaux de polynômes, en caractéritique p . C.R.Acad.Sci.Paris Sér. A-B 264 1967 A653-A656
"... MJ Bertin has made use of Galois descent in order to construct an example of a factorial noetherian ring wich is not Cohen Macaulay..." Robert M. Fossum
The example is done completly in The Divisor Class Groups of a Krull Domain, Robert Fossum, Example 16.7 pages 87-88


Watching the transaction of an external account using smart contract

Question: Is their any way to execute a function of smart contract whenever a transaction to a predefined external account occurs? I mean if someone transfers some ethers to account A, a function of a smart contract can store some values of that transaction. I want to do it using smart contract only not using any wrapper around this. Please suggest.
Comment: It is possible in a reverse way. i.e., whenever someone sends Ether to the contract, record it and send the amount to account A.
Answer: If you mean without you sending instructions to check it each turn,
up to my limited knowledge I think it is not possible because someone has to interact with the contract for it to do anything.
However, it is possible to do so with the external functions you do not want to use.
I hope I help.


Not able to edit or delete Global Navigation Items in Site Navigation Settings

Question: Edit is disabled and Delete option is missing
Not able to edit or delete Global Navigation Items in Site navigation settings even though the user is a member of Site Owners Group. As in the below screenshot, the user is not getting delete button and edit button is disabled. Please suggest how to resolve it?
Answer: The behavior you are getting is because, the site is added in global navigation by SharePoint. If you scroll top in Navigation settings, you can see below settings done in it.

If you continue this settings, you will continue face this issue. To change the site title and URL you need to go to that site and change the settings there manually. Changes will be reflect to global navigation automatically.

The alternate solution for this is you deselect the "Show subsites" option and create your own heading for each site.
Comment: Thanks for replying. Actually the issue is out of 4 sub-sites, one Subsite is not visible in the global navigation even for Site Owners. Can you tell me what could be the reason?
Comment: In Site Settings-Navigation, increase the Maximum number of dynamic items in Global and Current Navigation and see if that fixes it.
Answer: You cannot edit this under Navigation, since this Subsite name if you go to site content you will find this name.
If you want edit the page URL go to site or subsite and go to Site Settings>Welcome Page and browse the page path and submit.


How do you deal with bullies?

Question: What is the most effective way to stop bullying or cope with it? I am not asking about a fighting solution, since fighting gets you in trouble and is generally impossible to achieve 100% of the time.
I am bullied a lot, in a lot of ways, from yelling, to mocking, to spam/abusive texts/emails/calls, to physical hits and sexual comments. I want to not be bullied anymore, or at least be able to cope with it. I have been bullied for 3 years now, and I've had enough. What do I do?
Comment: Actually, just in case you didn't notice, Martial Arts Stack Exchange is mostly about fighting/martial arts solutions :)
Comment: You might have done this already, and perhaps it didn'twork, but if your school has a counselor, let them know what's going on. They - or another teacher you trust - will more than likely take bullying very seriously and they have the power to make some fundamental changes which will help you out at school. You need help. Don't be afraid or ashamed to ask for it.
Comment: https://martialarts.stackexchange.com/q/12621/1780 and https://martialarts.stackexchange.com/a/7038/1780 might be useful.
Comment: I can't migrate this as it has an answer now, but this would be a much better fit (And probably has answers) at [IPS](https://interpersonal.stackexchange.com/)
Answer: This looks like it might be a duplicate question that's already been answered here, as Macaco Branco mentioned in the comments. But I did want to give a unique perspective on this, as someone who was once bullied as a child myself.
I'm going to assume you're in school still, and that you're a boy. Hopefully that assumption isn't wrong. My advice would still generally apply if you were a girl or an adult, too.
The obvious answers are stuff you already know: Avoid the bullies, keep your head down, don't provoke anyone, and try to blend in and not stand out. Beyond that, get stronger and take MMA, BJJ, or Muay Thai.
But honestly, do you want to know the thing that has the greatest chance of actually working? Something that will sort of immunize you from ever being targeted by a bully again?
The answer is: Make friends. As many as you can. The more the better!
Bullies pick on people who are easy targets. Those would be people who stand out and who don't have lots of friends, or no friends at all. They don't pick on the popular kids. They don't pick on the jocks. They don't pick on kids who look normal, act normal, talk normal, dress normal, and have normal interests.
Now, to some degree it has nothing to do with looking and acting like everyone else. It's all about making friends. Making friends often means not being weird and not being the sort of kid nobody wants to be seen with. Those kids simply lack friends because they're different. Not a lot of kids are going to accept kids that are unusual. So those kids who are different will often struggle to make friends.
And the more a kid goes through life feeling different and acting different, the more likely that kid is to be introverted and therefore only need one or two good friends. Those kids with one or two friends are targets for bullies. Chances are, their friends are also like them, weird and different. Bullies won't be deterred by those one or two friends of theirs.
So, I know it's unfair. I know you're probably different from others. You stand out in some way. Maybe you're weaker physically. Maybe you look younger than the rest of the kids in your class. Or you wear feminine clothing, or clothing that's really colorful when the other boys don't. Maybe you color your hair. Or you wear earrings. Maybe you listen to music that nobody else does, and you're not afraid to show it by wearing that band's t-shirt. Or you have interests that are uncommon that nobody else can relate to. Etc.
All of those things are the way you express your individuality. Or they're not an expression, it's just who you are. And it's not fair to ask that you change just to satisfy a bully.
But I think that's the wrong way to look at it. I would reframe that in your mind a bit. Instead of changing to satisfy someone else, think about wanting to do whatever you can to make new friends and be the sort of person who everyone wants to be around. Do it not to satisfy others but because you personally want to be someone who everyone likes. That goes beyond what you wear and what you look like. It's also and mostly about being friendly and warm, and taking a genuine interest in and appreciating others, who they are, what they're into, as well as their problems in life. And not judging them for it.
And I want to be clear here. It doesn't mean changing who you are and your interests. It does mean that you will be less concerned with conveying to others who you are and, rather, shifting the focus onto them and discovering who they are, their uniqueness, their interests, and so on. It's less about you and more about them. Let them shine. Let them do the talking. Let them tell you all about their favorite subject: themselves. And listen to them, really listen.
The worst thing you can do is put up some kind of barrier that prevents them from opening up to you or getting closer to you. You need to be better about gauging their reactions to you. If you're wearing a t-shirt that offends them, for example, maybe you should stop wearing those t-shirts or tone that down a bit. That's less about you repressing your individuality and more about caring about others around you. That's it.
And you might be very passionate about some subject and can talk for hours about it, but know that most people get bored beyond a few sentences. Keep it short and only give them more if they ask you for it. The more time you're spending talking, the less you're able to find out about them, and the less they want to be with you.
You don't want to anger them if they believe something that's against what you believe. So just keep those things to yourself. You don't want to make them feel less than you in any way, so stop trying to play yourself up. You don't want to make them feel awkward around you, so don't do or say stuff that other kids aren't doing or saying.
Instead, make it so that they feel like they can really open up and tell you their interests. That should be your focus. Take the focus away from you and put it on them. It's not about you trying to be someone you're not. It's about you trying to put the focus onto them.
School can be brutal. I remember trying to make friends with kids that seemed like they could use a friend. I figured we were in the same boat, so the more the merrier, right? And I would try to befriend them, only for them to lash out at me and push me away. They didn't want me near them, either.
There's a reason why those kids are alone. They're not friendly, not nice, and they don't put in the effort to make friends. Many also have mental or personality problems, unfortunately, and push people away. Other kids see them alone and know not to approach. Like I said, it's brutal sometimes.
So I'll just say you have to break out of that. Start making new friends. Easier said than done. Chances are you don't know how to do that. That's great! Be aware of that fact. That will lead you to asking the right questions. There are books on how to make friends. Search for them and read some of them. Take from them what you think you can apply. And then little by little, make changes in your behavior that increase the chances of you making new friends.
Don't worry if you're not successful right away. It can take a whole year or even longer before people start coming around, and you get in with the right social circle. Acting all friendly all of the sudden makes other kids suspicious. It takes time before they get used to the new you and begin to accept you into their friend groups. Then once you're in one group, it becomes easier to branch out to others.
For you even, it's going to seem like trying to be someone you're not, at least at first. When you're far enough along in this process, I'm just gonna tell you that you won't have to worry about that anymore, because it will be genuine. That will be who you genuinely are. It won't be an act. And kids will feel that and will begin to trust you.
By the time you find yourself in a larger social circle, you'll have forgotten about that bully. The bullies will simply vanish, because you're no longer a target. You have friends. And if you do still get bullied, your new friends won't stand for it. They'll push back on the bully for you. That's what bullies fear the most. Bullies don't want to be the ones who are ostracized by the group, because that would make them just like the ones they bully.
Whatever you do, don't become violent. Just channel all of that emotion into motivation for becoming the one everyone wants to be with. That's your goal. And do reach out to adults that can help if it becomes too much to handle.
This is my perspective. I hope it helps. Good luck.
Comment: Just as a special perspective: neurodiverse people (e.g. Asperger, ADHD) stand out *and* have a hard time finding friends. Therefore, they are especially prone to bullying. It also is often a neglected possibility in cases of comorbidity, high intelligence, or in females because some typical symptoms are moderated and do not show.
Comment: @PhilipKlöcking Indeed. Once diagnosed, kids and adults can get into ABA therapy programs and attend private counseling sessions with specialists to help them fit in better and become more social. So there is hope. I'll tell you this, though. Being on the autistic spectrum doesn't make anyone a mean, horrible person. Some of the kindest people I've met were on the spectrum. So if someone is being mean, pushing others away, that's different. There's something else going on there, maybe in addition to autism. A qualified psychologist (not a simple counselor) can help.
Comment: I'm diagnosed myself so fully agreed. Just mentioning that there are special needs and conditions (impulsiveness, slower processing speed of hints to emotional states, the tendency to either not focus or hyperfocus, brain parts that ensure 'social appropriateness' of behaviour showing low or no activity, ..) which often lead to both bullying and the inability to socialise because of anxiety growing out of unsuccessful attempts of 'masking'. All the more important it gets diagnosed and properly addressed by *experts* as early as possible, while brain plasticity is still there.
Comment: And by the way, not saying that the original poster is autistic. But anyone who is autistic and reading my answer here telling them to get interested in making lots of new friends, my hope is that they will read what I wrote and realize some of the things I said in it apply to them. Maybe they recognize some of those anti-social behaviors now, whereas before they didn't realize it wasn't helping them. Then I hope they realize they should continue in this direction and make it their goal to get better at it. It has to be something they want to do, not something they're told to do.
Comment: Frankly, it is something they need professional help *to be able to do* in the first place. It's not about not wanting it enough or liking to be "anti-social". Rather the opposite, that is why morbidity of anxiety and suicide rates are much higher for neurodiverse people. It's your brain working against you and that's a fight you can't win alone. When you speak out loudly the things that other people's brains stop in time *not because you don't know it's inappropriate but because the part of the brain that hits the breaks in normal brains does not work* that is a liability beyond willpower.
Comment: @PhilipKlöcking I see it as less black and white. I agree that getting diagnosed and getting appropriate therapy can be helpful. So can reading books on how to make friends, even kids on the spectrum. Many kids on the spectrum who have not been diagnosed by the time they are in their teens are quite capable of learning to be social from books, videos, and trial and error on their own. Not all. Frustration at attempting and failing at making friends would then be a great motivator for seeking out and finding a good psychologist who can then recognize autism and take the appropriate steps.
Comment: @PhilipKlöcking Incidentally, my kid is on the spectrum. ABA therapy doesn't typically treat socialization. It's a good/necessary first step. For social skills, it's hard to find good options for kids on the spectrum. It depends on what's offered locally, which varies. Counselors attempt to fill the gap and teach a little at a time, like how to read body language, for example. All things can be helpful. I don't think there's one thing by itself which will "work". So I'm less black and white on this subject. Find what works.
Answer: Yes, I know, it may sound cheesy to students in school but... Tell a trusted teacher. Most likely, teachers will help. They at least will try to help you. If you feel too shy or embarrassed to tell a teacher, you can talk to a parent or a trusted friend. If you really express it and say something, it will be stopped. And if you are brave enough, you can go up to the bullies (cyber bulling is different, try to stay away from devices for a little bit) and tell them to STOP. For more help, visit https://www.stopbullying.gov/
Answer: I was bullied many times as a young person. Nomadic upbringing. New kid. I found that fighting back immediately, whether I won or lost, made a statement bull(ies) understood. They then did not focus on me. Just let your proud instinct go and fight. Strike quickly with determination, force and pre emptively. First target the throat with a knife hand, 2nd knuckle punch, grab or fist. Bloody the nose or lip which is good publicity. Avoid fighting if you can. If you cannot avoid, fight aggressively with determination.

How do you deal with bullies?


Simple blinking Led with control over both the pause rate and flash time?

Question: I was hoping someone could help me understand a very simple approach to creating a flashing led. While many simple examples exist, I cant quite find one that allows me to control both the pause rate and display duration times.. for example: led on (emitting) "10ms" led off "30ms" (repeat forever). Or perhaps I swap out a capacitor to creat "led on 500ms" led off "2ms" (repeat forever). Anyhow, I have capacitors to work with, 555 times, resistors, diodes. I'm a real beginner obviously, and do not know how to design around the 555 - but if someone has a very easy suggestion I can attempt I'd appreciate it. I'm attempting to study the effect of "charging" a glow in the dark object with a 3.3v UV Led and thought it would be neat to see the minimal amount of strobing required to energize the glow. Thanks!
Comment: *for example: led on (emitting) "10ms" led off "30ms" (repeat forever). Or perhaps I swap out a capacitor to creat "led on 500ms" led off "2ms" (repeat forever).* That will be a challenge using 555 ICs. Flashlights you can buy that have these functions use a microcontroller which is a cheaper solution than anything 555. There's no need to explain how to make a flashing LED with a 555, there are plenty of tutorials to be found if you look for them.
Comment: This is exactly the sort of thing that [Arduino](https://arduino.stackexchange.com/) is perfect for. You have a specific application in mind, and don't want to get bogged down in the technical details.
Comment: 555 astable oscillator. Two resistors in parallel in charge/discharge circuit with a diode  in series with each resistor, opposite polarity for each diode. One controls charge and the other discharge.
Comment: Much appreciated thank you all, I'm going to look more into Arduino and micro controllers for future projects - makes a lot of sense since I know programming. I'm also going to give the 555 timer ideas here a try for learning
Answer: Just Googling "555 astable circuit" will list plenty of web sites.  This one: 555 Oscillator Tutorial gives the equations for the on time and off time.
Comment: thanks this really nailed the question because this link outlines exactly how the t1 and t2 times can be produced!


How do I enable the "Universe" repository from the command line?

Question: How do you use terminal to enable Universe source?
Or any those 4 from Software Sources: Main, Universe, Restricted, Multiverse
Main is on by default and Restricted is on if durring Ubuntu installation i tick Enable Restricted Formats.
Answer with line where version checked so it auto detects it.
Like command I know for partner but that goes to Other Software tab sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
Answer: I finally found answer myself.
To put all ubuntu sources to work without clicking them just enter in terminal
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"

So for just "Universe" would be
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

You can then check in Software sources it will show it works now.
You can delete manually from sudo gedit /etc/apt/sources.list line http://archive.ubuntu.com/ubuntu lucid main universe restricted multiverse and save and see in Software sources nothing is ticked. Then do
 sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

& that makes Just universe ticked.
For all enabled do
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"

you can add also partner repository with different link (see difference is ubuntu to canonical)
sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -sc) partner"

$(lsb_release -sc) makes checking your Ubuntu version and putting its name in link. Since 10.04 is called lucid then you can test in terminal lsb_release -sc gives word lucid Thats makes added repository link precise name of your ubuntu Release in Software sources. Wrong word and noting will work.
for all differences in repositories read https://help.ubuntu.com/community/Repositories/Ubuntu
Answer: As of Ubuntu 12.10, you can run:
sudo add-apt-repository universe

Which is easier than running sed over sources.list files, and will take into account which of -updates/-proposed/-backports is enabled.
You can go back with the --remove flag, but you'll still have to remove the packages:
sudo aptitude purge '~i ~s universe/'

Comment: This command is indepotent (i.e. can be executed multiple time without side effect). The command suggested in answer from @Kangarooo is not, the sources.list file is modified and grows each time the command gets executed (tested with Ubuntu 18.04).
Answer: Universe is enabled by default so you usually don't need to do this. You could edit the sources file from the terminal:
sudoedit /etc/apt/sources.list

And then uncomment the universe sections of the following lines:
#deb http://us.archive.ubuntu.com/ubuntu/ precise universe
#deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe

The Ubuntu help page may be of use. And if you want to enable it via the GUI:

How do I enable the "Universe" repository?
Comment: I think 'deb http://security.ubuntu.com/ubuntu precise-security universe' should also be mentioned.  While Canonical doesn't provide support for universe packages, I see quite a few (community-provided?) updates sitting there.
Comment: What I was searching for: `What` is the `baseline/default`?


For how long is a satellite orbiting at 300 miles going to be visible from horizon to horizon?

Question: Elon Musk has a plan for satellite internet that involves LEO and VLEO satellites. The question I have is how long would a satellite at these altitudes actually be within range before having to hand off to another? And how many satellites would it take at these altitudes to provide 24x7 coverage of a specific area?
Comment: Check out the images in the question [SpaceX's 4,425 satellite constellation - what's the method to the madness?](https://space.stackexchange.com/q/19055/12102) and especially it's excellent answer. I believe there may even be a "next phase" with even more satellites envisioned.
Answer:
For how long is a satellite orbiting at 300 miles going to be visible from horizon to horizon?
Answer: 16.6 minutes
The formula for angular horizon distance is https://sites.math.washington.edu/~conroy/m120-general/horizon.pdf
$A = cos^{-1} \frac{R}{(R+h)}$ where:
A = angle
R = radius of Earth:    3,958 mi
h = altitude:       300 mi
A = 23°
Double that for horizon-to-horizon, and you get 16.6 minutes out of a 130 minute orbit.

The question I have is how long would a satellite at these altitudes actually be within range before having to hand off to another?

A lot less.
Comment: this answer is the ***maximum*** time between rise and set, which occurs only when the satellite passes directly overhead.  the visible interval shrinks as the orbit track moves sideways, out of the plane of this picture.  "actually being in range" is ***not necessarily*** less at all, but it needs more information to determine what the OP means by "in range".


Finding DC of Athletics check to climb on a cable line strung between two moving objects in zero gravity?

Question: Climbing in zero or low gravity is a -5 DC modifier. If the two objects are moving at high speed (let's say 300 MPH through outerspace, so no wind resistance), how would that impact the DC of the climb check?
Comment: Physics clarification: they are moving 300 MPH with respect to *what*? For example moving that speed wrt some rubble in the way is quite important. Wrt distant star? Doesn't matter much. Please specify :-)
Comment: Hey all, remember how comments aren't for solving the problem or chatting?
Answer: It wouldn't impact the DC at all
Two ships moving at similar speeds and similar heading aren't moving relative to each other any differently than if they were gently drifting near each other. Space doesn't care about "speedometer" speeds, only relative speeds.
Climbing a cable between two ships travelling 300MPH would be the same difficulty as climbing a cable between two ships that are not moving at all: just the standard −5 DC for climbing in microgravity. It's basically like them being parked beside each other. In fact, that's exactly what they are: parked beside each other.
If this seems non-intuitive, look at any video of an astronaut taking a space walk from the International Space Station. That astronaut and the ISS look like they're not moving. They're not having any trouble at all moving around. But they're both travelling at over 17 thousand MPH, yet it makes no difference* from moving at 300MPH or zero MPH, because they're moving together.
* Almost no difference. The fact that orbits are curved has a very, very slight effect over a long enough time that makes them different from straight lines in deep space, but not different in a way that matters here.
Answer: As per my earlier comment, although there is no air resistance, two objects moving at high speed are likely not actually moving at exactly the same speed and course (although in game terms they are, of course, moving the exact same move speed). I would put the penalty somewhere between "severe wind" and "windstorm", so a +5 to +10 penalty. If an ally is on one of the ships, they could make a Piloting check against either an opposed check or a DC of 10. For every 5 they succeed by, they downgrade the severity by one rank, down to making it a +0 by keeping everything at a steady state. Of course, the same applies to failure or enemy action, making things more difficult.
Comment: @SevenSidedDie: Without getting too conversational, I have my doubts that the line would remain completely taut. Given the speeds involved, and the potential for movement, you'd either have to have a very strong cable or an elastic one. Either way, the cable is going to flex, although it may be the difference between it swinging like a slack rope and vibrating like a taut cable. Either way, it's going to make the climb more difficult.
Comment: I think you're picturing a taut cable twanging around, but a *taut* cable between two ships means that one is effectively (due to frame of reference issues) towing the other. In which case, the cable would be steady. Any other situation would be a *slack* cable, very similar to tethers ISS astronauts use regularly to maneuver. Either way, there wouldn't be any meaningful forces interfering with using it to move. Any movement of the cable  strong enough to make it unpredictable, but weak enough to not create a steady towing, would very quickly just snap the cable, not make it hard to climb.


Getting dust with smoothing plane?

Question: I am new to hand planing. I have some S12E cedar and when I take my smoother (old Sargent) to the rough face I just get dust in the mouth and it gets stuck on the board. The blade is sharpened to 1000 grit and stripped and shaved hair with no force. I have the blade forward to keep a tight mouth. What could be causing this? I am not using the cedar for anything. It was some scrap from a project.
Comment: Forgot to shoehorn in something to do with sharpness. The ability of an edge to shave arm hair actually doesn't tell us as much as one might expect about its ability cut wood. A much better proxy is *the ability to cut wood*...... so keep scraps of pine on hand and use their end grain to test sharpness in a meaningful way. It's important to use pine/a similar softwood for this testing as harder woods are more forgiving about slightly under-sharp edges (the fibres are stiffer and put up more resistance). The fibres of a soft wood on the other hand want to bend over and not be cut.
Answer:
the rough face I just get dust in the mouth

This contains its own clue. It's fairly typical not to get shavings at first when planing rough wood, simply because the cutting edge is initially encountering lots of high spots in the texture, rather than a fairly contiguous surface as you get later in the planing process (and later in the planing process is ideally when the smoother should actually be brought to play).

Sidenote
Rough planing should ideally be done with a tool suited to that task. Historically this work was done with a 'roughing jack' or a fore plane1 and these are still the best way to do this (IF doing the whole process by hand).
Although no. 4s are now very commonly used as more multi-purpose tools than they would have been in workshops back in the day, they were never intended to be anything other than smoothers and rough planing is not really in their wheelhouse.

and it gets stuck on the board

This is an unrelated issue and there are various possible causes.

I have the blade forward to keep a tight mouth.

And this is the clue to the cause or part of the cause.
When doing anything other than smoothing — which should result in shavings of no more than a few thou — a tight mouth is actually detrimental to the function of a smoother2.
Additionally you may have an issue with the prep or the positioning of the cap iron/chipbreaker.
If you don't own another plane and need to use the Sargent for this

Position the frog fully back so the mouth is as open as it can be;

set the cap iron well back from the cutting edge;

ensure the bevel side of the iron is opposite to the cap iron (sorry had to mention this as occasionally newbies put them in upside down, so the bevel is facing the direction of travel);

adjust for a heavier cut;

and have at it. The performance difference should be stark.
Once you're down to a reasonably flat and smooth surface convert the plane back to smoothing settings before proceeding.

I would recommend leaving the frog where it is.

Set the cap iron fairly close to the edge (see previous link for some rough numbers) and see how it goes. If there are knots and/or other irregular grain you may need to set the iron very close to the edge, IF the goal is a tearout-free surface.

Adjust for a very very thin shaving initially and go heavier if it feels like this is possible.

If you do still get any clogging issues it's likely shavings getting jammed under or up against the cap iron, which means its leading edge needs to be fettled3.

Bonus material.
If you need to do this lots and you want to stick to one plane
It would be advisable to have a second iron (and ideally cap iron also4) set up specifically for rough work — i.e. with a cambered edge — that you can swap into your Sargent as needed.
If you're lucky enough to live somewhere where there are abundant secondhand tools I would suggest picking up a spare vintage iron for this. These can often be had for next to nothing if separate from a plane, or you can buy a basket case of no. 4 or 5 and just steal the iron from it. Do not sweat it if the iron is very rusty and even if quite heavily pitted.
If you want to or have to buy new, there are numerous sellers of new irons on AliExpress or eBay. If you still buy from Amazon they may have very similar stuff (possibly the exact same products from the same factories in China) but there may be a markup.

1 What we now call scrub planes weren't ubiquitous and possibly were only used for hogging off lots of excess material, e.g. to take down excess material from riven boards, which weren't merely rough but could be super rough and not at all flat.
2 In actual fact I would recommend that you don't rely on this, pretty much at all. Many many experienced plane jockeys set their frogs in the fully back position (this is, with the front face of the frog perfectly aligned with the rear edge of the mouth) and then literally never touch it again. See Mouth of a Plane for a bit more on this.
3 Just a quick thing on this, most guides suggest or state outright that this takes "just a couple of minutes" but they're either exaggerating or fibbing. In my experience it usually takes longer (although occasionally you do get lucky!) and sometimes takes MUCH longer; it all depends on the original shaping and condition of the cap iron you're dealing with (as well as the flatness of the forward part of the back of the cutting iron).
4 With a spare cap iron as well it makes the swap much faster as you can simply drop in the whole iron assembly, instead of having to take off your only cap iron to position it on the cutters each time you make the change.
Comment: Thank you so much. I do have a jack plane and jointer plane but haven't used them or set them up yet. Life got in the way.
Comment: Welcome! Is your jack also vintage and if so what condition is it it?
Comment: I have an an old Millers Falls No14c.

Getting dust with smoothing plane?


Categorical Variable and Target Variable

Question: Though a similar question is answered here , but I wanted to take a different approach. Assuming that I have a binary target variable 1/0 and a categorical variable Gender M/F. From this, I can have a proportion p1 for M with target 1 and p2 for F with target 1. N1 and N2 would be total number of M and F respectively.
Is it prudent to run a test for H0: p1=p2 ? If H0 cannot be rejected, doesn't it indicate that Gender doesn't have any correlation with Target
Comment: Is Gender the only explanatory variable you have? Or can it be used together with others?
Comment: Actually, I have a large number of binary Categorical Predictors. So for each Predictor, I want to try out this method with the target variable. Is there any gap in this theory ?
Comment: Yes, I think there is a gap. The point is, that not beeing able to identify a correlation between one of your features and the target doesn't mean there is no such relationship between a combination of your features and the target. Let's say your target states 1=obese 0=not obese and you have a second flag 0=weighs less then 70kg and 1=more than 70kg. Given this data it could be that (depending on the composition of your data) you would never reject H0 and thus reason, that your data doesn't allow you to decide on the target attribute.
Comment: But if you consider combinations of your attributes and look at your data with weight more than 70kg and gender=Female, clearly you still have a lot of data points which are normal, but you surely will have a higher ratio of data points which would have to be classified as obese. Btw I hope I don't upset somebody by that example, I think obesity starts much higher, but I wanted a border which is low enough so it would not be sufficient as a single attribute and still high enough so it splits of some of the non-obese people.
Answer: Reading from your comments, it appears you can use more that one predictor for your target variable.
If you want to understand whether Gender (M/F) has a significant association, you should run a logistic regression using it together with other predictors. This would let you control for the impact of Gender all things equal, i.e. after you controlled for the effects of other variables.
Logistic regression will return significant scores and standard errors for each variables.
Alternatively, you could look at relative importance scores from tree-based models such as Random Forest or XGBoost. (However, Logistic regression is better for hypothesis testing.)
BUT: If you still want to stick with bivariate statistics, i.e. using just one predictor at a time, you can use simpler tools such as T-test or one-way ANOVA to understand whether belonging to one gender or the other makes a difference (statistically speaking).
Hope this helps, otherwise let me know.
Comment: Let me elaborate with another example. I am working with the Autombile Dataset [here](https://archive.ics.uci.edu/ml/datasets/automobile). I'm trying a linear regression approach. Using the statsmodels.api library I can get the significance of the numerical variables. However, how to assess the significance of the Categorical Variables ? A 5 level categorical variable becomes 4 Dummy Variables after Label Encoding. How to assess the overall significance of the variable.


Is the polarization of light changed by gravity?

Question: The Gravitational_redshift shows, that the wavelength of light gets altered in a gravitational field. But what about polarization of light? I imagine that e.g. by tidal forces circular polarized light could get deformed into elliptic polarized light. Is this possible? Or is polarization of light an invariant quantity in a gravitational field?
Comment: Intuitively I would think that depends on the gradient of the field. For today's objects it would probably require some rather low wavelengths to find a measurable effect.
Answer: Fermi transport will be the equations that describe how each polarisation component changes direction, as the ray passes through the gravitational field (or rather, curved spacetime). So for circular polarisation to become eliptical, you need to check whether othogonal components cease to be orthogonal (when Fermi-Walker transported along an arbitrary trajectory). It turns out that inner products are preserved (so the angle of polarisation may be altered depending on the trajectory through space-time, but the ellipticity shouldn't change in vacuum). However, this assumes the short-wavelength (ray-optics) limit, so you might get a more complex answer by considering extremely low frequencies.


Imapsync doesn't sync unicode characters properly

Question: I am using imapsync to migrate my e-mail account from a CPanel (courier) mailserver to a Debian/Dovecot one. The issue I am facing has to do with some folders that contain Unicode characters. For example a mailbox folder containing Greek characters ιs migrated as INBOX.&A5QDtQO7A8QDrwOx- &A6QDzQPAA78DxQ-. Does anybody hava a solution on this?
Answer: String "INBOX.&A5QDtQO7A8QDrwOx- &A6QDzQPAA78DxQ-"
is the correct IMAP foldername code to represent
something a more friendly email software could represent as
"INBOX.Δελτία Τύπου"
So first, you should check both mailboxes at host1 and host2 from the same email client,
it is possible that what you consider an issue is not one at all.
Second, if this is really an issue then this issue could come
from Dovecot not allowing some utf-8 characters encoded in utf7_imap.
To be sure of that just try to create the folder in Dovecot by hand
and if it works, folder created, look at how imapsync displays it.
To solve this issue, in case there is an issue, you may try to rename
folders to an encoding more friendly with Dovecot with the help of
imapsync option --regextrans2
To change "&A5QDtQO7A8QDrwOx- &A6QDzQPAA78DxQ-" to "Press Releases"
imapsync ... --regextrans2 "s/&A5QDtQO7A8QDrwOx- &A6QDzQPAA78DxQ-/Press Releases/"

To help finding what actual folder name corresponds to an utf7_imap code,
the imapsync tarball contains a script called imap_utf7.
Here is an example of its usage:
echo "INBOX.&A5QDtQO7A8QDrwOx- &A6QDzQPAA78DxQ-"  | ./W/learn/imap_utf7
INBOX.Δελτία Τύπου

(I wrote imapsync)
Answer: Maybe you should try one of the tools dovecot suggests itself.
Take a look at this perl script or the build in migration tool named dsync.
Comment: Thanks. Unfortunately Ι have the same issues with both the perl script and dsync


Is there a context-free grammar for $L = \{a^{2^n}| n \geq 1\}$?

Question: I was trying to find a cf-grammar for $L = \{a^{2^n}| n \geq 1\}$ but I cannot seem to find one. Is there a cf-grammar or does it not exist because of the quadratic-exponent?
Answer: It's a more or less standard result that the language in question isn't  context-free, so the answer to your question is no. The same holds for a number of similar languages, like
$$
L_1= \{a^{n^2} \mid n\ge 0\}\quad\text{and}\quad L_2=\{a^p\mid p\text{ is prime}\}
$$
There's a nice property that can be useful in cases like this: any context-free language over a one-symbol alphabet is regular. This, combined with a characterization of regular languages over a unary alphabet implies that languages like the ones above cannot be context-free since they're too "sparse".


2.3.5 Authorize.net issue

Question: Trying to complete my 2.3.5 site and need to add my Authorize.net configuration. I see no place to accept credit cards under the "Payment Methods". We are setup with Auhtorize.net and also use it on our 1.9 site. However on 2.3.5 it is "Deprecated". How else can we utilize Authorize.net and configure it. After all this has no way of being able to accept credit cards
Answer: You can install the official Authorize.net plugin from the Magento Marketplace website.  It may not work in Magento 2.4 (not tested) but will work in Magento 2.3.5
https://marketplace.magento.com/authorizenet-magento-module-authorizenet.html

2.3.5 Authorize.net issue


Is $2^n = p \cdot m$ solvable?

Question: When I divide the scale between 0 and 1 continuously in halfs, are then all rational numbers (<1) covered? I.e. can every rational number $p/q  (p<q)$  be written as $m/2^n$ for some $m,n \in \mathbb{N}$?
Answer: No. For example, $1/3$ cannot be so written. Suppose that $\dfrac13 = \dfrac{m}{2^n}$  for some integers $m$ and $n$; then $3m=2^n$. But $2^n$ is not divisible by $3$ for any $n$.
The numbers that can be written in the form $\dfrac{m}{2^n}$ are called dyadic rationals.
Answer: HINT $\ $ The lowest terms representation of a fraction is unique. In lowest terms, your dyadic fractions have denominator of form $\rm\:2^n\:.\:$ But there are lowest term fractions not of that form.

Is $2^n = p \cdot m$ solvable?


Is "lingua Latina studenda pergit" grammatical?

Question: I want to say "people continue to study Latin", and I came up with lingua Latina studenda pergit.
Is such a combination gerundive and pergere grammatical?
It must be understandable, but I do not recall ever seeing it used or discussed.
Another option would be lingua Latina studeri pergit, but I want to know if the gerundive works, too.
Comment: It's hard to prove a negative, but I don't think I've ever seen a gerundive construction (as distinct from a future passive participle) used in the nominative.
Answer: I don't think so. First, are you sure that pergit can be used in this sense? I would use pergo to indicate a sense of progression, and I would have an agent in mind as its subject, someone who continues to move in a certain direction. Perhaps permanet or perstat would fit?
As to the gerundive construction, i.e. a gerundive that is used dominantly, I believe it cannot be used in the nominative, nor in the accusative without a preposition. The same applies a to gerunds, mutatis mutandis. In its non-dominant use, a gerundive has a sense of obligation or prediction, which, as you say, is not what we want in this example: "the Latin language continues to be compulsory to be studied"; or as an ablative: "it continues while studying the Latin language".
But the passivity of the gerund is also problematic here, because studeo is normally intransitive: it goes with the dative and cannot normally be passivised with a subject. A gerundive is also passive, but studendus and linga Latina could not agree in case. Then what would the gerundive agree with?
In the nominative, one would use a simple noun or an infinitive rather than a gerundive, to express "doing something" as a subject or direct object. In this case, a noun comes first to mind:

Studium lingae Latinae permanet.

An infinitive is possible in theory:

? Studere linguae Latinae permanet.

Somehow, I don't like this very much, but it's hard to explain why not. Perhaps verbs that mean "continue" are not often used with infinitive constructions? At least I don't think permanet is constructed with an infinitive; and perstat with an infinitive means something else, as does pergit.

Linguae Latinae adhuc studemus / semper studebimus.

This has a slightly different meaning, but it could be appropriate.
Comment: I think the problem with *?Studere linguae Latinae permanet* is that infinitive subjects rarely take any verb other than *esse* and its compounds.
Comment: @TKR: Hmm you may be right; I can't think of any counter-examples. But how about as a subject complement?: *? lingua Latina permanet legi*. I don't think that works either. That construction only works with copulae, I suppose, and *permaneo* isn't a proper copula.
Comment: I think you're right -- that doesn't sound correct to me either. The issue there seems to be that *permaneo* doesn't take an infinitive complement, active or passive.
Comment: @TKR: Yes, I think so too. And, while some other verbs do take an infinitive as a complement, like *persto*, it won't be in the proper thematic role.
Comment: Thanks! I mistook *studere* for a transitive verb. It's good to have this misconception corrected, but the main question is about using gerundive with *pergere*. I have seen *pergere* with infinitive to mean "to continue to do something", and my dictionary also gives this use. You have convinced me that I shouldn't use gerundive even if I change to a transitive verb.
Answer: I'll expand this later (I'm on my phone), but I'd offer Etiamnunc linguae Latinae studetur. ("People are still studying Latin," or, more literally, "Study is still given to Latin.")
Comment: I would like that, but I've tried to find passive finite forms of *studeo* in the HP corpus, and there are hardly any.  *Studetur* gives one result, from Iustianiaus, and *studentur* zero results. The word doesn't seem to be used in the passive in the classical age? Still, I think you can make a case for it, as a late form.
Comment: @Cerberus Yeah, my position on such matters seems to be in a state of constant flux, but at the moment I don't find a lack of attestation in such a case persuasive as a guide to modern usage.


DHCP dora process on L2

Question: can you explain in DHCP dora process
how discover ,offer, request and ack massages send on L2 ? i know all 4 massages will be broadcast on L3 but on L2 how they will transfer (unicast or broadcast)
Comment: Google is your friend
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: DHCP works in a client / server model. See this packet capture for reference: https://www.cloudshark.org/captures/c109b95db0af
The client encapsulates the Discover message in Ethernet II and transmits it via the MAC address FF:FF:FF:FF:FF:FF (L2 broadcast).
The DHCP server receives the client request and it will reply with an Offer using the source MAC address located on the Discover message (L2 unicast).
Based on this packet capture the client sends the DHCP Discover and Request messages as L2 broadcast. The DHCP server uses L2 unicast.
Note: The client sends the Request message as a broadcast even though it should know the mac address of the DHCP server after it received the Offer. The client should have an entry on it's ARP table. I think this behavior depends on the client OS but I'm not 100% sure on this.
Comment: The DHCP request is sent as broadcast to inform other DHCP servers with outstanding offers to the same client/MAC to withdraw their offer.
Answer: ARP (Address Resolution Protocol) is what is used to resolve a layer-3 address to a layer-2 address. The ARP process for a host will send out an ARP request to get the layer-2 address for a layer-3 address. When you have a layer-3 broadcast address, that will not work because no host will claim the layer-3 broadcast address. That means that when you broadcast at layer-3, you must broadcast at layer-2 because it is not possible to resolve a layer-3 broadcast address to a layer-2 unicast address.
Having said that, there are variation of DHCP where only some of the DHCP messages are broadcast. Unfortunately, protocols above OSI layer-4, e.g. DHCP, are explicitly off-topic here.

DHCP dora process on L2


Rocket fuel consumption

Question: Consider a velocity change $dV$ for a rocket accelerated by an on-board thruster. Is the total amount of fuel consumed proportional to $dV$, or to $dE$, where $dE$ is the change in kinetic energy, or to some other measure, and if so, which measure?
Comment: what's with the immediate -1 score?
Comment: Some users seem to go through and down-vote questions they just don't like for some reason. I don't get it either.
Answer: For this question you should consider the rocket equation:
$$v(t)-v_0 = u \ln \left ( \frac{M_0}{M(t)} \right ) - gt$$
where $v_0$ and $M_0$ are the initial speed and mass, $v(t)$ and $M(t)$ are the speed and mass after a time $t$ and $u$ is the exhaust velocity relative  to the rocket body. You can ignore the $-gt$ term if you are, for example, in outer space.
Rearranging for $M(t)$, you get
$$M(t) = M_0 \ e^{-\frac{dv+gt}{u}}$$
After a time $t$, the mass $dm$ of fuel consumed is then
$$dm = M_0 \left ( 1 - e^{-\frac{dv+gt}{u}} \right ) = M \left ( 1 - e^{\frac{dv+gt}{u}} \right )$$
I hope this answers your question.

Rocket fuel consumption


Coloring backgorund of richtextbox line in C#

Question:
I'm trying to color a specific line's background in a RichTextBox.
I need the line's background to be colored all the way to the end of the right side of the control.
I tried using the SelectionBackColor property, but it colors only until the end of the line.
Does anybody know of a way to do this?
thanks :)
Comment: Did you find a way to do this?  Thanks.
Answer: mmm, I believe you cannot do it without some custom painting, because as you said, with RTF formatting you format text so if you do not have text ( chars or white spaces or tabs... ) you cannot reach those parts of the control which are completely empty, unless you do change the whole control background color...
Answer: Bit messy, but if you don't want to go ahead with custom painting the control. You could make the textbox transparent, then add an image behind the control which has the line selected. You could then change the Image.Location.Y value on the TextChanged event.
Answer: Customizing the stock Windows rich text control is possible, but they didn't make it easy. If I were you, I would do what I did: Purchase a better text control.


Hibernate lazy loading in detached objects

Question: I have created a class in which I have set some of it's fields (other entities) to be LAZY loaded. Now I need to use this object after it has been detached from the session, so I obviously need to make sure all the fields that I need are populated before detaching it. I tried just calling the getters to these lazy fields but that didn't seem to work. Anyone have an idea how to force these fields to be loaded?
Comment: are you sure your session is open while calling getters  ?
Comment: Session if definitely open when I call the getters
Answer: Hibernate.initialize(yourObject)

will force-initialize the object/collection that is passed to it. You need an active session for this.
If the entity is detached, you'd have to re-attach the object (using merge(..)) to an active session and then initialize it.
Comment: Hibernate.initialize is not transitive I believe. So if your object has a lazy collection or lazy field, you need to do Hibernate.initialize(object.getLazyField()) or .initialize(object.getLazyCollection())
Comment: `merge` is just for some very special cases. As a rule of a thumb I'd recomment `update`
Comment: @pakore - well, the difference I think is that `merge(..)` can insert a new record as well. But I'm more used to the JPA semantics, so it might be a bit different here.
Answer: You can reattach it to the session. This is the normal way.
session.update(yourObject); //This reattachs the object to the current session.
yourObject.someGetter(); //This will work now.

Answer: <prop key="hibernate.enable_lazy_load_no_trans">true</prop>

you can add this line into your configuration file,it can fetch your lazy objects even it is detached,but it should be use post 4.1.7 version as there are some connection leakage issue with previous version.see  here
Answer: I know that you asked for Hibernate but EclipseLink has this feature so it might be worth checking out if you are using JPA and not tied to a given implementation. You might run into other problems migrating to EclipseLink though..


Undo/Redo implementation

Question: Give me some thoughts how to implement undo/redo functionality - like we have in text editors.
What algorithms should I use and what I may read. thanks.
Comment: Maybe add some more detail about the area your software is working in (text processing? Graphics? Database?) and possibly platforms / programming languages.
Answer: I know about two major divisions of the types of undo's

SAVE STATE:
One category of undo is where you actually save history states. In this case what happens is that at every point you keep on saving the state in some location of memory. When you want to do an undo, you just swap out the current state and swap in the state which was already there in the memory. This is how it is done with History in Adobe Photoshop or reopening closed tabs in Google Chrome, for example.

GENERATE STATE:
The other category is where instead of maintaining the states themselves, you just remember what the actions were. when you need to undo, you need to do a logical reverse of that particular action. For a simple example, when you do a Ctrl+B in some text editor that supports undo's, it is remembered as a Bold action. Now with each action is a mapping of its logical reverses. So, when you do a Ctrl+Z, it looks up from a inverse actions table and finds that the undo action is a Ctrl+B again. That is performed and you get your previous state. So, here your previous state was not stored in memory but generated when you needed it.

For text editors, generating the state this way is not too computation intensive but for programs like Adobe Photoshop, it might be too computationally intensive or just plain impossible. For example - for a Blur action, you will specify a de-Blur action, but that can never get you to the original state because the data is already lost. So, depending on the situation - possibility of a logical inverse action and the feasibility of it, you need to choose between these two broad categories, and then implement them the way you want. Ofcourse, it is possible to have a hybrid strategy that works for you.
Also, sometimes, like in Gmail, a time limited undo is possible because the action (sending the mail) is never done in the first place. So, you are not "undo"ing there, you are just "not doing" the action itself.
Comment: Sometimes it may be helpful to keep a mixture of save states and "forward" actions.  As a simple approach, if one kept a "major save state" every 5 actions, and also kept save states after the last "major save state", one could do the first few undo operations by reverting save states, and one could do the next undo by repeating 4 actions from the previous major save.  A somewhat more general approach would be to use a power-of-two progression for different levels of save state, thus requiring storage of lg(N) save states for N-level undo, using O(1) forward iterations.
Comment: The answer should add this hybrid approach too. This is very feasible where undoing by generating previous state is too complex and the data being edited is too large. A balance between the two. One can adopt many strategies instead of a fixed 4-length or power-of-2 length progression. Like save state whenever generating previous state is too complex.
Answer: I have written two text editors from scratch, and they both employ a very primitive form of undo/redo functionality. By "primitive", I mean that the functionality was very easy to implement, but that it is uneconomical in very large files (say >> 10 MB). However, the system is very flexible; for instance, it supports unlimited levels of undo.
Basically, I define a structure like
type
  TUndoDataItem = record
    text: /array of/ string;
    selBegin: integer;
    selEnd: integer;
    scrollPos: TPoint;
  end;

and then define an array
var
  UndoData: array of TUndoDataItem;

Then each member of this array specifies a saved state of the text. Now, on each edit of the text (character key down, backspace down, delete key down, cut/paste, selection moved by mouse etc.), I (re)start a timer of (say) one second. When triggered, the timer saves the current state as a new member of the UndoData array.
On undo (Ctrl+Z), I restore the editor to the state UndoData[UndoLevel - 1] and decrease the UndoLevel by one. By default, UndoLevel is equal to the index of the last member of the UndoData array. On redo (Ctrl+Y or Shift+Ctrl+Z), I restore the editor to the state UndoData[UndoLevel + 1] and increase the UndoLevel by one. Of course, if the edit timer is triggered when UndoLevel is not equal to the length (minus one) of the UndoData array, I clear all items of this array after UndoLevel, as is common on the Microsoft Windows platform (but Emacs is better, if I recall correctly -- the disadvantage of the Microsoft Windows approach is that, if you undo a lot of changes and then accidentally edit the buffer, the previous content (that was undid) is permanently lost). You might want to skip this reduction of the array.
In a different type of program, for instance, an image editor, the same technique can be applied, but, of course, with a completely different UndoDataItem structure. A more advanced approach, which does not require as much memory, is to save only the changes between the undo levels (that is, instead of saving "alpha\nbeta\gamma" and "alpha\nbeta\ngamma\ndelta", you could save "alpha\nbeta\ngamma" and "ADD \ndelta", if you see what I mean). In very large files where each change is small compared to the file size, this will greatly decrease the memory usage of the undo data, but it is trickier to implement, and possibly more error-prone.
Answer: There are several ways to do this, but you could start looking at the Command pattern. Use a list of commands to move back (Undo) or forward (redo) through your actions. An example in C# can be found here.
Answer: My only two cents is that you would want to use two stacks to keep track of the operations. Every time the user performs some operations, your program should put those operations on a "performed" stack. When user want to undo those operations, simply pop operations from the "performed" stack to a "recall" stack. When user wants to redo those operations, pop items from "recall" stack and push them back to "performed" stack.
Hope it helps.
Answer: A bit late, but here goes: You specifically refer to text editors, what follow explains an algorithm that can be adapted to whatever it is you are editing. The principle involved is to keep a list of actions/instructions that can be automated to recreate each change you made. Do not make changes to the original file (if not empty), keep it as a back-up.
Keep a forward-backward linked-list of changes you make to the original file. This list is saved intermittently to a temporary file, until the user actually Saves the changes: when this happens you apply the changes to a new file, copying the old one and simultaneously applying the changes; then rename the original file to a backup, and change the new file's name to the correct name. (You can either keep the saved change-list, or delete it and replace with a subsequent list of changes.)
Each node in the linked-list contain the following info:.

type of change: you either insert data, or you delete data: to "change" data means a delete followed by an insert
position in file: can be an offset or line/column-pair
data buffer: this is the data involved with the action; if insert it is the data that was inserted; if delete, the data that was deleted.

To implement Undo, you work backward from the tail of the linked-list, using a 'current-node' pointer or index: where the change was insert, you do a delete but without updating the linked-list; and where it was a delete you insert the data from the data in the linked-list buffer. Do this for each 'Undo'-command from the user. Redo moves the 'current-node' pointer forward and executes the change as per the node. Should the user make a change to the code after undoing, delete all nodes after the'current-node' indicator to the tail, and set tail equal to the 'current-node' indicator. The user's new changes are then inserted after the tail. And that's about it.
Answer: One way to implement a basic undo/redo feature is to use both the memento and command design patterns.
Memento aims at keeping the state of an object to be restored later for example.
This memento should be as small as possible in an optimisation purpose.
The command pattern encapsulates in an object (a command) some instructions to execute when required.
Based on these two concepts you can write a basic undo/redo history, like the following one coded in TypeScript (extracted and adapted from the front-end library Interacto).
Such a history relies on two stacks:

the stack for objects that can be undone
the stack for objects that can be redone

Comments are provided within the algorithm. Just note that on an undo operation, the redo stack must be cleared! The reason is to let the application in a stable state: if you go back in past to redo some actions you made, your former actions will not exist any more as you change the future.
    export class UndoHistory {
        /** The undoable objects. */
        private readonly undos: Array<Undoable>;

        /** The redoable objects. */
        private readonly redos: Array<Undoable>;

        /** The maximal number of undo. */
        private sizeMax: number;

        public constructor() {
            this.sizeMax = 0;
            this.undos = [];
            this.redos = [];
            this.sizeMax = 30;
        }

        /** Adds an undoable object to the collector. */
        public add(undoable: Undoable): void {
            if (this.sizeMax > 0) {
                // Cleaning the oldest undoable object
                if (this.undos.length === this.sizeMax) {
                    this.undos.shift();
                }

                this.undos.push(undoable);
                // You must clear the redo stack!
                this.clearRedo();
            }
        }

        private clearRedo(): void {
            if (this.redos.length > 0) {
                this.redos.length = 0;
            }
        }

        /** Undoes the last undoable object. */
        public undo(): void {
            const undoable = this.undos.pop();
            if (undoable !== undefined) {
                undoable.undo();
                this.redos.push(undoable);
            }
        }

        /** Redoes the last undoable object. */
        public redo(): void {
            const undoable = this.redos.pop();
            if (undoable !== undefined) {
                undoable.redo();
                this.undos.push(undoable);
            }
        }
    }

The Undoable interface is quite simple:
    export interface Undoable {
        /** Undoes the command */
        undo(): void;
        /** Redoes the undone command */
        redo(): void;
    }

You can now write undoable commands that operate on your application.
For example (still based on Interacto examples), you can write a command like this one:
    export class ClearTextCmd implements Undoable {
       // The memento that saves the previous state of the text data
       private memento: string;

       public constructor(private text: TextData) {}

       // Executes the command
       public execute() void {
         // Creating the memento
         this.memento = this.text.text;
         // Applying the changes (in many
         // cases do and redo are similar, but the memento creation)
         redo();
       }

       public undo(): void {
         this.text.text = this.memento;
       }

       public redo(): void {
         this.text.text = '';
       }
    }

You can now execute and add the command to the UndoHistory instance:
    const cmd = new ClearTextCmd(...);
    //...
    undoHistory.add(cmd);

Finally, you can bind an undo button (or a shortcut) to this history (same thing for redo).
Such examples are detailed on the Interacto documentation page.
Edit:
Note that there exists several undo/redo algorithms.
I detailed the classic linear one.
For code editors, researchers proposed the 'selective undo algorithm' (research article) ("Supporting Selective Undo in a Code Editor", Yoon et al.).
Undo/redo algorithms for collaborative editing are also specific (research article) ("A framework for undoing actions in collaborative systems", Prakash et al.).
Comment: @Noman_1 I do not think so. It is a Last-In-First-Out (a stack). Since we push into the Array, we have to pop the last element to use the array as a stack (while `shift` removes the head).
Comment: If you add a new element and we have a too big stack, you want to remove the oldest one, the one that would require 51 undos to be used. That is the first of the list, the oldest. Im talking about the case: if (this.undos.length === this.sizeMax)
Comment: @Noman_1 Indeed! I did not look at the this block. I fixed my answer. Thanks
Comment: Wouldn't it be "this.undos.shift();" instread of "pop()" on UndoHistory.add?
Comment: The link in "Undo/redo algorithms for collaborative editing are also specific (research article)." is dead. Please give titles, year and author of the articles so one may at least Google them.
Answer: The Memento pattern was made for this.
Before implementing this yourself, note that this is quite common, and code already exist - For example, if you're coding in .Net, you can use IEditableObject, and in the javascript world, you can use immutable libraries like immer.js.
Answer: If the actions are reversible. e.g Adding 1, make a player move etc see  how to use the Command Pattern to implement undo/redo. Follow the link the you will find a detailed examples on how to do that.
If not, use Saved State as explained by @Lazer.
Answer: You may study an example of an existing undo/redo framework, the first Google hit is on codeplex (for .NET). I don't know if that is better or worse than any other framework, there are lots of them.
If your goal is to have undo/redo functionality in your application you might as well just pick an existing framework that looks suitable to your kind of application.
If you want to learn how to build your own undo/redo you can download the source code and have a look at both patterns and the details how to wire things up.

Undo/Redo implementation