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

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
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
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
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
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

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