SMath Studio Forum
»
SMath Studio
»
Questions
»
how to know the name of the variable
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Вот так можно решить задачу при помощи компонента Скрипт. Code: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 );
Script. Kross example 1.sm (7kb) downloaded 13 time(s). Script. Kross example 1.pdf (19kb) downloaded 15 time(s). |
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
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 (7kb) downloaded 12 time(s). |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Originally Posted by: mkraska 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. Code:var defs = Enumerable.Range( 0, store.Count ).Select( n => store[n] ).ToList();
This means: get all enabled definitions. How to check this. Code:var defs = Enumerable.Range( 0, store.Count )
.Select( n => store[n] )
.ToList();
defs.ForEach( d => store.TraceData( d.ToString() ) );
|
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
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=<semicolon>; decimal symbol=<comma>; system decimal symbol=<comma>; 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 |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Try to remove it manually and update again (20ad815b-bc5e-487d-9258-57fde2ac6de8). For 0.98.6179 last version is 0.1.6273.2204. Edited by user 05 March 2017 20:48:13(UTC)
| Reason: Not specified |
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
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.
|
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
I think I found the problem. Plugin updated, please try again. |
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
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.
|
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
I forgot to replace Tech.CodeGeneration.dll. Plugin updated, try again. Edited by user 05 March 2017 22:24:19(UTC)
| Reason: Not specified |
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
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.
|
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Originally Posted by: mkraska 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 |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
Originally Posted by: uni Only portable version not working or both?
Good point, installer version works. But installer version is a bad place for experiments. |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Ok, I need portable version. How I can get it? This link not working for me. |
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
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). |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
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 |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
|
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,639 Location: Italy Was thanked: 1323 time(s) in 873 post(s)
|
Something close to your request (input must be provided with strings, output is automated and issues reported in trace window) name+value+description.sm (8kb) downloaded 23 time(s).Edited by user 17 March 2017 18:51:23(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
how to know the name of the variable
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.