Comments (21)
@themadrobot
These four blocks should all appear as a single block with a dropdown.
They also need to check input validity and generate appropriate error messages.
When these are implemented, please also implement unit tests.
from appinventor-sources.
They all are as 1 block with a mutator as shown below
Dec>Hex and Dec>Binary are done. I am currently trying to get Hex>Dec and Binary>Dec working from the same mutator as 2 use string imputs where as Dec>Hex and Dec>Binary use numeric inputs.
Never done unit tests so will have to learn how to do that
from appinventor-sources.
Take a look at the text split blocks, where the dropdown mutator changes the "at" input type from text to list.
For info on unit tests, look at
/appinventor/blocklyeditor/tests/README
and see the part on writing simple code generator tests, and clone one
of the existing code generator tests.
from appinventor-sources.
The block is fully working
I have create a sample app that allows you convert to the different units using the maths block I have written. Below is a screenshot showing all the blocks to create the app.
I posted the app on the following forum thread https://groups.google.com/d/msg/app-inventor-open-source-dev/FrQf6PXedUs/hZFA2RY4fh4J
I have not yet done any unit testing yet
from appinventor-sources.
I have merged my code with the latest AI source code. I have also added the internationalization for english in the file appinventor\blocklyeditor\src\msg\en_messages.js as shown below
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TITLE_CONVERT = 'convert unit';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_HEX = 'dec to hex';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_HEX_TO_DEC = 'hex to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_BIN = 'dec to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_BIN_TO_DEC = 'binary to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_HEX = 'Returns the conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_HEX_TO_DEC = 'Returns the conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_BIN = 'Returns the conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_BIN_TO_DEC = 'Returns the conversion from binary to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_HEX = 'Returns the conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_HEX_TO_DEC = 'Returns the conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_BIN = 'Returns the conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_BIN_TO_DEC = 'Returns the conversion from binary to decimal';
For the other 3 translation folders :
appinventor\blocklyeditor\src\msg\es_es
appinventor\blocklyeditor\src\msg\zh_cn
appinventor\blocklyeditor\src\msg\zh_tw
I won't be able to translate these myself as I only speak English. Shall I add the same message code and let MIT sort the to translation out?
from appinventor-sources.
Please also send this into to app-inventor-developers. Make sure to
issue a pull request if you have not already done so.
== Hal Abelson
[email protected]
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty
On Fri, Nov 14, 2014 at 2:09 PM, Gareth Haylings [email protected]
wrote:
I have merged my code with the latest AI source code. I have also added
the internationalization for english in the file
appinventor\blocklyeditor\src\msg\en_messages.js as shown belowBlockly.Msg.LANG_MATH_CONVERT_UNITS_TITLE_CONVERT = 'convert unit';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_HEX = 'dec to hex';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_HEX_TO_DEC = 'hex to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_BIN = 'dec to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_BIN_TO_DEC = 'binary to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_HEX = 'Returns the
conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_HEX_TO_DEC = 'Returns the
conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_BIN = 'Returns the
conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_BIN_TO_DEC = 'Returns the
conversion from binary to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_HEX = 'Returns the
conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_HEX_TO_DEC = 'Returns the
conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_BIN = 'Returns the
conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_BIN_TO_DEC = 'Returns the
conversion from binary to decimal';For the other 3 translation folders :
appinventor\blocklyeditor\src\msg\es_es
appinventor\blocklyeditor\src\msg\zh_cn
appinventor\blocklyeditor\src\msg\zh_twI won't be able to translate these myself as I only speak English. Shall I
add the same message code and let MIT sort the to translation out?—
Reply to this email directly or view it on GitHub
#162 (comment)
.
from appinventor-sources.
I haven't issue it as a pull request just yet as I am still working on adding validation code to ensure correct input entered (dec, hex, binary) also still need to do the unit testing.
It is fully working other than the valid input check.
Would you like me to put what I have done up to now as a pull request or shall I add the input check code first?
from appinventor-sources.
When you are ready, make it a pull request in github. Check with andrew
or jeff or josé isf you need help.
== Hal Abelson
[email protected]
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty
On Fri, Nov 14, 2014 at 2:38 PM, Gareth Haylings [email protected]
wrote:
I haven't issue it as a pull request just yet as I am still working on
adding validation code to ensure correct input entered (dec, hex, binary)
also still need to do the unit testing.It is fully working other than the valid input check.
Would you like me to put what I have done up to now as a pull request?
—
Reply to this email directly or view it on GitHub
#162 (comment)
.
from appinventor-sources.
I believe that if you put in an empty string the message will default to
English and then someone can add a translation later.
Wei or Jeff or Andrew or José: Is that the correct?
== Hal Abelson
[email protected]
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty
On Fri, Nov 14, 2014 at 2:09 PM, Gareth Haylings [email protected]
wrote:
I have merged my code with the latest AI source code. I have also added
the internationalization for english in the file
appinventor\blocklyeditor\src\msg\en_messages.js as shown belowBlockly.Msg.LANG_MATH_CONVERT_UNITS_TITLE_CONVERT = 'convert unit';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_HEX = 'dec to hex';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_HEX_TO_DEC = 'hex to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_BIN = 'dec to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_BIN_TO_DEC = 'binary to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_HEX = 'Returns the
conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_HEX_TO_DEC = 'Returns the
conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_BIN = 'Returns the
conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_BIN_TO_DEC = 'Returns the
conversion from binary to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_HEX = 'Returns the
conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_HEX_TO_DEC = 'Returns the
conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_BIN = 'Returns the
conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_BIN_TO_DEC = 'Returns the
conversion from binary to decimal';For the other 3 translation folders :
appinventor\blocklyeditor\src\msg\es_es
appinventor\blocklyeditor\src\msg\zh_cn
appinventor\blocklyeditor\src\msg\zh_twI won't be able to translate these myself as I only speak English. Shall I
add the same message code and let MIT sort the to translation out?—
Reply to this email directly or view it on GitHub
#162 (comment)
.
from appinventor-sources.
This is true in the recent pull request to the Punya framework by Andrew.
On 11/14/14 5:50 PM, hal wrote:
I believe that if you put in an empty string the message will default to
English and then someone can add a translation later.Wei or Jeff or Andrew or José: Is that the correct?
== Hal Abelson
[email protected]
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class FacultyOn Fri, Nov 14, 2014 at 2:09 PM, Gareth Haylings
[email protected]
wrote:I have merged my code with the latest AI source code. I have also added
the internationalization for english in the file
appinventor\blocklyeditor\src\msg\en_messages.js as shown belowBlockly.Msg.LANG_MATH_CONVERT_UNITS_TITLE_CONVERT = 'convert unit';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_HEX = 'dec to hex';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_HEX_TO_DEC = 'hex to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_DEC_TO_BIN = 'dec to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_OP_BIN_TO_DEC = 'binary to dec';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_HEX = 'Returns the
conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_HEX_TO_DEC = 'Returns the
conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_DEC_TO_BIN = 'Returns the
conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_TOOLTIP_BIN_TO_DEC = 'Returns the
conversion from binary to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_HEX = 'Returns the
conversion from decimal to hexdecimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_HEX_TO_DEC = 'Returns the
conversion from hexdecimal to decimal';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_DEC_TO_BIN = 'Returns the
conversion from decimal to binary';
Blockly.Msg.LANG_MATH_CONVERT_UNITS_HELPURL_BIN_TO_DEC = 'Returns the
conversion from binary to decimal';For the other 3 translation folders :
appinventor\blocklyeditor\src\msg\es_es
appinventor\blocklyeditor\src\msg\zh_cn
appinventor\blocklyeditor\src\msg\zh_twI won't be able to translate these myself as I only speak English.
Shall I
add the same message code and let MIT sort the to translation out?—
Reply to this email directly or view it on GitHub—
Reply to this email directly or view it on GitHub
#162 (comment).
from appinventor-sources.
Thanks will try this
from appinventor-sources.
Gareth, have you added the validation coding? Is this ready for a review?
from appinventor-sources.
Hi hal
I'm pretty sure I did but havent be able to do anything on ai code at moment. Just arrived home from 6 days stay in hostpital after avserious burst appedics operation.. Very close call for me. Will be looking at the code in the new year when I have recovered. Have a good xmas and happy new year.
Gareth
from appinventor-sources.
Oh my god! I hope you are doing well. Please let us know how your
convalescence is progressing.
== Hal Abelson
[email protected]
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty
On Tue, Dec 23, 2014 at 1:08 PM, Gareth Haylings [email protected]
wrote:
Hi hal
I'm pretty sure I did but havent be able to do anything on ai code at
moment. Just arrived home from 6 days stay in hostpital after avserious
burst appedics operation.. Very close call for me. Will be looking at the
code in the new year when I have recovered. Have a good xmas and happy new
year.Gareth
—
Reply to this email directly or view it on GitHub
#162 (comment)
.
from appinventor-sources.
Yes it wasnt the nicest feeling but atleast I'm still alive. 2 years previously exactly the same time I had a pacemaker fitted due to my heart stopping for 16seconds. Things like this happening put you life into percpective and what is really important in life (my wife and kids).
Not sure what op I plan to have in the next as this seems to be a byannual thing I do, but I intend to by cyborg by the end of it then I'll be indistructable. Got to laugh to get through experiences like this
from appinventor-sources.
Gareth, I so sorry to hear of your situation, and am so glad you’re home now. Rest easy my thoughts are with and hope for a fast and easy recovery.
Be well.
Andrew McKinney
[email protected]
On Dec 23, 2014, at 1:36 PM, Gareth Haylings [email protected] wrote:
Yes it wasnt the nicest feeling but atleast I'm still alive. 2 years previously exactly the same time I had a pacemaker fitted due to my heart stopping for 16seconds. Things like this happening put you life into percpective and what is really important in life (my wife and kids).
Not sure what op I plan to have in the next as this seems to be a byannual thing I do, but I intend to by cyborg by the end of it then I'll be indistructable. Got to laugh to get through experiences like this
—
Reply to this email directly or view it on GitHub #162 (comment).
from appinventor-sources.
Cheers Andrew
I'm in good spirit and got lots of support from family and friends. Looking forward to christmas now.
from appinventor-sources.
Cheers Jose. On the mend now feeling better every day. Just aching now. The good thing about this is I get a few extra weeks xmas holiday on the sick. Time to catch up on the AI stuff and get mad robots v0.2alpha released shortly. Made some really cool physics mods to the canvas component before I was in hospital which will be included in the release
Will sort out another open source hang out to demo the latest mods I've done in the new year
from appinventor-sources.
Wishing you quick recovery. Rest well
On Dec 27, 2014 4:51 PM, "Gareth Haylings" [email protected] wrote:
Cheers Jose. On the mend now feeling better every day. Just aching now.
The good thing about this is I get a few extra weeks xmas holiday on the
sick. Time to catch up on the AI stuff and get mad robots v0.2alpha
released shortly. Made some really cool physics mods to the canvas
component before I was in hospital which will be included in the release—
Reply to this email directly or view it on GitHub
#162 (comment)
.
from appinventor-sources.
Nice work on the math conversion blocks. I did a review, and left a couple
of comments.
== Hal Abelson
[email protected]
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty
On Sat, Dec 27, 2014 at 4:51 PM, Gareth Haylings [email protected]
wrote:
Cheers Jose. On the mend now feeling better every day. Just aching now.
The good thing about this is I get a few extra weeks xmas holiday on the
sick. Time to catch up on the AI stuff and get mad robots v0.2alpha
released shortly. Made some really cool physics mods to the canvas
component before I was in hospital which will be included in the release—
Reply to this email directly or view it on GitHub
#162 (comment)
.
from appinventor-sources.
This is being handled in pull request #365.
We'll close this issue when that has been finished.
from appinventor-sources.
Related Issues (20)
- ant build failed: appinventor-sources/appinventor/build-common.xml:125: Compile failed; see the compiler error output for details.
- Techdebt: Collison of PitchProperty and RollProperty HOT 1
- aiStarter is not recognized in Safari
- Remove @license notations from all JS files HOT 4
- Fix multidex error on Android < 5 HOT 1
- Reports of possible regression in PrepareAppIcon step
- Missing functionality in iOS ListView HOT 4
- Project properties dialog does not open in Traditional Chinese (possibly others)
- LinearProgress does not work on Samsung devices HOT 3
- File ReadPermission/WriterPermission properties have no effect
- UI Properties for Chart Text and Axes HOT 1
- Workspace scrollbar overlaps blocks drawer, Hindering access to last block
- Implement repeat forever HOT 1
- iOS ListView does not accept dictionaries via blocks HOT 3
- "Add" string not translated in component_method block
- iOS companion crashes if ListView SelectionIndex set to be too large
- BlocklyTranslationGenerator.java did not specify the default charset HOT 1
- How to use AISTARTER HOT 1
- [iOS bug] yail/string-replace-mappings-longest-string
- "needs reply to review" label process is broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appinventor-sources.