Snippets feature

Snippets feature - Сообщения

#1 Опубликовано: 30.09.2010 10:08:09
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

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.
1 пользователям понравился этот пост
Radovan Omorjan 30.09.2010 12:26:00
#2 Опубликовано: 30.09.2010 14:13:28
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: Moderator

Thanks for this interesting feature.
I think that it would be useful to include a snippet for English <-> SI units.

Regards,

Oscar Campo
#3 Опубликовано: 30.09.2010 15:43:16
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#4 Опубликовано: 30.09.2010 17:17:36
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

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.
#5 Опубликовано: 01.06.2013 17:31:13
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

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
2013 06 02 hatch and fill.zip (5 КиБ) скачан 135 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
3 пользователям понравился этот пост
Radovan Omorjan 02.06.2013 02:13:00, ioan92 02.06.2013 03:52:00, Davide Carpi 02.06.2013 06:09:00
#6 Опубликовано: 02.06.2013 07:33:21
kilele

kilele

133 сообщений из 397 понравились пользователям.

Группа: User

Thanks. The second plot takes like 20 secs to load, some english/german descriptions do not show up in the snippet manager.
snippman.png
1 пользователям понравился этот пост
Martin Kraska 02.06.2013 08:15:00
#7 Опубликовано: 02.06.2013 08:14:19
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

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.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#8 Опубликовано: 05.12.2013 17:42:26
Ryan Freund

Ryan Freund

19 сообщений из 339 понравились пользователям.

Группа: User

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
#9 Опубликовано: 15.04.2014 12:58:08
Ryan Freund

Ryan Freund

19 сообщений из 339 понравились пользователям.

Группа: User

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.
#10 Опубликовано: 11.05.2016 08:25:19
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
sergio 15.05.2016 15:37:00
#11 Опубликовано: 28.09.2016 16:15:44
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений