SlideShare a Scribd company logo
1 of 22
Download to read offline
Ruby
Code The Web
세상에서 가장 아름다운 프로그래밍 언어
2015.05.31
HTML + CSSHTML
웹 서비스의 기본 구성
Client Server
“나 페이지 보여줘”
“응 여기 있어”
Request
Response
Static Website (대학 동아리 소개 웹사이트)
Client Server
“나
페이지
보여줘”
“나 페이지 보여줘”
“나 페이지 보여줘”
“여기 똑같은 놈이야”
“그래 이 남자야”
“이 남자야”
Dynamic Website (페이스북, 트위터)
Client Server
“나
페이지
보여줘”
“나 페이지 보여줘”
“나 페이지 보여줘”
“넌 권한이 없어”
“넌 노란 남자”
“넌 파란 남자”
Object-Oriented
High-Level
Scripting Language
모든 것이 객체다(진짜로) 컴파일이 필요없음
마치 영어 문장처럼
겁나 쉽게 쓰이고 읽힙니다
Data Type 을 알아서 인식한다
my_age = 26
is_she_pretty = true
my_favorite_quote = “You are a beautiful monkey”
변수 이름을 이렇게 쓰자
my_age = 26
1. 소문자로 시작한다
2. 단어들은 _ (underscore)으로 구분한다 myAge (X)
My_age(X)
3. $, @등의 기호들로 시작하지 말자 $my_age (X)
연산 기호
25 + 2 = 27
5 - 3 = 2
3 * 4 = 12
5 / 4 = 1
2**3 = 8
10 % 7 = 3
덧셈
뺄셈
곱셈
나눗셈
지수
모듈 (나머지)
출력하기
puts “what is his name”
print “is he hot”
출력한 후 빈 줄을 하나 추가한다
화면에 그냥 출력한다
이름 (String)
나이 (Integer)
어머님 나이(Integer)
본인이 AB형인지 아닌지 (Boolean)
2. puts 를 이용해서 이름을 출력해주세요
3. print 를 이용해서 어머니 나이와
본인 나이를 곱한 값을 출력해주세요
4. puts 를 이용해서 AB형 유무를 출력해주세요
1. 위의 값들을 각각의 변수에 넣어서 입력해주세요
반복자(Iterators) - while loop
count = 1
while count <= 10
puts count
count += 1
end
반복자(Iterators) - for loop
for number in 1…10
puts “Hi”
end
반복자(Iterators) - for loop
animals = [“cats”, “dogs”, “monkeys”]
for num in 0..2
puts animals[num]
end
반복자(Iterators) - each loop
animals = [“cats”, “dogs”, “monkeys”]
animals.each do |x|
puts x
end
반복자(Iterators)
while, for, each 반복자들을 활용해서
1 ~ 10000 의 숫자를 합친 값을 출력하세요
Data 종류 - Symbol
표기 방식 :name
String 과 같다고 생각하면 이해하기 쉽다
주로 함수 이름, 키 이름, 변수등의 ID 로 사용된다
예) student[:grade]
Data 종류 - Array
x = Array.new
x << 10
x[1] = 99
y = ["Alice", 23, 7.3]
x[2] = y[1] + y[-1]
Data 종류 - Hash
person = Hash.new
person["last_name"] = "Rodriguez"
person[:first_name] = “Alice"
order = {"item" => "Corn Flakes", "weight" => 18}
order = {:item => "Corn Flakes", :weight => 18}
order = {item: "Corn Flakes", weight: 18}
It was the best of times, it was the worst of times, it was the age of wisdom,
it was the age of foolishness, it was the epoch of belief, it was the epoch of
incredulity, it was the season of Light, it was the season of Darkness, it was
the spring of hope, it was the winter of despair, we had everything before
us, we had nothing before us, we were all going direct to Heaven, we were
all going direct the other way.
위 글은 Charles Dickens 명작인
<두 도시 이야기>의 오프닝 문단입니다.
Hash를 이용하여 각 단어별로
문단에 등장하는 빈도수를 출력하세요
hint: String 의 split 함수 활요

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Code_The_Web_150531_Ruby_1

  • 1. Ruby Code The Web 세상에서 가장 아름다운 프로그래밍 언어 2015.05.31
  • 3. 웹 서비스의 기본 구성 Client Server “나 페이지 보여줘” “응 여기 있어” Request Response
  • 4. Static Website (대학 동아리 소개 웹사이트) Client Server “나 페이지 보여줘” “나 페이지 보여줘” “나 페이지 보여줘” “여기 똑같은 놈이야” “그래 이 남자야” “이 남자야”
  • 5. Dynamic Website (페이스북, 트위터) Client Server “나 페이지 보여줘” “나 페이지 보여줘” “나 페이지 보여줘” “넌 권한이 없어” “넌 노란 남자” “넌 파란 남자”
  • 6.
  • 7.
  • 8. Object-Oriented High-Level Scripting Language 모든 것이 객체다(진짜로) 컴파일이 필요없음 마치 영어 문장처럼 겁나 쉽게 쓰이고 읽힙니다
  • 9. Data Type 을 알아서 인식한다 my_age = 26 is_she_pretty = true my_favorite_quote = “You are a beautiful monkey”
  • 10. 변수 이름을 이렇게 쓰자 my_age = 26 1. 소문자로 시작한다 2. 단어들은 _ (underscore)으로 구분한다 myAge (X) My_age(X) 3. $, @등의 기호들로 시작하지 말자 $my_age (X)
  • 11. 연산 기호 25 + 2 = 27 5 - 3 = 2 3 * 4 = 12 5 / 4 = 1 2**3 = 8 10 % 7 = 3 덧셈 뺄셈 곱셈 나눗셈 지수 모듈 (나머지)
  • 12. 출력하기 puts “what is his name” print “is he hot” 출력한 후 빈 줄을 하나 추가한다 화면에 그냥 출력한다
  • 13. 이름 (String) 나이 (Integer) 어머님 나이(Integer) 본인이 AB형인지 아닌지 (Boolean) 2. puts 를 이용해서 이름을 출력해주세요 3. print 를 이용해서 어머니 나이와 본인 나이를 곱한 값을 출력해주세요 4. puts 를 이용해서 AB형 유무를 출력해주세요 1. 위의 값들을 각각의 변수에 넣어서 입력해주세요
  • 14. 반복자(Iterators) - while loop count = 1 while count <= 10 puts count count += 1 end
  • 15. 반복자(Iterators) - for loop for number in 1…10 puts “Hi” end
  • 16. 반복자(Iterators) - for loop animals = [“cats”, “dogs”, “monkeys”] for num in 0..2 puts animals[num] end
  • 17. 반복자(Iterators) - each loop animals = [“cats”, “dogs”, “monkeys”] animals.each do |x| puts x end
  • 18. 반복자(Iterators) while, for, each 반복자들을 활용해서 1 ~ 10000 의 숫자를 합친 값을 출력하세요
  • 19. Data 종류 - Symbol 표기 방식 :name String 과 같다고 생각하면 이해하기 쉽다 주로 함수 이름, 키 이름, 변수등의 ID 로 사용된다 예) student[:grade]
  • 20. Data 종류 - Array x = Array.new x << 10 x[1] = 99 y = ["Alice", 23, 7.3] x[2] = y[1] + y[-1]
  • 21. Data 종류 - Hash person = Hash.new person["last_name"] = "Rodriguez" person[:first_name] = “Alice" order = {"item" => "Corn Flakes", "weight" => 18} order = {:item => "Corn Flakes", :weight => 18} order = {item: "Corn Flakes", weight: 18}
  • 22. It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way. 위 글은 Charles Dickens 명작인 <두 도시 이야기>의 오프닝 문단입니다. Hash를 이용하여 각 단어별로 문단에 등장하는 빈도수를 출력하세요 hint: String 의 split 함수 활요