The document discusses WTF oriented programming techniques including:
- Using try/catch blocks to safely access nested object attributes
- Applying the Law of Demeter to avoid violating encapsulation
- Mapping and selecting arrays instead of iterating with each
- Storing translations in locale files instead of hardcoding strings
- Conditional logic to dynamically set form field values
The examples provide concise code snippets that implement various WTF patterns for handling errors, following principles of object-oriented design, and internationalization.
Fábio Akita é co-fundador da Codeminer 42, empresa de desenvolvimento de software principalmente para startups. Desde 2008 é o criador e organizador do Rubyconf Brasil, uma das maiores conferências de tecnologia da América Latina. Tem experiência de 20 anos no mercado de software, tendo passado pelo mercado de grandes agências, consultoria SAP corporativo e pelo primeiro boom de startups em 2000. Nesta edição do 7Masters, ele trouxe a talk "WTF Oriented Programming".
This session will introduce you to the new Form component in Symfony2. With the new domain-driven paradigma and its flexible design, the component opens a door to a wide range of possibilities. The brand new architecture makes creating complex forms easier and faster than ever before. This talk will teach you today what you need to know to build powerful forms tomorrow.
Fábio Akita é co-fundador da Codeminer 42, empresa de desenvolvimento de software principalmente para startups. Desde 2008 é o criador e organizador do Rubyconf Brasil, uma das maiores conferências de tecnologia da América Latina. Tem experiência de 20 anos no mercado de software, tendo passado pelo mercado de grandes agências, consultoria SAP corporativo e pelo primeiro boom de startups em 2000. Nesta edição do 7Masters, ele trouxe a talk "WTF Oriented Programming".
This session will introduce you to the new Form component in Symfony2. With the new domain-driven paradigma and its flexible design, the component opens a door to a wide range of possibilities. The brand new architecture makes creating complex forms easier and faster than ever before. This talk will teach you today what you need to know to build powerful forms tomorrow.
Transducers are a type of reducing function that take in a reducing function and give back another reducing function. They allow you to compose functions together in a chain or pipeline structure to quickly, easily and efficiently transform data. In PHP, we have the mtdowling/transducers library, built off the basis of the idea of Clojure's transducer library.
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
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.
jQuery is drawing newcomers to JavaSCript in droves. As a community, we have an obligation -- and it is in our interest -- to help these newcomers understand where jQuery ends and JavaScript begins.
Build Solutions Not Puzzles - Write Sensible Code. Write code that can clearly communicate your intension. A few guideline and tips for writing readable and maintainable code.
SOLID - a set of concepts for designing maintainable and understandable software - yet some of these ideas can be hard to understand themselves. Scholarly definitions and generic examples of these are often still confusing and not applicable to real world applications. By taking a look at an actual application, we'll explore these principles in action, and demonstrate the benefits of following them.
[ITOnAir]데브멘토 동영상, 장동수 KTH 웹플랫폼Lab 차장(2/2부)_Dev & Tech Festival
<!--StartFragment-->하이브리드앱의 개요모바일 플랫폼 춘추전국시대앱스프레소 소개, WAC 2.0 Waikiki API앱스프레소 Extension API, Device API 및 데모영상 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />본 영상은 데브멘토 ITOnAir (tv.devmento.co.kr) 또는 다음tv팟(tvpot.daum.net/pot/Itonair)을 통해 웹과 모바일로 시청하실 수 있습니다.
HTML5 and CSS3 Refresher
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2013.
http://www.ivanomalavolta.com
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
Transducers are a type of reducing function that take in a reducing function and give back another reducing function. They allow you to compose functions together in a chain or pipeline structure to quickly, easily and efficiently transform data. In PHP, we have the mtdowling/transducers library, built off the basis of the idea of Clojure's transducer library.
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
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.
jQuery is drawing newcomers to JavaSCript in droves. As a community, we have an obligation -- and it is in our interest -- to help these newcomers understand where jQuery ends and JavaScript begins.
Build Solutions Not Puzzles - Write Sensible Code. Write code that can clearly communicate your intension. A few guideline and tips for writing readable and maintainable code.
SOLID - a set of concepts for designing maintainable and understandable software - yet some of these ideas can be hard to understand themselves. Scholarly definitions and generic examples of these are often still confusing and not applicable to real world applications. By taking a look at an actual application, we'll explore these principles in action, and demonstrate the benefits of following them.
[ITOnAir]데브멘토 동영상, 장동수 KTH 웹플랫폼Lab 차장(2/2부)_Dev & Tech Festival
<!--StartFragment-->하이브리드앱의 개요모바일 플랫폼 춘추전국시대앱스프레소 소개, WAC 2.0 Waikiki API앱스프레소 Extension API, Device API 및 데모영상 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />본 영상은 데브멘토 ITOnAir (tv.devmento.co.kr) 또는 다음tv팟(tvpot.daum.net/pot/Itonair)을 통해 웹과 모바일로 시청하실 수 있습니다.
HTML5 and CSS3 Refresher
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2013.
http://www.ivanomalavolta.com
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
An Elephant of a Different Colour: HackVic Metcalfe
Slides from my GTA-PHP Meetup talk about Hack which is the Facebook version of the PHP programming language which runs under their HHVM runtime environment for PHP. The focus of my talk was the language improvements that the Facebook team has added to PHP.
There's a lot of information in the presenter's notes, so if you're interested in Hack scroll down to see the extras.
Desmistificando Mitos de Tech Startups - Intercon 2017Fabio Akita
Versão apresentada no evento Intercon 2017. Desmistificando 10 dos principais mitos ainda repetidos pela comunidade de empreendedorismo e tech startups.
30 Days to Elixir and Crystal and Back to RubyFabio Akita
Presented at Ruby Dev Summit, a journey through learning Elixir, Crystal and making Ruby better in the process, and why Ruby still can compete in the Web.
Focada em jovens estudantes ou recém-formados para terem uma perspectiva sobre o que almejar na carreira de TI. Versão apresentada pela primeira vez no 6o meetup do Cricíuma Dev.
This is the opening keynote for the 1st edition of THE CONF (www.theconf.club). It has full presenter notes. The video recording will be available at InfoQ Brasil.
Desmistificando Mitos de Startups - Sebrae - APFabio Akita
O mundo de startups se tornou um grande show. A maioria não entende que a sorte tem um papel mais forte do que se imagina. E sem conhecimento, experiência e paciência, Não existe caminho simples para o sucesso.
A Journey through New Languages - Locaweb Tech DayFabio Akita
An exercise started in 2014 going all the way to early 2016 of a simple crawler made in (ugly) Ruby first, then moving to Elixir, to Crystal and back to Ruby and what we can take out of it.
A Journey through new Languages - Intercon 2016Fabio Akita
Minha palestra apresentando minha jornada sobre um código Ruby feito com otimização prematura, passando por Elixir, Crystal e de volta ao Ruby, escrito da forma arquiteturalmente mais "correta" e que no final se tornou até mais performática.
Esta é a minha palestra "Premature Optimization" versão "Code-Only". #THECONFBR
The Open Commerce Conference - Premature Optimisation: The Root of All EvilFabio Akita
This is the talk I presented in NYC at the Spree Conference. It's about how we may be making bad decisions out of blindly following misleading pitches. To avoid it, we just need to go back to the basics of CS: Don't optimize prematurely. Here's how.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
31. –Jamie Zawinksi
“Some people, when confronted with a problem,
think, “I know, I’ll use regular expressions.” Now
they have two problems.”
http://davidcel.is/blog/2012/09/06/stop-validating-email-addresses-with-regex/
32. class
User
<
ActiveRecord::Base
validates
:email,
format:
{
with:
/A[^@]+@([^@.]+.)+[^@.]+z/
}
end
33. class
User
<
ActiveRecord::Base
validates
:email,
format:
{
with:
/A[^@]+@([^@.]+.)+[^@.]+z/
}
end
class
EmailValidator
<
ActiveModel::EachValidator
def
validate_each(record,
attribute,
value)
unless
email_valid?(value)
record.errors[attribute]
<<
(options[:message]
||
"must
be
a
valid
email")
end
end
def
email_valid?(email)
Mail::Address.new(email)
true
rescue
Mail::Field::ParseError
=>
e
false
end
end
34. class
User
<
ActiveRecord::Base
validates
:email,
format:
{
with:
/A[^@]+@([^@.]+.)+[^@.]+z/
}
end
class
EmailValidator
<
ActiveModel::EachValidator
def
validate_each(record,
attribute,
value)
unless
email_valid?(value)
record.errors[attribute]
<<
(options[:message]
||
"must
be
a
valid
email")
end
end
def
email_valid?(email)
Mail::Address.new(email)
true
rescue
Mail::Field::ParseError
=>
e
false
end
end
35. class
User
<
ActiveRecord::Base
validates
:email,
format:
{
with:
/A[^@]+@([^@.]+.)+[^@.]+z/
}
end
class
EmailValidator
<
ActiveModel::EachValidator
def
validate_each(record,
attribute,
value)
unless
email_valid?(value)
record.errors[attribute]
<<
(options[:message]
||
"must
be
a
valid
email")
end
end
def
email_valid?(email)
Mail::Address.new(email)
true
rescue
Mail::Field::ParseError
=>
e
false
end
end
class
User
<
ActiveRecord::Base
validates
:email,
email:
true
end
36.
37. class
User
<
ActiveRecord::Base
validates
:link,
format:
{
with:
/(^$)|(^(http|https)://[a-‐z0-‐9]+([-‐.]{1}[a-‐z0-‐9]+)*.[a-‐z]{2,5}(([0-‐9]{1,5})?/.*)?$)/ix
}
end
https://coderwall.com/p/ztig5g/validate-urls-in-rails
38. class
User
<
ActiveRecord::Base
validates
:link,
format:
{
with:
/(^$)|(^(http|https)://[a-‐z0-‐9]+([-‐.]{1}[a-‐z0-‐9]+)*.[a-‐z]{2,5}(([0-‐9]{1,5})?/.*)?$)/ix
}
end
https://coderwall.com/p/ztig5g/validate-urls-in-rails
class
UrlValidator
<
ActiveModel::EachValidator
def
validate_each(record,
attribute,
value)
unless
url_valid?(value)
record.errors[attribute]
<<
(options[:message]
||
"must
be
a
valid
URL")
end
end
#
a
URL
may
be
technically
well-‐formed
but
may
#
not
actually
be
valid,
so
this
checks
for
both.
def
url_valid?(url)
url
=
URI.parse(url)
rescue
false
url.kind_of?(URI::HTTP)
||
url.kind_of?(URI::HTTPS)
end
end
39. class
User
<
ActiveRecord::Base
validates
:link,
format:
{
with:
/(^$)|(^(http|https)://[a-‐z0-‐9]+([-‐.]{1}[a-‐z0-‐9]+)*.[a-‐z]{2,5}(([0-‐9]{1,5})?/.*)?$)/ix
}
end
https://coderwall.com/p/ztig5g/validate-urls-in-rails
class
UrlValidator
<
ActiveModel::EachValidator
def
validate_each(record,
attribute,
value)
unless
url_valid?(value)
record.errors[attribute]
<<
(options[:message]
||
"must
be
a
valid
URL")
end
end
#
a
URL
may
be
technically
well-‐formed
but
may
#
not
actually
be
valid,
so
this
checks
for
both.
def
url_valid?(url)
url
=
URI.parse(url)
rescue
false
url.kind_of?(URI::HTTP)
||
url.kind_of?(URI::HTTPS)
end
end
40. class
User
<
ActiveRecord::Base
validates
:link,
url:
true
end
class
User
<
ActiveRecord::Base
validates
:link,
format:
{
with:
/(^$)|(^(http|https)://[a-‐z0-‐9]+([-‐.]{1}[a-‐z0-‐9]+)*.[a-‐z]{2,5}(([0-‐9]{1,5})?/.*)?$)/ix
}
end
https://coderwall.com/p/ztig5g/validate-urls-in-rails
class
UrlValidator
<
ActiveModel::EachValidator
def
validate_each(record,
attribute,
value)
unless
url_valid?(value)
record.errors[attribute]
<<
(options[:message]
||
"must
be
a
valid
URL")
end
end
#
a
URL
may
be
technically
well-‐formed
but
may
#
not
actually
be
valid,
so
this
checks
for
both.
def
url_valid?(url)
url
=
URI.parse(url)
rescue
false
url.kind_of?(URI::HTTP)
||
url.kind_of?(URI::HTTPS)
end
end
41. def
query
Vote.connection.select_values
<<-‐SQL
SELECT
voteable_id
FROM
votes
LEFT
OUTER
JOIN
authorships
ON
authorships.bill_id
=
voteable_id
LEFT
OUTER
JOIN
politicians
ON
politicians.id
=
politician_id
WHERE
voteable_type
=
'Bill'
AND
person_type
=
'User'
AND
votes.created_at
>=
now()
-‐
interval
'90
days'
#{@condition.present??
"AND
#{@condition}"
:
""}
GROUP
BY
voteable_id
ORDER
BY
count(*)
DESC
LIMIT
6;
SQL
end
http://guides.rubyonrails.org/active_record_querying.html
42. def
query
Vote.connection.select_values
<<-‐SQL
SELECT
voteable_id
FROM
votes
LEFT
OUTER
JOIN
authorships
ON
authorships.bill_id
=
voteable_id
LEFT
OUTER
JOIN
politicians
ON
politicians.id
=
politician_id
WHERE
voteable_type
=
'Bill'
AND
person_type
=
'User'
AND
votes.created_at
>=
now()
-‐
interval
'90
days'
#{@condition.present??
"AND
#{@condition}"
:
""}
GROUP
BY
voteable_id
ORDER
BY
count(*)
DESC
LIMIT
6;
SQL
end
def
query
query
=
Vote.select('voteable_id')
joins("LEFT
OUTER
JOIN
authorships
ON
authorships.bill_id
=
voteable_id").
joins("LEFT
OUTER
JOIN
politicians
ON
politicians.id
=
politician_id").
where(voteable_type:
'Bill',
person_type:
'User').
where("votes.created_at
>=
now()
-‐
interval
'90
days'").
group('voteable_id').
order('count(*)
desc').
limit(6)
query
=
query.where(@condition)
if
@condition.present?
query
end
http://guides.rubyonrails.org/active_record_querying.html