Need some advice for my IT folks

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Need some advice for my IT folks

Post by teacherguy » Thu Jan 12, 2012 3:12 am

I have a music literacy app that I wrote to help my music students. The standalone runs fine on both Windows and OS X. I implemented a splash stack so that results can be saved over time. I've had students take the app home and have had no reported issues.

However this week I asked to have the program installed on one of our school's network drives so that students can access it on any of the computers in the school. Here I am seeing problems when trying to quit the program. The app clearly cannot write the changes properly and it hangs. So from reading the threads here I concluded we had a permissions problem. Yet my lead IT person tested the app after providing full permissions to the enclosing folder. No change. I sent her a custom build that commented out the "save this stack" and it worked fine. But of course I need it to be able to save.

Advice appreciated.

~Brian

spencer
Posts: 71
Joined: Mon May 09, 2011 3:01 pm

Re: Need some advice for my IT folks

Post by spencer » Thu Jan 12, 2012 12:46 pm

Sounds like a path problem.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Need some advice for my IT folks

Post by teacherguy » Thu Jan 12, 2012 6:12 pm

spencer wrote:Sounds like a path problem.
I've watched the enclosing folder during the quit process. It seems to create a duplicate of my main stack with a tilde sign in front of it, after that it stops responding. So it seems that the path is correct at least.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7392
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Need some advice for my IT folks

Post by jacque » Thu Jan 12, 2012 7:49 pm

The tilde-copy is a temporary copy that the engine makes when saving a stack. When the "save" command is executed, the temp copy is created as a backup, the original stack is saved, and if the save is successful the temp is deleted. If the temp copy is still there, the save didn't work and the tilde-copy is your backup. It's a data preservation fail-safe. You can toss out the original (which may or may not be corrupted,) rename the copy by removing the tilde, and it's your original stack once again.

What you are seeing shows that the save is failing at some point after making the copy. Apparently the engine can write to the folder, since it can create the copy, but check to see if the copy is the same size on disk as the original. Maybe it can't write the file completely. I often save stacks across a LAN and it works, so I'm not sure why yours isn't but you might get more info if you check the result after issuing the save command -- there might be an error code in there.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Need some advice for my IT folks

Post by sturgis » Thu Jan 12, 2012 8:49 pm

Hmm. Would you be willing to share a copy (linux version) with me to try some stuff? I ask for 2 reasons. A) I can always stand to learn more about music, and b) I can see if I can make it work on my linux box. If so i'll let you know what I discover.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Need some advice for my IT folks

Post by teacherguy » Thu Jan 12, 2012 9:10 pm

Thanks, here is what I found: I opened the app and used it for a few minutes. I set the enclosing folder right next to the stack so I could watch the save process. Upon quitting, the original stack (about 12 megs) got the tilde sign, and the new file appeared with just a few k in it. The interesting thing is that, even though my stack now said "Not Responding" I continued to watch the new file, and VERY slowly it was increasing in size, so I let it keep going. It did get up to the correct size after about two minutes, and then I got a popup from Windows telling me the program wasn't responding and basically a "force quit" button.

So, I opened the program, and sure enough my changes were there. So it is saving, I just figured it wasn't because of the "Not Responding" message, and the fact that it is taking an eternity to save. Any idea why that is?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Need some advice for my IT folks

Post by sturgis » Thu Jan 12, 2012 9:34 pm

teacherguy wrote:Thanks, here is what I found: I opened the app and used it for a few minutes. I set the enclosing folder right next to the stack so I could watch the save process. Upon quitting, the original stack (about 12 megs) got the tilde sign, and the new file appeared with just a few k in it. The interesting thing is that, even though my stack now said "Not Responding" I continued to watch the new file, and VERY slowly it was increasing in size, so I let it keep going. It did get up to the correct size after about two minutes, and then I got a popup from Windows telling me the program wasn't responding and basically a "force quit" button.

So, I opened the program, and sure enough my changes were there. So it is saving, I just figured it wasn't because of the "Not Responding" message, and the fact that it is taking an eternity to save. Any idea why that is?
Ah, you did say it was on a network share, not running from a linux box. Might do a quick test, create a 12 meg file on the local drive then copy it to the network folder and see how long it takes. (bipassing livecode for the test entirely, just a test of the network read/write speed) If it takes a similar amount of time, then you may have your culprit.

What kind of data are you saving? Since it sounds like this is a multi-user type of thing, are you saving state for each user, or what? I guess what i'm getting at is, perhaps using an sqlite back end or something of that nature might help. This way, you can use the database to save changes, state information, whatever, and keep it updated live during the session. This would bipass a 12 meg network write. (the stack loads into memory, runs locally, then when 'saved' the full 12 megs of the stack have to be written back across the network to the shared folder)

Edit: Another thought. If the users are running on their personal machines, is there any reason not to change your app so that a) it checks to see if this is a first run on that particular machine. If it is, copy the stack file to the users appdata folder (or whevever appropriate depending on os) then load the stack. On save, save it locally to the users system. This also avoids a big network write issue. If its NOT the first run and the stack file is available locally, open it up from the local machine and you're good to go.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Need some advice for my IT folks

Post by teacherguy » Thu Jan 12, 2012 9:43 pm

Yeah that's a great point. It's not anything even as elaborate as all that...I'm just essentially saving the scores for each level with the student's name. Really basic, I know I really shouldn't be saving the entire stack just to do that. Hm, and now I really see your point... if 15 kids on the network are all playing, how would it reconcile those scores across the machines.

I was only using the application locally in the past so this was never an issue. Don't have any experience with sql.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Need some advice for my IT folks

Post by sturgis » Thu Jan 12, 2012 9:58 pm

Sounds like there may be some concurrency issues also. If one kid does their thing and is trying to save while another kid is trying to save, one will overwrite the other (unless they each have their own copy of the stack.. at which point you'd have to have a way to pull the info out of each stack to reconcile)

While the sql method would probably not be too bad, but if nothing else you could implement some type of login scheme so that on close or save, each students scores could be saved to a file named based on who they are, session date, or whatever you need to do to avoid overwrites of data. Then you could make a simple additional stack that you use to collate all this stuff from the files.

With SQL, no collating necessary, but care would have to be taken since the same database could be open from multiple locations. I don't know enough about db access yet to direct you on that. Assuming multiple users can only write to their own data though, this might not be a big problem. (sqlite would work ok for this, but I think a mySql back end would be better because its designed for multiple users)

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Need some advice for my IT folks

Post by mwieder » Thu Jan 12, 2012 10:18 pm

Also sounds like a virus-checker might be coming into play here, especially on a system controlled by an IT department. You might disable that on your system and see if the network save works without it.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Need some advice for my IT folks

Post by sturgis » Thu Jan 12, 2012 10:21 pm

Oh, yep! Wouldn't have occurred to me any time this year, but you're right.
mwieder wrote:Also sounds like a virus-checker might be coming into play here, especially on a system controlled by an IT department. You might disable that on your system and see if the network save works without it.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Need some advice for my IT folks

Post by teacherguy » Thu Jan 12, 2012 11:48 pm

Hm, I'm starting to think that pushing scores to a google spreadsheet might make life a lot easier here. I would still need to be able to do some saving of preferences for the teacher who needs to set parameters for the game, but scoring could all be pushed to google.

Can anyone point me on a tutorial for saving/loading preferences files for standalones?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Need some advice for my IT folks

Post by mwieder » Thu Jan 12, 2012 11:55 pm

rule of thumb: don't save the stack, save and retrieve preferences to and from a text file. It's pretty easy:

Code: Select all

put tPreferences into url ("file:" & tPathToFile)
and

Code: Select all

put url ("file:" & tPathToFile) into tPreferences
parse tPreferences to taste.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Need some advice for my IT folks

Post by teacherguy » Fri Jan 13, 2012 2:18 am

Let's say I'm saving a preference like the minimum time allowed for a student to complete x questions. How would I store something like that into the text file? Put tMinTime into line x of tPreferences.... along those lines? And then I keep a list for myself of which line in the document coincides to which pref?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Need some advice for my IT folks

Post by sturgis » Fri Jan 13, 2012 2:29 am

Could do that, or do it as pairs varname:value or even as an xml tree. Or, if you have all your preferences and stuff in an array you can use arrayencode() and arraydecode() to make things easier.

Post Reply