<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sugarlabs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tswast</id>
	<title>Sugar Labs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sugarlabs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tswast"/>
	<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/go/Special:Contributions/Tswast"/>
	<updated>2026-06-09T11:15:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50926</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50926"/>
		<updated>2010-04-07T04:53:55Z</updated>

		<summary type="html">&lt;p&gt;Tswast: /* Add node to appropriate category */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&lt;br /&gt;
[[Category:Activities|Plot]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
== Modifying Plot ==&lt;br /&gt;
For the ambitious, who don&#039;t mind programming:&lt;br /&gt;
&lt;br /&gt;
=== Adding a function ===&lt;br /&gt;
1. Add to plotter/parse.py&lt;br /&gt;
&lt;br /&gt;
==== Create an icon ====&lt;br /&gt;
[[Image:Plot-modify-createicon.png‎]]&lt;br /&gt;
&lt;br /&gt;
Create an icon for the new function. As a convention, its name should be the same as the function name in all lowercase letters. There should be two files: one for the working copy, and an exported &amp;quot;Plain SVG&amp;quot; copy. There names should be &amp;lt;functionname&amp;gt;.svg for the plain svg and &amp;lt;functionname&amp;gt;-inkscape.svg for the working copy.&lt;br /&gt;
&lt;br /&gt;
==== Create node class ====&lt;br /&gt;
Create a new file plotter/view/puzzletree/nodes/&amp;lt;functionname&amp;gt;.py.&lt;br /&gt;
&lt;br /&gt;
In it place:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from .simplenode import SimpleNode&lt;br /&gt;
from gettext import gettext as _&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class FunctionName(SimpleNode):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Node representing &amp;lt;some function&amp;gt;.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    CLASS = &amp;quot;functionname&amp;quot;&lt;br /&gt;
    background = SimpleNode.loadbackground(&amp;quot;functionname.svg&amp;quot;)&lt;br /&gt;
    title = _(&amp;quot;Function Name&amp;quot;)&lt;br /&gt;
    description = _(u&amp;quot;Enter a description of the function here.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    def __call__(self, x):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Calls the function... put a more descriptive comment here.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        return functionname(x)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    def get_equation_string(self, variable):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Returns a string to use this function in the Python parser.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        return &amp;quot;functionname(%s)&amp;quot; % variable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CLASS should be a unique identifier for the node class (the lowercase class name should work fine). This is used when saving to the journal to describe which nodes are used.&lt;br /&gt;
&lt;br /&gt;
background should be loaded from the plain *.svg file created as an icon. Just give it the filename (not the full path).&lt;br /&gt;
&lt;br /&gt;
title is shown above the description in the palette. It should reflect the common name for the function being added.&lt;br /&gt;
&lt;br /&gt;
description is a longer description that gives more information about the function. Ideally, it should be understandable by those without advanced knowledge of Mathematics.&lt;br /&gt;
&lt;br /&gt;
__call__ should return the value that the function would return for x. Additional modules may need to be imported in order to do this, depending on the function.&lt;br /&gt;
&lt;br /&gt;
get_equation_string should return the string needed to apply the same function in the Python parse equation input. (NOTE: this may mean you&#039;ll need to add the function to the list of those available to the plotter.parse module.)&lt;br /&gt;
&lt;br /&gt;
==== Add node appropriate category ====&lt;br /&gt;
&lt;br /&gt;
Edit the file: plotter/view/puzzletree/nodes/__init__.py.&lt;br /&gt;
&lt;br /&gt;
Add the node class you just created to the appropriate category (in this case: functions).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
# functions&lt;br /&gt;
from .constant import Constant&lt;br /&gt;
from .identity import Identity&lt;br /&gt;
from .functionname import FunctionName&lt;br /&gt;
&lt;br /&gt;
FUNCTIONS = [&lt;br /&gt;
    Constant,&lt;br /&gt;
    Identity,&lt;br /&gt;
    FunctionName&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it! Your new function should now show up in the palette when you edit equations in the Plot activity.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://bugs.launchpad.net/sugar-plotter-activity Bug Tracker]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50925</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50925"/>
		<updated>2010-04-07T04:43:39Z</updated>

		<summary type="html">&lt;p&gt;Tswast: /* Adding a function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&lt;br /&gt;
[[Category:Activities|Plot]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
== Modifying Plot ==&lt;br /&gt;
For the ambitious, who don&#039;t mind programming:&lt;br /&gt;
&lt;br /&gt;
=== Adding a function ===&lt;br /&gt;
1. Add to plotter/parse.py&lt;br /&gt;
&lt;br /&gt;
==== Create an icon ====&lt;br /&gt;
[[Image:Plot-modify-createicon.png‎]]&lt;br /&gt;
&lt;br /&gt;
Create an icon for the new function. As a convention, its name should be the same as the function name in all lowercase letters. There should be two files: one for the working copy, and an exported &amp;quot;Plain SVG&amp;quot; copy. There names should be &amp;lt;functionname&amp;gt;.svg for the plain svg and &amp;lt;functionname&amp;gt;-inkscape.svg for the working copy.&lt;br /&gt;
&lt;br /&gt;
==== Create node class ====&lt;br /&gt;
Create a new file plotter/view/puzzletree/nodes/&amp;lt;functionname&amp;gt;.py.&lt;br /&gt;
&lt;br /&gt;
In it place:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from .simplenode import SimpleNode&lt;br /&gt;
from gettext import gettext as _&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class FunctionName(SimpleNode):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Node representing &amp;lt;some function&amp;gt;.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    CLASS = &amp;quot;functionname&amp;quot;&lt;br /&gt;
    background = SimpleNode.loadbackground(&amp;quot;functionname.svg&amp;quot;)&lt;br /&gt;
    title = _(&amp;quot;Function Name&amp;quot;)&lt;br /&gt;
    description = _(u&amp;quot;Enter a description of the function here.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    def __call__(self, x):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Calls the function... put a more descriptive comment here.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        return functionname(x)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    def get_equation_string(self, variable):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Returns a string to use this function in the Python parser.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        return &amp;quot;functionname(%s)&amp;quot; % variable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CLASS should be a unique identifier for the node class (the lowercase class name should work fine). This is used when saving to the journal to describe which nodes are used.&lt;br /&gt;
&lt;br /&gt;
background should be loaded from the plain *.svg file created as an icon. Just give it the filename (not the full path).&lt;br /&gt;
&lt;br /&gt;
title is shown above the description in the palette. It should reflect the common name for the function being added.&lt;br /&gt;
&lt;br /&gt;
description is a longer description that gives more information about the function. Ideally, it should be understandable by those without advanced knowledge of Mathematics.&lt;br /&gt;
&lt;br /&gt;
__call__ should return the value that the function would return for x. Additional modules may need to be imported in order to do this, depending on the function.&lt;br /&gt;
&lt;br /&gt;
get_equation_string should return the string needed to apply the same function in the Python parse equation input. (NOTE: this may mean you&#039;ll need to add the function to the list of those available to the plotter.parse module.)&lt;br /&gt;
&lt;br /&gt;
4. Add to node list.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://bugs.launchpad.net/sugar-plotter-activity Bug Tracker]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50924</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50924"/>
		<updated>2010-04-07T04:09:29Z</updated>

		<summary type="html">&lt;p&gt;Tswast: Added more info for adding functions to plot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&lt;br /&gt;
[[Category:Activities|Plot]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
== Modifying Plot ==&lt;br /&gt;
For the ambitious, who don&#039;t mind programming:&lt;br /&gt;
&lt;br /&gt;
=== Adding a function ===&lt;br /&gt;
1. Add to plotter/parse.py&lt;br /&gt;
&lt;br /&gt;
==== Create an icon ====&lt;br /&gt;
[[Image:Plot-modify-createicon.png‎]]&lt;br /&gt;
&lt;br /&gt;
Create an icon for the new function. As a convention, its name should be the same as the function name in all lowercase letters. There should be two files: one for the working copy, and an exported &amp;quot;Plain SVG&amp;quot; copy. There names should be &amp;lt;functionname&amp;gt;.svg for the plain svg and &amp;lt;functionname&amp;gt;-inkscape.svg for the working copy.&lt;br /&gt;
&lt;br /&gt;
3. Create node class.&lt;br /&gt;
4. Add to node list.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://bugs.launchpad.net/sugar-plotter-activity Bug Tracker]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Plot-modify-createicon.png&amp;diff=50919</id>
		<title>File:Plot-modify-createicon.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Plot-modify-createicon.png&amp;diff=50919"/>
		<updated>2010-04-06T20:13:20Z</updated>

		<summary type="html">&lt;p&gt;Tswast: Image showing the creation of two *.svg files for adding a function to the Plot activity palette.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Image showing the creation of two *.svg files for adding a function to the Plot activity palette.&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50874</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50874"/>
		<updated>2010-04-05T19:19:41Z</updated>

		<summary type="html">&lt;p&gt;Tswast: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&lt;br /&gt;
[[Category:Activities|Turtle Art]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
== Modifying Plot ==&lt;br /&gt;
=== Adding a function ===&lt;br /&gt;
1. Add to plotter/parse.py&lt;br /&gt;
2. Create icon.&lt;br /&gt;
3. Create node class.&lt;br /&gt;
4. Add to node list.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://bugs.launchpad.net/sugar-plotter-activity Bug Tracker]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50873</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50873"/>
		<updated>2010-04-05T19:18:10Z</updated>

		<summary type="html">&lt;p&gt;Tswast: Added link to bug tracker.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&lt;br /&gt;
[[Category:Activities|Turtle Art]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://bugs.launchpad.net/sugar-plotter-activity Bug Tracker]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activity_Team/Modifing_an_Activity&amp;diff=50478</id>
		<title>Activity Team/Modifing an Activity</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activity_Team/Modifing_an_Activity&amp;diff=50478"/>
		<updated>2010-03-31T22:14:43Z</updated>

		<summary type="html">&lt;p&gt;Tswast: Fixed links.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{GoogleTrans-en}}{{TOCright}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Editing==&lt;br /&gt;
This describes how to reprogram activities using Sugar and the activities Browse, Pippy &amp;amp; Terminal. It does not require any extra development tools. Development is done directly on the OLPC XO, alternatively it can be done using the [[Live CD]], [[Sugar on a Stick]] or other implementations of Sugar. &lt;br /&gt;
&lt;br /&gt;
This page is targeted at beginners, more experienced users may find reading [[Activities/Turtle Art/Patching]] , [[Activity_Team/Resources]] and [[Activity_Team/Creating_a_New_Activity]] useful.&lt;br /&gt;
&lt;br /&gt;
The activities are  stored  at &#039;&#039;/home/olpc/Activities&#039;&#039; and you can use the browser as a &amp;quot;file manager&amp;quot; to browse the file system using the URL prefix &#039;&#039;file://&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, type &#039;&#039;file:///home/olpc/Activities/TurtleArt.activity&#039;&#039; into the browser address bar to see the Python files that make up the TurtleArt activity. Click on one of the *.py files to inspect the code.&lt;br /&gt;
&lt;br /&gt;
You can view the code but not edit it in the browser. To edit, select the code and copy to the clipboard (ctrl c) and open Pippy (the Python editor) and paste it to the code window (ctrl v). You can then edit the code and save it to the Journal, &#039;&#039;keep as Pippy document&#039;&#039; and using a suitable filename (eg &#039;&#039;filename.py&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
To run the modified code, you need to copy it from the journal back to the directory that the activity resides in, in this case  &#039;&#039;/home/olpc/Activities/TurtleArt.activity&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Start the terminal activity and navigate to the activity&#039;s directory. It is a good idea to use mv (move) to backup the original file to &#039;&#039;filename.bak&#039;&#039; before it gets overwritten. Then copy the edited file from the journal. &lt;br /&gt;
&lt;br /&gt;
     cd /home/olpc/Activities/TurtleArt.activity&amp;lt;br&amp;gt;&lt;br /&gt;
     mv filename.py filename.bak&amp;lt;br&amp;gt;&lt;br /&gt;
     copy-from-journal filename.py&lt;br /&gt;
&lt;br /&gt;
(Though there may be a message that it is copying the latest of a large number of  objects of that name, mostly that&#039;s OK, but occasionally I find that I have saved an empty file. I think [http://dev.laptop.org/git?p=users/phil/support-scripts;a=blob_plain;f=copy-from-journal copy-from-journal] copies the most recent item in the journal, so access these items immediately before you copy them) &amp;lt;br&amp;gt;&lt;br /&gt;
Due to a bug(?), it may save as &#039;&#039;filename..py&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
If you need to rename the file use the move command&lt;br /&gt;
&lt;br /&gt;
     mv filename..py filename.py&lt;br /&gt;
&lt;br /&gt;
There is an activity [http://wiki.laptop.org/go/Develop Develop] which has a file manager and an editor, currently (at writing this) version 35 seems to be buggy. It shares the limitation with the above method that it saves to the journal, not the activity&#039;s directory. If working OK, its only benefit may be avoiding the step of copying from Browse to Pippy&lt;br /&gt;
&lt;br /&gt;
==Modifying TurtleArt Files==&lt;br /&gt;
(see also [[Activities/TurtleArt-0.88#Programmable_Brick]])&lt;br /&gt;
&lt;br /&gt;
Turtle Art has a special block that is programmable in Pippy. Look for the tamyblock.py entry in your Journal. Try uncommenting one of the examples.&lt;br /&gt;
&lt;br /&gt;
Use the Pippy import button to import your code into Turtle Art.&lt;br /&gt;
&lt;br /&gt;
[[Image:TAPippyButton.svg]]&lt;br /&gt;
&lt;br /&gt;
Your code is associated with the myblock.svg block found on the Sensors palette.&lt;br /&gt;
&lt;br /&gt;
[[Image:TAMyblock.svg]]&lt;br /&gt;
&lt;br /&gt;
Examples: [http://tonyforster.blogspot.com/2009/03/turtle-fileview.html File Viewer] [http://tonyforster.blogspot.com/2009/03/orbital-motion-in-python-and-turtleart.html Orbital Motion] [http://tonyforster.blogspot.com/2009/03/turtle-oscilloscope.html Oscilloscope]&lt;br /&gt;
&lt;br /&gt;
===talogo.py===&lt;br /&gt;
The file &#039;&#039;talogo.py&#039;&#039; does a lot of the calculating. For example, careful divide avoids overflow errors by returning 0 for division by zero. &lt;br /&gt;
&lt;br /&gt;
 def careful_divide(x,y):&amp;lt;br&amp;gt;&lt;br /&gt;
    if y==0: return 0&amp;lt;br&amp;gt;&lt;br /&gt;
    return x/y&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify it to return 42 for division by zero&lt;br /&gt;
&lt;br /&gt;
 def careful_divide(x,y):&amp;lt;br&amp;gt;&lt;br /&gt;
    if y==0: return 42&amp;lt;br&amp;gt;&lt;br /&gt;
    return x/y&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Bad_divide.jpg]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Swap the functions of pen up and pen down by substituting &#039;&#039;True&#039;&#039; and &#039;&#039;False&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
was:&lt;br /&gt;
 defprim(lc,&#039;pendown&#039;, 0, lambda lc: setpen(lc.tw.turtle, True))&amp;lt;br&amp;gt;&lt;br /&gt;
 defprim(lc,&#039;penup&#039;, 0, lambda lc: setpen(lc.tw.turtle, False))&lt;br /&gt;
becomes:&lt;br /&gt;
 defprim(lc,&#039;pendown&#039;, 0, lambda lc: setpen(lc.tw.turtle, False))&amp;lt;br&amp;gt;&lt;br /&gt;
 defprim(lc,&#039;penup&#039;, 0, lambda lc: setpen(lc.tw.turtle, True))&lt;br /&gt;
&lt;br /&gt;
[[Image:Bad_pen.jpg]]&lt;br /&gt;
&lt;br /&gt;
===turtleart.py===&lt;br /&gt;
This file is not used by Sugar to launch TurtleArt but you can use it to launch TurtleArt from the terminal, go to &#039;&#039;/home/olpc/Activities/TurtleArt.activity&#039;&#039; and type&lt;br /&gt;
&lt;br /&gt;
 python turtleart.py&lt;br /&gt;
&lt;br /&gt;
it will open without the menu bar, it is also in Spanish because it is hard coded.&lt;br /&gt;
&lt;br /&gt;
 twNew(win1, os.path.abspath(&#039;.&#039;),&#039;es&#039;)&lt;br /&gt;
&lt;br /&gt;
change &#039;&#039;es&#039;&#039; to &#039;&#039;en&#039;&#039; in the file &#039;&#039;turtleart.py&#039;&#039; and it will launch in English&lt;br /&gt;
&lt;br /&gt;
 twNew(win1, os.path.abspath(&#039;.&#039;),&#039;en&#039;)&lt;br /&gt;
&lt;br /&gt;
===taturtle.py===&lt;br /&gt;
This file handles the turtle drawing functions, for example the following code calculates which of the 36 turtle sprites, each rotated by 10 degrees to draw, depending on the heading.&lt;br /&gt;
&lt;br /&gt;
 def turn_turtle(t):&lt;br /&gt;
    setshape(t.spr, t.shapelist[(int(t.heading+5)%360)/10])&lt;br /&gt;
&lt;br /&gt;
A correction of 5 degrees is added so that the turtle is facing straight up for headings -4.999 to +4.999 degrees.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Good_heading.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Change +5 to +0 and the turtle is rotated left for any heading&amp;lt;0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 def turn_turtle(t):&lt;br /&gt;
    setshape(t.spr, t.shapelist[(int(t.heading+0)%360)/10])&lt;br /&gt;
 &lt;br /&gt;
[[Image:Bad_heading.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===tasetup.py===&lt;br /&gt;
This file controls, amongst other things the docking behaviour of the blocks. The arithmetic operators +-*/ have equal block dimensions and dock both sides with number blocks. They are defined as having an &#039;&#039;ari&#039;&#039; docking style.&lt;br /&gt;
&lt;br /&gt;
     (&#039;plus&#039;,&#039;+&#039;,&#039;ari&#039;),&lt;br /&gt;
     (&#039;minus&#039;,&#039;-&#039;,&#039;ari&#039;),&lt;br /&gt;
     (&#039;product&#039;,&#039;*&#039;,&#039;ari&#039;),&lt;br /&gt;
     (&#039;division&#039;,&#039;/&#039;,&#039;ari&#039;),&lt;br /&gt;
&lt;br /&gt;
And the docking points, left and right, are given coordinates in the following code&lt;br /&gt;
&lt;br /&gt;
  &#039;ari&#039;:     ((&#039;numend&#039;,True,12,20),(&#039;num&#039;,False,39,20)),&lt;br /&gt;
&lt;br /&gt;
The effect of changing the y coordinates of the left and right docking points from 20 to 10 and 30 are shown below.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &#039;ari&#039;:     ((&#039;numend&#039;,True,12,10),(&#039;num&#039;,False,39,30)),&lt;br /&gt;
&lt;br /&gt;
[[Image:Bad_ari_dock.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Modifying Speak==&lt;br /&gt;
===Editing a language dictionary===&lt;br /&gt;
This is based on information at [http://wiki.laptop.org/go/Instructions_for_implementing_a_new_language_%22voice%22_for_Speak_on_the_XO laptop.org] &amp;lt;i&amp;gt;Instructions for implementing a new language &amp;quot;voice&amp;quot; for Speak on the XO.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the following, Speak is modified so that it spells out the letters in &#039;OLPC&#039; rather than trying to pronounce it as a word, only the English pronunciation dictionary is modified.&lt;br /&gt;
&lt;br /&gt;
There is a dictionary for each language (eg. en_dict for English) which is compiled from a rules file and a list file, you can find a description of the syntax for these files in the [http://espeak.sourceforge.net/dictionary.html dictionary documentation]. In this example, the rules and list files are downloaded as a zip (compressed) file, the en_list file is edited and a new dictionary en_dict is created from the files en_rules and en_list&lt;br /&gt;
&lt;br /&gt;
Download the source files for espeak from http://kent.dl.sourceforge.net/sourceforge/espeak/espeak-1.40.02-source.zip &lt;br /&gt;
&lt;br /&gt;
Go to the Journal where you will find File espeak-1.40.02-source.zip &lt;br /&gt;
&lt;br /&gt;
Open this with Etoys, extract all to the suggested directory /home/olpc/isolation/1/uid_to_home_dir/1004/data/MyEtoys&lt;br /&gt;
1004 (or similar) seems to be a temporary directory and may be different in your case, keep Etoys open till you have copied the required files&lt;br /&gt;
&lt;br /&gt;
In [http://wiki.laptop.org/go/Instructions_for_implementing_a_new_language_%22voice%22_for_Speak_on_the_XO laptop.org] the suggestion is to use the Linux vi text editor, here Write is used as the text editor.&lt;br /&gt;
&lt;br /&gt;
Open Terminal and go to directory /home/olpc/isolation/1/uid_to_home_dir/1004/data/MyEtoys/espeak-1.40.02-source/dictsource   (or similar)&lt;br /&gt;
&lt;br /&gt;
     cd /home/olpc/isolation/1/uid_to_home_dir/1004/data/MyEtoys/espeak-1.40.02-source/dictsource&lt;br /&gt;
&lt;br /&gt;
[http://dev.laptop.org/git?p=users/phil/support-scripts;a=blob_plain;f=copy-to-journal copy-to-journal] the list and rules files for the English dictionary, the Mime [http://wiki.laptop.org/go/Sugar.mime#Who_decides_the_default_activity_for_opening_files_of_different_mime_types.3F 1] [http://en.wikipedia.org/wiki/MIME 2] [http://wiki.laptop.org/go/Journal_entry_bundles 3] type is text/plain&lt;br /&gt;
&lt;br /&gt;
     copy-to-journal en_list -m text/plain&lt;br /&gt;
     copy-to-journal en_rules -m text/plain&lt;br /&gt;
&lt;br /&gt;
Go to the Journal and open the en_list file with Write and edit to indicate that the string &#039;OLPC&#039; is to be spoken as an abbreviation:&lt;br /&gt;
&lt;br /&gt;
     ok	        $abbrev&lt;br /&gt;
     olpc	$abbrev&lt;br /&gt;
     omg	$abbrev&lt;br /&gt;
&lt;br /&gt;
keep as text&lt;br /&gt;
&lt;br /&gt;
Go to Terminal and copy both files from the Journal &lt;br /&gt;
&lt;br /&gt;
(these files are copied to a temporary directory /home/olpc rather than the final destination /usr/share/espeak-data because either [http://dev.laptop.org/git?p=users/phil/support-scripts;a=blob_plain;f=copy-from-journal copy-from-journal] does not have the required permission or I do not know the syntax for user root)&lt;br /&gt;
&lt;br /&gt;
     cd /home/olpc&lt;br /&gt;
     copy-from-journal en_list&lt;br /&gt;
     copy-from-journal en_rules&lt;br /&gt;
&lt;br /&gt;
I think [http://dev.laptop.org/git?p=users/phil/support-scripts;a=blob_plain;f=copy-from-journal copy-from-journal] copies the most recent item in the journal, so access both these items immediately before you copy them, keep them as text.&lt;br /&gt;
The files are copied across as en_rules.txt and en_list.txt to directory cd /home/olpc&lt;br /&gt;
You can use Browse to check the contents of both files, just put /home/olpc in the address bar&lt;br /&gt;
&lt;br /&gt;
Finally, go to the destination directory, /usr/share/espeak-data , change the user to root, back up the old dictionary, copy the list and rules files from /home/olpc while removing the txt extension, compile them to create a new en_dict and exit root user shell&lt;br /&gt;
&lt;br /&gt;
     cd /usr/share/espeak-data&lt;br /&gt;
     su&lt;br /&gt;
     mv en_dict en_dict.bak&lt;br /&gt;
     mv /home/olpc/en_rules.txt en_rules&lt;br /&gt;
     mv /home/olpc/en_list.txt en_list&lt;br /&gt;
     espeak --compile=en&lt;br /&gt;
     exit&lt;br /&gt;
&lt;br /&gt;
Start Speak and type OLPC&lt;br /&gt;
&lt;br /&gt;
=== activity.py===&lt;br /&gt;
Files are at &#039;&#039;/home/olpc/Activities/Speak.activity&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
Modify the initial greeting on startup by editing &#039;&#039;Hello %s.  Type something&#039;&#039;&amp;lt;br&amp;gt; &lt;br /&gt;
&#039;&#039;%s&#039;&#039; is a placeholder for your name&lt;br /&gt;
&lt;br /&gt;
 self.say(_(&amp;quot;Hello %s.  Type something.&amp;quot;) % xoOwner.props.nick)&lt;br /&gt;
&lt;br /&gt;
==Modifying Ruler==&lt;br /&gt;
&#039;&#039;subactivity.py&#039;&#039;  the menu system&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;show_rulers.py&#039;&#039;  the initial screen of 3 rulers&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;show_grids.py&#039;&#039;   the cm and mm grids&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;checkers.py&#039;&#039;     the checker board&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;show_angles.py&#039;&#039;  the 90deg and 360 deg protractors&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;util.py&#039;&#039;         4 utility functions including pixel (dots per inch) to mm conversion&amp;lt;br&amp;gt;&lt;br /&gt;
===util.py===&lt;br /&gt;
The conversion to mm is by&lt;br /&gt;
 def mm(n):&lt;br /&gt;
    return n / 25.40 * 200&lt;br /&gt;
&lt;br /&gt;
change to inches and tenths with&lt;br /&gt;
 def mm(n):&lt;br /&gt;
    return n / 10.00 * 200&lt;br /&gt;
&lt;br /&gt;
challenges:&amp;lt;br&amp;gt;&lt;br /&gt;
change labels from cm &amp;amp; mm to inches and tenths&amp;lt;br&amp;gt;&lt;br /&gt;
get the protractors correctly centred on the screen&amp;lt;br&amp;gt;&lt;br /&gt;
===show_angles.py===&lt;br /&gt;
Shown below is the code relating to drawing the quadrant protractor, comments are added. &amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Show_angle.jpg]]&lt;br /&gt;
&lt;br /&gt;
 class Angles90(paper.Drawing):&lt;br /&gt;
    def draw(self,c):&lt;br /&gt;
        self.set_background_color(&#039;white&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
        c.set_antialias(True)&amp;lt;br&amp;gt;&lt;br /&gt;
        ox = mm(0)                     #x origin at LHS&lt;br /&gt;
        oy = mm(99)                    #y origin at bottom&lt;br /&gt;
        d = mm(90)                     #default line length 90mm&lt;br /&gt;
        def xy(angle,m=d):             #calculate line x,y from angle&lt;br /&gt;
            return cos(-angle)*m+ox,sin(-angle)*m+oy&lt;br /&gt;
        def ray(angle,r0=0,r1=d):      #default lines from origin&lt;br /&gt;
            c.move_to(*xy(angle,r0))   #start point&lt;br /&gt;
            c.line_to(*xy(angle,r1))   #end point &amp;lt;br&amp;gt;&lt;br /&gt;
        lw = 6                         #line width 6 pixels&lt;br /&gt;
        c.set_line_width(lw)&lt;br /&gt;
        c.move_to(ox,oy+lw/2)&lt;br /&gt;
        c.line_to(*xy(pi/2))           #vertical line&lt;br /&gt;
        ray(0)                         #horizontal line&lt;br /&gt;
        c.stroke()    &amp;lt;br&amp;gt;&lt;br /&gt;
        c.save()&lt;br /&gt;
        c.set_line_width(3)&lt;br /&gt;
        c.set_dash([mm(5)])&lt;br /&gt;
        ray(pi/4)                      #dashed line 45 degrees&lt;br /&gt;
        c.stroke()           &lt;br /&gt;
        c.restore()&amp;lt;br&amp;gt;&lt;br /&gt;
        c.set_line_width(4)            #line width 4 pixels&lt;br /&gt;
        for a in range(10,81,10):      #every 10 deg from 10 to 81&lt;br /&gt;
            ray(d2r(a),mm(10),mm(85))  #radius 10 to 85mm&lt;br /&gt;
        c.stroke()                     #10 degree lines, thick outer section&lt;br /&gt;
        c.set_line_width(2)            #width 2 pixels&lt;br /&gt;
        for a in range(10,81,10):      #every 10 deg from 10 to 81&lt;br /&gt;
            ray(d2r(a),mm(3),mm(20))&lt;br /&gt;
        c.stroke()         #10 degree lines, thin inner section (overwritten by 5 deg lines)&amp;lt;br&amp;gt;&lt;br /&gt;
        c.set_line_width(2)            #width 2 pixels&lt;br /&gt;
        for a in range(1,90,1):        #every 1 deg from 1 to 90&lt;br /&gt;
            ray(d2r(a),mm(70),mm(80))  #1 deg lines from 70 to 80 radius&lt;br /&gt;
        c.stroke()                     #1 degree lines&lt;br /&gt;
        c.set_line_width(2)            #width 2 pixels&lt;br /&gt;
        for a in range(0,90,5):        #every 5 deg from 0 to 90&lt;br /&gt;
            ray(d2r(a),mm(20),mm(81))  #radius 20 to 81mm&lt;br /&gt;
        c.stroke()                     #5 degree lines&lt;br /&gt;
&lt;br /&gt;
The purpose of the numeric coefficients should be apparent. Try altering them and predicting the result.&amp;lt;br&amp;gt;&lt;br /&gt;
Challenges:&amp;lt;br&amp;gt;&lt;br /&gt;
Try adding numbers to the 10 degree lines.&amp;lt;br&amp;gt;&lt;br /&gt;
Display the mouse coordinates in mm.&lt;br /&gt;
&lt;br /&gt;
==Modifying Calculate==&lt;br /&gt;
===layout.py===&lt;br /&gt;
Two mods to increase the discoverability of the help and plot functions. Two new buttons are added. A help (?) button puts the string &#039;help&#039; into the display, pressing enter then displays help. A plot (plt) button puts the plot template in the display. Enter values and press enter.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Modified_keypad.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Reduce the width of the clear button&amp;lt;br&amp;gt;&lt;br /&gt;
was:&lt;br /&gt;
  [3, 0, 3, _(&#039;Clear&#039;), self.col_gray1, lambda w: self._parent.clear()],&lt;br /&gt;
becomes:&lt;br /&gt;
  [4, 0, 2, _(&#039;Clear&#039;), self.col_gray1, lambda w: self._parent.clear()],&lt;br /&gt;
and add two buttons, one for help and the other for plot&amp;lt;br&amp;gt;&lt;br /&gt;
add:&lt;br /&gt;
  [2, 3, 1, &#039;?&#039;, self.col_gray2, lambda w: self._parent.add_text(&#039;help&#039;)],&amp;lt;br&amp;gt;&lt;br /&gt;
  [3, 0, 1, &#039;plt&#039;, self.col_gray3, lambda w: self._parent.add_text(&#039;plot(eqn,var=-a..b)&#039;)],&lt;br /&gt;
&lt;br /&gt;
==Modifying TamTam==&lt;br /&gt;
===Add new instrument===&lt;br /&gt;
&lt;br /&gt;
Obtain two images for new instrument (see [http://dev.laptop.org/browser?p=projects/tamtam;a=tree;f=common/Resources/Images;h=2c5083b16d215ec34b4292d5865cd685d9da6386;hb=HEAD examples])&lt;br /&gt;
* dimensions 112x112&lt;br /&gt;
* alpha channel should present&lt;br /&gt;
* one copy for normal-state&lt;br /&gt;
** name is &amp;quot;&amp;lt;name_of_instrument&amp;gt;.png&amp;quot;&lt;br /&gt;
** image of instrument is &amp;quot;shadowed&amp;quot;&lt;br /&gt;
* one copy for selected-state&lt;br /&gt;
** name is &amp;quot;&amp;lt;name_of_instrument&amp;gt;sel.png&amp;quot;&lt;br /&gt;
** image of instrument is not &amp;quot;shadowed&amp;quot;&lt;br /&gt;
** image is framed&lt;br /&gt;
Place all files to common/Resources/Images directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain sound file for new instrument with follow preferable characteristics&lt;br /&gt;
* filename is &amp;quot;&amp;lt;name_of_instrument&amp;gt;&amp;quot; (w/o suffix)&lt;br /&gt;
* Uncompressed PCM, 16KHz&lt;br /&gt;
* ...&lt;br /&gt;
Place file to common/Resources/Sounds directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change common/Util/Instruments.py file by adding new line&lt;br /&gt;
&lt;br /&gt;
 _addInstrument(&amp;quot;&amp;lt;name_of_instrument&amp;gt;&amp;quot;, &amp;lt;type&amp;gt;, &amp;lt;register&amp;gt;, &#039;&amp;lt;category&amp;gt;&#039;, &amp;lt;start&amp;gt;, &amp;lt;end&amp;gt;, &amp;lt;duration&amp;gt;, &amp;lt;scale&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;type&#039;&#039; type of sound processing&lt;br /&gt;
** &#039;&#039;INST_SIMP&#039;&#039; &amp;quot;simple&amp;quot; playing (try it first)&lt;br /&gt;
** &#039;&#039;INST_TIED&#039;&#039; some kind of processing filters&lt;br /&gt;
* &#039;&#039;register&#039;&#039; ...&lt;br /&gt;
** &#039;&#039;LOW&#039;&#039; ...&lt;br /&gt;
** &#039;&#039;MID&#039;&#039; ...&lt;br /&gt;
** &#039;&#039;HIGH&#039;&#039; ...&lt;br /&gt;
** &#039;&#039;PUNCH&#039;&#039; ...&lt;br /&gt;
* &#039;&#039;category&#039;&#039; group of instruments&lt;br /&gt;
** &#039;&#039;animals&#039;&#039;&lt;br /&gt;
** &#039;&#039;percussions&#039;&#039;&lt;br /&gt;
** &#039;&#039;strings&#039;&#039;&lt;br /&gt;
** &#039;&#039;winds&#039;&#039;&lt;br /&gt;
** &#039;&#039;percussions&#039;&#039;&lt;br /&gt;
** &#039;&#039;keyboard&#039;&#039;&lt;br /&gt;
** &#039;&#039;concret&#039;&#039;&lt;br /&gt;
** &#039;&#039;people&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Add new drum kit===&lt;br /&gt;
&lt;br /&gt;
Prepare three images, two like for [[#Add new instrument|regular instrument]] and follows one&lt;br /&gt;
* name is &amp;quot;&amp;lt;name_of_instrument&amp;gt;selgen.png&amp;quot;&lt;br /&gt;
* image is (another) framed [http://dev.laptop.org/browser?p=projects/tamtam;a=blob;f=common/Resources/Images/drum5kitselgen.png;h=2208d557f3cf065770b7fda3f9ab072adbad6e34;hb=HEAD see]&lt;br /&gt;
Place all files to common/Resources/Images directory&lt;br /&gt;
&lt;br /&gt;
Create sound files&lt;br /&gt;
* 13(do not sure about hardcoded nature of this number) [[#Add new instrument|sound files(use unique name for each stage instead of &amp;lt;name_of_instrument&amp;gt;)]] for different stages of drum playing&lt;br /&gt;
* one [[#Add new instrument|sound file]] for drum itself&lt;br /&gt;
and place them all to common/Resources/Sounds directory&lt;br /&gt;
&lt;br /&gt;
Add follows line to common/Util/Instruments.py for every of 13 stages&lt;br /&gt;
 _addInstrument(&amp;quot;&amp;lt;unique_name_of_drum_stage&amp;gt;&amp;quot;, &amp;lt;type&amp;gt;, &amp;lt;register&amp;gt;, &#039;&amp;lt;category&amp;gt;&#039;, &amp;lt;start&amp;gt;, &amp;lt;end&amp;gt;, &amp;lt;duration&amp;gt;, &amp;lt;scale&amp;gt;, kitStage=True)&lt;br /&gt;
and lines for drum itself&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;any_unique_varname&amp;gt; = { 24 : &amp;quot;&amp;lt;name_of_drum_stage_1&amp;gt;&amp;quot;,&lt;br /&gt;
                          26 : ...,&lt;br /&gt;
                          28 : ...,&lt;br /&gt;
                          30 : ...,&lt;br /&gt;
                          32 : ...,&lt;br /&gt;
                          34 : ...,&lt;br /&gt;
                          36 : ...,&lt;br /&gt;
                          38 : ...,&lt;br /&gt;
                          40 : ...,&lt;br /&gt;
                          42 : ...,&lt;br /&gt;
                          44 : ...,&lt;br /&gt;
                          46 : ...,&lt;br /&gt;
                          48 : &amp;quot;&amp;lt;name_of_drum_stage_13&amp;gt;&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
 _addInstrument(&amp;quot;&amp;lt;name_of_drum&amp;gt;&amp;quot;, 0, 0, &amp;quot;percussions&amp;quot;, 0, 0, 0, 1, &amp;lt;any_unique_varname&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
To use new drum kits in TamTamMini [http://dev.sugarlabs.org/ticket/285 #285] bug should be fixed.&lt;br /&gt;
&lt;br /&gt;
==Modifying Chat==&lt;br /&gt;
===Using Pippy===&lt;br /&gt;
Modifying the Chat activity can be done with Pippy! (since [https://dev.laptop.org/ticket/5542 #5542])&lt;br /&gt;
&lt;br /&gt;
Open up the Chat activity and hit fn + spacebar (view source key). The source for the Chat activity will be shown in the Journal. Click Start to open the source with Pippy.&lt;br /&gt;
&lt;br /&gt;
Make your modifications to Chat and &#039;&#039;&#039;Keep&#039;&#039;&#039; --&amp;gt; &#039;&#039;&#039;As Activity Bundle&#039;&#039;&#039;. Your new activity will pop up as &amp;quot;Chat Source Bundle&amp;quot; in the Journal. Click start to try out your modifications.&lt;br /&gt;
&lt;br /&gt;
===Text Display===&lt;br /&gt;
Changing how text is displayed in text is done in the function:&lt;br /&gt;
&lt;br /&gt;
 def add_text(self, buddy, text, status_message=False):&lt;br /&gt;
&lt;br /&gt;
The source contains a description and diagram of how to modify how text is displayed on the screen. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        Display text on screen, with name and colors.&lt;br /&gt;
&lt;br /&gt;
        buddy -- buddy object or dict {nick: string, color: string}&lt;br /&gt;
                 (The dict is for loading the chat log from the journal,&lt;br /&gt;
                 when we don&#039;t have the buddy object any more.)&lt;br /&gt;
        text -- string, what the buddy said&lt;br /&gt;
        status_message -- boolean&lt;br /&gt;
            False: show what buddy said&lt;br /&gt;
            True: show what buddy did&lt;br /&gt;
&lt;br /&gt;
        hippo layout:&lt;br /&gt;
        .------------- rb ---------------.&lt;br /&gt;
        | +name_vbox+ +----msg_vbox----+ |&lt;br /&gt;
        | |         | |                | |&lt;br /&gt;
        | | nick:   | | +--msg_hbox--+ | |&lt;br /&gt;
        | |         | | | text       | | |&lt;br /&gt;
        | +---------+ | +------------+ | |&lt;br /&gt;
        |             |                | |&lt;br /&gt;
        |             | +--msg_hbox--+ | |&lt;br /&gt;
        |             | | text | url | | |&lt;br /&gt;
        |             | +------------+ | |&lt;br /&gt;
        |             +----------------+ |&lt;br /&gt;
        `--------------------------------&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Modifying SocialCalc==&lt;br /&gt;
[http://seeta.in/wiki/index.php?title=SocialCalc_on_Sugar SocialCalc] is a spreadsheet activity. You can find information on how it is programmed at [http://seeta.in/wiki/index.php?title=Guide PROGRAMMING OF SOCIALCALC.]&lt;br /&gt;
&lt;br /&gt;
It is primarily written in Java with some Python code to &amp;quot;Sugarise&amp;quot; it. You will find the Python code at //home/olpc/Activities/SocialCalcActivity and the Java code in the web subdirectory. &lt;br /&gt;
&lt;br /&gt;
===socialcalcconstants.js===&lt;br /&gt;
In the web subdirectory the file &amp;lt;i&amp;gt;socialcalcconstants.js&amp;lt;/i&amp;gt; contains a number of constants including the error message strings and date format.&lt;br /&gt;
&lt;br /&gt;
For example at line 341, the string &amp;lt;i&amp;gt;s_calcerrunknownname: &amp;quot;Unknown name&amp;quot;&amp;lt;/i&amp;gt; is the error message for when you type an unrecognised string into a cell. Try typing &amp;lt;i&amp;gt;=abc&amp;lt;/i&amp;gt; into a spreadsheet cell and it displays as &amp;lt;i&amp;gt;Unknown name &amp;quot;ABC&amp;quot;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use Pippy as your editor, even though the file being edited is Java script. Just follow the instructions at the beginning of this article but substitute .js for .py&lt;br /&gt;
&lt;br /&gt;
Editing line 341 to read &amp;lt;i&amp;gt;s_calcerrunknownname: &amp;quot;Unknown namey thing&amp;quot;&amp;lt;/i&amp;gt; results in an error message for &amp;lt;i&amp;gt;=abc&amp;lt;/i&amp;gt; of &amp;lt;i&amp;gt;Unknown namey thing &amp;quot;ABC&amp;quot;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The month names for date formatting cells are at line 310 &lt;br /&gt;
&amp;lt;i&amp;gt;s_FormatNumber_monthnames: [&amp;quot;January&amp;quot;, &amp;quot;February&amp;quot;, &amp;quot;March&amp;quot;, &amp;quot;April&amp;quot;, &amp;quot;May&amp;quot;, &amp;quot;June&amp;quot;, &amp;quot;July&amp;quot;, &amp;quot;August&amp;quot;, &amp;quot;September&amp;quot;,             &amp;quot;October&amp;quot;, &amp;quot;November&amp;quot;, &amp;quot;December&amp;quot;],&amp;lt;/i&amp;gt;&lt;br /&gt;
Edit this to change month names in cells which are date formatted.&lt;br /&gt;
&lt;br /&gt;
The help for the functions are at lines 352-462. For example, edit the string&lt;br /&gt;
&amp;lt;i&amp;gt;s_fdef_ACOS: &#039;Trigonometric arccosine function. &#039;,&amp;lt;/i&amp;gt; to change the text shown in this image.&lt;br /&gt;
[[Image:Calcfunc.jpg]]&lt;br /&gt;
&lt;br /&gt;
Help for the arguments that the functions require are at lines 464-499. For example, the string&lt;br /&gt;
&amp;lt;i&amp;gt;s_farg_v: &amp;quot;value&amp;quot;,&amp;lt;/i&amp;gt; results in the image below.&lt;br /&gt;
&lt;br /&gt;
[[image:Funcargs.jpg]]&lt;br /&gt;
&lt;br /&gt;
The text for the function categories is at lines 503-512&lt;br /&gt;
   s_fclass_all: &amp;quot;All&amp;quot;,&lt;br /&gt;
   s_fclass_stat: &amp;quot;Statistics&amp;quot;,&lt;br /&gt;
   s_fclass_lookup: &amp;quot;Lookup&amp;quot;,&lt;br /&gt;
   s_fclass_datetime: &amp;quot;Date &amp;amp; Time&amp;quot;,&lt;br /&gt;
   s_fclass_financial: &amp;quot;Financial&amp;quot;,&lt;br /&gt;
   s_fclass_test: &amp;quot;Test&amp;quot;,&lt;br /&gt;
   s_fclass_math: &amp;quot;Math&amp;quot;,&lt;br /&gt;
   s_fclass_text: &amp;quot;Text&amp;quot;,&lt;br /&gt;
[[image:Funccat.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are lots more constants that you can experiment with.&lt;br /&gt;
&lt;br /&gt;
===formula1.js===&lt;br /&gt;
formula1.js parses formulae entered into cells. It also has the code for functions.&lt;br /&gt;
&lt;br /&gt;
==Modifying Physics==&lt;br /&gt;
===Changing block properties - density===&lt;br /&gt;
[[Activities/Physics|Physics]] is based on Box2D v2.0.2 , there is good [http://www.box2d.org/manual.html#d0e1468 documentation]. It is &#039;wrapped&#039; in a python wrapper called [http://elements.linuxuser.at/ elements] which is then &#039;Sugarised&#039; to make Physics. It was originally on the [http://wiki.laptop.org/go/Physics_(activity) OLPC wiki] but has now migrated to the [[Activities/Physics|Sugarlabs wiki]].&lt;br /&gt;
&lt;br /&gt;
You will find the &#039;Sugarising&#039; code at &amp;lt;i&amp;gt;/home/olpc/Activities/Physics.activity&amp;lt;/i&amp;gt; directory and the Elements code in the &amp;lt;i&amp;gt;elements&amp;lt;/i&amp;gt; subdirectory and the Box2D code in a further &amp;lt;i&amp;gt;box2d&amp;lt;/i&amp;gt; subdirectory.&lt;br /&gt;
&lt;br /&gt;
Here is an example, you can make rectangles have a lower density than other shapes. &lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;i&amp;gt;tools.py&amp;lt;/i&amp;gt; in the &amp;lt;i&amp;gt;/home/olpc/Activities/Physics.activity&amp;lt;/i&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
In the box creation tool&lt;br /&gt;
     # The box creation tool        &lt;br /&gt;
     class BoxTool(Tool): &lt;br /&gt;
edit line 103 to read&lt;br /&gt;
     self.game.world.add.rect(self.rect.center, self.rect.width/2, self.rect.height/2, dynamic=True, &lt;br /&gt;
     density=0.01, restitution=0.16, friction=0.5)&lt;br /&gt;
&lt;br /&gt;
Alternatively you could get the same result editing the file &amp;lt;i&amp;gt;add_objects.py&amp;lt;/i&amp;gt; in the &amp;lt;i&amp;gt;/home/olpc/Activities/Physics.activity/elements&amp;lt;/i&amp;gt; directory. Force the function &lt;br /&gt;
&lt;br /&gt;
     def rect(...) &lt;br /&gt;
&lt;br /&gt;
to have density of 0.01. at line 147 add the following code&lt;br /&gt;
&lt;br /&gt;
     density = 0.01&lt;br /&gt;
&lt;br /&gt;
[[image:Physics-equal-density.jpg]]&lt;br /&gt;
&lt;br /&gt;
Equal density (1.0)&lt;br /&gt;
&lt;br /&gt;
[[image:Physics-unequal-density.jpg]]&lt;br /&gt;
&lt;br /&gt;
Modified so rectangles have a density of 0.01&lt;br /&gt;
&lt;br /&gt;
===Adding a keyboard shortcut===&lt;br /&gt;
A more sophisticated approach would be to use keyboard shortcuts&lt;br /&gt;
*l = light, density=0.1&lt;br /&gt;
*n = normal, density=1.0&lt;br /&gt;
*h = heavy, density=10&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;i&amp;gt;tools.py&amp;lt;/i&amp;gt; in the &amp;lt;i&amp;gt;/home/olpc/Activities/Physics.activity&amp;lt;/i&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Add the following code in the event handler, handleEvents(self,event), of class Tool(object)&lt;br /&gt;
&lt;br /&gt;
            elif event.key == K_h:&lt;br /&gt;
                self.setdensity=10&lt;br /&gt;
            elif event.key == K_l:&lt;br /&gt;
                self.setdensity=0.1&lt;br /&gt;
            elif event.key == K_n:&lt;br /&gt;
                self.setdensity=1&lt;br /&gt;
&lt;br /&gt;
add the following code in the __init__ method of class BoxTool(Tool)&lt;br /&gt;
&lt;br /&gt;
            self.setdensity =1&lt;br /&gt;
&lt;br /&gt;
finally modify this line of code to set density to self.setdensity rather than 1.0&lt;br /&gt;
&lt;br /&gt;
      self.game.world.add.rect(self.rect.center, self.rect.width/2, self.rect.height/2, &lt;br /&gt;
         dynamic=True, density=self.setdensity, restitution=0.16, friction=0.5)&lt;br /&gt;
&lt;br /&gt;
Do the same for circles, triangles and polygons.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Explanation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The class BoxTool is a derived class of the base class Tool. Attributes in a derived class override attributes in a base class, if the attribute is not defined in the derived class, then the base class attribute is inherited. When an instance of BoxTool is created, the __init__ method of class BoxTool runs, the __init__ method of class Tool is overridden. But handleEvents(self,event) is inherited from class Tool because it is not defined in class BoxTool. The default density is set in __init__ , it is altered by handleEvents and is used to create a rectangle of the appropriate density in self.game.world.add.rect&lt;br /&gt;
&lt;br /&gt;
The significance of &#039;self&#039; is that it is the current instance of BoxTool. Using self.density means the variable density in the current instance.  For more on classes see [http://docs.python.org/tutorial/classes.html Python Tutorial, Section 9, Classes] or [http://www.openbookproject.net/pybiblio/gasp/course/O-objects.html Gasp Lessons].&lt;br /&gt;
&lt;br /&gt;
===Adding toolbar buttons===&lt;br /&gt;
The *.svg icons were created for the 3 densities, using the vector drawing package Inkscape. A feather, wood and rock:&lt;br /&gt;
* [[image:Feather.svg]] feather.svg http://www.box.net/shared/f2cu2mmjdg&lt;br /&gt;
* wood http://www.box.net/shared/goqicaiiyt&lt;br /&gt;
* rock http://www.box.net/shared/ybnc686fhy&lt;br /&gt;
&lt;br /&gt;
They can be downloaded to the journal, they save as &amp;lt;i&amp;gt;File index.php from...&amp;lt;/i&amp;gt;  Do not open them or the paint activity will corrupt them. They need, each in turn, to be the top (most recently accessed) items in the journal for copy-from-journal to work. &lt;br /&gt;
&lt;br /&gt;
In terminal change to directory /home/olpc/Activities/Physics.activity/icons &lt;br /&gt;
&lt;br /&gt;
  copy-from-journal feather.svg&lt;br /&gt;
  mv feather..svg feather.svg&lt;br /&gt;
&lt;br /&gt;
and same again for wood and rock.&lt;br /&gt;
&lt;br /&gt;
Edit the activity.py file in the directory /home/olpc/Activities/Physics.activity add the following code in build_toolbar(), just after the code for self.destroy that places three new toolbuttons to the right of the existing buttons.&lt;br /&gt;
&lt;br /&gt;
        self.light = RadioToolButton(group=self.box, named_icon=&#039;feather&#039;)&lt;br /&gt;
        self.light.set_tooltip(_(&amp;quot;Light&amp;quot;))&lt;br /&gt;
 #        self.light.connect(&#039;clicked&#039;,self._light_cb)&lt;br /&gt;
        create_toolbar.insert(self.light,-1)    &lt;br /&gt;
        self.light.show()&lt;br /&gt;
        self.normal = RadioToolButton(group=self.box, named_icon=&#039;wood&#039;)&lt;br /&gt;
        self.normal.set_tooltip(_(&amp;quot;Normal&amp;quot;))&lt;br /&gt;
 #        self.normal.connect(&#039;clicked&#039;,self._normal_cb)&lt;br /&gt;
        create_toolbar.insert(self.normal,-1)    &lt;br /&gt;
        self.normal.show()&lt;br /&gt;
        self.heavy = RadioToolButton(group=self.box, named_icon=&#039;rock&#039;)&lt;br /&gt;
        self.heavy.set_tooltip(_(&amp;quot;Heavy&amp;quot;))&lt;br /&gt;
 #        self.heavy.connect(&#039;clicked&#039;,self._heavy_cb)&lt;br /&gt;
        create_toolbar.insert(self.heavy,-1)    &lt;br /&gt;
        self.heavy.show()&lt;br /&gt;
&lt;br /&gt;
[[image:Physics-toolbar.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Modifying ConozcoUruguay Activity (in Spanish)==&lt;br /&gt;
See http://drupal.ceibaljam.org/?q=node/46 for how to modify the contents of the ConozcoUruguay Activity to develop content, create new questions and new levels of play. This description is particularly directed to those who have no programming skills. (in Spanish but see translate.google.com for a translation)&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
;OLPC [[olpc:XO|XO]]: the One Laptop per Child laptop hardware&lt;br /&gt;
;Linux: the underlying computer operating system. If you start the Terminal activity you are looking at a Linux command line interface.&lt;br /&gt;
;Sugar: the GUI (Graphical User Interface) for the operating system. It is written in Python and launched from Linux. It is what you see when you turn on your XO or launch Sugar on a Stick.&lt;br /&gt;
;Python: the programming language that most activities are written in. Source files have a *.py extension. It is an interpreted language, not a compiled one; programs run when the Python interpreter reads and interprets the *.py files; there are no executable (*.exe) files. The Pippy activity is a Python editor.&lt;br /&gt;
;Libraries: If you read a *.py python source file, you are not seeing the whole story. Libraries of code are imported, often at the start of a *.py file you will see libraries imported, &#039;&#039;e.g.&#039;&#039;,&lt;br /&gt;
 import pango&lt;br /&gt;
 import gtk&lt;br /&gt;
&lt;br /&gt;
Some of the more commonly used libraries:&lt;br /&gt;
&lt;br /&gt;
[http://library.gnome.org/devel/gtk/stable/gtk.html GTK] - a library for creating graphical user interfaces. &amp;lt;br&amp;gt;&lt;br /&gt;
[http://library.gnome.org/devel/pango/stable/ pango] - text rendering library &amp;lt;br&amp;gt;&lt;br /&gt;
[http://cairographics.org/documentation cairo] - graphics rendering library &amp;lt;br&amp;gt;&lt;br /&gt;
pangocairo - the library integrating Pango and cairo &amp;lt;br&amp;gt;&lt;br /&gt;
[http://docs.python.org/library/math.html#module-math math] - gives access to library functions for floating point math&amp;lt;br&amp;gt;&lt;br /&gt;
[http://docs.python.org/library/time.html time] - this module provides various time-related functions.&amp;lt;br&amp;gt;&lt;br /&gt;
[http://wiki.laptop.org/go/Sugar_Architecture/API/Sugar_Library_Packages sugar] - the sugar Package allows access to several modules and subpackages&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.pygtk.org/docs/pygobject/gobject-functions.html gobject] - an abstraction layer that allows programming with an object paradigm&amp;lt;br&amp;gt;&lt;br /&gt;
[http://docs.python.org/library/os.html os] - this module provides a unified interface to a number of operating system functions.&lt;br /&gt;
&lt;br /&gt;
==Readings==&lt;br /&gt;
*[[olpc:Sugar_Architecture/API]]&lt;br /&gt;
*http://xo-whs.wikispaces.com/Terminal Linux&lt;br /&gt;
*[http://www6.software.ibm.com/developerworks/education/l-sugarpy/l-sugarpy-pdf.pdf Application development for the OLPC laptop]&lt;br /&gt;
*[http://www.olpcaustria.org/mediawiki/index.php/Activity_handbook Activity handbook - Olpcaustria]&amp;lt;br&amp;gt;&lt;br /&gt;
*http://www.python.org/doc/ Python&lt;br /&gt;
&lt;br /&gt;
[[Category:Activity Team]]&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Physics&amp;diff=50477</id>
		<title>Activities/Physics</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Physics&amp;diff=50477"/>
		<updated>2010-03-31T22:12:05Z</updated>

		<summary type="html">&lt;p&gt;Tswast: Fixed broken link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{GoogleTrans-en}}{{TOCright}}&lt;br /&gt;
[[Category:Activities|Physics]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
[[Image:activity-physics-55x55.png]]&lt;br /&gt;
&lt;br /&gt;
Physics is a physical world simulator and playground -- you can add squares, circles, triangles, or draw your own shapes, and see them come to life with forces (think gravity, Newton!), friction (scrrrrape), and inertia (ahh, slow down!).&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
{|&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:physics_blender.png|thumb|none|280px|A motor drives the centre cross shape, while the outer edges are pinned to stop the blender breaking.]]&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:physics_dancing puppet.png|thumb|none|280px|One motor is used to drive a circle connected via a belt to another pinned wheel that bounces a weight to make a puppet dance.]]&lt;br /&gt;
|+&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:physics_dancing_puppet2.png|thumb|none|280px|More puppet dancing]]&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:physics_dog.jpg|thumb|none|280px|Running dog using two motors]]&lt;br /&gt;
|+&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:physics_marble_pusher.jpg|thumb|none|280px|Using a motor on a circle to drive a piston that slowly releases balls one by one]]&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:Earthquake simulator.png|thumb|none|280px|Motor driven earthquake simulator]]&lt;br /&gt;
|+&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:physics_transverse_waves.png|thumb|none|280px|Example illustrating transverse wave propagation.]]&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|[[Image:physics_longitudinal_waves.png|thumb|none|280px|Example illustrating longitudinal wave propagation.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ideas to try ==&lt;br /&gt;
&lt;br /&gt;
*Build a machine that sorts different sized balls in to two buckets, large and small, with no ball jams. &lt;br /&gt;
*A cyclic mechanism for lifting balls from the bottom of the screen to the top, again and again.&lt;br /&gt;
*Try dropping 2 different mass objects at the same time.&lt;br /&gt;
*Experiment with pendulums of different lengths and masses.&lt;br /&gt;
*Ping pong, can you make a device that hits a ball back and forth across the screen?&lt;br /&gt;
*Try building a mechanical binary clock.&lt;br /&gt;
*Convert rotation into parallel motion using pistons.&lt;br /&gt;
*Experiment with touching one motorised circle against one pinned circle of various sizes.&lt;br /&gt;
*Try building a rag-doll puppet and make it dance in a convincing way.&lt;br /&gt;
*Use just links and circles to make a structurally sound Eiffel Tower.&lt;br /&gt;
*Try building a ratchet mechanism.&lt;br /&gt;
*Try building an analogue clock face where the min hand goes around 60 times for each hour.&lt;br /&gt;
*Modify the program itself: [[Activity_Team/Modifing_an_Activity#Modifying_Physics|Modifying Physics]]&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
[[Image:physics-toolbar.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stop/Start:&#039;&#039;&#039; allows you to stop time and start it again, allowing you to build constructions without them collapsing while you work. &#039;&#039;&amp;lt;Ctrl&amp;gt;+space&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Draw:&#039;&#039;&#039; click and hold to draw any shape you&#039;d like! &#039;&#039;&amp;lt;Ctrl+D&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Circle:&#039;&#039;&#039; circles of any radius. Click (center) drag and release (outer edge). &#039;&#039;&amp;lt;Ctrl+C&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Triangle:&#039;&#039;&#039; triangles (equilateral) of any size and initial rotation. Click (center of base) drag and release. &#039;&#039;&amp;lt;Ctrl+T&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Box:&#039;&#039;&#039; rectangles of any dimension. Click (corner) drag + release (opposite corner). &#039;&#039;&amp;lt;Ctrl+B&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Polygon:&#039;&#039;&#039; as many sides as you would like. Draw your own N-gon. Click, drag and release for each point, to end return to the start point. &#039;&#039;&amp;lt;Ctrl+P&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Grab:&#039;&#039;&#039; drag existing objects around with the mouse. &#039;&#039;&amp;lt;Ctrl+G&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Motor:&#039;&#039;&#039; click an object to pin and drive it with clockwise rotation. It is easiest to stop the simulation, place your object, add its motor, and resume the simulation again. &#039;&#039;&amp;lt;Ctrl+M&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pin:&#039;&#039;&#039; pin a shape to the screen, it can rotate about the pin. If you want to lock a shape in place, use two or more pins to stop it rotating. &#039;&#039;&amp;lt;Ctrl+O&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Joint:&#039;&#039;&#039; connect two objects together with a rod. Click on any object, drag to another object and release to create the joint (each end of joint allows rotation). &#039;&#039;&amp;lt;Ctrl+J&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Erase:&#039;&#039;&#039; click on an object to erase it, or click and hold to draw a line of destruction--erasing everything in its path! &#039;&#039;&amp;lt;Ctrl+E&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;20&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Hints and tips&#039;&#039;&#039;: Single clicking (no drag) with the circle, triangle or box tool, will add a default sized shape. Once you have used a shape tool, it remembers the last shape you made with it, a single click will add a clone of that last shape.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Development =&lt;br /&gt;
[[Image:PhysicsElements.png|160px|right]]&lt;br /&gt;
There are quite a few code layers to contend with. A regular Python Activity acts as a Sugar wrapper to Physics which is written using OLPCGames which itself wraps Pygame, Physics then uses Elements as a wrapper for Box2D.&lt;br /&gt;
&lt;br /&gt;
==Video==&lt;br /&gt;
&lt;br /&gt;
Please do post videos with feedback, talking while you&#039;re trying something for the first time is particularly insightful as it can highlight those initial expectations for user interface behaviour. Bonus points to Dennis for being brave enough to be part of the first wave!&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=guE7Uklqr_c UI feedback Video] unfortunately there&#039;s a seg fault at the end, ticket from Dennis is [http://dev.sugarlabs.org/ticket/1194 #1194].&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=1nseWyxaN6g Sugar at the Boston Museum], for more information see Bill Kerr&#039;s [http://xo-whs2009.blogspot.com/2009/08/physics-games-screenshots_14.html blog].&lt;br /&gt;
&lt;br /&gt;
== Release Notes ==&lt;br /&gt;
&lt;br /&gt;
=== v3 ===&lt;br /&gt;
&lt;br /&gt;
* Journal state saving now supported!&lt;br /&gt;
* MIME type support added so Physics Journal entries can be sent to others (application/x-physics-activity)&lt;br /&gt;
* Fixed Activity title text input so you can name your work correctly (olpcgames glitch)&lt;br /&gt;
* New Grab toolbar icon (hand)&lt;br /&gt;
* New Polygon toolbar icon (irregular polygon shape)&lt;br /&gt;
* Cleaned up toolbar order &lt;br /&gt;
* Single click behaviour so that Circle, Triangle, and Box tool add default sized shapes&lt;br /&gt;
* Single click behaviour for all tools, so that a subsequent single click creates a clone of the last shape made with that tool.&lt;br /&gt;
* Erase tool now erases (one by one) pins/joints/motors from a shape, before finally removing the shape itself.&lt;br /&gt;
* Using &amp;lt;Ctrl&amp;gt;+key for all keyboard shortcuts (was causing PyGame input focus issues when typing a title)&lt;br /&gt;
* Using the Sugar standard arrow cursor for the PyGame canvas (well, a fake one)&lt;br /&gt;
* Cleaned up the Activity icon&lt;br /&gt;
* Upgraded to new version of Elements 0.13&lt;br /&gt;
* Upgraded to new version of Box2D&lt;br /&gt;
* Picked up Pootle (July 3rd) translations&lt;br /&gt;
&lt;br /&gt;
====user notes ====&lt;br /&gt;
I really struggle to get any of the motor actions to work. Can you post some videos of your own successes? It&#039;s hard to build curriculum when you don&#039;t know how something is supposed to work.&lt;br /&gt;
&lt;br /&gt;
=== v2 ===&lt;br /&gt;
&lt;br /&gt;
* Migrated to Sugar Labs&lt;br /&gt;
* Motor toolbar button added&lt;br /&gt;
* Pin toolbar button added&lt;br /&gt;
* Toolbar reworked for displaying state and keyboard accelerators&lt;br /&gt;
* Stop/play toolbar button added&lt;br /&gt;
* Prevented very small freehand and polygon shapes to prevent Box2d crashes&lt;br /&gt;
&lt;br /&gt;
=== v1 ===&lt;br /&gt;
&lt;br /&gt;
* Original created by Brian Jordan, Alex Levenson, Chris Hager&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4193 Activity bundle]&lt;br /&gt;
* [http://git.sugarlabs.org/projects/physics GIT repository]&lt;br /&gt;
* [http://download.sugarlabs.org/sources/honey/Physics/ Source tarball]&lt;br /&gt;
* [http://bugs.sugarlabs.org/query?component=Physics Bug tracker]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50476</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50476"/>
		<updated>2010-03-31T21:59:11Z</updated>

		<summary type="html">&lt;p&gt;Tswast: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&lt;br /&gt;
[[Category:Activities|Turtle Art]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50475</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50475"/>
		<updated>2010-03-31T21:58:25Z</updated>

		<summary type="html">&lt;p&gt;Tswast: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Translations | [[Activities/Plot|english]] &amp;amp;#124; [[Activities/Plot/lang-es|español]] &amp;amp;#124;}}{{GoogleTrans-en}}{{TOCright}}&lt;br /&gt;
[[Category:Activities|Turtle Art]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50474</id>
		<title>Activities/Plot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activities/Plot&amp;diff=50474"/>
		<updated>2010-03-31T21:57:54Z</updated>

		<summary type="html">&lt;p&gt;Tswast: Created initial page for Plot activity&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Translations | [[Activities/Turtle Art|english]] &amp;amp;#124; [[Activities/Turtle Art/lang-es|español]] &amp;amp;#124;}}{{GoogleTrans-en}}{{TOCright}}&lt;br /&gt;
[[Category:Activities|Turtle Art]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Activity-plot.svg‎]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Plot is an activity that plots mathematical functions.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [http://activities.sugarlabs.org/en-US/sugar/addon/4287/ Activity download page]&lt;br /&gt;
* [https://code.launchpad.net/sugar-plotter-activity Source]&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Activity-plot.svg&amp;diff=50473</id>
		<title>File:Activity-plot.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Activity-plot.svg&amp;diff=50473"/>
		<updated>2010-03-31T21:54:14Z</updated>

		<summary type="html">&lt;p&gt;Tswast: Icon for Plot activity.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Icon for Plot activity.&lt;/div&gt;</summary>
		<author><name>Tswast</name></author>
	</entry>
</feed>