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

Messages - joejoe

#166
newLISP in the real world /
September 18, 2009, 07:52:52 AM
Quote from: "hilti"Hi Joejoe



check out my attempt of "auto-loading" modules. Download Dragonfly framework. It's in the file dragonfly.lsp



Just a few lines of code.



Cheers

Hilti


thanks for the help Hilti.



im refraining from using bsd/mit/non-copyleft code, so i am sticking to the core modules. i appreciate the insight, and if dragonfly every becomes gpl, you bet i will be all over it. :0)   --joejoe
#167
newLISP in the real world /
September 16, 2009, 11:48:49 AM
cormullion! thanks for this help!!


Quote from: "cormullion"(dolist (el (println (lookup 'title (sxml


You've got a dolist but aren't you're supplying the result of a println function rather than a list?


Yes - I thought that was how I was going to get the filename to the save, but what you've suggested is beautiful. I am studying and playing with it now.


 
Quote from: "cormullion"


...



This is one way to do it:


(xml-type-tags nil nil nil nil)
(set 'sxml (xml-parse xml 15))

; get references to items

(set 'item-refs (ref-all 'item sxml))

; for each item
(dolist (ir item-refs)
   (set 'title (lookup 'title (sxml (chop ir))))
   (set 'description (lookup 'description (sxml (chop ir))))
   (set 'file-name (lower-case (replace "[^A-Za-z]" title "" 0)))
   (change-dir "/Users/me")
   (write-file file-name (string title "n" description "nn")))
 


Thank you again, cormullion. It makes sense what you are doing in this code.
#168
Hi - I am trying to put together a few bits of code from cormullion's superb introduction here:



http://www.newlisp.org/dokuwiki/doku.php?id=introduction:introduction_part_2#working_with_xml">http://www.newlisp.org/dokuwiki/doku.ph ... g_with_xml">http://www.newlisp.org/dokuwiki/doku.php?id=introduction:introduction_part_2#working_with_xml



but am ending up with:



ERR: value expected : (0 2 9 0)



The two bits Im trying to merge are commented in the code below, along with my attempt to take the titles from the xml file and make them into local file names. From there I want to put the links and description into each respective file.



Would anyone be able to say which part of the manual I need to go back and study? I cant seem to get inside of the dolist to insert a save command for each title as it is recursed through. Thanks for any sort of tip.


#!/usr/bin/newlisp

(set 'xml (get-url "http://shop.ebay.com/i.html?_nkw=lisp&_rss=1"))
(xml-type-tags nil nil nil nil)
(set 'sxml (xml-parse xml 15))

;(println (lookup 'title (sxml (chop (ref 'item sxml)))))
;(save (lookup 'title (sxml (chop (ref 'item sxml)))))

;(dolist (el (ref-all 'title sxml))
; (println (rest (sxml (chop el)))))

(dolist (el (println (lookup 'title (sxml (chop (ref-all 'item sxml))))))
(save (lookup 'title (sxml (chop (ref-all 'item sxml))))))

(exit)
#169
newLISP newS /
September 11, 2009, 12:07:30 PM
Quote from: "cormullion"I'm assuming that people don't want to modify newLISP itself, but want to write some application running on top of newLISP that they want to sell, to make a living from their own programming efforts. I know that this is already done by some developers.



[...]



I realise that I hijacked this thread, and that it has nothing to do with jeff's modules; it was just that I was reading something on a thread about how someone couldn't write commercial software with newLISP, which seemed a outcome that wasn't ideal. It seems like more people lose out the GPL way, although perhaps the moral highground is safely attained.




as xytroxon pointed out above, i dont think there is any problem writing commercial code w/ newLISP.



in fact, i think that Jeff's modules can be boxed and sold w/out source code for $$.
#170
newLISP newS /
September 11, 2009, 10:13:06 AM
Quote from: "cormullion"Lutz: it seems that the GPL is holding back the adoption of newLISP by people. What are the benefits that outweigh this (to my mind) major disadvantage?


i would say that, in the long run, Lutz has been smartest and most helpful to release newLISP under the gplv3. the gpl *is* the benefit of nL, as other languages have yet to realize. linux is a supreme example of attracting talent to help develop broadly and rapidly.


Quote from: "cormullion"I understand that some other scripting languages have more flexible licences that allow people more freedom to work and develop in their own chosen way...


they are more flexible, as spoken above in this thread, for the programmer / distributor / proprietor, but for a community, non-copyleft licensing isnt ideal. i think Jeff said it precisely:


Quote from: "Jeff"It would only hold people back from extending the language themselves and re-branding it proprietorially.




the gpl prevents code from the black hole effect where contributed code can be removed and withheld from the community (bsd/mit type licensings allow black holing code).



licensing is really an issue of gathering support through trust: ensuring any contributor that his or her work will remain freely contributed to all.



its always a personal decision, but i would not want to contribute my help to a project that allows others to withhold my contributions and help from the person that ends up with the software. through time, i think that a lot of developers are going to realize that the gpl is a good idea because their own code cant be withheld from their own grandchildren. :0)



cormullion, does this make good sense and/or is does this at least clarify what can and cannot be done with gpl/copyleft code from code that is not?
#171
newLISP in the real world /
September 10, 2009, 05:04:56 AM
Quote from: "xytroxon"I think you are getting confused by how the load and module functions work...



From the newLISP manual:



[...]



-- xytroxon


understood. thank you xytroxon.



i appreciate you taking the time to point this out.
#172
newLISP newS /
September 09, 2009, 08:15:39 AM
Quote from: "Jeff"The GPL imposes many restraints on what code may be used for. I am unconcerned about the possibility of someone "stealing" my code for a proprietary product and not releasing their changes. I am more interested in the code being, to my own mind, truly free.


i understand you, though i dont discount potential in possibility.


Quote from: "Jeff"Without wanting to get too much into a debate about the GPL, I feel that code is truly free if others may use it as they see fit, without imposing any restrictions on them. The end user is completely free to use it in any way, so long as they don't, 1) remove the license notice, 2) expect a a warranty.


nor do i want to debate. i truly want to know if you understand that you are saying that you want the end user to be free to use the code, though you are allowing a middleman to deny end users access to even read the code. from your hands to another is one step, but code moves quickly, from hand to hand, as you well know.



if i am mistaken in my statement above, it would be that you are concerned only with how the code leaves your hands, not a concern for how all end users recieve your code. if this second guess is the correct one, then i am clear about your gift of code.



thank you for your response. i certainly appreciate and have respect for you giving your code to others.
#173
newLISP newS /
September 09, 2009, 06:30:29 AM
Quote from: "Jeff"It is GPL-compatible, and is more permissive.


for the distributor, of course, but not end users, of the larger group which we all are a part.


Quote from: "Jeff"The MIT license hits less resistance at proprietary companies, as it makes no demands on the license of derivative code.


im guessing this is a concern of your own? i dont see the value of taking newLISP (gpl) and forking a module for it into a different license, thus destroying the guaranteed end user value of this contributed module from remaining for future users/developers.



personally, and i understand this is my opinion, i wouldnt understand why anyone (other than a proprietary distributor/developer/webservicer) would want to contribute to, and collaborate for, a non-copyleft module for newLISP.


Quote from: "Jeff"I don't mind the GPL, but I am not a strong believer in it. It's more important to me that the code is widely available and usable in any project than it is that it is free in the GPL sense of the term.


i think code is most useful when it can be reused most, i.e., entire freedom to further it, having finally, and fully, received it.
#174
newLISP in the real world /
September 09, 2009, 06:12:01 AM
thanks cormullion!



i thought that by re-installing newlisp w/ the module in place, this would let me not have to load the web.lsp module manually. am i correct about this? i even put it in the nL unpacked modules directory before i re-ran the config/make/make install.



this is what i get when i try to run the http as a string, as you pointed out: (thanks again!)


newLISP v.10.1.1 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info.

> (Web:parse-url "http://www.newlisp.org")

ERR: invalid function : (Web:parse-url "http://www.newlisp.org")
>
#175
hi -



i see the modules you are contributing are under the mit license? as you know, newLISP uses the gpl license and i am curious as to why you would not want to release these modules under the gpl? thanks!
#176
newLISP in the real world / using external modules
September 08, 2009, 11:40:58 AM
hi -



im trying to use the web.lsp module:



http://static.artfulcode.net/newlisp/web.lsp.html">http://static.artfulcode.net/newlisp/web.lsp.html



i added the file



http://static.artfulcode.net/newlisp/web.lsp.src.html">http://static.artfulcode.net/newlisp/web.lsp.src.html



as web.lsp to the



/usr/share/newlisp/modules



directory on my debian squeeze i386 machine and went through the ./configure, make and make install again and tried to do a basic function call like this:


> (Web:parse-url http://www.newlisp.org)

ERR: invalid function : (Web:parse-url http://www.newlisp.org)
> (parse-url http://www.newlisp.org)

ERR: invalid function : (parse-url http://www.newlisp.org)
>


i know i am making a most basic error in trying this.



can anyone say what i am doing incorrectly? thanks very much!
#177
Dragonfly / dragonfly web framework license
September 07, 2009, 11:34:15 AM
hi hilti - looks like really cool code you've released.



im curious to know why you chose the mit license instead of the license that newlisp uses, the gpl? any chance you might consider the gpl for future releases?



thanks in any case! - :0)
#178
newLISP in the real world /
August 22, 2009, 08:57:27 AM
Thanks for the replies!



cormullion: It was permissions. I chmodded 777 setup.lsp and it saves fine.



tom: Im running it w/ apache and the ownerships/permissions created through the wiki are different, as you mentioned. Im now guessing that running the wiki w/ newlisp as the server would be faster and simpler?



Im hosting with nearlyfreespeech.net and I downloaded the software w/ wget and extracted it w/ tar and it put my username as the owner of all the files, whereas when I create a page through the wiki, it gives the owner as user 25000 with a permission of 664.



Im guessing I should change all the pages(/files?) to owner 2500 and set permissions to 664?



Thanks again to both for clarifying what was occurring.
#179
Hi -



I chmodded 777 the pages and backup folders in the newlisp wiki software but any changes I make with the Edit button at page bottom are not having effect. If I manually edit the pages from the command line, the page shows the changes.



I havent changed anything other than chmodding these folders and making the software find newlisp in colors.cgi, index.cgi and rss.cgi.



Also, when I go to edit the setup.lsp via web browser, it gives this error when I try to save:



ERR: problem saving file in function save : "pages/setup.lsp"



Anyone else have this same experience or know why page changes and setup utility are not completing? Thanks very much!



One last strange thing: when I tar zxvf the newlisp wiki folder, all the files in the pages folder have the wierd ^M at the end of every line. I typically have only seen this when using unzip withouth the -e flag. thanks again! :0)