Post Reply 
(Free42) matrix copy/paste bug
02-06-2018, 08:57 AM (This post was last modified: 02-06-2018 09:15 AM by Werner.)
Post: #1
(Free42) matrix copy/paste bug
I only discovered this yesterday (the matrix copy I mean)!
And it works really well, save for one thing: the import does not handle 34 digits with exponents.
Just export the 2x1 matrix containing
Code:
 1/7
 2 SQRT
You get
Code:
1.428571428571428571428571428571429e-1
1.414213562373095048801688724209698
Now copy that and paste it again into Free42 - you get
Code:
"1.4285"
1.414213562373095048801688724209698

The first one is a string. It seems there's a bug in the combination of 34 digits and exponent.
(tested on Free42 Decimal Windows 2.012 and iOS 2.0.12d)

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
02-06-2018, 12:32 PM
Post: #2
RE: (Free42) matrix copy/paste bug
Update: there's more going on. Try as I might, I can't get the following

Code:
kg    1
g    0.001
lb    0.45359237
oz    28.3495
slug    14.5939029372
lbt    0.3732417
ton    907.18474
tonUK    1016.0469088
t    1000
ozt    0.031103475
ct    0.0002
grain    0.00006479891
u    1.66057E-27

into my iPhone. It does work on Windows Free42 Decimal, though.
The iOS version insists on treating everything as a string and will return just a 1 column matrix.

Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
02-06-2018, 02:05 PM (This post was last modified: 02-06-2018 02:08 PM by Thomas Okken.)
Post: #3
RE: (Free42) matrix copy/paste bug
(02-06-2018 08:57 AM)Werner Wrote:  
Code:
1.428571428571428571428571428571429e-1
1.414213562373095048801688724209698
Now copy that and paste it again into Free42 - you get
Code:
"1.4285"
1.414213562373095048801688724209698

The first one is a string. It seems there's a bug in the combination of 34 digits and exponent.

Hmm. That affects scalar paste as well. Must be a bug in the number parser.
It looks like it doesn't handle negative exponents. Ouch! Release 2.0.13 coming soon...

(02-06-2018 12:32 PM)Werner Wrote:  Update: there's more going on. Try as I might, I can't get the following

Code:
kg    1
g    0.001
lb    0.45359237
oz    28.3495
slug    14.5939029372
lbt    0.3732417
ton    907.18474
tonUK    1016.0469088
t    1000
ozt    0.031103475
ct    0.0002
grain    0.00006479891
u    1.66057E-27

into my iPhone. It does work on Windows Free42 Decimal, though.
The iOS version insists on treating everything as a string and will return just a 1 column matrix.

That's probably because the tabs are getting turned into spaces somewhere. The matrix paste logic looks for tabs to separate cells within a row.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-06-2018, 02:22 PM
Post: #4
RE: (Free42) matrix copy/paste bug
Thanks Thomas.
Yes, the tabs get turned into spaces by gmail. Can't seem to find a way to keep them, and once I open it on the phone, there's no way even to generate a tab?
The only thing that works so far is to generate a table in Notes, but that means re-typing everything..
Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
02-06-2018, 03:46 PM
Post: #5
RE: (Free42) matrix copy/paste bug
I see tabs turning into spaces with the iOS Mail app, and also with Thunderbird in MacOS. Even the copies in the Sent folder have spaces instead of tabs.

Copying and pasting matrices between Free42 and Notes on iOS works fine. The system does not appear to be at fault, but the email clients.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-06-2018, 05:34 PM
Post: #6
RE: (Free42) matrix copy/paste bug
(02-06-2018 02:22 PM)Werner Wrote:  Thanks Thomas.
Yes, the tabs get turned into spaces by gmail. Can't seem to find a way to keep them, and once I open it on the phone, there's no way even to generate a tab?
The only thing that works so far is to generate a table in Notes, but that means re-typing everything..
Werner
How about if you zip up the file before emailing it?
Find all posts by this user
Quote this message in a reply
02-06-2018, 05:51 PM
Post: #7
RE: (Free42) matrix copy/paste bug
Or paste the data into Google Sheets...
Visit this user's website Find all posts by this user
Quote this message in a reply
02-07-2018, 01:51 AM
Post: #8
RE: (Free42) matrix copy/paste bug
2.0.13 is out now for Android, Windows, MacOS, and Linux. The iOS version will probably appear in the App Store tomorrow or Thursday.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-07-2018, 08:32 AM
Post: #9
RE: (Free42) matrix copy/paste bug
Thanks Thomas.
Google sheets is indeed the way to define the matrices once and be able to copy/paste them in both the Windows version and the iOS version (well I need to test iOS v2.0.13 still) IF you format the column with numerical values as text. There does not seem to be a numerical format that shows all digits, and switches to scientific notation when the numbers get too small or too large, like, well, the 42S does ;-)

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
02-07-2018, 02:25 PM
Post: #10
RE: (Free42) matrix copy/paste bug
I've mentioned this to the SwissMicros guys but I don't think it has any impact on the DM42.
Find all posts by this user
Quote this message in a reply
02-07-2018, 02:50 PM
Post: #11
RE: (Free42) matrix copy/paste bug
It would be nice to have a way to save/restore variables as we have for programs with the .raw files. This would enable for example matrix initialization on the DM42 from a .dat or .var file.
Find all posts by this user
Quote this message in a reply
02-07-2018, 03:04 PM (This post was last modified: 02-07-2018 03:05 PM by toml_12953.)
Post: #12
RE: (Free42) matrix copy/paste bug
(02-07-2018 01:51 AM)Thomas Okken Wrote:  2.0.13 is out now for Android, Windows, MacOS, and Linux. The iOS version will probably appear in the App Store tomorrow or Thursday.

Wow! Such service. Thanks! Do you know if this latest version will appear on the DM42's next release or not?

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
02-07-2018, 03:15 PM
Post: #13
RE: (Free42) matrix copy/paste bug
(02-07-2018 03:04 PM)toml_12953 Wrote:  
(02-07-2018 01:51 AM)Thomas Okken Wrote:  2.0.13 is out now for Android, Windows, MacOS, and Linux. The iOS version will probably appear in the App Store tomorrow or Thursday.

Wow! Such service. Thanks! Do you know if this latest version will appear on the DM42's next release or not?

The DM42 doesn't have Copy and Paste, so this change doesn't impact it. They should merge my changes up to and including 2.0.11, but everything since then, so far, has been either Copy & Paste fixes or platform-specific stuff.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-07-2018, 05:41 PM
Post: #14
RE: (Free42) matrix copy/paste bug
(02-07-2018 02:50 PM)Didier Lachieze Wrote:  It would be nice to have a way to save/restore variables as we have for programs with the .raw files. This would enable for example matrix initialization on the DM42 from a .dat or .var file.


I agree - this would be fantastic. This could be done similar to load/save files or states, or better, a new command where this could be done from within a program on the fly. You could then have a program work on many multiple data sets that had been pre-created.

At present, I am using a saved state to preload a saved matrix.

Bill
Smithville, NJ
Find all posts by this user
Quote this message in a reply
02-07-2018, 07:14 PM
Post: #15
RE: (Free42) matrix copy/paste bug
(02-07-2018 03:15 PM)Thomas Okken Wrote:  
(02-07-2018 03:04 PM)toml_12953 Wrote:  Wow! Such service. Thanks! Do you know if this latest version will appear on the DM42's next release or not?

The DM42 doesn't have Copy and Paste, so this change doesn't impact it. They should merge my changes up to and including 2.0.11, but everything since then, so far, has been either Copy & Paste fixes or platform-specific stuff.

Duh! Of course! I wasn't thinking. The excitement of a new version and all... Smile
I'm quite happy with the Windows version, though.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
02-08-2018, 08:17 AM (This post was last modified: 02-08-2018 08:36 AM by Thomas Okken.)
Post: #16
RE: (Free42) matrix copy/paste bug
(02-07-2018 08:32 AM)Werner Wrote:  Google sheets is indeed the way to define the matrices once and be able to copy/paste them in both the Windows version and the iOS version (well I need to test iOS v2.0.13 still) IF you format the column with numerical values as text. There does not seem to be a numerical format that shows all digits, and switches to scientific notation when the numbers get too small or too large, like, well, the 42S does ;-)

The new Paste functionality (in Free42 2.0 and later) gets the "text" version of the clipboard, and that contains numerical data in whatever way the originating spreadsheet chose to represent it, including the loss of precision that may result from whatever format is in place.

There are two ways around that: (1) find a way to make the spreadsheet show the numbers at full precision, or (2) add code to core_paste() in Free42 that handles the various vendor-specific data formats that spreadsheets put on the clipboard.

Unfortunately, the "text" (tab-delimited) format is the only one that all the spreadsheets that I tested with support. (Microsoft Excel, Google Sheets, Apple Numbers, and LibreOffice Calc.) Unless someone pays me to do it, option (2) from the previous paragraph is not going to happen, because it's a *lot* of work, so (1) is what I would recommend. Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
02-08-2018, 10:33 AM
Post: #17
RE: (Free42) matrix copy/paste bug
O, I'm happy with option (1), Thomas!
It's also the only one to allow defining 34 digits ;-)

Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
02-08-2018, 09:11 PM
Post: #18
RE: (Free42) matrix copy/paste bug
(02-07-2018 03:15 PM)Thomas Okken Wrote:  
(02-07-2018 03:04 PM)toml_12953 Wrote:  Wow! Such service. Thanks! Do you know if this latest version will appear on the DM42's next release or not?

The DM42 doesn't have Copy and Paste, so this change doesn't impact it. They should merge my changes up to and including 2.0.11, but everything since then, so far, has been either Copy & Paste fixes or platform-specific stuff.

We have, however, merged 2.0.13 into the DM42 source tree. It won't be in the next firmware version but (probably) in the one after that.

Even though the changes don't affect the DM42 platform, we keep it up to date in order to avoid surprises when applying the DM42 patches as much as possible. Going from, say, 2.0.11 straight to 2.0.14 when it is released carries with it more risk of nasty surprises than if the incremental updates are applied in sequence.
Find all posts by this user
Quote this message in a reply
02-09-2018, 01:17 AM (This post was last modified: 02-09-2018 01:18 AM by Thomas Okken.)
Post: #19
RE: (Free42) matrix copy/paste bug
(02-08-2018 09:11 PM)grsbanks Wrote:  
(02-07-2018 03:15 PM)Thomas Okken Wrote:  The DM42 doesn't have Copy and Paste, so this change doesn't impact it. They should merge my changes up to and including 2.0.11, but everything since then, so far, has been either Copy & Paste fixes or platform-specific stuff.

We have, however, merged 2.0.13 into the DM42 source tree. It won't be in the next firmware version but (probably) in the one after that.

Even though the changes don't affect the DM42 platform, we keep it up to date in order to avoid surprises when applying the DM42 patches as much as possible. Going from, say, 2.0.11 straight to 2.0.14 when it is released carries with it more risk of nasty surprises than if the incremental updates are applied in sequence.

I agree. That's exactly what I would recommend.

My remark about merging <= 2.0.11 was meant in the sense "if you're in sync with 2.0.11 and are getting ready to release, don't delay the release in order to merge > 2.0.11, because it won't make a difference to DM42 users."
Visit this user's website Find all posts by this user
Quote this message in a reply
02-09-2018, 02:52 PM
Post: #20
RE: (Free42) matrix copy/paste bug
(02-06-2018 03:46 PM)Thomas Okken Wrote:  I see tabs turning into spaces with the iOS Mail app, and also with Thunderbird in MacOS. Even the copies in the Sent folder have spaces instead of tabs.

Copying and pasting matrices between Free42 and Notes on iOS works fine. The system does not appear to be at fault, but the email clients.

It just occurred to me that if it's the email clients that are turning tabs into spaces, you might still be able to email matrices if you could just avoid using email clients, i.e. use the gmail.com web site in a browser. It turns out that works; I just successfully emailed a matrix to myself on my iPhone, using gmail.com in Safari. The tabs survived the trip.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)