Haven't thought about putting the index path into the trie, maybe as part of the data. Thanks for the sort. I find myself using the sort function quite often and being able to sort by a comparison function will simplify many other scripts.
Thanks!
Eddie
Search found 294 matches
- Fri Mar 18, 2005 3:41 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
- Fri Mar 18, 2005 2:21 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
Yep that is a trie. This is the same structure as the trie I have a search working for above except I have data attached to the entries. Therefore "a" becomes "(a data)." I've got the search working what is hard is the insertion. This would actually be quite easy if there was some way to get a point...
- Thu Mar 17, 2005 10:21 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
Yes, but what if we are looking into a trie that has the words "the", "there", "these", "to." Notice the structure of the trie with out any data attached. You would have to have data to actually see that "the" was an entry into the trie. http://www.bmc.edu/~eddier/trie.png I'm not sure how I can use...
- Thu Mar 17, 2005 5:18 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
- Mon Mar 14, 2005 10:42 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
Maybe your looking for a "trie" instead of a "tree." Which brings up the following topic. I created an example trie as: (setq trie '((("h" nil) (("a" nil) (("s" "has")) (("v" nil) (("e" "have"))))) (("t" 0) (("o" "to"))))) where the trie contains the words "has," "have," and "to." The second part of...
- Mon Mar 14, 2005 2:20 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
- Mon Mar 14, 2005 2:15 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
- Fri Mar 11, 2005 11:13 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
I have no clue. None from this side. But, I think creating the pages on a client machine and dumping them on the server means less security risks and then I'm guaranteed that it will be fast enough. I'm just going to copy the script to the other client and add a header file for each type of director...
- Fri Mar 11, 2005 11:10 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
- Fri Mar 11, 2005 3:39 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
- Fri Mar 11, 2005 2:03 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
- Fri Mar 11, 2005 2:00 pm
- Forum: newLISP in the real world
- Topic: depth 'nth
- Replies: 18
- Views: 11244
- Fri Mar 11, 2005 1:55 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
Thanks Norman and Lutz. The Alumnae requested that the columns be able to sort. And of course they also wanted the index. And many wanted to be able to print the table. Good about being intuitive to use. I was going to use a scrolling table but then I have to add an extra part to the script to be ab...
- Thu Mar 10, 2005 10:58 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
The way data is collected is through the (load mechanism). The client programs create a list of lists from the a database and then ftp the file to the server. I'm now thinking of changing their scripts to just dump 4 html pages onto the server instead of going through CGI. That way the response will...
- Thu Mar 10, 2005 10:24 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
Thanks Norman :) Connected directly to the network, Im getting > (time (get-url "http://www.bmc.edu/cgi-bin/alum.cgi")) 409 > (time (get-url "http://www.bmc.edu/cgi-bin/alum.cgi")) 403 > (time (get-url "http://www.bmc.edu/cgi-bin/alum.cgi")) 428 > (time (get-url "http://www.bmc.edu/cgi-bin/alum.cgi"...
- Thu Mar 10, 2005 9:34 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
Lutz, The CGI works pretty fast connected straight to our server. I would like to know how fast it responds offsite. I'm not sure if this is intuitive to use so please feel free to suggest improvements.
[/url]http://www.bmc.edu/cgi-bin/alum.cgi[/url]
Eddie
[/url]http://www.bmc.edu/cgi-bin/alum.cgi[/url]
Eddie
- Thu Mar 10, 2005 4:28 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
Your solution works great! Yep this small and fast enough :)
Eddie
Code: Select all
(define (sort-by L col)
(let (k -1)
(select L
(map last (sort
(map (fn (x) (list (upper-case (nth col x)) (inc 'k)))
L))))))
- Thu Mar 10, 2005 4:08 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
- Thu Mar 10, 2005 1:50 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
- Thu Mar 10, 2005 1:47 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
Thanks Lutz! Everytime I've tried to time the two I get such different results that I couldn't figure out which was faster. The previous sort had a problem with the contents passed to the compare function. The following fixes the problem and adds the faster compare. (define (merge-sort X f) (println...
- Wed Mar 09, 2005 10:29 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
- Wed Mar 09, 2005 10:16 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
Thanks, then I have the following solution. I know merge sort uses a bit of memory but it works for now. (define (merge-sort X f) (let (h (/ (length X) 2)) (if (= (length X) 1) X (merge (merge-sort (slice X 0 h) f) (merge-sort (slice X h) f)))) (define (merge X Y f) (cond ((empty? X) Y) ((empty? Y) ...
- Wed Mar 09, 2005 9:16 pm
- Forum: newLISP in the real world
- Topic: sorting
- Replies: 22
- Views: 12998
sorting
Lutz, In a particular CGI program I am writing the following problem has come up. I will have to write a sort based on a comparison function. For example, I need to ignore case of letters and I need to sort by a different element of lists of lists as in (sort (("12" "Bb") ("32" "ab")) f) where f is ...
- Mon Mar 07, 2005 1:46 pm
- Forum: newLISP newS
- Topic: NewLisp competition
- Replies: 19
- Views: 12291
- Fri Mar 04, 2005 5:17 pm
- Forum: newLISP newS
- Topic: NewLisp competition
- Replies: 19
- Views: 12291