text:
Start

2019-01-21 15:00 AKST

End

2019-01-27 15:00 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -18488 days 2:53:06

5:00:00

0:00:00

Problem CCodforces

Nicolas wants to start a competitive fishing career in the codforces™ championships. There are a lot of different divisions to compete in, but since Nicolas is a new participant in codforces™ he must start in the lowest division (division 1). Nicolas goal is to as quickly as possible get to the highest division (division $K$) and win a fishing contest in it.

The codforces™ rules state that you may only gain a single division per contest, so he needs to perform at least one contest in each division. Nicolas is very confident, and thinks he will only need exactly one contest per division to get to the next division. When codforces™ has a contest, there’s only a single division competing at a time, and two competitions never overlap in time. The contests also follow the same schedule each year.

Nicolas may start competing at codforces™ any day of the year. What he means by as fast as possible is that as few contests as possible should occur at codforces™ (independent of whether he competes in them or not) between the first contest he participates in and the first win Nicolas gets in the highest division. Help Nicolas to compute the number of competitions he needs.

Input

The first line of input contains two integers $N$ and $K$ ($1 \leq K \leq N \leq 10^6$), the number of contests per year, and the number of divisions.

The next line contains the $N$ integers $x_1, \dots , x_ N$, ($1 \leq x_ i \leq K$), the schedule of contests for a year. $x_ i$ is the division competing during the $i$’th contest counted from the start of a new year. Each division between $1$ and $K$ has at least one contest during the year.

Output

Output a single integer, the smallest number of contests that codforces™ needs to host between Nicolas’s first contest and his first win in division $K$.

Scoring

Your solution will be tested on a set of test case groups. To get the points for a group, you need to pass all the test cases in the group.

 Group Points Constraints $1$ $15$ $N \leq 10^2$ $2$ $20$ $N \leq 10^3$ $3$ $25$ $N = K$ $4$ $40$ No further constraints

Explanation of sample 3

The fastest way for Nicolas to reach his target is to let his first contest be the second one for division 1 during the year. Then he waits for four contests to participate in the first division 2 contest in the year after. Then he waits for three contests to compete in division 3. Then he waits for five contests to compete in division 4. Finall he waits for two contests to compete in division 5. In total, it takes $1+(4+1)+(3+1)+(5+1)+(2+1) = 19$ contests.

Sample Input 1 Sample Output 1
3 3
3 2 1

5

Sample Input 2 Sample Output 2
3 2
1 1 2

2

Sample Input 3 Sample Output 3
7 5
2 1 1 4 3 2 5

19


text:
• Open Surveys
• Supplemental Graduate Application Spring 2020 - MS in Mechanical Engineering

To be considered, applicants must have already completed the Cal State Apply (https://www2.calstate.edu/apply) Online Application to the University.

Send all required documents directly to the university during this process:  (1) Official Transcripts, (2) GRE scores if available (see Question 9 below), (3) International Applicants are required to submit English Proficiency Scores (see Question 7 below), and (4) International applicants are required to submit their transcripts directly to IERF or WES for evaluation (see Question 8 below).

This supplemental application (completed by answering the questions below) is required by the Mechanical Engineering Department to gather relevant information necessary for making recommendations for admission.

1. What is your CIN?  (This is the 9-digits number you received by email a week after submitting Cal State Apply online application.  For example: (333444555)

2. What is your name as given in the application? (Enter it as Last-Name, First-Name.  For example:  Smith, John)

4. Have you previously applied for admission to Cal State LA's graduate program in Mechanical Engineering?

Yes
No
5. If the answer for the above question is "Yes", indicate the Term/Year (Ex., Fall 2015) and list actions taken since your previous application (if any) and/or reason for reapplication.

6. Are you an international student?  (Note that the international application is different than resident application on Cal State Apply.)

Yes
No
7. All graduate and post-baccalaureate applicants, regardless of citizenship, whose preparatory education was principally in a language other than English, must demonstrate competence in English.  Those who do not possess a bachelor's degree from a postsecondary institution where English is the principal language of instruction must complete and submit satisfactory English Proficiency Exam Scores.

The acceptable English Language Exams are: (1) TOEFL, (2) IELTS, and  (3) PTE (you should have already seen this information while applying on Cal State Apply).   If applicable to you, indicate the score and name of the exam (for example: TOEFL score - 85)

8. If you have studied at an institution outside the US, you will need to have your foreign academic work evaluated by International Education Research Foundation (IERF) or World Education Services (WES) for securing admission into the program.

• IERF - Visit https://apply.ierf.org/  to create an online application requesting the "Detailed Report”.  The foreign evaluation fee is $165 (USD). When submitting your course work to IERF please make sure to indicate that you were referred by "CSU Los Angeles- Office of Graduate Admissions" and that you would like to have the official agency copy of the evaluation report sent directly to Cal State LA - Office of Graduate Admissions. • WES - Visit http://www.wes.org/fees/evaltypes.asp to create an online application, you will need to order the course-by-course evaluation report. The fees are$160 for the WES Basic or \$205 for the WES ICAP.

Indicate the date that you applied for IERF or WES or if you have not studied at an institution outside of the US enter Not Applicable

(Note: International Applicants will only be considered after we received IERF or WES report.  Ensure that you apply for IERF or WES very soon.)

9. Graduate Record Examination (GRE) is not currently required.  However, your GRE scores can be considered in the admission process.

Check the GRE details at

If you have taken the GRE exam, provide the GRE scores (Total, Verbal, Quantitative) and the year the exam was taken.

10. Provide the following information concerning you undergraduate degree:

(1) Name of the discipline mentioned on the transcript (for example: Bachelor of Science in Mechanical Engineering or Bachelor of Science in Physics)

(2) Name of the University

(3) Dates of attendance [for example: June 2012 to May 2017 or August 2013 to December 2019 (expected date)]

11.  Students must have a substantial background in mathematics, science, and core mechanical engineering coursework.  We consider knowledge of the following subjects to be essential preparation for our graduate program.  Indicate (click) all the categories/sequences completed in your undergraduate/bachelor's degree program.  Leave it blank (do not click) if you have not completed one or more of the courses in a category/sequence.

Completed 3 semester-equivalent courses of Calculus (Cal State LA: MATH 2110, MATH 2120, MATH 2130)
Completed a course in Differential Equations (Cal State LA: MATH 2150)
Completed 2 semester-equivalent courses in General Physics (Cal State LA: PHYS 2100, or PHYS 2200)
Completed 4 semester-equivalent courses in foundational ME coursework (Cal State LA: ME 2010 - Statics ME 2050 - Strength of Materials, ME 2070 - Material Science and Engineering, and ME 3200 - Dynamics)
Completed 2 semester-equivalent courses in Fluid Mechanics and Thermodynamics (Cal State LA: ME 3030 and ME 3260)
Completed semester-equivalent course (s) in Machine Design (Cal State LA: ME 3230) and/or Heat Transfer I (Cal State LA: ME 4061)
Completed 1 semester Programming Course with Numerical Methods (Cal State LA: Offered as 2 courses ME 2800 (1 unit) and ME 3800 (2 units)
12. For any background coursework categories/sequences not selected (clicked) above, specify which courses you have completed in each such category/sequence using the Cal State LA course numbers (MATH 2110, MATH 2120, MATH 2130, PHYS 2100, PHYS 2200, ME 2010, ME 2050, ME 2070, ME 2800, ME 3030, ME 3210, ME 3230, ME 3260, ME 3800 and ME 4061).

[For example, if you have completed only the first two courses of the three semester Calculus sequence, indicate MATH 2110, MATH 2120.  Specify for all categories/sequences left unclicked.]

13. For students who attended a university within the USA, enter the final GPA (Grade-Point-Average) as recorded on your transcripts at the end of your undergraduate program.

For International Applicants ensure that the transcripts are submitted to IERF or WES and indicate the GPA as indicated from IERF or WES report. (for example: 3.48)

14. Is there any additional information that can add value to this application?  (Maybe you have taken some additional courses beyond the required curriculum, passed the FE Exam, participated in engineering projects, conducted undergraduate research, obtained some certifications/advanced degrees, work experience etc.).  Be brief as your answer is limited to 100 words.

format: plain


text:
zbMATH — the first resource for mathematics

Dichotomies and asymptotic behaviour for linear differential systems. (English) Zbl 0559.34049
General necessary and sufficient conditions that a system of differential equations (*) $$x'=A(t)x$$ have a dichotomy are given in terms of Lyapunov type functions. Specific criteria are given which do not require either boundedness of the matrix A(t), or more generally that solutions of (*) have bounded growth or decay. A criterion using a generalized growth condition is also determined. Some further questions concerning the asymptotic behavior of solutions are addressed.
Reviewer: T.Gard

MSC:
 34D05 Asymptotic properties of solutions to ordinary differential equations 34C30 Manifolds of solutions of ODE (MSC2000) 34A30 Linear ordinary differential equations and systems 34D20 Stability of solutions to ordinary differential equations
Full Text:
References:
 [1] Dennis D. Berkey, Comparative exponential dichotomies and column diagonal dominance, J. Math. Anal. Appl. 55 (1976), no. 1, 140 – 149. · Zbl 0346.34032 [2] W. A. Coppel, Stability and asymptotic behavior of differential equations, D. C. Heath and Co., Boston, Mass., 1965. · Zbl 0154.09301 [3] W. A. Coppel, Dichotomies in stability theory, Lecture Notes in Mathematics, Vol. 629, Springer-Verlag, Berlin-New York, 1978. · Zbl 0376.34001 [4] Ju. L. Dalec$$^{\prime}$$kiĭ and M. G. Kreĭn, Stability of solutions of differential equations in Banach space, American Mathematical Society, Providence, R.I., 1974. Translated from the Russian by S. Smith; Translations of Mathematical Monographs, Vol. 43. [5] Philip Hartman, The existence of large or small solutions of linear differential equations, Duke Math. J. 28 (1961), 421 – 429. · Zbl 0102.30301 [6] A. C. Lazer, Characteristic exponents and diagonally dominant linear differential systems, J. Math. Anal. Appl. 35 (1971), 215 – 229. · Zbl 0215.43901 [7] Jack W. Macki and James S. Muldowney, The asymptotic behaviour of solutions to linear systems of ordinary differential equations, Pacific J. Math. 33 (1970), 693 – 706. · Zbl 0183.36002 [8] Marvin Marcus and Henryk Minc, A survey of matrix theory and matrix inequalities, Allyn and Bacon, Inc., Boston, Mass., 1964. · Zbl 0247.15002 [9] José Luis Massera and Juan Jorge Schäffer, Linear differential equations and function spaces, Pure and Applied Mathematics, Vol. 21, Academic Press, New York-London, 1966. · Zbl 0243.34107 [10] James S. Muldowney, On the dimension of the zero or infinity tending sets for linear differential equations, Proc. Amer. Math. Soc. 83 (1981), no. 4, 705 – 709. · Zbl 0484.34003 [11] Kenneth J. Palmer, A diagonal dominance criterion for exponential dichotomy, Bull. Austral. Math. Soc. 17 (1977), no. 3, 363 – 374. · Zbl 0363.34006 [12] Binyamin Schwarz, Totally positive differential systems, Pacific J. Math. 32 (1970), 203 – 229. · Zbl 0193.04501 [13] E. C. Titchmarsh, The theory of functions, Oxford Univ. Press, London, 1960. · Zbl 0005.21004 [14] Taro Yoshizawa, Stability theory by Liapunov’s second method, Publications of the Mathematical Society of Japan, No. 9, The Mathematical Society of Japan, Tokyo, 1966.
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:
skip to main content

Superconductivity in La2Ni2In
We report here the properties of single crystals of La 2 Ni 2 In . Electrical resistivity and specific heat measurements concur with the results of density functional theory calculations, finding that La 2 Ni 2 In is a weakly correlated metal, where the Ni magnetism is almost completely quenched, leaving only a weak Stoner enhancement of the density of states. Superconductivity is observed at temperatures below 0.9 K. A detailed analysis of the field and temperature dependencies of the resistivity, magnetic susceptibility, and specific heat at the lowest temperatures reveals that La 2 Ni 2 In is a dirty type-II superconductor with likely s -wave gap symmetry. Nanoclusters of ferromagnetic inclusions significantly affect the subgap states resulting in a nonexponential temperature dependence of the specific heat C ( T ) at T ≪ T c .
Authors:
; ; ;
Award ID(s):
Publication Date:
NSF-PAR ID:
10299922
Journal Name:
Physical review
Volume:
102
Page Range or eLocation-ID:
165125
ISSN:
2470-0010
Sponsoring Org:
National Science Foundation
##### More Like this
1. A phase transition material, VO 2 , with a semiconductor-to-metal transition (SMT) near 341 K (68 °C) has attracted significant research interest because of drastic changes in its electrical resistivity and optical dielectric properties. To address its application needs at specific temperatures, tunable SMT temperatures are highly desired. In this work, effective transition temperature ( T c ) tuning of VO 2 has been demonstrated via a novel Pt : VO 2 nanocomposite design, i.e. , uniform Pt nanoparticles (NPs) embedded in the VO 2 matrix. Interestingly, a bidirectional tuning has been achieved, i.e. , the transition temperature can be systematically tunedmore »
2. Abstract The origin of the weak insulating behavior of the resistivity, i.e. $${\rho }_{xx}\propto {\mathrm{ln}}\,(1/T)$$ ρ x x ∝ ln ( 1 / T ) , revealed when magnetic fields ( H ) suppress superconductivity in underdoped cuprates has been a longtime mystery. Surprisingly, the high-field behavior of the resistivity observed recently in charge- and spin-stripe-ordered La-214 cuprates suggests a metallic, as opposed to insulating, high-field normal state. Here we report the vanishing of the Hall coefficient in this field-revealed normal state for all $$T\ <\ (2-6){T}_{{\rm{c}}}^{0}$$ T < ( 2 − 6 ) T c 0 , where $${T}_{{\rm{c}}}^{0}$$more »
3. To directly use a CO 2 –CH 4 gas mixture for power and CO co-production by proton-conducting solid oxide fuel cells (H-SOFCs), a layer of in situ reduced La 0.6 Sr 0.2 Cr 0.85 Ni 0.15 O 3−δ (LSCrN@Ni) is fabricated on a Ni–BaZr 0.1 Ce 0.7 Y 0.1 Yb 0.1 O 3−δ (BZCYYb) anode-supported H-SOFC (H-DASC) for on-cell CO 2 dry reforming of CH 4 (DRC). For demonstrating the effectiveness of LSCrN@Ni, a cell without adding the LSCrN@Ni catalyst (H-CASC) is also studied comparatively. Fueled with H 2 , both H-CASC and H-DASC show similar stable performance with amore »
4. Abstract. Ice-nucleating particles (INPs) are efficiently removed fromclouds through precipitation, a convenience of nature for the study of thesevery rare particles that influence multiple climate-relevant cloudproperties including ice crystal concentrations, size distributions andphase-partitioning processes. INPs suspended in precipitation can be used toestimate in-cloud INP concentrations and to infer their originalcomposition. Offline droplet assays are commonly used to measure INPconcentrations in precipitation samples. Heat and filtration treatmentsare also used to probe INP composition and size ranges. Many previousstudies report storing samples prior to INP analyses, but little is knownabout the effects of storage on INP concentration or their sensitivity totreatments. Here,more »
5. Modern day data centers are operated at high power for increased power density, maintenance, and cooling which covers almost 2 percent (70 billion kilowatt-hours) of the total energy consumption in the US. IT components and cooling system occupy the major portion of this energy consumption. Although data centers are designed to perform efficiently, cooling the high-density components is still a challenge. So, alternative methods to improve the cooling efficiency has become the drive to reduce the cooling cost. As liquid cooling is more efficient for high specific heat capacity, density, and thermal conductivity, hybrid cooling can offer the advantage ofmore »


text:
mersenneforum.org Resuming L-L with a clean hard drive
 Register FAQ Search Today's Posts Mark Forums Read

 2004-12-31, 23:51 #1 Unregistered   492710 Posts Resuming L-L with a clean hard drive I was peacably testing 2070457. According the assignment file, Gimps checked my progress about 4:10 yesterday morning and found I was at iteration 2 million +. When I came to the computer after breakfast, my hard drive was dead (I trust entirely coincidentally!). Anyway I have a new hard drive installed. How do resume testing my number, preferably not at the beginning? Thanks!
2005-01-01, 00:46   #2
Xyzzy

"Mike"
Aug 2002

27×61 Posts

I hope you have a backup!

This is one reason I use "InterimFiles" every 1e6 iterations... I then back up the interim files periodically...

Quote:
 You can have the program generate save files every n iterations. The files will have a .XXX extension where XXX equals the current iteration divided by n. In prime.ini enter: InterimFiles=n
If you have a backup there will be a regular save file and a backup save file as well...

Worst case you can restart your work by recreating the worktodo.ini file...

 2005-01-01, 00:59 #3 Xyzzy     "Mike" Aug 2002 27×61 Posts Assuming this is you: Code: 27070457 68 2056703 11.3 37.2 86.2 30-Dec-04 04:48 20-Dec-04 17:22 danjmi CA3C1D458 Then (I think!) you want this in your worktodo.ini file: Code: Test=27070457,68,0
 2005-01-01, 01:25 #4 markr     "Mark" Feb 2003 Sydney 10001011112 Posts Mmm, the boundary between 67 & 68 is 28130000, so the line in your worktodo.ini should be Code: Test=27070457,67,0
 2005-01-01, 04:24 #5 Mike   May 2004 Vancouver, Canada 22×52 Posts Not necessarly... The exponent might have been factored up to 2^68, therefore it's better to stick to what Primenet is telling us, which is 68.
 2005-01-01, 05:46 #6 markr     "Mark" Feb 2003 Sydney 13×43 Posts Unfortunately Primenet is misleading us. The user report or status.txt "fact bits" is one higher than the TF level if a p-1 test has been done. I'm pretty sure I read some post saying that it actually adds 0.5 internally, and then the report rounds up... Anyway, for the machine I'm on now, the worktodo.ini has Test=17813597,65,1 but my user report has 17813597 66 8958364 67.9 12.0 72.0 29-Dec-04 04:27 22-Oct-04 06:14 new Also, the latest nofactor file has no 27M exponents TF'd above 2^67, although it's not as current as a primenet report. It won't affect anything anyway, since the p-1 step has been done. Last fiddled with by markr on 2005-01-01 at 05:50
 2005-01-05, 14:16 #7 garo     Aug 2002 Termonfeckin, IE 2×5×251 Posts So the correct worktodo entry is: Test=27070457,67,1

 Similar Threads Thread Thread Starter Forum Replies Last Post EdH Hardware 10 2017-02-13 19:25 TheMawn Lounge 32 2013-10-12 06:06 jasong Information & Answers 7 2007-11-16 02:41 ixfd64 Hardware 8 2004-06-03 20:37 delta_t Software 4 2003-06-26 13:54

All times are UTC. The time now is 04:40.

Thu Nov 26 04:40:16 UTC 2020 up 77 days, 1:51, 3 users, load averages: 1.15, 1.29, 1.49


text:
Home OALib Journal OALib PrePrints Submit Ranking News My Lib FAQ About Us Follow Us+
 Title Keywords Abstract Author All
Search Results: 1 - 10 of 100 matches for " "
 Page 1 /100 Display every page 5 10 20 Item
 High Energy Physics - Phenomenology , 2008, Abstract: We analyze baryon number, strangeness and electric charge fluctuations as well as their correlations in QCD at high temperature. We present results obtained from lattice calculations performed with an improved staggered fermion action (p4-action) at two values of the lattice cut-off with almost physical up and down quark masses and a physical value for the strange quark mass. We compare these results, with an ideal quark gas at high temperature and a hadron resonance gas model at low temperature. We find that fluctuations and correlations are well described by the former already for temperatures about 1.5 times the transition temperature. At low temperature qualitative features of the lattice results are quite well described by a hadron resonance gas model. Higher order cumulants, which become increasingly sensitive to the light pions, however show deviations from a resonance gas in the vicinity of the transition temperature.
 Physics , 2008, DOI: 10.1103/PhysRevD.79.074505 Abstract: We analyze baryon number, strangeness and electric charge fluctuations as well as their correlations in QCD at high temperature. We present results obtained from lattice calculations performed with an improved staggered fermion action (p4-action) at two values of the lattice cut-off with almost physical up and down quark masses and a physical value for the strange quark mass. We compare these results, with an ideal quark gas at high temperature and a hadron resonance gas model at low temperature. We find that fluctuations and correlations are well described by the former already for temperatures about 1.5 times the transition temperature. At low temperature qualitative features of the lattice results are quite well described by a hadron resonance gas model. Higher order cumulants, which become increasingly sensitive to the light pions, however show deviations from a resonance gas in the vicinity of the transition temperature.
 Physics , 2012, DOI: 10.1103/PhysRevD.86.034509 Abstract: We calculate the quadratic fluctuations of net baryon number, electric charge and strangeness as well as correlations among these conserved charges in (2+1)-flavor lattice QCD at zero chemical potential. Results are obtained using calculations with tree level improved gauge and the highly improved staggered quark (HISQ) actions with almost physical light and strange quark masses at three different values of the lattice cut-off. Our choice of parameters corresponds to a value of 160 MeV for the lightest pseudo scalar Goldstone mass and a physical value of the kaon mass. The three diagonal charge susceptibilities and the correlations among conserved charges have been extrapolated to the continuum limit in the temperature interval 150 MeV
 Physics , 2007, Abstract: We present results on bulk thermodynamic quantities as well as net baryon number, strangeness and electric charge fluctuations in QCD at non-zero density and temperature obtained from lattice calculations with almost physical quark masses for two values of the lattice cut-off $aT=1/4$ and 1/6 . We show that with our improved p4fa3-action the cut-off effects are under control when using lattices with a temporal extent of 6 or larger and that the contribution to the equation of state, which is due to a finite chemical potential is small for $\mu_q/T<1$. Moreover, at vanishing chemical potential, i.e. under conditions almost realized at RHIC and the LHC, quartic fluctuations of net baryon number and strangeness are large in a narrow temperature interval characterizing the transition region from the low to high temperature phase. At non-zero baryon number density, strangeness fluctuations are enhanced and correlated to fluctuations of the net baryon number. If strangeness is furthermore forced to vanish, as it may be the case in systems created in heavy ion collisions, strangeness fluctuations are significantly smaller than baryon number fluctuations.
 Physics , 2012, DOI: 10.1142/S0218301312500280 Abstract: We study the strangeness production in hot and dense nuclear medium, by requiring the conservation of the baryon density, electric charge fraction and zero net strangeness. The hadronic equation of state is investigated by means of an effective relativistic mean field model, with the inclusion of the full octet of baryons and kaon mesons. Kaons are considered taking into account of an effective chemical potential depending on the self-consistent interaction between baryons. The obtained results are compared with a minimal coupling scheme, calculated for different values of the anti-kaon optical potential and with non-interacting kaon particles. In this context, we also consider the possible onset of the kaon condensation for a wide range of temperatures and baryon densities.
 Physics , 2006, DOI: 10.1103/PhysRevC.74.064911 Abstract: Event-by-event fluctuations of the net baryon number and electric charge in nucleus-nucleus collisions are studied in Pb+Pb at SPS energies within the HSD transport model. We reveal an important role of the fluctuations in the number of target nucleon participants. They strongly influence all measured fluctuations even in the samples of events with rather rigid centrality trigger. This fact can be used to check different scenarios of nucleus-nucleus collisions by measuring the multiplicity fluctuations as a function of collision centrality in fixed kinematical regions of the projectile and target hemispheres. The HSD results for the event-by-event fluctuations of electric charge in central Pb+Pb collisions at 20, 30, 40, 80 and 158 A GeV are in a good agreement with the NA49 experimental data and considerably larger than expected in a quark-gluon plasma. This demonstrate that the distortions of the initial fluctuations by the hadronization phase and, in particular, by the final resonance decays dominate the observable fluctuations.
 Physics , 2010, DOI: 10.1088/1742-6596/230/1/012012 Abstract: We compare recent lattice results on fluctuations and correlations of strangeness, baryon number and electric charge obtained with p4 improved staggered action with the prediction of hadron resonance gas model. We show that hadron resonance gas can describe these fluctuations reasonably well if the hadron properties are as calculated on the lattice.
 High Energy Physics - Phenomenology , 2007, DOI: 10.1088/0954-3899/34/7/010 Abstract: We investigate, at both zero and finite temperature, the properties of strangelets versus the electric charge Z and strangeness S. The strangelet radius is not a monotonic function of either charge or strangeness, and a minimum is reached in the (Z, S) plane. However, the thermodynamically stable strangelets do not correspond to the radius minimum. The minimum radius always appears at positive strangeness, while the stable radius may appear at negative strangeness for very small baryon numbers. For large baryon numbers, the stable radius is proportional to the cubic root of baryon numbers, but inversely proportional to the square root of the confinement parameter in the present model. If bulk strange quark matter is absolutely stable, the reduced size of strangelets is about 1 fm, which may be relevant for the analysis of the strangelet production and detection.
 Physics , 2013, DOI: 10.1103/PhysRevLett.111.082301 Abstract: Appropriate combinations of up to fourth order cumulants of net strangeness fluctuations and their correlations with net baryon number and electric charge fluctuations, obtained from lattice QCD calculations, have been used to probe the strangeness carrying degrees of freedom at high temperatures. For temperatures up to the chiral crossover separate contributions of strange mesons and baryons can be well described by an uncorrelated gas of hadrons. Such a description breaks down in the chiral crossover region, suggesting that the deconfinement of strangeness takes place at the chiral crossover. On the other hand, the strangeness carrying degrees of freedom inside the quark gluon plasma can be described by a weakly interacting gas of quarks only for temperatures larger than twice the chiral crossover temperature. In the intermediate temperature window these observables show considerably richer structures, indicative of the strongly interacting nature of the quark gluon plasma.
 Physics , 2014, DOI: 10.1103/PhysRevLett.113.052301 Abstract: Recent results for moments of multiplicity distributions of net-protons and net-electric charge from the STAR collaboration are compared to lattice QCD results for higher order fluctuations of baryon number and electric charge by the Wuppertal-Budapest collaboration, with the purpose of extracting the freeze-out temperature and chemical potential. All lattice simulations are performed for a system of 2+1 dynamical quark flavors, at the physical mass for light and strange quarks; all results are continuum extrapolated. We show that it is possible to extract an upper value for the freeze-out temperature, as well as precise baryo-chemical potential values corresponding to the four highest collision energies of the experimental beam energy scan. Consistency between the freeze-out parameters obtained from baryon number and electric charge fluctuations is found. The freeze-out chemical potentials are now in agreement with the statistical hadronization model.
 Page 1 /100 Display every page 5 10 20 Item


text:
# zbMATH — the first resource for mathematics

On distributions of order statistics for absolutely continuous copulas with applications to reliability. (English) Zbl 1180.60013
Two main results are given concerning the marginal distribution functions of order statistics that are based on $$n$$ dependent standard uniform random variables having a joint absolutely continuous distribution (i.e. whose joint distribution function is an absolutely continuous copula). Specifically, Theorem 2 gives necessary and sufficient conditions that ensure that a vector of distribution functions $$(G_1,G_2,\dots,G_n)$$ corresponds to the vector of distribution functions of consecutive order statistics. Theorem 4 characterizes a univariate distribution function $$G$$ as the distribution function of a given order statistics. The presented problems are connected with the study of coherent systems in reliability theory.

##### MSC:
 60E05 Probability distributions: general theory 62G30 Order statistics; empirical distribution functions 62H05 Characterization and structure theory for multivariate probability distributions; copulas 62N05 Reliability and life testing
Full Text:
##### References:
 [1] Barlow R. E., Proschan F.: Mathematical Theory of Reliability. Wiley, New York 1965 · Zbl 0874.62111 [2] Barlow R. E., Proschan F.: Statistical Theory of Reliability and Life Testing. Probability Models. Holt, Rinehart and Winston, New York 1975 · Zbl 0379.62080 [3] Bassan B., Spizzichino F.: Relations among univariate aging, bivariate aging and dependence for exchangeable lifetimes. J. Multivariate Anal. 93 (2005), 313-339 · Zbl 1070.60015 · doi:10.1016/j.jmva.2004.04.002 [4] Boland P. J., Samaniego F. J.: The signature of a coherent system and its applications in reliability. Mathematical Reliability Theory: An Expository Perspective (R. Soyer, T. Mazzuchi, and N. Singpurwalla, Kluwer Academic Publishers, Boston 2004, pp. 1-29 [5] David H. A., Nagaraja H. N.: Order Statistics. Third edition. Wiley, Hoboken, NJ 2003 · Zbl 1053.62060 · doi:10.1002/0471722162 [6] Durante F., Jaworski P.: Absolutely continuous copulas with given diagonal sections. Comm. Statist. Theory Methods 37 (2008), 18, 2924-2942 · Zbl 1292.60019 · doi:10.1080/03610920802050927 [7] Durante F., Kolesárová A., Mesiar, R., Sempi C.: Copulas with given diagonal sections: novel constructions and applications. Internat. J. Uncertainty, Fuzziness, and Knowledge-Based Systems 15 (2007), 397-410 · Zbl 1158.62324 · doi:10.1142/S0218488507004753 [8] Durante F., Mesiar, R., Sempi C.: On a family of copulas constructed from the diagonal section. Soft Comput. 10 (2006), 490-494 · Zbl 1098.60016 · doi:10.1007/s00500-005-0523-7 [9] Galambos J.: The role of exchangeability in the theory of order statistics. Exchangeability in Probability and Statistics (G. Koch and F. Spizzichino, North-Holland, Amsterdam 1982, pp. 75-87 · Zbl 0505.62027 [10] Genest C., Quesada-Molina J. J., Rodríguez-Lallena J. A., Sempi C.: A characterization of quasi-copulas. J. Multivariate Anal. 69 (1999), 193-205 · Zbl 0935.62059 · doi:10.1006/jmva.1998.1809 [11] Jaworski P.: On uniform tail expansions of multivariate copulas and wide convergence of measures. Appl. Math. 33 (2006), 159-184 · Zbl 1102.62053 · doi:10.4064/am33-2-3 [12] Jaworski P.: On copulas and their diagonals. Inform. Sci., to appear · Zbl 1171.62332 · doi:10.1016/j.ins.2008.09.006 [13] Joe H.: Multivariate Models and Dependence Concepts. Chapman & Hall, London 1997 · Zbl 0990.62517 [14] Kochar S., Mukerjee, H., Samaniego F. J.: The “signature” of a coherent system and its application to comparisons among systems. Naval Res. Logist. 46 (1999), 507-523 DOI 10.1002/(SICI)1520-6750(199908)46:53.0.CO;2-D | · Zbl 0948.90067 · doi:10.1002/(SICI)1520-6750(199908)46:5<507::AID-NAV4>3.0.CO;2-D [15] Lai C. D., Xie M.: Stochastic Ageing and Dependence for Reliability. Springer-Verlag, New York 2006 · Zbl 1098.62130 [16] Mesiar R., Sempi C.: Ordinal sums and idempotents of copulas. Aequationaes Math., to appear · Zbl 1205.62063 · doi:10.1007/s00010-010-0013-6 [17] Navarro J., Rychlik T.: Reliability and expectation bounds for coherent systems with exchangeable components. J. Multivariate Anal. 98 (2007), 102-113 · Zbl 1102.62111 · doi:10.1016/j.jmva.2005.09.003 [18] Navarro J., Samaniego F. J., Balakrishnan, N., Bhattacharya D.: On the application and extension of system signatures in engineering reliability. Nav. Res. Logist. 55 (2008), 314-326 · Zbl 1153.90386 · doi:10.1002/nav.20285 [19] Nelsen R. B.: An Introduction to Copulas. (Lecture Notes in Statistics 139.) Springer, New York 1999 · Zbl 1152.62030 · doi:10.1007/978-1-4757-3076-0_1 [20] Rychlik T.: Bounds for expectation of $$L$$-estimates for dependent samples. Statistics 24 (1993), 1-7 · Zbl 0808.62048 · doi:10.1080/02331888308802385 [21] Rychlik T.: Distributions and expectations of order statistics for possibly dependent random variables. J. Multivariate Anal. 48 (1994), 31-42 · Zbl 0790.62048 · doi:10.1016/0047-259X(94)80003-E [22] Samaniego F. J.: On closure of the IFR class under formation of coherent systems. IEEE Trans. Reliab. R-34 (1985), 69-72 · Zbl 0585.62169 · doi:10.1109/TR.1985.5221935 [23] Sklar A.: Fonctions de répartition à $$n$$ dimensions et leurs marges. Publ. Inst. Statist. Univ. Paris 8 (1959), 229-231 · Zbl 0100.14202 [24] Spizzichino F.: Subjective probability models for lifetimes. (Monographs on Statistics and Applied Probability 91.) Chapman and Hall/CRC, Boca Raton 2001 · Zbl 1078.62530 [25] Spizzichino F.: The role of symmetrization and signature for systems with non-exchangeable components. Advances in Mathematical Modelling for Reliability (T. Bedford, J. Quigley, L. Walls, B. Alkali, A. Daneshkhah, and G. Hardman, IOS Press, Amsterdam 2008, pp. 138-148
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:
# C++ Program to get string typed in different keyboard layout

C++Server Side ProgrammingProgramming

Suppose we have two string S and T, and another string R. There are two popular keyboard layouts represented in S and T, they differ only in letters positions. All the other keys are the same. In S and T, all keys of the first and the second layouts in the same order. R may have digits also. It is known that it was typed in the first layout, but the writer intended to type it in the second layout. We have to find the string maintaining the second layout. (Since all keys but letters are the same in both layouts, the capitalization of the letters should remain the same, as well as all other non-alphabetic characters).

## Problem Category

To solve this problem, we need to manipulate strings. Strings in a programming language are a stream of characters that are stored in a particular array-like data type. Several languages specify strings as a specific data type (eg. Java, C++, Python); and several other languages specify strings as a character array (eg. C). Strings are instrumental in programming as they often are the preferred data type in various applications and are used as the datatype for input and output. There are various string operations, such as string searching, substring generation, string stripping operations, string translation operations, string replacement operations, string reverse operations, and much more. Check out the links below to understand how strings can be used in C/C++.

https://www.tutorialspoint.com/cplusplus/cpp_strings.htm

https://www.tutorialspoint.com/cprogramming/c_strings.htm

So, if the input of our problem is like S = "qwertyuiopasdfghjklzxcvbnm"; T = "veamhjsgqocnrbfxdtwkylupzi"; R = "helloworld87nicecoding", then the output will be "xawwqeqmwr87zglalqrgzf"

## Steps

To solve this, we will follow these steps −

res := an empty string
for initialize i := 0, when R[i] is not equal to 0, update (increase i by 1), do:
x := 0
for initialize j := 0, when j < 26, update (increase j by 1), do:
if R[i] is same as S[j], then:
res := res + T[j]
x := 1
Come out from the loop
otherwise when R[i] + 32 is same as S[j], then:
k := T[j] - 32
res := res + k
x := 1
Come out from the loop
if x is same as 0, then:
res := res + R[i]
return res

## Example

Let us see the following implementation to get better understanding −

#include <bits/stdc++.h>
using namespace std;
string solve(string S, string T, string R){
int x;
string res = "";
for (int i = 0; R[i] != 0; i++){
x = 0;
for (int j = 0; j < 26; j++){
if (R[i] == S[j]){
res += T[j];
x = 1;
break;
}
else if (R[i] + 32 == S[j]){
char k = T[j] - 32;
res += k;
x = 1;
break;
}
}
if (x == 0)
res += R[i];
}
return res;
}
int main(){
string S = "qwertyuiopasdfghjklzxcvbnm";
string T = "veamhjsgqocnrbfxdtwkylupzi";
string R = "helloworld87nicecoding";
cout << solve(S, T, R) << endl;
}

## Input

"qwertyuiopasdfghjklzxcvbnm", "veamhjsgqocnrbfxdtwkylupzi",
"helloworld87nicecoding"

## Output

xawwqeqmwr87zglalqrgzf
Updated on 08-Apr-2022 11:20:18


text:
# Practical Foundations of Mathematics

## 3.5  Products and Function-Spaces

Examples 2.1.4 and 2.1.7 gave recipes for the type constructors ® and +, for sets and functions. In Section 2.3 we gave type-theoretic rules for these, and promised that we would find interpretations of them in other mathematical structures. We shall now do this with posets and domains. The sum of posets or domains is formed in the obvious way, as a disjoint union, ie the components are incomparable, so we concentrate on products and function-spaces.

Products of posets, domains, lattices and diagrams

PROPOSITION 3.5.1 Let (X, £ X) and (Y, £ Y) be preorders. We equip the cartesian product XxY with the componentwise order:

x1,y1 £ Xx Yx2,y2    if    x1 £ Xx2 and y1 £ Yy2.

Then this makes XxY a preorder too. Also

(a)
the projections p0:x,y® x and p1:x,y® y are monotone;

(b)
if a:G® X and b:G® Y are monotone functions then so is the function a,b:G® Xx Y defined by a(-),b(-);

(c)
a function p:XxY® Z is (jointly) monotone iff it is monotone in each argument, for each constant value of the other;

(d)
if X and Y are posets, ie their order relations £ X and £ Y are antisymmetric, then Xx Y is also a poset. []

The corresponding result for domains applies equally well to semilattices, lattices, Heyting (semi)lattices and complete (semi)lattices, so we state it for individual diagram shapes. We shall consider part (c) later.

PROPOSITION 3.5.2 Let X and Y be preorders and Á a diagram shape.

(a)
Let x(-),y(-):Á® XxY be a diagram. Then the joins
 (Xx Y) Ú i Î Á xi,yi = X Ú i Î Á xi, Y Ú i Î Á yi
coincide in the sense that if one exists then so does the other, and then they are equal.

(b)
If X and Y have all joins of shape Á then so does XxY.

(c)
The projections p0:x,y® x and p1:x,y® y preserve joins.

(d)
If a:G® X and b:G® Y preserve joins of shape Á then so does the pair a,b:G® XxY.

PROOF: In (a), q,f is an upper bound for the set of pairs iff q bounds the first components and f the second. Hence q,f is least (or locally least or mimimal) iff both q and f are. The other parts follow. []

COROLLARY 3.5.3 If X and Y are dcpos or ipos then so is XxY, the projections are Scott-continuous and pairing preserves continuity. []

Products of diagrams are used to handle multiple suffixes. Doubly indexed joins can be rearranged, as may doubly indexed meets, but Example  3.5.14 shows that meets cannot be interchanged with joins.

LEMMA 3.5.4 Let x(-),( = ):Áx J® X be a diagram. If either the expression on the left or that on the right is defined in

 Ú i Î Á Ú j Î J xi,j = Ú -20mui ,j Î Áx J-20mu xi,j = Ú j Î J Ú i Î Á xi,j,
then so is the one in the middle and then they are equal.

PROOF: Assuming that the intermediate joins exist, for q Î X,

 æè "i.  q ³ Ú j Î J xi,j öø Û æè "i,j.  q ³ xi,j öø Û æè "j.  q ³ Ú i Î Á xi,j öø
and each of these is equivalent to q lying above the corresponding join. Substituting each of the three joins for q, they must be equal. []

Pointwise meets and joins

PROPOSITION 3.5.5 Let Y be a preorder and f,g:X® Y be functions (the order, if any, on X is unimportant). Then the pointwise order between f and g is given by

f £ [X® Y] g    if    "x: X.f(x) £ Yg(x).

The preorder of monotone functions from X to Y is written [X® Y] or YX and is called the function-space. Then

(a)
ev:[X® Y]x X® Y, given by f,x® f(x), is monotone;

(b)
if p:GxX® Y is monotone then so is \expx p:G® [X® Y], defined by lx.p (-,x);

(c)
[X® Y] is a poset, ie the pointwise order is antisymmetric, if Y is.

PROOF:

(a)
[[a]] If f,x1 £ g,x2 then f £ g and x1 £ x2, so using the pointwise order, monotonicity and transitivity, we have a square omitted diagram environment

(b)
[[b]] Joint monotonicity implies separate.

(c)
[[c]] f £ g £ f iff "x: X.f(x) £ Y g(x) £ Y f(x) whilst f = g iff "x: X.f(x) = g(x) . []

EXAMPLES 3.5.6

(a)
[X ® W], where X is a set with the discrete order and W is the type of propositions, is isomorphic to the powerset P(X) under inclusion.

(b)
[Xop® W], where X is a poset, is isomorphic to shv(X), the lattice of lower sets (Definition 3.1.7).

(c)
Similarly [X ® W]op is the lattice of upper sets (Example 3.1.6(f)).

(d)
[X® LiftY], where X and Y are (discrete) sets and LiftY carries the information order (Definition  3.3.7), is isomorphic to the poset of partial functions X\rightharpoonup Y with the extension order (Definition  3.3.3).

LEMMA 3.5.7 Let \funf(-):Á® [X® Y]. If the joins on the right of

 [X® Y] Ú i Î Á \funfi = lx. Y Ú i Î Á \funfi(x)
exist then so does the join on the left, and the equation holds.

PROOF:

(a)
If we have {\funfi|i:Á} £ q (in particular if the function q is the join) then each set { \funfi(x)|i:Á} has an upper bound, namely q(x):
 if \$q."x."i.\funfi(x) £ q(x) then "x.\$u."i.\funfi(x) £ u.

(b)
The function p:x® Ú\Xi Î Á(\funfi(x )), if it exists, is monotone, because if x¢ £ x then " i.\funfi(x¢) £ \funfi(x) £ p(x) and so since p(x¢) is the least upper bound we have p(x¢) £ p(x). It follows that p is the join of the functions. []

REMARK 3.5.8

(a)
However, knowing that there is some {\funfi(x)|i: Á} £ \argux for each x Î X is not sufficient to give a bound for the set of functions, because x® \argux need not be monotone. Indeed we need the axiom of choice (Definition  1.8.8) even to make this exist as a function.

That part (b) above works and this doesn't illustrates the value of unique ness, cf Lemma 1.2.11; ``locally least'' may be good enough, but inserting ``minimal'' doesn't help. omitted diagram environment

(b)
Let q be a monotone upper bound of the two functions illustrated, so q(1) = f(1) = g(1), but q(0) must also take this value. This constant function is therefore the least upper bound in the function-space, but as q(0)\not £ u it is not the pointwise least upper bound. []

COROLLARY 3.5.9 Let Y be a poset with all joins of shape Á.

(a)
Then [X® Y] also has all joins of shape  Á , computed pointwise;

(b)
ev(-,x) preserves them for each x;

(c)
of course ev(f,-) º f preserves them iff f does;

(d)
for p:GxX® Y, if p(-,x) preserves such joins for each x Î X then so does \expx p:G ® [X® Y] by lx.p(-,x). []

So far we have been discussing the poset of all monotone functions, which is not what we want for domains. Abusing notation, we also write [X® Y] for the poset of Scott-continuous functions from X to Y, with the pointwise order, X and Y now being dcpos. Recall that pointwise joins gave joins of functions.

PROPOSITION 3.5.10 The same holds with [X® Y] reinterpreted to consist only of continuous functions. In particular, [X® Y] is a dcpo, and an ipo with ^[X® Y] = lx.^Y if ^Y exists.

PROOF: From Lemma 3.5.4, if each \funfj preserves Á-indexed joins (for each j Î J), and Új\funfj exists pointwise, then it too preserves Á- indexed joins. Moreover it is the join amongst join-preserving functions. []

Beware that we have not said that ev:[X® Y]xX® Y preserves joins.

Joint continuity   Proposition 3.5.2 stated the properties of products of domains analogous to the result preceding it, apart from part  3.5.1(c). This deserves special consideration.

EXAMPLE 3.5.11 The function f:RxR® R defined by

 f(x,y) = 2 x y x2+y2        except for f(0,0) = 0
is continuous in x for each fixed value of y and vice versa , but it is not continuous at (0,0) as a function of two variables. []

There are several ways of reacting to this; in particular Exercise  3.20 shows what is missing in the case of binary meets or joins. For directed joins it turns out that the difficulty does not arise, but perhaps this just shows the poverty of order-theoretic representations of semantics.

LEMMA 3.5.12 The product of two directed, semidirected or confluent (Definition  3.4.1) posets has the same property. Moreover the diagonal function Á® ÁxÁ is cofinal ( Proposition 3.2.10) iff Á is semidirected, whilst the function Á® {*} is cofinal iff Á is inhabited. []

COROLLARY 3.5.13 A function f:Xx Y® Z of two arguments between dcpos is (jointly) continuous iff it is separately continuous. In particular ev:[X® Y]xX® Y is jointly continuous.

PROOF: Let Á be a directed diagram. Since Á® Áx Á is cofinal by Lemma 3.5.4 we have

 \dirsupdisplayixi,yi = \dirsupdisplayi,jxi,yj = \dirsupdisplayixi,\dirsupdisplayjyj
and separate continuity of f(-,Ú yj) and f(xi,-) gives
 f æè \dirsupdisplayixi,\dirsupdisplayjyj öø = \dirsupdisplayi f æè xi,\dirsupdisplayjyj öø = \dirsupdisplayi\dirsupdisplayj f(xi,yj),
whence joint continuity follows by cofinality again. []

We may compute binary meets pointwise if they commute with directed joins; a dcpo with this property is called a preframe. Infinite meets in [X® Y] may exist but need not be computed pointwise.

EXAMPLE 3.5.14 Consider X = Y = [0,1] Ì R (the unit interval) and (with J = N) let \funfn:X® Y by \funfn(x) = xn. The pointwise meet is discontinuous at 1 in both the Cauchy and Scott senses; the constantly 0 function is the meet in the function-space. []

It is common for function-spaces to inherit the properties of the target domain, irrespective of the source, because the function-space is often a subalgebra of a product. We have shown that this is the case for the existence of various classes of joins (see also Exercise 3.21), but there are simple counterexamples to this behaviour for the trichotomy property.

Scott's thesis   The origin of the work in these three sections was Dana Scott's unexpected discovery that non-syntactic models of the untyped l-calculus could be constructed from certain topological spaces (1969). These very un-geometrical spaces were algebraic lattices endowed with Scott's topology. Their retracts, known as continuous lattices, also arose from abstract work in topological lattice theory [ GHK+80].

Scott proposed that topological continuity be used as an approximation to computability. There were precedents for this idea in recursion theory around 1955. Yuri Ershov observed the analogy between the lattice of recursively enumerable sets and a topology. The Rice-Shapiro Theorem says that any recursively enumerable set of partial recursive functions ( ie sets of codes such that if one code for a function N\rightharpoonup N belongs to the set then so do all others) is Scott-open. The Myhill-Shepherdson Theorem says that any recursive f:[N\rightharpoonup N]\rightharpoonup [N\rightharpoonup N], as we would write it domain-theoretically, is Scott-continuous.

Christopher Strachey and others applied Scott's work to denotational semantics of programming languages, where the lattice element T was inappropriate. Scott and his followers repeatedly simplified the theory for this new audience, with the result that order theory replaced topology in the formal development. In particular, the term Scott domain came to be applied to any boundedly complete algebraic dcpo X for which \Xfg is countable (Exercise  3.21).

Domain theory can solve, not only fixed point equations (Example  3.3.1), but also type-equations, such as X º [X® X] for the untyped l-calculus. The right hand side may involve any of the type-constructors on ipos in an arbitrarily complicated way, giving a domain of mathematical meanings for objects with functions, case analysis and non-determinism.

Here and in Section 4.7 we interpret the l-calculus , primitive recursion on N and the fixed point operator Y. Gordon Plotkin [Plo77] considered these as a programming language ( PCF), with call-by-name evaluation (Remark 2.3.4). He showed that any program (closed term of type N) whose denotation in IPO is a numeral in LiftN ( ie not ^) terminates with that value, so there is a link back from the semantics to the syntax. This can now be proved by methods like those in Section 7.7.

However, parallel or ( por(yes,^) = yes = por(^,yes)) is also interpreted in IPO, but is not definable in PCF, whose programs execute ``sequentially.'' The tight link is broken for higher order terms, as there exist such terms that can ``recognise'' por as an argument. By adding por and a similar ``existential quantifier'' to PCF, Plotkin was able to extend the correspondence to higher types. Gérard Berry eliminated por with a different notion of ``domain,'' cf Example 4.51, but more complicated examples recur. The sequentiality and ``full abstraction'' problems remained open for two decades; they were solved for PCF in 1994 by Abramsky, Hyland, Jagadeesan and Ong, using games.

Without bounded completeness, function-spaces of algebraic dcpos need not be algebraic. Achim Jung showed that his own L-domains (Exercise 3.34) and Plotkin's SFP domains are the two maximal cartesian closed categories ( ie closed under function-spaces) of algebraic dcpos [Jun90].

The search for cartesian closed or ``convenient'' categories in topology is much older, and equally inconclusive. The function-space SX (where S is the Sierpi\'nski space, Definition 3.4.10) only exists with the properties it should have when X is locally compact, and even when YX exists it need not be locally compact. A famous cartesian closed full subcategory of compact Hausdorff spaces was found by John Kelley [Kel55], and there are other approaches to topology with different notions of function-space. Example  9.4.11(f) shows how a certain generalised function-space first arose geometrically.

Because of the generality of the infinitary joins required in topology, a function may be topologically continuous without being computable. One can add the word ``effective'' throughout the theory, but it seems to me to be very clumsy to bolt together two subjects like this. There ought to be a common axiomatisation, of which the free model would be equivalent to recursion theory, but with another model consisting of certain spaces. Synthetic domain theory abolishes non-computable functions between sets themselves, by refining the underlying logic.

This cannot be done in classical logic, because the extra axioms (such as the Church-Turing thesis) conflict with excluded middle. However, the use of excluded middle so infests existing accounts of mathematical foundations that it was necessary to start from the beginning, although synthetic domain theory is beyond the scope of this book.


text:
# What is the idiomatic way to shift and extend a list by a number of elements?

I have a lists, list, and want shift it right by a given number of elements, m, extending the list by repeating the last element. A form that works is

Drop[#, m]& @ PadRight[#, Length[#] + m, Last[#]]& @ list

which, for

m = 3
list = {3, 0, 7, 2, 1}

gives

{2, 1, 1, 1, 1}

and for

m = 2
list = {3, 8, 2, 7, 1, 6}

gives

{2, 7, 1, 6, 6, 6}

This is what I want, but I wonder if there is a more idiomatic way to accomplish it.

• Perhaps the accepted terminology is different among Mathematica users, but don't you mean you're shifting the list to the left? – David Zhang Jul 6 '15 at 20:46
• @DavidZhang: Yes, indeed! – orome Jul 6 '15 at 20:47

m = 2;

Join[list[[m + 1 ;;]], Table[list[[-1]], {m}]]


text:
# how to show the existence of root for a system of polynomial equations?

I come across a system of polynomial equations. Although I can solve it by Mathematica (numerically), I wonder whether it is possible to prove this root indeed exists. Any general method to do it? For example, $f(x_1,x_2)=0$ ; $g(x_1,x_2)=0$ ; $f$ and $g$ are polynomials of $x_1$ and $x_2$, and I compute an approximate root $(x_1^*,x_2^*)$ by some numerical method. How can I show there indeed exists a root around this approximate calculated root? I just wonder whether there exist some general theories in doing so.

• Real root or complex root? How many equations/unknowns? – Igor Rivin Oct 6 '16 at 10:54
• real and two equations with two unknowns – stephenkk Oct 6 '16 at 11:19
• Could you perhaps tell us the system? In some cases you can guess the exact algebraic solution after you solved the system to high accuracy and then check the algebraic solution in exact arithmetic. Sometimes Smale's Alpha Theory helps. – Moritz Firsching Oct 6 '16 at 13:04


text:
I want to make some VHDL code open source. But before I do, I want to make sure that it is as readable as possible. Things to improve upon could for example be naming and the use of comments.

The code is adding two binary-coded-decimal numbers. The algorithm behind it will come in the documentation. Note that this isn't the default way to add BCD numbers.

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
generic(
--BCD_ADD_DEC_SIZE is the amount of decimal digits. e.g. BCD_ADD_DEC_SIZE = 4 means the highest representable integer is 9999
);
port(
--input and output ports
);
end entity;
signal BCD_a, BCD_b : unsigned(4*BCD_ADD_DEC_SIZE downto 0);
signal BCD_sum : STD_LOGIC_VECTOR(4*BCD_ADD_DEC_SIZE-1 downto 0);
signal BCD_cout : STD_LOGIC;

--increment6: a function to increment a 4 bit STD_LOGIC_VECTOR by 6.
function increment6 (number : STD_LOGIC_VECTOR(3 downto 0)) return STD_LOGIC_VECTOR is
begin
return ((number(3) or number(2) or number(1)) & ((number(2) or number(1)) nand (number(2) nand number(1))) & not(number(1)) & number(0));
end function;

--decrement6: a function to decrement a 4 bit STD_LOGIC_VECTOR by 6.
function decrement6 (number : STD_LOGIC_VECTOR(3 downto 0)) return STD_LOGIC_VECTOR is
begin
return ((number(3) and number(2) and number(1)) & (number(2) xor number(1)) & not(number(1)) & number(0));
end function;
begin

--BCD_SIZE is the amount of binary digits that are needed for the BCD number. Each decimal digit is 4 bits, so 4*BCD_ADD_DEC_SIZE.
constant BCD_SIZE : integer := 4*BCD_ADD_DEC_SIZE;
variable cin : STD_LOGIC;
variable a, b, sum : unsigned(BCD_SIZE downto 0);
begin

--Put the inputs in the variables, add a leading '0' to store a later carry.
a := BCD_a;
b := BCD_b;

--increment every decimal digit of operand b by 6
for i in 0 to BCD_ADD_DEC_SIZE-1 loop
b(4*i+3 downto 4*i) := unsigned(increment6(STD_LOGIC_VECTOR(b(4*i+3 downto 4*i))));
end loop;

--add a, b and the carry_in to form a temporary sum that needs to be corrected
sum := a + b + ("" & cin);

--correction: if the sum of two decimal digits exceeded 9, subtract 6 from the temporary sum
for j in 0 to BCD_ADD_DEC_SIZE-1 loop
if (sum(4*j+4) = (a(4*j+4) xor b(4*j+4))) then
sum(4*j+3 downto 4*j) := unsigned(decrement6(STD_LOGIC_VECTOR(sum(4*j+3 downto 4*j))));
end if;
end loop;

BCD_sum <= STD_LOGIC_VECTOR(sum(BCD_SIZE-1 downto 0));
BCD_cout <= sum(BCD_SIZE);
end if;

--assign outputs. If the sum has a carry out of '1', BCD_add_cout_o will be set to '1'.
end process;
end behavioral;

Overall, its not too bad, but I do have some suggestions for readability. What I like to do is add white-space to make elements line up with each other. For example, for this line:

BCD_add_a_i, BCD_add_b_i : in STD_LOGIC_VECTOR(4*BCD_ADD_DEC_SIZE-1 downto 0);

I'd do something like this:

BCD_add_a_i    : in  STD_LOGIC_VECTOR(4*BCD_ADD_DEC_SIZE-1 downto 0);

I think it makes large blocks of text like that a smidge easier to read.

For the increment/decrement functions, I'd split up the big or/and/nand statements with variables. It ultimately doesn't affect much synthesis-wise, but again makes a bit easier to read. I'd also be consistent on whether you use the '&' operator or 'and' operator, rather than switching throughout the statement.

For this statement:

b(4*i+3 downto 4*i) := unsigned(increment6(STD_LOGIC_VECTOR(b(4*i+3 downto 4*i))));

I'd find a way to make that a little less ugly, but I'm not strictly sure how. It might have to be one of those necessary evil type of things, but cleaning that up would be really nice. Maybe do the SLV/unsigned typecasting within the increment/decrement functions.

I'm not too fond of the sorta-Hungarian notation thing for ports and signals, but that's more a personal thing than a readability thing.

• Exactly the answer I needed. – gilianzz Aug 30 '16 at 12:39
• Note that & is not logical "and", but concatenation. – mkrieger1 Aug 30 '16 at 13:16
• mrkrieger: Yep, you're right, I got C syntax and VHDL syntax confused. – Drew Aug 30 '16 at 16:54

Bug

The cin input is not combined with the a and b inputs of the same cycle, but of the previous cycle.

For example, for the input sequence

a     b     cin
---------------
0010  0000    0
0020  0000    1
0030  0000    0

the output sequence is 0011, 0020, 0030 instead of 0010, 0021, 0030, as I would expect:

Don't confuse signals and variables

Confusion about the behaviour of these two kinds of objects is likely the source of the bug.

--Put the inputs in the variables, […]  -- not quite true
a := BCD_a;
b := BCD_b;

But BCD_a and BCD_b are signals, not variables, so their values are only updated in the next clock cycle. No intermediate signal is used for cin, so it becomes misaligned with the a and b variables.

Unconventional timing

Since there is no internal state on which the outputs depend, the adder could be an entirely combinational circuit and no clock is actually required.

If the circuit should be synchronous to a clock, then it is conventional that the outputs are valid one clock cycle after the inputs, usually by placing registers before the outputs.

In the posted code there are additional registers after some of the inputs, and there is this construct:

process(bcd_add_clk_i)
…
begin
…
bcd_sum <= …;
bcd_cout <= …;
end if;

--assign outputs. …
end process;

This means that bcd_add_sum_o and bcd_add_cout_o get updated when the clock changes (because the assignment is inside the process sensitive to the clock), but not at a rising edge, in other words, at the next falling edge of the clock.

The outputs therefore are delayed by 2½ clock cycles with respect to the inputs, instead of 0 (in the case of combinational logic) or 1 clock cycles, as can be seen in the screenshot above.

What you maybe meant to write was

process(bcd_add_clk_i)
…
begin
…
bcd_sum <= …;
bcd_cout <= …;
end if;
end process;

--assign outputs. […]  -- outside the clock process

or simply

process(bcd_add_clk_i)
…
begin
…
bcd_add_sum_o <= …;  -- no intermediate signal
end if;
end process;

Some comments are simply not needed. For example:

port(
--input and output ports
…
);

The port(); syntax is already a pretty strong suggestion that it contains a list of input and output ports.

Other comments could be made unnecessary by using better names. For example:

--bcd_add_dec_size is the amount of decimal digits. […]

Using the name num_digits would already explain its purpose. (Besides, it makes no sense to have fewer than one digit, so it should be a positive, not an integer.)

Using the bcd_ or bcd_add_ prefixes would be appropriate in a higher level of the design hierarchy in order to distinguish names from similar names that do not belong to the BCD adder. However, inside the BCD adder, there is nothing to distinguish and the prefixes just add noise.

The _i and _o suffixes used for port names are fine, because they distinguish the ports from internal signals. I would not use the _i suffix for the clock, however, because it is clear that it is an input.

I would list the clock individually as the first port (so that it becomes obvious that it is a sequential circuit), instead of grouping it with cin. The two ports may have the same type and direction, but conceptually they are different things.

Use better abstractions

Manipulating bits by hand in order to implement arithmetic functions is error-prone and hard to understand and check for correctness by a human. The numeric_std package defines the operators to let you simply write + 6 and - 6 instead of using the increment6 and decrement6 functions. (Also, converting from unsigned to std_logic_vector and back was not necessary.)

Define some types representing the different kinds of values that occur in the design, and corresponding functions to operate on them. This lets you emphasize what the design accomplishes and reduces the possibilities for errors in details about how it is done, for example when counting the indices of a large bit vector in several places.

Suggested solution

This may seem a bit over-engineered for such a simple design, but chances are that you need to deal with BCD numbers in other places, too. Then you can re-use the types and functions by placing them in a package.

Omitting the type conversions at entity boundaries and only doing them at the very top level will then also simplify individual entities.

This should by synthesizable with any VHDL-93 compiler. I tested it with Cadence RTL Compiler version 14, and apart from 24 fewer flip-flops compared to the original code, there is practically no difference in gate count.

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

generic (
num_digits : integer := 3);
port (
clk : in std_logic;
a_i, b_i : in std_logic_vector(4 * num_digits - 1 downto 0);
cin_i : in std_logic;
sum_o : out std_logic_vector(4 * num_digits - 1 downto 0);
cout_o : out std_logic);
end entity;

subtype bcd_digit is natural range 0 to 9;
type bcd_number is array (num_digits - 1 downto 0) of bcd_digit;

constant bits_per_digit : natural := 4;
subtype bcd_vector is unsigned(bits_per_digit * num_digits - 1 downto 0);

function from_vector (v : bcd_vector) return bcd_number is
variable offset : natural;
variable result : bcd_number;
begin
for digit in bcd_number'range loop
offset := digit * bits_per_digit;
result(digit) := to_integer(
v(offset + bits_per_digit - 1 downto offset));
end loop;

return result;
end function;

function to_vector (num : bcd_number) return bcd_vector is
variable offset : natural;
variable result : bcd_vector;
begin
for digit in bcd_number'range loop
offset := digit * bits_per_digit;
result(offset + bits_per_digit - 1 downto offset) :=
to_unsigned(num(digit), bits_per_digit);
end loop;

return result;
end function;

subtype carry is natural range 0 to 1;

type bcd_sum is record
s : bcd_number;
c : carry;
end record;

function add_numbers (a, b : bcd_number; c : carry) return bcd_sum is
variable result : bcd_sum;
variable digit_sum : natural;
variable ripple : carry := c;
begin
for digit in bcd_number'right to bcd_number'left loop
digit_sum := a(digit) + b(digit) + ripple;
if digit_sum >= 10 then
result.s(digit) := digit_sum - 10;
ripple := 1;
else
result.s(digit) := digit_sum;
ripple := 0;
end if;
end loop;
result.c := ripple;

return result;
end function;

signal a, b : bcd_number;
signal cin : carry;
signal sum : bcd_sum;

begin
a <= from_vector(unsigned(a_i));
b <= from_vector(unsigned(b_i));
cin <= 1 when cin_i = '1' else 0;

process (clk) is
begin
if rising_edge(clk) then


text:
Microsoft is trying to force everybody to update from the old NT4 domain system to the “new” (as in “was new >10 years ago”) Active Directory system. While that’s probably a good idea for most people there are some like me stuck with a working Samba installation that for some reason needs to continue to use NT4 domains.

Getting a Windows computer to join such a domain has become more difficult with Windows 10. Here is what needs to be done (I write this mostly so I can look it up myself):

1. Make sure your samba server is configured to enforce the NT4 (SMB1) login. samba.conf must contain the following entry:
[global]
// other entries here
server max protocol = NT1

2. Install the SMB1 protocol on the Windows computer. This is done using the “Turn Windows Features on or off” dialog (just type this into the start menu). You need to set the check marks for two entries under “SMB 1.0/CIFS File share Support”:
• SMB 1.0/CIFS Client
• SMB 1.0/CIFS Server

I’m not 100% sure whether the latter is required. I haven’t tried it without.

3. Add the following entries to the registry:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]
"DomainCompatibilityMode"=dword:00000001
"DNSNameResolutionRequired"=dword:00000000

You can either add them manually or copy the above to the .reg file and import that into the registry.

4. Reboot the computer to activate these changes.

Now it should be possible to join the Windows 10 computer to the Samba Domain.

Source: Required Settings for Samba NT4 Domains on the Samba Wiki.

Starting with Windows Vista Microsoft has started to take security really serious. That’s a good thing. Unfortunately in typically Microsoft attitude they think they always know best and that the user is an idiot, so it’s best to keep anything dangerous from him.

Fast forward to Windows 10 and the issue at hand:

Windows 10 tries to identify networks and based on that classifies them as private or public. The Windows firewall then changes some settings based on this classification.

Now imagine a computer installed in a special setting that is connected via LAN to some other computers in the same place. Network wise this is an isolated island, there is no connection to any company LAN or the Internet. All computers have fixed IP addresses, so there is no DHCP server involved, and provide network shares to each other.

Unfortunately Windows sees this setup as an unidentified network and classifies it as a public network. This means that many things – in particular network shares – do not work.

And since Microsoft doesn’t trust users to know what they are doing, there is no easy (GUI) way to change this. It used to be possible in Windows 7 but no longer.

So, what can be done? Google turned up lots of different suggestions but the only one that worked for me was this answer on SuperUser.com.

It gives a PowerShell script which I have adjusted to my needs:

Write-Host "current settings:"
Get-NetConnectionProfile |
Where{ $_.InterfaceAlias -eq 'NetworkCardName'} | ForEach {$_
$_|Set-NetConnectionProfile -NetWorkCategory Private } Write-Host "new settings:" Get-NetConnectionProfile | Where{$_.InterfaceAlias -eq 'NetworkCardName'}

Write-Host "Beliebige Taste um fortzufahren..."
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")  It reads all connection profiles, filters for the one that apply to a network adapter with a given name (which I renamed to make it unique) and changes this profile to be private. It then displays the new settings and waits for the user to press a key. In order to work, this script must be started with administrator privileges. Of course, that would have been too simple: Microsoft also by default prevents the execution of PowerShell scripts. Again, that might be a valid security measure but in this situation it’s merely a pain in the lower back. So in order to allow scripts, we need to change this setting as suggested in yet another answer on SuperUser.com: Start PowerShell as administrator and run the following command: set-executionpolicy remotesigned  This allows the execution of local scripts, which is what we want. It also allows remote scripts if those are signed, which isn’t particularly what I want but apparently you can’t get one without the other. Diesmal funktioniert alles [music video] Even after Microsoft abandoned the stupid idea of the Windows 8 start screen and gave us back the start menu in Windows 10 there is still a lot to desire. Of course you can replace the the start menu with a tool like Open Shell (formerly known as Classic Shell) which improves it quite a lot. Or you use a separate launcher like the Portable Apps Launcher. I have switched to Open Shell but I also use JumpFolder to create my own, multiple “Start Menus” using the jump list that every icon on the taskbar has had since Windows 7. Basic usage means that you put the JumpFolder.exe into any directory on your disk, add subdirectories containing shortcuts to the programs you want to start, pin JumpFolder.exe to the Windows taskbar and start it once. After that the jump list of this icon will show you all those shortcuts: (In case you are curious: These shortcuts start Civilization, the original DOs game from 1991, 7 Kingdoms, a Windows game from 1997) and Todolist by Abstract Spoon. I can definitely recommend the games but the todo list is not my favourite, but hey, it’s free.) Note that even though the JumpFolder homepage states that it requires Windows 7, it also works for later Windows versions, including Windows 10. But the number of entries in the jump list is limited (by default to 10 entries which can be increased, but even then, vertical space on a monitor is limited) and it would be nice to have more than one. But there can only be one JumpFolder.exe icon on the taskbar. So, what can be done? Simple: Create a shortcut to JumpFolder.exe itself and pin that shortcut to the taskbar. OK, here are the steps: 1. Create a new directory. 2. Put the JumpFolder.exe file into it 3. Create a shortcut to that executable in the same folder and give it a unique name, e.g. “MyJumpFolder1” 4. Optionally, assign an icon to this shortcut. 5. Pin this shortcut to the taskbar 6. Create subdirectories for categories (e.g. “games” and “tools” and put shortcuts into these subdirectories. 7. Start the shortcut on the taskbar. It will now parse the subdirectories and create a jump list from them. 8. Voila: You have a unique “start menu”. Now rinse and repeat for each additional “start menu” you want. Of course the shortcuts can be for anything, e.g. open a folder or start a program passing it parameters. This way you can create a “start menu” for your music, by putting several shortcuts to your music player into the subdirectories passing it e.g. the directory containing the music files it should play. Eg. for VLC it would look like this: c:\path\to\VLC.exe "c:\path\to\Peter Fox" (The parameter is the directory containing mp3s with music from Peter Fox’ album Stadtaffe“.) My current music “start menu” looks like this: The same principle can also be used to create entries with jump lists in the start menu, but personally I find that a lot less useful. I stumbled upon JumpFolder a few years ago when I was considering writing such a program myself. I’ve even got the source code from back then. But it didn’t keep my interest after I discovered that such a program already exists. Due the the COVID19 pandemic I am currently working from home, using Putty + ssh + Remote Desktop to log into and work on my office PC. For this to work, the office PC must be turned on and booted. So far I have let it running 24h which is really a waste of energy but since sometimes nobody is in the office at all, that was the most fool proof way. Today I have had some time at my hands waiting for an Ubuntu server to finish installing, so I thought about alternatives. • One would have been Wake on LAN (WOL), if the BIOS of my computer supported it, but unfortunately it doesn’t (see edit below). • Waking up using the RTC (real time clock) is actually an option in the BIOS, but that would have woken it up every day rather than just on weekdays. Finally I stumbled upon an article on How-To Geek about “How to Make Your PC Wake From Sleep Automatically“. The Windows Scheduler has an option to wake up the computer to run a task. Note that it works only if the computer wasn’t turned off but rather sent into hibernation. So I set up a task that runs “cmd.exe” with the parameter “/c exit” weekly on Monday to Friday at 7:30. Of course I tested it first with a on time schedule and it worked fine. So now I have sent my office PC into hibernation. We’ll see whether it is available on Monday when I want to log into it. EDIT: It turns out that my office PC supports WOL even though it’s not visible in the BIOS. But the network card properties under Windows have a setting for it: So when I read the hint from Vandrovnik on the international Delphi Praxis forum, I ssh’d into the company intranet and was able to simply wake up my office PC using the wakeonlan tool installed on the remote logon computer: wakeonlan [hardware address] Great, this is much more flexible than I thought. Since Microsoft will end the free support for Windows 7 in January 2020, we are updating all our computers to Windows 10 (I would really have liked to avoid that. Windows 7 is definitely not the best Windows ever but its annoyances are known. Windows 10 started to annoy me with new so called “features” immediately after the installation finished. But hey, that’s what you get when you make a living developing software for this stinking pile of sh*t. sorry excuse for an operating system.) Anyway: As before, when I updated from Windows 8 to Windows 8.1, the Windows 10 update broke my Delphi 6 and 2007 installations. Fortunately my workarounds / fixes for Windows 8.1 also work for Windows 10. Also fortunately I blogged about them so I could look them up. In theory it is simple to install the dotNet 2.0 framework on Windows 10: Just go to “Programs and Features”, select “Turn Windows Features on or off”, set the checkmark for “.NET Framework 3.5 (includes .NET 2.0 and 3.0)”, press OK and let Windows download the necessary files from Windows Update. Unfortunately this only works most of the time. If you are unlucky like me and it doesn’t, you will start an odyssey of downloading installers from Microsoft (which also fail, because they try to download files from Windows Update for whatever reason), using the dism tool and possibly Power Shell to install it offline (both of which failed too in my case) and then either despair or find a reference to the “Missed Features Installer”. When I arrived there, I was very suspicious (and so should you!) of downloading and using such a 3rd party installer. I used the download from Computer Bild not because I think they are the most brilliant computer magazine in Germany (they are not) but at least I trust them not to distribute malware (which is more than I trust the computer magazine CHIP). In addition, I used Virus Total to scan the installer. It gave me a thumbs up, so I was brave enough to run it. Guess what? It worked. I now have a working .NET 3.5 and 2.0 framework on my computer and could finally install the program I actually wanted to install: The AVT Universal Package for accessing a camera. Sometimes your program needs to block the screen saver from automatically kicking in. My use case was that the program was recording data and whenever the screen saver was active, the data was lost (No idea why, it probably had something to do with the way HID is implemented in Windows.) So I was looking for a way to fix that without forcing the user to turn off the screen saver. The methods that used to work under Windows XP no longer work in Windows 7 and later (I don’t care about Vista), so I googled and found this question on StackOverflow. The Windows API functions PowerCreateRequest + PowerSetRequest mentioned in the highest voted answer looked promising. Unfortunately they don’t seem to be available in Delphi (Delphi 2007, which I used for that project, is too old to know them, but I couldn’t find them in Delphi 10.3 either). The first task was therefore to get a function declaration for Delphi. Google didn’t help here which meant that I had to create them myself. Not a big deal: type TPowerCreateRequest = function(_Context: PReasonContext): THandle; stdcall; TPowerSetRequest = function(_Handle: THandle; _RequestType: TPowerRequestType): LongBool; stdcall; TPowerClearRequest = function(_Handle: THandle; _RequestType: TPowerRequestType): LongBool; stdcall;  I prefer loading such functions at runtime rather than the program not starting because some external reference is not avaiable. These functions are exported by kernel32.dll.  FDllHandle := SafeLoadLibrary(kernel32); PowerCreateRequest := GetProcAddress(FDllHandle, 'PowerCreateRequest'); PowerSetRequest := GetProcAddress(FDllHandle, 'PowerSetRequest'); PowerClearRequest := GetProcAddress(FDllHandle, 'PowerClearRequest'); if not Assigned(PowerCreateRequest) or not Assigned(PowerSetRequest) or not Assigned(PowerClearRequest) then raise EOsFunc.Create(_('Could not initialize the PowerXxxxRequest functions from kernel32.'));  Usage is not without its own problems. First, I had to declare the constants and parameters: const POWER_REQUEST_CONTEXT_VERSION = 0; POWER_REQUEST_CONTEXT_DETAILED_STRING = 2; POWER_REQUEST_CONTEXT_SIMPLE_STRING = 1; type PReasonContext = ^TReasonContext; TReasonContext = record Version: ULONG; Flags: DWORD; case Boolean of False: ( SimpleReasonString: PWideChar; ); True: ( Detailed: record LocalizedReasonModule: HMODULE; LocalizedReasonId: ULONG; ReasonStringCount: ULONG; ReasonStrings: PPWideChar; end; ); end; type {$MinEnumSize 4}
TPowerRequestType = (
PowerRequestDisplayRequired = 0,
PowerRequestSystemRequired = 1,
PowerRequestAwayModeRequired = 2,
PowerRequestExecutionRequired = 3);

Now, how do these functions work?

The first thing to do is creating a power request with PowerCreateRequest. This function requires a PReasonContext pointer which must be initialized correctly. The Version and Flags fields are simple: Assign one of the POWER_REQUEST_CONTEXT_xxx constants declared above. But what about the other fields? I decided to go with the simple case, that is: Set Flags to POWER_REQUEST_CONTEXT_SIMPLE_STRING and provide a value for SimpleReasonString.

var
FRequestHandle: THandle;
FContext: TReasonContext;
FReason: array[0..255] of WideChar;
// [...]
FContext.Version := POWER_REQUEST_CONTEXT_VERSION;
FContext.Flags := POWER_REQUEST_CONTEXT_SIMPLE_STRING;
FContext.SimpleReasonString := @FReason;
FRequestHandle := PowerCreateRequest(@FContext);
if FRequestHandle = INVALID_HANDLE_VALUE then
RaiseLastOSError;

Where FReason is an array of WideChar. My tests showed that the TReasonContext record and the reason string it points to must be available through the lifetime of the reason context. If it isn’t, the reason displayed by the powercfg tool (see below) will be corrupted. Therefore I did not use a WideString but a static array.

After the power request has been created, calls to PowerSetRequest and PowerClearRequest are possible.

  Win32Check(PowerSetRequest(FRequestHandle, PowerRequestDisplayRequired));

This call prevents the screen saver from starting automatically. A call to PowerClearRequest supposedly turns that off again (but I haven’t tested it).

I mentioned the powercfg tool above. It’s a Windows command line tool that among other functionality can display processes that have active power requests. e.g.

powercfg /requests
DISPLAY:
[PROCESS] \Device\HarddiskVolume2\Source\dzlib\tests\BlockScreenSaver\BlockScreenSaver.exe
test

SYSTEM:
None.

AWAYMODE:
None.

EXECUTION:
None.

PERFBOOST:
None.

The string “test” is the reason I passed to PowerCreateRequests.

I mentioned that failing to preserver the reason string results in a corrupted message in the display. It looked like this:

powercfg /requests
DISPLAY:
[PROCESS] \Device\HarddiskVolume2\Source\dzlib\tests\BlockScreenSaver\BlockScreenSaver.exe
?a?E?I???↑?E?↑?E?↑?E?↑?E?↑

Note that this tool requires administrator privileges (but power requests don’t).

I have added this code to my dzlib. It’s in u_dzOsUtils. There is also a simple test / demo program BlockScreenSaver.

If you would like to comment on this, go to this post in the international Delphi Praxis forum.

… seems to be the motto of Microsoft.

How else can you explain that a recent update of Windows 7 and Windows 10, that broke older versions of one of our programs (no idea yet what exactly is the problem, but the error code indicates an out of memory error) has different effects.

Windows 7 shows a dialog that the program could not be started and even gives some additional information. But that’s not good enough, the user could be irritated by telling him a program has crashed. So Windows 10 goes a step further and simply does … nothing. The program starts (as you can verify in the task manager), but nothing appears on the screen.

If you have administrator privileges, you can look into the event log (If you know how to do that). If you haven’t or don’t know how to, you are lost.

<sarcasm>Great feature, guys!</sarcasm>

So I don’t forget: According to an article in c’t magazine, disabling the “DiagTrack” service (“Connected User Experience and Telemetry”) will completely disable user tracking in Windows 10. They also say that they did not see any negative effects.

Source: Telefonierverbot in c’t 01/2019 page 172 (in German)


text:
A STUDY OF AVERAGE ERROR BOUND OF TRAPEZOIDAL RULE

• Journal title : Honam Mathematical Journal
• Volume 30, Issue 3,  2008, pp.581-587
• Publisher : The Honam Mathematical Society
• DOI : 10.5831/HMJ.2008.30.3.581
Title & Authors
A STUDY OF AVERAGE ERROR BOUND OF TRAPEZOIDAL RULE
Yang, Mee-Hyea; Hong, Bum-Il;

Abstract
In this paper, to have a better a posteriori error bound of the average case error between the true value of I(f) and the Trapezoidal rule on subintervals using zero mean-Gaussian, we prove that a new average error between the difference of the true value of I(f) from the composite Trapezoidal rule and that of the composite Trapezoidal rule from the simple Trapezoidal rule is bounded by $\small{c_rH^{2r+3}}$ through direct computation of constants $\small{c_r}$ for r $\small{{\leq}}$ 2 under the assumption that we have subintervals (for simplicity equal length h) partitioning [0, 1].
Keywords
Trapezoidal rule;Error analysis;Wiener measure;
Language
English
Cited by
1.
ON A STUDY OF ERROR BOUNDS OF TRAPEZOIDAL RULE,;;

호남수학학술지, 2014. vol.36. 2, pp.291-303
1.
ON A STUDY OF ERROR BOUNDS OF TRAPEZOIDAL RULE, Honam Mathematical Journal, 2014, 36, 2, 291
References
1.
P. J. Davis and P. Rabinowitz, Methods of Numerical Integration, Academic Press, New York, 1975.

2.
N. Hahm and B. I. Hong, An Error of composite Trapezoidal Rule, J. of Appl. Math. &. Computing 13 (2003), 365-372.

3.
B. I. Hong, N. Hahm and M. Yang, An Error bounds of Trapezoidal Rule on subintervals Using zero-mean Gaussian, J. of Korea information processing Soc. 12-A (2005), 391-394.

4.
H. H. Kuo, Gaussian Measure in Banach Spaces, Lecture Notes in Mathematics 463, Springer-Verlag, Berlin.

5.
E. Novak, Deterministic and Stochastic Error Bound in Numerical Analysis Lecture Notes in Mathematics 1349, Springer-Verlag, Berlin, 1988.

6.
A. V. Skorohod, Integration in Hilbert Space, Springer-Verlag, New York, 1974.

7.
J. F. Traub, G. W. Wasilkowski and H. Wozniakowski, Information-Based Complexity, Academic Press, New York, 1988.

8.
N. N. Vakhania, Probability distributed on Linear Spaces, North-Holland, New York, 1981.