Matt Davis built a very cool module for the Jupyter notebook called ipythonblocks that rendered small images using HTML and CSS - http://ipythonblocks.org/ seems to be down right now, but you can grab the plugin at https://github.com/jiffyclub/ipythonblocks. As Guzdial & Ericson showed, it's a great way to teach loops and conditionals, array indexing, and a bunch of other things. Mike Hansen built the "skimage.novice" module to provide similar functionality on top of SciPy's image manipulation as a bridge between the simple-but-slow and the real-but-harder-to-understand (http://scikit-image.org/docs/stable/api/skimage.novice.html).

G

On 2015-12-03 10:32 AM, Lukas Weber wrote:
Hi Karin,

I like the example about pixels in an image. For each pixel in an image (row by row), do something, for example convert color to grayscale. Most students have a good intuition about images, pixels, and other media examples.

I think this was from the "media computation" examples in Mark Guzdial's "Why Is It So Hard To Learn To Program" paper: http://files.software-carpentry.org/training-course/2012/08/guzdial.pdf

Lukas


On Thu, Dec 3, 2015 at 11:19 AM, Juan Nunez-Iglesias <[email protected] <mailto:[email protected]>> wrote:

    Ha! I like the egg metaphor + demo. One thing I would suggest is
    to change the variable from "egg" to "egg_in_hand". People in my
    workshop seemed to have the most trouble with the idea that each
    element was being assigned to the variable name in the for loop.
    With "egg_in_hand", you can demonstrate the assignment that's
    happening.

    Either way, I like all the different applications of your
    metaphor. You can teach programming *and* make a cake, all in one
    session!

    Juan.

    On Thu, Dec 3, 2015 at 9:01 PM, Ian Hawke <[email protected]
    <mailto:[email protected]>> wrote:

        One example that I've used in words, and want to try in reality:

        Take an eggbox with one row of eggs.

        for egg in eggbox:
            crack(egg)

        and then take them out one at a time and crack them (into a
        jug, I guess).

        Alternatively, number the eggs with a permanent marker from 0,
        and use this to display list access.

        Main reason for doing this with an eggbox is that it extends
        to two dimensions, so the metaphor can extends to numpy array
        examples with two indices, which always seems to cause more
        issues.

        Ian


        On 03/12/2015 09:24, Karin Lagesen wrote:

            The more I teach, the more I realize that I am not really
            able to convey what a for loop does to everybody. Do any
            of you have a metaphor or something that you use for
            teaching it? I explain about variables and collections,
            and the body of the loop, and I show examples, but I am
            still not able to get through all the time.

            Karin

            _______________________________________________
            Discuss mailing list
            [email protected]
            <mailto:[email protected]>
            
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org




        _______________________________________________
        Discuss mailing list
        [email protected]
        <mailto:[email protected]>
        
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org



    _______________________________________________
    Discuss mailing list
    [email protected]
    <mailto:[email protected]>
    
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org




_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org

--
Dr. Greg Wilson    | [email protected]
Software Carpentry | http://software-carpentry.org

_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org

Reply via email to