SlideShare a Scribd company logo
1 of 31
Programmeren kun je
       leren!
       Alper Cugun
Why?
Algorithm
Fry an egg
• Put pan on furnace
• If not vegetarian
 • Put bacon in pan
• For each egg
 • Break egg and put it pan
• Yield delicious egg dish
Assignment

b = “hello”
c=1
d=3
e=c+d
Three constructs

• Loops
• Choices
• Encapsulation
Choices
Python

if points < 10:
  print ‘You need more points’
else:
  print “You’re a winner!”
Ruby code
if points < 10
 puts ‘You need more points’
else
 puts “You’re a winner!”
end
Javascript code
if (points < 10) {
    alert(‘You need more points’);
} else {
    alert(“You’re a winner!”);
}
Loops
Python


for counter in range(5):
 print ‘Counting’, counter
Ruby code

for i in 0..5
 puts “Counting #{i}”
end
Javascript code

for (var i = 0; i < 10; i++) {
    alert(‘Counting ‘ + i);
}
Encapsulation
Functions
def oranjeWint(team):
    if ‘Huntelaar’ in team:
      return True
    else:
      return False
…
print oranjeWint([‘Sneyder’, ‘’, ‘’])
Classes
class Country:
  def __init__(self, name):
     self.name = name
     self.money = 0
  def spend(self):
     self.money -= 1000000
  def bailout(self, amount):
     self.money += amount
Classes
some_country = Country()
some_country.spend()
some_country.spend()


print some_country.money


some_country.bailout(1000000)
List

a = []
b = [1, 2, ‘hello’]
print b[0]
Dictionary

b = {‘winst’: 3, ‘verlies’: 0,
‘gelijkspel’: 1}


print ‘Punten bij verlies:’, b[‘verlies’]
Where to look?

• function reference
• modules
• classes
• API docs
Verder leren
Cargo-Bot
Verder leren

• stackoverflow.com

• tryruby.org — ruby
• codecademy.com — javascript
Just do it!
Scraperwiki
Programmeren Kun Je Leren Workshop Hackathon 16-06-2012

More Related Content

Viewers also liked

Apps for Amsterdam Workshop Hackathon 16-06-2012
Apps for Amsterdam Workshop Hackathon 16-06-2012Apps for Amsterdam Workshop Hackathon 16-06-2012
Apps for Amsterdam Workshop Hackathon 16-06-2012Hack DeOverheid
 
Open Health Data Workshop Hackathon 16-06-2012
Open Health Data Workshop Hackathon 16-06-2012Open Health Data Workshop Hackathon 16-06-2012
Open Health Data Workshop Hackathon 16-06-2012Hack DeOverheid
 
Open Aid Data Workshop Hackathon 16-06-2012
Open Aid Data Workshop Hackathon 16-06-2012Open Aid Data Workshop Hackathon 16-06-2012
Open Aid Data Workshop Hackathon 16-06-2012Hack DeOverheid
 
Toeval of Niet Workshop Hackathon 16-06-2012
Toeval of Niet Workshop Hackathon 16-06-2012Toeval of Niet Workshop Hackathon 16-06-2012
Toeval of Niet Workshop Hackathon 16-06-2012Hack DeOverheid
 
College admission management system
College admission management systemCollege admission management system
College admission management systemMitesh Patel
 

Viewers also liked (6)

Apps for Amsterdam Workshop Hackathon 16-06-2012
Apps for Amsterdam Workshop Hackathon 16-06-2012Apps for Amsterdam Workshop Hackathon 16-06-2012
Apps for Amsterdam Workshop Hackathon 16-06-2012
 
Open Health Data Workshop Hackathon 16-06-2012
Open Health Data Workshop Hackathon 16-06-2012Open Health Data Workshop Hackathon 16-06-2012
Open Health Data Workshop Hackathon 16-06-2012
 
Open Aid Data Workshop Hackathon 16-06-2012
Open Aid Data Workshop Hackathon 16-06-2012Open Aid Data Workshop Hackathon 16-06-2012
Open Aid Data Workshop Hackathon 16-06-2012
 
Toeval of Niet Workshop Hackathon 16-06-2012
Toeval of Niet Workshop Hackathon 16-06-2012Toeval of Niet Workshop Hackathon 16-06-2012
Toeval of Niet Workshop Hackathon 16-06-2012
 
College admission management system
College admission management systemCollege admission management system
College admission management system
 
GENERATION OF COMPUTERS.
GENERATION OF COMPUTERS.GENERATION OF COMPUTERS.
GENERATION OF COMPUTERS.
 

Similar to Programmeren Kun Je Leren Workshop Hackathon 16-06-2012

Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScriptniklal
 
Lesson1 python an introduction
Lesson1 python an introductionLesson1 python an introduction
Lesson1 python an introductionArulalan T
 
Python Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdfPython Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdfRahul Jain
 
Generated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 GeneratorsGenerated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 GeneratorsMark Baker
 
Functional programming in ruby
Functional programming in rubyFunctional programming in ruby
Functional programming in rubyKoen Handekyn
 
Beautiful python - PyLadies
Beautiful python - PyLadiesBeautiful python - PyLadies
Beautiful python - PyLadiesAlicia Pérez
 
The Final Programming Project
The Final Programming ProjectThe Final Programming Project
The Final Programming ProjectSage Jacobs
 
Week 6 java script loops
Week 6   java script loopsWeek 6   java script loops
Week 6 java script loopsbrianjihoonlee
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
presentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptxpresentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptxGAURAVRATHORE86
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a bossgsterndale
 
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽tbosstraining
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015Fernando Hamasaki de Amorim
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesMatt Harrison
 
Introduction to Nim
Introduction to NimIntroduction to Nim
Introduction to NimFred Heath
 

Similar to Programmeren Kun Je Leren Workshop Hackathon 16-06-2012 (20)

CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 
Lesson1 python an introduction
Lesson1 python an introductionLesson1 python an introduction
Lesson1 python an introduction
 
Python Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdfPython Cheat Sheet 2.0.pdf
Python Cheat Sheet 2.0.pdf
 
Generated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 GeneratorsGenerated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 Generators
 
python_p4_v2.pdf
python_p4_v2.pdfpython_p4_v2.pdf
python_p4_v2.pdf
 
Functional programming in ruby
Functional programming in rubyFunctional programming in ruby
Functional programming in ruby
 
Beautiful python - PyLadies
Beautiful python - PyLadiesBeautiful python - PyLadies
Beautiful python - PyLadies
 
The Final Programming Project
The Final Programming ProjectThe Final Programming Project
The Final Programming Project
 
Week 6 java script loops
Week 6   java script loopsWeek 6   java script loops
Week 6 java script loops
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
presentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptxpresentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptx
 
Kotlin
KotlinKotlin
Kotlin
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a boss
 
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
 
Intro to ruby
Intro to rubyIntro to ruby
Intro to ruby
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
 
Welcome to python
Welcome to pythonWelcome to python
Welcome to python
 
Introduction to Nim
Introduction to NimIntroduction to Nim
Introduction to Nim
 

Recently uploaded

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

Programmeren Kun Je Leren Workshop Hackathon 16-06-2012

Editor's Notes

  1. \n
  2. financial opportunity, tremendous need\nmoral pressure, those that can do this now can achieve a lot and should do so\nto be aware about what is happening around you and what is possible\n
  3. al-Kwharizmi\n
  4. Recipe, if you can cook, you can program. Kids can do it and with practice you may become a master chef.\n\nhttp://www.flickr.com/photos/cproppe/4339535475/\n\nYou may burn something, or produce something inedible. But everything if you do it reflexively, you will probably learn something and do it better the next time.\n\nTo extend this analogy further: you can copy paste program just like you can cook, with ready made ingredients.\n
  5. \n
  6. The most basic construct.\n\nYou put a value somewhere where you can do something more with it.\n
  7. All programming is built from these three. This is what we started with.\n\nIf you know how to do these in one language, it&amp;#x2019;s pretty easy to do it in another. Difference between Spanish and Italian.\n
  8. In computer jargon this is called a branch, because every choice spreads out the possibilities like a tree\n\nhttp://www.flickr.com/photos/squirmelia/3644609288/\n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. This is how we used to do stuff. If you only have loops and branches, this is what you get.\n\nPeople would read printouts of machine language. We made things a bit more friendly.\n
  17. If you combine loops and choices then things start to get rather complicated rather quickly.\n\nComes down to delegate. You tell somebody what to do and you don&amp;#x2019;t care how they do it, you just care about the result.\n\nDit gaan we even allemaal in Python doen. Met Ruby ben ik niet bekend genoeg, en Javascript heeft wat rare dingen hierin zitten.\n
  18. What&amp;#x2019;s in the function does not matter for who&amp;#x2019;s outside of it. You the caller just put something in and you get something out of it according to the definition of the contract or the API.\n\nAll kinds of magic could be going on inside the function, assumptions or bugs. They are not your problem (until they are).\n\nhttp://www.flickr.com/photos/nickharris1/4529228162\n
  19. A bit more complicated than funtions, but a natural evolution onwards. Classes are collections of functions (behaviour) that have internal state.\n\nA basic economic model.\n
  20. I&amp;#x2019;m going on holiday to greece next week, so this was top of mind for me.\n\nOf course this is ridiculously simplistic. But with another couple of classes and methods, you would be well on your way to simulating the European currency market.\n\nClass ESFM with functions. That is the power of classes. They not only hide away even more complexity, you can use them to model things.\n\nAnother bunch of lines, and you will be writing a HFT trading bot.\n
  21. ruby/javascript: array\n\none of a standard object that most languages have, because they are so useful\nused when the order is important\n
  22. map, hash, associative array\n\nanother thing that is always there\nused when the order is not important, but you quickly need to find things\n
  23. http://docs.python.org/library/functions.html\nhttp://docs.python.org/py-modindex.html\n\nMost of these have example code. Are usually a lot packaged with your language. Many you can also download.\n\nThat is all configuration and can be annoying, but is not treated during the course of this 45 minutes.\n
  24. \n
  25. Built in Codea, iPad app\n
  26. \n
  27. \n
  28. http://eloquentjavascript.net/\nhttp://jsfiddle.net/\n
  29. \n
  30. https://scraperwiki.com/docs/python/python_intro_tutorial/\nhttps://scraperwiki.com/scrapers/funda-amsterdam/\n
  31. \n