Re: Best practise approach for artwork for iOS and Android?
This work for a few images, but let's say that your app has 100's images. Your package / SA has limits. I found it easy to settle on a routine. Images 400 X 400 or less I produce at 800 X 800 and run them the TinyJPG and get optimized. So the 2X size work well, in fact in "mandatory" on small image (100 X 50) from full screen images (414 X 736) the 1X, otherwise "eagle eyes" complain Of course it is not optimal, but from user feedback; they only complain "the image a fuzzy" when we take an item below a certain rect (400 X 400) AND optimize it AND display a 1X... when the image is bigger, I suspect treatment of edges and sharpness are still "acceptable" to the eye -- after optimization, even my eagles eyes users TinyPNG.com I have not found any this better. My own command line tool (run it through ImageMadic and mozjpg) never come close to TINYpng.com. Works so well that save in photoshop at the native rect (2X for image below 400x400 are save a 800 X 800) and save out at 100% quality on Photoshop . Drop in TINYpng.com (does jpeg as well) and look at savings!\ And test them side by side with the originals. Of course, is you are doing Ansel Adam coffee book style photographic representations that’s a different story. But my users are interest in the content of the photo -- "the documentary" aspect. They hardly notice the photo quality (except for small images, where I think optimization "breaks" the photo) Brahmanathaswami On 6/12/18, 10:45 AM, "use-livecode on behalf of Mark Waddingham via use-livecode" wrote: TL;DR: if you can find a tool which can upscale your images acceptably to 2x or even 4x - do so - keep the original image as foo.png and the upscale ones as foo@2x/4x.png and set the filename of the image with foo.png. The engine should do the rest (from the using as much as it can pixel data wise at least point of view). ___ 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: Optimization can be tricky
Thanks for the tip Ralphlove the sound of that filer function. On Tue, Jun 12, 2018 at 7:00 PM, Curry Kenworthy via use-livecode < use-livecode@lists.runrev.com> wrote: > > Optimizing scripts in LC is not the same as running reports in other > software suites. If you only need 10 results, you probably don't want to > handle all items twice. > > I hate to loop through all items even once. But if I do, I may be done! > I'm not making a full report to print out; I'm just getting my 10 items. If > I use sort or filter, likewise, I will do whatever necessary to keep it > short and sweet, even if that means adjusting some of the starting > assumptions. > > If the sort really is taking more time than the loop, something is bogging > it down. Look at the random() and arithmetic attached to the sort. That's > potentially like running a whole lot of LCS. So if you sort, try a plain > numeric sort with no fancy stuff added. Then go grab your 10 - the other > requirements can be addressed before or after the sort. > > Best wishes, > > Curry Kenworthy > > Custom Software Development > LiveCode Training and Consulting > http://livecodeconsulting.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
Re: Optimization can be tricky
Optimizing scripts in LC is not the same as running reports in other software suites. If you only need 10 results, you probably don't want to handle all items twice. I hate to loop through all items even once. But if I do, I may be done! I'm not making a full report to print out; I'm just getting my 10 items. If I use sort or filter, likewise, I will do whatever necessary to keep it short and sweet, even if that means adjusting some of the starting assumptions. If the sort really is taking more time than the loop, something is bogging it down. Look at the random() and arithmetic attached to the sort. That's potentially like running a whole lot of LCS. So if you sort, try a plain numeric sort with no fancy stuff added. Then go grab your 10 - the other requirements can be addressed before or after the sort. Best wishes, Curry Kenworthy Custom Software Development LiveCode Training and Consulting http://livecodeconsulting.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
RE: Optimization can be tricky
Filter is lightning fast. I have the list of all 40,000+ cities in the US and have a predictive search field. I tried DBs, in memory DB and other methods until I stumbled on to the filter operator. Load a text file into a var and the start filtering. There is no perceptible delay when typing the first few letters of a city name. I even carry some meta data along for the ride. I don't know if it can be used here. I have not had the time to look at the code or the problem presented. 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 hh via use-livecode Sent: Tuesday, June 12, 2018 4:39 PM To: use-livecode@lists.runrev.com Cc: hh Subject: Re: Optimization can be tricky The scenario Geoff described is roughly to get the top ten (a handful) of 2000 records comparing a certain numeric value of each. To get that unknown value of each one has to go once through all the records *and then sort* for that ranking. (LiveCode is very fast with a simple numeric sort!) Any other method of ranking while going through the data will generously waste CPU time. > Curry wrote: > Put yourself in the computer's shoes, and also clarify what you need > to accomplish. You are asking it to sort the entire list of 2000 > records, but (if I understand) you only want a handful of those. > > And it has already gone through all the records once before the sort. > If you asked a human to do that, it would be a risky interaction. > There might be raised voices when they present the neatly arranged > file cabinet with files in a special order, and you deliver the punch > line that you only need to pull a few. If you only need to pull 5 > records, most people don't want to go through all 2000 files - twice. > > So generally, don't use a sort after doing a complete loop on a big > text list, use another method. Do unto your computer as you hope it > will do unto you when they run the world. :) ___ 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: Optimization can be tricky
Then there's something about Geoff's problem (or problem statement) that I don't understand. What on earth is in those records for sorting a mere 2000 of them to be noticable? (I had thought he had to be talking about magnitudes more lines than that). LC (9.0) sorts 20,000 lines of >1000 chars each in 65ms or so, on my aging MacBook Pro. So the delay can't be the sort - it must be in the extracting of the data from the arrays into his 'candidateList'. It would be good to get that clarified before we spend more time optimizing the wrong thing :-) Alex. On 12/06/2018 21:39, hh via use-livecode wrote: The scenario Geoff described is roughly to get the top ten (a handful) of 2000 records comparing a certain numeric value of each. To get that unknown value of each one has to go once through all the records *and then sort* for that ranking. (LiveCode is very fast with a simple numeric sort!) Any other method of ranking while going through the data will generously waste CPU time. Curry wrote: Put yourself in the computer's shoes, and also clarify what you need to accomplish. You are asking it to sort the entire list of 2000 records, but (if I understand) you only want a handful of those. And it has already gone through all the records once before the sort. If you asked a human to do that, it would be a risky interaction. There might be raised voices when they present the neatly arranged file cabinet with files in a special order, and you deliver the punch line that you only need to pull a few. If you only need to pull 5 records, most people don't want to go through all 2000 files - twice. So generally, don't use a sort after doing a complete loop on a big text list, use another method. Do unto your computer as you hope it will do unto you when they run the world. :) ___ 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: Best practise approach for artwork for iOS and Android?
Just one thing to add here based on what Trevor mentioned - these are images which you have complete control over so... If you can upscale them (perhaps using the tool Lagi suggests) with a good degree of visual improvement then you can use the multi-resolution aware feature of referenced (filename) image objects to improve the display of your images on high resolution screens. Modern devices have screens which are 2-3x the dpi of screens we have lived with for decades - so more pixel data means better quality display. When you use the filename property such as 'foo.png' the image object will look for images which have name 'foo@x.png' first where x is 1,1.5,2 or 4 based on the number of device pixels available. E.g. On a 2x retina device - it will look for the 2x image and fit it to the logical (the rect) size. Note: the base size is taken from the 1x image size and the file actually used is based on the 'effective scale' of the total transform from image text to device pixels - so the dpi setting in the images don't matter and it's much more competent than just using the type of screen. TL;DR: if you can find a tool which can upscale your images acceptably to 2x or even 4x - do so - keep the original image as foo.png and the upscale ones as foo@2x/4x.png and set the filename of the image with foo.png. The engine should do the rest (from the using as much as it can pixel data wise at least point of view). Warmest Regards, Mark. Sent from my iPhone > On 12 Jun 2018, at 17:23, Trevor DeVore via use-livecode > wrote: > > On Tue, Jun 12, 2018 at 2:01 AM, Tiemo Hollmann TB via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> >> I thought the dpi only reflects at print, because any screen has it's fixed >> pixels. I think an image 800x600 with 144 dpi looks identical on any >> screen, >> as an image 800x600 with 72 dpi because in both cases 800x600 screen pixels >> are being used and there is nothing between the pixels. Or don't I see >> anything here? >> > > Changing the DPI setting in the image may affect display in image viewing > applications. If you were to change the DDPI setting of an 800x600 image > from 72 to 144 then the image would be displayed as a 400x300 image in an > application like Preview on macOS or Photoshop. LiveCode will display an > image using the natural dimensions by default. That means an image with > 800x600 pixels will be displayed as an 800x600 image. > > As a developer you could get the `metadata` of an image and check the > `density` key in the resulting array to determine if you should resize the > image based on the density setting. Depending on your application you may > face a new dilemma, however. You have to decide what the base DPI is for > the image. An image with 144 DPI could be a 2x image if created on macOS > (base of 72 DPI) or a 1.5x image if created on Windows (base of 96 DPI). > So that image may need to be displayed at 400x300 or 533x400. > > -- > Trevor DeVore > ScreenSteps > www.screensteps.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
Re: Optimization can be tricky
The scenario Geoff described is roughly to get the top ten (a handful) of 2000 records comparing a certain numeric value of each. To get that unknown value of each one has to go once through all the records *and then sort* for that ranking. (LiveCode is very fast with a simple numeric sort!) Any other method of ranking while going through the data will generously waste CPU time. > Curry wrote: > Put yourself in the computer's shoes, and also clarify what you need to > accomplish. You are asking it to sort the entire list of 2000 records, > but (if I understand) you only want a handful of those. > > And it has already gone through all the records once before the sort. If > you asked a human to do that, it would be a risky interaction. There > might be raised voices when they present the neatly arranged file > cabinet with files in a special order, and you deliver the punch line > that you only need to pull a few. If you only need to pull 5 records, > most people don't want to go through all 2000 files - twice. > > So generally, don't use a sort after doing a complete loop on a big text > list, use another method. Do unto your computer as you hope it will do > unto you when they run the world. :) ___ 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: Optimization can be tricky
Put yourself in the computer's shoes, and also clarify what you need to accomplish. You are asking it to sort the entire list of 2000 records, but (if I understand) you only want a handful of those. And it has already gone through all the records once before the sort. If you asked a human to do that, it would be a risky interaction. There might be raised voices when they present the neatly arranged file cabinet with files in a special order, and you deliver the punch line that you only need to pull a few. If you only need to pull 5 records, most people don't want to go through all 2000 files - twice. So generally, don't use a sort after doing a complete loop on a big text list, use another method. Do unto your computer as you hope it will do unto you when they run the world. :) (But I would be interested in the speed of your original code on LC 9 vs LC 6.7, just to see how engine optimization is faring. I'm surprised it took a minute.) Best wishes, Curry Kenworthy Custom Software Development LiveCode Training and Consulting http://livecodeconsulting.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
Re: Need help with a Datagrid error...
Hi Paul Yeah, thats probably the only way to track it down is to know what data is in the column. however. what happens when you paste an invalid path into an image's file path boxdoes it return an error or crash. or does it just give you a blank image? If I recall correctly there used to be a bug that had to do with invalid file names causing things to go crazy but it may not have been the same version. So it could be a combo of 2 things. Good luck Paul. Thanks On Tue, Jun 12, 2018 at 1:24 PM, Paul Dupuis via use-livecode < use-livecode@lists.runrev.com> wrote: > I should have noted the LC version. This is a standalone built under > LiveCode 6.7.11 > > If I could get one of the customers to respond with their document(s) > and settings that caused the error, it would probably be simple to track > down. > > My current theory is that rows can display either htmlText or an image > in a particular column depending upon the users data. I am speculating > that an image may not be being resolved correctly. This may just have to > wait until a customer cares enough to help us troubleshoot it by letting > us look at their data. > > It was a wild shot that someone else may have recognized this. Thanks > for replying. > > > On 6/12/2018 12:11 PM, Tom Glod via use-livecode wrote: > > so i work alot with datagrids and i've never seen such an array of > errors. > > Can you tell us what version of LC the standalone was built with? > > > > one thing that comes to mind is something i vaguely remember happening a > > few years ago. I was updating the datagrid while one of the handlers in > > the library was still running (FullInData). an error was causing the > > handler to not complete and when an update was triggered it went haywire. > > > > these are hard to diagnose in standalones especially when its something > > that depends on the error being specific to the content of the column. > > > > this is real ugly i hope you get to the bottom of it. > > > > > > > > On Tue, Jun 12, 2018 at 7:36 AM, Paul Dupuis via use-livecode < > > use-livecode@lists.runrev.com> wrote: > > > >> I have a rarely occurring Datagrid error that a couple customers have > >> reported. Unfortunately, none of the customers have been able to tell us > >> what they were doing when the error occured or be able to reproduce it. > >> I hope someone on this list may have seen this before and know what is > >> causing it. > >> > >> The error occurs when a window/stack with a datagrid is opened . The > >> datagrid on the window may have already had data from previous openings > >> and closings. An execution error occurs in the standalone before the new > >> data is populated to the datagrid. > >> > >> Anyone seen anything like this? > >> > >> Chunk: error in object expression: (Line 3919, column 33) > >> Chunk: can't find object: (Line 3919, column 33) > >> Object: does not have this property: (Line 3919, column 21) > >> put: error in expression: (Line 3919, column 1) > >> repeat: error in statement: (Line 3909, column 1) > >> repeat: error in statement: (Line 3899, column 1) > >> if-then: error in statement: (Line 3874, column 1) > >> Handler: error in statement: _table.DrawColumns (Line 3874, column 1) > >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" > of > >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack > >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > >> 4.0.1/HyperRESEARCH.exe" > >> - > >> > >> if-then: error in statement: (Line 3821, column 1) > >> if-then: error in statement: (Line 3820, column 1) > >> Handler: error in statement: _table.DrawControlsInRealTime (Line 3820, > >> column 1) > >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" > of > >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack > >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > >> 4.0.1/HyperRESEARCH.exe" > >> - > >> > >> Handler: error in statement: _table.DrawWithProperties (Line 3500, > column > >> 1) > >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" > of > >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack > >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > >> 4.0.1/HyperRESEARCH.exe" > >> - > >> > >> switch: error in statement: (Line 2319, column 1) > >> Handler: error in statement: _DrawListWithProperties (Line 2319, column > 1) > >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" > of > >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack > >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > >> 4.0.1/HyperRESEARCH.exe" > >> - >
Re: Optimization can be tricky
I don't know if these are good ideas or BAD ideas and without some suitable data, not sure if I could find out - so I'll throw the ideas over and let you decide if they are worth trying :-) 1. Two ideas combined - avoid scanning for the "item 1" of each line - use the (hopefully optimised enough) numeric-index array lookups So, instead of put random(101 + s1 * 30 + 5 * s2 - i2),T,S & cr \ after candidateList try put T,S into candidateArray[count] put random(101 + s1 * 30 + 5 * s2 - i2) into candidateValue[count] add 1 to count And then later put the keys of candidateValue into candidatelist sort numeric the lines of candidatelist by candidateValue of each and the access via the candidateArray. 2. (even wilder) Assume you have N entries to consider, and that you only need M results The *IF* M << N (i.e. much less than - you only need a few results from a large input set). You might try something like this for the inner loop : (going back to using lines ...) repeat for each line S in storyArray[T] put userSeenArray[uID][item 1 of S] into s1 put abs(item 2 of S - i1) into s2 if s2 < 20 and s1 < 4 then put random(101 + s1 * 30 + 5 * s2 - i2),T,S & cr \ after candidateList add 1 to lineCount if lineCount > 4 * M then-- (why 4 ? - maybe 2, maybe 8 ??) sort candidateList numeric by item 1 of each delete line M+1 to -1 of candidateList put M into lineCount end if end if end repeat 3. even wilder still - create K different candidateLists (where K is some power of 2) - sort each one, - mergesort in pairs, stopping when you get to M ... put 8 into KK-- (why 8 ? - maybe 16, or 32 ...) repeat for each key T in interestArray[uID] put item 1 of interestArray[uID][T] into i1 put item 2 of interestArray[uID][T] into i2 repeat for each line S in storyArray[T] put userSeenArray[uID][item 1 of S] into s1 put abs(item 2 of S - i1) into s2 if s2 < 20 and s1 < 4 then add 1 to setCount put random(101 + s1 * 30 + 5 * s2 - i2),T,S & cr \ after candidateList[setCount] if setCount > KK then put 0 into setCount end if end if end repeat repeat with i = 1 to KK sort numeric lines of candidateList[i] by item 1 of each end repeat and then write / use a mergesort that takes two sorted lists, and returns the first N of the merged list. (or even better, returns the first N, with a limit value; then each mergesort after the first can use the max value from the N'th entry of earlier merges to allow for early exit...) That is left as an exercise for the reader :-) :-) As I say - could be totally crazy, could be worthwhile. I'd be happy to try out benchmarking it - if I had some representative data to play with. Alex. On 12/06/2018 12:03, hh via use-livecode wrote: You could try the following: repeat for each key T in interestArray[uID] put item 1 of interestArray[uID][T] into i1 put item 2 of interestArray[uID][T] into i2 repeat for each line S in storyArray[T] put userSeenArray[uID][item 1 of S] into s1 put abs(item 2 of S - i1) into s2 if s2 < 20 and s1 < 4 then put random(101 + s1 * 30 + 5 * s2 - i2),T,S & cr \ after candidateList end if end repeat end repeat sort candidateList numeric by item 1 of each Ali wrote: repeat for each key T in interestArray[uID] Geoff wrote: repeat for each line T in the keys of interestArray[uID] repeat for each line S in storyArray[T] if abs(item 2 of S - item 1 of interestArray[uID][T]) < 20 \ and userSeenArray[uID][item 1 of S] < 4 then put (101 + userSeenArray[uID][item 1 of S] * 30 + 5 * \ abs(item 2 of S - item 1 of interestArray[uID][T]) - \ item 2 of interestArray[uID][T]),T,S & cr after candidateList end repeat end repeat sort lines of candidateList numeric by random(item 1 of each) ___ 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: Need help with a Datagrid error...
I should have noted the LC version. This is a standalone built under LiveCode 6.7.11 If I could get one of the customers to respond with their document(s) and settings that caused the error, it would probably be simple to track down. My current theory is that rows can display either htmlText or an image in a particular column depending upon the users data. I am speculating that an image may not be being resolved correctly. This may just have to wait until a customer cares enough to help us troubleshoot it by letting us look at their data. It was a wild shot that someone else may have recognized this. Thanks for replying. On 6/12/2018 12:11 PM, Tom Glod via use-livecode wrote: > so i work alot with datagrids and i've never seen such an array of errors. > Can you tell us what version of LC the standalone was built with? > > one thing that comes to mind is something i vaguely remember happening a > few years ago. I was updating the datagrid while one of the handlers in > the library was still running (FullInData). an error was causing the > handler to not complete and when an update was triggered it went haywire. > > these are hard to diagnose in standalones especially when its something > that depends on the error being specific to the content of the column. > > this is real ugly i hope you get to the bottom of it. > > > > On Tue, Jun 12, 2018 at 7:36 AM, Paul Dupuis via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> I have a rarely occurring Datagrid error that a couple customers have >> reported. Unfortunately, none of the customers have been able to tell us >> what they were doing when the error occured or be able to reproduce it. >> I hope someone on this list may have seen this before and know what is >> causing it. >> >> The error occurs when a window/stack with a datagrid is opened . The >> datagrid on the window may have already had data from previous openings >> and closings. An execution error occurs in the standalone before the new >> data is populated to the datagrid. >> >> Anyone seen anything like this? >> >> Chunk: error in object expression: (Line 3919, column 33) >> Chunk: can't find object: (Line 3919, column 33) >> Object: does not have this property: (Line 3919, column 21) >> put: error in expression: (Line 3919, column 1) >> repeat: error in statement: (Line 3909, column 1) >> repeat: error in statement: (Line 3899, column 1) >> if-then: error in statement: (Line 3874, column 1) >> Handler: error in statement: _table.DrawColumns (Line 3874, column 1) >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH >> 4.0.1/HyperRESEARCH.exe" >> - >> >> if-then: error in statement: (Line 3821, column 1) >> if-then: error in statement: (Line 3820, column 1) >> Handler: error in statement: _table.DrawControlsInRealTime (Line 3820, >> column 1) >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH >> 4.0.1/HyperRESEARCH.exe" >> - >> >> Handler: error in statement: _table.DrawWithProperties (Line 3500, column >> 1) >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH >> 4.0.1/HyperRESEARCH.exe" >> - >> >> switch: error in statement: (Line 2319, column 1) >> Handler: error in statement: _DrawListWithProperties (Line 2319, column 1) >> Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of >> stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" >> Object ID: button id 1005 of group id 1004 of card id 1002 of stack >> "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH >> 4.0.1/HyperRESEARCH.exe" >> - >> >> if-then: error in statement: (Line 7540, column 1) >> >> >> ___ >> 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: h
Re: Best practise approach for artwork for iOS and Android?
on Tue, 12 Jun 2018, Lagi Pittas wrote: > I don't know what sort of images you have but > take a look at xara (xara.com/designer-pro/features) I use Xara Photo Graphic Designer and agree with Lagi's recommendation. Check these videos about intelligent scaling: https://www.youtube.com/watch?v=dfNLaZ5cSHs https://www.youtube.com/watch?v=s9j-WYl0OJY Al ___ 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: Best practise approach for artwork for iOS and Android?
On Tue, Jun 12, 2018 at 2:01 AM, Tiemo Hollmann TB via use-livecode < use-livecode@lists.runrev.com> wrote: > > I thought the dpi only reflects at print, because any screen has it's fixed > pixels. I think an image 800x600 with 144 dpi looks identical on any > screen, > as an image 800x600 with 72 dpi because in both cases 800x600 screen pixels > are being used and there is nothing between the pixels. Or don't I see > anything here? > Changing the DPI setting in the image may affect display in image viewing applications. If you were to change the DDPI setting of an 800x600 image from 72 to 144 then the image would be displayed as a 400x300 image in an application like Preview on macOS or Photoshop. LiveCode will display an image using the natural dimensions by default. That means an image with 800x600 pixels will be displayed as an 800x600 image. As a developer you could get the `metadata` of an image and check the `density` key in the resulting array to determine if you should resize the image based on the density setting. Depending on your application you may face a new dilemma, however. You have to decide what the base DPI is for the image. An image with 144 DPI could be a 2x image if created on macOS (base of 72 DPI) or a 1.5x image if created on Windows (base of 96 DPI). So that image may need to be displayed at 400x300 or 533x400. -- Trevor DeVore ScreenSteps www.screensteps.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
Re: Need help with a Datagrid error...
so i work alot with datagrids and i've never seen such an array of errors. Can you tell us what version of LC the standalone was built with? one thing that comes to mind is something i vaguely remember happening a few years ago. I was updating the datagrid while one of the handlers in the library was still running (FullInData). an error was causing the handler to not complete and when an update was triggered it went haywire. these are hard to diagnose in standalones especially when its something that depends on the error being specific to the content of the column. this is real ugly i hope you get to the bottom of it. On Tue, Jun 12, 2018 at 7:36 AM, Paul Dupuis via use-livecode < use-livecode@lists.runrev.com> wrote: > I have a rarely occurring Datagrid error that a couple customers have > reported. Unfortunately, none of the customers have been able to tell us > what they were doing when the error occured or be able to reproduce it. > I hope someone on this list may have seen this before and know what is > causing it. > > The error occurs when a window/stack with a datagrid is opened . The > datagrid on the window may have already had data from previous openings > and closings. An execution error occurs in the standalone before the new > data is populated to the datagrid. > > Anyone seen anything like this? > > Chunk: error in object expression: (Line 3919, column 33) > Chunk: can't find object: (Line 3919, column 33) > Object: does not have this property: (Line 3919, column 21) > put: error in expression: (Line 3919, column 1) > repeat: error in statement: (Line 3909, column 1) > repeat: error in statement: (Line 3899, column 1) > if-then: error in statement: (Line 3874, column 1) > Handler: error in statement: _table.DrawColumns (Line 3874, column 1) > Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of > stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > Object ID: button id 1005 of group id 1004 of card id 1002 of stack > "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > 4.0.1/HyperRESEARCH.exe" > - > > if-then: error in statement: (Line 3821, column 1) > if-then: error in statement: (Line 3820, column 1) > Handler: error in statement: _table.DrawControlsInRealTime (Line 3820, > column 1) > Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of > stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > Object ID: button id 1005 of group id 1004 of card id 1002 of stack > "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > 4.0.1/HyperRESEARCH.exe" > - > > Handler: error in statement: _table.DrawWithProperties (Line 3500, column > 1) > Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of > stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > Object ID: button id 1005 of group id 1004 of card id 1002 of stack > "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > 4.0.1/HyperRESEARCH.exe" > - > > switch: error in statement: (Line 2319, column 1) > Handler: error in statement: _DrawListWithProperties (Line 2319, column 1) > Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of > stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" > Object ID: button id 1005 of group id 1004 of card id 1002 of stack > "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH > 4.0.1/HyperRESEARCH.exe" > - > > if-then: error in statement: (Line 7540, column 1) > > > ___ > 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: Android USB port
The LC team takes custom requests, and you wouldn't have to tell them how to link the code into LiveCode. :) Write to supp...@livecode.com and see what they say. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On June 12, 2018 10:19:54 AM Douglas Ruisaard via use-livecode wrote: Thanks for the reply, Jacqueline. I was hoping for a reply from you as one of the Android experts on this list. Your response is as expected. Yes, I am aware of Bluetooth usage on Android.. and, ideally, THAT would be perfect... since I have a fully developed and working iOS version of my app using Bluetooth via Monte's excellent "mergBLE" kit. I don't WANT to use the USB if I don't have to but without adding yet another piece of hardware to the project (my hardware guy would kill me!), WIFI sockets are not an option either. Serial connectivity is "native" to all Arduino platforms and the Bluetooth is built into our project for the iOS connectivity. If anyone could suggest a contractible resource who could "link" an open source Java "library" to LC, that would be fantastic. Hitting the "yellow-pages" for such a resource seems to be an exercise in frustration in terms of responsiveness of the variety of 10 - 12 supposed Android development companies which tout development expertise. The Java source resource (in case anyone is interested and able) is from Adafruit and can be found here: https://github.com/adafruit/Bluefruit_LE_Connect_Android Regarding "... a custom Android external ...", if I can find a competent Android developer (and, as I said, I REALY need some advice in that regard), how would I instruct them to "link" their code to LC's? I'm quite ignorant about that aspect of LC development.. but willing to learn. Douglas Ruisaard Trilogy Software (250) 573-3935 On 6/10/18 10:44 AM, Douglas Ruisaard via use-livecode wrote: > Apple, if it isn't known, requires you to sell your first-born, sign a contract in blood and then embed a "special" hardware chip in your device in order to ALLOW USB connectivity. I'm good with using BlueTooth for iOS... but Android has me stumped unless this community can lend a hand. You can use Bluetooth with Android as well, but we don't have an external for that yet. USB connectivity has always been missing on all platforms, and I don't know of any plans to add it. It sounds like what you need is a custom Android external for BlueTooth. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.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
Re: AW: Best practise approach for artwork for iOS and Android?
You may be right, I should have said to double the size. The idea is to give LC more pixels to work with when it scales the card content. But LC is pretty good at scaling, so starting with the originals may work fine. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On June 12, 2018 2:03:31 AM Tiemo Hollmann TB via use-livecode wrote: Hi Jacque, I thought the dpi only reflects at print, because any screen has it's fixed pixels. I think an image 800x600 with 144 dpi looks identical on any screen, as an image 800x600 with 72 dpi because in both cases 800x600 screen pixels are being used and there is nothing between the pixels. Or don't I see anything here? But perhaps I really hould try to start the project with the old 800x600 images, as you and also Kee Nethery pointed out. In this case I am not sure what would give the better quality in point-of-view resolution. Importing the original old 800x600 images into LiveCode and let the LiveCode engine stretch (not distore) the images to a full screen size (with white space on some edges at some disply sizes), or would photoshop make a better job in interpolating pixels, if I would enlarge all images in photoshop to lets say 2732x2014 (or even 3200x2400) and let the LiveCode engine shrink the images to fit each screen. Tiemo -Ursprüngliche Nachricht- Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von J. Landman Gay via use-livecode Gesendet: Montag, 11. Juni 2018 21:58 An: How to use LiveCode Cc: J. Landman Gay Betreff: Re: Best practise approach for artwork for iOS and Android? I would bulk-convert all the images to a higher resolution, perhaps 144dpi. On Mac, Graphic Converter can batch process these in seconds, and I am sure there are other programs that do the same on both Mac and Windows. Use these higher-resolution images in your project. On mobile, use fullScreenMode "showAll", which will automatically adjust the display to fit any resolution and screen size on both iOS and Android. Depending on the original card size, some edges will either be cropped or empty space will be added. There are ways around this, mainly by displaying an image at a larger size than the (original) card size. There was a bug in the showAll fullscreenmode when navigating cards, but that has just been fixed and will be in the next 9.0 release. There are also workarounds for this right now if you don't want to wait. This is a quick process that doesn't take much time because you won't have to adjust every image. On 6/11/18 3:54 AM, Tiemo Hollmann TB via use-livecode wrote: Hi, I have three old windows program (going back to the 90th), designed for children, which are based on "full window" image backgrounds (douzends of cards, each with another background image) and lots of small detail images. Up to now I have only developed LiveCode for Windows and MacOS, no experience yet with iOS and Android development. I try to evaluate the work load to redevelop those old windows programs for mobile and one general question before I start is the art work. Since the old art work has a size about 800x600 by 72dpi, I obviously would need to let redesign all art work for the todays resolutions, which would be a pretty costly part of the project and probably the go or nogo for the whole project. Since there are so many different screen sizes, resolutions and aspect ratios on iOS and Android, I wonder how to cover all those variants technically in LiveCode and basically from the art work side. E.g. which size and ratio I would have to let create the "master" images by the artist (to be also on the safe side for the next years)? Since I can't let design for each ratio a different master image for each card, I probably would have to distort the "master" image to each different screen size (app only for tablets in landscape mode)? Could I let make the OS the distortion of one background image per card in LiveCode, or would I need to import and assign different images (which I have distored in photoshop before) for each screen size in each card? Additionally I would need to create douzends of polygons as clickable objects, above each image for small parts of it, where I am not sure, if they would keep their exact target area, when the background image will be distort - probably not. Up to now it looks to me as a never ending story, but perhaps I don't see a good approach Any experience or pointers to a how to are very welcome. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.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 li
Re: Android USB port
Thanks for the reply, Jacqueline. I was hoping for a reply from you as one of the Android experts on this list. Your response is as expected. Yes, I am aware of Bluetooth usage on Android.. and, ideally, THAT would be perfect... since I have a fully developed and working iOS version of my app using Bluetooth via Monte's excellent "mergBLE" kit. I don't WANT to use the USB if I don't have to but without adding yet another piece of hardware to the project (my hardware guy would kill me!), WIFI sockets are not an option either. Serial connectivity is "native" to all Arduino platforms and the Bluetooth is built into our project for the iOS connectivity. If anyone could suggest a contractible resource who could "link" an open source Java "library" to LC, that would be fantastic. Hitting the "yellow-pages" for such a resource seems to be an exercise in frustration in terms of responsiveness of the variety of 10 - 12 supposed Android development companies which tout development expertise. The Java source resource (in case anyone is interested and able) is from Adafruit and can be found here: https://github.com/adafruit/Bluefruit_LE_Connect_Android Regarding "... a custom Android external ...", if I can find a competent Android developer (and, as I said, I REALY need some advice in that regard), how would I instruct them to "link" their code to LC's? I'm quite ignorant about that aspect of LC development.. but willing to learn. Douglas Ruisaard Trilogy Software (250) 573-3935 > On 6/10/18 10:44 AM, Douglas Ruisaard via use-livecode wrote: > > Apple, if it isn't known, requires you to sell your first-born, sign a > > contract in blood and then > embed a "special" hardware chip in your device in order to ALLOW USB > connectivity. I'm good with > using BlueTooth for iOS... but Android has me stumped unless this community > can lend a hand. > > You can use Bluetooth with Android as well, but we don't have an > external for that yet. USB connectivity has always been missing on all > platforms, and I don't know of any plans to add it. > > It sounds like what you need is a custom Android external for BlueTooth. > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.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
Re: how to use the scale geometry property of an object?
If you use fullscreenmode they will scale automatically, you don't have to do anything. Everything on the card will resize itself proportionally, which is why it's so easy. The down side is that buttons and other controls will also scale, so they may not be exactly the same size as standard OS conventions, but I live with that. If you are using a custom skin it doesn't matter much. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On June 12, 2018 5:26:13 AM Tiemo Hollmann TB via use-livecode wrote: Hi, I have a full-window image and need dozens of clickable transparent polygons on top of it, shaping details of the image. My idea was, that all these polygons could be resized and positioned automatically by the scaling property of the object, when resizing the stack. I have never used the geometry propertry section of an object to scale it and I don't see actually how it works. My idea was, that when activated, the object would scale automatically, if I resize the stack, but nothing happens with the object. Obviously it's not that easy, as I thought, or I am missing something vital. I also tested to resize each object in the resizeStack handler by script by the resized proportions of the stack, but this gives very inaccurate results because of rounding the small factors of all the small resize steps, while resizing a stack by dragging the window. Any hint, on how to use the scale property of an object? Thanks 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
Re: how to use the scale geometry property of an object?
Are you talking about the geometry manager? I’ll be talking about that at LCG next month. One thing you’re going to need to handle manually will be the aspect ratio. The GM does not have the ability to do that automatically (that I know of). To prevent accumulation of small errors in your resize handler, you need to use constants for the relative position of objects. So the object is x% from the left/top/right/bottom. That is how the GM works. On Jun 12, 2018, 5:24 AM -0500, Tiemo Hollmann TB via use-livecode , wrote: > Hi, > > I have a full-window image and need dozens of clickable transparent polygons > on top of it, shaping details of the image. My idea was, that all these > polygons could be resized and positioned automatically by the scaling > property of the object, when resizing the stack. > > > > I have never used the geometry propertry section of an object to scale it > and I don't see actually how it works. > > My idea was, that when activated, the object would scale automatically, if I > resize the stack, but nothing happens with the object. Obviously it's not > that easy, as I thought, or I am missing something vital. > > > > I also tested to resize each object in the resizeStack handler by script by > the resized proportions of the stack, but this gives very inaccurate results > because of rounding the small factors of all the small resize steps, while > resizing a stack by dragging the window. > > > > Any hint, on how to use the scale property of an object? > > > > Thanks > > 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
Re: Optimization can be tricky
Sorry, I forgot to mention Jerry who already proposed to pull out computations from the inner loop and also to use variables in the inner loop. My experience says to avoid getting items as often as possible. And to use the random() in the inner repeat loop instead of in the final sort may be worth a trial with a large data set. I wrote: > You could try the following. > > repeat for each key T in interestArray[uID] > put item 1 of interestArray[uID][T] into i1 > put item 2 of interestArray[uID][T] into i2 > repeat for each line S in storyArray[T] > put userSeenArray[uID][item 1 of S] into s1 > put abs(item 2 of S - i1) into s2 > if s2 < 20 and s1 < 4 then > put random(101 + s1 * 30 + 5 * s2 - i2),T,S & cr after candidateList > end if > end repeat > end repeat > sort candidateList numeric by item 1 of each > > > Ali wrote: > repeat for each key T in interestArray[uID] > > Geoff wrote: > repeat for each line T in the keys of interestArray[uID] > repeat for each line S in storyArray[T] >if abs(item 2 of S - item 1 of interestArray[uID][T]) < 20 \ > and userSeenArray[uID][item 1 of S] < 4 >then put (101 + userSeenArray[uID][item 1 of S] * 30 + 5 * \ > abs(item 2 of S - item 1 of interestArray[uID][T]) - \ > item 2 of interestArray[uID][T]),T,S & cr after candidateList > end repeat > end repeat > sort lines of candidateList numeric by random(item 1 of each) ___ 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
Need help with a Datagrid error...
I have a rarely occurring Datagrid error that a couple customers have reported. Unfortunately, none of the customers have been able to tell us what they were doing when the error occured or be able to reproduce it. I hope someone on this list may have seen this before and know what is causing it. The error occurs when a window/stack with a datagrid is opened . The datagrid on the window may have already had data from previous openings and closings. An execution error occurs in the standalone before the new data is populated to the datagrid. Anyone seen anything like this? Chunk: error in object expression: (Line 3919, column 33) Chunk: can't find object: (Line 3919, column 33) Object: does not have this property: (Line 3919, column 21) put: error in expression: (Line 3919, column 1) repeat: error in statement: (Line 3909, column 1) repeat: error in statement: (Line 3899, column 1) if-then: error in statement: (Line 3874, column 1) Handler: error in statement: _table.DrawColumns (Line 3874, column 1) Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" Object ID: button id 1005 of group id 1004 of card id 1002 of stack "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH 4.0.1/HyperRESEARCH.exe" - if-then: error in statement: (Line 3821, column 1) if-then: error in statement: (Line 3820, column 1) Handler: error in statement: _table.DrawControlsInRealTime (Line 3820, column 1) Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" Object ID: button id 1005 of group id 1004 of card id 1002 of stack "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH 4.0.1/HyperRESEARCH.exe" - Handler: error in statement: _table.DrawWithProperties (Line 3500, column 1) Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" Object ID: button id 1005 of group id 1004 of card id 1002 of stack "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH 4.0.1/HyperRESEARCH.exe" - switch: error in statement: (Line 2319, column 1) Handler: error in statement: _DrawListWithProperties (Line 2319, column 1) Object: button "Data Grid" of group "Behaviors" of card "card id 1002" of stack "revDataGridLibrary" of stack "HyperRESEARCH.exe" Object ID: button id 1005 of group id 1004 of card id 1002 of stack "revDataGridLibrary" of stack "C:/Program Files (x86)/HyperRESEARCH 4.0.1/HyperRESEARCH.exe" - if-then: error in statement: (Line 7540, column 1) ___ 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: Optimization can be tricky
You could try the following: repeat for each key T in interestArray[uID] put item 1 of interestArray[uID][T] into i1 put item 2 of interestArray[uID][T] into i2 repeat for each line S in storyArray[T] put userSeenArray[uID][item 1 of S] into s1 put abs(item 2 of S - i1) into s2 if s2 < 20 and s1 < 4 then put random(101 + s1 * 30 + 5 * s2 - i2),T,S & cr \ after candidateList end if end repeat end repeat sort candidateList numeric by item 1 of each > Ali wrote: > repeat for each key T in interestArray[uID] > >> Geoff wrote: >> repeat for each line T in the keys of interestArray[uID] >> repeat for each line S in storyArray[T] >> if abs(item 2 of S - item 1 of interestArray[uID][T]) < 20 \ >> and userSeenArray[uID][item 1 of S] < 4 >> then put (101 + userSeenArray[uID][item 1 of S] * 30 + 5 * \ >> abs(item 2 of S - item 1 of interestArray[uID][T]) - \ >> item 2 of interestArray[uID][T]),T,S & cr after candidateList >> end repeat >> end repeat >> sort lines of candidateList numeric by random(item 1 of each) ___ 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 use the scale geometry property of an object?
Hi, I have a full-window image and need dozens of clickable transparent polygons on top of it, shaping details of the image. My idea was, that all these polygons could be resized and positioned automatically by the scaling property of the object, when resizing the stack. I have never used the geometry propertry section of an object to scale it and I don't see actually how it works. My idea was, that when activated, the object would scale automatically, if I resize the stack, but nothing happens with the object. Obviously it's not that easy, as I thought, or I am missing something vital. I also tested to resize each object in the resizeStack handler by script by the resized proportions of the stack, but this gives very inaccurate results because of rounding the small factors of all the small resize steps, while resizing a stack by dragging the window. Any hint, on how to use the scale property of an object? Thanks 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
AW: Best practise approach for artwork for iOS and Android?
Hi Lagi, faszinating tool! Tiemo -Ursprüngliche Nachricht- Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von Lagi Pittas via use-livecode Gesendet: Dienstag, 12. Juni 2018 11:18 An: How to use LiveCode Cc: Lagi Pittas Betreff: Re: Best practise approach for artwork for iOS and Android? Hi, I don't know what sort of images you have but take a look at xara ( xara.com/designer-pro/features) Scroll down to the intelligent scaling video - better yet they have a trial. I think the intelligent scaling might even give you the "safe Zone" that SB mentioned Regards Lagi Lagi On Mon, 11 Jun 2018 at 14:48, Kee Nethery via use-livecode < use-livecode@lists.runrev.com> wrote: > If you use the imagery you have, don’t distort it to fill the screen. > That always looks bad. Add white space and/or crop but keep the > proportions correct. > > If you run them through a smoothing filter to up the dpi, you will > want to bit poke each image to restore sharp corners that should not > have been rounded. > > Personally, if the app worked well with the images you had, and > redoing them is your big go/no go, I’d use the images you have. If one > app gains traction, perhaps v2 has new images. > > Toss them all against the wall and see what sticks. > > My two cents. > > Kee Nethery > > > On Jun 11, 2018, at 1:54 AM, Tiemo Hollmann TB via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > Hi, > > > > I have three old windows program (going back to the 90th), designed > > for children, which are based on "full window" image backgrounds > > (douzends of cards, each with another background image) and lots of > > small detail > images. > > Up to now I have only developed LiveCode for Windows and MacOS, no > > experience yet with iOS and Android development. I try to evaluate > > the > work > > load to redevelop those old windows programs for mobile and one > > general question before I start is the art work. Since the old art > > work has a > size > > about 800x600 by 72dpi, I obviously would need to let redesign all > > art > work > > for the todays resolutions, which would be a pretty costly part of > > the project and probably the go or nogo for the whole project. > > > > > > > > Since there are so many different screen sizes, resolutions and > > aspect ratios on iOS and Android, I wonder how to cover all those > > variants technically in LiveCode and basically from the art work > > side. E.g. which size and ratio I would have to let create the > > "master" images by the > artist > > (to be also on the safe side for the next years)? > > > > Since I can't let design for each ratio a different master image for > > each card, I probably would have to distort the "master" image to > > each > different > > screen size (app only for tablets in landscape mode)? Could I let > > make > the > > OS the distortion of one background image per card in LiveCode, or > > would > I > > need to import and assign different images (which I have distored in > > photoshop before) for each screen size in each card? Additionally I > > would need to create douzends of polygons as clickable objects, > > above each > image > > for small parts of it, where I am not sure, if they would keep their > exact > > target area, when the background image will be distort - probably not. > > > > > > > > Up to now it looks to me as a never ending story, but perhaps I > > don't > see a > > good approach > > > > Any experience or pointers to a how to are very welcome. > > > > > > > > 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 ___ 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: Best practise approach for artwork for iOS and Android?
Hi, I don't know what sort of images you have but take a look at xara ( xara.com/designer-pro/features) Scroll down to the intelligent scaling video - better yet they have a trial. I think the intelligent scaling might even give you the "safe Zone" that SB mentioned Regards Lagi Lagi On Mon, 11 Jun 2018 at 14:48, Kee Nethery via use-livecode < use-livecode@lists.runrev.com> wrote: > If you use the imagery you have, don’t distort it to fill the screen. That > always looks bad. Add white space and/or crop but keep the proportions > correct. > > If you run them through a smoothing filter to up the dpi, you will want to > bit poke each image to restore sharp corners that should not have been > rounded. > > Personally, if the app worked well with the images you had, and redoing > them is your big go/no go, I’d use the images you have. If one app gains > traction, perhaps v2 has new images. > > Toss them all against the wall and see what sticks. > > My two cents. > > Kee Nethery > > > On Jun 11, 2018, at 1:54 AM, Tiemo Hollmann TB via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > Hi, > > > > I have three old windows program (going back to the 90th), designed for > > children, which are based on "full window" image backgrounds (douzends of > > cards, each with another background image) and lots of small detail > images. > > Up to now I have only developed LiveCode for Windows and MacOS, no > > experience yet with iOS and Android development. I try to evaluate the > work > > load to redevelop those old windows programs for mobile and one general > > question before I start is the art work. Since the old art work has a > size > > about 800x600 by 72dpi, I obviously would need to let redesign all art > work > > for the todays resolutions, which would be a pretty costly part of the > > project and probably the go or nogo for the whole project. > > > > > > > > Since there are so many different screen sizes, resolutions and aspect > > ratios on iOS and Android, I wonder how to cover all those variants > > technically in LiveCode and basically from the art work side. E.g. which > > size and ratio I would have to let create the "master" images by the > artist > > (to be also on the safe side for the next years)? > > > > Since I can't let design for each ratio a different master image for each > > card, I probably would have to distort the "master" image to each > different > > screen size (app only for tablets in landscape mode)? Could I let make > the > > OS the distortion of one background image per card in LiveCode, or would > I > > need to import and assign different images (which I have distored in > > photoshop before) for each screen size in each card? Additionally I would > > need to create douzends of polygons as clickable objects, above each > image > > for small parts of it, where I am not sure, if they would keep their > exact > > target area, when the background image will be distort - probably not. > > > > > > > > Up to now it looks to me as a never ending story, but perhaps I don't > see a > > good approach > > > > Any experience or pointers to a how to are very welcome. > > > > > > > > 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 ___ 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: Optimization can be tricky
Hi Geoff, One thing to try in your original code, which should be significantly faster if the array is big, is using > repeat for each key T in interestArray[uID] instead of > repeat for each line T in the keys of interestArray[uID] The latter has to allocate memory for a string containing all the keys, AND iterate through the lines of that string, whereas repeating for each key directly accesses the keys of the array in hash order, and thus no extra allocation will occur and the iteration is faster than finding the next line delimiter each time. On Tue, Jun 12, 2018 at 8:35 AM Clarence Martin via use-livecode < use-livecode@lists.runrev.com> wrote: > I know that this might be a different use-case but I have a CA Lottery - > Fantasy five lottery parser that collects lottery data and loads it into a > matrix and provides the total number of hits for each number. This also > has 4 optimization buttons to the show differences. This aupplication was > optimized by our Pasadena LiveCode user's group. Drop me an email and I > will send you a zipped copy of the Script with a sample lotto data file > with approximately 8000 lines of picks. > Email: chi...@themartinz.com > > -Original Message- > From: use-livecode On Behalf Of > Geoff Canyon via use-livecode > Sent: Monday, June 11, 2018 5:22 PM > To: How to use LiveCode > Cc: Geoff Canyon > Subject: Optimization can be tricky > > I have a routine that takes about a minute to run for the test case I > created, and who knows how long for the real use case. Given that I want to > run it several thousand times for actual work, I need it to run (much) > faster. > > Roughly, the routine gathers together a bunch of data from arrays, sorts > the data based on its relationship to other arrays, and then returns a > subset of the result. > > My first pass at the routine looked roughly like this: > >repeat for each line T in the keys of interestArray[uID] > repeat for each line S in storyArray[T] > if abs(item 2 of S - item 1 of interestArray[uID][T]) < 20 \ >and userSeenArray[uID][item 1 of S] < 4 > then put (101 + userSeenArray[uID][item 1 of S] * 30 + 5 * \ >abs(item 2 of S - item 1 of interestArray[uID][T]) - \ >item 2 of interestArray[uID][T]),T,S & cr after > candidateList > end repeat >end repeat >sort lines of candidateList numeric by random(item 1 of each) > > In simple terms: parse through the individual lines of all the entries > that possibly work, calculating a relevant value for each and appending > that value and the line to an interim list, which then gets sorted, > randomly favoring lower values. > > I assumed the problem was all the line-by-line parsing, and I thought of a > clever way to accomplish the same thing. That led to this: > >put storyArray into R >intersect R with interestArray[uID] >combine R using cr and comma >sort lines of R by (101 + userSeenArray[uID][item 2 of each] * 30 + 5 * > \ > abs(item 3 of each - item 1 of interestArray[uID][item 1 of > each]) \ > - item 2 of interestArray[uID][item 1 of each]) > > Much simpler, albeit that's a heck of a "sort by" -- more complex by far > than any I had previously created, and a testament to the power and > flexibility of "each". Alas, despite condensing my code and removing > parsing and loops, that version took ten seconds more than the previous > version, I'm guessing because the previous version has that "if" statement > that weeds out undesirable entries before the sort has to deal with them. > > (I'm writing this email as I parse through this figuring it out) > > So it turns out that the crazy use of "each" is only part of the problem > -- changing that line to: > >sort lines of R by random(1) > > still takes over 20 seconds -- 3x as fast, but still far too slow. It > turns out that the source data numbers anywhere from 1,000 to 2,000 lines, > so sorting it in any way to randomly select the several lines I need is a > really bad choice. removing the sort step but keeping everything else cuts > the execution time down to under a second. > > Hmm. How to select several lines at weighted random from among a couple > thousand? I'll think on this and post a follow-up. > ___ > 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 su
RE: Optimization can be tricky
I know that this might be a different use-case but I have a CA Lottery - Fantasy five lottery parser that collects lottery data and loads it into a matrix and provides the total number of hits for each number. This also has 4 optimization buttons to the show differences. This aupplication was optimized by our Pasadena LiveCode user's group. Drop me an email and I will send you a zipped copy of the Script with a sample lotto data file with approximately 8000 lines of picks. Email: chi...@themartinz.com -Original Message- From: use-livecode On Behalf Of Geoff Canyon via use-livecode Sent: Monday, June 11, 2018 5:22 PM To: How to use LiveCode Cc: Geoff Canyon Subject: Optimization can be tricky I have a routine that takes about a minute to run for the test case I created, and who knows how long for the real use case. Given that I want to run it several thousand times for actual work, I need it to run (much) faster. Roughly, the routine gathers together a bunch of data from arrays, sorts the data based on its relationship to other arrays, and then returns a subset of the result. My first pass at the routine looked roughly like this: repeat for each line T in the keys of interestArray[uID] repeat for each line S in storyArray[T] if abs(item 2 of S - item 1 of interestArray[uID][T]) < 20 \ and userSeenArray[uID][item 1 of S] < 4 then put (101 + userSeenArray[uID][item 1 of S] * 30 + 5 * \ abs(item 2 of S - item 1 of interestArray[uID][T]) - \ item 2 of interestArray[uID][T]),T,S & cr after candidateList end repeat end repeat sort lines of candidateList numeric by random(item 1 of each) In simple terms: parse through the individual lines of all the entries that possibly work, calculating a relevant value for each and appending that value and the line to an interim list, which then gets sorted, randomly favoring lower values. I assumed the problem was all the line-by-line parsing, and I thought of a clever way to accomplish the same thing. That led to this: put storyArray into R intersect R with interestArray[uID] combine R using cr and comma sort lines of R by (101 + userSeenArray[uID][item 2 of each] * 30 + 5 * \ abs(item 3 of each - item 1 of interestArray[uID][item 1 of each]) \ - item 2 of interestArray[uID][item 1 of each]) Much simpler, albeit that's a heck of a "sort by" -- more complex by far than any I had previously created, and a testament to the power and flexibility of "each". Alas, despite condensing my code and removing parsing and loops, that version took ten seconds more than the previous version, I'm guessing because the previous version has that "if" statement that weeds out undesirable entries before the sort has to deal with them. (I'm writing this email as I parse through this figuring it out) So it turns out that the crazy use of "each" is only part of the problem -- changing that line to: sort lines of R by random(1) still takes over 20 seconds -- 3x as fast, but still far too slow. It turns out that the source data numbers anywhere from 1,000 to 2,000 lines, so sorting it in any way to randomly select the several lines I need is a really bad choice. removing the sort step but keeping everything else cuts the execution time down to under a second. Hmm. How to select several lines at weighted random from among a couple thousand? I'll think on this and post a follow-up. ___ 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
AW: Best practise approach for artwork for iOS and Android?
Hi Jacque, I thought the dpi only reflects at print, because any screen has it's fixed pixels. I think an image 800x600 with 144 dpi looks identical on any screen, as an image 800x600 with 72 dpi because in both cases 800x600 screen pixels are being used and there is nothing between the pixels. Or don't I see anything here? But perhaps I really hould try to start the project with the old 800x600 images, as you and also Kee Nethery pointed out. In this case I am not sure what would give the better quality in point-of-view resolution. Importing the original old 800x600 images into LiveCode and let the LiveCode engine stretch (not distore) the images to a full screen size (with white space on some edges at some disply sizes), or would photoshop make a better job in interpolating pixels, if I would enlarge all images in photoshop to lets say 2732x2014 (or even 3200x2400) and let the LiveCode engine shrink the images to fit each screen. Tiemo -Ursprüngliche Nachricht- Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von J. Landman Gay via use-livecode Gesendet: Montag, 11. Juni 2018 21:58 An: How to use LiveCode Cc: J. Landman Gay Betreff: Re: Best practise approach for artwork for iOS and Android? I would bulk-convert all the images to a higher resolution, perhaps 144dpi. On Mac, Graphic Converter can batch process these in seconds, and I am sure there are other programs that do the same on both Mac and Windows. Use these higher-resolution images in your project. On mobile, use fullScreenMode "showAll", which will automatically adjust the display to fit any resolution and screen size on both iOS and Android. Depending on the original card size, some edges will either be cropped or empty space will be added. There are ways around this, mainly by displaying an image at a larger size than the (original) card size. There was a bug in the showAll fullscreenmode when navigating cards, but that has just been fixed and will be in the next 9.0 release. There are also workarounds for this right now if you don't want to wait. This is a quick process that doesn't take much time because you won't have to adjust every image. On 6/11/18 3:54 AM, Tiemo Hollmann TB via use-livecode wrote: > Hi, > > I have three old windows program (going back to the 90th), designed > for children, which are based on "full window" image backgrounds > (douzends of cards, each with another background image) and lots of small detail images. > Up to now I have only developed LiveCode for Windows and MacOS, no > experience yet with iOS and Android development. I try to evaluate the > work load to redevelop those old windows programs for mobile and one > general question before I start is the art work. Since the old art > work has a size about 800x600 by 72dpi, I obviously would need to let > redesign all art work for the todays resolutions, which would be a > pretty costly part of the project and probably the go or nogo for the whole project. > > > > Since there are so many different screen sizes, resolutions and aspect > ratios on iOS and Android, I wonder how to cover all those variants > technically in LiveCode and basically from the art work side. E.g. > which size and ratio I would have to let create the "master" images by > the artist (to be also on the safe side for the next years)? > > Since I can't let design for each ratio a different master image for > each card, I probably would have to distort the "master" image to each > different screen size (app only for tablets in landscape mode)? Could > I let make the OS the distortion of one background image per card in > LiveCode, or would I need to import and assign different images (which > I have distored in photoshop before) for each screen size in each > card? Additionally I would need to create douzends of polygons as > clickable objects, above each image for small parts of it, where I am > not sure, if they would keep their exact target area, when the background image will be distort - probably not. > > > > Up to now it looks to me as a never ending story, but perhaps I don't > see a good approach > > Any experience or pointers to a how to are very welcome. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.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