pencilcode / pencilcode Goto Github PK
View Code? Open in Web Editor NEWAn online IDE for kids: pencilcode.net.
Home Page: http://dev.pencilcode.net/
License: MIT License
An online IDE for kids: pencilcode.net.
Home Page: http://dev.pencilcode.net/
License: MIT License
The big advantage of CoffeeScript - optional parentheses for function invocation - is also a big disadvantage when it comes to allowing ambiguous syntax that does not run the way it reads on the screen.
We should improve the ACE editor coffeescript mode to add warnings in the following situations:
Inserting a command like fd(10000)
moves the turtle out of the output window. I guess it can be confusing and difficult for kids to bring it back. I feel there should be a set range for commands like these determined by the height and width of the output window.
Also, considering the fact that the target audience is kids who don't know anything about rgb values it would be nice to show a little popup saying that the rgb values can only be from 0 to 255 when somebody enters a value which does not lie in the range.
When clicking the "Email" option from the Share dialog when not logged in, we get the following email:
Check out this program that I created on http://pencilcode.net!
Posted program: http://share.pencilcode.net/home/vh0em--first
Latest program: http:undefined
Program code: http://pencilcode.net/edit/first
That undefined bit shouldn't be included in that case.
Ran into this when demoing today.
When using "Save" to create an account with a new name that has been reserved on a very slow school network, a bad error message is shown.
Today, when using pencilcode at a school with a very slow (throttled) network, we got the message "cannot set key" (instead of something like "account name rocco is taken"). This is probably because the JSON request to get a listing of account names was slowed down by the school network, and then we just saved using a name that already exists; and then that failed due to the conflict.
(1) Should fix this error message and
(2) Should find a way to test with very slow networks.
An offline version of pencilcode is probably needed.
There are several reasons we want to upgrade to node v0.12.x:
Unfortunately, pencilcode does not currently work with node v.0.12.x. Incompatibilities are probably something relatively simple; we should investigate and upgrade.
Allow a simple way to turn on and off the grid lines.
Originally PencilCode/jquery-turtle#19.
When running programs in the IDE, we should snap screenshots and save them to the server as "preview thumbnails".
It is easy to save the main canvas, but drawing the other HTML might be more involved. Here is a library that we could use (and improve) to handle rendering HTML to a canvas.
When switching programs between Javascript and Coffeescript (clicking the gear menu), we should translate the student's program between the two languages when possible.
To translate from Coffeescript to Javascript, we could use the normal Coffeescript compiler.
To translate from Javascript to Coffeescript, there is the project js2coffee.
After switching, we should consider saving the original and providing an "undo" link in the butter bar, so it's easy to get back without loss. Using the gear menu to switch back before edits should also restore the original
There should be some way of changing the origin - maybe a sethome() function, or maybe if you pass some arguments to home(), it should work.
Note that you can effectively change the origin to {pageX: 100, pageY: 100} by doing this:
$('#field').moveto pageX: 100, pageY: 100
It's been reported that pencilcode mostly works on an ipad with a logitech bluetooth keyboard, except that the arrow keys don't work.
Needs a repro.
Hi,
In https://github.com/PencilCode/pencilcode/blob/master/server/load.js#L2 , the module 'fs-ext' is required. This dependency gave me an error during npm install due to which I discovered that replacing it with 'fs' worked without any error. Even in https://github.com/PencilCode/pencilcode/blob/master/server/save.js#L2 the 'fs' module is required, and 'fs-ext' doesn't seem to use any special methods not in 'fs', and it isn't used anywhere else, so it may be a typo.
Pencilcode uses flat files as its store, managed by the 640 lines of python code in site/wsgi that implement the /load/ and /save/ URLs.
This code should be rewritten as a node.js javascript server for these reasons:
Many new users ask for this: when you are exploring a first example before signing up, e.g.,
http://pencilcode.net/edit/first
There should be a big "Another Example" button that randomly loads another example program from the top-level of pencil code.
A complete listing of examples can be gotten via listing http://pencilcode.net/load/, and looking for all the non-directory files that are non-empty.
Following a clean install of node.js on a Mac,
git clone https://github.com/nsthorat/rtc-pencilcode-site.git
cd rtc-pencilcode-site
npm install
grunt
fails when trying to invoke grunt, which is not anywhere on the PATH on my box.
However, ./node_modules/.bin/grunt
does work.
There should be a "Share" button next to the "Save" button that provides sharing options.
There are currently three different types of URLs that can be used to share pointers to a piece of code in pencilcode.
However, users have no idea of the three options here. A "Share" dialog should present and explain all three with a word or two. Could also allow the URLs to be emailed or tweeted or facebooked etc.
A framework is needed for puzzle-problems in Pencil Code.
The editor should allow you to load (or copy) a special kind of program that injects code into the IDE that walks you through a puzzle/problem/tutorial.
Maybe the first line of a program should be allowed to have some metadata that references a tutorial script..... Needs to be thought through.
When one logs in to rename a file, it says "Moved to...", which is confusing, because the terminology used in the rename button is "Rename".
A Pencil Code program is almost exactly the same as what can be expressed in JSFiddle. We should allow students to export their work to JSFiddle, probably through the "share" button.
JSFiddle has a POST API that should allow us to do this from the browser, and they recently fixed an issue that should allow us to post a coffeescript program.
The POST API is described here:
In multi-tab browsers, when you open two editing sessions to the same file, it is too easy to lose track of which tab has your most recent edits and overwrite them by accident.
We should either avoid this situation or make it less confusing.
A few possible alternative ideas for the user model here:
(A) Make it less confusing: Edits in one tab are immediately reflected in all tabs editing the same file. So it doesn't matter which tab you use; they're all equivalent and in sync.
(B) Avoid this situation, favoring the new tab: Opening a new tab for editing a file closes (or moves to the parent directory) the old tab that was editing the same file. Unsaved edits should be transferred from the old tab to the new tab.
(C) Avoid this situation, favoring the old tab: Opening a new tab for editing a file that is already open in another tab opens the file in a read-only mode, with a message that the file is already open for edit in another tab.
We could use localStorage to detect the multiple-tab case: a tab editing a file can "ping" its editor-start-time and last-alive-time timestamps into localStorage while it is open; and a new editor tab can see the other tab's presence in localStorage, etc.
Interested in comments about whether we think A, B, or C (or something else) is the way to go.
On IE 11 on Windows 8, the iframe for frame.pencilcode.net is empty in on all pages, and I see no errors on the Developer Tools console. In addition, all network requests succeeded, according to the Developer Tools network monitor, but there is no request going to frame.pencilcode.net. Maybe it's something wrong with the browser iframe security or the URL being too long? Works on the same computer using Google Chrome. You worked on iframes a while ago, what do you think?
To allow teachers to manage homework assignments without posting everything on the public web, we should be able to save and open and edit and run pencilcode programs on Google Drive.
I have registered pencilcode as an app with Google drive in a way that will allow us to develop on it. Information to follow in this issue.
Block programs with empty sockets should refuse to run, rather than running and then producing a runtime error.
My son just told me that he was trying to understand some of the commands in the help pane, and the one-line description and simple code example helped some, but he would have liked the possibility to pop out into a full example program that uses the selected command, so he can explore the command in context.
Every time I click on the run button in any program in Firefox, pencilcode refreshes the page. A screenshot of the console output is here.
Expand on preview mode (design mode?) to provide more graphic details. More details would help to:
-figure out angles,
-identify where to expect a write
-show the turtle's coordinates on the provided graph panel.
ctrl+Enter for run
ctrl+S for save
Originally PencilCode/jquery-turtle#15
Is it intended? If yes, then the error message is not very helpful.(Unexpected 'POST_IF'
)
ajaxorg/ace#1844
Currently, 'Ask for help' gives the user a shortened URL containing the code. This fails for large codes such as http://weihang.pencilcode.net/edit/dandelion.
The "browse users" page is almost unusable because of the increasing number of pencilcode accounts.
The page should include a prefix or substring filter. Enter a substring of the name that you are looking for, and it should instantly filter down to those names that contain the substring.
Some users will go to the "Browse users" page and hunt for a "Create new account" button. We should provide one there. (Reasoning: it is a common UI paradigm to see a list of objects and then have an option to "add a new one" to the list - and we follow this paradigm elsewhere on the site.)
Currently the only way to create an account is to edit a program (e.g., "Let's play") and then save it. After your first save, you are prompted to create an account.
This workflow should be available from "browse users". Because the backends like all directories to be nonempty, we could have a boilerplate first file that gets created in order to create the account (e.g., a copy of /edit/first)..
Any plans on i18n support?
Rather important for teaching non-english speaking kids programming.
Currently there is a line in editor-view.js that hard-codes the glyph dimensions on one of the monospace fonts that we use:
big = { width: 14, height: 29 };
For portability, we should eliminate hard-coded numbers and measure the text.
When the user hovers the cursor over the 'Browse user' button, he sees the 'See the guide' link, which is irrelevant to browsing users.
When i performed npm install
, I got the following output:
C:\Users\Bootstrap\Documents\GitHub\pencilcode [master]> npm install
npm WARN prefer global [email protected] should be installed with -g
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\dynamic.io requires debug@'~0.7.4' but will load
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\debug,
npm WARN unmet dependency which is version 2.1.0
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\grunt requires coffee-script@'~1.3.3' but will load
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\coffee-script,
npm WARN unmet dependency which is version 1.9.1
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\mocha requires debug@'2.0.0' but will load
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\debug,
npm WARN unmet dependency which is version 2.1.0
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\socket.io-parser requires debug@'0.7.4' but will load
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\debug,
npm WARN unmet dependency which is version 2.1.0
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\socket.io\node_modules\engine.io requires debug@'1.0.3' but will load
npm WARN unmet dependency C:\Users\Bootstrap\Documents\GitHub\pencilcode\node_modules\socket.io\node_modules\debug,
npm WARN unmet dependency which is version 0.7.4
[email protected] node_modules\debug
└── [email protected]
I have already installed coffee-script globally.
Need help with this error.
Some resources on the internet are only available if requested by a server, not a browser, so we should provide a simple proxy URL for pencilcode apps to fetch resources by bouncing off the pencilcode server.
Two use cases:
(1) PencilCode/jquery-turtle#25 - smart hit-testing. When using an offdomain image for a turtle, we want to inspect bits so that we can hit-test correctly (i.e., don't collide on transparent corners). But CORS rules prevent us from knowing the bits unless we safely bounce off a server we own. (The security rules are what keeps corp secrets safe from public browser pages javascript.)
(2) PencilCode/jquery-turtle#6 - text-to-speech. When using google translate tts, it only accepts requests without a referrer header. So people who use it bounce their requests off a proxy.
Integrating the ice_editor is a project for Monday's hackathon.
We should implement the sitemap protocol on pencilcode.net so that ordinary search engines can index public pages on the site. We would describe every file in /home/ (not /edit/).
The protocol:
http://www.sitemaps.org/protocol.html
Suggested implementation:
(1) There should probably be a single sitemap.xml for the entire site.
(2) robots.txt (on every subdomain) should refer to http://pencilcode.net/sitemap.xml.
(3) The sitemap should be generated dynamically on-request by crawling the entire directory tree.
(4) The sitemap file should be cached and not regenerated more than once per hour, to ensure that we don't get killed by an overaggressive crawl.
Would make sense to do this after the node.js port of the python servers.
When the user runs the following code
play "F3/4^G3/4c3/4f3/4[gE]3/4c3/4^G3/4g3/4[^g^D]3/4c3/4^G3/4^g3/4 [d=D]"
There should be a debug mode where it can render the notes that are being played as beautiful music staves, as it does when you paste the string into this webpage:
http://test.incompleteopus.net/vexabc/test/editor.html
The github project incompleteopus/vexabc is an open-source library that could be used to provide this.
When pressing ctrl-s in the editor, it saves, but then it takes focus out of the editor.
It should keep focus in the editor!
Suggested by premr at PencilCode/jquery-turtle#16
Allows you to know which users have created the most amount of programs that might be of interest.
Check for X-Requested-With, if it's an AJAX request, serve 404, otherwise if it's a browser, serve the parent directory.
We should be able to search the Pencilcode directory by keyword such as "maze" or "bubble sort."
Right now, pencilcode's server uses synchronous filesystem operations; we should switch to async file operations.
There's a style question when doing the conversion: we could convert the code to using callbacks everywhere; or another alternative is to use Promises, and use Promise-style asynchronous style.
Originally PencilCode/jquery-turtle#13.
Create a quicker link to the PencilCode reference card rather than having to search through the help link. Make the reference card a modal pop-in that is HTML and not a PDF.
I entered the command: Turtle help.
The test area and graph areas write to screen js code.
The only way to clear the panel is to hit the 'run/execute' button.
Clean-up error handling in test panel.
Provide a more elaborate guide for correct syntax/usage.
premr suggested: Allow numbers on the grids so people can know where to move the turtle in x,y rather than just relative movements
davidbau wrote: Yes great idea - there should be a debugging button that toggles "show movement labels" that
(1) shows grid labels that prem suggests and
(2) puts a protractor / compass rose under the current position of the
turtle
(3) shows a forward /back number line under the current position of the
turtle.
And maybe when in this mode, mousing to different parts of the screen
should preview code like "moveto 42, 32" or "fd 108" or "rt 144". Some
sort of click or gesture should enter that code into the editor.
Originally PencilCode/jquery-turtle#20
Example: http://weihang.pencilcode.net/edit/test
I pressed tab on the second line while the test function was collapsed.
Implement a password-recovery email flow.
Two possibilities here. We could just allow it without verification - trust our users.
Or we could suggest collection of an email address at signup. Although COPPA prohibits retention of an email address as part of the account, it does allow retention of an email address hash. This would be enough to permit an email address to be re-entered and verified during a password-recovery flow.
Originally PencilCode/jquery-turtle#14.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.