Search found 294 matches

by eddier
Fri Mar 18, 2005 3:41 pm
Forum: newLISP in the real world
Topic: depth 'nth
Replies: 18
Views: 11244

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
by eddier
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...
by eddier
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...
by eddier
Thu Mar 17, 2005 5:18 pm
Forum: newLISP in the real world
Topic: depth 'nth
Replies: 18
Views: 11244

I'm going to give up on this for a while. With Ryan out of school and a bunch of other tasks at hand, I'll wait to another time.

Ed
by eddier
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...
by eddier
Mon Mar 14, 2005 2:20 pm
Forum: newLISP in the real world
Topic: depth 'nth
Replies: 18
Views: 11244

We will be waiting. I've noticed in the past that when someone solved a problem like the one you are facing, it provided a solution for many other types of problems as well.

Eddie
by eddier
Mon Mar 14, 2005 2:15 pm
Forum: newLISP in the real world
Topic: sorting
Replies: 22
Views: 12998

This is the way the various sorts in MzScheme's libraries work. I have actually had three occasions that I recall that a sort like this was needed. Thanks Lutz!

Eddie
by eddier
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...
by eddier
Fri Mar 11, 2005 11:10 pm
Forum: newLISP in the real world
Topic: depth 'nth
Replies: 18
Views: 11244

As a matter of taste I try never to use regular old iteration unless it SCREAMS at me. I like recursion in almost every circumstance. A recursive tree search is not very difficult actually even for n-arry trees. Do you want an inorder, preorder, or postorder and how many elements per node?

Eddie
by eddier
Fri Mar 11, 2005 3:39 pm
Forum: newLISP in the real world
Topic: sorting
Replies: 22
Views: 12998

No more CGI. I combined the two scripts and just generate the pages and ftp them to the site. If there had been many columns then I would have buffered the pages.

Eddie
by eddier
Fri Mar 11, 2005 2:03 pm
Forum: newLISP in the real world
Topic: depth 'nth
Replies: 18
Views: 11244

Then again maybe you are building a tree? If so, you can use a general purpose tree searching algorithm?

Eddie
by eddier
Fri Mar 11, 2005 2:00 pm
Forum: newLISP in the real world
Topic: depth 'nth
Replies: 18
Views: 11244

What about an associative list with a number representing the depth? Say

((a 0) (b 1) (c 2) ...)

Eddie
by eddier
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...
by eddier
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...
by eddier
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"...
by eddier
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
by eddier
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 :)

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))))))
Eddie
by eddier
Thu Mar 10, 2005 4:08 pm
Forum: newLISP in the real world
Topic: sorting
Replies: 22
Views: 12998

Thanks. I will see if this gives me the performance and flexibility I need.

Eddie
by eddier
Thu Mar 10, 2005 1:50 pm
Forum: newLISP in the real world
Topic: sorting
Replies: 22
Views: 12998

Oops! leave the (println X) out.

Eddie
by eddier
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...
by eddier
Wed Mar 09, 2005 10:29 pm
Forum: newLISP in the real world
Topic: sorting
Replies: 22
Views: 12998

After testing I have come to no conclusion. Which is faster (= (length X) 1) or (empty? (rest X))?

Sometimes the former is faster sometimes the latter is faster.

Eddie
by eddier
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) ...
by eddier
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 ...
by eddier
Mon Mar 07, 2005 1:46 pm
Forum: newLISP newS
Topic: NewLisp competition
Replies: 19
Views: 12291

newdep and pjot:

It will be great to see what you guys come up with. I was thinking about combining some existing things I have created for work and repackaging them. Is this ok or do I need to come up with something from scratch?

Eddie
by eddier
Fri Mar 04, 2005 5:17 pm
Forum: newLISP newS
Topic: NewLisp competition
Replies: 19
Views: 12291

I'll join but I doubt any project of mine will be flashy since I won't have but about two weeks in the summer to work on something and as you say, there are some smart programmers here using newLISP.

Eddie