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

#31
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.
#32
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! :-)
#33
Wow, that did the trick!



Thank you for the insight Ralph! :9)
#34
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!
#35
Blingo!



Raisins have been picked Ralph! Woo hoo! :D



What a treasure it is to have such support!



I learned more than I was looking for and am such happier!



Kind thanks for your suggestion and guidance, again.



It's a happy json raisin pickin from the cake kinda day today! :P
#36
Ralph



Gotcha on the x y term form finding they y data if it is there. Also on the error prevention by returning an empty value instead of getting a nil value from the ref statement. It's brilliant and certainly makes using json data more friendly.



I am getting the


ERR: data type and format don't match in function format :

error after integrating your simpler map suggestion.


(set 'ali (get-url ali-link))
(set 'alie (json-parse ali))
(set 'jsondata (lookup "products" (lookup "result" alie)))
 
(define (raisins jsonitem)
    (format "<a href="%s">%s</a>n"<img src="%s">nn"
          (string (if (ref '("productUrl" ?) jsonitem match true) ($it 1) '()))
          (string (if (ref '("productTitle" ?) jsonitem match true) ($it 1) '()))
          (string (if (ref '("imageUrl" ?) jsonitem match true) ($it 1) '())) ))
 
(println (join (map raisins jsondata) "n"))


(println jsondata) gives this:


((("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" ...

What I do notice looking at the JSON result in Firefox, is that there are <font>LISP</font> in the productTitle, which may be confusing the syntax for format?



In the JSON Firefox display, it shows


productTitle:     "EMACS GNU XEMACS <font><b>LISP</b></font> programmers wildebeest men Sweatshirts Thick Combed Cotton"

It seems these raisins are quite close to being picked. Thank you again for your guidance, Ralph.
#37
Thanks to both Ralph and Hans-Peter!



I am trying Ralph's and am getting nil response.



If I am understanding correctly, Ralph intended that I do something like this:


(set 'ali (get-url ali-link))
(set 'alie (json-parse ali))

(set 'jsondata (lookup "products" (lookup "result" alie)))
 
(define (raisins jsonitem)
    (format "<a href="%s">%s</a>n"<img src="%s">nn"
          (string (if (ref '("productUrl" ?) jsonitem match true) ($it 1)))
          (string (if (ref '("imageTitle" ?) jsonitem match true) ($it 1)))
          (string (if (ref '("imageUrl" ?) jsonitem match true) ($it 1))) ))
         
(println (map raisins (if (ref '("products" ?) jsondata match true) ($it 1) '())))


When I run this in my browser, I get this result:


()

When I do


(println (set 'jsondata (lookup "products" (lookup "result" alie))))

to see what I am working with, I get this:


((("productTitle" "...

Notice the three leading parenthesis.



When I do this:


(println (set 'jsonitem (jsondata 0)))

I get this:


(("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"))

It seems the extra set of parenthesis that comes with jsondata are making it so the define cannot only get into the first set, which doesn't have the product data sets? I've tried a bunch of tweaks and am coming back to ask if I might be missing something simple.



Thank you both and all again! :0)
#38
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)
#39
newLISP newS / Re: Book about Fuzzy Logic in newLISP
March 13, 2019, 08:42:17 PM
Argüelles,



Thank you for the meta extension facility! Looks stellar!



Quick question, do you have a license associated w the code?



nL is GPL which allows us to modify contribute it without letting others close source it.



I'm getting a grasp of the idea of fuzzy logic on top of nL! Kudos! :D
#40
Quote from: "ralph.ronnquist"You might have meant the third line be
(set 'worder (map lower-case words))

Ralph, you always bat cleanup around here. Thank you!



It's hard to admit you know what I want to do before I even thought to do it! ;0)



Thanks for this very much and learned going forward. Big thanks for this and all many past!
#41
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!
#42
Thanks again Ted,! I was able to do it with get-url here.


(json-parse (get-url "https://pastebin.com/raw/brx7F2vA"))


(("ID" ("1" "2" "3" "4" "5" "6" "7" "8")) ("Name" ("Rick" "Dan" "Michelle" "Ryan"            
   "Gary" "Nina" "Simon" "Guru"))                                                            
 ("Salary" ("623.3" "515.2" "611" "729" "843.25" "578" "632.8" "722.5"))                      
 ("StartDate" ("1/1/2012" "9/23/2013" "11/15/2014" "5/11/2014" "3/27/2015" "5/21/2013"        
   "7/30/2013" "6/17/2014"))
 ("Dept" ("IT" "Operations" "IT" "HR" "Finance" "IT" "Operations" "Finance")))
#43
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!
#44
Anything else we might add? / Re: Newlisp vs Lua
February 02, 2018, 06:14:20 PM
TedWalther,



I have long appreciated your advice and direction.



On multiple occasions you have guided me in the proper direction.



Thank you. Your responses I regard as true mentorship. That is absolute.


QuoteYou need to look at it from both sides. [...]

The choice I have is, [...] [contribute to closed or open ecosystems].

Yes, the GPL requires that the end user (our own selves included) rank higher than a developer/distributor's personal interests. I would agree and still hold that my spent 'life force' is greater when more people can make more use of it than I can myself alone.


QuoteGPL takes that choice away from me.

As it is designed to. Greater good outranks personal profit, any way we dice it.



It does so to insure the allowance to end users, a larger benefit to our society.



Multiplication stacks way higher than does simple addition. It's your choice always.


QuoteAs for my grandkids, if you think BSD license will prevent them from accessing my source code, you are wrong.

If I grab your BSD code and redistribute it closed, I'd say your code would not be available to your grandkids.



Grandpa, what's my computer doing? 'I used to know'.


QuoteEven the GNU C compiler allows you to [...]

Survivability still often supercedes even the greatest of ethic.



I'm not in. Wouldn't want anyone not to know what their computer is doing.
#45
Anything else we might add? / Re: Newlisp vs Lua
February 02, 2018, 12:39:28 AM
newLisp vs Lua.



These are two differently licensed projects, which make them incomparable.


Quote from: "rickyboy"
I always try to be mindful of what the licensing is for the tools that I use, and I consider MIT/BSD/ISC and the like to be superior (namely, more free) than any GPL.


If you contributed code that your grand-kids could not make use of because your license choice allowed the boxing up and redistribution of your source code without sharing the source code to your grand-kids, that would be a loss, like not really free code (i.e., MIT/BSD).



Dual-licensing allows for deception and deprivation, a novice move. Freedom does not tend towards denying others a freedom you were freely given.



The authors of GPL software want to make sure that any contribution to their codebase remains "free". Free, like code that is not able to be boxed up as unreadable, unredistributable, unusable software.



Everyone here understands how their (copyleft) contributions remain available to everyone else because the GPL requires any redistribution of their code to include the source code, important when you want to know what your computer is doing.



Here's a better explanation than I can offer. Well worth the reading!



https://www.gnu.org/licenses/copyleft.en.html">https://www.gnu.org/licenses/copyleft.en.html



"Copyleft says that anyone who redistributes the software, with or without changes, must pass along the freedom to further copy and change it. Copyleft guarantees that every user has freedom."



Lua is MIT/BSD, newLisp is GPL. These are two different permissions.



If you want your contributions able to be denied to another, go with Lua (MIT licensed software).



If you want to make sure you contributions are available and impermeably free, go w newLisp (copyleft).



MIT/BSD projects do not last over time because too many contributions are absconded with.



License consideration allows for software utility, part of what makes nL better than anything out there!