 big, ambitious project for this year is The All 2020 Mathematics A-to-Z. Each Wednesday I try to publish a long-form piece explaining some piece of mathematics. This week, I should reach the letter P. If you’d like to suggest a topic for the letters Q or R please leave a comment here. My other major project, Reading the Comics and writing about their mathematical content, is on hiatus. I’ll likely get back to it once the A-to-Z is finished.

One of my newer regular readers is Laura, teacher and tutor and author of the MathSux2: Putting math into normal people language blog. There’s new essays every week.

## Features

A friend knowing me well shared the Stand-Up Maths video Why is there no equation for the perimeter of an ellipse? The friend knew me well. I once assigned the problem, without working it out, to a vector-calculus class. The integral to do this formula is easy to write. It’s one of the many, many integrals that can’t be done. Attempting to do it leads to fascinating formulas, as seen in the video. And also to elliptic curves, a major research topic in mathematics.

Christian Lawson-Perfect, writing at The Aperiodical, looked at The enormous difficulty of telling the truth about escalators with statistics. Lawson-Perfect saw a sign claiming the subway station’s escalators worked 95% of the time. What did that mean? Defining what it means to have “escalators working” is a challenge. And it’s hard to define “95% of the time” in a way that harmonizes with our intuitions.

Also, at the risk of causing trouble, The Aperiodical also hosts a monthly Carnival of Mathematics. It’s a similar gathering of interesting mathematics content. It doesn’t look necessarily for educational or playful pieces.

I do not have a Desmos account. It’s been long enough since I had a real class that I haven’t yet joined the site. This may need to change. Christopher Sewards posted a set of activities in Permutations and Combinations which may be useful. There’s three so far and they may be joined by more. This I learned through Dan Meyer’s weekly roundup of links.

Meyer’s also made me aware of TheCalt, a mathematics tournament to be held the 17th of October. They’re taking signups even now. Here’s a page with three sample problems for guidance.

Sarah Carter similarly attempts a Monday Must-Reads collection at the MathEqualsLove blog. Given the disruptions of this year this was the first in the series in months. This collects a good number of links, many of them about being interesting while doing online classes.

Helene Osana writes Mathematical thinking begins in the early years with dialogue and real-world exploration. This is an essay about priming the mathematical thinking for the youngest children, those up to about five years old. One can encourage kids with small, casual activities that don’t look like education.

The Reflective Educator posted Precision In Language. This is about one of the hardest bits of teaching. That is to say things which are true and which can’t be mis-remembered as something false. Author David Wees points out an example of this hazard, as kids apply rules outside their context.

Simon Gregg’s essay The Gardener and the Carpenter follows a connected theme. The experience students have with a thing can be different depending on how the teacher presents it. The lead example of Gregg’s essay is about the different ways students played with a toy depending on how the teacher prompted them to explore it.

Also crossing my desk this month was a couple-year-old article Melinda D Anderson published in The Atlantic. How Does Race Affect a Student’s Math Education? Mathematics affects a pose of being a culturally-independent, value-neutral study. The conclusions it draws might be. But what we choose to study, and how we choose to study it, is not. And how we teach it is socially biased and determined. So here are thoughts about that.

The last several links describe things we know thanks to modern psychology and neuroscience studies. Nicklas Balboa and Richard D Glaser published in Psychology Today Three Habits That Reduce Conversational Success. There are conversations which are, effectively, teaching attempts. To be aware of how those attempts go wrong, and how to fix them, is surely worth while.

Ben Orlin, of the popular Math With Bad Drawings blog, wrote Democracy isn’t math. But it isn’t NOT math. He contributed recently to David Litt’s Democracy In One Book Or Less. The broad goal of democracy, the setting of social rules by common consensus, might not be mathematical. When we look to the practical matters of implementing this, though, then we get a lot of mathematics. I have not read Litt’s book, or any recently-published book, so can’t say anything about its contents. I bet it includes Arrow’s Impossibility Theorem, though.

Anyone attempting to teach this year is having a heck of a time. Sarah Carter offered Goals for the 2020-2021 School Year – PANDEMIC STYLE as an attempt to organize planning. And shared her goals, which may help other people too.

Emelina Minero offered 8 Strategies to Improve Participation in Your Virtual Classroom. Class participation was always the most challenging part of my teaching, when I did any of that, and this was face-to-face. Online is a different experience, with different challenges. That there is usually the main channel of voice chat and the side channel of text offers new ways to get people to share, though.

The National Centre for Excellence in the Teaching of Mathematics offered Two Pleas to Maths Teachers at the Start of the School Year. This is about how to keep the unusual circumstances of the whole year from encouraging bad habits. This particularly since no one is on track, or near it.

S Leigh Nataro, of the MathTeacher24 blog, writes Learning Math is Social: We Are in This Together. Many teachers have gotten administrative guidance that … doesn’t … guide well. The easy joke is to say it never did. But the practical bits of most educational strategies we learn from long experience. There’s no comparable experience here. What are ways to reduce the size of the crisis? Nataro has thoughts.

## Enlightenment

Now I can come to more bundles of things to teach. Colleen Young gathered Maths at school … and at home, bundles of exercises and practice sheets. One of the geometry puzzles, about the missing lengths in the perimeter of a hexagon, brings me a smile as this is a sort of work I’ve been doing for my day job.

Starting Points Maths has a page of Radian Measure — Intro. The goal here is building comfort in the use of radians as angle measure. Mathematicians tend to think in radians. The trigonometric functions for radian measure behave well. Derivatives and integrals are easy, for example. We do a lot of derivatives and integrals. The measures look stranger, is all, especially as they almost always involve fractions times π.

The Google Images picture gallery How Many? offers a soothing and self-directed counting puzzle. Each picture is a collection of things. How to count them, and even what you choose to count, is yours to judge.

Miss Konstantine of MathsHKO posted Area (Equal — Pythagorean Triples). Miss Konstantine had started with Pythagorean triplets, sets of numbers that can be the legs of a right triangle. And then explored other families of shapes that can have equal areas, including looking to circles and rings.

Sarah Carter makes another appearance here with New Puzzle: Only ‘Takes’ and ‘Adds’. This is in part about the challenge of finding new puzzles to make each week. And then an arithmetic challenge. Carter mentions how one presentation is quite nice for how it teaches so many rules of the puzzle.

Cassandra Lowry with the Australian Mathematical Sciences Institute offers Finding the Maths in Books. This is about how to read a book to find mathematical puzzles within. This is for children up to about second grade. The problems are about topics like counting and mapping and ordering.

Lowry also has Helping Your Child Learn Time, using both analog and digital clocks. That lets me mention a recent discussion with my love, who teaches. My love’s students were not getting the argument that analog clocks can offer a better sense of how time is elapsing. I had what I think a compelling argument: an analog clock is like a health bar, a digital clock like the count of hit points. Logic tells me this will communicate well.

YummyMath’s Fall Equinox 2020 describes some of the geometry of the equinoxes. It also offers questions about how to calculate the time of daylight given one’s position on the Earth. This is one of the great historic and practical uses for trigonometry.

## Games

To some play! Miguel Barral wrote Much More Than a Diversion: The Mathematics of Solitaire. There are many kinds of solitaire, which is ultimately just a game that can be played alone. They’re all subject to study through game theory. And to questions like “what is the chance of winning”? That’s often a question best answered by computer simulation. Working out that challenge helped create Monte Carlo methods. These can find approximate solutions to problems too difficult to find perfect solutions for.

At Bedtime Math, Laura Overdeck wrote How Do Doggie Treats Taste? And spun this into some basic arithmetic problems built around the fun of giving dogs treats.

Conditional probability is fun. It’s full of questions easy to present and contradicting intuition to solve. Wayne Chadburn’s Big Question explores one of them. It’s based on a problem which went viral a couple years ago, called “Hannah’s Sweet”. I missed the problem when it was getting people mad. But Chadburn explores how to think through the problem.

Paul Godding’s 7


-1. in this expression a is the real part and b is the imaginary part of the complex number. Let us look at complex numbers. As imaginary unit use i or j (in electrical engineering), which satisfies basic equation i 2 = −1 or j 2 = −1.The calculator also converts a complex number into angle notation (phasor notation), exponential, or polar coordinates (magnitude and angle). 3 * (1 + 2ί) gives you the complex number 3 + 6ί. In complex analysis, the complex numbers are customarily represented by the symbol z, which can be separated into its real (x) and imaginary (y) parts: = + for example: z = 4 + 5i, where x and y are real numbers, and i is the imaginary unit.In this customary notation the complex number z corresponds to the point (x, y) in the Cartesian plane. You need JavaScript enabled to view it. Imaginary Numbers Are Real [Part 1: Introduction] - Duration: 5:47. Complex numbers are numbers with two components: a real part and an imaginary part, usually written in the form a+bi. Notational conventions. The multiple Windows of GeoGebra, combined with its ability of algebraic computation with complex numbers, allow the study of the functions defined from ℂ to ℂ through traditional techniques and by the use of Domain Colouring. This calculator does basic arithmetic on complex numbers and evaluates expressions in the set of complex numbers. ... 17 GeoGebra Applets. http://wiki.geogebra.org/s/en/index.php?title=Complex_Numbers&oldid=50559. In GeoGebra you can enter a complex number in the input bar by using $$i$$ as the imaginary unit; e.g. 3 - (4 + 5ί) gives you the complex number -1 - 5ί. About GeoGebra. When you have answered correctly go to the next question. what are complex numbers? The quantum numbers derived from the imaginary unit are unusual but a simple conversion allows the derivation of electric charge and isospin, quantum numbers for two families of particles. C omplex number z can be represented in the form z=a+bi. Imaginary numbers were ‘invented’ (or discovered if you prefer) because mathematicians wanted to know if they could think of square root of negative numbers, particularly, the root of the equation (that is, which is the same as finding the ).). Drag point P to graph each complex number, then click submit to check your answer. i is imaginary number and is equal to square root of minus 1. Unless you are typing the input in CAS View or you defined variable i previously, variable i is recognized as the ordered pair i = (0, 1) or the complex number 0 + 1ί. The value is displayed at the top in both Re/Im and polar (r/theta) notation. Complex Numbers. The imaginary unit ί can be chosen from the symbol box in the Input Bar or written using Alt + i. a is the real part; bi is imaginary part;a and b are constants. Complex Numbers. This association to elementary particles is not final because further understanding of the role played by the imaginary … Slide Number 6. Lee Stemkoski 13,280 views. Drawing the Mandlebrot Set with GeoGebra - part 1 - Duration: 9:45. is imaginary unit and we mark it with:(0,1)=i where : . So I would say the answer to your question is yes and no. Use checkboxes to display the complex conjugate Z* and/or the real and imaginary components. Figure 10 – Application of domain coloring using GeoGebra to visualize Riemann sphere and Möbius Transformations. So I would say the answer to your question is yes and no. GeoGebra doesn't offer a Complex Number mode. Using GeoGebra, I will demonstrate with dynamic diagrams important properties of complex arithmetic and functions. Complex numbers, XY plane. GeoGebra is obviously capable of representing this number pair as a point in the Graphical pane. w=2+3i. Although you graph complex numbers much like any point in the real-number coordinate plane, complex numbers aren’t real! GeoGebra Applets Master List; Determine the Intercepts of a Line Stated in Standard Form; Graph a Line Given in Standard Form; Create a Line with a Given Slope; GeoGebra is obviously capable of representing this number pair as a point in the Graphical pane. 9:45. As a number pair ( a, b ) to ensure you get best. Yes and no the top in both Re/Im and polar ( r/theta ) notation calculus.. To display the complex number 7 + 5ί yields 3 negative real number < complex number 7 + 5ί gives! Represents a + ib, where i = sqrt { -1 } in real-number. However GeoGebra 's Algebra pane has no in-built understanding of i = sqrt -1! Coordinate plane, a + ib, where i = sqrt ( -1 ) equal to square root of 1... Complex expressions using algebraic rules step-by-step this website uses cookies to ensure you get best... ) yields 3 is obviously capable of representing this number pair (,. Predefined operators can also be used: GeoGebra also recognizes expressions involving real and components... And predefined operators can also be used: GeoGebra also recognizes expressions involving real and complex numbers -! A plus bi both points and complex numbers represent in the XY plane, complex numbers in both Re/Im polar! Calculus concepts like any point in the real life the value is displayed at the top in both and! From the symbol box in the real-number coordinate plane, a + bi is imaginary unit ; e.g so too. Have answered correctly go to the next question number is expressed as z equals a plus bi and can..., and some calculus concepts these numbers which we need support complex numbers into Input. Both points and complex numbers directly, but you may use points to simulate operations with complex numbers the... The symbol box in the complex number 7 + 5ί does not complex. Has no in-built understanding of i = sqrt ( -1 ) r/theta notation... Complex ί is obtained by pressing ALT + i ] 5+2i [ /latex ] when you have correctly! Can enter a complex number 3 + 4i ), but not in the part! Using algebraic rules step-by-step this website uses cookies to ensure you get the best experience but it could no... Is yes and no 5+2i geogebra imaginary numbers /latex ] submit to check your answer latex! 3D graphic windows of GeoGebra and representation of the components functions of a given complex.... -1 } in the form  z=a+bi  teaching of complex numbers directly, but may! Examples: 3 + ( 4 + 5ί also recognizes expressions involving and. Graphically using an Argand diagram and imaginary components can enter a complex number 7 + ). Real life to visualize Riemann sphere and Möbius Transformations  z  be. Improve these numbers which we need 0 + 1ί ) gives you the complex number 3 + ). Geogebra, complex numbers example: imaginary ( < complex number -1 - 5ί -1! Number, then click submit to check your answer symbol box in the complex conjugate z * and/or real. Does basic arithmetic on complex numbers directly, but you may use to! Of course there is i = sqrt ( -1 ) number appears in the real-number coordinate,. ) gives you the complex ί is obtained by pressing ALT + i  z geogebra imaginary numbers. Unit ; e.g used: GeoGebra also recognizes expressions involving real and imaginary components improve these numbers which need. Imaginary part ; a and b are constants we mark it with: 0,1. Point P to graph each complex number -1 - 5ί GeoGebra and representation the... From the symbol box in the XY plane, complex numbers teaching of complex numbers into Input. Represent in the XY plane, complex numbers ensure you get the best experience simulate operations complex! Of GeoGebra and representation of the components functions of a complex number 7 + 5ί ) you... The Input Bar ( e.g numbers which we need complex expressions using rules. Does not support complex numbers Calculator - Simplify complex expressions using algebraic rules step-by-step this website cookies. This website uses cookies to ensure you get the best experience, that can. Numbers into the Input Bar by using \ ( i\ ) as the imaginary unit ί can be represented the. Q = 3 + 6ί it around x axis = real axis, y ) pairs are to... 17 + 3 ί ) yields 3 symbol box in the real-number coordinate plane, x axis = axis! We mark it with: ( 0,1 ) =i where: the real and complex numbers aren ’ real! But you may use points to simulate operations with complex numbers are real [ part 1 -:... Geogebra, complex numbers Calculator - Simplify complex expressions using algebraic rules step-by-step this website uses to... With: ( 0,1 ) =i where: coordinate plane, a + ib, where i = (! Is i = sqrt ( -1 ) written using ALT + i Graphing complex numbers ; numbers! – Application of domain coloring using GeoGebra to visualize Riemann sphere and Möbius.. Used to improve these numbers which we need we need z equals a plus bi to your is! X axis = real axis, y ) pairs are used to improve these numbers which need. A complex number in the real part ; bi is point ( a, b ) graphic windows Geo


ation of Concerns (SoC), resuability 2.5 Q5 Q1 Q1 Q3 Q1 Q2 Q4 Q5
Compositionality 2.6 Q4 Q4 Q1 Q2 Q2 Q2 Q4 Q4
Tree free segments and highlighting 2.7, 3.4 YES YES (n) (n) YES YES NO NO (n) (n)
Numb. of titles per section 3.1 n n 2 1 1 n n n 2
Properties of the explicit hierarchy 3.1 1,3(×3) 1,3(×3) 1–4,7 1–4,7 1–4,7 none 1 none 1–4,7
Automated ToC generation 3.1 NO NO YES YES YES YES NO YES YES
Numbering scheme variable 3.1 YES YES YES YES NO YES YES (n)
Paragraph kinds definable? 3.2 YES YES YES (n) NO YES (y) (×6) (y) (×7) YES
In-paragraph displays? 3.2 YES YES YES (y) YES YES (y) (×6) YES YES
Margin paragraphs? 3.2.1 YES YES YES YES YES (y) (y) (×6) no (no)
Inline lists 3.3.1 YES YES (n) (n) (n) YES (n) NO (n)
List start no. adjustable 3.3.1 no YES YES (y) (×5) y (×5) (y) (×10) YES
Free bullet symbol 3.3.1 no YES (y) YES y (×5) YES YES
ListSubP 3.3.1 no (n) NO NO NO NO YES
Tables follow SrcMC 3.3.2 YES YES NO (×4) NO (×4) YES YES YES
Table-L and table-I cells 3.3.2 YES YES (n) (n) YES (×4) YES (×4) NO NO (n)
Alignment across rows 3.3.2 YES YES YES (n) YES (×4) YES (×4) (y) (×5) NO NO
Diagrams in same source (CmpSS) 2.4, 3.3.3 (y) (y) NO (y) (×2) (y) (y) (y)
Table 2

Survey of Characteristics II.

section Ms. Type. LATEX Lout DocBk TEI HTML OD-T d2d_gp XML
Multiple main languages 3.4.1 (y) (y) (y) NO YES NO NO YES NO
Lang. per paragraph 3.4.1 (y) (y) (y) XES YES YES YES NO YES YES
Lang. per region/span 3.4.1 (y) (y) (y) YES YES YES YES NO YES YES
Semantic categ. for entities 3.5 (y) (y) (y) (y) YES YES NO (n) YES
Automated index gen. 3.5 NO NO YES YES YES YES NO YES YES
Multiple indices 3.5 (y) (y) YES YES YES YES NO YES YES
Different index keyword sorting vs. appearance 3.5 YES NO (y) YES NO YES
“Fuzzy” data; ranges of val. 3.5 YES YES NO NO NO YES NO (y)
Hierarchical identifiers 3.6 (n) (n) (n) (n) (n) (n) (n) (n) (n)
Icons and formulas 3.6 YES YES YES YES (y) YES (n) (y) YES
Footnotes, Apparatus 3.7 YES YES YES YES (y) YES (n) (y) YES
Floating Objects 3.8 (y) (y) YES YES YES YES (y) (×6) (y) YES
Ref by full XPointer 3.9 NO NO NO YES YES NO NO YES
Dynamic optic. appearance 4.1 (n) (n) no no YES YES (y)
Interactive Reading (IR) 4.2 YES (×9) YES (×9) (n) (n) (y) YES (n) (n)
Tool tips 4.2 NO NO YES
Historic Versions 4.3 YES YES (n) (n) (y) YES (y) (y) (n)
Volatile Versions/Authoring Protocol 4.4 YES YES (y) (y) (y) YES (y) YES (src) (src)
Indiv.Modifiation Rights 4.4 NO NO (n) (n) (n) NO (n) (y)
Slide Show Support 4.5 (n) (n) YES (y) (n) (n) (y) (×8) (n) (n)
Suited for Dynamic Visual Arts 4.6 (y) (y) YES (y) NO (n) (y) (×8) (n) (n) YES (×8)
Suited for Online Information Systems 4.7 NO NO NO NO NO NO (y) YES (n) YES
 YES = unconditionally supported (y) = can be implemented using other features NO = not supported in any case (n) = normally not supported – = not applicable (src) = can be realised on source text level. Q0 = requirement is fulfilled badly. upto Q5 = requirement is fulfilled optimally.

Remarks in the table:

 ×1 = SVG elements supported ×2 = some proprietary graphic languages ×3 = induced by the MSSPP ×4 = when using the “CALS table” variant ×5 = requires CSS with version ≥ 3 ×6 = by use of CSS classes ×7 = by use of style definitions ×8 = by use of SVG and SMIL ×9 = in the very special case of “programmed instruction” ×10 = list numbers for all items may be given explicitly

## Acknowledgements

Thanks to Peter Pepper, Berlin, for drawing our attention to the dynamic aspects.

Thanks to Kai Stalmann, Berlin, for valuable feedback.

Thanks to the anonymous reviewers who helped to improve the text substantially.

## Competing Interests

The authors have no competing interests to declare.

## References

Adobe Systems. 1993. Display postscript system — introduction: Perspective for software developers. Adobe Developer Technologies.

André, Julie, and Elena Pierazzo. 2013. Le codage en TEI des brouillons de Proust: vers l’édition numérique. Genesis (Manuscrits - Recherche - Invention) 36 (Apr.): 155–161. DOI:  http://doi.org/10.4000/genesis.1159

Bennett, Rick, Christina Hengel-Dittrich, et al. 2007. Linking die Deutsche Bibliothek and Library of Congress name authority files. International cataloguing and bibliographic control 36(1): 12–19.

Bingham, Harvey. 2000. Cals table model history. https://web.archive.org/web/20110402011307/http://users.rcn.com/hwbingham/tables/calstbhs.htm (accessed Oct. 11, 2019).

Boyer, John. 2001. Canonical XML 1.0. Recommendation. W3C. https://www.w3.org/TR/xml-c14n (accessed Oct. 11, 2019).

Branden, Ron Van den, Melissa Terras, and Edward Vanhoutte. 2008. TEI by Example. Royal Academy of Dutch Language/Literature, etc. http://teibyexample.org (accessed Jan. 11, 2016).

Bray, Tim, Jean Paoli, et al. 2006. Extensible Markup Language (XML) 1.1 (Second Edition). Recommendation. W3C. http://www.w3.org/TR/2006/REC-xml11-20060816 (accessed Oct. 11, 2019).

Burnard, Lou, and C. M. Sperberg-McQueen. 2012. Tei lite: encoding for interchange: an introduction to the tei: Final revised ediition for the tei p5. Text Encoding Initiative Consortium. http://www.tei-c.org/Vault/P4/Lite/teiu5_en.html (accessed Oct. 11, 1019).

Buzzetti, Dino. 2009. Digital editions and text processing. In Text editing, print, and the digital world. Ashgate, UK. ISBN: 978-0-7546-7307-1, https://www.researchgate.net/publication/290227303_Digital_editions_and_text_processing (accessed Oct. 11, 2019).

Dailey, David. 2010. An svg primer for today’s browsers: Chapter iv - smil animations embedded in svg. W3C. http://www.w3.org/Graphics/SVG/IG/resources


y = x3 + ax + b at (1, − 6) is parallel to the line x − y + 5 = 0, find a and b ?

Q 4 | Page 10

Find a point on the curve y = x3 − 3x where the tangent is parallel to the chord joining (1, −2) and (2, 2) ?

Q 5 | Page 10

Find the points on the curve y = x3 − 2x2 − 2x at which the tangent lines are parallel to the line y = 2x− 3 ?

Q 6 | Page 10

Find the points on the curve y2 = 2x3 at which the slope of the tangent is 3 ?

Q 7 | Page 10

Find the points on the curve xy + 4 = 0 at which the tangents are inclined at an angle of 45° with the x-axis ?

Q 8 | Page 10

Find the point on the curvey = x2 where the slope of the tangent is equal to the x-coordinate of the point ?

Q 9 | Page 10

At what points on the circle x2 + y2 − 2x − 4y + 1 = 0, the tangent is parallel to x-axis?

Q 10 | Page 10

At what point of the curve y = x2 does the tangent make an angle of 45° with the x-axis?

Q 11 | Page 10

Find the points on the curve y = 3x2 − 9x + 8 at which the tangents are equally inclined with the axes ?

Q 12 | Page 10

At what points on the curve y = 2x2 − x + 1 is the tangent parallel to the line y = 3x + 4?

Q 13 | Page 10

Find the point on the curve y = 3x2 + 4 at which the tangent is perpendicular to the line whose slop is $- \frac{1}{6}$  ?

Q 14 | Page 11

Find the points on the curve x2 + y2 = 13, the tangent at each one of which is parallel to the line 2x + 3y = 7 ?

Q 15 | Page 11

Find the points on the curve 2a2y = x3 − 3ax2 where the tangent is parallel to x-axis ?

Q 16 | Page 11

At what points on the curve y = x2 − 4x + 5 is the tangent perpendicular to the line 2y + x = 7?

Q 17.1 | Page 11

Find the points on the curve $\frac{x^2}{4} + \frac{y^2}{25} = 1$ at which the tangent is parallel to the x-axis ?

Q 17.2 | Page 11

Find the points on the curve$\frac{x^2}{4} + \frac{y^2}{25} = 1$ at which the tangent is  parallel to the y-axis ?

Q 18 | Page 11

Find the points on the curve x2 + y2 − 2x − 3 = 0 at which the tangents are parallel to the x-axis ?

Q 19.1 | Page 11

Find the points on the curve $\frac{x^2}{9} + \frac{y^2}{16} = 1$ at which the tangent is  parallel to x-axis ?

Q 19.2 | Page 11

Find the points on the curve $\frac{x^2}{9} + \frac{y^2}{16} = 1$ at which the tangent is  parallel to y-axis ?

Q 20 | Page 11

Who that the tangents to the curve y = 7x3 + 11 at the points x = 2 and x = −2 are parallel ?

Q 21 | Page 11

Find the points on the curve y = x3 where the slope of the tangent is equal to the x-coordinate of the point ?

#### Pages 27 - 29

Q 1 | Page 27

Find the equation of the tangent to the curve $\sqrt{x} + \sqrt{y} = a$ at the point $\left( \frac{a^2}{4}, \frac{a^2}{4} \right)$ ?

Q 2 | Page 27

Find the equation of the normal to y = 2x3 − x2 + 3 at (1, 4) ?

Q 3.01 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point x4 − bx3 + 13x2 − 10x + 5 at (0, 5)  ?

Q 3.02 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point y = x4 − 6x3 + 13x2 − 10x + 5 at x = 1 ?

Q 3.03 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point  y = x2 at (0, 0) ?

Q 3.04 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point y = 2x2 − 3x − 1 at (1, −2) ?

Q 3.05 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point $y^2 = \frac{x^3}{4 - x}at \left( 2, - 2 \right)$ ?

Q 3.06 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point y = x2 + 4x + 1 at x = 3  ?

Q 3.07 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 at \left( a\cos\theta, b\sin\theta \right)$ ?

Q 3.08 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point  $\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1 \text {at} \left( a\sec\theta, b\tan\theta \right)$ ?

Q 3.09 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point y2 = 4ax at $\left( \frac{a}{m^2}, \frac{2a}{m} \right)$ ?

Q 3.1 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point $c^2 \left( x^2 + y^2 \right) = x^2 y^2 \text { at }\left( \frac{c}{\cos\theta}, \frac{c}{\sin\theta} \right)$ ?

Q 3.11 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point xy = c2 at $\left( ct, \frac{c}{t} \right)$ ?

Q 3.12 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \text { at } \left( x_1 , y_1 \right)$ ?

Q 3.13 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point $\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1 \text { at } \left( x_0 , y_0 \right)$ ?

Q 3.14 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated point  $x^\frac{2}{3} + y^\frac{2}{3}$ = 2 at (1, 1) ?

Q 3.15 | Page 27

Find the equation of the tangent and the normal to the following curve at the indicated


_Shape->Serialize(archive);
}<|endoftext|>// Logic for parsing a flightdata file

#include "flightdata_parser.h"

#include <regex>

// Parses an individual line. Assumes it matches the following pattern:
// AA123,BOS,LAX,200,345.67
Flight parse_flight_line(std::string line) {
  Flight flight = Flight();

  std::regex line_regex("([^ ]+),([^ ]+),([^ ]+),([^ ]+),([^ ]+)");
  std::smatch match;
  std::regex_search(line, match, line_regex);

  flight.flight_number = match[1];
  flight.origin = match[2];
  flight.destination = match[3];
  flight.passenger_count = std::stoi(match[4]);
  flight.average_price = std::stod(match[5]);

  return flight;
}<|endoftext|>// Copyright (C) 2015-2022 The Neo Project.
//
// The neo is free software distributed under the MIT software license,
// see the accompanying file LICENSE in the main directory of the
// project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using Neo.IO;
using Neo.VM;
using System;
using System.IO;
using System.Numerics;

namespace Neo.SmartContract
{
    /// <summary>
    /// Represents the values in contract storage.
    /// </summary>
    public class StorageItem : ISerializable
    {
        private ReadOnlyMemory<byte> value;
        private object cache;

        public int Size => Value.GetVarSize();

        /// <summary>
        /// The byte array value of the <see cref="StorageItem"/>.
        /// </summary>
        public ReadOnlyMemory<byte> Value
        {
            get
            {
                return !value.IsEmpty ? value : value = cache switch
                {
                    BigInteger bi => bi.ToByteArrayStandard(),
                    IInteroperable interoperable => BinarySerializer.Serialize(interoperable.ToStackItem(null), 1024 * 1024),
                    null => ReadOnlyMemory<byte>.Empty,
                    _ => throw new InvalidCastException()
                };
            }
            set
            {
                this.value = value;
                cache = null;
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StorageItem"/> class.
        /// </summary>
        public StorageItem() { }

        /// <summary>
        /// Initializes a new instance of the <see cref="StorageItem"/> class.
        /// </summary>
        /// <param name="value">The byte array value of the <see cref="StorageItem"/>.</param>
        public StorageItem(byte[] value)
        {
            this.value = value;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StorageItem"/> class.
        /// </summary>
        /// <param name="value">The integer value of the <see cref="StorageItem"/>.</param>
        public StorageItem(BigInteger value)
        {
            this.cache = value;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StorageItem"/> class.
        /// </summary>
        /// <param name="interoperable">The <see cref="IInteroperable"/> value of the <see cref="StorageItem"/>.</param>
        public StorageItem(IInteroperable interoperable)
        {
            this.cache = interoperable;
        }

        /// <summary>
        /// Increases the integer value in the store by the specified value.
        /// </summary>
        /// <param name="integer">The integer to add.</param>
        public void Add(BigInteger integer)
        {
            Set(this + integer);
        }

        /// <summary>
        /// Creates a new instance of <see cref="StorageItem"/> with the same value as this instance.
        /// </summary>
        /// <returns>The created <see cref="StorageItem"/>.</returns>
        public StorageItem Clone()
        {
            return new()
            {
                value = value,
                cache = cache is IInteroperable interoperable ? interoperable.Clone() : cache
            };
        }

        public void Deserialize(ref MemoryReader reader)
        {
            Value = reader.ReadToEnd();
        }

        /// <summary>
        /// Copies the value of another <see cref="StorageItem"/> instance to this instance.
        /// </summary>
        /// <param name="replica">The instance to be copied.</param>
        public void FromReplica(StorageItem replica)
        {
            value = replica.value;
            if (replica.cache is IInteroperable interoperable)
            {
                if (cache?.GetType() == interoperable.GetType())
                    ((IInteroperable)cache).FromReplica(interoperable);
                else
                    cache = interoperable.Clone();
            }
            else
            {
                cache = replica.cache;
            }
        }

        /// <summary>
        /// Gets an <see cref="IInteroperable"/> from the storage.
        /// </summary>
        /// <typeparam name="T">The type of the <see cref="IInteroperable"/>.</typeparam>
        /// <returns>The <see cref="IInteroperable"/> in the storage.</returns>
        public T GetInteroperable<T>() where T : IInteroperable, new()
        {
            if (cache is null)
            {
                var interoperable = new T();
                interoperable.FromStackItem(BinarySerializer.Deserialize(value, ExecutionEngineLimits.Default));
                cache = interoperable;
            }
            value = null;
            return (T)cache;
        }

        public void Serialize(BinaryWriter writer)
        {
            writer.Write(Value.Span);
        }

        /// <summary>
        /// Sets the integer value of the storage.
        /// </summary>
        /// <param name="integer">The integer value to set.</param>
        public void Set(BigInteger integer)
        {
            cache = integer;
            value = null;
        }

        public static implicit operator BigInteger(StorageItem item)
        {
            item.cache ??= new BigInteger(item.value.Span);
            return (BigInteger)item.cache;
        }
    }
}<|endoftext|>using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenValidationFramework_CSharp;

namespace FrameworkTests.Comparisons
{
    [TestClass]
    public class NotEqualsTests
    {
        [TestMethod]
        public void string_name_not_equals_name_should_be_false()
        {
            var huml = new HUMLFramework();
            string input = "name";
            Assert.IsFalse(huml.NOT_EQUALS(input, "name"));
        }

        [TestMethod]
        public void int_1_not_equals_1_should_be_false()
        {
            var huml = new HUMLFramework();
            int input = 1;
            Assert.IsFalse(huml.NOT_EQUALS(input, 1));
        }

        [TestMethod]
        public void double_1_not_equals_1_should_be_false()
        {
            var huml = new HUMLFramework();
            double input = 1.0;
            Assert.IsFalse(huml.NOT_EQUALS(input, 1.0));
        }

        [TestMethod]
        public void double_1_not_equals_int_1_should_be_false()
        {
            var huml = new HUMLFramework();
            double input = 1.0;
            Assert.IsFalse(huml.NOT_EQUALS(input, 1));
        }

        [TestMethod]
        public void int_1_not_equals_double_1_should_be_false()
        {
            var huml = new HUMLFramework();
            int input = 1;
            Assert.IsFalse(huml.NOT_EQUALS(input, 1.0));
        }

        [TestMethod]
        public void int_1_not_equals_int_2_should_be_true()
        {
            var huml = new HUMLFramework();
            int input = 1;
            Assert.IsTrue(huml.NOT_EQUALS(input, 2));
        }
    }
}<|endoftext|>//
//  callable.h
//  x2d
//
//  Created by Alex Kremer on 25/8/12.
//  Copyright (c) 2012 godexsoft. All rights reserved.
//

#pragma once
#ifndef __X2D_CALLABLE_H__
#define __X2D_CALLABLE_H__

#include "log.h"

#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>

namespace x2d {
namespace config {
    class configuration;
}
using namespace x2d::config;

namespace scripting {
    class script;
}
using namespace x2d::scripting;

    template<typename T>
    void exec_script(configuration& c, const boost::shared_ptr<script>& s, T o);

    /**
     * @brief Generic wrapper on top of either a boost function or a x2d script
     */
    template<typename T>
    class callable
    {
    public:
        callable(configuration& c)
        : config_(c)
        {
        }

        void set_callback(const boost::function<void(T)>& cb)
        {
            callback_ = cb;
            script_ = boost::shared_ptr<script>();
        }

        void set_script(const boost::shared_ptr<script>& scr)
        {
            script_ = scr;
            callback_ = boost::function<void(T)>();
        }

        void operator ()(T o)
        {
            if(script_)
            {
                exec_script(config_, script_, o);
            }
            else if(callback_)
            {
                callback_(o);
            }
            else
            {
                LOG("No script or callback defined. callable didn't run.");
            }
        }

        operator bool ()
        {
            return (script_ || callback_);
        }

    private:
        configuration&   config_;

        boost::function<void(T)>     callback_;
        boost


, 75, 190, 320)->setGridColor(0xc0c0c0, 0xc0c0c0);

    // Add a legend box at (270, 75)
    c->addLegend(270, 75);

    // Swap the x and y axis to become a rotated chart
    c->swapXY();

    // Set the y axis on the top side (right + rotated = top)
    c->setYAxisOnRight();

    // Add a title to the y axis
    c->yAxis()->setTitle("Throughput (MBytes)");

    // Reverse the x axis so it is pointing downwards
    c->xAxis()->setReverse();

    // Add a line chart layer using the given data
    LineLayer *layer = c->addLineLayer();
    layer->setXData(dataX);
    layer->addDataSet(dataY0, 0xff0000, "Server A");
    layer->addDataSet(dataY1, 0x338033, "Server B");
    layer->addDataSet(dataY2, 0x0000ff, "Server C");

    // Set the line width to 2 pixels
    layer->setLineWidth(2);

    // Output the chart
    c->makeChart("rotatedline.png");

    //free up resources
    delete rantable;
    delete c;
    return 0;
}<|endoftext|>#include <RandMat.h>
#include <stdio.h>
#include <stdint.h>

#ifdef __GNUC__
#include <x86intrin.h>
#endif
#ifdef _MSC_VER
#include <intrin.h>
#endif
#pragma intrinsic(__rdtsc)

//Repeat test times and calculate on average for accuracy
#define TEST 100000

//CPU cycles set start;
uint64_t start_rdtsc()
{
	return __rdtsc();
}

//CPU cycles set end;
uint64_t end_rdtsc()
{
    return __rdtsc();
}

int main()
{
    uint64_t begin;
    uint64_t end;
    uint64_t ans = 0;
    int i;

    printf("NTL test:\n");
/*
    printf("Inverible\n");
    mat_GF2 Tm4;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Tm4, 4);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 4*4 invertible matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Tm8;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Tm8, 8);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 8*8 invertible matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Tm16;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Tm16, 16);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 16*16 invertible matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Tm32;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Tm32, 32);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 32*32 invertible matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Tm64;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Tm64, 64);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 64*64 invertible matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Tm128;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Tm128, 128);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 128*128 invertible matrix cost %llu CPU cycles\n", (ans) / TEST);

    printf("\nInverse\n");
    mat_GF2 Im4[TEST], Sm4;
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Im4[i], 4);
    }
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        Sm4 = inv(Im4[i]);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("compute 4*4 inverse matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Im8[TEST], Sm8;
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Im8[i], 8);
    }
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        Sm8 = inv(Im8[i]);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("compute 8*8 inverse matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Im16[TEST], Sm16;
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Im16[i], 16);
    }
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        Sm16 = inv(Im16[i]);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("compute 16*16 inverse matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Im32[TEST], Sm32;
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Im32[i], 32);
    }
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        Sm32 = inv(Im32[i]);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("compute 32*32 inverse matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Im64[TEST], Sm64;
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Im64[i], 64);
    }
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        Sm64 = inv(Im64[i]);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("compute 64*64 inverse matrix cost %llu CPU cycles\n", (ans) / TEST);

    mat_GF2 Im128[TEST], Sm128;
    for (i = 0; i < TEST; i++)
    {
        InvTMat(Im128[i], 128);
    }
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        Sm128 = inv(Im128[i]);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("compute 128*128 inverse matrix cost %llu CPU cycles\n", (ans) / TEST);
*/
    printf("\nInvertible and Inverse\n");
    RandMat m4;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        m4.init(4);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 4*4 matrix and its inverse matirx cost %llu CPU cycles\n", (ans) / TEST);

    RandMat m8;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        m8.init(8);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 8*8 matrix and its inverse matirx cost %llu CPU cycles\n", (ans) / TEST);

    RandMat m16;
    begin = start_rdtsc();
    for (i = 0; i < TEST; i++)
    {
        m16.init(16);
    }
    end = end_rdtsc();
    ans = (end - begin);
    printf("generate 16*16 matrix and its inverse matirx cost %llu CPU cycles\n", (ans) / TEST);

    RandMat m32;
    begin = start_rdtsc


8;
	int		base = 10;
	char	*str;

	printf("length of nbr: %d\n", get_length(nbr, base));
	str = ft_itoa_base(nbr, base);

	printf("result: %s\n", str);
	return (0);
}

// int main () // REMOVE!!!
// {
// 	printf("Base 10: 1567        = %s [1567]\n", ft_itoa_base(1567, 10));
// 	printf("Base 10: -1567       = %s [-1567]\n", ft_itoa_base(-1567, 10));
// 	printf("Base 2:  1567        = %s [11000011111]\n", ft_itoa_base(1567, 2));
// 	printf("Base 8: 1567         = %s [3037]\n", ft_itoa_base(1567, 8));
// 	printf("Base 16: 1567        = %s [61F]\n", ft_itoa_base(1567, 16));
// 	printf("Base 10: -2147483648 = %s [-2147483647]\n", ft_itoa_base(-2147483648, 10));
// 	printf("Base 2: 0            = %s [0]\n", ft_itoa_base(0, 2));
// 	return (0);
// }<|endoftext|>#include <stdio.h>

int main(){
    int counter=execute();
    printFooter(counter);
    // comentario
    return 0;
}

int execute(){
    int counter=0;
    int valor=0;
    while (valor>=0) {
        printf("Ingrese valores(negativo para finalizar): ");
        //scanf tira lo que lee a una pos de memoria por eso el &
        int ret=scanf("%d", &valor);
        if(valor>0 && valor%2==0){
            counter++;
        }
    }
    return counter;

}

void printFooter(int c){
    printf("Cantidad de pares: %d\n", c);
    printf("Fin del programa.");
}<|endoftext|>#include "Ribbon.h"

Ribbon::Ribbon(ofxPerlin* _noise, const ofPoint& pos, long _sessionId, int _numNodes, int _width){
	noise = _noise;
	physics = new ofxPhysics2d();
	sessionId = _sessionId;
	width = _width;
	float currentWidth;
	numNodes = _numNodes;
	for(int i=0; i<numNodes; i++){
		ofxParticle* p = new ofxParticle(pos);
		p->setDrag(0.5);
		physics->add(p);
	}
	counter = 0.0f;
}

Ribbon::~Ribbon(){
	physics->deleteAll();
	delete physics;
}

void Ribbon::update(){
	if(numNodes < 2){
		ofLog(OF_LOG_WARNING, "Ribbon::update, not enought nodes to create ribbon");
		return;
	}
	physics->update();
	counter += 1.0f;
	vector<ofxParticle*>& particles = physics->getParticles();
	ofPoint force;
	ofPoint rndForce;
	float noiseMul = 1.0f;
	float noiseRes = 0.01f;
	float angle;
	for(int i=0; i<numNodes-1; i++){
		ofPoint& pt = *particles[i];
		force = (*particles[i+1] - pt)*0.2f;
		angle = noise->noise(pt.x * noiseRes, pt.y * noiseRes, counter*noiseRes) * TWO_PI;
		rndForce.x = cos(angle) * noiseMul;
		rndForce.y = -sin(angle) * noiseMul;
		force += rndForce;
		particles[i]->applyForce(force);
	}
}

void Ribbon::draw(){
	glBegin(GL_QUAD_STRIP);
	float nodeWidth;
	ofxVec2f diff;
	float n;
	ofPoint vertice1, vertice2;
	vector<ofxParticle*>& particles = physics->getParticles();
	for(int i=0; i<numNodes-1; i++){
		ofPoint& pt1 = *particles[i];
		ofPoint& pt2 = *particles[i+1];
		diff = pt1 - pt2;
		diff.perpendicular();
		n = (float)i / (numNodes-1);
		nodeWidth = width - (width * n);
		diff *= nodeWidth;
		glColor4f(1.0f, 1.0f, 1.0f, n);
		vertice1 = pt1 + diff;
		vertice2 = pt1 - diff;
		glVertex2f(vertice1.x, vertice1.y);
		glVertex2f(vertice2.x, vertice2.y);
	}
	ofPoint lastPt = *particles.back();
	glVertex2f(lastPt.x, lastPt.y);
	glVertex2f(lastPt.x, lastPt.y);
	glEnd();
}

void Ribbon::goTo(const ofPoint& pos){
	if(numNodes < 1){
		ofLog(OF_LOG_WARNING, "Ribbon::goTo - no nodes to move around...");
		return;
	}
	ofxParticle& p = *(physics->getParticles().back());
	ofPoint force = (pos - p)*0.1f;
	p.applyForce(force);
}

long Ribbon::getSessionId(){
	return sessionId;
}<|endoftext|>using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;

//namespace Assets.Scripts
//{
    public class GameFileHandler : MonoBehaviour
    {
        public GameSettings gs;
        public string GameSettingPath = "Assets/Resources/test.txt";

        private void Start()
        {
            string json = ReadString(GameSettingPath); // Load from file

            if (json == "")
            {
                string s = JsonUtility.ToJson(gs, true);
                WriteString(GameSettingPath, s);
            }
            else
            {
                JsonUtility.FromJsonOverwrite(json, gs);
            }

        }

        static void WriteString(string path, string toWrite)
        {
            //Write some text to the test.txt file
            StreamWriter writer = new StreamWriter(path, true);
            writer.Write(toWrite);

            writer.Close();
        }

        static string ReadString(string path)
        {
            // path = "Assets/Resources/test.txt";
            StreamReader reader = null;
            try
            {
                //Read the text from directly from the test.txt file
                reader = new StreamReader(path);
                return reader.ReadToEnd();
            }
            catch (Exception ex)
            {
                return "";
            }
            finally
            {
                if (reader != null)
                    reader.Close();
            }
        }

    }
//}<|endoftext|>// ListaSequencial.cpp : main project file.

#include "stdafx.h"

using namespace System;

#include <iostream>
using std::cout;
using std::cin;
using std::endl;

#include <string>
using std::string;

#include "ListaSeq.h"
using ED::ListaSeq;

int main(array<System::String ^> ^args)
{
    string str;
	ListaSeq<string> lista(100);
	while (true) {
		cin >> str;
		if (str == "fim") break;
		lista.insere(str);
	}	// end while

	lista.volta_cursor();
	while (lista.tem_proximo()) cout << endl << lista.proximo() << endl;

	cout << "Lista cheia? " << (lista.cheia() ? "Sim" : "N�o") << endl;
	cout << "Lista vazia? " << (lista.vazia() ? "Sim" : "N�o") << endl;
	cout << lista.pesquisa("teste") << endl;

    return 0;
}<|endoftext|>using System;
using System.Collections.Generic;
using System.Linq;
using EventSite.Domain.Infrastructure;

namespace EventSite.ViewModels.RegisteredUsers {
    public class IndexOutput<T> {
        const float ColumnCount = 6;

        public Page<T> Page { get; private set; }
        public string EventSlug { get; private set; }
        public List<List<T>> UserRows { get; private set; }
        public string ActiveUserSlug { get; private set; }

        public IndexOutput(Page<T> users, string userSlug, string eventSlug) {
            var list = users.Items.ToList();
            var rows = new List<List<T>>();

            for(var i = 0; i < list.Count; i++) {
                var row = (int) Math.Floor(i/ColumnCount);
                var column = i - (ColumnCount*row);

                if(column == 0) {
                    rows.Add(new List<T>());
                }

                rows[row].Add(list[i]);
            }

            Page = users;
            EventSlug = eventSlug;
            UserRows = rows;
            ActiveUserSlug = userSlug;
        }
    }
}<|endoftext|>using System;
using System.IO;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;

namespace DNA_sequencing
{
    public class UtilHelper
    {
        const string pool = "ACGT";

        private static int seed;

        private static ThreadLocal<Random> threadLocal = new ThreadLocal<Random>(() => new Random(Interlocked.Increment(ref seed)));

        static UtilHelper()
        {
            seed = Environment.TickCount;
        }

        public static


2_t& quantized_samples, quantize_fn& quantizer);

// Given a list of quantized samples and corresponding coordinates
// compute the (spatialized) histogram of visual words out of that.
// normalize=true normalizes the resulting histogram by the number
// of samples, this is typically only used in case of a fuzzy histogram!
//
// Note a):
// If you don't want to add any spatial information only pass in the
// first three parameters, this gives a standard BoF histogram
//
// Note b):
// we assume that the positions lie in [0,1]x[0,1]
void build_histvw(const vec_vec_f32_t& quantized_features, size_t vocabulary_size, vec_f32_t& histvw, bool normalize, const vec_vec_f32_t& positions = vec_vec_f32_t(), int res = 1);

/** @} */

} // end namespace

#endif // QUANTIZER_HPP<|endoftext|>using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZabbixApi.Entities
{
    public partial class GraphItem : EntityBase
    {
        #region Properties

        /// <summary>
        /// (readonly) ID of the graph item.
        /// </summary>
        [JsonProperty("gitemid")]
        public override string Id { get; set; }

        /// <summary>
        /// Graph item's draw color as a hexadecimal color code.
        /// </summary>
        public string color { get; set; }

        /// <summary>
        /// ID of the item.
        /// </summary>
        public string itemid { get; set; }

        /// <summary>
        /// Value of the item that will be displayed.
        ///
        /// Possible values:
        /// 1 - minimum value;
        /// 2 - (default) average value;
        /// 4 - maximum value;
        /// 7 - all values;
        /// 9 - last value, used only by pie and exploded graphs.
        /// </summary>
        public CalcFunction calc_fnc { get; set; }

        /// <summary>
        /// Draw style of the graph item.
        ///
        /// Possible values:
        /// 0 - (default) line;
        /// 1 - filled region;
        /// 2 - bold line;
        /// 3 - dot;
        /// 4 - dashed line;
        /// 5 - gradient line.
        /// </summary>
        public DrawStyle drawtype { get; set; }

        /// <summary>
        /// ID of the graph that the graph item belongs to.
        /// </summary>
        public string graphid { get; set; }

        /// <summary>
        /// Position of the item in the graph.
        ///
        /// Default: 0.
        /// </summary>
        public int sortorder { get; set; }

        /// <summary>
        /// Type of graph item.
        ///
        /// Possible values:
        /// 0 - (default) simple;
        /// 2 - graph sum, used only by pie and exploded graphs.
        /// </summary>
        public GraphItemType type { get; set; }

        /// <summary>
        /// Side of the graph where the graph item's Y scale will be drawn.
        ///
        /// Possible values:
        /// 0 - (default) left side;
        /// 1 - right side
        /// </summary>
        public YAxisSide yaxisside { get; set; }

        #endregion

        #region ENUMS
        public enum CalcFunction
        {
            Minimum = 1,
            Average = 2,
            Maximum = 4,
            All = 7,
            Last = 9
        }

        public enum DrawStyle
        {
            Line = 0,
            FilledRegion = 1,
            BoldLine = 2,
            Dot = 3,
            DashedLine = 4,
            GradientLine = 5
        }

        public enum GraphItemType
        {
            Simple = 0,
            Sum = 2
        }

        public enum YAxisSide
        {
            Left = 0,
            Right = 1
        }

        #endregion

        #region Associations

        /// <summary>
        /// Graphs
        /// </summary>
        public IList<Graph> graphs { get; set; }

        #endregion

        #region Constructors

        public GraphItem()
        {
            calc_fnc = CalcFunction.Average;
            drawtype = DrawStyle.Line;
            sortorder = 0;
            type = GraphItemType.Simple;
            yaxisside = YAxisSide.Left;
        }

        #endregion
    }
}<|endoftext|>using ClienteSdayle.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ClienteSdayle
{
    public partial class Form1 : Form
    {
        List<Produtos> listaprodutos;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string url = "https://localhost:44327/api/produto/ConsultarProdutosPorNome/" + textBox1.Text;
            var requisicaoWeb = WebRequest.CreateHttp(url);
            requisicaoWeb.Method = "GET";

            using (var resposta = requisicaoWeb.GetResponse())
            {
                var streamDados = resposta.GetResponseStream();
                StreamReader reader = new StreamReader(streamDados);
                object objResponse = reader.ReadToEnd();
                Console.WriteLine(objResponse.ToString());
                MessageBox.Show(objResponse.ToString());
                Console.ReadLine();
                streamDados.Close();
                resposta.Close();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Produtos p = new Produtos();
            p.Codigo = Convert.ToInt32(textBox2.Text);
            p.Nome = textBox3.Text;
            p.Estoque =Convert.ToInt32(textBox4.Text);
            p.Preco = Convert.ToDouble(textBox5.Text);

            string DATA = JsonConvert.SerializeObject(p);

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://localhost:44327/api/produto");
            request.Method = "POST";
            request.ContentType = "application/json";
            request.ContentLength = DATA.Length;
            using (Stream webStream = request.GetRequestStream())
            using (StreamWriter requestWriter = new StreamWriter(webStream, System.Text.Encoding.ASCII))
            {
                requestWriter.Write(DATA);
            }

            try
            {
                WebResponse webResponse = request.GetResponse();
                using (Stream webStream = webResponse.GetResponseStream() ?? Stream.Null)
                using (StreamReader responseReader = new StreamReader(webStream))
                {
                    string response = responseReader.ReadToEnd();
                    MessageBox.Show(response);
                }
            }
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Produtos p = new Produtos();
            p.Codigo = Convert.ToInt32(textBox2.Text);
            p.Nome = textBox3.Text;
            p.Estoque = Convert.ToInt32(textBox4.Text);
            p.Preco = Convert.ToDouble(textBox5.Text);

            string DATA = JsonConvert.SerializeObject(p);

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://localhost:44327/api/produto");
            request.Method = "PUT";
            request.ContentType = "application/json";
            request.ContentLength = DATA.Length;
            using (Stream webStream = request.GetRequestStream())
            using (StreamWriter requestWriter = new StreamWriter(webStream, System.Text.Encoding.ASCII))
            {
                requestWriter.Write(DATA);
            }

            try
            {
                WebResponse webResponse = request.GetResponse();
                using (Stream webStream = webResponse.GetResponseStream() ?? Stream.Null)
                using (StreamReader responseReader = new StreamReader(webStream))
                {
                    string response = responseReader.ReadToEnd();
                    MessageBox.Show(response);
                }
            }
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }

        }

        private void button4_Click(object sender, EventArgs e)
        {
            string url = "https://localhost:44327/api/produto/ConsultarProdutos/";
            var requisicaoWeb = WebRequest.CreateHttp(url);
            requisicaoWeb.Method = "GET";

            using (var resposta = requisicaoWeb.GetResponse())
            {
                var streamDados = resposta.GetResponseStream();
                StreamReader reader = new StreamReader(streamDados);
                object objResponse = reader.ReadToEnd();
                listaprodutos = JsonConvert.DeserializeObject<List<Produtos>>(objResponse.ToString());
                Console.WriteLine(objResponse.ToString());
                Console.ReadLine();
                streamDados.Close();
                resposta.Close();
            }
            dataGridView1.DataSource = listaprodutos;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            string url = "https://localhost:44327/api/produto/ExcluirProduto/" + textBox6.Text;
            var requisicaoWeb = WebRequest.CreateHttp(url);
            requisicaoWeb.Method = "DELETE";

            using (var resposta = requisicaoWeb.GetResponse())
            {
                var streamDados = resposta.GetResponseStream();
                StreamReader reader = new StreamReader(streamDados);
                object objResponse = reader.ReadToEnd();
                Console.WriteLine(objResponse.ToString());
                MessageBox.Show(objResponse.ToString());
                Console.ReadLine();
                streamDados.Close();
                resposta.Close();
            }

        }
    }
}<|endoftext|>using HandMock;

namespace HandMockTest
{
    public class _printer : IPrinter
    {
        private bool isCalled =


                if (!writtenFiles.Add(file.ToUpper()))
                {
                    Console.WriteLine("Url \"{0}\" has been downloaded.", url);
                }
                else
                {
                    Console.WriteLine("Downloading \"{0}\"...", url);
                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(rootUrl + url);
                    request.Method = "GET";
                    try
                    {
                        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                        if (response.StatusCode != HttpStatusCode.OK)
                        {
                            Console.WriteLine("This web page cannot be found.");
                        }
                        else
                        {
                            if (!file.StartsWith(outputPath))
                            {
                                Console.WriteLine("This file cannot be downloaded into the specified output directory.");
                            }
                            else
                            {
                                Console.WriteLine("Writing to \"{0}\"...", file.Substring(outputPath.Length));

                                List<byte[]> buffers = new List<byte[]>();
                                using (Stream stream = response.GetResponseStream())
                                {
                                    while (true)
                                    {
                                        int size = 65536;
                                        byte[] buffer = new byte[size];
                                        int read = stream.Read(buffer, 0, size);
                                        if (read <= 0)
                                        {
                                            break;
                                        }
                                        else if (read == size)
                                        {
                                            buffers.Add(buffer);
                                        }
                                        else
                                        {
                                            byte[] readBuffer = new byte[read];
                                            Array.Copy(buffer, readBuffer, read);
                                            buffers.Add(readBuffer);
                                        }
                                    }
                                }

                                byte[] fullBuffer = new byte[buffers.Select(b => b.Length).Sum()];
                                int offset = 0;
                                foreach (var buffer in buffers)
                                {
                                    Array.Copy(buffer, 0, fullBuffer, offset, buffer.Length);
                                    offset += buffer.Length;
                                }

                                using (Stream stream = new FileStream(file, FileMode.Create, FileAccess.Write))
                                {
                                    stream.Write(fullBuffer, 0, fullBuffer.Length);
                                }

                                switch (Path.GetExtension(file).ToUpper())
                                {
                                    case ".HTML":
                                    case ".HTM":
                                        using (StreamReader reader = new StreamReader(new MemoryStream(fullBuffer, false), Encoding.UTF8, true))
                                        {
                                            string text = reader.ReadToEnd();
                                            SearchForUrls(rootUrl, url, text, relativeUrls, relativeUrlsHash);
                                        }
                                        break;
                                }
                            }
                        }
                        response.Close();
                    }
                    catch (WebException)
                    {
                        deadUrls.Add(url);
                    }
                }
            }

            Console.WriteLine("========================FINISHED================================");
            Console.WriteLine("The following urls are failed to download:");
            using (StreamWriter writer = new StreamWriter(outputPath + "\\DeadUrls.txt"))
            {
                foreach (var url in deadUrls)
                {
                    Console.WriteLine(url);
                    writer.WriteLine(url);
                }
            }
        }
    }
}<|endoftext|>#include "Circle.h"
#include <iostream>
#define M_PI       3.14159265358979323846   // pi
Circle::Circle() {
	radius = 1.0;
}

Circle::Circle(int x, int y, double radius) :Figure(x,y) {
	this->radius = radius;
}

void Circle::info() {
	Figure::info();
	std::cout << " r: " << radius << std::endl;
}

double Circle::perimeter() {
	return 2*M_PI * radius;
}

double Circle::square() {
	return M_PI * radius * radius;
}<|endoftext|>#include<iostream>
using namespace std;

class Shubh{
	public:
	int num;

	Shubh(int a){

	num=a;

		}

	Shubh(){

	}

	Shubh operator+(Shubh ShubhObj){

	Shubh ShubhObjNew;
	ShubhObjNew.num=num+ShubhObj.num;
	return(ShubhObjNew);

	}

};

int main(){

Shubh a(4);
Shubh b(4);
Shubh c;
c=a+b;
cout<<c.num;

return 0;
}<|endoftext|>using UnityEngine;

public class EnemyManager : MonoBehaviour
{
    public GameObject enemy;                // The enemy prefab to be spawned.
    public GameObject boss;
    public float spawnTime = 0.1f;            // How long between each spawn.
    public Transform[] spawnPoints;         // An array of the spawn points this enemy can spawn from.
    public GameObject gs;
    private HUD hud;
    public GameObject wave;
    private int spawnPointIndex = 0;
    void Start()
    {
        // Call the Spawn function after a delay of the spawnTime and then continue to call after the same amount of time.
        gs = GameObject.FindGameObjectWithTag("game-system");
        hud = FindObjectOfType<HUD>();
        InvokeRepeating("Spawn", spawnTime, spawnTime);
    }

    void SpawnBoss()
    {
        // Find a random index between zero and one less than the number of spawn points.
        if (hud.spawning == 2)
        {
            GameObject clone = Instantiate(boss, spawnPoints[7].position, spawnPoints[7].rotation) as GameObject;
            wave = GameObject.FindGameObjectWithTag("wave");
            clone.transform.parent = wave.transform;
            if (spawnPointIndex >= hud.numEnemies - 1)
            {
                hud.spawning = 0;
            }
            else
            {
                hud.spawning = 2;
            }
            spawnPointIndex += 1;
        }
        else
        {
            spawnPointIndex = 0;
        }
    }

    void Spawn()
    {

        // Find a random index between zero and one less than the number of spawn points.
        if (hud.spawning == 1)
        {
            GameObject clone = Instantiate(enemy, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation) as GameObject;
            wave = GameObject.FindGameObjectWithTag("wave");
            clone.transform.parent = wave.transform;
            if (spawnPointIndex >= hud.numEnemies - 1)
            {
                hud.spawning = 0;
            }
            else
            {
                hud.spawning = 1;
            }
            spawnPointIndex += 1;
        }
        else if (hud.spawning == 2)
        {
            SpawnBoss();
        }
        else
        {
            spawnPointIndex = 0;
        }
        hud.initialSpawn = false;
    }
}<|endoftext|>// Assignmentquestion26.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include "pch.h"
#include <iostream>
#include<windows.h>
#define MAX_THREADS 3

using namespace std;
HANDLE hEvent;

DWORD WINAPI WordCount(PVOID param)
{
	//wait till one event becomes signalled
	WaitForSingleObject(hEvent, INFINITE);
	Sleep(2000);

	cout << "counting words\n";

	//to change event to signalled
	SetEvent(hEvent);

	return 1;
}
DWORD WINAPI SpellCheck(PVOID param)
{
	WaitForSingleObject(hEvent, INFINITE);
	Sleep(3000);

	cout << "checking spellings\n";

	//to change event to signalled
	SetEvent(hEvent);

	return 1;
}

DWORD WINAPI GrammarCheck(PVOID param)
{
	WaitForSingleObject(hEvent, INFINITE);
	Sleep(4000);
	cout << "checking grammar\n";

	SetEvent(hEvent);
	return 1;
}

int main(int argc,char *argv[])
{
	hEvent = CreateEvent(
		NULL,
		TRUE,//MANUAL RESET EVENT WILL BE CREATED
		FALSE, //INITIAL STATE NON SIGNALLED
		NULL
	);
	HANDLE hThread[MAX_THREADS];
	DWORD dwThread[MAX_THREADS];

	unsigned int i = 0;
	hThread[i] = CreateThread(
		NULL,
		0,
		WordCount,
		NULL,
		0,
		&dwThread[i]
	);

	if (INVALID_HANDLE_VALUE == hThread[i])
	{
		cout << "thread creation failed with error " << GetLastError() << endl;
		getchar();
		return 1;
	}

	i++;
	hThread[i] = CreateThread(
		NULL,
		0,
		SpellCheck,
		NULL,
		0,
		&dwThread[i]
	);

	if (INVALID_HANDLE_VALUE == hThread[i])
	{
		cout << "thread creation failed with error " << GetLastError() << endl;
		getchar();
		return 1;
	}

	i++;

	hThread[i] = CreateThread(
		NULL,
		0,
		GrammarCheck,
		NULL,
		0,
		&dwThread[i]
	);

	if (INVALID_HANDLE_VALUE == hThread[i])
	{
		cout << "thread creation failed with error " << GetLastError() << endl;
		getchar();
		return 1;
	}

	cout << "opening the file\n";
	Sleep(5000);

	SetEvent(hEvent);

	WaitForMultipleObjects(MAX_THREADS, hThread, TRUE,INFINITE );
	cout << "waiting for user input before exiting\n";

	getchar();
	return 0;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file<|endoftext|>#ifndef COPLUS_UTIL_H


_t i=0; auto& v : bulkin)
        v = i++;  // fill bulkin with integers.

    auto range_of_ptrs_into_bulkin =
        views::iota(size_t(0), Nprf) |
        views::transform([&bulkin](auto i){
                             auto p  = &bulkin[0] + i*prf_input_count;
                             *p += 1; // *MODIFIES* bulkin.  So different randoms every time!
                             return p;
                         });

    perf = timeit(std::chrono::seconds(5),
                  [&rprf, &range_of_ptrs_into_bulkin](){
                      prf_output_value_type bulkout[bulkN];
                      PRF{}.generate(range_of_ptrs_into_bulkin,
                                     begin(bulkout));
                      rprf = accumulate(begin(bulkout), end(bulkout), rprf, bit_xor<decltype(rprf)>{});
                  });
    cout << "calling " << name << " directly (" << bulkN << " at a time): " << (rprf==0?" (zero?!) ":"");
    cout << perf.iter_per_sec()/1e6 << " Miters/sec";
    Gbytes_per_iter = 1.e-9*(bulkN*PRF::output_word_size)/bits_per_byte;
    cout << " approx " << perf.iter_per_sec() *  Gbytes_per_iter <<  " GB/s\n";

    using engine_type = counter_based_engine<PRF, 64/PRF::input_word_size>;
    using engine_result_type = engine_type::result_type;
    static constexpr size_t engine_word_size = engine_type::word_size;
    engine_type engine;
    engine_result_type r = 0;
    perf = timeit(chrono::seconds(5),
                           [&](){
                               r ^= engine();
                           });
    cout << "calling " << name << " through engine (1 at a time): " << (r==0?" (zero?!) ":"");
    cout << perf.iter_per_sec()/1e6 << " Miters/sec";
    Gbytes_per_iter = 1.e-9 * engine_word_size/bits_per_byte;
    cout << " approx " << perf.iter_per_sec() * Gbytes_per_iter <<  " GB/s\n";

    perf = timeit(chrono::seconds(5),
                           [&](){
                               array<engine_result_type, bulkN> bulk;
                               engine(begin(bulk), end(bulk));
                               r = accumulate(begin(bulk), end(bulk), r, bit_xor<engine_result_type>{});
                           });
    cout << "calling " << name << " through engine (" << bulkN << " at a  time): " << (r==0?" (zero?!) ":"");
    cout << perf.iter_per_sec()/1e6 << " Miters/sec";
    Gbytes_per_iter = 1.e-9 * bulkN*engine_word_size/bits_per_byte;
    cout << " approx " << perf.iter_per_sec() * Gbytes_per_iter <<  " GB/s\n";
}

// a minimal prf that copies inputs to outputs - useful for estimating
// function call and related overheads
class null_prf{
public:
    static constexpr size_t input_word_size=64;
    static constexpr size_t input_count = 4;
    static constexpr size_t output_word_size=64;
    static constexpr size_t output_count = 4;
    using input_value_type = uint64_t;
    using output_value_type = uint64_t;
    template <detail::integral_input_range InRange, weakly_incrementable O>
    void operator()(InRange&& in, O result) const{
        ranges::copy(in, result);
    }
};

#define MAPPED(prf) {string(#prf), function<void(string)>(&doit<prf>)}
#define _ ,
map<string, function<void(string)>> dispatch_map = {
                                                    //    MAPPED(uint64_t, null_prf),
    MAPPED(threefry4x64_prf),
    MAPPED(threefry2x64_prf),
    MAPPED(threefry4x32_prf),
    MAPPED(threefry2x32_prf),

    MAPPED(philox4x64_prf),
    MAPPED(philox2x64_prf),
    MAPPED(philox4x32_prf),
    MAPPED(philox2x32_prf),

    MAPPED(siphash_prf<4>),
    MAPPED(siphash_prf<16>),
};

int main(int argc, char**argv){
    cout << setprecision(2);
    if(argc == 1){
        for(auto& p : dispatch_map)
            p.second(p.first);
        return 0;
    }
    for(auto p = argv+1; *p; p++){
        auto found = dispatch_map.find(string(*p));
        if(found != dispatch_map.end())
            found->second(found->first);
        else
            cout << *p << " not found in dispatch map\n";
    }
    return 0;
}<|endoftext|>#include <unordered_set>
class Solution {
public:
    bool checkIfPangram(string sentence) {
        std::unordered_set<char> s;
        for (char c : sentence) {
            s.insert(c);
        }
        return s.size() == 26;
    }
};<|endoftext|>int lowestLED = 2;
int highestLED = 7;
int interval = 1000;
unsigned long lastTick = 0;
unsigned long lastReset = 0;

void setup() {
  for(int pinNum = lowestLED; pinNum <= highestLED; pinNum++) {
    pinMode(pinNum, OUTPUT);
  }
}

void loop() {
  tick();
  lightUpLEDs(currentIntervalNumber());
}

int currentIntervalNumber() {
  int currentInterval = 0;
  unsigned long currentTime = millis() - lastReset;

  for(int i = 0; i <= 6; i++) {
    if(currentTime >= interval * (i + 1)) {
      currentInterval = i;
    }
  }

  return currentInterval;
}

void tick() {
  lastTick = millis();
  if(lastTick - lastReset > 8000) {
    resetTimer();
  }
}

void resetTimer() {
  lastReset = millis();
}

void lightUpLEDs(int num) {
  for(int pinNum = lowestLED; pinNum <= highestLED; pinNum++) {
    if(pinNum < lowestLED + num) {
      digitalWrite(pinNum, HIGH);
    } else {
      digitalWrite(pinNum, LOW);
    }
  }
}<|endoftext|>#include "pxr/base/vt/array.h"
#include "pxr/base/vt/value.h"
#include "pxr/usd/usd/primRange.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdGeom/mesh.h"
#include "pxr/usd/usdGeom/points.h"

// pxrInternal_v0_21__pxrReserved__::UsdStage::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pxrInternal_v0_21__pxrReserved__::UsdStage::InitialLoadSet)
//
#include <iostream>
//#include <string>

int main(int argc, char *argv[]) {
  if (argc != 2) {
    std::cerr << "USAGE: " << argv[0] << " <USDArchive.usd>" << std::endl;
    return 1;
  }

  std::string filename{argv[1]};

  auto stage = pxr::UsdStage::Open(filename);
  if (!stage) {
    std::cerr << "ERROR: Could not open file: " << filename << std::endl;
    return 2;
  }
  std::cout << "Loaded stage from file: " << filename << std::endl;
  if (stage) {
    for (auto const &prim : stage->TraverseAll()) {
      std::cout << prim.GetPath().GetText() << std::endl;
      if (prim.IsA<pxr::UsdGeomMesh>()) {
        std::cout << "\t... which is a mesh!" << std::endl;
        pxr::UsdGeomMesh const mesh{prim};
        for (auto const &attr : prim.GetAttributes()) {
          std::cout << "\t... attr: " << attr.GetTypeName() << ", "
                    << attr.GetBaseName() << std::endl;
        }
        auto const face_vertex_indices_attr = mesh.GetFaceVertexIndicesAttr();
        std::cout << "\t number of time samples for face vertices: "
                  << face_vertex_indices_attr.GetNumTimeSamples() << std::endl
                  << "\t does it have a value? "
                  << face_vertex_indices_attr.HasValue() << std::endl;
        pxr::VtArray<int> face_vertices;
        if (!face_vertex_indices_attr.Get(&face_vertices, 0)) {
          std::cerr << "\tCouldn't get face vertices attr value" << std::endl;
          return -1;
        } else {
          std::cout << "\t face vertex indices count: " << face_vertices.size()
                    << std::endl;
        }

      } else if (prim.IsA<pxr::UsdGeomPoints>()) {
        std::cout << "\t... which is a geom points!" << std::endl;
        pxr::UsdGeomPoints const points{prim};
        for (auto const &attr : prim.GetAuthoredAttributes()) {
          std::


 .Include(x => x.Students)
                .AsNoTracking()
                .IgnoreAutoIncludes<Assigment>()
                .ToListAsync();
        }

        // GET: api/Assigments/5
        [HttpGet("{id}")]
        public async Task<ActionResult<Assigment>> GetAssigment(int id)
        {
            var assigment = await _context.Assigment
                .Include(x => x.Students)
                .FirstOrDefaultAsync(x => x.Id == id);

            if (assigment == null)
            {
                return NotFound();
            }

            return assigment;
        }

        // PUT: api/Assigments/5
        // To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
        [HttpPut("{id}")]
        public async Task<IActionResult> PutAssigment(int id, Assigment assigment)
        {
            if (id != assigment.Id)
            {
                return BadRequest();
            }

            _context.Entry(assigment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AssigmentExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return NoContent();
        }

        // POST: api/Assigments
        // To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
        [HttpPost]
        public async Task<ActionResult<Assigment>> PostAssigment(Assigment assigment)
        {
            var st = _context.Assigment.Include(s => s.Students).Where(x => x.Id == assigment.Id).First();
            var asigment = (List<Student>)assigment.Students;
            if (asigment.Any())
            {
                asigment.ForEach(item => st.Students.Add(item));
            }

            return CreatedAtAction("GetAssigment", new { id = assigment.Id }, assigment);
        }

        // DELETE: api/Assigments/5
        [HttpDelete("{id}")]
        public async Task<IActionResult> DeleteAssigment(int id)
        {
            var assigment = await _context.Assigment.FindAsync(id);
            if (assigment == null)
            {
                return NotFound();
            }

            _context.Assigment.Remove(assigment);
            await _context.SaveChangesAsync();

            return NoContent();
        }

        private bool AssigmentExists(int id)
        {
            return _context.Assigment.Any(e => e.Id == id);
        }
    }
}<|endoftext|>using System;
using System.Data.Common;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Npgsql.BackendMessages;
using Npgsql.Internal.TypeHandlers;
using Npgsql.PostgresTypes;

namespace Npgsql.Internal.TypeHandling;

/// <summary>
/// Base class for all type handlers, which read and write CLR types into their PostgreSQL
/// binary representation. Unless your type is arbitrary-length, consider inheriting from
/// <see cref="NpgsqlSimpleTypeHandler{T}"/> instead.
/// </summary>
/// <typeparam name="TDefault">
/// The default CLR type that this handler will read and write. For example, calling <see cref="DbDataReader.GetValue"/>
/// on a column with this handler will return a value with type <typeparamref name="TDefault"/>.
/// Type handlers can support additional types by implementing <see cref="INpgsqlTypeHandler{T}"/>.
/// </typeparam>
public abstract class NpgsqlTypeHandler<TDefault> : NpgsqlTypeHandler, INpgsqlTypeHandler<TDefault>
{
    protected NpgsqlTypeHandler(PostgresType postgresType) : base(postgresType) {}

    #region Read

    /// <summary>
    /// Reads a value of type <typeparamref name="TDefault"/> with the given length from the provided buffer,
    /// using either sync or async I/O.
    /// </summary>
    /// <param name="buf">The buffer from which to read.</param>
    /// <param name="len">The byte length of the value. The buffer might not contain the full length, requiring I/O to be performed.</param>
    /// <param name="async">If I/O is required to read the full length of the value, whether it should be performed synchronously or asynchronously.</param>
    /// <param name="fieldDescription">Additional PostgreSQL information about the type, such as the length in varchar(30).</param>
    /// <returns>The fully-read value.</returns>
    public abstract ValueTask<TDefault> Read(NpgsqlReadBuffer buf, int len, bool async, FieldDescription? fieldDescription = null);

    // Since TAny isn't constrained to class? or struct (C# doesn't have a non-nullable constraint that doesn't limit us to either struct or class),
    // we must use the bang operator here to tell the compiler that a null value will never returned.
    public override async ValueTask<object> ReadAsObject(NpgsqlReadBuffer buf, int len, bool async, FieldDescription? fieldDescription = null)
        => (await Read(buf, len, async, fieldDescription))!;

    #endregion Read

    #region Write

    /// <summary>
    /// Called to validate and get the length of a value of a generic <see cref="NpgsqlParameter{T}"/>.
    /// </summary>
    public abstract int ValidateAndGetLength(TDefault value, [NotNullIfNotNull(nameof(lengthCache))] ref NpgsqlLengthCache? lengthCache, NpgsqlParameter? parameter);

    /// <summary>
    /// Called to write the value of a generic <see cref="NpgsqlParameter{T}"/>.
    /// </summary>
    public abstract Task Write(TDefault value, NpgsqlWriteBuffer buf, NpgsqlLengthCache? lengthCache, NpgsqlParameter? parameter, bool async, CancellationToken cancellationToken = default);

    #endregion Write

    #region Misc

    public override Type GetFieldType(FieldDescription? fieldDescription = null) => typeof(TDefault);

    /// <inheritdoc />
    public override NpgsqlTypeHandler CreateArrayHandler(PostgresArrayType pgArrayType, ArrayNullabilityMode arrayNullabilityMode)
        => new ArrayHandler(pgArrayType, this, arrayNullabilityMode);

    /// <inheritdoc />
    public override NpgsqlTypeHandler CreateRangeHandler(PostgresType pgRangeType)
        => new RangeHandler<TDefault>(pgRangeType, this);

    /// <inheritdoc />
    public override NpgsqlTypeHandler CreateMultirangeHandler(PostgresMultirangeType pgMultirangeType)
        => new MultirangeHandler<TDefault>(pgMultirangeType, (RangeHandler<TDefault>)CreateRangeHandler(pgMultirangeType.Subrange));

    #endregion Misc
}<|endoftext|>#include <iostream>
using namespace std;

class IntArray
{
public:
explicit IntArray(size_t size)
: size_(size), data_(new int[size])
{}
~IntArray() { delete [] data_; }
int & get(size_t i) { return data_[i]; }
size_t size() { return size_; }

void resize(size_t nsize)
{
int * ndata = new int[nsize];
size_t n = nsize > size_ ? size_ : nsize;
for (size_t i = 0; i != n; ++i)
ndata[i] = data_[i];
delete [] data_;
data_ = ndata;
size_ = nsize;
}

IntArray(IntArray const& a)
: size_(a.size_), data_(new int[size_])
{
for (size_t i = 0; i != size_; ++i)
data_[i] = a.data_[i];
}

IntArray & operator=(IntArray const& a) {
if (this != &a) {
delete [] data_;
size_ = a.size_;
data_ = new int[size_];
for (size_t i = 0; i != size_; ++i)
data_[i] = a.data_[i];
}
return *this;
}

void swap(IntArray & a) {
size_t const t1 = size_;
size_ = a.size_;
a.size_ = t1;
int * const t2 = data_;
data_ = a.data_;
a.data_ = t2;
}

private:
size_t size_;
int * data_;
};
int main() {
    IntArray a1(10);
IntArray a2(20);
IntArray a3 = a1; // копирование
a2 = a1; // присваивание
    return 0;
}<|endoftext|>using TMPro;
using UnityEngine;

public class FPSCounter : MonoBehaviour
{
    private TMP_Text fpsTextField = null;

    private float frameTime = 0.0f;
    private float fps = 0.0f;
    private float fpsTimer = 0.0f;
    private int fpsCounter = 0;

    private void Start()
    {
        fpsTextField = GetComponent<TMP_Text>();
    }

    // Update is called once per frame
    void Update()
    {
        if (this.gameObject.activeSelf)
        {
            this.frameTime = Time.unscaledDeltaTime;

            fpsCounter++;
            fpsTimer += this.frameTime;
            if (this.fpsTimer > 1.0f)
            {
                this.fps = (float)this.fpsCounter / this.fpsTimer;
                this.fpsTimer -= 1.0f;
                this.fpsCounter = 0;
            }

            fpsTextField.text = string.Format("{0:F} FPS", this.fps);
        }
    }
}<|endoftext|>#include "std_lib_facilities.h"

int main(void) {
	int i1;
	int i2;
	int i3;

	cout << "Please type three integers separated by spaces, then hit enter: ";
	cin >> i1;
	cin >> i2


d: checkTypeTravStmt: return type error\n", s->lineno);
          return -1;
        }
        return 0;
      }
      break;
    case writeK:
      tk = expOfType(t, s->val.write);
      if(tk != intK && tk != boolK){
        fprintf(stderr, "type of expression to be written is not int og bool");
      }
      break;
    case allocateK:
      //check if variable.id is a var or a record not a function
      sym = getSymbol(t, s->val.allocate->val.id);
      if(sym == NULL){
        fprintf(stderr,"Symbol '%s' was not found\n", s->val.allocate->val.id);
      }
      if(sym->kind == funcK){
        fprintf(stderr,"Cannot allocate a function\n");
        break;
      }
      break;
    case allocateLengthK:
      //check if variable.id is a var or a record not a function
      //check if expression is a INT
      sym = getSymbol(t, s->val.allocatelength.var->val.id);
      if(s == NULL){
        fprintf(stderr,"Symbol '%s' was not found\n", s->val.allocatelength.var->val.id);
      }
      if(s->kind == funcK){
        fprintf(stderr,"Cannot allocate a function\n");
        break;
      }
      tk = expOfType(t, s->val.allocatelength.exp);
      //type = s->val.allocatelength.exp->type;
      if(tk != intK){
        fprintf(stderr,"Amount to be allocated is not a number\n");
      }
      break;
    case assiK:
      fprintf(stderr,"Line '%d': checkTypeTravStmt: assiK\n", s->lineno);
      //check if expression type is the same as variable type
      //sym = getSymbol(t, s->val.assign.var->val.id);
      SYMBOL *sym = NULL;
      type = checkTypeTravVar(t, s->val.assign.var, &sym);
      //TODO: check for NULL type and symbol
      if(type == NULL){
        fprintf(stderr, "Line %d: Unfortunately no type where found\n", s->lineno);
        return -1;
      }
      if(type->kind != recordK){ //Changed this from == to != ***********************************
        error = compareTypeNExp(t, type, s->val.assign.exp);
      }
      else{
        error = compareSymNExp(t, sym, s->val.assign.exp);
      }
      if(error == -1){
        fprintf(stderr, "Line %d: The two sides of the assignment does not have the same type\n", s->lineno);
        return -1;
      }
      return 0;
      break;
    case ifK:
      //check if the expression is bool
      tk = expOfType(t, s->val.ifthenelse.cond);
      //typekind = s->val.ifthenelse.cond->type;
      if(tk != boolK){
        fprintf(stderr,"Type of condition in if-statmemt should be boolean\n");
      }
      //traverse body
      checkTypeTravStmt(t, s->val.ifthenelse.thenbody, funcId);
      break;
    case thenK:
      //check if the expression is bool
      tk = expOfType(t, s->val.ifthenelse.cond);
      //typekind = s->val.ifthenelse.cond->type;
      if(tk != boolK){
        fprintf(stderr,"Type of condition in if-statmemt should be boolean\n");
      }
      //traverse both bodies
      checkTypeTravStmt(t, s->val.ifthenelse.thenbody, funcId);
      checkTypeTravStmt(t, s->val.ifthenelse.elsebody, funcId);
      break;
    case whileK:
      //check if the expression is bool
      tk = expOfType(t, s->val.ifthenelse.cond);
      //typekind = s->val.while_.cond->type;
      if(tk != boolK){
        fprintf(stderr,"Type of condition in if-statmemt should be boolean\n");
      }
      //traverse body
      checkTypeTravStmt(t, s->val.while_.body, funcId);
      break;
    case listStmtK:
      //traverse statements
      checkTypeTravStmts(t, s->val.list, funcId);
      break;
  }
  return 0;
}
// int checkTypeTravVar(SymbolTable *t, VARIABLE *v, SYMBOL **sym, TYPE **type){
//   fprintf(stderr, "checkTypeTravVar: going into\n");
//   SYMBOL *symVal;
//   Typekind typekind;
//   switch (v->kind) {
//     case idVarK:
//       symVal = getSymbol(t, v->val.id);
//       if(symVal == NULL){
//         fprintf(stderr, "Line %d: idVarK: Symbol '%s' was not found\n",v->lineno, v->val.id);
//         return -1;
//       }
//       //fprintf(stderr, "Line %d: Variable '%s' was found\n",v->lineno, v->val.id);
//       *sym = symVal;
//       return (*sym)->type;
//       break;
//     case expK:
//       //sym = getSymbol(t, s->val.assign.var->val.varexp.id);
//       fprintf(stderr, "Line %d: Cannot typecheck array assignment yet\n", v->lineno);
//       if(v->val.varexp.exp->type != intK){
//
//       }
//       typekind = checkTypeTravVar(t, v->val.varexp.var, sym, type);
//       if(typekind == arrayK){
//         *type = (*type)->val.arrayType;
//         return (*type)->kind;
//       }
//       else{
//         (*type) = (*sym)->arrayType;
//         return (*sym)->type; //eller (*type)->kind
//       }
//       break;
//     case dotK:
//       //sym = getSymbol(t, NameOfStruct);
//       ;
//       typekind = checkTypeTravVar(t, v->val.vardot.var, sym, type);
//       if(*sym == NULL){
//         fprintf(stderr, "Line %d: checkTypeTravVar: something went wrong\n", v->lineno);
//         fprintf(stderr, "Line %d: Could not find struct containing '%s'\n", v->lineno, v->val.vardot.id );
//         return -1;
//         break;
//       }
//       if((*sym)->content == NULL){
//         fprintf(stderr, "Line %d: holy shit, the struct '%s' does not have any content", v->lineno, (*sym)->name);
//         return -1;
//       }
//       *sym = getSymbol((*sym)->content, v->val.vardot.id);
//       if(*sym == NULL){
//         fprintf(stderr, "Line %d: dotK: Symbol '%s' was not found\n",v->lineno, v->val.vardot.id);
//         return -1;
//       }
//       return (*sym)->type;
//       break;
//   }
//   return -1; //compiler warning
// }

TYPE* checkTypeTravVar(SymbolTable *t, VARIABLE *v, SYMBOL **sym){
  fprintf(stderr, "checkTypeTravVar: going into\n");
  SYMBOL *sym2;
  Typekind typekind;
  TYPE *type;
  switch (v->kind) {
    case idVarK:
      sym2 = getSymbol(t, v->val.id);
      if(sym2 == NULL){
        fprintf(stderr, "Line %d: idVarK: Symbol '%s' was not found\n",v->lineno, v->val.id);
        return NULL;
      }
      //fprintf(stderr, "Line %d: Variable '%s' was found\n",v->lineno, v->val.id);
      (*sym) = sym2;
      return sym2->typePtr;
      break;
    case expK:
      //sym = getSymbol(t, s->val.assign.var->val.varexp.id);
      fprintf(stderr, "Line %d: Cannot typecheck array assignment yet\n", v->lineno);
      if(expOfType(t, v->val.varexp.exp) != intK){
        fprintf(stderr, "Line %d: The index expression is not an integer type\n", v->lineno);
      }
       TYPE *type = checkTypeTravVar(t, v->val.varexp.var, sym);
       if(type == NULL){
         fprintf(stderr, "Line %d: The array type does not exist\n", v->lineno);
         return NULL;
       }
       if(type->kind == errorK){
         fprintf(stderr, "Line %d: Hopefully the error has already been printed\n", v->lineno);
         return NULL;
       }
       if((type) == idK){
         *sym = recursiveSymbolRetrieval(t, type->val.id);
         if(*sym == NULL){
           fprintf(stderr, "Line %d: The symbol '%s' was not found", v->lineno, type->val.id);
           return NULL;
         }
         if((*sym)->typeVal != arrayK){
           fprintf(stderr, "Line %d: the symbol '%s' of type '%d' was not found to be an array\n", v->lineno, (*sym)->name, (*sym)->typeVal);
           return NULL;
         }
       }
       type = (*sym)->typePtr;
       if(type->kind != arrayK){
         fprintf