Czy można pisać testy bez takich bibliotek jak JUnit, TestNG i festAssert? Mockować bez Mockito? Łapać wyjątki bez catch-exception? Oczywiście, że można. Odpowiedzią jest Spock.
Podczas prezentacji przyjrzymy się możliwościom Spocka w testowaniu kodu javowego i grooviowego. Zobaczymy jak pisać w stylu given-when-then, sprawdząć warunki nie używając słowa "assert", jak zasilać testy danymi, udawać, że mamy zależności testowanego obiektu i pisać testy integracyjne z podniesionym kontekstem springa.
The document shows an example Java class called HelloWorld that contains a greeting method to return the string "Hello" plus a name. It then demonstrates initializing an instance of the class, setting the name, and calling the greet method to print the greeting. The document also shows how this example is translated to use Groovy instead of Java.
This document provides examples of Python code snippets covering various topics like Python basics (print, variables, data types), conditional statements (if-else), loops (for, while), functions, object oriented programming (classes, inheritance), file handling, modules, database connectivity (MySQL, Redis), XML/HTML parsing and web scraping. It also shows code for installing and importing various third party Python libraries and modules.
The Ring programming language version 1.10 book - Part 56 of 212Mahmoud Samir Fayed
1. Load the Allegro library by loading the gamelib.ring file
2. Initialize Allegro and set up the display
3. Create bitmaps and draw objects onto the display
4. Add animation by moving objects and redrawing the display periodically
5. Handle user input events from the keyboard and mouse
6. Use a game loop to continuously update the display based on input
Paco van der Linden, werkzaam als Senior ADF Ontwikkelaar bij AMIS, heeft met Groovy een aantal interessante oplossingen ontwikkeld. De kennis en ervaring die hij daarbij met Groovy in combinatie met Java (en ADF) heeft opgedaan, heeft hij op maandag 26 november gedeeld in een kennissessie.
Slides from my GeeCON 2014 Prague talk:
"Groovy is a dynamic language that provides different types of metaprogramming techniques. In this talk we’ll mainly see runtime metaprogramming. I’ll explain Groovy Meta-Object-Protocol (MOP), the metaclass, how to intercept method calls, how to deal with method missing and property missing, the use of mixins, traits and categories. All of these topics will be explained with examples in order to understand them.
Also, I’ll talk a little bit about compile-time metaprogramming with AST Transformations. AST Transformations provide a wonderful way of manipulating code at compile time via modifications of the Abstract Syntax Tree. We’ll see a basic but powerful example of what we can do with AST transformations."
The code is available at: https://github.com/lmivan/geecon2014-prague-metaprograming-with-groovy
The Ring programming language version 1.5.2 book - Part 45 of 181Mahmoud Samir Fayed
1. Initialize Allegro and load necessary addons like images.
2. Create a display and show a message box to initialize the window.
3. Draw shapes and bitmaps to the display and flip periodically to animate.
4. Set up event handling for input from keyboard, mouse, and timer to control animation.
5. Inside the game loop: handle input, update object positions, redraw, and flip display continuously.
The document shows an example Java class called HelloWorld that contains a greeting method to return the string "Hello" plus a name. It then demonstrates initializing an instance of the class, setting the name, and calling the greet method to print the greeting. The document also shows how this example is translated to use Groovy instead of Java.
This document provides examples of Python code snippets covering various topics like Python basics (print, variables, data types), conditional statements (if-else), loops (for, while), functions, object oriented programming (classes, inheritance), file handling, modules, database connectivity (MySQL, Redis), XML/HTML parsing and web scraping. It also shows code for installing and importing various third party Python libraries and modules.
The Ring programming language version 1.10 book - Part 56 of 212Mahmoud Samir Fayed
1. Load the Allegro library by loading the gamelib.ring file
2. Initialize Allegro and set up the display
3. Create bitmaps and draw objects onto the display
4. Add animation by moving objects and redrawing the display periodically
5. Handle user input events from the keyboard and mouse
6. Use a game loop to continuously update the display based on input
Paco van der Linden, werkzaam als Senior ADF Ontwikkelaar bij AMIS, heeft met Groovy een aantal interessante oplossingen ontwikkeld. De kennis en ervaring die hij daarbij met Groovy in combinatie met Java (en ADF) heeft opgedaan, heeft hij op maandag 26 november gedeeld in een kennissessie.
Slides from my GeeCON 2014 Prague talk:
"Groovy is a dynamic language that provides different types of metaprogramming techniques. In this talk we’ll mainly see runtime metaprogramming. I’ll explain Groovy Meta-Object-Protocol (MOP), the metaclass, how to intercept method calls, how to deal with method missing and property missing, the use of mixins, traits and categories. All of these topics will be explained with examples in order to understand them.
Also, I’ll talk a little bit about compile-time metaprogramming with AST Transformations. AST Transformations provide a wonderful way of manipulating code at compile time via modifications of the Abstract Syntax Tree. We’ll see a basic but powerful example of what we can do with AST transformations."
The code is available at: https://github.com/lmivan/geecon2014-prague-metaprograming-with-groovy
The Ring programming language version 1.5.2 book - Part 45 of 181Mahmoud Samir Fayed
1. Initialize Allegro and load necessary addons like images.
2. Create a display and show a message box to initialize the window.
3. Draw shapes and bitmaps to the display and flip periodically to animate.
4. Set up event handling for input from keyboard, mouse, and timer to control animation.
5. Inside the game loop: handle input, update object positions, redraw, and flip display continuously.
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebChristian Baranowski
The document discusses Behavior Driven Development (BDD) using Groovy, Spock and Geb. It provides an overview of BDD and defines the given-when-then structure. It then demonstrates various Groovy and Spock features for writing BDD tests including classes, methods, collections, closures, assertions and mock objects. Spock allows writing tests in a readable and expressive manner with support for parameterization and different test lifecycle methods.
The document discusses the tools Spock and Geb for testing in Groovy. It provides arguments for why to use Spock, describes the Given-When-Then structure in Spock tests, and covers Spock blocks, lifecycles, mocking, and the four phases of testing.
The Ring programming language version 1.9 book - Part 53 of 210Mahmoud Samir Fayed
This document provides code examples and documentation for Ring's web application framework. It includes code for user authentication using a database, classes for database access and web controllers, and descriptions of the main classes and methods in the WebLib API for generating HTML pages and handling requests. The document covers key concepts like generating pages dynamically based on request parameters, working with databases using Model classes, and common tasks like cookies, file uploads, and URL encoding.
The Ring programming language version 1.5.4 book - Part 44 of 185Mahmoud Samir Fayed
This document contains code for classes that provide functionality for database operations and model-view-controller (MVC) patterns in Ring.
The Database class handles database connections and queries. The ModelBase class extends Database and provides methods for CRUD operations on a database table based on the class name. The ControllerBase class sets up an associated view and model based on its class name and provides routing functionality. Together these classes provide a framework for building MVC-based applications with Ring that interact with a database.
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)MongoSF
The document appears to be notes from a MongoDB training session that discusses various MongoDB features like MapReduce, geospatial indexes, and GridFS. It also covers topics like database commands, indexing, and querying documents with embedded documents and arrays. Examples are provided for how to implement many of these MongoDB features and functions.
The document appears to be a series of tips for writing clean, readable code in Groovy. Some of the key points mentioned include:
1. Write readable code and comment any tricks or non-obvious parts of the code.
2. Be aware that some clever code may actually be a bug.
3. Use static code analysis tools like IntelliJ IDEA to inspect code quality.
4. Refer to documentation when unsure rather than relying on tricks.
5. Avoid writing code in an overly clever or obfuscated way.
The Ring programming language version 1.3 book - Part 34 of 88Mahmoud Samir Fayed
This document contains code from the datalib.ring library that defines classes for database connectivity and model-view-controller implementation in Ring.
The Database class handles database connections and queries. The ModelBase class extends Database and adds methods for CRUD operations on a model object. It determines the table name from the class name.
The ControllerBase class is the base class for controllers. It dynamically creates the view and model objects based on the controller class name. It also contains routing logic and pagination methods. These classes provide a framework for building MVC applications with Ring and connecting to a database.
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
This document summarizes code from the Ring documentation related to user registration, login, and database classes. It describes classes for users, models, views, controllers, and languages that allow for user registration, login, form views, and routing. It also summarizes the Database, ModelBase, and ControllerBase classes that provide functionality for connecting to databases, executing queries, and managing model data.
The Ring programming language version 1.7 book - Part 48 of 196Mahmoud Samir Fayed
This document provides code examples and documentation for Ring's web library (weblib.ring). It describes classes and methods for generating HTML pages, forms, tables and other elements. This includes the Page class for adding common elements like text, headings, paragraphs etc., the Application class for handling requests, cookies and encoding, and classes representing various HTML elements like forms, inputs, images etc. It also provides an overview of how to create pages dynamically using View and Controller classes along with Model classes for database access.
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
The Ring programming language version 1.4.1 book - Part 13 of 31Mahmoud Samir Fayed
This document provides documentation on Ring's web library API for generating HTML pages and elements. It describes classes and methods for creating pages, adding content and attributes, handling forms, and more. The Page class allows adding various HTML elements to the page content through methods like text(), html(), h1(), etc. The Application class contains methods for encoding, cookies, and page structure. WebLib enables generating complete HTML pages in Ring code.
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Suyeol Jeon
The document contains code snippets demonstrating various Swift programming concepts including variables, constants, types, optionals, functions, classes, structs, enums, and more. Key concepts demonstrated include variable and constant declaration with types, optional binding, functions with parameters and return values, classes and structs with properties and methods, tuples, and enums with associated values and raw values.
Working with Databases and Groovy
This document discusses how to work with databases using Groovy. It covers:
- Connecting to databases and using groovy.sql.Sql to execute queries and statements
- Performing reads and writes like inserting, updating, deleting rows
- Calling stored procedures
- Advanced techniques like transactions, batching, pagination
- Using groovy.sql.DataSet to treat tables as collections
It also briefly introduces using MongoDB and Neo4j with Groovy.
JDD2015: Where Test Doubles can lead you... - Sebastian Malaca PROIDEA
WHERE TEST DOUBLES CAN LEAD YOU...
"With great power comes great responsibility". And Test Double Patterns gives you a great power. Your life is easier, tests lighter and faster.
But someday this power can turn against you.
Each day we are more comfortable with using Test Double Patters. We are creating assumptions. We are mocking services. We are ending with well covered code and tests... that tell us nothing.
That's why it's so important to recognize warning signs. To know the pitfalls that are waiting for us. To know what to do in these situations.
The document discusses patterns for more powerful asserts when doing approval testing. It outlines 7 approaches to asserting values in approval tests, moving from simple number and string assertions to more complex objects, files, automatically generated names, custom verification methods, and using diff tools to compare outputs on failure. The goal is to make approval testing more expressive and tests less cluttered while still using normal test scenarios.
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
This intermediate-level talk will teach you techniques using the popular NoSQL database MongoDB and the Python library Ming to write maintainable, high-performance, and scalable applications. We will cover everything you need to become an effective Ming/MongoDB developer from basic PyMongo queries to high-level object-document mapping setups in Ming.
The Ring programming language version 1.5.2 book - Part 43 of 181Mahmoud Samir Fayed
This document discusses Ring code for implementing CRUD (create, read, update, delete) functionality using an MVC (model-view-controller) pattern. It includes code for classes that represent a Salary model, controller, and view. It also includes code for classes that handle user registration and login functionality, including models, views, controllers, and language files. The document provides code examples for connecting to a database, implementing base model and controller classes, and performing common database operations like searching, counting, inserting, updating, and finding records.
The Ring programming language version 1.5 book - Part 8 of 31Mahmoud Samir Fayed
This document summarizes key classes and methods from the Ring web library (weblib.ring).
The Application class contains methods for encoding, decoding, cookies, and more. The Page class contains methods for generating common HTML elements and structures. Model classes like UsersModel manage data access and object relational mapping. Controller classes handle requests and coordinate the view and model.
The Ring programming language version 1.8 book - Part 49 of 202Mahmoud Samir Fayed
The document provides code examples of using Bootstrap classes and components to create buttons and modal dialog boxes in HTML. It defines CSS classes for different columns, button groups, and modal elements. Buttons are created with classname, text, and other attributes. The modal dialog box contains header, body, and footer sections with close buttons and content text. Screenshots are included of the rendered output.
Scenari introduzione Application Service Governance in AziendaConsulthinkspa
La visione Consulthink per la selezione di un'infrastruttura abilitante per l'IT di un'Azienda per la realizzazione della "Application Service Governance",
attraverso un'analisi di mercato e la realizzazione di PoC personalizzate .
This short document promotes creating Haiku Deck presentations on SlideShare and getting started making one. It encourages the reader to be inspired to make their own presentation using Haiku Deck on the SlideShare platform. A call to action is given to get started creating a Haiku Deck presentation.
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebChristian Baranowski
The document discusses Behavior Driven Development (BDD) using Groovy, Spock and Geb. It provides an overview of BDD and defines the given-when-then structure. It then demonstrates various Groovy and Spock features for writing BDD tests including classes, methods, collections, closures, assertions and mock objects. Spock allows writing tests in a readable and expressive manner with support for parameterization and different test lifecycle methods.
The document discusses the tools Spock and Geb for testing in Groovy. It provides arguments for why to use Spock, describes the Given-When-Then structure in Spock tests, and covers Spock blocks, lifecycles, mocking, and the four phases of testing.
The Ring programming language version 1.9 book - Part 53 of 210Mahmoud Samir Fayed
This document provides code examples and documentation for Ring's web application framework. It includes code for user authentication using a database, classes for database access and web controllers, and descriptions of the main classes and methods in the WebLib API for generating HTML pages and handling requests. The document covers key concepts like generating pages dynamically based on request parameters, working with databases using Model classes, and common tasks like cookies, file uploads, and URL encoding.
The Ring programming language version 1.5.4 book - Part 44 of 185Mahmoud Samir Fayed
This document contains code for classes that provide functionality for database operations and model-view-controller (MVC) patterns in Ring.
The Database class handles database connections and queries. The ModelBase class extends Database and provides methods for CRUD operations on a database table based on the class name. The ControllerBase class sets up an associated view and model based on its class name and provides routing functionality. Together these classes provide a framework for building MVC-based applications with Ring that interact with a database.
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)MongoSF
The document appears to be notes from a MongoDB training session that discusses various MongoDB features like MapReduce, geospatial indexes, and GridFS. It also covers topics like database commands, indexing, and querying documents with embedded documents and arrays. Examples are provided for how to implement many of these MongoDB features and functions.
The document appears to be a series of tips for writing clean, readable code in Groovy. Some of the key points mentioned include:
1. Write readable code and comment any tricks or non-obvious parts of the code.
2. Be aware that some clever code may actually be a bug.
3. Use static code analysis tools like IntelliJ IDEA to inspect code quality.
4. Refer to documentation when unsure rather than relying on tricks.
5. Avoid writing code in an overly clever or obfuscated way.
The Ring programming language version 1.3 book - Part 34 of 88Mahmoud Samir Fayed
This document contains code from the datalib.ring library that defines classes for database connectivity and model-view-controller implementation in Ring.
The Database class handles database connections and queries. The ModelBase class extends Database and adds methods for CRUD operations on a model object. It determines the table name from the class name.
The ControllerBase class is the base class for controllers. It dynamically creates the view and model objects based on the controller class name. It also contains routing logic and pagination methods. These classes provide a framework for building MVC applications with Ring and connecting to a database.
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
This document summarizes code from the Ring documentation related to user registration, login, and database classes. It describes classes for users, models, views, controllers, and languages that allow for user registration, login, form views, and routing. It also summarizes the Database, ModelBase, and ControllerBase classes that provide functionality for connecting to databases, executing queries, and managing model data.
The Ring programming language version 1.7 book - Part 48 of 196Mahmoud Samir Fayed
This document provides code examples and documentation for Ring's web library (weblib.ring). It describes classes and methods for generating HTML pages, forms, tables and other elements. This includes the Page class for adding common elements like text, headings, paragraphs etc., the Application class for handling requests, cookies and encoding, and classes representing various HTML elements like forms, inputs, images etc. It also provides an overview of how to create pages dynamically using View and Controller classes along with Model classes for database access.
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
The Ring programming language version 1.4.1 book - Part 13 of 31Mahmoud Samir Fayed
This document provides documentation on Ring's web library API for generating HTML pages and elements. It describes classes and methods for creating pages, adding content and attributes, handling forms, and more. The Page class allows adding various HTML elements to the page content through methods like text(), html(), h1(), etc. The Application class contains methods for encoding, cookies, and page structure. WebLib enables generating complete HTML pages in Ring code.
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Suyeol Jeon
The document contains code snippets demonstrating various Swift programming concepts including variables, constants, types, optionals, functions, classes, structs, enums, and more. Key concepts demonstrated include variable and constant declaration with types, optional binding, functions with parameters and return values, classes and structs with properties and methods, tuples, and enums with associated values and raw values.
Working with Databases and Groovy
This document discusses how to work with databases using Groovy. It covers:
- Connecting to databases and using groovy.sql.Sql to execute queries and statements
- Performing reads and writes like inserting, updating, deleting rows
- Calling stored procedures
- Advanced techniques like transactions, batching, pagination
- Using groovy.sql.DataSet to treat tables as collections
It also briefly introduces using MongoDB and Neo4j with Groovy.
JDD2015: Where Test Doubles can lead you... - Sebastian Malaca PROIDEA
WHERE TEST DOUBLES CAN LEAD YOU...
"With great power comes great responsibility". And Test Double Patterns gives you a great power. Your life is easier, tests lighter and faster.
But someday this power can turn against you.
Each day we are more comfortable with using Test Double Patters. We are creating assumptions. We are mocking services. We are ending with well covered code and tests... that tell us nothing.
That's why it's so important to recognize warning signs. To know the pitfalls that are waiting for us. To know what to do in these situations.
The document discusses patterns for more powerful asserts when doing approval testing. It outlines 7 approaches to asserting values in approval tests, moving from simple number and string assertions to more complex objects, files, automatically generated names, custom verification methods, and using diff tools to compare outputs on failure. The goal is to make approval testing more expressive and tests less cluttered while still using normal test scenarios.
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
This intermediate-level talk will teach you techniques using the popular NoSQL database MongoDB and the Python library Ming to write maintainable, high-performance, and scalable applications. We will cover everything you need to become an effective Ming/MongoDB developer from basic PyMongo queries to high-level object-document mapping setups in Ming.
The Ring programming language version 1.5.2 book - Part 43 of 181Mahmoud Samir Fayed
This document discusses Ring code for implementing CRUD (create, read, update, delete) functionality using an MVC (model-view-controller) pattern. It includes code for classes that represent a Salary model, controller, and view. It also includes code for classes that handle user registration and login functionality, including models, views, controllers, and language files. The document provides code examples for connecting to a database, implementing base model and controller classes, and performing common database operations like searching, counting, inserting, updating, and finding records.
The Ring programming language version 1.5 book - Part 8 of 31Mahmoud Samir Fayed
This document summarizes key classes and methods from the Ring web library (weblib.ring).
The Application class contains methods for encoding, decoding, cookies, and more. The Page class contains methods for generating common HTML elements and structures. Model classes like UsersModel manage data access and object relational mapping. Controller classes handle requests and coordinate the view and model.
The Ring programming language version 1.8 book - Part 49 of 202Mahmoud Samir Fayed
The document provides code examples of using Bootstrap classes and components to create buttons and modal dialog boxes in HTML. It defines CSS classes for different columns, button groups, and modal elements. Buttons are created with classname, text, and other attributes. The modal dialog box contains header, body, and footer sections with close buttons and content text. Screenshots are included of the rendered output.
Scenari introduzione Application Service Governance in AziendaConsulthinkspa
La visione Consulthink per la selezione di un'infrastruttura abilitante per l'IT di un'Azienda per la realizzazione della "Application Service Governance",
attraverso un'analisi di mercato e la realizzazione di PoC personalizzate .
This short document promotes creating Haiku Deck presentations on SlideShare and getting started making one. It encourages the reader to be inspired to make their own presentation using Haiku Deck on the SlideShare platform. A call to action is given to get started creating a Haiku Deck presentation.
This document discusses UNESCO's Teacher Training Initiative for Sub-Saharan Africa (TTISSA), launched in 2006 to improve teacher quality and quantity in the region. The initiative supports countries in addressing teacher challenges over 10 years through activities like developing teacher policies, building capacity through workshops and guides, creating innovative training approaches, and advocacy around issues like teachers' working conditions. UNESCO Dakar implements TTISSA through technical support, tools, data collection, and an online learning platform to help teachers develop and share resources.
Meilleur Remboursement optique, hospitalisation, des cotisations pas cher réponds aux besoins des seniors, des retraités.
Une simulation gratuit pour une Mutuelle senior pas cher
http://www.mutuelle-probtp.com/mutuelle-senior.html
Charter Broker Revenue while working and Decrease since leaving companyChristian Borchardt
This financial document shows key metrics for a company over several years, including cash, net worth, total current liabilities, and total current assets from 2009 to 2013. The graph allows toggling between different financial metrics and zooming in on specific areas by dragging to analyze the company's finances over time.
This document discusses Korea's abortion laws and provides opinions on possible solutions. It notes that under current law, less than 5% of abortions in Korea are legal, as abortion is only permitted in certain cases like rape, incest, or health risks. The document argues that abortions should be made illegal and penalties enhanced, as babies have a right to choose their own fate. It suggests two feasible solutions - that people behave responsibly to prevent unwanted pregnancies, and that the government establishes one-year nurseries for unexpected pregnancies where people may not be ready for parenthood.
An AI assistant to help entrepreneurs
Entrepreneurs,
students
Impact envisioned
for
Entrepreneurs and
students
Impact envisioned
To provide guidance and
mentorship to
entrepreneurs and
students through an AI
assistant
Technology
Artificial Intelligence
A new study1 commissioned by Aquila Capital reveals that currently 7% of European institutional investors have any exposure to hydropower, compared with 37% to solar and 29% to wind. However, just over half (52%) of institutional investors are committed to diversifying or increasing the size of their renewable portfolio.
Este documento describe tres métodos para observar elementos en su verdadera magnitud: abatimientos, giros y cambios de plano. Los abatimientos permiten ver figuras planas o rectas en su verdadera magnitud. Los cambios de plano pasan figuras de planos oblicuos a planos proyectantes horizontales o verticales. Los giros cambian puntos de cuadrante y transforman rectas y planos mediante rotaciones y desplazamientos de proyecciones. Todos estos métodos tienen el objetivo común de representar elementos en su tamaño real.
El documento describe diferentes modelos didácticos para la enseñanza de las ciencias naturales, incluyendo el modelo tradicional de transmisión-recepción, el modelo constructivista de recepción significativa, el modelo de cambio conceptual, el modelo de investigación por descubrimiento y el modelo de investigación guiada. Cada modelo se caracteriza por su enfoque del aprendizaje y las ventajas y desventajas de cada uno. La conclusión es que la mejor práctica implica el uso flexible de diferentes modelos según sea más adecuado y un cambio hacia una conce
Mahmoud Al Khazendar is applying for the position of Accounts Coordinator/Administrator. He has over 15 years of experience in accounting roles. His most recent role was as a Senior Accountant at Delta Emirates Contracting Co. LLC since 2013. Previously he held senior accountant roles at Al Habtoor – Leighton Group from 2006-2013. He has a Bachelor's Degree in Accounting from The Islamic University Gaza. He is seeking a new opportunity with better pay and a challenging work environment.
Here are the steps to solve this problem:
1) Since ED is tangent at C, ∠ECD = 90° (property of tangents)
2) ∆OCD ~ ∆OED (AA similarity)
3) Corresponding parts are proportional:
OC/OD = OC/OE
Cross multiply: OC×OE = OD×OC
Divide both sides by OC: OE = OD
4) Given DE = 20, OE = OD = 20/2 = 10
5) ∠ACD = ∠AED (inscribed angles on the same arc)
6) ∆ACD ~ ∆AED (AA similarity)
7) Corresponding parts are proportional
The document discusses topics in coordinate geometry including slopes, length of line segments, midpoints, and proofs. It provides formulas and examples for calculating slopes, lengths of lines, and midpoints. It also discusses using an analytical approach to prove geometric theorems through using coordinates, formulas, and algebraic manipulations rather than relying solely on diagrams.
The document provides examples of Kotlin classes and properties compared to Java classes. Some key points summarized:
1. Kotlin classes can define properties directly rather than private fields with getters/setters like in Java. Properties are accessed directly rather than through getter methods.
2. Data classes provide equals(), hashCode(), toString() by default and allow destructuring declarations. Regular classes do not have these features by default.
3. Default values can be defined for properties in Kotlin classes, unlike Java where default values require a builder pattern.
From java to kotlin beyond alt+shift+cmd+kFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay! Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write. In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
Presentation in Portuguese (Brazilian) about Kotlin basics. Can be used as reference to the basics of the language. It is specially focused on people with prior development experience, specially in Java.
The document discusses new features introduced in C# 6.0 and later versions including auto-property initialization, expression-bodied members, null-conditional and null-coalescing operators, string interpolation, nameof operator, index initializers, exception filters, and using the 'await' keyword in catch and finally blocks. It provides examples of how these features simplify code compared to earlier versions of C#.
The need for functional programming languages is more important than ever with the current hardware and software trends. Scala has become the number one choice for functional programming languages and is becoming the language of choice for many development teams. But with the introduction of functional programming in Java 8 is Scala still relevant and needed?
The document provides an overview of Scala concepts for Java programmers, including object-oriented features, pattern matching, functional programming constructs like immutability and higher-order functions, actors and futures for concurrency, and implicits. Key concepts covered include case classes, lazy evaluation, parallel collections, currying, partial functions, and implicit parameters.
The document discusses Kotlin DSL and how it can be used to create domain-specific languages. It provides examples of using Kotlin features like operators, lambdas, and extensions to build DSLs for validation rules, UI layouts, dependency injection, and more. Key points include how functions, operators, and properties can be overridden or extended to define new syntax and behaviors for DSLs, and how inline functions allow embedding DSL code without additional overhead.
Are you stuck in the Java world? I’ll share my story about convincing my team and the client of the benefits of Kotlin. Furthermore I’ll delve into how we migrated an existing Java Android app, with 300k active users, to Kotlin. Even if you have never seen Kotlin before, come and see how you will create better apps with this modern and elegant language. At the end of this talk you’ll be able to convince your team / client why it’s a great to use Kotlin. The power of Kotlin can be leveraged everywhere you use Java, since it compiles to JVM bytecode. So even if you’re not an Android developer, check out this session to get acquainted with Kotlin! No excuses: switch to Kotlin :)
This document provides an introduction to Groovy for Java developers. It discusses Groovy's features such as closures, optional typing and syntax, and how it compiles to Java bytecode. It then provides examples of writing a simple Groovy script to generate XML, using closures, mocking objects in tests, and building projects with Ant.
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018Codemotion
Kotlin is a programming language developed by JetBrains that targets multiple platforms including the JVM, JavaScript, and native binaries. A year ago it has been adopted as an officially supported language for Android development. Kotlin offers clean and concise syntax, interoperability, both object-oriented and functional code constructs, and a lot of other cool features with little or no overhead. Let's find out together why developers love this language and how it helps them to be productive and have fun!
The document discusses Kotlin DSL and provides examples of using Kotlin as a domain-specific language (DSL) to define validation rules. It shows how to build a validation DSL that allows defining validation logic for fields in a concise way using functions like "be" and "not". The validation rules can then be validated against objects to check for errors.
Scala 3 is arriving, and with it comes incredible new power for library authors. In this presentation, Alexander Ioffe, contributor to Quill (a LINQ-like persistence layer for Scala), will show how using Scala 3 Macros, Quill is being rebuilt to be better, stronger, and faster. As you will learn in this presentation, Scala 3 introduces a new powerhouse keyword called 'inline' that opens up a new continent of capability. This construct powers all Scala 3 macros, and allows users to interact with staged code almost indistinguishably from normal code, allowing familiar patterns such as global-methods, type-classes, and type-level-logic. For Quill, Alexander will show how this allows generating compile-time SQL using patterns that we once only dreamed about using--and these features just scratch the surface of what can be done with staged code. Come discover the bright future of powerful, type-safe libraries in Scala 3!
Помните легендарные Java Puzzlers? Да-да, те самые, с Джошом Блохом и Нилом Гафтером? Ну, по которым ещё книжку написали? Так вот, в Groovy всё ещё веселее.
В смысле — задачки ещё более странные, и ответы ещё более поразительные. Этот доклад для вас, Groovy-разработчики, мы покажем вам настоящие, большие и красивые подводные камни! И для вас, Java-разработчики, потому что таких вещей на Java-подобном синтакисе вы точно никогда не видели! И для вас, PHP-разработчики… хотя, нет, не для вас :)
Всем точно будет весело — ваши ведущие Женя и Барух будут зажигать, шутить, спорить, бросаться футболками в публику, и самое главное — заставят вас офигевать от Groovy.
Grails Launchpad - From Ground Zero to OrbitZachary Klein
This document provides an overview of Grails Launchpad, a Grails development tool created by Zachary Klein. It discusses Klein's background with Grails and his roles maintaining Grails resources. The document also provides an introduction to Grails, describing it as a Java web application framework based on Spring Boot that follows the MVC pattern. Key Grails features highlighted include its plugin architecture, GORM for object-relational mapping, and convention over configuration approach.
The document summarizes features in C# 10 and beyond, including records, required properties, parameter null checking, pattern matching, lambda improvements, and value tuple deconstruction. It also discusses how to run samples and provides information about the presenter, Moaid Hathot. Key C# 10 features covered are records, properties, parameter null checking, pattern matching, and lambda improvements. The document promotes less code through features like file-scoped namespaces and global using directives. It concludes with a discussion of abstract data types and static abstract members in interfaces.
The document summarizes new features in .NET 3.5 including implicitly typed local variables, automatic properties, object and collection initializers, extension methods, lambda expressions, query syntax, and anonymous types. Key features are variables that infer type from initialization value, simplified property declarations, initializing objects and collections in a single statement, extending types without inheritance, lambda functions, LINQ query syntax, and anonymous class types without names.
This document contains code snippets demonstrating various C# language features including:
1. Defining classes with methods and properties.
2. Creating and initializing objects.
3. Implementing interfaces and inheritance.
4. Using generics, delegates, events, and attributes.
5. Working with collections, LINQ queries, and core namespaces.
The document contains code examples showing how Kotlin code is compiled to Java bytecode. It demonstrates how Kotlin classes, functions, properties, and other language features are represented in the compiled Java code. Key aspects that are summarized include data classes, property delegates like lazy, extension functions, and overriding behavior.
Similar to 4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz (20)
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfUndress Baby
The quest for the best AI face swap solution is marked by an amalgamation of technological prowess and artistic finesse, where cutting-edge algorithms seamlessly replace faces in images or videos with striking realism. Leveraging advanced deep learning techniques, the best AI face swap tools meticulously analyze facial features, lighting conditions, and expressions to execute flawless transformations, ensuring natural-looking results that blur the line between reality and illusion, captivating users with their ingenuity and sophistication.
Web:- https://undressbaby.com/
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...kalichargn70th171
A dynamic process unfolds in the intricate realm of software development, dedicated to crafting and sustaining products that effortlessly address user needs. Amidst vital stages like market analysis and requirement assessments, the heart of software development lies in the meticulous creation and upkeep of source code. Code alterations are inherent, challenging code quality, particularly under stringent deadlines.
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
4. PersonValidator.java Part. 1
@Component
public class PersonValidator {
public void validatePerson(Person person) {
String firstName = person.getFirstName();
if (firstName == null || firstName.length() == 0) {
throw new PersonValidationException("First
name must be given");
}
String lastName = person.getLastName();
if (lastName == null || lastName.length() == 0) {
throw new PersonValidationException("Last name
must be given");
}
5. PersonValidator.java Part. 2
Integer age = person.getAge();
if (age == null){
throw new PersonValidationException("Age must be
given");
}
if( age < 0) {
throw new PersonValidationException("Age cannot
be negative");
}
}
}
16. when-then blocks
class PersonTest extends Specification {
def "should set first name from constructor"() {
when:
Person person = new Person(firstName: "Bob")
then:
person.firstName == "Bob"
}
}
18. Block with description
def "should set first name from constructor 2"() {
when: "person with set first name"
Person person = new Person(firstName: "Bob")
then: "person has first name"
person.firstName == "Bob"
}
19. Given block
def "should set first name from setter"() {
given:
Person person = new Person(firstName: "Bob")
when:
person.firstName = 'Tom'
then:
person.firstName == "Tom"
}
20. Multiple asserts
def "should set person data from constructor"() {
when:
Person person = new Person("Bob", "Smith", 15)
then:
person.firstName == "Bob"
person.lastName == "Smith"
person.age == 15
}
21. Multiple when then
def "should set first name from constructor and change
with setter"() {
when:
Person person = new Person(firstName: "Bob")
then:
person.firstName == "Bob"
when:
person.firstName = "Tom"
then:
person.firstName == "Tom"
}
22. And block
def "should set first name and last name"() {
when:
Person person = new Person(firstName: "Bob",
lastName: "Smith")
then:
person.firstName == "Bob"
and:
person.lastName == "Smith"
}
23. Expect block
def "should compare person with equals"() {
expect:
new Person("Bob", "Smith", 15) == new Person
("Bob", "Smith", 15)
}
33. Parameters in table
@Unroll
def "should set person data"() {
when:
Person person = new Person(lastName: lastName,
firstName: firstName, age: age)
then:
person.firstName == firstName
person.lastName == lastName
person.age == age
where:
lastName | firstName | age
"Smith" | "John" | 25
"Kowalski" | "Jan" | 24
}
34. Parameters in method signature
@Unroll
def "should set person data 2"(String firstName, String
lastName, int age) {
// …
where:
lastName | firstName | age
"Smith" | "John" | 25
"Kowalski" | "Jan" | 24
}
35. Parameters in method name
@Unroll
def "should set person with #lastName, #firstName and
#age"() {
// …
where:
lastName | firstName | age
"Smith" | "John" | 25
"Kowalski" | "Jan" | 24
}
36. Call parameterless method in test name
Part 1
@Unroll("should set person with #lastName.length(),
#firstName.toUpperCase() and #age")
37. Call parameterless method in test name
Part 2
@Unroll("should set person with #lastName.length(),
#firstName.toUpperCase() and #age when last name starts
with #firstLetter")
def "should set person with lastName, firstName and age
3"() {
//…
where:
lastName | firstName | age
"Smith" | "John" | 25
"Kowalski" | "Jan" | 24
firstLetter = lastName.charAt(0)
}
38. Separeted table
@Unroll
def "should check if person is adult with table"() {
expect:
new Person(age: age).isAdult() == adult
where:
age || adult
17 || false
18 || true
19 || true
}
39. Parameters from list
@Unroll
def "should check if person is adult with list"() {
expect:
new Person(age: age).isAdult() == adult
ageSquare == age * age
where:
age << [17, 18, 19]
adult << [false, true, true]
ageSquare = age * age
}
40. Parameters from list of list
@Unroll
def "should check if person is adult with list 2"() {
expect:
new Person(age: age).isAdult() == adult
where:
[age, adult] << [[17,false], [18,true], [19,
true]]
}
41. One paramter table
@Unroll
def "should set first name"() {
when:
Person person = new Person(firstName: firstName)
then:
person.firstName == firstName
where:
firstName | _
"John" | _
"Jan" | _
}
42. Parameters from db - setup
static Sql sql = Sql.newInstance("jdbc:h2:mem:", "sa",
"", "org.h2.Driver")
def setupSpec() {
sql.execute("""DROP TABLE IF EXISTS person;
CREATE TABLE person (
first_name VARCHAR(256) NOT NULL,
last_name VARCHAR(256) NOT NULL,
age INT NOT NULL
);""")
sql.executeInsert("""INSERT INTO person (first_name,
last_name, age) VALUES
('Tom', 'Smith', 24),
('Jan', 'Kowalski', 30);""")
}
44. All parameters from db
@Unroll
def "should set person data with #lastName, #firstName
and #age"() {
// …
where:
[firstName, lastName, age] << sql.rows("SELECT *
FROM person;")
}
45. All parameters from db by name
@Unroll
def "should set person data with #lastName, #firstName
and #age"() {
// …
where:
[firstName, lastName, age] << sql.rows("SELECT
first_name, last_name, age FROM person;")
}
46. Drop last parameter
@Unroll
def "should set person data with #lastName, #firstName
and #age"() {
// …
where:
[firstName, lastName] << sql.rows("SELECT * FROM
person;")
}
47. Omit parameter
@Unroll
def "should set person data with #lastName, #firstName
and #age"() {
// …
where:
[_, lastName, age] << sql.rows("SELECT * FROM
person;")
}
49. Not thrown exception
PersonValidator sut = new PersonValidator()
def "should pass validation"() {
given:
Person person = new Person(firstName: "Tom",
lastName: "Smith", age: 30)
when:
sut.validatePerson(person)
then:
notThrown(PersonValidationException)
}
50. Not thrown exception - fails
Expected no exception of type 'com.blogspot.przybyszd.
spock.bean.PersonValidationException' to be thrown, but
got it nevertheless
51. Thrown exception
@Unroll
def "should not pass validation"() {
then:
PersonValidationException exception = thrown
(PersonValidationException)
exception.message == message
where:
firstName | lastName | age | message
"Tom" | "Smith" | -1 | "Age cannot be
negative"
"" | "Kowalski" | 19 | "First name must
be given"
"Jan" | null | 19 | "Last name must
be given"
}
52. Thrown exception - another exception
Expected exception of type 'com.blogspot.przybyszd.
spock.bean.PersonValidationException', but got 'java.
lang.RuntimeException'
53. Thrown exception - but no exception
Expected exception of type 'com.blogspot.przybyszd.
spock.bean.PersonValidationException', but no exception
was thrown
56. Validate mock calls
def "should persist one person"() {
given:
Person person = new Person("John", "Smith", 20)
when:
sut.persist(person)
then:
1 * jdbcTemplate.execute("Insert into person
(first_name, last_name, age) values ('John', 'Smith',
20)")
}
57. Mock not called
Too few invocations for:
1 * jdbcTemplate.execute("Insert into person
(first_name, last_name, age) values ('John', 'Smith',
20)") (0 invocations)
Unmatched invocations (ordered by similarity):
None
58. Too many calls
1 * jdbcTemplate.execute("Insert into person
(first_name, last_name, age) values ('John', 'Smith',
20)") (2 invocations)
Matching invocations (ordered by last occurrence):
2 * jdbcTemplate.execute('Insert into person
(first_name, last_name, age) values ('John',
'Smith', 20)') <-- this triggered the error
59. Another parameters in calls
def "should persist many persons"() {
given:
List<Person> persons = [new Person("John",
"Smith", 20), new Person("Jan", "Kowalski", 15)]
when:
sut.persist(persons)
then:
1 * jdbcTemplate.execute("Insert into person
(first_name, last_name, age) values ('John', 'Smith',
20)")
1 * jdbcTemplate.execute("Insert into person
(first_name, last_name, age) values ('Jan', 'Kowalski',
15)")
}
91. With
def "should set first name, last name and age 1"() {
when:
Person person = new Person(firstName: "Bob",
lastName: "Smith", age: 40)
then:
with(person) {
firstName == "Bob"
lastName == "Smith"
age == 40
}
}
105. void instead of def
void "should set first name from constructor"() {
when:
Person person = new Person(firstName: "Bob")
then:
person.firstName == "Bob"
}
106. Shoud instead of def
Should "set first name from constructor"() {
when:
Person person = new Person(firstName: "Bob")
then:
person.firstName == "Bob"
}
107. Shoud instead of def - how it works
import java.lang.Void as Should