Question:
From what I have found, a very large amount of protocols that travel over the internet are "text-based" rather than binary. The protocols in question include, but are not limited to HTTP, SMTP, FTP (I think this one is all text-based?), WHOIS, IRC.
In fact, some of these protocols jump through some hoops whenever they want to transmit binary data.
Is there a reason behind this? Text-based protocols obviously have a bit of an overhead as they require sending more data to transmit the same amount of information (see example below). What benefits outweigh this?

By text-based, I mean most of the characters used in the protocol are between 0x20 (space) and 0x7E (~), with the occasional "special character" used for very special purposes, such as the newlines, null, ETX, and EOT. This is opposed to transmitting raw, binary data over the connection.
For instance, transmitting the integer 123456 as text would involve sending the string 123456 (represented in hex as 31 32 33 34 35 36), whereas the 32-bit binary value would be sent as (represented in hex) 0x0001E240 (and as you can see, "contains" the special null character.

When the world was younger, and computers weren't all glorified PCs, word sizes varied (a DEC 2020 we had around here had 36 bit words), format of binary data was a contentious issue (big endian vs little endian, and even weirder orders of bits were reasonably common). There was little consensus on character size/encoding (ASCII, EBCDIC were the main contenders, our DEC had 5/6/7/8 bits/character encodings). ARPAnet (the Internet predecessor) was designed to connect machines of any description. The common denominator was (and still is) text. You could be reasonably certain that 7-bit encoded text wouldn't get mangled by the underlying means to ship data around (until quite recently, sending email in some 8-bit encoding carried a guarantee that the recipient would get mutilated messages, serial lines were normally configured as 7-bit with one bit parity).
If you rummage around in e.g. the telnet or FTP protocol descriptions (the first Internet protocols, the network idea then was to connect remotely to a "supercomputer", and shuffle files to and fro), you see that the connection includes negotiating lots of details we take as uniform,
Yes, binary would be (a bit) more efficient. But machines and memories (and also networks) have grown enormously, so the bit scrimping of yore is a thing of the past (mostly). And nobody in their right mind will suggest ripping out all existing protocols to replace them with binary ones. Besides, text protocols offer a very useful debugging technique. Today I never install the telnet server (better use the encrypted SSH protocol for remote connections), but have to telnet client handy to "talk" to some errant server to figure out snags. Today you'd probably use netcat or ncat for futzing around...


Question:
My son Horatio (nine years old, fourth grade) came home with some fun math homework exercises today. One of his problems was the following little question:

I am thinking of a number...

It is prime.
The digits add up to $10.$
It has a $3$ in the tens place.

What is my number?

Let us assume that the problem refers to digits in decimal notation. Horatio came up with $37,$ of course, and asked me whether there might be larger solutions with more digits. We observed together that $433$ is another solution, and also $631$ and $1531.$ But also notice that $10333$ solves the problem, based on the list of the first $10000$ primes, and also $100333$, and presumably many others.
My question is: How many solutions does the problem have? In particular, are there infinitely many solutions?
How could one prove or refute such a thing? I could imagine that there are very large prime numbers of the decimal form $10000000000000\cdots00000333$, but don't know how to prove or refute this.
Can you provide a satisfactory answer this fourth-grade homework question?

As requested I'm posting this an answer. I wrote a short sage script to check the primality of numbers of the form $10^n+333$ where $n$ is in the range $[4,2000]$. I found that the following values of $n$ give rise to prime numbers:
$$4,5,6,12,53,222,231,416.$$
Edit 3: I stopped my laptop's search between 2000 and 3000, since it hadn't found anything in 20 minutes. I wrote a quick program to check numbers of the form $10^n+3*10^i+33$. Here are a couple

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033
100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300033
100000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000033
100000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000033
100000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000033
10000000000000000000000000000000003000000033
10000000000000000000000000000030000000000033
10000000000000000000000030000000000000000033
10000000003000000000000000000000000000000033

There seemed to be plenty of numbers of this form and presumably I could find more if I checked some of the other possible forms as outlined by dr jimbob.
Note: I revised the post a bit after jimbob pointed out I was actually looking for primes that didn't quite fit the requirements.
Edit 4: As requested here are the sage scripts I used.
To check if $10^n+333$ was prime:
for n in range(0,500):
  k=10^n+333
  if(is_prime(k)):
    print n

And to check for numbers of the form $10^n+3*10^i+33$:
for n in range(0,500):
  k=10^n+33
  for i in range(2,n):
    l=k+3*10^i
    if(is_prime(l)):
      print l


Question:
What would seem to be a silly question actually does have some depth to it. I was trying to scoop out some of my favorite soft name-brand ice cream when I noticed it was frozen solid, rather than its usual creamy consistency. After leaving it out for 10 minutes, it was nice and creamy again.
Notably, that amount of time wasn't long enough for it to "melt", as it would still not flow were the container flipped upside down, just long enough to "soften". So why is it that ice cream becomes stiffer/harder when cooled and softer when allowed to warm slightly?
My Hypothesis:
I think the "hardness" of the ice cream is largely determined by the properties of the ice crystals within, which change somehow with temperature. Now while I don't know how they do change, I'm fairly certain of how they don't.
You could view the temperature of the ice cream as infinitely many concentric layers, from a layer of maximum temperature on the outside of the ice cream given the ice cream warms from the outside in, to the point of minimum temperature at roughly the center of the ice cream. Therefore, it's fair to assume that partial melting and therefore decrease in size of each ice crystal is unlikely, as that would require a very thick "band" of ice cream layers to be at a transition temperature between completely crystalline and completely molten, which would only be likely with very slow cooling.

A couple of decades ago I was peripherally involved with some research on the properties of ice cream being done by the company Walls in the UK. The work was on relating the consistency of the ice cream to the microstructure, so it was quite closely related to your question.
Anyhow, ice cream has a surprisingly complicated microstructure. It contains ice crystals, liquid sugar solution, fat globules and air bubbles (the proportions of these change with the type and quality of the ice cream). At temperatures from zero down to typical domestic freezer temperatures it is not frozen solid because the sugar depresses the freezing point of water and the concentrated sugar solution remains liquid.
The amount of the liquid phase present decreases with decreasing temperature. If you imagine starting at zero C then as you lower the temperature crystals of ice form, which pulls water out of the fluid phase and increases the sugar concentration in the fluid phase. This depresses the freezing point until it matches the freezer temperature at which point the system is in equilibrium. Lower the temperature further and this forms more ice crystals, increases the sugar concentration still further and depresses the freezing point of the liquid phase still further. And so on. The liquid phase doesn't disappear completely until you get down to very, very low temperatures at which point the remaining sugar solution freezes as a glass.
It's this change in the amount of the liquid phase present that is causing the changes you have observed. As you warm the initially very cold ice cream you melt some of the ice crystals and get more fluid phase, plus the viscosity of the fluid phase decreases as it gets more dilute. Both of these soften the ice cream.
I should emphasise that this is a very simplified account of a very complicated rheological behaviour, but it should give you a basic idea of what is going on. The details are endlessly fascinating if you're a colloid scientist (or just like ice cream). For example sugar poisons the surface of the ice crystals and changes their morphology. In ice cream the crystals tend to be rounded blobs rather than the jagged crystals ice usually forms. This also affects the rheology since the rounded crystals flow over each other more easily.


Question:
Can someone explain this to me by drawing resonance structures for the cyclopropylmethyl carbocation please?
Also one more question, is the tricyclopropylmethyl carbocation more stable than tropylium ion?

It is commonly said, that a cyclopropane fragment behaves somewhat like a double bond. It can conjugate, and pass mesomeric effect similar to a double bond, but the donor orbital is $\sigma_{\ce{C-C}}$ instead of $\pi_{\ce{C=C}}$. Cyclopropane can be considered as a complex of a carbene and an alkene, where the carbene $\mathrm{p}$ orbital interacts with the $\pi^*_{\ce{C=C}}$ orbital while the carbene $\mathrm{sp^2}$ orbital interacts with the $\pi_{\ce{C=C}}$ orbital, so this 'virtual' double bond behaves somewhat like a normal double bond.
On the other hand, the structure of the cyclopropylmethyl cation is downright weird. It is well known that both cyclopropylmethyl and cyclobutyl derivatives give very similar product mixture under $\mathrm{S_N1}$ hydrolysis conditions, resulting in both cyclopropylmethyl and cyclobutyl derivatives (see, for example, J. Am. Chem. Soc. 1951, 73 (6), 2509–2520). This is commonly described by the conjugation in following manner (here, the 1-cyclopropylethyl cation is depicted):

Here bonding of $\ce{C-4}$ with $\ce{C-1}$ and $\ce{C-2}$ can be roughly described as an interaction of the vacant $\mathrm{p}$-orbital of $\ce{C-4}$ with filled orbital of $\pi$-bond between $\ce{C-1}$ and $\ce{C-2}$. It does not matter much, where the original leaving group was - at  $\ce{C-2}$ or $\ce{C-1}$. Since the positive charge is more or less symmetrically distributed between three atoms and the small ring is somewhat relieved of its geometrical strain (both cyclopropane and cyclobutane are very strained molecules, not only due to angle strain, but also considerable steric interactions between hydrogens), the cation has remarkable stability.
Similar effects are common in the chemistry of small bicyclic systems, with norbornane derivitives being the chosen test subjects for decades with the 2-norbornyl cation being probably the most well-known example. March's Advanced Organic Chemistry, 7th ed., Section 10.C.i discusses such nonclassical carbocations in great detail, with the cyclopropylmethyl system being described on pp 404–406.
With further addition of multiple cyclopropyl groups, however, the full conjugation becomes sterically hindered, so extra groups beyond the first have less of an effect. Of course, the stability of these cations is far below that of the tropylium cation, which has very little strain and also possesses aromatic character, distributing the positive charge over seven(!) carbon atoms.  In fact, the stability of the tropylium system is so high, that even the cyclooctatrienyl cation (also known as the homotropylium cation) adopts a similar structure.


Question:
Bowtie2 is probably the most widely used aligner because of it's speed. Burrow-wheeler (BW) algorithms (including bwa) tend to be faster. However, they have limitations when it comes to aligning very short reads (e.g. gRNA). Also, setting maximum number of mismatches allowed is complicated by the seed length, overlaps and other parameters.
I wonder if there is any better multi-purpose aligner out there. May be with algorithm other that BW. One which allows special cases e.g. allowing shord reads and high number of mismatches.

Note from @bricoletc: bowtie2 uses an FM index for read alignment, which is built on top of the Burrows-Wheeler transform. So both bowtie2 and bwa are BW-based aligners.

Bowtie2 is no longer the fastest aligner. As you point out, BWA is faster, despite being based on the same Burrows-Wheeler transform as Bowtie2. As @user172818 points out, bwa-aln will work better for very short sequences under 36bp.
For transcript mapping, Salmon and Kallisto are much faster, but have been designed to optimise cDNA-seq mapping. Their speed is gained from avoiding a strict base-to-base alignment, but they can output mostly-aligned reads (i.e. position-only, without local alignment) as pseudo-alignments. See here for more details.
Both Kallisto and Salmon can do additional bootstrapping that is interpreted by sleuth (and other downstream tools) for improved performance in isoform detection. They can also output counts that are equivalent to read-level counts from other programs, which can then be used by other downstream gene-based differential expression analysis software (e.g. DESeq2). Salmon has additional options that can  correct mappings for sequence-level and GC bias.
HISAT2 is from the same group as Bowtie2, and does the same sort of stuff, but with a few optimisations added on top. In particular, it's much better at working out split reads from RNASeq runs, while also working for genomic alignments. Like Bowtie2, it will do local alignment of reads.
For quick genomic alignment of long reads, minimap2 works well. For high-accuracy alignment (but comparatively slower), LAST works well.
There are two programs I have used that are specifically designed for long read transcript quantification that process minimap2 read mapping into isoform counts (based on a provided reference transcriptome): bambu and oarfish. Both seem to work reasonably well; bambu is a native R package with nice isoform visualisation included; oarfish produces Salmon-like output that can be imported into R via tximport.
Most bioinformaticians seem to prefer STAR for things that Bowtie2 was previously used for. I'm not yet convinced it's a better alternative, and currently prefer HISAT2 for high accuracy short-read alignment.
According to @kasper-thystrup-karstensen, STAR is able to read Chimeric alignments (for detecting e.g. circular RNA through custom coding).


Question:
When comparing o,m,p-toluidine basicities, the ortho effect is believed to explain why o-toluidine is weaker. But when comparing o,m,p-toluic acid basicities, the ortho effect is stated as a reason why o-toluic acid is stronger acid. I was told that the ortho effect is a phenomenon in which an ortho- group causes steric hindrance, forcing the $\ce{-COOH}$, $\ce{-NH2}$ or some other bulky group to move out of the plane, inhibiting resonance. Then, if the ortho effect inhibits resonance, why is o-toluic acid the strongest and o-toluidine the weakest?
Where am I going wrong in my understanding of the ortho effect?

I'd like to throw a tentative explanation for the ortho effect into the ring:

In the molecules in question, an interaction between the protons of the methyl group and the lone pair of the amine nitrogen and the negative charge on the carboxylate, respectively,  can be assumed.
In the first case, the electron density on the N atom is (slightly) reduced, and thus the basicity of o-toluidine.
In the latter case, a similar interaction provides additional stabilisation of the carboxylate. As a result, o-toluic acid is more acidic than the isomers.


Question:
I am fairly new to DSP, and have done some research on possible filters for smoothing accelerometer data in python. An example of the type of data Ill be experiencing can be seen in the following image:

Essentially, I am looking for advice as to smooth this data to eventually convert it into velocity and displacement. I understand that accelerometers from mobile phones are extremely noisy.
I dont think I can use a Kalman filter at the moment because I cant get hold of the device to reference the noise produced by the data (I read that its essential to place the device flat and find the amount of noise from those readings?)
FFT has produced some interesting results. One of my attempts was to FFT the acceleration signal, then render low frequencies to have a absolute FFT value of 0. Then I used omega arithmetic and inverse FFT to gain a plot for velocity. The results were as follows:

Is this a good way to go about things? I am trying to remove the overall noisy nature of the signal but obvious peaks such as at around 80 seconds need to be identified.
I have also tired using a low pass filter on the original accelerometer data, which has done a great job of smoothing it, but I'm not really sure where to go from here.
Any guidance on where to go from here would be really helpful!
EDIT: A little bit of code:
for i in range(len(fz)):
    testing = (abs(Sz[i]))/Nz

    if fz[i] < 0.05:
        Sz[i]=0

Velfreq = []
Velfreqa = array(Velfreq)
Velfreqa = Sz/(2*pi*fz*1j)
Veltimed = ifft(Velfreqa)
real = Veltimed.real

So essentially, ive performed a FFT on my accelerometer data, giving Sz, filtered high frequencies out using a simple brick wall filter (I know its not ideal). Then ive use omega arithmetic on the FFT of the data.
Also thanks very much to datageist for adding my images into my post :)

As pointed out by @JohnRobertson in Bag of Tricks for Denoising Signals While Maintaining Sharp Transitions, Total Variaton (TV) denoising is another good alternative if your signal is piece-wise constant. This may be the case for the accelerometer data, if your signal keeps varying between different plateaux.
Below is a Matlab code that performs TV denoising in such a signal. The code is based on the paper An Augmented Lagrangian Method for Total Variation Video Restoration. The parameters $\mu$ and $\rho$ have to be adjusted according to the noise level and signal characteristics.
If $y$ is the noisy signal and $x$ is the signal to be estimated, the function to be minimized is $\mu\|{x-y}\|^2+\|{Dx}\|_1$, where $D$ is the finite differences operator.
function denoise()

f = [-1*ones(1000,1);3*ones(100,1);1*ones(500,1);-2*ones(800,1);0*ones(900,1)];
plot(f);
axis([1 length(f) -4 4]);
title('Original');
g = f + .25*randn(length(f),1);
figure;
plot(g,'r');
title('Noisy');
axis([1 length(f) -4 4]);
fc = denoisetv(g,.5);
figure;
plot(fc,'g');
title('De-noised');
axis([1 length(f) -4 4]);

function f = denoisetv(g,mu)
I = length(g);
u = zeros(I,1);
y = zeros(I,1);
rho = 10;

eigD = abs(fftn([-1;1],[I 1])).^2;
for k=1:100
    f = real(ifft(fft(mu*g+rho*Dt(u)-Dt(y))./(mu+rho*eigD)));
    v = D(f)+(1/rho)*y;
    u = max(abs(v)-1/rho,0).*sign(v);
    y = y - rho*(u-D(f));
end

function y = D(x)
y = [diff(x);x(1)-x(end)];

function y = Dt(x)
y = [x(end)-x(1);-diff(x)];

Results:


Question:
I have been observing my cat and found that when confronted with an unknown item, she will always use her front left paw to touch it.
This has me wondering if animals exhibit handedness like humans do? (and do I have a left handed cat?)
One note of importance is that with an unknown item, her approach is always identical, so possibly using the left paw means allowing a fast possible exit based on how she positions her body.
This question is related to Are there dextral/sinistral higher animals?. However, I question the "paw-ness" as a consequence of how the cat is approaching new items (to be ready to flee), whereas the other question remarks about the high number of "right-pawed" dogs and questions the influence of people for this preference.

Short Answer
Yes. handedness (or Behavioral Lateralization) has been documented in numerous vertebrates (mammals, reptiles and birds) as well as invertebrates.

This includes domestic cats (see Wells & Millsopp 2009).

 Long Answer
There have been numerous studies that have documented behavioral lateralization in many groups of animals including lower vertebrates (fish and amphibians), reptiles (even snakes!), birds and mammals. More recent work (e.g., Frasnelli 2013) has also shown that lateralization can also occur in invertebrates. In other words, "handedness" (or pawedness, footedness, eyedness, earedness, nostriledness,
toothedness, breastedness, gonadedness, etc.) occurs rather extensively across the animal kingdom.

These studies suggest that the evolution of brain lateralization, often linked to lateralized behaviors, may have occurred early in evolutionary history and may not have been the result of multiple independent evolutionary events as once thought.

Although this view of brain lateralization as a highly conserved trait throughout evolutionary history has gained popularity, it's still contested (reviewed by Bisazza et al. 1998; Vallortigara et al. 1999).

Note: Laterality of function may manifest in terms of preference (frequency) or performance (proficiency), with the former being far more often investigated.
And no, right-handedness is not always dominant.
But Why?

One hypothesis is that brain lateralization was the evolutionary result of the need to break up complex tasks and perform them with highly specialized neuronal units to avoid functional overlap (i.e., to account for "functional incompatibility").

In humans, many hypotheses have been developed including: division of labor, genetics, epigenetic factors, prenatal hormone exposure, prenatal vestibular asymmetry, and even ultrasound exposure in the womb.

Snake studies (see below) have suggested lateralization behavior can be dictated by environmental conditions (specifically, temperature).

Other work (Hoso et al. 2007) suggest that lateralization could be the result of convergent evolution. In this case, snakes developed feeding aparati that allow them to better consume more-common dextral species of snails.

Note: dextral (meaning "clockwise") is a type of chirality -- another form of "handedness"

Reviews:

Lateralization in non-human primates: McGrew & Marchant 1997.

Lateralized behaviors in mammals and birds:
Bradshaw & Rogers 1993; Rogers & Andrew 2002.

Lateralized behaviors in lower vertebrates: Bisazza et al. 1998; Vallortigara et al. 1999.

Some Examples:
Invertebrates

Some spiders appear to favor certain appendages for prey handling and protection (Ades & Novaes Ramires 2002).

Octopi (or octopodes) preferably use one eye over the other (Byrne et al. 2002; with seemingly no preference for right/left at the population level: Byrne et al. 2004) and also apparently have a preferred arm (Byrne et al. 2006).

Fish

Preferential ventral fin use in the gourami (Trichogaster trichopterus). [Bisazza et al. 2001].

Preferential eye use in a variety of fish species [Sovrano et al. 1999, 2001].

Amphibians

Lateralization of neural control for vocalization in frogs (Rana pipiens). [Bauer 1993].

Preferential use of hindlimbs (Robins et al. 1998), forelimbs (Bisazza et al. 1996) and eyes (Vallortigara et al. 1998) in adult anurans.

Snakes

Preferential use of right hemipenis over left under warm conditions. [Shine et al. 2000].

Coiling asymmetries were found at both the individual and population levels. [Roth 2003].

Birds

Tendency for parrots to use left-feet when feeding. [Friedmann & Davis 1938].

Mammals

Pawdness in mice. [Collins 1975].

left forelimb bias in a species of bat when using hands for climbing/grasping. [Zucca et al. 2010]

Behavior experiments show domesticated cats show strong preference to consistently use either left or right paw and that the lateralized behavior was strongly sex related (in their population: ♂ = left / ♀ = right). [Wells & Millsopp 2009].

Non-human Primates

Posture, reaching preference, tool use, gathering food, carrying, and many other tasks. See McGrew & Marchant (1997) for review.

Citations

Ades, C., and Novaes Ramires, E. (2002). Asymmetry of leg use during prey handling in the spider Scytodes globula (Scytodidae). Journal of Insect Behavior 15: 563–570.

Bauer, R. H. (1993). Lateralization of neural control for vocalization by the frog (Rana pipiens). Psychobiology, 21, 243–248.

Bisazza, A., Cantalupo, C., Robins, A., Rogers, L. J. & Vallortigara, G. (1996). Right-pawedness in toads. Nature, 379, 408.

Bisazza, A., Rogers, L. J. & Vallortigara, G. (1998). The origins of cerebral asymmetry: a review of evidence of behavioural and brain lateralization in fishes, reptiles and amphibians. Neuroscience and Biobehavioral Reviews, 22, 411–426.

Bisazza, A., Lippolis, G. & Vallortigara, G. (2001). Lateralization of ventral fins use during object exploration in the blue gourami (Trichogaster trichopterus). Physiology & Behavior, 72, 575–578.

Bradshaw, J. L. & Rogers, L. J. (1993). The Evolution of Lateral Asymmetries, Language, Tool Use and Intellect. San Diego: Academic Press.

Byrne, R.A., Kuba, M. and Griebel, U. (2002). Lateral asymmetry of eye use in Octopus vulgaris. Animal Behaviour, 64(3):461-468.

Byrne, R.A., Kuba, M.J. and Meisel, D.V. (2004). Lateralized eye use in Octopus vulgaris shows antisymmetrical distribution. Animal Behaviour, 68(5):1107-1114.

Byrne, R.A., Kuba, M.J., Meisel, D.V., Griebel, U. and Mather, J.A. (2006). Does Octopus vulgaris have preferred arms?. Journal of Comparative Psychology 120(3):198.

Collins RL (1975) When left-handed mice live in righthanded worlds. Science 187:181–184.

Friedmann, H., & Davis, M. (1938). " Left-Handedness" in Parrots. The Auk, 55(3), 478-480.

Hoso, M., Asami, T., & Hori, M. (2007). Right-handed snakes: convergent evolution of asymmetry for functional specialization. Biology Letters, 3(2), 169-173.

McGrew, W. C., & Marchant, L. F. (1997). On the other hand: current issues in and meta‐analysis of the behavioral laterality of hand function in nonhuman primates. American Journal of Physical Anthropology, 104(S25), 201-232.

Robins, A., Lippolis, G., Bisazza, A., Vallortigara, G. & Rogers, L. J. (1998). Lateralized agonistic responses and hindlimb use in toads. Animal Behaviour, 56, 875–881.

Rogers, L. J. & Andrew, R. J. (Eds) (2002). Comparative Vertebrate Lateralization. Cambridge: Cambridge University Press.

Roth, E. D. (2003). ‘Handedness’ in snakes? Lateralization of coiling behaviour in a cottonmouth, Agkistrodon piscivorus leucostoma, population. Animal behaviour, 66(2), 337-341.

Shine, R., Olsson, M. M., LeMaster, M. P., Moore, I. T., & Mason, R. T. (2000). Are snakes right-handed? Asymmetry in hemipenis size and usage in gartersnakes (Thamnophis sirtalis). Behavioral Ecology, 11(4), 411-415.

Sovrano, V. A., Rainoldi, C., Bisazza, A. & Vallortigara, G. (1999). Roots of brain specializations: preferential left-eye use during mirror-image inspection in six species of teleost fish. Behavioural Brain Research, 106, 175–180.

Sovrano, V. A., Bisazza, A. & Vallortigara, G. (2001). Lateralization of response to social stimuli in fishes: a comparison between different methods and species. Physiology & Behavior, 74, 237– 244.

Vallortigara, G., Rogers, L. J., Bisazza, A., Lippolis, G. & Robins, A. (1998). Complementary right and left hemifield use for predatory and agonistic behaviour in toads. NeuroReport, 9, 3341–3344.

Vallortigara, G., Rogers, L. J. & Bisazza, A. (1999). Possible evolutionary origins of cognitive brain lateralization. Brain Research Reviews, 30, 164–175.

Wells, D. L., & Millsopp, S. (2009). Lateralized behaviour in the domestic cat, Felis silvestris catus. Animal Behaviour, 78(2), 537-541.

Zucca, P., Palladini, A., Baciadonna, L. and Scaravelli, D. (2010). Handedness in the echolocating Schreiber's long-fingered bat (Miniopterus schreibersii). Behavioural processes, 84(3): 693-695.


Question:
My youngest son is in $6$th grade. He likes to play with numbers. Today, he showed me his latest finding. I call it his "Sum of Some" because he adds up some selected numbers from a series of numbers, and the sum equals a later number in that same series. I have translated his finding into the following equation:
$$(100\times2^n)+(10\times2^{n+1})+2^{n+3}=2^{n+7}.$$
Why is this so? What is the proof or explanation? Is it true for any $n$?
His own presentation of his finding:

Every one of these numbers is two times the number before it.
  $1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192$.
  I pick any one of them, times $100$. Then I add the next one, times $10$. Then I skip the next one. Then I add the one after that.
  If I then skip three ones and read the fourth, that one equals my sum!

Factor out the $2^n$ and you get: $2^n (100+20+8) = 2^n 128 = 2^{n+7}$ since $2^7 = 128$


Question:
If $A$ and $B$ are square matrices such that $AB = I$, where $I$ is the identity matrix, show that $BA = I$.

I do not understand anything more than the following.

Elementary row operations.
Linear dependence.
Row reduced forms and their relations with the original matrix.

If the entries of the matrix are not from a mathematical structure which supports commutativity, what can we say about this problem?
P.S.: Please avoid using the transpose and/or inverse of a matrix.

Dilawar says in 2. that he knows linear dependence! So I will give a proof, similar to that of TheMachineCharmer, which uses linear independence.
Suppose each matrix is $n$ by $n$. We consider our matrices to all be acting on some $n$-dimensional vector space with a chosen basis (hence isomorphism between linear transformations and $n$ by $n$ matrices).
Then $AB$ has range equal to the full space, since $AB=I$. Thus the range of $B$ must also have dimension $n$. For if it did not, then a set of $n-1$ vectors would span the range of $B$, so the range of $AB$, which is the image under $A$ of the range of $B$, would also be spanned by a set of $n-1$ vectors, hence would have dimension less than $n$.
Now note that $B=BI=B(AB)=(BA)B$. By the distributive law, $(I-BA)B=0$. Thus, since $B$ has full range, the matrix $I-BA$ gives $0$ on all vectors. But this means that it must be the $0$ matrix, so $I=BA$.


Question:
In an answer to a previous question, it was stated that one should

zero-pad the input signals (add zeros to the end so that at least half of the wave is "blank")

What's the reason for this?

Zero padding allows one to use a longer FFT, which will produce a longer FFT result vector.
A longer FFT result has more frequency bins that are more closely spaced in frequency.  But they will be essentially providing the same result as a high quality Sinc interpolation of a shorter non-zero-padded FFT of the original data.
This might result in a smoother looking spectrum when plotted without further interpolation.
Although this interpolation won't help with resolving or the resolution of and/or between adjacent or nearby frequencies, it might make it easier to visually resolve the peak of a single isolated frequency that does not have any significant adjacent signals or noise in the spectrum.  Statistically, the higher density of FFT result bins will probably make it more likely that the peak magnitude bin is closer to the frequency of a random isolated input frequency sinusoid, and without further interpolation (parabolic, et.al.).
But, essentially, zero padding before a DFT/FFT is a computationally efficient method of interpolating a large number of points.
Zero-padding for cross-correlation, auto-correlation, or convolution filtering  is used to not mix convolution results (due to circular convolution).  The full result of a linear convolution is longer than either of the two input vectors.  If you don't provide a place to put the end of this longer convolution result, FFT fast convolution will just mix it in with and cruft up your desired result.  Zero-padding provides a bunch zeros into which to mix the longer result.  And it's far far easier to un-mix something that has only been mixed/summed with a vector of zeros.


Question:
My colleague and I have developed a software tool intend to release it open-source. This tool is specifically for tasks in bioinformatics but we think it would be helpful for the wider community. Our institution will permit us to release it provided we get appropriate credit.
Thus we wish to publish it in peer-review. Is peer-review publication of bioinformatics software available? If so what is required to publish it?

There are whole journals based primarily around publishing open source tools. The primary example of that is "Bioinformatics", where a lot of the open-source tools are published. We've also had luck publishing in the Nucleic Acids Research yearly special webservers issue, since we make Galaxy wrappers around our tools.
You can also publish on tools in venues like Nature Methods, but it's vastly more difficult to get in there if your paper is purely on a tool and it's not something game-changing like salmon or kallisto.
Regarding what's actually needed to publish a tool, you will typically need the following:

Decent documentation. I ask for this as a reviewer and am asked about it when I submit things.
Easy installation. No one wants to spend two hours trying to compile your tool, so make sure there's a conda package or at least a docker container for it.
Test data. Without this your reviewers and users will likely not be happy since they won't be able to try it out on something small.

For the actual submission you'll tend to need comparisons to other tools. I'm generally not a big fan of this, but you will find that some reviewers will demand it (assuming there are other tools that do something similarish to yours).


Question:
Given the following:

bruises are caused by minor trauma which breaks blood vessels beneath the skin, causing bleeding
the mechanism by which bleeding stops is clotting
blood clots inside the body have an unfortunate tendency to get into the bloodstream and cause blockages, leading to severe problems such as strokes or heart attacks

why is it that people don't die from bruises?  What mechanism does the human body have to keep this from happening?

blood clots inside the body have an unfortunate tendency to get into the bloodstream and cause blockages, leading to severe problems such as strokes or heart attacks

This statement is primarily true only for blood clots within blood vessels, especially in the veins. When you are talking about bruising, you are talking about clots outside of the vasculature.
When a blood clot occurs in an artery, it can block that artery or break off, flow downstream, and block some smaller distal vessel. These events are most severe when they affect crucial organs like the brain and heart ("stroke" or "heart attack"), though of course any organ can be damaged in this way. However, blood clots in arteries can't ever directly affect a tissue that is not distal from where the clot starts, because they can never pass through capillaries or travel backward.
When a blood clot occurs in a vein and is dislodged, it can follow the increasingly larger venous system back to the heart, where it can cause a pulmonary embolism (blockage in the lungs) or, via a patent foramen ovale, travel to the left-side circulation and end up anywhere, including the coronary arteries or blood vessels of the brain. Similarly, clots that form in the venous return from the lungs to the heart or in the left side of the heart itself can travel anywhere (except the lungs) and create a blockage.
For a clot outside the vasculature, for it to have an effect somewhere else systemically it must re-enter the vasculature. This is simply not possible in most situations, because the vessels involved are very small, and during bleeding the blood is flowing out of vessels: there is no pressure gradient to push the clot back into the vessels.
In more severe cases of injury where major vessels are involved, clotting in those major vessels can indeed be a problem, but not for common occurrences of bruising.
(see also @anongoodnurse's answer that contains a good clarification of what exactly a bruise is, as well as how there are risks from very serious bruises but not the same way the original question implied)


Question:
I've been trying to design a charging system for a small robot powered by a 2S 20C lithium polymer (LiPo) battery. Were I to trust everything I read online, I would believe that the LiPo will kill me in my sleep and steal my life savings. The common advice I read, if you are brave enough to use LiPo batteries, is "never leave unattended", "never charge on top of a flammable or conductive surface", and "never charge at a rate faster than 1 C".
I understand why this is prudent, but what is the actual risk with LiPo batteries?
Nearly every cell phone, both Android and iPhone alike, contains a LiPo battery, which most people, including myself, charge while unattended—often-times while left on a flammable or conductive surface. Yet you never hear about someone bursting into flames because their cell phone exploded. Yes, I know there are freak accidents, but how dangerous are modern LiPo batteries? Why do so many online commenters treat stand-alone LiPo batteries like bombs waiting to go off, but don't even think twice about the LiPo sitting in their pocket?

Every cell phone (as well as laptop and nearly everything with a rechargeable battery) uses LiIon/LiPo (essentially equivalent for the purposes of this discussion). And you're right: In terms of actual incidences, lithium-ion and lithium-polymer are the safest battery chemistry to be in wide use, bar none.
And the only reason this now ubiquitous chemistry hasn't murdered you and/or your family several times over is that these cells aren't charged unattended. You may not be attending it personally, but every single one of those lithium-ion batteries has a significant amount of protection and monitoring circuitry that is permanently integrated into the pack. It acts as the gatekeeper. It monitors every cell in a battery.

It disconnects the output terminals and prevents them from being overcharged.
It disconnects the output if they are discharged at too high a current.
It disconnects the output if it is CHARGED at too high a current.
If any of the cells are going bad, the output is disconnected.
If any cell gets too hot, it disconnects the output.
If anyone of the cells is over-discharged, it disconnects the output (and permanently - if you forget to charge a lithium-ion battery for too long, you will find that it will no longer charge. It is effectively destroyed, and the protection circuit will not permit you to charge the cells).

Indeed, every single phone battery, laptop battery, *whatever battery that is a rechargeable lithium chemistry is the most closely monitored, scrutinized, and actively managed, the diametric opposite of 'unattended' as one can get for a battery.
And the reason so much extra trouble is done is because lithium-ion batteries are actually that dangerous. They need protection circuitry to be safe, and they are not even remotely safe without it. Other chemistries such is NiMH or NiCad can be used relatively safely as bare cells, without any monitoring. If they get too hot, they can vent (which has happened to me personally), and it can be pretty startling, but it isn't going to burn down your house or land you an extended stay in a burn unit. Lithium-ion batteries will do both, and that's pretty much the only outcome. Ironically, lithium-ion batteries have become the safest packaged battery by being the most dangerous battery chemistry.
You might be wondering what actually makes them so dangerous.
Other battery chemistries, such as lead-acid or NiMH or NiCad, are not pressurized at room temperature, though heat does generate some internal pressure. They also have aqueous, non-flammable electrolytes. They store energy in the form of a relatively slow oxidation/reduction reaction, one whose rate of energy release is too low to, say, cause them to eject 6-foot jets of flame. Or any flame, really.
Lithium-ion batteries are fundamentally different. They store energy like a spring. That's not a metaphor. Well, like two springs. Lithium ions are forced between the atoms of covalently-bonded anode material, pushing them apart and 'stretching' the bonds, storing energy. This process is called intercalation. Upon discharge, the lithium ions move out of the anode and into the cathode. This is very much electromechanical, and both the anode and cathode experience significant mechanical strain from this.
In fact, both anode and cathode alternatively increase or decrease in physical volume depending on the battery's state of charge. This change in volume is uneven however, so a fully charged lithium-ion battery is actually exerting nontrivial amounts of pressure on its container or other parts of itself. Lithium-ion batteries are generally under a lot of internal pressure, unlike other chemistries.
The other problem is their electrolyte is a volatile, extremely flammable solvent that will burn quite vigorously and easily.
The complex chemistry of lithium-ion cells is not even completely understood, and there are a few different chemistries with different levels of reactivity and inherent danger, but the ones with high energy density all can undergo thermal runaway. Basically, if they get too hot, lithium ions will begin reacting with oxygen stored as metal oxides in the cathode and release even more heat, which accelerates the reaction further.
What inevitably results is a battery that self-ignites, sprays its highly flammable solvent electrolyte out of itself, and promptly ignites that as well, now that a fresh supply of oxygen is available. That's just bonus fire however, there is still a ton of fire from the lithium metal oxidizing with the ample store of oxygen inside.
If they get too hot that happens. If they are overcharged, they become unstable and mechanical shock can make them go off like a grenade. If they are over-discharged, some of the metal in the cathode undergoes an irreversible chemical reaction and will form metallic shunts. These shunts will be invisible, until charging expands part of the battery enough that the separating membrane is punctured by one of these shunts, creating a dead short, which of course results in fire, etc.: The lithium-ion failure mode we know and love.
So, just to be clear, not only is overcharging dangerous, but so is over-discharging, and the battery will wait until you've pumped a ton of energy back into it before spectacularly failing on you, and without any warning or measurable signs.
That covers consumer batteries. All this protection circuitry is less able to mitigate the danger of high drain applications, however. High drain generates no small amount of heat (which is bad) and more worrying, it causes huge amounts of mechanical stress on the anode and cathode. Fissures can form and widen, leading to instability if you're unlucky, or just a shorter useful life if it is not too severe. This is why you see LiPos rated in 'C', or how quickly they can be safely discharged. Please, take those ratings seriously and derate it, both for safety and because many manufacturers simply lie about the C rating of their batteries.
Even with all that, sometimes an RC Lipo will just burst into flame for no reason. You absolutely need to heed the warnings to never charge them unattended, and everything else. You should buy a safety bag to charge them in because it might prevent your house from burning down (possibly with you or loved ones inside). Even if the risk is very low, the damage it can cause is vast, and the measures needed to mitigate most of that potential for damage are trivial.
Don't ignore everything you're being told - it's all spot on. It comes from people who have learned to respect LiPos for what they are, and you should too. The thing you definitely want to avoid is having this lesson taught to you by a lithium-ion battery, instead of peers online and offline. The latter might flame you on a forum, but the former will literally flame you.
Let's see some videos of stuff exploding!
Let me go a little more into how they fail. I've discussed the mechanism, but what really happens? Lithium-ion batteries really only have one failure mode, which is kind of exploding then shooting out a stunningly huge amount of fire in a giant jet of flame for several seconds, and then continuing general burning-related activities for a bit after that. This is a chemical fire, so you cannot extinguish it (lithium-ion batteries will still shoot out huge jets of fire even in the vacuum of space. The oxidizer is contained inside, it doesn't need air or oxygen to burn). Oh, and throwing water on lithium does nothing good, at least in terms of fire reduction.
Here is a 'greatest hits' list of some good examples of failure. Note that this does sometimes happen in high drain RC cases even with proper safety measures in place. Comparing high drain applications to the much safer and lower currents of phones is not at all a valid one. Hundreds of amperes ≠ a few hundred milliamperes.
RC plane failure.
Knife stabs smartphone-sized battery.
Overcharged LiPo spontaneously explodes.
Laptop battery in a thermal runaway is lightly pressed on, making it explode.


Question:
What is the preferred and efficient approach for interpolating multidimensional data?
Things I'm worried about:

performance and memory for construction, single/batch evaluation
handling dimensions from 1 to 6
linear or higher-order
ability to obtain gradients (if not linear)
regular vs scattered grid
using as Interpolating Function, e.g. to find roots or to minimize
extrapolation capabilities

Is there efficient open-source implementation of this?
I had partial luck with scipy.interpolate and kriging from scikit-learn.
I did not try splines, Chebyshev polynomials, etc.
Here is what I found so far on this topic:
Python 4D linear interpolation on a rectangular grid
Fast interpolation of regularly sampled 3D data with different intervals in x,y, and z
Fast interpolation of regular grid data
What method of multivariate scattered interpolation is the best for practical use?

For the first part of my question, I found this very useful comparison for performance of different linear interpolation methods using python libraries:

Below is list of methods collected so far.
Standart interpolation, structured grid:

Unstructured (scattered) grid:

2 large projects that include interpolation:
 (parts of CGAL, licensed GPL/LGPL)
 (University of Illinois-NCSA License ~= MIT + BSD-3)
Sparse grids:

Kriging (Gaussian Process):

General GPL licensed:

Tasmanian
The Toolkit for Adaptive Stochastic Modeling and Non-Intrusive Approximation - is a robust library for high dimensional integration and
interpolation as well as parameter calibration.
Python binding for Tasmanian:

 (parts of CGAL, licensed GPL/LGPL)


Question:
Consider the question, "What is a photon?".  The answers say, "an elementary particle" and not much else. They don't actually answer the question. Moreover, the question is flagged as a duplicate of, "What exactly is a quantum of light?" – the answers there don't tell me what a photon is either. Nor do any of the answers to this question mentioned in the comments. When I search on "photon", I can't find anything useful. Questions such as, "Wave function of a photon" look promising, but bear no fruit. Others say things like, "the photon is an excitation of the photon field." That tells me  nothing. Nor does the tag description, which says:

The photon is the quantum of the electromagnetic four-potential, and therefore the massless bosonic particle associated with the electromagnetic force, commonly also called the 'particle of light'...

I'd say that's less than helpful because it gives the impression that photons are forever popping into existence and flying back and forth exerting force. This same concept is in the photon Wikipedia article too - but it isn't true. As as anna said, "Virtual particles only exist in the mathematics of the model." So, who can tell me what a real photon is, or refer me to some kind of authoritative informative definition that is accepted and trusted by particle physicists? I say all this because I think it's of paramount importance. If we have no clear idea of what a photon actually is, we lack foundation. It's like what kotozna said:

Photons seem to be one of the foundation ideas of quantum mechanics, so I am concerned that without a clear definition or set of concrete examples, the basis for understanding quantum experiments is a little fuzzy.

I second that, only more so. How can we understand pair production if we don't understand what the photon is? Or the electron? Or the electromagnetic field? Or everything else? It all starts with the photon.
I will give a 400-point bounty to the least-worst answer to the question. One answer will get the bounty, even if I don't like it. And the question is this:
What exactly is a photon?

The word photon is one of the most confusing and misused words in physics. Probably much more than other words in physics, it is being used with several different meanings and one can only try to find which one is meant based on the source and context of the message.
The photon that spectroscopy experimenter uses to explain how spectra are connected to the atoms and molecules is a different concept from the photon quantum optics experimenters talk about when explaining their experiments. Those are different from the photon that the high energy experimenters talk about and there are still other photons the high energy theorists talk about. There are probably even more variants (and countless personal modifications) in use.
The term was introduced by G. N. Lewis in 1926 for the concept of "atom of light":

[...] one might have been tempted to adopt the hypothesis that we are dealing here with a new type of atom, an identifiable entity, uncreatable and indestructible, which acts as the carrier of radiant energy and, after absorption, persists as an essential constituent of the absorbing atom until it is later sent out again bearing a new amount of energy [...]–"The origin of the word "photon""

I therefore take the liberty of proposing for this hypothetical new atom, which is not light but plays an essential part in every process of radiation, the name photon.–"The Conservation of Photons" (1926-12-18)

As far as I know, this original meaning of the word photon is not used anymore, because all the modern variants allow for creation and destruction of photons.
The photon the experimenter in visible-UV spectroscopy usually talks about is an object that has definite frequency $\nu$ and definite energy $h\nu$; its size and position are unknown, perhaps undefined; yet it can be absorbed and emitted by a molecule.
The photon the experimenter in quantum optics (detection correlation studies) usually talks about is a purposely mysterious "quantum object" that is more complicated: it has no definite frequency, has somewhat defined position and size, but can span whole experimental apparatus and only looks like a localized particle when it gets detected in a light detector.
The photon the high energy experimenter talks about is a small particle that is not possible to see in photos of the particle tracks and their scattering events, but makes it easy to explain the curvature of tracks of matter particles with common point of origin within the framework of energy and momentum conservation (e. g. appearance of pair of oppositely charged particles, or the Compton scattering). This photon has usually definite momentum and energy (hence also definite frequency), and fairly definite position, since it participates in fairly localized scattering events.
Theorists use the word photon with several meanings as well. The common denominator is the mathematics used to describe electromagnetic field and its interaction with matter. Certain special quantum states of EM field - so-called Fock states - behave mathematically in a way that allows one to use the language of "photons as countable things with definite energy". More precisely, there are states of the EM field that can be specified by stating an infinite set of non-negative whole numbers. When one of these numbers change by one, this is described by a figure of speech as "creation of photon" or "destruction of photon". This way of describing state allows one to easily calculate the total energy of the system and its frequency distribution. However, this kind of photon cannot be localized except to the whole system.
In the general case, the state of the EM field is not of such a special kind, and the number of photons itself is not definite. This means the primary object of the mathematical theory of EM field is not a set of point particles with definite number of members, but a continuous EM field. Photons are merely a figure of speech useful when the field is of a special kind.
Theorists still talk about photons a lot though, partially because:

it is quite entrenched in the curriculum and textbooks for historical and inertia reasons;
experimenters use it to describe their experiments;
partially because it makes a good impression on people reading popular accounts of physics; it is hard to talk interestingly about $\psi$ function or the Fock space, but it is easy to talk about "particles of light";
partially because of how the Feynman diagram method is taught.

(In the Feynman diagram, a wavy line in spacetime is often introduced as representing a photon. But these diagrams are a calculational aid for perturbation theory for complicated field equations; the wavy line in the Feynman diagram does not necessarily represent actual point particle moving through spacetime. The diagram, together with the photon it refers to, is just a useful graphical representation of certain complicated integrals.)

Note on the necessity of the concept of photon

Many famous experiments once regarded as evidence for photons were later explained qualitatively or semi-quantitatively based solely based on the theory of waves (classical EM theory of light, sometimes with Schroedinger's equation added). These are for example the photoelectric effect, Compton scattering, black-body radiation and perhaps others.

There always was a minority group of physicists who avoided the concept of photon altogether for this kind of phenomena and preferred the idea that the possibilities of EM theory are not exhausted. Check out these papers for non-photon approaches to physics:

R. Kidd, J. Ardini, A. Anton, Evolution of the modern photon, Am. J. Phys. 57, 27 (1989)

C. V. Raman, A classical derivation of the Compton
effect. Indian Journal of Physics, 3, 357-369. (1928)

Trevor W. Marshall, Emilio Santos: The myth of the photon, Arxiv (1997)

Timothy H. Boyer, Derivation of the Blackbody Radiation Spectrum without Quantum Assumptions, Phys. Rev. 182, 1374 (1969)


Question:
The shift theorem says:

Multiplying $x_n$ by a linear phase $e^{\frac{2\pi i}{N}n m}$ for some integer m corresponds to a circular shift of the output $X_k$: $X_k$ is replaced by $X_{k-m}$, where the subscript is interpreted modulo N (i.e., periodically).

Ok, that works fine:
plot a

N = 9
k = [0, 1, 2, 3, 4, 5, 6, 7, 8]
plot ifft(fft(a)*exp(-1j*2*pi*3*k/N))

It shifted by 3 samples, as I expected.
I thought you could also do this to shift by fractions of a sample, but when I try it, my signal becomes imaginary and not at all like the original:
plot real(ifft(fft(a)*exp(-1j*2*pi*3.5*k/N)))
plot imag(ifft(fft(a)*exp(-1j*2*pi*3.5*k/N))), 'b--'

I didn't expect this at all.  Isn't this equivalent to convolving with a real impulse that's been shifted by 3.5 samples?  So the impulse should still be real, and the result should still be real?  And it should have more or less the same shape as the original, but sinc interpolated?

If you want the shifted output of the IFFT to be real, the phase twist/rotation in the frequency domain has to be conjugate symmetric, as well as the data.  This can be accomplished by adding an appropriate offset to your complex exp()'s exponent, for the given phase slope, so that the phase of the upper (or negative) half, modulo 2 Pi, mirrors the lower half in the FFT aperture.  The complex exponential shift function can also be made conjugate symmetric by indexing it from -N/2 to N/2 with a phase of zero at index 0.
It just so happens that the appropriate offset for phase twists or spirals, that complete an exact integer multiples of 2 Pi rotations in aperture, to be conjugate symmetric in aperture, is zero.
With a conjugate symmetric phase twist vector, the result should then end up as a circular Sinc interpolation for non-integer shifts.
Elaboration by OP:
Your choice of k = [0, 1, 2, 3, 4, 5, 6, 7, 8] is producing an asymmetrical complex exponential:

If you use k = [0, 1, 2, 3, 4, -4, -3, -2, -1] instead, you get a Hermite-symmetric complex exponential:
plot(fftshift(exp(-1j * 2*pi * 0.5/N * k)))

and now when you use the same exponential formula to shift by 0.5 or 3.5 samples, you get a real result:
plot ifft(fft(a)*exp(-1j * 2 * pi * 0.5/N *k))
plot ifft(fft(a)*exp(-1j * 2 * pi * 3.5/N *k))


Question: As far as I can tell, the two big generic US Department of Energy computational science software frameworks are  PETSc and Trilinos. They seem similar at first glance, beyond differences in language (C versus C++). What are the main differences between the two frameworks, and what factors should influence choosing one over the other? (Ignore institutional bias and existing infrastructure.)

There are huge differences in culture, coding style, and capabilities.  Probably the fundamental difference is Trilinos tries to provide an environment for solving FEM problems and PETSc provides an environment for solving sparse linear algebra problems.
Why is that significant?

Trilinos will provide a large number of packages concerned with separate parts of the FEM solver. Sometimes these packages work together sometimes they don't.  Even the base components are in its own package and advanced C++ tools
PETSC provides a small amount of core routines that can be built upon, but leaves the FEM solvers to third party packages.  Because of this, it is associated with a larger community than just FEM.  For example, even the eigen solvers are third party which is arguably a major part of linear algebra.
Bottom line, Trilinos focuses working well within its own packages and PETSc has interfaces that call out to many middleware packages (I've often heard it called "lighter-weight" because of this but I wouldn't make that claim)

IMHO, which you should use really depends on the problem.  Please share more details for us to answer that question.


Question:
I was very surprised when I started to read something about non-convex optimization in general and I saw statements like this:

Many practical problems of importance are non-convex, and most
  non-convex problems are hard (if not impossible) to solve exactly in a
  reasonable time. (source)

or

In general it is NP-hard to find a local minimum and many algorithms may get stuck at a saddle point. (source)

I'm doing kind of non-convex optimization every day - namely relaxation of molecular geometry. I never considered it something tricky, slow and liable to get stuck. In this context, we have clearly many-dimensional non-convex surfaces ( >1000 degrees of freedom ). We use mostly first-order techniques derived from steepest descent and dynamical quenching such as FIRE, which converge in few hundred steps to a local minimum (less than number of DOFs). I expect that with the addition of stochastic noise it must be robust as hell. (Global optimization is a different story)
I somehow cannot imagine how the potential energy surface should look like, to make these optimization methods stuck or slowly convergent. E.g. very pathological PES (but not due to non-convexity) is this spiral, yet it is not such a big problem. Can you give illustrative example of pathological non-convex PES?
So I don't want to argue with the quotes above. Rather, I have feeling that I'm missing something here. Perhaps the context.

The misunderstanding lies in what constitutes "solving" an optimization problem, e.g. $\arg\min f(x)$. For mathematicians, the problem is only considered "solved" once we have:

A candidate solution: A particular choice of the decision variable $x^\star$ and its corresponding objective value $f(x^\star)$, AND
A proof of optimality: A mathematical proof that the choice of $x^\star$ is globally optimal, i.e. that $f(x) \ge f(x^\star)$ holds for every choice of $x$.

When $f$ is convex, both ingredients are readily obtained. Gradient descent locates a candidate solution $x^\star$ that makes the gradient vanish $\nabla f(x^\star)=0$. The proof of optimality follows from a simple fact taught in MATH101 that, if $f$ is convex, and its gradient $\nabla f$ vanishes at $x^\star$, then $x^\star$ is a global solution.
When $f$ is nonconvex, a candidate solution may still be easy to find, but the proof of optimality becomes extremely difficult. For example, we may run gradient descent and find a point $\nabla f(x^\star)=0$. But when $f$ is nonconvex, the condition $\nabla f(x)=0$ is necessary but no longer sufficient for global optimality. Indeed, it is not even sufficient for local optimality, i.e. we cannot even guarantee that $x^\star$ is a local minimum based on its gradient information alone. One approach is to enumerate all the points satisfying $\nabla f(x)=0$, and this can be a formidable task even over just one or two dimensions.
When mathematicians say that most problems are impossible to solve, they are really saying that the proof of (even local) optimality is impossible to construct. But in the real world, we are often only interested in computing a "good-enough" solution, and this can be found in an endless number of ways. For many highly nonconvex problems, our intuition tells us that the "good-enough" solutions are actually globally optimal, even if we are completely unable to prove it!


Question:
How should I route USB Connector shield on PCB? Should it be connected to GND plane right where USB is placed, or should  the shield be isolated from GND, or should it be connected to ground through ESD protection chip, high resistance resistor or fuse?
PS. Should I put the shield connections on schematic, or just route it on PCB?

For the shield to be effective, it requires as low impedance connection as possible to your shield ground.  I think those recommending resistors, or not connecting it to ground at all, or strictly talking about your digital logic ground, and assuming you have a separate shield ground.  If you have a metal enclosure, this will be your shield ground.  At some point, your digital ground must connect to your shield ground.  For EMI reasons, this single point should be close to your I/O area.  This means it's best to place your USB connector with any other I/O connectors around one section of the board and locate your shield to logic ground point at that location.  There are some exceptions to the single point, rule, if you have a solid metal enclosure without any apertures, for example, multiple connection points can be helpful.  In any case, at shield to circuit ground connection, some may recommend using a resistor or capacitor (or both) but rarely is there a reasonable reason to do this.  You want a low inductance connection between the two to provide a path for common mode noise.  Why divert noise though parasitic capacitance (e.g. radiate it out into the environment)?  The only reason usually given for such tactics is to prevent ground loops, but you're talking about USB, ground loops most likely won't be an issue for most USB applications.  Granted, such tactics will prevent ground loops, but they will also rend your shielding all but ineffective.


Question:
The recent news about a new supermassive virus being discovered got me thinking about how we define viruses as non-living organisms whilst they are bigger than bacteria, and much more complex than we first gave them credit for.
What biological differences between viruses and cellular organisms have made viruses be deemed non-living?

If this is a topic that really interests you, I'd suggest searching for papers/reviews/opinions written by Didier Raoult.  Raoult is one of the original discoverers of the massive Mimivirus and his work will lead you to some truly fascinating discussions that I couldn't hope to reproduce here.
The main argument for why viruses aren't living is basically what has been said already.  Viruses are obligate parasites, and while plenty of parasites are indeed living what sets viruses apart is that they always rely on the host for the machinery with which to replicate.  A parasitic worm may need the host to survive, using the host as a source for energy, but the worm produces and synthesizes its own proteins using its own ribosomes and associated complexes.
That's basically what it boils down to.  No ribosomes?  Not living.   One advantage of this definition, for example, is that it is a positive selection (everyone "alive" has got ribosomes) which eliminates things like mitochondria that are sort of near the boundary of other definitions.  There are examples on either side of something that breaks every other rule but not this one.  Another common rule is metabolism and while that suffices for most cases some living parasites have lost metabolic activity, relying on their host for energy.
However (and this is the really interesting part) even the ribosome definition is a bit shaky, especially as viruses have been found encoding things like their own tRNAs.  Here are a few points to think about:

We have ribosome encoding organisms (REOs), so why can't we define viruses as capsid encoding organisms (CEOs)?
Comparing viruses to a living organism such as a human is absurd, given the massive differences in complexity.  A virus, really, is just a vehicle or genetic material, and would be more rightly compared to a sperm cell.  Is a sperm cell alive, or is it a package for genetic material that is capable of life once it has infected/fertilized another cell?
The really large DNA viruses often create cytoplasmic features called virus factories.  These look an awful lot like a nucleus.  What is a nucleus anyway?  Maybe it's just a very successful DNA virus that never left.
Viruses can get viruses.

I'll wind down here, but suffice to say that while our current definition may have sufficed for a while, and still does, it is no longer quite solid.  In particular, there is a theory alluded to above that eukaryotic life itself actually formed because of viruses.  I can expand on this if you like, but here are some great sources:
Boyer, M., Yutin, N., Pagnier, I., et al.  2009.  Giant Marseillevirus highlights the role of amoebae as a melting pot in emergence of chimeric microorganisms.  PNAS.  106(51):21848-21853 (
Claverie, JM.  Viruses take center stage in cellular evolution.  2006.  Genome Biology.  7:110. (
Ogata, H., Ray, J., Toyoda, K., et al.  2011.  Two new subfamilies of DNA mismatch repair proteins (MutS) specifically abundant in the marine environment.  The ISME Journal.  5:1143-1151 (
Raoult, D. and Forterre, P.  2008.  Redefining viruses: lessons from Mimivirus.  Nature Reviews Microbiology. 6:315-319. (
Scola, B., Desnues, C., Pagnier, I., et al.  The virophage as a unique parasite of the giant mimivirus.  2008.  Nature.  455:100-104 (


Question:
I was trying to explain to someone that C is Turing-complete, and realized that I don't actually know if it is, indeed, technically Turing-complete. (C as in the abstract semantics, not as in an actual implementation.)
The "obvious" answer (roughly: it can address an arbitrary amount of memory, so it can emulate a RAM machine, so it's Turing-complete) isn't actually correct, as far as I can tell, as although the C standard allows for size_t to be arbitrarily large, it must be fixed at some length, and no matter what length it is fixed at it is still finite. (In other words, although you could, given an arbitrary halting Turing machine, pick a length of size_t such that it will run "properly", there is no way to pick a length of size_t such that all halting Turing machines will run properly)
So: is C99 Turing-complete?

I'm not sure but I think the answer is no, for rather subtle reasons. I asked on Theoretical Computer Science a few years ago and didn't get an answer that goes beyond what I'll present here.
In most programming languages, you can simulate a Turing machine by:

simulating the finite automaton with a program that uses a finite amount of memory;
simulating the tape with a pair of linked lists of integers, representing the content of the tape before and after the current position. Moving the pointer means transferring the head of one of the lists onto the other list.

A concrete implementation running on a computer would run out of memory if the tape got too long, but an ideal implementation could execute the Turing machine program faithfully. This can be done with pen and paper, or by buying a computer with more memory, and a compiler targeting an architecture with more bits per word and so on if the program ever runs out of memory.
This doesn't work in C because it's impossible to have a linked list that can grow forever: there's always some limit on the number of nodes.
To explain why, I first need to explain what a C implementation is. C is actually a family of programming languages. The ISO C standard (more precisely, a specific version of this standard) defines (with the level of formality that English allows) the syntax and semantics a family of programming languages. C has a lot of undefined behavior and implementation-defined behavior. An “implementation” of C codifies all the implementation-defined behavior (the list of things to codify is in appendix J for C99). Each implementation of C is a separate programming language. Note that the meaning of the word “implementation” is a bit peculiar: what it really means is a language variant, there can be multiple different compiler programs that implement the same language variant.
In a given implementation of C, a byte has $2^{\texttt{CHAR_BIT}}$ possible values. All data can represented as an array of bytes: a type t has at most
$2^{\texttt{CHAR_BIT} \times \texttt{sizeof(t)}}$ possible values. This number varies in different implementations of C, but for a given implementation of C, it's a constant.
In particular, pointers can only take at most $2^{\texttt{CHAR_BIT} \times \texttt{sizeof(void*)}}$ values. This means that there is a finite maximum number of addressable objects.
The values of CHAR_BIT and sizeof(void*) are observable, so if you run out of memory, you can't just resume running your program with larger values for those parameters. You would be running the program under a different programming language — a different C implementation.
If programs in a language can only have a bounded number of states, then the programming language is no more expressive than finite automata. The fragment of C that's restricted to addressable storage only allows at most $n \times 2^{\texttt{CHAR_BIT} \times \texttt{sizeof(void*)}}$ program states where $n$ is the size of the abstract syntax tree of the program (representing the state of the control flow), therefore this program can be simulated by a finite automaton with that many states. If C is more expressive, it has to be through the use of other features.
C does not directly impose a maximum recursion depth. An implementation is allowed to have a maximum, but it's also allowed not to have one. But how do we communicate between a function call and its parent? Arguments are no good if they're addressable, because that would indirectly limit the depth of recursion: if you have a function int f(int x) { … f(…) …} then all the occurrences of x on active frames of f have their own address and so the number of nested calls is bounded by the number of possible addresses for x.
A C program can use non-addressable storage in the form of register variables. “Normal” implementations can only have a small, finite number of variables that don't have an address, but in theory an implementation could allow an unbounded amount of register storage. In such an implementation, you can make an unbounded amount of recursive calls to a function, as long as its argument are register. But since the arguments are register, you can't make a pointer to them, and so you need to copy their data around explicitly: you can only pass around a finite amount of data, not an arbitrary-sized data structure that's made of pointers.
With unbounded recursion depth, and the restriction that a function can only get data from its direct caller (register arguments) and return data to its direct caller (the function return value), you get the power of deterministic pushdown automata.
I can't find a way to go further.
(Of course you could make the program store the tape content externally, through file input/output functions. But then you wouldn't be asking whether C is Turing-complete, but whether C plus an infinite storage system is Turing-complete, to which the answer is a boring “yes”. You might as well define the storage to be a Turing oracle — call fopen("oracle", "r+"), fwrite the initial tape content to it and fread back the final tape content.)


Question:
According to Wikipedia, if a system has $50\%$ chance to be in state $\left|\psi_1\right>$ and $50\%$ to be in state $\left|\psi_2\right>$, then this is a mixed state.
Now, consider the state
$$\left|\Psi\right>=\frac{\left|\psi_1\right>+\left|\psi_2\right>}{\sqrt{2}},$$ which is a superposition of the states $\left|\psi_1\right>$ and $\left|\psi_2\right>$. Let $\left|\psi_i\right>$ be eigenstates of the Hamiltonian operator. Then measurements of energy will give $50\%$ chance of it being $E_1$ and $50\%$ of being $E_2$. But this then corresponds to the definition above of mixed state! However, superposition is defined to be a pure state.
So, what is the mistake here? What is the real difference between mixed state and superposition of pure states?

The state
\begin{equation}
|\Psi \rangle = \frac{1}{\sqrt{2}}\left(|\psi_1\rangle +|\psi_2\rangle \right)
\end{equation}
is a pure state. Meaning, there's not a 50% chance the system is in the state $|\psi_1\rangle$ and a 50% it is in the state $|\psi_2\rangle$. There is a 0% chance that the system is in either of those states, and a 100% chance the system is in the state $|\Psi\rangle$.
The point is that these statements are all made before I make any measurements.
It is true that if I measure the observable corresponding to $\psi$ ($\psi$-gular momentum :)), then there is a 50% chance after collapse the system will end up in the state $|\psi_1\rangle$.
However, let's say I choose to measure a different observable. Let's say the observable is called $\phi$, and let's say that $\phi$ and $\psi$ are incompatible observables in the sense that as operators $[\hat{\psi},\hat{\phi}]\neq0$. (I realize I'm using $\psi$ in a sense you didn't originally intend but hopefully you know what I mean). The incompatibliity means that $|\psi_1 \rangle$ is not just proportional to $|\phi_1\rangle$, it is a superposition of $|\phi_1\rangle$ and $|\phi_2\rangle$ (the two operators are not simulatenously diagonalized).
Then we want to re-express $|\Psi\rangle$ in the $\phi$ basis. Let's say that we find
\begin{equation}
|\Psi\rangle = |\phi_1\rangle
\end{equation}
For example, this would happen if
\begin{equation}
|\psi_1\rangle = \frac{1}{\sqrt{2}}(|\phi_1\rangle+|\phi_2\rangle)
\end{equation}
\begin{equation}
|\psi_2\rangle = \frac{1}{\sqrt{2}}(|\phi_1\rangle-|\phi_2\rangle)
\end{equation}
Then I can ask for the probability of measuring $\phi$ and having the system collapse to the state $|\phi_1\rangle$, given that the state is $|\Psi\rangle$, it's 100%. So I have predictions for the two experiments, one measuring $\psi$ and the other $\phi$, given knowledge that the state is $\Psi$.
But now let's say that there's a 50% chance that the system is in the pure state $|\psi_1\rangle$, and a 50% chance the system is in the pure state $|\psi_2\rangle$. Not a superposition, a genuine uncertainty as to what the state of the system is. If the state is $|\psi_1 \rangle$, then there is a 50% chance that measuring $\phi$ will collapse the system into the state $|\phi_1\rangle$. Meanwhile, if the state is $|\psi_2\rangle$, I get a 50% chance of finding the system in $|\phi_1\rangle$ after measuring. So the probability of measuring the system in the state $|\phi_1\rangle$ after measuring $\phi$, is (50% being in $\psi_1$)(50% measuring $\phi_1$) + (50% being in $\psi_2$)(50% measuring $\phi_1$)=50%. This is different than the pure state case.
So the difference between a 'density matrix' type uncertainty and a 'quantum superposition' of a pure state lies in the ability of quantum amplitudes to interfere, which you can measure by preparing many copies of the same state and then measuring incompatible observables.


Question:
I have the following data of fragment counts for each gene in 16 samples:
> str(expression)
'data.frame':   42412 obs. of  16 variables:
 $ sample1 : int  4555 49 122 351 53 27 1 0 0 2513 ...
 $ sample2 : int  2991 51 55 94 49 10 55 0 0 978 ...
 $ sample3 : int  3762 28 136 321 94 12 15 0 0 2181 ...
 $ sample4 : int  4845 43 193 361 81 48 9 0 0 2883 ...
 $ sample5 : int  2920 24 104 151 50 20 32 0 0 1743 ...
 $ sample6 : int  4157 11 135 324 58 26 4 0 0 2364 ...
 $ sample7 : int  3000 19 155 242 57 12 18 2 0 1946 ...
 $ sample8 : int  5644 30 227 504 91 37 11 0 0 2988 ...
 $ sample9 : int  2808 65 247 93 272 38 1108 1 0 1430 ...
 $ sample10: int  2458 37 163 64 150 29 729 2 1 1049 ...
 $ sample11: int  2064 30 123 51 142 23 637 0 0 1169 ...
 $ sample12: int  1945 63 209 40 171 41 688 3 2 749 ...
 $ sample13: int  2015 57 432 82 104 47 948 4 0 1171 ...
 $ sample14: int  2550 54 177 59 201 36 730 0 0 1474 ...
 $ sample15: int  2425 90 279 73 358 34 1052 3 3 1027 ...
 $ sample16: int  2343 56 365 67 161 43 877 3 1 1333 ...

How do I compute RPKM values from these?

First off,
Don’t use RPKMs.
They are truly deprecated because they’re confusing once it comes to paired-end reads. If anything, use FPKMs, which are mathematically the same but use a more correct name (do we count paired reads separately? No, we count fragments).
Even better, use TPM (= transcripts per million), or an appropriate cross-library normalisation method. TMP is defined as:
$$
\text{TPM}_\color{orchid}i =
    {\color{dodgerblue}{\frac{x_\color{orchid}i}{{l_\text{eff}}_\color{orchid}i}}}
    \cdot
    \frac{1}{\sum_\color{tomato}j \color{dodgerblue}{\frac{x_\color{tomato}j}{{l_\text{eff}}_\color{tomato}j}}}
    \cdot
    \color{darkcyan}{10^6}
$$
where

$\color{orchid}i$: transcript index,
$x_i$: transcript raw count,
$\color{tomato}j$ iterates over all (known) transcripts,
$\color{dodgerblue}{\frac{x_k}{{l_\text{eff}}_k}}$: rate of fragment coverage per nucleobase ($l_\text{eff}$ being the effective length),
$\color{darkcyan}{10^6}$: scaling factor (= “per millions”).

That said, FPKM can be calculated in R as follows. Note that most of the calculation happens in log transformed number space, to avoid numerical instability:
fpkm = function (counts, effective_lengths) {
    exp(log(counts) - log(effective_lengths) - log(sum(counts)) + log(1E9))
}

Here, the effective length is the transcript length minus the mean fragment length plus 1; that is, all the possible positions of an average fragment inside the transcript, which equals the number of all distinct fragments that can be sampled from a transcript.
This function handles one library at a time. I (and others) argue that this is the way functions should be written. If you want to apply the code to multiple libraries, nothing is easier using ‹dplyr›:
tidy_expression = tidy_expression %>%
    group_by(Sample) %>%
    mutate(FPKM = fpkm(Count, col_data$Lengths))

However, the data in the question isn’t in tidy data format, so we first need to transform it accordingly using ‹tidyr›:
tidy_expression = expression %>%
    pivot_longer(names_to = Sample, values_to = Count)

This equation fails if all your counts are zero; instead of zeros you will get a vector of NaNs. You might want to account for that.

And I mentioned that TPMs are superior, so here’s their function as well:
tpm = function (counts, effective_lengths) {
    rate = log(counts) - log(effective_lengths)
    exp(rate - log(sum(exp(rate))) + log(1E6))
}


Question:
In this answer it is mentioned

A regular language can be recognized by a finite automaton. A context-free language requires a stack, and a context sensitive language requires two stacks (which is equivalent to saying it requires a full Turing machine).

I wanted to know regarding the truth of the bold part above. Is it in fact true or not? What is a good way to reach at an answer to this?

Two bits to this answer;
Firstly, the class of languages recognised by Turing Machines is not context sensitive, it's recursively enumerable (context sensitive is the class of languages you get from linear bound automata).
The second part, assuming we adjust the question, is that yes, a two-stack PDA is as powerful as a TM. It's mildly simpler to assume that we're using the model of TMs that has a tape that's infinite in one direction only (though both directions is not much harder, and equivalent).
To see the equivalence, just think of the first stack as the contents of the tape to the left of the current position, and the second as the contents to the right. You start off like so:

Push the normal "bottom of stack" markers on both stacks.
Push the input to the left stack (use non-determinism to "guess" the end of the input).
Move everything to the right stack (to keep things in the proper order).

Now you can ignore the input and do everything on the contents of the stacks (which is simulating the tape). You pop to read and push to write (so you can change the "tape" by pushing something different to what you read). Then we can simulate the TM by popping from the right stack and pushing to the left to move right, and vice versa to move left. If we hit the bottom of the left stack we behave accordingly (halt and reject, or stay where you, depending on the model), if we hit the bottom of the right stack, we just push a blank symbol onto the left.
For a full formal proof, see an answer to another question.
The relationship the other way should be even more obvious, i.e. that we can simulate a two-stack PDA with a TM.


Question:
Given a real function of real variables, is there software available that can automatically generate numerically-accurate code to calculate the function over all inputs on a machine equipped with IEEE 754 arithmetic?
For example, if the real function to be evaluated were:

The software would consider catastrophic cancellation and possibly output table lookups for certain sets of inputs to avoid a loss in computational accuracy.
Alternatively, is there software that can generate a pure table-based lookup routine to calculate a given function to high accuracy?

The best solution that I know of is to program the symbolic expressions in Mathematica, Maple, or SymPy; all of the links go directly to the code generation documentation. All of the programs above can generate code in C or Fortran.
None of the programs above mentions accuracy in IEEE 754 arithmetic; in general, it would be difficult to anticipate all sources of catastrophic cancellation, as @dmckee notes. It's hard to replace human expertise in numerical analysis.
To provide a concrete example, consider calculating the trigonometric functions to high precision for arbitrary inputs in $[0, 2\pi]$. There are many strategies for doing so, some even hardware dependent, as see in the Wikipedia article Trigonometric Tables. All of the  algorithms require ingenuity and numerical analysis, even algorithms that depend on lookup tables and Taylor series or interpolation (see the Wikipedia article The Table-Maker's Dilemma). For more detail, see the related Stack Overflow question How do Trigonometric Functions work?.
Software that generated code or routines to calculate arbitrary functions to high accuracy would not only need to be aware of cancellation errors, but also series approximants (Taylor, Padé, Chebyshev, rational, etc.) for calculating functions that are not defined in terms of a finite number of additions, subtractions, multiplications, divisions, and bit shifts. (See Approximation Theory.)


Question: Why are solderless protoboards called "breadboards"?  I've used the term for decades but couldn't answer a student's question about the name.

This terminology goes waaaaay back to the days of vacuum tubes.
Generally, you would mount a number of tube-sockets on standoffs to a piece of wood (the actual "breadboard"), and do all the wiring with point-point wire and the components just hanging between the various devices.
If you needed additional connection points, you would use a solder-lug terminal strip.

Image credit: Random googling.
The story goes that an engineer had an idea for a vacuum tube device late one night. Looking around the house, the only base for his prototype that he found was indeed his wife's breadboard, from the breadbox.
Now, I'm not endorsing actually using a real breadboard. It's your marital strife if you do.

I've actually constructed a tube project using the breadboard technique. It works very well.


Question: Rather basic, I'm afraid, but when would you use a relay, and when would you use a transistor?  In a relay the contacts wear out, so why are relays used at all?

Relays offer complete isolation between the activating circuit and the load.
They can switch AC and DC, and be activated by AC or DC.
They can be very robust.
They also have the advantage that one can often see if the device is actuated, and one can even hear the actuation in many cases.


Question: In the calculus of variations, particularly Lagrangian mechanics, people often say we vary the position and the velocity independently. But velocity is the derivative of position, so how can you treat them as independent variables?

Unlike your question suggests, it is not true that velocity is varied independently of position. A variation of position $q \mapsto q + \delta q$ induces a variation of velocity $\partial_t q \mapsto \partial_t q + \partial_t (\delta q)$ as you would expect.
The only thing that may seem strange is that $q$ and $\partial_t q$ are treated as independent variables of the Lagrangian $L(q,\partial_t q)$. But this is not surprising; after all, if you ask "what is the kinetic energy of a particle?", then it is not enough to know the position of the particle, you also have to know its velocity to answer that question.
Put differently, you can choose position and velocity independently as initial conditions, that's why the Lagrangian function treats them as independent; but the calculus of variation does not vary them independently, a variation in position induces a fitting variation in velocity.