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 - joejoe

#21
> (int 00)
0

> (int 01)
1

> (int 02)
2

> (int 03)
3

> (int 04)
4

> (int 05)
5

> (int 06)
6

> (int 07)
7

> (int 08)
0

> (int 09)
0

> (int 10)
10

> (int 11)
11




ok. nL is playing tricks on me! ;0)



Manual says:


QuoteIf exp evaluates to a string, the string must start with a digit; one or more spaces; or the + or - sign.


(set 'my-nums '("00" "08" "40"))

(int (nth 1 my-nums))

;-> 0


I managed to get float to come to my rescue:



(int (float (nth 1 my-nums)))

;-> 8


What's up w/ int and the 08 and 09 numbers?



Thank you.
#22
Hi, the Geany [0] editor comes with a LISP filetype definition file [1].



I would like to modify this to make it newLISP friendly. I would like any additional suggestion over what I am here asking if is the logical approach to modifying this LISP definition file to make a newLISP definition file.



From what I can see, I know I should change the keywords= line by removing the existing keywords and put in the newLISP expression and function words, like:


keywords=+ / div mul and or define find-all ...

to include all the words listed on the left hand side of the newLISP manual (frame) [2].



My questions are these:



+ What might be the difference between keywords= and special_keywords= ?

+ Based on these [3] config options, is there anything else I would need to change in the file?



Thanks!



[0] http://geany.org/">http://geany.org/

[1] https://bazaar.launchpad.net/~haaaad/geany/master/view/head:/data/filetypes.lisp">https://bazaar.launchpad.net/~haaaad/ge ... types.lisp">https://bazaar.launchpad.net/~haaaad/geany/master/view/head:/data/filetypes.lisp

[2] http://www.newlisp.org/downloads/manual_frame.html">http://www.newlisp.org/downloads/manual_frame.html

[3] http://www.geany.org/manual/current/index.html#filetype-configuration">http://www.geany.org/manual/current/ind ... figuration">http://www.geany.org/manual/current/index.html#filetype-configuration
#23
Hi -



This is my working code to grab titles from my page:


(set 'titles (find-all {<h2>.*</h2>} page $0))

Sometimes they are not <h2> tags that I have to look into to find my titles.



Sometimes they are <a href=...> tags that are inside of <h2> tags. Tough! :0)



I have definied two symbols, enclosure-tag-open and enclosure-tag-close.



Now I am trying to use these symbols in my find-all. I have tried all of these:


(set 'titles (find-all {enclosure-tag-open[.*]enclosure-tag-close} page $0))

(set 'titles (find-all {(eval enclosure-tag-open).*(eval enclosure-tag-close)} page $0))

(set 'titles (find-all {(println enclosure-tag-open)[.*](println enclosure-tag-close)} page $0))


I have even tried to make my own find-all string and then somehow run it:


(println "find-all {"(println enclosure-tag-open)".*"(println enclosure-tag-close)"} page $0")

Is there an easy way to have symbols replace the <h2> and </h2> below:


(set 'titles (find-all {<h2>.*</h2>} page $0))

Thanks very much!
#24
Hi,



I seem to be missing a basic understanding of what a list is.



I am following cormullion's "Building a list" example here:



http://en.wikibooks.org/wiki/Introduction_to_newLISP/print#Building_lists">http://en.wikibooks.org/wiki/Introducti ... ding_lists">http://en.wikibooks.org/wiki/Introduction_to_newLISP/print#Building_lists



where he says:


(set 'vowels '("a" "e" "i" "o" "u"))
;-> ("a" "e" "i" "o" "u") ; an unevaluated list


so I am trying to find-all 4+ character strings in my list:


#/usr/local/bin/newlisp

(set 'vowels '("a" "ee" "iii" "oooo" "uuuuu"))

(println (find-all {w{4,}} vowels))

(exit)


But when I run the code, it says:


ERR: list expected in function find-all : "\w{4,}"

Am I correct to see this as a list:


("a" "ee" "iii" "oooo" "uuuuu") ?



I tried w/ the regex 0 option, too:

(println (find-all {w{4,}} vowels 0))


but I still get the same error.



This is probably my most common error I get trying to run code, so I know its important! :0)



Thank you for shedding light on this hurdle.
#25
I have almost gotten this on my own, but am stumped.



I am after a list of the words occurring two or more times in 'title-words, that are "good", sorted by frequency (high to low).



Here I try:


#/usr/local/bin/newlisp

; my list of words:

(set 'title-words '("one" "two" "two" "three" "three" "three" "four" "four" "four" "four" "five" "five" "five" "five" "five" "six" "six"))


; words to remove from my list:

(set 'bad-title-words '("two" "four"))


; the "good" words i want:

(set 'good (difference title-words bad-title-words))


; an index count of the good words frequencies:

(set 'title-words-index (count good title-words))


; good word frequencies that occur more than once in my list

(set 'big-title-words-index (ref-all '1 title-words-index < true))


(println title-words) ; initial list of words
:-> ("one" "two" "two" "three" "three" "three" "four" "four" "four" "four" "five" "five" "five" "five" "five" "six" "six")

(println bad-title-words) ; words to remove
;-> ("two" "four")

(println good) ; words i want to keep
;-> ("one" "three" "five" "six")

(println title-words-index) ; a count of good word frequency
;-> (1 3 5 2)

(println big-title-words-index) ; somehow related to the words i want to get and sort by frequency
;-> (3 5 2)

(exit)


Now i dont know how to get the words back again. I think I got lost and even went down a wrong road.



I would appreciate any directions back to my path! :0)
#26
newLISP in the real world / cleaning strings
May 13, 2012, 09:37:41 PM
Hi -



I would like to know how to do one thing, please.



I would like to know how to remove string elements which are less than 4 characters long from my string. (By characters, i mean letters, numbers, !/#/$//,/'/;/:/etc).



For example:



If my string is this:


("a bb ccc dddd eeeee ffffff")

I would like to know which function is best to make this list only a list of strings four or more characters long.


("dddd eeeee ffffff")



I tried replace-ing


(replace "[.]" title "" 0)

and


(replace "[+]" title "" 0)

but that did not seem to clean out one character strings.



I tried various maneuvers w/ define and length but wound up lost and without solution.



Am I simply missing the "magic" regex that means "characters less than 4 characters long"?



And is replace the correct function to "remove" these things?



Thank you for any guidance!
#27
newLISP in the real world / regex help
April 19, 2012, 09:27:36 PM
Ive tried for last three hours to get this one. :0)



I *am* able to get a regex to work with this:


find-all {<title>([^.]+)</title>}

on the xml code below, but I tried this (and about 60 other iterations):


find-all {<item>([^.]+)</item>}

to get the entire value of the text between the <item> and </item> tags.



Is there not a simple way to say, look for the <item> tag and then get everything until you see the </item> tag?



Any suggestion would really be appreciated. Thanks very much! :0)


<item><title>Very Cute Solar Powered Plant Decoration Flower Random Color </title><description><![CDATA[<table border='0' cellpadding='8'> <tr><td> <a href= 'http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=2&toolid=10039&campid=5337070286&item=120898233743&vectorid=229466&lgeo=1' target='_blank'><img src='http://thumbs4.ebaystatic.com/pict/1208982337434040_1.jpg' border='0'/></a></td><td><strong>$1.99</strong><br>End Date: Friday May-18-2012 18:43:55 PDT<br>Buy It Now for only: $1.99<br><a href='http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=2&toolid=10039&campid=5337070286&item=120898233743&vectorid=229466&lgeo=1' target='_blank'>Buy It Now</a> | <a href='http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&toolid=10039&campid=5337070286&vectorid=229466&lgeo=1&mpre=http%3A%2F%2Fcgi1.ebay.com%2Fws%2FeBayISAPI.dll%3FMfcISAPICommand%3DMakeTrack%26item%3D120898233743%26ssPageName%3DRSS%3AB%3ASRCH%3AUS%3A104' target='_blank'>Add to watch list</a></td></tr> </table>]]></description><pubDate>18 Apr 2012 18:53:18 GMT-07:00</pubDate><guid>120898233743</guid><link>http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=2&toolid=10039&campid=5337070286&item=120898233743&vectorid=229466&lgeo=1</link><e:BidCount></e:BidCount><e:CurrentPrice>1.99</e:CurrentPrice><e:ListingType>FixedPrice</e:ListingType><e:BuyItNowPrice></e:BuyItNowPrice><e:ListingEndTime>2012-05-19T01:43:55.000Z</e:ListingEndTime><e:ListOrder>120898233743</e:ListOrder><e:PaymentMethod>PayPal</e:PaymentMethod></item>
#28
Hi - I am using Cormullion's beautiful Intro to nL example:



http://en.wikibooks.org/wiki/Introduction_to_newLISP/The_Internet#Accessing_web_pages">http://en.wikibooks.org/wiki/Introducti ... _web_pages">http://en.wikibooks.org/wiki/Introduction_to_newLISP/The_Internet#Accessing_web_pages



He shows:


(set 'the-source (get-url "http://www.apple.com"))
(replace {src="(httpS*?jpg)"} the-source (push $1 images-list -1) 0)
(println images-list)


and so I am trying to modify it to pull different info from a different web page:


(set 'the-source (get-url "http://nukene.ws/headlines"))
(replace {<h2>S*?</h2>} the-source (push $1 images-list -1) 0)
(println images-list)


(Essentially I am after the headline article titles between the <h2>...</h2>



I am getting


nil

as an answer, and Im suspecting I have an incorrect regex.



Ive tried various versions of the above using the  in front of various character without success.



Would one be so kind as to point me my shortcoming? Much appreciated and thank you a lot! :0)
#29
Hi -



If there were a separate forum for requesting paid coding service, I would use it for this post.



I would like to receive bids on a newLISP script described here:



Essentially, the script would load a web page periodically in firefox, begin a video caputure of the web page (without any toolbars or borders, just the web page inner frame itself), scroll down the page while continuing the video capture, when hitting the bottom, return to top, and stop the video recording.



Then the script would add in an audio track that fades out at the end of the video, compress the new video w/ this audio down to 15-20MB (or smaller if quality is still there), name it Sitename-YYYY-MM-DD and upload it to a YouTube account with the follow config variables:



Local configs:

Sitename

URL of web page to scroll capture

Audio Folder Path

 - (random song selection for video chosen at runtime)

 - (I will have multiple songs to choose from in Audio Folder)

I may be forgetting some necessary configs you might add.



YouTube configs:

YoutTube credentials

Video Title

Video Description

Video Tags

Video License Select,

etc., options available on the YouTube video upload page.



This script would be run once a day on a Linode account I have( ssh available).



Below are a couple commands I now use to do this manually, if they might help.


recordmydesktop --windowid 0x1cd9b18 --no-cursor --no-sound --no-frame --v_quality 30 -y 130 -x 5 --width 975 --height 650
* Please note, I have not gotten proper video dimensions yet, so you would adjust to make proper YT video.



(I use the Scrollyfox firefox extension manually)

(I use Pitivi editor to combine the video w/ audio and fade out the audio and video end.)


mencoder tmpfile.avi -ovc lavc -oac mp3lame -o Sitename-YYYY-MM-DD.avi
* This command I just found on the web and it works well, but if you can do better, please do.



Thanks! And I look forward to meeting a nL coder for future work as well! :0)
#30
Hi,



I have a small project and would be needing a neLISP programmer.



I would like to know what your hourly rate would be. Thank you very much!
#31
Hi -



I am working on my local machine (Linux Mint < Ubuntu < Debian) and trying to get a simple web page to load.



I ran this newLISP command to get the server running:



newlisp -http -d 8080 -w /home/joe/newlisping/web



And inside of the web directory I have a file called go.lsp which is this:


#!/usr/bin/newlisp
#
# First newLISP from-scratch web site :D


(print "Content-Type: text/htmlrnrn")
(println "<h3>My 1st newLISP Web Site! :D</h3>n")

(exit)


When I take Firefox to /home/joe/newlisping/web/go.lsp I see the file contents, not a web page.



I even tried to chmod 755 the file but still only see the file contents.



Any quick pointer would be great! Thanks!!



newLISP v.10.2.8 on Linux IPv4 UTF-8
#32
newLISP in the real world / newLISP + Cherokee Web Server
February 20, 2011, 12:53:19 PM
Hi, is it possible to have nL serve pages through Cherokee Web Server?



http://www.cherokee-project.com/">http://www.cherokee-project.com/



If so, how do you allow them to work together?



Is it just creating nL .cgi files and calling them from the browser from the proper location?



Thanks much!
#33
newLISP in the real world / newLISP Tutors?
January 31, 2011, 01:59:56 PM
Hi -



Just curious to know if there are any nL tutors out there, and if so, where are you located and how much would you cost per hour? In person tutoring.



I have a couple projects I am working on and they would go much faster if I could pay someone to guide me along for a couple hours+ a week.



Thanks and can easily travel all over the US.
#34
newLISP in the real world / dolist or not dolist
November 16, 2010, 08:07:29 AM
Hi -



I still know next to nothing nL but I have patched together this with help:


(set 'result (unique (sort
    (find-all {[a-zA-Z]+}
        (replace "<[^>]+.*+>" (get-url "http://mysite.com/") "" 0) )
)))
(println result)
(exit)


I am trying to now pull from multiple of my sites, so I want to get-url mysite.com and mysite0.com and mysite1.com as well.



I thought this should be done with dolist. I still want to unique and sort the compilation of urls that I retreive.



So I tried this:


(set 'result (unique (sort (dolist 123
    (find-all {[a-zA-Z]+}
        (replace "<[^>]+.*+>" (get-url "http://mysite.com") "" 0) )
    (find-all {[a-zA-Z]+}
        (replace "<[^>]+.*+>" (get-url "http://site.com/") "" 0) )
    (find-all {[a-zA-Z]+}
        (replace "<[^>]+.*+>" (get-url "http://newsite.com/") "" 0) )
))))

(println result)

(exit)


But it is saying list is expected in dolist.



But how would I make dolist not unique and sort until the end of compiling the 'result list?



Thanks!
#35
I am trying this bit of code from the manual here:



http://www.newlisp.org/downloads/newlisp_manual.html#find-all">http://www.newlisp.org/downloads/newlis ... l#find-all">http://www.newlisp.org/downloads/newlisp_manual.html#find-all


(unique (sort
    (find-all {[a-zA-Z]+}
        (replace "<[^>]+>" (get-url "http://newlisp.org") "" 0) )
))


which is said to produce:


Quote→ ("A" "ACC" "AI" "API" "About" "All" "Amazing" "Apps"

...

"where" "whole" "width" "wiki" "will" "with" "work" "written")


but when I run this I get no result at all.



Did something change since this was written or can anyone else say they receive the expected result above?



Thanks! I want to do something very similar and I appreciate the simplicity of being able to do such a thing. :0)
#36
I cant figure out what I should be doing differently to be able to parse a file that apparently has a looong string token that nL doesnt like.



I have this code:


(set 'words (parse (read-file "myfile")))
(exit)


and it I get the error:


ERR: string token too long : "></div>rntttttntttt</div>nttt</div> ntt "

Its an html source file i am trying to pull pieces from into lists.



Thank you for direction!
#37
Hi -



I am trying to install newLISP on a dreamhost.com account.



I downloaded nL 10.1.7 and was able to successfullly run the ./configure-alt with these results:


Detected Operating System LINUX
Detected memory model ILP32, using memory model ILP32
UTF-8 is enabled
readline support is disabled

To enable readline support, use the --enable-readline option, and specify the
proper libraries to link by setting the RLFLAGS variable when running
configure.  Also if necessary, use the INCLUDES variable to specify where the
readline header files are."


Type "make" to build your newlisp binary.

If that doesn't work, type "make help"


I then run make w/ these seemingly successful results:


make -f makefile_configure
make[1]: Entering directory `/home/..myhomedirectory../bin/newlisp-10.1.7'
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG newlisp.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-symbol.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-math.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-list.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-liststr.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-string.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-filesys.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-sock.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-import.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-xml.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-web.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-matrix.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-debug.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG pcre.c
gcc -m32 -Wall -pedantic -Wno-long-long -Wno-strict-aliasing -O2 -c  -DNEWCONFIG nl-utf8.c
gcc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o     nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o pcre.o nl-utf8.o -m32 -lm -ldl  -o newlisp
strip newlisp
make[1]: Leaving directory `/home/..myhomedirectory../bin/newlisp-10.1.7'


and then I run make install which results w/ this:


{... abbreviated errors ...]

install: cannot create regular file `/usr/share/newlisp/guiserver/stroke-demo.lsp': No such file or directory
make: [install] Error 1 (ignored)
install -m 644 guiserver/tabs-demo.lsp /usr/share/newlisp/guiserver/tabs-demo.lsp
install: cannot create regular file `/usr/share/newlisp/guiserver/tabs-demo.lsp': No such file or directory
make: [install] Error 1 (ignored)
install -m 644 guiserver/textrot-demo.lsp /usr/share/newlisp/guiserver/textrot-demo.lsp
install: cannot create regular file `/usr/share/newlisp/guiserver/textrot-demo.lsp': No such file or directory
make: [install] Error 1 (ignored)
install -m 644 guiserver/widgets-demo.lsp /usr/share/newlisp/guiserver/widgets-demo.lsp
install: cannot create regular file `/usr/share/newlisp/guiserver/widgets-demo.lsp': No such file or directory
make: [install] Error 1 (ignored)
install -m 644 guiserver/word-count.lsp /usr/share/newlisp/guiserver/word-count.lsp
install: cannot create regular file `/usr/share/newlisp/guiserver/word-count.lsp': No such file or directory
make: [install] Error 1 (ignored)
install -m 644 guiserver/uppercase.lsp /usr/share/newlisp/guiserver/uppercase.lsp
install: cannot create regular file `/usr/share/newlisp/guiserver/uppercase.lsp': No such file or directory
make: [install] Error 1 (ignored)


From the INSTALL.txt, I am guessing that this direction is relevant:


When using the READLINE option on some OSs, the library options
-lreadline and -lncurses or -ltermcap have to be replaced. 'readline'
support enables command line editing and key-word expansion using the
TAB-key.  Study the makefile of your platform to see what options are
supported.


But I am not sure. It looks like it is trying to install things into places Im sure a shared hosting user does not have access to. Is there a workaround that I am missing?



Here is my uname -a:


Linux ... 2.6.31.5-aufs2-grsec-1.0-x86_64-opteron #2 SMP Wed Oct 28 09:43:52 PDT 2009 x86_64 GNU/Linux

thanks very much!!
#38
newLISP in the real world / newLISP Hosting Providers
December 12, 2009, 02:59:03 PM
I thought it would be helpful to list hosts that have newLISP installed:



http://nearlyfreespeech.net/">http://nearlyfreespeech.net/

http://example.nfshost.com/versions.php">http://example.nfshost.com/versions.php (version info)



If anyone else knows of a host that has newLISP installed, please list it here.



thanks!



keywords: newLISP hosting, newLISP host, newLISP hosts, ?
#39
Hi -



At the moment, nearlyfreespeech.net doesnt have cron available.



Is it possible to call a .lsp file from another server that allows cron? (without leaving the .lsp file world readable?)



Or would it be a drag on the server to set up a persistent nL script that calls another nL script every half hour or so?



Has anyone w/ nearlyfreespeech.net figured a way to do scheduled jobs with newLISP?



thanks very much for any insight or direction!
#40
Dragonfly / How to Dragonfly on nearlyfreespeech.net ?
November 13, 2009, 05:14:57 PM
Hi -



Ive set up a domain w/ nearlyfreespeech.net, and ssh'd in and retreived the dragonfly code w/ the hg command, changed directory to the example-site as indicated in the Getting Started docs, and then ran:



./newlispServer



When I go to mysite.com:8080 the site just hangs.



If I navigate to the example-site directory like this:



http://mysite.com/dragonfly-newlisp/example-site">http://mysite.com/dragonfly-newlisp/example-site



I get this error:



ERR: problem accessing file : "/home/public/dragonfly-framework/lib/utils.lsp"



Is there something else that needs configuring?



Thanks!



also -- if this is not the place to ask Dragonfly-related questions, please direct me to the appropriate place. I would think that it would almost merit its own Forum on the nL Fan Club forums? thanks again! :D