Re: [WebDNA] Wishlist: ignore whitespace in database changes
This WebDNA talk-list message is from 2016
It keeps the original formatting.
numero = 112942
interpreted = N
texte = 529Over the years I=E2=80=99ve been bending WebDNA to my will. I=E2=80=99ve =more or less successfully implemented the view and controller ideology =of an MVC framework in WebDNA, and am getting ever closer to doing the =work to get data models working in webDNA. It=E2=80=99s so frustrating =in 2016 to not be able to tag a field in a database as unique or numeric =and let the language deal with it for you when you interact with the =database. I recently wasted more time then I care to admit to making =[delete db=3Dsomedb&leIDdata=3D10000] work because i forgot to add =&IDtype=3Dnum to the code.> On Aug 31, 2016, at 9:10 AM, dbrooke@euca.us wrote:>=20> Hey Brian, glad to see you are still hacking away at WebDNA. :-)>=20> Of course, this has always been a hack that we WebDNA'ers have =employed to give our eyes some ability to see what is going on with the =code.>=20> I personally haven't taken the time to do this, but perhaps a custom =function could take care of this.>=20> Something like (untested):>=20> Function-----------------> [function name=3Deuca_dbHelper]> [return][grep search=3D> %09&replace=3D%26][param_string][/grep][/return]> [/function]>=20> Call function-------------------------> [append db=3D^data/dbstats.db&autonumber=3Did][euca_dbHelper> dbpath=3D[url][$path][/url]> dbname=3D[url][$name][/url]> firstseen=3D[$timestamp]> lastseen=3D[$timestamp]> opencount=3D1> changecount=3D0> ][/append]>=20>=20> Obviously, the values entered in the call are suspect to break this if =they contain tabs or returns.. but maybe URL'ing or something else would =solve that problem.> Let us know if you come up with something that works.>=20> However, I agree with you that the format similar to:> [append db=3D^data/dbstats.db&autonumber=3Did]> dbpath=3D[url][$path][/url]> dbname=3D[url][$name][/url]> firstseen=3D[$timestamp]> lastseen=3D[$timestamp]> opencount=3D1> changecount=3D0> [/append]>=20>=20> Would be a nifty addition to WebDNA.>=20> Donovan>=20>=20>=20>=20> On 2016-08-30 11:26, Brian Burton wrote:>> While most database record changes (append/replace) are pretty>> simple, some of them can get pretty complex, and the code gets ugly>> fast.>>=20>> this is actual code I wrote this morning:>>=20>> [append db=3D^data/dbstats.db&autonumber=3Did][!]>> =[/!]dbpath=3D[$path]&dbname=3D[$name]&firstseen=3D[$timestamp]&lastseen=3D=[$timestamp]&opencount=3D1&changecount=3D0[!]>> =[/!]&Fcv=3D[$fields]&Fpv=3D&Fdh=3D[$fields]&Fdhts=3D[$timestamp]&Fdl=3D[$f=ields]&Fdlts=3D[$timestamp]&Fmh=3D[$fields]&Fmhts=3D[$timestamp][!]>> =[/!]&Rcv=3D[$records]&Rpv=3D&Rdh=3D[$records]&Rdhts=3D[$timestamp]&Rdl=3D[=$records]&Rdlts=3D[$timestamp]&Rmh=3D[$records]&Rmhts=3D[$timestamp][!]>> =[/!]&Mcv=3D[$memory]&Fpv=3D&Mdh=3D[$memory]&Mdhts=3D[$timestamp]&Mdl=3D[$m=emory]&Mdlts=3D[$timestamp]&Mmh=3D[$memory]&Mmhts=3D[$timestamp]][!]>> =[/!]&Dcv=3D[$filesize]&Dpv=3D&Ddh=3D[$filesize]&Ddhts=3D[$timestamp]&Ddl=3D=[$filesize]&Ddlts=3D[$timestamp]&Dmh=3D[$filesize]&Dmhts=3D[$timestamp][!]=>> [/!][/append]>>=20>> all the comment tags look horrible and are onerous to type and>> occasionally get messed up, which adds time to debug.>> What if we had an ignorewhitespace=3DT modifier for append and =replace>> functions?>>=20>> [append db=3D^data/dbstats.db&autonumber=3Did&ignorewhitespace=3DT]>> dbpath=3D[$path]>> &dbname=3D[$name]>> &firstseen=3D[$timestamp]>> &lastseen=3D[$timestamp]>> &opencount=3D1>> &changecount=3D0>> =E2=80=A6 etc ...>> [/append]>>=20>> Heck, even the ampersands seem superfluous at that point, but I =don=E2=80=99t>> want to upset the purists. :P>> If one desires to store away line feeds, they could just [url] the>> value being stored (which should done anyway) and problem solved.>>=20>> Brian B. Burton>>=20>>=20>>=20>> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list
.>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Associated Messages, from the most recent to the oldest:
529Over the years I=E2=80=99ve been bending WebDNA to my will. I=E2=80=99ve =more or less successfully implemented the view and controller ideology =of an MVC framework in WebDNA, and am getting ever closer to doing the =work to get data models working in webDNA. It=E2=80=99s so frustrating =in 2016 to not be able to tag a field in a database as unique or numeric =and let the language deal with it for you when you interact with the =database. I recently wasted more time then I care to admit to making =[delete db=3Dsomedb&leIDdata=3D10000] work because i forgot to add =&IDtype=3Dnum to the code.> On Aug 31, 2016, at 9:10 AM, dbrooke@euca.us wrote:>=20> Hey Brian, glad to see you are still hacking away at WebDNA. :-)>=20> Of course, this has always been a hack that we WebDNA'ers have =employed to give our eyes some ability to see what is going on with the =code.>=20> I personally haven't taken the time to do this, but perhaps a custom =function could take care of this.>=20> Something like (untested):>=20> Function-----------------> [function name=3Deuca_dbHelper]> [return][grep search=3D> %09&replace=3D%26][param_string][/grep][/return]> [/function]>=20> Call function-------------------------> [append db=3D^data/dbstats.db&autonumber=3Did][euca_dbHelper> dbpath=3D[url][$path][/url]> dbname=3D[url][$name][/url]> firstseen=3D[$timestamp]> lastseen=3D[$timestamp]> opencount=3D1> changecount=3D0> ][/append]>=20>=20> Obviously, the values entered in the call are suspect to break this if =they contain tabs or returns.. but maybe URL'ing or something else would =solve that problem.> Let us know if you come up with something that works.>=20> However, I agree with you that the format similar to:> [append db=3D^data/dbstats.db&autonumber=3Did]> dbpath=3D[url][$path][/url]> dbname=3D[url][$name][/url]> firstseen=3D[$timestamp]> lastseen=3D[$timestamp]> opencount=3D1> changecount=3D0> [/append]>=20>=20> Would be a nifty addition to WebDNA.>=20> Donovan>=20>=20>=20>=20> On 2016-08-30 11:26, Brian Burton wrote:>> While most database record changes (append/replace) are pretty>> simple, some of them can get pretty complex, and the code gets ugly>> fast.>>=20>> this is actual code I wrote this morning:>>=20>> [append db=3D^data/dbstats.db&autonumber=3Did][!]>> =[/!]dbpath=3D[$path]&dbname=3D[$name]&firstseen=3D[$timestamp]&lastseen=3D=[$timestamp]&opencount=3D1&changecount=3D0[!]>> =[/!]&Fcv=3D[$fields]&Fpv=3D&Fdh=3D[$fields]&Fdhts=3D[$timestamp]&Fdl=3D[$f=ields]&Fdlts=3D[$timestamp]&Fmh=3D[$fields]&Fmhts=3D[$timestamp][!]>> =[/!]&Rcv=3D[$records]&Rpv=3D&Rdh=3D[$records]&Rdhts=3D[$timestamp]&Rdl=3D[=$records]&Rdlts=3D[$timestamp]&Rmh=3D[$records]&Rmhts=3D[$timestamp][!]>> =[/!]&Mcv=3D[$memory]&Fpv=3D&Mdh=3D[$memory]&Mdhts=3D[$timestamp]&Mdl=3D[$m=emory]&Mdlts=3D[$timestamp]&Mmh=3D[$memory]&Mmhts=3D[$timestamp]][!]>> =[/!]&Dcv=3D[$filesize]&Dpv=3D&Ddh=3D[$filesize]&Ddhts=3D[$timestamp]&Ddl=3D=[$filesize]&Ddlts=3D[$timestamp]&Dmh=3D[$filesize]&Dmhts=3D[$timestamp][!]=>> [/!][/append]>>=20>> all the comment tags look horrible and are onerous to type and>> occasionally get messed up, which adds time to debug.>> What if we had an ignorewhitespace=3DT modifier for append and =replace>> functions?>>=20>> [append db=3D^data/dbstats.db&autonumber=3Did&ignorewhitespace=3DT]>> dbpath=3D[$path]>> &dbname=3D[$name]>> &firstseen=3D[$timestamp]>> &lastseen=3D[$timestamp]>> &opencount=3D1>> &changecount=3D0>> =E2=80=A6 etc ...>> [/append]>>=20>> Heck, even the ampersands seem superfluous at that point, but I =don=E2=80=99t>> want to upset the purists. :P>> If one desires to store away line feeds, they could just [url] the>> value being stored (which should done anyway) and problem solved.>>=20>> Brian B. Burton>>=20>>=20>>=20>> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list .>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Brian Burton
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[cart]'s ever get recycled? (2000)
Location of Browser Info.txt file (1997)
Annoying character on writefile... (2004)
Re:UPS, FEDEX TRACKING (1999)
oops private message leaked into talk list (1997)
Bug Report, maybe (1997)
Webstar 1.3.1 PPC (1997)
Different ways to get images (2005)
Paramater Passing Value (2002)
OT-JS why it does not run on Mac (2001)
Another question (1997)
Count regular expressions in a file (2007)
Problems with [Applescript] (1997)
showif and cart (1997)
WebMerchant Problem (1999)
WCS Newbie question (1997)
Parameter Passing (2000)
Allow-Deny: Solved with [Getchars] (1998)
Trouble with carts (2000)
Ampersand (1997)