This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
This document provides an agenda for a ColdFusion security training session presented by Pete Freitag and David Epler. It includes introductions to the presenters and their backgrounds in ColdFusion and security. The agenda covers common ColdFusion vulnerabilities like file uploads, SQL injection, path traversals, and cross-site scripting. It also demonstrates the OWASP ZAP security tool and provides a sneak peek at a new ColdFusion security analyzer called Raijin/Blizzard. Hands-on lessons are included to allow participants to try exploiting vulnerabilities.
Learn the ins and outs of running background tasks with the popular python module Celery. We'll hit the ground running. With everything you need to know to run your first task, to scaling your stack to run millions each day.
SpringBoot with MyBatis, Flyway, QueryDSLSunghyouk Bae
This document provides an overview and tutorials for using MyBatis with Spring Boot. It introduces the mybatis-spring-boot-starter dependency, and covers setting up MyBatis mappers using annotation and XML styles. It also demonstrates MyBatis configuration in Spring Boot, database migrations with Flyway, and MyBatis testing. Additional sections explain concepts like repositories, Java configuration, and using QueryDSL with MyBatis.
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Edureka!
This Edureka "Node.js tutorial" will help you to learn the Node.js fundamentals and how to create an application in Node.js. Node.js is an open-source, cross-platform JavaScript runtime environment for developing a diverse variety of server tools and applications. Below are the topics covered in this tutorial:
1) Client Server Architecture
2) Limitations of Multi-Threaded Model
3) What is Node.js?
4) Features of Node.js
5) Node.js Installation
6) Blocking Vs. Non – Blocking I/O
7) Creating Node.js Program
8) Node.js Modules
9) Demo – Grocery List Web Application using Node.js
Whitebox testing of Spring Boot applicationsYura Nosenko
This document discusses whitebox testing of Spring Boot applications. It begins with introductions and backgrounds, then discusses issues with existing testing frameworks like TestNG and JUnit 4. It proposes alternatives like Spock and JUnit 5, highlighting advantages of each. It also provides an overview of Spring Boot testing capabilities, focusing on integration testing support, transaction handling, main components, and reactive support. It concludes with examples of setting up Spring Boot testing with Spock and JUnit 5.
Celery is a distributed task queue that allows long-running processes to be executed asynchronously outside of the main request-response cycle. It uses message brokers like RabbitMQ to distribute jobs to worker nodes for processing. This improves request performance and allows tasks to be distributed across multiple machines. Common use cases include asynchronous tasks like email sending, long database operations, image/video processing, and external API calls.
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
This document provides an agenda for a ColdFusion security training session presented by Pete Freitag and David Epler. It includes introductions to the presenters and their backgrounds in ColdFusion and security. The agenda covers common ColdFusion vulnerabilities like file uploads, SQL injection, path traversals, and cross-site scripting. It also demonstrates the OWASP ZAP security tool and provides a sneak peek at a new ColdFusion security analyzer called Raijin/Blizzard. Hands-on lessons are included to allow participants to try exploiting vulnerabilities.
Learn the ins and outs of running background tasks with the popular python module Celery. We'll hit the ground running. With everything you need to know to run your first task, to scaling your stack to run millions each day.
SpringBoot with MyBatis, Flyway, QueryDSLSunghyouk Bae
This document provides an overview and tutorials for using MyBatis with Spring Boot. It introduces the mybatis-spring-boot-starter dependency, and covers setting up MyBatis mappers using annotation and XML styles. It also demonstrates MyBatis configuration in Spring Boot, database migrations with Flyway, and MyBatis testing. Additional sections explain concepts like repositories, Java configuration, and using QueryDSL with MyBatis.
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Edureka!
This Edureka "Node.js tutorial" will help you to learn the Node.js fundamentals and how to create an application in Node.js. Node.js is an open-source, cross-platform JavaScript runtime environment for developing a diverse variety of server tools and applications. Below are the topics covered in this tutorial:
1) Client Server Architecture
2) Limitations of Multi-Threaded Model
3) What is Node.js?
4) Features of Node.js
5) Node.js Installation
6) Blocking Vs. Non – Blocking I/O
7) Creating Node.js Program
8) Node.js Modules
9) Demo – Grocery List Web Application using Node.js
Whitebox testing of Spring Boot applicationsYura Nosenko
This document discusses whitebox testing of Spring Boot applications. It begins with introductions and backgrounds, then discusses issues with existing testing frameworks like TestNG and JUnit 4. It proposes alternatives like Spock and JUnit 5, highlighting advantages of each. It also provides an overview of Spring Boot testing capabilities, focusing on integration testing support, transaction handling, main components, and reactive support. It concludes with examples of setting up Spring Boot testing with Spock and JUnit 5.
Celery is a distributed task queue that allows long-running processes to be executed asynchronously outside of the main request-response cycle. It uses message brokers like RabbitMQ to distribute jobs to worker nodes for processing. This improves request performance and allows tasks to be distributed across multiple machines. Common use cases include asynchronous tasks like email sending, long database operations, image/video processing, and external API calls.
Europython 2011 - Playing tasks with Django & CeleryMauro Rocco
This document discusses using Django and Celery for asynchronous task processing. Some key points:
- Celery allows defining and processing asynchronous tasks across multiple machines in a distributed, fault-tolerant way. It supports scheduling via cron-like functionality.
- Django-celery provides a Django app that integrates Celery with the Django admin for task scheduling and monitoring. It replaces Celery configuration with Django settings.
- Unique tasks ensure only one instance of a task runs at a time across all machines. This is useful for accessing sensitive resources atomically. Custom locking and concurrency handling is implemented.
- Centralized logging is implemented by connecting signal handlers to Celery's logging setup. This allows sending all worker logs to a syslog
Take a load off! Load testing your Oracle APEX or JDeveloper web applicationsSage Computing Services
Geeeez, after demanding you unit test, system test, black box test, white box test, test-test-test everything, your manager is now demanding you load test your brand spanking new Oracle web application. How on earth can you do this?
This technical presentation will explain the concepts behind preparing for load testing, the Http protocol's request/response model, and live demonstrations using Oracle's Http Analyzer and Apache's JMeter to stress test your Oracle web application.
The presentation is suitable for anybody, be it DBAs or developers, who are concerned about the performance of any web based application, possibly an Apex or JDeveloper or 3rd party web application. Knowledge of Apex or JDeveloper is not mandatory for this presentation and they will not be covered in any depth.
Microservice With Spring Boot and Spring CloudEberhard Wolff
Spring Boot and Spring Cloud are an ideal foundation for creating Microservices based on Java. This presentation explains basic concepts of these libraries.
MySQL 8.0.17 has the ability to create indexes over JSON arrays to speed up your queries. This presentation shows examples and explain all you need to know about this new feature: How are array indexes created? How do they work? When are they used? Are there any limitations?
The document provides an overview and introduction to Spring Data JPA, including:
1) How Spring Data abstracts away basic data management concepts and supports both relational and non-relational databases.
2) An example of refactoring from plain JPA to Spring Data JPA by defining a repository interface and using built-in query methods.
3) How the Spring Data repository abstraction reduces the effort to implement data access layers through interfaces like Repository.
Evolving a Clean, Pragmatic Architecture - A Craftsman's GuideVictor Rentea
This document outlines an agenda and presentation on clean code architecture. It discusses modeling data with entities and value objects, organizing logic by extracting services and applying the onion architecture. It emphasizes testing to reduce fear, and protecting developers through simplicity and avoiding overengineering. The presentation emphasizes keeping data transfer objects lightweight and external to the domain.
Helm is an essential tool for continuous delivery after containerization. Helm is a package manager that provides template engines, release management, versioning, and other features to help manage Kubernetes applications and infrastructure as code. It allows defining common templates for repetitive workloads like workers to simplify management complexity. Migrating infrastructure to Kubernetes and using Helm can save costs, reduce deployment time, and increase productivity compared to alternatives. Helm is a stepping stone to future approaches like GitOps for pull-based DevOps workflows.
The document discusses methodologies for assessing application security, including both blackbox and whitebox approaches. It outlines challenges with each approach, such as difficulty discovering all application assets and endpoints with blackbox testing. Whitebox testing is presented as able to more fully cover the application scope by analyzing source code directly. The document also covers specific challenges for assessing web 2.0 applications and services.
Don't Be Mocked by your Mocks - Best Practices using MocksVictor Rentea
Do you ❤️ Mocks? When you write your first unit tests, especially on older codebases, mocking foreign code is key to survival. But as you grow older in the craft, you start piling up hours and days wasted to refactor fragile tests or to fix bugs that those heavy mock-based tests didn't catch. And so you start looking at Mocks differently.
Let's go through the key factors to consider to strike the optimal balance between what needs to be mocked away and what code should be tested in integration. There's sometimes a fine line there, often interwoven with strong emotions:
"Why am I testing this?"
"Argh… these tests take too long"
"Can this ever really break?"
etc...
Among the points that we'll touch on:
- Mocks vs Refactoring
- Mocks vs Reliability
- Fine vs Coarse Mocks
- Reproducibility
- Partial Mocks
- Mocking Statics
- Alternatives to Mocks
Speakers: Victor Rentea
Victor is a Java Champion and Independent Trainer with an impressive experience: thousands of developers in dozens of companies trained in dedicated company sessions. He is the founder of one of the largest developer communities in Romania, Bucharest Software Craftsmanship Community and a top international conference speaker.
To find more about him, join a live masterclass or call him in for a company dedicated training: victorrentea.ro
This is one of the 15 minute "TED" style talk presented as part of the Database Symposium at the ODTUG Kscope18 conference. In this presentation @SQLMaria coveres topics like what data type you should use to store JSON documents (varchar2, clob or blob) the pro's and con's of using an IS JSON check constraint, and how to load, index, and query JSON documents.
Nat, List and Option Monoids -from scratch -Combining and Folding -an examplePhilip Schwarz
Nat, List and Option Monoids, from scratch. Combining and Folding: an example.
Code: https://github.com/philipschwarz/nat-list-and-option-monoids-from-scratch-combining-and-folding-an-example
Rust is a systems programming language that is fast, memory-efficient, and safe. It was created by Mozilla Research in 2010 and released in 2015. Rust uses a borrow checker to ensure memory safety at compile time without using garbage collection. It is suitable for writing system software, embedded applications, and web assembly. Rust aims to prevent common concurrency bugs and provides features like strong typing, pattern matching, and macros.
Are you using Java8 Lambdas & Streams in your core business logic? Then you might be having this strange feeling that it’s not Java anymore: at times it’s cryptic, barely readable.. This was the topic of the workshop with the same name that I held at VoxxedDays Bucharest 2017. These are the slides backing the that workshop.
As a summary, the materials walk through the functional features of Java8, adding details along the way about how we can keep the code clean as we embrace the Java 8 features.
The entire desktop screencast + voice it's on youtube, here: https://youtu.be/uH9A37k2QkU
We start with why you should use task queues. Then we show a few straightforward examples with Python and Celery and Ruby and Resque.
Finally, we wrap up with a quick example of a task queue in PHP using Redis.
https://github.com/bryanhelmig/phqueue
Application misconfiguration attacks exploit weaknesses in web applications caused by configuration mistakes. These mistakes include using default passwords and privileges or revealing too much debugging information. Misconfiguration can have minor effects but can also cause major issues like data loss or full system compromise. It is a common problem caused by factors like human error and complex application interfaces. Proper security practices like regular reviews and testing can help detect and prevent misconfiguration vulnerabilities.
This document provides an introduction to Node.js, Express, and MongoDB. Node.js is a JavaScript runtime built on Chrome's V8 engine that allows JavaScript to be run on the server-side. Express is a web application framework for Node.js that provides routing capabilities and middleware support. MongoDB is a non-relational database that stores data in flexible, JSON-like documents, rather than using rigid tables. The document discusses the pros and cons of each technology and provides examples of basic usage and configuration.
Clean Code @Voxxed Days Cluj 2023 - opening KeynoteVictor Rentea
Clean Code principles have become a cornerstone of professional developer teams worldwide. But frameworks and languages have evolved, and so have the challenges we’re facing today while crafting modern applications. Single-page apps, extremely DRY code, microservices, excessive functional programming, and reactive flows have all taken their toll on our code quality. Hop aboard this roundtrip of the most damaging Code Smells as of 2023 and fill your toolbox with a load of practical tricks you can immediately apply to your day-to-day work. All in an entertaining show spiced with live-coding moments.
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
Ever seen a code base where understanding a simple method meant jumping through tangled class hierarchies? We all have! And while "Favor composition over inheritance!" is almost as old as object-oriented programming, strictly avoiding all types of subclassing leads to verbose, un-Pythonic code. So, what to do?
The discussion on composition vs. inheritance is so frustrating because far-reaching design decisions like this can only be made with the ecosystem in mind – and because there's more than one type of subclassing!
Let's take a dogma-free stroll through the types of subclassing through a Pythonic lens and untangle some patterns and trade-offs together. By the end, you'll be more confident in deciding when subclassing will make your code more Pythonic and when composition will improve its clarity.
This document provides an overview of design challenges and examples of designing in small domains. Some key points:
1. It discusses common reasons why design fails, such as lack of domain expertise, communication, or time for design up front.
2. It presents examples of designing value objects like GroupId and GroupName to encapsulate behavior and validation related to those concepts.
3. It shows how behaviors can be modeled through modules that handle commands and events related to a domain, like starting a private group.
4. Testing examples demonstrate state-based, event-driven, and scenario-based approaches using fixtures to generate random test data.
5. Overall it promotes designing domains with primitives/
Europython 2011 - Playing tasks with Django & CeleryMauro Rocco
This document discusses using Django and Celery for asynchronous task processing. Some key points:
- Celery allows defining and processing asynchronous tasks across multiple machines in a distributed, fault-tolerant way. It supports scheduling via cron-like functionality.
- Django-celery provides a Django app that integrates Celery with the Django admin for task scheduling and monitoring. It replaces Celery configuration with Django settings.
- Unique tasks ensure only one instance of a task runs at a time across all machines. This is useful for accessing sensitive resources atomically. Custom locking and concurrency handling is implemented.
- Centralized logging is implemented by connecting signal handlers to Celery's logging setup. This allows sending all worker logs to a syslog
Take a load off! Load testing your Oracle APEX or JDeveloper web applicationsSage Computing Services
Geeeez, after demanding you unit test, system test, black box test, white box test, test-test-test everything, your manager is now demanding you load test your brand spanking new Oracle web application. How on earth can you do this?
This technical presentation will explain the concepts behind preparing for load testing, the Http protocol's request/response model, and live demonstrations using Oracle's Http Analyzer and Apache's JMeter to stress test your Oracle web application.
The presentation is suitable for anybody, be it DBAs or developers, who are concerned about the performance of any web based application, possibly an Apex or JDeveloper or 3rd party web application. Knowledge of Apex or JDeveloper is not mandatory for this presentation and they will not be covered in any depth.
Microservice With Spring Boot and Spring CloudEberhard Wolff
Spring Boot and Spring Cloud are an ideal foundation for creating Microservices based on Java. This presentation explains basic concepts of these libraries.
MySQL 8.0.17 has the ability to create indexes over JSON arrays to speed up your queries. This presentation shows examples and explain all you need to know about this new feature: How are array indexes created? How do they work? When are they used? Are there any limitations?
The document provides an overview and introduction to Spring Data JPA, including:
1) How Spring Data abstracts away basic data management concepts and supports both relational and non-relational databases.
2) An example of refactoring from plain JPA to Spring Data JPA by defining a repository interface and using built-in query methods.
3) How the Spring Data repository abstraction reduces the effort to implement data access layers through interfaces like Repository.
Evolving a Clean, Pragmatic Architecture - A Craftsman's GuideVictor Rentea
This document outlines an agenda and presentation on clean code architecture. It discusses modeling data with entities and value objects, organizing logic by extracting services and applying the onion architecture. It emphasizes testing to reduce fear, and protecting developers through simplicity and avoiding overengineering. The presentation emphasizes keeping data transfer objects lightweight and external to the domain.
Helm is an essential tool for continuous delivery after containerization. Helm is a package manager that provides template engines, release management, versioning, and other features to help manage Kubernetes applications and infrastructure as code. It allows defining common templates for repetitive workloads like workers to simplify management complexity. Migrating infrastructure to Kubernetes and using Helm can save costs, reduce deployment time, and increase productivity compared to alternatives. Helm is a stepping stone to future approaches like GitOps for pull-based DevOps workflows.
The document discusses methodologies for assessing application security, including both blackbox and whitebox approaches. It outlines challenges with each approach, such as difficulty discovering all application assets and endpoints with blackbox testing. Whitebox testing is presented as able to more fully cover the application scope by analyzing source code directly. The document also covers specific challenges for assessing web 2.0 applications and services.
Don't Be Mocked by your Mocks - Best Practices using MocksVictor Rentea
Do you ❤️ Mocks? When you write your first unit tests, especially on older codebases, mocking foreign code is key to survival. But as you grow older in the craft, you start piling up hours and days wasted to refactor fragile tests or to fix bugs that those heavy mock-based tests didn't catch. And so you start looking at Mocks differently.
Let's go through the key factors to consider to strike the optimal balance between what needs to be mocked away and what code should be tested in integration. There's sometimes a fine line there, often interwoven with strong emotions:
"Why am I testing this?"
"Argh… these tests take too long"
"Can this ever really break?"
etc...
Among the points that we'll touch on:
- Mocks vs Refactoring
- Mocks vs Reliability
- Fine vs Coarse Mocks
- Reproducibility
- Partial Mocks
- Mocking Statics
- Alternatives to Mocks
Speakers: Victor Rentea
Victor is a Java Champion and Independent Trainer with an impressive experience: thousands of developers in dozens of companies trained in dedicated company sessions. He is the founder of one of the largest developer communities in Romania, Bucharest Software Craftsmanship Community and a top international conference speaker.
To find more about him, join a live masterclass or call him in for a company dedicated training: victorrentea.ro
This is one of the 15 minute "TED" style talk presented as part of the Database Symposium at the ODTUG Kscope18 conference. In this presentation @SQLMaria coveres topics like what data type you should use to store JSON documents (varchar2, clob or blob) the pro's and con's of using an IS JSON check constraint, and how to load, index, and query JSON documents.
Nat, List and Option Monoids -from scratch -Combining and Folding -an examplePhilip Schwarz
Nat, List and Option Monoids, from scratch. Combining and Folding: an example.
Code: https://github.com/philipschwarz/nat-list-and-option-monoids-from-scratch-combining-and-folding-an-example
Rust is a systems programming language that is fast, memory-efficient, and safe. It was created by Mozilla Research in 2010 and released in 2015. Rust uses a borrow checker to ensure memory safety at compile time without using garbage collection. It is suitable for writing system software, embedded applications, and web assembly. Rust aims to prevent common concurrency bugs and provides features like strong typing, pattern matching, and macros.
Are you using Java8 Lambdas & Streams in your core business logic? Then you might be having this strange feeling that it’s not Java anymore: at times it’s cryptic, barely readable.. This was the topic of the workshop with the same name that I held at VoxxedDays Bucharest 2017. These are the slides backing the that workshop.
As a summary, the materials walk through the functional features of Java8, adding details along the way about how we can keep the code clean as we embrace the Java 8 features.
The entire desktop screencast + voice it's on youtube, here: https://youtu.be/uH9A37k2QkU
We start with why you should use task queues. Then we show a few straightforward examples with Python and Celery and Ruby and Resque.
Finally, we wrap up with a quick example of a task queue in PHP using Redis.
https://github.com/bryanhelmig/phqueue
Application misconfiguration attacks exploit weaknesses in web applications caused by configuration mistakes. These mistakes include using default passwords and privileges or revealing too much debugging information. Misconfiguration can have minor effects but can also cause major issues like data loss or full system compromise. It is a common problem caused by factors like human error and complex application interfaces. Proper security practices like regular reviews and testing can help detect and prevent misconfiguration vulnerabilities.
This document provides an introduction to Node.js, Express, and MongoDB. Node.js is a JavaScript runtime built on Chrome's V8 engine that allows JavaScript to be run on the server-side. Express is a web application framework for Node.js that provides routing capabilities and middleware support. MongoDB is a non-relational database that stores data in flexible, JSON-like documents, rather than using rigid tables. The document discusses the pros and cons of each technology and provides examples of basic usage and configuration.
Clean Code @Voxxed Days Cluj 2023 - opening KeynoteVictor Rentea
Clean Code principles have become a cornerstone of professional developer teams worldwide. But frameworks and languages have evolved, and so have the challenges we’re facing today while crafting modern applications. Single-page apps, extremely DRY code, microservices, excessive functional programming, and reactive flows have all taken their toll on our code quality. Hop aboard this roundtrip of the most damaging Code Smells as of 2023 and fill your toolbox with a load of practical tricks you can immediately apply to your day-to-day work. All in an entertaining show spiced with live-coding moments.
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
Ever seen a code base where understanding a simple method meant jumping through tangled class hierarchies? We all have! And while "Favor composition over inheritance!" is almost as old as object-oriented programming, strictly avoiding all types of subclassing leads to verbose, un-Pythonic code. So, what to do?
The discussion on composition vs. inheritance is so frustrating because far-reaching design decisions like this can only be made with the ecosystem in mind – and because there's more than one type of subclassing!
Let's take a dogma-free stroll through the types of subclassing through a Pythonic lens and untangle some patterns and trade-offs together. By the end, you'll be more confident in deciding when subclassing will make your code more Pythonic and when composition will improve its clarity.
This document provides an overview of design challenges and examples of designing in small domains. Some key points:
1. It discusses common reasons why design fails, such as lack of domain expertise, communication, or time for design up front.
2. It presents examples of designing value objects like GroupId and GroupName to encapsulate behavior and validation related to those concepts.
3. It shows how behaviors can be modeled through modules that handle commands and events related to a domain, like starting a private group.
4. Testing examples demonstrate state-based, event-driven, and scenario-based approaches using fixtures to generate random test data.
5. Overall it promotes designing domains with primitives/
Haskell is a non-strict, purely functional programming language with strong static type inference. It supports recursive data types like Color, recursive functions on those types, parametric polymorphism with types like lists and Maybe, type classes for concepts like equality and ordering, and default definitions for type class methods. Type classes provide ad-hoc polymorphism and are more static than object-oriented classes.
This document provides an overview of advanced Python concepts including: inheritance and the MRO; mixins; variable scope; iterators and generators; list comprehensions; itertools; coroutines; operator overloading; __getattr__ and __dict__; decorators; descriptors; properties; functions vs methods; type and metaprogramming; and using __metaclass__. It includes code examples to demonstrate these concepts.
This document discusses functional domain-driven design and the use of monads. It begins by stating that functional domain-driven design is still a work in progress. It then provides definitions of monads and functions as they relate to category theory. The document discusses how monads can be used with a functional approach to domain-driven design. It also includes brief biographical information about the software developer who posted this content.
Eric Lafortune - ProGuard and DexGuard for optimization and protectionGuardSquare
ProGuard and DexGuard are tools that optimize and obfuscate Android applications. ProGuard can shrink code size by 20-90% and improve performance by up to 20% through techniques like dead code elimination, constant propagation, and method inlining. It also protects applications from reverse engineering by obfuscating symbols through renaming and eliminating unused code and resources.
The document provides examples of code translations between OCaml and Java, asking the user to complete code snippets in Java based on OCaml examples. It tests knowledge of data structures, classes, interfaces, inheritance, exceptions, recursion, and the object-oriented design process. The user is prompted to attempt answering questions without looking at the answers first to maximize learning.
Python's "batteries included" philosophy means that it comes with an astonishing amount of great stuff. On top of that, there's a vibrant world of third-party libraries that help make Python even more wonderful. We'll go on a breezy, example-filled tour through some of my favorites, from treasures in the standard library to great third-party packages that I don't think I could live without, and we'll touch on some of the fuzzier aspects of the Python culture that make it such a joy to be part of.
Taking Perl to Eleven with Higher-Order FunctionsDavid Golden
Sometimes, you just need your Perl to go one higher. This talk will teach you how to use functions that return functions for powerful, succinct solutions to some repetitive coding problems. Along the way, you’ll see concrete examples using higher-order Perl to generate declarative, structured “fake” data for testing.
Madrid gug - sacando partido a las transformaciones ast de groovyIván López Martín
Groovy es un gran lenguaje con capacidades muy potentes de metaprogramación en tiempo de compilación. ¿Sabías que hay más de 40 transformaciones AST disponibles para hacernos la vida más fácil como desarrolladores?
En esta charla aprenderás las transformaciones más importantes que proporciona Groovy a través de muchos ejemplos para explicar todos los conceptos.
Similar to Dataclasses en Python 3.7: Empieza a borrar código (11)
Odoo ERP software
Odoo ERP software, a leading open-source software for Enterprise Resource Planning (ERP) and business management, has recently launched its latest version, Odoo 17 Community Edition. This update introduces a range of new features and enhancements designed to streamline business operations and support growth.
The Odoo Community serves as a cost-free edition within the Odoo suite of ERP systems. Tailored to accommodate the standard needs of business operations, it provides a robust platform suitable for organisations of different sizes and business sectors. Within the Odoo Community Edition, users can access a variety of essential features and services essential for managing day-to-day tasks efficiently.
This blog presents a detailed overview of the features available within the Odoo 17 Community edition, and the differences between Odoo 17 community and enterprise editions, aiming to equip you with the necessary information to make an informed decision about its suitability for your business.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
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.
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.
WhatsApp offers simple, reliable, and private messaging and calling services for free worldwide. With end-to-end encryption, your personal messages and calls are secure, ensuring only you and the recipient can access them. Enjoy voice and video calls to stay connected with loved ones or colleagues. Express yourself using stickers, GIFs, or by sharing moments on Status. WhatsApp Business enables global customer outreach, facilitating sales growth and relationship building through showcasing products and services. Stay connected effortlessly with group chats for planning outings with friends or staying updated on family conversations.
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.
DDS Security Version 1.2 was adopted in 2024. This revision strengthens support for long runnings systems adding new cryptographic algorithms, certificate revocation, and hardness against DoS attacks.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
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/
What is Augmented Reality Image Trackingpavan998932
Augmented Reality (AR) Image Tracking is a technology that enables AR applications to recognize and track images in the real world, overlaying digital content onto them. This enhances the user's interaction with their environment by providing additional information and interactive elements directly tied to physical images.
2. Tech Lead en Qnective AG
Encantador de serpientes desde v2.2
Trabajo en remoto desde 2016
Incapaz de soportarun invierno de
verdad desde2016
Apenas sé hablar español técnico
Gran amante de las listas
Como esta
Python
Venga!
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
3. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
from dataclasses import dataclass
@dataclass
class Point:
x: int
y: int
p1 = Point(0, 0)
print(f'{p1}: x={p1.x}, y={p1.y}')
p2 = Point(x=0, y=0)
print(f'{p1} == {p2} -> {p1 == p2}’)
Point(x=0, y=0): x=0, y=0
Point(x=0, y=0) == Point(x=0, y=0) -> True
4. El dato estructurado
De tuplas a clases
Añadiendo funcionalidad a una clase
Dataclass
Casosmás simples
Comparabilidad
Hashabilidad
Campos
Valores por defecto
Herencia
__slots__
Funciones de apoyo
Proyectos de terceros
Alternativas
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
6. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
red = 255, 0, 0
orange = (255, 165, 0)
green = tuple(0, 255, 0)
>>> orange[0]
255
>>> r, g, b = orange
>>> g
165
7. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
red = list((255, 0, 0))
orange = [255, 165, 0]
8. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
red = dict(red=255, green=0, blue=0)
orange = {'red': 255,
'green': 165,
'blue': 0}
>>> orange[‘blue’]
0
9. ( )
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
from collections import namedtuple
Colour = namedtuple(
'Colour', 'red green blue')
red = Colour(255, 0, 0)
orange = Colour(red=255,
green=165,
blue=0)
>>> orange.red
255
10. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
from typing import NamedTuple
class Colour(NamedTuple):
red: int
green: int
blue: int = 0 # default!
red = Colour(255, 0)
orange = Colour(red=255, green=165)
>>> red.red
255
>>> orange.blue
0
11. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
from types import SimpleNamespace
red = SimpleNamespace(red=255, green=0, blue=0)
>>> red.red
255
12. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
class Colour:
def __init__(self, red, green, blue=0):
self.red = red
self.green = green
self.blue = blue
red = Colour(255, 0)
orange = Colour(red=255, green=165)
>>> red.red
255
>>> orange.blue
0
17. def __eq__(self, other):
if other.__class__ is not self.__class__:
return NotImplemented
return (self.red, self.green, self.blue) == (
other.red, other.green, other.blue)
>>> red1 = Colour(255, 0, 0)
>>> red2 = Colour(255, 0, 0)
>>> red1 == red2
True
>>> red1 is red2
False
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
18. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
class Colour:
def __init__(self, red, green, blue=0):
self.red = red
self.green = green
self.blue = blue
def __repr__(self):
return (f"{self.__class__.__name__}("
f"red={self.red}, green={self.green}, "
f"blue={self.blue})")
def __eq__(self, other):
if other.__class__ is not self.__class__:
return NotImplemented
return (self.red, self.green, self.blue) == (
other.red, other.green, other.blue)
19. >>> list(sorted([orange, red]))
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: '<' not supported between instances of
'Colour' and 'Colour'
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
20. def __lt__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) < (
other.red, other.green, other.blue)
return NotImplemented
...
>>> list(sorted([orange, red]))
[Colour(red=255, green=0, blue=0), Colour(red=255,
green=165, blue=0)]
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
21. class Colour:
def __init__(self, red, green, blue=0):
self.red = red
self.green = green
self.blue = blue
def __repr__(self):
return (f"{self.__class__.__name__}("
f"red={self.red}, green={self.green}, "
f"blue={self.blue})")
def __eq__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) == (
other.red, other.green, other.blue)
return NotImplemented
def __ge__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) >= (
other.red, other.green, other.blue)
return NotImplemented
def __gt__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) > (
other.red, other.green, other.blue)
return NotImplemented
def __le__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) <= (
other.red, other.green, other.blue)
return NotImplemented
def __lt__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) < (
other.red, other.green, other.blue)
return NotImplemented
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
22. def __delattr__(self, name):
raise TypeError(f'cannot delete field {name}')
def __setattr__(self, name, value):
raise TypeError(f'cannot assign to field {name}’)
>>> red = Colour(255, 0, 0)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "<input>", line 4, in __init__
File "<input>", line 48, in __setattr__
TypeError: cannot assign to field red
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
23. def __init__(self, red, green, blue=0):
object.__setattr__(self, "red", red)
object.__setattr__(self, "green", green)
object.__setattr__(self, "blue", blue)
>>> red = Colour(255, 0, 0)
>>> red.blue = 1
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "<input>", line 23, in __setattr__
TypeError: cannot assign to field blue
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
28. from dataclasses import dataclass
@dataclass
class Colour:
red: int
green: int
blue: int
orange = Colour(red=255, green=165, blue=0)
red = Colour(255, 0, 0)
>>> red
Colour(red=255, green=0, blue=0)
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
29. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
# Python 3.5
from typing import Optional
def fun(width: float,
name: Optional[str]=None) -> None:
pass
# Python 3.6
temperature: float
temperature = 'cold'
class Measurement:
speed: float
__annotations__
30. from dataclasses import dataclass
@dataclass
class Colour:
red: int
green: int
blue: int
orange = Colour(red=255, green=165, blue=0)
red = Colour(255, 0, 0)
red2 = Colour(255, 0, 0)
>>> red == red2
True
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
31. from dataclasses import dataclass
@dataclass
class Colour:
red: int
green: int
blue: int
red = Colour(255, 0, 0)
>>> red.red = 240
>>> red
Colour(red=240, green=0, blue=0)
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
32. from dataclasses import dataclass
@dataclass
class Colour:
red: int
green: int
blue: int
>>> list(sorted([orange, red]))
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: '<' not supported between instances of
'Colour' and 'Colour'
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
33. @dataclass(order=True)
class Colour:
red: int
green: int
blue: int
>>> list(sorted([orange, red]))
[Colour(red=255, green=0, blue=0),
Colour(red=255, green=165, blue=0)]
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
34. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
def dataclass(_cls=None, *, order=False):
def wrap(cls):
return _process_class(cls, order)
# See if we're being called as @dataclass
# or @dataclass().
if _cls is None:
# We're called with parens.
return wrap
# We're called as @dataclass without parens.
return wrap(_cls)
35. @dataclass(order=True)
class Colour:
red: int
green: int
blue: int
>>> hash(red)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: unhashable type: 'Colour'
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
37. @dataclass(order=True, frozen=True)
class Colour:
red: int
green: int
blue: int
>>> red.red = 240
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "<string>", line 3, in __setattr__
dataclasses.FrozenInstanceError: cannot assign
to field 'red'
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
38. Dataclass
@dataclass(order=True, frozen=True)
class Colour:
red: int
green: int
blue: int
Claseartesanal
• class Colour:
def __init__(self, red, green, blue=0):
object.__setattr__(self, "red", red)
object.__setattr__(self, "green", green)
object.__setattr__(self, "blue", blue)
def __repr__(self):
return (f"{self.__class__.__name__}("
f"red={self.red}, green={self.green}, "
f"blue={self.blue})")
def __eq__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) == (
other.red, other.green, other.blue)
return NotImplemented
def __ge__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) >= (
other.red, other.green, other.blue)
return NotImplemented
def __gt__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) > (
other.red, other.green, other.blue)
return NotImplemented
def __le__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) <= (
other.red, other.green, other.blue)
return NotImplemented
def __lt__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) < (
other.red, other.green, other.blue)
return NotImplemented
def __delattr__(self, name):
raise TypeError(f'cannot delete field {name}')
def __setattr__(self, name, value):
raise TypeError(f'cannot assign to field {name}')
def __hash__(self):
return hash((self.red, self.green, self.blue))
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
40. Los campos de una dataclass
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
41. @dataclass
class Colour:
red: int
green: int
blue: int = 0
orange = Colour(red=255, green=165)
red = Colour(255, 0)
>>> red
Colour(red=255, green=0, blue=0)
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
42. from typing import List
@dataclass
class Employee:
name: str
surname: str
children: List[str] = []
john = Employee('John', 'Green')
hank = Employee('Hank', 'Green’)
john.children.append('Henry')
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
43. Traceback (most recent call last):
File "<input>", line 3, in <module>
File "dataclasses.py", line 966, in dataclass
return wrap(_cls)
File "dataclasses.py", line 958, in wrap
return _process_class(cls, init, repr, eq, order,
unsafe_hash, frozen)
File "dataclasses.py", line 809, in _process_class
for name, type in cls_annotations.items()]
File "dataclasses.py", line 809, in <listcomp>
for name, type in cls_annotations.items()]
File "dataclasses.py", line 702, in _get_field
raise ValueError(f'mutable default
{type(f.default)} for field '
ValueError: mutable default <class 'list'> for field
children is not allowed: use default_factory
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
44. from dataclasses import dataclass, field
from typing import List
@dataclass
class Employee:
name: str
surname: str
children: List[str] = field(default_factory=list)
john = Employee('John', 'Green')
hank = Employee('Hank', 'Green')
john.children.append('Henry')
john.children.append('Alice’)
>>> hank.children
[]
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
45. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
__annotations__
dataclasses.Field
__dataclass_fields__
47. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
from typing import ClassVar
@dataclass
class Colour:
MAX: ClassVar[int] = 255
red: int
green: int
blue: int = 0
red = Colour(255, 0)
orange = Colour(255, 165)
>>> red.MAX
255
49. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
@dataclass
class Point1d:
x: float
@dataclass
class Point2d(Point1d):
y: float
@dataclass
class Point3d(Point2d):
z: float
p1 = Point1d(11.1)
p2 = Point2d(22.2, 33.3)
p3 = Point3d(44.4, 55.5, 66.6)
>>> p1, p2, p3
(Point1d(x=11.1), Point2d(x=22.2, y=33.3), Point3d(x=44.4, y=55.5,
z=66.6))
50. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
@dataclass
class Colour:
__slots__ = (
'red’,
'green’,
'blue')
red: int
green: int
blue: int
>>> red.check = True
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'Colour' object has no attribute
'check'
Rapidez de acceso
Restricción de creación de campos
Ahorro de espacio
¡Sin valores por defecto!
52. fields Lista los campos guardados. Funciona con instancias y
clases.
asdict Convierte un objeto en diccionario de forma recursiva
astuple Convierte un objeto en tupla de forma recursiva
replace Crea una copia (no profunda) de un objeto con algunos
campos cambiados de valor.
is_dataclass Comprueba si un objeto o clase es una dataclass
make_dataclass Crea una nueva clase con dataclass
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
53. fields Lista los campos guardados. Funciona con instancias y
clases.
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
>>> dataclasses.fields(red)
(Field(name='red’,...
Field(name='green',type=<class
'int'>,default=<dataclasses._MISSING_TYPE object at
0x0000028B13380208>,default_factory=<dataclasses._MISSI
NG_TYPE object at
0x0000028B13380208>,init=True,repr=True,hash=None,compa
re=True,metadata=mappingproxy({}),_field_type=_FIELD),
Field(name='blue’,...))
54. asdict Convierte un objeto en diccionario de forma recursiva
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
>>> dataclasses.asdict(red)
{'red': 255, 'green': 0, 'blue': 0}
55. astuple Convierte un objeto en tupla de forma recursiva
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
>>> dataclasses.astuple(red)
(255, 0, 0)
56. replace Crea una copia (no profunda) de un objeto con algunos
campos cambiados de valor.
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
>>> red2 = dataclasses.replace(red, blue=12)
>>> red2
Colour(red=255, green=0, blue=12)
57. is_dataclass Comprueba si un objeto o clase es una dataclass
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
>>> dataclasses.is_dataclass(red)
True
>>> dataclasses.is_dataclass(Colour)
True
>>> dataclasses.is_dataclass([])
False
58. make_dataclass Crea una nueva clase con dataclass
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
from dataclasses import make_dataclass
Colour = make_dataclass('Colour',
fields=[('red', int), ('green', int),
('blue', int)])
red = Colour(255, 0, 0)
orange = Colour(255, 165, 0)
60. dataslots Decorador with_slots, añade slots a una
dataclass.
dataclass-factory Crea instancias de dataclasses a partir de
diccionarios. Inverso a asdict.
strictclasses Decorador que hace que se comprueben tipos
en asignación.
dataclassinspector Intenta mostrar el equivalente al código
generado por una dataclass. Intenta.
fistro Genera instancias de dataclasses con datos
para pruebas. Fixtures.
dataclasses-jsonschema Crea JSON schema a partir de una dataclass.
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
62. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
import attr
@attr.s
class Colour:
red: int = attr.ib()
green: int = attr.ib()
blue: int = attr.ib()
red = Colour(255, 0, 0)
>>> red
Colour(red=255, green=0, blue=0)
63. Funciona desde Python 2.7
Soporta __slots__
Validadores
Convertidores
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
65. El dato estructurado
De tuplas a clases
Añadiendo funcionalidad a una clase
Dataclass
Casosmás simples
Comparabilidad
Hashabilidad
Campos
Valores por defecto
Herencia
__slots__
Funciones de apoyo
Proyectos de terceros
Alternativas
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
66. Dataclass
@dataclass(order=True, frozen=True)
class Colour:
red: int
green: int
blue: int
Claseartesanal
• class Colour:
def __init__(self, red, green, blue=0):
object.__setattr__(self, "red", red)
object.__setattr__(self, "green", green)
object.__setattr__(self, "blue", blue)
def __repr__(self):
return (f"{self.__class__.__name__}("
f"red={self.red}, green={self.green}, "
f"blue={self.blue})")
def __eq__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) == (
other.red, other.green, other.blue)
return NotImplemented
def __ge__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) >= (
other.red, other.green, other.blue)
return NotImplemented
def __gt__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) > (
other.red, other.green, other.blue)
return NotImplemented
def __le__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) <= (
other.red, other.green, other.blue)
return NotImplemented
def __lt__(self, other):
if other.__class__ is self.__class__:
return (self.red, self.green, self.blue) < (
other.red, other.green, other.blue)
return NotImplemented
def __delattr__(self, name):
raise TypeError(f'cannot delete field {name}')
def __setattr__(self, name, value):
raise TypeError(f'cannot assign to field {name}')
def __hash__(self):
return hash((self.red, self.green, self.blue))
Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
67. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
Añade.
Otro.
Campo.
69. Jacobo de Vera | @jovianjake | PyDay Tenerife 2018
Todd Ehlers en Flickr
Philippe_ en Flickr
Leo Hidalgo en Flickr
Antonio Trogu en Flickr
Bruce Baugh en Flickr
VivaAntarctica en Flickr
eightydaysjet en Flickr
Farrukh en Flickr
Andy Wilson en Flickr
Valerie Reneé en Flickr
Paul Keller en Flickr
Marc Wesel en Flickr
Matteo Tarenghi en Flickr
JD Hancock en Flickr
Smabs Sputzer (1956-2017) en Flickr
Loco Races en Flickr
Cameron Daigle en Flickr