Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Andrey Ivashov  
#1 Posted : 30 September 2010 17:08:09(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,377
Man
Russian Federation

Was thanked: 1607 time(s) in 538 post(s)
Hello.

SMath Studio 0.90 will have a new interesting feature - Snippets. Here is one case how it works:


SMath Studio will have some built-in snippets, but of course every user can create its own snippets. Snippet in SMath Studio is a simple *.sm file that is placed into the special "snippets" folder. Every snippet can be inserted to the page using Dynamic Assistance (pressing TAB will insert snippet inside th collapsed Area Region; pressing Shift+TAB will insert just all snippet expressions without Area Region) or directly from the "Snippet Manager" of the "Tools" menu group.

By the way, please, advise me snippets that you want to be built-in to the SMath Studio.

Best regards, Andrey Ivashov.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 30/09/2010(UTC)
Offline oscampo  
#2 Posted : 30 September 2010 21:13:28(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 128
Man
Location: Cali, Colombia

Was thanked: 41 time(s) in 29 post(s)
Thanks for this interesting feature.
I think that it would be useful to include a snippet for English <-> SI units.

Regards,

Oscar Campo
Offline omorr  
#3 Posted : 30 September 2010 22:43:16(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,728
Man
Serbia

Was thanked: 309 time(s) in 264 post(s)
Hello Andrey,

I suppose Snippets would be useful if we want to have some sort of worksheets inside worksheets. With Area regions, dedicated "snippets" folder, we could have some collection of expressions which could be reused many times - some sort of "subroutines". If you remember there were extensive discussion and interest on the Forum about this possibility as a very welcome feature. I am just curious if there would be any specific rules for snippets *.sm files? Some sort of "input" into and "output" from the snippets, some local variables for the snippet. I suppose not this time because you mentioned that there is a possibility to insert the snippet either as Collapsed Area region or to insert the entire *.sm file - every expression in it. I hope I am right.

Regards,
Radovan

Edited by user 30 September 2010 22:48:44(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Andrey Ivashov  
#4 Posted : 01 October 2010 00:17:36(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,377
Man
Russian Federation

Was thanked: 1607 time(s) in 538 post(s)
omorr, you are absolutely right. No any rules for snippet *.sm files will be required (except user can set shortcut to see the snippet in the DA list).

Regards.
Offline mkraska  
#5 Posted : 02 June 2013 00:31:13(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,497
Germany

Was thanked: 796 time(s) in 509 post(s)
Following Davide's recommendation, I supply the stuff as snippets with corresponding example. You may unpack the zip file in your SMath install directory, then the files go automatically to the correct locations.

Some remarks:
- The description in the snippet manager is taken from the file properties, this does not show up in the dynamic assistant.
- After insertion of the snippet, the dynamic assistant shows the the description text of defined functions along with their definition.
- The explanation text in the examples browser is taken from the file properties.
- The snippets are more of an exercise for me in making snippets and examples than a real contribution to the community, as they are quite trivial.

Also, I have not seen any set of snippets gaining such popularity that it is continuously discussed and improved like many of the great plugins. Feedback, however, is welcome. Perhaps, plotting related helper functions could be collected in a central example.

I also encourage the plugin makers to use the examples mechanism (examples folder) for documenting the use of their products. Partly this is already done.

The files in the attachment have descriptions in german and english.

Edit: 2013 06 02 fixed missing translations

Edited by user 02 June 2013 15:15:34(UTC)  | Reason: Not specified

File Attachment(s):
2013 06 02 hatch and fill.zip (6kb) downloaded 56 time(s).
mkraska attached the following image(s):
hatch.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
thanks 3 users thanked mkraska for this useful post.
on 02/06/2013(UTC),  on 02/06/2013(UTC),  on 02/06/2013(UTC)
Offline kilele  
#6 Posted : 02 June 2013 14:33:21(UTC)
kilele


Rank: Advanced Member

Groups: Registered
Joined: 30/03/2011(UTC)
Posts: 392

Was thanked: 132 time(s) in 113 post(s)
Thanks. The second plot takes like 20 secs to load, some english/german descriptions do not show up in the snippet manager.

Edited by user 02 June 2013 14:37:48(UTC)  | Reason: Not specified

kilele attached the following image(s):
snippman.png
thanks 1 user thanked kilele for this useful post.
on 02/06/2013(UTC)
Offline mkraska  
#7 Posted : 02 June 2013 15:14:19(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,497
Germany

Was thanked: 796 time(s) in 509 post(s)
Originally Posted by: kilele Go to Quoted Post
Thanks. The second plot takes like 20 secs to load, some english/german descriptions do not show up in the snippet manager.


English descriptions were incomplete, fixed. And, yes, the fill function is slow (no performance optimization done so far). I had the idea of making coloured contour plots using dots with computed colors, but given the lousy performance I think that is a bad idea. On top of that, most graphics tricks are obsolete as soon as any of the plugins under construction are mature and feature-rich enough. Matplotlib would be nice, but there is few hope as they have no c# api.

My newly gained snippets experience has found it's way to the Handbuch now.

Edited by user 02 June 2013 15:16:29(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline RFreund  
#8 Posted : 06 December 2013 00:42:26(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 289
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Is there a way to use sub folders in the snippet folder or with the snippet manager? I think it would help with organization.

Thanks
Offline RFreund  
#9 Posted : 15 April 2014 19:58:08(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 289
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
This may be stated somewhere but if you use area regions in your snippet make sure that they are expanded. That way when you insert the snippet into a calculation page between separators the snippet will not overlap other regions.
Offline Davide Carpi  
#10 Posted : 11 May 2016 14:25:19(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,200
Man
Italy
Location: Italy

Was thanked: 1113 time(s) in 727 post(s)
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 15/05/2016(UTC)
Offline Jean Giraud  
#11 Posted : 28 September 2016 22:15:44(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,952
Canada

Was thanked: 707 time(s) in 553 post(s)
Originally Posted by: oscampo Go to Quoted Post
Thanks for this interesting feature.
I think that it would be useful to include a snippet for English <-> SI units.

Regards,

Oscar Campo


It does include Imperial => SI

Edited by moderator 29 September 2016 00:42:27(UTC)  | Reason: added [quote] BBCODE

Users browsing this topic
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.