SlideShare a Scribd company logo
1 of 48
Download to read offline
Teaching Programming Online
pamela fox
@pamelafox

Friday, October 18, 13
Friday, October 18, 13
What is Khan Academy?

Friday, October 18, 13
K-12 Subject Tutorials

Friday, October 18, 13
Exercises & Videos

Friday, October 18, 13
Personalized Learning

Friday, October 18, 13
Teacher-facing Analytics

Friday, October 18, 13
The Tech Stack
Backend

Frontend

Handlebars
jQuery
Backbone

Friday, October 18, 13

LESS

FB React
Heavy on Open Source
Using

Contributing

Blogging
http://bjk5.com/
http://mattfaus.com/
Friday, October 18, 13

https://github.com/Khan
Friday, October 18, 13
What should we teach, exactly?

Friday, October 18, 13
So many options
Ruby C++
Haskell
Scheme
Java Python Lua
JavaScript

Languages

Websites Mobile
Games Hardware
Animation

Uses

Robotics Simulation
Data Science
Friday, October 18, 13
Our goals
No Installation Needed
Fun for Anyone
Shareable
Gateway Drug

Friday, October 18, 13
So many options
Ruby C++
Haskell
Scheme
Java Python Lua
JavaScript

Languages

Websites Mobile
Games Hardware
Animation
Robotics Simulation
Data Science

Uses

Friday, October 18, 13
How do students program?

Friday, October 18, 13
ACE editor

ProcessingJS
JSHint ! BabyHint ! Loop Checker

Friday, October 18, 13
ACE Editor
number scrubber

Friday, October 18, 13

color picker
ACE Editor
number scrubber

Friday, October 18, 13

color picker
ACE Editor
number scrubber

Friday, October 18, 13

color picker
ProcessingJS

http://processingjs.org/reference

Friday, October 18, 13
JSHint
var myName = “spaghetti
errors

if (i == 0) {
warnings
}

best
practices

var i = 2;
if (i == 0) {
}

Friday, October 18, 13
BabyHint
elipse(10, 10, 20, 30);
spelling

ellipse(1, 1, 20, 30, 5);
wrong
arguments

Friday, October 18, 13
Infinite Loop Checker
var i = 0;
while(i < 10) {
ellipse(i, i, 30, 30);
}

Web Worker

Friday, October 18, 13
Now, how do we teach?

Friday, October 18, 13
Usual way to teach: Videos

https://www.khanacademy.org/science/computer-science/v/python-lists

Friday, October 18, 13
Our approach: “talk-throughs”
Making passive instruction interactive!

Uses same environment they program in
https://www.khanacademy.org/cs/programming/drawing-basics/p/intro-to-drawing
Friday, October 18, 13
Playing talk-throughs
commands = [
{"key": "n", "time": 14124},
{"key": "n", "time": 14260},
{"key": "r", "time": 14676},
{"key": "e", "time": 14764},
{"key": "c", "time": 15036},
{"key": "t", "time": 15548},...]

SoundManager2.js
var player = soundManager.createSound({
url: revision.getMp3Url(),
whileplaying: function() {
updateTimeLeft(Record.currentTime());
Record.trigger("playUpdate");
}
});

Friday, October 18, 13

<audio> or <object>
Creating talk-throughs

canvas controls

recording controls

Friday, October 18, 13
Recording audio
getUserMedia()
var multirecorder = new MultiRecorder();
multirecorder.startRecording();

new Worker()
rightBuffer.push(stream[0]);
leftBuffer.push(stream[1]);

multirecorder.stopRecording();

getInterleaved();
encodeWAV();

https://github.com/Khan/MultiRecorderJS/blob/master/multirecorder.js

Friday, October 18, 13
How can we assess learning?

Friday, October 18, 13
Usual way to assess: Exercises

Repeated multiple times with variants
Friday, October 18, 13
Our approach: coding challenges

Structured yet flexible.
More than one way to code the solution.
Friday, October 18, 13
...and they’re fun!

Friday, October 18, 13
How do we “grade” challenges?

staticTest

Friday, October 18, 13

StructuredJS

Esprima
Esprima
AST
JavaScript
var theNumber = 50;
if (theNumber > 0) {
}

http://esprima.org/demo/parse.html#
Friday, October 18, 13
StructuredJS
structure:

user code:

var $numVar = $numVal;

var theNumber = 10;

if ($numVar > 0) {
rect($x, $y, $w, $h);
}

fill(255, 255, 255);
if (theNumber > 0) {
rect(10, 10, 30, 40);
}
if (theNumber < 0) {
rect(10, 50, 30, 40);
}

it’s a match!
http://khan.github.io/structuredjs/index.html

Friday, October 18, 13
staticTest
staticTest(“Add the ifs!”, function() {
var descrip = “Now add an if to check if the number is positive.”;
var pattern = function() {
var $numVar = $numVal;
if ($numVar > 0) {
rect($x, $y, $w, $h);
}
};
result = match(pattern);
if (passes(result)) {
var goodX = structure(pattern, inRange(“$x”, 10, 20));
if (!matches(goodX)) {
result = fail(“Hm, does your rect start on the side?”);
}
}
assertMatch(result, descrip, displayP);
});

Friday, October 18, 13
...Not quite that simple, though!

Most challenge tests are hundreds of lines long.

Most steps have 10-20 helpful messages.

https://www.khanacademy.org/cs/challenge-exploding-sun/2050946856

Friday, October 18, 13
How do we get feedback on challenges?

<form action=”https://docs.google.com/a/khanacademy.org/forms/
d/1OmFRH5NoBusswiSaSYkoDiUPayycXLnpQh8IX60tJbM/formResponse”
method="post" target="hidden_iframe">

Friday, October 18, 13
Spreadsheet of user feedback
pivot table!

Friday, October 18, 13
...plus automated statistics

Friday, October 18, 13
How can we create a community?

Friday, October 18, 13
Questions & Answers

Friday, October 18, 13
Wilson Voting Algorithm, GAE’d
def wilson_confidence(upvotes_name, downvotes_name, score):
"""Lower bound of Wilson score 90% confidence interval.
This is the algorithm Reddit uses to sort comments.
You should not use this if downvotes are disallowed - it is only useful in
the presence of both upvotes and downvotes because its ranking is based on
an estimate of the ratio of upvotes to downvotes.
See http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
"""
upvotes = getattr(score, upvotes_name)
downvotes = getattr(score, downvotes_name)
if upvotes == 0:
return -downvotes
elif upvotes == downvotes:
return 0
n = upvotes + downvotes
z = 1.64485 # 90% confidence z-score
phat = float(upvotes) / n # p-hat
return ((phat + z * z / (2 * n) - z *
math.sqrt((phat * (1 - phat) + z * z / (4 * n)) / n))
/ (1 + z * z / n))

class TimeIndependentScoreProperty(ndb.ComputedProperty):
def __init__(self, upvotes_name="upvotes", downvotes_name="downvotes",
**kwargs):
super(TimeIndependentScoreProperty, self).__init__(
functools.partial(wilson_confidence, upvotes_name, downvotes_name),
**kwargs)

Friday, October 18, 13
Spin-offs!

Friday, October 18, 13
The Hot Programs

Friday, October 18, 13
Reddit Voting Algorithm, GAE’d
def time_dependent(decay_seconds, upvotes_name, downvotes_name, created_name, score):
"""Ranking based on both age and quality.
This is the algorithm Reddit uses to sort stories. We want there to be
churn, a constant stream of new programs hitting the hot page,
so this algorithm takes into account both the score of the scratchpad and the age.
See http://amix.dk/blog/post/19588
"""
s = getattr(score, upvotes_name) - getattr(score, downvotes_name)
# Weight votes logarithmically - initial votes are worth a ton
order = math.log(max(abs(s), 1), 10)
sign = 1 if s > 0 else -1 if s < 0 else 0
# Seconds since this algorithm's start date
date = getattr(score, created_name) or datetime.datetime.now()
seconds = epoch_seconds(date) - 1349108492
return round(order + sign * seconds / decay_seconds, 7)

class TimeDependentScoreProperty(ndb.ComputedProperty):
def __init__(self, decay_seconds, upvotes_name="upvotes",
downvotes_name="downvotes", created_name="created", **kwargs):
super(TimeDependentScoreProperty, self).__init__(functools.partial(
time_dependent, decay_seconds, upvotes_name, downvotes_name,
created_name), **kwargs)

Friday, October 18, 13
Teaching Programming Online

Learn

Friday, October 18, 13

Practice

Create

Share

Help

More Related Content

What's hot

Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Tatsuhiko Miyagawa
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By DesignAll Things Open
 
Black Ops Testing Workshop from Agile Testing Days 2014
Black Ops Testing Workshop from Agile Testing Days 2014Black Ops Testing Workshop from Agile Testing Days 2014
Black Ops Testing Workshop from Agile Testing Days 2014Alan Richardson
 
Code with Style - PyOhio
Code with Style - PyOhioCode with Style - PyOhio
Code with Style - PyOhioClayton Parker
 
Shibuyajs Digest
Shibuyajs DigestShibuyajs Digest
Shibuyajs Digesttakesako
 
실시간 웹 협업도구 만들기 V0.3
실시간 웹 협업도구 만들기 V0.3실시간 웹 협업도구 만들기 V0.3
실시간 웹 협업도구 만들기 V0.3NAVER D2
 
A Modest Introduction To Swift
A Modest Introduction To SwiftA Modest Introduction To Swift
A Modest Introduction To SwiftJohn Anderson
 
Javascript - The Stack and Beyond
Javascript - The Stack and BeyondJavascript - The Stack and Beyond
Javascript - The Stack and BeyondAll Things Open
 
Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1Ralph Whitbeck
 
SXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBustersSXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBustersElena-Oana Tabaranu
 
Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Alan Richardson
 

What's hot (18)

Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By Design
 
Yahoo is open to developers
Yahoo is open to developersYahoo is open to developers
Yahoo is open to developers
 
Black Ops Testing Workshop from Agile Testing Days 2014
Black Ops Testing Workshop from Agile Testing Days 2014Black Ops Testing Workshop from Agile Testing Days 2014
Black Ops Testing Workshop from Agile Testing Days 2014
 
Effective Benchmarks
Effective BenchmarksEffective Benchmarks
Effective Benchmarks
 
Code with style
Code with styleCode with style
Code with style
 
Code with Style - PyOhio
Code with Style - PyOhioCode with Style - PyOhio
Code with Style - PyOhio
 
Shibuyajs Digest
Shibuyajs DigestShibuyajs Digest
Shibuyajs Digest
 
Getting testy with Perl
Getting testy with PerlGetting testy with Perl
Getting testy with Perl
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 
실시간 웹 협업도구 만들기 V0.3
실시간 웹 협업도구 만들기 V0.3실시간 웹 협업도구 만들기 V0.3
실시간 웹 협업도구 만들기 V0.3
 
Getting Testy With Perl6
Getting Testy With Perl6Getting Testy With Perl6
Getting Testy With Perl6
 
A Modest Introduction To Swift
A Modest Introduction To SwiftA Modest Introduction To Swift
A Modest Introduction To Swift
 
Javascript - The Stack and Beyond
Javascript - The Stack and BeyondJavascript - The Stack and Beyond
Javascript - The Stack and Beyond
 
Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1
 
SXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBustersSXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBusters
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014
 

Viewers also liked

Django Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryDjango Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryPamela Fox
 
A Year of Hermit Hacking
A Year of Hermit HackingA Year of Hermit Hacking
A Year of Hermit HackingPamela Fox
 
Engineering culture
Engineering cultureEngineering culture
Engineering culturePamela Fox
 
The Developer Experience
The Developer Experience The Developer Experience
The Developer Experience Pamela Fox
 
Présentation RIA avec Adobe Flex / RIA with Adobe Flex
Présentation RIA avec Adobe Flex / RIA with Adobe FlexPrésentation RIA avec Adobe Flex / RIA with Adobe Flex
Présentation RIA avec Adobe Flex / RIA with Adobe FlexCynapsys It Hotspot
 
El Estado es un obstaculo
El Estado es un obstaculoEl Estado es un obstaculo
El Estado es un obstaculoAlicia Vasquez
 
LOR Characteristics and Considerations
LOR Characteristics and ConsiderationsLOR Characteristics and Considerations
LOR Characteristics and ConsiderationsScott Leslie
 
Sizzling Stylus!
Sizzling Stylus!Sizzling Stylus!
Sizzling Stylus!Pamela Fox
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
 
Por Qué Fracasa el Estado en la Educación
Por Qué Fracasa el Estado en la EducaciónPor Qué Fracasa el Estado en la Educación
Por Qué Fracasa el Estado en la EducaciónAlicia Vasquez
 
¿HAY LIBERTAD ECONOMICA?
¿HAY LIBERTAD ECONOMICA?¿HAY LIBERTAD ECONOMICA?
¿HAY LIBERTAD ECONOMICA?Alicia Vasquez
 
Flex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASFlex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASPamela Fox
 
Client Killed the Server Star
Client Killed the Server StarClient Killed the Server Star
Client Killed the Server StarPamela Fox
 
No, Really, I'm Shy
No, Really, I'm ShyNo, Really, I'm Shy
No, Really, I'm ShyPamela Fox
 
LA EDUCACIÓN EN UNA ECONOMIA LIBRE
LA EDUCACIÓN EN UNA ECONOMIA LIBRELA EDUCACIÓN EN UNA ECONOMIA LIBRE
LA EDUCACIÓN EN UNA ECONOMIA LIBREAlicia Vasquez
 

Viewers also liked (15)

Django Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryDjango Admin: Widgetry & Witchery
Django Admin: Widgetry & Witchery
 
A Year of Hermit Hacking
A Year of Hermit HackingA Year of Hermit Hacking
A Year of Hermit Hacking
 
Engineering culture
Engineering cultureEngineering culture
Engineering culture
 
The Developer Experience
The Developer Experience The Developer Experience
The Developer Experience
 
Présentation RIA avec Adobe Flex / RIA with Adobe Flex
Présentation RIA avec Adobe Flex / RIA with Adobe FlexPrésentation RIA avec Adobe Flex / RIA with Adobe Flex
Présentation RIA avec Adobe Flex / RIA with Adobe Flex
 
El Estado es un obstaculo
El Estado es un obstaculoEl Estado es un obstaculo
El Estado es un obstaculo
 
LOR Characteristics and Considerations
LOR Characteristics and ConsiderationsLOR Characteristics and Considerations
LOR Characteristics and Considerations
 
Sizzling Stylus!
Sizzling Stylus!Sizzling Stylus!
Sizzling Stylus!
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
Por Qué Fracasa el Estado en la Educación
Por Qué Fracasa el Estado en la EducaciónPor Qué Fracasa el Estado en la Educación
Por Qué Fracasa el Estado en la Educación
 
¿HAY LIBERTAD ECONOMICA?
¿HAY LIBERTAD ECONOMICA?¿HAY LIBERTAD ECONOMICA?
¿HAY LIBERTAD ECONOMICA?
 
Flex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASFlex vs. HTML5 for RIAS
Flex vs. HTML5 for RIAS
 
Client Killed the Server Star
Client Killed the Server StarClient Killed the Server Star
Client Killed the Server Star
 
No, Really, I'm Shy
No, Really, I'm ShyNo, Really, I'm Shy
No, Really, I'm Shy
 
LA EDUCACIÓN EN UNA ECONOMIA LIBRE
LA EDUCACIÓN EN UNA ECONOMIA LIBRELA EDUCACIÓN EN UNA ECONOMIA LIBRE
LA EDUCACIÓN EN UNA ECONOMIA LIBRE
 

Similar to Teaching Programming Online Guide

Magento Attributes - Fresh View
Magento Attributes - Fresh ViewMagento Attributes - Fresh View
Magento Attributes - Fresh ViewAlex Gotgelf
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers StealBen Scofield
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?Nikita Popov
 
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"Fwdays
 
festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...
festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...
festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...festival ICT 2016
 
PHP Performance Trivia
PHP Performance TriviaPHP Performance Trivia
PHP Performance TriviaNikita Popov
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)James Titcumb
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
 
FITC 2013 - The Technical Learning Curve
FITC 2013 - The Technical Learning CurveFITC 2013 - The Technical Learning Curve
FITC 2013 - The Technical Learning CurveLittle Miss Robot
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP TestingRan Mizrahi
 
How to write not breakable unit tests
How to write not breakable unit testsHow to write not breakable unit tests
How to write not breakable unit testsRafal Ksiazek
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP frameworkDinh Pham
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkNguyen Duc Phu
 
Develop with Swift
Develop with SwiftDevelop with Swift
Develop with SwiftNaoki Morita
 
Phpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and MinkPhpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and MinkRichard Tuin
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
 

Similar to Teaching Programming Online Guide (20)

Magento Attributes - Fresh View
Magento Attributes - Fresh ViewMagento Attributes - Fresh View
Magento Attributes - Fresh View
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?
 
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"
 
festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...
festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...
festival ICT 2013: Solid as diamond: use ruby in an web application penetrati...
 
PHP Performance Trivia
PHP Performance TriviaPHP Performance Trivia
PHP Performance Trivia
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
FITC 2013 - The Technical Learning Curve
FITC 2013 - The Technical Learning CurveFITC 2013 - The Technical Learning Curve
FITC 2013 - The Technical Learning Curve
 
Go react codelab
Go react codelabGo react codelab
Go react codelab
 
Hardcore PHP
Hardcore PHPHardcore PHP
Hardcore PHP
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP Testing
 
How to write not breakable unit tests
How to write not breakable unit testsHow to write not breakable unit tests
How to write not breakable unit tests
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP framework
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
 
Develop with Swift
Develop with SwiftDevelop with Swift
Develop with Swift
 
Phpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and MinkPhpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and Mink
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
Groovy
GroovyGroovy
Groovy
 

More from Pamela Fox

How I became a born again vegetable-tarian
How I became a born again vegetable-tarianHow I became a born again vegetable-tarian
How I became a born again vegetable-tarianPamela Fox
 
The Developer Experience
The Developer ExperienceThe Developer Experience
The Developer ExperiencePamela Fox
 
Writing Apps the Google-y Way (Brisbane)
Writing Apps the Google-y Way (Brisbane)Writing Apps the Google-y Way (Brisbane)
Writing Apps the Google-y Way (Brisbane)Pamela Fox
 
Writing Apps the Google-y Way
Writing Apps the Google-y WayWriting Apps the Google-y Way
Writing Apps the Google-y WayPamela Fox
 
The Wonders of the "Onesie"
The Wonders of the "Onesie"The Wonders of the "Onesie"
The Wonders of the "Onesie"Pamela Fox
 
I’M A Barbie Girl In A CS World
I’M A Barbie Girl In A CS WorldI’M A Barbie Girl In A CS World
I’M A Barbie Girl In A CS WorldPamela Fox
 
Google Wave 20/20: Product, Protocol, Platform
Google Wave 20/20: Product, Protocol, PlatformGoogle Wave 20/20: Product, Protocol, Platform
Google Wave 20/20: Product, Protocol, PlatformPamela Fox
 
Collaborative Mapping with Google Wave
Collaborative Mapping with Google WaveCollaborative Mapping with Google Wave
Collaborative Mapping with Google WavePamela Fox
 
Google Products: Deep Dive on Google Maps
Google Products: Deep Dive on Google MapsGoogle Products: Deep Dive on Google Maps
Google Products: Deep Dive on Google MapsPamela Fox
 
Google Products & Google Maps
Google Products & Google MapsGoogle Products & Google Maps
Google Products & Google MapsPamela Fox
 
Mashups & APIs
Mashups & APIsMashups & APIs
Mashups & APIsPamela Fox
 
A World of Words
A World of WordsA World of Words
A World of WordsPamela Fox
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIsPamela Fox
 
Growing up Geek: My Dad, the Computer Scientist
Growing up Geek: My Dad, the Computer ScientistGrowing up Geek: My Dad, the Computer Scientist
Growing up Geek: My Dad, the Computer ScientistPamela Fox
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructurePamela Fox
 
NORAD Santa Tracker: Tips & Tricks
NORAD Santa Tracker: Tips & TricksNORAD Santa Tracker: Tips & Tricks
NORAD Santa Tracker: Tips & TricksPamela Fox
 
Socializing Apps
Socializing AppsSocializing Apps
Socializing AppsPamela Fox
 
Open Maps (Or Close Enough?)
Open Maps (Or Close Enough?)Open Maps (Or Close Enough?)
Open Maps (Or Close Enough?)Pamela Fox
 
Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)Pamela Fox
 
Data-Driven Facial Animation Based on Feature Points
Data-Driven Facial Animation Based on Feature Points Data-Driven Facial Animation Based on Feature Points
Data-Driven Facial Animation Based on Feature Points Pamela Fox
 

More from Pamela Fox (20)

How I became a born again vegetable-tarian
How I became a born again vegetable-tarianHow I became a born again vegetable-tarian
How I became a born again vegetable-tarian
 
The Developer Experience
The Developer ExperienceThe Developer Experience
The Developer Experience
 
Writing Apps the Google-y Way (Brisbane)
Writing Apps the Google-y Way (Brisbane)Writing Apps the Google-y Way (Brisbane)
Writing Apps the Google-y Way (Brisbane)
 
Writing Apps the Google-y Way
Writing Apps the Google-y WayWriting Apps the Google-y Way
Writing Apps the Google-y Way
 
The Wonders of the "Onesie"
The Wonders of the "Onesie"The Wonders of the "Onesie"
The Wonders of the "Onesie"
 
I’M A Barbie Girl In A CS World
I’M A Barbie Girl In A CS WorldI’M A Barbie Girl In A CS World
I’M A Barbie Girl In A CS World
 
Google Wave 20/20: Product, Protocol, Platform
Google Wave 20/20: Product, Protocol, PlatformGoogle Wave 20/20: Product, Protocol, Platform
Google Wave 20/20: Product, Protocol, Platform
 
Collaborative Mapping with Google Wave
Collaborative Mapping with Google WaveCollaborative Mapping with Google Wave
Collaborative Mapping with Google Wave
 
Google Products: Deep Dive on Google Maps
Google Products: Deep Dive on Google MapsGoogle Products: Deep Dive on Google Maps
Google Products: Deep Dive on Google Maps
 
Google Products & Google Maps
Google Products & Google MapsGoogle Products & Google Maps
Google Products & Google Maps
 
Mashups & APIs
Mashups & APIsMashups & APIs
Mashups & APIs
 
A World of Words
A World of WordsA World of Words
A World of Words
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIs
 
Growing up Geek: My Dad, the Computer Scientist
Growing up Geek: My Dad, the Computer ScientistGrowing up Geek: My Dad, the Computer Scientist
Growing up Geek: My Dad, the Computer Scientist
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 
NORAD Santa Tracker: Tips & Tricks
NORAD Santa Tracker: Tips & TricksNORAD Santa Tracker: Tips & Tricks
NORAD Santa Tracker: Tips & Tricks
 
Socializing Apps
Socializing AppsSocializing Apps
Socializing Apps
 
Open Maps (Or Close Enough?)
Open Maps (Or Close Enough?)Open Maps (Or Close Enough?)
Open Maps (Or Close Enough?)
 
Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)Gadgets Intro (Plus Mapplets)
Gadgets Intro (Plus Mapplets)
 
Data-Driven Facial Animation Based on Feature Points
Data-Driven Facial Animation Based on Feature Points Data-Driven Facial Animation Based on Feature Points
Data-Driven Facial Animation Based on Feature Points
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Teaching Programming Online Guide

  • 1. Teaching Programming Online pamela fox @pamelafox Friday, October 18, 13
  • 3. What is Khan Academy? Friday, October 18, 13
  • 5. Exercises & Videos Friday, October 18, 13
  • 9. Heavy on Open Source Using Contributing Blogging http://bjk5.com/ http://mattfaus.com/ Friday, October 18, 13 https://github.com/Khan
  • 11. What should we teach, exactly? Friday, October 18, 13
  • 12. So many options Ruby C++ Haskell Scheme Java Python Lua JavaScript Languages Websites Mobile Games Hardware Animation Uses Robotics Simulation Data Science Friday, October 18, 13
  • 13. Our goals No Installation Needed Fun for Anyone Shareable Gateway Drug Friday, October 18, 13
  • 14. So many options Ruby C++ Haskell Scheme Java Python Lua JavaScript Languages Websites Mobile Games Hardware Animation Robotics Simulation Data Science Uses Friday, October 18, 13
  • 15. How do students program? Friday, October 18, 13
  • 16. ACE editor ProcessingJS JSHint ! BabyHint ! Loop Checker Friday, October 18, 13
  • 17. ACE Editor number scrubber Friday, October 18, 13 color picker
  • 18. ACE Editor number scrubber Friday, October 18, 13 color picker
  • 19. ACE Editor number scrubber Friday, October 18, 13 color picker
  • 21. JSHint var myName = “spaghetti errors if (i == 0) { warnings } best practices var i = 2; if (i == 0) { } Friday, October 18, 13
  • 22. BabyHint elipse(10, 10, 20, 30); spelling ellipse(1, 1, 20, 30, 5); wrong arguments Friday, October 18, 13
  • 23. Infinite Loop Checker var i = 0; while(i < 10) { ellipse(i, i, 30, 30); } Web Worker Friday, October 18, 13
  • 24. Now, how do we teach? Friday, October 18, 13
  • 25. Usual way to teach: Videos https://www.khanacademy.org/science/computer-science/v/python-lists Friday, October 18, 13
  • 26. Our approach: “talk-throughs” Making passive instruction interactive! Uses same environment they program in https://www.khanacademy.org/cs/programming/drawing-basics/p/intro-to-drawing Friday, October 18, 13
  • 27. Playing talk-throughs commands = [ {"key": "n", "time": 14124}, {"key": "n", "time": 14260}, {"key": "r", "time": 14676}, {"key": "e", "time": 14764}, {"key": "c", "time": 15036}, {"key": "t", "time": 15548},...] SoundManager2.js var player = soundManager.createSound({ url: revision.getMp3Url(), whileplaying: function() { updateTimeLeft(Record.currentTime()); Record.trigger("playUpdate"); } }); Friday, October 18, 13 <audio> or <object>
  • 28. Creating talk-throughs canvas controls recording controls Friday, October 18, 13
  • 29. Recording audio getUserMedia() var multirecorder = new MultiRecorder(); multirecorder.startRecording(); new Worker() rightBuffer.push(stream[0]); leftBuffer.push(stream[1]); multirecorder.stopRecording(); getInterleaved(); encodeWAV(); https://github.com/Khan/MultiRecorderJS/blob/master/multirecorder.js Friday, October 18, 13
  • 30. How can we assess learning? Friday, October 18, 13
  • 31. Usual way to assess: Exercises Repeated multiple times with variants Friday, October 18, 13
  • 32. Our approach: coding challenges Structured yet flexible. More than one way to code the solution. Friday, October 18, 13
  • 34. How do we “grade” challenges? staticTest Friday, October 18, 13 StructuredJS Esprima
  • 35. Esprima AST JavaScript var theNumber = 50; if (theNumber > 0) { } http://esprima.org/demo/parse.html# Friday, October 18, 13
  • 36. StructuredJS structure: user code: var $numVar = $numVal; var theNumber = 10; if ($numVar > 0) { rect($x, $y, $w, $h); } fill(255, 255, 255); if (theNumber > 0) { rect(10, 10, 30, 40); } if (theNumber < 0) { rect(10, 50, 30, 40); } it’s a match! http://khan.github.io/structuredjs/index.html Friday, October 18, 13
  • 37. staticTest staticTest(“Add the ifs!”, function() { var descrip = “Now add an if to check if the number is positive.”; var pattern = function() { var $numVar = $numVal; if ($numVar > 0) { rect($x, $y, $w, $h); } }; result = match(pattern); if (passes(result)) { var goodX = structure(pattern, inRange(“$x”, 10, 20)); if (!matches(goodX)) { result = fail(“Hm, does your rect start on the side?”); } } assertMatch(result, descrip, displayP); }); Friday, October 18, 13
  • 38. ...Not quite that simple, though! Most challenge tests are hundreds of lines long. Most steps have 10-20 helpful messages. https://www.khanacademy.org/cs/challenge-exploding-sun/2050946856 Friday, October 18, 13
  • 39. How do we get feedback on challenges? <form action=”https://docs.google.com/a/khanacademy.org/forms/ d/1OmFRH5NoBusswiSaSYkoDiUPayycXLnpQh8IX60tJbM/formResponse” method="post" target="hidden_iframe"> Friday, October 18, 13
  • 40. Spreadsheet of user feedback pivot table! Friday, October 18, 13
  • 42. How can we create a community? Friday, October 18, 13
  • 43. Questions & Answers Friday, October 18, 13
  • 44. Wilson Voting Algorithm, GAE’d def wilson_confidence(upvotes_name, downvotes_name, score): """Lower bound of Wilson score 90% confidence interval. This is the algorithm Reddit uses to sort comments. You should not use this if downvotes are disallowed - it is only useful in the presence of both upvotes and downvotes because its ranking is based on an estimate of the ratio of upvotes to downvotes. See http://www.evanmiller.org/how-not-to-sort-by-average-rating.html """ upvotes = getattr(score, upvotes_name) downvotes = getattr(score, downvotes_name) if upvotes == 0: return -downvotes elif upvotes == downvotes: return 0 n = upvotes + downvotes z = 1.64485 # 90% confidence z-score phat = float(upvotes) / n # p-hat return ((phat + z * z / (2 * n) - z * math.sqrt((phat * (1 - phat) + z * z / (4 * n)) / n)) / (1 + z * z / n)) class TimeIndependentScoreProperty(ndb.ComputedProperty): def __init__(self, upvotes_name="upvotes", downvotes_name="downvotes", **kwargs): super(TimeIndependentScoreProperty, self).__init__( functools.partial(wilson_confidence, upvotes_name, downvotes_name), **kwargs) Friday, October 18, 13
  • 46. The Hot Programs Friday, October 18, 13
  • 47. Reddit Voting Algorithm, GAE’d def time_dependent(decay_seconds, upvotes_name, downvotes_name, created_name, score): """Ranking based on both age and quality. This is the algorithm Reddit uses to sort stories. We want there to be churn, a constant stream of new programs hitting the hot page, so this algorithm takes into account both the score of the scratchpad and the age. See http://amix.dk/blog/post/19588 """ s = getattr(score, upvotes_name) - getattr(score, downvotes_name) # Weight votes logarithmically - initial votes are worth a ton order = math.log(max(abs(s), 1), 10) sign = 1 if s > 0 else -1 if s < 0 else 0 # Seconds since this algorithm's start date date = getattr(score, created_name) or datetime.datetime.now() seconds = epoch_seconds(date) - 1349108492 return round(order + sign * seconds / decay_seconds, 7) class TimeDependentScoreProperty(ndb.ComputedProperty): def __init__(self, decay_seconds, upvotes_name="upvotes", downvotes_name="downvotes", created_name="created", **kwargs): super(TimeDependentScoreProperty, self).__init__(functools.partial( time_dependent, decay_seconds, upvotes_name, downvotes_name, created_name), **kwargs) Friday, October 18, 13
  • 48. Teaching Programming Online Learn Friday, October 18, 13 Practice Create Share Help

Editor's Notes

  1. {}