Statistics: Posted by SWEdeAndy — Mon Mar 18, 2024 8:35 pm
Statistics: Posted by SWEdeAndy — Mon Mar 18, 2024 6:16 pm
You'll be happy to see that I finally found how to crack the pasting nut - see my just released WebDeployHelper tool beta over here: https://forums.livecode.com/viewtopic.php?f=120&t=38989SWEdeAndy, I'd also be very curious if you have any similar workarounds concerning file I/O (writing to and from local files on a Mac/Linux/Windows etc) -- and/or the ability to accept clipboard data from a user (incoming). File I/O - even just text - would be magic! Marc
Statistics: Posted by mbossiere — Mon Mar 18, 2024 6:06 pm
CODE:
curl http://localhost:8080/v1/models
CODE:
put "" into tHeaders put "http://localhost:8080/v1/models" into tBaseURL put tsNetGetSync(tBaseURL, tHeaders, tRecvHeaders, tResult, tBytes) into tData
CODE:
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{ "model": "luna-ai-llama2", "messages": [{"role": "user", "content": "How are you?"}], "temperature": 0.9 }'
CODE:
put "http://localhost:8080" into tBaseURL put "" into tHeaders //put "/v1/chat/completions&Content-Type: application/json & model: ggml-gpt4all-j & messages: [&role: user&content: How are you?&] & temperature: 0.9" into tHeaders //put "/v1/chat/completions&content:How are you?&Content-Type:application/json&model:ggml-gpt4all-j&role:user&temperature:0.9" into tHeaders put "/v1/chat/completions&Content-Type: application/json & model: ggml-gpt4all-j & messages: [&role: user&content: How are you?&] & temperature: 0.9" into tHeaders put tBaseURL&tHeaders into tRequestString put "" into tHeaders put tsNetGetSync(tRequestString, tHeaders, tRecvHeaders, tResult, tBytes) into tData
Statistics: Posted by mrcoollion — Mon Mar 18, 2024 4:53 pm
Statistics: Posted by richmond62 — Mon Mar 18, 2024 10:35 am
Statistics: Posted by stam — Mon Mar 18, 2024 9:55 am
Statistics: Posted by oldummy — Mon Mar 18, 2024 8:55 am
Statistics: Posted by mbossiere — Mon Mar 18, 2024 7:29 am
CODE:
put quote & specialFolderPath("resources") & slash & "library/pdftotext.exe" & quote into sPDFtotext put shell(sPDFtotext && "-f" && tPageNum && "-l" && tPageNum && "-layout" && sFile && "-") into tShellResults
Statistics: Posted by bamakojeff — Mon Mar 18, 2024 1:41 am
Statistics: Posted by grzkmo — Mon Mar 18, 2024 1:00 am
Statistics: Posted by SWEdeAndy — Sun Mar 17, 2024 11:13 pm
Statistics: Posted by SWEdeAndy — Sun Mar 17, 2024 11:07 pm
Statistics: Posted by j9v6 — Sun Mar 17, 2024 10:51 pm
CODE:
mobileControlset "myNativeField", "editable", false
Statistics: Posted by bamakojeff — Sun Mar 17, 2024 8:04 pm
The risk is that rarely, a valid post by new user whose first language is not English may be deleted as spam. Not great on the very rare occasions this may happen.#2 is the most difficult Spam to deal with, so Klaus's sixth sense is invaluable in this respect.
Statistics: Posted by SparkOut — Sun Mar 17, 2024 3:55 pm
Statistics: Posted by Klaus — Sun Mar 17, 2024 2:02 pm
Statistics: Posted by oldummy — Sun Mar 17, 2024 1:37 pm
Statistics: Posted by stam — Sun Mar 17, 2024 1:29 pm
Statistics: Posted by richmond62 — Sun Mar 17, 2024 1:11 pm
I actually do not care!...but do you think this snippet came from a human (spam) or a "C" rated AI helper (bot)?
Statistics: Posted by Klaus — Sun Mar 17, 2024 12:00 pm
Statistics: Posted by dunbarx — Sat Mar 16, 2024 9:28 pm
Statistics: Posted by Klaus — Sat Mar 16, 2024 8:38 pm
Statistics: Posted by dunbarx — Sat Mar 16, 2024 8:09 pm
Statistics: Posted by Klaus — Sat Mar 16, 2024 5:24 pm
Statistics: Posted by SparkOut — Sat Mar 16, 2024 4:58 pm
Statistics: Posted by dunbarx — Sat Mar 16, 2024 4:40 pm
Statistics: Posted by Klaus — Sat Mar 16, 2024 1:08 pm
Statistics: Posted by Klaus — Sat Mar 16, 2024 12:44 pm
If I well understood this lib allows you to create - and manage - new articles to Apple menu, but you can't modify Apple articles.Ideally this would be a menubar item but really not sure if/how you can do this with LiveCode. There is a 'Mac Status Menu' library that I guess lets you do this, but the documentation puts Spartans to shame - to say it's laconic is a vast overstatement.
Statistics: Posted by Zax — Sat Mar 16, 2024 10:34 am
Statistics: Posted by SparkOut — Sat Mar 16, 2024 10:11 am
Statistics: Posted by FourthWorld — Sat Mar 16, 2024 6:39 am
Statistics: Posted by leifsmith — Sat Mar 16, 2024 12:49 am
CODE:
on selectionChanged delete line word 2 of the clickline of the targetend selectionChanged
Yep. Clicking anywhere in a line essentially sets the cursor at that point, and that is a changed selection.Statistics: Posted by dunbarx — Fri Mar 15, 2024 11:35 pm
Statistics: Posted by Aduro91 — Fri Mar 15, 2024 11:22 pm
Statistics: Posted by SparkOut — Fri Mar 15, 2024 8:15 pm
Statistics: Posted by swing62 — Fri Mar 15, 2024 7:16 pm
Statistics: Posted by dunbarx — Fri Mar 15, 2024 7:00 pm
CODE:
on mouseWithin if the mouse is down then delete line (word 2 of the mouseLine) of the target wait until the mouse is up end ifend mouseWithin
Statistics: Posted by dunbarx — Fri Mar 15, 2024 6:57 pm
Statistics: Posted by dunbarx — Fri Mar 15, 2024 6:41 pm
Statistics: Posted by Klaus — Fri Mar 15, 2024 3:29 pm
Statistics: Posted by richmond62 — Fri Mar 15, 2024 2:41 pm
Statistics: Posted by Klaus — Fri Mar 15, 2024 2:38 pm
Statistics: Posted by swing62 — Fri Mar 15, 2024 11:43 am
As others have said, you cannot do such "simple, ordinary" tasks with a modal dialog open. You are locked out.Yes that is the method to delete the row, but wanting to do it with a click on the same row ? Or by searching the line by locating it through code search (or name, title...) and then delete it.
Statistics: Posted by dunbarx — Thu Mar 14, 2024 11:59 pm
CODE:
on doSendNotification local tScriptFile put specialfolderpath("temp") & "/send.sh" into tScriptFile put sScript into url ("binfile:/" & tScriptFile) get shell ("sh" && tScriptFile) put it into fld "output"end doSendNotification
Statistics: Posted by Aduro91 — Thu Mar 14, 2024 10:35 pm
Not sure I understand, do you mean that something like:...
In practice I do not find an elegant method to delete a row from a field, also because there are other functions that the field performs...
CODE:
...delete line 42 of fld "your field in question here"...
CODE:
...lock messagesdelete line 42 of fld "your field in question here"## more stuff here if neccessary...unlock messages...
Statistics: Posted by swing62 — Thu Mar 14, 2024 8:51 pm
CODE:
...delete line 42 of fld "your field in question here"...
CODE:
...lock messagesdelete line 42 of fld "your field in question here"## more stuff here if neccessary...unlock messages...
Statistics: Posted by Klaus — Thu Mar 14, 2024 7:39 pm
Statistics: Posted by bn — Thu Mar 14, 2024 7:37 pm
Statistics: Posted by bn — Thu Mar 14, 2024 7:33 pm
Statistics: Posted by bn — Thu Mar 14, 2024 7:25 pm
Statistics: Posted by swing62 — Thu Mar 14, 2024 7:21 pm
Statistics: Posted by swing62 — Thu Mar 14, 2024 7:08 pm
Statistics: Posted by stam — Thu Mar 14, 2024 6:53 pm
Statistics: Posted by Klaus — Thu Mar 14, 2024 6:36 pm
Statistics: Posted by swing62 — Thu Mar 14, 2024 6:29 pm
Statistics: Posted by stam — Thu Mar 14, 2024 4:10 pm
Statistics: Posted by Gary Rathbone — Thu Mar 14, 2024 4:01 pm
Statistics: Posted by Gary Rathbone — Thu Mar 14, 2024 3:56 pm
Statistics: Posted by Gary Rathbone — Thu Mar 14, 2024 3:47 pm
Statistics: Posted by Gary Rathbone — Thu Mar 14, 2024 3:39 pm
Statistics: Posted by Gary Rathbone — Thu Mar 14, 2024 3:30 pm
and the code to get the metadata for each word when the user clicks on a word is simply:<p><span metadata="1">first_word</span> <span metadata="2">second_word</span></p>
CODE:
put the metadata of the mouseText into tWordID
and to get the metadata for each word I will use:<p metadata="1 2">first_word second_word</p>
CODE:
put the number of words of char 1 to word 4 of the mouseChunk of fld "txt" into tNumput word 2 of the mouseLine in tLineput word tNum of the metadata of line tLine of fld "txt" into tWordID
Statistics: Posted by bamakojeff — Thu Mar 14, 2024 2:45 pm
Statistics: Posted by dunbarx — Thu Mar 14, 2024 2:27 pm
Statistics: Posted by bn — Thu Mar 14, 2024 2:12 pm
Statistics: Posted by dunbarx — Thu Mar 14, 2024 1:58 pm
Statistics: Posted by stam — Thu Mar 14, 2024 1:57 pm
Statistics: Posted by bn — Thu Mar 14, 2024 1:28 pm
Statistics: Posted by stam — Thu Mar 14, 2024 12:43 pm
Statistics: Posted by paul@researchware.com — Thu Mar 14, 2024 12:27 pm
Statistics: Posted by dunbarx — Thu Mar 14, 2024 3:52 am
Statistics: Posted by trevix — Thu Mar 14, 2024 1:11 am
Statistics: Posted by bn — Wed Mar 13, 2024 10:40 pm
CODE:
on mouseup answer file "Select a Font..." put it into tFont start using font file tFont set the textfont of fld "fFont" to "Quicksand Light"end mouseup
Statistics: Posted by Gary Rathbone — Wed Mar 13, 2024 10:16 pm
Statistics: Posted by SparkOut — Wed Mar 13, 2024 9:59 pm
CODE:
on mouseup answer file "Select a Font..." put it into tFont start using font file tFont set the textfont of fld "fFont" to tFont ## does not work ##########end mouseup
Statistics: Posted by bn — Wed Mar 13, 2024 9:30 pm
CODE:
on mouseup answer file "Select a Font..." put it into tFont start using font file tFont set the textfont of fld "fFont" to tFontend mouseup
Statistics: Posted by Gary Rathbone — Wed Mar 13, 2024 9:03 pm
Actually I use the metadata of line 1 to make a pair of wordnumber:text of property then I can query for each word that does have metadata the content of the metadata.So the metadata is never set as a property to the words themselves, but rather in the "owner" of those words, that is, the line?
Statistics: Posted by bn — Wed Mar 13, 2024 8:56 pm
CODE:
set the metadata of word 3 of fld 1 to "t,X" & return & "h,Y" & return & "e,Z"
CODE:
answer item 2 of line 2 of the metaData of word 3 of fld 1
Statistics: Posted by dunbarx — Wed Mar 13, 2024 8:54 pm
Statistics: Posted by Gary Rathbone — Wed Mar 13, 2024 8:50 pm
Statistics: Posted by Gary Rathbone — Wed Mar 13, 2024 8:46 pm
Statistics: Posted by Gary Rathbone — Wed Mar 13, 2024 8:42 pm
Statistics: Posted by dunbarx — Wed Mar 13, 2024 8:29 pm
Statistics: Posted by Gary Rathbone — Wed Mar 13, 2024 6:08 pm
Statistics: Posted by bn — Wed Mar 13, 2024 5:52 pm
Statistics: Posted by dunbarx — Wed Mar 13, 2024 4:17 pm
Statistics: Posted by dunbarx — Wed Mar 13, 2024 3:42 pm
Statistics: Posted by dunbarx — Wed Mar 13, 2024 3:38 pm
Statistics: Posted by bamakojeff — Wed Mar 13, 2024 2:40 pm
Statistics: Posted by dunbarx — Wed Mar 13, 2024 2:17 pm
Statistics: Posted by dunbarx — Wed Mar 13, 2024 2:21 am
Statistics: Posted by stam — Wed Mar 13, 2024 1:38 am
Statistics: Posted by bamakojeff — Wed Mar 13, 2024 12:56 am
CODE:
<p><font bgcolor="#DEDEDE">Lorem ipsum <a name="JEFF">dolor</a></font><font bgcolor="#DEDEDE"> sit amet</font></p>
Statistics: Posted by bn — Tue Mar 12, 2024 10:52 pm
Statistics: Posted by dunbarx — Tue Mar 12, 2024 10:50 pm
Statistics: Posted by stam — Tue Mar 12, 2024 8:46 pm
Statistics: Posted by stam — Tue Mar 12, 2024 8:29 pm
Statistics: Posted by stam — Tue Mar 12, 2024 7:45 pm
Statistics: Posted by kresten — Tue Mar 12, 2024 4:51 pm
Statistics: Posted by kresten — Tue Mar 12, 2024 4:50 pm
Statistics: Posted by Gary Rathbone — Tue Mar 12, 2024 3:45 pm
Statistics: Posted by dunbarx — Tue Mar 12, 2024 3:45 pm
Statistics: Posted by bn — Tue Mar 12, 2024 3:25 pm
Statistics: Posted by dunbarx — Tue Mar 12, 2024 3:20 pm
Statistics: Posted by trevix — Tue Mar 12, 2024 2:49 pm
CODE:
set foregroundcolor of char X to Y of fld "Z" to "color"
Statistics: Posted by bamakojeff — Tue Mar 12, 2024 2:24 pm
Statistics: Posted by Klaus — Tue Mar 12, 2024 2:05 pm
Statistics: Posted by bn — Tue Mar 12, 2024 1:00 pm
Statistics: Posted by bn — Tue Mar 12, 2024 12:25 pm
CODE:
on mouseUp repeat with i = 1 to the number of words of field "ff" set the metadata of word i of field "ff" to i end repeatend mouseUp
Statistics: Posted by bn — Tue Mar 12, 2024 12:23 pm
Statistics: Posted by richmond62 — Tue Mar 12, 2024 12:18 pm
CODE:
on mouseup answer file "choose font" if it is not empty then put it into tFile start using font file tFile end if put fontnames() into fld "fFonts"end mouseUp
Statistics: Posted by Gary Rathbone — Tue Mar 12, 2024 12:15 pm
Statistics: Posted by stam — Tue Mar 12, 2024 12:01 pm
Statistics: Posted by bn — Tue Mar 12, 2024 11:57 am
Statistics: Posted by richmond62 — Tue Mar 12, 2024 11:54 am
If you have provided an API key then maybe someone with Android experience can chime in.Description
This widget wraps an MKMapView on iOS and 64-bit Mac, and a GoogleMap on
Android. It supports simple markers and polylines (on Android).
Note: In order to use the map widget on Android, you must create a Google Maps V2 API key for your app, and set it in the standalone settings for the map widget via the cog icon in the Inclusions pane of the standalone settings stack.
Statistics: Posted by bn — Tue Mar 12, 2024 11:48 am
CODE:
on linkClicked pClick beep put the target && pClick & cr & the clickChunk & cr & the clickText & cr & the metadata of the clickChunk into field "fRes"end linkClicked
CODE:
set the metadata of word 3 of field 1 to "myMetaData"
Statistics: Posted by bn — Tue Mar 12, 2024 11:40 am
Statistics: Posted by deniolps — Tue Mar 12, 2024 8:27 am
CODE:
set the backgroundcolor of char X to Y of fld "Z" to "color"
to highlight text in a field. But if I add metadata to the text, then the background color has "gaps" in it - lines one pixel wide where the new background color is not set. This happens whether you use htmltext in the field and have the metadata in <span> tags or you create it programmatically.CODE:
set the htmltext of fld "txt" to "<span metadata='1'>Lorem</span> <span metadata='2'>ipsum</span> <span metadata='3'>dolor</span> <span metadata='4'>sic</span> <span metadata='5'>mit</span>"
CODE:
set the backgroundcolor of char 1 to -1 of fld "txt" to "green"
CODE:
set the metadata of word 1 of fld "txt" to "1"set the metadata of word 2 of fld "txt" to "2"...
Statistics: Posted by bamakojeff — Tue Mar 12, 2024 12:05 am
Statistics: Posted by Laserl — Mon Mar 11, 2024 8:24 pm
Statistics: Posted by trevix — Mon Mar 11, 2024 7:56 pm
CODE:
on ScrollFromOutside pValue --line number sent from other script in order to select and scroll put the formattedHeight of field "FldList" of me into tFormattedHeight set the height of field "FldList" of me to tFormattedHeight put the effective textHeight of field "FldList" of me into tTextHeight put the number of lines of field "FldList" of me into tNumLines put trunc((pValue - 1) * tTextHeight) into tScroll -- into tNumOfLine --number of visible lines put tFormattedHeight - the height of me into tMaxScroll set the vscroll of me to 0 set the top of field "FldList" of me to the top of me put max(0,min(tScroll,tMaxScroll)) into tScroll2 --set the vscroll of me to tScroll2 if the environment is "mobile" then mobileControlSet sScrollerId, "contentRect", (0,0,the width of field "FldList" of me,tFormattedHeight) wait 100 milliseconds with messages mobileControlSet sScrollerId, "vscroll", tScroll2 end if set the vscroll of me to tScroll2 set the hilitedline of fld "FldList" of me to pValueend ScrollFromOutside
Statistics: Posted by trevix — Mon Mar 11, 2024 7:50 pm
Statistics: Posted by dunbarx — Mon Mar 11, 2024 7:18 pm
CODE:
find word "(Gesamtwürdigung"
CODE:
find "Gesamtwürdigung"orfind string "Gesamtwürdigung"
Statistics: Posted by dunbarx — Mon Mar 11, 2024 7:16 pm
Statistics: Posted by jacque — Mon Mar 11, 2024 6:41 pm
Statistics: Posted by stam — Mon Mar 11, 2024 5:25 pm
Statistics: Posted by j9v6 — Mon Mar 11, 2024 4:40 pm
CODE:
put the fontNames into tNames; sort tNames; filter tNames with "*open sans*"; put tNames
Statistics: Posted by bn — Mon Mar 11, 2024 3:07 pm
Statistics: Posted by stam — Mon Mar 11, 2024 2:29 pm
It's a non-argument you chose to argue - SQLite has no "structural housekeeping" requirement - at least no more than a spreadsheet or a text file. Because it's not an RDBMS.The structural housekeeping of RDBMSs is not trivial.
CODE:
SELECT * FROM ( SELECT * FROM <table> ORDER BY <column> DESC LIMIT 200 )ORDER BY <column> ASC;
Statistics: Posted by stam — Mon Mar 11, 2024 2:21 pm
Statistics: Posted by bn — Mon Mar 11, 2024 2:11 pm
Statistics: Posted by Gary Rathbone — Mon Mar 11, 2024 2:00 pm
No one said it wasn't a relational database; it's not an RDMBS.SQLite is a relational database system.
I don't run the world, I just report what I see in my travels across it.Well that is of course your prerogative.I would not make that recommendation.SQLite can be used as a substitute for ZIP archives or Tarballs.
LC says LC makes a great web authoring solution. Technology providers are proud of their work.I literally lifted that verbatim from SQLite home page on use-cases for SQLite: https://www.sqlite.org/whentouse.html.
Bruce was looking for a tail operation, and was delighted to find LC's file I/O is complete enough to provide that along with seek, append, and the other file system directives scripters of many languages enjoy.No doubt - and that's why we all use it. And Bernd's code is magic.In the meantime, tailing is what he asked for, and with Bernd's example we see LC is once again up to the task.
But that's a creative solution that had to be invented tailored to the exact scenario at hand.
Statistics: Posted by FourthWorld — Mon Mar 11, 2024 5:33 am
Statistics: Posted by FourthWorld — Mon Mar 11, 2024 5:10 am
Statistics: Posted by bbalmerTotalFluency — Mon Mar 11, 2024 4:53 am
CODE:
local sExpected, sObserved, sDoF, sCriticalValue# sExpected, SObserved are comma delimited listsfunction chiSquare pObserved, pExpected local K, X, peeValue set the numberformat to "0.##################" setValues pExpected, pObserved if sCriticalValue < 0 or sDoF < 1 then return 0 put sDoF * 0.5 into K put sCriticalValue * 0.5 into X //special case if sDoF = 2 then return exp(-1.0 * X) put igf(K, X) into peeValue if peeValue is not a number or peeValue = infinity or peeValue <= 1e-8 then return 1e-14; divide peeValue by gamma(K) return 1 - peeValueend chiSquarecommand setValues pExpected, pObserved if pExpected is empty or pObserved is empty then exit to top put pExpected into sExpected put pObserved into sObserved put getCriticalValue() into sCriticalValue put getDegreesOfFreedeom() into sDoFend setValuesfunction getCriticalValue // test statistic local tDiff, tValue repeat with x = 1 to the number of items of sObserved put item x of sObserved - item x of sExpected into tDiff add ((tDiff * tDiff)/item x of sExpected) to tValue end repeat return tValueend getCriticalValuefunction getDegreesOfFreedeom return the number of items of sObserved - 1end getDegreesOfFreedeomfunction igf S, Z local Sc, tSum = 1, Nom = 1, Denom = 1 if Z < 0 then return 0 put 1/S into Sc multiply Sc by Z^S multiply Sc by exp(-1 * Z) repeat with x = 0 to 160 // 200 causes overlow so reduced to 160 multiply Nom by Z add 1 to S multiply denom by S add (Nom/Denom) to tSum end repeat return tSum * Scend igffunction gamma N local K, Z, Sc, F = 1, Ck, tSum constant A = 15 constant SQRT2PI = 5066282746310005024157652848110452530069867406099383 put N into Z put (Z+A)^(z+0.5) into Sc multiply Sc by exp(-1*(Z+A)) divide Sc by z put SQRT2PI into tSum repeat Add 1 to z Add 1 to k put (a-k)^(k-0.5) into Ck multiply Ck by exp(A-K) divide Ck by F add (Ck/Z) to tSum multiply F by (-1*K) exit repeat if K >= A end repeat return tSum * Scend gamma--function gamma Z // approx_gamma algorithm-- local D, RECIP_Z-- constant RECIP_E = 0.36787944117144232159552377016147-- constant TWOPI = 6.283185307179586476925286766559-- put (1/Z) into RECIP_Z-- put 0.1 * RECIP_Z into D-- put 1/((12*Z) - D) into D-- put (D+Z) * RECIP_E into D-- put D^Z into D-- multiply D by sqrt(TWOPI * RECIP_Z)-- return D--end gamma
Statistics: Posted by stam — Mon Mar 11, 2024 4:18 am
Well that is of course your prerogative.I would not make that recommendation.SQLite can be used as a substitute for ZIP archives or Tarballs.
No doubt - and that's why we all use it. And Bernd's code is magic.In the meantime, tailing is what he asked for, and with Bernd's example we see LC is once again up to the task.
Statistics: Posted by stam — Mon Mar 11, 2024 3:51 am
Poor example I'm afraid - one option is treatment and the other prevention - you can't prevent with treatment and you can't treat with prevention - you can only prevent. But I appreciate the sentimentWhy rush to a stent when some patients only need a cleaner diet and some exercise? Of course the answer will depend on the patient.
You might be surprised what some folks do with their files. I've seen people attempt all sorts of things, and then express surprise that they broke the file. But even when used as intended:I wasn't suggesting deleting random bytes of a file - which file format can withstand that and in what context (outside of hard drive failure) would this mythical event happen?
Any structured data is best read from and written to through a provided interface. Sanitizing inputs is a useful practice with most file formats (mind those semicolons).I was suggesting changing the content even by 1 char. A prime example of the pain this can cause is trying to a TSV file where the field contents contain carriage returns. Records become misaligned etc. It doesn't take much at all to do this accidentally do this with a simple text file, but much more difficult to do with an SQLite file.
SQLite is a relational database system.And to be clear I'm not comparing text files with RDMS's - I'm comparing text file storage with SQLite file storage (not an RDMS).
There are many storage options, each with their strengths and weaknesses. There is no one-size-fits-all solution. SQLite is quite capable and well suited for many things, but I can't recommend strongly enough the value of studying its internal structures and algorithms before choosing it for a given task, doubly so if tempted to recommended it to others for an undefined range of tasks.Ease of coding for both is similar. Both can be used interchangeably in many situations - but many LC users simply don't realise how blazingly fast SQLite can be... and it's an excellent storage medium.
I would not make that recommendation. And given that both Zip and SQLite have grown in popularity over the years without either replacing the other, it seems a good many systems and application engineers see very different benefits in each.SQLite can be used as a substitute for ZIP archives or Tarballs.
Flat files can be displayed in datagrids, and SQL query results can be displayed in columnar fields. I use both storage methods, and both display methods, each for different reasons.So yeah so people prefer text files and tableFields, others prefer SQLite files and datagrids.
At the heart of finding optimal solutions for a given task is understanding the system as a whole. Most applications can be seen as boxes where stuff comes in and other stuff comes out, and knowing what's happening on either end of that process chain will inform the choices within the box we're writing.You can use both, but in both cases, truly large amounts of data favour the latter - in my mind anyway.
Statistics: Posted by FourthWorld — Mon Mar 11, 2024 12:53 am
Statistics: Posted by dunbarx — Mon Mar 11, 2024 12:15 am
Statistics: Posted by GoSm — Sun Mar 10, 2024 11:01 pm
Statistics: Posted by SparkOut — Sun Mar 10, 2024 10:24 pm
Statistics: Posted by SparkOut — Sun Mar 10, 2024 10:21 pm
CODE:
set the textfont of field "fldTestfield" to empty
Statistics: Posted by SparkOut — Sun Mar 10, 2024 10:03 pm
CODE:
on mouseUp answer file "choose font" if it is not empty then put it into tFile start using font file tFile end ifend mouseUp
Statistics: Posted by bn — Sun Mar 10, 2024 9:14 pm
Statistics: Posted by Gary Rathbone — Sun Mar 10, 2024 8:00 pm
Statistics: Posted by Gary Rathbone — Sun Mar 10, 2024 7:48 pm
Statistics: Posted by stam — Sun Mar 10, 2024 6:50 pm
Safer because it’s less prone to random errors. Deleting 1 char in a text file (a column or record delimiter) can alter the contents of the entire file but the same in a database at most can alter 1 record. Plus SQLite is highly compressed and is effective file based storage.a) Safer in what way?Ultimately however I still think an sqlite database would be a) safer, b) quicker with the number of records discussed here.
b) Quicker only for certain operations, and slower for others.
Of course, it's all about the use case.Slower for others? Possibly there are circumstances where cleverness with a text file can produce slightly quicker results, but I would postulate that the majority of times SQLite is much quicker. But like everything there are code optimisations that can be performed in SQL as well. In your example wouldn’t to ensure indexing was adequate for example.
Statistics: Posted by FourthWorld — Sun Mar 10, 2024 5:31 pm
a) Safer in what way?Ultimately however I still think an sqlite database would be a) safer, b) quicker with the number of records discussed here.
Statistics: Posted by stam — Sun Mar 10, 2024 4:57 pm
Statistics: Posted by FourthWorld — Sun Mar 10, 2024 4:43 pm
Statistics: Posted by dunbarx — Sun Mar 10, 2024 2:54 pm
Statistics: Posted by Gary Rathbone — Sun Mar 10, 2024 2:34 pm
Statistics: Posted by bn — Sun Mar 10, 2024 9:06 am
Statistics: Posted by stam — Sun Mar 10, 2024 2:07 am
Statistics: Posted by bn — Sun Mar 10, 2024 12:29 am
CODE:
on mouseUp local tFile, tData answer file "choose file to read" if it is empty then exit mouseUp put it into tFile put line -200 to -1 of tFile into tData // ... process tDataend mouseUp
Statistics: Posted by bn — Sun Mar 10, 2024 12:11 am
CODE:
on mouseUp local tFile, tData answer file "choose file to read" if it is empty then exit mouseUp put it into tFile put line -200 to -1 of tFile into tData // ... process tDataend mouseUp
I'm guessing there won't be much difference at all with smaller text files, but would be very curious to see what happened with files with over 50,000 lines that the OP reports.Statistics: Posted by stam — Sat Mar 09, 2024 11:15 pm
CODE:
on mouseUp ## 25 chars per row ## lets use 30 chars to be sure put 200 * 30 into tCharsNeeded ## the number of lines you want from the end of the file put 200 into tNumLinesNeeded answer file "choose file to read" if it is empty then exit mouseUp put it into tfilePath open file tFilePath for text read read from file tfilePath at - tCharsNeeded until eof ## tResult should contain "EOF" put the result into tResult put textDecode(it, "utf8") into tData -- depends on your needs. ## for debugging check if you have enough lines to cut them down to the number your want ## otherwise increase the number of chars per line put the number of lines of tData into tNumLines ## cut down the number of lines to the last 200 of the file put line - tNumLinesNeeded to -1 of tData into tData ## for debugging check put the number of lines of tData into tNumAfter close file tFilePath ## now do processing your data -- code end mouseUp
Statistics: Posted by bn — Sat Mar 09, 2024 9:53 pm
referring to LiveCode, it should be pointed out that if one makes a minimal effort to trawl through the forums there is a bucket-load of stuff to get anyone with a bit of 'oomph' going on building quite a few types of 'computer game'.I am looking for someone who can please teach me how to build a computer game
Statistics: Posted by richmond62 — Sat Mar 09, 2024 7:00 pm
Statistics: Posted by stam — Sat Mar 09, 2024 4:46 pm
Statistics: Posted by stam — Sat Mar 09, 2024 4:35 pm
Statistics: Posted by danielrr — Sat Mar 09, 2024 3:57 pm
Statistics: Posted by stam — Sat Mar 09, 2024 3:21 pm
Statistics: Posted by SparkOut — Sat Mar 09, 2024 3:07 pm
Statistics: Posted by danielrr — Sat Mar 09, 2024 2:57 pm
Statistics: Posted by richmond62 — Sat Mar 09, 2024 12:58 pm
Statistics: Posted by SparkOut — Sat Mar 09, 2024 11:41 am
Statistics: Posted by SparkOut — Sat Mar 09, 2024 11:22 am
Statistics: Posted by mrcoollion — Sat Mar 09, 2024 11:09 am
Statistics: Posted by bbalmerTotalFluency — Sat Mar 09, 2024 9:35 am
Statistics: Posted by stam — Sat Mar 09, 2024 1:07 am
Statistics: Posted by Gary Rathbone — Fri Mar 08, 2024 11:59 pm
I accept I may be missing the obvious coding magic that allows read from file to read the last 200 lines and if I am please do post the answer, and even better post some speed comparisons.Summary: Takes data from a file that has been opened with the open file command, and places the data in the it variable
Statistics: Posted by stam — Fri Mar 08, 2024 7:20 pm
Statistics: Posted by stam — Fri Mar 08, 2024 7:06 pm
Statistics: Posted by bobcole — Fri Mar 08, 2024 5:50 pm
Statistics: Posted by dunbarx — Fri Mar 08, 2024 4:50 pm
Which is basically what put URL (file://...) does.Summary: Takes data from a file that has been opened with the open file command, and places the data in the it variable.
Statistics: Posted by Klaus — Fri Mar 08, 2024 4:44 pm
Statistics: Posted by FourthWorld — Fri Mar 08, 2024 4:24 pm
Statistics: Posted by mrcoollion — Fri Mar 08, 2024 4:08 pm
Statistics: Posted by dunbarx — Fri Mar 08, 2024 3:13 pm
Statistics: Posted by Zax — Fri Mar 08, 2024 2:17 pm
CODE:
on dropNewElement droppedFilePath put dropThing(droppedFilePath) into arrFileInfos // "fileName", "filePath", "fileType" et "iconPath" if arrFileInfos is not an array and arrFileInfos is not empty then answerError "An error has occured." & cr & " " & arrFileInfos & " [#7300]" exit to top end if ... // process if no errorend dropNewElement
Statistics: Posted by stam — Fri Mar 08, 2024 1:51 pm
Statistics: Posted by stam — Fri Mar 08, 2024 1:48 pm
The code with 7300 error is only called on dragDrop built-in message.Reviewing your code above, is there any other part of the app that executes the lineIf not, then why is on dropNewElement droppedFilePath being run on startup? Is this the issue?CODE:
answerError "An error has occured." & cr & " " & arrFileInfos & " [#7300]"
Statistics: Posted by Zax — Fri Mar 08, 2024 1:48 pm
Statistics: Posted by Gary Rathbone — Fri Mar 08, 2024 1:05 pm