Re: socketTimeoutInterval is NOT for connecting
At 5:19 pm -0800 28/10/02, RCS wrote: I use 'socketTimeoutInterval' quite often...but that is for reading and writing to a socket that is already open. I am looking for a timeout setting for 'connecting' to a socket. If I use 'open socket' to connect to a device that is either offline (or invalid), I would like to set a time out of 5 or 10 seconds (the device usually responds in 1) instead of the default 1 minute. I can only get so many cups of coffee in a day you know... Dar suggested a way to handle this. The latest version of libUrl (1.0.8b1) has an internal routine similar to Dar's idea. If you look towards the bottom, you will see a function handler named ulOpenSocket. Used in combination with the two handlers following, it uses the current socketTimeoutInterval to determine a timeout when opening a socket. You could copy these handlers to your own script, and modify as necessary. (I'd suggest changing the names at least to avoid any potential name conflicts down the line.) Be sure to add the script locals that are used in these handlers at the top of your script. And you'll also need the usual socketError handler to catch errors. If you don't have it already, you can get the latest liburl version here: http://www.runrev.com/revolution/developers/interimreleases/liburl/releases.shtml Cheers Dave ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Drag'n Drop with MC 25a6
Tested the drag'n drop capabilites of M 25a6 with my Mac OS 8.6 system. When dragging a file icon onto a field, got that file path in the field. When dragging some text from a word processor: nothing / or a number of hieroglyphs [according to the syntax used] ;-) -- Regards, (-8 Dominique ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Tips for code porting to MC
Hi Guys, Im porting a rather large neural network (NN) program written in C++ to Metacard to do some stats... Im looking for tips regarding porting variable redirection (pointers and pointers to pointers) and c-style struct variables. The key to porting these is speed as NN require speed and ease of scripting as MC is all about that! for example: how do you port x[a][b] = item b of line a of x But this proves extremely slow once you reach a1000... what about p-x-b[i] so far the best I found (without much searching I admit) is p_x_b[i] but what of p-x[a]-b Im looking for any good schemes you may propose! Thanks in advance for any help! Xavier http://monsieurx.com - incoming metacard section... my site is back! ;)) Visit us at http://www.clearstream.com IMPORTANT MESSAGE Internet communications are not secure and therefore Clearstream International does not accept legal responsibility for the contents of this message. The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be the views of Clearstream International or of any of its affiliates or subsidiaries. END OF DISCLAIMER ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Tips for code porting to MC
On Tuesday, October 29, 2002, at 08:18 AM, [EMAIL PROTECTED] wrote: Im looking for tips regarding porting variable redirection (pointers and pointers to pointers) and c-style struct variables. I wouldn't ignore arrays, but I have been considering substructure in strings. MC stings are byte strings and it might be that same-size char chunk replacements are efficient. If so, you can create a data space within a string in a global variable. I'd run the experiment, anyway. Or you might try a mix in which some data are packed in strings and others are not, in which some pointers are implemented as arrays and some are implemented as string offsets. This might be better if strings are always rebuilt. Dar Scott ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Tips for code porting to MC
[EMAIL PROTECTED] wrote: Hi Guys, Im porting a rather large neural network (NN) program written in C++ to Metacard to do some stats... Im looking for tips regarding porting variable redirection (pointers and pointers to pointers) and c-style struct variables. The key to porting these is speed as NN require speed and ease of scripting as MC is all about that! for example: how do you port x[a][b] = item b of line a of x But this proves extremely slow once you reach a1000... what about p-x-b[i] so far the best I found (without much searching I admit) is p_x_b[i] but what of p-x[a]-b Im looking for any good schemes you may propose! Thanks in advance for any help! Xavier http://monsieurx.com - incoming metacard section... my site is back! ;)) Visit us at http://www.clearstream.com Hi, 1.- Use extensively the read-only repeat for each... loop structure. 2.- Use extensively the array vars instead of item-lines tables vars to store the datas you are searching on, sorting,... 3.- Use B-Tree alike data storage structures if the datas you have to parse at once exceed 500 ko. 4.- Run your app under Linux (extensively tested as two time faster than both Windows or MacOSX). -- Cordialement, Pierre Sahores Inspection académique de Seine-Saint-Denis. Applications et bases de données WEB et VPN Qualifier et produire l'avantage compétitif ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Copying OS X apps
Has anyone figured out how to copy a Mac OS X application? The usual way, copying the data fork and the resource fork, doesn't seem to work. Actually, they don't even have resource forks. The bundle structure seems to be the culprit. I tried copying each of these: /test_app.app/Contents/Info.plist /test_app.app/Contents/PkgInfo /test_app.app/Contents/MacOS/MetaCardCarbonMach-O /test_app.app/Contents/Resources/MetaCard.icns /test_app.app/Contents/Resources/MetaCardCarbonMach-0.rsrc /test_app.app/Contents/Resources/MetaCardDoc.icns But no go. I don't even get a folder structure. Any ideas? -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Copying OS X apps
J. Landman Gay a écrit : Has anyone figured out how to copy a Mac OS X application? The usual way, copying the data fork and the resource fork, doesn't seem to work. Actually, they don't even have resource forks. The bundle structure seems to be the culprit. I tried copying each of these: /test_app.app/Contents/Info.plist /test_app.app/Contents/PkgInfo /test_app.app/Contents/MacOS/MetaCardCarbonMach-O /test_app.app/Contents/Resources/MetaCard.icns /test_app.app/Contents/Resources/MetaCardCarbonMach-0.rsrc /test_app.app/Contents/Resources/MetaCardDoc.icns But no go. I don't even get a folder structure. Any ideas? -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard Hi Jacque, Did you try this in a terminal ? cp -R /theselectedpath/Ressources/ /thedestinationpath/Ressources/ -R is the recursive option. -- Cordialement, Pierre Sahores Inspection académique de Seine-Saint-Denis. Applications et bases de données WEB et VPN Qualifier et produire l'avantage compétitif ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Copying OS X apps
On 10/29/02 4:51 PM, Pierre Sahores wrote: Did you try this in a terminal ? cp -R /theselectedpath/Ressources/ /thedestinationpath/Ressources/ -R is the recursive option. Sorry, I should have been more clear. I need to copy the application in a script. For most files, I can use: put url (binfile:theSourceURL) into url (binfile:theDestURL) put url (resfile: theSourceURL) into url (resfile: theDestURL) and I get a new file, but if the file is an OS X bundle, I don't get anything at all. It just fails silently. I am also having a problem setting file types and creators for the copied files under OS X, even the ones that aren't apps. I set the filetype to what I need and then make the copy with the two lines above. The new file has a data fork and a resource fork, but no type or creator. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Copying OS X apps
Jacque, I use this in a program I'm working on right now. You can't use Terminal as it doesn't copy it properly (for some reason). You need to use applescript: tell application Finder copy filePath - Original Message - From: J. Landman Gay [EMAIL PROTECTED] To: metacard list [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 4:31 PM Subject: Copying OS X apps Has anyone figured out how to copy a Mac OS X application? The usual way, copying the data fork and the resource fork, doesn't seem to work. Actually, they don't even have resource forks. The bundle structure seems to be the culprit. I tried copying each of these: /test_app.app/Contents/Info.plist /test_app.app/Contents/PkgInfo /test_app.app/Contents/MacOS/MetaCardCarbonMach-O /test_app.app/Contents/Resources/MetaCard.icns /test_app.app/Contents/Resources/MetaCardCarbonMach-0.rsrc /test_app.app/Contents/Resources/MetaCardDoc.icns But no go. I don't even get a folder structure. Any ideas? -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Copying OS X apps
Sorry about that... I was saying you need to use applescript (and don't forget about use colon-delimited paths). Here's the code I use... note that this works only for the boot volume and not for other volumes (because non-boot volumes start with /Volumes/volName/): function CopyApp pSrcPath,pCopyName -- Assumes pSrcPath is / delimited put into tNewApp if last char of pSrcPath is / then delete last char of pSrcPath put pSrcPath into tASPath replace / with : in tASPath if first char of tASPath is : then delete first char of tASPath put tell application q(Finder) cr into tAS put duplicate file q(tASPath) \ of startup disk replacing existing items cr after tAS put set the name of the result to q(pCopyName) \ cr end tell after tAS do tAS as AppleScript end CopyApp function q what return quote what quote end q Hope this helps... don't forget that if you copy an app in OS X, you still will need to deal with bundle information, icons, etc. for the new copy. Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ - Original Message - From: Pierre Sahores [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 4:51 PM Subject: Re: Copying OS X apps J. Landman Gay a écrit : Has anyone figured out how to copy a Mac OS X application? The usual way, copying the data fork and the resource fork, doesn't seem to work. Actually, they don't even have resource forks. The bundle structure seems to be the culprit. I tried copying each of these: /test_app.app/Contents/Info.plist /test_app.app/Contents/PkgInfo /test_app.app/Contents/MacOS/MetaCardCarbonMach-O /test_app.app/Contents/Resources/MetaCard.icns /test_app.app/Contents/Resources/MetaCardCarbonMach-0.rsrc /test_app.app/Contents/Resources/MetaCardDoc.icns But no go. I don't even get a folder structure. Any ideas? -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard Hi Jacque, Did you try this in a terminal ? cp -R /theselectedpath/Ressources/ /thedestinationpath/Ressources/ -R is the recursive option. -- Cordialement, Pierre Sahores Inspection académique de Seine-Saint-Denis. Applications et bases de données WEB et VPN Qualifier et produire l'avantage compétitif ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
unsubscribing
i have decided to move to RunRev. they have some MIDI action over there and MC is really a little over my head... so far! thanks for the assistance. when i get handy with cgi socket array url concerns, i can always return. right now i am trying to get a startup handler going... all the best. = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
timeout (or 'force-quit') for 'open socket' needed
More specifically, I would like to 'force-quit' (from a script) a request to open a socket. I can get the effect I want by doing a 'Control-Period', but that does not work from a script. It seems like you do have the control from your engine to abandon this OS request...I would just like to be able to control it from my program too. Would there really be any harm in requesting an open socket from the OS, but if I do not get a response within 5 seconds, just abort? Even if the OS responds (one or two minutes later!), I have already moved on to something else (i.e. trying another socket). It's like trying to go to URL from your browser, but pressing the STOP button (because it is taking forever), and moving on to another URL. Eventually the targeted URL may respond, but you are already 'gone'. I can't imagine what it would be like if my browser forced me to complete each call to a URL...I would be drinking way too much coffee, that is for sure! ;-) I just can't see a customer sitting in front of the computer for that long before they realize that the device they want to communicate with is not responding (power off, wrong IP, not connected, etc.). Since I cannot even 'ping' the device without opening a socket first, I too am subject to this 'waiting' from the program...so I see no way around this. Thanks, JR Date: Mon, 28 Oct 2002 11:21:16 -0700 (MST) From: Scott Raney [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Invalid socket connect timeout? Reply-To: [EMAIL PROTECTED] On Sun, 27 Oct 2002 RCS [EMAIL PROTECTED] wrote: Is there a way to set the time that the internal MetaCard engine takes to 'try' to open a socket? I have found that if a socket is not valid (or the host is not on the network) MetaCard will try to connect for up to one minute until it returns a socketError...is this normal? It'd be helpful to have the platform and the script you used for reports like this. The only problem I know of in this area is that open socket .. with message doesn't work right if a connection fails on MacOS. This has already been fixed for 2.5 alpha 7. In general, though, this sort of thing unfortunately is never going to work as well on MacOS (including OS X) as it does on Win32 and UNIX because of limitations in the way OpenTransport and the underlying socket implementation works (indeed, even the standard UNIX utilities like ping and telnet take a long time to time out compared with the equivalents on Win32 and other UNIX platforms). In some specific cases, specifically failed DNS lookups, that 60 second timeout is actually hard-coded into the OS and so is not anything we can change without writing a whole bunch of new code so that we don't have to rely on OS routines to do these lookups. Regards, Scott Thanks, JR Scott Raney [EMAIL PROTECTED] http://www.metacard.com MetaCard: You know, there's an easier way to do that... ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Detect ResizeStack completion?
Thanks for the replies to my question: Has anyone found a good way to detect the COMPLETION of a stack's resizing? It now appears that Mac and Windows responses to resizeStack are different. Scott Rossi suggested: Check a variable state, not the mouse state. on mouseDown set the uAllowResize of this stack to true end mouseDown on resizeStack w,h if the uAllowResize of this stack then doComplexThings end resizeStack etc. This does not work. When the window is being resized with the mouse, no mouseup or mousedown messaages go to the stack, in either Windows or Mac. Richard Gaskin reported: I seems that the resizeStack message is sent after a stack is resized (but before the content region is drawn). If you run this script in a stack: on resizeStack put milliseconds() pass resizestack end resizeStack ...the Message Box appears only once, after the drag is completed and the mouse button released. What behaviors were you experiencing that suggested that the message was set continuously? This is indeed what happens with Mac OS9. But with WIndows 2000, the very same test gives a different result: the message box displays a continually changing series of numbers while the window is being resized. Indeed I believe this difference is visible with stacks like the Metacard Control Browser, whose fields and buttons move when you resize the window. On the Mac, they move only when you release the mouse; on Windows, they continuously adjust while you drag the depressed mouse. Perhaps this difference in behavior is worth noting somewhere, and it would be interesting to know what happens in other OSes. My original question, how to detect the conclusion of a stack-resizing, should now be restated as: How can I detect this when using Windows? Further suggestions are welcome. David Epstein ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Copying OS X apps
you need to use applescript (and don't forget about use colon-delimited paths). Thanks Ken, that helps a lot -- and I would have forgotten about the colons if you hadn't mentioned it. Just knowing I need to use AppleScript saved me hours. I haven't tried it in MetaCard yet, but in the Script Editor, copying an OS X app seems to move the whole package. That is, this AppleScript moves the whole application bundle intact: tell application Finder set theSrcPath to Macintosh HD:Users:username:folder1:test_app.app set theDestPath to Macintosh HD:Users:username:folder2 duplicate file theSrcPath to folder theDestPath with replacing end tell Apparently AppleScript/Finder in OS X is smart enough to know that a folder named .app should be treated like a file and it moves the whole bundle. I didn't need to worry about icons or anything in the Contents folder, they went over by themselves. A nice touch. I also found that if you know the name of the non-startup volume, you can plug it into one of the paths and the copy will still work. MC can get the disk names with the volumes function, so I'm in business. Now all I need to do is re-script it for MC with all those quote constants. ;) Thanks again. Big help. On 10/29/02 5:47 PM, Ken Ray wrote: Sorry about that... I was saying you need to use applescript (and don't forget about use colon-delimited paths). Here's the code I use... note that this works only for the boot volume and not for other volumes (because non-boot volumes start with /Volumes/volName/): function CopyApp pSrcPath,pCopyName -- Assumes pSrcPath is / delimited put into tNewApp if last char of pSrcPath is / then delete last char of pSrcPath put pSrcPath into tASPath replace / with : in tASPath if first char of tASPath is : then delete first char of tASPath put tell application q(Finder) cr into tAS put duplicate file q(tASPath) \ of startup disk replacing existing items cr after tAS put set the name of the result to q(pCopyName) \ cr end tell after tAS do tAS as AppleScript end CopyApp function q what return quote what quote end q Hope this helps... don't forget that if you copy an app in OS X, you still will need to deal with bundle information, icons, etc. for the new copy. Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: metacard digest, Vol 1 #377 - 9 msgs
Hi Guys, Im porting a rather large neural network (NN) program written in C++ to Metacard to do some stats... Im looking for tips regarding porting variable redirection (pointers and pointers to pointers) and c-style struct variables. The key to porting these is speed as NN require speed and ease of scripting as MC is all about that! Why not write an external? You'll be much happier with the speed - and you already have the hard part done. NN code is going to be pokey in MC compared to C++ - you can still do the hard part (the GUI) the easy way in MC. -ml ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Copying OS X apps
Thanks, Jacque... I hadn't thought of providing the destPath with the duplicate file command - a lot easier than setting the name of the result. Thanks! I'll update my scripts... ;-) Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ - Original Message - From: J. Landman Gay [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 9:04 PM Subject: Re: Copying OS X apps you need to use applescript (and don't forget about use colon-delimited paths). Thanks Ken, that helps a lot -- and I would have forgotten about the colons if you hadn't mentioned it. Just knowing I need to use AppleScript saved me hours. I haven't tried it in MetaCard yet, but in the Script Editor, copying an OS X app seems to move the whole package. That is, this AppleScript moves the whole application bundle intact: tell application Finder set theSrcPath to Macintosh HD:Users:username:folder1:test_app.app set theDestPath to Macintosh HD:Users:username:folder2 duplicate file theSrcPath to folder theDestPath with replacing end tell Apparently AppleScript/Finder in OS X is smart enough to know that a folder named .app should be treated like a file and it moves the whole bundle. I didn't need to worry about icons or anything in the Contents folder, they went over by themselves. A nice touch. I also found that if you know the name of the non-startup volume, you can plug it into one of the paths and the copy will still work. MC can get the disk names with the volumes function, so I'm in business. Now all I need to do is re-script it for MC with all those quote constants. ;) Thanks again. Big help. On 10/29/02 5:47 PM, Ken Ray wrote: Sorry about that... I was saying you need to use applescript (and don't forget about use colon-delimited paths). Here's the code I use... note that this works only for the boot volume and not for other volumes (because non-boot volumes start with /Volumes/volName/): function CopyApp pSrcPath,pCopyName -- Assumes pSrcPath is / delimited put into tNewApp if last char of pSrcPath is / then delete last char of pSrcPath put pSrcPath into tASPath replace / with : in tASPath if first char of tASPath is : then delete first char of tASPath put tell application q(Finder) cr into tAS put duplicate file q(tASPath) \ of startup disk replacing existing items cr after tAS put set the name of the result to q(pCopyName) \ cr end tell after tAS do tAS as AppleScript end CopyApp function q what return quote what quote end q Hope this helps... don't forget that if you copy an app in OS X, you still will need to deal with bundle information, icons, etc. for the new copy. Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
unsubscribe me from Metacard list
unsubscribe me from Metacard list = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard