text:
# Flow coefficient

The flow coefficient of a device is a relative measure of its efficiency at allowing fluid flow. It describes the relationship between the pressure drop across an orifice valve or other assembly and the corresponding flow rate.

Mathematically the flow coefficient Cv (or flow-capacity rating of valve) can be expressed as :

${\displaystyle C_{\text{v}}=Q{\sqrt {\frac {\text{SG}}{\Delta P}}}}$

where:

Q is the rate of flow (expressed in US gallons per minute),
SG is the specific gravity of the fluid (for water = 1),
ΔP is the pressure drop across the valve (expressed in psi).

In more practical terms, the flow coefficient Cv is the volume (in US gallons) of water at 60 °F (16 °C) that will flow per minute through a valve with a pressure drop of 1 psi (6.9 kPa) across the valve.

The use of the flow coefficient offers a standard method of comparing valve capacities and sizing valves for specific applications that is widely accepted by industry. The general definition of the flow coefficient can be expanded into equations modeling the flow of liquids, gases and steam using the discharge coefficient.

For gas flow in a pneumatic system the Cv for the same assembly can be used with a more complex equation.[1][2] Absolute pressures (psia) must be used for gas rather than simply differential pressure.

For air flow at room temperature, when the outlet pressure is less than 1/2 the absolute inlet pressure, the flow becomes quite simple (although it reaches sonic velocity internally). With Cv = 1.0 and 200 psia inlet pressure the flow is 100 standard cubic feet per minute (scfm). The flow is proportional to the absolute inlet pressure, so the flow in scfm would equal the Cv flow coefficient if the inlet pressure were reduced to 2 psia and the outlet were connected to a vacuum with less than 1 psi absolute pressure (1.0 scfm when Cv = 1.0, 2 psia input).

## Flow factor

The metric equivalent flow factor (Kv) is calculated using metric units :

${\displaystyle K_{\text{v}}=Q{\sqrt {\frac {\text{SG}}{\Delta P}}}}$

where[3]

Kv is the flow factor (expressed in m3·h−1).
Q is the flowrate (expressed in cubic metres per hour m3·h−1),
SG is the specific gravity of the fluid (for water = 1),
P is the differential pressure across the device (expressed in bar).

Kv can be calculated from Cv using the equation:[4]

${\displaystyle K_{\text{v}}=0.865\cdot C_{\text{v}}}$

The kv factor or value as it is also called is defined in VDI/VDE Richtlinien No. 2173.[5] A simplified version of the definition is: The kv factor of a valve indicates "The water flow in m3/h, at a pressure drop across the valve of 1 kgf/cm2 when the valve is completely open. The complete definition also says that the flow medium must have a specific gravity of 1000 kg/m3 and a kinematic viscosity of 10−6 m2/s. e.g. water[clarify]

## References

1. ^ "Valve Sizing" (PDF). Technical Bulletin. Swagelok. Retrieved 21 April 2020.
2. ^ "Cv Calculator". Generant. Retrieved 21 April 2020.
3. ^ Boysen, Herman. "kV: what, why, how, whence?" (PDF). Technical paper. Danfoss. Danfoss. Retrieved 21 April 2020.
4. ^ "Control Valve Sizing". Control Valve Handbook (PDF) (5th ed.). Emerson Electric. September 2019. Retrieved 26 February 2022.
5. ^ Strömungstechnische Kenngrößen von Stellventilen und deren Bestimmung [Fluidic characteristic quantities of control valves and their determination] (PDF) (Standard). VDI, VDE. September 2007. 2173. Retrieved 17 April 2020.


text:
Energy Storage Control with Aging Limitation - Archive ouverte HAL Access content directly
Conference Papers Year :

Energy Storage Control with Aging Limitation

Pierre Haessig
Hamid Ben Ahmed
Bernard Multon

Abstract

Energy Storage Systems (ESS) are often proposed to mitigate the fluctuations of renewable power sources like wind turbines. In such a context, the main objective for the ESS control (its energy management) is to maximize the performance of the mitigation scheme. However, most ESS, and electrochemical batteries in particular, can only perform a limited number of charge/discharge cycles over their lifetime. This limitation is rarely taken into account in the optimization of the energy management, because of the lack of an appropriate formalization of cycling aging. We present a method to explicitly embed a limitation of cycling aging, as a constraint, in the control optimization. We model cycling aging with the usual exchanged energy'' counting method. We demonstrate the effectiveness of our aging-constrained energy management using a publicly available wind power time series. Day-ahead forecast error is minimized while keeping storage cycling just under an acceptable target level.

Dates and versions

hal-01147369 , version 1 (07-07-2015)

Identifiers

• HAL Id : hal-01147369 , version 1
• DOI :

Cite

Pierre Haessig, Hamid Ben Ahmed, Bernard Multon. Energy Storage Control with Aging Limitation. PowerTech 2015, IEEE, Jun 2015, Eindhoven, Netherlands. ⟨10.1109/PTC.2015.7232683⟩. ⟨hal-01147369⟩

840 View

format: plain


text:
# neutrosophic set

Let $M$ be a subset of a universe of discourse $U$. Each element $x\in U$ has degrees of membership, indeterminacy, and non-membership in $M$, which are subsets of the hyperreal interval $]^{-}0,1^{+}[$. The notation $x(T,I,F)\in M$ means that

• the degree of membership of $x$ in $M$ is $T$;

• the degree of indeterminacy of $x$ in $M$ is $I$; and

• the degree of non-membership of $x$ in $M$ is $F$.

$M$ is called neutrosophic set, whereas $T,I,F$ are called neutrosophic components of the element $x$ with respect to $M$.

Now let’s explain the previous notations:
A number $\varepsilon$ is said to be infinitesimal if and only if for all positive integers $n$ one has $|\varepsilon|<\frac{1}{n}$. Let $\varepsilon>0$ be a such infinitesimal number. The hyper-real number set is an extension of the real number set, which includes classes of infinite numbers and classes of infinitesimal numbers.
Generally, for any real number $a$ one defines ${}^{-}a$ which signifies a monad, i.e. a set of hyper-real numbers in non-standard analysis, as follows:
${}^{-}a=\{a-\varepsilon:\varepsilon\in R^{*},\varepsilon$ is infinitesimal $\}$,
and similarly one defines $a^{+}$, which is also a monad, as:
$a^{+}=\{a+\varepsilon:\varepsilon\in R^{*},\varepsilon$ is infinitesimal $\}$.
A binad ${}^{-}a^{+}$ is a union of the above two monads, i.e.
${}^{-}a^{+}=^{-}a\cup a^{+}$.
For example: The non-standard finite number $1^{+}=1+\varepsilon$, where $1$ is its standard part and $\varepsilon$ its non-standard part, and similarly the non-standard finite number ${}^{-}0=0-\varepsilon$, where $0$ is its standard part and $\varepsilon$ its non-standard part.
Similarly for $3^{+}=3+\varepsilon$, etc.
Note that $]^{-}0,1^{+}[$ is called the non-standard unit interval.

The superior sum of the neutrosophic components is defined as

 $n_{sup}=sup(T)+sup(I)+sup(F)\in]^{-}0,3^{+}[$

which may be as high as 3 or $3^{+}$.
While the inferior sum of the neutrosophic components is defined as

 $n_{inf}=inf(T)+inf(I)+inf(F)\in]^{-}0,3^{+}[$

which may be as low as 0 or ${}^{-}0$.

The notion of neutrosophic set was introduced by Florentin Smarandache in 1995 as a generalization of fuzzy set (especially of intuitionistic fuzzy set) when $n_{sup}=1$, of intuitionistic set when $n_{sup}<1$, and of paraconsistent set when $n_{sup}>1$.

The main distinctions between the neutrosophic set (NS) and intuitionistic fuzzy set (IFS) are the facts that (a) the sum of the scalar neutrosophic components (or their superior sum, $n_{sup}$, if the neutrosophic components are subsets) in NS is not necessarily 1 as in IFS but any number from ${}^{-}0$ to $3^{+}$ in order to allow the characterization of incomplete or paraconsistent information, and (b) in NS one uses the non-standard interval $]^{-}0,1^{+}[$ in order to make a difference between absolute membership, denoted by $1^{+}$, and relative membership, denoted by $1$, while in IFS one only uses the standard interval $[0,1]$.

An example:
Let $A$ be a neutrosophic set.
One can say, by abuse of language, that any element neutrosophically belongs to any set, due to the flexibility of degrees of truth/indeterminacy/falsity involved, which each varies between ${}^{-}0$ and $1^{+}$.
Thus the element $x(0.1,0.2,0.3)\in A$ means, the degree of membership of $x$ in $A$ is 0.1, the degree on indeterminacy (undecidability) is 0.2, and the degree of non-membership is 0.3 (as one sees, the sum of components is ¡ 1).
Similarly the element $y(0.6,0.2,0.5)\in A$, with the sum of components ¿ 1.
Or the element $z(0.7,0.1,0.2)\in A$, with the sum of components = 1.
More general, the element $w((0.20-0.30),(0.40-0.45)\cup[0.50-0.51],\{0.20,0.24,0.28\})\in A$, means:
- the degree of membership is between 0.20-0.30 (one cannot find an exact approximation because of various sources used);
- the degree of indeterminacy related to the appurtenance of $w$ to $A$ is between 0.40-0.45 or between 0.50-0.51 (limits included);
- the degree of non-membership is 0.20 or 0.24 or 0.28.

A remark:
- In technical applications, where there is no need for distinctions between absolute membership and relative membership, we can use standard subsets instead of non-standard subsets and respectively the unit interval $[0,1]$ instead of the non-standard unit interval $]^{-}0,1^{+}[$.

## References

• 1 F. Smarandache, A Unifying Field in Logics: Neutrosophic Logic. Neutrosophy, Neutrosophic Set, Neutrosophic Probability and Statistics, third edition, Xiquan, Phoenix, 2003. http://www.gallup.unm.edu/ smarandache/eBook-Neutrosophics2.pdfThe whole book is also online and can be downloaded here. .
• 2 F. Smarandache, J. Dezert, A. Buller, M. Khoshnevisan, S. Bhattacharya, S. Singh, F. Liu, Gh. C. Dinulescu-Campina, C. Lucas, C. Gershenson, Proceedings of the First International Conference on Neutrosophy, Neutrosophic Logic, Neutrosophic Set, Neutrosophic Probability and Statistics, The University of New Mexico, Gallup Campus, 1-3 December 2001. \htmladdnormallinkThe Proceedings are also online and can be downloaded here.http://arxiv.org/pdf/math.GM/0306384
• 3 Haibin Wang, Praveen Madiraju, Yanqing Zhang, Rajshekhar Sunderraman, Interval Neutrosophic Sets, International Journal of Applied Mathematics and Statistics, Vol. 3, No. M05, 1-18, 2005.
Title neutrosophic set NeutrosophicSet 2013-03-22 15:21:49 2013-03-22 15:21:49 para0doxa (5174) para0doxa (5174) 9 para0doxa (5174) Definition msc 03E70


text:
## A global convergence result for a higher order difference equation.(English)Zbl 1180.39003

Summary: Let $$f(z_1,\dots,z_k)\in C(I^k,I)$$ be a given function, where $$I$$ is (bounded or unbounded) subinterval of $$\mathbb R$$, and $$k\in\mathbb N$$. Assume that $$f(y_1,y_2,\dots,y_k)\geq f(y_2,\dots,y_k,y_1)$$ if $$y_1\geq \max\{y_2,\dots,y_k\}$$, $$f(y_1,y_2,\dots,y_k)\leq f(y_2,\dots,y_k,y_1)$$ if $$y_1\leq \min\{y_2,\dots,y_k\}$$, and $$f$$ is non-decreasing in the last variable $$z_k$$. We then prove that every bounded solution of an autonomous difference equation of order $$k$$, namely, $$x_n= f(x_{n-1},\dots,x_{n-k})$$, $$n=0,1,2,\dots$$, with initial values $$x_{-k},\dots,x_{-1}\in I$$, is convergent, and every unbounded solution tends either to $$+\infty$$ or to $$-\infty$$.

### MSC:

 39A10 Additive difference equations
Full Text:

### References:

 [1] J. Bibby, “Axiomatisations of the average and a further generalisation of monotonic sequences,” Glasgow Mathematical Journal, vol. 15, pp. 63-65, 1974. · Zbl 0291.40003 [2] D. Borwein, “Convergence criteria for bounded sequences,” Proceedings of the Edinburgh Mathematical Society (2), vol. 18, no. 1, pp. 99-103, 1972/73. · Zbl 0247.40001 [3] E. T. Copson, “On a generalisation of monotonic sequences,” Proceedings of the Edinburgh Mathematical Society (2), vol. 17, no. 2, pp. 159-164, 1970/71. · Zbl 0223.40001 [4] H. El-Metwally, E. A. Grove, and G. Ladas, “A global convergence result with applications to periodic solutions,” Journal of Mathematical Analysis and Applications, vol. 245, no. 1, pp. 161-170, 2000. · Zbl 0971.39004 [5] G. L. Karakostas and S. Stević, “Slowly varying solutions of the difference equation xn+1=f(xn,\cdots ,xn - k)+g(n,xn,xn - 1,\cdots ,xn - k),” Journal of Difference Equations and Applications, vol. 10, no. 3, pp. 249-255, 2004. · Zbl 1048.39003 [6] S. Stević, “A note on bounded sequences satisfying linear inequalities,” Indian Journal of Mathematics, vol. 43, no. 2, pp. 223-230, 2001. · Zbl 1035.40002 [7] S. Stević, “A generalization of the Copson’s theorem concerning sequences which satisfy a linear inequality,” Indian Journal of Mathematics, vol. 43, no. 3, pp. 277-282, 2001. · Zbl 1034.40002 [8] S. Stević, “A global convergence result,” Indian Journal of Mathematics, vol. 44, no. 3, pp. 361-368, 2002. · Zbl 1034.39002 [9] S. Stević, “A global convergence results with applications to periodic solutions,” Indian Journal of Pure and Applied Mathematics, vol. 33, no. 1, pp. 45-53, 2002. · Zbl 1002.39004 [10] S. Stević, “Asymptotic behavior of a sequence defined by iteration with applications,” Colloquium Mathematicum, vol. 93, no. 2, pp. 267-276, 2002. · Zbl 1029.39006 [11] S. Stević, “Asymptotic behavior of a nonlinear difference equation,” Indian Journal of Pure and Applied Mathematics, vol. 34, no. 12, pp. 1681-1687, 2003. · Zbl 1049.39012 [12] K. S. Berenhaut and S. Stević, “The behaviour of the positive solutions of the difference equation xn=A+(xn - 2/xn - 1)p,” Journal of Difference Equations and Applications, vol. 12, no. 9, pp. 909-918, 2006. · Zbl 1111.39003 [13] L. Berg, “Inclusion theorems for non-linear difference equations with applications,” Journal of Difference Equations and Applications, vol. 10, no. 4, pp. 399-408, 2004. · Zbl 1056.39003 [14] L. Berg, “Corrections to ‘inclusion theorems for non-linear difference equations with applications’,” Journal of Difference Equations and Applications, vol. 11, no. 2, pp. 181-182, 2005. · Zbl 1080.39002 [15] L. Berg and L. von Wolfersdorf, “On a class of generalized autoconvolution equations of the third kind,” Zeitschrift für Analysis und ihre Anwendungen, vol. 24, no. 2, pp. 217-250, 2005. · Zbl 1104.45001 [16] S. Stević, “On the recursive sequence xn=1+\sum i=1k\alpha ixn - pi/\sum j=1m\beta jxn - qj,” Discrete Dynamics in Nature and Society, vol. 2007, Article ID 39404, p. 7, 2007. · Zbl 1180.39006 [17] T. Sun, H. Xi, and H. Wu, “On boundedness of the solutions of the difference equation xn+1=xn - 1/(p+xn),” Discrete Dynamics in Nature and Society, vol. 2006, Article ID 20652, p. 7, 2006. · Zbl 1149.39301 [18] S.-E. Takahasi, Y. Miura, and T. Miura, “On convergence of a recursive sequence xn+1=f(xn,xn - 1),” Taiwanese Journal of Mathematics, vol. 10, no. 3, pp. 631-638, 2006. · Zbl 1100.39001
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# Calculate the Force in Cable AB and angle for support system shown.[need guidance]

1. Oct 25, 2009

### Dellis

Hi, I been trying to do this exercise, visually it looks very basic but I just need some guidance, thanks in advance :).

1. The problem statement, all variables and given/known data

Calculate the Force AB in Cable and the angle(theta symbol) for support system shown.

Point A pinned and Point B connected as a cable at an angle( not given ), Point B with a Force of 100 going to the right and a Weight of 200, like displayed below.

A
\_________>F=100
|B
|
|
|
[W]=200

2. Relevant equations

$$\Sigma$$Fx=0
$$\Sigma$$Fy=0
$$\Sigma$$M=0

3. The attempt at a solution

1st step- The free Body Diagram showing all the forces

2nd step- Guidance needed at this point, is this the right direction????

$$\Sigma$$Fxy= 100-200=0

Last edited: Oct 25, 2009
2. Oct 25, 2009

### PhanthomJay

Re: Calculate the Force in Cable AB and angle for support system shown.[need guidance

Great start. What are the forces acting, both known and unknown?
No, what are you doing here? It's sum of F_x = 0, and sum of F_y =0. What are the x components of all the forces; what are the y components of all the forces? You'll get 2 equations with 2 unknowns (T and theta), which you can solve. Alternatively, it may be simpler to compute the resultant (magnitude and direction) of the applied loads, and the Tension must be equal and opposite to that resultant.

3. Oct 25, 2009

### Dellis

Re: Calculate the Force in Cable AB and angle for support system shown.[need guidance

1. Forces are on a STABLE situation, Force POINT A meets with POINT B which then its Force shows going in a Horizontal direction, then the TENSION of the Weight literally comes down from POINT B

2. So its like this?....

F_x = 0
F_x= 100lb

F_y= 0
F_y = -200 lb

3. I am confused, is it possible to even use the Triangle Method for this? or that would be making things to complicated?

Show me a route I can follow, this problem visually seems to be basic but I just don't know how to approach it.

Last edited: Oct 25, 2009
4. Oct 26, 2009

### PhanthomJay

Re: Calculate the Force in Cable AB and angle for support system shown.[need guidance

F_x can't simultaneously be 0 and 100. The equation at joint B is sum of all forces in the x direction is 0. You have 100 units of force acting to the right, and T* cos theta units of force acting to the left.
Same comment; 200 acting down and T*sin theta acting up, sum of which are 0.
Yes, that's the easiest way. Use Pythagorus' theorem to calculate the hypotenuse of a triangle with legs of 200 and 100, and calculate the proper angle. The tension is then equal and opposite to this result.

5. Oct 26, 2009

### Dellis

Re: Calculate the Force in Cable AB and angle for support system shown.[need guidance

Right direction????

C(2)= A(2)+B(2)

A(2)= 100(2) + 200(2)

$$\sqrt{}$$A(2)= 3000

A= 173.2 lb

Last edited: Oct 26, 2009
6. Oct 26, 2009

### PhanthomJay

Re: Calculate the Force in Cable AB and angle for support system shown.[need guidance

Ahh, your math is not so good. C is the hypotenuse of the triangle, which you are trying to find. A and B are the legs, given. C must be greater than A or B. It's $$C^2 = A^2 + B^2$$. Solve for C.

7. Oct 26, 2009

### Dellis

Re: Calculate the Force in Cable AB and angle for support system shown.[need guidance

Yeah that's why I need help with it , but anyways I did it again and Its the same thing, so the answer will be now

$$C^2 = A^2 + B^2$$

C^2= 200^2 + 100^2

$$\sqrt[]{}$$C^2= 30000

C= 173.2 lb

What is the next step?, help me out here, I know you probably did the problem in your head already, guide me.

Last edited: Oct 26, 2009
8. Oct 26, 2009

### PhanthomJay

Re: Calculate the Force in Cable AB and angle for support system shown.[need guidance

yes.
$$C^2 = 40000 + 10000 =50000$$
$$\sqrt C} = \sqrt 50000 = ???$$


text:
# Revision history [back]

### Aruco (diamonds) not working on bigger images. Which parameters to tune?

Hello,

somehow detecting charuco diamonds does not work with bigger images for me. With my original images of 1920x1080 it neither recognizes the ids reliably (the diamond ids elements are switching places every time). In the first image, you can see it recognizes (7, 9, 45, 2).

Then I tried downsampling the images to 960x540, and dividing the calibration params, f, c, to half, and it works! The id is correctly recognized as (2,7,45,9) and the pose estimation is accurate.

How to make it work for bigger images? I tried changing the detection parameters depending on absolute pixel units (not relative to image size). Here is a list of my current parameters.

nmarkers: 1024
minMarkerPerimeterRate: 0.1
maxMarkerPerimeterRate: 4.0
polygonalApproxAccuracyRate: 0.05
minCornerDistance: 10.0
minDistanceToBorder: 10
minMarkerDistance: 10.0
minMarkerDistanceRate: 0.05
doCornerRefinement: false
cornerRefinementWinSize: 5
cornerRefinementMaxIterations: 30
cornerRefinementMinAccuracy: 0.1
markerBorderBits: 1
perspectiveRemovePixelPerCell: 8
perspectiveRemoveIgnoredMarginPerCell: 0.13
maxErroneousBitsInBorderRate: 0.04
minOtsuStdDev: 5.0
errorCorrectionRate: 0.6

Any hints?

thank you!


text:
## The Household Survey: A Note on the December 2, 2011 Report

We do not typically see 40 basis-point declines in the unemployment rate in a single month.

The decline that we would like to see would be this one: a 60 basis-point decline generated by an increase in employment, partially offset by a 20 basis point-rise generated by an increase in labor force participation. That would show very strong demand for labor by firms. And that would show workers confident that demand for ther labor would be strong and hence reentering the labor force.

That is not what we saw in November with our 40 basis-point decline in the household-survey unemployment rate to 8.6%. What we saw in November, instead, was a 15 basis-points decline in the unemployment rate generated by more people at work. That is welcome. But most of the decline was a 25 basis-point decline generated by a fall in labor force participation. Workers as a group did not become more optimistic about their long-run employment opportunities, but rather less. That is not welcome. It is harder to pull people into employment if they are out of the labor force than if they are in the labor force and unemployed. Hence the fall in the labor force participation rate leads us to mark down the long-term potential output growth path of the American economy.

All in all, therefore, this decline in the unemployment rate is bad news: a little bit of good news about the current state of the labor market, coupled with rather more bad news about the sustainable level of potential output in the United States.

The inconsistency between the household survey increase in employment and the much smaller payroll survey increase in unemployment reinforces the bad news. From the payroll survey we would have expected the household survey employment-to-population ratio to be flat. The employment gain is the household survey is thus likely to be partially due to sampling error, and thus offset in future months.

I would rather have had a decline in the unemployment rate from 9% to 8.9% coupled with flat labor force participation rate than this household employment report. Would I rather have had a completely flat report for both the unemployment rate and the labor force participation rate? I am not sure. That is a tough question.

How large should we mark down our estimate of the long-run economic growth path of the United States from today's household employment report? How much should we mark down our estimate of the long-run economic growth path of the United States from the household employment reports of the past two years? Two years ago, after all, the recession was over. The employment-to-population ratio was where it is. The labor force participation rate was a full 100 basis points higher.

If you believe that the unemployment rate follows a stationary stochastic process without much memory--that it by itself encodes the state of the business cycle and thus the gap between current and potential GDP--then the past two years' employment news would lead us to mark down the future growth path of U.S. potential output by 1.54%. Given a trend level of real potential GDP right now of $15T/year, a projected real growth rate of 2.7%/year, and the assumption that real GDP is a cash flow of equity riskiness with an equity required real rate of return of 6%/year, that would mean that the bad news about labor force participation over the past two years has reduced our estimate of the present value of future American real GDP by: ($15T x 1.54%)/(6% - 2.7%) = $7T$7 trillion of bad news from the fact that over the past two years, as the employment-to-population ratio has flatlined, labor force participation has fallen.

Now surely this is an overestimate. Surely the unemployment rate is not a sufficient statistic for the state of the business cycle and the gap between actual and potential output.

But by how much is this an overestimate?

How would we estimate the bias?

And if the bias is small, then the U.S. government's delaying the actions to jumpstart the recovery that would turn it from a jobless one into a real recovery costs Americans an extra $300 billion/month in foregone future economic growth, over and above the current$90 billion/month in idle workers and factories that could perfectly well be producing useful goods and services without triggering inflation.

For if the bias is small, than that is the right estimate of the cost of having a jobless rather than a real recovery: $400 billion/month--$5,000/month for each family of 4--with 1/4 coming from the current output gap and the delay in returning to the normal of potential output, and 3/4 coming from the damage that the awful state of the labor market is doing to the skills and attachment of the American labor force.


text:
# CERN Preprints

2013-06-18
04:08
 Measurement of B meson production cross-sections in proton-proton collisions at sqrt(s)= 7 TeV / LHCb collaboration The production cross-sections of B mesons are measured using data, corresponding to a integrated luminosity of 0.36 fb-1, collected with the LHCb detector at a centre-of-mass energy of 7 TeV. [...] arXiv:1306.3663 ; CERN-PH-EP-2013-095 ; LHCB-PAPER-2013-004. - 2013. - 13 p. Preprint - Full text

2013-06-17
12:24
 Masses of exotic calcium isotopes pin down nuclear forces / Wienholtz, F (Greifswald U.) ; Beck, D (Darmstadt, GSI) ; Blaum, K (Heidelberg, Max Planck Inst.) ; Borgmann, Ch (Heidelberg, Max Planck Inst.) ; Breitenfeldt, M (Leuven U.) ; Cakirli, R B (Heidelberg, Max Planck Inst. ; Istanbul U.) ; George, S (Greifswald U.) ; Herfurth, F (Darmstadt, GSI) ; Holt, J D (Darmstadt, Tech. Hochsch. ; Darmstadt, EMMI) ; Kowalska, M (CERN) et al. 2013.

2013-06-17
04:08
 MCPLOTS: a particle physics resource based on volunteer computing / Karneyeu, A ; Mijovic, L ; Prestel, S ; Skands, P Z The mcplots.cern.ch web site (MCPLOTS) provides a simple online repository of plots made with high-energy-physics event generators, comparing them to a wide variety of experimental data. [...] arXiv:1306.3436 ; CERN-PH-TH-2013-105 ; DESY 13-104 ; LU-TP 13-23. - 2013. - 30 p. Preprint - Full text

2013-06-17
04:07
 Forbidden Kaon and Pion Decays in NA62 / Moulson, Matthew (INFN, Frascati) NA62, an experiment at the CERN SPS to measure the branching ratio for the decay K+ -> pi+ nu nu-bar with ~10% precision, will observe ~10^13 K+ decays in its fiducial volume, and will thus also be able to carry out a rich program to search for forbidden K+ and pi0 decays, including in particular K+ decays that violate the conservation of lepton flavor and/or number. [...] arXiv:1306.3361. - 2013. - 11 p. Preprint

2013-06-12
09:28
 The Muon Collider as a $H/A$ factory / Eichten, Estia (Fermilab) ; Martin, Adam (CERN ; Notre Dame U.) We show that a muon collider is ideally suited for the study of heavy H/A scalars, cousins of the Higgs boson found in two-Higgs doublet models and required in supersymmetric models. [...] arXiv:1306.2609 ; FERMILAB-PUB-13-193-T ; CERN-PH-TH-2013-111. - 2013. - 7 p. Preprint - Full text

2013-06-12
09:28
 Measurement of the differential branching fraction of the decay $\Lambda_b^0\rightarrow\Lambda\mu^+\mu^-$ / LHCb collaboration The differential branching fraction of the decay $\Lambda_b^0\rightarrow\Lambda\mu^+\mu^-$ is measured as a function of the square of the dimuon invariant mass, $q^2$. [...] arXiv:1306.2577 ; LHCB-PAPER-2013-025 ; CERN-PH-EP-2013-094. - 2013. - 23 p. Preprint - Full text - Fulltext - Related supplementary data file(s) - Related data file(s)

2013-06-11
10:07
 Directed flow of charged particles at mid-rapidity relative to the spectator plane in Pb-Pb collisions at sqrt{s_NN}=2.76 TeV /ALICE The directed flow of charged particles at midrapidity is measured in Pb-Pb collisions at sqrt{s_NN}=2.76 TeV relative to the collision plane defined by the spectator nucleons. Both, the rapidity odd (v_1^odd) and even (v_1^even) directed flow components are reported. [...] CERN-PH-EP-2013-100.- Geneva : CERN, 2013 Draft (restricted): PDF; Fulltext: PDF;

2013-06-11
06:12
 First observation of the decay $B_s^0 \rightarrow \phi \bar{K}^{*0}$ / LHCb collaboration A first observation of the decay $B_s^0 \rightarrow \phi \bar{K}^{*0}$ is reported from an analysis based on a data sample, corresponding to an integrated luminosity of 1.0 fb$^{-1}$ of $pp$ collisions at sqrt(s) = 7 TeV, collected with the LHCb detector. [...] arXiv:1306.2239 ; LHCB-PAPER-2013-012 ; CERN-PH-EP-2013-087. - 2013. Preprint - Full text

2013-06-09
23:15
 Energy calibration and resolution of the CMS electromagnetic calorimeter in pp collisions at $\sqrt{s}$ = 7 TeV / CMS Collaboration The energy calibration and resolution of the electromagnetic calorimeter (ECAL) of the CMS detector have been determined using proton-proton collision data from LHC operation in 2010 and 2011 at a centre-of-mass energy of $\sqrt{s}$=7 TeV with integrated luminosities of about 5 inverse femtobarns. [...] arXiv:1306.2016 ; CMS-EGM-11-001 ; CERN-PH-EP-2013-097. - 2013. - 51 p. Preprint - Fulltext - Full text

2013-06-07
04:12
 Measurement of $C\!P$ violation in the phase space of $B^{\pm} \to K^{\pm} \pi^{+} \pi^{-}$ and $B^{\pm} \to K^{\pm} K^{+} K^{-}$ decays / LHCb collaboration The charmless decays $B^{\pm}\to K^{\pm}\pi^+\pi^-$ and $B^{\pm}\to K^{\pm}K^+K^-$ are reconstructed using data, corresponding to an integrated luminosity of 1.0 fb$^{-1}$, collected by LHCb in 2011. [...] arXiv:1306.1246 ; LHCB-PAPER-2013-027 ; CERN-PH-EP-2013-090. - 2013. - 9 p. Preprint - Full text - Related data file(s)


text:
⚠ This EIP is not recommended for general use or implementation as it is likely to change.

# EIP-5115: Super Composable Yield Token Source

### Interface for wrapped yield-generating tokens.

Author Vu Nguyen, Long Vuong, Anton Buenavista https://ethereum-magicians.org/t/eip-5115-super-composable-yield-token-standard/9423 Draft Standards Track ERC 2022-05-30 20

## Abstract

This standard proposes an API for wrapped yield-generating tokens within smart contracts. It is an extension on the EIP-20 token that provides basic functionality for transferring, depositing, withdrawing tokens, as well as reading balances.

## Motivation

Yield generating mechanisms are built in all shapes and sizes, necessitating a manual integration every time a protocol builds on top of another protocol’s yield generating mechanism.

EIP-4626 tackled a significant part of this fragmentation by standardizing the interfaces for vaults, a major category among various yield-generating mechanisms.

In this EIP, we’re extending the coverage to include assets beyond EIP-4626’s reach, namely:

• Yield-generating assets that have different base tokens used for minting vs accounting for the pool value.
• This category includes AMM liquidity tokens (which are yield generating assets that yield swap fees) since the value of the pool is measured in “liquidity units” (for example, $\sqrt k$ in UniswapV2, as defined in UniswapV2 whitepaper) which can’t be deposited in (as they are not tokens).
• This extends the flexibility in minting the yield-bearing assets. For example, there could be an ETH vault that wants to allow users to deposit cETH directly instead of ETH, for gas efficiency or UX reasons.
• Assets with reward tokens by default (e.g. COMP rewards for supplying in Compound). The reward tokens are expected to be sold to compound into the same asset.

While EIP-4626 is a well-designed and suitable standard for most vaults, there will inevitably be some yield-generating mechanisms that do not fit into their category (LP tokens for instance). A more flexible standard is required to standardize the interaction with all types of yield generating mechanisms.

Therefore, we are proposing Super Composable Yield (SCY), a flexible standard for wrapped yield generating tokens that could cover most mechanisms in DeFi. We foresee that:

• EIP-4626 will still be a popular vault standard, that most vaults should adopt.
• SCY tokens can wrap over most yield generating mechanisms in DeFi, including EIP-4626 vaults for projects built on top of interest-bearing tokens.
• Whoever needs the functionalities of SCY could integrate with the existing SCY tokens or write a new SCY (to wrap over the target interest-bearing token).

### Use Cases

This EIP is designed for flexibility, aiming to accommodate as many yield generating mechanisms as possible. Particularly, this standard aims to be generalized enough that it supports the following uses cases and more:

• Money market supply positions
• Lending DAI in Compound, getting DAI interests and COMP rewards
• Lending ETH in BenQi, getting ETH interests and QI + AVAX rewards
• Lending USDC in Aave, getting USDC interests and stkAAVE rewards
• AMM liquidity provision
• Provide ETH + USDC to ETHUSDC pool in SushiSwap, getting swap fees in more ETH+USDC
• Provide ETH + USDC to ETHUSDC pool in SushiSwap and stake it in Sushi Onsen, getting swap fees and SUSHI rewards
• Provide USDC+DAI+USDT to 3crv pool and stake it in Convex, getting 3crv swap fees and CRV + CVX rewards
• Vault positions
• Provide ETH into Yearn EIP-4626 vault, where the vault accrues yield from Yearn’s ETH strategy
• Provide DAI into Harvest and staking it, getting DAI interests and FARM rewards
• Liquid staking positions
• Holding stETH (in Lido), getting yields in more stETH
• Liquidity mining programs
• Provide USDC in Stargate, getting STG rewards
• Provide LOOKS in LooksRare, getting LOOKS yield and WETH rewards
• Rebasing tokens
• Stake OHM into sOHM/gOHM, getting OHM rebase yield
• Stake BTRFLY into xBTRFLY, getting BTRFLY rebase yield

The EIP hopes to minimize, if not possibly eliminate, the use of customized adapters in order to interact with many different forms of yield-generating token mechanisms.

## Specification

### Generic Yield Generating Pool

We will first introduce Generic Yield Generating Pool (GYGP), a model to describe most yield generating mechanisms in DeFi. In every yield generating mechanism, there is a pool of funds, whose value is measured in assets. There are a number of users who contribute liquidity to the pool, in exchange for shares of the pool, which represents units of ownership of the pool. Over time, the value (measured in assets) of the pool grows, such that each share is worth more assets over time. The pool could earn a number of reward tokens over time, which are distributed to the users according to some logic (For example, proportionally the number of shares).

Here are the more concrete definitions of the terms:

#### Definitions:

• asset: Is a unit to measure the value of the pool. At time t, the pool has a total value of TotalAsset(t) assets.
• shares: Is a unit that represents ownership of the pool. At time t, there are TotalShares(t) shares in total.
• reward tokens: Over time, the pool earns $n_{rewards}$ types of reward tokens $(n_{rewards} \ge 0)$. At time t, $TotalRewards_i(t)$ is the amount of reward token i that has accumulated for the pool up until time t.
• exchange rate: At time t, the exchange rate ExchangeRate(t) is simply how many assets each shares is worth $ExchangeRate(t) = \frac{TotalAsset(t)}{TotalShares(t)}$
• users: At time t, each user u has $shares_u(t)$ shares in the pool, which is worth $asset_u(t) = shares_u(t) \cdot ExchangeRate(t)$ assets. Until time t, user u is entitled to receive a total of $rewards_{u_i}(t)$ reward token i. The sum of all users’ shares, assets and rewards should be the same as the total shares, assets and rewards of the whole pool.

#### State changes:

1. A user deposits assets into the pool, in exchange for new shares that will be created for the user, proportionally to the asset amount being deposited compared to the value of the pool.
2. A user withdraws assets from the pool, by burning their shares, proportionally to the asset amount being burned compared to the value of the pool
3. The pool earns some assets. The exchange rate will simply increase due to the additional assets.
4. The pool earns some reward tokens. The additional reward tokens will be distributed among the users.

#### Examples of GYGPs in DeFi:

Yield generating mechanism Asset Shares Reward tokens Exchange rate
Supply USDC in Compound USDC cUSDC COMP USDC value per cUSDC, increases with USDC supply interests
ETH liquid staking in Lido stETH wstETH None stETH value per wstETH, increases with ETH staking rewards
Stake LOOKS in LooksRare LOOKS shares (in contract) WETH LOOKS value per shares, increases with LOOKS rewards
Stake BTRFLY into xBTRFLY BTRFLY xBTRFLY None BTRFLY value per xBTRFLY, increases due to rebase rewards
Provide ETH+USDC liquidity on Sushiswap ETHUSDC liquidity (a pool of x ETH + y USDC has sqrt(xy) ETHUSDC liquidity) ETHUSDC Sushiswap LP (SLP) token None ETHUSDC liquidity value per ETHUSDC SLP, increases due to swap fees
Provide ETH+USDC liquidity on Sushiswap and stake into Onsen ETHUSDC liquidity (a pool of x ETH + y USDC has sqrt(xy) ETHUSDC liquidity) ETHUSDC Sushiswap LP (SLP) token SUSHI ETHUSDC liquidity value per ETHUSDC SLP, increases due to swap fees
Provide USDC+USDT+DAI liquidity in Curve 3crv pool’s liquidity (amount of D per 3crv token) 3crv token CRV 3crv pool’s liquidity per 3crv token, increases due to swap fees
Provide BAL+WETH liquidity in Balancer (80% BAL, 20% WETH) BALWETH liquidity (a pool of x BAL + y WETH has x^0.8*y^0.2 BALWETH liquidity) BALWETH Balancer LP token None BALWETH liquidity per BALWETH Balancer LP token, increases due to swap fees

### Super Composable Yield Token Standard

#### Overview

Super Composable Yield is a token standard for all GYGPs. Each Super Composable Yield token represents shares in a GYGP and allows for interacting with the GYGP via a standard interface

All SCY tokens:

• MUST implement EIP-20 to represent shares in the underlying GYGP.
• MUST implement EIP-20’s optional metadata extensions name, symbol, and decimals, which SHOULD reflect the underlying GYGP’s accounting asset’s name, symbol, and decimals.
• MAY implement EIP-2612 to improve the UX of approving SCY tokens on various integrations.
• MAY revert on calls to transfer and transferFrom if a SCY token is to be non-transferable.
• The EIP-20 operations balanceOf, transfer, totalSupply, etc. SHOULD operate on the GYGP “shares”, which represent a claim to ownership on a fraction of the GYGP’s underlying holdings.

#### Definition of base tokens

Base tokens are tokens that could be deposited to mint SCY tokens (and hence, to enter the underlying GYGP), or redeemed when burning SCY tokens (and hence, exiting the underlying GYGP). Essentially, base tokens are implicitly converted into units of assets when deposited or redeemed, to conform to state change #1 and #2 of the GYGP definition above.

There could be multiple kinds of base tokens in a SCY. This allows for maximum flexibility in how to mint SCY to enter the underlying yield generating pool. For example, both BAL and WETH (and even BALWETH LP token) could be used to mint the SCY token for BALWETH Balancer pool (by providing single-sided liquidity).

As such, base tokens are not necessarily the same as the asset (which is a key difference between SCY and EIP-4626).

#### Interface

interface ISuperComposableYield {
enum AssetType {
TOKEN,
LIQUIDITY
}

event Deposit(
uint256 amountDeposited,
uint256 amountScyOut
);

event Redeem(
uint256 amountScyToRedeem,
uint256 amountTokenOut
);

event ClaimRewards(
uint256[] rewardAmounts
);

event ExchangeRateUpdated(uint256 oldExchangeRate, uint256 newExchangeRate);

function deposit(
uint256 amountTokenToPull,
uint256 minSharesOut
) external returns (uint256 amountSharesOut);

function redeem(
uint256 amountSharesToPull,
uint256 minTokenOut
) external returns (uint256 amountTokenOut);

function claimRewards(address user) external returns (uint256[] memory rewardAmounts);

function exchangeRateCurrent() external returns (uint256);

function exchangeRateStored() external view returns (uint256);

function getRewardTokens() external view returns (address[] memory);

function getBaseTokens() external view returns (address[] memory);

function yieldToken() external view returns (address);

function isValidBaseToken(address token) external view returns (bool);

function assetInfo()
external
view
returns (
AssetType assetType,
uint8 assetDecimals
);

function name() external view returns (string memory);

function symbol() external view returns (string memory);

function decimals() external view returns (uint8);
}

#### Methods

function deposit(
uint256 amountTokenToPull,
uint256 minSharesOut
) external returns (uint256 amountSharesOut);

This method will first pull amountTokenToPull of tokenIn (a base token), and use the floating amount tokenIn in the SCY contract to deposit to mint new shares.

The ideal way to deposit is to send tokenIn in first, then call the deposit function with amountTokenToPull = 0. This pattern is similar to UniswapV2 (and UniswapV3) pools, which allow for better composability and gas efficiency by minimizing token transfers. For example, a router contract could swap from some other token to tokenIn which is sent directly to the SCY contract before deposit is called.

This function will convert the amount of tokenIn into some worth of assets and deposit this amount into the SCY contract for the recipient, who will receive amountSharesOut of SCY tokens (shares).

• MUST emit the Deposit event.
• MUST support EIP-20’s approve / transferFrom flow where tokenIn are taken from receiver directly (as msg.sender) or if the msg.sender has EIP-20 approved allowance over the base token of the receiver.
• MUST revert if $amountSharesOut \lt minSharesOut$ (due to deposit limit being reached, slippage, or the user not approving enough tokenIn **to the SCY contract, etc).
function redeem(
uint256 amountSharesToPull,
uint256 minTokenOut
) external returns (uint256 amountTokenOut);

This method will first pull amountSharesToPull of SCY tokens, and use the floating amount of SCY tokens in the SCY contract to redeem to tokenOut (a base token). This pattern is similar to the one in deposit

This function will redeem the exact SCY token (shares) from the SCY contract. The assets are converted into tokenOut of tokenOut.

• MUST emit the Redeem event.
• MUST support EIP-20’s approve / transferFrom flow where the shares are burned from receiver directly (as msg.sender) or if the msg.sender has EIP-20 approved allowance over the shares of the receiver.
• MUST revert if $tokenOut \lt minTokenOut$ (due to redeem limit being reached, slippage, or the user not approving enough amountSharesToPull **to the SCY contract, etc).
function claimRewards(address user) external returns (uint256[] memory rewardAmounts);

This method sends all the available claimable rewards to the user as is, with the amounts in the list being in the same order as getRewardTokens.

• MUST emit the ClaimRewards event.
• MAY return one or multiple rewards to the user.
• MAY return zero rewards to the user.
function exchangeRateCurrent() external returns (uint256);

This method updates and returns the latest exchange rate, which is the exchange rate from SCY token amount into asset amount, scaled by a fixed scaling factor of 1e18.

• MUST return $ExchangeRate(t_{now})$ such that $ExchangeRate(t_{now}) \times scyBalance / 1e18 = assetBalance$.
• MUST NOT include fees that are charged against the underlying yield token in the SCY contract.
function exchangeRateStored() external view returns (uint256);

This read-only method returns the last saved value of the exchange rate.

• MUST return the value of exchangeRateCurrent of a past timestamp where it was last updated in the contract
• MUST NOT include fees that are charged against the underlying yield token in the SCY contract.
• MUST NOT revert.
function yieldToken() external view returns (address);

This read-only method returns the underlying yield-generating token (representing a GYGP) that was wrapped into a SCY token.

• MUST return a token address that conforms to the EIP-20 interface, or zero address
• MUST NOT revert.
• MUST reflect the exact underlying yield-generating token address if the SCY token is a wrapped token.
• MAY return 0x or zero address if the SCY token is natively implemented, and not from wrapping.
function getRewardTokens() external view returns (address[] memory);

This read-only method returns the latest list of all reward tokens.

• MUST return EIP-20 token addresses.
• MUST NOT revert.
• MAY return an empty list, one, or several token addresses.
• MAY return additional reward tokens over time, depending on when underlyingYieldToken supports more or less reward tokens.
function getBaseTokens() external view returns (address[] memory);

This read-only method returns the list of all base tokens that can be used to deposit into the SCY contract.

• MUST return EIP-20 token addresses.
• MUST return at least one address.
• MUST NOT revert.
function isValidBaseToken(address token) external view returns (bool);

This read-only method checks whether a token address entered is a base token that can be used to mint SCY.

• MUST NOT revert.
function assetInfo()
external
view
returns (
AssetType assetType,
uint8 assetDecimals
);

This read-only function returns useful information about the asset, intended for front-ends or off-chain systems to display balances and information about the asset.

decimals is the decimals to format asset balances.

Convention for assetType and format of the info field: 1) If asset is an EIP-20 token, assetType = 0, assetAddress is the address of the token; 2) If asset is liquidity of an AMM (like $\sqrt{k}$ in UniswapV2 forks), assetType = 1, assetAddress is the address of the LP token.

• MUST reflect the underlying asset’s decimals if at all possible in order to eliminate any possible source of confusion or be deemed malicious.
• MUST conform to the conventions for assetType and info.
• MUST NOT revert.

#### Events

event Deposit(
uint256 amountDeposited,
uint256 amountScyOut
);

caller has converted exact base tokens into SCY (shares) and transferred those SCY to receiver.

• MUST be emitted when base tokens are deposited into the SCY contract via deposit method.
event Redeem(
uint256 amountScyToRedeem,
uint256 amountTokenOut
);

caller has converted exact SCY (shares) into base tokens and transferred those base tokens to receiver.

• MUST be emitted when base tokens are redeemed from the SCY contract via redeem method.
event ClaimRewards(
uint256[] rewardAmounts
);

caller has claimed user rewards and transferred them to the user.

• MUST be emitted when rewards are claimed from the SCY contract via claimRewards method.
event ExchangeRateUpdated(uint256 oldExchangeRate, uint256 newExchangeRate);

The exchangeRateCurrent is updated to the latest exchange rate.

• MUST be emitted when the exchange rate is updated in the SCY contract via exchangeRateCurrent method.

“SCY” Word Choice:

“SCY” (pronunciation: /sʌɪ/), an abbreviation of Super Composable Yield, was found to be appropriate to describe a broad universe of composable yield-bearing digital assets.

## Rationale

EIP-20 is enforced because implementation details such as transfer, token approvals, and balance calculation directly carry over to the SCY tokens. This standardization makes the SCY tokens immediately compatible with all EIP-20 use cases.

EIP-165 is not explicitly mentioned to be supported as there are no optional methods in this standard. It is expected for all methods defined in the interface to be implemented.

EIP-2612 can optionally be implemented in order to improve the UX of approving SCY tokens on various integrations.

The exchangeRateStored read-only method serves as a rough estimate of the prevalent exchange rate since the last update. It is included for frontends, wallets, and applications that need an estimate on the exchange rate of SCY tokens into assets, not an exact value possibly including slippage or other fees as this would require them doing a state update and spending gas. For applications that need an exact exchange rate, the exchangeRateCurrent mutable function can be used.

## Backwards Compatibility

This EIP is fully backwards compatible as its implementation extends the functionality of EIP-20, however the optional metadata extensions, namely name, decimals, and symbol semantics MUST be implemented for all SCY token implementations.

## Security Considerations

Malicious implementations which conform to the interface can put users at risk. It is recommended that all integrators (such as wallets, aggregators, or other smart contract protocols) review the implementation to avoid possible exploits and users losing funds.

The method exchangeRateStored returns an outdated estimated value and does not confer the exact current exchange rate of asset per share. Should accuracy be needed, exchangeRateCurrent should be used instead (which additionally updates exchangeRateStored.)

decimals in assetInfo must strongly reflect the underlying asset’s decimals if at all possible in order to eliminate any possible source of confusion or be deemed malicious.

yieldToken must strongly reflect the address of the underlying wrapped yield-generating token. For a native implementation wherein the SCY token does not wrap a yield-generating token, but natively represents a GYGP share, then the address returned MAY be a zero address. Otherwise, for wrapped tokens, you may introduce confusion on what the SCY token represents, or may be deemed malicious.

Copyright and related rights waived via CC0.


text:
# Topology: definition via neighborhood vs open sets?

I'm reading the Wikipedia page on Topology. It claims topology can be defined using axioms of neighbors N(x) or open sets. I'm confused because the neighbor axioms do not allow a topology with the empty set, because x must be included in the topology. Yet, the definition of open set topology requires the empty set and X belong to the topology.

Can anyone clear up my confusion between neighborhood and open set definitions? Why do they result in different topologies?

Thank you

The definitions are equivalent, and the empty set is open if you use the definition with neighbourhoods.

Namely, for every element $$x$$ of the empty set (note: there aren't any!) you can find the whole neigbourhood from $$N(x)$$ contained in the same empty set (provided that you can show me that element $$x$$ in the first place!).

In other words, this is true precisely because the premise ($$x\in\emptyset$$) is always false. See also: https://en.wikipedia.org/wiki/Vacuous_truth .

You may be confused about what the statement means. It does not mean that the sets you give as neighborhoods will become the open sets.

Rather, what it says is given a set $$X$$, that the following two pieces of information are equivalent (in that one of them will uniquely determine the other):

1. A collection of subsets $$\tau$$ of $$X$$ that (i) includes $$\varnothing$$ and $$X$$; (ii) is closed under arbitrary unions; and (iii) is closed under finite intersections. (That is, a topology on $$X$$ given by the collection of "open sets").

2. For each $$x\in X$$, a family $$\mathcal{N}_x$$ of subsets of $$X$$ such that: (i) For every $$A\in \mathcal{N}_x$$, $$x\in A$$; (ii) if $$A\in \mathcal{N}_x$$ and $$A\subseteq B$$, then $$B\in\mathcal{N}_x$$; (iii) if $$A,B\in\mathcal{N}_x$$, then $$A\cap B\in\mathcal{N}_x$$; and (iv) For every $$A\in \mathcal{N}_x$$ there exists $$B\in\mathcal{N}_x$$ such that for all $$y$$, if $$y\in B$$, then $$A\in\mathcal{N}_y$$. (That is, $$\mathcal{N}_x$$ is a "system of neighborhoods for each $$x\in X$$").

So the statement is that tiven a topology $$\tau$$ as in 1, there is a way of defining the collection of families as in 2; that given a family of sets $$\mathcal{N}_x$$ as in 2, there is a way to define a topology $$\tau$$ using that information; and that if you use $$\tau$$ to construct the neighborhoods and then use the neighborhoods to construct a topology, you get back the $$\tau$$ you started with; and if you start with neighborhoods, use them to construct $$\tau$$, and then you use $$\tau$$ to construct the neighborhoods, you get back the neighborhoods you started with.

The constructions are as follows: given a topology $$\tau$$, the family $$\mathcal{N}_x$$ consists precisely of the set $$A$$ for which there exists $$\mathcal{O}\in\tau$$ with $$x\in\mathcal{O}$$ and $$\mathcal{O}\subseteq A$$.

And given a collection of families as in 2, the topology $$\tau$$ is defined to be the collection of all subset $$\mathcal{O}$$ of $$X$$ such that for every $$x$$, if $$x\in\mathcal{O}$$, then $$\mathcal{O}\in\mathcal{N}_x$$.

It is a good exercise to verify these constructions have the properties I described in the paragraph after item 2.


text:
If the selling price of 45 articles is equal to the cost price of 50 articles, the loss or gain percentage is:

This question was previously asked in
SSC Matric Level Previous Paper (Held on: 9 Nov 2020 Shift 1)
View all SSC Selection Post Papers >
1. Gain: $$\frac{{50}}{3}\%$$
2. Loss: $$\frac{{50}}{9}\%$$
3. Loss: $$\frac{{100}}{9}\%$$
4. Gain: $$\frac{{100}}{9}\%$$

Option 4 : Gain: $$\frac{{100}}{9}\%$$
Free
GK Chapter Test 1 - Ancient History
18116
15 Questions 30 Marks 10 Mins

Detailed Solution

Given:

Selling price of 45 articles is equal to the cost price of 50 articles

Concept used:

Profit and loss

Calculation:

SP × 45 = CP × 50

$$\frac{{SP}}{{CP}} = \frac{{50}}{{45}}$$

$$\frac{{SP}}{{CP}} = \frac{{10}}{9}$$

Gain = SP - CP

Gain % = $$\frac{{10 - 9}}{9} \times 100$$

Gain% = $$\frac{{100}}{9}\%$$


text:
Structure of a Nanocrystalline Phase with Second Harmonic Generation

Abstract
Phases of the 10K$_2$O-4Na$_2$O-14Nb$_2$O$_5$-72TeO$_2$ glass-ceramic with second harmonic generation were studied by using an energy dispersive method in X-ray spectroscopy and XRD. The Bravais lattice of 10K$_2$O-4Na$_2$O-14Nb$_2$O$_5$-72TeO$_2$ glass-ceramic was basically a face-centered cubic structure from the results of sin2??. The cubic crystalline phase of this oxygen-deficient fluorite-type structure was found to be slightly distorted. Knowledge of the crystal structure of the tellurite-based glass-ceramic is believed to be very important for the development and application of new nonlinear optical materials
Keywords: SHG, TeO$_2$, Nanocrystals, Nonlinear optical materials, Glass-ceramic

 Search for

Indexed/Covered by


text:
Is $R(su_{4})\cong R(so_{6})$? - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-19T21:23:13Z http://mathoverflow.net/feeds/question/93926 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/93926/is-rsu-4-cong-rso-6 Is $R(su_{4})\cong R(so_{6})$? Changwei Zhou 2012-04-13T01:15:43Z 2012-05-10T09:26:09Z
This is one of small the unsettled questions I had in my senior project. I want to prove for type $D$ we have $R(T)$ is a free module over $R(G)$ by finding a basis. I think we should have,$R(G)\cong R(g)$, $R(T)\cong R(h_{g})$, but since $SO_{6}$ is not simply connected this probably does not work and I have to "ascend" to spin groups, but I do not know how.

Define the representation ring of a lie algebra to be the formal sums of its characters, it is not hard to show that $$R(su_{4})\cong \mathbb{Z}[x+y+z+w,xy+yz+zx+wz+wy+wz,xyz+yzw+xzw+xyw]/(xyzw-1)$$ and $$R(h_{su_{4}})\cong \mathbb{Z}[x,y,z,w]/(xyzw-1)$$

a typical basis of $R(h_{su_{4}})$ over $R(su_{4})$ consists of $x^{i}y^{j}z^{k}, 0\le i\le 3, o\le j\le 2, 0\le k\le 1$.

I proved that the weight lattice of $su_{4}$ and $so_{6}$ are isomorphic, and their Weyl group are both isomorphic to $S_{4}$. So $R(h_{so_{6}})$ should be a free module over $R(so_{6})$ with rank 24 as well. But I found I could not use this to find a basis for $R(h_{so_{6}})$ over $R(so_{6})$, because we have:

$$R(so_{6})\cong \mathbb{Z}[x+y+z+x^{-1}+y^{-1}+z^{-1},x^{\frac{1}{2}}y^{\frac{1}{2}}z^{\frac{1}{2}}+x^{\frac{1}{2}}y^{-\frac{1}{2}}z^{-\frac{1}{2}}+x^{-\frac{1}{2}}y^{-\frac{1}{2}}z^{\frac{1}{2}}+x^{-\frac{1}{2}}y^{\frac{1}{2}}z^{-\frac{1}{2}},x^{-\frac{1}{2}}y^{-\frac{1}{2}}z^{-\frac{1}{2}}+x^{\frac{1}{2}}y^{-\frac{1}{2}}z^{\frac{1}{2}}+x^{-\frac{1}{2}}y^{\frac{1}{2}}z^{\frac{1}{2}}+x^{\frac{1}{2}}y^{\frac{1}{2}}z^{-\frac{1}{2}}]$$

the first is the standard representation with weights $\pm L_{i}$, the second and the third are the spin representations one obtain from clifford algebra or "ascend" to spin group(can be found at Fulton&Harris, Chapter 23.2 or here). As one commentator noted I am not clear about the relationship between $R(so_{6})$ and $R(h_{so_{6}})$.

and $$R(h_{so_{6}})\cong \mathbb{Z}[x,y,z,x^{-1},y^{-1},z^{-1}]$$ because we know the two diagonal submatrices in $so_{6}$ must be skew-symmetric. From $A+D^{T}=0$ we conclude $T$ is isomorphic to $S^{1}\times S^{1}\times S^{1}$. Thus we conclude this.

I thought it would be a simple change of variable to prove the two cases are just the same, but I found the isomorphism between $R(so_{6})$ and $R(su_{4})$ does not extend nicely to an isomorphism between $R(h_{so_{6}})$ and $R(h_{su_{4}})$. So I believe I must be confused. My advisor suggested me that maybe there is some subtly in $Spin_{6}$, but I still do not know how to estbalish an isomorphism or to find the basis right away.
 http://mathoverflow.net/questions/93926/is-rsu-4-cong-rso-6/93963#93963 Answer by BS for Is $R(su_{4})\cong R(so_{6})$? BS 2012-04-13T15:05:40Z 2012-04-13T15:05:40Z
It is a standard fact that $Spin(6)$ and $SU(4)$ (hence $so_{6}$ and $su_{4}$) are isomorphic. An easy way to see this is to observe that $SU(4)$ is simply connected and acts on the exterior square of $\mathbb{C}^4$, preserving a (complex) quadratic form (coming form exterior squaring and $det=1$) and a real structure (a conjugate-linear involution, hodge star followed by conjugation) for which the quadratic form is definite. Then the equality of dimensions (and easy calculation of the kernel) shows that $SU(4)\to SO(6)$ is a double covering.

From a higher standpoint, you may also observe that the Dynkin diagrams for $D_3$ and $A_3$ are the same, hence the maximal compact subgroups of the corresponding simply connected complex Lie groups are isomorphic.


text:
# Crop an image to a square

In this challenge, you will take an input image and crop it to make a square, leaving only the central part of the input image.

The answers must work with landscape, portrait, or square input images. The width of the output image should be equal to the shortest side of the input image e.g. the result of a 200x300 image should be a 200x200 image. An equal amount must be cropped from both ends of the input image e.g. for a 200x300 input image, 50 pixels should be cropped from each end of the image, leaving only the central part of the image. Where its not possible to crop an equal amount from both sides e.g. a 200x301 image, the extra 1 pixel may be cropped from either end of the image. For a square input image, the output should be identical to the input.

Input:

The input file should be read from the hard disk of the machine running the program. You may choose which of bmp, jpeg, png or pnm to support as the input image format.

Output

The output file should be written to the hard disk of the machine running the program. The format of the output image should be bmp, jpeg, png or pnm.

Win Criteria

This is code golf. Shortest code wins.

Notes:

1. The input/output file paths do not count towards the program size.
2. The standard libraries of your programming language may be used. Other libraries are disallowed.
3. Standard loopholes apply.

Example:

Input Image:

Expected Output:

Images by kirill777 - licenced CC-BY 3.0

• This seems to have a significant bias toward languages whose standard library contains BMP functions. For example, php.net/manual/en/function.imagecreatefromwbmp.php Aug 5 '14 at 23:08
• Thats true but allowing external libraries would bring its own set of potential issues and introduce too much scope for loopholes Aug 5 '14 at 23:39
• Can we at least choose the image format?
– Doorknob
Aug 5 '14 at 23:52
• @doorknob i updated the question to allow jpeg and png. If anyone wants to use another format, please request it in the comments. Aug 6 '14 at 0:10
• PNM? That allows languages with no standard library support for images to participate. Aug 6 '14 at 10:08

# Parsing the raw bytestream: Haskell (319 = 332 - 13)

Without any imports at all, this program crops P1 PBM images.

g _[]=[]
g z x=(\(a,b)->a:g z b).splitAt z$x q=map f=filter main=do c<-readFile"in.pbm";let(r:p)=tail.f((/='#').head).lines$c;(w:h:_)=(q read).words$r;m=min w h;t s=take m.drop((s-m)div2);k d=[[m,m]]++(q(t w)(t h d))in writeFile"out.pbm".("P1\n"++).unlines.q(unwords.(q show)).k.(q((q read).g 1)).take h.g w.f(elem"01").concat$p

## Special case: helpful formatting (214 = 227 - 13)

My first attempt at PBM (P1) was based on the example at Wikipedia and assumed spaces separated the pixels, and lines in the text correlated with lines in the image. Under those conditions, this shorter version works fine.

main=do c<-readFile"in.pbm";writeFile"out.pbm".("P1\n"++).unlines.q(unwords.(q show)).k.q((q read).words).tail.filter((/='#').head).lines$c k((w:h:_):d)=let m=min w h;t s=take m.drop((s-m)div2)in[[m,m]]++(q(t w)(t h d)) q=map  Bonus feature: strips out comments! Both of the above work in essentially the same manner as the original below, but with a simpler header, lower bit depth, and no padding, although the topmost program works harder to allow for a range of formatting options. # Also available in a wide range of colours: Haskell (545 = 558 - 13) No pre-existing image-handling functions were harmed in the making of this program. Uncompressed 24-bit RGB bitmaps have a fairly straight-forward header system but are complicated by the mod-4 padding for each row's byte array. This code grabs the bitmap offset, width, and height from the input header, calculates the row padding, and extracts the bitmap data into a list of lists (rows of columns, bottom-left corner first). Cropping is as simple as dropping half the excess and then taking the desired length from each list. The new file size is calculated as 3*(padded width)*height + 54 bytes (for the minimal required headers). The new header is constructed and the cropped image data appended. It's all mapped to characters and written back out to disk. Input: in.bmp (6 characters removed from total) Output: out.bmp (7 characters removed from total) I think there's still some redundancy still in there, but my brain hurts to look at it this way. import System.IO import Data.Char import Data.List.Split main=do k"in.bmp"ReadMode(\h->do i h u;c<-hGetContents h;let d=l(ord)c;w=s 18d;h=s 22d;p=o w;m=min w h;q=o m;j a b=y a(r b m)in k"out.bmp"WriteMode(\g->do i g u;hPutStr g$"BM"++l chr((z e[m*(3*m+q)+54,0,54,40,m,m,1572865,0,0,1,1,0,0])++((z((++(f q$cycle[0])).y(3*m)(3*r w m)).j m h$chunksOf(3*w+p)$n(s 10d)d))))) i=hSetBinaryMode k=withFile z=concatMap l=map v=div f=take n=drop u=True y t d=f t.n d s d=sum.zipWith(*)(l(256^)[0..3]).y 4d o=(mod4) r a b=v(a-b)2 e x=l((mod256).(xv).(256^))[0..3]  For comparison, an ungolfed version is over 8 times as long, at 4582 (4595 - 13) bytes: import System.IO import Data.Char import Data.List.Split main = readImage cropImageToSquare cropImageToSquare fileHandle = do hSetBinaryMode fileHandle True fileContents <- hGetContents fileHandle let inImageData = asBytes fileContents inImageBitmapOffset = getIntFromWordAt 10 inImageData inImageWidth = getIntFromWordAt 18 inImageData inImageHeight = getIntFromWordAt 22 inImageData inImageBitmapData = drop inImageBitmapOffset inImageData inImageBitmap = chunksOf (paddedBytesForWidth inImageWidth) inImageBitmapData outImageSideLength = min inImageWidth inImageHeight outFileHeader = fileHeader outImageSideLength outImageSideLength outImageHeader = imageHeader outImageSideLength outImageSideLength outHeaders = outFileHeader ++ outImageHeader outImageBitmap = crop outImageSideLength outImageSideLength inImageWidth inImageBitmap in writeImage "out.bmp" outHeaders outImageBitmap --- Read Image --------------------------------------------------------- readImage = withFile "in.bmp" ReadMode --------------------------------------------------------- Read Image --- --- Write Image -------------------------------------------------------- writeImage filename header imageBitmap = do withFile filename WriteMode write' where write' fileHandle = do hSetBinaryMode fileHandle True hPutStr fileHandle . ("BM"++) . map chr$ (concatMap wordFromInt header)
++ (concat imageBitmap)

-------------------------------------------------------- Write Image ---

--- Character-Integer Conversion ---------------------------------------

asBytes = map ord

getWordAt offset = take 4 . drop offset

getIntFromWordAt offset = intFromWord . getWordAt offset

intFromWord     = sum . zipWith (*) (map (256^) [0..3])

wordFromInt int = map((mod 256) . (int div) . (256^)) [0..3]

--------------------------------------- Character-Integer Conversion ---

fileHeader width height = [ fileSize
, reserved
, bitmapOffset
]
where
fileSize     = imageFileSize width height
reserved     = 0
bitmapOffset = 54

imageFileSize width height = 54 + height * (paddedBytesForWidth width)
rowPadding = (mod 4)

, width
, height
, planesAndBits
, compression
, bitmapSize
, horizontalImageResolution
, verticalImageResolution
, paletteSize
, coloursUsed
]
where
planesAndBits    = int32FromInt16s colourPlanes bitDepth
colourPlanes     = 1
bitDepth         = 24
compression      = 0
bitmapSize       = 0
horizontalImageResolution = pixelsPerMetreFromDPI 72
verticalImageResolution   = pixelsPerMetreFromDPI 72
paletteSize      = 0
coloursUsed      = 0

pixelsPerMetreFromDPI = round . (* (100/2.54))

int32FromInt16s lowBytes highBytes = lowBytes + shift 2 highBytes
shift bytesUp number  = (256 ^ bytesUp) * number

--- Crop Image ---------------------------------------------------------

crop toHeight toWidth fromWidth = cropWidth toWidth fromWidth
. cropHeight toHeight

cropHeight toHeight image = take toHeight
. drop ( halfExtra (length image) toHeight)
$image cropWidth toWidth fromWidth image = map ( padRow toWidth . take (3 * toWidth) . drop (3 * (halfExtra fromWidth toWidth)) )$ image

$xs ++ (repeat 0) halfExtra fromLength toLength = (fromLength - toLength) div 2 --------------------------------------------------------- Crop Image ---  • Very nice answer. I'm having a little trouble getting it to work with my test images. see dl.dropboxusercontent.com/u/141246873/crop/bg1ascii.pbm and dl.dropboxusercontent.com/u/141246873/crop/bg1raw.pbm These images are pbm versions of the example image in the question. They were generated using GIMP. One is ascii and the other is raw. Please could you try it with either one of the files. Thanks. Aug 6 '14 at 22:00 • On the first version, some characters can be saved by shortcutting map to an infix function (like (#)=map) instead of q. Maybe on the second version too, i haven't checked. Aug 7 '14 at 8:41 • P4 PBMs are out, sorry. As for the P1 image, I followed the Wikipedia example too closely and assumed spaces between pixels and matching line lengths. The new (longer) program I just added handles bg1ascii.pbm, though, and still manages it without importing functionality. Aug 7 '14 at 11:38 • Tested and its working well with the GIMP generated images Aug 7 '14 at 18:22 ## Mathematica 52 Spaces not needed: ImageCrop[#, {#, #} &@Min@ImageDimensions@#] &@Import@"c:\\test.png"  • Sorry this is one of the standard loopholes: meta.codegolf.stackexchange.com/a/1078/21713 Aug 8 '14 at 21:23 • @Ryan Sorry, but not this time. The OP (you) wrote "The standard libraries of your programming language may be used. Other libraries are disallowed.".I'm using only the standard Mathematica statements - NO LIBRARIES AT ALL Aug 8 '14 at 21:36 # Rebol, 165 92 (105 - 13) i: load %in.bmp s: i/size m: min s/1 s/2 c: to-pair reduce[m m]save %out.bmp copy/part skip i s - c / 2 c  At its simplest if you have a image file (in.bmp) of 300x200 then it can be cropped and saved to file (out.bmp) like so: save %out.bmp copy/part skip load %in.bmp 50x0 200x200  Rebol comes with a spatial coordinates datatype called Pair! Here are some examples of this datatype (using Rebol console): >> type? 300x200 == pair! >> first 300x200 == 300.0 >> second 300x200 == 200.0 >> 300x200 - 200x200 == 100x0 >> 300x200 - 200x200 / 2 == 50x0  The last example shows how the skip coordinates were worked out for balanced cropping. NB. This solution was tested using latest version of Rebol 3 (see http://rebolsource.net/) on OS X. BMP is currently supported on all platforms. PNG, Jpeg & other formats are only partially implemented (across platforms) at this time. # C# - 250271265 229 (incl. 26 for file names) Forgot about the import for it to work. using System.Drawing; class P{static void Main(string[] a){var b=new Bitmap(@"C:\Dev\q.jpg",true);int h=b.Height,w=b.Width,s=h<w?h:w,d=(h-w)/2;b.Clone(new Rectangle(d>0?0:d*-1,d>0?d:0,s,s),b.PixelFormat).Save(@"C:\Dev\q2.jpg");}}  De-golfed (or what you call it). using System.Drawing; class Program { static void Main(string[] a) { var b = new Bitmap(@"C:\Dev\q.jpg",true); int h=b.Heightw=b.Width,s=h<w?h:w,d=(h-w)/2; b.Clone(new Rectangle(d>0?0:d*-1,d>0?d:0,s,s),b.PixelFormat).Save(@"C:\Dev\q2.jpg"); } }  Thanks (again) to w0lf for pointing out different declaration style. • this can be reduced significantly by erasing extra whitespace and using the int x=..., y=... declaration style: pastie.org/9454985 Aug 8 '14 at 6:34 • also, you can drop the spaces around equal signs and most line breaks. See the link in my previous comment. It's 232 chars. Aug 8 '14 at 8:32 • Thanks! I guess it is better to actually look at the link :) Aug 8 '14 at 8:44 • Yes. Well, at both links because I just realized thsi can be shortened even more. :) Aug 8 '14 at 9:14 • Well, according to the rules the image-reference don't count, but yeah, nice! Aug 8 '14 at 9:17 # Java, 373348342336 322 import java.awt.image.*;import java.io.*;import javax.imageio.*;class M{public static void main(String[]a)throws Exception{BufferedImage i=ImageIO.read(new File(a[0]));int[]d={i.getWidth(),i.getHeight()},o={0,0};int s=d[0]>d[1]?1:0;o[1-s]=(d[1-s]-d[s])/2;ImageIO.write(i.getSubimage(o[0],o[1],d[s],d[s]),"bmp",new File("out.bmp"));}}  Ungolfed: import java.awt.image.*; import java.io.*; import javax.imageio.*; class M{ public static void main(String[] args) throws Exception{ // read file as argument, instead of args[0] the path to the file could hardcoded. // Since the path to the input file don't count towards the character count, I'm not counting args[0] BufferedImage i = ImageIO.read(new File(args[0])); int[] dimension = { i.getWidth(), i.getHeight() }, origin = { 0, 0 }; int smaller = dimension[0] > dimension[1] ? 1 : 0; // 1-smaller is the index of the bigger dimension origin[1-smaller] = (dimension[1-smaller] - dimension[smaller]) / 2; // again, path to output file don't count ImageIO.write(i.getSubimage(origin[0], origin[1], dimension[smaller], dimension[smaller]), "bmp", new File("out.bmp")); } }  Usage: java M image.type Should be able to read jpg, png, bmp, wbmp and gif. Writes a bmp called "o". Who said you couldn't use Java for golf? Edit: Just realised that file paths don't count towards the character count. • You can use * for imports.. Like import java.io.* etc ;) Aug 6 '14 at 17:50 • I'm so used to eclipse handling the imports that I didn't even think of that. There was other stuff that could be removed, too. E: Oops, forgot an import. Aug 6 '14 at 18:02 • You can cut 9 by removing public  from the class and the two spaces in String[] a) throws. You should add a golfed (no whitespace) version so it's easier for others to count/verify, though. Aug 6 '14 at 18:55 • @Geobits done. Also apparently I counted too many characters. Should be fixed now. Aug 6 '14 at 19:29 • Works nicely for portrait/landscape images but doesn't seem to produce any output for square images? Aug 6 '14 at 20:35 # Bash, 115 with ImageMagic, hard to say if you can count it as a standard lib :) #!/bin/bash convert$1 -set option:size '%[fx:min(h,w)]x%[fx:min(h,w)]' xc:red +swap -gravity center -composite _$1  • I'm not counting it as a standard lib sorry :) Aug 6 '14 at 20:21 # Clojure, 320 (333 - 13 for filenames) Deciding to sidestep types, this P1 (ASCII) PBM cropper is written in Clojure. With function names like interpose, read-string, and clojure.string/replace, it's not exactly golf friendly, and I'm not sufficiently experienced to know if I can compile without a namespace declaration. (Leiningen puts it in automatically, and Leiningen is nice to me, so I'm going to leave it there, though I did eject .core.) On the plus side, however, file access and string concatenation are short. (ns a(:gen-class))(defn -main[](let[[[_ r p]](re-seq #"(^\s*\d+\s+\d+)([\s\S]*$)"(clojure.string/replace(slurp"in.pbm")#"(P1)|(#.*\n)"""))[w
str"P1\n"c" "c"\n"(flatten(interpose"\n"(take
c(partition c w(drop(+(*(quot(- h c)2)w)(quot(- w c)2))(re-seq #"\S"p))))))))))

The function at the heart of the program is ungolfed below.

(defn crop-pbm [in out]
(let [         filestream (slurp in)
image-data (clojure.string/replace (str filestream "\n") #"(P1)|(#.*\n)" "")
[[_ resolution pixels]] (re-seq #"(^\s*\d+\s+\d+)([\s\S]*$)" image-data) pixels (re-seq #"\S" pixels) [width height] (map read-string (re-seq #"\d+" resolution)) crop (min width height) drop-width (- width crop) drop-height (- height crop) initial-drop-width (quot drop-width 2) initial-drop-height (quot drop-height 2) initial-drop (+ (* initial-drop-height width) initial-drop-width) cropped-pixels (take crop (partition crop width (drop initial-drop pixels))) cropped-image (apply str "P1\n" crop " " crop "\n" (flatten (interpose "\n" cropped-pixels)))] (spit out cropped-image)))  Rather than constructing a two-dimensional array to represent the image, this program calculates the number of pixels to the new top-left corner and drops them, then jumps original-width pixels at a time, taking cropped-side-length pixels from as many steps. The regular expression function re-seq does much of the heavy lifting, stripping out whitespace and forming arrays simultaneously, which leads me to suspect that Perl could follow this approach and yield a shorter program. # Perl, 276 287 (289 300 - 13) ## Regex to the Rescue! Who needs dedicated image functions when you have regular expressions? (And 1-bit images to crop.) local$/;open I,"in.pbm";$_=<I>;s/(P1)|(#.*\n)//g;/^\s*(\d+)\s+(\d+)([\s\S]*)$/;($w,$h,$_)=($1,$2,$3);$c=$w<$h?$w:$h;s/\D//g;$d=$w-$c;while($z++<$w*int(($h-$c)/2)+int($d/2)){s/^\d//};while($i++<$c){/^(\d{$c})(\d{$d})(.*)/;$p.=$1."\n";$_=$3."0"x$w}open O,'>',"out.pbm";print O"P1\n$c$c\n$p"  That's the golfed version of: use strict; use warnings; # Read in the image file local$/ = undef;

open IMAGEIN, '<', "in.pbm" or die "Can't read 'in.pbm': $!"; my$image_data = <IMAGEIN>;
close IMAGEIN;

$_ =$image_data;
s/(P1)|(#.*\n)//g;

# Divide into width, height, and pixels
/^\s*(\d+)\s+(\d+)([\s\S]*)$/; (my$width, my $height,$_) = ($1,$2, $3); # Remove anything that isn't a number from the pixel data s/\D//g; my$pixels = $_; # Determine the new dimensions my$crop = $width <$height ? $width :$height;

# Calculate total to remove along each axis
my $drop_width =$width  - $crop; my$drop_height = $height -$crop;

# Calculate how much to remove from the first side along each axis
my $initial_drop_width = int($drop_width  / 2);
my $initial_drop_height = int($drop_height / 2);

# Calculate total pixels to the new top-left corner
my $initial_drop =$width * $initial_drop_height +$initial_drop_width;

# Remove the pixels preceding the corner
$_ =$pixels;
while (32760 < $initial_drop) # Stay under regex limit { s/^\d{32760}//;$initial_drop -= 32760;
}
s/^\d{$initial_drop}//; # Take *crop* rows of *crop* pixels$pixels = "";
for (my $i=0;$i<$crop;$i++)
{
/^(\d{$crop})(\d{$drop_width})(.*)/;
$pixels .=$1 . "\n";
$_ =$3 . "0"x$width; # Add some 0s to ensure final match } # Construct the new, cropped image my$cropped_image = "P1\n$crop$crop\n$pixels"; # Write out the image file open IMAGEOUT, '>', "out.pbm" or die "Can't write 'out.pbm':$!";
print IMAGEOUT \$cropped_image;
close IMAGEOUT;

There's a limit to the length of a string the substitution functions will handle, which necessitates a bothersome while loop for taller images. Even so, finally under 300!

# C#, 420

If the image is portrait it gets rotated while cropping and then cropped image is rotated to correct orientation.

Edit: now crop centre of the image. Run in terminal as crop.exe a.jpg

class P
{
static void Main(string[] a)
{
if (a.Length > 0)
{
Bitmap b = (Bitmap)Image.FromFile(a[0]);
int w = b.Width;
int h = b.Height;
int d = Math.Abs(w - h) / 2;
if (h > w) { b.RotateFlip(RotateFlipType.Rotate270FlipNone); }
Bitmap c = new Bitmap(h, h);
for (int x = d; x < (h+d); x++)
{
for (int y = 0; y < h; y++)
{
c.SetPixel(x-d, y, b.GetPixel(x, y));
}
}
if (h > w) { c.RotateFlip(RotateFlipType.Rotate90FlipNone); }
c.Save("Q.jpg");
}
}
}

• Unfortunately this throws an exception on an image with portrait orientation. It also outputs the left side of the input image and not the central part. To see what I mean, try it with the example image in the question and compare your result. Aug 6 '14 at 19:05

# C++/Qt 146

This might technically break rule #2 as Qt is not part of standard C++.

The first argument will be the input filename and the second will be the output filename.

#include<QtGui>
main(int c,char**v){QApplication a(c,v);QPixmap p(v[1]);int w=p.width(),h=p.height(),m=qMin(w,h);p.copy(w-m,h-m,m,m).save(v[2]);}

• This answer is not valid due to the use of a non standard library, but thanks for taking part :) Aug 6 '14 at 19:25

# Io, 103 bytes (excluding file path)

i := Image open("img.png");e := (i width) min(i height);i crop(((i width)-e)/2,((i height)-e)/2,e,e) save("crop.png")

You can use Io for CG!

• This can be heavily 'golfed' even further Aug 27 '15 at 6:01

# Matlab, 116 (130 with file names)

Pretty straightforward.

I=imread('a.jpg');[m,n]=size(I);z=min(m,n);c=m<n;r=[1,ceil((m-z)/2)]*~c+c*[ceil((n-z)/2),1];imwrite(imcrop(I,[r,z-1,z-1]),'z.jpg')

# APL (dzaima/APL), 66 bytes

i←P5.img p
P5.size←2⍴a←⌊/s←i.sz
P5.draw←{i P5.G.img⍨.5×a-s⋄i.save}

Try it online!


text:
## Intermediate Algebra for College Students (7th Edition)

$(5x-2)(25x^2+10x+4)$
Given:$125x^3-8$ Since, $a^3-b^3=(a-b)(a^2+ab+b^2)$ Thus, $=(5x)^3-(2)^3$ or, $=(5x-2)(25x^2+(5x)(2)+4$ Hence, $(5x-2)(25x^2+10x+4)$


text:
# Help with 10th grade geometry proof?

• Apr 25th 2013, 06:30 PM
jackmac868
Help with 10th grade geometry proof?
I am having extreme difficulty with this. I've tried using inscribed angle theorems, but I've given up. Can anyone solve this?Attachment 28158
I'm in tenth grade geometry. Thank you. Just click on the proof to enlarge it
• Apr 25th 2013, 06:56 PM
Re: Help with 10th grade geometry proof?
Draw a line $\overrightarrow{BE}$
Make a point Z that is half way along $\overrightarrow{BE}$ (midpoint between B and E)

Draw a line $\overrightarrow{ZA}$

Through mirror symmetry, $\frac{\angle 1}{\overrightarrow{AB}}\frac{\cong}{\cong} \frac{\angle 2}{\overrightarrow{AE}}$

That should do it.

• Apr 27th 2013, 08:37 AM
johng
Re: Help with 10th grade geometry proof?
Hi,
I didn't really understand the previous answer. I think you have the right idea in trying to use the inscribed angle theorem. I hope you can prove your problem with the help of the following:

Attachment 28172


text:
# Compute hyperbolic length of the arc of the circle

Compute the hyperbolic length of the arc of the circle $x^2 + y^2 = 25$ that lies between (3, 4) and (4, 3).

From my notes I know the formula is $$\ln \frac{{\csc \beta - \cot \beta }}{{\csc \alpha - \cot \alpha }}$$

however I don't know how to find $\beta$ and $\alpha$

• can you give more information? (which book are you using, which model and so on – Willemien Mar 17 '15 at 21:59
• I assume that $\alpha$ and $\beta$ are the two sharp angles of the $(3,4;5)$ straight-edged triangle. – Lucian Mar 18 '15 at 2:15