how to know the name of the variable

how to know the name of the variable - Messages

#21 Posted: 3/1/2017 3:59:41 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Forum Var name.sm (13 KiB) downloaded 52 time(s).
#22 Posted: 3/5/2017 12:41:32 PM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Вот так можно решить задачу при помощи компонента Скрипт.

var defs = Enumerable.Range( 0, store.Count ).Select( n => store[n] ).ToList();
var args = ( Entry.Create( terms ) ).Items.ToList();

var vars = args.Take(4).Select( x => new Entry( "\"" + x.Text + "\"" ) ).ToList();
var vals = args.Take(4).ToList();
var desc = args.Take(4)
    .Select( x => defs.Find( d => d.Name.Equals( x.Text ) ).Description )
    .Select( x => new Entry( "\"" + x + "\"" ) ).ToList();

var rows = new Entry( "4" );
var cols = new Entry( "3" );

var mat = new Entry( "mat", TermType.Function, new Entry[] 
{
    vars[0], vals[0], desc[0], 
    vars[1], vals[1], desc[1], 
    vars[2], vals[2], desc[2],
    vars[3], vals[3], desc[3],
    rows, cols 
} );

store.AddDefinition( args[4].Text, new Term[0], mat );

2017-03-05 20-38-03 SMath Studio - [Script. Kross example 1.sm ].png

Script. Kross example 1.sm (6 KiB) downloaded 35 time(s).
Script. Kross example 1.pdf (18 KiB) downloaded 40 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Davide Carpi 3/5/2017 8:12:00 PM
#23 Posted: 3/5/2017 2:11:20 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Is there access to some list of definitions in the sheet? The script example seems to reqire explicit specification, which variables are to be processed. Could I just ask to export everything (excluding pre-defined names)?

If specification of the variables is acceptable, then the matrix can be created relying on math regions only.

export.sm (6 KiB) downloaded 32 time(s).
2017-03-05 18_00_56-SMath Studio 0.98.6179 - [Script.%20Kross%20example%201.sm_].png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
#24 Posted: 3/5/2017 2:22:28 PM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Wrote

Is there access to some list of definitions in the sheet? The script example seems to reqire explicit specification, which variables are to be processed. Could I just ask to export everything (excluding pre-defined names)?


Yes, the first line do it.

var defs = Enumerable.Range( 0, store.Count ).Select( n => store[n] ).ToList();

This means: get all enabled definitions.

How to check this.

var defs = Enumerable.Range( 0, store.Count )
    .Select( n => store[n] )
    .ToList();

defs.ForEach( d => store.TraceData( d.ToString() ) );

2017-03-05 22-21-48 SMath Studio - [List1 ].png


Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Martin Kraska 3/5/2017 2:32:00 PM
#25 Posted: 3/5/2017 2:35:01 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I just downloaded the script region and pasted the code above into it and set language to C#.

This gives the error message in the output window:

Die Datei oder Assembly "LinqBridge, Version=1.3.0.0, Culture=neutral, PublicKeyToken=c2b14eb747628076" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

(system can't find the file)

SMath Studio: SMath Studio Desktop 0.98.6179.21440, portable, x86
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 (Windows 7 Professional , x64)
Screen: 1920x1080 px, 96x96 dpi
Localization: separator=; decimal symbol=; system decimal symbol=; language=GER
Frameworks: CLR 2.0.50727.5485

installed versions:
v2.0.50727 2.0.50727.5420 SP2
v3.0 3.0.30729.5420 SP2
v3.5 3.5.30729.5420 SP1
v4
Client 4.6.01055
Full 4.6.01055
v4.0
Client 4.0.0.0
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#26 Posted: 3/5/2017 2:42:56 PM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Try to remove it manually and update again (20ad815b-bc5e-487d-9258-57fde2ac6de8).
For 0.98.6179 last version is 0.1.6273.2204.
Russia ☭ forever, Viacheslav N. Mezentsev
#27 Posted: 3/5/2017 3:36:49 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I deleted the dir and re-installed from extension manager (I did this just some hours ago, thus if the online gallery didn't change, then this didn't change anything locally).

There is a file LinqBridge.dll, yet the log file says

05.03.2017 19:30:58 [INFO ] Script Region, version 0.1.6273.2204, Sonntag, 5. März 2017 01:13:28
05.03.2017 19:31:28 [ERROR] Die Datei oder Assembly "LinqBridge, Version=1.3.0.0, Culture=neutral, PublicKeyToken=c2b14eb747628076" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

It says that LinqBridge or a dependence of it was not found.

Same message in the output window.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#28 Posted: 3/5/2017 3:51:30 PM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

I think I found the problem. Plugin updated, please try again.
Russia ☭ forever, Viacheslav N. Mezentsev
#29 Posted: 3/5/2017 4:08:45 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Sorry, didn't solve the problem. This is what the log says:

05.03.2017 20:05:57 [INFO ] Script Region, version 0.1.6273.19487, Sonntag, 5. März 2017 10:49:34
05.03.2017 20:06:20 [ERROR] Die Datei oder Assembly "LinqBridge, Version=1.3.0.0, Culture=neutral, PublicKeyToken=c2b14eb747628076" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#30 Posted: 3/5/2017 4:15:03 PM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

I forgot to replace Tech.CodeGeneration.dll. Plugin updated, try again.
Russia ☭ forever, Viacheslav N. Mezentsev
#31 Posted: 3/5/2017 4:34:13 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

05.03.2017 20:31:31 [INFO ] Script Region, version 0.1.6273.20457, Sonntag, 5. März 2017 11:21:54
05.03.2017 20:31:54 [ERROR] Die Datei oder Assembly "LinqBridge, Version=1.3.0.0, Culture=neutral, PublicKeyToken=c2b14eb747628076" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#32 Posted: 3/6/2017 1:37:04 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Wrote

05.03.2017 20:31:31 [INFO ] Script Region, version 0.1.6273.20457, Sonntag, 5. März 2017 11:21:54
05.03.2017 20:31:54 [ERROR] Die Datei oder Assembly "LinqBridge, Version=1.3.0.0, Culture=neutral, PublicKeyToken=c2b14eb747628076" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.


Only portable version not working or both?
Russia ☭ forever, Viacheslav N. Mezentsev
#33 Posted: 3/6/2017 4:23:51 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote


Only portable version not working or both?


Good point, installer version works. But installer version is a bad place for experiments.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#34 Posted: 3/6/2017 4:43:08 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Ok, I need portable version. How I can get it? This link not working for me.
Russia ☭ forever, Viacheslav N. Mezentsev
#35 Posted: 3/6/2017 4:56:55 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Currently the link is broken. Unpacking the linux version to some directory and placing an empty file "portable.version" in the install dir is a workaround (or better: the official way).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#36 Posted: 3/6/2017 6:21:52 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Well, I reproduced the problem. It is much harder to fix than I thought before (I don't know why it is happening for portable version).
Russia ☭ forever, Viacheslav N. Mezentsev
#37 Posted: 3/6/2017 9:01:52 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Сontinue in this topic.
Russia ☭ forever, Viacheslav N. Mezentsev
#38 Posted: 3/17/2017 12:42:30 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Something close to your request (input must be provided with strings, output is automated and issues reported in trace window)

name+value+description.sm (7 KiB) downloaded 44 time(s).

2017-03-17 16_41_00-SMath Studio - [name+value+description.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • New Posts New Posts
  • No New Posts No New Posts