Re: Internal WIKI Links do not work on WSL2 Debian

2022-01-18 Thread Thorsten Jolitz
Hi List,
today I figured out what seems to be the problem here:
Somehow the URLs are built with the computername instead of the port:
http://0.0.0.0:asuspn/?home

Replacing asuspn with 5000 all of these work, even from (say) Edge in
Win10, when pil wiki server was started on WSL2:

http://localhost:5000/?home
http://localhost:5000/?help
http://localhost:5000/?*Menu=+0&*Tab=+1&*ID=&*ID=$login

with the last one, I can actually login, get a session id, and can navigate
in the wiki and in my account.
Strange, the port looks ok in the server call, and on Archlinux the URLs
are ok too, but on WSL2 the servername instead of port is used to build the
URL.

$ pil wiki/main.l -main -go +
(server (or (format (sys "PORT")) *WikiPort) "!wiki")
! *WikiPort
-> 5000

Cheers
Thorsten

PS
I start the wiki the normal way
$ pil wiki/main.l -main -go +
*Socket
1877 = 40895 20654634285828729~
: *Socket
-> NIL
: 1877 * 2022-01-19 00:00:37 admin
1883 = 57451 41629218673747370~
:



Am Di., 28. Dez. 2021 um 23:42 Uhr schrieb Thorsten Jolitz <
tjol...@gmail.com>:

> Hi Alex,
> yes, *ID is NIL when I debug it (see PS1).
> I'm not sure how to debug (app), but all global vars except *PID seem to
> be NIL ...
>
> I think it's a WSL2 localhost problem, not a bug in PicoLisp.
> Not too long ago I tried accessing the pil wiki server running on WSL2
> from the Win10 Browser (say Edge), and that did not work at all.
> Now it seems they have fixed that ,what is very nice, but still not the
> same like pure Linux apparently.
>
> Checking localhost everything seems normal (see PS 2) , but e.g this
> article describes a lot of problems:
> Fixing WSL2 localhost access issue - abdus.dev
> 
>
> Cheers
> Thorsten
>
> PS 1
> $  pil wiki/main.l -main -go +
> (and (== 'login *ID) (app))
> ! *ID
> -> NIL
> ! (setq *ID 123456789)   # naive try
> -> 123456789
>
> # naiv try did not work
> Can't load -2.html?*Menu=+0&*Tab=+1&*ID=+123456789&*ID=$login
>
> PS 2
> $ ping -a localhost
> PING localhost (127.0.0.1) 56(84) bytes of data.
>
> # type c (peek current url) in W3M : wiki start page
> http://localhost:8080/
>
> # $ sudo cat /etc/hosts
> 127.0.0.1   localhost
> 127.0.1.1   xyz.localdomain  xyz
>
> Am Di., 28. Dez. 2021 um 20:44 Uhr schrieb Alexander Burger <
> a...@software-lab.de>:
>
>> Hi Thorsten, Olaf,
>>
>> > it's a session problem.
>> > Port 8080 does not help, but I cross checked on Archlinux, when I first
>> > click on the Login link, a session prefix is added to the internal
>> links,
>> > and after login, that session prefix is everywhere in the html source.
>> > But on WSL2 that does not work somehow
>>
>> This is indeed strange. This logic should not depend on the system.
>>
>> I think the session is started after clicking on "Log in" in
>>
>>(dm (html> . +Doc) ()
>>   (and (== 'login *ID) (app))
>>
>> So somehow this check fails? The *ID value is passed on the URL, perhaps
>> it is
>> destroyed somehow? The browser?
>>
>> ☺/ A!ex
>>
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>


Re: ideas for pilBox apps?

2022-01-18 Thread Alexander Burger
Hi Olaf,

nice ideas! :)

Hard to decide where to dive in. Perhaps we should discuss it a little more on
PilCon the day after tomorrow?

Speaking of PilCon: I wrote a little DES (Discrete-Event Simulation) library,
and would like to present and discuss it.

☺/ A!ex

On Tue, Jan 18, 2022 at 01:25:54PM +0100, O.Hamann wrote:
> Hi all,
> 
> during last PilCon Mia asked if there were any ideas for pilBox apps she
> could work in the blog post series.
> 
> For pilBox modified ToDo list app was the only thing that came into my
> mind at that early hour :-)
> (of course could be of really interest how to keep the data of both
> desktop and pilBox ToDos in sync without a centralized todo-data-server)
>And could be useful when expanded to a reusable shopping list (mark
> required items at home and check/disappear them when put into shopping cart)
> 
> 
> But what about a tiny quiz application to shorten waiting time at the
> bus station or elsewhere?
> 
> Such a pilBox App might (down)load different questions+answers sets and
> presents them as a little multiple choice game.
> 
> My silly example for first question ever of such a quiz:
> 
> "What are the 3 main base data types of picolisp?"
> a) uint8, uint16, uint32
> b) digits, chars, lists
> c) numbers, symbols, cons pairs (lists)
> d) cell, heap, garbage collection
> 
> :-)
> 
> A reduced first aim of that app could be the basic flashcard (german:
> Lernkarte) version (less programming and no need to find senseful
> alternate answers):
> 
> pilBox App shows question:
> "What are the 3 main base data types of picolisp?"
> Nothing else is shown.
> User mumbles "Easy: numbers, symbols, lists".
> Then taps on 'Show' button.
> "Numbers, Symbols, Cons Pairs (lists)" shows up.
> User strikes his arm "Yes!"
> Seatmate asks: "Interesting, what programming language are you talking
> about?"
> 
> :-)
> 
> 
> Greetings, Olaf
> 
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


ideas for pilBox apps?

2022-01-18 Thread O.Hamann
Hi all,

during last PilCon Mia asked if there were any ideas for pilBox apps she
could work in the blog post series.

For pilBox modified ToDo list app was the only thing that came into my
mind at that early hour :-)
(of course could be of really interest how to keep the data of both
desktop and pilBox ToDos in sync without a centralized todo-data-server)
   And could be useful when expanded to a reusable shopping list (mark
required items at home and check/disappear them when put into shopping cart)


But what about a tiny quiz application to shorten waiting time at the
bus station or elsewhere?

Such a pilBox App might (down)load different questions+answers sets and
presents them as a little multiple choice game.

My silly example for first question ever of such a quiz:

"What are the 3 main base data types of picolisp?"
a) uint8, uint16, uint32
b) digits, chars, lists
c) numbers, symbols, cons pairs (lists)
d) cell, heap, garbage collection

:-)

A reduced first aim of that app could be the basic flashcard (german:
Lernkarte) version (less programming and no need to find senseful
alternate answers):

pilBox App shows question:
"What are the 3 main base data types of picolisp?"
Nothing else is shown.
User mumbles "Easy: numbers, symbols, lists".
Then taps on 'Show' button.
"Numbers, Symbols, Cons Pairs (lists)" shows up.
User strikes his arm "Yes!"
Seatmate asks: "Interesting, what programming language are you talking
about?"

:-)


Greetings, Olaf


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe