![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
|
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 2 users thanked uni for this useful post.
|
on 21/06/2014(UTC), on 30/12/2021(UTC)
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. uni attached the following image(s): |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. Python also works but w/o syntax highlighting. File Attachment(s): uni attached the following image(s): |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. Small improvements. EDIT: Test (c#). ![2017-03-09_12-09-20.png](/forum/resource.ashx?a=16588&b=2) Script:
Code:var log = ( Action<string> ) ( ( text ) => store.TraceData(
String.Format( "{0} {1} [INFO ] {2}",
DateTime.Now.ToShortDateString(), DateTime.Now.ToLongTimeString(),text ) ) );
var defs = Enumerable.Range( 0, store.Count ).Select( n => store[n] ).ToList();
defs.ForEach( d => log( d.ToString() ) );
Edited by user 09 March 2017 10:11:23(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
The source code has been restored, updated and uploaded to svn. Something does not work yet (last example). The plugin is not available, because Release Manager can't build it (too complex I think). Edited by user 01 February 2016 20:10:13(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated (svn). Now last example works and we are waiting when Andrey fix the Release Manager. |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
|
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![Razonar Razonar](/forum/images/noavatar.gif) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,508 ![Uruguay Uruguay](/forum/Content/images/flags/UY.png) Was thanked: 974 time(s) in 609 post(s)
|
Hi Uni. Admirable work, thanks a lot for this plugin. Just few questions: - From where plugin's take c#, vb.net and python ¿(i.e. came when plugin is downloaded)? - ¿Can call nympi or Sci python? - ¿Can you show how to modify some SMtah's vector or matrix variable? In other words, ¿there are an output, avoiding handling files, to smath worksheet or only can view results in the trace window? - Not related with your plugin, but ... easy asking you: SMath don't have maple's traperror or mathcad onerror functions? Have a nice day. Alvaro. Edited by user 24 May 2016 00:14:18(UTC)
| Reason: Not specified
|
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Originally Posted by: Razonar ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) - From where plugin's take c#, vb.net and python ¿(i.e. came when plugin is downloaded)? - ¿Can call nympi or Sci python? - ¿Can you show how to modify some SMtah's vector or matrix variable? In other words, ¿there are an output, avoiding handling files, to smath worksheet or only can view results in the trace window? c#, vn.net from the .Net Framework which is already installed on your PC. As for the python I used IronPython which is a part of the plugin. Not shure about numpi and Sci. I think it is impossible use them now. You can modify and add definitions to the worksheet dynamically (inside the script). It not so simple to show how you can use this, I need a time to make an example. |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
![Tinu Tinu](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f3357.png&width=100&height=100) ![](/forum/Images/Ranks/Member.png) Rank: Member Groups: Registered
Joined: 04/01/2014(UTC) Posts: 19 ![Man Man](/forum/Themes/yafvision/male.gif) ![Switzerland Switzerland](/forum/Content/images/flags/CH.png) Location: Bern Was thanked: 14 time(s) in 12 post(s)
|
Originally Posted by: uni ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) c#, vn.net from the .Net Framework which is already installed on your PC. As for the python I used IronPython which is a part of the plugin. Not shure about numpi and Sci. I think it is impossible use them now.
You can modify and add definitions to the worksheet dynamically (inside the script). It not so simple to show how you can use this, I need a time to make an example.
Examples (specially regarding Python) would be greatly appreciated! Tinu
|
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked Tinu for this useful post.
|
|
|
![ahmetanildindar ahmetanildindar](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9737.JPG&width=100&height=100) Rank: Newbie
Groups: Registered
Joined: 23/08/2015(UTC) Posts: 2 ![Turkey Turkey](/forum/Content/images/flags/TR.png) Was thanked: 1 time(s) in 1 post(s)
|
Dear all, I donwloaded @uni's #3 smath file. Tried to understand but it seems more explanation is needed for low level users like me ![Good](/forum/Images/Emoticons/sm_smile_good.gif) It would be really perfect having Python scripts running within Smath. Is there any ongoing effort? ++Ahmet
|
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked ahmetanildindar for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. Variable terms added. Some namespaces declared implicit. ![2017-03-02_09-01-57.png](/forum/resource.ashx?a=16507&b=2) Script:
Code:try
{
string varname = terms[0].Text;
List<Definition> list = new List<Definition>();
for ( int n = 0; n < store.Count; n++ ) list.Add( store[ n ] );
// Функция условия для поиска определения.
Predicate< Definition > cond = delegate( Definition x )
{
// Если имя определения (переменной) равно varname.
return x.Name.Equals( varname );
};
// Метод Find ищет первый элемент, который удовлетворяет условию.
Definition def = list.Find( cond );
// Если элемент найден, то что-нибудь делаем.
store.TraceData( varname + ( def != null ? " " : " not " ) + "found" );
if ( def != null )
{
TMatrix m = new TMatrix( new TNumber[ 2, 3 ] );
m.unit.SetValue( ( TNumber ) new TDouble( "\"name\"" ), new long[] { 0, 0 } );
m.unit.SetValue( ( TNumber ) new TDouble( "\"descr\"" ), new long[] { 0, 1 } );
m.unit.SetValue( ( TNumber ) new TDouble( "\"value\"" ), new long[] { 0, 2 } );
m.unit.SetValue( ( TNumber ) new TDouble( "\"" + def.Name + "\"" ), new long[] { 1, 0 } );
m.unit.SetValue( ( TNumber ) new TDouble( "\"" + def.Description + "\"" ), new long[] { 1, 1 } );
TNumber val = SMath.Math.Numeric.Expression.Calculate( def.Result, store );
m.unit.SetValue( val, new long[] { 1, 2 } );
Definition res = new Definition( "out", m.ToTerms(), new Term[0] );
store.AddDefinition( res );
}
}
catch ( Exception ex )
{
store.TraceData( ex.Message );
}
Edited by user 09 March 2017 09:56:44(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. Fixed some issues related to vb compiler. |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. Examples added. Edited by user 24 September 2018 19:33:40(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. Now more magic available. ![2017-03-04 20-42-28 SMath Studio - [Script. Lambda. Linq.sm].png](/forum/resource.ashx?a=16527&b=2) Script:
Code:var args = Entry.Create( terms );
var entries = args.Items.ToList().Take(3).Select( x => Decision.Preprocessing( x, store ) ).ToList();
var nums = entries.Select( x => SMath.Math.Numeric.Expression.Calculate( x, store ).obj.ToDouble() ).ToList();
nums.ForEach( n => store.TraceData( n.ToString() ) );
Edited by user 09 March 2017 10:16:46(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Updated. Another attempt to fix the problem related with the portable version. Martin, please try again. Now the tmp directory appears in the plugins directory and you need to remove it content manually periodically. Fix this later. Edited by user 06 March 2017 13:14:43(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![mkraska mkraska](/forum/images/noavatar.gif) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,045 ![Germany Germany](/forum/Content/images/flags/DE.png) Was thanked: 1176 time(s) in 752 post(s)
|
Now working with the portable version, thanks. With maxima, we had quite some issues with temp dirs (interference between multiple smath instances or documents... |
|
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
Add definitions from list of strings. To get a textual representation we use [Ctrl+C], [Ctrl+V]. ![2017-03-08 12-08-37 SMath Studio - [Script. Load definitions.sm ].png](/forum/resource.ashx?a=16571&b=2) Script:
Code:var defs = new List<string>( new[] { "E:m*c^2", "a:1", "b:2" } );
defs.ForEach( d =>
{
var tmp = SMath.Math.Symbolic.Converter.ToMItem(d).ToTerms();
Decision.SymbolicCalculation( Entry.Create( tmp ), store );
} );
Edited by user 09 March 2017 09:55:54(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
String to matrix (c#). ![2017-03-08 21-31-34 SMath Studio - [Script. String to matrix.sm].png](/forum/resource.ashx?a=16575&b=2) Script:
Code:// rows - 2, cols - 3.
var text =
@"
1, 1.2, 0.3,
2, 9.5, -12,
2, 3
";
var provider = new NumberFormatInfo() { NumberDecimalSeparator = "." };
var vals = text
.Split( ',' ).Select( s => s.Trim() )
.Select( x => new TDouble( double.Parse( x, provider ) ).ToTerms() )
.Select( x => Entry.Create(x) ).ToList();
var mat = new Entry( "mat", TermType.Function, vals.ToArray() );
store.AddDefinition( "out", new Term[0], mat );
Edited by user 09 March 2017 09:55:17(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked uni for this useful post.
|
|
|
![uni uni](/forum/resource.ashx?url=http%3a%2f%2fen.smath.com%2fforum%2fUploads%2f966.jpg&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,639 ![Man Man](/forum/Themes/yafvision/male.gif) ![Russian Federation Russian Federation](/forum/Content/images/flags/RU.png) Was thanked: 1400 time(s) in 817 post(s)
|
How to add unit. ![2018-09-24_21-50-40.png](/forum/resource.ashx?a=25063&b=2) Script:
Code:var entry = new Entry(
"*", TermType.Function,
new[] { new Entry( "10" ), new Entry( "'m" ) }
);
store.AddDefinition( "out", entry );
Edited by user 24 September 2018 19:51:17(UTC)
| Reason: Not specified |
Russia ☭ forever (git.io/vOZo0) Viacheslav N. Mezentsev |
|
|
|
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.