ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
rob_w has quit [Read error: Connection reset by peer]
karswell has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
_whitelogger has joined #picolisp
rob_w has joined #picolisp
alexshendi_ has quit [Ping timeout: 240 seconds]
freeemint_ has joined #picolisp
karswell_ has joined #picolisp
karswell has quit [Ping timeout: 240 seconds]
<freeemint_> He is there a better way to do a "weigthed joint" (a joint which has an attribute associated with relation) than introducing a new class with two +Joints and the weights?
<Regenaxer> What is "attribute associated with relation"?
<Regenaxer> You mean a +Bag?
<Regenaxer> A +Joint is always between objects
<cess11_> Besides '+Bag, '+UB and '+Aux might be useful.
<freeemint_> yeah i wanted a bag
<Regenaxer> There is perhaps a problem with a +Joint as bag element
<Regenaxer> iirc the relation cannot be automatically maintained in some cases
<freeemint_> which are those cases?
<Regenaxer> not sure. There is not enough info to create the opposite bag if a joint is added
<Regenaxer> What model do you have in mind?
<Regenaxer> You can try anyway, I'm not sure atm
<freeemint_> +ClassA has an +Number of +ClassB and +ClassB is refered by +ClassA
<Regenaxer> So this is just (+List +Joint) <-> (+Joint) ?
<freeemint_> No
<freeemint_> +ClassA has +Number of +ClassB like A1 has 3 B1 and has 4 B2 and 5B5
<cess11_> What does your 'rel expressions look like?
<Regenaxer> You can try with a bag, just not expect such a bag to be built implicitly on the opposing side, because then the count is not known
<freeemint_> Is is it safe if B asks A to add B to his joint? (B being without bag and A with bag)
<Regenaxer> Or, go with +Link:
<Regenaxer> (rel rab (+List +Bag) # Rabatte
<Regenaxer> ((+Link) (+Wg)) # Warengruppe
<Regenaxer> ((+Number) 2) ) # Rabatt % netto
<Regenaxer>
<Regenaxer> (rel fib (+List +Bag) # Fibu-Zuordnungen
<Regenaxer> ((+Link) (+Fk)) # Fibukonto Wareneinkauf
<Regenaxer> ((+Number) 2) # Netto-Warenwert
<Regenaxer> ((+Link) (+USt)) # Steuer
<Regenaxer> ((+Number) 2) ) # Steuerbetrag
<Regenaxer> You can also use (+Ref +Link) which is equivalent to a +Joint
<freeemint_> How is that equivalent?
<Regenaxer> Just play around!
<Regenaxer> It is
<Regenaxer> I use +List +Joint for small amounts (< 100)
<Regenaxer> A +Ref +Link is like a +Joint, bi-directional, right?
<Regenaxer> Just a little slower, but can handle more data
<Regenaxer> eg. an +Article would have a (+Ref +Link) to the supplier
<Regenaxer> you find all articles of that supplier via the index
<Regenaxer> A +List +Joint in the supplier would be huge
<cess11_> 'bench works fine for measuring performance in the DB-context too, one can set up a couple of alternative schemas or relation types and test some more or less common action patterns.
<freeemint_> Is the problem the total space or that the complete +Joint has to be loaded if it is processed?
<Regenaxer> yes
<freeemint_> *it the object
<Regenaxer> The supplier may have one million articles
<Regenaxer> the supplier object would be *huge*
<freeemint_> ah ...
<Regenaxer> Each access to that supplier needs to load it into memory
<freeemint_> I thought so
<Regenaxer> This applies to all +List relations, not just +Joints
<Regenaxer> Though you can keep it out of the object with +Swap
<freeemint_> When you put it into an index you only have to load it up when you search in it
<Regenaxer> I do that with some long lists or strings
<Regenaxer> eg. the hashed password
<Regenaxer> exactly
<Regenaxer> and then only a part of the index tree is accessed
<Regenaxer> branch
<freeemint_> also log(n) vs O(N)
<Regenaxer> yes
<cess11_> A good way to get acquainted with these things and the basic pilog is to grab some open data CSV that looks fun and parse it into fairly simple objects and work on those.
<Regenaxer> T
<freeemint_> how does +Hook behave?
<Regenaxer> It is a DB root
<Regenaxer> base of indexes
<freeemint_> Is it loaded it to ram with the object
<Regenaxer> Default is NIL which means the *DB object
<Regenaxer> It is loaded when such an index is accessed
<freeemint_> how is it size. is the whole db loaded or just the relvant branches?
<freeemint_> *sub db
<Regenaxer> The whole db is never loaded
<Regenaxer> I was talking of the *DB symbol
<Regenaxer> which is {1}
<Regenaxer> it points to the roots of the indexes
<Regenaxer> and a hook specifies another database root
<Regenaxer> a sub-db
<freeemint_> ok (rel supplier (+Ref +Link vs (rel supplier(+Hool +Link)
<Regenaxer> You may have local unique indexes there
<Regenaxer> no
<Regenaxer> The +Hook is additional
<freeemint_> But that is the doc example
<freeemint_> (rel sup (+Hook +Link) (+Sup))
<Regenaxer> yes
<freeemint_> why no then?
<Regenaxer> So the value of 'sup' is a hook for other relations
<Regenaxer> (+Ref +Link vs (rel supplier(+Hool +Link)
<Regenaxer> +Ref is not "versus" +Hook
<Regenaxer> you may have both
<Regenaxer> (rel pro (+Hook +Dep +Ref +Link) # Project
<Regenaxer> (nm seq mod)
<Regenaxer> NIL (+Pro) )
<Regenaxer> (rel seq (+Ref +List +Number) pro) # BOQ Sequence (1 2 3)
<Regenaxer> So the 'seq' index "hangs" on the 'pro' object
<Regenaxer> the sequence is private to that project
<Regenaxer> then it continues like that:
<Regenaxer> (rel nm (+IdxFold +String) 3 pro) # Description
<Regenaxer> (rel mod (+List +Joint) boq (+mod)) # Modules
<Regenaxer> So 'nm' is also in a private index
<freeemint_> i do not get that yet
<Regenaxer> no problem, then you don't need hooks yet
<Regenaxer> Just keep all in the global root *DB object
<freeemint_> maybe i need that still ... i will think a bit
<Regenaxer> good
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
<freeemint_> (class +Thing +Entity)
<freeemint_> (rel name (+Idx +String))
<freeemint_> (rel store (+List +Num))
<freeemint_> (rel store2 (+Swap +List +Num))
<freeemint_> (dm T (Name Store Swap) (:= name Name) (:= store Store) (:= store2 Swap))
<Regenaxer> +Num -> +Number
<freeemint_> ahh
<freeemint_> Is there a way to disable printing numbers and long list (complettly) in console
<Regenaxer> (less Lst) ?
<Regenaxer> Does not disable anything though
<Regenaxer> but I use it if I expect long output
<Regenaxer> (more (foo) less)
<Regenaxer> nonsense the last one
<Regenaxer> (less (foo))
<Regenaxer> Has anyone used Server-Sent events?
<Regenaxer> I don't get the 'onmessage' event
<freeemint_> afk
<cess11_> freeemint_: Yes, write your own functions where you have them return something useful rather than just pass on their data to stdout.
<cess11_> I often use expressions like '(length (setq *Stuffs (make (in Source ... ] or similar.
<cess11_> For example you could set up a class that keeps the long list in a field and then use a method that only shows a part of it.
<cess11_> It depends on the situation what fits, sometimes 'let or closure-like use of local variables is enough, sometimes one wants persistence, and so on.
alexshendi_ has joined #picolisp
<Regenaxer> As I said, I'm trying to utilize Server-Sent Events. It works, but only *once*
<Regenaxer> Anybody here?
<Regenaxer> I'm not sure about the message format. Found PHP examples, but I don't know PHP
<Regenaxer> What exactly does header() do? Does it send the header line immediately to the client, or is it put into the output buffer and sent *every* time in the loop?
<Regenaxer> e.g.:
<Regenaxer> header('Cache-Control: no-cache');
<Regenaxer> header("Content-Type: text/event-stream\n\n");
<Regenaxer> while (1) {
<Regenaxer> ob_end_flush();
<Regenaxer> echo "\n\n";
<Regenaxer> echo "event: ping\n";
<Regenaxer> flush();
<Regenaxer> sleep(1);
<Regenaxer> }
<Regenaxer> In my analog pil code I get only the first message throug
<Regenaxer> So my question is: Are the header lines sent each time in the loop, or only the first time?
<Regenaxer> Are they kept in the buffer, and sent by ob_end_flush()? Or only once, immediately when header() is called?
<Regenaxer> afp, bbl
<cess11_> Not sure, never done much with those myself.
inara` has joined #picolisp
inara has quit [Ping timeout: 264 seconds]
<Regenaxer> ret
<Regenaxer> Hmm, I do have
<Regenaxer> (httpHead "text/event-stream" 0)
<Regenaxer> (ht:Out *Chunked
<Regenaxer> (prinl "data: " @ "\r\n\r") ) ) )
<Regenaxer> So the 'data' is there
<Regenaxer> But this is in a loop, and does it only once
<Regenaxer> Perhaps the JS handler needs a return value?
<Regenaxer> My primary question was whether I need
<Regenaxer> (while (line T)
<Regenaxer> (httpHead "text/event-stream" 0)
<Regenaxer> (ht:Out *Chunked
<Regenaxer> (prinl "data: " @ "\r\n\r") )
<Regenaxer> or whether this is enough:
<Regenaxer> (httpHead "text/event-stream" 0)
<Regenaxer> (while (line T)
<Regenaxer> (ht:Out *Chunked
<Regenaxer> (prinl "data: " @ "\r\n\r") )
<Regenaxer> ie. send the header only once, since this is a permanent connection
<Regenaxer> Anyway, I tried both and get the same result (only 1 event)
<freeemint_> i got (class +SwapTest +Entity) (rel name (+Idx +String)) I can find it with (show '{3}) and it has name "veryfast" (i commited correctly) but not via (select +SwapTest name "veryfast")
<freeemint_> (also (select +SwapTest) is doing nothing
<Regenaxer> Does (scan '(name . +SwapTest)) dump a correct tree?
<freeemint_> no it is nil too
<freeemint_> using latest tarball with (== 64 64)
<Regenaxer> So you did not commit correctly
<Regenaxer> (new! '(+SwapTest) 'name "foo")
<Regenaxer> or
<freeemint_> I did (new T
<Regenaxer> (put!> '{3} 'name ...
<Regenaxer> ok, and then (commit) ?
<freeemint_> now it works
<Regenaxer> ok
<freeemint_> beforehand i did write my own contructor
<freeemint_> could that cause trouble?
<Regenaxer> perhaps
<Regenaxer> you can always cause trouble ;)
<freeemint_> it also has (rel fast (+Swap +List +Number)) when i now do (new! '(+SwapTest) 'name "foo" 'fast (1 2 3)) is fails commeting has> --Bad Extra
<freeemint_> pass it a list instead?
<freeemint_> or in other words let me rtfm first
<Regenaxer> hmm, "Bad Extra" refers to a prefix class
<Regenaxer> try to find where exactly it went wrong
<Regenaxer> look at the env in the error breakpoint
<Regenaxer> or do (bt)
<freeemint_> in extra X is NIL
<Regenaxer> Which method is being executed?
<freeemint_> extra
<Regenaxer> no
<Regenaxer> extra is the function
<Regenaxer> it tries to go to the same method in the extra class
<Regenaxer> so we need the class and the method
<freeemint_> Maybe i am just doing it wrong
<Regenaxer> "Bad Extra" means that there is no extra
<Regenaxer> yep
<Regenaxer> The method is not found in the hierarchy
<Regenaxer> afp
<freeemint_> If i had a +DBEntity with N slots how i fill them?
<freeemint_> ok
<freeemint_> quoting helps
judi has joined #picolisp
<judi> Hello
<judi> I don't understand why there is a Prolog in PicoLisp?
<freeemint_> Regenaxer , the sole creator of Picolisp found it helpfull in his daily work
<freeemint_> judi what puzzles you?
<judi> why we need another language in PicoLisp system beside Lisp
<freeemint_> Very simply, prolog allows you to write down some search task based predefined rules very simply and direct
<tankf33der> judi: is it the only problem you have around picolisp? :)
<judi> @tankf33der, I'm touching the surface now
<tankf33der> ok
<judi> asking about the surface of the iceberg, but no yet the beneath of the iceberg
<freeemint_> judi: Do you want an example what you can do easily with prolog?
<judi> I'd love to
<freeemint_> Do you know Einsteins Puzzle with the houses and cigaretts?
<judi> no
<freeemint_> https://baptiste-wicht.com/posts/2010/09/solve-einsteins-riddle-using-prolog.html Try to read the puzzle and think how you would solve it in Lisp (or any language really)
<freeemint_> then look at the prolog solution.
<freeemint_> Prolog just works on assumptions and rules and derives knowledge from these.
<freeemint_> Writing and explizit algorithm like this is very tiresome.
<freeemint_> If you are just able to state the domain knowledge things get easier.
<freeemint_> (this code is normal prolog)
<judi> didn't understood all of the article, but seems specially interesting. I should read it again
<freeemint_> the picolisp solution is here https://rosettacode.org/wiki/Zebra_puzzle#PicoLisp
<freeemint_> (other animals but same problem)
<judi> cant we just use SQL and database?
<freeemint_> SQL can store things but not derive things
<freeemint_> you know dog(woof). dog(mark). likes(woof,meat). If you ask prolog dog(X), likes(X,meat). prolog concludes that X = woof
<freeemint_> What is a dog and likes meat?
<freeemint_> you get the idea?
<freeemint_> judi?
alexshendi_ has quit [Ping timeout: 240 seconds]
<freeemint_> judi:
<judi> yes
<judi> thanks
<judi> I think I have to reread the code of this einstein puzzle again
judi has quit [Quit: Page closed]
<Regenaxer> ret
<Regenaxer> good discussion freeemint_!
gko_ has quit [Quit: ZNC - http://znc.in]
gko has joined #picolisp
<Regenaxer> Grr
<Regenaxer> still struggling with Server-Sent Events
<freeemint_> Regenaxer: I was just solving the puzzl by hand - just finished
<Regenaxer> run only one time, and I don't find the reason
<Regenaxer> good freeemint_!
<freeemint_> i had to peek a little
<freeemint_> because the second step was not obvious to me. Living left of does not mean being a direct left naihbor to me
<freeemint_> Question: why are {numbers} not reset after a roll back?
<Regenaxer> What {numbers} ?
<freeemint_> number of external symbol
<freeemint_> (new T) -> {2} (rollback) (new T) -> {3}
<Regenaxer> You mean in (all 0) ?
<Regenaxer> ah
<Regenaxer> (rollback) does not delete allocated symbols, because they may be in use by other processes
<Regenaxer> (dbck) cleans them up and returns them to the avail list
<Regenaxer> See 'doc dbck', it is explained there
<freeemint_> are blocks permanently lost when the next commit happens before a (dbck)?
<freeemint_> (or is the ordering of them chronocically just {2} {8} {5} {11})
<Regenaxer> No, they are not lost
<Regenaxer> They are just not yet put into the "avail" list
<freeemint_> as i expected of you
<Regenaxer> Try (dbck), then 'new' again
<Regenaxer> Then you get {2} etc.
<freeemint_> i saw
<Regenaxer> Blocks are only returned to the avail list if no other processes are running
<Regenaxer> i.e. in a nightly cronjob
<Regenaxer> doing (dbgc) and (dbck)
<freeemint_> I feel a little more comfy in the database now i got my first working +Joint (tried both directions)
<Regenaxer> good :)
<Regenaxer> Btw, the typical clean up is done in the 'admin' function on @lib/too.l
<Regenaxer> I have this in every cronjob
<Regenaxer> E.g. from the wiki sources, wiki/back.l:
<Regenaxer> (load "@lib/too.l")
<Regenaxer> (admin
<Regenaxer> (snapshot "/bak/wiki" "db/wiki") )
<freeemint_> Do we have some version controll stuff for the database? (other than nightly dupplication) (i mean something more "git"-like)
<Regenaxer> You can use git or whatever you like
<Regenaxer> The above 'snapshot' does incremental backups
shpx has joined #picolisp
<Regenaxer> The "duplication" is something different
<Regenaxer> I call it "mirroring", and it is a continuous process
<Regenaxer> Mirrors all changes in transaction-units every 20 seconds or so
<freeemint_> aber kein "aufschlüsseln" auf commit level?
<Regenaxer> No, it *does*
<Regenaxer> It will not mirror parts of a transaction
<Regenaxer> i.e. (dbSync) -> (commit 'upd) calls
<Regenaxer> either all or nothing
<Regenaxer> Git cannot do that
<freeemint_> mhh .. what i had in mind was very outlandish
<freeemint_> Want to hear it?
<freeemint_> (I learned to ask)
<Regenaxer> I'm soo frustrated with that Server-Sent Events problem
<Regenaxer> Hanging almost all day now on it
<Regenaxer> Makes me really crazy
<Regenaxer> I need it next week :(
<freeemint_> Do you want to explain it to me ... i do not whether that helps you
<Regenaxer> Thanks. It is a bit hard to explain without the sources
<Regenaxer> But I use Server-Sent Events
<freeemint_> and the source is confidential?
<Regenaxer> function serverSentEvent(fun, fld) {
<Regenaxer> (new EventSource(SesId + "!" + fun)).onmessage = function(event) {
<Regenaxer> var field = document.getElementById(fld);
<Regenaxer> field.value += event.data + "\n";
<Regenaxer> };
<Regenaxer> post(field.form, false, null, null);
<Regenaxer> }
<Regenaxer> No, it will be in the pil distro later
<Regenaxer> The above is added to @lib/form.js here locally
<freeemint_> What does not work?
<Regenaxer> The strange thing is that it works fine, but only *one* time
<Regenaxer> A simple test case:
<Regenaxer> (for L '("abc" "def" "ghi")
<Regenaxer> (httpHead "text/event-stream" 0)
<Regenaxer> (ht:Out *Chunked (prinl "data: " L "\n")) )
<Regenaxer> only "abc" shows up in the text field
<freeemint_> what is fld?
<Regenaxer> There is more involved, also a GUI prefix class in @lib/form.l
<Regenaxer> 'fld' is passed in from the GUI
<Regenaxer> it is a text area here
<freeemint_> so a java script side object
<Regenaxer> "abc" appears in the text area
<freeemint_> i read that
<Regenaxer> only the EventSource object is JS here
<freeemint_> Does the problem appear in all browsers?
<Regenaxer> I tried in Chrome here on the tablet, and then also on a Firefox on a desktop
<Regenaxer> same behavior
<Regenaxer> The exact data format is critical
<Regenaxer> If I omit the "\n" in the last line it does not work at all
<Regenaxer> And my question a few hours ago was whether (httpHead "text/event-stream" 0)
<freeemint_> You call serverSentEvent once per function and field, right?
<Regenaxer> needs to be for *every* message or only *once* for a session
<Regenaxer> No, only a single time, when the page is displayed
<Regenaxer> Then the EventSource object correctly connects to the server
<Regenaxer> and receives one event
<Regenaxer> "abc"
<Regenaxer> Then the connection should be kept open
<freeemint_> I got the weird feeling that the event source object is collected in javascript after one event
<Regenaxer> but "bcd" does not trigger
<Regenaxer> Maybe
<Regenaxer> But this is the defined functionality
<Regenaxer> Its *purpose* is to keep the connection open
<freeemint_> could you make an global JS structure where you put the handlers in?
<Regenaxer> Good idea
<freeemint_> I know but i am sorta thinking if it goes out of scope the event handler might be collected
<Regenaxer> Sounds correct, the examples in the web always used a global
<freeemint_> try it
<Regenaxer> No, same behavior
<Regenaxer> just abc
<Regenaxer> But it was a valid idea!
<freeemint_> the SesID remains valid?
<Regenaxer> yes
<freeemint_> Can i see your new code
<Regenaxer> It is the pil session
<Regenaxer> with the global?
<freeemint_> yes
<freeemint_> the js code
<Regenaxer> var Source;
<Regenaxer> function serverSentEvent(fun, fld) {
<Regenaxer> Source = new EventSource(SesId + "!" + fun);
<Regenaxer> Source.onmessage = function(event) {
<Regenaxer> field.value += event.data + "\n";
<Regenaxer> var field = document.getElementById(fld);
<Regenaxer> post(field.form, false, null, null);
<Regenaxer> };
<Regenaxer> }
<freeemint_> Just a non problem related question: Why do you add one \n on server side and another one on client side?
<Regenaxer> The ones on the server side are not part of the data, but for the protocol
<Regenaxer> To end one message
<Regenaxer> It is documented this way, and without them nothing is fired at all
<Regenaxer> I revert the code
<Regenaxer> It seems that there must be some error, because it re-connects every 3 seconds and sends "abc" all the time then
<Regenaxer> (that retryng every 3 secs is also in the docs)
<freeemint_> just out of interest could you try to change the refreshrate: (with: retry: 10000\n
<freeemint_> retry: 10000\n
<Regenaxer> In the body where "data: " is ?
<Regenaxer> yep, now it is 10 secs
<freeemint_> Do you have root on the client ... may try wireshark
<Regenaxer> No, I'm on Android
<Regenaxer> not rooted any more
<Regenaxer> What would you look for in the protocol?
<Regenaxer> I traced on the Lisp and JS levels until now, is quite OK
<freeemint_> if the package arrives at the phone
<Regenaxer> I can trace JS with lisp(null, "console", "Message");
<freeemint_> *second package
<freeemint_> also if they look as they should
<Regenaxer> Well, the for loop does surely send it
mtsd has joined #picolisp
<Regenaxer> where may it be lost?
<Regenaxer> The big question is whether the EventSource object closes down
<Regenaxer> due to some error perhaps
<Regenaxer> the 'onerror' is not helpful
<Regenaxer> it just says "undefined"
<freeemint_> can you change (prinl "data: " L "\n") into (prinl "data: " L "\n\n" )
<Regenaxer> it is already 2 newlines
<Regenaxer> because 'prinl' sends one too
<Regenaxer> In fact I tried with three too
<freeemint_> it should be two
<Regenaxer> and also with returns: event.data
<freeemint_> what about calling 'flush
<Regenaxer> yes, two
<Regenaxer> I did that too, but ht:Out does it anyway
<Regenaxer> You are good! On the right tracks! :)
<Regenaxer> So it is good that you look at it with fresh eyes
<Regenaxer> I just inserted an error handler again
<freeemint_> well my fresh eyesdid not see the l in prinl
<Regenaxer> but nothing new: (console "Error: undefined")
<Regenaxer> Src.onerror = function(event) {
<Regenaxer> lisp(null, "console", "Error: " + event.data);
<Regenaxer> };
<freeemint_> what is *Chunked?
<Regenaxer> It is so-called chunked http transfer
<freeemint_> ah
<Regenaxer> no need to send a Content-length
<Regenaxer> But I tried witwout too
<freeemint_> Try (httpHead "text/event-stream" 0) (for L '("abc" "def" "ghi") (ht:Out *Chunked (prinl "data: " L "\n")) )
<freeemint_> andif does not wrok give me your (httpHead "text/event-stream" 0)
<Regenaxer> I tried that too
<Regenaxer> This was what my PHP question was about
<Regenaxer> whether the headers are sent each time or not
<Regenaxer> But it does not matter here, as the second time is not fired either way
<Regenaxer> What do you mean with: give me your (httpHead ... ?
<freeemint_> Paste the result
<Regenaxer> ok
<Regenaxer> HTTP/1.1 200 OK
<Regenaxer> Cache-Control: private, no-store, no-cache
<Regenaxer> Cache-Control: max-age=0
<Regenaxer> Date: Sat, 24 Feb 2018 19:01:45 GMT
<Regenaxer> Server: PicoLisp
<Regenaxer> Content-Type: text/event-stream
<Regenaxer> Transfer-Encoding: chunked
<freeemint_> could you point the client to: https://stream.wikimedia.org/v2/stream/recentchange
<Regenaxer> Chrome?
<Regenaxer> Takes long ...
<freeemint_> not your brwoser the event client
<Regenaxer> Crome is my client
<freeemint_> ah
<Regenaxer> The pil server just generates strings
<freeemint_> does it do anything yet?
<Regenaxer> My original test connected with ssh somewhere
<Regenaxer> But now I use just "abc" ...
<freeemint_> can you point curl to your stream ?
<freeemint_> curl -s Your_stream
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Regenaxer> difficult, as it first starts a pil session, redireqts the browser to it, and then (fork)s a process which does the streaming
<Regenaxer> I copied the port and session ID of that process to (client ... though
<Regenaxer> Looked all good
<Regenaxer> a bit tedious
shpx has joined #picolisp
<Regenaxer> first with w3m so that no JS interfers
<Regenaxer> let me try again ...
<freeemint_> :D
<Regenaxer> got it
<Regenaxer> too long, let me shorten
<Regenaxer> ok
<Regenaxer> As you see, it sends all "abc", "def" and "ghi"
<freeemint_> (ht:Out *Chunked (prinl "data: " L "\n")) what does that print?
<freeemint_> (your code)
<Regenaxer> hmm, strange
<Regenaxer> it is *not* chunked
<Regenaxer> Perhaps because I started the session with w3m
<freeemint_> I think you are the chunking wrong
<Regenaxer> I did without too
<freeemint_> 7\r\n
<Regenaxer> (http1 ...) + (prinl "Content-Length
<Regenaxer> Where do you see that?
<freeemint_> Mozilla\r\n
<freeemint_> 9\r\n
<freeemint_> Developer\r\n
<freeemint_> 7\r\n Network\r\n
<freeemint_> 0\r\n \r\n
<Regenaxer> Ok, then it *is* chunked
<Regenaxer> Chunked encoding inserts such formatting
<freeemint_> i ve never seen any hint of them in your pastings
<freeemint_> but at the same time i asked you to look at with an http client not a socket my fault
<Regenaxer> ok
<freeemint_> Where do you chunk it?
<freeemint_> I have not seen where you chunk it
<Regenaxer> The source? It is src64/ht.l
<Regenaxer> or, equivalent, src/ht.c
<Regenaxer> I try again, from Chrome
<Regenaxer> redirecting the stream to a file
<Regenaxer> ok, now it is chunked
<Regenaxer> moment
<freeemint_> What happend with /R ?
<freeemint_> *\r
<Regenaxer> yes
<Regenaxer> Pastebin discarded returns
<Regenaxer> I can see here in the editor
<Regenaxer> Content-Type: text/event-stream^M
<Regenaxer> b^M
<Regenaxer> ^M
<Regenaxer> Transfer-Encoding: chunked^M
<Regenaxer> data: abc
<Regenaxer> (copy/paste from vim)
<freeemint_> ah nice
<freeemint_> have you thought about trying events and having a event listener instead?
<Regenaxer> yes, like the "ping" example?
<freeemint_> might be a different code path or more helpfull error messages
<freeemint_> i would choose "message"
<freeemint_> but yes
<Regenaxer> I tried with "message", and same result
<Regenaxer> :)
<Regenaxer> addEventListener iirc
<freeemint_> are you scared of a little python?
<Regenaxer> uh, yes, I don't know it well
<freeemint_> https://github.com/btubbs/sseclient a python sse client my has some helpfull debug messages
<Regenaxer> Hmm, not sure if it will run on my tablet
<freeemint_> ah ... yes
<freeemint_> do you have the stream somewhere on the internet?
<Regenaxer> Can try
<Regenaxer> from another server
<Regenaxer> moment
<freeemint_> if you want to i got a static ipv4 on one of my pcs
<freeemint_> could use this one
<freeemint_> (static as in world wide static)
<freeemint_> (like if you want to tear down a firewall)
<Regenaxer> Can you try https://7fach.info/8080 ?
<freeemint_> you can just let me in instead of the world
<Regenaxer> no problem
<Regenaxer> It is httpGate
<freeemint_> no script strickes again
<Regenaxer> ?
<freeemint_> ok in the firefox network analysis only "data: abc" arrives
<Regenaxer> ok, same as here
<Regenaxer> Pil does not close the connection yet
<freeemint_> I will wireshark it to be sure
<Regenaxer> great
alexshendi has joined #picolisp
<freeemint_> Regenaxer do you use cloudflare?
<Regenaxer> no
<Regenaxer> Why?
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shpx has joined #picolisp
shpx has quit [Client Quit]
freemint_ has joined #picolisp
freemint_ has quit [Client Quit]
<Regenaxer> freeemint_, let's stop for today?
<Regenaxer> Getting tired ...
orivej has joined #picolisp
<Regenaxer> freeemint_, thanks a lot for helping me!
<Regenaxer> I retire now, some family duties :)
<Regenaxer> nite!
<freeemint_> Regenaxer:
<freeemint_> Can you leave the server online?
<freeemint_> Good night
<Regenaxer> oh, sorry, yes
<Regenaxer> I restart it
<Regenaxer> Thanks! :)
<freeemint_> Regenaxer: Could also deactivate https by default?
<freeemint_> Regenaxer: but only if it works quickly i got a work around
<Regenaxer> Hmm, I don't have port 80 open
<Regenaxer> ok
<freeemint_> i think i got a work around
<Regenaxer> ok, great!
<freeemint_> port 80 is open!
<freeemint_> anyhow do not change anything
<Regenaxer> There is iptables running
<Regenaxer> port 80 is closed I thought (?)
<Regenaxer> ah, no, only on wifi
<Regenaxer> a remains when this ran on a notebook only
<Regenaxer> So http should be OK, httpGate is running
<freeemint_> Regenaxer: The diagone is ugly
<freeemint_> Regenaxer: As ugly as it gets
<Regenaxer> oh
<freeemint_> packets are arrive
<freeemint_> but are dropped because they are "malformed"
<freeemint_> they do not reach the browser
<Regenaxer> uh
<freeemint_> but with wireshark i could see them
<Regenaxer> btw, I fixed my iptables now
<Regenaxer> is 80 closed now?
<freeemint_> they are probably thrown away and rerequested in kernel level
<Regenaxer> I can open 80 now
<Regenaxer> opened again
<freeemint_> wireshark sadly does not report what is corrupt
<Regenaxer> How can that happen?
<Regenaxer> Packets are a kernel issue
<freeemint_> The last not malformed chunk is 0d 0a 62 0d 0a 64 61 74 61 3a which says something like "linebreak data:"
<freeemint_> after that there is a chunkboundary for one character but more than one arrives
<freeemint_> (two bytes)
<Regenaxer> It is the next header then?
<Regenaxer> We must keep the header outside the loop?
<Regenaxer> Let me change
<Regenaxer> I changed it
<Regenaxer> Header only once at start
<Regenaxer> Can you try again?
mtsd has quit [Quit: Leaving]
<freeemint_> Regenaxer: I do
<freeemint_> Also the defect packets arrived every 30 s roughly
<Regenaxer> strange
<freeemint_> no longer but the reason why only abc arrives becomes apperent
freeemint_____ has joined #picolisp
<freeemint_____> Regenaxer: try curl 7fach.info/33535/55368285947067650~\!chatSse
<freeemint_____> ! is escaped already
<freeemint_> the is strange wait a bit
<freeemint_> I am asking for help
<freeemint_> afk and capturing
<freeemint_> Regenaxer: If you are still reading it a tarball of the source via mail might be helpfull
<Regenaxer> ok
<Regenaxer> Sent
<freeemint_> also nobody could help me
<Regenaxer> You asked others?
<freeemint_____> yeah i am in local computer cloub who is like 2 minutes away
<Regenaxer> It must have worked
<freeemint_____> they could give me some woreshark
<Regenaxer> cool!
<freeemint_____> tips but nobody wants to protocol dive with me rn
freeemint_____ has quit [Quit: Page closed]
<freeemint_> Regenaxer: Your email has not arrived
<Regenaxer> johtobsch@gmail.com ?
<Regenaxer> I took from the mailing list
<freeemint_> yes
<Regenaxer> Returned Mail
<Regenaxer> message was blocked because its content presents a
<Regenaxer> potential security issue.
<Regenaxer> hmm
<Regenaxer> the tgz
<Regenaxer> grr
<Regenaxer> I attach un-tarred
<Regenaxer> or, tar without zip
<Regenaxer> Sent again
<freeemint_> if it does not work i give you another email
<Regenaxer> Did the defect packets disappear with single-header?
<freeemint_> let me look
<freeemint_> i think so
<freeemint_> but i wanna be sure
<Regenaxer> again returned mail
<freeemint_> yes they vanished
<Regenaxer> I sent angain with direct files
<freeemint_> But what appeard is another pattern ...
<Regenaxer> ok?
<freeemint_> the client ask a get every 5 seconds and the server answers with:
<Regenaxer> Sigh! Again returned
freeemint__ has joined #picolisp
<Regenaxer> Whats the matter with Gmail?
<freeemint__> they are "very secure"
<Regenaxer> But plain sources?
<Regenaxer> I try your other address
<freeemint_> good
<freeemint_> The packet contains ve
<freeemint_> *the packet contains abc def and ghi
<freeemint_> the thing is they arive as one package it seems
<Regenaxer> yeah, only one header
<Regenaxer> but is that right or wrong?
<Regenaxer> It is not clear, and not explained
<Regenaxer> That's why I asked here about the PHP examples
<Regenaxer> header('Cache-Control: no-cache');
<Regenaxer> header("Content-Type: text/event-stream\n\n");
<Regenaxer> while (1) {
<Regenaxer> echo "\n\n";
<Regenaxer> echo "event: ping\n";
<Regenaxer> flush();
<Regenaxer> ob_end_flush();
<Regenaxer> sleep(1);
<Regenaxer> }
<Regenaxer> What does header() mean here?
<Regenaxer> Is it in the buffer, and send every time?
<Regenaxer> Not clear to me
<Regenaxer> Anyway both ways don't work ;)
freeemint__ has quit [Quit: Page closed]
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
freeemint_ has quit [Ping timeout: 260 seconds]