Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline DiegoV  
#1 Posted : 14 June 2022 07:52:42(UTC)
DiegoV

Rank: Newbie

Groups: Registered
Joined: 17/01/2021(UTC)
Posts: 7
Costa Rica
Location: Heredia

Was thanked: 1 time(s) in 1 post(s)
Hi!
I have recently update Smath Studio to version 1.0.8151 and now I'm getting some errors on Draw2D() plot: See attached file. Ejemplo Maxima 2D Draw rectangles.sm (7kb) downloaded 19 time(s).
Apparently, now there is an error on labels, but in older versions of Smath it worked just fine.
The issue seems to be that now Draw2D() function doesn't support special characters and instead replaced them with UNICODE text...
Can anyone help me please!!?
Offline mkraska  
#2 Posted : 14 June 2022 19:18:49(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,743
Germany

Was thanked: 955 time(s) in 606 post(s)
This is due to a change in string encoding on SMath side. I haven't had time to adjust the string handling on Maxima side. I see two workarounds for now:

1. use an older version of SMath (I don't remember at which version the change was implemented).
2. add a custom translation rule in maxima.xml in the plugin directory. The procedure is described in section 7.6 of the SMath Handbuch (the section is in English).

You might try to replace "\\0020\\" by " ".


Note that custom changes to maxima.xml aren't conveyed with the .sm file, so this is not portable.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline DiegoV  
#3 Posted : 15 June 2022 09:20:05(UTC)
DiegoV

Rank: Newbie

Groups: Registered
Joined: 17/01/2021(UTC)
Posts: 7
Costa Rica
Location: Heredia

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: DiegoV Go to Quoted Post
Can anyone help me please!!?

Make it native brute force.

Square.PNG


The issue is with special characters like ".", " ", "_", "/", etc.
Offline mkraska  
#4 Posted : 15 June 2022 16:48:23(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,743
Germany

Was thanked: 955 time(s) in 606 post(s)
I confirm that there seems to be a problem with custom translations in maxima.xml. Sorry for guiding you into a dead end.

Possibly, this also has been broken at some version of SMath Studio. I'll ad that to the bug tracking system just as the string handling.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline uni  
#5 Posted : 15 June 2022 18:59:20(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,331
Man
Russian Federation

Was thanked: 1163 time(s) in 672 post(s)
Originally Posted by: mkraska Go to Quoted Post
I'll ad that to the bug tracking system just as the string handling.


add text decoding.jpg

ConvertToMaxima.cs:

Code:

        public static string PrepareStringsForMaxima(string text)
        {        
       //     text = ConvertTrigonometricFunctionsFromSMathToMaxima(text);
            text = TermsConverter.DecodeText( text ).Replace("\"$", "");
            text = text.Replace("$\"", "");
            //foreach (var pair in CharactersToAscii) text = (new Regex(pair.Key).Replace(text, pair.Value));
            //foreach (var pair in letters) text = (new Regex(pair.Key).Replace(text, pair.Value));
            //foreach (var pair in symbolsToMaxima) text = (new Regex(pair.Key)).Replace(text, pair.Value);
            text = text.Replace("\\", "\\\\"); // convert backslash
            return text;
        }


You need to add TermsConverter.DecodeText( text )

Edited by user 15 June 2022 19:03:17(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 15/06/2022(UTC)
Offline DiegoV  
#6 Posted : 15 June 2022 21:50:50(UTC)
DiegoV

Rank: Newbie

Groups: Registered
Joined: 17/01/2021(UTC)
Posts: 7
Costa Rica
Location: Heredia

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: uni Go to Quoted Post
Originally Posted by: mkraska Go to Quoted Post
I'll ad that to the bug tracking system just as the string handling.


add text decoding.jpg

ConvertToMaxima.cs:

Code:

        public static string PrepareStringsForMaxima(string text)
        {        
       //     text = ConvertTrigonometricFunctionsFromSMathToMaxima(text);
            text = TermsConverter.DecodeText( text ).Replace("\"$", "");
            text = text.Replace("$\"", "");
            //foreach (var pair in CharactersToAscii) text = (new Regex(pair.Key).Replace(text, pair.Value));
            //foreach (var pair in letters) text = (new Regex(pair.Key).Replace(text, pair.Value));
            //foreach (var pair in symbolsToMaxima) text = (new Regex(pair.Key)).Replace(text, pair.Value);
            text = text.Replace("\\", "\\\\"); // convert backslash
            return text;
        }


You need to add TermsConverter.DecodeText( text )


Hi Thanks!, but I'm not sure how to do that, can you guide me?
thanks 1 user thanked DiegoV for this useful post.
on 17/06/2022(UTC)
Offline uni  
#7 Posted : 16 June 2022 07:40:27(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,331
Man
Russian Federation

Was thanked: 1163 time(s) in 672 post(s)
Originally Posted by: DiegoV Go to Quoted Post
Hi Thanks!, but I'm not sure how to do that, can you guide me?


This is a hint for the plugin developer who needs to make changes to the source files in order to fix the problem: ConvertToMaxima.cs

Russia ☭ forever
Viacheslav N. Mezentsev
Offline Davide Carpi  
#8 Posted : 16 June 2022 13:19:03(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,516
Man
Italy
Location: Italy

Was thanked: 1260 time(s) in 829 post(s)
I've applied the fix proposed by Viacheslav, please try the updated plugin and check if it works.
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 2 users thanked Davide Carpi for this useful post.
on 17/06/2022(UTC),  on 17/06/2022(UTC)
Offline mkraska  
#9 Posted : 17 June 2022 16:26:45(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,743
Germany

Was thanked: 955 time(s) in 606 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
I've applied the fix proposed by Viacheslav, please try the updated plugin and check if it works.


Thanks, Viacheslav and Davide. I confirm that the fix works with version 8151. It is, however, not available for older version (tested with 7921).

EDIT: Tried again, works with 7921.

Edited by user 18 June 2022 00:18:33(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Davide Carpi  
#10 Posted : 17 June 2022 20:18:59(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,516
Man
Italy
Location: Italy

Was thanked: 1260 time(s) in 829 post(s)
Hi Martin, thank you for the feedback, I wasn't able to test it myself.
I've published the current code for every stable SMath Studio since 0.99.7579, so it should be available in the extensions Manager for a wide user base.

Edited by user 18 June 2022 15:53:49(UTC)  | Reason: Fixed

If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline DiegoV  
#11 Posted : 17 June 2022 22:48:07(UTC)
DiegoV

Rank: Newbie

Groups: Registered
Joined: 17/01/2021(UTC)
Posts: 7
Costa Rica
Location: Heredia

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
I've applied the fix proposed by Viacheslav, please try the updated plugin and check if it works.


It works! thanks!! ur the best!

Captura.JPG
Offline mkraska  
#12 Posted : 18 June 2022 00:21:04(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,743
Germany

Was thanked: 955 time(s) in 606 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
Hi Martin, thank you for the feedback, I wasn't able to test it myself.
I've published the current code for every stable SMath Studio since 0.99.7579, so it should be available in the extensions Manager for a wide user base.


Tried again, works now with 7921. Don't know what went wrong at the first try. Thanks again for fixing the problem.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.