Dad Joke Survivors

Nickelodeon Australia put together a public service announcement (PSA) in honor of father’s day.  The premise is that dads all over the world are telling poor, barely humorous jokes to their children.  It is having an effect.  It is no laughing matter.  Definitely worth watching.

CodeForces.com

CodeForces gives you programming problems and contests.  You can choose to solve them in many different languages including Python.

Once you get an account, go to problem sets and sort by solved from “highest to lowest”.  This will give you the easiest problems first.

 

codeforces.com/

I have made just a little progress.  But I am hoping to do this on a daily basis.  You can see my progress: codeforces.com/profile/GadgetNate

If you sign up for an account, leave your user name in a comment.

CodingBat, CloudCoder, Skulpt.org, CodeMirror, and PythonTutor.com

CodingBat

CodingBat.com

CodingBat is a free site of live coding problems to build coding skill in Java, and now in Python (example problem), created by Nick Parlante who is computer science lecturer at Stanford. The coding problems give immediate feedback, so it’s an opportunity to practice and solidify understanding of the concepts. The problems could be used as homework, or for self-study practice, or in a lab, or as live lecture examples. The problems, all listed off theCodingBat home, have low overhead: short problem statements (like an exam) and immediate feedback in the browser. The idea for CodingBat came from my experience teaching CS at Stanford combined with seeing how student’s used unit-tests in more advanced courses, and crystalized when I saw an Owen Astrachan demo of a unit-testing thing he uses with his Duke students.

It is idea.  There are a few drawbacks.  The coding editor does not capture “tab” characters which is a real killer in Python where indention is nearly as common as “;” is in Java or C#.  The problems are great to get started.  Each problem essentially tells you to write a subroutine (def) and then it runs a set of unit tests on it.  It does allow for you to create your own problems.  But the editor to do this does not look to inviting.

CloudCoder

CloudCoder

CloudCoder is an open source web-based programming exercise system (inspired by CodingBat). It is designed to make it easy for instructors of introductory programming courses to assign short exercises to students for skills development and assessment. Currently, exercises in C/C++, Java, Python, and Ruby are supported.

Because CloudCoder is web-based, it is easy for students to use. The only software students need to work on exercises is a web browser.

It is opensource and written in Java, and it is hosted on GitHub: github.com/cloudcoderdotorg/CloudCoder

PythonTutor Visualization

PythonTutor.com

Online Python Tutor is a free educational tool created by Philip Guo that helps people overcome a fundamental barrier to learning programming: understanding what happens as the computer executes each line of a program’s source code.

Using this tool, you can write Python, Java, JavaScript, TypeScript, and Ruby programs in your Web browser and visualize what the computer is doing step-by-step as it executes those programs.

Their visualization component can be embedded in a website using an iFrame and the code is passed in URLEncoded to the source.    This allows for the student to step through the code line by line.  They see what is in memory, the input and the output.  It can be a great way for students to explore their code.  And it seems like a natural extension to the CloudCoder and CodeBat sites.

Trinket

trinket.io/

Trinket lets you run and write code in any browser, on any device.

Trinkets work instantly, with no need to log in, download plugins, or install software.

Easily share or embed the code with your changes when you’re done.

Skuplt

Skuplt.org

Skulpt is an entirely in-browser implementation of Python.

No preprocessing, plugins, or server-side support required, just write Python and reload.

 CodeMirror

codemirror.net

CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addonsthat implement more advanced editing functionality.

A rich programming API and a CSS theming system are available for customizing CodeMirror to fit your application, and extending it with new functionality.

The Idea

A few of my friends and their children meet up on Sundays to review MathCounts and now we have added a program/electronics/robotics section which we have started out by doing Python.  These are middle school kids.  Their ability to control their attention span is limited.  Don’t misunderstand me.  They have long and focused attention spans.  But only for things that capture their interest (like Brawl on the Nintendo or Type Racer or some other game).  Our Python training on the first day did not fall into that category.  So after a few hours of math in the morning, the Python training essentially put them to sleep.

But they love Type Racer.  Which has me on the quest to bring the same focus, interest, and experience to our Python classes.  More on that later..

LilyPond = LaTex for Music!!

LaTeX is used to format math and science papers.  It is a markup language (similar to what HTML is for the web).

LilyPond (LilyPond.org) is a markup language for writing musical scores.

 

text-input-1-annotate

 

Fescobaldi (www.frescobaldi.org/)is a Python program that makes it easy to write the LilyPond code and see the resulting script.

 

 

Find all Palindromes between 1 and 10,000 in multiple bases

 

# Find all numbers between 1 to 10,000 which are palindromes in more than one base

def digit_to_char(digit):
    if digit < 10:
        return str(digit)
    return chr(ord('a') + digit - 10)

def str_base(number,base):
    if number < 0:
        return '-' + str_base(-number, base)
    (d, m) = divmod(number, base)
    if d > 0:
        return str_base(d, base) + digit_to_char(m)
    return digit_to_char(m)



for S in range(1, 10001):
    n = 0
    S += 1
    palindromeCount = 0
    msg = ""
    for B in range(2,11):
        inBaseB = str_base(S, B)
        if inBaseB == inBaseB[::-1]:
            msg += " base " + str(B) + ": " + inBaseB + ";"
            palindromeCount += 1
    if palindromeCount >= 2:
        print(str(S) + "(" + msg + " )")
        
2( base 3: 2; base 4: 2; base 5: 2; base 6: 2; base 7: 2; base 8: 2; base 9: 2; base 10: 2; )
3( base 2: 11; base 4: 3; base 5: 3; base 6: 3; base 7: 3; base 8: 3; base 9: 3; base 10: 3; )
4( base 3: 11; base 5: 4; base 6: 4; base 7: 4; base 8: 4; base 9: 4; base 10: 4; )
5( base 2: 101; base 4: 11; base 6: 5; base 7: 5; base 8: 5; base 9: 5; base 10: 5; )
6( base 5: 11; base 7: 6; base 8: 6; base 9: 6; base 10: 6; )
7( base 2: 111; base 6: 11; base 8: 7; base 9: 7; base 10: 7; )
8( base 3: 22; base 7: 11; base 9: 8; base 10: 8; )
9( base 2: 1001; base 8: 11; base 10: 9; )
10( base 3: 101; base 4: 22; base 9: 11; )
15( base 2: 1111; base 4: 33; )
16( base 3: 121; base 7: 22; )
17( base 2: 10001; base 4: 101; )
18( base 5: 33; base 8: 22; )
20( base 3: 202; base 9: 22; )
21( base 2: 10101; base 4: 111; base 6: 33; )
24( base 5: 44; base 7: 33; )
26( base 3: 222; base 5: 101; )
27( base 2: 11011; base 8: 33; )
28( base 3: 1001; base 6: 44; )
31( base 2: 11111; base 5: 111; )
33( base 2: 100001; base 10: 33; )
36( base 5: 121; base 8: 44; )
40( base 3: 1111; base 7: 55; base 9: 44; )
45( base 2: 101101; base 8: 55; )
46( base 4: 232; base 5: 141; )
50( base 7: 101; base 9: 55; )
51( base 2: 110011; base 4: 303; )
52( base 3: 1221; base 5: 202; )
55( base 4: 313; base 6: 131; base 10: 55; )
57( base 5: 212; base 7: 111; )
63( base 2: 111111; base 4: 333; base 8: 77; )
65( base 2: 1000001; base 4: 1001; base 8: 101; )
67( base 5: 232; base 6: 151; )
73( base 2: 1001001; base 8: 111; )
78( base 5: 303; base 7: 141; )
80( base 3: 2222; base 6: 212; base 9: 88; )
82( base 3: 10001; base 9: 101; )
85( base 2: 1010101; base 4: 1111; base 7: 151; )
88( base 5: 323; base 10: 88; )
91( base 3: 10101; base 9: 111; )
92( base 6: 232; base 7: 161; )
93( base 2: 1011101; base 5: 333; )
98( base 5: 343; base 6: 242; )
99( base 2: 1100011; base 10: 99; )
100( base 3: 10201; base 7: 202; base 9: 121; )
104( base 5: 404; base 6: 252; )
105( base 4: 1221; base 8: 151; )
107( base 2: 1101011; base 7: 212; )
109( base 5: 414; base 9: 131; )
111( base 6: 303; base 10: 111; )
114( base 5: 424; base 7: 222; )
119( base 2: 1110111; base 5: 434; )
121( base 3: 11111; base 7: 232; base 8: 171; base 10: 121; )
127( base 2: 1111111; base 9: 151; )
129( base 2: 10000001; base 6: 333; )
130( base 3: 11211; base 4: 2002; base 8: 202; )
135( base 6: 343; base 7: 252; )
141( base 6: 353; base 10: 141; )
142( base 3: 12021; base 7: 262; )
150( base 4: 2112; base 7: 303; )
151( base 3: 12121; base 10: 151; )
154( base 6: 414; base 8: 232; base 9: 181; )
160( base 3: 12221; base 6: 424; )
164( base 3: 20002; base 7: 323; base 9: 202; )
170( base 4: 2222; base 8: 252; )
171( base 7: 333; base 10: 171; )
173( base 3: 20102; base 9: 212; )
178( base 6: 454; base 7: 343; base 8: 262; )
182( base 3: 20202; base 9: 222; )
185( base 6: 505; base 7: 353; )
186( base 5: 1221; base 8: 272; )
191( base 6: 515; base 9: 232; base 10: 191; )
195( base 2: 11000011; base 4: 3003; base 8: 303; )
200( base 7: 404; base 9: 242; )
203( base 3: 21112; base 6: 535; base 8: 313; )
209( base 6: 545; base 9: 252; )
212( base 3: 21212; base 10: 212; )
215( base 4: 3113; base 6: 555; )
219( base 2: 11011011; base 8: 333; )
227( base 8: 343; base 9: 272; )
235( base 4: 3223; base 7: 454; base 8: 353; )
242( base 3: 22222; base 7: 464; base 10: 242; )
246( base 5: 1441; base 9: 303; )
252( base 5: 2002; base 10: 252; )
255( base 2: 11111111; base 4: 3333; base 9: 313; )
257( base 2: 100000001; base 4: 10001; base 7: 515; )
264( base 7: 525; base 9: 323; )
273( base 2: 100010001; base 4: 10101; base 9: 333; )
282( base 5: 2112; base 9: 343; base 10: 282; )
292( base 7: 565; base 8: 444; base 10: 292; )
300( base 7: 606; base 8: 454; base 9: 363; )
313( base 2: 100111001; base 10: 313; )
316( base 3: 102201; base 8: 474; )
325( base 2: 101000101; base 4: 11011; base 8: 505; )
328( base 3: 110011; base 7: 646; base 9: 404; )
333( base 8: 515; base 10: 333; )
341( base 2: 101010101; base 4: 11111; base 8: 525; )
342( base 5: 2332; base 7: 666; )
343( base 6: 1331; base 10: 343; )
357( base 4: 11211; base 8: 545; )
364( base 3: 111111; base 9: 444; )
365( base 2: 101101101; base 8: 555; )
373( base 4: 11311; base 8: 565; base 9: 454; base 10: 373; )
381( base 2: 101111101; base 8: 575; )
393( base 4: 12021; base 10: 393; )
400( base 3: 112211; base 7: 1111; base 9: 484; )
414( base 8: 636; base 10: 414; )
427( base 2: 110101011; base 6: 1551; )
434( base 6: 2002; base 10: 434; )
438( base 5: 3223; base 8: 666; )
446( base 8: 676; base 9: 545; )
455( base 2: 111000111; base 8: 707; base 9: 555; )
464( base 9: 565; base 10: 464; )
471( base 2: 111010111; base 8: 727; )
484( base 3: 122221; base 10: 484; )
495( base 2: 111101111; base 8: 757; )
511( base 2: 111111111; base 8: 777; )
513( base 2: 1000000001; base 8: 1001; )
546( base 4: 20202; base 9: 666; )
555( base 9: 676; base 10: 555; )
560( base 3: 202202; base 6: 2332; )
564( base 5: 4224; base 9: 686; )
585( base 2: 1001001001; base 8: 1111; base 10: 585; )
624( base 5: 4444; base 7: 1551; )
626( base 5: 10001; base 10: 626; )
644( base 3: 212212; base 6: 2552; )
646( base 9: 787; base 10: 646; )
651( base 5: 10101; base 6: 3003; )
656( base 3: 220022; base 9: 808; base 10: 656; )
666( base 4: 22122; base 10: 666; )
676( base 5: 10201; base 10: 676; )
692( base 3: 221122; base 9: 848; )
693( base 2: 1010110101; base 6: 3113; )
701( base 5: 10301; base 9: 858; )
717( base 2: 1011001101; base 10: 717; )
728( base 3: 222222; base 9: 888; )
730( base 3: 1000001; base 9: 1001; )
757( base 3: 1001001; base 10: 757; )
771( base 2: 1100000011; base 4: 30003; )
777( base 6: 3333; base 10: 777; )
787( base 4: 30103; base 10: 787; )
819( base 2: 1100110011; base 4: 30303; base 6: 3443; )
820( base 3: 1010101; base 9: 1111; )
856( base 5: 11411; base 7: 2332; )
868( base 6: 4004; base 10: 868; )
910( base 3: 1020201; base 6: 4114; base 9: 1221; )
939( base 4: 32223; base 10: 939; )
975( base 2: 1111001111; base 4: 33033; )
1023( base 2: 1111111111; base 4: 33333; )
1025( base 2: 10000000001; base 4: 100001; )
1066( base 3: 1110111; base 5: 13231; )
1105( base 2: 10001010001; base 4: 101101; )
1221( base 5: 14341; base 10: 1221; )
1285( base 2: 10100000101; base 4: 110011; )
1312( base 3: 1210121; base 7: 3553; )
1365( base 2: 10101010101; base 4: 111111; )
1432( base 5: 21212; base 7: 4114; )
1441( base 6: 10401; base 10: 1441; )
1460( base 3: 2000002; base 9: 2002; )
1539( base 2: 11000000011; base 8: 3003; )
1550( base 3: 2010102; base 9: 2112; )
1640( base 3: 2020202; base 9: 2222; )
1667( base 3: 2021202; base 5: 23132; )
1755( base 2: 11011011011; base 8: 3333; )
1885( base 4: 131131; base 6: 12421; )
2000( base 7: 5555; base 9: 2662; )
2188( base 3: 10000001; base 5: 32223; )
2268( base 5: 33033; base 8: 4334; )
2293( base 5: 33133; base 6: 14341; )
2550( base 4: 213312; base 9: 3443; )
2565( base 2: 101000000101; base 8: 5005; )
2709( base 2: 101010010101; base 5: 41314; base 8: 5225; )
2730( base 4: 222222; base 9: 3663; )
2910( base 4: 231132; base 9: 3883; )
2920( base 3: 11000011; base 9: 4004; )
2925( base 2: 101101101101; base 8: 5555; )
2997( base 7: 11511; base 8: 5665; )
3069( base 2: 101111111101; base 8: 5775; )
3074( base 5: 44244; base 6: 22122; )
3075( base 2: 110000000011; base 4: 300003; )
3280( base 3: 11111111; base 9: 4444; )
3315( base 2: 110011110011; base 4: 303303; )
3550( base 7: 13231; base 9: 4774; )
3591( base 2: 111000000111; base 8: 7007; )
3640( base 3: 11222211; base 9: 4884; )
3663( base 8: 7117; base 10: 3663; )
3735( base 2: 111010010111; base 8: 7227; )
3740( base 6: 25152; base 9: 5115; )
3855( base 2: 111100001111; base 4: 330033; )
3951( base 2: 111101101111; base 8: 7557; )
3999( base 2: 111110011111; base 6: 30303; )
4095( base 2: 111111111111; base 4: 333333; base 8: 7777; )
4097( base 2: 1000000000001; base 4: 1000001; base 8: 10001; )
4161( base 2: 1000001000001; base 4: 1001001; base 8: 10101; )
4225( base 4: 1002001; base 8: 10201; )
4257( base 2: 1000010100001; base 6: 31413; )
4289( base 4: 1003001; base 8: 10301; )
4369( base 2: 1000100010001; base 4: 1010101; )
4433( base 2: 1000101010001; base 4: 1011101; )
4593( base 2: 1000111110001; base 6: 33133; )
4617( base 2: 1001000001001; base 8: 11011; )
4681( base 2: 1001001001001; base 8: 11111; )
5001( base 6: 35053; base 8: 11611; )
5049( base 2: 1001110111001; base 7: 20502; )
5125( base 2: 1010000000101; base 4: 1100011; )
5189( base 2: 1010001000101; base 4: 1101011; )
5397( base 2: 1010100010101; base 4: 1110111; )
5461( base 2: 1010101010101; base 4: 1111111; )
5740( base 6: 42324; base 9: 7777; )
5840( base 3: 22000022; base 9: 8008; )
5854( base 6: 43034; base 7: 23032; )
6148( base 6: 44244; base 7: 23632; )
6200( base 3: 22111122; base 9: 8448; )
6560( base 3: 22222222; base 9: 8888; )
6562( base 3: 100000001; base 9: 10001; )
6643( base 2: 1100111110011; base 3: 100010001; base 9: 10101; )
6697( base 4: 1220221; base 8: 15051; )
6724( base 3: 100020001; base 9: 10201; )
6761( base 4: 1221221; base 8: 15151; )
6825( base 4: 1222221; base 8: 15251; )
6886( base 9: 10401; base 10: 6886; )
6889( base 4: 1223221; base 8: 15351; )
6953( base 7: 26162; base 8: 15451; )
7300( base 3: 101000101; base 9: 11011; )
7373( base 4: 1303031; base 6: 54045; )
7381( base 3: 101010101; base 9: 11111; )
7409( base 6: 54145; base 8: 16361; )
7447( base 2: 1110100010111; base 10: 7447; )
7462( base 3: 101020101; base 9: 11211; )
7517( base 4: 1311131; base 6: 54445; )
7667( base 6: 55255; base 10: 7667; )
7703( base 6: 55355; base 7: 31313; )
7777( base 6: 100001; base 10: 7777; )
7801( base 7: 31513; base 8: 17171; )
7997( base 4: 1330331; base 10: 7997; )
8038( base 3: 102000201; base 9: 12021; )
8119( base 3: 102010201; base 9: 12121; )
8194( base 4: 2000002; base 8: 20002; )
8200( base 3: 102020201; base 7: 32623; base 9: 12221; )
8258( base 4: 2001002; base 8: 20102; )
8281( base 6: 102201; base 9: 12321; )
8322( base 4: 2002002; base 8: 20202; )
8386( base 4: 2003002; base 8: 20302; )
8578( base 3: 102202201; base 8: 20602; )
8778( base 8: 21112; base 10: 8778; )
8802( base 4: 2021202; base 7: 34443; )
9009( base 2: 10001100110001; base 10: 9009; )
9103( base 3: 110111011; base 7: 35353; )
9201( base 2: 10001111110001; base 7: 35553; )
9222( base 4: 2100012; base 5: 243342; )
9490( base 3: 111000111; base 8: 22422; )
9958( base 4: 2123212; base 7: 41014; )

 

 

 

 

Coding Contests and other Python resources

 

I have been looking at some of the various contest problems.  Every year HP sponsors a contest called HP CodeWars and looking through some of the problems, the kids should be able to solve some (with minor modifications of the problems) today.  I have printed out a handful which we can give to the kids that are further ahead to keep them engaged.  We can also integrate them into future lessons as well:
Here are some other contest problems that we can use or get ideas from:
American Computer Science League: http://www.hpcodewars.org/index.php?page=samples
Cornell University High School Programming Contest: http://www.cs.cornell.edu/home/rvr/ProgrammingContest2015.pdf
USA Computing Olympiad: http://www.usaco.org/index.php?page=resources
Proco: http://proco.stanford.edu/2009/
UIL Computer Science: http://www.uiltexas.org/academics/computer-science
Battle of the Brains: http://www.utdallas.edu/k12/contest/
Other Python Resources:
Tying in Robotics using Raspberry Pi:
OpenCV using Python: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_tutorials.html
Communicating to the Arduino in Python: http://playground.arduino.cc/Interfacing/Python
Running Python on the Arduino (Python on a chip): http://playground.arduino.cc/CommonTopics/PyMite
Python related Arduino lessons: http://www.toptechboy.com/using-python-with-arduino-lessons/
Understanding Internet protocols by building servers/clients:
Sockets overview and creating an Echo server: http://www.bogotobogo.com/python/python_network_programming_server_client.php
Build a webserver in Python: http://ruslanspivak.com/lsbaws-part1/
Webclient (extremely simple): http://stackoverflow.com/questions/4220601/writing-a-small-yet-flexible-http-client
Python Chat server: http://www.ibm.com/developerworks/linux/tutorials/l-pysocks/
Creating web applications in Python (review of options and frameworks):
Leave a comment with Python resources you think I should check out.

 

The Interstellar Team

Here are some of the grand prize entries from previous years:

See more at: http://settlement.arc.nasa.gov/Contest/

First Python Class for kids

A fellow parent and I are working on putting together a Python class for our middle school children.  In the first lesson, planning to cover:

  • Install Python on your computer
  • Using IDLE interactively to explore
    • String
    • Variables
    • if/else
    • while
    • Boolean logic
    • Integers
  • Create Python files

Here is the PowerPoint file we have so far:

Tutorial01-basic-NathanEdits (1)

 

“Lean On”

Lean On” is a song recorded by American EDM group Major Lazer and French producer DJ Snake for Major Lazer’s third studio album, Peace Is the Mission (2015), featuring vocals from Danish singer . It was produced by Major Lazer and DJ Snake, and written by MØ, Major Lazer member Diplo, DJ Snake, Jr. Blender and Martin Bresso.[1] “Lean On” was released through Mad Decent independently (Because Music for Europe, WMG for Australia) as the lead single from the album on March 1, 2015.[2] It is a dancehall[3] and electronic song being also described as a house music ballad.[4][5]

“Lean On” was a commercial success, peaking at number 4 on the Billboard Hot 100 and at number 2 on the UK Singles Chart. It reached number one in several other countries including Australia, Ireland, the Netherlands, New Zealand, Denmark and Switzerland. The accompanying music video for “Lean On” was filmed in ND Studios, Karjat and Kaul Heritage City, Vasai in Maharashtra, India, and premiered on March 23, 2015.

It was chosen as the official song of 2017 FIFA U-17 World Cup

[From Wikipedia: en.wikipedia.org/wiki/Lean_On]

One of my interests lately has been dance.  I recently joined the YMCA and have really enjoyed the Zumba and BodyJam classes.  Simultaneously, I came across a Danish singer by the name of MØ and her song “Lean On”.  In checking out the song I ran across the music video, which was filmed in India.  Needless to say, with my site ISpeakHindi.com I found that to be interesting.

The choreographed by Paresh Shirodkar.  (Facebook)

Here is another instructional video that walks through the dance in a lot more steps and more complete.

 

Here the perform the complete dance. (keep an eye out for the dog that wonders on set and magically disappears 🙂 )

A few more videos:

On the streets:

 

Here is one that shows a week to week improvement of a dance group:

Other singers: