Re: [Scilab-users] command longer than 4096

2023-04-25 Thread Federico Miyara


Vincent,

A question to be sure we understood the underlying problem.
How did you get this error message?
-  Using SciNotes (F5 shorcut for example)?
-  Using exec function?
-  Using copy/paste?

When testing the code I usually select a portion of code from SciNotes and use the 
contextual menu "Evaluate selection with echo".

However, I notice now that with F5 I don't experience the same problem...!

But I also notice that in other cases of commands longer than 4096 the problem 
doesn't show. When I use .. to continue on the next line, there is no problem. 
When the same data is included in a single very long line the problem arises.

I'm including at the end two examples. In the first one the data are ordered 
with frequent ..'s, in the second one I removed all the continuation marks with 
the consequence that it will not be accepted.

The expected behavior would be that there were no difference between the 
different ways of executing a command.

As final note, among the answers I received when I posted my quest, one 
included the proposal of a function which allows to read massive data as in my 
usage case from a block comment at the end of the file. This would be 
interesting also in order to alleviate the code.

Regards,

Federico Miyara
From: users 
 On 
Behalf Of Federico Miyara
Sent: Thursday, November 17, 2022 10:21 PM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] command longer than 4096




EXTERNAL EMAIL :  The sender of this email is external to 3DS. Be wary of the content 
and do not open unexpected attachments or links. If you consider this email as spam, 
you can click 
here
 (no login or additional action will be requested).




Christopher,

Yes, you understand correctly my case.

There is a reason that justifies my request: I often use my scripts as examples 
within a didactic context. They are exhaustively commented, for instance. I 
consider it preferable to have all the needed data in the same script since I 
cannot be sure that potential future users who find my script will also find 
the associated file with the data (sometimes one downloads a file for future 
use without checking whether we are downloading all the associated files).

Then they should also change the script according to the particular directory 
tree where they choose to place the data, which is an unnecessary distraction 
from the very point of the example.

I agree that it wouldn't be convenient nor practical to work in this way with 
very large data sets, but some 1000 data is not unusual.

Regards,

Federico Miyara
On 17/11/2022 05:16, Dang Ngoc Chan, Christophe wrote:

Hello Federico,



De : users 
 De la 
part de Federico

Miyara Envoyé : jeudi 17 novembre 2022 03:36



I have to create a vector from a plain text containing about 700 decimal 
numbers, each one with several digits.

[...]

Is there a simple way to do this other than [...] saving the data as a

text file



To be sure I understand well :

in your Scilab script, you have something like



foo = [3.14, 1.414 ; 1.732 ...



with the 700 numbers written inside your script?



Of course your request is legitimate but IMHO, this is really not the best 
practice.

I warmly recommend to have the 700 numbers in a separate file.



Regards



--

Christophe Dang Ngoc Chan

Mechanical calculation engineer





a = [0.2146008   0.3126420   0.3616361   0.2922267   0.5664249   0.4826472   
0.3321719   0.5935095 ..
0.5015342   0.4368588   0.2693125   0.6325745   0.4051954   0.9184708   
0.0437334   0.4818509 ..
0.2639556   0.4148104   0.2806498   0.1280058   0.7783129   0.2119030   
0.1121355   0.6856896 ..
0.1531217   0.6970851   0.8415518   0.4062025   0.4094825   0.8784126   
0.1138360   0.1998338 ..
0.5618661   0.5896177   0.6853980   0.8906225   0.5042213   0.3493615   
0.3873779   0.9222899 ..
0.9488184   0.3435337   0.3760119   0.7340941   0.2615761   0.4993494   
0.2638578   0.5253563 ..
0.5376230   0.1199926   0.2256303   0.6274093   0.7608433   0.0485566   
0.6723950   0.2017173 ..
0.3911574   0.8300317   0.5878720   0.4829179   0.2232865   0.8400886   
0.1205996   0.2855364 ..
0.8607515   0.8494102   0.5257061   0.9931210   0.6488563   0.9923191   
0.0500420   0.7485507 ..
0.4104059   0.6084526   0.8544211   0.0642647   0.8279083   0.9262344   
0.5667211   0.5711639 ..
0.8160110   0.0568928   0.5595937   0.1249340   0.7279222   0.2677766   
0.5465335   0.9885408 ..
0.7395657   0.0037173   0.5900573   0.3096467   0.2552206   0.6251879   
0.1157417   0.6117004 ..
0.6783956   0.3320095   0.0258710   0.5174468   0.3916873   0.2413538   
0.5064435   0.4236102 ..
0.2893728   0.0887932   0.6212882   0.3454984   0.7064868   

Re: [Scilab-users] command longer than 4096

2023-04-25 Thread COUVERT Vincent
Dear Frederico,

A question to be sure we understood the underlying problem.
How did you get this error message?

-  Using SciNotes (F5 shorcut for example)?

-  Using exec function?

-  Using copy/paste?

Thanks.



From: users  On Behalf Of Federico Miyara
Sent: Thursday, November 17, 2022 10:21 PM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] command longer than 4096



EXTERNAL EMAIL :  The sender of this email is external to 3DS. Be wary of the 
content and do not open unexpected attachments or links. If you consider this 
email as spam, you can click 
here
 (no login or additional action will be requested).




Christopher,

Yes, you understand correctly my case.

There is a reason that justifies my request: I often use my scripts as examples 
within a didactic context. They are exhaustively commented, for instance. I 
consider it preferable to have all the needed data in the same script since I 
cannot be sure that potential future users who find my script will also find 
the associated file with the data (sometimes one downloads a file for future 
use without checking whether we are downloading all the associated files).

Then they should also change the script according to the particular directory 
tree where they choose to place the data, which is an unnecessary distraction 
from the very point of the example.

I agree that it wouldn't be convenient nor practical to work in this way with 
very large data sets, but some 1000 data is not unusual.

Regards,

Federico Miyara
On 17/11/2022 05:16, Dang Ngoc Chan, Christophe wrote:

Hello Federico,



De : users 
 De la 
part de Federico

Miyara Envoyé : jeudi 17 novembre 2022 03:36



I have to create a vector from a plain text containing about 700 decimal 
numbers, each one with several digits.

[...]

Is there a simple way to do this other than [...] saving the data as a

text file



To be sure I understand well :

in your Scilab script, you have something like



foo = [3.14, 1.414 ; 1.732 ...



with the 700 numbers written inside your script?



Of course your request is legitimate but IMHO, this is really not the best 
practice.

I warmly recommend to have the 700 numbers in a separate file.



Regards



--

Christophe Dang Ngoc Chan

Mechanical calculation engineer



General

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.

___

users mailing list - users@lists.scilab.org

Click here to unsubscribe: 


http://lists.scilab.org/mailman/listinfo/users







[Avast logo]


El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
www.avast.com




This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: 
https://lists.scilab.org/mailman/listinfo/users