[ prog / sol / mona ]

sol


spam thread

233 2022-05-16 06:17

>>225
It has lost relevance but I need to close out the gestalt.

correct me if I'm wrong, but all languages can program the same stuff right, it's just a difference of notation and syntax?

And semantics and standard library. Some languages provide direct memory management while others are not, some languages have strict evaluation model, others have lazy one etc. Also all of them have significant differences in their standard libraries.

idk how to do step 4. I'm following this tutorial https://medium.com/decentralize-today/decentralized-p2p-chat-in-100-lines-of-code-d6e496034cd4

That tutorial is rather complex. The main idea is that an HTML page has a <form> with named inputs and when the user clicks "Submit" your server-side script receives those inputs in a request. For example:

<form>
<input type="number" name="cislo1"> + <input type="number" name="cislo2">
</form>

Server script (Python CGI):

import cgi

form = cgi.FieldStorage()
cislo1 = int(form.getfirst("cislo1", 0))  # Python's CGI interface is... not the most convenient one.
cislo2 = int(form.getfirst("cislo2", 0))

result = cislo1 + cislo2

print("Content-type: text/html\n")
print("""<!DOCTYPE HTML>
        <html>
        <head><meta charset="utf-8"></head>
        <body>Kwota""" + str(result) + """</body>
        </html>""")
301


VIP:

do not edit these