Re: Sorting by item ... of each and item ... of each
I believe this works: on mouseUp put fld 1 into tList sort lines of tList by _sortKey(each) put tList into fld 2 end mouseUp function _sortKey pLine set the itemDel to ";" return item 3 of pLine & ";" & item 2 of pLine end _sortKey I realize it isn't as simple as you were looking for, but at least it avoids doing 2 separate sorts. Phil Davis On 9/2/23 6:03 PM, matthias rebbe via use-livecode wrote: Of course my "not working" sort code look like this set the itemdelimiter to ";" sort lines of tList numeric by item 3 of each and item 2 of each. Am 03.09.2023 um 02:59 schriebmatthias_livecode_150...@m-r-d.de: Maybe i do not see the forest for the trees I have a tab delimited list which i want to sort. I am using this code to sort it by item 3 and item 2 set the itemdelimiter to tab sort lines of tList numeric by item 3 of each and item 2 of each. But that code does not sort as i expected it. Column 2 is not sorted correctly. The following list is the result. 113254;8420;3016365 113254;8423;3016365 113254;8422;3016365 113254;8420;3016365 113254;8420;3016365 113254;8420;3016365 113254;8421;3016365 203212;8420;3016366 203212;8423;3016366 203212;8422;3016366 203212;8420;3016366 My expectation for example was that for value 3016365 in column 3 the values in Col 2 would be sorted like this 113254;8423;3016365 113254;8422;3016365 113254;8421;3016365 113254;8420;3016365 113254;8420;3016365 113254;8420;3016365 113254;8420;3016365 Tried also'by item 2 of each and item 3 of each', but the sort result is the same? Am i missing something? Regards, Matthias ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Am I using the best mail client?
Thunderbird for me as well, for all the reasons Jacque stated. Phil Davis On 5/11/23 10:27 AM, J. Landman Gay via use-livecode wrote: I use Thunderbird. Like Matthias, I set up a rule to move list mail into a subfolder where I can sort by date, author,, subject, or any other attribute. It supportsl threading. There are several layouts you can use depending on how you like to organize and view mail. You can color-code emails automatically on arrival, or manually if you want to mark one for special reasons. You can drag-drop mail from one folder to another even across accounts. There are a lot of options so you can customize it however you want. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On May 11, 2023 11:33:31 AM Craig Newman via use-livecode wrote: Since I got real help here, and not on the forum(hmph), I am wondering if the eMail client I am using is one reason I do not prefer this venue. I am using the native Mac “Mail’ client. Are there much better ones? Craig ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Sockets (again)
Bob - Don't use EOF. It's broken since forever ago. I've done both of the following methods with success: -- either -- End your data stream with a CR, and then on the receiving end "read from socket XYZ for 1 line". This assumes that the data stream itself doesn't contain any CRs. I normally base64-encode the data stream, then replace CR with empty in the encoded string. This doesn't interfere with base64Decoding on the receiving end - it'll still work fine. -- or -- Make line 1 of your data stream an integer that is the number of bytes in line 2 of your data stream Make line 2 of your data stream the data you want to send Then on the receiving end, do a two-step: - read from socket XYZ for 1 line - put it into tDataLength - read from socket XYZ for tDataLength bytes That's all I got :-) Phil Davis On 4/4/23 1:47 PM, Bob Sneidar via use-livecode wrote: I have sockets working in my File Server Agent, but only using non-blocking calls, that is using "with message". Removing the "with message" bit does not return any response from the server agent. For instance I send a payload using write payload to socket tSocket with message "messageReceived" The messageReceived handler gets triggered, and I can then read from socket tSocket until EOF -- or other delimiter it will then contain the response from the File Server Agent. If however I use write payload to socket tSocket -- blocking read from socket tSocket until EOF -- or some other delimiter doesn't matter the call times out and nothing ends up in the it or result variables. I can (and have) made the non-blocking method work, but that means I have to send all the files I want to transfer all at once, because if I send them one at a time, I need to know if the last transfer succeeded before continuing. Does anyone have an example of a blocking socket server? The example in Livecode Lessons really only focuses on non-blocking calls. Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: running platform-native by default
Thanks Mark. Last night I discovered I could do that, but it revealed a well-hidden bug in one app when launched on either platform, so for now I may just deliver 2 versions of the app. Thank you! Phil On 3/24/23 1:10 AM, Mark Waddingham via use-livecode wrote: On 2023-03-22 19:45, Phil Davis via use-livecode wrote: I'm using LC 9.6.8 to build some macOS Intel/Silicon ("dual-native") apps. Upon first launch of these apps on my Silicon test machine, I always get the OS dialog that says "To open '', you need to install Rosetta. Do you want to install it now?" I always click the "Not Now" button because I want the apps to run native by default, wherever they are running. (I'm avoiding installing Rosetta on that machine.) I discovered I can avoid getting the Rosetta dialog this way: After installation and before first launch, do a "get info" on the installed app. In the macOS Info dialog, check AND uncheck the "Open using Rosetta" checkbox. Close the dialog and now the app will launch in native (Silicon) mode. MY QUESTION: Is there a way to pre-set my apps so their first launch uses the engine that's native to the platform they're installed on? It seems like there ought to be a way. I can't expect all my users to jump through this manual hoop - and it just looks unprofessional to me. Yes - you just need to tweak the plist - there's an LSArchitecturePriority (or similar!) entry which determines the order the slices in the executable are considered. We made x86-64 the primary architecture in 9.6.8 to ensure by default people didn't potentially use an architecture (i.e. arm64) which hadn't been well tested (i.e. making it optin). In 9.6.9-rc-3 (which is, hopefully, imminent!), we'll be removing the experimental tag from the arm64 slice and make the priority the default - i.e. on arm macs LC and its standalones will run using the native (arm64) architecture by default. Warmest Regards, Mark. -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
running platform-native by default
I'm using LC 9.6.8 to build some macOS Intel/Silicon ("dual-native") apps. Upon first launch of these apps on my Silicon test machine, I always get the OS dialog that says "To open '', you need to install Rosetta. Do you want to install it now?" I always click the "Not Now" button because I want the apps to run native by default, wherever they are running. (I'm avoiding installing Rosetta on that machine.) I discovered I can avoid getting the Rosetta dialog this way: After installation and before first launch, do a "get info" on the installed app. In the macOS Info dialog, check AND uncheck the "Open using Rosetta" checkbox. Close the dialog and now the app will launch in native (Silicon) mode. MY QUESTION: Is there a way to pre-set my apps so their first launch uses the engine that's native to the platform they're installed on? It seems like there ought to be a way. I can't expect all my users to jump through this manual hoop - and it just looks unprofessional to me. Maybe there's an AppleScript I can run after install and before first launch. But it would need to run automatically at the end of the install process, which would complicate my installer-building process - I'm currently distributing on DMGs. Your thoughts? -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Training the AI to write better LiveCode
+1 Spot-on Bob! On 1/23/23 4:24 PM, Bob Sneidar via use-livecode wrote: The real problem with information is not the information itself, but that we pretty much all process information in the context of our chosen world view. Because of this, freedom of speech and open discourse MUST be preserved, because my life's experience is that if the "good guys" and the "bad guys" want to control what information is available, the bad guys*ALWAYS* win. They are unhampered by such inconveniences such as truth and morality. Bob S -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: RANT (Mild): revZIP library
Hi Sean, I wonder if you could open the unzipper as a process in LC. Then your app could probably receive realtime updates from it and let the user what's going on. I've done that before but it was a long time ago, so I have forgotten more than I remember. HTH - Phil Davis On 10/11/22 1:34 PM, Pi Digital via use-livecode wrote: Hi Paul I got affected by that and other win revzip issues too. I ended up parsing them through a shell script and using windows built in unzipper. Of course the downfall with that is a lack of feedback on progress which, for large files like this, requires a great deal of time to process and feedback is almost a necessity. I made the shell visible just so that the customer was aware of its progress. It was ugly in terms of UIX but it got us out of a short term hole. I hope you can get a more long term solution. I’m sure you’re capable of building the shell script but let us know if not. All the best Sean On 11 Oct 2022, at 20:37, Paul Dupuis via use-livecode wrote: We just got bit by a 4+ year old bug (See https://quality.livecode.com/show_bug.cgi?id=20859) where the revZIP library on macOS can create and read ZIP archives over 2GB, BUT the Windows library can not. We distribute our desktop research application as "cross-platform" for macOS and Windows and just had a researcher on macOS build a "package" (our term for a custom ZIP archive our LiveCode app can make of the researcher's data files) over 2GB and sent to their Window colleague who can NOT open it. Yes, we walked the Windows researcher through unzipping the archive with WinZIP and accessing all the data files manually, but so much for the "elegance" of our app being cross-platform due to using LiveCode. Now, do we add code to check the size and prohibit macOS users from creating "packages" over 2GB so if they are sent to a Windows researcher, they can be opened OR do we just warn the Windows researcher if the archive is over 2GB that they will not be able to open it? Neither is a good option. This just makes us look bad. Paul Dupuis Researchware ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Images and arrays...
Hi Paul, sorry I'm so late to the party. I think the best you can do is to capture & then reuse all the properties of the target image. I created a stack and imported an image. Then I ran this button script to make an exact replica of image 1. It worked: on mouseUp put the properties of img 1 into tPropsA -- could be saved for later use lock screen create image set the properties of img 2 to tPropsA set the left of img 2 to the right of img 1 + 30 unlock screen end mouseUp Hope this helps - Phil Davis On 7/5/22 2:20 PM, Paul Dupuis via use-livecode wrote: I am drawing a blank: If I have the following code: export snapshot from rect tRect of player "mediaConvert" of stack "libHrAPI" to tImage as PNG put tImage into pRefArray[tRef] The actual image (not a reference, such as a long ID) is placed in the tRefArray[tRef] array element However, if I have a variable tImageID that contains a reference to an image such as image id 10328 of card id 10001 of stack "X" How do I get that actual Image stored in the array? put tImageID into pRefArray[tRef] -- results in the array element storing the long ID put (tImageID) into pRefArray[tRef] -- also results in the array element storing the long ID. I thought the () might for the long ID to be evaluated to an actual image ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Is LC encryption different for Mac than for Windows??
I don't know about newer LC versions, but some older ones don't do "read from socket until EOF" correctly. Because of that, I added a data header containing the length of the data in bytes. On the receiving end, something like this happens: read from socket for 1 line put it into tLength read from socket for tLength put it into tData close socket I add error-checking of course. HTH - Phil On 7/1/22 6:10 PM, Phil Davis via use-livecode wrote: I was about to suggest that - you beat me to it. My client/server apps use base64 encode/decode as the final "envelope" for the data before network transfer. But I have LC on both ends of the transfer, and you may not. But ultimately it shouldn't matter. Phil Davis On 7/1/22 6:05 PM, Bob Sneidar via use-livecode wrote: Okay so I base64Encoded the encrypted string before sending over the wire, and base64Decoded on the receiving end. Same thing coming back. I am still getting the error. It's not a problem with sending data over the wire. Bob S On Jul 1, 2022, at 17:55 , Bob Sneidar via use-livecode wrote: That's supposed to be Binary Encoding On Jul 1, 2022, at 17:08 , Bob Sneidar via use-livecode wrote: Also when I was running it on my Mac, the client in the server we’re running on the same Macintosh. On the windows machine however I’m going over the wire. Should I buy Ineri encoded or something? Sent from my iPhone ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Is LC encryption different for Mac than for Windows??
I was about to suggest that - you beat me to it. My client/server apps use base64 encode/decode as the final "envelope" for the data before network transfer. But I have LC on both ends of the transfer, and you may not. But ultimately it shouldn't matter. Phil Davis On 7/1/22 6:05 PM, Bob Sneidar via use-livecode wrote: Okay so I base64Encoded the encrypted string before sending over the wire, and base64Decoded on the receiving end. Same thing coming back. I am still getting the error. It's not a problem with sending data over the wire. Bob S On Jul 1, 2022, at 17:55 , Bob Sneidar via use-livecode wrote: That's supposed to be Binary Encoding On Jul 1, 2022, at 17:08 , Bob Sneidar via use-livecode wrote: Also when I was running it on my Mac, the client in the server we’re running on the same Macintosh. On the windows machine however I’m going over the wire. Should I buy Ineri encoded or something? Sent from my iPhone ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Is Anyone on the list still using macOS 10.11?
Hi Matthias, If you need another tester, one of my machines is an early 2009 Core 2 Duo mini running 10.10.5. Phil Davis On 6/27/22 5:26 AM, matthias rebbe via use-livecode wrote: Hi, is there anyone on the list still using macOS 10.10 and would be willing to test 2 or 3 sample apps for me. The apps are just with one answer dialog. There seems to be a problem with standalones under macOS 10.10 that were code signed with a Mac with Apple cpu (M1/M2). The results of the testing would me help to enhance my LC Notarizing lesson. Regards, Matthias ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Would anyone miss convertOctals?
I was thinking along those lines as well. Heck, I just saw my octalmologist last week. Phil Davis On 6/10/22 8:16 AM, Bob Sneidar via use-livecode wrote: So it has nothing to do with eye surgery?? Dang. I thought I was going to get a prize or something. Bob S On Jun 10, 2022, at 24:45 , Mark Waddingham via use-livecode wrote: Given the responses so far, it looks to me like convertOctals is an exceptionally rarely used feature (the number of years of LC experience amongst those who have responded is in excess of two centuries, and >80% of the respondents didn't know what the property was). ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Limit on the number of parameters?
In LC 9.6.7, this works in a button script: on mouseUp tryThis "1", "2", "3", "4", "5", "66", "777", "", "9", "10" end mouseUp command tryThis put the params -- the handler name and all 10 params are there end tryThis I often stuff lots of data items into an array and use the array as a param. For me, that makes life easier. YMMV. Phil Davis On 6/6/22 11:45 AM, Bob Sneidar via use-livecode wrote: Is the number of parameters passed to a custom handler limited to 4? I do not seem to be getting a 5th parameter to pass to a function I use. Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Decrypting (and encrypting) Large files
On 5/10/22 12:35 PM, Richard Gaskin via use-livecode wrote: Mark Clark wrote: > Wondering if anyone has used LiveCode for encrypting-decrypting large > files? ... > I’m thinking about using LC for decrypting zip compressed log files > that can be multiple gigabytes in size. I’d like to use just LC vs. > resorting to shell if possible. What is behind the preference to roll your own rather than call existing purpose-built command-line tools from LC with shell()? I like this option. You could use shell("openssl ") to encrypt any size file. Also it may be possible to run 'openssl' as a process, by which (I believe) you could make it non blocking, running in the background. (I haven't tried opening 'openssl' as a process, just speculating here.) Phil Davis Your chunking described in your latest post seems the way to go, AFAIK pretty much how other tools would handle it. Another option: if you're in an environment where even log files require strong encryption, could you pipe log data to a separate secured log server instead? -- Phil Davis (503) 307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to extract a video clip...
Hi Paul, Your app doesn't have to install ffmpeg on the user's system - your app can run it from where it resides in your app's bundle. (Just reference it in your command line using its full path, not just 'ffmpeg'.) Phil Davis On 3/19/22 12:18 PM, Paul Dupuis via use-livecode wrote: On 3/19/2022 2:55 PM, Matthias Rebbe via use-livecode wrote: You could use ffmpeg for this. Here‘s a post where it is described how to do it https://superuser.com/questions/377343/cut-part-from-video-file-from-start-position-to-end-position-with-ffmpeg I have (and still am) considering ffmpeg. It was what I was alluding to with the mention of a command line utility called by shell() in my original post. To bundle the macOS (~35mb) and Windows (~77mb) adds that size (or that compressed) to my Standalone, so my app can install it on the users system (I have the sort of computer novice customers that you do NOT want to ask to download additional software of). That's not too bad a size increase as my App sits at about 200-230mb currently. Still, I asked the USE-LIST as you never know whether some one out there has made a widget that could just be part of the standalone app or someone knows of a clever technique or a smaller utility Thank you. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Speed up a slow loop
Jacque - Did it ever work as expected, or has it always behaved this way on all devices? (If it ever did work right, I guess that points to a change that happened outside your code.) Phil Davis On 3/2/22 4:35 PM, J. Landman Gay via use-livecode wrote: On 3/2/22 5:12 PM, Devin Asay via use-livecode wrote: Have you tried put the keys of sDictFile into tCorrWdList repeat for each line I in pList if I is among the lines of tCorrWdList then put I & cr after tCheckedList else put I & cr after tNonWords end if end repeat Yeah. No change. But I do appreciate the reply. I've been trying to figure this out for 2 days. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: RIP David Boggs
The quote, for those struggling with browsers and paywalls. I was able to see it in a Tor browser: Before becoming the dominant networking protocol, Ethernet was challenged by several other technologies. In the early 1980s, Mr. Metcalfe said, when Mr. Boggs took the stage at a California computing conference, at the San Jose Convention Center, to discuss the future of networking, a rival technologist questioned the mathematical theory behind Ethernet, telling Mr. Boggs that it would never work with large numbers of machines. His response was unequivocal. “Seems Ethernet does not work in theory,” he said, “only in practice.” https://www.nytimesn7cgmftshazwhfgzm37qxb44r64ytbb2dj3x62d2lljsciiyd.onion/2022/02/28/technology/david-boggs-dead.html A keeper indeed. Phil Davis On 3/1/22 10:31 AM, Mark Wieder via use-livecode wrote: On 3/1/22 10:26, Stephen Barncard via use-livecode wrote: Paywall Opened without a paywall for me. That last quote is a keeper. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Simple? DG question
Sean, you hit the nail on the head! Thank you! After updating the 'answer' field, I added this code: -- update the DG internal array put fld "answer" of me into tDataA["answer"] put fld "question" of me into tDataA["question"] set the dgDataOfIndex [ the dgIndex of me ] of the dgControl of me to tDataA Now it works perfectly. You are the MAN!!! :-) Phil On 2/15/22 3:40 PM, Pi Digital via use-livecode wrote: When the user clicks on the toggle, do you have script that is overwriting the dgData or dgText and then invoking a redraw of the form? Or are you only changing the state of the graphic? Ideally you want to change the data and allow it to redraw the grid again. I’m coding the same myself at this very moment for a project I’m on where I want layers to be made visible and invisible. I’m allowing the user to mouseUp on an SVG widget with the ‘eye open’ iconPresetName which then calls a handler with the layer number and the target (which is the ‘visibility’ widget) which adjusts the data for the grid and rewrites to it by using ‘set the dgDataOfIndex[pLayerNum] to pVisible' or something like it. Once all the handlers are complete it redraws the grid with the updated visibility icon. Does that help? Sean Cole Pi Digital Productions Ltd eMail Ts & Cs On 15 Feb 2022, at 22:03, Phil Davis via use-livecode wrote: Hi folks, I have a 'form' Data Grid where each line's data objects are: - a 'question' text field whose value is set once and never changed. - an 'answer' text field whose value is set by the user's interaction with a 2-state 'answer' group. When the user clicks/taps the 2-state 'answer' group, its visual state changes to acknowledge the tap, and its new state (true or false) is put into the 'answer' text field. I have verified that this part works, and the toggle object is setting the value of the 'answer' text field to reflect the visual state of the toggle object. My problem: For some reason, the dgText and dgData of the data grid only contain 'false' as the answer values from every line in the DG, regardless of the toggle settings (and therefore the text values in the 'answer' fields). Like this: falseFever above 100°F falseUnexplained body aches or pain falseCoughing falseSore throat falseChills What am I missing? Thanks for any insight you can offer. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Simple? DG question
Hi folks, I have a 'form' Data Grid where each line's data objects are: - a 'question' text field whose value is set once and never changed. - an 'answer' text field whose value is set by the user's interaction with a 2-state 'answer' group. When the user clicks/taps the 2-state 'answer' group, its visual state changes to acknowledge the tap, and its new state (true or false) is put into the 'answer' text field. I have verified that this part works, and the toggle object is setting the value of the 'answer' text field to reflect the visual state of the toggle object. My problem: For some reason, the dgText and dgData of the data grid only contain 'false' as the answer values from every line in the DG, regardless of the toggle settings (and therefore the text values in the 'answer' fields). Like this: false Fever above 100°F false Unexplained body aches or pain false Coughing false Sore throat false Chills What am I missing? Thanks for any insight you can offer. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Mac Multiple Monitor Menubar Management
Actually 'the working screenRects' returns that info for all screens. Maybe that could work for you. Phil On 1/23/22 10:21 PM, Phil Davis via use-livecode wrote: Hi Mike, Would this give you what you need? function menubarHeight return item 2 of the working screenRect end menubarHeight Phil Davis On 1/23/22 7:39 PM, Mike Kerner via use-livecode wrote: Other than using windowBoundingRect, is there any way to compute the menubar height? The 2021 MBP's have changed the height of the menubar to accommodate the notch. Generally it's 42 pixels on the new MBP, except when it's something else, especially on secondary monitors (e.g. I've seen it at 50 px in one case). I want to constrain the movement of a window to keep the user from dragging it under the menubar. The code I have works great, until you add monitor 2. screenRects (plural) tells you what the rect is for the second window, but it doesn't take the menubar into account. I could just assume it's the same height as the menubar on monitor 1, but that assumes that the menubar is present on monitor 2, as well. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Mac Multiple Monitor Menubar Management
Hi Mike, Would this give you what you need? function menubarHeight return item 2 of the working screenRect end menubarHeight Phil Davis On 1/23/22 7:39 PM, Mike Kerner via use-livecode wrote: Other than using windowBoundingRect, is there any way to compute the menubar height? The 2021 MBP's have changed the height of the menubar to accommodate the notch. Generally it's 42 pixels on the new MBP, except when it's something else, especially on secondary monitors (e.g. I've seen it at 50 px in one case). I want to constrain the movement of a window to keep the user from dragging it under the menubar. The code I have works great, until you add monitor 2. screenRects (plural) tells you what the rect is for the second window, but it doesn't take the menubar into account. I could just assume it's the same height as the menubar on monitor 1, but that assumes that the menubar is present on monitor 2, as well. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Rounding in LiveCode vs Excel
Will using "statround()" instead of "round()" give you an Excel-comparable outcome? Phil Davis On 1/9/22 12:49 PM, Andreas Bergendal via use-livecode wrote: Hi all, TLDR; In LC: round(0.5,0) = 1 (Excel agrees) round(5,-1) = 0 (Excel disagrees and makes that 10!) I agree with Excel, I want the latter rounded to 10, not 0. Is LC doing it ’wrong’ and if so, why? Long version: I’m building software for a client that will do some calculations that are currently done in Excel. They want most amounts rounded off by hundred, so e.g. 1049 is rounded to 1000 and 1050 is rounded to 1100 etc. In Excel they would use this formula structure: ROUND(1050/100;0)*100 for which Excel returns 1100. I pointed out that ROUND(1050;-2) would give the same result, which they were unaware of. In Excel it does. So, I thought I’d be smart and use the shorter form in LiveCode: round(1050,-2) Astonishingly though, for that LiveCode returns 1000. While round(1050/100,0)*100 returns 1100 also in LiveCode, which is what we want. So I ended up having to use the cumbersome, long version in LiveCode to get what Excel gives in both versions. Is LiveCode (or Excel) doing it ’wrong’, or what is going on? Why does LiveCode round decimals with one logic and integers with another? /Andreas ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: New user
Welcome to the list, Alex! There are people here who are a LOT more familiar with Windows <-> device communication than I am, but I can at least ask questions. Are you familiar with the "open driver" command and "serialControlString" property? They might give you some of what you need. I confess I haven't worked in a Windows environment in many years, so what I used to know may now be obsolete. Ahh, technology! Best regards - Phil Davis On 12/20/21 8:33 PM, Alex Hughson via use-livecode wrote: Hello all. I am a beginner user of LiveCode. I’ve managed to work my way through a project which I think I can complete. However the project has to be able to communicate with an I/O board (Numato 16 channel USB GPIO Module for example) from a Windows Standalone application. I have not been able to find any guidance or samples for how to do this. This has led me to wonder if it is even possible to creat some kind of serial communication using LC or whether I should start over with a different platform. I am doing the LC work using a Mac. Any help or advice would be much appreciated. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Server directory of a running script
Also, maybe try "the filename of me". It seems like that should work, though I could be wrong. Phil Davis On 11/12/21 2:46 AM, jbv via use-livecode wrote: Great ! Thank you. Le 2021-11-12 05:20, Ralf Bitter via use-livecode a écrit : You might try $_SERVER["PATH_TRANSLATED"] Ralf ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: [OT] Multiple macOS recommendation sought
Hi Paul, Several years ago - 6-8-10 years ago? Not sure when - I left VMs behind in favor of minimally-configured actual hardware. I have a couple of Windows laptops but almost never use them now. My main development world consists of 4 Mac minis of various ages (all Intel or M1) and a couple of 2015 MBP laptops (and 2 iPads). Each machine has an external drive used by Time Machine, so I can restore my work as needed. I use Screen Sharing to manage things on multiple computers from a single keyboard/display/mouse and it works great for my purposes. I confess, I don't normally reinstall the OSes except for upgrades to the next version if needed (e.g. High Sierra to Mojave); I just keep them current with Apple updates and have never had a dev issue that damaged the OS. Obviously my setup doesn't cover every macOS version, but my selected hardware+OS combos have been very adequate for my needs. And for me, it helps to have a LAN whose physical and conceptual topologies are the same. It helps clarify problem sources in a client/server system I maintain. Hope this helps - Phil Davis On 10/26/21 2:08 PM, Paul Dupuis via use-livecode wrote: A problem I have struggled with for decades is software testing on the various versions of operating systems our software deploys on. For testing on Windows, we use Virtualbox with Virtual Machines (VMs) for Windows 7, Windows 8.1, and Windows 10 (we have yet to try to build a Windows 11 VM) For macOS we have tried a multi-boot system, a mac Mini with hard disks partitions to boot to OSX 10.9, 10.10, 10.11, 10.12, 10.13, and 10.14 (Mojave). We tried a partition for 10.15 Catalina, but were were already experience problems switching between boot partitions where the Mini would forget what Startup disk it should boot from. When we added Catalina, the problem became worse, trying to go from Catalina to an older OS on reboot or vice versa would fail. So we tried a Mojave (10.14) laptop with Virtualbox and build a Catalina VM. This worked well for Catalina testing. We like VMs for the ability to reset to a snapshot or to clone them. We added a Big Sur VM, but playing video does not work in the VM and Virtualbox's latest release has not fixed this and macOS VMs are not really supported, even on mac hardware. We just tried a Monterey VM and it is unstable. It will crash and reboot after a random amount of time. Some sort of virtual machine is very appealing because of the ability to restore the machine to a snapshot after testing or to clone it. If testing messes something up, you can always get back to a known state without rebuilding a computer. What have other people's experiences been? Does anyone have a more stable, easier solution? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Whatever happened to on-rev?
And yet our individual subdomains are still up and running: http://phildavis.on-rev.com/ Phil Davis On 8/19/21 4:50 PM, Bob Sneidar via use-livecode wrote: > Well I'll be Pavlov's Lapdog! So it is! > > Bob S > > >> On Aug 19, 2021, at 16:43 , Mark Wieder via use-livecode >> wrote: >> >> ? >> looks like it bit the dust. >> >> http://on-rev.com/ >> >> -- >> Mark Wieder >> ahsoftw...@gmail.com >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Need to populate array into datagrid
Hi Skip, First, make sure your array uses the format required by the datagrid. It should be a numeric-indexed array, where each key (index) represents a DG row (line), with that key's subkeys representing the DG columns of the row. Then: set the dgData of grp "my grid" to tMyDataA That's it! It might be helpful to manually put a couple of lines of values into a DG and then do something like this so you can have a visual depiction of how the array should be organized: -- in a test button on mouseUp put the dgData of grp "my grid" into tDataA breakpoint end mouseUp Phil Davis On 8/10/21 11:52 AM, Skip Kimpel via use-livecode wrote: > What is the best way to do this? I have searched my old code, online > results, etc and cannot find a clear cut answer. Having said that, it has > been a VERY long time since I have done this so I am part of the "use it or > lose it" club right now. > > Any help would be greatly appreciated! > > SKIP > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: how to include Apple's SF Pro font in an iOS app?
Thanks Jacque! I'll try '(System)' out and see what happens. Phil On 7/29/21 10:55 PM, J. Landman Gay via use-livecode wrote: > I don't know why it wouldn't be allowed. Apple provides the fonts on > their developer site and says you can download and use them: > https://developer.apple.com/fonts/ > Fonts are often named one thing but listed differently in the font > files. This post mentions it's named "SFUI-Regular" on iOS 13: > https://developer.apple.com/forums/thread/126548 > > If that's the case then you probably do have the font on the iPad and > assigning LC's "system" font will automatically use it. In fat, that > seems to be the preferred method according to that post. > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.com > On July 29, 2021 11:19:06 PM Phil Davis via use-livecode > wrote: > >> Functionally speaking, I understand how to include it, but... will Apple >> let me release the app with that font included? I don't speak their >> brand of legalese very well. >> >> I can see the list of fonts that reside on my iPad and the SF fonts are >> not there. (I'm running iOS 14.6. ) But Apple makes it sound like >> they're ready for use. So I don't know what I'm supposed to do if I want >> to use the font in my app. >> >> Do you have experience with this issue? I could use some guidance. >> >> Many thanks - >> Phil Davis >> >> -- >> Phil Davis >> 503-307-4363 >> >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
how to include Apple's SF Pro font in an iOS app?
Functionally speaking, I understand how to include it, but... will Apple let me release the app with that font included? I don't speak their brand of legalese very well. I can see the list of fonts that reside on my iPad and the SF fonts are not there. (I'm running iOS 14.6. ) But Apple makes it sound like they're ready for use. So I don't know what I'm supposed to do if I want to use the font in my app. Do you have experience with this issue? I could use some guidance. Many thanks - Phil Davis -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: the systemversion shows wrong version # on Mac
If you want the actual macOS system version, you can use the 'sw_vers' shell command. phils-macbook-pro:~ pdslabs2$ sw_vers -productVersion 10.15.7 or phils-macbook-pro:~ pdslabs2$ sw_vers ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H1030 Phil Davis On 5/7/21 7:25 AM, Andre Garzia via use-livecode wrote: > Tiemo, > > This is not a bug. > > MacOS Big Sur will identify itself as both 10.16.0 and 11.x. This is by > design so that scripts checking for version compatibility can see Big Sur as > just a minor version of 10.x > > The version seen depends on both which SDK was used to compile the app, and > also on the value of the environment variable called SYSTEM_VERSION_COMPAT. > > Best > Andre > >> On 7 May 2021, at 13:00, Tiemo via use-livecode >> wrote: >> >> Hello, >> >> >> >> I am on macOS 11.2.3 and the systemversion shows 10.16.0? >> >> It shows the same at least going back to 8.1.7 >> >> >> >> Do I have to multiply the systemversion by 1.1053 to get the real one? >> >> >> >> Tiemo >> >> >> >> >> >> >> >> >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: notarizing DMG fails - solved
Thank you Matthias! Your tools make my life SO much easier! You have done a great service for this community. Phil Davis On 5/5/21 2:20 AM, matthias rebbe via use-livecode wrote: >> Am 05.05.2021 um 11:10 schrieb Tiemo via use-livecode >> : >> >> Thank you all for helping my lost soul in Apples notarizing nirvana >> >> Tiemo >> >> P.S. >> Matthias, perhaps you want to add this in your great helpfile - without that >> it would have taken weeks for me! >> > I am currently working on it. ;) > First i will just add a note, but later, when i have more free time i will > enhance it to describe all more detailed. > > The Helper Stack will also get an update to support package installers. But > it takes some time. > > > >> -Ursprüngliche Nachricht- >> Von: use-livecode Im Auftrag von >> matthias rebbe via use-livecode >> Gesendet: Mittwoch, 5. Mai 2021 10:31 >> An: How to use LiveCode >> Cc: matthias_livecode_150...@m-r-d.de >> Betreff: Re: notarizing DMG fails >> >> Tiemo, >> >> i think i found the solution. I tried here myself and did als get the error >> "this identity cannot be used for signing code" when using the Developer ID >> Installer certificate for signing the .pkg. >> According to Apple (see point 2) >> https://help.apple.com/xcode/mac/current/#/deve51ce7c3d >> >> you have to use the tool productsign to sign the package installer. >> >> So the syntax is like this >> >> productsign --sign >> >> >> Example >> productsign --sign "Developer ID Installer: Matthias Rebbe ()" >> "/users/matthias/LC/builts/test/test.pkg" >> "/users/matthias/LC/builts/test/test_signed.pkg" >> >> After successful signing i got this messages in Terminal >> >> productsign: using timestamp authority for signature >> productsign: signing product with identity "Developer ID Installer: Matthias >> Rebbe ()" from keychain >> /Users/matthias/Library/Keychains/login.keychain-db >> productsign: adding certificate "Developer ID Certification Authority" >> productsign: adding certificate "Apple Root CA" >> productsign: Wrote signed product archive to >> /users/matthias/LC/builts/test/test_signed.pkg >> >> >> Regards >> >> - >> Matthias Rebbe >> Life Is Too Short For Boring Code > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: [bug] strange memory leak in LC
I created a little "leak test" stack that runs the "leaks" shell command against the processID of the LC engine that runs the stack. It checks for new leaks every 60 seconds and lists the number and size of each new leak found. I'm running it in LC 9.6.1 on 3 Macs right now - Catalina, High Sierra and Big Sur. After about 30 minutes: - LC on Big Sur (M1) has 10 leaks for a total of 688 bytes. - LC on Catalina (Intel) has no leaks. - LC on High Sierra (Intel) has no leaks. Just FYI - Phil Davis On 3/26/21 7:33 PM, John Balgenorth via use-livecode wrote: > I am not personally using Bug Sur but if you make a standalone does > it leak memory too or is this only with the development system? > > JB > >> On Mar 26, 2021, at 7:29 PM, scott--- via use-livecode >> wrote: >> >> I’m running Big Sur and just got a warning from the OS that I was out of >> application memory. Livecode was using 133.52 GB of memory. It had been >> open for a couple days but it wasn’t doing anything. >> -- >> Scott Morrow >> >> Elementary Software >> (Now with 20% less chalk dust!) >> web https://elementarysoftware.com/ >> email sc...@elementarysoftware.com >> booth1-360-734-4701 >> -- >> >>> On Mar 26, 2021, at 6:53 AM, Andre Garzia via use-livecode >>> wrote: >>> >>> Sean, >>> >>> The stack was not running anything. It was simply opened. I don’t believe >>> it would leak like that. Anyway, I’m monitoring to see if it happens again. >>> >>> A >>> >>>>> On 26 Mar 2021, at 13:01, Sean Cole (Pi) via use-livecode >>>>> wrote: >>>> Wow, Andre, that's impressive. That amounts to about 34MB per minute over >>>> 48hrs. I've had a pretty massive stack (226MB file at the moment) on my Mac >>>> sitting here over the last week. Looking in the activity monitor, LC has >>>> 987MB associated with it. and watching it over a period of time it remains >>>> stable and even went down a tiny bit. >>>> >>>> I wonder if this is more an issue with Rosetta2 in this instance. Maybe >>>> something in LC leaks because of the Rosetta transformation of the binary. >>>> Perhaps, as a test, open the same stack on a non-AppleSilicon Mac and watch >>>> them both for how much memory they expend over a period of time. >>>> >>>> All the best with that. >>>> >>>> Sean >>>> >>>> On Fri, 26 Mar 2021 at 10:03, Andre Garzia via use-livecode < >>>> use-livecode@lists.runrev.com> wrote: >>>> >>>>> I have no idea what happened. I’m running LC 9.6.2-rc-3 on macOS Big Sur >>>>> on M1 ISA (so it is running under Rosetta 2). I kept the IDE opened for a >>>>> couple days, I was working on a gaziliion stacks at the same time and was >>>>> not yet ready to close them. >>>>> >>>>> The stacks were not doing anything, they were not running “send in time” >>>>> commands or doing any kind of processing, they were just opened. Then >>>>> macOS >>>>> showed me a dialog I have never ever seen on macOS 10.x, a memory >>>>> exhaustion dialog. Looking closer at it, LiveCode was using 100 GB of >>>>> memory, as in Gigabyte, as can be seen on this screenshot: >>>>> >>>>> http://andregarzia.com/img/shots/lc-memory-leak.png < >>>>> http://andregarzia.com/img/shots/lc-memory-leak.png> >>>>> >>>>> I remember things like the “default button” causing leaks due to the >>>>> animation and so on, but all I had was a bunch of custom stacks open and >>>>> the script editor focused. Thats it. It was open since yesterday. >>>>> ___ >>>>> use-livecode mailing list >>>>> use-livecode@lists.runrev.com >>>>> Please visit this url to subscribe, unsubscribe and manage your >>>>> subscription preferences: >>>>> http://lists.runrev.com/mailman/listinfo/use-livecode >>>>> >>>> ___ >>>> use-livecode mailing list >>>> use-livecode@lists.runrev.com >>>> Please visit this url to subscribe, unsubscribe and manage your >>>> subscription preferences: >>>> http://lists.runrev.com/mailman/listinfo/use-livecode >>> >>>
Re: Setting Creation Date of file to a past date?
On Mac or Linux you can use the "touch" shell command - not sure if it's available on Windows. You can download the "Shell Command Help" LC plugin to simplify access to info about it. Phil Davis On 3/14/21 1:04 PM, Michael Kristensen via use-livecode wrote: Hi there I want to create/export some images from Livecode to fit into a slideshow that is sorted by creation date. It means that the files I export shall have a creation date of the past. So that when they are put into the folder of the slideshow, the images are placed automatically at the desired places. How would you go about to set the creation date of a file to a date in the past with Livecode (maybe with the help of shell or applescript) Thanks Michael ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: mergFTPd example?
Thanks Håkan - Phil On 3/10/21 2:05 AM, ha...@exformedia.se wrote: I would go for a REST API on the desktop and then use the https protocol. On the mobile app you can then just use the powerful url command. Take a look at ”post data to URL” in the dictionary. And maybe also the ”put url … into” for getting data in the opposite direction. :-Håkan On 10 Mar 2021, 08:29 +0100, Phil Davis via use-livecode , wrote: I'm anticipating the need to connect an iOS app with a companion desktop app so the desktop app can get data from the mobile app and do some reporting and recordkeeping. It should also be able to transfer data back to the mobile app. Does anyone have an example of how to make that happen? I can't find one anywhere. The data connection & transfer don't have to be made with mergFTPd but I see it's an LC option. Thanks - Phil -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: mergFTPd example?
Thank you Matthias! I haven't played with 9.6.2 yet but will now be doing so very soon. I'll look into it tomorrow (it's almost 2 AM here) and see what I can learn. Thanks again - Phil On 3/10/21 1:47 AM, matthias rebbe via use-livecode wrote: Hi Phil, i would say mergFTPd is the easiest way to accomplish that. Did you already check the mergFTP Demo stack which is inside the Livecode app bundle, e.g. here for LC 9.6.2 /Applications/LiveCode Business 9.6.2 (rc 2).app/Contents/Tools/Ext/mergFTPD-1.0.56 You just need to set/select the correct provisioning profile in the standalone settings under iOS and you could test that stack on your iOS device or in the simulator. Now regarding fetching data from the iOS device. Let's say the ip of the iOS device is 192.168.0.25, the username and password for the ftp access are the same as in the demo stack and the file we want retrieve is report.xlsx and want to store it on the desktop, then the command to fetch the file is put URL "ftp://hello:world@192.168.0.25/report.xlsx; into URL "binfile:~/desktop/report.xlsx" To upload a file to the server the following would be used put URL "binfile:~/desktop/report.xlsx" into URL "ftp://hello:world@192.168.0.25/report.xlsx; Regards, Matthias - Matthias Rebbe Life Is Too Short For Boring Code Am 10.03.2021 um 08:27 schrieb Phil Davis via use-livecode : I'm anticipating the need to connect an iOS app with a companion desktop app so the desktop app can get data from the mobile app and do some reporting and recordkeeping. It should also be able to transfer data back to the mobile app. Does anyone have an example of how to make that happen? I can't find one anywhere. The data connection & transfer don't have to be made with mergFTPd but I see it's an LC option. Thanks - Phil -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
mergFTPd example?
I'm anticipating the need to connect an iOS app with a companion desktop app so the desktop app can get data from the mobile app and do some reporting and recordkeeping. It should also be able to transfer data back to the mobile app. Does anyone have an example of how to make that happen? I can't find one anywhere. The data connection & transfer don't have to be made with mergFTPd but I see it's an LC option. Thanks - Phil -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Multidimensional array issue
When I want to determine whether or not an array element contains non-whitespace, I usually say: if word 1 of tDataA["item"] is empty then ... (or is NOT empty) Just another option. Phil Davis On 3/8/21 5:36 PM, Bob Sneidar via use-livecode wrote: Are you testing for empty, or are you testing if there is a value in an array variable? If there is no key matching your array variable, LC will return an empty string. An empty string is a value. Mark is using a different method, seeing if a key of an array is itself an array. If bobtest ["value"] contains another array so that bobtest ["value"] ["anumber"] contains 1, then bobtest ["value"] is an array. If bobtest ["value"] contains 1 then it is not an array. But getting the value of bobtest ["value"] ["number"] will return empty whether or not bobtest '{value"] is an array. This is why Mark is testing for an array rather than the value. It seems a bit wonky, you might think, "Why not return an error?" But trust me, when you work with arrays, especially when it comes to datagrid data, this is the best course. Bob S On Mar 8, 2021, at 16:25 , HENRY LOWE via use-livecode wrote: Thanks Mark. There are two possible states: tArray[“status”] holds a value and tArray[“status”][“text”] does not or tArray[“status”][“text”] holds a value and tArray[“status”] does not My code is trying to do the following: If tArray[“status”] does not hold a value then check if tArray[“status”][“text”] holds a value The crux is how one reliably determines that an array member (e.g. tArray[“status”]) holds a value? I would have assumed that if the array member does not hold a value then - if tArray[member] is empty would always return true. However that does not appear to be the case if the array is multidimensional. It appears that both tArray[“status”] is an array and tArray[“status”][“text”] is an array are true. Am I missing something about using this syntax? Thanks, Henry On Mar 8, 2021, at 3:56 PM, Mark Wieder via use-livecode wrote: On 3/8/21 3:46 PM, HENRY LOWE via use-livecode wrote: I have often used the form 'if tArray[“key1”] is empty' to determine whether an array element hold a value but this breaks if tArray[“key1”][“key2”] holds a value. Same here. Not that I've every liked that paradigm, just that it's been that way since life crawled out of the ocean. However this should do the trick. if tArray["status"] is an array then put tArray["status"]["text"] into tStatus else put tArray["status"] into tStatus end if -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Did I dream this ?
There's mouseH, mouseV, clickH, clickV but those are the only partial loc things I'm aware of. Phil Davis On 3/4/21 10:54 AM, jbv via use-livecode wrote: Hi list, I thought I remembered a property like xloc or yloc in LC that would return only the horizontal or vertical location of an object... Or was it before, in Metacard or even in OMO ? jbv ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Swipe gesture script on datagrid
Would the dgProp["left swipe control"] of grp "yourDG" help? At least that might let you change the default trash can to some other control (maybe to a group that contains your 2 buttons?). If you get that far, maybe the message path of your 2 buttons would go through the DG template row behavior script. I don't know for sure but that would be my first guess. Phil Davis On 1/18/21 10:28 PM, Ludovic THEBAULT via use-livecode wrote: Hello, How edit the script of a swipe gesture control ? I want to add two buttons to the right swipe control, it’s ok for appearance but I cannot find where to edit the script. Is it even possible? PS : i have datagrid helper plugin 2.5. Thanks ! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Is there a way to manually trigger GC?
Hi Tom, Does hasMemory() have any effect on available memory, or does it truly just report the state of things? I wonder if there is some shell command that might help? Phil Davis On 1/16/21 11:31 AM, Tom Glod via use-livecode wrote: Hi Folks, I'm finding my application does a nice job to unload data from memory, but it takes a while for that to happen. When the initial load of the application occurs, the memory consumption is quite high if there is lots of data to be loaded (1 GB+). But after a while, the used ram drops down to under 100 mb as the application run in the background, after which the application swaps is only the data I am accessing. Can I trigger that memory release manually? (Maybe its another mechanism and not GC?!) TIA Tom Glod Founder & Developer MakeShyft R.D.A (www.makeshyft.com) Mobile:647.562.9411 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: DG outcomes on desktop vs mobile
Well, I'm feeling pretty dumb about now. It's the architecture, stupid! I overlooked the fact that, unlike on desktop systems, my mobile app doesn't automagically have access to the test files that reside in the app's dev environment on my Mac. During startup on the iPad, the app has to populate its [Documents] subfolders with test files stored in the app bundle. It's my first mobile app. At least there's that. And I can pretty much guarantee I'll never again overlook the need to do this! So that part of the app is working now. Thanks for the great ideas, which will be useful when I stumble again - Phil On 10/23/20 3:06 PM, Bob Sneidar via use-livecode wrote: I got into the habit of setting the dgdata to empty before populating it because I ran into issues where my own code set the dgdata to something not an array, and this seems to bork the data grid. I think it was an empty array, or an empty record. This didn’t show up as a blank line however, the data displayed correctly, but the data grid became unresponsive. It didn’t show up in the text view of the property inspector either. I had to put the dgtext into the msg and then the blank line showed up. Bob S On Oct 23, 2020, at 5:19 AM, Andrew at MidWest Coast Media via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: This happened to me, twice, in a project I just launched. I was in crunch so didn’t have time to properly document but something happened where the DG wasn’t loading. I could take the same dgData or dgText and load it to another DG fine. Being on mobile made this harder to debug because even with Remote Debugger I would still have to compile and launch to the simulator each time I tried a tweak. Because I was up against a deadline and since I wasted several hours trying to troubleshoot I just replaced the DG with a brand new: everything worked. Didn’t even bother to troubleshoot the 2nd time it happened, just immediately made a new DG and moved on. Not a definitive answer to your question but an acknowledgement of your problem. —Andrew Bell I'm building an iPad app that reads a bunch of files into an array and then sets the dgData of a form DG to that array. The array is well-formed for DG use. After setting the dgData of the DG, the result is empty. Only one problem: the DG now contains no data. (I also tried setting the dgText of the DG to a flat version of the same data and got the same outcome.) I can then create another array from custom property data and set the dgData of the same form DG to that array and it works. On the desktop, however, the same DG loading process never fails. The data being loaded is all text - nothing esoteric. Does anyone have any ideas how I can find & fix the problem(s)? Or have you run into this before? Thank you - Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: DG outcomes on desktop vs mobile
All the files are in a 'Students' subfolder of the app's Documents folder, and the path reflects that. However, your question is making me go through the handling of data with a fine-tooth comb, so that may result in something. Thanks Jacque - Phil On 10/23/20 11:22 AM, J. Landman Gay via use-livecode wrote: What is the path you use to get the files? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On October 23, 2020 12:26:34 PM Phil Davis via use-livecode wrote: That's a good question. On desktop, the array variable is full of data. On the iPad it's apparently empty. I'll drill down further and see what's going on. Thanks for the idea. Phil On 10/23/20 1:03 AM, JeeJeeStudio via use-livecode wrote: What do you see when you answer the data you set the dgdata to? Does it show the values? Op vr 23 okt. 2020 08:44 schreef Phil Davis via use-livecode < use-livecode@lists.runrev.com>: I'm building an iPad app that reads a bunch of files into an array and then sets the dgData of a form DG to that array. The array is well-formed for DG use. After setting the dgData of the DG, the result is empty. Only one problem: the DG now contains no data. (I also tried setting the dgText of the DG to a flat version of the same data and got the same outcome.) I can then create another array from custom property data and set the dgData of the same form DG to that array and it works. On the desktop, however, the same DG loading process never fails. The data being loaded is all text - nothing esoteric. Does anyone have any ideas how I can find & fix the problem(s)? Or have you run into this before? Thank you - Phil Davis -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: DG outcomes on desktop vs mobile
That's a good question. On desktop, the array variable is full of data. On the iPad it's apparently empty. I'll drill down further and see what's going on. Thanks for the idea. Phil On 10/23/20 1:03 AM, JeeJeeStudio via use-livecode wrote: What do you see when you answer the data you set the dgdata to? Does it show the values? Op vr 23 okt. 2020 08:44 schreef Phil Davis via use-livecode < use-livecode@lists.runrev.com>: I'm building an iPad app that reads a bunch of files into an array and then sets the dgData of a form DG to that array. The array is well-formed for DG use. After setting the dgData of the DG, the result is empty. Only one problem: the DG now contains no data. (I also tried setting the dgText of the DG to a flat version of the same data and got the same outcome.) I can then create another array from custom property data and set the dgData of the same form DG to that array and it works. On the desktop, however, the same DG loading process never fails. The data being loaded is all text - nothing esoteric. Does anyone have any ideas how I can find & fix the problem(s)? Or have you run into this before? Thank you - Phil Davis -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: DG outcomes on desktop vs mobile
Thanks Andrew - I think I'll try this for the same reasons you did. Phil On 10/23/20 5:19 AM, Andrew at MidWest Coast Media via use-livecode wrote: This happened to me, twice, in a project I just launched. I was in crunch so didn’t have time to properly document but something happened where the DG wasn’t loading. I could take the same dgData or dgText and load it to another DG fine. Being on mobile made this harder to debug because even with Remote Debugger I would still have to compile and launch to the simulator each time I tried a tweak. Because I was up against a deadline and since I wasted several hours trying to troubleshoot I just replaced the DG with a brand new: everything worked. Didn’t even bother to troubleshoot the 2nd time it happened, just immediately made a new DG and moved on. Not a definitive answer to your question but an acknowledgement of your problem. —Andrew Bell I'm building an iPad app that reads a bunch of files into an array and then sets the dgData of a form DG to that array. The array is well-formed for DG use. After setting the dgData of the DG, the result is empty. Only one problem: the DG now contains no data. (I also tried setting the dgText of the DG to a flat version of the same data and got the same outcome.) I can then create another array from custom property data and set the dgData of the same form DG to that array and it works. On the desktop, however, the same DG loading process never fails. The data being loaded is all text - nothing esoteric. Does anyone have any ideas how I can find & fix the problem(s)? Or have you run into this before? Thank you - Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
DG outcomes on desktop vs mobile
I'm building an iPad app that reads a bunch of files into an array and then sets the dgData of a form DG to that array. The array is well-formed for DG use. After setting the dgData of the DG, the result is empty. Only one problem: the DG now contains no data. (I also tried setting the dgText of the DG to a flat version of the same data and got the same outcome.) I can then create another array from custom property data and set the dgData of the same form DG to that array and it works. On the desktop, however, the same DG loading process never fails. The data being loaded is all text - nothing esoteric. Does anyone have any ideas how I can find & fix the problem(s)? Or have you run into this before? Thank you - Phil Davis -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: The iOS "Files" folder
On a related note, there is a "File Sharing" check box in the iOS > Requirements tab > Requirements and Restrictions section of the Standalone App settings. What does that do? Thanks - Phil Davis On 10/13/20 9:19 AM, Andrew at MidWest Coast Media via use-livecode wrote: It looks from the minimum documentation I have that you could do much the same with an image, but I have not tried it. I use this in a (now abandoned) feature of an app to take a screenshot of the mobile stack and share the image. Switched to this after mergSocial stopped working when Apple made some core OS updates. The entire MergExt suite is extremely powerful and extremely under-documented. put specialFolderPath("documents") & "/IndianaOnTap.png" into tFilePath put the rect of this card into tRect put the bottom of field "promoName" into tBottom put item 1 of tRect & COMMA & item 2 of tRect & COMMA & item 3 of tRect & COMMA & tBottom into tExportRect export snapshot from rect tExportRect of this card to file tFilePath as PNG mergPopActivity "Indiana On Tap just hooked me up!",tFilePath,"" —Andrew Bell ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Modal stacks cpu usage
Sorry Neville, I didn't read your email closely enough - you are obviously on the right track. Phil On 9/30/20 9:02 PM, Phil Davis via use-livecode wrote: Another factor I discovered in times past (which may have been changed by now) that eats up CPU cycles is the "Default" button style. Do you possibly have one of those on your stack? Phil Davis On 9/30/20 7:30 PM, Neville Smythe via use-livecode wrote: I have just noticed something curious. I am running LiveCode 8.1 IDE 9.6.1 on a Mac Air 2020 quad core Catalina. Typically LC cpu usage shows about 34% (presumably of 1 core). When a modal stack is opened it immediately ramps up to 99% ; the fan kicks in, and if left for a while the OS boosts the kernel_task daemon which I have been told is a protection device to prevent overheating. This has the effect of very markedly slowing down all apps as they get less cpu time. If the stack is opened in non-modal mode, cpu usage stays around 34% . I don’t understand why a modal stack should be a cpu hog, indeed it seems like a bug to me. I have a suspicion the wait with messages command may have the same effect on cpu performance, so it could be the culprit. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Modal stacks cpu usage
Another factor I discovered in times past (which may have been changed by now) that eats up CPU cycles is the "Default" button style. Do you possibly have one of those on your stack? Phil Davis On 9/30/20 7:30 PM, Neville Smythe via use-livecode wrote: I have just noticed something curious. I am running LiveCode 8.1 IDE 9.6.1 on a Mac Air 2020 quad core Catalina. Typically LC cpu usage shows about 34% (presumably of 1 core). When a modal stack is opened it immediately ramps up to 99% ; the fan kicks in, and if left for a while the OS boosts the kernel_task daemon which I have been told is a protection device to prevent overheating. This has the effect of very markedly slowing down all apps as they get less cpu time. If the stack is opened in non-modal mode, cpu usage stays around 34% . I don’t understand why a modal stack should be a cpu hog, indeed it seems like a bug to me. I have a suspicion the wait with messages command may have the same effect on cpu performance, so it could be the culprit. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How Do You Get Filename / Image
Maybe check the result after your 'put URL... into URL ...' statement. That might give you a hint about the problem. Phil Davis On 9/6/20 2:31 PM, Sannyasin Brahmanathaswami via use-livecode wrote: Looks like that does not work on mouseUp local tImageName, tDestinationPath,tHolder set the itemdelimiter to "/" put (item -2 to -1 of the filename of img "slideImage") into tImageName put "_ForWebSite/" into tDestinationPath put tDestinationPath & tImageName into tHolder -- put URL("binfile:" & the filename of img "slideImage" ) into URL("binfile:" & tDestinationPath & tImageName) put the filename of img "slideImage" into URL("binfile:" & tDestinationPath & tImageName) end mouseUp On 9/6/20, 8:08 AM, "use-livecode on behalf of Brian Milby via use-livecode" wrote: Looks like you need to specify a full path for the source and destination. on mouseUp local tImageName, tDestinationPath set the itemdelimiter to "/" put (item -1 of the filename of img 1 ) into tImageName put item 1 to -2 of the filename of this stack & "/" into tDestinationPath put URL("binfile:" & the filename of img 1 ) into URL("binfile:" & tDestinationPath & tImageName) end mouseUp On Sun, Sep 6, 2020 at 9:59 AM Sannyasin Brahmanathaswami via use-livecode < use-livecode@lists.runrev.com> wrote: > Maybe it is aphasia... > > How do we get file from one location to another location > > on mouseUp > local tRelativeURL > -- repeat with x = 1 to (the number of cards of stack > “SlideShowSetUp”) > --go card x > set the itemdelimiter to “/” > put (the item -2 to -1 of the filename of img “slideimage” ) into > tRelativeURL > # this works is: there is a path > # 1-ellora/dsc1234.jpg > > # this does not work: > put URL(“binfile:” & tRelativeURL ) into > URL(“binfile:_ForWebSite/” & tRelativeURL) > > put the filename of img “slideimage” into > URL(“binfile:_ForWebSite/” & tRelativeURL) > > -- end repeat > end mouseUp > > ?? > > Brahmanathaswami > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: tsnetGetFile() example using HTTP?
Thanks Charles. I probably won't get all the way back into this until Monday, just FYI. Also, HostM support has just given me an HTTPS tsnetGetFile download example stack. I tried it and my initial test worked! I still have some experimenting to do with it to find out which tsnetGetFile() settings are required for my case and which ones aren't, but the initial outcome is a great encouragement. (I'll be asking them if I can upload a mod of it to the livecodeshare site.) Although I've been developing software since the 70s (and maybe because I have been), I still don't know my HTTP headers well at all. That spills over into not knowing exactly what tsnet settings to use in certain cases. I'm pretty sure that has been a large factor in my current challenge. I'm using LC 9.6.0 on macOS 10.13.6 (my main dev machine) and up (Mojave, Catalina). Thanks again - Phil On 7/18/20 5:10 AM, Charles Warwick via use-livecode wrote: Hi Phil, You can use the same command with HTTP, just make sure you set any HTTP headers accordingly (similar to tsNetGet). As for the issues with FTP, which version of LC are you using? Regards, Charles On 18 Jul 2020, at 6:48 pm, Phil Davis via use-livecode wrote: Hi Charles, Thanks for the response. Yes, my app is doing what is shown in the lesson (using FTP) and it's generally successful as long as the files aren't too large. Are you saying I can probably just change the protocol to HTTP and it will likely work? I'll try it when I'm not so bleary-eyed (it's almost 2 AM here in the US Pacific Northwest). Phil On 7/18/20 12:54 AM, Charles Warwick via use-livecode wrote: Hi Phil, Does this lesson help you? http://lessons.livecode.com/m/4071/l/853715-how-to-asynchronously-download-via-sftp-directly-to-a-file It uses SFTP with tsNetGetFile, so while the protocol used is different, the concept is the same. Regards, Charles On 18 Jul 2020, at 5:17 pm, Phil Davis via use-livecode wrote: Does anyone have an working example stack you're willing to share where 'tsnetGetFile' or 'tsnetGetFileSync' is using HTTP (or HTTPS) to download a file? I have had limited success using FTP but it consistently fails (in my situation at least) when files are bigger than 200-300 MB (depending I guess on network traffic at that moment, or ???). Today I started with the example described in the lesson: http://lessons.livecode.com/m/4071/l/945907-how-to-download-multiple-files-in-the-background-with-tsnet The example uses HTTP via 'tsnetGet' to download the text of web pages into a variable, and then uses "put tData into url ("file:" )" to make the files. In my real-world situation I can't do that. My actual downloads are binary files that can be over 1 GB. I need to download them as files to the local disk, so for me 'tsnetGet' is out. There are no tsnet examples on http://livecodeshare.runrev.com/ so I'm turning to you (which I should have done earlier). (Is there anywhere else I should look for examples? I did look on stackexchange and stackoverflow but no joy.) Thanks for any and all responses. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: tsnetGetFile() example using HTTP?
Hi Charles, Thanks for the response. Yes, my app is doing what is shown in the lesson (using FTP) and it's generally successful as long as the files aren't too large. Are you saying I can probably just change the protocol to HTTP and it will likely work? I'll try it when I'm not so bleary-eyed (it's almost 2 AM here in the US Pacific Northwest). Phil On 7/18/20 12:54 AM, Charles Warwick via use-livecode wrote: Hi Phil, Does this lesson help you? http://lessons.livecode.com/m/4071/l/853715-how-to-asynchronously-download-via-sftp-directly-to-a-file It uses SFTP with tsNetGetFile, so while the protocol used is different, the concept is the same. Regards, Charles On 18 Jul 2020, at 5:17 pm, Phil Davis via use-livecode wrote: Does anyone have an working example stack you're willing to share where 'tsnetGetFile' or 'tsnetGetFileSync' is using HTTP (or HTTPS) to download a file? I have had limited success using FTP but it consistently fails (in my situation at least) when files are bigger than 200-300 MB (depending I guess on network traffic at that moment, or ???). Today I started with the example described in the lesson: http://lessons.livecode.com/m/4071/l/945907-how-to-download-multiple-files-in-the-background-with-tsnet The example uses HTTP via 'tsnetGet' to download the text of web pages into a variable, and then uses "put tData into url ("file:" )" to make the files. In my real-world situation I can't do that. My actual downloads are binary files that can be over 1 GB. I need to download them as files to the local disk, so for me 'tsnetGet' is out. There are no tsnet examples on http://livecodeshare.runrev.com/ so I'm turning to you (which I should have done earlier). (Is there anywhere else I should look for examples? I did look on stackexchange and stackoverflow but no joy.) Thanks for any and all responses. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
tsnetGetFile() example using HTTP?
Does anyone have an working example stack you're willing to share where 'tsnetGetFile' or 'tsnetGetFileSync' is using HTTP (or HTTPS) to download a file? I have had limited success using FTP but it consistently fails (in my situation at least) when files are bigger than 200-300 MB (depending I guess on network traffic at that moment, or ???). Today I started with the example described in the lesson: http://lessons.livecode.com/m/4071/l/945907-how-to-download-multiple-files-in-the-background-with-tsnet The example uses HTTP via 'tsnetGet' to download the text of web pages into a variable, and then uses "put tData into url ("file:" )" to make the files. In my real-world situation I can't do that. My actual downloads are binary files that can be over 1 GB. I need to download them as files to the local disk, so for me 'tsnetGet' is out. There are no tsnet examples on http://livecodeshare.runrev.com/ so I'm turning to you (which I should have done earlier). (Is there anywhere else I should look for examples? I did look on stackexchange and stackoverflow but no joy.) Thanks for any and all responses. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Drawing a blank on simple code...
You're almost there Paul! On 5/19/20 2:18 PM, Paul Dupuis via use-livecode wrote: I have a set of custom properties in stack "X", a lot of which begin with "options_" So I assume these are members of a customPropertySet, whose name I'll call "myOptions". I want to loop through them and get the values, so I have: local tDisplayList put the customKeys of stack "X" into tProperties To prevent the unintended, I would do this instead: put the customKeys["myOptions"] of stack "X" into tProperties filter lines of tProperties with "options_*" if tProperties is empty then exit to top repeat for each line tLine in tProperties put the customKeys[tLine] of stack "X" into tProp This should work: put the myOptions[tLine] of stack "X" into tProp -- do stuff here end repeat When I walk through this code in the debugger, I see that tProperties gets a list of the names of all custom properties in the "X" stack. YEA! Then I see that that list correctly gets filtered to just those that begin with "options_" YEA! Then I see the in the repeat loop the variable "tLine" get the name of each "options" property in succession. YEA! PROBLEM: put the customKeys[tLine] of stack "X" into tProp DOES NOT fetch the value of the indicated property into tProp I know this is simple - and I have coded it before - but I can seem to find my past code in prior projects and obviously am missing something. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode Best - Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Open printing to pdf
What happens if you remove the space from the file path? Does it still behave the same? Phil Davis On 5/12/20 4:23 PM, GEORGE WOOD via use-livecode wrote: Here is on example of what I tried: on mouseup put “/Desktop/test files/Test.pdf” into temp open printing to pdf temp print cd 1 from (topleft of cd 1) to (bottomright of cd 1) close printing put the result end mouseup ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: on-rev server upgrade-related problems
Thanks so much for your interest in this bug, Matthias! I'm just getting back into it now, catching up on bug comments posted since yesterday. Phil On 5/8/20 5:28 AM, matthias rebbe via use-livecode wrote: Phil, i´ve answered already to the bug report, but maybe this is also of interest for the others. As i have also accoun ton the same On-Revi as you and did some test. I am sure it´s a tsNet timeout problem. tsNET has several default timeouts. The defaults are 30, 0, 30, 6, 30, 1000 The fifth one defines "the time period in seconds that is used to calculate whether or not the transfer has fallen below the low speed limit set by pLowSpeedLimit." It can be set either to 0 to disable the time out or to any other value. In my first test my LC Server script returned just a 5MB file back to the client. That worked. I then added a "wait 45 seconds" to the script before outputting/returning 5MB file to the client. I got exactly the same error message than youor your clients, "tsneterr: (28) Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds" This makes sense as because of the "wait 45 seconds" we exceeded the default time-out value of 30. I then added the following line to the client script. tsNetSetTimeouts 30, 0, 30, 6, 120, 1000 With it i´ve changed the timeout to 120 seconds. After adding that line, the 5 MB file was received again by the client w/o the tsNet error. So setting the timeout either to a higher value or to 0 in the client script should solve it. I am not sure, but i assume setting it to 0 is not recommended. Hope this helps. Matthias - Matthias Rebbe Life Is Too Short For Boring Code Am 07.05.2020 um 20:35 schrieb Phil Davis via use-livecode : Thank you all for so many great questions and responses! I don't have time to give a comprehensive response right now but (1) I'll whittle away at it and (2) all your comments renew my hope that a solution is out there waiting for me to find it. Quick responses: - I too would start by going back to LC 6.6.x on the server if I could, but apparently the recent server upgrades - new hardware running LC 9.5.1 - are not backward compatible. That's what I'm told at least. - The LC client app is POSTing a request to an LC CGI system on an on-rev server. The server system assembles a data packet (normally an encoded array), encrypts & encodes it and writes it back to the client. The packet can be any size up to maybe a megabyte or two, but that would be pretty big. Normally the packet size is no more than a few hundred KB. Thanks again - Phil On 5/7/20 7:29 AM, Ralph DiMola via use-livecode wrote: Phil, I had a problem with a GET request with a url encoded url in a parameter after the upgrade. There are new security rules. I changed it to a POST and it then worked. I am changing my apps to use a POST. Robin had lifted the new security rule for me temporarily until all the apps are updated. One other thing, the new MySQL server is now Maria DB. It is functionally the same but I noticed if you have a column with no default value but is required and the field is not in the SQL update then it throws an error. MySQL did not do this. Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Phil Davis via use-livecode Sent: Thursday, May 07, 2020 3:18 AM To: How to use LiveCode Cc: Phil Davis Subject: on-rev server upgrade-related problems Has anyone had part or all of an on-rev server-based system stop working since the server upgrades a month or so ago? My client has an on-rev.com-based training system. Training delivery is via web browser, and that part continues to work. But there are several desktop apps that provide training development, management and real-time monitoring. All of those apps became non-functional as soon as the upgrades were done, and remain so. I haven't been able to figure out how to restore functionality. Robin in on-rev support has been very helpful, but we still don't have a solution. This is the bug report: https://quality.livecode.com/show_bug.cgi?id=22704 I wouldn't wish this on anyone, but in a way I'm hoping it isn't just us. Thanks - Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-liv
Re: on-rev server upgrade-related problems
Thank you all for so many great questions and responses! I don't have time to give a comprehensive response right now but (1) I'll whittle away at it and (2) all your comments renew my hope that a solution is out there waiting for me to find it. Quick responses: - I too would start by going back to LC 6.6.x on the server if I could, but apparently the recent server upgrades - new hardware running LC 9.5.1 - are not backward compatible. That's what I'm told at least. - The LC client app is POSTing a request to an LC CGI system on an on-rev server. The server system assembles a data packet (normally an encoded array), encrypts & encodes it and writes it back to the client. The packet can be any size up to maybe a megabyte or two, but that would be pretty big. Normally the packet size is no more than a few hundred KB. Thanks again - Phil On 5/7/20 7:29 AM, Ralph DiMola via use-livecode wrote: Phil, I had a problem with a GET request with a url encoded url in a parameter after the upgrade. There are new security rules. I changed it to a POST and it then worked. I am changing my apps to use a POST. Robin had lifted the new security rule for me temporarily until all the apps are updated. One other thing, the new MySQL server is now Maria DB. It is functionally the same but I noticed if you have a column with no default value but is required and the field is not in the SQL update then it throws an error. MySQL did not do this. Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Phil Davis via use-livecode Sent: Thursday, May 07, 2020 3:18 AM To: How to use LiveCode Cc: Phil Davis Subject: on-rev server upgrade-related problems Has anyone had part or all of an on-rev server-based system stop working since the server upgrades a month or so ago? My client has an on-rev.com-based training system. Training delivery is via web browser, and that part continues to work. But there are several desktop apps that provide training development, management and real-time monitoring. All of those apps became non-functional as soon as the upgrades were done, and remain so. I haven't been able to figure out how to restore functionality. Robin in on-rev support has been very helpful, but we still don't have a solution. This is the bug report: https://quality.livecode.com/show_bug.cgi?id=22704 I wouldn't wish this on anyone, but in a way I'm hoping it isn't just us. Thanks - Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
on-rev server upgrade-related problems
Has anyone had part or all of an on-rev server-based system stop working since the server upgrades a month or so ago? My client has an on-rev.com-based training system. Training delivery is via web browser, and that part continues to work. But there are several desktop apps that provide training development, management and real-time monitoring. All of those apps became non-functional as soon as the upgrades were done, and remain so. I haven't been able to figure out how to restore functionality. Robin in on-rev support has been very helpful, but we still don't have a solution. This is the bug report: https://quality.livecode.com/show_bug.cgi?id=22704 I wouldn't wish this on anyone, but in a way I'm hoping it isn't just us. Thanks - Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: sqLite delete memory database
Is there an LC function that clears trash from memory? Does "hasMemory"? If not, it seems like that would be a nice feature. Phil Davis On 5/1/20 12:25 PM, Tom Glod via use-livecode wrote: hmmmyou can try set the pragma to zero out flag (i am pretty sure there is one) .. and drop all tables on close? its strange that it does not 'delete' from memory. Are we sure on this?. is this dependent on the garbage collector in LC? On Fri, May 1, 2020 at 7:14 AM JB via use-livecode < use-livecode@lists.runrev.com> wrote: I have been testing SQLite 3 using the command line interface and it looks to me like SQLite is designed to securely delete the memory of the database automatically after it closes the database. I could be wrong but if you can’t read the memory it is probably already securely deleted when the database was closed. JB On Apr 30, 2020, at 6:43 PM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: I can create memory databases, but how do I delete it once created? revdb_disconnect still leaves it in memory. revCloseDatabase is just a synonym of revdb_disconnect. Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Learned my lesson
I feel your pain! I switched to using "of me" or "of the owner of me" whenever possible which works very well in many/most cases, but sometimes it just isn't enough. Phil Davis On 4/17/20 6:41 PM, Bob Sneidar via use-livecode wrote: I just spent 2 hours purging the detestable “this stack” from my entire list of projects. If you use substacks, if you hide and show stacks, this stack simply unreliable. Instead put this at the head of every script that needs to know what the parent stack is: put getParentStack(the long id of me) into tParentStack and have this in a library or active script somewhere: function getParentCard pObjectID put offset("card id", pObjectID) into tStartChar put char tStartChar to -1 of pObjectID into tCardID return tCardID end getParentCard function getParentStack pObjectID put offset("stack ", pObjectID) into tStartChar put char tStartChar to -1 of pObjectID into tParentStack return tParentStack end getParentStack Now you will know ABSOLUTELY which stack you are in from any object on any card. And no, I’m not senile (much yet) I know I already posted this some time ago. Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Socket Help
Hi Bob, I'm realizing now that your system connects client and server via the internet. Mine connects them via LAN. Big security difference! In another system I wrote that connects client & server over the internet, the server does this upon receiving a request: does a 'wait flag' (temp file) exist for this data source? - no: - is this an update request? - no: select/assemble data & put it - yes: set a 'wait flag', do the update, delete the wait flag, put the response - yes: put 'busy' (client tries again in a few ticks, up to x attempts) In the case of this system, the traffic is low enough so this approach has worked fine for years. In a higher volume system you might want to see if any other CGI transactions are in progress against the requested data source before you start changing data. That's all I got. I realize it probably isn't new news. Phil On 4/6/20 7:49 AM, Bob Sneidar via use-livecode wrote: Hi Phil. Thanks for the reply. I’m curious how this client server method handles multiple simultaneous connections? I had the idea of having a listener agent spawn an SQL Agent stack the first time a client connected, that would then listen on a random port. The listener agent would return the random port to the client which would then in the future communicate with the random SQL agent directly. A kind of passive connection if you will. I’m not sure all that is necessary though. I kept waking up all night thinking of ways to implement the encryption so that even a person with time to decipher the method would not be able to use it in subsequent captures. Of course, nothing is uncrackable, even Fort Knox, given the time, resources and resolve. The trick to encryption is to make the process of foreign decryption so tedious and time consuming that it isn’t worth the effort. And of course the reward for the foreign agent has to be considered when determining the level of complexity. There is no hacker in the Ukraine poring over the encrypted packets of my SQL transactions to access my data, so I don’t think I need go to extreme measures! I simply need to be able to reassure the principles of my company that their data is secure in transit. One more note, to secure passwords that I store in SQL, I encrypt those separately with a different key and seed before creating the SQL. That way, even if someone got physical access to the database, they couldn’t decipher the passwords. Bob S On Apr 5, 2020, at 11:25 PM, Phil Davis via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: Hi Bob, I created a client-server business system for a client some years ago. It too uses data encryption. What I did on the server side was prep the data for net transfer (base64Encode it as the final prep step, I think), then transfer length(data) & CR & data. On the client side, the app reads from the socket for 1 line (which goes into a variable, say "X"), then read from socket for X bytes. This keeps it simple - no need for special terminators etc - and seems to always work. Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Socket Help
Hi Bob, I created a client-server business system for a client some years ago. It too uses data encryption. What I did on the server side was prep the data for net transfer (base64Encode it as the final prep step, I think), then transfer length(data) & CR & data. On the client side, the app reads from the socket for 1 line (which goes into a variable, say "X"), then read from socket for X bytes. This keeps it simple - no need for special terminators etc - and seems to always work. Phil Davis On 4/5/20 12:51 PM, Bob Sneidar via use-livecode wrote: Hi Kee. Thanks for the response. I decided to go ahead and bypass the issue of the client and server being on the same device. I got my laptop out and created the server app there. I got it working as advertised. [Technical stuff] One thing I am doing is encrypting the data before sending it. The thing is, I needed a delimiter of some kind when reading the data back, because the data will be variable in length, and the end char will also be variable. So what I did is I appended a termination character after the encrypted data before sending it, then stripped the termination on the server side before decrypting it. I do the same thing when sending data back. This has the effect of making any intercepted data in transit impossible to decrypt without knowing that there IS a terminator, what the terminator is, the encryption key and the seed! Even a brute force method would fail to decrypt the data. I could get even fancier by sending two transmissions each way, the first being the randomized position and "poison pill" character that will be inserted into the encrypted data (itself encrypted), and a second the actual encrypted data. Even if the client and server stacks aren't password protected, there would be no way to anticipate what the poison pill character and position was. I suppose I could use a web server with SSL certs, but first, I don’t know how, and second I would be adding the lag time for the web server to respond. Right now it's taking a little over 300 milliseconds for a simple string to return on a local area network My goal is to create a client/server agent that I can securely send database queries to and get results back from. Bob S On Apr 5, 2020, at 11:55 AM, Kee Nethery via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: Here’s how this should work. Server has an IP and port number that it listens on. Client sends a packet from the same IP and some random port. Computer routes the packet and it doesn’t have to send the packet out on the net. It goes out the client port and back in to the server port. Server replies from its port to the client port (client is waiting for a reply). Try talking to your server with a browser on your computer and see what the server response looks like. Kee Nethery On Apr 5, 2020, at 11:22 AM, Bob Sneidar via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: Hi all. I am creating a client/server socket based app and I am trying to develop both the client and server on the same workstation, and I am having difficulty. I *think* the issue is that the client and server cannot both be on the same system, but I’m not entirely sure. I’m asking the system to listen and also talk on the same port. Anyone have any insight into this? Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com<mailto:use-livecode@lists.runrev.com> Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: The TopLevel Stack
Hi Bob, Is the first stack opened as 'toplevel' or in some other mode? That would make a difference. Best - Phil Davis On 3/27/20 3:40 PM, Bob Sneidar via use-livecode wrote: Hi all. I’m having fits here. I have a stack that opens another stack invisible. It supposedly closes itself, then returns to the first stack. At that point, it *should* be the topStack… BUT IT’S NOT! Subsequent commands like setting the text of a field fail with no such object! How do I FORCE a stack to be the active stack? Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Invalid Image File / Original Image Size
Hi Ralph, Certainly Klaus's approach will work. Here is another that works. As you know, image files have "signatures" in their headers to identify what kind of files they are: https://en.wikipedia.org/wiki/List_of_file_signatures (the "ISO 8859-1" column) Once you know the signatures of the image file types you want to allow, you could do something like this: on mouseUp answer file "Pick an image file:" if it is empty then exit to top answer isSupportedImage(it) end mouseUp function isSupportedImage pPath # Allow JPG, PNG and GIF images. put byte 1 to 12 of url ("binfile:" & pPath) into tHeader switch case "JFIF" is in tHeader case "PNG" is in tHeader case "GIF" is in tHeader return true break default return false break end switch end isSupportedImage I have used this approach in projects before and it seems to work reliably. Phil Davis On 2/17/20 1:08 PM, Ralph DiMola via use-livecode wrote: What's the best way to know if I set the filename of an image control and the file is either not an image or in an unsupported format? I'm getting https links to unknown images so I check images before app deployment. After resizing an image is there a way to know the original dimensions? Just wondering? I now save the original x/y sizes in properties so I know them after a resize. Thanks Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: does this PNG have transparency?
I like it! Nice job. Phil On 1/27/20 8:21 AM, Bob Sneidar via use-livecode wrote: Voila! function pngIsTransparent pImageFile if not (there is a file pImageFile) then return "ERROR: Invalid file path!" set the filename of the templateImage to pImageFile put numtochar(0) into tZero return (tZero is in the alphaData of the templateImage) OR (tZero is in the maskData of the templateImage) end pngIsTransparent Another one for the masterLibrary Bob S On Jan 27, 2020, at 08:16 , Paul Dupuis via use-livecode wrote: You should be able to use 'the templateImage' (see dictionary), and numToChar probably should be numToByte As in: on mouseUp answer file "Pick an image:" if it is empty then exit to top set the filename of the templateImage to it put numToByte(0) into tZero put (tZero is in the alphaData of the templateImage) OR (tZero is in the maskData of the templateImage) end mouseUp ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: does this PNG have transparency?
Maybe this? It seems to work in my simple testing. Am I missing something? on mouseUp answer file "Pick an image:" if it is empty then exit to top set the filename of img "my test" to it put numtochar(0) into tZero put (tZero is in the alphaData of img "my test") OR (tZero is in the maskData of img "my test") end mouseUp Phil On 1/24/20 1:48 PM, Phil Davis via use-livecode wrote: I usually make things harder than they need to be, so I'm asking: Is there a simple way my LC code can determine if a PNG image is completely opaque or not? Thanks - Phil -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
does this PNG have transparency?
I usually make things harder than they need to be, so I'm asking: Is there a simple way my LC code can determine if a PNG image is completely opaque or not? Thanks - Phil -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: TIFF support in the past?
Wow. How soon we (I) forget! Phil On 1/24/20 1:28 AM, Richmond Mathewson via use-livecode wrote: http://runtime-revolution.278305.n4.nabble.com/LiveCode-Import-Tiff-td3432308.html On Fri, Jan 24, 2020 at 10:43 AM Phil Davis via use-livecode < use-livecode@lists.runrev.com> wrote: Thank you Mark! Phil On 1/24/20 12:14 AM, Mark Waddingham via use-livecode wrote: I think the player object would show tiff files back when it was QT driven - the engine itself has never natively supported tiff. Warmest Regards, Mark Sent from my iPhone On 24 Jan 2020, at 08:01, Phil Davis via use-livecode < use-livecode@lists.runrev.com> wrote: I'm trying to find out if there was a time in the distant past when LC supported the TIFF image format. I found some TIFF image assets in some subfolders of a project from back then (maybe 10 or more years ago?) but can't run a copy of LC from that era to find out. Any memories? Thanks - Phil Davis -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: TIFF support in the past?
Thank you Mark! Phil On 1/24/20 12:14 AM, Mark Waddingham via use-livecode wrote: I think the player object would show tiff files back when it was QT driven - the engine itself has never natively supported tiff. Warmest Regards, Mark Sent from my iPhone On 24 Jan 2020, at 08:01, Phil Davis via use-livecode wrote: I'm trying to find out if there was a time in the distant past when LC supported the TIFF image format. I found some TIFF image assets in some subfolders of a project from back then (maybe 10 or more years ago?) but can't run a copy of LC from that era to find out. Any memories? Thanks - Phil Davis -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
TIFF support in the past?
I'm trying to find out if there was a time in the distant past when LC supported the TIFF image format. I found some TIFF image assets in some subfolders of a project from back then (maybe 10 or more years ago?) but can't run a copy of LC from that era to find out. Any memories? Thanks - Phil Davis -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: shell() and pdftotext
To find the full path, this may work - open Terminal and type: which pdftotext and it should display the path to the copy of pdftotext that the OS runs when you type the 'pdftotext' command. Phil Davis On 1/12/20 2:00 PM, Brian Milby via use-livecode wrote: My guess is that shell can’t find your executable. Try using full paths. Thanks, Brian On Jan 12, 2020, 2:54 PM -0500, Hillen Richard via use-livecode , wrote: Hello, I want to extract .txt from a pdf-file using Livecode 9.5 on macOS Catalina. Therefore I installed from http://www.xpdfreader.com/ the xpdf-tools-mac-4.02 and using the Terminal with „pdftotext /Users/hillen/Desktop/inter.pdf“ I get a clean text-file inter.txt. Wonderful! So I hopefully wrote in Livecode: —— put "/users/hillen/Desktop/inter.pdf" into fn put "pdftotext " & fn into Kommando if there is not a file fn then answer „no SourceFile!" exit to top end if get shell(quote & Kommando & quote) answer it & return & the result —— But extracting doesn´t work and I get the answer: /bin/sh: line 1: pdftotext /users ……pdf: No such file or directory and the result ist 127. Typing to Terminal „pdftotext“ I get a List with command-options. With get shell(„pdftotext“) with and without quotes I get the answer „/bin/sh: line 1: pdftotext: command not found“ What is wrong? May you please help? Richard. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Indy 9.5.0. Apple can't search for malware in LC Indy?
On 11/5/19 12:26 PM, Paul Dupuis via use-livecode wrote: I am sure it is possible. I just don't have the PHP/HTML/Javascript/whatever skills to do that. Me neither. I do it either directly in a .lc server page, or else the .lc page starts using a stackfile that does it. (fiddling around with different machines...) It appears the $_SERVER[HTTP_USER_AGENT] server global might provide an adequate distinction between OSes on requesting machines. I just ran a 'globals.lc' server page from 3 different Macs with different OS versions and got this info returned: $_SERVER[HTTP_USER_AGENT] = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36 $_SERVER[HTTP_USER_AGENT] = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36 $_SERVER[HTTP_USER_AGENT] = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15 My server's globals.lc page looks like this on the inside: " after tOutput end repeat put tOutput ?> Phil Davis On 11/5/2019 12:02 PM, Phil Davis via use-livecode wrote: On this issue, isn't it possible to let a web server detect the OS requesting the download? So the server can then do the picking and send the right version to the requestor? Or maybe the info available to the server about the requesting OS isn't that detailed. Not sure. At least I'm sure I can use a single download link for an app's Mac and Windows installers. Phil Davis On 11/5/19 8:33 AM, Paul Dupuis via use-livecode wrote: I'm not saying YOUR experience is invalid. I guess I am just saying we have really really really computer naive customers and Apple has gone and complicated things and it creates a support burden for us that we would not have had to expend resources addressing if Apple had not done this. Apple has, and there is no going back, so it is what it is, but it is really really annoying! :-( On 11/5/2019 11:23 AM, Bob Sneidar via use-livecode wrote: But the installers for drivers and the installer you want to use are not different. And what else does anyone have to go on but their experiences, and other people's experiences? I need to tap into that resource! ;-) Bob S On Nov 5, 2019, at 08:18 , Paul Dupuis via use-livecode wrote: On 11/5/2019 10:41 AM, Bob Sneidar via use-livecode wrote: First, your assumption that "it's one everyone is experiencing for any installer" is exactly that, an assumption based on your experiences. The vast majority of our customers are computer novices and anything but the simplest of steps can cause them problems. Most do not know what version of macOS they run, nor how to tell what version they are running. Second, I was not calling for RunRev to "fix" this. It is clearly Apple's inane drive for marketing a level or privacy and security that is mostly a gigantic lie that is the cause. And thirdly, drivers are a bit different than research apps. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Indy 9.5.0. Apple can't search for malware in LC Indy?
On this issue, isn't it possible to let a web server detect the OS requesting the download? So the server can then do the picking and send the right version to the requestor? Or maybe the info available to the server about the requesting OS isn't that detailed. Not sure. At least I'm sure I can use a single download link for an app's Mac and Windows installers. Phil Davis On 11/5/19 8:33 AM, Paul Dupuis via use-livecode wrote: I'm not saying YOUR experience is invalid. I guess I am just saying we have really really really computer naive customers and Apple has gone and complicated things and it creates a support burden for us that we would not have had to expend resources addressing if Apple had not done this. Apple has, and there is no going back, so it is what it is, but it is really really annoying! :-( On 11/5/2019 11:23 AM, Bob Sneidar via use-livecode wrote: But the installers for drivers and the installer you want to use are not different. And what else does anyone have to go on but their experiences, and other people's experiences? I need to tap into that resource! ;-) Bob S On Nov 5, 2019, at 08:18 , Paul Dupuis via use-livecode wrote: On 11/5/2019 10:41 AM, Bob Sneidar via use-livecode wrote: First, your assumption that "it's one everyone is experiencing for any installer" is exactly that, an assumption based on your experiences. The vast majority of our customers are computer novices and anything but the simplest of steps can cause them problems. Most do not know what version of macOS they run, nor how to tell what version they are running. Second, I was not calling for RunRev to "fix" this. It is clearly Apple's inane drive for marketing a level or privacy and security that is mostly a gigantic lie that is the cause. And thirdly, drivers are a bit different than research apps. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: server push to desktop client
Thanks for sharing your insight Richard. Great food for thought. Phil On 11/5/19 12:29 AM, Richard Gaskin via use-livecode wrote: Phil Davis wrote: > I need to make a desktop app (Mac only for now) that receives pushed > data from a LC server. I've never done this - all the desktop <-> > server interactions I've programmed have used the traditional client- > server model. So I'm looking for approaches/tips/ideas from anyone > who has experience with other approaches. I'd stick with simple polling for this. Anything else requires either opening a socket (with all the firewall/router changes needed to allow that), or creating a dependency on a separate process like push notifications, which would likely require LCB. Polling can get the job done well enough, and is secure and requires no router changes or external dependencies. And if down the road you find a convenient way to switch to something else you can change that part, but at least it lets you get it out the door now using reliable features and your existing skillset. > And maybe I'm making it too hard. Can FTP watch a server folder, and > detect and respond to the creation of a file in the folder? Maybe I > could use a method like that, if that's a capability of FTP. You could poll from the client using FTP, but compared to HTTP it's a noisy protocol, with many more steps internally. The inefficiency of FTP is more than offset by its utility when ad hoc access to remote file stores are needed. But when the goal is more specific, HTTP will often beat it for both efficiency and client implementation cost every time. On the server, an LC Server script that reports any changes to a folder from the last time it was called would be straightforward to write, give you reliably consistent results*, and would run quickly. * Years ago when I was monitoring folders with FTP I learned more than I cared to about FTP date representations. They vary. A lot. By different rules, according to a vastly flexible set of config options. So you can never know which server will use month-and-day only up to a certain cutoff, and then one of several month-day-year options for anything older. Sometimes the cuttoff is a month. Sometimes it's the year break. Other times it's a specific number of days. "Hey man, it's all about flexibility!" In all cases it can mean a listing in which date representations take on at least two different formats. Even if you just had LC Server return "the detailed files" at least you'd have solid consistency in the format of every file, every time. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: server push to desktop client
Thank you Kee! This is extremely helpful. Phil On 11/5/19 12:38 AM, Kee Nethery via use-livecode wrote: Normal data flow is Mac app contacts a central server and sees if there is updated data to acquire. If yes, it acquires it. This is the normal flow because of firewalls and ports. For the server to really push data to a Mac client, the Mac client has to be a server, with a routable IP address / port. Most client machines are behind firewalls that allow them to initiate contact, but do not allow random external machines to contact them. So the normal setup is, server has a dns entry on an IP address that anyone can reach from anywhere on the Internet. Server is listening on a single port for incoming connections. Assuming the same data (updates) goes to each client, server has a text page containing a single integer. That integer is the number of the latest update. Client hits that web page periodically to see if its internal integer is different from the server. It’s a very quick exchange. Client sees their internal integer isn’t the same. Let’s say client has 92 and server has 103. Client then hits pages 93 to 103 to get all the updates. For example: http://my.server.com/updates/93.txt All the way to: http://my.server.com/updates/103.txt On the server side, you create update pages and increment the integer at something like: http://my.server.com/updates/last.txt The server is fast because it serves up static pages and the fastest page is last.txt because it’s only (in this example) three characters “103”. I’m assuming all clients get the same data. When each client gets unique data, you’ll probably have a database on the server and clients will do hits against the server to see if they have new data to gather, and if yes, they’ll do their query with their userid to gather their data. The trade off between server text pages and server database responses is one of those things you’ll need to figure out which is most efficient for you. Could be you ship a client that can do both and the very first hit to the server is a static page that tells the client “text” or “database” and then the client does the right thing. Could periodically check that page and perhaps you have a flag on it like “database always” that tells the client to stop checking, all updates forever will be the database update process. But ... client pulls from the server because most servers cannot push through firewalls and routers an NAT servers to initiate first contact with a client. Kee Nethery On Nov 4, 2019, at 11:26 PM, Phil Davis via use-livecode wrote: I need to make a desktop app (Mac only for now) that receives pushed data from a LC server. I've never done this - all the desktop <-> server interactions I've programmed have used the traditional client-server model. So I'm looking for approaches/tips/ideas from anyone who has experience with other approaches. I'm not sure what protocol to use. And maybe I'm making it too hard. Can FTP watch a server folder, and detect and respond to the creation of a file in the folder? Maybe I could use a method like that, if that's a capability of FTP. Thanks for any input you may offer. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
server push to desktop client
I need to make a desktop app (Mac only for now) that receives pushed data from a LC server. I've never done this - all the desktop <-> server interactions I've programmed have used the traditional client-server model. So I'm looking for approaches/tips/ideas from anyone who has experience with other approaches. I'm not sure what protocol to use. And maybe I'm making it too hard. Can FTP watch a server folder, and detect and respond to the creation of a file in the folder? Maybe I could use a method like that, if that's a capability of FTP. Thanks for any input you may offer. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: identifying text chars in an image
Thanks for your great ideas Hermann. In my next experiment I think I'll start by looking for any scrabble tile by looking for its [known] background color, and then work out to its edges. That should give me both the grid cell size and a starting point for discovering all cells in the grid. Unless anyone knows of something simpler? Thanks - Phil On 10/28/19 5:43 PM, hh via use-livecode wrote: Phil D. wrote: So maybe I should first be asking about detecting the grid established by the scrabble letters. You need some criteria to find the topleft of the grid and the size of one letter: color/transparency/a marker(fixed image part)... You could also use pattern recognition for that. Then it's the easy part to get all possible letters by computing the grid and crop (get from imageData) the grid elements by script. Then doing the OCR for each single char. If you need that for a standalone, then 'tesseract' with its huge language packs is probably not appropriate and 'ocrad' could be good enough for that. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: identifying text chars in an image
One thing I found is when I cropped my test image to include only one horizontal word, tesseract handled that fine. So... if I could detect the grid pattern in which all the letters are laid out, maybe I could feed the letters to an OCR tool one word or char at a time and get the results I'm looking for. That would also give me clear info about spatial relations between the letters, so I could group them correctly into words. So maybe I should first be asking about detecting the grid established by the scrabble letters. (It's actually Bananagrams letters. My nerdy grandkids like to use Scrabble letters when playing Bananagrams so they can see who gets high score.) Thanks - Phil On 10/28/19 2:23 PM, Phil Davis via use-livecode wrote: Thanks for the followup on this. I experimented some with tesseract and came to the same conclusion. Since the values assigned to each character are standard wthin Scrabble, I don't really need to detect those tiny numerals. But the alpha chars are of course essential. I believe there must be a way to get there. Thankfully no one is pressuring me to finish it, so I can explore. Phil On 10/28/19 1:57 PM, hh via use-livecode wrote: After a second read I think it will be hard to find a service to do that for you. And this is not doable using tesseract or similar from LiveCode: AFAIK, no "ordinary" OCR software is able to detect and read horizontal *and* vertical text and distinguish clearly between the board's "Score text" and the "Scrabble letters". You (or your service) would have to write an own "learning routine" for that. E.g. the algorithm described here: http://rasdasd.com/projects/Scrabble_Detector/Scrabble_Paper.pdf There are also approaches for own specialized boards like here https://github.com/eladj/ScrabbleOCR You could try to use the java from there via LC Builder's FFI. Phil D. wrote: I want to [programmatically] take a picture of a Scrabble board and then take from that image the characters displayed in it, and maintain the organization of the text. In other words, I want to convert the text displayed in the image to text strings. Any ideas where I should start? I would love to be able to do it in my app. However I'm not completely against uploading the image to a service that would do it for me; I am only mostly against it. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: identifying text chars in an image
Thanks for the followup on this. I experimented some with tesseract and came to the same conclusion. Since the values assigned to each character are standard wthin Scrabble, I don't really need to detect those tiny numerals. But the alpha chars are of course essential. I believe there must be a way to get there. Thankfully no one is pressuring me to finish it, so I can explore. Phil On 10/28/19 1:57 PM, hh via use-livecode wrote: After a second read I think it will be hard to find a service to do that for you. And this is not doable using tesseract or similar from LiveCode: AFAIK, no "ordinary" OCR software is able to detect and read horizontal *and* vertical text and distinguish clearly between the board's "Score text" and the "Scrabble letters". You (or your service) would have to write an own "learning routine" for that. E.g. the algorithm described here: http://rasdasd.com/projects/Scrabble_Detector/Scrabble_Paper.pdf There are also approaches for own specialized boards like here https://github.com/eladj/ScrabbleOCR You could try to use the java from there via LC Builder's FFI. Phil D. wrote: I want to [programmatically] take a picture of a Scrabble board and then take from that image the characters displayed in it, and maintain the organization of the text. In other words, I want to convert the text displayed in the image to text strings. Any ideas where I should start? I would love to be able to do it in my app. However I'm not completely against uploading the image to a service that would do it for me; I am only mostly against it. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: identifying text chars in an image
Thanks Richmond and hh - really appreciate these ideas. I'll be looking into them. Phil On 10/28/19 7:26 AM, hh via use-livecode wrote: There are also emscripten ports to javascript you could use via a browser widget (and a CDN if online). https://tesseract.projectnaptha.com https://antimatter15.com/ocrad.js/demo.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
identifying text chars in an image
I want to [programmatically] take a picture of a Scrabble board and then take from that image the characters displayed in it, and maintain the organization of the text. In other words, I want to convert the text displayed in the image to text strings. Any ideas where I should start? I would love to be able to do it in my app. However I'm not completely against uploading the image to a service that would do it for me; I am only mostly against it. Thanks for any ideas to may have. -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Can I find out what handler I am in?
Tom, param(0) contains the name of the handler you're in. on mouseUp put param(0) end mouseUp Would put into the message box: mouseUp Phil Davis On 10/25/19 10:00 AM, Tom Glod via use-livecode wrote: Hey you guys, I have searched high and low and I am pretty sure the answer is no , but I wanted to make sure before I did a feature request and a workaround. But is there a function that I can call inside a handler that will tell me the name of the handler? Just like the params() tells me the parameters of the current handler? -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Possible solution to determine if default network has changed (MacOS only for now)
I'm guessing you meant "route -v get default" ? Otherwise I don't get much back from the command. Phil Davis On 10/22/19 11:05 AM, Bob Sneidar via use-livecode wrote: Hi all. MacOS only for now. I think I put together a way to tell if the default network has changed since the last time an internet connection took place. It's no good of course, just getting the IP address, as given an identical subnet, you have a 1 in 254 change of getting the same IP address on a different network. We want to be absolutely certain. Similarly, the gateway, subnet mask and DNS might also be identical. Finally, the only adapter we care about is the one that is being used as the default route to the internet or local resources. (there may be more than one active adapter, as in the Ethernet and Wireless adapters). The trick is to get the MAC address of the router, then store it and compare it each time you attempt to communicate. Here's what I came up with. Feel free to chide me if I am overthinking this: on mouseUp put "route get default" into tShellCommand put shell(tShellCommand) into tDefaultAdapter put lineOffset("Interface: ", tDefaultAdapter) into tInterfaceLine if tInterfaceLine = 0 then answer info "No default interface found!" as sheet exit mouseUp end if put word 2 of line tInterfaceLine of tDefaultAdapter into tDefaultInterface put "ipconfig getpacket " & tDefaultInterface into tShellCommand put shell(tShellCommand) into tInterfaceDetail put lineOffset("router (ip_mult): ", tInterfaceDetail) into tRouterLine put word 3 of line tRouterLine of tInterfaceDetail into tRouterAddress put char 2 to -2 of tRouterAddress into tRouterAddress put tRouterAddress put "arp " & tRouterAddress into tShellCommand put shell(tShellCommand) into tArpReply put word 4 of tArpReply into tDefaultMACAddress end mouseUp Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Where LiveCode is Now
Amen Bob! Phil Davis On 10/3/19 9:31 AM, Bob Sneidar via use-livecode wrote: For my part I love what you guys do. As I've mentioned before, Livecode has upped my value to my employer, as they see that I am capable of more than what they hider me to do. It may even have been responsible for a couple raises in the recent past. Also as I have mentioned before, I have never seen a company so responsive to it's users, and also so transparent. We have people *actually* involved in the development process come on list and tell us what they are doing and planning. Seriously, you guys do not get enough credit for how hard you work. Bob S On Oct 3, 2019, at 09:25 , Heather Laine via use-livecode wrote: Dear List Folks, I'd like to reassure you, the team is anything but idle, and the fruits of their labours are coming your way. I don't wish to steal Pano's thunder, but you should look for an announcement on 9.0.5 tomorrow (all being well with the build, which is currently undergoing final checks. Probably I've just jinxed it by mentioning a release date, in direct contravention of my rules.) 9.0.5 has had a fix shoehorned into it for the nasty debugger crashing that was reported not long ago. 9.5.1 is well under way and shouldn't be long now, bringing the needed updates for iOS among other things. I'm not going to even hint at a release date of next week for this, its certain to cause a #fail. 9.6 is in progress with some nice new features and a first dp is not far off. Real Soon Now :). Yes, it has taken a little longer than usual between releases. A major reason for this was the server move, which impacted our build bots and delayed all test builds. Frustrating, but necessary work, and thankfully that is all done now and everything is working smoothly again. One does not appreciate the full complexity of these build bots until one attempts to move them intact from one place to another. The suggestion that all our efforts will remain with LCFM Native and never bear fruit for LiveCode itself is based on a misconception, an idea that somehow we are working on something other than LiveCode. We're not. Everything we are building for LCFM Native is built with LiveCode. We cannot do it without improving LiveCode. Those improvements will come back to the community (many already have). Hermann... its not an infinite effort. FileMaker is very much a finite set of code, with relatively slow changes. I hope you will like 9.0.5, 9.5.1 and 9.6, we're looking forward to bringing them to you. Best Regards, Heather Heather Laine Customer Services Manager LiveCode Ltd www.livecode.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Stacks and Sub Stacks
On 9/25/19 7:43 AM, Sannyasin Brahmanathaswami via use-livecode wrote: Related: if you have this in the message box. put the openstacks you only get the 1. presently open binary stacks 2. any script only stack that you explicitly have open in the IDE Some more options: put revLoadedStacks() This returns a list of all [binary] stacks in memory, both main & sub, whether they are open or not. put the mainStacks Returns a list of all mainstacks in memory, including script-only stacks, whether open or not. But, can you we a list of all stacks available to the message path "right now" We can query the stack files, but they are included with stack, but not necessarily open. And the stackFiles may list some stacks that no longer exist in those locations. ' The stackFiles of stack "myStack" ' is a user-supplied setting. It can get out of sync with reality pretty quickly as an app's folder tree changes. (but I guess you could script it to keep it current) My $0.02 - Phil Davis Another say to put this is when doing a start using "MyControls.livecodescript" …later on, how do you query for all stacks "open" by "start using" BR Hi. You probably mean script-only stacks. Substacks are just stacks, but they live in the same file as the mainStack. It helps with organization, and when you save one, you save them all. You can only have one mainStack, but as many subStacks as you like. For me, I have projects that use substacks for, say, data entry. The subStack is built just for that purpose. When making a standalone, substacks are included in the final package. Just practice a bit. Craig ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Audio Recording with cameracontrol
Hi Dan, I haven't used cameracontrol, but... In a Mac-only app I built for a client, I used the 'sox' commandline app for recording. It has been quite reliable now for several years. Like so: command audio_startRecording* * put into sRecorderApp put into sFilename put sRecorderApp \ && "-q -d -r 22050 -b 16 -e signed -c 1" \ && sFilename \ into sCommand -- settings are for recording speech open process sCommand for neither end audio_startRecording command audio_stopRecording -- get the sox process ID filter shell("ps -A") with ("*" & sRecorderApp & "*") into tList put word 1 of tList into tPID -- end the sox process put shell("kill -s INT" && tPID) into sCommandStatus # Tells 'kill' to send SIGINT to the recorder app - equivalent to control-c in Terminal -- close the LC process put empty into tResult try close process sCommand put the result into tResult catch tErr put tErr into tResult end try -- return the filename return sFilename end audio_stopRecording I imagine there are other commandline apps that would work as well. Hope this helps - Phil Davis On 9/20/19 2:27 PM, Dan Soneson via use-livecode wrote: I am trying to update audio recording capabilities in LiveCode, now that we soon won't be able to use QuickTime any longer, even on Macs. I've been trying to use cameracontrol to do the recording, but have quickly run into 2 major bugs, I think - one an absolute showstopper: I set the videoDevice to empty, so as to only record the audio. It seems I am able to record audio only for 10 seconds or less. Once I go beyond 10 seconds the resulting file is unreadable, and simply doesn't play in the player. Can anyone get a successful, playable audio recording longer than 10 seconds? When I enable the video recording as well, I get a lovely video recording with audio if the recording is 10 seconds or shorter. Once the video is longer than 10 seconds, there is no audio at all but the video is still lovely. So the file plays, but there is no audio. Am I alone in experiencing these problems? Is there another way to do audio recording, since we can no longer do "record sound" (since it is not available for Windows, and is restricted to 32 bit applications on Mac)? Platform: MacOS Mojave LiveCode Business 9.04 Thanks, Dan ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis 503-307-4363 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Duplicate card and object command lc 9.0.4
Hi Muaadh, Try this: Go to the card you want to duplicate and in the Message Box type "clone this card". It isn't exactly the answer to your question but it should give you the outcome you desire. Phil Davis On 6/7/19 11:15 AM, Muaadh Salih via use-livecode wrote: Until now I was using LC 7.1..4 with very few ( solvable ) problems. I installed the latest version (9.0.4) and noticed that "Duplicate Card " command , form either line command or menu click produced nothing . . I know I can use copy and paste but this requires reediting existing stacks with , sometime , unwanted problem. This issue concerns "duplicate Card" only . It works fine for duplicating other stack object. I have removed old preference fines and this installation is a clean one. but still can not duplicate card . His this command being disabled in 9.0.4 ? We are putting up a course module in "programming for humanities " degree and want student to be confident on what they are using . Thanks for the help Muaadh - ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Design questions...
Hi Glen, There are some screen resolution stats on the web that may be useful, at least for 'general public' app window sizes: https://en.wikipedia.org/wiki/Display_resolution Phil Davis On 6/6/19 6:47 AM, Glen Bojsza via use-livecode wrote: Hello, I was looking for input on the following design questions...I haven't done anything for years so I am looking for other developers' experiences. 1. what would be considered the smallest stack size for a desktop app? 2. Does the above fill most of the screens in use today ...ie what is the noraml or considered the standard screen resolution for a desktop laptop? 3. Are apps considered acceptable if the user needs to scroll down to see the full app. 4. Are menu bars (ie File Open) still necessary or are users familiar enough with section buttons? 5. If the stack is too large for a user (say they use a lower resoultion screen notebook then is there a way to detect this and have scroll bars appear? I appreciate any insights the list may have. regards, Glen ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Black boxes replace images in Mojave (Was "No subject")
As it turns out, the Remove script uses the sips command. (* Remove ©2009 Apple, Inc. Use sips to remove embedded profile and color management data from an image. *) on run display dialog "Remove the embedded profile from an image." set chosenFile to choose file with prompt "Choose an image " default location path to desktop folder open chosenFile end run on open draggedItems repeat with thisFile in (draggedItems as list) try -- use 'sips -d profile' to remove an embedded profile -- or use 'sips -d profile --deleteColorManagementProperties' to remove an embedded profile and other color related info set filePath to quoted form of POSIX path of thisFile set cmdLine to ("sips -d profile --deleteColorManagementProperties " & filePath) as string do shell script cmdLine end try end repeat end open Phil Davis On 6/4/19 2:14 PM, Matthias Rebbe via use-livecode wrote: Tom, see answer below Am 04.06.2019 um 23:02 schrieb tbodine via use-livecode mailto:use-livecode@lists.runrev.com>>: Mark and Matthias, This workaround looks promising! While I don't have Mojave to test against, I do find problem images have many different colorSync profiles. Matthias, after you have stripped out the profile, what does Preview's Info screen show as the ColorSync Profile data? Both methods, Marks one terminal command: sips -d profile --deleteColorManagementProperties ~/Downloads/Background_mit_Rand_.png and my... dragging the image onto Remove.app in /library/scripts/colorsync/ replaces the ColorSync Profile to sRGB IEC61966-2.1 Regards, Matthiass I'm thinking it would be good to have an acceptable default value that I can tell users is OK, and anything else should be stripped. Thanks to your both! Tom Bodine -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html <http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html> ___ use-livecode mailing list use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com> Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: button ICON
Thanks hh - I concur. Your approach seems cleaner. Phil On 4/22/19 9:20 AM, hh via use-livecode wrote: As Phil said, but don't set the text of the (empty) image used as icon of the button but set the filename of the image. The icon will change accordingly. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: button ICON
Hi Klaus, The only method I can think of is where you set the icon of a button to the id of an image object, and then set the text of that image object to the binfile url of different image files. That does work, but may not be what you're looking for. Best - Phil Davis On 4/20/19 9:36 AM, Klaus major-k via use-livecode wrote: Hi friends, I have a vague memory that we can use images as icons in buttons WITHOUT putting them in an image object first. Am I right or was I dreaming? :-) Thanks for any hints. Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: What is Macintosh equivalent of relaunch handler?
Or another approach might be to open the invisible app as a process in the UI app. On 3/29/19 10:50 AM, Phil Davis via use-livecode wrote: Hi Bill, It sounds like this is your scenario: You have an app with UI that is running, and you want it to occasionally send/receive info to/from another invisible 'helper' app. Is that correct? If so, can you use sockets in your environment? That would be a simple way to get the interaction you want between the 2 apps. Or maybe I misunderstand your scenario. Best - Phil On 3/29/19 10:41 AM, Bill Vlahos via use-livecode wrote: Doing this on startup works perfectly but I don’t see how my app can get notification any other way while it is running. I’ve tried openCard, preOpenCard, openStack, preOpenStack, and resumeStack but no luck. Bill On Mar 29, 2019, at 12:14 AM, Richard Gaskin via use-livecode wrote: To get the args, just know that any word is an arg, and a quoted string counts as one word, so this: on startup put $1 & $2 & $3 end startup ...when call from: ./myapp ThisIsArg1 "And this is a multi-word arg" "this,is,delimited" ...would give you: ThisIsArg1 "And this is a multi-word arg" "this,is,delimited" From there you can parse to your heart's delight. That is, once we figure out how your app will get notification... ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: What is Macintosh equivalent of relaunch handler?
Hi Bill, It sounds like this is your scenario: You have an app with UI that is running, and you want it to occasionally send/receive info to/from another invisible 'helper' app. Is that correct? If so, can you use sockets in your environment? That would be a simple way to get the interaction you want between the 2 apps. Or maybe I misunderstand your scenario. Best - Phil On 3/29/19 10:41 AM, Bill Vlahos via use-livecode wrote: Doing this on startup works perfectly but I don’t see how my app can get notification any other way while it is running. I’ve tried openCard, preOpenCard, openStack, preOpenStack, and resumeStack but no luck. Bill On Mar 29, 2019, at 12:14 AM, Richard Gaskin via use-livecode wrote: To get the args, just know that any word is an arg, and a quoted string counts as one word, so this: on startup put $1 & $2 & $3 end startup ...when call from: ./myapp ThisIsArg1 "And this is a multi-word arg" "this,is,delimited" ...would give you: ThisIsArg1 "And this is a multi-word arg" "this,is,delimited" From there you can parse to your heart's delight. That is, once we figure out how your app will get notification... ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LC application running on lab computers
Hi Peter, Is it possible you're running LC in a user account that doesn't have "admin" permissions? I suggest this because they are lab computers. You can check Apple menu > System Preferences > Users & Groups > [username] to find out. Phil Davis On 3/27/19 11:20 PM, Peter Bogdanoff via use-livecode wrote: In attempting to create this folder in MacOS: put specialFolderpath("asup") & “/My Folder" into tURL [which yields tURL: /Library/Application Support/My Folder ] create folder tURL returns a result: can't create that directory Why the error? Peter ArtsInteractive On Mar 27, 2019, at 2:38 PM, Peter Bogdanoff via use-livecode wrote: Thanks all! I’ll check these out. Peter On Mar 27, 2019, at 2:28 PM, Ralph DiMola via use-livecode wrote: These are the public ones on Win 10: 25 C:/Users/Public/Desktop 46 C:/Users/Public/Documents 53 C:/Users/Public/Music 54 C:/Users/Public/Pictures 55 C:/Users/Public/Videos Used this in the message box: put empty into msg;repeat with i = 1 to 100;if specialFolderPath(i) contains "public" then put i&(i) after msg;end repeat Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Klaus major-k via use-livecode Sent: Wednesday, March 27, 2019 5:04 PM To: How to use LiveCode Cc: Klaus major-k Subject: Re: LC application running on lab computers Hi Peter, Am 27.03.2019 um 21:59 schrieb Peter Bogdanoff via use-livecode : Hi, My application is being installed on Windows machines in a school lab. The admin is having trouble because I’m writing preference files to the Users\\ folder and when another user logs in, the file is not available. This may be a problem in the future for Macs as well. These same preference files should be accessed by all users. The specialFolderPath functions don’t seem to have one for a root level Library/Preferences folder. Is there otherwise a best, or even workable practice for this scenario? you could use these 2 undocumented specialfolderpath() codes for Windows: -> specialFolderPath(35) -> prefs folder for ALL users -> specialfolderpath(26) -> dito for the current user only! Not sure this is still working on Win 10, but worth a try. :-) Check this in the IDE with the messagebox: put specialFolderPath(35) Peter Bogdanoff ArtsInteractive Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LiveCode Localization?
I considered qualifying that phrase, but... nh. On 3/18/19 3:52 PM, Bob Sneidar via use-livecode wrote: The hell I am! ;-) Bob S On Mar 17, 2019, at 17:31 , Phil Davis via use-livecode wrote: To add a new language, we clone an existing YAML file and translate it, and adjust the RTL/LTR training UI orientation settings as needed. Add the YAML file into the next build of the content editor and Bob's your uncle. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LiveCode Localization?
On 3/17/19 5:31 PM, Phil Davis via use-livecode wrote: Hi Kee, I support a training development & delivery system that currently supports training in English, Spanish and Arabic. The training dev environment is English only, but the training content you can create with it can be in those other languages. When we added support for Arabic a couple of years ago, we switched from trying to maintain everything in custom properties and using a separate template stack for each language, to storing all language-specific settings (RTL vs LTR, etc) and default content in YAML files. Now we can easily add new languages with no changes needed to code (at least in theory - it seems to work out perfectly). Oops - should say "it NEVER seems to work out perfectly." To add a new language, we clone an existing YAML file and translate it, and adjust the RTL/LTR training UI orientation settings as needed. Add the YAML file into the next build of the content editor and Bob's your uncle. Best - Phil Davis On 3/16/19 1:17 PM, kee nethery via use-livecode wrote: Does anyone on this list have an app that you localize into other languages (French, German, Japanese, etc)? If so, I’d like to ask you how you support localization. Want to see if there is a common method since LiveCode does not support the techniques used by macOS, iOS, Android, Windows. Thanks, Kee Nethery ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LiveCode Localization?
Hi Kee, I support a training development & delivery system that currently supports training in English, Spanish and Arabic. The training dev environment is English only, but the training content you can create with it can be in those other languages. When we added support for Arabic a couple of years ago, we switched from trying to maintain everything in custom properties and using a separate template stack for each language, to storing all language-specific settings (RTL vs LTR, etc) and default content in YAML files. Now we can easily add new languages with no changes needed to code (at least in theory - it seems to work out perfectly). To add a new language, we clone an existing YAML file and translate it, and adjust the RTL/LTR training UI orientation settings as needed. Add the YAML file into the next build of the content editor and Bob's your uncle. Best - Phil Davis On 3/16/19 1:17 PM, kee nethery via use-livecode wrote: Does anyone on this list have an app that you localize into other languages (French, German, Japanese, etc)? If so, I’d like to ask you how you support localization. Want to see if there is a common method since LiveCode does not support the techniques used by macOS, iOS, Android, Windows. Thanks, Kee Nethery ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Compiling Livecode
After using Parallels for a few years, I realized I hate virtual environments. What I really do like, however, is having a Windows 10 physical machine's desktop available in a window on my Mac, much like Mac-to-Mac Screen Sharing. (I recently discovered MS Remote Desktop - no going back!) I guess I could do something similar with machines running earlier versions of Windows but haven't tried yet. Phil Davis On 3/6/19 3:39 PM, Bob Sneidar via use-livecode wrote: Don't have it switch. You can share anything, or else not. You cn use coherence view, or not. I personally like sharing my Mac environment with my PC environment (folder redirection and all that) because it makes it simple to collaborate between the two environments. Recently I was able to IMPORT a VMWare VM into Parallels, becaue the VMWare player wouldn't run the Virtual Machine I was given because it wasn't able to emulate some kind of processor mode! ICK! I hate crap like that! Bob S On Mar 6, 2019, at 03:57 , David Bovill via use-livecode wrote: Thanks Eric, I may well go that route. I've run Parallel before - but I found all the switching, and space it took up a bit much. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Need crash course in Dropbox library
I'm not sure how this would work in your context, but one way to break up a file into pieces is to use open / read / close like this: # assumes LC 9.0.2 # tMyFolder = path of folder containing the file to upload # tMyFileShortFilename = 'short' filename of file to upload - no path, just the filename # tMyFilePath = full path of file to upload filter files(tMyFolder, "detailed") with tMyFileShortFilename & ",*" into tFileDescription put item 2 of tFileDescription into tBytesRemaining put 0 into tBytesProcessed put 157286400 into tChunkSize -- 150 MB put tChunkSize into tBytesThisRead open file tMyFilePath for binary read repeat until tBytesRemaining = 0 read from file tMyFilePath for tBytesThisRead subtract length(it) from tBytesRemaining _processChunk it put min(tChunkSize, tBytesRemaining) into tBytesThisRead end repeat close file tMyFilePath Your upload would be done in the '_processChunk' handler. HTH - Phil Davis On 2/18/19 5:21 AM, pink via use-livecode wrote: I'm getting a little closer... 1. how do I break fileContents into smaller pieces? 2. how do I properly calculate the pOffset value? Matthias Rebbe via use-livecode wrote Hey pink Yes, you are just going to put 150MB at a time into the pData parameter and ship it. I have not uploaded any binary files, just encoded text files, so you may have to fiddle with encoding to make sure you don't get into any trouble. You should be able to open/read the files using put url "binfile:/" into fileContents On Sun, Feb 17, 2019 at 10:42 AM pink via use-livecode < use-livecode@.runrev wrote: the phxDropbox library is for v1 of the Dropbox API, which has been deprecated what I need is to get a handle of the upload session commands, how do I properly break the file data into seperate sessions, and how do i determine the offset value Matthias Rebbe via use-livecode wrote Don't know if this works anymore but before i used this: *on*openstack *if* thereisnotastack"phxDropboxLib"*then* *put*GetPathToFile("phxDropboxLib.livecode") intophxLib *start*usingstackphxLib *else* *if* "phxDropboxLib"isnotamongthelinesofthestacksinuse*then* *start*usingstack"phxDropboxLib" *end* *if* *--* *if* "phxDropboxLib"isnotamongthelinesofthestacksinuse*then* *answer*error"Unable to load phxDropboxLib" *quit* *end* *if* *constant*myAppKey = "appappappapp" *constant*myAppSec = "secsecsec" *constant*myTokKey = "toktoktoktok" *constant*myTokSec = "sectoksectok" *--* *if* notphx_DropboxAvailable() *then* *answer*"Dropbox HTTPS connection NOT available" *end* *if* *get*phx_DropboxInitLib(myAppKey, myAppSec, myTokKey, myTokSec) end openCard reading *put*phx_DropboxReadFile("sandbox", ("/folder/some.txt")) intoField"Name1"ofcard1 writing-- *put*phx_DropboxWriteFile("sandbox", ("/folder/some.txt"), "text/html", true, myName) intofield"udontcme"ofcard1 --close--- *on*closeStack *set*theuTokenKey ofthisstacktoempty *set*theuTokenSec ofthisstacktoempty *stop*usingstack"phxDropboxLib" *close*stack"phxDropboxLib" *pass*closeStack *end*closeStack Op 16-2-2019 om 00:23 schreef pink via use-livecode: under the documentation for dropboxUpload, it states it shouldn't be used for files larger than 150MB, the video files will all be around 800MB I've been looking through the stack, but cannot find the answers I am looking for. SO I am still not clear how I should get my file into pData and pData is just a chunk of the data? How do I make that chunk out of the whole and where do I get pOffset from? Matthias Rebbe via use-livecode wrote Hey, pink, thanks for the clarification. First of all, is there a reason why you are doing it this way instead of using dropboxUpload? If you use dropboxUpload you can do it all in one shot. Gerard's stack explains the process and how to use the various commands Doing it the way you are doing it, you would start with sessionStart and then you would repeatedly call sessionAppend pOffset is the length of what you have already sent because there are no guarantees that dropbox will get your file stream in order, so if it gets them out of order and pData isn't the same length for each call to append, the only way dropbox knows where to put the data it just received is if you tell it where to put it. pData should be at most 150mb per call. ___ use-livecode mailing list use-livecode@.runrev Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode - --- Greg (pink) Miller mad, pink and dangerous to code -- Sent from: http://runtime
Re: how to write control-c to an open process?
I just found a different way to accomplish the same outcome. Instead of writing some special form of control-c to the process, I can get the ID of the process and issue a 'kill' shell command for that ID using the 'kill' format option that sends the same signal as the one sent by typing control-c. The outcome is identical to control-c but no control chars are required. So this works: kill -s INT Where is the numeric ID of the process I want to end. *whew* Thanks - Phil On 1/30/19 12:58 AM, Phil Davis via use-livecode wrote: In a LC script I need to write control-c to an open process so the app being run as a process will end. (At least that's how I can end it in Terminal). Has anyone had success doing this? Please share what you have learned about it. Thanks - -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
how to write control-c to an open process?
In a LC script I need to write control-c to an open process so the app being run as a process will end. (At least that's how I can end it in Terminal). Has anyone had success doing this? Please share what you have learned about it. Thanks - -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode