Refactoring for Rails - using deodorant to prevent code smells and a shower from time to time to eliminate the most persistent ones.
Slides used for my presentation at #rubyconfth 2022
Presentation on writing clean and maintainable good. I have present really simple steps to write high quality code and share many more benefit of writing clean code.
Refactor your code to fix code smells, with the right methods from the Gurus. Watch Martin Fowler talk about TDD and Red-Green Refactoring, and follow the catalog as advised
Bye Bye Cowboy-Coder days! by Vytautas Dagilis.
„Working Effectively with Legacy Code“- one of the best books which talks about Unit testing and TDD. Presentation covers best practices listed in the book as well as shows which of them were successfully implemented in practice. You will find out how to commit changes and be sure that they work even without running and testing application itself.
This document discusses refactoring code to improve its quality. It begins by explaining that refactoring is about fixing code by improving its structure and design while maintaining its external behavior. It then discusses what makes code good or bad, focusing on qualities like robustness, simplicity and being easy to change. Common code smells that make code hard to understand and modify are identified, such as duplicated code, large classes and long methods. Refactoring is defined as changing code without changing its external behavior but improving its internal structure. Reasons for refactoring include improving maintainability and making code easier to understand and modify. The document outlines a refactoring cycle of selecting a code smell to address, choosing a refactoring technique,
This document discusses design patterns and principles. It begins by defining design patterns as repeatable solutions to common design problems. It then covers several design patterns including Singleton, Strategy, Adapter, Template, Factory, Abstract Factory, and Observer patterns. It also discusses low-level principles like Tell Don't Ask and high-level principles like the Single Responsibility Principle. Finally, it provides examples of how to implement some of the patterns and principles in code.
This document summarizes key principles for writing clean code as outlined in the book "Clean Code" by Robert C. Martin. It discusses ideas like writing code that is easy to read and understand through use of meaningful names, small functions that do one thing well, and avoiding duplication. It also covers principles for object-oriented design like encapsulation, organization for change, and separation of concerns. Testing philosophies like test-driven development and ensuring tests are fast, independent, repeatable, self-validating, and timely are also emphasized. The overall message is that writing clean code requires attention to structure, naming, formatting and testing to produce software that is simple, well-organized and a pleasure to maintain.
Scala Bay Meetup - The state of Scala code style and qualityJaime Jorge
Questions:
• What are the current Scala code styles?
• Are we respecting them? An analysis of Scala Open Source projects using Codacy
• What might become best practices/standard?
This document discusses code refactoring in Javascript. It introduces refactoring and defines it as changing code without altering external behavior but improving internal structure. The document outlines an agenda including an introduction, examples, and a coding activity. It discusses code smells that indicate needs for refactoring, such as duplicated code. It emphasizes testing during refactoring and focusing on small, incremental changes. The overall message is that refactoring improves code quality and maintainability over time.
Presentation on writing clean and maintainable good. I have present really simple steps to write high quality code and share many more benefit of writing clean code.
Refactor your code to fix code smells, with the right methods from the Gurus. Watch Martin Fowler talk about TDD and Red-Green Refactoring, and follow the catalog as advised
Bye Bye Cowboy-Coder days! by Vytautas Dagilis.
„Working Effectively with Legacy Code“- one of the best books which talks about Unit testing and TDD. Presentation covers best practices listed in the book as well as shows which of them were successfully implemented in practice. You will find out how to commit changes and be sure that they work even without running and testing application itself.
This document discusses refactoring code to improve its quality. It begins by explaining that refactoring is about fixing code by improving its structure and design while maintaining its external behavior. It then discusses what makes code good or bad, focusing on qualities like robustness, simplicity and being easy to change. Common code smells that make code hard to understand and modify are identified, such as duplicated code, large classes and long methods. Refactoring is defined as changing code without changing its external behavior but improving its internal structure. Reasons for refactoring include improving maintainability and making code easier to understand and modify. The document outlines a refactoring cycle of selecting a code smell to address, choosing a refactoring technique,
This document discusses design patterns and principles. It begins by defining design patterns as repeatable solutions to common design problems. It then covers several design patterns including Singleton, Strategy, Adapter, Template, Factory, Abstract Factory, and Observer patterns. It also discusses low-level principles like Tell Don't Ask and high-level principles like the Single Responsibility Principle. Finally, it provides examples of how to implement some of the patterns and principles in code.
This document summarizes key principles for writing clean code as outlined in the book "Clean Code" by Robert C. Martin. It discusses ideas like writing code that is easy to read and understand through use of meaningful names, small functions that do one thing well, and avoiding duplication. It also covers principles for object-oriented design like encapsulation, organization for change, and separation of concerns. Testing philosophies like test-driven development and ensuring tests are fast, independent, repeatable, self-validating, and timely are also emphasized. The overall message is that writing clean code requires attention to structure, naming, formatting and testing to produce software that is simple, well-organized and a pleasure to maintain.
Scala Bay Meetup - The state of Scala code style and qualityJaime Jorge
Questions:
• What are the current Scala code styles?
• Are we respecting them? An analysis of Scala Open Source projects using Codacy
• What might become best practices/standard?
This document discusses code refactoring in Javascript. It introduces refactoring and defines it as changing code without altering external behavior but improving internal structure. The document outlines an agenda including an introduction, examples, and a coding activity. It discusses code smells that indicate needs for refactoring, such as duplicated code. It emphasizes testing during refactoring and focusing on small, incremental changes. The overall message is that refactoring improves code quality and maintainability over time.
Clan code is extremely essential to build scalable application which can be maintained quite easily and improved further
Slide was prepared with contribution to my colleague
and i thank them for the help!
Android Deobfuscation: Tools and Techniquescaleb194331
Malware analysts are increasingly faced with the challenge of reverse engineering obfuscated code. This talk describes several obfuscation techniques and two new deobfuscation tools: dex-oracle and Simplify.
Second "code school lesson" for Eurosport's developers.
1. Refactoring : when? why? how?
2. Single Responsability
3. Practical case : clean architecture.
You’re finally doing TDD, but your past mistakes are catching up with you. No matter what you do, you can’t get rid of the gaping black holes caused by your legacy code.
In this presentation, we learn about the causes of legacy code and the reasons it is so difficult to work with. Then we discuss various techniques to test untestable code, revive and simplify incomprehensible code, redesign stable yet untested code, and repair that rift we created in the time-space continuum.
This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
Aim of this presentation is not to make you masters in Java 8 Concurrency, but to help you guide towards that goal. Sometimes it helps just to know that there is some API that might be suitable for a particular situation. Make use of the pointers given to search more and learn more on those topics. Refer to books, Java API Documentation, Blogs etc. to learn more. Examples and demos for all cases discussed will be added to my blog www.javajee.com.
This document discusses test-driven development (TDD) with Puppet. It explains why testing is important, such as having confidence to change code without breaking things. It covers what to test, like parameters, resources, and conditional logic. Tools for testing like rspec-puppet are also presented. The document demonstrates writing tests first, then code to pass the tests, for a sample MOTD module. It encourages testing all parameters and provides examples for validating values. Finally, it discusses integrating tests with Travis CI for continuous integration.
Traits in PHP allow for sharing of methods among classes without instantiation. They provide a way to reuse code and reduce duplication. Traits are included using the 'use' keyword and resolve at compile time, making them highly coupled and difficult to test in isolation. While traits can achieve multiple inheritance, their inflexibility means other patterns like dependency injection are often preferable. Traits should be used sparingly to share simple functionality rather than as a primary means of code organization.
This document discusses the importance of code reviews for programmers. It notes that code reviews can increase quality, reduce defects, improve readability, and help programmers share knowledge and get to know each other better. The document provides recommendations for different code review methodologies, how to prepare code for review, what reviewers should focus on, ways to improve code quality through refactoring and following best practices like using meaningful names and comments. It also discusses principles like DRY, object orientation, design patterns, and attention to performance and security.
The document discusses best practices for testing with mocks in Ruby on Rails applications. It recommends that tests run fast by avoiding loading Rails and using factories, and that mocks should assert messages rather than state. Tests become more maintainable by mocking roles instead of concrete objects, and by isolating code into single responsibility classes rather than putting logic in fat models. When code is well-encapsulated with messages, mocks can make tests clearer; but mocks may indicate problems when they are difficult to set up or when tests become brittle.
Même le code source mal écrit s’exécute! Du code source qui n’est pas propre peut grandement affecter l’efficacité d’une organisation de développement
logiciel. Chaque année, d’innombrables heures sont perdues par les équipes de développement à cause d’un code source mal écrit.
The process of changing a software system in such a way that it does not alter the external (observable) behavior of the code yet improves its internal structure, to make it easier to understand and cheaper to modify.
Writing Clean Code (Recommendations by Robert Martin)Shirish Bari
The document discusses clean code best practices as outlined by Robert C. Martin. It covers topics such as meaningful naming conventions, writing small functions, using comments appropriately, formatting code consistently, separating data and objects, handling errors through exceptions, defining clear boundaries, and writing unit tests. The goal is to write code that is readable, maintainable, and flexible through applying these best practices.
This document discusses using metrics to identify areas of code that need refactoring. It outlines some common metrics like lines of code, number of defects, and cyclomatic complexity. While metrics can help identify problem areas objectively, they must be easy to understand and provide actionable data. Refactoring involves small incremental changes that improve code quality without changing external behavior. Code smells indicate areas that would benefit from refactoring, and metrics can help identify smelly code. Sample refactors are also discussed.
This document discusses opportunities to improve curation on CPAN. It suggests implementing features like module tagging, reviews of module groups, registering module use, following semantic versioning guidelines, and retiring old modules. The goal is to provide more context around modules, encourage collaboration between authors, and help users more easily find high-quality solutions on CPAN.
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Mozaic Works
Talk delivered by Aki Salmi at I T.A.K.E. Unconference in Bucharest, 2014.
The presentation shows two example cases of introducing new features to the project. The first is a story of adding a search criteria to a list of 15 parameters.
The other example is total refactoring of handling files transferred to the system using FTP. It included both changes to the supported file types and the structure of the code.
In both examples, the end results are highlighted from both maintainability perspective and from business perspective.
This document introduces lambda expressions in Java 8. It provides background on why lambda expressions were added to Java, including to allow for more functional programming and parallel processing. It covers the syntax of lambda expressions, when they should and should not be used, functional interfaces, method and constructor references, referencing external variables, debugging lambda expressions, and new lambda methods added in Java 8. The document also advertises exercises for the reader to complete to practice using lambda expressions.
My presentation from the PHP Matsuri 2011 conference. This presentation discusses the changes in CakePHP 2.0 and goes into more detail on some of the cooler features that PHP 5 allows us, and some of the internal restructuring.
Data science in ruby is it possible? is it fast? should we use it?Rodrigo Urubatan
These are the slides I used in my presentation about Data Science in Ruby during the first Rubyconf Thailand
Really great event!
feel free to send questions
Data science in ruby, is it possible? is it fast? should we use it?Rodrigo Urubatan
Slides used in my presentation at http://thedevelopersconference.com.br in the #ruby track this year in são Paulo,
Talking a little about data science, what are the alternatives to do it in ruby, how to integrate ruby and python and what are the best solutions available.
Clan code is extremely essential to build scalable application which can be maintained quite easily and improved further
Slide was prepared with contribution to my colleague
and i thank them for the help!
Android Deobfuscation: Tools and Techniquescaleb194331
Malware analysts are increasingly faced with the challenge of reverse engineering obfuscated code. This talk describes several obfuscation techniques and two new deobfuscation tools: dex-oracle and Simplify.
Second "code school lesson" for Eurosport's developers.
1. Refactoring : when? why? how?
2. Single Responsability
3. Practical case : clean architecture.
You’re finally doing TDD, but your past mistakes are catching up with you. No matter what you do, you can’t get rid of the gaping black holes caused by your legacy code.
In this presentation, we learn about the causes of legacy code and the reasons it is so difficult to work with. Then we discuss various techniques to test untestable code, revive and simplify incomprehensible code, redesign stable yet untested code, and repair that rift we created in the time-space continuum.
This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
Aim of this presentation is not to make you masters in Java 8 Concurrency, but to help you guide towards that goal. Sometimes it helps just to know that there is some API that might be suitable for a particular situation. Make use of the pointers given to search more and learn more on those topics. Refer to books, Java API Documentation, Blogs etc. to learn more. Examples and demos for all cases discussed will be added to my blog www.javajee.com.
This document discusses test-driven development (TDD) with Puppet. It explains why testing is important, such as having confidence to change code without breaking things. It covers what to test, like parameters, resources, and conditional logic. Tools for testing like rspec-puppet are also presented. The document demonstrates writing tests first, then code to pass the tests, for a sample MOTD module. It encourages testing all parameters and provides examples for validating values. Finally, it discusses integrating tests with Travis CI for continuous integration.
Traits in PHP allow for sharing of methods among classes without instantiation. They provide a way to reuse code and reduce duplication. Traits are included using the 'use' keyword and resolve at compile time, making them highly coupled and difficult to test in isolation. While traits can achieve multiple inheritance, their inflexibility means other patterns like dependency injection are often preferable. Traits should be used sparingly to share simple functionality rather than as a primary means of code organization.
This document discusses the importance of code reviews for programmers. It notes that code reviews can increase quality, reduce defects, improve readability, and help programmers share knowledge and get to know each other better. The document provides recommendations for different code review methodologies, how to prepare code for review, what reviewers should focus on, ways to improve code quality through refactoring and following best practices like using meaningful names and comments. It also discusses principles like DRY, object orientation, design patterns, and attention to performance and security.
The document discusses best practices for testing with mocks in Ruby on Rails applications. It recommends that tests run fast by avoiding loading Rails and using factories, and that mocks should assert messages rather than state. Tests become more maintainable by mocking roles instead of concrete objects, and by isolating code into single responsibility classes rather than putting logic in fat models. When code is well-encapsulated with messages, mocks can make tests clearer; but mocks may indicate problems when they are difficult to set up or when tests become brittle.
Même le code source mal écrit s’exécute! Du code source qui n’est pas propre peut grandement affecter l’efficacité d’une organisation de développement
logiciel. Chaque année, d’innombrables heures sont perdues par les équipes de développement à cause d’un code source mal écrit.
The process of changing a software system in such a way that it does not alter the external (observable) behavior of the code yet improves its internal structure, to make it easier to understand and cheaper to modify.
Writing Clean Code (Recommendations by Robert Martin)Shirish Bari
The document discusses clean code best practices as outlined by Robert C. Martin. It covers topics such as meaningful naming conventions, writing small functions, using comments appropriately, formatting code consistently, separating data and objects, handling errors through exceptions, defining clear boundaries, and writing unit tests. The goal is to write code that is readable, maintainable, and flexible through applying these best practices.
This document discusses using metrics to identify areas of code that need refactoring. It outlines some common metrics like lines of code, number of defects, and cyclomatic complexity. While metrics can help identify problem areas objectively, they must be easy to understand and provide actionable data. Refactoring involves small incremental changes that improve code quality without changing external behavior. Code smells indicate areas that would benefit from refactoring, and metrics can help identify smelly code. Sample refactors are also discussed.
This document discusses opportunities to improve curation on CPAN. It suggests implementing features like module tagging, reviews of module groups, registering module use, following semantic versioning guidelines, and retiring old modules. The goal is to provide more context around modules, encourage collaboration between authors, and help users more easily find high-quality solutions on CPAN.
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Mozaic Works
Talk delivered by Aki Salmi at I T.A.K.E. Unconference in Bucharest, 2014.
The presentation shows two example cases of introducing new features to the project. The first is a story of adding a search criteria to a list of 15 parameters.
The other example is total refactoring of handling files transferred to the system using FTP. It included both changes to the supported file types and the structure of the code.
In both examples, the end results are highlighted from both maintainability perspective and from business perspective.
This document introduces lambda expressions in Java 8. It provides background on why lambda expressions were added to Java, including to allow for more functional programming and parallel processing. It covers the syntax of lambda expressions, when they should and should not be used, functional interfaces, method and constructor references, referencing external variables, debugging lambda expressions, and new lambda methods added in Java 8. The document also advertises exercises for the reader to complete to practice using lambda expressions.
My presentation from the PHP Matsuri 2011 conference. This presentation discusses the changes in CakePHP 2.0 and goes into more detail on some of the cooler features that PHP 5 allows us, and some of the internal restructuring.
Data science in ruby is it possible? is it fast? should we use it?Rodrigo Urubatan
These are the slides I used in my presentation about Data Science in Ruby during the first Rubyconf Thailand
Really great event!
feel free to send questions
Data science in ruby, is it possible? is it fast? should we use it?Rodrigo Urubatan
Slides used in my presentation at http://thedevelopersconference.com.br in the #ruby track this year in são Paulo,
Talking a little about data science, what are the alternatives to do it in ruby, how to integrate ruby and python and what are the best solutions available.
2018 the conf put git to work - increase the quality of your rails project...Rodrigo Urubatan
These are the slides I used in my presentation at #theconfbr this year.
If you have any questions or comments about the presentation, contact me through my twitter @urubatan.
if you want to subscribe to my weekly Ruby And Rails tips newsletter please do it in this address http://bit.ly/weekly_rails_tips
2018 RubyHACK: put git to work - increase the quality of your rails project...Rodrigo Urubatan
This is the RubyHack 2018 presentation on automating your common tasks using git
The main idea is to use the tools you already have to improve your day to day work
TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...Rodrigo Urubatan
Estes são os slides da minha palestra no The Developers Conference Porto Alegre deste ano, onde falei um pouco sobre desenvolvimento de aplicações multi plataforma com Xamarin, problemas e vantagens que encontrei no primeiro projeto que fiz com a plataforma, por que escolhi esta plataforma, alguns exemplos de código, ...
os exemplos completos do código Xamarin e do servidor Rails estão no meu github (tem o link nos slides)
My presentation at the first theconf.club event talking about my first experiences creating games with the Unity3d platform, why I've done it and what the platform provides
Rubyconf2016 - Solving communication problems in distributed teams with BDDRodrigo Urubatan
This was my talk in Rubyconf Brazil 2016, it summarises some of my experience using BDD to improve team interaction and communication in local and distributed teams, what are the differences, what benefits I found and how I used it.
I mainly focus in BDD as a communication tool, the automated tests are only a very good side effect, but I've already used it without test automation too.
O documento discute as vantagens e desvantagens de trabalhar remotamente. As vantagens incluem flexibilidade geográfica, mais tempo com a família e economia de custos com escritório. As desvantagens são a sensação de isolamento, desafios de comunicação sem contato pessoal e dificuldades em atividades como pair programming. Ferramentas como Hangouts, Slack e Trello podem ajudar na colaboração remota.
The document discusses using a behavior-driven development (BDD) approach to software development. It promotes using a ubiquitous language derived from user stories and scenarios to specify, develop, and test software. This helps improve communication between technical and non-technical teams. Examples are provided of automating scenarios written in a Given-When-Then format using tools like Cucumber, Gauge, and RSpec.
Interfaces ricas com Rails e React.JS @ Rubyconf 2015Rodrigo Urubatan
O documento descreve uma aplicação web criada com Ruby on Rails no backend e React.js no frontend. A aplicação é um blog simples onde os usuários podem criar, editar e visualizar posts. Componentes React são usados para construir as interfaces do usuário enquanto Backbone.js facilita a comunicação entre o cliente e o servidor. O objetivo é demonstrar como criar uma Single Page Application usando essas tecnologias.
TDC São Paulo 2015 - Interfaces Ricas com Rails e React.JSRodrigo Urubatan
O documento descreve uma aplicação web construída com Rails no backend e React.js no frontend. O objetivo é usar Rails apenas para a API e implementar toda a interface do usuário com React para melhor interação sem duplicação de código. É explicado como configurar a aplicação Rails, criar os componentes React e usar Backbone para comunicação cliente-servidor.
Full Text Search com Solr, MySQL Full text e PostgreSQL Full TextRodrigo Urubatan
Slides usados na palestra Full Text Search com Solr, MySQL Full text e PostgreSQL Full Text que apresentei hoje pela manha no #TheDevConf #TDCPOA #TDC2014
O documento fornece uma introdução básica à linguagem de programação Ruby, incluindo sua sintaxe, tipos de dados, estruturas de controle e programação orientada a objetos. Também discute como Ruby pode ser usado para acessar infraestruturas Java existentes e frameworks como Ruby on Rails.
Ruby on rails impressione a você mesmo, seu chefe e seu clienteRodrigo Urubatan
O documento descreve Ruby e Ruby on Rails. Ruby é uma linguagem de programação dinâmica e de código aberto focada em simplicidade e produtividade, enquanto Ruby on Rails é um framework web de código aberto construído em Ruby que otimiza a felicidade do programador e produtividade sustentável através de convenções ao invés de configurações.
Este documento apresenta um mini-curso sobre o framework Ruby on Rails, demonstrando como criar uma aplicação completa com sorteios integrados ao Twitter em apenas algumas etapas, incluindo instalação do Ruby, conceitos básicos, criação de cadastros de usuários e sorteios, execução dos sorteios via API do Twitter e publicação da aplicação.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
1. Refactoring
for Rails
Using deodorant to prevent code smells
and a shower from time to time to
eliminate the most persistent ones
Rodrigo Urubatan Ferreira Jardim
rodrigo@urubatan.com
http://urubatan.dev
http://github.com/urubatan
http://twitter.com/urubatan
2. There is no magic trick, to fix most
smells we use simple refactoring
• Change Function Declaration
• Collapse Hierarchy
• Extract Module (Combine Functions into…)
• Extract Class (Combine Functions into…)
• Decompose Conditional
• Inline Variable
• Extract Variable
• Extract Method
• Inline Method
• Extract Superclass
• Move Field
• Move Function
• Remove Dead Code
• Rename Field/Variable/Method/Class
• Replace Constructor With Factory Function (here I usually use constantize, …)
• Replace TypeCode with subclasses
4. Refactoring good practices/rules
• After you complete the refactoring, the tests should still
work
• Refactoring should not change behavior
• In noncritical scenarios refactoring should not change
external API
• Refactoring is about code quality; you should separate time
for it
• Time saved to improve code quality will save your vacation
time and reduce the number of bugs
• Golden rule: big refactoring should be in it’s own PR not in a
random feature PR
• Exception: always leave the code you touch better than
when you found it, always do small refactorings
6. When something
smells different
• camel case variables…
• conditional expression with parenthesis
• incorrect parenthesis in method definition
• whitespace before parenthesis in method call
• negative condition in control flow statement
• Attribution sign in comparison
• Type Checking
• That ruby code that looks like your other
language
7. Rubocop for
the help
• Add to your Gemfile
• gem 'rubocop', require: false
• Run before every commit
• rubocop –a
• Abort commit if exit code isn’t zero
• I use husky+lint-staged for this
module.exports = {
'*.js': ['npx prettier --write', 'npx
eslint', 'git update-index --again'],
'!(*schema).rb': ['rubocop -a --fail-level
e', 'git update-index --again']
}
Lint-staged.config.js
8. The old and good
spaghetti code
• Class with too many responsibilities
• Method with too many responsibilities
• Incomplete library class
• Circular dependencies
• Change one piece another blows up
• Methods with many exit points
10. Big methods
• Sometimes the method is big and the only
thing you can do is to make it clear what is it
about
11. The first shower to fix
big classes and methods
• Extract super class
• Collapse hierarchy
• Extract module
• Move function
• Extract method
• Extract variable
• Inline variable
• Rename Class/Method/Variable
12. Fruit salad
• Too many instance variables
• Too many methods
• Methods with too many arguments
13. Some things just
smells like nothing
• Many return statements
• Unneeded comments
• If Boolean true than false
• Value objects?
14. That thing that
smells like prison
• To change one class or method safely you need
to touch many other methods or classes
• when you need to change 5 different projects
because you removed one field of a table
16. Smells like the wrong
way
• Using models in migrations
• Migrations without down method
• Migrations that change model and update
data
17. Smells like help
is needed
• Views with query logic
• Views with repeated code
• Views with really complex bits
18. Refactoring Summary
Rucobop and similar
tools are your friend
Refactoring should be
separated from feature
implementation, use
separated PRs
Organize class
hierarchies with Extract
Superclass, extract
Module, extract class,
move function
Organize method body
with extract method,
extract variable, inline
variable
Remove dead code,
and have only one exit
point per method
whenever possible
Kill anything that
indicate a circular
dependency
Controllers should be
thin, models strong but
not fat
Pay attention to your
migrations
Use view helpers wisely
Don’t add query code
in your views
Cleaner code has less
bugs, and increase your
vacation/free time
Code smells are a really cool way to describe and remember things that in some situations might cause issues in our code, flags to parts of the code that need refactoring.
And there are many different names for common refactoring techniques, some language specific, but after researching most of what I saw was already described in the refactoring holly book.
This presentation will not be code intensive; I’ll hardly show any code but I’ll try to help everyone identify some red flags and will comment how to improve them, most of the time using techniques name from this book.
Adventure is good when we arrive in a marvelous country like Thailand, but for our code it isn’t always good…
I know that sometimes the case without else covers all the possibilities of an enumeration, but in the future we might add another item to that enumeration and break the code
And for code without tests that is always a big risk of everything breaking down with any change
We have all been there, I use an enum to identify tag types in a system, and that enum has a case to display a user friendly name in one or two screens in the system, after a few years the system was running fine, the editors asked for a new tag type, that we promptly added to the enumeration, and a “Undefined method for NilClass” started appearing in the system logsand this is a sample of both scenarios because we also didn’t add the new enum value to the test case before that bug…
And of course, those two situations aren’t even in the refactoring list, maybe in Clean Code, but it is better to avoid both scenarios when possible
And add new tests for any code you touch
There are other scenarios that can explode your code and are easy to find and fix, the easiest way to find these simpler cases is to use a tool like rubocop
Rubocop will also help your ruby code look and feel like Ruby code, and not like the juice stand in a comedy show from Latin America
in the show a homeless boy opened a juice stand, and whenever you asked for one of the juices he would say: this one is lemon juice, it tastes like gooseberry and looks like tamarind..Rubocop standard configuration will warn you before your code looks like one of those juices
I think it is a good practice to add rubocop for all your projects Gemfile, that will prevent versioning issues and make sure you always have it installed.
And with a little help of husky and lint-staged JS modules, we can make sure it is executed before every commit reducing the risk of human error/forgetting to run it
I think of rubocop as your everyday deodorant, it’ll keep out most mildly smells but won’t prevent you from needing a shower
This is one of the best smells on an Italian restaurant and one of the worst smiles on your code, if you think of spaghetti while looking at the code it means there are many other smaller smells, like a wale class, dolphin method, you might smell something missing, or you might smell like you’ve been there already.
One of the most common consequences of this smell is that when you change one part of the code, another or many other parts will blow due to circular dependencies or simply poor organization.
There isn’t one single path to fix this big mess, so I’ll break it into a few different smells to help with the refactoring.
When you find a whale class, it is probably not alone, because whales travel in pod, and they are usually composed of big methods
Dolphin methods are usually a big part of whale classes, most of the time these big methods are doing more than they should, but even if they aren’t doing more then what they should, they will make your life debugging or understanding the code a less fun and a lor harder.
In case the pod of whales has duplicated code what is really common, we can start the refactoring with an extract super class, sometimes the pod has nothing in common, in this case we collapse hierarchy, and when the whale is trying to fly, walk or do something that it shouldn’t we can extract module or extract class to move the weird behavior outside and use composition.
Since in our code whales and dolphins usually are part of the same pod, we’ll also use a lot of extract method, that is one of the hardest refactoring in my opinion, because it involves passing parameters to the new method, using a good name and returning everything the old method needs to continue and if this is correctly done the new method might remove duplicated code from other parts of our big class hierarchy.
Many times we combine extract method with move function to move methods to the new parent class or the newly created module.
Extract variable also usually helps in extracting methods, and sometimes inline variable will make the extracted method include code duplicated code from more whales.
This also means that we usually use extract/inline variable to create code duplication in many places to solve that duplication with extract method.
An last but not less important, an spaghetti rarely has a good naming convention, so use rename with abundance.
Some classes remember a fruit salad, because they contain a lot of instance variables, a huge number of methods and methods with too many attributes.
Sometimes this is hidden, like an activerecord class that points to a table with a huge number of fields.
To improve this scenarios, to initialize a class with too many instance variables and to fix methods with too many arguments we usually accept a parameter object, what in ruby is usually replaces by a more flexible hash.
For an API method it is usually better to receive an object with the specific arguments instead of having one method with many arguments in-line, it is easier to document.
The refactoring for that would be a Combine Variables into Value Object, and combine arguments into Value Object
There is also code that just doesn’t smell like anything, actually it smells like it shouldn’t be there, for these we use Remove Dead Code
And with a lot of dead code removed, and sometimes not dead but simply useless like return statements, our code will look a lot more like ruby and will look cleaner.
Also using returns when the code isn’t really useless, we should probably rearrange the logic of that method because too many exist points is a really bad code smell that will start turning your code into an Italian pasta
There are other scenarios where your code is making your life a lot harder, for example when a change in one method reflects in many different places, or worse yet to change one field or method you need to apply the same change in various other places.
This is usually a lack of encapsulation
To solve this, we should use Encapsulate Variable or work on the class hierarchies with Extract Superclass or Collapse Hierarchy, usually the former is better.
There is also no perfect path for something that is depended on a lot of places, but it is a good idea to have clear paths of dependencies through the application and libraries, and avoid circular dependencies with all your forces.
Those are the two most common rails anti patterns, of course there is no magic number but if your controller is doing much more than preparing data to send to the model and preparing the result to send to the view probably most of that logic should be extracted to a method and then the method moved to the model.
And if the models are too fat it is very possible they are doing too many things that aren’t really related, or they become a domain dumpster
Like a music model, that starts with music name, id, file name, and suddenly starts to convert the music file to wav, mp3, ogg, created a clip for that music, counts downloads, …the convert methods should be their own commands, the download counter should probably be another model, that would also help to save more information about who and when the music was downloaded, …
In summary a fat model is usually doing things that should be elsewhere and a fat controller is probably doing things the model should do.
Migrations are those things that when you have multiple environments or take too long to move a feature to production will break during every deploy, not all migrations of course, but one of them will…
And it is usually because a model that was used in a migration changed after the migration was created
The migration doesn’t have a down method so you can’t go back to where you were before to work on the other feature and your database becomes a mess of migrated code from different branches
And migrations that change models and update data at the same time are also a good source for errors and regrets.
For these situations I could not apply the refactoring names from martin fowler book, but just avoid these cases that in my experience are the most common error sources in migrations.
When you are using erb views the most common anti patterns are adding model query logic in the views, that should be in the controllers, in the best case scenario the data needed for that view should get to the view in instance variables.
Also views with repeated code or some really complex parts, those two scenarios have the same solution, use extract method for the complex or repeated part, and move the method to a ViewHelper
This also has the side effect of allowing that bit of code to be easily tested