Code Monkey home page Code Monkey logo

Comments (21)

halatmit avatar halatmit commented on July 24, 2024

@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.

themadrobot avatar themadrobot commented on July 24, 2024

They all are as 1 block with a mutator as shown below
capture1

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.

halatmit avatar halatmit commented on July 24, 2024

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.

themadrobot avatar themadrobot commented on July 24, 2024

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.
capture1

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.

themadrobot avatar themadrobot commented on July 24, 2024

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.

halatmit avatar halatmit commented on July 24, 2024

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 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?


Reply to this email directly or view it on GitHub
#162 (comment)
.

from appinventor-sources.

themadrobot avatar themadrobot commented on July 24, 2024

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.

halatmit avatar halatmit commented on July 24, 2024

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.

halatmit avatar halatmit commented on July 24, 2024

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 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?


Reply to this email directly or view it on GitHub
#162 (comment)
.

from appinventor-sources.

weihuali0509 avatar weihuali0509 commented on July 24, 2024

This is true in the recent pull request to the Punya framework by Andrew.

Wei
[email protected]

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 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 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?


Reply to this email directly or view it on GitHub

#162 (comment)
.


Reply to this email directly or view it on GitHub
#162 (comment).

from appinventor-sources.

themadrobot avatar themadrobot commented on July 24, 2024

Thanks will try this

from appinventor-sources.

halatmit avatar halatmit commented on July 24, 2024

@themadrobot

Gareth, have you added the validation coding? Is this ready for a review?

from appinventor-sources.

themadrobot avatar themadrobot commented on July 24, 2024

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.

halatmit avatar halatmit commented on July 24, 2024

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.

themadrobot avatar themadrobot commented on July 24, 2024

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.

afmckinney avatar afmckinney commented on July 24, 2024

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.

themadrobot avatar themadrobot commented on July 24, 2024

Cheers Andrew

I'm in good spirit and got lots of support from family and friends. Looking forward to christmas now.

from appinventor-sources.

themadrobot avatar themadrobot commented on July 24, 2024

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.

kkashi01 avatar kkashi01 commented on July 24, 2024

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.

halatmit avatar halatmit commented on July 24, 2024

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.

halatmit avatar halatmit commented on July 24, 2024

This is being handled in pull request #365.

We'll close this issue when that has been finished.

from appinventor-sources.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.