Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - didi

#1
I am wondering how to  communicate via the serial port  under Windows7.   Has someone a tipp ?
#2
I am testing and learning all about the  Greenarrays  GA144 chip ,  a multicore processor with 144 very simple 32 bit processors, optimized for FORTH, Chuck Moores design - really minimalistic.  



I first have made a disassembler, about one page of code, which is  quite good : http://www.forthseen.de">//http://www.ForthSeen.de, see the section NewLisp.  ( The experts are usually able to shrink my code another 30%  .. ) .



Now I'm trying to write a Simulator for the GA144. For one processor it works quite good, now I'm thinking how to make  144 of them in parallel, and what might be the best  data structures in newLISP.  



This is the structure of one  processor:
; g8.lsp 19.October.2014 19:00

; test settings
( set 'DS '( 1 2 3 4 5 6 7 8 ))   ; data stack
( set 'RS '( 11 12 13 14 15 16 17 18 )) ; return stack
( set 'S 9 'T 10 'R 19 'P 0 'A 0 'B 0 'ALU 0 'EXT 0 'CY 0  )  ; registers
( set 'RAM ( array 64 '( 0 ) ))  ; RAM 64 words  each 18 bits
( set 'ROM ( array 64 '( 0 ) ))  ; ROM 64 words dto.
( set 'IO  '( (0x15D "io" 0x15555 )  ; IO-section
  (0x141 "data" 0 ) (0x145 "---u" 0 ) (0x175 "--l-" 0 ) (0x165 "--lu" 0 )
  (0x115 "-d--" 0 ) (0x105 "-d-u" 0 ) (0x135 "-dl-" 0 ) (0x125 "-dlu" 0 )
  (0x1D5 "r---" 0 ) (0x1C5 "r--u" 0 ) (0x1F5 "r-l-" 0 ) (0x1E5 "r-lu" 0 )
  (0x195 "rd--" 0 ) (0x185 "rd-u" 0 ) (0x1B5 "rdl-" 0 ) (0x1A5 "rdlu" 0 ) ))

The GA144  and FORTH are  working mainly on a data-stack, a lot of pushing and poping which is easy in newLISP. But what about 144 such parts

 - different context's ?

 - a big Array ?

 - big lists of list ..
#3
newLISP in the real world / Searching in lists
January 08, 2013, 10:16:07 PM
I want to import data directly from Wordpress to my ZZBlogX.  I can export data as XML-Files.  I've parsed it with xml-parse and filtered out unnecessary things.  Now I have the problem to seek through the file  for eg.   to  look for "title" and then get the next element which is the title to make a title-list.  


( do-while (find "title" outlist)
  ( set 'i  ( find "title" outlist ))
  ( set 'outlist ( i outlist))
  ( push (pop outlist) title-list )
)


That doesn't work .  Would it be better to work with  slice  eg.  get the index of the element and make an new list with slice ?
#4
I wrote another  newLISP programm -  " ZZBlogX – A Static Blog Generator"



ZZBlogX generates dozens of blog like html-pages in a second. I wrote this program as an easier and more flexible replacement for my Wordpress blogs. In contrast to eg. Wordpress the pages are 'static' that means you do not need a database on your webspace and the pages are loading faster.



The only thing what you have to do, is to store your articles as simple text files. In the next article "Quick Start" you'll find all you need for a first try.



ZZBlogX is an easy to use, very small and fast "textbased static blog generator" , currently only for Windows, written in the funtastic "newLISP" programming language and it's Opensource.



ZZBlogX ...



    reads the "settings.lsp" file

    reads your text files for example "01.txt" "02.txt" and so on.

    takes the first line as headline

    takes the last line as categories separated by commas

    takes the text between first and last line as the article

    takes the file-date as the post date (alternatives possible)

    generates a temporary database

    sorts all articles by time

    generates a main-page "index.html"

    if necessary "index1.html" "index2.html" ..

    generates a side-page for each category with at least 2 articles

    inserts possible links to previous and next pages

    inserts possible links to all category start pages



More about it  here :        http://www.zzblogx.com">//http://www.ZZBlogX.com



PS:  This ZZBlogX-Website is generated by ZZBlogX



PPS:  Happy New Year to all !
#5
newLISP in the real world / List indexing
January 09, 2012, 11:06:04 AM
; implicit indexing from "Code Patterns"



(set 'L '(a b (c d (e f) g) h i))



(L 2 2 1) β†’ f

(L 2 2)   β†’ (e f)



Is there a reverse function to get the vector of an  element in a nested list ?

Is it right, that the  find function principally does this,  but only in the highest level ?



For example

(find 'a L ) -> 0

(find 'b L ) -> 1

(find 'c L ) -> nil ?
#6
newLISP Graphics & Sound / oh-no-graphic
May 25, 2009, 09:19:29 AM
PART1 :

my old rgb-mixer enhanced with one line for ppm-graphic-format : ; rgb_mixer_ppm.lsp  25may2009 dmemos
 
( set 'cmax 255 )
( set 'cmin 0 )
( set 'cdelta ( / ( sub cmax cmin) 10 )) ; "/" only for int else "div"
( set 'drgb ( dup cdelta 3 ))
( set 'white ( dup cmax 3 ))
( set 'black ( dup cmin 3 ))
( set 'red ( list cmax cmin cmin ))
( set 'green ( list cmin cmax cmin ))
( set 'blue ( list cmin cmin cmax ))

( define ( limit rgbx)
  ( if ( > rgbx cmax) cmax
   ( if ( < rgbx cmin) cmin rgbx )))

( define ( rgb-add rgb1 rgb2 )
( map limit ( map add rgb1 rgb2)))

( define ( rgb-sub rgb1 rgb2 )
( map limit ( map sub rgb1 rgb2)))

( define ( rgb-complement rgb1 )
( rgb-sub white rgb1 ))

( set 'yellow ( rgb-add red green ))
( set 'cyan ( rgb-add green blue ))
( set 'magenta ( rgb-add red blue ))

( define ( rgb-lighter rgb1 i )
( if ( = nil i ) (set 'i 1 ))
( rgb-add rgb1 ( map mul drgb ( list i i i ))))

( define ( rgb-darker rgb1 i )
( if ( = nil i ) (set 'i 1 ))
( rgb-sub rgb1 ( map * drgb ( list i i i ))))

( set 'darkgrey ( rgb-lighter black 3 ))
( set 'lightgrey ( rgb-darker white ))

; translate rgb list to a string for ppm-format eg. ( 75 75 75 )  ->  "KKK"
( define ( ppm mrgb )  ( join ( map char mrgb )))
#7
newLISP Graphics & Sound / postscript - module
May 17, 2009, 10:35:53 AM
The links to the samples in the table are not working :



http://www.newlisp.org/index.cgi?Postscript">http://www.newlisp.org/index.cgi?Postscript
#8
newLISP as localhost and cgi-functions :



With Firefox and Ie8 everything works good , you can send a html-page back via  the ( putpage ... ) command or you can generate a html-page  with  ( print ... ) commands .

Googles Chrome recognizes the direct-print-commands but not the putpage-version.

Apples Safari under Windows XP opens the cgi-file only as a text-file, so that you can only read the source-text .



As a workaround i tried the  "loacation: " command - the simplest version :

( load "cgi.lsp" )
( println "location: http://www.newlisp.org/" )
( println )


But this version doesn't work at all .  I'm clueless .

Damned to learn and use JavaScript ? - or is there another way ...
#9
newLISP newS / textformat in files
March 21, 2009, 07:05:55 AM
After storing text in files i have sometimes the special chars eg.  "252" as backslash and decimal-sequence in the text-file where i need eg. directly the german Umlaut 'ΓΌ'  - how can i control that ?  or is it system depending ,  i use windows xp.
#10
newLISP and the O.S. / ShortNotizer
February 28, 2009, 09:32:05 AM
Hello World! -  the ShortNotizer V1.1 is here. It works with all Windows-Version and all browser  ( i know )  - you can download it from :



http://www.shortnotizer.com">www.ShortNotizer.com



features :

- for short notes via your browser

- cardbox - system

- fast

- newLISP as localhost

- pure newLISP and CGI

- Cormullions newLISP database nldb is used

- pure simple, but it's working fine

- small, less than 0.3MB



a lot of other features are planed ...



PS: don't be too scared about my programming style ..
#11
newLISP newS / Beginners Corner - list functions
February 04, 2009, 09:28:28 AM
I can't find the solution to this simple question, maybe you can help me.



This is my target :

( "myfolder" "me" 55  (  ( "abc" "def" ) ( "ghi"  "jkl" )))



This is my start point :

(set 'SN:folder '("myFolder" "me" 55 '( ( "abc" "def" )   )))



( set 'note '( "ghi"  "jkl" ))



With  'setf'  i can change an existing element :

( setf ( folder 3 0 ) note ))



But how can i push a new 'note'  to the place  ( folder 3 1 )    ?
#12
The exact code sample of the cgi.lsp file can't be shown here, but it starts with :

<% (set 'site "example.com") %>

...

I put this code in a sample html-file and called the file via newLISP as a localhost but nothing happens , only the normal page is shown. The ide-app works via the same localhost .



The idea is to make a simple application without frames and javascript, but i can't derive this out of the ide- or wiki-example. Must i first start the cgi.lsp in the html-file and how ? -  any other ideas ?
#13
This is my first try to generate a vocabulary :
; mparse_words_asc_lower_case.lsp  dmemos 11.jan.2009
( silent    ; no console-echo
 ( println ( date ) )
 ( change-dir "C:\Documents and Settings\didi\My Documents\newLISP" )
 ( set 'src_txt ( read-file  "wrnpc12.txt" ))  ;  war_and_peace
 ( set 'word_char [text]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_[/text])
 ( set 'sep_char [text] nrt!"#$%'()*+,-./:;<=>?@[]~"&/\[/text])
 ( set 'lineout "" )
 ( set 'out_lst '() )

 ( replace "rn" src_txt " " ) ; replace all CR-LF with " "
 ( set 'src_txt ( lower-case src_txt ))

 ( while ( < 0 (length src_txt) )
   ( set 'x ( pop src_txt ))
   ( if ( find x word_char )
       ( push x lineout -1)            ; word_char found
       ( if ( find x sep_char )        ; else no word_char
         ( if ( < 0 (length lineout))                                  
           ( begin
            ( push lineout out_lst -1)
            ( set 'lineout "")))))
 )

 ( set 'word_list (sort (unique out_lst)))
 ( write-file "word_list_wrnpc12.txt" (string word_list) )
)
( println ( date ))
( println  "bye " )


For me this is really short and fast enough, but i'm sure that the expert-newLISPer can do it better.

I tried some extreme big texts , 600kB of text needs 7min . The book "war and peace" is over 3MB in ascii-text , is it faster to divide it in parts and then join the lists ?
#14
The pop3-function works fine , i can download the files from my email-account. The files are in mime 1.0 format, i can read them with outlook-express after renaming the extension to .eml .



But what if i want to work with the email-text in newLISP ?

The from:  to: cc: subject: and date: fields are easy to get .

But what with the email-content , in an example a charset="iso-8859-1" is

given ?

I can imagine different ways :

- to start an external mime-decoder out of newLISP , is there any ?

- to use a dll , any idea where i can get one and can give someone a practical example ?

- to make an own decoder in newLISP but i'm not sure eg. how many charset i should use ?
#15
Is it possible to use newLisp as localhost in windows  and a webbrowser eg. explorer  AND store data via the browser and newLisp into a file ?



I like  to program a logbook-function with the webbrowser as a user-interface. The data which is typed in  a textfield should be appended as clear-text to a textfile - and displayed back to the html-page.



I'm no expert, maybe it's possible with this  200k-small newLisp.
#16
( replace "X" (eval button-cmd-string) xname )



This is what worked, but i guess there is a better way to eg. create a non-destructive replace .  





; <><><><><><><><><><><><><><><><><><><>



PS: long time no see - while having only little time for hacking , i'm trying to simplify the gui-programming for me . This works already :



( mgs:gui-intro )

( mgs:make-frame "my-app" 5 5 90 45 )  ; the size in % of screen can be left

( mgs:tool-bar )

( mgs:add-button  "Run" "Stop" )

( mgs:gui-start )



... probably the rest will take some weeks more ;-)  .. but i'll stay tuned to newLISP fanclub
#17
Just finished my computer-abstinent vacation, where i walked by pure chance into  an absolute thrilling symposium . I could only take a short glimpse into one presentation , but the homepage is nice and the proceedings are  free available :



http://fir.epfl.ch/home.html">http://fir.epfl.ch/home.html



http://fir.epfl.ch/docs/FIR_proceedings_online.pdf">http://fir.epfl.ch/docs/FIR_proceedings_online.pdf



This seems to be at the edge of science-fiction .



Hope it fits in this 'Whatever Else' thread and it bothers nobody - newLISP for  AI-Applications ... there are so many things we can do with it.
#18
Anything else we might add? / Podcasts
August 01, 2007, 11:56:17 AM
I don't know if anyone is interested in listening podcast - this is my current  "best-of-playlist"  :



1. MeshForum - ITC.MeshForum2006-ManuelLima-2006.05.07 (46:52)

2. Technometria with Phil Windley - ITC.TM-DavidPlatt-2007.01.02 (78:02)

3. IT Conversations - Steve Wozniak Part 1 (47:38)

4. Paul Graham - Hackers and Painters (27:05)

5. IT Conversations - Steve Wozniak Part 2 (54:46)

6. Chris DiBona with Leo Laporte - FLOSS Weekly 12: PHP's Rasmus Lerdorf (55:05)

7. Chaos Computer Club - CRE028 Extreme Programming (102:13)

8. O'Reilly Media Open Source Conference - OSC.OSCON-KathySierra-2006.07.25 (44:04)

9. Paul Graham - Great Hackers (30:49)

10. Dr. Moira Gunn - ITC.TN-ChipHeath-2007.01.09 (40:55)

11. Guido van Rossum - ITC.SDF-GuidoVanRossum.1-2005.02.17 (52:45)

12. Chris DiBona with Leo Laporte - FLOSS Weekly 11: Guido van Rossum (65:50)

13. Phil Windley - ITC.TM-Matz-2006.10.18 (39:21)

14. Paul Graham - ITC.OSCON05-PaulGraham-2005.08.02 (32:45)

15. team@se-radio.net - Episode 62: Odersky on Scala (53:57)  *)



*) From 'Software Engineering Radio' .  Scala is an interface to java , strongly-typed , it seems not bad, but not as nice as newLISP and gui-server ;-)



This are my recommendations for  'sleepless nights'  . I'd be glad if anyone has a tip for similar podcasts .
#19
newLISP Graphics & Sound / Button-handler and drawing
August 01, 2007, 11:13:36 AM
Can we draw after the  gs:set-visible command ?


( gs:draw-line 'L1 0 200 200 0 gs:green )
 
 (gs:set-visible 'Mdialog true )
 
 ( gs:draw-line 'L1 50 200 200 200 gs:blue )

 ( define ( ButtonRun-handler )
    ( println  "Button Run" )
    ( gs:draw-line 'L1 0 0 200 200 gs:red )
   ;( gs:set-background 'Mcanvas gs:green )
 )


This is only an example to show the effect .  I can see the green line and even the blue line which is drawn after  the set-visible command .

But i can not see the red line after pressing the run button .



If i minimize the Mdialog-window and then maximize it again i see the red line - or if i set the background after drawing to eg. green ( but not white what is already the background) .
#20
newLISP Graphics & Sound / mouse event
July 29, 2007, 06:13:13 AM
(define (mouse-pressed-action id type x y button cnt mods)
     (println "id:" id " type:" type " x:" x " y:" y " button:" button " count:" cnt " mods:" mods))


results in :>  id:189 type:146 x:1 y:16 button:() count:nil mods:nil



id:189 is not correct  it is the x-value

type:146  this is the y-value



it seems that the order is somewhere messed .