Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use expression parsing library; use submodules; cleanup #7

Closed
wants to merge 3 commits into from

Conversation

pcworld
Copy link
Contributor

@pcworld pcworld commented Aug 11, 2014

@Herrie82
Copy link
Contributor

It seems that the sqrt, ln and log don't work due to invalid parsing ("Invalid Input"). I've updated some logics, see https://github.com/pcworld/org.webosports.app.calculator/pull/1/files for my suggested fixes. Please also note that due to our OpenEmbedded build process we cannot use submodules currently and we'd need the full libs to be included for our apps to work. Can you update your PR accordingly?

@pcworld
Copy link
Contributor Author

pcworld commented Aug 12, 2014

The parsing library is not "broken". And why calculate the result right away for the four specific functions? Why not let me enter my formula as I want, and then press equals? Why enclose the whole input with the function I choose? Makes it rather hard to enter something like "10+ln(2)/2"

And why not fix the build process instead of abusing git? If it uses git clone, it might be as easy to add the --recursive parameter for git >= 1.6.5.
And maybe change the submodules URLs from SSH to HTTPS, as for the first you need a public key to clone.

@pcworld
Copy link
Contributor Author

pcworld commented Aug 12, 2014

According to bitbake/lib/bb/fetch2/gitsm.py, one can use gitsm:// URL in the recipe to clone and init submodules.

@Herrie82
Copy link
Contributor

Ah sorry, my bad then, I expect the "same" behavior as in legacy, hence my adjustments. Now it makes sense. Might be good to have "2 modes" available for the calculator via a settings menu or toggle? A "simple" and a "scientific" one? I suspect most users will use the "simple" one most of the time and less will use it for more advanced calculations? I'll check with morphis to see if we can use the gitsm:// like you mentioned, that sounds feasible to me. There might be a good reason why it's not implemented/used for our build but then again I know a bit of JS and not much bitbake/OpenEmbedded.

@pcworld
Copy link
Contributor Author

pcworld commented Aug 12, 2014

For the calc.exe-like behavior you don't need any parsing library at all. I guess you mean this mode where you never see the formula, and as soon as you press +/- the current result is displayed? (Just how calculators worked some dozen years ago.)

@Herrie82
Copy link
Contributor

I guess I was looking too much at the legacy 3.0.x app (https://github.com/openwebos/core-apps/tree/master/com.palm.app.calculator) that was open sourced by HP and it's behavior and expected the new app one to do the same. I see that adding the possibility for longer formulas is a nice extra! I just wonder if the "average Joe" user would expect it as default or they would expect the old fashioned style. I'm all for options in general, so enabling/disabling it via a setting would be good. Could be in Tweaks as well, but since it's in an app itself it makes more sense there I'd say?

@morphis
Copy link
Member

morphis commented Aug 12, 2014

Regarding submodules: It's not that easy. gitsm:// isn't very efficient and will avoid using premirror so will always fetch from source which is something we try to avoid. We can use a different approach to initialize all submodules but that will cause additional maintenance on the build system side which I would like to avoid. Using a plain copy of the library is the most efficient way for now so I would really like to stick to it at least for apps we pull in through OE and not preware. For apps installed through preware they can use whatever they want.

@Herrie82
Copy link
Contributor

Parsing library has now been included, as well as Enyo with the following PR: #12

@Herrie82 Herrie82 closed this Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants