Search found 28 matches
- Tue Jul 07, 2020 6:37 am
- Forum: newLISP in the real world
- Topic: XFS undelete
- Replies: 0
- Views: 4120
XFS undelete
Hi, we had to recover tens of GB on a deleted XFS file system and this is what we came up with. May be it is useful to one or the other when recovering deleted files on a XFS partition. Pls wade through the source with all the comments. It is not intended as a XFS howto. Links to the interna of XFS ...
- Thu Jan 11, 2018 12:52 pm
- Forum: newLISP in the real world
- Topic: (share) with (pack) memory
- Replies: 3
- Views: 4091
Re: (share) with (pack) memory
hm, i meant reading the (shared memory) from a C-lib. i.e. Parent <-> (share mem) <-> Forked child (calling the C-lib) Parent: (set 'flashMemory (share)) (share flashMemory (rand 0xFFFF 100)) Forked Child: (emulavr_load_flash (pack (dup "u" 100) flashMemory)) C-lib prints rubbish numbers: ubyte * em...
- Sun Jan 07, 2018 9:44 am
- Forum: newLISP in the real world
- Topic: (share) with (pack) memory
- Replies: 3
- Views: 4091
(share) with (pack) memory
it seems not possible to use (share) with packed elements. i.e. (set 'flash (share)) (share flash (pack (dup "u" 10) (sequence 1 10))) According to the docs (share) should work with any newlisp expression. When forking processes and calling C-libs from these processes it would be nice to be able to ...
- Thu Jul 06, 2017 6:45 am
- Forum: Anything else we might add?
- Topic: Error in gsl.lsp ?
- Replies: 3
- Views: 4753
Re: Error in gsl.lsp ?
Thks for pointing to this one. It is indeed the locale setting. This works. (set-locale "en_US.utf8") (load "/usr/local/share/newlisp/modules/gsl.lsp") (trace (open "trace.txt" "write")) (gsl:CholeskyD '((4 2 -2) (2 10 2) (-2 2 5))) > ((2 0 0) (1 3 0) (-1 1 1.732050807568877)) Setting (set-locale "d...
- Wed Jul 05, 2017 11:43 am
- Forum: Anything else we might add?
- Topic: Error in gsl.lsp ?
- Replies: 3
- Views: 4753
Error in gsl.lsp ?
The example for (gsl:CholeskyD) throws an error, newlisp v.10.7.1, libgsl.so.19 on XUBUNTU, gsl Ver 2.1: All other examples are working. (gsl:CholeskyD '((4 2 -2) (2 10 2) (-2 2 5)))) ERR: mismatch in number of arguments called from user function gsl:(CholeskyD '((4 2 -2) (2 10 2) (-2 2 5))) Debug o...
- Thu Jun 29, 2017 7:36 pm
- Forum: newLISP in the real world
- Topic: multiple-value-bind
- Replies: 3
- Views: 3519
Re: multiple-value-bind
Answering myself .. ;; @syntax (m-v-b symlist valuelist body) ;; ;; @param symlist valuelist body ;; symlist: List of var names ;; valuelist: List of values or function call which returns list of values ;; body: Operation with var names ;; @return Expanded 'let with body ;; @example ;; (m-v-b '(a b ...
- Thu Jun 29, 2017 7:22 pm
- Forum: newLISP in the real world
- Topic: multiple-value-bind
- Replies: 3
- Views: 3519
Re: multiple-value-bind
Good idea. Looks not too bad: (macro (mvb) nil) (constant 'mvb (lambda-macro () (list 'let (flat (transpose (list (args 0) (args 1)))) (args 2)))) (define (ttt) (mvb (a b c) (1 2 3) (println "Killroy: " (+ a b c)))) (ttt) ==> > Killroy: 6 6 '(mvb (a b c) (1 2 3) (println "Killroy: " (+ a b c))) ==> ...
- Thu Jun 29, 2017 5:53 am
- Forum: newLISP in the real world
- Topic: multiple-value-bind
- Replies: 3
- Views: 3519
multiple-value-bind
Hello, i'am trying to emulate "multiple-value-bind" via read time macro. That is translate: (mvb '(a b c .... ) '(1 2 3 ....) ...))) into (let (a 1 b 2 c 3 ....) ..... )))) The idea i had is expansion during read time : (macro (mvb) nil) (constant 'mvb (lambda-macro (ALIST BLIST) (letex (flat (trans...
- Tue Jun 27, 2017 7:19 pm
- Forum: newLISP in the real world
- Topic: Infix.lsp as macro
- Replies: 4
- Views: 3986
Re: Infix.lsp as macro
Exactly what is needed. Thx. A minor setback is that infix.lsp does not handle "-" with one argument. Math code is much clearer now. Proof of expansion during read time attached. (load "infix.lsp") (macro (mix) nil) (constant 'mix (lambda-macro () (INFIX:xlate (join (map string (args)) " ")))) (defi...
- Tue Jun 27, 2017 2:09 pm
- Forum: newLISP in the real world
- Topic: Infix.lsp as macro
- Replies: 4
- Views: 3986
Re: Infix.lsp as macro
thanks a ton. I must admit that i would never ever thought of a redefiniton.
Can you explain why the macro becomes "executable" due to the redefiniton ?
Can you explain why the macro becomes "executable" due to the redefiniton ?
- Tue Jun 27, 2017 7:01 am
- Forum: newLISP in the real world
- Topic: Infix.lsp as macro
- Replies: 4
- Views: 3986
Infix.lsp as macro
Hi, is it possible to transform the infix.lsp to a "true" macro i.e. doing the work at compile time ? Or do i miss a critical point there ? Calling "eval" during runtime is supposed to be expensive (at least in other lisps). Not sure how newlisp handles eval. Reason for asking is that i redo some of...
- Wed May 04, 2016 7:01 pm
- Forum: So, what can you actually DO with newLISP?
- Topic: Quaternion strikes back
- Replies: 4
- Views: 9540
Re: Quaternion strikes back
@Lutz, the naming is just fine by me. For those in need for speed i've ported the code to C and put it on github so you can access it via FFI. https://github.com/hds1/dual-quaternion-c The functionality is quite the same as for the newlisp module. Time needed for 1000000 Dual Quaternion ScLERPs: 2.4...
- Fri Apr 29, 2016 11:01 am
- Forum: So, what can you actually DO with newLISP?
- Topic: Quaternion strikes back
- Replies: 4
- Views: 9540
Re: Quaternion strikes back
i would consider the package now a stable first release. For the Dual Quaternion module the NLERP, DLB, DLBblending, ScLERP, get/setScrewParams et al. have been added. There are some dependencies between these modules. For the DQ you will need the dualNum,vector and quaternion module as well. If you...
- Mon Apr 25, 2016 11:24 am
- Forum: So, what can you actually DO with newLISP?
- Topic: Quaternion strikes back
- Replies: 4
- Views: 9540
Quaternion strikes back
Thanks Ted for the hint.
Done it. You can find the files here:
https://github.com/hds1
Regards
Heiko
Done it. You can find the files here:
https://github.com/hds1
Regards
Heiko
- Mon Apr 25, 2016 8:21 am
- Forum: Anything else we might add?
- Topic: min-max limiter
- Replies: 2
- Views: 8858
Re: min-max limiter
sweet.
Thanks a lot for pointing this one out.
Thanks a lot for pointing this one out.
- Mon Apr 25, 2016 7:13 am
- Forum: Anything else we might add?
- Topic: min-max limiter
- Replies: 2
- Views: 8858
min-max limiter
Hello, i couldn't find a function in newlisp to limit a value between upper and lower limits. i.e. something like this: "return x < some_minimum ? some_minimum : x > some_maximum ? : some_maximum : x;" Reason is that i'am working a lot with sin, cos and the brothers and i often need to limit my floa...
- Wed Apr 06, 2016 7:02 pm
- Forum: So, what can you actually DO with newLISP?
- Topic: Quaternion Calculus
- Replies: 5
- Views: 6971
Re: Quaternion Calculus
see github
- Mon Apr 04, 2016 7:36 pm
- Forum: So, what can you actually DO with newLISP?
- Topic: Quaternion Calculus
- Replies: 5
- Views: 6971
- Tue Mar 22, 2016 10:08 am
- Forum: newLISP in the real world
- Topic: exec function not returning string list
- Replies: 2
- Views: 4864
Re: exec function not returning string list
If you want to avoid the interim file creation you could use the environment as a placeholder i.e. (env "willi" "<html><head></head><body>Killroy</body></html>") (exec "echo $willi" | tidy -q 2>/dev/null) => ("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2//EN\">" "<html>" "<head>" "<meta name=\"gener...
- Mon Feb 16, 2015 8:39 am
- Forum: newLISP in the real world
- Topic: newlisp --quite
- Replies: 3
- Views: 3102
Re: newlisp --quite
thanks for the hint with (silent). But you need to wrap your whole proggi into it. (silent (long prog to follow)) Hm, it doesn't feel right to me. Consider other scripting languages: echo 'print "laura\n";' | perl echo 'print "laura\n";' | ruby echo 'print "laura\n";' | python (adds an extra \n beca...
- Sun Feb 15, 2015 8:29 pm
- Forum: newLISP in the real world
- Topic: newlisp --quite
- Replies: 3
- Views: 3102
newlisp --quite
Hello, is it possible to turn off the standard return output of newlisp ? i.e: echo "(print 'willi')" | newlisp willinil nil Here the "nil" value. So my feature request would be something like: echo "(println 'willi')" | newlisp -q --> willi Kubuntu 14.04, kernel 3.13.0-45-generic, newLISP v.10.6.2 ...
- Wed Feb 11, 2015 7:18 pm
- Forum: newLISP in the real world
- Topic: NL crash on Matrix op
- Replies: 3
- Views: 2915
Re: NL crash on Matrix op
great. thanks.
Regards
Heiko
Regards
Heiko
- Wed Feb 11, 2015 2:01 pm
- Forum: newLISP in the real world
- Topic: NL crash on Matrix op
- Replies: 3
- Views: 2915
NL crash on Matrix op
Hi, just stumbled upon crashes of newlisp 10.6.2 on not possible Matrix ops. >(set 'A '((1 2 3) (4 5 6))) >(det A 1e-10) --> Speicherzugriffsfehler (Speicherabzug geschrieben) (Memory acces error) and NL crashes. Happens with or without pivot and also on (mat ...) ops. > (set 'B '((-1 1 1) (1 4 -5) ...
- Sun Mar 30, 2014 6:09 pm
- Forum: newLISP in the real world
- Topic: cgi; stream output from exe to stdout
- Replies: 16
- Views: 6497
Re: cgi; stream output from exe to stdout
@Lutz,
thanks for the reply, but still the output is saved first in avariable and then send out to whom ever it shall go.
Can't it be done without interime saving ?
Consider Pictures, video streams or such. You don't want to save them, you want to pass the stream "through".
Thanks
hds1
thanks for the reply, but still the output is saved first in avariable and then send out to whom ever it shall go.
Can't it be done without interime saving ?
Consider Pictures, video streams or such. You don't want to save them, you want to pass the stream "through".
Thanks
hds1
- Sat Mar 29, 2014 8:10 am
- Forum: newLISP in the real world
- Topic: cgi; stream output from exe to stdout
- Replies: 16
- Views: 6497
cgi; stream output from exe to stdout
Hello all, in a cgi script i'am trying to pipe the output from an exec prog via a stream to the browser. i.e. the output from "mapserver" et al. ; could be MByte large pictures. In Perl i can use print and backquotes like: <snip> $ENV{"QUERY_STRING"}=blah blah print `/path/to/mapserv`; # -> output g...