Search found 24 matches

by Sleeper
Wed Jun 27, 2007 8:11 am
Forum: newLISP newS
Topic: development GUI-server v 0.94
Replies: 7
Views: 4743

in newlisp-edit.lsp:

Code: Select all

(constant 'TEMP_DIR (if (= ostype Win32) "C:\\temp" "/tmp"))
Win32 must be in quotes.
i already mentioned this in previous topic
by Sleeper
Tue Jun 26, 2007 1:22 pm
Forum: newLISP newS
Topic: development GUI-server v. 0.93
Replies: 8
Views: 5628

thanks Lutz!
i found this place in the beginning of newlisp-edit.lsp, i think there also must be

Code: Select all

(if (= ostype "Win32") "C:\\temp" "/tmp")
("Win32" instead of Win32)
i fixed that, created "c:\\temp" directory and now it works.
by Sleeper
Tue Jun 26, 2007 9:03 am
Forum: newLISP newS
Topic: development GUI-server v. 0.93
Replies: 8
Views: 5628

the same problem with newlisp-edit.lsp

message-dialog: cannot be applied to MAIN:TheEditor

all other demos runs fine, including new 2D-graphics stuff
(this looks great. congrats Lutz!)
by Sleeper
Sun Jun 24, 2007 8:42 pm
Forum: newLISP newS
Topic: development GUI-server v. 0.92
Replies: 12
Views: 8171

i have updated all this files to the latest version before posting here
just checked this again
i have newlisp 9.1.1 installed. maybe this is the reason
by Sleeper
Sun Jun 24, 2007 6:53 pm
Forum: newLISP newS
Topic: development GUI-server v. 0.92
Replies: 12
Views: 8171

Hi, Lutz!
maybe i missed something but newlisp-edit.lsp doesn't work on my system.
it shows an error:

message-dialog:
cannot be applied to MAIN:TheEditor

and then it exits
all other demos works fine
by Sleeper
Sun Jun 24, 2007 6:18 pm
Forum: Anything else we might add?
Topic: reading exact number of bytes from the socket
Replies: 0
Views: 2226

reading exact number of bytes from the socket

hi
i am trying to work with sockets for the first time.
i need a function that reads exactly n bytes from the socket (and blocks until they are available)
how can i do this?
by Sleeper
Wed May 23, 2007 9:57 pm
Forum: newLISP and the O.S.
Topic: deleteing a folder and everything contained in it
Replies: 9
Views: 9317

you're right, i put x after comma just in case :)

good idea with currying, it may be useful
i used for different tasks similar recursive walk function (much like in python os.walk) but without curry.
by Sleeper
Tue May 22, 2007 7:17 pm
Forum: newLISP and the O.S.
Topic: deleteing a folder and everything contained in it
Replies: 9
Views: 9317

i totally agree ;D
by Sleeper
Tue May 22, 2007 5:44 pm
Forum: newLISP and the O.S.
Topic: deleteing a folder and everything contained in it
Replies: 9
Views: 9317

I put "x" and "full" in define statement to make them local to this function.

http://newlisp.org/CodePatterns.html#locals

Also in this case they don't pollute global namespace. In recursive functions non-local variables may cause big problems, as they are shared between all running functions.
by Sleeper
Mon May 21, 2007 6:04 pm
Forum: Anything else we might add?
Topic: initializing lists
Replies: 2
Views: 2563

Code: Select all

(set 'b1 (list cmin cmin cmin))
by Sleeper
Mon May 21, 2007 6:13 am
Forum: newLISP and the O.S.
Topic: deleteing a folder and everything contained in it
Replies: 9
Views: 9317

this recursive version is better i forgot about it :) (define (remove-all root, x full) (dolist (x (directory root)) (set 'full (append root "/" x)) (if (directory? full) (if (and (!= x "..") (!= x ".")) (begin (remove-all full) (remove-dir full))) (delete-file full)))) example: (remove-all "c:\\tem...
by Sleeper
Sun May 20, 2007 9:14 pm
Forum: newLISP and the O.S.
Topic: deleteing a folder and everything contained in it
Replies: 9
Views: 9317

Hi, SHX! try this function: (define (remove-all dir) (set 'fnames (list dir)) (set 'dirs '()) (while (not (empty? fnames)) (set 'fname (pop fnames)) (if (directory? fname) (begin (dolist (x (directory fname)) (if (and (!= x ".") (!= x "..")) (push (append fname "/" x) fnames))) (if (!= fname dir) (p...
by Sleeper
Thu Feb 01, 2007 11:19 am
Forum: newLISP Graphics & Sound
Topic: change byte order in string data
Replies: 0
Views: 3904

change byte order in string data

Recently i wrote a few opengl demos in newlisp just for fun, in which i used simple TGA texture loading function. The problem is that in tga image data colors go in BGR or BGRA order and i use GL_BGR_EXT and GL_BGRA_EXT extensions. What i want is to change color order to standard RGB and RGBA in a f...
by Sleeper
Tue Dec 26, 2006 11:00 am
Forum: newLISP and the O.S.
Topic: seek on big files
Replies: 10
Views: 9729

Thanx Lutz!
Now all works fine.
by Sleeper
Sun Dec 24, 2006 11:05 pm
Forum: newLISP and the O.S.
Topic: seek on big files
Replies: 10
Views: 9729

perhaps something is wrong with my system..
newlisp 9.0 - same results.
i have Intel Core 2 Duo and NTFS-formatted disk
by Sleeper
Sun Dec 24, 2006 10:37 pm
Forum: newLISP and the O.S.
Topic: seek on big files
Replies: 10
Views: 9729

I get the same errors with newlisp 9.0.9 and 9.0.11 on WinXP:

Code: Select all

...
2140000 record -> Ok 02140000
2150000 record -> Error reading 02140001
...
4290000 record -> Error reading 02140215
4300000 record -> Error reading ########
...
4990000 record -> Error reading ########
by Sleeper
Sun Dec 24, 2006 8:33 pm
Forum: newLISP and the O.S.
Topic: seek on big files
Replies: 10
Views: 9729

seek on big files

Sorry for maybe stupid question.. Why do i get nil when use "seek" builtin function on big binary files? (up to 6 GB) > (set 'f (open "storage.tmp" "r")) 3 > (seek f) 0 > (seek f -1) nil > (seek f 5893610690) 1598643394 I'm sure that position 5893610690 exists in that file. Sometimes i get negative ...
by Sleeper
Fri Dec 15, 2006 8:20 pm
Forum: newLISP and the O.S.
Topic: net-ping error
Replies: 3
Views: 4533

right. thanks Sammo!
i didn't notice it
by Sleeper
Fri Dec 15, 2006 7:31 pm
Forum: newLISP and the O.S.
Topic: net-ping error
Replies: 3
Views: 4533

net-ping error

Hi all!
I get an error with net-ping.

Code: Select all

newLISP v.9.0.9 on Win32, execute 'newlisp -h' for more info.

> (net-ping "www.google.com")

invalid function : (net-ping "www.google.com")
what's wrong with it?
by Sleeper
Wed Dec 13, 2006 8:31 pm
Forum: Anything else we might add?
Topic: figures for all
Replies: 5
Views: 4119

great, i like it! ; circle.lsp -- ; prints itself in a circle (set 'cc (find-all "[^\t\n\r]" (read-file (main-args 1)))) (set 'w (int (sqrt (div (length cc) 1.7 0.25)))) (set 'h (int (div w 1.5))) (set 'g (dup (dup " " w true) h true)) (set 'r (div w 2.2)) (for (i 1 h) (for (j 1 w) (if (> (length cc...
by Sleeper
Sun Dec 10, 2006 11:26 pm
Forum: newLISP in the real world
Topic: Can I use newlisp without console window?
Replies: 7
Views: 6887

Code: Select all

(import "kernel32.dll" "FreeConsole")
(FreeConsole)
this code works for me... it hides console window when you want.
just add this as first two lines of your script
by Sleeper
Sun Dec 10, 2006 10:15 pm
Forum: newLISP in the real world
Topic: Decode me! (Part #2 - Winter Session)
Replies: 25
Views: 19394

newdep wrote: PS: I created this vigenere (which is indeed upper-case as cormullion mentioned) to encrypt base64 listings.. ;-) Just so it stays readable..
that's a good idea!
by Sleeper
Sun Dec 10, 2006 5:58 pm
Forum: newLISP in the real world
Topic: Decode me! (Part #2 - Winter Session)
Replies: 25
Views: 19394

to solve this i found some new-lisp function names like "map" "char" "sequence" and calculated difference between char-codes.

then i found out that these differences repeat every six characters..


encoded version works fine, but looks like decodes itself with code "annorm" instead of "norman" :)
by Sleeper
Sun Dec 10, 2006 1:40 pm
Forum: newLISP in the real world
Topic: Decode me! (Part #2 - Winter Session)
Replies: 25
Views: 19394

;; create the Vigenere list (setq alpha (rotate (map char (sequence 97 122)))) (dotimes (x 26) (push (rotate alpha -1) vlist -1)) ;; return the corresponding letters from x and y coding indexes (define (return-encode x y) (vlist (find x (first vlist)) (find y (first vlist)))) ;; return the correspo...