This document summarizes closures and different closure types in Ruby including blocks, procs, and lambdas. Blocks are not objects but can be passed explicitly. Procs are method objects that can be called and passed arguments. Lambdas are similar to procs but check the number of arguments and treat return like break.
En tant que formateur Ruby, je rencontre régulièrement des développeurs manipulant les block, Proc et lambda sans toujours comprendre comment cela fonctionne. J'ai donc eu l'idée de faire cette présentation au Meetup Paris.rb. (10 décembre 2012)
This document discusses cognitive biases that affect human decision-making, including availability bias and hindsight bias. Availability bias refers to the tendency to rely more on information that is readily available. Hindsight bias is when people believe outcomes were predictable after they occurred. The document also notes that people tend to experience stronger regret over outcomes caused by actions rather than inactions. It provides photo credits for the images.
The document discusses various Ruby concepts and features including:
1. Ruby is highly dynamic, productive, and unpredictable which can lead to dangerous surprises if not used carefully. The principle of least astonishment aims to avoid surprising behavior.
2. Examples demonstrate implicit blocks, alias and alias_method differences, operator precedence, parameter defaults, method definitions, and more.
3. Ruby's flexibility allows for creative and spacey method names, parameter tricks, and dynamic behavior but can surprise developers if they do not follow the principle of least astonishment. Questions are welcomed from the audience.
This document summarizes and compares several freelancing platforms: Upwork offers both fixed-price and hourly projects with video tracking software and gameable ratings; Fiverr focuses on hourly work and has the largest number of freelancer earnings but also gameable ratings; Freelancer is a leader in fixed-price projects and number of freelancers but profile ratings can be gamed; Toptal only accepts pre-screened developers and clients for hourly work with higher rates and payment guarantees without tracking; and an upcoming community event is mentioned.
This document discusses the Ruby programming language and Vilnius Ruby community. It covers topics like Ruby being an interpreted, dynamic, object-oriented language. It provides examples of Ruby code like defining methods, iterating with blocks, and using classes and objects. It also mentions the Ruby ecosystem including open source and gems. The document encourages questions at the end.
This document summarizes closures and different closure types in Ruby including blocks, procs, and lambdas. Blocks are not objects but can be passed explicitly. Procs are method objects that can be called and passed arguments. Lambdas are similar to procs but check the number of arguments and treat return like break.
En tant que formateur Ruby, je rencontre régulièrement des développeurs manipulant les block, Proc et lambda sans toujours comprendre comment cela fonctionne. J'ai donc eu l'idée de faire cette présentation au Meetup Paris.rb. (10 décembre 2012)
This document discusses cognitive biases that affect human decision-making, including availability bias and hindsight bias. Availability bias refers to the tendency to rely more on information that is readily available. Hindsight bias is when people believe outcomes were predictable after they occurred. The document also notes that people tend to experience stronger regret over outcomes caused by actions rather than inactions. It provides photo credits for the images.
The document discusses various Ruby concepts and features including:
1. Ruby is highly dynamic, productive, and unpredictable which can lead to dangerous surprises if not used carefully. The principle of least astonishment aims to avoid surprising behavior.
2. Examples demonstrate implicit blocks, alias and alias_method differences, operator precedence, parameter defaults, method definitions, and more.
3. Ruby's flexibility allows for creative and spacey method names, parameter tricks, and dynamic behavior but can surprise developers if they do not follow the principle of least astonishment. Questions are welcomed from the audience.
This document summarizes and compares several freelancing platforms: Upwork offers both fixed-price and hourly projects with video tracking software and gameable ratings; Fiverr focuses on hourly work and has the largest number of freelancer earnings but also gameable ratings; Freelancer is a leader in fixed-price projects and number of freelancers but profile ratings can be gamed; Toptal only accepts pre-screened developers and clients for hourly work with higher rates and payment guarantees without tracking; and an upcoming community event is mentioned.
This document discusses the Ruby programming language and Vilnius Ruby community. It covers topics like Ruby being an interpreted, dynamic, object-oriented language. It provides examples of Ruby code like defining methods, iterating with blocks, and using classes and objects. It also mentions the Ruby ecosystem including open source and gems. The document encourages questions at the end.
The Ruby community is welcoming to beginners, focused on learning, values keeping things simple, is open source, seriously practices test-driven development, is highly innovative, and social. Most importantly, being part of the Ruby community is about bringing joy to programming.
This document discusses legacy and long-running projects. It defines a legacy system as an old technology that continues to be used because it still meets user needs, even though newer technologies are available. It notes that long-running projects of over 2 years duration can be considered legacy. The document provides advice on when and how to rewrite legacy systems, including ensuring the new technology is mature and the team is ready. It also discusses challenges of maintaining motivation for teams on legacy projects and paying off the accumulated technical debt over time.
The Ruby community is welcoming to beginners, focused on learning, values keeping things simple, is open source, seriously practices test-driven development, is highly innovative, and social. Most importantly, being part of the Ruby community is about bringing joy to programming.
This document discusses legacy and long-running projects. It defines a legacy system as an old technology that continues to be used because it still meets user needs, even though newer technologies are available. It notes that long-running projects of over 2 years duration can be considered legacy. The document provides advice on when and how to rewrite legacy systems, including ensuring the new technology is mature and the team is ready. It also discusses challenges of maintaining motivation for teams on legacy projects and paying off the accumulated technical debt over time.
25. Pavyzdys
class Recipe
def contains?(ingredient)
if [“miltai”, “cukrus”].include?(ingredient)
puts “Šis ingredientas yra!”
else
puts “Teks nusipirkti”
end
end
end
r = Recipe.new
r.contains?(“razinkos”) #=> “Teks nusipirkti”
29. Užduotis
Parašyti klasę, kurios objektas mokėtų
sukūrimo metu atsiminti perduotą sąrašą ir
pasakyti, ar konkreti dalis yra tame sąraše.
Pavyzdžiui:
home = House.new([“sienos”, “laiptai”])
home.has?(“langai”) #=> “Ne”
home.has?(“sienos”) #=> “Taip”
30. irmūnams :-)
ma užduotis p
Papildo
Papildykite klasę nauju metodu, kuris
pagal perduotą aukštų skaičių, grąžiną
pastato aukštį (sakykim, kad vienas
aukštas = 3.1 m)
Pavyzdžiui:
home.height(2) #=> 6.2
home.height(5) #=> 15.5