Search found 58 matches
- Sat Mar 12, 2011 4:47 pm
- Forum: newLISP in the real world
- Topic: Applying multiple lists?
- Replies: 4
- Views: 2916
Re: Applying multiple lists?
Although - after a coffee - I thought that (set 'L '(("one" "two") ("for" "you"))) (map append (L 0) (L 1)) ) was easier if you knew there were just two elements.. Bah, transpose is what I was looking for, thanks! Here is what I was looking to do: I had a list of lists of scores, and wanted to add ...
- Sat Mar 12, 2011 12:54 am
- Forum: newLISP in the real world
- Topic: Applying multiple lists?
- Replies: 4
- Views: 2916
Applying multiple lists?
Hi there, Having a brain-fart, I blame it on dropping my morning coffee by accident before finishing it. I have a list with multiple lists inside, and I'd like to map a function to each list as if I were passing them separately to map. Example: (map append '("one" "two") '("for" "you")) will render ...
- Thu Feb 03, 2011 5:41 pm
- Forum: newLISP in the real world
- Topic: A bug perhaps?
- Replies: 2
- Views: 1971
Re: A bug perhaps?
Sorry for the noise Lutz, the bug was due to the shared library. It had to do with AES encryption, and the subroutine was expecting a NULL terminated block-size string of 64 bytes.
- Mon Jan 31, 2011 11:52 pm
- Forum: newLISP in the real world
- Topic: A bug perhaps?
- Replies: 2
- Views: 1971
A bug perhaps?
Hi, I have a newLISP script that uses a shared library, and upon passing it a specific argument (JSON) with a specific length (63 characters), I am able to crash newLISP. Here is the string that crashes it: (set 'test "{\"ID\":\"somedumbuser@ahost.com\",\"DEBUG\":\"why does this crash63\"}") These, ...
- Sat Jan 01, 2011 8:42 pm
- Forum: newLISP and the O.S.
- Topic: Loading libraries on OSX
- Replies: 2
- Views: 3450
Re: Loading libraries on OSX
Ah, thanks Lutz, good catch. It indeed was a 32bit vs 64bit issue.
Hope you had a happy new years!
-Tony.
Hope you had a happy new years!
-Tony.
- Sat Jan 01, 2011 6:44 pm
- Forum: newLISP and the O.S.
- Topic: Loading libraries on OSX
- Replies: 2
- Views: 3450
Loading libraries on OSX
Running Snow Leopard, latest version of NewLISP. Trying to use the memcached.lsp file, but NewLISP is having trouble importing the library which was installed via macports: > (import "/opt/local/lib/libmemcached.5.dylib" "memcached_create") ERR: problem loading library in function import : "dlopen(/...
- Fri Dec 18, 2009 10:00 pm
- Forum: newLISP in the real world
- Topic: Question about spawn
- Replies: 1
- Views: 1492
Re: Question about spawn
Sorry for the noise everyone, it appears that the children were just exiting faster than expected. I used the primes example script and saw 4 newlisp processes running. At least now I know for sure it works. :)
- Fri Dec 18, 2009 9:12 pm
- Forum: newLISP in the real world
- Topic: Question about spawn
- Replies: 1
- Views: 1492
Question about spawn
Hi, in my application I have a dotimes call that for each iteration calls spawn which calls another function. The problem is that when running top I only see one lisp process when I know the loop should be spawning at least 4 separate processes. I am running top with full command line args and the a...
- Fri Dec 18, 2009 6:54 pm
- Forum: newLISP in the real world
- Topic: Using bayes functions in context?
- Replies: 2
- Views: 2122
Re: Using bayes functions in context?
Thanks, I tried defining MAIN:K just without the tick. That solution worked. :)
- Fri Dec 18, 2009 5:19 pm
- Forum: newLISP in the real world
- Topic: Using bayes functions in context?
- Replies: 2
- Views: 2122
Using bayes functions in context?
I am running into this issue -- when trying to use the bayes functions in context MAIN, it works as expected. When trying to use these in a defined function, I am getting an error with bayes-query. > (bayes-train '(A A B C C) '(A B B C C C) 'L) (5 6) > (bayes-query '(A C) L) (0.579614219 0.420385781...
- Thu Dec 17, 2009 5:56 pm
- Forum: newLISP newS
- Topic: libmemcached api
- Replies: 6
- Views: 7008
Re: libmemcached api
Hey Jeff: This seems to work for me: (define (get-key key , res (value-length 0) (flags 0)) (when MEMCACHED (setq res (memcached_get MEMCACHED key (length key) (address value-length) (address flags) (address MEMCACHED_RETURN))) ;(unless (zero? res) (get-string res)))) (if (zero? res) nil (get-string...
- Wed Dec 16, 2009 6:27 pm
- Forum: newLISP in the real world
- Topic: Embedded lists with match?
- Replies: 2
- Views: 1677
Embedded lists with match?
Is something like this possible:
Basically I need to go backwards in referencing the key with one of it's elements.
Thanks in advance!
Code: Select all
(set 'lst '("key ("this one" "that one" "other one")))
(match '(? ("that one")) lst)
Thanks in advance!
- Tue Dec 15, 2009 1:57 pm
- Forum: newLISP newS
- Topic: libmemcached api
- Replies: 6
- Views: 7008
Re: libmemcached api
Sure, I will dig into it and see what's going on. I just wanted to make sure it wasn't PEBKAC. :)
- Tue Dec 15, 2009 5:06 am
- Forum: newLISP newS
- Topic: libmemcached api
- Replies: 6
- Views: 7008
Re: libmemcached api
Hi Jeff. Thanks for the code... unfortunately I don't seem to be able to get it working correctly under 10.1.7. I load the .lsp file, do a memcached:init, memcached:add-server (I know the server is running and works)... and then when I do a memcached:get-key <some_key> that I know for sure doesn't e...
- Fri Dec 11, 2009 8:28 pm
- Forum: newLISP in the real world
- Topic: Accessing #define's with import?
- Replies: 1
- Views: 1460
Accessing #define's with import?
Hi, is there a way to import or use #define's from a library?
Thanks!
Thanks!
- Wed Dec 09, 2009 7:49 pm
- Forum: So, what can you actually DO with newLISP?
- Topic: New word stemmer, now with multiple language support!
- Replies: 1
- Views: 3563
New word stemmer, now with multiple language support!
Hi, a while back I made a newlisp word stemmer that used a stemming library: http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=2678&p=14985&hilit=stemmer#p14985 I had to re-visit this and decided to update the library with a different one. The library I'm using now is located here: http://sno...
- Sun May 24, 2009 10:23 pm
- Forum: newLISP newS
- Topic: SentenceBoundary.lsp?
- Replies: 15
- Views: 13003
- Sat May 23, 2009 8:19 pm
- Forum: newLISP newS
- Topic: SentenceBoundary.lsp?
- Replies: 15
- Views: 13003
Just a quick post on a bug I found.. On line 180, GetSentences will fail if on the last argument if the sentence passed in has any whitespace in it; ie: "The brown fox jumped high. " Adding a trim statement to any line before the parse will fix it. I'm sure it was written so that you pass the string...
- Mon May 18, 2009 12:29 am
- Forum: newLISP newS
- Topic: SentenceBoundary.lsp?
- Replies: 15
- Views: 13003
SentenceBoundary.lsp?
Doesn't appear to exist anymore:
http://www.newlisp.org/code/SentenceBoundary.lsp.txt
Anyone have a copy of this? Thanks in advance.
http://www.newlisp.org/code/SentenceBoundary.lsp.txt
Anyone have a copy of this? Thanks in advance.
- Thu Mar 12, 2009 4:14 pm
- Forum: newLISP in the real world
- Topic: Stemming in newLISP
- Replies: 0
- Views: 3156
Stemming in newLISP
Coded this real quick for a project I've been working on. ;; stemmer for newLISP, relies on the following code: ;; http://tartarus.org/~martin/PorterStemmer/c_thread_safe.txt ;; ;; download, rename to stemmer.c and compile with: ;; gcc -fPIC -c stemmer.c ;; gcc -shared -o libstemmer.so stemmer.o ;; ...
- Tue Jan 20, 2009 4:16 am
- Forum: newLISP newS
- Topic: Passing multiple lists to bayes-train?
- Replies: 14
- Views: 9914
Thanks for the clarification. What I am trying to do is essentially figure out a way to parse a document, and based on terms, figure out which paragraph is most relevant when passing in some tokens. I would like the paragraph that matches on the most number of tokens to be rated higher than a paragr...
- Tue Jan 20, 2009 2:27 am
- Forum: newLISP newS
- Topic: Passing multiple lists to bayes-train?
- Replies: 14
- Views: 9914
I'm not entirely sure on how the bayes stuff works, but if you had trained a document that you had parsed into paragraphs, and then passed those paragraphs as a parsed list of strings into bayes-train and passed in tokens like ("amd" "athlon" "processor") -- I am assuming those lists (parsed paragra...
- Sat Jan 17, 2009 5:39 pm
- Forum: newLISP newS
- Topic: Question on pointers and importing of shared libraries
- Replies: 2
- Views: 2968
Question on pointers and importing of shared libraries
What is the method of referencing/retrieving the data in a (char **) pointer? I have successfully used (get-string) when trying to reference a (char *), but no such luck with the other. I tried various calls to address with no luck. Is this even possible?
Thanks in advance!
Thanks in advance!
- Sat Jan 17, 2009 2:12 am
- Forum: newLISP newS
- Topic: Passing multiple lists to bayes-train?
- Replies: 14
- Views: 9914
- Thu Jan 15, 2009 11:48 pm
- Forum: newLISP newS
- Topic: Passing multiple lists to bayes-train?
- Replies: 14
- Views: 9914
You just became my new favorite person, this is absolutely what I needed.... THANK YOU THANK YOU THANK YOU! :)cormullion wrote:Perhaps this is cheating...
:)Code: Select all
(set 'paras '( ("a" "b" "c" "both") ("x" "y" "z" "both"))) (apply bayes-train (push 'K paras -1)) (bayes-query '("c" "a") K) ;-> (1 0)