Re: PicoLisp 3.0 GUI changes issue
I'll replace them with tw_pwd and tw_uname which is the names of the E/R relations, I like it consistent over the whole board :-) /Henrik On Mon, Nov 2, 2009 at 8:33 AM, Alexander Burger a...@software-lab.de wrot= e: Hi Henrik, As of PicoLisp 3 *Post for instance is no more so the above wouldn't That's right. Just for the info, '*Post' needs to be replaced by '*PRG'. In the code in we discussed, however, it was not necessary any more. I'm unable to get the cursor to appear in them. The only lead I have on this one is that the pwd2 field is of course the only field that is not a part of the +User E/R. Oops, my error. '+E/R' does not make sense in _all_ fields, as the object is no longer created at the initial GET, but in the Save button. '+E/R' automatically disables input fields when the form holds no object. So the solution should be (not tested): (de register () =A0 (app) =A0 (action =A0 =A0 =A0(rss-html =A0 =A0 =A0 =A0 (form NIL =A0 =A0 =A0 =A0 =A0 =A0(grid 2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Username (gui 'uname '(+AlNum) 10) =A0 =A0 =A0 =A0 =A0 =A0 =A0 Password (gui 'pwd '(+PwdCheck +PwField) '(= val (: home pwd2)) 10) =A0 =A0 =A0 =A0 =A0 =A0 =A0 Password Again (gui 'pwd2 '(+PwField) 10) =A0 =A0 =A0 =A0 =A0 =A0 =A0 Email (gui 'email '(+TextField) 10) =A0 =A0 =A0 =A0 =A0 =A0 =A0 Twitter username (gui 'twn '(+TextField) 10= ) =A0 =A0 =A0 =A0 =A0 =A0 =A0 Twitter password (gui 'twp '(+PwField) 10) = ) =A0 =A0 =A0 =A0 =A0 =A0(gui '(+Button) Save =A0 =A0 =A0 =A0 =A0 =A0 =A0 '(cond =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((db 'uname '+User (val (: home unam= e))) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(err Name not unique) ) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (( (val (: home pwd)) (val (: hom= e pwd2))) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(err Password mismatch) ) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (T =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(let Usr =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (new! '(+User) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'uname (val (: ho= me uname)) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'tw_pwd (val (: h= ome tw_pwd)) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'tw_uname (val (:= home tw_uname)) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'pwd (val (: home= pwd)) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'email (val (: ho= me email))) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (cookie 'uid (put! Usr '= uid (randNum '+Gh 20))) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (redir) ) ) ) ) ) ) ) ) The two fields 'twn' and 'twp' are not used? Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: +Idx problems maybe?
I did the rebuild but I'm still not getting any results when running the above query and I know for a fact that I should be getting at least two. Doing the scan gives me a long list, this is the end of it: (zerosum dirt(nap) - Home . {8o}) {8o} (zhou {BH}) {BH} (ziDesigns - Zaigham's Corner // Updates . {9i}) {9i} (zie {5S}) {5S} (zin {CL}) {CL} (zine {1N}) {1N} (zine {1v}) {1v} (zine {3Q}) {3Q} (zine {4z}) {4z} (zine {;m}) {;m} (zine {Ai}) {Ai} (zine {i}) {i} (zing {73}) {73} (ziuba {6X}) {6X} (zny {3m}) {3m} (zons {D}) {D} (zor {CB}) {CB} (zorberry's {:b}) {:b} (zorblades {4m}) {4m} (zweilAI.net {1j}) {1j} (zysz {4D}) {4D} (|architect's {b}) {b} (=C3=A4lp {DK}) {DK} (=C3=B4ng {8T}) {8T} (=C3=B6kmotorkonsult {CV}) {CV} (=C3=B6ren {6Y}) {6Y} (=C3=BCro {Av}) {Av} (=CE=BB Tony's Blog =CE=BB . {A6}) {A6} (=E3=80=8A=E8=B4=A2=E7=BB=8F=E7=BD=91=E3=80=8B-English . {:q}) {:q} (=E3=80=8B-English {:q}) {:q} (=E7=BB=8F=E7=BD=91=E3=80=8B-English {:q}) {:q} (=E7=BD=91=E3=80=8B-English {:q}) {:q} (=E8=B4=A2=E7=BB=8F=E7=BD=91=E3=80=8B-English {:q}) {:q} Does that output tell you anything? On Mon, Nov 2, 2009 at 12:25 PM, Henrik Sarvell hsarv...@gmail.com wrote: Thanks, I'll try it out. /Henrik On Mon, Nov 2, 2009 at 8:13 AM, Alexander Burger a...@software-lab.de wr= ote: Hi Henrik, (rel title =C2=A0 =C2=A0 (+Idx +String)) # ... The +Idx wasn't there when the feeds in question were first created, I added it because I thought it would be necessary or speed things up. OK. (mapc '((F)(put! F 'title (; F title))) (collect 'fid '+Feed)) This has no effect, because 'put!' will not modify the object if the new value is the current value, and therefore will also not modify or create the index as a side effect. The easiest is to use 'rebuild' to (re)build an index: =C2=A0 (load lib/too.l) =C2=A0 (rebuild (collect 'fid '+Feed) 'title '+Feed) (mapc show =C2=A0 =C2=A0(solve =C2=A0 =C2=A0 =C2=A0(quote @Str big =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select (@Feeds) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((title +Feed @Str)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(tolr @Str @Feeds title))) =C2=A0 =C2=A0 =c2...@feeds )) This query looks correct. You could also try to dump the index directly =C2=A0 (scan (tree 'title '+Feed)) Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: +Idx problems maybe?
Oops seems like the substring matching wasn't case insensitive... Do I have to take care of that explicitly or is there some sibling of tolr that will do case insensitive searches too? I took a look at the pilog file, I already get what same and range are doing but what are part, head and fold doing? /Henrik On Mon, Nov 2, 2009 at 9:39 PM, Henrik Sarvell hsarv...@gmail.com wrote: I did the rebuild but I'm still not getting any results when running the above query and I know for a fact that I should be getting at least two. Doing the scan gives me a long list, this is the end of it: (zerosum dirt(nap) - Home . {8o}) {8o} (zhou {BH}) {BH} (ziDesigns - Zaigham's Corner // Updates . {9i}) {9i} (zie {5S}) {5S} (zin {CL}) {CL} (zine {1N}) {1N} (zine {1v}) {1v} (zine {3Q}) {3Q} (zine {4z}) {4z} (zine {;m}) {;m} (zine {Ai}) {Ai} (zine {i}) {i} (zing {73}) {73} (ziuba {6X}) {6X} (zny {3m}) {3m} (zons {D}) {D} (zor {CB}) {CB} (zorberry's {:b}) {:b} (zorblades {4m}) {4m} (zweilAI.net {1j}) {1j} (zysz {4D}) {4D} (|architect's {b}) {b} (=C3=A4lp {DK}) {DK} (=C3=B4ng {8T}) {8T} (=C3=B6kmotorkonsult {CV}) {CV} (=C3=B6ren {6Y}) {6Y} (=C3=BCro {Av}) {Av} (=CE=BB Tony's Blog =CE=BB . {A6}) {A6} (=E3=80=8A=E8=B4=A2=E7=BB=8F=E7=BD=91=E3=80=8B-English . {:q}) {:q} (=E3=80=8B-English {:q}) {:q} (=E7=BB=8F=E7=BD=91=E3=80=8B-English {:q}) {:q} (=E7=BD=91=E3=80=8B-English {:q}) {:q} (=E8=B4=A2=E7=BB=8F=E7=BD=91=E3=80=8B-English {:q}) {:q} Does that output tell you anything? On Mon, Nov 2, 2009 at 12:25 PM, Henrik Sarvell hsarv...@gmail.com wrot= e: Thanks, I'll try it out. /Henrik On Mon, Nov 2, 2009 at 8:13 AM, Alexander Burger a...@software-lab.de w= rote: Hi Henrik, (rel title =C2=A0 =C2=A0 (+Idx +String)) # ... The +Idx wasn't there when the feeds in question were first created, I added it because I thought it would be necessary or speed things up. OK. (mapc '((F)(put! F 'title (; F title))) (collect 'fid '+Feed)) This has no effect, because 'put!' will not modify the object if the new value is the current value, and therefore will also not modify or create the index as a side effect. The easiest is to use 'rebuild' to (re)build an index: =C2=A0 (load lib/too.l) =C2=A0 (rebuild (collect 'fid '+Feed) 'title '+Feed) (mapc show =C2=A0 =C2=A0(solve =C2=A0 =C2=A0 =C2=A0(quote @Str big =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select (@Feeds) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((title +Feed @Str)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(tolr @Str @Feeds title))) =C2=A0 =C2=A0 =c2...@feeds )) This query looks correct. You could also try to dump the index directly =C2=A0 (scan (tree 'title '+Feed)) Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: +Idx problems maybe?
Hi Henrik, I took a look at the pilog file, I already get what same and range are doing but what are part, head and fold doing? You are on the right track. You used 'tolr', but this actually makes sense only in combination with the '+Sn' (Soundex) prefix. The whole matter is rather complicated, because there are so many combinations of index types and Pilog comparison functions possible. I would say that we have the following typical use cases for string searches (I'll leave out numerical searches, which usually combine with 'same' or 'range'). 1. Exact searches. You have either a unique index (rel key (+Key +String)) or a non-unique index (rel key (+Ref +String)) and you can compare results in Pilog with (same @Str @Cls key) for exact matches, or with (head @Str @Cls key) for dictionary searches (searching only for the beginning of strings). These are case-sensitive searches. 2. Folded searches. They make use of the 'fold' function which keeps only letters, converted to lower case, and digits. (rel key (+Fold +Ref +String)) ... (fold @Str @Cls key) This searches only for the beginning of strings. We use it typically for telephone numbers. If a search for individual words in a key is desired, we can use (rel key (+List +Fold +Ref +String)) ... (fold @Str @Cls key) This stores only the strings in the list (not the substrings) in 'fold'ed representation. So each word can be found by dictionary search. This requires changes to the GUI and import functions, though, as 'key' is not a string but a list of strings. Finally, we can also index folded substrings: (rel key (+Fold +Idx +String)) ... (part @Str @Cls key) This is perhaps what you need. If you go for it, I'd recommend you download once more the latest testing release, as the 'part' function was changed recently. 3. Tolerant searches. They return first all exact (case-sensitive) matches of partial strings, and then the matches according to the soundex algorithm (the first letter is compared exactly (case-sensitive), the rest checks for similarity). This makes mainly sense for personal names. (rel key (+Sn +Idx +String)) ... (tolr @Str @Cls key) Concerning space consumption, the '+Key' and '+Ref' indexes are the most economical ones. They create only a single entry in the index tree per key. Then follow the '+List +Ref +String' indexes, which create an entry per word. Most space-hungry are the '+Idx' indexes, as they create an entry for each substring down to a length of three, and '+Sn' adds one more for the soundex key. Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe