off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
dpsutton 2021-02-11T00:30:58.236700Z

i just checked the prospectus for stange loop. surprisingly affordable tiers to sponsor and support strange loop. worth highlighting to people at your jobs as I just did

1👍
dpsutton 2021-02-11T04:20:16.237600Z

does anyone remember a zach tellman library that use de Bruijn numbers? I remember it from about 5 years ago but don't have it locally at the moment

2021-02-11T11:31:12.243900Z

He worked on an integer map representation that got adopted into contrib as int-map: https://github.com/clojure/data.int-map/blob/9dc6659ed26f0523d62448b0766b9bf746afa754/src/main/java/clojure/data/int_map/Nodes.java#L49 (there may, of course be something else too).

dpsutton 2021-02-11T14:44:30.252500Z

That’s the one! I found it late last night by writing a script to download all the clojure and ztellman repos and grepping for it. Thanks

1👍
aratare 2021-02-11T06:29:24.243600Z

Just want to bring this to everyone's attention: https://www.theverge.com/2021/2/10/22277054/slack-android-psa-password-reset-email-plaintext

2021-02-11T11:31:12.243900Z

He worked on an integer map representation that got adopted into contrib as int-map: https://github.com/clojure/data.int-map/blob/9dc6659ed26f0523d62448b0766b9bf746afa754/src/main/java/clojure/data/int_map/Nodes.java#L49 (there may, of course be something else too).

2021-02-11T11:38:41.245900Z

I made 2 small macros for -> and ->> threadings which let you plug a let in the middle. Please let me know what you think about them in a thread here in Slack. https://twitter.com/VincentCantin/status/1359828282519130114

2021-02-11T12:37:08.246300Z

I am thinking to add them to an utility library at some point, and I would be interested in critics to improve them.

alexmiller 2021-02-11T13:27:50.247400Z

And the problem you’re trying to solve is ...

2021-02-11T13:29:07.247600Z

Staying in the flow of the parent -> or ->>

2021-02-11T13:33:27.248Z

It can be useful for ad hoc data transformation, e.g.

(-> ...
    (->let [{a :a, b :b} _] {:a b, :b a})
    ...)

2021-02-11T13:34:36.248400Z

Can I please vent about the traumatic lunch break I've just endured?

2021-02-11T13:36:37.248500Z

I've just had the most traumatic lunch break... I was making dinner and went to put some bits of onions and stuff down the garbage chute. But it was blocked. There was a bag half down the chute and half in the chute. My neighbour had overfilled a bag and it got stuck. I tried to yank it to free it, but it wasn't budging. Finally I yanked hard enough that half the bag and its contents came flying out at me and all over the communal area floor... My neighbour has a small child, barely a toddler. Still in nappies. Rotten food and nappies everywhere. Everywhere I just stood for a few minutes in complete disbelief that this had just happened. There's no way I can be surrounded by rotten food and dirty nappies, just no way. This doesn't happen. I don't have a child, there's no way I could ever have to deal with multiple nappies and all the shit that goes down a garbage chute. I just couldn't process it. My neighbour wasn't home, probably for the best, honestly. Thank god I have surgical gloves. I got it all picked up and re-bagged into bags that fit down the chute and then had to get a basin of water and bleach and scrub the floor. All this while my lunch was cooking, it ended up completely ruined. Then I hear my neighbour coming home. OK. Count to ten, breathe, stay calm... I'm a rational adult. It was a mistake. It's dealt with. My neighbour doesn't speak great english, I think he was well aware I was pissed at him. And I think he grasped that the cause of my displeasure was something in the direction of the rubbish chute, but I'm not convinced he fully grasped the hell I had just been through because of him. Or how much I wanted to kill him. I need a shower, a beer, and I'm still hungry.

1
Audrius 2021-02-11T14:09:18.248700Z

revenge is only you can do 😞

1😈
alexmiller 2021-02-11T14:20:11.249100Z

have you ever considered ..... not being in an -> form? :)

2021-02-11T14:20:50.249300Z

yes, it is possible 🙂

alexmiller 2021-02-11T14:20:53.249500Z

or using as->

alexmiller 2021-02-11T14:21:33.249700Z

as-> is probably shorter than what you're doing too

2021-02-11T14:21:43.249900Z

I had the context of “writing fast” in mind, for situations like the Advent of Code where the time to a solution is very important.

2021-02-11T14:23:24.250100Z

as-> works only for a single binding and single body. In the heat of time-pressured coding, having a multiple binding and multiple body is helpful.

2021-02-11T14:24:14.250400Z

->let also maintain a better code readability, and it is also very important for speed.

alexmiller 2021-02-11T14:25:11.250600Z

I guess I find writing fast usually means spending twice as long debugging later :)

2😁
2021-02-11T14:26:05.250800Z

Yes, that’s exactly why it has to also stay readable, from my experience in the AoC 2020.

alexmiller 2021-02-11T14:26:28.251100Z

bespoke flow control is rarely more readable imo

dpsutton 2021-02-11T14:44:30.252500Z

That’s the one! I found it late last night by writing a script to download all the clojure and ztellman repos and grepping for it. Thanks

1👍
p-himik 2021-02-11T15:14:00.252700Z

I doubt revenge would be beneficial for either party given that the neighbor haven't done anything deliberately and likely still has no idea what have happened. A shower, a beer, and some food would be much better. And knowing the tensile strength of the garbage bags your neighbor uses. :)

1🍺1🍻
2021-02-11T15:23:53.253200Z

ive had a couple of beers, and got cleaned up. Feeling a bit better now.

2021-02-11T15:24:39.253400Z

It's just I have a massive stressor in my life right now. And little things like this I don't need right now! It makes me feel like the universe is just piling it on.

Dane Filipczak 2021-02-11T16:11:17.253700Z

That sounds awful, I’m sorry it happened to you.

borkdude 2021-02-11T16:57:05.254400Z

I think the link to differences between Clojure and ClojureScript is out of context here: https://www.lihaoyi.com/post/FromFirstPrinciplesWhyScala.html

1👍
seancorfield 2021-02-11T17:11:40.255900Z

I agree with Alex here -- I see a lot of people inventing their own threading macros and they are nearly all weird and, unless you know the macro's semantics well, they make the code much less readable for other people (and also for your future self).

1👍
2021-02-11T17:12:24.256100Z

Yeah, that is a bad day. Hopefully you can find good ways to reduce your stress level on average, long term, but I know that is generic and thus perhaps frustrating advice.

1➕
seancorfield 2021-02-11T17:13:29.256400Z

That said, at work we have condp-> and condp->> which are like cond-> and cond->> but also thread the value through the predicate. We use them very rarely and I wouldn't use them in public OSS (although we've open-sourced them so others can "hang themselves" if they wish 🙂 ).

Audrius 2021-02-11T17:14:40.256600Z

@qmstuart you said you had a couple of beers to calm your self down. You should have some more and update us with the state...

seancorfield 2021-02-11T17:15:18.256800Z

An example of this hard-to-read macro-based code is the Tupelo libraries, IMO: I see one of their users (one of the authors, I believe) answering questions from beginners on Stack Overflow and their answers are always based on some Tupelo code that is going to be much less useful to beginners than answering using just plain old Clojure code.

1💯
seancorfield 2021-02-11T17:15:52.257Z

(and they also always link to their own curated "Clojure resources" page instead of the official pages!)

2021-02-11T17:16:32.257200Z

The custom threading macro which I used the most was comp-> , it uses comp but with the arguments in the reverse order. Do you think that this one be more easily accepted and/or understood?

seancorfield 2021-02-11T17:17:51.257500Z

I think that would make code much less readable for other people.

2021-02-11T17:18:38.257700Z

I will write those wise words in the Readme file of the library, if one day I create it: “do not use in team-based projects”

seancorfield 2021-02-11T17:19:08.258Z

Especially given the core comp function already seems to behave in two completely different ways: plain comp as a wrapper and comp-in-transducers.

seancorfield 2021-02-11T17:20:37.258300Z

(comp f g h) means (f (g (h %))) so it's h, then g, then f but when you see (into #{} (comp (map inc) (filter even?)) data) then it is "as-if" it was map inc first, then filter even?, when applied to the data.

1
2021-02-11T17:23:13.258600Z

Originally, I wade comp-> with AoC in mind. The goal was to be able to write the code in the order of thoughts without having to move the cursor backward. I still believe that in this very particular context (AoC), it is a good usage.

John Conti 2021-02-11T17:24:14.258800Z

IMO https://mortoray.com/2013/08/13/we-dont-need-a-string-type/ is why traditional “type-safe” programming languages are unsafe to use for business long term. This is a forrest of decisions that cannot be made “better” for all contexts and are very hard to change. Without an optimum answer the choice cannot produce value. And they make work, so they detract from product velocity. In the days of shrink-wrap software they did provide product quality assurance that produced value. Obviously this generalization does not apply to the Haskell/ML world, that has other issues in most contexts, or “hosted languages like Typescript/Clojure(script).

2021-02-11T17:25:02.259Z

In AoC, it is faster for the programmer to combine functions via -> or ->> compared to transducers because: • sometimes we don’t fully know what we are writing in advance • we may need to add a sort step in the middle of a ->> at any time, which can’t be in a transducer

2021-02-11T17:27:28.259400Z

But yes, I agree that comp is already confusing without comp-> 🙂

seancorfield 2021-02-11T17:29:26.259600Z

I think that just suggests that programmers aren't yet familiar enough with transducers to reach for them as the natural "first step" -- and that's no sleight: transducers are "relatively new" and a lot of people definitely struggle with them. Even with a decade of Clojure under my belt, I still don't always reach for transducers -- when they would be the "best" choice for the solution at hand. I'm slowly getting better about that 🙂

dharrigan 2021-02-11T17:30:50.259900Z

This makes my eyes bleed

dharrigan 2021-02-11T17:30:52.260100Z

@ implicit def ExampleTuple[T: Example, V: Example]: Example[(T, V)] = new Example[(T, V)]{
    def value = (implicitly[Example[T]].value, implicitly[Example[V]].value)
  }

11😂
seancorfield 2021-02-11T17:37:12.260800Z

That sort of thing is why I switched from Scala to Clojure a decade ago! 👀

3
dpsutton 2021-02-11T17:40:34.261400Z

people complain about parens too 🙂. I've had great success with both C# and F# (particularly F#) in a past job.

2021-02-11T17:49:00.264400Z

Any linux gurus around? I’m trying to remember the name of a thing I used to use. The idea was I have a program named “foo” that handles incoming requests on port 1234, but I don’t want to leave it running all the time. There was a linux thingy that would fire up “foo” for me whenever it detected an incoming request on port 1234. Does that ring any bells? Might be old/obsolete.

2021-02-12T14:04:37.282400Z

That sounds interesting. I wouldn’t call it security through obscurity, I’d call it “shared secret.” It’s no less secure than entering a pin, and pins only have 10 digits.

2021-02-12T14:10:00.282600Z

By the way, as a follow-up to my original question, our overworked sysadmin guy finally had time to sit down (virtually) and talk to me, and it turns out we’re not even using nginx for the proxy, it’s all on a load balancer on a completely different machine. It fooled me because I ssh in over vpn to an internal numeric IP, but my browser connects over a public .com address. It was nice to think back to the “good old days” of inetd tho. 🙂

tvaughan 2021-02-12T14:24:29.282800Z

> It was nice to think back to the “good old days” of inetd tho. :hugging_face:

2021-02-11T17:51:28.266100Z

Backstory is my Clojure web app isn’t getting the X-Forwarded-For header from nginx, and I accidentally discovered that my app works just fine even when nginx is completely shut down, so I’m trying to discover what service or process or whatever is forwarding web requests to my app.

tvaughan 2021-02-11T17:55:14.266300Z

inetd (and /etc/inittab or /etc/inetd.conf)

tvaughan 2021-02-11T17:58:11.267200Z

I'm sure there's some systemd replacement for it now, although I don't know what that is

2021-02-11T17:59:02.268700Z

The missing header suggests something below the level of http, so maybe a firewall is redirecting traffic from one port to another

2021-02-11T18:10:32.268900Z

inetd! That was it, thanks!

1👍
2021-02-11T18:11:29.269200Z

you can use a socket unit for systemd as well

rwstauner 2021-02-11T18:45:49.269900Z

xinetd is another incarnation

rwstauner 2021-02-11T20:22:46.270600Z

also, i built a standalone utility to do this with tcp servers a few years back: https://github.com/rwstauner/ynetd mostly so that a really complicated docker-compose setup could hold off on running some things until they are actually used, also can be configured to shut them down again, etc.

Thomas Moerman 2021-02-11T21:21:14.271900Z

Hey guys, do you sometimes experience reluctance of "calling it a day" out of fear of losing your mental context while working on some stuff?

Thomas Moerman 2021-02-12T08:31:56.279400Z

@jayzawrotny a while ago I switched to Roam Research (fun fact: powered by Clojure) for note taking in the vein of Zettelkasten, that definitely helps to "let go" of something for a while. I do get stuck sometimes when trying to explain something abstract/complicated in prose to my future self, clarity takes practice.

danieroux 2021-02-12T09:32:58.281500Z

Also a fun fact, that I just discovered about Roam: If you export your database as EDN, the file starts with #datascript/DB! … a self-described, schema-in-band dump of my whole Roam DB, with Datalog as my query language. All lock-in concerns I had just vanished.

euccastro 2021-02-12T10:08:33.281700Z

there's a org-roam too, if you're using emacs

euccastro 2021-02-12T10:09:05.281900Z

it doesn't interface with roam AFAICT, it's just an implementation of some of the core ideas in emacs

Thomas Moerman 2021-02-12T11:02:10.282200Z

https://youtu.be/RCCigccBzIU?t=392 "For myself, the most important thing has been the daily discipline of neatly writing down your thoughts and what to do" -- E. Dijkstra

2021-02-12T15:58:12.283200Z

In how to Take Smart Notes by Sönke Ahrens which covers more about zettelkastens. One particularly applicable quote: > The brain doesn’t distinguish between an actual finished task and one that is postponed by taking a note. By writing something down, we literally get it out of our heads. This was in response to the findings now known as the Zeigarnik effect: > Open tasks tend to occupy our short-term memory - until they are done

Thomas Moerman 2021-02-13T08:58:30.285300Z

Wow interesting. Never heard about the Zeigarnik effect before.

genekim 2021-02-13T21:01:05.296200Z

Freaking awesome, @jayzawrotny!

Thomas Moerman 2021-02-11T21:22:41.272600Z

Feature request: an IDE that shuts itself off automatically after x hours of activity

Thomas Moerman 2021-02-11T21:22:54.272800Z

</rant>

2021-02-11T21:25:54.273100Z

yeah I definitely do that

aaron-santos 2021-02-11T21:26:37.273200Z

Used to a lot more, but now I reckon my boss isn't running a charity and neither am I

5☝️
2021-02-11T21:56:06.273600Z

It usually hits me late Friday afternoons. I’ve been dealing with it by opening up a document called “Monday ToDo” and brain-dumping my mental state with instructions on how to resume work.

3👍
2021-02-11T21:56:32.273800Z

Cool stuff, guys!

2021-02-11T22:19:40.274100Z

Yeah… I stayed up until 5 AM getting the Clojure on Shared Hosts via CGI article, repo, and example site all prepared for the announcement. The next day was not pleasant but at the same time it would have been another 20 hours before I could return to the project if I went according to schedule.

1🍻
2021-02-11T22:25:44.274500Z

Granted, it was because I was enjoying the project and was excited to share it. As for work that hasn’t been an issue lately since I started using the zettelkasten technique for note-taking\organizing knowledge.

1👍
2021-02-11T22:26:58.274700Z

Ooh could probably combine manutter51's technique with zettelkastens. I’ll have to try that!

borkdude 2021-02-11T22:31:12.274900Z

Can someone explain to me what zettelkastens is in one or two sentences? I keep hearing about it

borkdude 2021-02-11T22:34:46.275300Z

Great summary, thanks

1👍