Neutralizing TCA washes

Question: Trichloroacetic Acid (TCA) is commonly used for protein precipitation but the wash waste needs to be neutralized prior to disposal. What exactly is required to effectively neutralize TCA waste? Do I just add caustic?
Comment: You might want to add a bit here to establish the biological relevance, as it is now this is a pure chemistry question.
Comment: How can I migrate this question?
Answer: A neutralization reaction occurs between Brönsted acids and bases to form a salt.
In this case, you have to add a Brönsted base to neutralize your acid. If the final pH is important, you should work out the exact quantity of base to add. Otherwise, just use litmus paper to check the pH of your solution, and add base until it's neutral.
EDIT
In view of the other answer proposed, I want to stress the following:
Do NOT dispose of your solution in the sink/sewer. Leave it in its plastic bin until a lab technician takes it to the furnace.
If the base you use is sodium bicarbonate (NaHCO3), there will be bubbling, caused by the decomposition of carbonic acid (H2CO3) into water (H2O) and carbon dioxide (CO2). You've successfully neutralized the TCA once there's no bubbling upon addition of NaHCO3.
It is indeed best to proceed slowly while adding your base.
Answer: I've been fortunate to find a protocol hidden away in my lab archives.

The acid waste can be accumulated for 10 days before it needs to be neutralized. The waste should be kept in a carboy in a fume hood.
50 mL 50% w/v Sodium Bicarbonate slurry should be added per liter of TCA waste. During neutralization fumes will be generated which may include chlorine gas.
When the pH reaches 6-8, dispose the waste into the sewer.
Comment: From the MSDS for TCA, it states to neutralize with sodium bicarbonate so as to prevent Cl2 gas formation (like with neutralization with HCl).
Comment: I know what the structure of TCA is, which is exactly _why_ I'm asking you how you think Cl2 will be generated?
Comment: Why did this get 2 downvotes? Is it incorrect? Why is it accepted instead of the other, much higher scoring answer?
Comment: I accepted it since I was the one who asked the question and wrote the answer. It was downvoted since someone decided that it was "unsafe" despite the fact that this is actually the EH&S determined protocol. There needs to be better comment history on SE.
Comment: -1. Unless a proper citation is given, I see no reason why trichloroacetic acid would produce chlorine gas in the absence of an oxidising agent.

Neutralizing TCA washes


What is the best, worst and average case running times of an algorithm?

Question: What is the best, worst and average case running times of an algorithm?
Comment: I removed "operating-systems" tag, since it does nothing with the question.
Comment: Yes...but I couldn't find a perfect answer
Comment: I'm voting to close this question because it's off-topic here. This is not really a programming issue, but a theoretical computer science question, so it should have been asked on Computer Science Stack Exchange.
Answer: In the simplest terms, for a problem where the input size is n:

Best case = fastest time to complete, with optimal inputs chosen.
For example, the best case for a sorting algorithm would be data that's already sorted.
Worst case = slowest time to complete, with pessimal inputs chosen.
For example, the worst case for a sorting algorithm might be data that's sorted in reverse order (but it depends on the particular algorithm).
Average case = arithmetic mean.  Run the algorithm many times, using many different inputs of size n that come from some distribution that generates these inputs (in the simplest case, all the possible inputs are equally likely), compute the total running time (by adding the individual times), and divide by the number of trials.  You may also need to normalize the results based on the size of the input sets.

Complexity and running time are often expressed in "Big O notation," which is used to describe the approximate amount of time an algorithm requires to complete, based the size of its input.  Rob Bell wrote an excellent overview with very clear examples.
The most commonly used Big O descriptions are

O(1) always terminates in about the same amount of time, regardless of the input size.
O(logN) takes a fixed additional amount of time each time the input size doubles.
O(N) takes twice as long to finish if the input size doubles.
O(N2) takes four times as long if the input size doubles.
O(2N) increases exponentially as the input size increases.

You can see from the table below that the difference is small for small input sizes, but it can become tremendous as the input size increases even a little bit.

Input Size              Time to Complete
               O(1)  O(logN)   O(N)   O(N2)   O(2N)
     1           1       1      1       1       1
     2           1       2      2       4       4
     4           1       3      4      16      16
     8           1       4      8      64     256
    16           1       5     16     254   65536
Comment: And wrong. First, all three are w.r.t a fixed input size `n`. Otherwise, "worst" or "best" might not be well defined. Secondly, average case means to take the average over *all* inputs (of this given size), weighted with some probability distribution (typically uniform).
Comment: It is also important to note that best-case or worst-case has nothing to do with the input size. It has to do with the nature of the input. E.g. whether the list is already sorted.
Answer: Worst Case Analysis (Usually Done)
In the worst case analysis, we calculate upper bound on running time of an algorithm. We must know the case that causes maximum number of operations to be executed. For Linear Search, the worst case happens when the element to be searched (x in the above code) is not present in the array. When x is not present, the search() functions compares it with all the elements of arr[] one by one. Therefore, the worst case time complexity of linear search would be Θ(n).
Average Case Analysis (Sometimes done)
In average case analysis, we take all possible inputs and calculate computing time for all of the inputs. Sum all the calculated values and divide the sum by total number of inputs. We must know (or predict) distribution of cases. For the linear search problem, let us assume that all cases are uniformly distributed (including the case of x not being present in array). So we sum all the cases and divide the sum by (n+1). Following is the value of average case time complexity.
Best Case Analysis (Bogus)
In the best case analysis, we calculate lower bound on running time of an algorithm. We must know the case that causes minimum number of operations to be executed. In the linear search problem, the best case occurs when x is present at the first location. The number of operations in the best case is constant (not dependent on n). So time complexity in the best case would be Θ(1)
Comment: Source - https://www.geeksforgeeks.org/analysis-of-algorithms-set-2-asymptotic-analysis/
Answer: Think of an algorithm as a program.  This program takes some data, churns on it for a while, and then spits out an answer.  Of course, we care about how long the program churns on the data before giving the answer.
But there's a catch: for many algorithms, running time depends on the data itself.  Many sorting algorithms are faster for already-sorted data, for instance, and some are slowest for data that's sorted in reverse order.
So let's think about where that data comes from.  Maybe your best friend gets to pick the data.  Your friend picks data that causes your program to run quickly, and we call that runtime the best case, since the algorithm will never do better than that.  Maybe your worst enemy (in textbooks, this is called the adversary) gets to pick the data.  Your worst enemy picks data that causes your program to run slowly, and we call that runtime the worst case because the algorithm will never do worse than that.  And maybe a giant roulette wheel gets to pick your data.  Then, you can run your algorithm on a bunch of roulette wheel data, and average all the runtimes to get the average case time.
Comment: :::::...thnnks for the answer & helping me :)
Answer: The best time would be like if something is already sorted, then no work needs to be done.
The worst case (depends on your algorithm) but think about what would cause your algorithm to take the longest amount of time.
Answer: The running time of an algorithm depends on the size and "complexity" of the input.
For example the best case running time of insertion sort on an input of some size n is proportional to n, i.e. c * n time units for some constant c which depends on the cost (time) of comparison, arithmetic, ... of your computing model. The worst case running time of this algorithm (insertion sort) is proportional to n * n. To make a statement for the average time we need some assumption on the distribution of the input data: E.g. if the input is random data (and therefore likely not sorted) the average running time is again proportional to n*n.
If you know more about the input data, e.g. that it is sorted with decreasing values (and we are sorting with increasing values) the average running time is stille proportinal to n*n, but the constant factor is higher (because the average searching time for the minimum (which will be inserted at the end of the sorted sub-list) takes longer).
Another, more complex example is quicksort: Its average and best running time for random data is proportional to n * log n. The worst caste time is still n * n (often for an already sorted input, but this depends on the algorithm to find the pivot element in the divide step).
Answer: worst case is generally denoted by asymptotic notation i.e big(O)
best case is denoted by asymptotic notation i.e big(OMEGA)


How to convert a wav to mp3 in audacity

Question: I am trying to export a wav format file to an mp3 format in audacity, but when it's done exporting all that is does is make this screaching sound for about two seconds and then there is no sound at all. I have learned so much from frequent use of this site, thank you in advance for all of your help.
Answer: Follow the below steps:

Open Audacity and import your WAV file by clicking the "File" menu, go to "Import" and select "Audio.". Wait a couple of seconds
for your file to load. Once you see the sound waves appear in the
editing window, your WAV is ready to convert.
Export the WAV to MP3. Go back to the "File" menu and select "Export". When the export window opens, Click "Save as type" from
the drop-down menu and choose "MP3 Files."
Rename your file now if you like. Then click the "Save" button.
Enter any metadata you wish to add. You will find fields for song and album titles, file dates, artist names, and other notes you
may like to associate with your file.
Wait for the exporting process to finish. Once the green bar has reached 100%, you may test the MP3 file using your favorite media
player.
Comment: The green bar (it's a progress bar indicating the duration of the convert process) should appear after pressing OK in the Edit metadata dialog box. I have tested now and it appears. The color might differ based on the theme installed on your system. Mine is blue
Comment: I don't see a green bar.
Comment: @ cioby23, Ardour is the program that I am exporting from, so I have had to export using "raw data" which is what Audacity states in an error message. Is there a setting where I can see the green bar?

How to convert a wav to mp3 in audacity


Terminology for Note Hold/Released Fractions in Rhythm?

Question: I'm trying to figure out what (Western musical) terms are most accurate to use in documentation I am writing for an electronic music file format. In these formats there is a parameter that specifies the portion of a note's specified duration (which more often than not directly connect one to the next) the note should play before the music engine automatically transitions the envelope to release phase. The best real world analog I can think of for this would be playing a piano legato, with part of the time taken up by gaps while fingers move to the next key.
Comment: Not musical terms, but maybe this is well described by the technical terms [_duty cycle_](https://en.wikipedia.org/wiki/Duty_cycle) and (equivalently) _mark-space ratio_?
Comment: I found a wikipedia site about envelope ADSR, maybe check that. (Attack, Decay, Sustain, Release).
Answer: There is no such term in music language, because the parameter, as you describe it, is not how the musicians think about music.
Some sources say that e.g. staccato means playing the note for e.g. half of its duration, but this is really inaccurate. For example, a passage consisting of staccato eighth notes and quarter notes, the quarter notes rather not be played twice longer than the eighth notes. They would rather all be sounding for a similar short time.
Legato refers to how the note connects to the next one, and I see it used it music software. E.g. legato quantization typically means "extend the end of the note up to the start of the next one". Legato overlap means extending note beyond the start of the next one (typically expressed in absolute time units, not percentage). Legato note followed by a pause doesn't really make sense. However, I could see stretching the definition in your particular software to say "100% legato" means playing the note for its full notated duration.
The general term articulation doesn't seem appropriate, because articulation may also refer to accenting or playing techniques unrelated to the note lengths.
In MIDI, a very close term is are event/note length/duration. At the event start, the Attack phase begins, at the event end, the Release phase begins. In MIDI, the value is given in absolute time units but I could imagine it could be presented as a percentage of the time of the written note, e.g. "50% note length means it sounds for half of its notated duration". Still it feels a bit like a technical term.
Answer: There is no standard term for this parameter in classical music theory.  If I were you I would make one up, perhaps "sustain duration" or "sustain ratio," depending on whether it is specified in units of time or as a fraction of the nominal note duration.  This term, however, has the problem of seeming to refer to the ADSR envelope while possibly leading some users into thinking that it does not include the attack and decay portions.
To get away from envelope terminology you might prefer to make something up from less technical terms, such as the "sounding portion" of the note.  Again, you might use "sounding duration" or "sounding ratio" depending on how you specify it.  If "sounding" is too old fashioned or fussy for your taste, the simpler "on" and "off" might work, or maybe "hold ratio" as in "hold the note for half (or 3/4, or whatever) its notated length."
If you have time for some research, you can see whether other theorists have adopted terms for this, as suggested by Aaron in a comment, and decide whether you wish to adopt the same terms.  If you do, please post an answer.
Answer: The terms you're looking for are

staccatissimo: the most detached (i.e., shortest sounding duration)
staccato:  detached
portato: detached, but not as markedly so as staccato
tenuto: as much of the duration as possible, but short of legato
legato: smooth connection note to note

These terms are relative (to each other) and do not have mathematical definitions. Some music software makes the proportions user-settable.
There is also legatissimo, which is infrequently used, but equates to "as legato as possible" or "the most legato".
Comment: Are there terms for the two fractions of time (as opposed to the relative lengths of them)?
Comment: @user94097 You mean the sounding and non-sounding parts of a particular note articulation? No. It's possible that some theorist(s) published paper(s) in which they adopted terms for those designations, but they would be specific to the writer rather than being in general use.
Answer: Adding to Aaron's answer - staccato - generally the note is held for approximately 1/2 of its written value. So staccato crotchet will be held for a quaver, followed by a quaver silence.
Staccatissimo will last for about 1/4 of its written value.
Portato will mean no gaps between - oddly the word itself can mean 'half-staccato.
Tenuto is given its full value, in some circumstances a touch more.
Legato will have a smooth connection between notes, rather like words when we speak, 'all in one breath'.
Mezzo-staccato, meaning a note will sound for 3/4 of its written timing.
It seems you're looking for terms that differentiate between those above, as far as duration of sound/silence are concerned. The terms above do just that!
As far as technical terms go, ADSR may help - Attack, Decay, Sustain and Release, with Sustain being the key to how long a note will sound for, after being played, and release being the time taken for the note to become inaudible after it's been played. There are several Q&A here which are concerned with ADSR.
Comment: I think both this answer and Aaron's miss the point of the question, which is not seeking terms such as "staccato" or "legato" but rather a name for the parameter that one varies to produce staccato or legato, analogous to _tempo_ being the parameter that one varies to produce _largo_ or _prestissimo._
Comment: The usual unexplained dv. How am I going to learn to produce better answers?


Can a judge assign a murder victim's paid counsel to represent her murderer?

Question: A prominent Arkansas business woman hires her friend to represent her in a business dispute with an investor. 16 months later she is murdered. Her judge assigns her attorney friend to represent her murderer. Neither the attorney or judge tell the court record or the murderer of the continuing dual representation. Her case is not settled until 3 months after her murderer is sentenced to life plus 196 years. Is this legal? This is a real life case from 1988. What options are available to a defendant who discovers this huge error and conspiracy?
Comment: Really? Can an Arkansas judge 'assign' an attorney, like that or in any other circumstances?
Comment: In criminal cases, people that can't afford a lawyer are provided one from the public defenders office. Judges don't generally pick/assign those lawyers. We would need a link to the actual case to see what the details w.r.t. the case. Sounds a bit strange, as lawyers are specialized. Commercial lawyers are not usually criminal defense lawyers. Without knowing the details of the case, I'd expect the judge and lawyer were in it together (the lawyer volunteered to be a PD, and the judge worked to get that volunteer).
Answer: This would have been a basis to disqualify the attorney when this was happening. Ineffective assistance of counsel is a ground for setting aside a case post-conviction in a collateral attack on the conviction, in some circumstances, and this would at least suggest that an ineffective assistance of counsel basis to set aside the conviction might be credible.
The pertinent question is whether the claim could be raised 35+ years later when there was a guilty plea made pursuant to a plea bargain. This could be quite challenging.
The normal rule is that the challenge to a guilty plea based conviction must be filed within 90 days, pursuant to Arkansas Rule of Criminal Procedure 37.2(c)(1), but an exception (perhaps unwritten and only described in case law) might apply if the challenge is based upon newly discovered evidence.
This depends upon the procedural history of the case, Arkansas state law and Arkansas court rules concerning post-conviction review, and federal habeas corpus law, including the Antiterrorism and Effective Death Penalty Act of 1996 which imposes strict limitations on federal post-conviction review. Federal law requires, among other things, that state law options for post-conviction review have been exhausted before a federal habeas corpus petition can be filed.
There are also strict time limits on when newly discovered evidence can be raised to set aside a prior conviction. So, the time that this was discovered matters. It could be a matter of months rather than years. And, this argument is much harder to make in the case of an agreed plea bargain than in the case of a case litigated to trial and fought at every step of the way.
In particular, I don't know if the conviction could be set aside successfully without a credible claim that a non-conflicted counsel could have secured a non-guilty verdict for the criminal defendant in the case.
A law review article from the year 2000 discusses when post-conviction relief is available based upon newly discovered evidence of innocence. It notes, for example, that:

In Arkansas, the means to obtain post-trial relief after a criminal
conviction include a motion for new trial, direct appeal, a petition
for state habeas corpus relief, a petition for relief from an illegal
sentence, a petition for relief under Rule 37 of the Arkansas Rules of
Criminal Procedure, a petition for writ of error coram nobis, a
petition for federal habeas corpus relief, and clemency petitions to
the executive branch.

This article evaluates the extent to which this is possible, stating:

Arkansas's post-trial procedures allow prisoners to present to circuit
courts newly discovered evidence of actual innocence and obtain relief
from a death sentence or a sentence of imprisonment. This article
concludes that either because the nature of the relief provided by
these procedures is limited, or because of the brief time frame within
which one must petition for relief, all post-trial procedures provide
little opportunity for a prisoner to establish his or her actual
innocence through newly discovered evidence. This article also
suggests possible reforms to enable prisoners to prove that newly
discovered evidence establishes their actual innocence.

Later on the article notes:

According to the Arkansas Supreme Court, the writ of error coram nobis
is a "legal procedure to fill a gap in the legal system-to provide
relief that was not available at trial because a fact exists which was
not known at that time and relief is not available on appeal because
it is not in the record. ' The court has further stated that "[t]he
writ is allowed only under compelling circumstances to achieve justice
and to address errors of the most fundamental nature.'"

Yet, despite
this assertion, the court has limited the scope of the writ of error
coram nobis. Newly discovered evidence is not in itself a basis for
issuance of a writ. The writ is available to address errors in four
categories: insanity at the time of trial, a coerced guilty plea,
material evidence withheld by the prosecutor, or a third-party
confession to the crime made between conviction and direct appeal.
The court justified the limitation of the writ regarding newly
discovered evidence in the form of a third-party confession as
follows: "[T]he questions of fact which invariably accompany an
allegation of a third-party confession demand prompt scrutiny. The
mere fact that another person has confessed to a crime cannot, alone,
be grounds for relief for such confessions are not uncommon and must
be approached with some skepticism. The trial court must carefully
scrutinize the corn plete circumstances surrounding the confession and
all the available evidence. Assessing the merits of the third-party
confession requires that all of the evidence be available and
unimpaired by the passage of time so that the trial court's
examination can be exhaustive and decisive. Our requirement that such
a claim be raised before affirmance serves to limit such claims to the
time frame in which it is most likely that the trial court can
determine with certainty whether the writ should issue. Assertions of
a third-party confession after a judgment is affirmed may be addressed
to the executive branch in a clemency proceeding." The court also
discussed the limits of the writ of error coram nobis in a capital
murder case where the petitioner sought leave to proceed in circuit
court because DNA analysis, which was unavailable at his trial in
1979, was now available to test a hair sample the State introduced
into evidence. The petitioner contended that the results of the DNA
test would refute the State's expert witness testimony that hair found
on the victim was like his hair. The court stated: Where there was no
fundamental error at the time of trial, newly discovered evidence is
not a cause to issue a writ of error coran nobis. The mere fact that
over time a scientific test may have been developed which did not
exist at the time of a petitioner's trial is not in itself cause to
issue the writ because the development in scientific testing cannot
establish a fundamental error made at trial. A petitioner who contends
that newly developed scientific testing can exonerate him should
submit the allegation to the executive branch in a clemency
proceeding.
This reasoning is suspect. Even though advances in scientific testing
cannot establish a fundamental error, the results of a new scientific
test can do so. The court's reasoning makes sense only if the
imprisonment of innocent persons is not a "fundamental error."
Nevertheless, the writ of error coram nobis provides a narrow window
of relief for petitioners who claim that newly discovered evidence in
the form of a third-party confession has established their actual
innocence.' The writ can also serve as a powerful tool in the area of
prosecutorial misconduct.

The Innocence Project is one organization among others that helps people with post-conviction cases like this one, because the right to counsel at state expense does not extend to post-conviction review of criminal convictions.
Comment: @KingJames Just to make things blatantly explicit, anything said here (or any place online) should be taken as generalized information only, not as a substitute for specific legal advice. While talking in generalities and discussing things from a casual interest perspective are fine, it's across the line of what answerers here are qualified for to provide assistance with the details of a case you have a personal stake in. Once you start getting into nitty-gritty case specifics, that's when you need to turn to a qualified lawyer licensed to practice in the relevant jurisdiction.
Comment: this might explain why the attorney did absolutely no investigation of or offered any of the available mitigation evidence or mention during the sentencing phase of trial: 1- the undisputed State Hospital diagnosis he was in a dissociative mental state when committing the crime. 2- His father was convicted of sodimizing him at age 3, and the court continued giving him back to his father till age thirteen. 3-No family character witness allowed. 4- Overseas twice in Army.
Comment: WOW! That was breath taking information. Thank you. I did not specifically mention it - but this was not a plea bargain, but a jury trial.
Comment: @KingJames I misunderstood the statement: "Her case is not settled until 3 months after her murderer is sentenced to life plus 196 years." to mean it was a plea bargain. The deadlines in litigated cases are a little different, but also long gone, but the room for an ineffective assistance of counsel argument is stronger if the case was litigated.
Comment: @R.M. Indeed. The success rate for lawyers in post-conviction review cases is something 40-80 times greater than the success rate of self-represented parties (in part due to greater skill and in part because they don't take on weak cases).


Help with architecturing a wizard

Question: I'm building a 3 step wizard for feedback in visual force where the user is expected to fill up a form on each step of the page. I'm planning to use one controller for navigation and 3 visual force pages to handle the input and output fields .Here are things i would need some help.A user can fill the form say 2 steps and abandon and come again later and fill up the form. Has any body done this and if so can you share code snippets or best approach? How do we do this? Any code reference or articles with real examples would really help in this regard?. Thanks Joseph
Comment: Unless you allow them to save at each step along the way, or save their steps in a cookie, they won't be able to come back when they log-in later as the view state will have been lost in the controller.
Comment: There's some pretty clever solutions, really, and it's not that hard to accomplish.
Answer: A basic solution for this involves the use of the Web Storage API, which will be necessarily complex (but possible), with some effort.
First, you'll need an actionMethod on each page of the wizard that allows the script to set values into the view state. This is necessary because you can't just save the view state directly; Bad Things happen if you try.
Second, you'll want to set up "on select" or "on change" events on every element you wish to save. You can use onchange and onselect attributes on managed elements (elements starting with apex:), but a generic document-level change handler will suffice for non-salesforce-specific field types (e.g. you will need to handle Lookup Fields in a special manner).
Third, you'll want an "on load" event handler so the actionMethod from the first step can be called to restore the elements back into the view state when the page first loads.
Putting it all together, you'll end up with something like this:
<code><apex:page controller="XYZ">
<script>
function onload() {
    var oldValues = [], index = 0, key, value;
    while(index < localStorage.length) {
        key = localStorage.key(index++);
        value = localStorage.get(key);
        if(key.match(/myForm#.+/)) {
            oldValues.push({key: key.split(/#/)[1], value: value});
        }
    }
    restoreValues(oldValues);
}
window.addEventListener('load', onload, true);
</script>
...
<apex:form id="form">
    <apex:actionFunction name="restoreValues" action="{!loadValuesToState}" reRender="form" />
        <apex:param name="oldValues" value="" />
    </apex:actionFunction>
    ...
    <apex:inputText value="{!someVar}" onchange="this.value? localStorage.setItem('myForm#someVar', this.value): localStorage.removeItem('myForm#someVar')" />
    ...
 </apex:form>
</code>
Then, in your controller:
<code> public class KeyPair { String key, value }
 public void loadValuesToState(KeyPair[] values) {
     for(KeyPair[] value: values) {
     if(value.key=='someVar') {
         someVar = value.value;
     }
     ...
 }
</code>
There are "easier" ways of doing this, but most of them aren't very IE8 compatible, meaning you'd want to use jQuery if you expect IE8 will still be a problem. The problem will start when you need to start saving lookup fields (you need to store the _lkid value instead of the text value), multi-selects, and other salesforce-specific input types. The generic types, including regular text fields, long text fields, and select lists are easier to handle.
You'll probably also want to include a means of clearing the form once the wizard is done or if the user chooses to clear out the data. Note that I use a sort of "namespace" convention so you can have multiple forms use this technique without clobbering each other. This is important, because localStorage works at the domain level (e.g. all Visualforce pages will see each other's data).
This solution works even with no Internet connectivity, meaning you can guarantee that your user's data will survive the page failing to load due to intermittent issues, etc. Of course, you could implement a server-side solution as well; simply save their data periodically with an actionPoller set on the page that calls a function to save their data. This introduces the need for Internet connectivity, but allows them to resume their work on another browser/computer/device.

Help with architecturing a wizard


Should we enforce the user login at app startup?

Question: when we should enforce users to login at mobile app startup and when we can postpone it?
What are the best practices for this?
Comment: As a general rule, allow the user to interact with an app without forcing a user to create a login.
Comment: This is hard to answer as it depends highly on your app. If the user don't need to login at all, why force them to? But if the user needs to login to use the app, it makes sense to have them login at the beginning.
Answer: It is very app dependent.
A question to consider - what can an anonymous user accomplish. If you have some store, definitely allow to windowshop to get them hooked before they actually sign up. Same with any products that require some membership etc, show them as much as you can and then cash in (thus ask for data) as late as possible in the process.
If it is some business-related app / task app where you need to be logged in to access some restricted data, ask for a login before you can do anything else.
Answer: Depends on the context. And as for best practices, I don't think there is a yes or no answer to this. But there are definitely best practices around the login experience itself.
Let me illustrate 'context' with a few examples:

e-commerce: people might want to browse, add to cart etc and only if they decide to purchase it - they would want to create an account and login (and hope that their selected items added in their cart show up after logging in as well)

banking products: people cannot do much without logging in, only read supporting info/ product info.

newspapers/ journalism: sites such as WSJ, New York Times etc will show only a glimpse of the news article and will prompt you to login. They want to entice you, and have good quality journalism, but do not want to show the whole article for free.
Answer: As a user, I always like to look around and see if the app is for me before I create an account and give you my data.
You can give your users a unique ID based on their IMEI + Phone number and ask them for more details along the way after they used your app. When they are doing a checkout you can start asking for full information and build their profile with that data.
Answer: Basically, this depends on two main factors: 1. do we want to attract them with some content and 2. should they be able to access some content without logging in.
Some cases:
If the app is a part of a broader ecosystem the User knows then yes, we can require it. Especially when the expectations from the app are quite obvious (like FB Messenger, for example).
If we need to convince the User, what they can see in the app may be crucial factor for them to use it. But only if there is something to show—some interfaces depend on the data they need to input first.
In some cases we can present them pre-login content (like ecommerce platforms, where finding a product someone wants to purchase is the very trigger for them to log in or create an account. But sometimes users may be expected to have an account—e.g. if it's a company CRM, User accounts are usually created by administrators. Similarly about banking apps. In these cases, sometimes it would be great to at least show them what they can expect–via onboarding screens or some anonymous content.


Immobile vs Stationary difference

Question: When speaking about something that usually moves but now cannot, which word is better: Immobile or Stationary?
Comment: "Cannot" is a key word here.  If it was "is not", either term would probably be equally used.  "Cannot" suggests immobile (or better, immobilized).
Answer: There are two main meanings that these two words represent. The first definition is "can't move". The second definition is "isn't moving now".
Both words can have both meanings. In general, though, immobile has a stronger sense of being unable to move, while stationary has a stronger sense of not moving now.
So simply put, it's your choice. I would probably use "immobile", myself.
Comment: I'm wondering if this is a regionalized difference.  To me, it's somewhat the opposite.  Stationary can mean either not moving now or something that isn't intended to move.  Immobile is generally used for something intended to be mobile but isn't mobile now.  By any chance is there something you can cite that indicates what the "official" meaning is supposed to be?
Comment: @fixer1234 I already provided a dictionary definition for both words in my answer. Just click on the word to see the citation. You will note that the *first* definition for "immobile" is "incapable of being moved".
Answer: I would use the past participial adjective, immobilized, to indicate that something has happened to the thing that has taken away its former mobility.  Neither stationary nor immobile conveys that meaning.
P.S. The word immobilized is silent with respect to whether that which has been immobilized will ever be mobile again, but neither does it imply permanence. You would need to say temporarily immobilized or something along those lines if you wanted to indicate that the mobility has been taken away but not permanently. Of course context could also make that clear.

With the patient immobilized, the surgical procedure can proceed.
Comment: Does it mean, that later it will be able to move again?
Comment: @SovereignSun: Please see the P.S.

Immobile vs Stationary difference


What is the difference between an SDL physical key code and an SDL virtual key code?

Question: The struct SDL_Keysym has SDL_Scancode and SDL_Keycode members. What is the difference between them? The documentation does not really clear it up for me. I tried both and they seem to do the same thing.
Answer: See the SDL documentation. Scancodes represent the physical position of the keys, modeled after a standard QWERTY keyboard, while Keycodes are the character obtained by pressing the key.
On an AZERTY keyboard, pressing A will emit a 'Q' scancode and an 'a' keycode.
Answer: Generally, scancodes are the true values emitted by the keyboard (hardware) to the OS while keycode is what the OS/library maps it to based on the chosen layout. The layout decides the mapping between scancode to some virtual key code. It is part of the operating system's settings. Here, by layout, I mean the functional layout; there're also mechanical and visual layouts. Read more about keyboard layouts in Wikipedia. The concept of scan code and virtual key is explained better with illustration in MSDN.
However, SDL uses scancode to mean something different: the scancode of the key in the US QWERTY keyboard whose location is the same as the one in question. It's the device-independant way of denoting a key based on its location. This is buried in an unusual location in SDL's manual:

Scancodes are meant to be layout-independent. Think of this as "the user pressed the Q key as it would be on a US QWERTY keyboard" regardless of whether this is actually a European keyboard or a Dvorak keyboard or whatever. The scancode is always the same key position.
Keycodes are meant to be layout-dependent. Think of this as "the user pressed the key that is labelled 'Q' on a specific keyboard."
In example, if you pressed the key that's two keys to the right of CAPS LOCK on a US QWERTY keyboard, it'll report a scancode of SDL_SCANCODE_S and a keycode of SDLK_S. The same key on a Dvorak keyboard, will report a scancode of SDL_SCANCODE_S and a keycode of SDLK_O.

In the above quote, by layout the manual means the functional layout. The main part of the manual regarding keyboards is a bit brief on this issue:

SDL_Scancode values are used to represent the physical location of a keyboard key on the keyboard.
SDL_Keycode values are mapped to the current layout of the keyboard and correlate to an SDL_Scancode.
Which one to use is left to the application: scancodes are suited in situations where controls are layout-dependent (eg. the "WASD" keys as left-handed arrow keys), whereas keycodes are better suited to situations where controls are character-dependent (eg. the "I" key for Inventory).

In the above quote, by layout the manual means the mechanical/physical layout. So for controlling the character, for instance, using the scancode is better, while for receiving the user's name keycode is better.
Comment: You have mentioned that "SDL uses scancode to mean something different". SDL scancodes contains values from the USB documentation and refers to the true values emitted by the keyboard (hardware) to the OS. What do you mean by "something different" ?
Comment: It's in the answer, no? _SDL uses scancode to mean something different: **the scancode of the key in the US QWERTY keyboard whose location is the same as the one in question**_.  Say if the user has [Dvorak keyboard](https://en.wikipedia.org/wiki/Dvorak_keyboard_layout) and the user presses `,` SDL would return `SDL_SCANCODE_Q`.


Total number of integers relatively prime to $p^2$

Question: I am reading my number theory textbook and it states without proof that the total number of elements relatively prime to $p^2$ for some prime $p$ is $p(p-1)$. Why is this so? I know that the number of relatively prime elements to $p$ is always $p-1$.
Comment: [The general result.](http://math.stackexchange.com/questions/629933/properties-of-the-euler-totient-function/)
Comment: See  "Totient function".
Answer: All positive integers not relatively prime to $p^2$ less than or equal to $p^2$ are of the form $pv$, where $v\leq p$. There are $p$ options for $v$; $v=1,2,3...p$, so of the $p^2$ positive integers less than or equal to $p^2$, $p$ are not relatively prime to it. Then there are $p^2-p$ numbers less than or equal to $p^2$ and relatively prime to $p^2$.
EDIT: In general, $\phi(p^n)=p^n-p^{n-1}$ with similar reasoning.
Answer: Let's say $p$ is an odd prime.
You already know this but let's review: from $1$ to $p$, the only number $n$ such that $\gcd(n, p) > 1$ is $n = p$; this is because $p$ is prime and not divisible by any number from $2$ to $p - 1$. From $p + 1$ to $2p$, the only number $n$ such that $\gcd(n, p) > 1$ is $n = 2p$. And so on and so forth to $(p - 1)p + 1$ to $p^2$.
What we've done here is take $p$ sets of $p$ consecutive integers and we've found that in each of these sets only one integer $n$ satisfies $\gcd(n, p) > 1$, meaning that $p - 1$ integers in the set of consecutive integers are coprime to $p$. Since there are $p$ sets of $p$ consecutive integers, that means $(p - 1)p$ integers out of the integers from $1$ to $p^2$ are coprime to $p$ and to $p^2$, just as your book asserted.
Answer: Hint:-
The number of primes less than and relatively prime to a number $x$ is represented by Euler Phi function-$\phi(x)=x(1-\frac{1}{p_1})(1-\frac{1}{p_2})...(1-\frac{1}{p_n})$ where $p_1,p_2,...,p_n$ are the prime factors (distinct) of $x$.
Now what will be this if $x$ is a prime as in your question?
Answer: Every number, n  can be written as $n = mp + k $ where $0 \le k < p$.  $n$ is relatively prime to $p$ if and only if $k \ne 0$.  There are $p-1$ options.  For numbers less than $p^2$ (not stated in the OP but clearly intended by the book-- otherwise there are infinitely many numbers relatively prime to any number), $0 \le m < p$.  So there are $p$ choices for $m$.
Thus there are $p(p-1)$ options for relatively prime to $p$.
The book probably assumed it was clear that only the $p, 2p, \ldots, (p - 1)p$ weren't relatively prime, and as there are p of those there are $p^2 - p = p(p-1)$ that are relatively prime.
Or maybe the book assumed it'd be clear that those that aren't can simply be listed as:
$$1,2,\ldots,p-1$$
$$p+1,p+2,\ldots,2p - 1$$
$$2p+1, 2p+2,\ldots,3p - 1$$
...
$$(p-1)p+1, (p-1)p + 2,\ldots,p^2 - 1$$
Of which there are clearly $p$ sequences of $p-1$ elements.
Or maybe the book had stated there are $p-1$ less than $p (1 \ldots(p-1))$.  $2(p-1)(1\ldots(p-1)$ and $p + 1 \ldots p + (p-1))$ less than $2p$.  And $m(p-1)$ less than $mp (1 \ldots p-1, p+1 \ldots p + (p-1), 2p + 1 \ldots 2p + (p-1)$, etc. up to $(m-1)p + 1 \ldots (m-1)p + (p-1))$.
Answer: $\frac{1}{p}$ of the numbers from 1 to $p^n$ are divisible by p, so $p^n-\frac{p^n}{p}$  are not divisible by p.


sample xsd files from geographic sources

Question: Where can I download sample xsd files for different features like road,rail,river,land etc.I need them urgently for checking the working of my project which works on the schema of geographic data.
Answer: If you're interested in INSPIRE data (as per your tag) then you should look at the INSPIRE site, for example INSPIRE xml schemas would seem a good place to look.  These though aren't samples, they are actual schemas that data providers need to follow.
If you're interested in Geology then you should look no further than GeoSciML.
If you're after Geography Markup Language then try http://schemas.opengis.net/gml/


Is it possible to search another storeview product name if current language store view is no result?

Question: My website have two store view which are in different language.
I use keyword "Clothes" to search in dutch store. It should be no result in magento since there are no product name in dutch contain "Clothes". Is it possible to search another language store view if current language store view do not have result ?
Answer: Yes. But you will have to add extra functionality. Have a look at the \Magento\Catalog\Api\ProductRepositoryInterface interface there is a method called get and getById there is a parameter $storeId, where you can use as a fall back if the current store doesn't not have the product you're looking for.
You will however have to extend the functionality of what ever search engine you're using.


Mortar over grout

Question: Can I mortar over the grout I installed in between my 3/8 spaces brick veneers? Given there is enough space in depth, would it stick and look ok? I bought and installed a natural gray grout but it came out darker than expected. Luckily the spaces were deep and I still have a little room to play with. Or would it be better to either, remove grout, which I don't want to, or re apply lighter grout?
Comment: The bricks form a vertical wall, correct? what are the dimensions?
Answer: Mortar and grout  both contain cement so they should form a positive mechanical bond. What may prevent this is if a sealer has been applied to the grout. The depth of the joint is important. If the joint is 3/8 inch in height it should be close to 3/8 inch in depth. This also ensures that enough mortar can be troweled into the joint to bond with the brick and grout. The fastest way to open the joint is with a masonry blade and a grinder. It is a noisy and dusty job so proper safety protection should be taken. Vacuum the joints and dampen the joint and brick. Dampening is key to point work. It allows the water in the mortar to remain there rather than being absorbed into the dry grout and will form a stronger joint. It also makes the inevitable mortar splotches and smears easier to remove from the brick face for the same reason (the water isn't absorbed as easily if the brick is already wet). Mix the mortar in batches that can be used within 30-40 minutes if temperatures are above 80 degrees. If you add a splash of admixture to the mortar while mixing it will be easier to trowel and become more resilient when cured. Use a mortar bag and joint tool if you can. The joint tool is key to forming a professional looking concave (or convex) shaped joint. After mortar has set for a few hours mist with water to slow cure time and increase it's strength. It will lighten significantly once fully dried.
Comment: Very professional, thank you very much. I didn't seal the grout yet, I sealed the bricks a week after they were laid on the wall, to avoid thin set, mortar or grout setting in pores. So I should be set to go. I'm hoping I am deep enough, I don't want mortar coming flush with the bricks but also don't want the dust kick up. I don't mind the noise. Will a grout scraper work better if I have the time and strength? Or is it to much. It's 50 square feet wall.
Comment: If grinding the joints isn't feasible here is a suggestion that will allow the mortar a positive attachment point. Use a 1/4 inch masonry bit and drill a series of perforations along the grout line spaced about 2-3 inches apart. Don't drill completely through the grout, but a 1/2- 3/4 inch hole should work. Vacuum the dust out ,wet the opening and grout, and press in the mortar.

Mortar over grout


My neighbors weeds infesting my yard

Question: My neighbor's yard is terrible and the house next to hers is abandoned due to fire so it's weeds everywhere. It's been a battle to keep the weeds out a battle i have lost. What was once a beautiful backyard is now overrun with weeds. It's fall now but i plan to have a garden on the spring but i am unsure how to keep weeds out. Any suggestions? There is no privacy fence just chain fencing. Also i read about raised garden beds would they keep weeds out instead of planting straight into the ground?
Comment: First thing: ask your municipality (after you ask your neighbors). Maybe there are rules. Then what do you mean with "your garden"? lawn? vegetable garden? flower beds? If you have also the name (or a picture) of the weeds, we may be able to help better. (perennial weeds: you may need to dig in order to make a barrier to the roots. In other cases: no barriers will help you. If somebody could cut the weeds 2-4 time a year, it would be really better (so not much work for your neighbor)
Comment: It is a waste of time to try to guess where weed seeds came from. If you don't want them , kill them.
Answer: I have a neighbor whose yard is a weed-pit, too. Fortunately for me, two things work in my favor: the yard is downwind from my yard and I have a solid six-foot tall fence between our yards.
A couple of ideas to take care of this year's weeds:

As noted by @Giacomo Catenazzi in the comment under your question,
if possible, get local government involved. Most cities in my state
have ordinances that govern the height of grasses in yards; in many
cases, these are incorrectly used to prevent people from planting
native plants, but in all cases, the city will need to inspect if
you complain. A big concern that you should have is rats infesting
the house and yard due to the unkempt yard.
If you live in a rural area, then there will be no laws governing
yards like I cited above, but there will probably be laws governing
noxious weeds (this also applies to most cities).
So, do some research on your municipality's web site to get the
facts as to municipal ordinances that may apply, then call the
municipal government AND your alderperson/town supervisor/mayor/take
your pick of official and file a formal complaint against the
neighbor's property. If there are "plant height/weediness" laws like
I mentioned, then demand that the municipality enforce that
ordinance, which involves cutting the entire yard and charging that
property's owner. Next year, complain again and keep complaining until the house sells.

If the municipality has no ordinances governing properties as I described above, or if the municipality refuses to act, you could take matters into your own hands. I don't mean cutting down the weeds, but deadheading them. Because most weeds spread via air dispersal, deadheading can really make a difference as to the number of weeds in your yard, especially if that yard is upwind of yours.  This means, though, that you must enter that yard, which could go against trespassing laws and perhaps be a hazard to you if the neighbor has left garbage lying around that you could turn an ankle on or fall over. If you do decide to deadhead, just cut the seedheads off and put into a kraft paper lawn waste bag; don't drop on the ground or put into compost.

No matter what happens with 1 and 2, you can permanently prevent the roots of perennial weeds from entering your yard by vertically burying a strip of aluminum flashing at the fence line. I recommend eight-inch wide flashing, going down six inches, screwing it horizontally into the ground so that it doesn't frost heave, and leaving two inches above ground, flush with the chain links. This is a decent amount of work (get a flat-bladed shovel to more easily make the V-trench you'll need to do this first), but it is a permanent solution.

So, I've covered how to stop weed seeds and roots, but what about seeds already in your yard? A good, organic mulch, applied just before the growing season at least one inch think will cover this year's weed seeds, preventing them from germinating. For perennial and shrub beds, I use arborist wood chips, which I get free from my city's yard waste dump. You can also buy hardwood mulch in bags or from a local nursery. Every year, add a half-inch or more to cover the previous year's seeds. I know from twenty+ years' experience that this works. See here to download a free fact sheet for more information. For vegetable gardens I use a one-year mulch such as cocoa bean hulls, rice hulls, pine needles, etc., whichever is common in your area.
If your municipality does cut down that yard, you may want to act next year to preemptively take care of the weeds, by perhaps cutting the yard regularly yourself or by planting a cover crop; one crop that works really well if you're not in a drought-prone area is pumpkins, as they spread fairly rapidly, have very long vines, and large enough leaves to prevent seeds from germinating or thriving.
Answer: In a similar situation, I was just spraying Roundup on the boundary edges. I have a funnel shaped attachment on my sprayer's wand which contains the spread of the mist, as I drag it, touching the ground.
But this only stops the weeds that are trying to crawl through.  You cant do much about the seeds that will blow over.  Just keep pulling them put, before they seed.
Answer: One of the best ways to keep weeds out in the presence of lots of weed seeds that you can't control is to use black plastic (not landscaping fabric; they can grow through landscaping fabric more easily, since it's porous). Of course, you still have to pull up weeds from the holes where you plant things, but it's a lot less weeds, and more manageable.
Landscaping fabric and mulch are often used, but some weeds from neighbor's yards grow right through mulch, in my experience (e.g. we had loads of prickly lettuce growing through ours this year).
Even tiny holes in black plastic can give opportunities for weeds (so be careful not to puncture it, especially as pulling up those weeds can make the holes bigger).
You could also try solarizing the ground to kill some weed seeds. Don't expect 100% elimination, but it may cut down on the weeds considerably.
Raised beds and containers can be helpful as long as they don't get weed seeds in them. They do tend to be easier to weed than just plain ground, though.
Another thing to do is grow crops that choke out the weeds, before the weeds get big enough.
And if you can't beat the weeds, you can sometimes make sure the less problematic weeds are the ones that are taking over. Pull up the most problematic ones first.
Comment: The plastic will completely sterilize the soil by totally preventing oxygen exchange with the soil. It could be useful, perhaps in a six inch strip (12 or more inches apart) with vegetable plants growing out of the middle, but should never be used to mostly or completely cover a garden. It's also impossible to water the plants except through their planting holes, which is where the weeds will also sprout. Perennial roots can be stopped with underground barriers such as edging or aluminum flashing,
Comment: It doesn't completely sterilize the soil. Plenty of oxygen goes under the plastic through the planting holes (and any wind out there will thoroughly ventilate it). I've used black plastic for many years. Plants can grow in it just fine (many plants even better than without it). But yes, it's difficult to water (fortunately, you don't need as much water with it, though). It does get very hot and dark, though, which could kill some stuff, but if there are planting holes, it's a lot cooler, and the plants appreciate the extra warmth that is left, often.
Comment: Actually, plastic does indeed prohibit nearly all if not all oxygen exchange - the planting holes are way too small for this to happen. If the mulch covers a small area, then it's really not a huge deal (as I noted in my comment) because the rest of the soil will contain enough microorganisms and invertebrates to recolonize the covered soil. I will post a reference when I can find it again (lost my bookmarks in a computer crash).
Comment: As promised, go here for much, much more information on the use of sheet mulches (cardboard, paper, landscape fabric and plastics in particular): https://gardenprofessors.com/the-cardboard-controversy/ Be sure to read the comments; I suggest searching for "oxygen" on the page. A couple quotes: "The only things using oxygen and releasing carbon dioxide are microbes. In a real world, soil is full not just of microbes, but roots and animals tlat all require oxygen. Oxygen is THE limting factor as you travel downwards in soil, so anything that slows gas exchange will limit oxygen availability."
Comment: To continue the previous comments: "Sheet mulching, as compared to three-dimensional mulch (like arborist chips) is bad for soil life, period. There is absolutely no published evidence to the contrary."  Author of this information is Linda Chalker-Scott, Professor Emerita Washington State University. She also cites a paper in this post and discusses the results in the comments.

My neighbors weeds infesting my yard


Extension of classical Liouville operator

Question: Let us consider a classical Hamiltonian system described by the Hamiltonian
\begin{equation}
H(q,p) =\frac{p^2}{2m}+V(q)
\end{equation}
where we stick to the case of single particle for simplicity. I am interesting in the dynamics generated by the extended Liouville operator
\begin{align}
i\mathcal L = \frac p m\frac{\partial}{\partial q}-V'(q)\frac{\partial}{\partial p}-V'''(q)\frac{\partial^3}{\partial p^3}
\end{align}
The equations of motion generated by $e^{i\mathcal L t}$ can no longer be written in a linear symplectic form, because by interpreting $\frac{\mathrm d}{\mathrm d t}\leftrightarrow i\mathcal L$
\begin{align}\label{eom}
\dot q = \frac{p}{m} \hspace{10mm}\dot p = -\frac{\partial V}{\partial q}
\end{align}
we would identically neglect the cubic derivative in the momentum. Is there a way to extend the above dynamical scheme in compliance with the modified Liouville operator? I am ultimately interested in a numerical method aimed at integrating $(q(t),p(t))$.
Answer: I am not experienced with cubic PDEs... only Infinite dimensional such. Your system looks like the first quantum correction in Wigner flows in phase space, but I cannot get much help from that magnificent formulation, off the cuff...
I could only formulate your problem in 19th century language.
You are seeking the Green's function for
$$
\left (\partial_t - \frac{p}{m} \partial_q + V(q)'\partial_p    +V(q)'''\partial_p^3  \right   ) f(q,p)=0 ,
$$
One could Fourier-transform to $f(q,p)=\int dy ~e^{iyp} F(q,y)$ ,
$$
\left (\partial_t +\frac{i}{m} \partial_y \partial_q + iV(q)' y   -iV(q)''' y^3  \right   ) F(q,y)=0 ,
$$
but it may not be clear this is friendlier to you purposes.
Comment: Indeed, I am looking for a first order nonlinear correction in the propagation of Wigner functions for a nonlinear quantum system. It seems like the problem is not straightforward, but I can look up whether the reformulation in terms of Green function offers some computational advantage.


QGIS Atlas page order problem

Question: I am using QGIS Atlas to export my work into PDFs. I have created a support polygon layer, which contain rectangles and I use this layer as coverage layer in QGIS atlas. My problem is that I don't know how the pagenumbers work. It change the page order when I update a feature in the coverage layer. For that reason I activated the sort by option, and used the autoincrement id of the coverage layer, but nothing had happened. It looks like the atlas is using kind of time metadata for page numbering. Is there any way I can fix this?
Comment: Have you created an integer field containing the desired page number per feature? Which QGIS version? If the issue only appears with autoincrement fields (which data source?) and it's a current QGIS version, should be reported as bug.
Comment: Thanks for your answer. It looks like the autoincrement field caused the proble. I created a new integer field for pagenumbers and that work well. If you add your comment as answer I'll accept as solution. (I used qgis Lyon, and las palmas versions)
Answer: It's possible that the issue only appears with autoincrement fields. Try creating an integer field containing the desired page number.
If this is an issue in the latest QGIS version, it should be reported as bug.
Comment: I'm using QGIS 3.0.2 and have a similar problem.  I added a field to the controlling layer which contains the map number.  So there are 2 fields in the table, fid which was system created as a unique key, and id which I created.  I use the expression concat('Map No ', $id) but QGIS insists on replacing id with the value in fid.
Comment: Just found that if I make the expression concat('Map No ', id) it works.  The $ before id seems to have been the problem.  I've a bit to learn obviously.

QGIS Atlas page order problem


what is the best way to feed GPT a scientific paper with a lot of formulas

Question: I often wish to ask GPT to read a scientific paper with a lot of formulas but I run into a difficulty. Usually a scientific paper is in pdf format and there are a lot of formulas. If those formulas are in latex form, GPT can indeed understand them precisely which is evidenced by that it can write codes that precisely translate a formula (according to my experience). But what if, like in a pdf, the formulas are not in latex form? If I copy and paste them the formulas usually become non-readable. I know that one can use some tool like mathpix that ocr a picture into latex with quite high fidelity. But that is still quite inconvenient as there may be ocr-errors which still need significant human inspection to make sure to eliminate. But openai must have fed scientific textbooks with loads of formulas into GPT in the training process in the first place, I suppose? So I suspect there does exist a convenient way to feed GPT a scientific paper in pdf format with a lot of formulas. If so, how do one do that?
Answer: There is an example "book_translation" in the OpenAI cookBook that automatically translates, chunk by chunk, a Math-book from the Slovenian language to the English language.
Maybe it helps to study the source code of that python notebook to solve your problem.

Translate a book writen in LaTeX from Slovenian into English
With permission of the author, we will demonstrate how to translate the book Euclidean Plane Geometry, written by Milan Mitrović from Slovenian into English, without modifying any of the LaTeX commands.
To achieve this, we will first split the book into chunks, each roughly a page long, then translate each chunk into English, and finally stitch them back together.


Inner product of columns of a matrix

Question: What information about a (square) matrix we earn if the inner product of its columns are known?
Answer: You have determined $A^*A$, or, alternatively, you know $A$ up to pre-multiplication by a unitary matrix $U$. So you know the $R$ factor of its QR factorization, and the factors $\Sigma$ and $V$ of its SVD. In particular, among other things, you know singular values and right singular vectors, the sign of its determinant, its rank, its kernel, its Euclidean and Frobenius norm.
Answer: A more geometric supplement to Federico's answer: if you think of columns as vectors, then knowing the inner products determines the set of vectors up to rigid motion, so any geometric information is determined by the inner products (including the volume of the simplex they span [determinant], singular values [the semi-axes of the ellipsoid which is the image of the unit ball by your matrix], the areas of the faces of the simplex determined by them, etc, etc.
Comment: @M.FarrokhiD.G. The matrix of inner products is $A A^t,$ so its determinant is the square of the determinant of $A.$ For various other formulas, check out my paper Surface Area and Other Measures of Ellipsoids.
Comment: Where can I find such relationships, say a formula for determinant of a matrix by inner product of its columns?

Inner product of columns of a matrix


Should I drink water before, during or after eating?

Question: As the title says, I would like to know what is the best time to drink water, is it before, during, or after having a meal?
Also suppose the answer was during, what quantity is recommended?
Comment: Are you trying to lose weight, gain muscle, etc? This question needs a lot more clarification
Comment: I need to reduce my belly body
Comment: +1 as my father had to stick to a very regimented diet after Gastric Bypass Surgery where he couldn't drink water 30 min before a meal and 20 min after.  I've always wondered why.
Comment: Its ok if it is a little water. After all, most of food -especially fruits- contains water and the stomach takes care of it by producing sufficient acid. I am not a health professional though. [See this answer](https://skeptics.stackexchange.com/a/1877)
Answer: Here's an excerpt from a blog post I did a while back addressing this question:

The "plug" in the bottom of your
  stomach is a stoma not a valve. It can
  be pushed open, so when you drink
  during a meal the liquid can push the
  food out of your stomach pouch and
  down into your intestines. There are
  two reasons you should care:
This frees up extra room in your
  stomach pouch so you'll eat more
  during that meal. You'll feel hungry
  again sooner.
A recommendation that I've stumbled
  across is the 15/30 rule. Don't drink
  anything from 15 minutes before a meal
  until 30 minutes after a meal. This
  isn't a license to under-hydrate, just
  a guideline on when to drink.

Update: The comment thread has indicated a desire for "proof" (pedants! :-) ), so here is some reference information and some reasoning built on top of that in support of the above hypothesis.
First, the amount of fluid in the stomach is positively correlated with the rate of gastric emptying. It so happens that 30 minutes is an approximate inflection point in the gastric emptying of both a solid and liquid meal, per the chart below (same source).

I'll assert that drinking water will render the net contents of the stomach more fluid, moving the gastric emptying rate from the blue curve towards the red curve.
This seems to confirm the conclusion that avoiding liquid during the meal will help stave off the next bout of hunger because a more solid meal will take longer to empty. The 15 minutes before also seems to fit, as roughly half of liquid consumed 15 minutes beforehand will have been emptied before the meal starts.
If one further considers the dynamics, drinking water immediately before a meal will help fill up the stomach and reduce immediate hunger but will cause that meal to be digested faster, so I hypothesize that you will be hungrier sooner with this approach.
Comment: @KronoS I swear they were from people who had talked to other people who had talked to actual doctors! :-)
Comment: Too bad you don't have any references...
Comment: Unfortunately I didn't track sources - and I think they were all second-hand anyway. Regardless, here's an opinion with explanation...
Comment: I read your blog post, but most of my experiences in dining with Japanese and Chinese includes a pot of hot tea with meals.
Comment: @wdypdx22 Difficult to compare a lifetime of dining experiences here... tea is served, but sipped sparingly from small cups (you can't gulp down a 16oz glass of hot tea) and often not really touched during the meal.
Comment: @Greg - Your theory is interesting, but I have not been able to find solid scientific references to confirm it. There're tons of links in both directions, but very few are solid science. Many are anecdotal, some cultural....
Comment: @wdypdx22 Cultural considerations are interesting conversation for blog, but not the issue at hand. We can compare notes if we happen to run into each on chat...
Comment: @wdypdx22 @KronoS Have added a reference that I think backs up the general hypothesis in my original post. I couldn't find a reference for the new hypothesis at the end of the update (it's late, so I haven't looked very hard) - if you happen to run across one, please add, otherwise I'll keep an eye out and add if I run across anything.
Comment: Everything with images in it looks so much more credible, don't you think @Greg? ;-) +1 for explaining things!
Comment: Duuuh, I saw this answer here: http://skeptics.stackexchange.com/a/1871/5840
Now.. which do I believe?
Comment: @Richards I think this is apples & oranges. That linked answer covers whether the water dilutes stomach acid affects digestion, answering the question if it's "bad for you" or "washes away nutrients". See the next answer here, which links the same Mayo article. This question/answer is more about the dynamics of how quickly everything happens and its affects on hunger perception.
Answer: A link from Mayo Clinic. "In fact, drinking water during or after a meal can actually improve digestion."  There are proponents on all sides of this question, and at this point I can't find enough definitive information that could cause me (or cause anyone to worry about it very much) to drink or not drink during a meal.
I can find no mention of whether to drink water before, during or after meals in 2 references so far. One is Understanding Nutrition, 10th Ed., Whitney/Rolfes a college nutrition text. Nor in the Ace Personal Trainer Manual, 3rd Ed., American Council on Exercise. Both texts suggest the typical daily 8 glasses, but not necessarily as glasses of water, since a considerable amount of one's daily needs come with food.
There was some research reported in a number of popular news media outlets at the end of 2010 that suggests drinking water before meals can be conducive to losing weight. http://www.nytimes.com/2010/11/16/health/16really.html
And according to exrx.net, "There is no magic number in prescribing the amount of water to consume throughout the day. The optimal amount varies according to body size, activity level, enviornmental factors, and diet."
Anecdotally, I watched my grandparents live well (healthily) into their 90's drinking either coffee, water, or sweet iced tea with every meal. I actually never even thought about this question, but tend to drink beverages with meals dependent on whether the food is moist or dry and whether I'm thirsty or not.
Answer: I'm a fan of Dr. Thomas Levy. I've read his books. In short:
If your last food has digested then you may drink as much water as you can, even a second before next meals. Non-veg food takes around 3 hours to digest and vegetarian ones 1-2 hrs, fruits 30-40 minutes etc.
Don't drink when food is in your stomach as it dilutes the enzymes. Take least amount of water during this time. However sometimes some water is required when you eat dry items.
Answer: If I can answer your question with a single word, it would be "yes". Water is necessary for the proper digestion of food. Add to that the fact that many people are dehydrated from not enough fluid intake and you could conclud that people should drink water all the time, whether they are eating or not.
During a meal, I would suggest drinking a glass of water. Overall, I would just make sure I don't drink too much: How much water is too much?
When it doubt, drink more water.
Comment: Do you have anything to backup that drinking water at anytime during the meal has no difference?
Comment: Also, since the body is ~70% water, and most food is largely water, what evidence indicates that all this wetness is still not sufficient for proper digestion and needs to be augmented by more water intake?
Answer: Despite my background in science, I'm going to suggest that you use a little trial and error here to see what works best for your digestion and satiety.  We can hypothesize and rationalize for weeks, but this is one circumstance where you can run the experiment for yourself several times over a few days.  Just do it.
Answer: I think you should drink whenever you feel like it. My grandma always forbade my mom to drink during meals (for whatever reason) but I don't see the point of that and think that it was a 1940s fashion. As other questions pointed out already, it is usually not a good idea to drink a large amount at one point of the day. It is best to spread your water/liquid intake throughout the day.
I like to eat my meals with a drink but I tend to drink little or nothing immediately before I go running because I feel sick otherwise. Although I drink about 20-30 minutes before my run because I think it is good to be hydrated properly for the time of the workout. I was never concerned about being dehydrated and running around with a water bottle all day is ridiculous in my humble opinion:) I do 10-15h of sport a week and never crashed because of water deprivation. So, listen to your body and you will be fine.
Comment: This provides no detail or reference to your hypothesis, and therefore is just that.  This should probably be a comment, more than an answer.
Comment: Parents don't like to have their kids drinking during meals because they will get full faster and not finish their meals. I give my kids enough to drink to not choke then they can have more after they finish their meal. Otherwise, they wont eat.
Comment: Agree, for two reasons. Common sense reason: no animal needs to be forced to drink water, they drink whenever they feel like it. There is ZERO evidence that somehow we humans are unique among evolved creatures in the world, and have a defective sense of thirst. Physiological reason: your stomach needs to be acidic to digest food. Water dilutes the acid. Drink some other time.
Comment: The answer is there is no time you have to drink! This is for sure an answer. You should drink whenever you feel thirsty. what else is there to say
Comment: Can you add some references to prove that this is more than just a personal opinion? Not that I agree or disagree with your opinion, but great answers on SE value good references and hard fact well above opinion and theory.
Answer: This New York Times article claims you should drink water before eating.

In the most recent [study], a randomized trial published in the journal Obesity in February, scientists at Virginia Tech followed a group of overweight subjects age 55 and up on low-calorie diets for about three months. Half the people were told to drink two cups of water before every meal. At the end of the study, the water group had lost an average of 15.5 pounds, compared with 11 pounds in the other group.
Comment: Wrong. The NYT article does not make any claim about what "you" should do. It discusses the quoted study and others related to old overweight people on low-calorie diets, observed over a short time frame. The difference between groups of 4.5 lb after three months may be statistically significant, but is not much of a difference physiologically, and cannot necessarily be extrapolated to different categories of people.
Answer: I have read about this on-line in medical forums and had several doctors tell me this.  I tried it myself as have several relatives and it works. As "J. Winchester"  commented above: the stomach needs acid to digest foods properly. When water is presented to your system during a meal, it fools the system into thinking that the liquid is acid and therefore shuts off production thereof. Yes, you will have wet food going down and it will eventually digest but not as efficiently as the the body's natural way. Consider that if the body still produced acid during the meal, The water would dilute the acid and make it less effective. Therefore, no liquid during food intake works for me and mine very well.
Comment: Hi @CliffWood, did you mean to post this as a comment? Which comment by J. Winchester are you referring to?


Has any one developed M-Bus protocol on STM controller?

Question: M-Bus is a building management side protocol which helps to communicate with the controller to get the available parameter values like current, voltage, power etc.
I have to develop an architecture which helps to get the data from Meters using the available protocol as M-Bus, I've STM32F030 controller and a datasheet of M-Bus, after searching a lot I couldn't find any working library, so is there anyone who has worked in this field please help.
Comment: There is a slim chance that you might get an answer on [Software Recommendations](https://softwarerecs.stackexchange.com/)
Answer: You could try mbus/libmbus that uses bitbanging so it only needs 4 GPIO. You could use it on almost any microcontroller.
It was not updated for 6 years but you could give it a go, even update it if needed.


What is that frog toy that Misaka loves?

Question: Misaka really loves this frog. Where does this frog come from? Does it exist both in anime and in real life (I feel like I've seen this frog somewhere before)?
Answer: It is very possible that you have seen it several times in the anime ( even in the game), it is a gekota

Gekota (ゲコ太 Gekota?) is a popular mascot found in merchandise marketed to children in the Toaru Majutsu no Index universe. A Gekota fan is called a Gekoer. Misaka Mikoto is a huge fan of the franchise it belongs to, and much to her consternation gets her labeled as someone who is childish.

And without a doubt there is also real life merchandise, and allot of look alike products, with a few samples bellow.
Comment: as stated in the first 2 lines of the quote. " in the Toaru Majutsu no Index universe". Made by Toaru Majutsu no Index. Popular due to Toaru Majutsu no Index.
Comment: The real life counterpart you might be thinking about might be Kerokerokeroppi which is something similar to the Gekota.
Comment: So, did Toaru Majutsu no Index get a gekota from another anime or Gekota become famous because of Toaru Majutsu no Index?
Comment: Ah, I thought that I saw this Gekota much longer before Toaru Majutsu no Index. Maybe I was wrong...
Comment: @ShinobuOshino There are tons of look alike products. the sticky hand (the toy) had a few resembling Gekota face's, and I believe those where made before Toaru Majutsu no Index even was released.


How do you tame an Ocelot in Minecraft?

Question: I have found an Ocelot in Minecraft, but I cannot tame it. When I try, the Ocelot gives off hearts, but does not become tamed.
Answer: From Minecraft Explorer:

How to tame an Ocelot:

Hold a Raw Fish whilst standing perfectly still and not looking around too quickly.

The Ocelot will slowly approach the player. When the Ocelot is close enough, use the Raw Fish on the Ocelot to tame it. (See notes below.)

Once the Raw Fish has been used, the Ocelot will turn into one of three different cat types.

Important
Ocelots can only be tamed when they walk to the player on their own.
Comment: While pictures can certainly answer a question, pictures of text help not at all.  They're not searcheable, nor do they contribute to SEO.  It'd also be a good idea to link to where you got this from.
Comment: I did I put "from Minecraft explorer"
Comment: Okay.  So what site is that?  Link it!  That will help with attribution.
Comment: It's the smartphone app Minecraft explorer

How do you tame an Ocelot in Minecraft?


Product overlapping header

Question: I've never seen this before, but my product pages started overlapping my header.  Just product pages.  This began while I was adding a page with elementor (an exact replica of another page) and adding a product (a duplicate of another product).  Nothing different.  Nothing in any code editors.  I don't usually use elementor (prefer classic text editor) but I haven't had issues when I've used it before.
I added padding to my site in custom CSS, but that causes all regular pages to have padding above the header.
Answer: Wordpress creates a unique class in body for each page check below for screenshot

If you want to add css for a particular page without changing anything in your regular pages you can add like this
<code>.uniqueclass header{
  padding:50px
  }
</code>

Product overlapping header


Current in only inductive AC circuit

Question: Current through a LR circuit is given by
$$i=i_0 (1-e^{\frac{-tR}{L}})..1$$From here I can observe that as I tend R towards 0 no current flows through the circuit , and current will be 0 when the resistance in circuit actually becomes 0.Though for an A.C. LR circuit I have seen my book presenting a proof where there is a sinusoidally varying emf source and an inductor in a circuit, and nothing else, still the expression of current is derived which is of finite magnitude. Now I might be wrong but I am taking the liberty of focusing my observation on the AC curcuit at a particular moment of time ,I assume here that my 'moment' is small enough to avoid any appreciable change in magnitude of current or its direction, so I am assuming it to be a DC source for this moment of time(which I don't know is valid or not).Given these assumptions and now comparing my momentary AC circuit to the one which is actually DC,how is the momentary AC circuit working when it has no resistance with reference to equation 1?
Comment: "I can observe that as I tend R towards 0 no current flows through the circuit , and current will be 0 when the resistance in circuit actually becomes 0." You didn't say how you reached that conclusion, but it is wrong. If you connect a voltage source V to an ideal inductor with no internal resistance, the current increases linearly at a rate where the back EMF equals the applied voltage - i.e. $V = L\dfrac{dI}{dt}$.
Comment: How? Ok I'll tell you how I reached my conclusion.First let the DC  circuit have inductor ,resistance and battery.Then I derive equation 1, now as R tends to 0 tau tends to infinity and as tau tends to infinity , e is raised to power 0, therefore i=i0(1-1)=0.This is the process through which I came to my conclusion that "if an ideal battery and ideal inductor are the sole elements in circuit , there can never be a current in it" , correct me if i am wrong.
Answer: I don't know what is meant by "...1" at the end of the equation, but otherwise the equation is for a series LR circuit connected to a dc (e.g., battery) source when a switch is first closed to connect the circuit to the battery and thereafter as time progresses.
The equation describes the dc transient behavior of the circuit between $t=0$ and $t=∞$ and assumes no initial current flowing in the circuit. The equation does not apply to the series LR behavior in an ac circuit.
The boundary conditions are $i=0$ at time $t=0$ the instant the switch is closed because you can't change the current through an ideal inductor instantaneously. At time $t=∞$ $i=i_0$  where $i_0$ is the final current and equals $\frac{V}{R}$ where $V$ is the battery voltage. This is because an ideal inductor looks like a short circuit to dc after transients have died out.
I should add that if you want to analyze the response of a series LR circuit to an ac source you will have to solve a first order differential equation. The following link may be of help to you in this regard:
https://www.mcvts.net/cms/lib07/NJ01911694/Centricity/Domain/134/1st%20order%20SystemsTransient%20Analysis.pdf
Hope this helps.
Comment: Hey Bob you did not adress my question the way I wanted , I'm not confused regarding these topics I'm confused when I approach these topics from the process I described in my question. Help
Comment: @ADITYAPRAKASH Not sure why you didn't since the answer you accepted was basically the same as mine except that it discussed varying R, which, as far as I can tell, was  not part of your question.. But that's always your prerogative.
Comment: I'm sorry , but @Farcher corrected my mistake in a way , the point where I was wrong was that current is 0 at all times in a DC circuit of inductor and battery because R is 0 , which ofcourse is not the case , and neither is the current equal to i0 at t=infinity , interestingly current will increase indefinitely, without an upper limit which I found in Farcher's answer , I'm sorry for not accepting your answer , though I'm genuinely indebted for your contribution towards clearing my doubt , but the framework of PSE is such that multiple answers cannot be accepted.Please understand
Answer: In the DC case powered by constant voltage source, the smaller the R, the greater is the final current. This is because in the end, all voltage is on the resistor, so it takes greater current to make RI equal to voltage of the source.
In both AC and DC case the current will flow even if resistance R is zero.
Comment: How can current flow in DC with no resistor
Comment: There is no resistance , where do I drop the potential at t=infinity , if there is no resistor
Comment: There is inductor in the circuit. All voltage drop is on that inductor. That also means current never stops increasing. It is idealization, in reality resistance of wires and inductor will be nonzero for high enough current.
Comment: @ADITYAPRAKASH wrote *"How can current flow in DC with no resistor"* - please understand that setting the resistance to zero doesn't mean remove the resistor.  Removing the resistor is equivalent to setting the resistance to 'infinity'.
Answer: The time constant of an resistor, $R$ and inductor, $L$, circuit is $\tau= \frac LR$.
As $R$ gets smaller and smaller the time constant gets larger and larger.
The initial charging current is $I_0 = \frac {\mathcal E}{R}$ where $\mathcal E$ is the emf of the voltage source.
The term $e^{- \frac {t}{\tau}}= e^{- \frac {Rt}{L}} $ can be expanded as far as the second term $1-\frac {Rt}{L}$ to a better and better approximation as $R$ becomes smaller and smaller.
So now your equation for the current is $I(t) =  \frac {\mathcal E}{R}\left ( 1-e^{- \frac {t}{\tau}}\right )\approx \frac {\mathcal E\,t}{L} $ and the approximation gets better and better as the resistance gets smaller and smaller.
Indeed if $R=0$ then $I(t) =   \frac {\mathcal E\,t}{L} $.
This expression can be found directly by having the voltage source connected an inductor with no resistance.
Then Kirchhoff's voltage law for such a circuit is $\mathcal E - L \frac{dI}{dt}$ and integration gives the same equation for the current, $I(t) =   \frac {\mathcal E\,t}{L} $.
Comment: Ok I was evaluating the limit incorrectly ,the current increases indefinitely

Current in only inductive AC circuit


Sky pixelated in camera raw merge

Question: I'm merging 5 photos using the PS Camera Raw merge.  The ground is fine in the merge but the sky is a bit pixelated.  I'm thinking this is because the sky changes slightly between the shots. Can anyone recommend a workaround?
Comment: Hi Charles and welcome to the site! It's hard for me to tell exactly what's going on. Maybe it would be helpful if you could post the source images (or some of them)? I've seen your other question about gamut warning. Is that one of your source images? The warning tells you that these red areas are just plain white with no details. The image is overexposed. If one or several of your images have such blank spots that could be the explanation. There simply isn't any data.
Comment: Thank you Wolff.  I'm going to keep looking into this.  The idea that the overexposure is the problem is interesting but I don't know how to change those exposures for the AEB setting on my camera.
Answer: A RAW overexposed - that's badly set camera! I guess  the image sensor in your camera is a bit smaller than full 35mm and you didn't check the exposure. Small sensor cameras have much less room for lousy settings than bigger ones.
If the camera allows exposure bracketing learn to use it in the next flights. You must take more shots, but the film costs are not a problem of today.
But assuming you cannot do a new flight you must replace the overexposed sky with something less disturbing. Of course the result a lie, but hopefully this is for leisure, not for anything critical where edits are forbidden.
Increase the canvas height to a square. Insert a new layer. Select the foreground and background color from the non-overexposed sky. You need blue and grey cloud.
Fill the new layer with Filter > Render > Clouds. Squeeze the rendering vertically to to the height of the original sky area to get more flat clouds:
Make a selection and cut a piece of the rendered sky. Paste it in place as a new layer. Close the rendered sky layer:

The selection was made with magic wand and it's not accurate enough except in small size and on the screen. You must learn how to make more precise selections. You must walk through the edge with big zoom and draw the new selection bit by bit.There's no shortcut for the job, but fortunately you can fully utilize background removal tutorials.

Sky pixelated in camera raw merge


Is there a torsion element in the homology cylinder group?

Question: The homology cylinder group is the monoid of homology cylinders modulo homology cobordism. I wonder whether there is any known finite order element in this group.
Comment: Could you explain which dimension(s) you're interested in? Since there's a 3-manifold tag, presumably the cylinders or their boundaries have dimension 3?
Comment: @Agol: I think he is referring to 3-dimensional cylinders with surface boundary.
Comment: @Agol: yes, Conant is right.
Answer: Certainly there is a lot of $2$-torsion. One easy way to construct such an example is to look at the embedding of the string link cobordism group on $n$ strands into the homology cobordism group of genus $n$. (Levine explains this embedding in his paper "Homology cylinders: an enlargment of the mapping class group." See Theorem 4 of that paper.) The string link group has lots of $2$-torsion. For example just tie an amphicheiral knot (which is not slice) into one of the strands. In fact the knot concordance group has infinitely many $\mathbb Z_2$ summands which inject into the homology cylinder group.
Comment: @HJ: this construction is for surfaces with one boundary component. I am sure there are other examples too. This paper http://arxiv.org/abs/0909.5580 shows there are infinitely many $\mathbb Z_2$ invariants, which should be realizable by actual homology cylinders, though I don't know off the top of my head.
Comment: Thank you! You helps me a lot. Is there any other example, for surfaces with boundary ?
Comment: @Conant: Would there be more example for more boundary componant?
Comment: @HJ: Sure. The map from string links to homology cobordisms extends to arbitrary numbers of components. Also, a string link is a homology cobordism of a planar surface so you get lots of direct examples that way.


Front coil spring broken and the part has been discontinued

Question: My son has a 1999 Infiniti Q45 that broke one of it's front coil springs.  It's near the bottom, so it still mostly works, but we want to fix it right.  However, we have looked at multiple online retailers and called several parts stores and junk yards in the area, but no one has a single replacement spring (or strut either, though his are typically sold separately).  Is there anyway to locate a compatible spring, even if it's not the exact part?  I have been trying to find the exact dimensions, but no one seems to have them.  One site might have said 8.2" diameter (inside? outside?), 19" long, but I can't find that site again now so I'm not sure.  Besides, nothing I've found in aftermarket parts seems anywhere near that big.  Is there anyway to resolve this, or is he just out of luck on this car?
Comment: Try internet salvage parts. I live near Houston and could not find a Nissan wheel in a junkyard. I had to go to an OK online site. Heat-treat of a spring is as important as dimensions so local manufacture is unlikely to match.
Answer: There are numerous companies that can make springs to order, which may be worth talking to, for example - https://www.skegsprings.co.uk/
I don't know anything about this example company, I just did a search on google.
A company like this will be able to make you a spring, or a matching pair, but may also be able to give you advice on common spring sizes.  It would be worth giving one a call.
You may even find that your coil springs are a common size that they have in stock.


Resonant Choke Filter Revisited

Question: The Resonant Choke filter in its traditional form looks like an orthodox choke input filter but it has a cap across the choke tuning it to twice the power frequency. This means 100 or 120 Hz depending on what part of the world. Intuitively you can get lower output ripple for a given output cap value compared to the normal choke input filter. In fact old audiophiles would sometimes "tune the choke" to reduce hum. Quite simply the choke and resonant cap form a high impedence parallel tuned circuit that blocks the 2F ripple. The higher order terms of the full wave rectified sine wave are of much lower amplitude and are dealt with by the output cap. An interesting aspect of this postwar circuit is that it has the potential for a good power factor but the old choke input filter can have a power factor that beats the cap input filter anyway. Could the choke in a resonant choke be smaller than the choke in a traditional choke input filter because less inductance is needed          ? What would be a sensible L/C ratio? Would the power factor compete with the valley fill? When this was originally done loads tended to have less variation. How would the resonant choke perform under changing loading?Is this circuit easy on the diode recovery making it a contender in a sine wave SMPS? How would it perform if it was slightly off resonance ? Would the component tolerances be reasonably broad for easy production ? Would the low THD input current waveform be useful for a quiet SMPS ?
Comment: LC resonator characteristic impedance \$Z_o=\sqrt{L/C}\$ is **the way** to find appropriate L/C ratio for parallel (series) resonance. This impedance compared to parallel (series) resistance seen sets \$Q=R_p/Z_o\$ (\$Q=Z_o/R_s\$)  pretty much defining overall behaviour (ringìng, bandwidth....)
Comment: Simulation is your friend here and that's exactly what I would do.
Comment: If I could I would .One day when I am not so bussey I will get with the program .I would like to see an analytical form if possible .
Answer: I just simulated a simple parallel inductor capacitor circuit. A 4H choke (common size for a guitar amp) requires a 440n cap to get a notch at exactly 120Hz. But with a 470n cap for example, the notch would be at 116Hz and so you would only get about 12dB attenuation (as opposed to more like 40dB if it really is tuned). Load has no effect on the resonance of the circuit in the simulation. I don't think it would work with SMPS because those chokes are usually pretty small. For example, a 100uH choke and 101.3n cap would resonate at 50kHz. But because the choke is so small, the notch is very narrow. I had to use 10ths of nano-farads to really get the 50kHz.
Comment: +1 for putting it on the simulator .What may be possible to show is that 1H tuned with 2.2 microfarad  will work plausibly .In reality the inducter loses some inductance when there is significant DC current flowing .This can  occur well before saturation .If you can secure the same ripple attenuation with say 1H then you can use a 40watt flouro choke on a valve amp .Ultimately if L gets small and C gets big the circulating currents will mean that L has to be rated for significantly more than the DC output current which means that L aint so small anymore.For the SMPS case LC could tune to  2F
Answer: I have been told that a frequency sweep is important because the filter has a deep notch, then good attenuation above the resonant frequency, but it has very poor rejection below the resonant frequency. I have not verified this but I believe the person who mentioned it and will have to check that myself.
In radio transmitters and RF amplifiers, the resonance is usually set a bit high, such as 12 5Hz for a 120 Hz ripple. The reason for this is so that as the choke inductance decreases with increasing load current, the resonant frequency does not dip below the ripple frequency and the power supply begin to behave as a capacitor input circuit.
It is prudent therefore to know the minimum inductance of the choke under all foreseen operating conditions. As power levels increase, especially voltages, these details become more important for safety reasons, i.e., non-exploding reasons. I have done numerous simulations in LTspice with various inductance and capacitance combinations. I am working on a power supply making 4800 VDC at 2 A, as part of a 3CX3000 RF linear power amplifier build. RF amps of this kind are tricky because they are almost always close to class B and so the very signal acts to modulate the output voltage of a carelessly or cheaply built power supply, in turn distorting the linearity of the signal.
One issue that shows up with non-resonant choke input power supplies is the generation of large voltage transients when abrupt changes in load current are present. Such transients are less common in audio equipment, but can appear in class B circuits used for single sideband, and become troublesome for 'pulsed' operation such as CW/Morse code, especially in high voltage circuits.
As an example, a simulation showed a 4 kV transient on top of the 4800V line when decreasing current from 2 A to 350 MA in 10 ms. The power supply was a full wave bridge rectifier followed by a 30 H choke and a 31 uF capacitor (not shown).
These transients can be greatly reduced with a resonant choke followed by a good size filter capacitor. Typical values seen were about 1 kV +/-300 V.
Those using LTspice may be interested in the way the current step with a resonant choke was simulated.

There is a discussion about this supply on amfone.net
http://amfone.net/Amforum/index.php?topic=44750.msg321900#msg321900
I am still researching this subject and that is what led me here. The only real remaining concern on my part is how the capacitor will handle the current. So, just wanted to share what I have learned about this so far. It's a very interesting topic. There is no reason not to post to an older question & answers, if more information can help.
The amplifier build is slowly continuing on bunkerofdoom.com, and that is where any solutions to our own power supply (exchange choke for resonant filter) will end up:
http://bunkerofdoom.com/3cx3000/index.html

Resonant Choke Filter Revisited