Re: PicoLisp on Raspi
I too was looking into creating an FPGA implementation of picolisp and am very excited about this. A developer board which already runs Linux but also has an FPGA onboard may be worth exploring. Like this one: http://shop.adapteva.com/collections/parallella/products/parallella-16-desktop-computer Perhaps the picolisp chip could offload calculations to the 16 core coprocessor for calculation intensive applications. In any case this is very exciting for many reasons and I'm happy to test and help however I can. Great work. On Sep 19, 2014 11:20 AM, Rowan Thorpe ro...@rowanthorpe.com wrote: On Fri 19 Sep 2014 15:47, Jakob Eriksson wrote: On September 19, 2014 at 3:18 PM Joe Bogner joebog...@gmail.com wrote: This might be off base, but is it within the realm of possibility to run PilMCU on a raspberry pi now or in the future? That's an accessible piece of hardware that many people already have (myself included). These people may also be willing to fund the work Raspi runs linux, so you can run PicoLisp on it right now. PilMCU is about new hardware chips. You could of course go the middle way, that could attract some attention: port PicoLisp to bare Raspberry Pi hardware. Also an interesting prospect. But the ARM cpu in the pi is not a natural fit, it is not 64 bit, only 32. So it would be more of a promo thing. But very cool in its own right. Strange this came up just now - I am a long-time stalker on the mailing list, and had been brewing the idea for a long time to get the ball rolling for a Picolisp equivalent of this: http://common-lisp.net/project/movitz/movitz.html and ultimately perhaps one day a picolisp-based kernel, and maybe even a predominantly picolisp-OS (...I like to dream big). I am for sure much more excited about this latest picolisp-machine announcement though (LISP machines are back! Their time has come! Mwahahahaha!), but there is probably still a good reason to also go the middle way too, for the reasons already mentioned - to gain attention and to do meaningful performance comparisons to existing software. FWIW: I am totally up for contributing to PilMCU, RasPicolisp or Picolix86_64p in any way that I can. Count me in. -- Rowan Thorpe PGP fingerprint: BB0A 0787 C0EE BDD8 7F97 3D30 49F2 13A5 265D CCBD There is a great difference between worry and concern. A worried person sees a problem, and a concerned person solves a problem. - Harold Stephens -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: How to show data of relations rather than external symbol?
Thanks for your speedy reply Alex. On Jun 30, 2014 2:18 AM, Alexander Burger a...@software-lab.de wrote: Hi David, If I have an +Entity with a +Joint to another +Entity and (show ...) it I get an external symbol rather than the data connected to it. How can I show all of the data connected to this object? So far the best I've come up with is to (dm show ...) and use (show (: theproperty)) but I want to know if there's a more idiomatic way. If I understand you correctly, you are looking for a generic and reflective way to show all data, without having to write entity-specific methods, right? That's correct unless there's nothing wrong or inefficient about how I use (show...) within my (show ...) method to display the data of a relation instead of it's external symbol. The 'edit' function is remotely doing that, in that it shows the class(es) of the object(s) in a relation (and also decodes calendar dates). It doesn't show the individual properties of those objects, though, but recurses if you click on them with 'K'. In general, I would use 'edit' to browse graphs of database objects. Yes this is very handy when building and debugging but won't help me display the data in a GUI component. Otherwise, you could write a custom version of 'show' which displays all properties of the object using 'getl'. But I do not believe it will be visually appealing. Agreed and a little over my head at this time to write anything more generic than what you've already written. Also how would I connect a (gui ...) component to such an object which will show all of the data of the object rather than external symbols ponting to relations? As gui components are typed, you would have to resort to a dumb text field or textarea to show things completely generically. I like this idea of a dumb text field just displaying the data. Can you elaborate on this? How about using the gui 'repl' function (which opens an interactive REPL in the browser, be careful about security issues!!) and then your 'show' from above? ;) Cool! I didn't even know about this. I may use it for debugging but the shell REPL is fine and I'm too paranoid worth security to let anyone else have a REPL. Thanks again for your help. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
How to show data of relations rather than external symbol?
Hi list, If I have an +Entity with a +Joint to another +Entity and (show ...) it I get an external symbol rather than the data connected to it. How can I show all of the data connected to this object? So far the best I've come up with is to (dm show ...) and use (show (: theproperty)) but I want to know if there's a more idiomatic way. Also how would I connect a (gui ...) component to such an object which will show all of the data of the object rather than external symbols ponting to relations? Thank you, David
Re: Dynamic generation of progress bars
Thank you Alex. My work with CL lately has clearly been rubbing off on me. I'll combat that with more picolisp thanks to your tip. What a wonderful language to work in. -David On Mon, Mar 3, 2014 at 2:45 AM, Alexander Burger a...@software-lab.dewrote: On Sun, Mar 02, 2014 at 05:38:20PM -0500, me wrote: Please help point me in the right direction once again? What I'm attempting to achieve is something like: (div progress (div '(progress-bar progress-bar-success (role . progressbar) (aria-valuenow . -79) (aria-valuemin . -100) (aria-valuemax . 100) (style . width: 79%) ) (span sr-only 79% Nominal) ) ) What I have is: (de make-progress-bar (bar-type width) (div progress (div '(`(,pack progress-bar progess-bar- ,bar-type) (role . progressbar) (aria-valuenow . `(,pack ,width)) (aria-valuemin . -100) (aria-valuemax . 100) (style . `(,pack width: ,width %)) ) (span sr-only `(,pack ,width % Nominal)) ) ) ) What is the idiomatic way to manipulate text such that I can dynamically generate different types of progress bars? The idea being that I could use different color coded static progress bars as a simple form of charting data. The problem with the solution above is that the backquote has a meaning in PicoLisp different from that in CL. It is a read macro, not a pattern-filler at runtime. Same goes for the comma. Passing a list dynamically at runtimes means that it must be built at runtime. This should work: (de make-progress-bar (Bar-type Width) (div progress (div (list (pack progress-bar progress-bar- Bar-type) '(role . progressbar) (cons 'aria-valuenow Width) '(aria-valuemin . -100) '(aria-valuemax . 100) (cons 'style (pack width: Width %)) ) (span sr-only Width % Nominal) ) ) ) (make-progress-bar success 79) You might also take a look at 'fill' (which is a bit similar to the CL backquote function) to build the list, but that's a little more involved in this case: (de make-progress-bar (Bar-type @Width) (let (@B (pack progress-bar progress-bar- Bar-type) @W (pack width: @Width %) ) (div progress (div (fill '(@B (role . progressbar) (aria-valuenow . @Width) (aria-valuemin . -100) (aria-valuemax . 100) (style . @W) ) ) (span sr-only @Width % Nominal) ) ) ) ) (make-progress-bar success 79) The effect is the same in both cases. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Dynamic generation of progress bars
Hello List, Please help point me in the right direction once again? What I'm attempting to achieve is something like: (div progress (div '(progress-bar progress-bar-success (role . progressbar) (aria-valuenow . -79) (aria-valuemin . -100) (aria-valuemax . 100) (style . width: 79%) ) (span sr-only 79% Nominal) ) ) What I have is: (de make-progress-bar (bar-type width) (div progress (div '(`(,pack progress-bar progess-bar- ,bar-type) (role . progressbar) (aria-valuenow . `(,pack ,width)) (aria-valuemin . -100) (aria-valuemax . 100) (style . `(,pack width: ,width %)) ) (span sr-only `(,pack ,width % Nominal)) ) ) ) What is the idiomatic way to manipulate text such that I can dynamically generate different types of progress bars? The idea being that I could use different color coded static progress bars as a simple form of charting data. Thank you.
Re: Altering web app framework look via a css framework
Thanks Alex this is exactly what I needed. This language is truly the most capable and integrated I've found. Bravo a million times over. -David On Mon, Feb 17, 2014 at 2:19 AM, Alexander Burger a...@software-lab.dewrote: On Sun, Feb 16, 2014 at 01:51:18PM -0500, me wrote: Are there any pro tips for how could I go about adding/altering css styling via a css framework like bootstrap for example? Including the necessary files is no problem Right. Let me explain, just for the records: You can pass either a single CSS file to the 'html' function (html 0 Project my.css NIL or a list of files (html 0 Project '(@lib.css my1.css my2.css) NIL In the latter case, definitions in later CSS files override the earlier ones, so my.css' can, for example, redefine things in @lib.css. Normally, you'll set a globel in your main pogram (setq *Css '(@lib.css my1.css my2.css)) and use that as in the individual pages (html 0 Project *Css NIL but I'm finding it difficult to specify CSS classes and such for gui components. Thank you in advance for your help. Most low-level HTML functions accept an style attribute argument, e.g.: (de div (Attr . Prg) # In @lib/xhtml.l You call it like (div NIL (p NIL Text ) ) This 'Attr' argument may be 1. A single atom. Then it should be a CSS class name (div myCls1 (p myCls2 2. A cons pair, specifying an HTML attribute (div '(id . myId) or (div '(style . margin: 60px;) 3. an arbitrarily nested combination of the above (div '(myClass (style . margin: 60px;) ..) Finally (back to your original question ;-): If you have a 'gui' component like (gui '(+E/R +Cue +TextField) '(key : home obj) Test 20) then you can pass styles in a dynamical environment via 1. the style function (style myClass (gui '(+E/R +Cue +TextField) '(key : home obj) Test 20) ) or (style '(myClass (style . margin: 60px;) ..) ... (gui '(+E/R +Cue +TextField) '(key : home obj) Test 20) ... ) 2. via the +Style prefix class (gui '(+Style +E/R +Cue +TextField) myClass '(key : home obj) Test 20 ) ) Note that using '+Style' is the most powerful way, because the argument is evaluated whenever needed while the form is executing, so the style can change dynamically depending on the situation and the form contents: (gui '(+Style +E/R +Cue +TextField) '(cond ((someCondition1) myClass) ((someOtherCondition someOtherClass)) (T somethingElse) ) ... With that, the style will be adjusted upon arbitrary XMLHttpRequests from the @lib/form.js functionality. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Altering web app framework look via a css framework
Thanks Alex this is exactly what I needed. This language is truly the most capable and integrated I've found. Bravo a million times over. -David On Mon, Feb 17, 2014 at 2:19 AM, Alexander Burger a...@software-lab.dewrote: On Sun, Feb 16, 2014 at 01:51:18PM -0500, me wrote: Are there any pro tips for how could I go about adding/altering css styling via a css framework like bootstrap for example? Including the necessary files is no problem Right. Let me explain, just for the records: You can pass either a single CSS file to the 'html' function (html 0 Project my.css NIL or a list of files (html 0 Project '(@lib.css my1.css my2.css) NIL In the latter case, definitions in later CSS files override the earlier ones, so my.css' can, for example, redefine things in @lib.css. Normally, you'll set a globel in your main pogram (setq *Css '(@lib.css my1.css my2.css)) and use that as in the individual pages (html 0 Project *Css NIL but I'm finding it difficult to specify CSS classes and such for gui components. Thank you in advance for your help. Most low-level HTML functions accept an style attribute argument, e.g.: (de div (Attr . Prg) # In @lib/xhtml.l You call it like (div NIL (p NIL Text ) ) This 'Attr' argument may be 1. A single atom. Then it should be a CSS class name (div myCls1 (p myCls2 2. A cons pair, specifying an HTML attribute (div '(id . myId) or (div '(style . margin: 60px;) 3. an arbitrarily nested combination of the above (div '(myClass (style . margin: 60px;) ..) Finally (back to your original question ;-): If you have a 'gui' component like (gui '(+E/R +Cue +TextField) '(key : home obj) Test 20) then you can pass styles in a dynamical environment via 1. the style function (style myClass (gui '(+E/R +Cue +TextField) '(key : home obj) Test 20) ) or (style '(myClass (style . margin: 60px;) ..) ... (gui '(+E/R +Cue +TextField) '(key : home obj) Test 20) ... ) 2. via the +Style prefix class (gui '(+Style +E/R +Cue +TextField) myClass '(key : home obj) Test 20 ) ) Note that using '+Style' is the most powerful way, because the argument is evaluated whenever needed while the form is executing, so the style can change dynamically depending on the situation and the form contents: (gui '(+Style +E/R +Cue +TextField) '(cond ((someCondition1) myClass) ((someOtherCondition someOtherClass)) (T somethingElse) ) ... With that, the style will be adjusted upon arbitrary XMLHttpRequests from the @lib/form.js functionality. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Altering web app framework look via a css framework
Hello List, Are there any pro tips for how could I go about adding/altering css styling via a css framework like bootstrap for example? Including the necessary files is no problem but I'm finding it difficult to specify CSS classes and such for gui components. Thank you in advance for your help.
Re: Calculating age based on DOB
Thank you Alex. I cannot seem to find httpGate anywhere in the distribution 3.1.5. I know this is terribly noob-ish but where is httpGate located? On Mon, Jan 27, 2014 at 2:02 AM, Alexander Burger a...@software-lab.dewrote: Hi David, If I load the app by going to localhost:8080 I see the button and can click on it but nothing happens and the button becomes disabled. If I then refresh the page (it now has a long session string in the address bar) the button is enabled and I can click on it, the desired Alert dialog pops up working correctly. Indeed, this is a known problem. The reason lies with the same server orgigin policy of JavaScript's XMLHttpRequests. Because PicoLisp uses a separate HTTP port for each session, JavaScript (wrongly) believes this is a new server, and refuses to execute :( How can I get the button to work the first time without reloading the page? The right way to handle this is to run web applications in combination with 'httpGate'. The best way is to start (as user 'root') /usr/lib/picolisp/bin/httpGate 80 8080 and (if you like to use HTTPS) /usr/lib/picolisp/bin/httpGate 443 8080 path-to-PEM I have similar lines in my /etc/rc.local file. For a local installation, adjust the pathes to 'httpGate' accordingly. With httpGate you also have the advantage that you don't need to specify :8080 in the browser (and that you can use HTTPS, of course). ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Calculating age based on DOB
Correction, it's available when I install pico from my distribution but I'm then back on 3.1.2. How can I build the latest on x86-64 LMDE? On Mon, Jan 27, 2014 at 2:02 AM, Alexander Burger a...@software-lab.dewrote: Hi David, If I load the app by going to localhost:8080 I see the button and can click on it but nothing happens and the button becomes disabled. If I then refresh the page (it now has a long session string in the address bar) the button is enabled and I can click on it, the desired Alert dialog pops up working correctly. Indeed, this is a known problem. The reason lies with the same server orgigin policy of JavaScript's XMLHttpRequests. Because PicoLisp uses a separate HTTP port for each session, JavaScript (wrongly) believes this is a new server, and refuses to execute :( How can I get the button to work the first time without reloading the page? The right way to handle this is to run web applications in combination with 'httpGate'. The best way is to start (as user 'root') /usr/lib/picolisp/bin/httpGate 80 8080 and (if you like to use HTTPS) /usr/lib/picolisp/bin/httpGate 443 8080 path-to-PEM I have similar lines in my /etc/rc.local file. For a local installation, adjust the pathes to 'httpGate' accordingly. With httpGate you also have the advantage that you don't need to specify :8080 in the browser (and that you can use HTTPS, of course). ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Calculating age based on DOB
When I run make from src64 nothing happens. When I run make from src it compiles but no httpGate. Weird. I'll stick to packaged version for now as I may wind up testing it on PC-BSD 10 for fun. On Sun, Feb 2, 2014 at 1:27 PM, Alexander Burger a...@software-lab.dewrote: Hi David, Thank you Alex. I cannot seem to find httpGate anywhere in the distribution 3.1.5. I know this is terribly noob-ish but where is httpGate located? Not really your fault, because httpGate is not yet well documented. Only some fragments in this Mailing list and in the Wiki. The binary 'httpGate' is either in /usr/lib/picolisp/bin/httpGate (if you install the picolisp package with 'apt-get'), or in your bin/ directory (if you install it locally). The local executable is built if you make PicoLisp as described in the INSTALL file. Instead of /usr/lib/picolisp/bin/httpGate 80 8080 /usr/lib/picolisp/bin/httpGate 443 8080 path-to-PEM you call it as e.g. /path/to/picolisp/bin/httpGate 80 8080 /path/to/picolisp/bin/httpGate 443 8080 path-to-PEM As you see, no big thing. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Calculating age based on DOB
Thank you Mattias that's what I needed. On Sun, Feb 2, 2014 at 1:41 PM, Mattias Sundblad mattias@gmail.comwrote: Hi, I think you need to run 'make all' or 'make gate' to build httpGate along with the interpreter. That should create a binary and place it in the 'bin' directory of the distribution. best wishes, Mattias On 2 February 2014 18:16, me yanosh...@gmail.com wrote: Thank you Alex. I cannot seem to find httpGate anywhere in the distribution 3.1.5. I know this is terribly noob-ish but where is httpGate located? On Mon, Jan 27, 2014 at 2:02 AM, Alexander Burger a...@software-lab.dewrote: Hi David, If I load the app by going to localhost:8080 I see the button and can click on it but nothing happens and the button becomes disabled. If I then refresh the page (it now has a long session string in the address bar) the button is enabled and I can click on it, the desired Alert dialog pops up working correctly. Indeed, this is a known problem. The reason lies with the same server orgigin policy of JavaScript's XMLHttpRequests. Because PicoLisp uses a separate HTTP port for each session, JavaScript (wrongly) believes this is a new server, and refuses to execute :( How can I get the button to work the first time without reloading the page? The right way to handle this is to run web applications in combination with 'httpGate'. The best way is to start (as user 'root') /usr/lib/picolisp/bin/httpGate 80 8080 and (if you like to use HTTPS) /usr/lib/picolisp/bin/httpGate 443 8080 path-to-PEM I have similar lines in my /etc/rc.local file. For a local installation, adjust the pathes to 'httpGate' accordingly. With httpGate you also have the advantage that you don't need to specify :8080 in the browser (and that you can use HTTPS, of course). ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Calculating age based on DOB
Thanks Alex that worked perfectly! Now I can display age calculated on the fly without wasting space in the DB. This isn't related to calculating age based on DOB but if you could please help me understand why is it that when I have a form and a line like: (de testo () (app) (action (html 0 Test! @lib.css NIL (form NIL (gui '(+OnClick +Button) alert('OK') Alert) ... ) If I load the app by going to localhost:8080 I see the button and can click on it but nothing happens and the button becomes disabled. If I then refresh the page (it now has a long session string in the address bar) the button is enabled and I can click on it, the desired Alert dialog pops up working correctly. How can I get the button to work the first time without reloading the page? The reason I ask is because I'm trying to use a JS charting library and can include all the necessary files but the same thing happens with this button. I have to reload the page and then click the button which loads the chart. The chart then appears correctly in the div I made for it but then promptly disappears. I feel like this page reloading issue is related
Re: Calculating age based on DOB
Thank you for your prompt and helpful reply Alex. The *JS trick worked great and the proper date calculation will be most helpful. If I may ask a few more questions: You're right, storing the age is silly when already storing DOB. How might I just calculate age on the fly and display it in the following (gui ...) or similar? (grid 6 ... Birthdate (gui '(+E/R +DateField) '(dob : home obj) 10 *DOB) Age (gui ...) ...) Aditionally, how would I go about including a .css file to override certain bits of the built-in one? Thanks again for all the help, I'm taking the plunge and using PicoLisp for my second non-trivial application (first one is in Common Lisp) and absolutely thrilled about it so far. The learning curve is indeed steep but the control and expressiveness gained once a better command of the language is obtained is nothing short of breathtaking. Warm regards, David Bloom On Sun, Jan 19, 2014 at 1:12 PM, Alexander Burger a...@software-lab.dewrote: Hi David, Essentially I can calculate age based off of DOB with a (dm T ...) line 18 but then that record won't show in the search dialog. When lines 13-20 are You are quite close :) The problem is the way your 'T' method is defined: (dm T (name NAME prefname PREFNAME sex SEX dob DOB email EMAIL txt TXT) (=: name NAME) ... This is not how it works. You could either define it as (dm T (NAME PREFNAME SEX DOB EMAIL TXT) (=: name NAME) ... and then call 'new!' (which is implied in the 'newButton' function): (new! '(+Person) *Name *PrefName ...) OR (and this is how I would do it), use the fact that the 'new' and 'new!' functions, and also the 'T' method of the '+Entity' parent class, accepts arguments as alternating keys and values: (dm T (DOB . @) (pass super) # Pass remaining arguments to the parent class (=: age (/ (- (date) DOB) 365)) ) or, directly, (dm T (DOB . @) (pass super 'age (/ (- (date) DOB) 365)) ) and then call it as (new! '(+Person) DOB 'name *Name 'prefname *PrefName ...) or (newButton T Dst '(+Person) DOB 'name *Name 'prefname *PrefName ...) BTW, a year has more than 365 days. A somewhat more accurate calculation might be (*/ (- (date) DOB) 100 36525)) Besides the fact, of course, that storing the _age_ in the database doesn't make sense, It is soon out of date ;-) Also, what is the idomatic way to include an outside .js file in head.../head? The best is to push the file name into the global '*JS' variable before program start: (push1 '*JS (allow myFile.js)) Examples for that are in lib/form.l or lib/canvas.l. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe