Search found 66 matches

by Fritz
Mon Apr 11, 2011 4:09 pm
Forum: newLISP and the O.S.
Topic: Problems installing on Vista
Replies: 10
Views: 4534

Re: Problems installing on Vista

I got similar problems on Window 7: my settings directory contained russian letters and was therefore unvisible for newlisp-edit. There was an error: ERR: problem saving in function save: "C:\\Users\\\241\232\233\232\\Appdata\\Roaming/newlisp/newlisp-edit.config" So I have added these strings into n...
by Fritz
Wed Jul 21, 2010 11:53 am
Forum: newLISP and the O.S.
Topic: NewLISP and CentOS
Replies: 3
Views: 1243

Re: NewLISP and CentOS

Thank you, installed successfully. If anybody else will try to repeat:

wget http://www.newlisp.org/downloads/newlisp-10.2.8.tgz
tar -xf newlisp-10.2.8.tgz
cd newlisp-10.2.8
sudo ./configure-alt
sudo make
sudo make install
by Fritz
Tue Jul 20, 2010 5:57 pm
Forum: newLISP and the O.S.
Topic: NewLISP and CentOS
Replies: 3
Views: 1243

NewLISP and CentOS

I got a virtual server with CentOS installed: now I need to run my newLISP projects on it.

Is it possible to install newLISP somehow via yum or any other automatic manager?

Or I should download sources and compile newLISP manually?
by Fritz
Wed Jul 07, 2010 1:34 pm
Forum: newLISP in the real world
Topic: How to reduce a list?
Replies: 2
Views: 473

Re: How to reduce a list?

Thank you! This method is much faster: 0,4 seconds vs 3 seconds with "filter" method.

So now I can load one hundred price-lists per second, so my task is accomplished.
by Fritz
Sat Jul 03, 2010 2:52 pm
Forum: newLISP in the real world
Topic: How to reduce a list?
Replies: 2
Views: 473

How to reduce a list?

I have a list like this: '((1 Oil 2) (1 Oil 5) (1 Oil 7) (2 Gas 4) (2 Gas 12)) I want to reduce it and get list like this: '((1 Oil 2 5 7) (2 Gas 4 12)) I can make it via "ref" or "find" or "filter" operators, but list is pretty big (3'000 records), so speed is important for me. It takes about 3-4 s...
by Fritz
Tue Jun 29, 2010 1:52 pm
Forum: newLISP in the real world
Topic: $0, $it, "symbol is protected" and find-all
Replies: 2
Views: 437

$0, $it, "symbol is protected" and find-all

I`m used to join "find-all" and "replace" operators via $it/$0 symbol: (find-all "12" "12345" (replace "1" (copy $0) "N")) But now, after upgrading to 10.2.8, newLISP says: "ERR: symbol is protected : $0" Is here a way to make this construction to work, or I`ll have to change my code somehow to avoi...
by Fritz
Fri May 28, 2010 9:42 am
Forum: newLISP and the O.S.
Topic: (+ newLISP Windows RS232)
Replies: 7
Views: 2141

Re: (+ newLISP Windows RS232)

do you have same success in writing to serial port? Yep. Here is a part of working code (Windows PC): ; Initialization (define (scales-init) (exec "mode COM1 BAUD=9600 PARITY=N DATA=8 STOP=1")) ; Getting data from COM-port (define (scales-weight-up) (local (hndl buff) (set 'hndl (open "COM1" "r")) ...
by Fritz
Sat Apr 17, 2010 9:02 am
Forum: newLISP in the real world
Topic: Web Crawler
Replies: 4
Views: 730

Re: Web Crawler

Has anyone written a web crawler in newLISP? I have written later in 2009 some kind of crawler to gather information from one big goverment site. Pretty simple thing, just several hundreds lines of code, "cgi.lsp" + regular expressions + lots of cookie romp. If you are going to make crawler without...
by Fritz
Fri Apr 09, 2010 12:26 pm
Forum: newLISP in the real world
Topic: find-all and empty strings
Replies: 8
Views: 757

Re: find-all and empty strings

As far as I can see, we will not be able to locate two different strings (empty and non-empty) at the same offset.

Code: Select all

(find-all "((?<=FILE:)[0-9]*)|(sample.gif)" "FILE:sample.gif")
But, probably, there will be no such situations in real life.
by Fritz
Fri Apr 09, 2010 9:56 am
Forum: newLISP in the real world
Topic: find-all and empty strings
Replies: 8
Views: 757

Re: find-all and empty strings

Unfortunately this strategy will swallow legitimate empty strings Yep, I have made an error: I did not took into account difference between starting search position and actual offset of the found item: (set 'offset 0 'lst '()) (while (set 'offset (find {(^|(?<=,))("(([^"]|"")*)"|([^",]*))} {Ten Tho...
by Fritz
Fri Apr 09, 2010 8:46 am
Forum: newLISP in the real world
Topic: find-all and empty strings
Replies: 8
Views: 757

Re: find-all and empty strings

I guess additional check for zero-length will help: (set 'offset 0 'lst '()) (while (set 'pos (find {(^|(?<=,))("(([^"]|"")*)"|([^",]*))} {Ten Thousand,10000, 2710 ,,"10,000","It's ""10 Grand"", baby",10K} 0 offset )) (if (and lst (= (last lst) $0 "")) (inc offset) (begin (set 'offset (+ offset (len...
by Fritz
Thu Apr 08, 2010 8:16 pm
Forum: newLISP in the real world
Topic: find-all and empty strings
Replies: 8
Views: 757

Re: find-all and empty strings

Here is an example from Friddle`s book: (find-all {(^|(?<=,))("(([^"]|"")*)"|([^",]*))} {Ten Thousand,10000, 2710 ,,"10,000","It's ""10 Grand"", baby",10K}) It will be very hard to make parse operator to process quotes correctly. And I can not just ignore empty fields, becouse their place is importa...
by Fritz
Thu Apr 08, 2010 5:53 pm
Forum: newLISP in the real world
Topic: find-all and empty strings
Replies: 8
Views: 757

find-all and empty strings

For some reason find-all operator stops on empty strings: > (find-all "(?<=,)[^,]*(?=,)" ",1,10,,100,1000,") ("1" "10" "") I did expect here: ("1" "10" "" "100" "1000") I think, somewhere inside find-all operator is a check: (if (= found-string prev-string) stop-search) Is it a feature to make progr...
by Fritz
Sun Mar 28, 2010 6:37 am
Forum: newLISP and the O.S.
Topic: (directory) in Windows and UTF8
Replies: 6
Views: 2282

Re: (directory) in Windows and UTF8

Cyril wrote:(import "iconv.dll" "libiconv")
GIMP iconv.dll made this for me! Thanx!
by Fritz
Sat Mar 27, 2010 6:44 pm
Forum: newLISP and the O.S.
Topic: (directory) in Windows and UTF8
Replies: 6
Views: 2282

(directory) in Windows and UTF8

I have suddenly noticed, that newLISP directory operator returns his data in UTF8 codepage, while native Windows XP codepage (in Russia) is windows-1251 (and newlisp-edit.lsp module has windows-1251 encoding too). That is not an important problem, becouse I always can use construction like (map deco...
by Fritz
Tue Mar 23, 2010 9:46 pm
Forum: Whither newLISP?
Topic: Prime numbers
Replies: 0
Views: 1531

Prime numbers

Found today a story about a boy, who was said by a teacher to print all prime numbers from 2 to 100. He had 2 hours to make a program on Basic. Boy had a working code in ten minutes: 10 CLS 20 PRINT "2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97" 30 E...
by Fritz
Tue Mar 23, 2010 3:19 pm
Forum: newLISP in the real world
Topic: Inversion of eval-string function
Replies: 2
Views: 478

Re: Inversion of eval-string function

How about... source Thanx, "source" looks promising for me. Only problem: source + sym dislike lists for some reason: > (set 'test '(("a" '(1 2 3 4 5)) ("b" 52) ("c" "something"))) (("a" '(1 2 3 4 5)) ("b" 52) ("c" "something")) > (source (sym (test 1 1))) "(set (sym \"52\" MAIN:MAIN) nil)\n\n" > (...
by Fritz
Tue Mar 23, 2010 1:57 pm
Forum: newLISP in the real world
Topic: Inversion of eval-string function
Replies: 2
Views: 478

Inversion of eval-string function

I have a variable, which contains some text with special symbols: > {some symbols \/""} "some symbols \\/\"\"" I want to save contents of this variable to the text file, with all that backslashes before quotes et cetera. Now I use function (define (gnirts-lave x) (1 -1 (string (list x)))) But, may b...
by Fritz
Mon Mar 22, 2010 7:11 am
Forum: newLISP in the real world
Topic: (time) function: big and small intervals
Replies: 3
Views: 514

Re: (time) function: big and small intervals

Aha, I see now. I will span now intervals from 50ms and longer in Windows. 68 years should be enough for me too :)
by Fritz
Sun Mar 21, 2010 10:13 pm
Forum: newLISP in the real world
Topic: (time) function: big and small intervals
Replies: 3
Views: 514

(time) function: big and small intervals

I have tested today some scripts operating with some millions files, and I have noticed two strange things about (time) function. 1. Big intervals. > (time (sleep 3600000)) 1,844674407e+016 1,8e+016ms = 595 000 years, hehe. 2. Small intervals. > (time (read-file "100_13.txt") 70) 0 > (time (read-fil...
by Fritz
Tue Mar 09, 2010 4:27 am
Forum: newLISP and the O.S.
Topic: (+ newLISP Windows RS232)
Replies: 7
Views: 2141

Re: (+ newLISP Windows RS232)

itistoday wrote:Couldn't you use the "import" function to import the necessary C functions from some windows DLL?
Well, I’ll try. I’m not too familiar with C, but it is a good reason to learn it closer.
by Fritz
Mon Mar 08, 2010 5:59 pm
Forum: newLISP Graphics & Sound
Topic: Gui-Server: "sunked" letters
Replies: 3
Views: 5299

Re: Gui-Server: "sunked" letters

I have found a solution. In "newlisp-edit" script there is a function "(openFindDialog)", which sets size of the "Find" window.

After changing width to 500 I can see all my letters:

Code: Select all

(gs:dialog 'FindDialog 'TheEditor "Find text" 500 200 nil nil)
by Fritz
Sun Mar 07, 2010 7:00 pm
Forum: newLISP and the O.S.
Topic: get-url with redirection?
Replies: 4
Views: 1515

Re: get-url with redirection?

You can also look into the text "get-url" returns to you. I believe, inside you will find a correct address of the file. First get-url: (get-url "http://lenta.ru/info") Result: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>302 Found</title>\n</head><body>\n<h1>Found</h1...
by Fritz
Sun Mar 07, 2010 6:51 pm
Forum: newLISP and the O.S.
Topic: newLISP-GS IDE has 'ERR: no working directory found' (VISTA)
Replies: 4
Views: 1466

Re: newLISP-GS IDE has 'ERR: no working directory found' (VISTA)

Thank you very much! I just realized, that I can open newlisp-edit.lsp and add there regexp search, parameters save, higher search fields and other functions I miss so!