text:
# A Sudden SSH out-of-memory

An accident and investigation of the server failure

In this post, I am going to share an accident I had recently with in-house production.

Let’s assume we have an SSH server. Clients who call commands through it. Quite simple, right?

Of course, we cannot have only one SSH server. Instead, we run several SSH servers and use HAProxy to load-balance traffic to them. It is way more safe to have several servers, instead of one. For example, it simplifies maintenance, allows to easily implement Rolling Updates or say A/B Testing. I wrote in a previous post more details on our HAProxy setup some time ago

# The outage as seen by users

At some day, our users (as I can recreate from reports) started to see strange connection timeouts from SSH server calls. The call they did was to download several gigabytes of data.

From a user perspective, it’s totally OK to retry a command once it failed for the very first time. So they did it.

After several retries, they tend to give up. At that time our system was no longer capable of serving any SSH requests at all

# The outage as seen from the server-side

We are running several SSH servers behind HAProxy. Servers were running in JVM. I use amazing Apache Mina SSHD to implement our SSH server.

Alerts appeared for our SSH servers. HAProxy started to drain traffic from dead SSH servers, based on health checks. It was good since other requests were still able to execute on still live servers.

There were only two servers in our setup. So the system was too fast to be killed.

All dead server had an out-of-memory (OOM) before death. Sadly, but it is hard to write an application that is can survive OOMs and continue to function. In our case, OOM tended to kill either SSH server socket processing for either SSH or HTTP.

The good side was that those SSH servers had not sensible state. Thus it was easy to restart them to be back in business. So we had the workaround

# Java heap dump analysis

By that time I had several memory dumps (.hprof) files from failed servers. It was time to analyze what is there. All those failures were only because a send buffer was full of data, consuming the rest of heap memory. More detailed, I found a massive SSH session object.

With more analysis, I found the whole memory was consumed by the write queue.

A closer look in memory dumps and I was able to figure out the outage was caused by a fresh Putty client on Windows, e.g. SSH-2.0-PuTTY_Release_0.69. At the time of the accident, it was the most recent version.

The state was that I had an OOM issue downloading several gigabytes of data over the SSH with Putty client. It was time to write integration tests to reproduce the problem. I did it. I was able to test every putty client version. I tried 0.67, 0.68 and 0.69. The OOM problem was likely to be introduced in 0.68.

# Client problem and users

Memory snapshot analysis was helpful to realize the problem was with a specific version of an SSH client. I also knew, only users with fresh computers we reporting the issue too.

It was evident I cannot do anything with the client. Users decided to use it for their reasons. Also, my SSH server implementation did not support the client filtering. Anyway, I’d be too hard to explain everyone the problem is probably with recent update of their software.

# Debugging the problem

Thanks to integration tests I did, I was also able to debug the problem and realize the cause of the issue.

I found the method, which handles all writes on the server: org.apache.sshd.common.session.AbstractSession#writePacket(org.apache.sshd.common.util.buffer.Buffer)

Apache Mina SSHD server is async. Instead of writing data directly to the socket it enqueues the data and sends once the OS is ready for it.

Also, the implementation writes messages to a dedicated queue while re-key process is running. This method is called for every SSH command channel writes too. SSH window size is checked before calling the method, so the command writer is blocked to wait while queued messages are sent.

In memory dumps of the session object, I saw the window was barely unlimited.

Having unlimited window and a slow network is enough for a server to consume all memory with messages queue. In my case SSH, command was streaming several gigabytes of data from memory.

There are two questions:

• Why is it happening only now?
• How can we avoid the problem?

# SSH window abuse

As we know, SSH protocol uses windows to limit the number of data being queued. Why didn’t it work?

It was easy to debug. I found out Putty was sending 2GB (e.g., signed integer max value) as the size of the receive window. Well, I saw no reason why. But having such a huge send window makes SSH server enqueue up to 2GB of data per session.

An optimistic approach, as we are a victim of it, is to trust SSH client and use the window as-is.

A defensive approach is to have an additional send window in SSH server to avoid blindly trusting a client.

# SSHD patch

Now it was more or less clear. The problem was in unlimited write queue and infinite send window. I created an issue for the Apache Mina SSHD project to let anyone know there is such a problem.

https://issues.apache.org/jira/browse/SSHD-754

I did a trivial patch on for the server. I decided to limit write queue for channel messages to block the sender even in the case send window is unlimited. I simply use a semaphore for it:

The code above is included in my inheritor of the org.apache.sshd.common.session.AbstractSession. I like Apache Mina SSHD library is designed in an extensible way making such workaround possible.

And the PressureLock was implemented this way:

I checked the fix with my tests. The problem was solved.

# Putty changes

With integration tests, I was able to detect that it started to fail only with Putty 0.68. Putty 0.67 was working great. Also, all our problems were only from putty SSH clients on Windows.

I decided to dig dipper and see, that change was it. Sadly, there were so many changes between 0.67 and 0.68. Also, it took several years for them too.

I knew I was looking the change to windows size. I confirmed in debugger, Putty 0.67 was using 16K for it.

And I found the change b22c0b6f3e6f5254270a89f86df3edfc4da829d2 and the winplink.c file

The change was to flip CONF_ssh_simple mode on Windows. The change did enable 2GB receive window, as you may see from the usages.

In ssh.c in Putty 0.70 we have defines:

And the code-block:

The windows size is computed by the following expression:

The windows sizes are exactly the same as I saw in debugger both for 0.67 and 0.69 versions.

That was it. And it was in April 2016. It took more than a year for the change to cause the issues I was debugging.

Thanks to the opensource, I was able to dig that deep to see the source of the problem. I liked it.

# Conclusion

I was running these SSH servers for more than a year. I like people say, ‘Hey, I did no changes to anything, why is it failing now?’

It was indeed the change. And the system started to fail. It was the outer world that changed.

I found the source of the issue and did a patch to make the server work again with new SSH clients. That was fun!


text:
?

Free Version
Difficult

# From One Graphical Representation to Another

APSTAT-PJ5OY7

At The Marvelous Marshmallow Market, customers were invited to suggest a new flavor for marshmallows. The finalists were announced and a vote was held. Results of the vote are displayed in the graph below.

If $200$ votes were cast, which of the following graphs displays the frequency distribution for the votes?

A
B
C
D
E

format: plain


text:
# Approximating functions in $H_0^1(\Omega)$ by piecewise affine ones.

I'm trying to understand how one approximates functions in $H_0^1(\Omega)$ by piecewise affine functions. The normal construction I have seen begins by breaking up your domain $\Omega$ into cubes $Q_i$ and on each $Q_i$ defining an averaged gradient $\frac{1}{|Q_i|} \int_{Q_i} Du =: \xi_i$. I can see why this approximates $Du$ well in the $L^2$ norm, but why can we then conclude that have in fact an $H_0^1(\Omega)$ function?

In other words, how can we "glue" the different affine pieces together? How do we know we can even do this? My first guess was to think in two dimensions and consider a cube and the four cubes adjacent to it. So let $\xi_1$ be the value of the gradient in the 'center cube'. Then if $\xi_2$ is the gradient on the piece on top, then I think we need to make the boundary normal to $\xi_1 - \xi_2$ so that we can have a continuous function across the boundary. I then suppose we need to do the same for the other pieces.

Is there a clearer way of seeing what is going on/how to do this?

-

Certainly, a piecewise affine function $f$ (meaning, a function which is affine on each open simplex of some triangulation of the domain) is in $W^{1,\\ p}_{loc}$ for some $1\leq p\leq \infty$ if and only if it is continuous (the discontinuity set would be otherwise too large, a hypersurface). In particular, you really need your approximating function to be continuous, in order to be of class $H^1$. On the other hand, continuous functions that are affine on each cube of a cubic subdivision, are too a rigid class: they are of the form $f(x_1,\dots,x_n)=\phi_1(x_1)+\dots+\phi_n(x_n)$, with $\phi_i$ some continuous piecewise affine functions of one variable. If you instead consider general continuous piecewise affine functions (as defined above), you get a class with more satisfactory density properties. Since $C^1_0(\Omega)$ functions are $H^1$-dense in $H^1_0(\Omega)$, it is sufficient to approximate a function in $C^1_0(\Omega)$ by $C^0$ piecewise affine functions in the $C^1$ sense; this is classically done by affine interpolation on the points of the 0-skeleton of the triangulation (there is a unique such interpolation: that's the advantage of triangulations compared to cubic subdivisions). So in your case you should further subdivide each cube in $n!$ simplices, and take the approximation affine on each of them. If you are interested in the quantitative aspect, it should not be difficult to bound the $H^1$ distance of the approximation; I guess that books of numerical analysis cover completely this point.


text:
### Recent Submissions

• #### On strong infinite Sidon and Bh sets and random sets of integers

(2021-04-21)
Article
Restricted access - publisher's policy
A set of integers S ¿ N is an a–strong Sidon set if the pairwise sums of its elements are far apart by a certain measure depending on a, more specifically if (x + w) - (y + z) = max{xa, ya, za, wa} for every x, y, z, ...
• #### Degrees of compression and inertia for free-abelian times free groups

(Elsevier, 2021-02-15)
Article
Restricted access - publisher's policy
We introduce the concepts of degree of inertia, diG(H), and degree of compression,dcG(H), of a finitely generated subgroupHof a given groupG. For the case of direct productsof free-abelian and free groups, we compute the ...
• #### A removal lemma for systems of linear equations over finite fields

(2012-01)
Article
Open Access
We prove a removal lemma for systems of linear equations over finite fields: let X1, . . . , Xm be subsets of the finite field Fq and let A be a (k × m) matrix with coefficients in Fq and rank k; if the linear system Ax = ...
• #### Triangulations and a discrete Brunn–Minkowski inequality in the plane

(2019-08-29)
Article
Open Access
For a set A of points in the plane, not all collinear, we denote by tr(A) the number of triangles in a triangulation of A, that is, tr(A)=2i+b-2 , where b and i are the numbers of boundary and interior points of the convex ...
• #### Product of primes in arithmetic progressions

(2020-05-01)
Article
Open Access
We prove that, for all q=2 and for all invertible residue classes a modulo q, there exists a natural number n=(650q)9 that is congruent to a modulo q and that is the product of exactly three primes, all of which are below ...
• #### Frozen (¿ + 1)-colourings of bounded degree graphs

(2020-10-19)
Article
Restricted access - publisher's policy
Let G be a graph on n vertices and with maximum degree ¿, and let k be an integer. The k-recolouring graph of G is the graph whose vertices are k-colourings of G and where two k-colourings are adjacent if they differ at ...
• #### On a problem of Sárközy and Sós for multivariate linear forms

(2020-03-18)
Article
Open Access
We prove that for pairwise co-prime numbers k1,…,kd=2 there does not exist any infinite set of positive integers A such that the representation function rA(n)=# {(a1,…,ad)¿Ad:k1a1+¿ +kdad=n} becomes constant for n large ...
• #### An Erdös–Fuchs theorem for ordered representation functions

(2020-10-28)
Article
Open Access
Letk=2 be a positive integer. We study concentration results for the ordered representationfunctionsr=k(A, n) = #{(a1= ··· =ak)¿ Ak:a1+···+ak=n}andr<k(A, n) = #{(a1<···<ak)¿ Ak:a1+···+ak=n}for any infinite set ...
• #### Local convergence and stability of tight bridge-addable classes

Article
Restricted access - publisher's policy
A class of graphs is bridge-addable if given a graph G in the class, any graph obtained by adding an edge between two connected components of G is also in the class. The authors recently proved a conjecture of McDiarmid, ...

(2020-10-01)
Article
Open Access
We study the class of link-types that admit a -minor-free diagram, i.e., they can be projected on the plane so that the resulting graph does not contain any subdivision of . We prove that is the closure of a subclass of ...
• #### On the number of coloured triangulations of d-manifolds

(2020-03-11)
Article
Open Access
We give superexponential lower and upper bounds on the number of coloured d-dimensional triangulations whose underlying space is an oriented manifold, when the number of simplices goes to infinity and d=3 is fixed. In the ...
• #### On varieties defined by large sets of quadrics and their application to error-correcting codes

(2020-10-01)
Article
Restricted access - publisher's policy
Let U be a ( k-1 2 - 1)-dimensional subspace of quadratic forms defined on F k with the property that U does not contain any reducible quadratic form. Let V (U) be the points of PG(k - 1, F) which are zeros of all quadratic ...


text:
# What is the max single day score on jeopardy?

So, I was trying to figure out what the max score on jeopardy is for a single day. what I did was account for the daily doubles at the very end with the lowest value category, (to save on the 1000's), Wagered everything in the daily doubles and final jeopardy. However I ended up with just a total of $approximately\;\$360000$for a single day. However I read that the true possible win is$\$566,400$ total. Where am I messing up? And am I missing a rule or something?

-
 See my Bloog post, "This is Maximal Jeopardy!": dlnds.com/bloog/this-is-maximal-jeopardy (I wrote it years ago, but just added it to my site.) – Blue Feb 3 at 0:52

## 1 Answer

I like this question, and I had to look something up for a moment. According to the Jeopardy Archive, daily doubles haven't occurred on the first row in years. But they can occur on the second row. So let's assume that all three daily doubles occur on the second row, meaning on questions of value $\$200$,$\$400$, and $\$400$. (As unlikely as this might be). With this assumption, we naturally assume a player gets all the questions before doubling his or her money with the daily doubles. During the first round, he or she will get$6$questions worth$200, 600, 800, 1000$and only$5$worth$400$. This totals to$6\cdot (200 + 600 + 800 + 1000) + 5\cdot 400= 6\cdot(2600) + 2000 = 17600.$Hitting the daily double, the player has$35200$after the first round (a respectable amount of money already). During the second round, he or she will get$6$questions worth$400, 1200, 1600, 2000$and only$4$worth$800$. This totals to$2 \cdot 6 \cdot (200 + 600 + 800 + 1000) + 4 \cdot 800 = 2 \cdot 15600 + 3200= 34400$. Thus the player will have a total of$\$69600$ before the second set of double jeopardies. After them, the player will have $\$278400$. Thus after the final round, assuming the player bets all of his or her money, he or she can end up with$\$556800$.

I presume that the small difference with my total and the total you suggest is that they let the daily doubles land on the smallest ones, instead of the second-smallest like I thought.

-
 This is well done, thanks, I was forgetting the fact that double jeopardy adds to existing totals. >.> – Link Feb 4 at 19:45


text:
# nilpotent matrix definition

Nilpotent matrix: A matrix is said to be nilpotent if there is some integer m for which {eq}A^m = 0 {/eq} Also, we use matrix multiplication here, IfX is an n× n nilpotent matrix, then Xm =0forallm ≥ n [9]. Write B in its Jordan form as in the proof of Lemma 1. Example NM62 Nilpotent matrix, size 6, index 2 On a first encounter with the definition of a nilpotent matrix, you might wonder if such a thing was possible at all. This definition can be applied in particular to square matrices. solvable). There are two equivalent definitions for a nilpotent matrix. Let F be a ﬁeld. Nilpotent Operators Definition and Examples of Nilpotent Operator Definition: nilpotent An operator is called nilpotent if View 8AzNilpotentOperators.pdf from MAT 2611 at University of South Africa. And indeed, some o⁄-diagonal entries in the ﬁsimpli–edﬂform of Lwill be non-zero. A square matrix A such that A^n is the zero matrix 0 for some positive integer matrix power n, known as the index (Ayres 1962, p. 11). Consequently, a nilpotent matrix cannot be invertible. Examples. The matrix. Let g be a … In mathematics, a Lie algebra is nilpotent if its lower central series eventually becomes zero. Let S,(M) be the sum of 3X3 principal minors a matrix M; thus S&A + zB)= 0 for every z E 5, since A + zB is nilpotent for all .a E [F. Here the block sizes are all 1, and a 1X1 block with zero lead diagonal is just a zero block. Proof. See nilpotent matrix for more. I suppose that is A^k =0 for some k? elements, and if ecery linear combination of A and B is nilpotent, then tr(AB”) = 0. solvable) Exercise 4.2. Types of Matrices - The various matrix types are covered in this lesson. The matrix; is nilpotent because A 3 = 0. Nilpotent definition is - equal to zero when raised to some power. The simplest nilpotent matrix in 3 dimensions is the zero matrix: 0 0 0 0 0 0 0 0 0 Which with regard to our structure theorem is the matrix of the zero map, which sends w i to 0 for all i. Thus all the eigenvalues of a unipotent matrix are 1. It is a Lie algebra analog of a nilpotent group Definition. The matrix = is nilpotent because A 3 = 0. A matrix A is said to be nilpotent if A^n = 0(matrix) for some integer greater/equal to 1, and smallest such positive power n is termed as its index of nilpotence e.g. I = I. Deﬁnition 2. if = for some n ∈ ℕ. See more. is nilpotent, since M 2 = 0. A nilpotent Lie group is a Lie group G which is connected and whose Lie algebra is a nilpotent Lie algebra g. That is, its Lie algebra lower central series g_1=[g,g],g_2=[g,g_1],... (1) eventually vanishes, g_k=0 for some k. So a nilpotent Lie group i A square matrix whose eigenvalues are all 0. This means a matrix A such that A^2 is not the zero matrix but A^3 is the zero matrix. D= 0:Solving P 1LP= 0 for Lgives L= 0:Thus a diagonalizable nilpotent matrix is the zero matrix, or equivalently, a non-zero nilpotent matrix Lis not diagonalizable. Let Lbe a non-zero nilpotent matrix. and download free types of matrices PDF lesson. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share … This definition can be applied in particular to square matrices. Nilpotent and Unipotent Matrices DEFINITION 3.1 A square matrix X is said to be nilpotent ifXr =0for some positive integer r. The least such positive integer is called the index (or, degree) of nilpotency. In particular, a square matrix, M, is a unipotent matrix, if and only if its characteristic polynomial, P(t), is a power of t − 1. Assume that two elements a, b in a (non-commutative) ring R satisfy ab = 0. Mayank Bajpai on 16 Oct 2020 @Ling Liang , take some tolerance while checking the equality of eigen value with zero. We prove that a matrix is nilpotent if and only if its eigenvalues are all zero. This means that there is an index k such that Bk = O. Idempotent definition, unchanged when multiplied by itself. If P is the least positive integer for which AP=0 then A is said to be nilpotent of index P. Click hereto get an answer to your question  If A is a nilpotent matrix of index 2 , then for any positive integer n , A(I + A)^n is equal to This definition can be applied in particular to square matrices.The matrix = is nilpotent because A 3 = 0. 3. Let be a Lie algebra. solvable) Lie algebra is nilpotent (resp. nilpotent. May I ask what is the definition of Nilpotent matrix. This definition can be applied in particular to square matrices.The matrix; is nilpotent because A 3 = 0. We give an example of a nilpotent matrix of degree 3. nilpotent translation in English-Spanish dictionary. Cookies help us deliver our services. This definition can be applied in particular to square matrices.The matrix


text:
Testing for LaTeX and TeX macro definitions

Keywords: latex text conditional macro ifx

When modifying a LaTeX environment it is often desirable to add new (optional) macro variables which evoke different effects to the document dependent on whether or not they are defined with a non-empty value.

As an example, consider the case where we wish to modify the standard Title Page routines to include a listing for spokesmen and collaboration members in place of the standard author field.

The desired result would be something that looked like:

Paper Title

Spokesmen
John Smith

Collaborators
Susi Que, Alen Smithee

But in the advent that the writer did not use one or both of the fields, you would want to exclude not only the names, but the "Spokesmen" or "Collaborators" text.

The way to accomplish this is by testing for the existence of a non-empty macro definition, and then branching on the result of the test. In TeX and LaTeX there is no automatic way to perform this test.

\if Constructs

The standard "\if" command does not test for a binary result, rather it always performs a character comparison on two arguments after macro expansion. As a result the following \if construct will work (sometimes):

\if \@testmacro \@relax \@relax
Commands to use if the macro is undefined
\else
Commands to use if the macro IS defined
\fi

The difficulty with this construct is that will fail if \@testmacro has certain special characters in it (mainly the comment character '%') or some type of unusual expansion for which the first two characters match. It also suffers from a condition where characters left over after the comparison can actually fall into the true branch of the statement and be executed as commands. All in all while this approach can be use, it is prone to difficulties.

\ifx Constructs

Given the problems associated with the intuitive use of \if there is a better method of testing for macro existence using the little known (yet standard) TeX \ifx directive. This directive compares two arguments, but does NOT expand macros. This has the effect of causing a match on two macros only when:

• Both arguments are macros AND their first level expansion is identical AND they have the same status with respect to \long and \outer

• One consequence of this statement is that two undefined macros will cause a match. Hence the following construct will ALWAYS correctly test whether a given macro is or is not defined:

\ifx \@testmacro \@empty
Code to be executed if the macro is undefined
\else
Code to be executed if the macro IS defined
\fi

So as an example, we will consider our idea of a \spokesman command. So in a user defined style file (loaded with the \usepackage{nameofpackage}) we would put the following:

%
% Define a spokesmen variable and initialize it
\newcommand{\spokesmen}[1]{\def\@spokesmen{#1}}
\spokesmen{}
%
% Properly clear the global variables and commands
% (is is more a convention to prevent confusion with
% symbols defined at other scopes)
\global\let\@spokesmen\@empty
\global\let\spokesmen\relax

% % % Some where within the style file where we redefine
% the command or environment we wish to modify
\renewcommand{\maketitle}{%
\begin{titlepage}
.
.
.
%
% Print the word Spokesmen
% and the name of the person only if the
% writer has defined it
\ifx\@spokesmen\@empty
\relax
\else
\begin{tabular}[t]{c}
\em{Spokesmen:}\\
\@spokesmen
\end{tabular}\par%
\fi%
.
.
.

If you have further questions consult:
TeX for the Impatient, Paul W. Abrahams -- ISBN 0-201-51375-7
For a detailed listing of all the standard TeX commands.
Andrew J. Norman


text:
1. anonymous

2. anonymous

use the distance formula$d =\sqrt{(x2-x1)^2 + (y2-y1)^2}$

3. anonymous

are u sure that is the right formula to use ?

4. anonymous

x,1, y1 = -2, -4 and X2, y2 = 4, 3

5. anonymous

whats so with that logic i was right ?

6. anonymous

$d= \sqrt{4-(-2)^2+(3-(-4)^2)}$

7. anonymous

$d= \sqrt{4-(4) + (3-16)}$

8. anonymous

$d= \sqrt{0 -13}$

9. anonymous

This ends up as a complex number d= 13i

10. anonymous

have you studied complex numbers?

11. anonymous

naw lol i just really cant get this question wrong :p

12. anonymous

maybe I have made a mistake, its not in your four options

13. anonymous

but those are the only options i have it has to be there :(

14. anonymous

one second I will get someone else to look over my results, but I have doubled checked it, and there are no mistakes. @Thesmartone

15. anonymous

@Thesmarterone need you to check my results

16. anonymous

hes offfline

17. anonymous

@Black_ninja123 @triciaal

18. Black_ninja123

One sec let me check

19. Black_ninja123

B is correct

20. anonymous

What does B is correct mean?

21. Black_ninja123

22. anonymous

23. anonymous

yea can u prove it ?

24. Black_ninja123

$d=(A.B)=\sqrt{x2-x1^{2}+y2-y1^{2}}$ This is the formula

25. anonymous

wait @HelpOfTheGods

26. anonymous

ok yea i seen that formula in my lesson so im thinking thats prob right since i have 0 clue lol

27. Black_ninja123

$\sqrt{-2 - 4^{2}+-4-3^{2}}$

28. anonymous

@Black_ninja123 chose the points in reverse

29. Black_ninja123

$\sqrt{36+49}$

30. Black_ninja123

$\sqrt{85}$

31. Black_ninja123

Square root of 85 is 9.22

32. anonymous

was anything I did @Black_ninja123 incorrect?

33. Black_ninja123

you said -2^2 is 4 but its actually -4

34. anonymous

are you joking me? -2 x -2 = 4 not -4!

35. Black_ninja123

Use the calculator and its gonna tell you -4

36. anonymous

I appreciate your help on this one @Black_ninja123

37. anonymous

I entered (-2)x (-2) and it still gives me +4

38. Black_ninja123

enter -2^2

39. anonymous

still +4

40. Black_ninja123

ok

41. anonymous

I can change the rules of arithmetic for integers if you like


text:
2017
Том 69
№ 2

# Volume 67, № 5, 2015

Anniversaries (Ukrainian)

### On the 90th Birthday of Yurii Makarovych Berezans’kyi

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 579-583

Article (Russian)

### Fredholm Boundary-Value Problems with Parameter in Sobolev Spaces

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 584-591

For systems of linear differential equations of order $r ∈ ℕ$, we study the most general class of inhomogeneous boundary-value problems whose solutions belong to the Sobolev space $W_p^{n + r} ([a, b],ℂ^m)$, where $m, n + 1 ∈ ℕ$ and $p ∈ [1,∞)$. We show that these problems are Fredholm problems and establish the conditions under which these problems have unique solutions continuous with respect to the parameter in the norm of this Sobolev space.

Article (Ukrainian)

### Representations of a Group of Linear Operators in a Banach Space on the Set of Entire Vectors of its Generator

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 592-601

For a strongly continuous one-parameter group $\{U(t)\} t ∈(−∞,∞)$ of linear operators in a Banach space $\mathfrak{B}$ with generator $A$, we prove the existence of a set $\mathfrak{B}_1$ dense in $\mathfrak{B}_1$ on the elements $x$ of which the function $U(t)x$ admits an extension to an entire B$\mathfrak{B}$-valued vector function. The description of the vectors from $\mathfrak{B}_1$ for which this extension has a finite order of growth and a finite type is presented. It is also established that the inclusion $x ∈ \mathfrak{B}_1$ is a necessary and sufficient condition for the existence of the limit ${ \lim}_{n\to 1}{\left(I+\frac{tA}{n}\right)}^nx$ and this limit is equal to $U(t)x$.

Article (Ukrainian)

### Convergence and Approximation of the Sturm–Liouville Operators with Potentials-Distributions

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 602–610

We study the operators $L_n y = −(p_n y′)′+q_n y, n ∈ ℤ_{+}$, given on a finite interval with various boundary conditions. It is assumed that the function $q_n$ is a derivative (in a sense of distributions) of $Q_n$ and $1/p_n , Q_n /p_n$, and $Q^2_n/p_n$ are integrable complex-valued functions. The sufficient conditions for the uniform convergence of Green functions $G_n$ of the operators $L_n$ on the square as $n → ∞$ to $G_0$ are established. It is proved that every $G_0$ is the limit of Green functions of the operators $L_n$ with smooth coefficients. If $p_0 > 0$ and $Q_0(t) ∈ ℝ$, then they can be chosen so that $p_n > 0$ and $q_n$ are real-valued and have compact supports.

Article (Ukrainian)

### Solvability of the Nonlocal Boundary-Value Problem for a System of Differential-Operator Equations in the Sobolev Scale of Spaces and in a Refined Scale

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 611-624

We study the solvability of the nonlocal boundary-value problem with one parameter for a system of differential-operator equations in the Sobolev scale of spaces of functions of many complex variables and in the scale of Hörmander spaces which form a refined Sobolev scale. By using the metric approach, we prove the theorems on lower estimates of small denominators appearing in the construction of solutions of the analyzed problem. They imply the unique solvability of the problem for almost all vectors formed by the coefficients of the equation and the parameter of nonlocal conditions.

Article (Ukrainian)

### Two-Term Differential Equations with Matrix Distributional Coefficients

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 625–634

We propose a regularization of the formal differential expression $$\begin{array}{cc}\hfill l(y)={i}^m{y}^{(m)}(t)+q(t)y(t),\hfill & \hfill t\in \left(a,b\right)\hfill \end{array},$$ of order $m ≥ 2$ with matrix distribution $q$. It is assumed that $q = Q^{([m/2])}$, where $Q = (Q_{i,j})_{i,j = 1}^s$ is a matrix function with entries $Q_{i,j} ϵ L_2[a, b]$ if $m$ is even and $Q_{i,j} ϵ L_1[a, b]$, otherwise. In the case of a Hermitian matrix $q$, we describe self-adjoint, maximal dissipative, and maximal accumulative extensions of the associated minimal operator and its generalized resolvents.

Article (Ukrainian)

### A Problem with Condition Containing an Integral Term for a Parabolic-Hyperbolic Equation

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 635-644

In a layer obtained as the Cartesian product of an interval $[−T_1 ,T_2], T_1 ,T_2 > 0$, and a space $ℝ_p, p ≥ 1$, we study a problem with nonlocal condition in the time variable containing an integral term for a mixed parabolic-hyperbolic equation in the class of functions almost periodic in the space variables. For this problem, we establish a criterion of uniqueness and sufficient conditions for the existence of solutions. To solve the problem of small denominators encountered in the construction of the solution, we use the metric approach.

Article (Ukrainian)

### Mixed Problems for the Two-Dimensional Heat-Conduction Equation in Anisotropic Hörmander Spaces

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 645-656

For some anisotropic inner-product Hörmander spaces, we prove the theorems on well-posedness of initial-boundary-value problems for the two-dimensional heat-conduction equation with Dirichlet or Neumann boundary conditions. The regularity of the functions from these spaces is characterized by a couple of numerical parameters and a function parameter regularly varying at infinity in Karamata’s sense and characterizing the regularity of functions more precisely than in the Sobolev scale.

Article (Ukrainian)

### Schrödinger Operators with Distributional Matrix Potentials

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 657–671

We study $1D$ Schrödinger operators $L(q)$ with distributional matrix potentials from the negative space $H_{unif}^{− 1} (ℝ, ℂ^{m × m})$. In particular, the class $H_{unif}^{− 1} (ℝ, ℂ^{m × m})$ contains periodic and almost periodic generalized functions. We establish the equivalence of different definitions of the operators $L(q)$, investigate their approximation by operators with smooth potentials $q ∈ L_{unif}^{− 1} (ℝ, ℂ^{m × m})$, and also prove that the spectra of operators $L(q)$ belong to the interior of a certain parabola.

Article (English)

### Elliptic Boundary-Value Problems in the Sense of Lawruk on Sobolev and Hörmander Spaces

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 672–691

We study elliptic boundary-value problems with additional unknown functions in boundary conditions. These problems were introduced by Lawruk. We prove that the operator corresponding to a problem of this kind is bounded and Fredholm in appropriate couples of the inner product isotropic Hörmander spaces $H^{s,φ}$, which form the refined Sobolev scale. The order of differentiation for these spaces is given by a real number $s$ and a positive function $φ$ slowly varying at infinity in Karamata’s sense. We consider this problem for an arbitrary elliptic equation $Au = f$ in a bounded Euclidean domain $Ω$ under the condition that $u ϵ H^{s,φ} (Ω),\; s < \text{ord} A$, and $f ϵ L_2 (Ω)$. We prove theorems on the a priori estimate and regularity of the generalized solutions to this problem.

Article (Ukrainian)

### On the Continuity in a Parameter for the Solutions of Boundary-Value Problems Total with Respect to the Spaces $C^{(n+r)}[a, b]$

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 692–700

We study a broad class of linear boundary-value problems for systems of ordinary differential equations, namely, the problems total with respect to the space $C^{(n+r)}[a, b]$, where $n ∈ ℕ$ and $r$ is the order of the equations. For their solutions, we prove the theorem of existence, uniqueness, and continuous dependence on the parameter in this space.

Article (Ukrainian)

### On Decompositions of a Scalar Operator into a Sum of Self-Adjoint Operators with Finite Spectrum

Ukr. Mat. Zh. - 2015. - 67, № 5. - pp. 701–716

We consider the problem of classification of nonequivalent representations of a scalar operator $λI$ in the form of a sum of $k$ self-adjoint operators with at most $n_1 , ...,n_k$ points in their spectra, respectively. It is shown that this problem is *-wild for some sets of spectra if $(n_1 , ...,n_k)$ coincides with one of the following $k$ -tuples: $(2, ..., 2)$ for $k ≥ 5,\; (2, 2, 2, 3),\; (2, 11, 11),\; (5, 5, 5)$, or $(4, 6, 6)$. It is demonstrated that, for the operators with points 0 and 1 in the spectra and $k ≥ 5$, the classification problems are *-wild for every rational $λ ϵ 2 [2, 3]$.


text:
Lloyd Allen

2021-11-20

Calculate. $\frac{d\left(2{x}^{5}\right)}{dx}$

Supoilign1964

Step 1
We have to calculate the following derivative:
$\frac{d\left(2{x}^{5}\right)}{dx}$
We know the formula of derivatives,
$\frac{{dx}^{n}}{dx}=n{x}^{n-1}$
$\frac{da{x}^{n}}{dx}=a\frac{{dx}^{n}}{dx}$ (where a is some constant)
Step 2
Applying above rule for the given derivative,
$\frac{d\left(2{x}^{5}\right)}{dx}=2\frac{{dx}^{5}}{dx}$
$=2\left(5{x}^{5-1}\right)$
$=10{x}^{4}$
Hence, required answer is $10{x}^{4}$.

Do you have a similar question?


text:
# Importing a SSL certificate using the keytool utility results in an Illegal Header error

#### Still need help?

The Atlassian Community is here for you.

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

## Problem

Attempting to import a new certificate into your local keystore using the keytool utility results in an error:

keytool error: java.security.cert.CertificateException: java.io.IOException: Illegal header: -----BEGIN CERTIFICATE-----

## Cause

This error is generally caused by a white space character in the header of the certificate. See this Stackflow discussion for more details.

## Resolution

Locate and remove any whitespace from the header of the certificate. See this discussion for tips on how this can be accomplished.


text:
# Why is the equilibrium constant unaffected by a change of the initial concentration?

In my class, it was taught that the equilibrium constant does not vary with the intial concentration of the reactants? Why is it so?

For $$a\mathrm{A}+b\mathrm{B}\rightarrow c\mathrm{C}+d\mathrm{D}$$, $$K_c=\frac{[\mathrm{C}]^c[\mathrm{D}]^d}{[\mathrm{A}]^a[\mathrm{B}]^b}$$ where $$[\mathrm{C}]$$, $$[\mathrm{D}]$$, $$[\mathrm{A}]$$, and $$[\mathrm{B}]$$ are concentrations at equilibrium.
• This is a first order approximation for ideal dilutions only. If the initial concentration becomes large, $K_c\propto K$ breaks down. – Martin - マーチン Sep 27 '18 at 12:56


text:
### Home > PC > Chapter 2 > Lesson 2.3.1 > Problem2-77

2-77.

Find the following sums.

1. $\frac { x + 2 } { x - 1 } + \frac { x } { x + 1 }$

$\frac{(x+2)(x+1)}{(x-1)(x+1)}+\frac{(x)(x-1)}{(x+1)(x-1)}$

$\large\frac{(x^2+x+2x+2)+(x^2-x)}{x^2+x-x-1}$

$\large\frac{2x^2+2x+2}{x^2-1}$

1. $\frac { c } { a - b } + \frac { c } { a + b }$

Review the steps outlined in part (a).

1. $\frac { x + 2 } { 3 x } - \frac { x + 1 } { 6 x ^ { 2 } }$

Use a Giant $1$ of $\frac{2x}{2x}$ for the first fraction to create a common denominator.


text:
# A polyp-on-chip for coral long-term culture

## Abstract

Coral polyps are basic clonal biological units of reef corals. However, in vitro experimental model for long-term physiological and ecological studies has not been well developed due to the difficulty of effectively acquiring and culturing single polyps. This study developed an experimental platform based on microfluidics for culturing single coral polyps and tracing its growth state over time in the long run. The corresponding computational modeling was conducted to predict the metabolic processes under the static and dynamic conditions by coupling the mass transfer and reaction with Navier-Stokes equations. Design and fabrication of the microfluidic chip was the key to provide a constant laminar flow environment that enabled the controlled high oxygen and bicarbonate transfer for the cultivation of the single coral polyps. The single coral polyps were induced to bail out of the coral reef upon the chemical stress and cultured for more than fifteen days in the microfluidic chip. It was found that the single coral polyps in the microfluidic chip can maintain their normal metabolic process over the cultivation period, suggesting that our microfluidic platform can serve as a suitable tool to study the coral polyps by providing a controllable and suitable biological microenvironment.

## Introduction

Stony corals are essential building blocks for coral reefs in marine ecosystems by providing foods, habitats and shelters for a large number of marine organisms. In recent years, coral bleaching occurred more and more frequently due to the environmental deterioration, for example ocean acidification and greenhouse effect1,2. It is thus urgent to conduct studies related to both the physiological and ecological processes of reef corals for the purpose of maintaining the biodiversity, protecting and restoring the marine ecosystems, and defending the sensitive shorelines from the waves1,3,4. To date, a series of investigations have been carried out on the physiology, symbiosis (with zooxanthellae) and biomineralization of the reef corals at the cell and tissue levels5,6,7,8,9,10. Although experimental methods for primary cultures have been established, the subsequent efficient proliferation of such cnidarian cells is still a problem. This is more or less due to lack of the experimental approaches to screen the key factors which affect the metabolic process of reef corals in a microscopic level.

To this end, it has been suggested that studying the coral polyps, which serves as model organisms for reef corals, is a more plausible way to acquire the necessary physiological information to understand the biological behaviors of reef corals11,12,13,14,15. However, it still remains a challenge to collect and culture single coral polyps in vitro16. Usually there are two approaches to obtain single coral polyps. One is to collect the planulae larvae and induce its metamorphosis to a primary polyp12,17. Normally a few nights around the full moon in an appropriate season are needed. This method is time consuming and restricted by the coral spawning period due to individual differences. The other one is to induce the detachment of the single polyps from the coral skeletons. For both methods, the main problem is how to create a suitable in vitro environment to support the long-term survival of the coral polyps. Although it has been reported that the polyps of solitary coral F. granulosa can survive in the glass Petri dishes for over three years18, the most majority of stony corals are colonial ones, which are different from solitary corals in the polyp size, structural and cultural features. And, as mentioned above, the single coral polyps bailing out of the coral skeletons are so sensitive to the environment that it is difficult for them to be cultured in vitro for a long period of time19. Previous studies indicated that culture of the single coral polyps suspended in the solution was limited to a week with two days’ seawater renewal16.

In order to solve the above problem, a biomimetic microwell-based microfluidic chip platform is presented here for the long-term culture of the single coral polyps, which can conveniently be combined with the microscopy. Compared with the traditional culture method, the microfluidic culture platform is advantageous in feasibly and precisely controlling the local cellular microenvironment and monitoring the growth state of the cultured living organisms in real time and in situ20,21,22. The platform can provide an adjustable microenvironment to control the temperature, light intensity and fluid composition, which can easily be assembled and disassembled based on different experimental requirements. To ensure the feasibility and robustness, the flow characteristics and the mass transfer for the dissolved oxygen (DO) and dissolved inorganic carbon (DIC) in this chip were evaluated and analyzed by the computer simulation. Single coral polyps were bailed out and cultured in this dynamic microfluidic chip under the traditional static and the flowing conditions. Experimental results confirmed that this coral-polyp-on-chip methodology is a more efficient approach to support the in vitro long-term culture of single coral polyps.

## Materials and Methods

### Coral microchip fabrication

Several aspects need to be taken care of when the microchip system was designed. First, it should be transparent in terms of the visible light in order for the coral polyps to be observed and imaged. Second, a dynamic fluid microenvironment should be considered to provide enough nutrients and remove unnecessary metabolic wastes. Third, the temperature and light intensity need to be changed within the chip as adjustable parameters. Therefore, as shown in Fig. 1C, a chip with a multilayer structure was employed, including a polymethyl methacrylate (PMMA) substrate, a cover glass, and a holder. The PMMA substrate contained three micro-cavities in parallel connected by flow channels with the fluid going in and out using silicone tubes. A syringe pump was connected to the chip to keep the fluid flowing at a constant speed. The cover glass was mounted onto the substrate after the explantation of the coral polyp. The two PMMA base holders (overall thickness ~ 4 mm), fixed by eight screws at the edge area, were used to seal the cover and substrate, thus allowing this multilayer microchip to be assembled and disassembled feasibly.

The multilayer chips were fabricated via the micromachining technology. In brief, the template was designed using the Software AutoCAD 2014 and processed by a computer controlled milling machine. On the PMMA substrate (thickness ~2 mm), the channels were engraved with a width of 1 mm and a height of 300 μm. The microwell was created on the substrate with a height of 500 μm and a diameter of 1.5 mm. Before the experiment, all the layers were sequentially rinsed with ethanol (Kermel), ultrapure water (18.2 $${\rm{M}}\Omega$$, Milli-Q gradient A10 water purification system, Millipore Corporation), and finally blew dry with N2.

### Modeling of flow characteristics, DO and DIC mass transfer in the chip

Photosynthesis and respiration are two critical biological processes in the long-term culture of coral polyps, which are associated with the uptake and release of the DO and DIC23,24,25,26. The DIC in the coral coelenteron is mainly taken in by symbiotic zooxanthellae for the photosynthesis to generate the photosynthates (DO, $${{\rm{H}}}_{2}{\rm{O}}$$) upon consuming equal molar numbers of DIC (Fig. 1B). The photosynthates are then used for respiration with the product (DIC) stored in coelenteron. However, coral polyps still need extra DIC from the ambient seawater27 since the photosynthesis rate of zooxanthellae algae is higher than that of coral polyps. To know the details about the flow environment in the chip, the flow characteristics, the DO and DIC transfer were simulated using the COMSOL Multiphysics 5.2a software. The simulated area included a 300 μm deep, 2 mm wide channel with six circle columns and a 500 μm deep microwell (radius 750 μm), where a single coral polyp settled. First, the flow field distribution of the liquid flow in the channel was evaluated to identify the key design parameters. The DO and DIC transfer and consumption were analyzed based on the flow field. Simulation details were put in the Supporting information.

### Bail-out and explantation of single coral polyps

Based on the calcium-free cell dissociation protocol5, the single coral polyps of P. damicornis (Coelenterata, Anthozoa, Scleractinia, collected from the coral reef in Wenchang, Hainan Province, China) were successfully induced to bail out of the coral reef. Briefly, fast-growing apical fragments (length ~ 1.0 cm) of the coral reefs were excised from parent coral colonies and cut into the smaller ones (length ~ 0.3–0.5 cm) with a stainless tweezer. The fragments were then submerged in the calcium-free artificial seawater (CaFSW) in a Petri dish, washed three times and pre-incubated in CaFSW with an orbital incubator (80 rpm) for 3 h. Afterwards, the fragments were transferred to a culture medium (5 mL) supplemented with the 3% penicillin-streptomycin solution in a 6-well plate. Culture mediums with different Dulbecco’s modified Eagle’s medium (DMEM) contents were tested to screen the best condition for the coral polyp explantation. The plate was placed in a 26 °C incubator and monitored continuously for the bail-out of the single coral polyps. The primary cultures were changed every day until the single coral polyps were released from the fragmental skeleton. The bailed-out coral polyps were examined under a stereomicroscope for their integrity. The intact coral polyps, including a mouth, twelve tentacles and mesenteries were submerged in the filter-sterilized artificial seawater (FASW) for the initial recovery. Viable coral polyps were collected by a 1 mL pipette with carefulness and placed in the chip microwell at a flow rate of 90 $${\rm{L}}\,{{\rm{\min }}}^{-1}$$, as shown in Fig. 1D.

### Culture of single coral polyps in the microfluidic chip

The microfluidic chip system was placed in a 525-liter glass aquarium filled with the artificial seawater. The culture process went with the temperature of 26 °C, salinity of 35 p.p.t (g L−1), 12/12 h illumination/dark cycle (white/red/blue fluorescent bulbs), and pH of 8.0–8.2. The P. damicornis colonies were acclimated for at least two weeks before experiments.

The artificial seawater was prepared by dissolving the coral pro salt (Red Sea, Europe) in a certain volume of deionized water until the salinity reached 35 p.p.t. The CaFSW was prepared by adding 23 g of NaCl, 0.763 g of KCl, 1.89 g of MgSO4·7H2O, 10.45 g of MgCl2·6H2O, 3 g of Na2SO4 and 0.25 g of NaHCO3 to a liter of deionized H2O. The pH value was adjusted to be 8.0 using the 1 M NaOH solution. The stock solution was prepared by dissolving 10 g of powered DMEM (GIBCO) in a liter of CaFSW, supplemented with 3.7 g of NaHCO3. A series of culture mediums were prepared in filter-sterilized artificial seawater (FASW) with different concentrations of stock solutions (0%, 20%, 40%, 60%, 80% and 100%). The penicillin-streptomycin solution (HyClone) was added when necessary.

### Characterization of coral polyps

Autofluorescences resulted from the native green fluorescent protein (green) in the P. damicornis coral polyps and algal chlorophyll (red) in the zooxanthellae11 can facilitate the fluorescence imaging. In this study, a laser scanning confocal microscope (LSCM, Leica TCS SP8, Germany) was used to image the coral polyps with the built-in software (Leica Application Suite X). The gross morphologies and fine structures of the coral polyps were characterized with the stereomicroscope (Olympus SZ51, Japan) and inversion fluorescence microscope (Olympus IX81, Japan). To capture the scanning electron microscopic (SEM, Scanning electron microscope, Hitachi SU8010) images, individual coral polyps were solidified and fixed in 2.5% glutaraldehyde for 1 h. The fixed coral polyps were then dehydrated upon immersion in pure ethanol, dried under vacuum, sputter-coated with gold-palladium and finally imaged.

## Results

### Bail-out and microscopic characterization of coral polyps

The coral polyp expulsion was often associated with the environmental stress. A number of stimuli have been adopted to induce the bail-out of the coral polyps, such as low pH, salinity gradient, thermal stress, chlordecone stress, or seawater with low nutrient load11,28,29,30,31. In this study, a new approach was employed.

The expulsion of the coral polyps was induced from P. damicornis fragments (Fig. 2A). Six different culture mediums with the DMEM contents ranging from 0 to 100% were used. The process involved the withdrawal of individual coral polyps from the coenosarc followed by the detachment and release from the fragmental skeleton. We found, the withdrawal and detachment of the coral polyps were dependent on the DMEM concentration and the best bailed-out concentration was 20%. At this concentration, the individual coral polyps showed the complete biological structure and the high vitality under a stereomicroscope (See the Supporting Information, Fig. S1). Although culture mediums of higher DMEM concentrations (40%, 60%, 80% and 100%) led to the detachment of the coral polyps from their parent coral skeletons over shorter period of time, the surface epitheliums of the ectodermal layers for the released coral polyps were incomplete or missing (Fig. S1, taking 80% as an example). Given even longer time, pieces of tissues composed of aggregated coral polyps with the interconnected coenosarcs were released from the skeletons, again suggesting that the high concentrations were inappropriate for the explantation of the single coral polyps. This indicated that the moderately concentrated medium (20%) was already enough for the coral polyp expulsion, which allowed for both the active polyp detachment and tissue structural integrity at the same time. Additional micro-scale features for the oral and aboral ends of the coral polyps were observed under the SEM (Figs. 2E,F; S2 A–C). Around the mouth area, there existed several different kinds of algae. A previous study indicated P. damicornis could consume and digest algae to some extent32. The fluorescence images were captured for the cultured P. damicornis polyps under the LSCM (Figs. 2G,H; S2 D–F). As mentioned above, the autofluorescences from both the native green fluorescent proteins (GFP) in the coral polyp and algal chlorophyll made the imaging process feasible. As shown in Fig. 2G, the fluorescent images confirmed that zooxanthellae symbionts only existed in the coral polyp’s ectoderm. It should also be noted, this was the first time for the individual coral polyp’s 3D structure to be imaged using the GFP and chlorophyll fluorescence signals at a high spatiotemporal resolution (Fig. 2H) (Movie S1). Using the built-in software, the curves of the fluorescence intensities (red and green) as a function of z (depth) were plotted (Fig. 2I). The fluorescence intensity of algal chlorophyll (red) were very high for the first 0–300–30 $${\rm{\mu }}{\rm{m}}$$ and went through a sharp decrease afterwards. This should come from the fact that zooxanthellae algae were located at the surface area of the mouth, where it was easy for them to acquire illuminance for the photosynthesis, thus providing more energy and oxygen for the growth of the coral polyp.

### Designing a microfluidic platform

As the core component of the coral polyp culture, the assembled microfluidic chip platform consists of three micro-cavities (or microwells) used to settle single coral polyps with the fluid flowing in the channels (Fig. 3A). The single coral polyps could easily be transferred into the chip by pipette transplanting, as shown in Fig. 3B. The problem of generating air bubbles could be avoided by filling the channels with the fluid before transplanting the coral polyps. In this way, the coral polyps could be settled in the microwells without injury. Owing to the disassembility of the microchip system, the cultured coral polyps can also be taken out of the microchip for further characterization, for example SEM. To maintain the normal metabolism of the coral polyps, the environmental factors including the flow rate, temperature and light intensity were precisely controlled in the aquarium.

A vital factor to be considered for the chip design is the structure and size of the microwells. If the microwell is too shallow, the coral polyps may bear the excessive impact from the liquid flow, which adversely affects the growth of the coral polyp. On the contrary, if the microwell is too deep, the effective mass transfer for the sufficient nutrient supply for the coral polyps cannot be guaranteed. Therefore, the depth and diameter of the microwell were selected to be 500 $${\rm{\mu }}{\rm{m}}$$ and 1.5 mm based on our simulation result. At the peripheric area of the microwell, there was a circular channel with 200 $${\rm{\mu }}{\rm{m}}$$ in depth and 3 mm in diameter to buffer the fluid impact on the coral polyp, thus preventing the coral polyp from entering the top channel (see the Fig. S3 for detail).

### Modeling of metabolic process

The flow characteristics in the microfluidic chip were crucial for the coral polyp’s long-term survival and growth. Two important parameters must be considered, i.e. the flow velocity and the shear rate, which are directly associated with the mass transfer and the impact force regarding the coral polyp. In order to balance the mass transfer and the impact force, the combined effect of both convection and diffusion need to be considered. Generally speaking, if the Peckert number is larger than 1, the convection contributes to the mass transfer more than the diffusion does. The homogeneous mass distribution can effectively be achieved by continuous perfusion. From the simulation results of various inlet rates (15–120 $${\rm{\mu }}{\rm{L}}/\,{\rm{\min }}$$) (Supporting Information, Fig. S3), the streamline plot of the velocity distribution in the microwell at the optimum inlet flow rate, $$Q=30\,{\rm{\mu }}{\rm{L}}\,{{\rm{\min }}}^{-1}$$, was shown in Fig. 4. As the liquid flowed forward through the system, the low velocity streamlines were distributed (blue) at the center area of the microwell and near the grooves, thus presenting the lower shear rates than those in the channels (red and green). The shear rate of the coral reef in the natural environment is in a range of 0.11–3 s−1 33,34. Our simulation result has shown that the shear rate in the chip environment (1.5–2.5 s−1) is within this range. The simulation results clearly indicated that the velocity and the shear rate were effectively limited by the buffer regions and barriers (see the Supporting Information, Fig. S4, for the design).

Regarding the metabolic process of the coral polyps, DO and DIC play important roles in the respiration and photosynthesis35. The lack of DO and DIC can limit the growth of the corals with the symbiotic algae during the culture16. Therefore, a suitable microenvironment in the 3D microchip must be presented for the respiration and photosynthesis of the coral polyps. The respiration and photosynthesis of the coral polyp were analyzed based on the mass transfer and the dynamical model of the metabolism, as shown in Eq. (1.4), (1.5) and (1.6) in the Supporting Information, respectively. And the detailed parameters used in the model were summarized in the Supporting Information (Table S1). Figure 5A showed the simulated results of the concentration distributions of DO and DIC by solving the laminar flow and mass transfer coupled equations. In order to highlight the difference between the microfluidic chip and the traditional method, the static and dynamic conditions were analyzed. The faster metabolite consumption and production were found under the static condition than those under the dynamic condition, which then led to the accumulation of DO and the reduction of DIC for the coral polyp in the central area of the microwell. The DIC concentration was lower than the initial value, 2 $${\rm{mol}}\,{{\rm{m}}}^{-3}$$, under the static condition, and became even lower and lower as the culture went on over longer simulation time. This ultimately led to the separation of zooxanthellae from the coral polyps (see the Supporting Information, Fig. S1). However, the situation was different under the dynamic condition, where the steady gradient distributions for DO and DIC were obtained because the liquid flow promoted the substance exchange in our microchip. The DO and DIC concentrations at the center area were about 0.26 and 2.2 $${\rm{mol}}\,{{\rm{m}}}^{-3}$$, respectively. This implied that the flow environment could enhance the mass transfer process, leading to the on-demand environment for the coral polyp culture. Furthermore, the respiration and photosynthetic rates over time were evaluated under the dynamic and static conditions, as shown in Fig. 5B. It should be noted, although the simulation period was short, the trends over longer time can clearly be predicted in our simulation result. The simulation indicated that the respiration and photosynthetic processes can quickly reach steady states under the dynamic condition and keep at higher levels. For the static condition, the larger scale simulation results are shown in Supporting Information (Fig. S6). Under the static condition, for the photosynthetic process (red curve, top panel in Fig. 5B), the photosynthetic rate decreased gradually over time. This explained why the long-term culture of the coral polyps can’t be performed in vitro under the static condition. where the energy supply from the photosynthetic process constantly decreased for even prolonged time and the coral polyps had to die eventually16.

From the above simulation results, it could be concluded that our microchip could implement the balance between the high DO and high DIC mass transfer and render the low fluid shear rate. The results of steady respiration and photosynthesis rates suggested that the microchip platform could present an open interface to study the biological behaviors for the coral polyps in response to additional environmental stimuli.

## Discussion

As is known, a coral polyp is the basic clonal biological unit of reef corals. Current investigations on coral polyps from colonial corals are limited by their poor viability in vitro. The most significant problem here is that individual coral polyps can only survive for a short period of time after the detachment from the coral skeleton. A previous study reported that a coral polyp was induced to detach from the colonial hard coral, which survived for a week16. However, using our microfluidic platform, P. damicornis polyps could grow and develop with good tissue integrity for more than 15 days. As shown in Figs. 6A and S7, the initial polyp explanted to the microfluidic system was still in a stressful state with frizzy tentacles. The tentacles of the coral polyp rarely relaxed as normal and the boundaries of the tentacles were ambiguous. A large number of zooxanthellae gathered in or even flowed out of the mouth. However, with the one-day recovery at a flow rate of 30 uL min−1, the single coral polyp in the microchip could move freely and their tentacles were fully relaxed (Movie S2). In the next few days, the coral polyp grew bigger with better vitality than before (Fig. 6C).

In comparison, under the static condition, the body of the coral polyp began to shrink and extended its mesenteric filaments the next day after the explantation. On the third day, coral cells and zooxanthellae flowed out of the mouth of the coral polyp and eventually caused the death of the coral polyp (Fig. 6B). The possible reason was that the static condition created a diffusion barrier in the microenvironment, limited the DIC supply for the photosynthesis of zooxanthellae and the DO supply for the respiration of the coral polyp, thus resulting in the death of the coral polyp36. In addition, the accumulation of metabolites worsened the quality of the surrounding microenvironment, which could also lead to the death of the coral polyp. However, under the dynamic condition, metabolites were continuously removed with the FASW. DO in the FASW can support the respiration, which in turn sustained the photosynthesis, thus creating a balanced microenvironment. This dynamically balanced mode in the microchip facilitated the survival and development of the coral polyp for a longer period of time.

In the long run, we can assume that the microchip system to culture the single coral polyps can be used for the long-term physiological and ecological studies such as the ocean acidification and El Nino effects on the reef corals at a microscopic level. Upon bailing-out, a single mother colony can generate many coral polyps. It will be more convenient and controllable to conduct the experimental study for many cultured coral polyps at the same time in order to retrieve the reliable results in comparison to using small colonies or nubbins as the experimental units37,38,39. For example, it has been reported that the deterioration of the coral colonies under the low pH condition was initiated from the single coral polyps28. With the coral bleaching occurring more and more frequently2, the studies using single coral polyps as experimental units can be a useful and alternative approach to understand the inherent mechanism. In consequence, such investigations can be carried out with the aid of the coral-polyp-on-chip.

In summary, we established a convenient and assembled microfluidic chip platform to provide a dynamic and controllable microenvironment for the single coral polyp culture. The design based on the microwell and the physical barriers in the chip enhanced the mass transfer efficiency, reduced the impact of the shear force and avoided the accumulation of metabolites. In reward, the single coral polyp survived and developed with good viability over a long period of time, i.e. fifteen days, in comparison to the case under the static culture condition. It was observed that the individual polyp of P. damicornis stretched out tentacles in vitro when cultured in our microfluidic platform, similar to the cultured case in the glass aquarium where the coral colonies developed healthy31. Moreover, because this coral polyp-on-chip is a modular device which can be standardized, it can easily be combined with various techniques, such as vibrational spectroscopy, high performance liquid chromatography-mass spectrometry (HPLC-MS), nuclear magnetic resonance (NMR), and the super resolution microscopy for the purpose of studying the coral polyps from different perspectives. Current studies are under way to decipher the biological cues for the single coral polyps under the environmental stressors, for example temperature change and/or ocean acidification.

## References

1. 1.

Carpenter, K. E. et al. One-third of reef-building corals face elevated extinction risk from climate change and local impacts. Science 321, 560–563 (2008).

2. 2.

Hughes, T. P. et al. Spatial and temporal patterns of mass bleaching of corals in the Anthropocene. Science 359, 80–83 (2018).

3. 3.

Salih, A., Larkum, A., Cox, G., Kühl, M. & Hoegh-Guldberg, O. Fluorescent pigments in corals are photoprotective. Nature 408, 850–853 (2000).

4. 4.

Yuyama, I. & Higuchi, T. Comparing the effects of symbiotic algae (Symbiodinium) clades C1 and D on early growth stages of Acropora tenuis. PLoS One 9, e98999, https://doi.org/10.1371/journal.pone.0098999 (2014).

5. 5.

Domart-Coulon, I. J., Elbert, D. C., Scully, E. P., Calimlim, P. S. & Ostrander, G. K. Aragonite crystallization in primary cell cultures of multicellular isolates from a hard coral, Pocillopora damicornis. Proceedings of the National Academy of Sciences of the United States of America 98, 11885–11890 (2001).

6. 6.

Yael, H. et al. Extracellular matrix production and calcium carbonate precipitation by coral cells in vitro. Proc Natl Acad Sci USA 105, 54–58 (2008).

7. 7.

Mass, T. et al. Aragonite precipitation by “proto-polyps” in coral cell cultures. PLoS One 7, e35049, https://doi.org/10.1371/journal.pone.0035049 (2012).

8. 8.

Mass, T., Drake, J. L., Heddleston, J. M. & Falkowski, P. G. Nanoscale Visualization of Biomineral Formation in Coral Proto-Polyps. Current Biology 27, S0960982217311764 (2017).

9. 9.

Nesa, B. & Hidaka, M. High zooxanthella density shortens the survival time of coral cell aggregates under thermal stress. Journal of Experimental Marine Biology and Ecology 368, 81–87, https://doi.org/10.1016/j.jembe.2008.10.018 (2009).

10. 10.

Davy, S. K., Allemand, D. & Weis, V. M. Cell biology of cnidarian-dinoflagellate symbiosis. Microbiol Mol Biol Rev 76, 229–261 (2012).

11. 11.

Shapiro, O. H., Kramarsky-Winter, E., Gavish, A. R., Stocker, R. & Vardi, A. A coral-on-a-chip microfluidic platform enabling live-imaging microscopy of reef-building corals. Nat Commun 7, 10860 (2016).

12. 12.

Akiva, A. et al. Minerals in the pre-settled coral Stylophora pistillata crystallize via protein and ion changes. Nat Commun 9, 1880 (2018).

13. 13.

Stien, D. et al. Metabolomics reveal that octocrylene accumulates in Pocillopora damicornis tissues as fatty acid conjugates and triggers coral cell mitochondrial dysfunction. Anal Chem 91, 990–995 (2019).

14. 14.

Thurber, R. V., Payet, J. P., Thurber, A. R. & Correa, A. M. Virus-host interactions and their roles in coral reef health and disease. Nat Rev Microbiol 15, 205–216 (2017).

15. 15.

Gardner, S. G., Nielsen, D. A., Petrou, K., Larkum, A. W. D. & Ralph, P. J. Characterisation of coral explants: a model organism for cnidarian–dinoflagellate studies. Coral Reefs 34, 133–142 (2014).

16. 16.

Domart-Coulon, I., Tambutté, S., Tambutté, E. & Allemand, D. Short term viability of soft tissue detached from the skeleton of reef-building corals. Journal of Experimental Marine Biology and Ecology 309, 199–217 (2004).

17. 17.

Ohno, Y. et al. Calcification process dynamics in coral primary polyps as observed using a calcein incubation method. Biochemistry & Biophysics Reports 9, 289–294 (2017).

18. 18.

Vizel, M., Loya, Y., Downs, C. A. & Kramarsky-Winter, E. A Novel Method for Coral Explant Culture and Micropropagation. Marine Biotechnology 13, 423–432 (2011).

19. 19.

Domart-Coulon, I. J. et al. A basidiomycete isolated from the skeleton of Pocillopora damicornis (Scleractinia) selectively stimulates short-term survival of coral skeletogenic cells. Marine Biology 144, 583–592 (2004).

20. 20.

Taylor, A. M. et al. A microfluidic culture platform for CNS axonal injury, regeneration and transport. Nature Methods 2, 599 (2005).

21. 21.

Zhong, Q., Ding, H., Gao, B., He, Z. & Gu, Z. Advances of Microfluidics in Biomedical Engineering. Advanced Materials Technologies 4, 1800663 (2019).

22. 22.

Chiu, P.-L., Chang, C.-H., Lin, Y.-L., Tsou, P.-H. & Li, B.-R. Rapid and safe isolation of human peripheral blood B and T lymphocytes through spiral microfluidic channels. Scientific Reports 9, 1–10 (2019).

23. 23.

Marubini, F., Ferrier-Pagès, C., Furla, P. & Allemand, D. Coral calcification responds to seawater acidification: a working hypothesis towards a physiological mechanism. Coral Reefs 27, 491–499 (2008).

24. 24.

Nakamura, T., Nadaoka, K. & Watanabe, A. A coral polyp model of photosynthesis, respiration and calcification incorporating a transcellular ion transport mechanism. Coral Reefs 32, 779–794 (2013).

25. 25.

Leclercq, N. & Jaubert, G. J. Primary Production, Respiration, and Calcification of a Coral Reef Mesocosm under Increased CO2Partial Pressure. Limnology and Oceanography 47, 558–564 (2002).

26. 26.

Aizawa, K. & Miyachi, S. Carbonic anhydrase and CO2 concentrating mechanisms in microalgae and cyanobacteria. Fems Microbiology Letters 39, 215–233 (1986).

27. 27.

Weis, V. M. Effect of dissolved inorganic carbon concentration on the photosynthesis of the symbiotic sea anemone Aiptasia pulchella Carlgren: Role of carbonic anhydrase. Journal of Experimental Marine Biology & Ecology 174, 209–225 (1993).

28. 28.

Hagit, K. et al. Breakdown of coral colonial form under reduced pH conditions is initiated in polyps and mediated through apoptosis. Proc Natl Acad Sci USA 112, 2082–2086 (2015).

29. 29.

Fordyce, A. J., Camp, E. F. & Ainsworth, T. D. Polyp bailout in Pocillopora damicornis following thermal stress. F1000Res 6, 687, https://doi.org/10.12688/f1000research.11522.2 (2017).

30. 30.

Wecker, P. et al. Exposure to the environmentally-persistent insecticide chlordecone induces detoxification genes and causes polyp bail-out in the coral P. damicornis. Chemosphere 195, 190–200 (2018).

31. 31.

Serrano, E., Coma, R., Inostroza, K. & Serrano, O. Polyp bail-out by the coral Astroides calycularis (Scleractinia, Dendrophylliidae). Marine Biodiversity 48, 1661–1665 (2017).

32. 32.

Sorokin, Y. U. I. On the Feeding of Some Scleractinian Corals with Bacteria and Dissolved Organic Matter. Limnology & Oceanography 18, 380–386 (1973).

33. 33.

Reidenbach, M. A., Monismith, S. G., Koseff, J. R., Yahel, G. & Genin, A. Boundary layer turbulence and flow structure over a fringing coral reef. Limnology and oceanography 51, 1956–1968 (2006).

34. 34.

Nakamura, T. v. & Van Woesik, R. Water-flow rates and passive diffusion partially explain differential survival of corals during the 1998 bleaching event. Marine Ecology Progress Series 212, 301–304 (2001).

35. 35.

Furla, P., Galgani, I., Durand, I. & Allemand, D. Sources and mechanisms of inorganic carbon transport for coral calcification and photosynthesis. Journal of Experimental Biology 203, 3445–3457 (2000).

36. 36.

Patterson, M. R. & Sebens, K. P. Forced convection modulates gas exchange in cnidarians. Proceedings of the National Academy of Sciences of the United States of America 86, 8833–8836 (1989).

37. 37.

Tang, J., Ni, X., Zhou, Z., Wang, L. & Lin, S. Acute microplastic exposure raises stress response and suppresses detoxification and immune capacities in the scleractinian coral Pocillopora damicornis. Environ Pollut 243, 66–74 (2018).

38. 38.

Yuan, C. et al. Effects of elevated ammonium on the transcriptome of the stony coral Pocillopora damicornis. Mar Pollut Bull 114, 46–52 (2017).

39. 39.

Zhou, Z. et al. Systemic response of the stony coral Pocillopora damicornis against acute cadmium stress. Aquatic Toxicology 194, 132–139 (2017).

## Acknowledgements

This study was supported by the State Key Development Program for Basic Research of China (2017YFA0700500, 2016YFA0501604), the Fundamental Research Funds for the Central Universities, and a project funded by the Priority Academic Program Development of Jiangsu Higher Education Institutions (PAPD), and the National Demonstration Center for Experimental Biomedical Engineering Education (Southeast University).

## Author information

Authors

### Contributions

All the authors, including Y.S.L., A.P.P., C.P.H., Z.H.L. and X.L.L., contributed to the design of the work, including microfluidic chip fabrication, encapsulation and optimization, as well as the analysis of the data. A.P.P. contributed to the bail-out of coral polyps. A.P.P. and Y.S.L. wrote the manuscript. X.L.L. reviewed and revised the manuscript.

### Corresponding author

Correspondence to Xiaolin Lu.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Pang, AP., Luo, Y., He, C. et al. A polyp-on-chip for coral long-term culture. Sci Rep 10, 6964 (2020). https://doi.org/10.1038/s41598-020-63829-4

• Accepted:

• Published:


text:
Home shell script to use cl1p.net online clipboard in linux - Error (23) Failed writing body
 I am searching for a simple solution to send stdout (or a file content) from a linux host (raspi with bash) to my PC. The RaspberryPI has network/internet connection, but for security reasons it's not an option to set up SMB / FTP server on the raspi. It is anoying to send to an external FTP server all the time, using command line. Please discuss general approaches (shell scripts for web form uploads, alternative options), and comment in particular on the scripting approach I meanwhile tried to write a shell script... #!/bin/bash a='content=' b=cat $2 content=$a$b curl -i -X POST https://cl1p.net/$1 -H "Content-Type: application/x-www-form-urlencoded" --data-binary "content=$content"  the script, as you see, should accept 2 command line args: $1 ... clipboard "unique name" $2 ... file to be sent to the clipboard)  When calling the script with the command line $ ./sh ./bclip.sh 20171207testXX ./test.log  I expected to be able to download the content here: https://cl1p.net/20171207testXX but when starting the script it says : not found.sh: 2: /boot/bclip.sh [... then the CURL upload output, and] (23) Failed writing body What am I doing wrong?


text:
Problems

Use sub-program

Calculate the sum and product N pairs which set material numbers, having taken advantage of subroutine SumDob for calculation of the sum and product of two material numbers.

Input

In the first line set the natural number N - quantity of pairs numbers. In the subsequent N lines through a blank it set on 2 material numbers. All input on the module does not exceed 100.

Output

In N lines deduce through a blank on two numbers: at first the sum, and then product of the next pair numbers. Result deduces with accuracy 4 signs after a decimal point.

Time limit 0.5 seconds
Memory limit 64 MiB
Input example #1
2
6 7.5
2.1 2.0

Output example #1
13.5000 45.0000
4.1000 4.2000

Example description: Permission is granted to use 2 sub-program to find the sum and product respectively each separately.

Source SFE-2010 Variant 13


text:
• You've just added this product to the cart:

無鹽麵包 (2片裝)

### 無鹽麵包 (2片裝)

產品簡介：
選用無鹽配方、更健康
• You've just added this product to the cart:

蘋果手撕包

### 蘋果手撕包

產品簡介：
混合丹麥酥及傳統方包嘅香酥鬆軟口感，配以清香的蘋果內餡
• You've just added this product to the cart:

蜂蜜手撕包

### 蜂蜜手撕包

產品簡介：
混合丹麥酥及傳統方包嘅香酥鬆軟口感，啖啖牛油及蜂蜜芳香
• You've just added this product to the cart:

迷你Q彈軟包(3個裝)

### 迷你Q彈軟包(3個裝)

產品簡介：
微甜的金黃色脆皮，內餡鬆軟麵包
• You've just added this product to the cart:

迷你朱古力手撕包

### 迷你朱古力手撕包

产品简介：
混合丹麦酥及传统方包慨香酥松软口感，表层淋上香浓朱古力酱，一试难忘
• You've just added this product to the cart:

迷你杏仁手撕包

### 迷你杏仁手撕包

产品简介：
混合丹麦酥及传统方包慨香酥松软口感，表层加入杏仁粒粒、口感丰富


text:
# A theoretical study of the photochemical $\alpha$-cleavage processes in symmetric and nonsymmetric ketones

Sumathi, K and Chandra, AK (1987) A theoretical study of the photochemical $\alpha$-cleavage processes in symmetric and nonsymmetric ketones. In: Journal of Photochemistry and Photobiology A: Chemistry, 40 (3). pp. 265-277.

 PDF full.pdf Restricted to Registered users only Download (881Kb) | Request a copy

## Abstract

The energy profiles for radical dissociation of the lowest triplet state of various symmetric and non-symmetric ketones have been computed using the MINDO/3 method and employing configuration interaction. The results of radical dissociation of thioformaldehyde were also examined. In each case, the activation barrier arises from an avoided crossing between two states of different symmetry. Our analysis reveals that the perpendicular motion of the carbonyl carbon is an important component in the reaction coordinate.

Item Type: Journal Article Copyright belongs of this article belongs to Elsevier Science Division of Chemical Sciences > Inorganic & Physical Chemistry 17 Mar 2008 19 Sep 2010 04:43 http://eprints.iisc.ernet.in/id/eprint/13247


text:
# When does the ratio X/Y of two random variables have a finite moment-generating function?

Let $X$ and $Y$ be two positive random variables with $Y < X$; these may be highly correlated. I would like a reasonable condition on $X$ and $Y$ so that the ratio $X/Y$ has a finite moment-generating function. By this I mean that $\mathbb E e^{r X/Y} < \infty$ for all $r \in \mathbb R$.

Here's one answer. Suppose that X and 1/Y both have super-Gaussian tail decay, that is,

$P(X > u) \le C e^{-cu^{2+\delta}},$

for positive constants $c$, $C$ and $\delta$, and similarly for $1/Y$. Then $X/Y$ has super-exponential tail decay:

$P(X/Y > u) = P(X > Yu$ and $Y \le 1/\sqrt{u}) + P(X > Yu$ and $Y > 1/\sqrt{u})$

$\le P(1/Y > \sqrt{u}) + P(X > \sqrt{u})$

$\le 2Ce^{-cu^{(2+\delta)/2}} = 2Ce^{-cu^{1+\delta/2}}.$

This gives a finite moment-generating function by the following simple argument, which uses the fundamental theorem of calculus and Tonelli's theorem. Let $Z = X/Y$.

$\mathbb Ee^{rZ} = \mathbb E \left[ 1 + \int_0^Z re^{ru} ~du \right] = 1 + \int_0^\infty re^{ru} \mathbb P(Z > u) ~du \le 1 + 2Cr \int_0^\infty e^{ru} e^{-cu^{1+\delta/2}} ~du$,

which is finite for all $r \in \mathbb R$. Thus, super-Gaussian tail decay suffices, but this is a very strong condition which I'd like to weaken.

(In fact, I only need that $\mathbb Ee^{rX/Y} < \infty$ for any one positive value of $r = r_0$. In that case, we may choose $r_0 = c/2$, and take $\delta = 0$ in all the above arguments. Then the integral $\int_0^\infty e^{r_0 u} e^{-cu} ~du$ still converges.)

-
Leonid, I can tell you exactly the context, if it helps. Let SPD be the set of symmetric, positive-definite d x d matrices. Consider the space Omega = C(R², SPD); this is the space of continuous (better yet, smooth) Riemannian metrics on R². Let P be a "reasonable" probability measure on Omega, and let g be a random variable with distribution P. That is, g is a random Riemannian metric on R². Let X = maximum eigenvalue of g(x) for x in [0,1)², and Y = minimum eigenvalue. Clearly, X and Y should be correlated. I want some understanding of the distribution of X/Y. –  Tom LaGatta Jan 15 '10 at 9:43

Let $D$ denote a set of probability distributions of positive random variables and $r$ a positive real number. Consider the following properties:
1. For every random variables $X$ and $T$ with probability distributions in $D$, $E(\mathrm{e}^{rXT})$ is finite.
2. For every random variable $X$ with probability distribution in $D$, $E(\mathrm{e}^{rX^2})$ is finite.
Property 1 implies Property 2 (choose $X=T$). Conversely, if Property 2 holds, note that $$\mathrm{e}^{ab}\le\mathrm{e}^{a^2}+\mathrm{e}^{b^2}-1$$ for every nonnegative $a$ and $b$ since the inequality is symmetric and, if $a\le b$, then the LHS is $\le\mathrm{e}^{b^2}$. For $a=\sqrt{r}X$ and $b=\sqrt{r}T$, one gets $$E(\mathrm{e}^{rXT})\le E(\mathrm{e}^{rX^2})+E(\mathrm{e}^{rT^2})-1,$$ which proves that Property 1 holds. Hence Properties 1 and 2 are equivalent.
Coming back to your context, you ask for Property 1 to hold with $T=1/Y$ and with no further constraint on the joint distribution of $(X,T)$ that $XT\ge1$ almost surely, a condition which holds as soon as $X\ge1$ and $T\ge1$ almost surely, for example. Thus, it seems that you are left with the condition that the set of probability distributions $D$ to which the distributions of $X$ and $T=1/Y$ belong, fulfills Property 2.
Basically, this means that one can replace your control $C\mathrm{e}^{-2ru^{2}}$ of the tails $P(X\ge u)$ and $P(1/Y\ge u)$ by $$Cu^{-(2+\delta)}\mathrm{e}^{-ru^2},$$ as soon as $\delta>0$ and that, without further information on the relationship between $X$ and $Y$, one cannot expect a much better sufficient condition.


text:
Script for handling PPA's on Ubuntu

I'm writing a bash script to handle the PPA's on Ubuntu & derivatives. I was wondering how to know if I'm handling this the right way.

So, the script works (flawlessly), but I posted it to a blog and got this feedback :

The way you wrote you script is the one we all use when we begin : we don't know the variables, so we use traditionnal commands, and in the end if we remove the "#" arguments from the script, the code is sad (maybe he meant 'poor' ?)

Here is a sample :

#! /bin/bash
SCRIPT="ppa-tool"
VERSION="2.0.1"
DATE="2014-03-26"
RELEASE="$(lsb_release -si)$(lsb_release -sr)"

[ -n "echo "$1" | grep ppa" ] && PPA=$1
[ -n "echo "$2" | grep ppa" ] && PPA=$2

helpsection()
{
echo -e "Usage : $SCRIPT [OPTION]... [PPA]... -h, --help shows this help -c, --check check if [PPA] is available for your release Version$VERSION - $DATE" exit 0 } error() { echo -e "$SCRIPT - Oops, something went wrong\nTry « $SCRIPT --help » for more information." && exit 0 ; } ppa_verification() { wget http://ppa.launchpad.net/$(echo $PPA | sed -e 's/ppa://g')/ubuntu/dists -O /tmp/"$SCRIPT-check.tmp" -q
if [[ -n "cat "/tmp/$SCRIPT-check.tmp" | grep$(lsb_release -sc)" ]] ; then
echo -e "$SCRIPT : '$PPA' is available for $RELEASE" else echo -e "$SCRIPT : '$PPA' is NOT available for$RELEASE"
fi
rm "/tmp/$SCRIPT-check.tmp" } [ "$1" == "--help" ] || [ "$1" == "-h" ] && helpsection if [ "$1" == "--check" ] || [ "$1" == "-c" ] || [ "$1" == "check" ]  ; then
[ -n "echo $2" ] && ppa_verification && exit 0 error fi error  Apparently, my syntax is bad, but I don't see what I could do to improve this, and I don't understand the feedback I recieved. Could you help me figure it out ? EDIT: From Unix&Linux (where I first posted, but was redirected here), someone said it wasn't good to use capital letters for variables. So$SCRIPT should become $script. • @Jamal : are you sure this is a better title than "Bash script : how to know if it's written correctly?" ? Because if the script itself is for PPA's handling, the main reason I'm here is to find out where I'm wrong with my BASH, not with the stuff the script does at the end – MrVaykadji Mar 26 '14 at 22:58 • I can assure that this title is better! Here we are doing review so asking for : how to know if it's written correctly is not relevant. And you should not include tag in the title. So yes the title is better. – Marc-Andre Mar 26 '14 at 23:02 • OP edited, now the full script is in English, should help the reviewers. – MrVaykadji Mar 26 '14 at 23:23 1 Answer User experience • -h or --help should print the usage message to standard output, which you do. However, on any unrecognizable command line, you should print the same (or similar) message to standard error and exit with a non-zero status. • Similarly, other error messages should go to standard error and result in a non-zero status. Style issues • Good job, double-quoting almost every variable you used. A lot of shell programmers neglect to do so. • Good job, breaking the program up into functions. A lot of shell programmers don't. • Indent your code consistently. It's hard to see where your functions begin and end. • Make use of case to replace convoluted if statements. • Do all of your command-line parsing in one place, and have a coherent parsing strategy. You can either use getopt (which has a bit of a learning curve) or build something based on shift (which is easier for a beginner to understand). • You can pass parameters to functions. Passing $PPA to ppa_verification() would be more elegant than using a global.

There isn't 100% consensus on whether variable names should be $ALL_CAPS or $lower_case. One common convention is $ALL_CAPS for global and/or exported variables, $lower_case for local or non-exported variables.

Use of wget

• Instead of writing the output of wget to a temporary file, you could just pipe it to grep directly: wget -q -O - "$url" | grep -q "$release".
• But then, to distinguish between a wget failure (e.g. network problem) and the release not being found by grep, you would have to interrogate ${PIPESTATUS[0]} and ${PIPESTATUS[1]}, which is a bit complicated.
• Why not try to fetch the subdirectory of dists/ that you care about instead? Then you only need to test whether the server returned an HTTP 200 (Success!) or HTTP 404 (Not Found).
#! /bin/bash
SCRIPT="ppa-tool"
VERSION="200_success"
DATE="2014-03-26"
RELEASE="$(lsb_release -si)$(lsb_release -sr)"

helpsection()
{
echo "Usage : $SCRIPT [OPTION]... [PPA]... -h, --help shows this help -c, --check check if [PPA] is available for your release Version$VERSION - $DATE" } ppa_verification() { local ppa="${1#ppa:}"

local codename="$(lsb_release -sc)" local url="http://ppa.launchpad.net/$ppa/ubuntu/dists/$codename/" wget "$url" -q -O /dev/null
######################################################################
# Exit Status
#
# Wget may return one of several error codes if it encounters problems.
# 0 No problems occurred.
# 1 Generic error code.
# 2 Parse error--for instance, when parsing command-line options, the .wgetrc' or .netrc'...
# 3 File I/O error.
# 4 Network failure.
# 5 SSL verification failure.
# 7 Protocol errors.
# 8 Server issued an error response.
######################################################################
case $? in 0) # Success echo "$SCRIPT : '$ppa' is available for$RELEASE"
;;
8) # HTTP 404 (Not Found) would result in wget returning 8
echo "$SCRIPT : '$ppa' is NOT available for $RELEASE" return 1 ;; *) echo "$SCRIPT : Error fetching $url" >&2 return 3 esac } PPA= while [ -n "$*" ] ; do
case "$1" in -h|--help) helpsection exit 0 ;; --check=*) PPA="${1#*=}"
;;
-c|--check|check)
PPA="$2" shift ;; *) helpsection >&2 exit 2 ;; esac shift done if [ -z "$PPA" ]; then
helpsection >&2
exit 2
fi

ppa_verification "$PPA"  • Thank you !! I don't understand everything but I'll make my homeworks – MrVaykadji Mar 28 '14 at 8:18 • There's a little mistake in your$url (from ppa_verification), it should be local url="http://ppa.launchpad.net/$ppa/ubuntu/dists/$codename/" – MrVaykadji Mar 28 '14 at 22:01
• A mistake in my code or your your code? I thought I was silently fixing a bug. – 200_success Mar 28 '14 at 22:02
• Yours. The suggested method is great, but you made a mistake with the url, it shouldn't have '/ppa' inside it. – MrVaykadji Mar 28 '14 at 22:13
• it is specified by the user, always. The convention is ppa:user/directory. With apt, for example apt-add-repository ppa:user/directory, and it is the same with this script. – MrVaykadji Mar 29 '14 at 9:43


text:
# Counting of selected words

I am typesetting a book, which has got more number of plants. While entering the text, I have to record the total number of plants recorded in my book.

In fact, I have created an index of all these plants, but the question is should I count manually, or LaTeX can count itself.

Here is my simple document.

\documentclass[a4paper,10pt]{article}

%For multiple index
\usepackage{imakeidx}
\makeindex
\makeindex[name=ch, title=Chemical index]
\makeindex[name=pl,title=Plant Index]

\begin{document}

This is my test docment. It contains total 5 plants. Plant 1\index[pl]{plant 1}  has
chemicals 1\index[ch]{chemical 1} and 2\index[ch]{chemical 2}. Another plant\index[pl]
{plant 2} continas the chemicals 2\index[ch]{chemical 2} and 3\index[ch]{chemical 3}.

List of plants:
Plant 3\index[pl]{plant 3}
plant 4\index[pl]{plant 4}
plant 5\index[pl]{plant 5}

\printindex
\indexprologue{\small Index of plants}
\printindex[pl]

\indexprologue{\small Index of chemicals}
\printindex[ch]

\end{document}

-
How are you inputting the plants' names? –  egreg Jan 26 '12 at 13:13
are you entering plants in the document using some macro? That is, at every occurence of a word you want to count is there in fact \macro{word I want to count}? Where macros can be different? Theny ou could just increase a counter whenever the macro is called. –  Roelof Spijker Jan 26 '12 at 13:14
Just use an own \plant macro to format all plant names and which increases a count which can be displayed at the very end. –  Martin Scharrer Jan 26 '12 at 13:50

You can use the .idx file for counting:

\documentclass[a4paper,10pt]{article}

%For multiple index
\usepackage{imakeidx}
\makeindex[name=ch, title=Chemical index]
\makeindex[name=pl,title=Plant Index]

\begin{document}

This is my test document. It contains a total of \ref{plants-number} plants. Plant
1\index[pl]{plant 1} has chemicals 1\index[ch]{chemical 1} and 2\index[ch]{chemical 2}.
Another plant\index[pl]{plant 2} continas the chemicals 2\index[ch]{chemical 2} and
3\index[ch]{chemical 3}.

List of plants:
Plant 3\index[pl]{plant 3}
plant 4\index[pl]{plant 4}
plant 5\index[pl]{plant 5}

\indexprologue{\small Index of plants}
\printindex[pl]

\indexprologue{\small Index of chemicals}
\printindex[ch]

% We'll count the number of plants and of chemicals
\newcounter{items}
\makeatletter
\begingroup
% Define suitably \indexentry
\newcommand{\indexentry}[2]{%
\@ifundefined{#1}
{\refstepcounter{items}\expandafter\let\csname#1\endcsname\@empty}
{}}

% Let's count the plants
\begingroup
\setcounter{items}{0}
\input{pl.idx}\label{plants-number}
\endgroup

% Let's count the chemicals
\begingroup
\setcounter{items}{0}
\input{ch.idx}\label{chemicals-number}
\endgroup

\endgroup

\end{document}

The final code will produce no text, but only a reference to the last counted plant; this reference may be used anywhere (but, of course, this requires at least two runs of LaTeX).

Note: there's no need to give a \makeindex command and \printindex command if you have only entries marked \index[pl] and \index[ch].

-
1. clarification of \makeindex comment. I could not understand. 2. Same logic can i apply to count chemicals also? –  Anil Jan 26 '12 at 14:32
1. If there's no \index{something} command, so that you don't have a "main index", then \makeindex and \printindex are useless. 2. Yes, of course. I'll add it. –  egreg Jan 26 '12 at 14:35

LaTeX provides built-in macros to handle counters and that is how the sectioning numbering, page numbers and floats are handled. In http://tex.stackexchange.com/a/19761/963 I posted a reply which is very similar to what you want to do and which I have adapted to include counters.

\documentclass{article}
\usepackage{lstdoc,booktabs}
\begin{document}
\makeatletter

\newcounter{cnt}
\setcounter{cnt}{0}
\let\alist\@empty

}

\def\RA#1|#2|#3|#4;{%
\expandafter\gdef\csname#1#2\endcsname{\textit{#1}&#2&#3&#4\cr\relax}
\lst@BubbleSort{\alist}
\stepcounter{cnt}
}

\def\RB#1|#2|#3|#4;{%
\expandafter\gdef\csname#2#1\endcsname{\textit{#1}&#2&#3&#4\cr\relax}
\lst@BubbleSort{\alist}
}

\RA Lactarius fallax      | velvety milk cap |edible |potentially risky;
\RA Lactarius camphoratus | candy cap        |edible |aromatic qualities;
\RA Suillus pungens       | slippery Jack    |edible |poor taste;
\RA Lactarius affinis     | kindred milk     |edible |unpalatable;
\RA Calocybe carnea       | pink fairhead    |edible |potentially risky;
\RA Amateta ocreata       | death angel      |inedible |highly poisonous;

%% typesetting the table
\newsavebox{\tempbox}
\savebox{\tempbox}{
\centering
\begin{tabular}{llll}
\toprule[1pt]
Species & Common name & Edibility & Remarks\\
\midrule
\@for\i:=\alist \do{\csname\i\endcsname}
\vspace{-14pt}\\\bottomrule
\end{tabular}
}

\begin{table}
\usebox{\tempbox}
\caption{Some mushrooms from Wikipedia}
\end{table}

Number of mushrooms in database is \textbf{\thecnt}

\end{document}

The idea is that everytime you add a plant (in my examples is mushrooms), you first add it to a database macro (just a comma delimited list really) and you increment the counter. Pretty much similar to when you adding something to an index. Depending on the structure of the document, the code can be adapted to hold an image, increment a number, sort alphabetically etc. In the example we just display the names in a table.

-

LateX provides the command \newcounter and \stepcounter and some other for counting.

\documentclass{article}

\newcounter{plants}
\newcommand{\plant}[1]{%
% step counter
\stepcounter{plants}% use \refstepcounter if you want
% to use the number with the \ref-\label-mechanism
% new line
\par
% optionally print counter
%   \theplants.
% print name
#1
}

\begin{document}
\plant{Foo}
\plant{Bar}
\plant{Baz}

Sum: \theplants
\end{document}

-
i have included the MWE -Anil –  Anil Jan 26 '12 at 14:13

If you are using xetex, you could use the xesearch package:

\documentclass{article}
\usepackage{xesearch}
\newcounter{plants}
\setcounter{plants}{0}
\def\plantlist{tree?,grass,flower?}
\SearchList{list1}{#1\stepcounter{plants}}{\plantlist}
\begin{document}
What is your favorite kind of plant? Trees, grass, or flowers?''
I like trees because they are much taller than grass and flowers.''
\end{document}

This code creates a counter called plants, then searches for a word found in \plantlist and increments the counter each time a word from the list is found.

• Add any word that you want to have counted to the list in line 5. E.g. tree,grass,flower.
• If you will be writing plural forms, add those to the list too, or use "?" or "*" to match those forms. E.g. tree? will match "tree" and "trees" and cact* will match "catcus" and "cacti".
• To display the final number of matching words, place \arabic{plants} at the end of your document.
-


text:
# Math Help - Integral Question

1. ## Integral Question

What does it mean when you have a problem that looks like this:

$\int \frac{dx}{\sqrt{25 + 16x^2}}$

I don't understand why the "dx" is on top of the fraction. Is that equivalent to

$\int \frac{1}{\sqrt{25 + 16x^2}} dx$

or is it different?

2. They're the same, just a matter of tastes.


text:
# Use the following information to answer the next four questions For each unit produced, a company...

Use the following information to answer the next four questions For each unit produced, a company expects to use 5 pounds of material at a cost of $3.50 per pound. It also expects each unit to require 1.5 hours of direct labor to complete, and it expects the wage rate to be$12 per hour. During the month, the company purchased 35,000 pounds of material for \$105,000, and used all 35,000 pounds of material to produce 8,000 units. The company actually incurred direct labor costs amounting to S177,000 for the 15,000 direct labor hours actually worked during the month 4. What is the company's direct materials price variance? Indicate whether the variance is favorable or unfavorable 5. What is the company's direct materials quantity variance? Indicate whether the variance is favorable or unfavorable.


text:
The Kleisli category is an interesting construction, but as with the Eilenberg-Moore category, it has a deeper significance.

For a monad $\mathbb{T}$ on category $\mathcal{C}$, there is a functor $U_{\mathbb{T}} : \mathcal{C}_{\mathbb{T}} \rightarrow \mathcal{C}$ with:

$U_{\mathbb{T}}(A) = \mathbb{T}(A) \qquad U_{\mathbb{T}}(f) = \mu \circ \mathbb{T}(f)$

There is also a functor $F_{\mathbb{T}} : \mathcal{C} \rightarrow \mathcal{C}_{\mathbb{T}}$ with:

$F_{\mathbb{T}}(A) = A \qquad F_{\mathbb{T}}(f) = \eta \circ f$

(Verifying that both these are legitimate functors is a useful exercise in applying the various axioms.)

In fact, $F_{\mathbb{T}} \dashv U_{\mathbb{T}}$. To see this, we must show a natural bijection between:

• Kleisli morphisms $F_{\mathbb{T}}(A) \rightarrow B$.
• $\mathcal{C}$-morphisms $A \rightarrow U_{\mathbb{T}}(B)$.

Recalling that Kleisli morphisms $A \rightarrow B$ are $\mathcal{C}$-morphisms $A \rightarrow \mathbb{T}(B)$, and expanding definitions:

• A Kleisli morphism $F_{\mathbb{T}}(A) \rightarrow B$ is a $\mathcal{C}$-morphism $A \rightarrow \mathbb{T}(B)$.
• A $\mathcal{C}$-morphism $A \rightarrow U_{\mathbb{T}}(B)$ is a $\mathcal{C}$-morphism $A \rightarrow \mathbb{T}(B)$.

So the bijection holds trivially. I think we can probably guess what the monad induced by this adjunction is going to turn out to be, but lets check the details anyway.

• Endofunctor: The endofunctor is $U_{\mathbb{T}} \circ F_{\mathbb{T}}$. On objects this is $U_{\mathbb{T}}(F_{\mathbb{B}}(A)) = U_{\mathbb{T}}(A) = \mathbb{T}(A)$. On morphisms $U_{\mathbb{T}}(F_{\mathbb{B}}(f)) = U_{\mathbb{T}}(\eta \circ f) = \mathbb{T}(\mu \circ \mathbb{T}(\eta \circ f)) = \mathbb{T}(f)$.
• Unit: The unit is the transpose of $\mathsf{id}_{F_{\mathbb{T}}(A)} : A \rightarrow A$, which is $\eta_A$.
• Multiplication: The multiplication at $A$ is $U_{\mathbb{T}}(\epsilon_{F_{\mathbb{T}}(A)})$, where $\epsilon_{\mathbb{F}(A)}$ is the transpose of $\mathsf{id}_{U_{\mathbb{T}}(F_{\mathbb{T}}(A))} : U_{\mathbb{T}}(F_{\mathbb{T}}(A)) \rightarrow U_{\mathbb{T}}(F_{\mathbb{T}}(A))$. Expanding definitions slightly, $\epsilon_{\mathbb{F}(A)}$ is $\mathsf{id}_{\mathbb{T}(A)}$. Then $U_{\mathbb{T}}(\mathsf{id}_{\mathbb{T}(A)})$ is $\mu \circ \mathbb{T}(\mathsf{id}_{\mathbb{T}(A)})$, which is simply $\mu$.

Summing up, for a monad $\mathbb{T}$, the the monad induced by the Kleisli adjunction $F_{\mathbb{T}} \dashv U_{\mathbb{T}}$ is $\mathbb{T}$ itself.

We have now seen two different constructions, the Eilenberg-Moore and Kleisli constructions, and their corresponding adjunctions. Both adjunctions yield the original monad. The natural question we shall pursue next is the relationship between these two constructions and other adjunctions that induce the same monad.