Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


3 Pages<123>
Options
Go to last post Go to first unread
Offline Davide Carpi  
#21 Posted : 31 August 2016 20:44:39(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: ChrisBietz Go to Quoted Post
I am trying to upload the plugin to the extension manager.
http://smath.info/upload/Extensions.aspx redirects me to http://smath.info/ReleaseManager/ which unfortunately results in a Server Error for me ExtensionManagerError.zip (2kb) downloaded 40 time(s).
Would anyone happen to know how to get around this?


Only Andrey can fix this issue; in the meanwhile you can prepare the project to be committed in the SVN (prepare project file)

If you don't have yet a SVN access, send a mail or a PM to Andrey.
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 01/09/2016(UTC)
Offline Jason McCool  
#22 Posted : 01 September 2016 21:32:42(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 75
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
Chris, I suppose I may be that user developers hate, but I'm playing around with the plugin without knowing what I'm doing, modifying an old worksheet for designing beam web stiffeners, referencing back to the SQLite tutorial for syntax and whatnot, to learn to use SQL as I go. I'm loving this so far! But I did mess up a Select statement, and everything froze up (graphically), although I could still save the worksheet. So I did a save as, closed it, reopened it, but now the eval(SQLiteQuery(DB,...) statement throws an error that it can't open the database file. I thought maybe the file got corrupted, but I can open it through that SQLite DB Browser Portable you linked to, so it appears to still be a valid database file. Any suggestions?
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline ChrisBietz  
#23 Posted : 01 September 2016 23:08:42(UTC)
ChrisBietz

Rank: Newbie

Groups: Registered
Joined: 23/08/2016(UTC)
Posts: 8
Man
United Kingdom
Location: Wymondham

Was thanked: 16 time(s) in 5 post(s)
Hey Jason, no worries, I appreciate each and any kind of feedback. The more I get the better can I hopefully make the plugin. Glad to hear that the plugin is of use to you.
Off-hand I'm not sure what could have caused this problem. I'd be however happy to have a look, if you would upload or PM me your sheet and database. Likewise I'd be happy to help you with any questions you may have regarding SQLite and usage of the SQLite plugin in SMath (to the best of my abilities). I'll send you one of my Inductor Calculation sheets for reference (Sorry, Electronics Engineer myself Good )

Edited by user 01 September 2016 23:18:28(UTC)  | Reason: Not specified

Offline Jason McCool  
#24 Posted : 02 September 2016 00:01:28(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 75
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
To add to my initial report, I did recopy over the db file from your zip file to my worksheet directory in case it was corrupted. But then I noticed that your sample worksheet in its own folder with its own untouched copy of the db file also gave the same error, so I thought maybe the plugin itself had an issue rather than the data file. I re-downloaded your 2 zip files, deleted the plugin from the SMath directory, and re-extracted to that directory. Then when I reopened your AISC example sheet, it was able to open the database file and pull the W44 beam depth as it before. Then I opened my own worksheet that had the initial problem, and SMath gave the same unable to open database error. Then opening your example file again produced the same error. I changed the name of the db file in the sample folder, and the reference to it in the same sample worksheet, and it worked. So then I did the same thing to the db file I had copied over to my calcs folder, and the file reference in the worksheet I was editing, and it started working again. So it seems to have been something related to the database name. Maybe changing the name forced a connection to reset that somehow became invalid but persistent when it froze up earlier? It seems like something is persisting from 1 worksheet to the other. If I open my worksheet with DB:="AISC Shape Lookup2.db" and then your sample with DB:="AISC Shape Lookup1.db", with the appropriately named db file in each worksheet's respective folder, your sample worksheet stops working. If I change the DB assignment to the "2" file, it works again. And now neither one works regardless of what I change it to. I'm out of ideas there.

Electronics? I would've guessed structural using AISC beam tables as examples Good
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline Jason McCool  
#25 Posted : 06 September 2016 22:45:12(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 75
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
Hi Chris. The inductor calc wouldn't work now either, so I thought I would try deleting the plugin and reinstalling through the extension manager to see if that cleared up any of the issues. Now I'm getting the following error. See the (hopefully) attached screenshots. It appears to be a bad GUID judging from the all-zeroes in the error message. The plugins folders appears to have a valid GUID for it though. The error also says that it should be installed and enabled, but when I go to Local Storage on the Extensions Manager, SMath appears to be recognizing it as such (enable is grayed out, disable and delete are active). Hope that helps.

Edit: Never mind - I see the post about problems uploading to Extensions Manager now. Whistle
2016-09-06_SQLite_Plugin_Error.png2016-09-06_SQLite_Plugin_Status.png2016-09-06_SqLite_Plugin_Folder_GUID.png

Edited by user 06 September 2016 22:53:10(UTC)  | Reason: missed previous posts

Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline Andrey Ivashov  
#26 Posted : 06 September 2016 23:42:05(UTC)
Andrey Ivashov


Rank: Administration

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

Was thanked: 1978 time(s) in 666 post(s)
Hello.

SQLLite Plug-in can be installed using Extensions Manager only starting from SMath Studio 0.98.6089. Previous versions of the program cannot install this plug-in correctly. I would highly recommend you to upgrade.

BTW: If you see error message with "GUID: 00000000-0000-..." then you are using old version of the plug-in. Please delete it and install latest one using Extensions Manager with SMath Studio 0.98.6089 or higher.

Best regards.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 08/09/2016(UTC)
Offline Jason McCool  
#27 Posted : 07 September 2016 00:18:24(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 75
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
Originally Posted by: Andrey Ivashov Go to Quoted Post
Hello.

SQLLite Plug-in can be installed using Extensions Manager only starting from SMath Studio 0.98.6089. Previous versions of the program cannot install this plug-in correctly. I would highly recommend you to upgrade.

BTW: If you see error message with "GUID: 00000000-0000-..." then you are using old version of the plug-in. Please delete it and install latest one using Extensions Manager with SMath Studio 0.98.6089 or higher.

Best regards.


That's odd. I had already updated to 6089 first thing this morning. Last week, I had gotten the plugin to work doing the original manual extraction of Chris's zip file to the plugins directory, but then it had stopped working at one point, and it seemed like I could only get it to open a database file once after each re-install. Any subsequent attempts to open a worksheet with SQL statements would generate the error that it couldn't open the db file. So after updating SMath to 6089 this morning, I tried and none of the worksheets, mine or Chris's, would open without errors, so I used the delete and install functions in Extensions Manager (6089) to delete the SQLite plugin and reinstall it. It appears to successfully install it, although now I get the error messages previously posted. But just to confirm, I just now deleted and installed using Extensions Manager, in 6089 (as confirmed in the screenshot below), and still get the same error message with the all-zero GUID. Umnik
2016-09-06_SMath6089.png
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline Davide Carpi  
#28 Posted : 07 September 2016 00:38:35(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1323 time(s) in 873 post(s)
Try this:

  1. Have the plugin installed from the Extensions Manager
  2. Open the worksheets created with old versions of the plugin
  3. Skip the error messages
  4. Recalculate
  5. Save & close the worksheet (program restart not required)
  6. Open it again

Edited by user 07 September 2016 00:41:13(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
thanks 1 user thanked Davide Carpi for this useful post.
on 07/09/2016(UTC)
Offline Jason McCool  
#29 Posted : 07 September 2016 00:53:58(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 75
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
Thanks, Davide. That does eliminate the zero GUID error on subsequent opens of those worksheets, Good although the "Unable to open database file" error is still present.Sad Recalculating, saving and reopening, changing variable names, nothing I've tried seems to help.
Jason

2016-09-06_DB_Open_Error.png
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline Davide Carpi  
#30 Posted : 07 September 2016 01:15:24(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: Jason McCool Go to Quoted Post
Thanks, Davide. That does eliminate the zero GUID error on subsequent opens of those worksheets, Good

That's because worksheets were created with a plugin without a GUID; default null GUID was used, hence the error message.


Originally Posted by: Jason McCool Go to Quoted Post
although the "Unable to open database file" error is still present.Sad Recalculating, saving and reopening, changing variable names, nothing I've tried seems to help.

Your example works perfectly for me (even without eval(...)). Please attach a worksheet and the database, so we can try to understand where might be the issue. Good

Edited by user 07 September 2016 01:16:57(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
Offline Andrey Ivashov  
#31 Posted : 07 September 2016 01:22:41(UTC)
Andrey Ivashov


Rank: Administration

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

Was thanked: 1978 time(s) in 666 post(s)
Taking in account error message returned by SQLLite plug-in it looks like latest version of the plug-in installed correctly, but for some reason it cannot find a file (or similar issue, like the file cannot be opened for read operation).

Please try to specify absolute path to the *.db file and ensure this file not used by any other application. If it will help, then it seems there is a bug in the plug-in (may be not, but it is just a first impression).
thanks 1 user thanked Andrey Ivashov for this useful post.
on 07/09/2016(UTC)
Offline Jason McCool  
#32 Posted : 07 September 2016 16:05:27(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 75
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
Yep! Absolute path worked. Thank you, Andrey! I had assumed that since the original example worksheet didn't give a full path name to the database file, that it was a relative path based on the database file being in the same folder as the worksheet. I had originally extracted Chris's example zip file to my desktop, then copied the db file over to a Dropbox folder I keep all my SMath worksheets in. I thought I'd been working with the db file in that projects folder, but it was apparently still referencing back to the one in the extracted zip file on my desktop. Changing the name back to match that made my worksheet start working again. Then I added the full folder path to the DB:="..." assignment in that and another test worksheet, and it could correctly open each database file. I'm not sure how the link to the original extract folder was persisting, but specifying the full path seems to eliminate that issue. Yahoo

2016-09-07_Orig_DB_path_name.png2016-09-07_Orig_SQLite_Ex_File_List.png
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline mikekaganski  
#33 Posted : 07 September 2016 18:27:16(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Please note that if you double-click the .sm, then SMath opens with the directory where the .sm located as current path; so all subsequent relative paths will be searched under this directory. But if you start SMath from, say, desktop shortcut, and then open the .sm from it, then current directory will be that was specified in the shortcut. The same will happen if you opened SMath by double-clicking one .sm, (and its path is now current directory), and then from that SMath open another .sm from another directory: the second directory won't be current one.

So, using relative paths in SMath is error-prone. If SMath for each .sm would make its own current path as one where the file is, regardless of opening method, then it would be good. For now, I wouldn't advise anyone to use relative paths.
Best regards,
Mike Kaganski
thanks 4 users thanked mikekaganski for this useful post.
on 07/09/2016(UTC),  on 07/09/2016(UTC),  on 07/09/2016(UTC),  on 08/09/2016(UTC)
Offline Jason McCool  
#34 Posted : 07 September 2016 18:34:29(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 75
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
Good to know. Thanks! I typically use each of those methods of opening files interchangeably throughout the day, and especially the recent files menu list. Your suggestion sounds like a good way to ensure consistent behavior.
Jason
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline Davide Carpi  
#35 Posted : 07 September 2016 18:40:17(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: mikekaganski Go to Quoted Post
Please note that if you double-click the .sm, then SMath opens with the directory where the .sm located as current path; so all subsequent relative paths will be searched under this directory. But if you start SMath from, say, desktop shortcut, and then open the .sm from it, then current directory will be that was specified in the shortcut. The same will happen if you opened SMath by double-clicking one .sm, (and its path is now current directory), and then from that SMath open another .sm from another directory: the second directory won't be current one.

So, using relative paths in SMath is error-prone. If SMath for each .sm would make its own current path as one where the file is, regardless of opening method, then it would be good. For now, I wouldn't advise anyone to use relative paths.


This explains everything, thank you Mike Good

But this is even poor implementation in the plugin and can be solved easily (fix the same issue yesterday in my WriterRegion)


  1. Check if path is rooted (absolute); if yes go to step 3, otherwise go to step 2;
  2. If the path is relative, build an absolute path;
  3. Use the output path


Code:
string path = "whatever";
// internal checks: a filename is specified, etc, etc, ...
path = Environment.ExpandEnvironmentVariables(path);
if (!String.IsNullOrEmpty(context.FileName) && !Path.IsPathRooted(path))
   path = Path.Combine(Path.GetDirectoryName(context.FileName), path);
// use path

Edited by user 07 September 2016 18:52:14(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
thanks 1 user thanked Davide Carpi for this useful post.
on 08/09/2016(UTC)
Offline Andrey Ivashov  
#36 Posted : 07 September 2016 22:40:04(UTC)
Andrey Ivashov


Rank: Administration

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

Was thanked: 1978 time(s) in 666 post(s)
Originally Posted by: mikekaganski Go to Quoted Post
Please note that if you double-click the .sm, then SMath opens with the directory where the .sm located as current path; so all subsequent relative paths will be searched under this directory. But if you start SMath from, say, desktop shortcut, and then open the .sm from it, then current directory will be that was specified in the shortcut. The same will happen if you opened SMath by double-clicking one .sm, (and its path is now current directory), and then from that SMath open another .sm from another directory: the second directory won't be current one.

So, using relative paths in SMath is error-prone. If SMath for each .sm would make its own current path as one where the file is, regardless of opening method, then it would be good. For now, I wouldn't advise anyone to use relative paths.


Thank you, Mike!
Seems there is something I should fix asap Good
Offline ChrisBietz  
#37 Posted : 08 September 2016 20:18:00(UTC)
ChrisBietz

Rank: Newbie

Groups: Registered
Joined: 23/08/2016(UTC)
Posts: 8
Man
United Kingdom
Location: Wymondham

Was thanked: 16 time(s) in 5 post(s)
I have updated the plugin
with the following changes (link in initial post):
  • Made plugin available to download via extension manager
  • Changed the way the correct SQLite assemby (for x86 or x64) is loaded to allow installation from extension manager for SMath below 8069
  • Uploaded source code and example to SVN
  • Small changes to example file, added separate example file for older SMath versions
  • Fixed relative path as suggested by Davide


Thanks again for all the helpful tips, suggestions, discussion.
Please excuse the time this fix took, I was unfortunately tied up with work commitments.
Sorry for any problems that have occured in the meantime (e.g. the GUID 000... problem).
I suggest to delete whatever version of the SQLite plugin is currently installed and get a copy using the extension manager where possible and only install manually if necessary.

Originally Posted by: Andrey Ivashov Go to Quoted Post

SQLLite Plug-in can be installed using Extensions Manager only starting from SMath Studio 0.98.6089 Previous versions of the program cannot install this plug-in correctly.

This was the case at the time Andrey posted this helpful comment, I have now however changed the plugin to allow SMath versions lower than 0.98.6089 to install the plugin correctly.

Originally Posted by: Davide Carpi Go to Quoted Post

But this is even poor implementation in the plugin and can be solved easily (fix the same issue yesterday in my WriterRegion)
Code:
string path = "whatever";
// internal checks: a filename is specified, etc, etc, ...
path = Environment.ExpandEnvironmentVariables(path);
if (!String.IsNullOrEmpty(context.FileName) && !Path.IsPathRooted(path))
   path = Path.Combine(Path.GetDirectoryName(context.FileName), path);
// use path

Thanks for this code Davide, I have pretty much used it as is and it works nicely.

I have tried to move the SQLite plugin forwards to use the IPluginLowLevelEvaluationFast interface, based on what source code I could find within the SVN. Conversion from Terms seemed still necessary and I could not reliably measure runtime improvements and have for the sake of compatibility reverted to the standard IPluginLowLevelEvaluation. As soon as more info about using Entry is available and a new Stable SMath version is released I will try to implement IPluginLowLevelEvaluationFast.
thanks 4 users thanked ChrisBietz for this useful post.
on 08/09/2016(UTC),  on 08/09/2016(UTC),  on 09/09/2016(UTC),  on 01/06/2019(UTC)
Offline uni  
#38 Posted : 01 June 2019 15:32:49(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Suggestions for improving the code. Unfortunately, I could not build a working assembly, because the method used to replace the SQL assembly doesn't work for me (VS2013).

SQLitePlugin.pdf (32kb) downloaded 63 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
Offline uni  
#39 Posted : 06 August 2019 12:07:53(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. Refactored.

Example

Edited by user 17 September 2020 19:56:02(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 06/08/2019(UTC),  on 24/03/2020(UTC)
Offline avp  
#40 Posted : 17 September 2020 15:39:01(UTC)
avp


Rank: Member

Groups: Registered
Joined: 03/07/2017(UTC)
Posts: 10

Please replace
Code:
double num3 = (double) sqLiteDataReader[ordinal];
with
Code:
double num3 = Convert.ToDouble(sqLiteDataReader[ordinal]);
in the plugin code to avoid confusion. And rebuild this awesome plugin.
I fixed it myself in the public repository. Andrey Ivashov rebuilt the plugin.

Edited by user 17 September 2020 16:39:47(UTC)  | Reason: Not specified

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