Fork me on GitHub
#off-topic
<
2020-09-29
>
jjttjj12:09:06

What factors do you use to determine if a component needs a start function separate from its constructor, or if the construction and starting should be done in one user function?

noisesmith15:09:13

I'd put it all in the construction code unless/until some component is expensive to construct but cheap to restart, ideally your component library should have separate start / restart functions and use your restart if available (similar to reboot / warm-boot of an OS)

jjttjj16:09:36

makes sense, thanks!

borkdude15:09:42

Can people here respond with their Java version, OS, processor and (System/getProperty "os.arch")?

borkdude15:09:25

never mind, was just wondering if there is a meaningful difference between x86_64 or amd64, but I think they're the same

noisesmith15:09:24

the one to look out for would be IA_64 but IIRC nobody actually uses that, intel lost that one

littleli18:09:58

x86_64 and amd64 are about the same arch. IA_64 is Itanium, which is end-of-life architecture.

bherrmann18:09:57

What is the extremely quick/simple way to serve https content from clojure? akin to python's ?

## generate certs using, $ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
## then run this from from python3
from http.server import HTTPServer, BaseHTTPRequestHandler
import ssl
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)
        self.end_headers()
        self.wfile.write(b'Hello, world!')       
httpd = HTTPServer(('localhost', 4443), SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, 
        keyfile="key.pem", 
        certfile='cert.pem', server_side=True)
httpd.serve_forever()

richiardiandrea19:09:02

Does anybody know if jq has got the equivalent of take-while and drop-while in Clojure?

borkdude20:09:21

Hmm, good point, maybe jet should support that too: https://github.com/borkdude/jet

borkdude20:09:09

@U0C8489U6 :

$ json=$(bb -e '(println (json/generate-string (map (fn [x] {:a x}) (range 10))))')
$ echo $json
[{"a":0},{"a":1},{"a":2},{"a":3},{"a":4},{"a":5},{"a":6},{"a":7},{"a":8},{"a":9}]
$ echo $json | bb -e '(->> (json/parse-stream *in* true) (drop-while #(< (:a %) 5)))'
({:a 5} {:a 6} {:a 7} {:a 8} {:a 9})

sova-soars-the-sora20:09:04

Say somebody is always inputting malformed login data into your login form... what's a funny redirect to give them ?

sova-soars-the-sora20:09:08

...short of an electric shock

noisesmith20:09:32

keep a set of IPs that are doing this and redirect them to one another

sova-soars-the-sora21:09:25

chat room of shame

sova-soars-the-sora21:09:45

i was thinking maybe just making a quick strobe.js page

sova-soars-the-sora21:09:55

#fff #000 #fff #000

sova-soars-the-sora21:09:22

or a tiled 1x1px gif that achieves the same even with noscript enabled... >=)

sova-soars-the-sora21:09:46

i think it is just 1 person but i have not been able to think of a humorous enough punishment yet.

andy.fingerhut21:09:50

Just be cautious what you put in, in case your boss ever reaches the same place 🙂

emccue21:09:45

@sova no redirect, just have something like the animation on tunnelbear

emccue21:09:12

just something popping up in the corner of the screen