Re: PicoLisp GUI on Smartphones
Hi Alex, On 14. Mar, 2014, at 11:23, Alexander Burger wrote: On Wed, Dec 25, 2013 at 01:35:38PM +0100, Alexander Burger wrote: Hi Jon, thanks for the input! ... When I tap/click on a menu and the menu drops down, I would like the menu to go away if I tap/click outside the menu, on neutral ground. This is difficult, if not impossible. The menu is implemented as anchor elements in an unordered list. Clicking outside it doesn't generate an event. Perhaps it could be solved with some JavaScript trick, but this would break the fundamental rule that the GUI should also work in an environment without JavaScript (e.g. on text browsers). Atually, this is not a problem. A JS add-on implementing this doesn't harm any other functionality. That's my view also. So I went ahead and build a handler (triggered by a new function 'bar?' in @lib/xhtml.l), which closes the menu upon a tap/click in the main window area. ♪♫ Alex I just tried it here http://phone.picolisp.com, and it works. Great! /Jon �M5�=�/8�A@��D�qu~�^fj)n��� ��z{Sʗ�{�٥r���
Re: PicoLisp GUI on Smartphones
On Wed, Dec 25, 2013 at 01:35:38PM +0100, Alexander Burger wrote: Hi Jon, thanks for the input! ... When I tap/click on a menu and the menu drops down, I would like the menu to go away if I tap/click outside the menu, on neutral ground. This is difficult, if not impossible. The menu is implemented as anchor elements in an unordered list. Clicking outside it doesn't generate an event. Perhaps it could be solved with some JavaScript trick, but this would break the fundamental rule that the GUI should also work in an environment without JavaScript (e.g. on text browsers). Atually, this is not a problem. A JS add-on implementing this doesn't harm any other functionality. So I went ahead and build a handler (triggered by a new function 'bar?' in @lib/xhtml.l), which closes the menu upon a tap/click in the main window area. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Alex, and the load distributed across multiple servers. How so? Currently PicoLisp forks on the same sever. Are you using remote queries to other PicoLisp instances? A proxy to parse routes? re: https://www.mail-archive.com/picolisp@software-lab.de/msg00097.html; For production. At the moment the project is still in prototype stage. How does fries.js GET and POST to PicoLisp? JSON converted to PicoLisp objects? re: http://www.prodevtips.com/2008/09/11/pico-lisp-and-json/; (:Thanks Henrik) Thanks, -rl On Tue, Jan 7, 2014 at 1:52 AM, Alexander Burger a...@software-lab.dewrote: Hi Rick, It seems to me that the easiest way to overcome server volume(1) limitations (http://www.kegel.com/c10k.html;), is by executing a much as possible on the client. See also: http://www.generalinterface.org/;. It all depends on the application. But, in my experience, the relative load on the server is quite low in the current PicoLisp architecture. Some things _have_ to be done on the server anyway, like validations and synchronizations, so you can't put much on the client alone. Also, the client does the most work anyway. The bottleneck is rendering the layout in the browser, not the virtual representation of the GUI components on the server. You can see that easily with 'top', if you run both the client and server on a single machine. And with tens of thousands of clients (doing heavy database work, not just static pages) the situation needs to be analyzed carefully, and the load distributed across multiple servers. Alex, thanks for pointing me to: http://getfri.es/; and https://github.com/jaunesarmiento/fries;. Do you use this for testing; or, for production? For production. At the moment the project is still in prototype stage. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Hi Rick, and the load distributed across multiple servers. How so? Currently PicoLisp forks on the same sever. Are you using remote queries to other PicoLisp instances? A proxy to parse routes? Sure, kind of. See e.g. http://software-lab.de/doc/refR.html#remote/2 You can easily fork to other servers, but then you must do explicit RPC (as opposed to the built-in one that you get with (fork)). Excerpts from a distributed shop system (without striving for completeness, just to get an idea): (class +Shop +Entity) (rel id (+Need +Key +Number)) # Client-ID (rel ip (+String)) # Host-IP (rel dom (+String)) # Domain (rel cat (+List +Ref +String)) # Categories (rel nm (+IdxFold +String)) # Name ... (dm pid () (when (: ip) (cdr (assoc (: id) (shops @))) ) ) (dm start () (call ssh (: ip) (pack cd (pwd) ; ./pil myApp/shop/main.l (: id) (sym (: nm)) lib/app.l -main -go -wait log/ (+ 3000 (: id)) 21 ) ) ) (dm stop () (when (pid This) (call ssh (: ip) (pack kill @)) ) ) (dm sock () (if (asoq This *ShopSocks) (cdar (rot *ShopSocks (index @ *ShopSocks))) (let? S (connect (: ip) (+ 4000 (: id))) (push '*ShopSocks (cons This S)) (let? L (nth *ShopSocks 4) (when (cdr L) (close (cdar @)) (con L) ) ) S ) ) ) (dm rsrc () (let? @Sock (connect (: ip) (+ 4000 (: id))) (let? L (nth *RsrcSocks 3) (when (cdr L) (close (car @)) (con L) ) ) (push '*RsrcSocks @Sock) (let @Ext (+ `*DbsMax (* `*RemoteDbsMax (: id))) (cons (curry (@Ext @Sock) (X) # out (ext @Ext (out @Sock (pr X)) ) ) (curry (@Ext @Sock) () # in (when (index @Sock *RsrcSocks) (rot *RsrcSocks @) (ext @Ext (or (in @Sock (rd)) (nil (close @Sock) (pop '*RsrcSocks)) ) ) ) ) ) ) ) ) (dm query @ (let? Sock (sock This) (ext (+ `*DbsMax (* `*RemoteDbsMax (: id))) (out Sock (pr (rest))) (rdShop Sock) ) ) ) ... # Article (class +Art +Entity) (rel shop (+Hook +Aux +Ref +Link) # Shop (id) NIL (+Shop) ) (rel id (+Ref +Number)) # ID (rel nm (+Hook2 +IdxFold +String) 3 shop) # Name (rel grp (+Hook2 +IdxFold +String) 3 shop) # Group (rel ts (+Hook2 +Ref +Bag) # Timestamp shop ((+Date)) ((+Time)) ) (rel pr (+Ref +Number) NIL 2) # Price (rel rp (+Ref +Number) shop 2) # Regular price ... (dm get @ (and (query (: shop) 'id '(db: +Art) (: id)) (pass get @) ) ) ... (de remoteShopSearch (Lst) (list '@Rsrc '(cons (rsrc *DirectShop)) '@Cat *CatSearch '@Grp *GrpSearch '@Lim (and *PrLimit (lit (cons NIL @))) (list 'remote '(@A . @Rsrc) (cons 'select '(@A) (conc (mapcar '((W) (list 'nm '+Art W)) Lst ) (quote (cat +Grp @Cat (grp +Art)) (key +Grp @Grp (grp +Art)) (pr +Art @Lim) ) ) (conc (mapcar '((W) (list 'part W '@A 'nm)) Lst ) (quote (same @Cat @A grp cat) (same @Grp @A grp key) (range @Lim @A pr) ) ) ) ) '(@@ aux 'shop '+Art *DirectShop (id (- @A))) ) ) ... # Find remote shop processes (off Shops) (de shops (IP) (cdr (or (assoc IP Shops) (push 'Shops (cons IP (in (list ssh IP ps --no-headers -o pid,cmd $(pgrep -f myApp/shop/main.l) ) (make (while (read) (let Pid @ (skip) (when (= ./bin/picolisp (till T)) (from main.l ) (link (cons (read) Pid)) ) (line T) ) ) ) ) ) ) ) ) ) (de shops- (IP) (setq Shops (delete (assoc IP Shops) Shops)) ) # RPC Commands (de updArt (Shop Id . Args) (when (db 'id '+Shop Shop) (dbSync) (with (or (aux 'shop '+Art @ Id) (new (db: +Art)
Re: PicoLisp GUI on Smartphones
Thanks Henrik and Alex, This came in my email this morning: http://us5.campaign-archive1.com/?u=502910cc28cb186a9e829f748id=a8605b778ae=9d2ada32e2 It seems to me that the easiest way to overcome server volume(1) limitations (http://www.kegel.com/c10k.html;), is by executing a much as possible on the client. See also: http://www.generalinterface.org/;. (Disclosure: my at work architecture is Oracle/Microsoft SQL Server and net. Sometimes General Interface is the UI.) I will create, and share, some (HTML5 and/or General Interface and/or TiddlyWiki)+PicoLisp examples; hopefully soon.(2) Alex, thanks for pointing me to: http://getfri.es/; and https://github.com/jaunesarmiento/fries;. Do you use this for testing; or, for production? Thanks, -rl (1) Not that I have this problem (no volume, ha ha). (2) A non PicoLisp experiment: http://ricklyman.net/gi4.html On Mon, Jan 6, 2014 at 2:19 AM, Alexander Burger a...@software-lab.dewrote: Hi Rick, a Happy New Year to you too! And to everybody else, of course! :) And thanks for the feedback and links. I have mixed feelings about: this would break the fundamental rule that the GUI should also work in an environment without JavaScript It seems contrary to what most companies are pursuing, e.g.: http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story; Sure, that's true. And in fact we are currently also using Phonegap and fries.js in the same project. Still it is an important feature for me if an application works _also_ without JavaScript and cookies, running in plain text browsers or scrape-script-driven, without any limits to handicapped persons (screen readers) or in otherwise restricted environments. Another gain is performance because of the lightweight. Under Windows I have used nodeJS so that localhost can query PicoLisp, in a psuedo RESTful manner (i.e., no app session...) Yes, and you can use PicoLisp in that way also in the standard setup. I do this for simple static pages. But I strongly disagree in non-trivial cases. The session-oriented protocol of a PicoLisp app is a must for me. A stateless paradigm like REST (keeping the state in the client instead of the server) would IMHO be by far inferior for the kind of applications I'm dealing with. As a matter of principle some state must be hold in the database on the server, and therefore also most decisions concerning the flow, so delegating some part of the state to the client gives a very unmodular program structure. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
http://www.engadget.com/2014/01/06/firefox-os-tablet-developer-program/ http://www.engadget.com/2014/01/06/panasonic-firefox-os-deal/ On Mon, Jan 6, 2014 at 10:15 AM, Rick Lyman lyman.r...@gmail.com wrote: Thanks Henrik and Alex, This came in my email this morning: http://us5.campaign-archive1.com/?u=502910cc28cb186a9e829f748id=a8605b778ae=9d2ada32e2 It seems to me that the easiest way to overcome server volume(1) limitations (http://www.kegel.com/c10k.html;), is by executing a much as possible on the client. See also: http://www.generalinterface.org/;. (Disclosure: my at work architecture is Oracle/Microsoft SQL Server and .net. Sometimes General Interface is the UI.) I will create, and share, some (HTML5 and/or General Interface and/or TiddlyWiki)+PicoLisp examples; hopefully soon.(2) Alex, thanks for pointing me to: http://getfri.es/; and https://github.com/jaunesarmiento/fries;. Do you use this for testing; or, for production? Thanks, -rl (1) Not that I have this problem (no volume, ha ha). (2) A non PicoLisp experiment: http://ricklyman.net/gi4.html On Mon, Jan 6, 2014 at 2:19 AM, Alexander Burger a...@software-lab.dewrote: Hi Rick, a Happy New Year to you too! And to everybody else, of course! :) And thanks for the feedback and links. I have mixed feelings about: this would break the fundamental rule that the GUI should also work in an environment without JavaScript It seems contrary to what most companies are pursuing, e.g.: http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story; Sure, that's true. And in fact we are currently also using Phonegap and fries.js in the same project. Still it is an important feature for me if an application works _also_ without JavaScript and cookies, running in plain text browsers or scrape-script-driven, without any limits to handicapped persons (screen readers) or in otherwise restricted environments. Another gain is performance because of the lightweight. Under Windows I have used nodeJS so that localhost can query PicoLisp, in a psuedo RESTful manner (i.e., no app session...) Yes, and you can use PicoLisp in that way also in the standard setup. I do this for simple static pages. But I strongly disagree in non-trivial cases. The session-oriented protocol of a PicoLisp app is a must for me. A stateless paradigm like REST (keeping the state in the client instead of the server) would IMHO be by far inferior for the kind of applications I'm dealing with. As a matter of principle some state must be hold in the database on the server, and therefore also most decisions concerning the flow, so delegating some part of the state to the client gives a very unmodular program structure. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Hi Rick, It seems to me that the easiest way to overcome server volume(1) limitations (http://www.kegel.com/c10k.html;), is by executing a much as possible on the client. See also: http://www.generalinterface.org/;. It all depends on the application. But, in my experience, the relative load on the server is quite low in the current PicoLisp architecture. Some things _have_ to be done on the server anyway, like validations and synchronizations, so you can't put much on the client alone. Also, the client does the most work anyway. The bottleneck is rendering the layout in the browser, not the virtual representation of the GUI components on the server. You can see that easily with 'top', if you run both the client and server on a single machine. And with tens of thousands of clients (doing heavy database work, not just static pages) the situation needs to be analyzed carefully, and the load distributed across multiple servers. Alex, thanks for pointing me to: http://getfri.es/; and https://github.com/jaunesarmiento/fries;. Do you use this for testing; or, for production? For production. At the moment the project is still in prototype stage. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Alex, I trust that you had a merry Christmas and a Happy New Year... Supporting phones is a very good idea: http://www.digitaltrends.com/mobile/mobile-phone-world-population-2014/; The article mentions: Of the 6 billion cell phones in use, only around 1.1 billion of them are mobile-broadband devices. I wonder what market size Mozilla is expecting for Firefox OS. Prior to you mentioning: http://www.w3.org/2009/dap/;; I had not thought of the browser supporting some of the same features as Firefox OS. I have mixed feelings about: this would break the fundamental rule that the GUI should also work in an environment without JavaScript It seems contrary to what most companies are pursuing, e.g.: http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story; Anyway, have you looked at: https://github.com/kripken/emscripten/wiki; and http://asmjs.org/faq.html;? I suppose that PicoLisp could run in the browser; and, act as an offline cache for the server, etc Some of the same code could also be used in nodeJS; for OS interop, etc... Under Windows I have used nodeJS so that localhost can query PicoLisp, in a psuedo RESTful manner (i.e., no app session...) Thanks, -rl On Wed, Dec 25, 2013 at 7:35 AM, Alexander Burger a...@software-lab.dewrote: Hi Jon, thanks for the input! Numerical input elements can/should be given pattern attributes that trigger the numerical keypad on iPhones/iPads, like this: input pattern=[0-9]* type=text value=55667788 / As far as I know, this pattern makes no difference on Android. ;-) This could be easily done using the 'style' function or the '+Style' prefix class, e.g. by replacing the field definition (gui '(+Var +NumField) '*DemoNum 10) with (style '(pattern . [0-9]*) (gui '(+Var +NumField) '*DemoNum 10) ) or with (gui '(+Style +Var +NumField) '(cons 'pattern [0-9]*) '*DemoNum 10 ) For the '+FixField' the pattern should probably extended for the decimal point, and a '-' for negative numbers might also be necessary. Note that 'style' could be used for a whole bunch of fields (style '(pattern . [0-9]*) (gui '(+NumField) 10) ... (gui '(+NumField) 10) ... ) When I tap/click on a menu and the menu drops down, I would like the menu to go away if I tap/click outside the menu, on neutral ground. This is difficult, if not impossible. The menu is implemented as anchor elements in an unordered list. Clicking outside it doesn't generate an event. Perhaps it could be solved with some JavaScript trick, but this would break the fundamental rule that the GUI should also work in an environment without JavaScript (e.g. on text browsers). ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Hi Rick, a Happy New Year to you too! And to everybody else, of course! :) And thanks for the feedback and links. I have mixed feelings about: this would break the fundamental rule that the GUI should also work in an environment without JavaScript It seems contrary to what most companies are pursuing, e.g.: http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story; Sure, that's true. And in fact we are currently also using Phonegap and fries.js in the same project. Still it is an important feature for me if an application works _also_ without JavaScript and cookies, running in plain text browsers or scrape-script-driven, without any limits to handicapped persons (screen readers) or in otherwise restricted environments. Another gain is performance because of the lightweight. Under Windows I have used nodeJS so that localhost can query PicoLisp, in a psuedo RESTful manner (i.e., no app session...) Yes, and you can use PicoLisp in that way also in the standard setup. I do this for simple static pages. But I strongly disagree in non-trivial cases. The session-oriented protocol of a PicoLisp app is a must for me. A stateless paradigm like REST (keeping the state in the client instead of the server) would IMHO be by far inferior for the kind of applications I'm dealing with. As a matter of principle some state must be hold in the database on the server, and therefore also most decisions concerning the flow, so delegating some part of the state to the client gives a very unmodular program structure. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Hi Alex, After a quick test of the demo app, I suggest two improvements. Numerical input elements can/should be given pattern attributes that trigger the numerical keypad on iPhones/iPads, like this: input pattern=[0-9]* type=text value=55667788 / As far as I know, this pattern makes no difference on Android. ;-) When I tap/click on a menu and the menu drops down, I would like the menu to go away if I tap/click outside the menu, on neutral ground. /Jon Hi all, it is quite straightforward to use the standard PicoLisp GUI on smartphones, basically by including a CSS file and new bar menu function. More about this on http://picolisp.com/5000/!wiki?PhoneGUI The article presents a simple demo, and describes how to access it. A merry Christmas and a Happy New Year to everyone! ?? Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Hi Jon, thanks for the input! Numerical input elements can/should be given pattern attributes that trigger the numerical keypad on iPhones/iPads, like this: input pattern=[0-9]* type=text value=55667788 / As far as I know, this pattern makes no difference on Android. ;-) This could be easily done using the 'style' function or the '+Style' prefix class, e.g. by replacing the field definition (gui '(+Var +NumField) '*DemoNum 10) with (style '(pattern . [0-9]*) (gui '(+Var +NumField) '*DemoNum 10) ) or with (gui '(+Style +Var +NumField) '(cons 'pattern [0-9]*) '*DemoNum 10 ) For the '+FixField' the pattern should probably extended for the decimal point, and a '-' for negative numbers might also be necessary. Note that 'style' could be used for a whole bunch of fields (style '(pattern . [0-9]*) (gui '(+NumField) 10) ... (gui '(+NumField) 10) ... ) When I tap/click on a menu and the menu drops down, I would like the menu to go away if I tap/click outside the menu, on neutral ground. This is difficult, if not impossible. The menu is implemented as anchor elements in an unordered list. Clicking outside it doesn't generate an event. Perhaps it could be solved with some JavaScript trick, but this would break the fundamental rule that the GUI should also work in an environment without JavaScript (e.g. on text browsers). ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
PicoLisp GUI on Smartphones
Hi all, it is quite straightforward to use the standard PicoLisp GUI on smartphones, basically by including a CSS file and new bar menu function. More about this on http://picolisp.com/5000/!wiki?PhoneGUI The article presents a simple demo, and describes how to access it. A merry Christmas and a Happy New Year to everyone! ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
re: HTML5 What future features are being worked on? Thanks Alex, -rl On Mon, Dec 23, 2013 at 10:18 AM, Alexander Burger a...@software-lab.dewrote: Hi all, it is quite straightforward to use the standard PicoLisp GUI on smartphones, basically by including a CSS file and new bar menu function. More about this on http://picolisp.com/5000/!wiki?PhoneGUI The article presents a simple demo, and describes how to access it. A merry Christmas and a Happy New Year to everyone! ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: PicoLisp GUI on Smartphones
Hi Rick, re: HTML5 What future features are being worked on? In the long range, I assume that the hardware of mobile devices will be fully supported (see e.g. Firefox OS). Currently, the geolocation API works fine. Also device orientation, camera access, touch events, vibration and so on. For ideas, look at http://www.w3.org/2009/dap/ ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe