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

#1
newLISP in the real world / ×tamp formatting
October 16, 2020, 10:33:16 PM
Hi,



When I do this from the nL command line interpreter:


> (println "&timestamp")
&timestamp
"&timestamp"


All good as expected.



When I am running it on a web server cgi script looking at it from my browser, I end up with this result:


×tamp

How do I preserve &timestamp if I am making a string, say to include in a url?



When the result is ×tamp instead of &timestamp in the url, things break.



It seems like when seen "&times", something is changing that to show × instead?



I have this at top of the cgi script:


(print "Content-Type: text/htmlrnrn")

Thanks very much!
#2
newLISP in the real world / get-url works on some sites
September 10, 2020, 11:12:54 PM
Hi,



I love get-url and what it makes available for coding!



It seems to work on some sites and others not so much.



I have never had any issue before with using get-url for http calls.



For example, on both nearlyfreespeech.net and my laptop, it hangs on some sites.



(get-url "http://newlisp.org">http://newlisp.org") -- works!

(get-url "http://nearlyfreespeech.net">http://nearlyfreespeech.net") -- doesnt't work!

(get-url "http://amazon.com">http://amazon.com") -- doesn't work!

(get-url "http://google.com">http://google.com") -- works!



When it doesn't work, it just hangs.



I am guessing this is a server blocking issue for get-url requests?



On my nearlyfreespeech server, the logs say:

[Fri Sep 11 05:52:46.179236 2020] [cgi:warn] [pid 6060:tid 34480497408] [client 174.16.51.59:0] AH01220: Timeout waiting for output from CGI script /fs6b/abc/public/go.cgi
[Fri Sep 11 05:52:46.179516 2020] [core:error] [pid 6060:tid 34480497408] (70007)The timeout specified has expired: [client 174.16.51.59:0] AH00574: ap_content_length_filter: apr_bucket_read() failed


newLISP v.10.7.1 32-bit on Linux IPv4/6 UTF-8 libffi

newLISP v.10.7.5 64-bit on BSD IPv4/6 UTF-8



Thank you much for any quick tips on this! :D
#3
newLISP in the real world / using ref data
August 30, 2020, 03:07:07 AM
The ref and ref-all functions bring back an address or list of addresses.



As cormullion wrote in the nL wikibook:


(ref-all "Brian Eno" itunes-data)
;-> ((0 2 14 528 6 1) (0 2 16 3186 6 1) (0 2 16 3226 6 1))


What would be the best way to get that data instead of the numerical addresses?



Essentially, once I find the address is (0 2 14 528 6 1), how best would I get what it actually is, not the address?



So how best to get (0 2 16 3186 6 1) data?



Thank you!
#4
I am using


#/usr/local/env/bin newlisp
(println "hihi")
(exit)


saved as an index.cgi w 755 chmod.



w only a 500 error on nearlyfreespeech.



When I type whereis newlisp, it shows:


$ whereis newlisp
newlisp:


I have done this before easily.



Now get:


$ newlisp
-bash: newlisp: command not found


Any tip on how to execute an index.cgi nL script w NFS?



Or if an easier place to up and run nL, please direct. Thought NFS was pretty straight.



Thank you!
#5
newLISP in the real world / nL cron script
October 26, 2019, 12:56:33 AM
Hi,



I have a script I am trying to run from cron on Debian/Ubuntu.


* * * * * joe /home/joe/winny/winny.lsp

The permissions of winny.lsp are 755.



Syslog looks like it is executing:


Oct 26 01:49:01 jsfccfow CRON[6574]: (joe) CMD (joe /home/joe/winny/winny.lsp)

The winny.lsp script contains:


(append-file "ltcbtc.txt" (println pairs (date (date-value) 0 "%y%m%d%H%M%S")))

The ltcbtc.txt file is already created and chmoded to 755.



I am not getting anything added to ltcbtc.txt file.



Anything I might be missing to get the nL script to run w cron?



Thank you! :-)
#6
newLISP in the real world / translating big numbers
October 12, 2019, 06:22:58 PM
Hi,



I often get this sort of number:



-2.000000000000049e-07



I would like number to just display itself, without the "e-" exponent thing.



I don't mind zeros and I have a big screen and it would love to see the real number.



Would there be an easy way to convert the e number back into normal digits?



Thanks much! :-)
#7
newLISP in the real world / values into mul
October 11, 2019, 04:08:36 PM
Hi,



I am trying this:


(set 'abc "8888")
(println abc)
(println (mul 2 abc))


and getting this:


8888

ERR: value expected in function mul : abc


What would be the way to get values into the mul function?



Thanks!
#8
Anything else we might add? / dragonfly artwork
October 10, 2019, 05:46:35 PM
Cool dragonfly art.



Came from the back cover of a magazine Birdy.
#9
newLISP in the real world / ccxt with nL
July 31, 2019, 03:33:14 AM
Hi,



ccxt has 'support' for php, python and js.



https://github.com/ccxt/ccxt">https://github.com/ccxt/ccxt

https://github.com/ccxt/ccxt/wiki/Manual#api-methods--endpoints">https://github.com/ccxt/ccxt/wiki/Manua ... -endpoints">https://github.com/ccxt/ccxt/wiki/Manual#api-methods--endpoints



I would like to skip those languages and simply access its api endpoints from nL.



Would anyone have a thought on how this might be done?



Thank you for any tip or suggestion on this! :-)
#10
newLISP in the real world / loading html templates
June 17, 2019, 08:10:09 AM
Hi,



I think I should load html templates with set command, however when I surround the html with the [text][/text] tags and use println to display the html, it omits the header.



For example, this code:


(set 'template [text]<!DOCTYPE html>
<html lang="en">
<title>W3.CSS Template</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
html,body,h1,h2,h3,h4,h5,h6 {font-family: "Roboto", sans-serif;}
.w3-sidebar {
  z-index: 3;
  width: 250px;
  top: 43px;
  bottom: 0;
  height: inherit;
}
</style>
<body>

<!-- Navbar -->
<div class="w3-top">
  <div class="w3-bar w3-theme w3-top w3-left-align w3-large">
    <a class="w3-bar-item w3-button w3-right w3-hide-large w3-hover-white w3-large w3-theme-l1" href="javascript:void(0)" onclick="w3_open()"><i class="fa fa-bars"></i></a>
    <a href="#" class="w3-bar-item w3-button w3-theme-l1">Logo</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">About</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Values</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">News</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Contact</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white">Clients</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white">Partners</a>
  </div>
</div>

<!-- Sidebar -->
<nav class="w3-sidebar w3-bar-block w3-collapse w3-large w3-theme-l5 w3-animate-left" id="mySidebar">
  <a href="javascript:void(0)" onclick="w3_close()" class="w3-right w3-xlarge w3-padding-large w3-hover-black w3-hide-large" title="Close Menu">
    <i class="fa fa-remove"></i>
  </a>
  <h4 class="w3-bar-item"><b>Menu</b></h4>
  <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a>
  <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a>
  <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a>
  <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a>
</nav>

<!-- Overlay effect when opening sidebar on small screens -->
<div class="w3-overlay w3-hide-large" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>

<!-- Main content: shift it to the right by 250 pixels when the sidebar is visible -->
<div class="w3-main" style="margin-left:250px">

  <div class="w3-row w3-padding-64">
    <div class="w3-twothird w3-container">
      <h1 class="w3-text-teal">Heading</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum
        dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
    </div>
    <div class="w3-third w3-container">
      <p class="w3-border w3-padding-large w3-padding-32 w3-center">AD</p>
      <p class="w3-border w3-padding-large w3-padding-64 w3-center">AD</p>
    </div>
  </div>

  <div class="w3-row">
    <div class="w3-twothird w3-container">
      <h1 class="w3-text-teal">Heading</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum
        dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
    </div>
    <div class="w3-third w3-container">
      <p class="w3-border w3-padding-large w3-padding-32 w3-center">AD</p>
      <p class="w3-border w3-padding-large w3-padding-64 w3-center">AD</p>
    </div>
  </div>

  <div class="w3-row w3-padding-64">
    <div class="w3-twothird w3-container">
      <h1 class="w3-text-teal">Heading</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum
        dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
    </div>
    <div class="w3-third w3-container">
      <p class="w3-border w3-padding-large w3-padding-32 w3-center">AD</p>
      <p class="w3-border w3-padding-large w3-padding-64 w3-center">AD</p>
    </div>
  </div>

  <!-- Pagination -->
  <div class="w3-center w3-padding-32">
    <div class="w3-bar">
      <a class="w3-button w3-black" href="#">1</a>
      <a class="w3-button w3-hover-black" href="#">2</a>
      <a class="w3-button w3-hover-black" href="#">3</a>
      <a class="w3-button w3-hover-black" href="#">4</a>
      <a class="w3-button w3-hover-black" href="#">5</a>
      <a class="w3-button w3-hover-black" href="#">»</a>
    </div>
  </div>

  <footer id="myFooter">
    <div class="w3-container w3-theme-l2 w3-padding-32">
      <h4>Footer</h4>
    </div>

    <div class="w3-container w3-theme-l1">
      <p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p>
    </div>
  </footer>

<!-- END MAIN -->
</div>

<script>
// Get the Sidebar
var mySidebar = document.getElementById("mySidebar");

// Get the DIV with overlay effect
var overlayBg = document.getElementById("myOverlay");

// Toggle between showing and hiding the sidebar, and add overlay effect
function w3_open() {
  if (mySidebar.style.display === 'block') {
    mySidebar.style.display = 'none';
    overlayBg.style.display = "none";
  } else {
    mySidebar.style.display = 'block';
    overlayBg.style.display = "block";
  }
}

// Close the sidebar with the close button
function w3_close() {
  mySidebar.style.display = "none";
  overlayBg.style.display = "none";
}
</script>

</body>
</html>
[/text])


when called with (println template), the browser yields a page that is missing the html header info and begins the source html with this:


<!-- Navbar -->
<div class="w3-top">
  <div class="w3-bar w3-theme w3-top w3-left-align w3-large">
    <a class="w3-bar-item w3-button w3-right w3-hide-large w3-hover-white w3-large w3-theme-l1" href="javascript:void(0)" onclick="w3_open()"><i class="fa fa-bars"></i></a>
    <a href="#" class="w3-bar-item w3-button w3-theme-l1">Logo</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">About</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Values</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">News</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Contact</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white">Clients</a>
    <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white">Partners</a>
  </div>
</div>

<!-- Sidebar --> ...


Is there something in the html header that is causing it not to display? I thought the [text][/text] formatters allowed anything to go inside of them?



Thanks very much!
#11
Hi,



I would like to format json data into html.



I have attempted this for a few days, and success looms. :0)



The json-parse return data is this:



(("result" (("totalResults" 19) ("products" ((("productTitle" "GILDAN EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1HMtjKuuSBuNjSsziq6zq8pXaz/GILDAN-EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt.jpg") ("productUrl" "https://www.aliexpress.com/item/GILDAN-EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt/32919995838.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt men") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1ZiW5OVXXXXbhXFXXq6xXFXXX5/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt-men.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt-men/2048199251.html")) (("productTitle" "GILDAN EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1gNryaifrK1RjSspbq6A4pFXa6/GILDAN-EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt.jpg") ("productUrl" "https://www.aliexpress.com/item/GILDAN-EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt/32961316694.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt men") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1OQTXX9CWBuNjy0Fhq6z6EVXa1/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt-men.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt-men/32708902913.html")) (("productTitle" "Lisp John McCarthy Lisp t shirt top clothing tee for funny male tshirt harajuku streetwear t-shirt men hip hop C2613") ("imageUrl" "https://ae01.alicdn.com/kf/HLB1KsivXOHrK1Rjy0Flq6AsaFXa8/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-t-shirt-top.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-t-shirt-top-clothing-tee-for-funny-male-tshirt-harajuku-streetwear-t/32951457641.html")) (("productTitle" "Lisp John McCarthy Lisp t shirt men hop t-shirt clothing tshirt male streetwear harajuku funny top hip for tee PF2613") ("imageUrl" "https://ae01.alicdn.com/kf/HLB1fw3tKHvpK1RjSZFqq6AXUVXaG/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-t-shirt-men.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-t-shirt-men-hop-t-shirt-clothing-tshirt-male-streetwear-harajuku-funny/32983702961.html")) (("productTitle" "New Short Sleeve Round Collar Mens T Shirts Fashion 2018 A Lisp Symbol - Mens Crewneck T-shirt - 7 Colours") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1KMFuXiCYBuNkSnaVq6AMsVXam/New-Short-Sleeve-Round-Collar-Mens-T-Shirts-Fashion-2018-A-font-b-Lisp-b-font.jpg") ("productUrl" "https://www.aliexpress.com/item/New-Short-Sleeve-Round-Collar-Mens-T-Shirts-Fashion-2018-A-Lisp-Symbol-Mens-Crewneck-T/32851305347.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo T-shirt Top Lycra Cotton Men T shirt New Design High Quality") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1Q2qyOVXXXXa8aFXXq6xXFXXX2/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-T-shirt-Top.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-short-sleeved-T-shirt-men/2048564231.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo T-shirt Top Lycra Cotton Men T shirt New Design High Quality") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1lv2iX1OSBuNjy0Fdq6zDnVXaz/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-T-shirt-Top.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-T-shirt-Top-Lycra-Cotton-Men-T/32708922788.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1ooXHbzuhSKJjSspjq6Ai8VXa9/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton/32834143521.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1UabedvBNTKJjSszbq6yFrFXaf/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton/32833672611.html")) (("productTitle" "Lisp John McCarthy Lisp t shirt harajuku kawaii t-shirt female femme cartoon tops tshirt women tee clothing graphic K2613") ("imageUrl" "https://ae01.alicdn.com/kf/HTB17jx4e9rqK1RjSZK9q6xyypXaE/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-t-shirt-harajuku.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-t-shirt-harajuku-kawaii-t-shirt-female-femme-cartoon-tops-tshirt-women/32934917454.html")) (("productTitle" "Lisp John McCarthy Lisp Hoodies Men Casual Hip Hop Sweatshirt Traksuit Pullover Hoody Tops E4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1sxcOKXGWBuNjy0Fbq6z4sXXah/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-Hoodies-Men-Casual.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-Hoodies-Men-Casual-Hip-Hop-Sweatshirt-Traksuit-Pullover-Hoody-Tops-E4301/32922051065.html")) (("productTitle" "Lisp John McCarthy Lisp Hoodies Men Hooded Sweatshirts Print Quality Pullover Casual Fashion Tracksuit Streetwear X4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1bTA7IHGYBuNjy0Foq6AiBFXai/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-Hoodies-Men-Hooded.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-Hoodies-Men-Hooded-Sweatshirts-Print-Quality-Pullover-Casual-Fashion-Tracksuit-Streetwear-X4301/32905489790.html")) (("productTitle" "Lisp John McCarthy Lisp Hoodies Men Hooded Sweatshirts Print Quality Pullover Casual Fashion Tracksuit Streetwear X4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1M5cvmTmWBKNjSZFBq6xxUFXa9/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-Hoodies-Men-Hooded.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-Hoodies-Men-Hooded-Sweatshirts-Print-Quality-Pullover-Casual-Fashion-Tracksuit-Streetwear-X4301/32910155757.html")) (("productTitle" "Lisp John McCarthy Lisp 3D Hoodie Hoodies Men Women 2019 Long Sleeve Autumn WInter Tops Tees Casual Sweatshirt Sweatshirts P4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1ENJeXELrK1Rjy0Fjq6zYXFXaH/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-3D-Hoodie-Hoodies.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-3D-Hoodie-Hoodies-Men-Women-2019-Long-Sleeve-Autumn-WInter-Tops-Tees/32946570658.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1X.5ampcJL1JjSZFOq6AWlXXao/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-men-Sweatshirts-Thick.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-men-Sweatshirts-Thick-Combed-Cotton/32834402567.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1V9WKXLNNTKJjSspfq6zXIFXa6/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-men-Sweatshirts-Thick.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-men-Sweatshirts-Thick-Combed-Cotton/32833411013.html")) (("productTitle" "Lisp John McCarthy Lisp 3D Print Hoodies women 2018 Black Cosplay Hoody Sweatshirt kpop Hipster Streetwear Tops Pullovers V2613") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1Y_HUXjDuK1Rjy1zjq6zraFXay/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-3D-Print-Hoodies.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-3D-Print-Hoodies-women-2018-Black-Cosplay-Hoody-Sweatshirt-kpop-Hipster-Streetwear/32935074154.html")))))) ("currentPageNum" 0) ("errorCode" 20010000) ("totalPageNum" 0))


I would like to translate this to html to display this:


<a href="https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-men-Sweatshirts-Thick-Combed-Cotton/32833411013.html">EMACS GNU XEMACS LISP programmer red and blue logo men Sweatshirts Thick Combed Cotton</a>
<img src=https://ae01.alicdn.com/kf/HTB1HMtjKuuSBuNjSsziq6zq8pXaz/GILDAN-EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt.jpg">"


Essentially, grabbing the item information from json and transposing it to display html.



I am trying with lookup and dolist but am having trouble getting into the parentheses without having to create a lookup address for each item.



I can get this far:


(set 'ali (get-url ali-link))
(set 'alie (json-parse ali))
(println (lookup "products" (lookup "result" alie)))


Thank you greatly for any quick pointer or general direction! :9)
#12
Hi and thanks!


(set 'word (join titles " "))
(set 'words (find-all {w{5,}} word))
(set 'worder (lower-case (string words)))
(println (sort worder))

ERR: list or array expected in function sort : worder

worder looks similar to this: ("one" "two" "three")



How would I best sort this?



Thanks very much for help!
#13
Hi,



(json-parse (exec "curl https://www.asdf.com/asdf.json">https://www.asdf.com/asdf.json"))



I am getting the message that a string is expected.



The result of the exec has [text]......[/text] at the beginning and end of what is returned.



Is this why json-parse thinks it is not a string?



I tried (json-parse (string (exec "curl....))) too. Still says a string is expected.



How do I remove the [text] ... [/text] so that the result can be interpreted by (json-parse)?



Thanks!
#14
newLISP in the real world / generating aws signature
October 22, 2016, 09:38:20 PM
Hi,



I am following this php code and am trying to reproduce it with nL.



http://webtutsdepot.com/2009/10/13/amazon-signed-request-php/">http://webtutsdepot.com/2009/10/13/amaz ... quest-php/">http://webtutsdepot.com/2009/10/13/amazon-signed-request-php/



I cannot figure out if this is a two part transaction or just a single query.



Would anyone know if I need an initial aws server response from the get-url command in order to complete the rest of building the url that will make the request with the aws signature?



Like do I need to say 'knock knock', and use part of their 'whos there' response in order to generate my signature?



Thanks for help!



joejoe
#15
newLISP in the real world / basic web calculator
October 13, 2016, 03:01:33 PM
Hi,



I would like to create a basic web calculator using nL.



I would like to display three images which correspond to three different values (say 1, 2 and 3).



I would like to display a running total as the images are clicked on.



So, I would start with the value of 0.



I click on the first image (which has a value of 1), and the total updates to 1.

Then I click on the second image (which has a value of 2), and the total updates to 3.

Then I click on the third image (which has a value of 3), and the total updates to 6.

Then I click on the second image again, and the total updates to 8.

Etc..



And then I have a buton to clear.



Would anyone have pointers to get me going in the right place?



Specifically:



Do I need to use a web form to do this?

Do I need to use cookies or can I do this without cookies?



Thanks very much for any help to get me going in the right direction! :0)
#16
newLISP in the real world / scaling list addressing
December 27, 2015, 03:21:21 PM
Hi and thanks!



I would like to associate a username with a bunch of schedules (lists), or vice versa.



Would anyone please direct towards an efficient way to scale this type of data structure:


; Format: Schedule# (Username, Schedule Name, Start Time, Interval in Seconds, Expiry).

(set 'S0 '("Username" "Feed plants" 1450754544 604800 1456197744))
(set 'S1 '("Username" "Manicure plants" 1450754544 259200 1453346544))

Or should I use this format:


(set 'Username
 '(("Feed plants" 1450754544 604800 1456197744)
   ("Manicure plants" 1450754544 259200 1453346544)
  )
)

And would implicit addressing be the best way to call up the list elements?



Very much appreciate and thanks again! :)
#17
newLISP in the real world / nL with Snappy Ubuntu Core
November 21, 2015, 09:50:36 PM
Hi,



I would like to create Ubuntu Snappy apps with newLISP and am not sure if it's possible or how best to do this.



http://developer.ubuntu.com/en/snappy/build-apps/">http://developer.ubuntu.com/en/snappy/build-apps/

http://developer.ubuntu.com/en/snappy/build-apps/your-first-snap/">http://developer.ubuntu.com/en/snappy/b ... irst-snap/">http://developer.ubuntu.com/en/snappy/build-apps/your-first-snap/



Any pointers or general direction on this would be greatly appreciated! :)



Thanks very much!



http://developer.ubuntu.com/en/snappy/">http://developer.ubuntu.com/en/snappy/

http://developer.ubuntu.com/en/snappy/start/using-snappy/">http://developer.ubuntu.com/en/snappy/s ... ng-snappy/">http://developer.ubuntu.com/en/snappy/start/using-snappy/

http://insights.ubuntu.com/2015/06/03/so-you-want-to-write-a-snappy-app/">http://insights.ubuntu.com/2015/06/03/s ... nappy-app/">http://insights.ubuntu.com/2015/06/03/so-you-want-to-write-a-snappy-app/
#18
Hi!



I am running a Debian (Linux Mint) and have installed apache2, sqlite3 and downloaded all the requirements for Rockets from here:



http://newlisponrockets.com/rockets-item.lsp?p=99">http://newlisponrockets.com/rockets-item.lsp?p=99



I am seeing the text of the index.cgi that I have unpacked into /var/www of Rockets when I go to:



http://localhost/index.cgi">http://localhost/index.cgi



Looks like this:


#!/usr/bin/env newlisp
(load "newlisp-rockets.lisp") ; this is where the magic happens!
(page-redirect "rockets-main")


I have done both of these suggestions:


QuoteYou could try adding the line:





AddHandler cgi-script .cgi .lsp





To /etc/apache2/sites-available/default (or instead of default, your site name)



If things really don't want to execute, try this:



cd /var/www

sudo nano .htaccess



Add the line "Options +ExecCGI"


from here: http://newlisponrockets.com/rockets-item.lsp?p=99">http://newlisponrockets.com/rockets-item.lsp?p=99



I am having no problem seeing newLISP here:


/var/www $ /usr/bin/env newlisp
newLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (exit)


Any quick thoughts on what to try? Thanks big! :O)
#19
Hi -



When I try this on my computer, it works fine:



newLISP v.10.3.3 on Linux IPv4/6 UTF-8


(set 'a '("oneone" "two" "twotwotwo" "three" "threethree"))
(println (filter (fn (x) (find-all {w{6,12}} x)) a))

;-> ("oneone" "twotwotwo" "threethree")



but when I try on NearlyFreeSpeech.net



newLISP v.10.2.8 on BSD IPv4 UTF-8


(set 'a '("oneone" "two" "twotwotwo" "three" "threethree"))
(println (filter (fn (x) (find-all {w{6,12}} x)) a))

;-> ("oneone" "two" "twotwotwo" "three" "threethree")



As the code shows, Im after strings 6-12 characters long.



Am I missing something or is there a slight difference causing this from nL 10.2.8 to 10.3.3?



Thanks very much in advance! :)
#20
newLISP in the real world / Creating an html form
June 17, 2012, 11:13:02 PM
Hi,



I would like to create an html form on my index.cgi.



For example, I would like to have a search on my site and use the term searched for to build my page.



Do I just create the form html, and have it post to mysite.com/index.cgi?search=xyz ?



What do I need to do inside of index.cgi in order to be able to receive a search?



This is not a search engine for searching the content on my site.



I will take the search term and build the page once I know what they are searching for.



I see this in Web.lsp:


Web:get
syntax: (Web:get str-key)

Returns the value of str-key in the query string or nil if not present. If str-key is not provided, returns an association list of all GET values.

Web:post
syntax: (Web:post str-key)

Returns the value of str-key in the client-submitted POST data or nil if not present. If str-key is not provided, returns an association list of all POST values.

http://scruffythinking.com/storage/artful/artful-web.html">http://scruffythinking.com/storage/artf ... l-web.html">http://scruffythinking.com/storage/artful/artful-web.html



If I get my form to submit to xyz.com/index.cgi?search=test then Web:get or Web:post will be able to interpret "test" and be able to doing things with it inside index.cgi?



Okay and thanks! :-)