Fork me on GitHub
#off-topic
<
2020-07-12
>
idiomancy05:07:20

Im desperate, I'm going crazy. Does anyone know what a function (e.g. {1, 3, 4} => [0,1,0,1,1]) that maps a set of indexes to a vector of booleans is called? (or what that kind of vector is called?)

chucklehead05:07:12

a bit vector/bit array?

idiomancy05:07:58

oh my god that is it

idiomancy05:07:01

thank you

👍 3
emccue11:07:00

if anyone is curious

emccue11:07:04

(defclass MyList
  :java-interfaces [Iterable]
  :methods
  {:--init--
   (fn [this]
      (write-slot this :underlying (ArrayList.)))

   :add
   (fn [this item]
     (.add (read-slot this :underlying) item))

   :iterator
   (fn [this]
     (.iterator (read-slot this :underlying)))

   :--str--
   (fn [this]
     (.toString (read-slot this :underlying)))

   :--hash--
   (fn [this]
     (.hashCode (read-slot this :underlying)))

   :--eq--
   (fn [this other]
     (and (is-instance? MyList other)
          (.equals (read-slot this :underlying)
                   (read-slot other :underlying))))})

(def my-list (doto (make-instance MyList)
               (call-method :add 1)
               (call-method :add 2)
               (call-method :add 3)))

(doseq [item my-list] ;; Implements Iterable directly
  (println (str "I got a " item)))

emccue11:07:15

I have gone pretty deep

emccue11:07:31

my-list
=> [1 2 3]

emccue11:07:34

(.forEach my-list
          (reify Consumer
            (accept [_ x]
              (println (str "I got a " x)))))
I got a 1
I got a 2
I got a 3
=> nil

emccue11:07:05

so now multiple inheritance and extending java interfaces is supported (with asterisks)

orestis12:07:33

How do people generate these “screenshots” of a minimalist editor with some code, to put in Twitter etc?

walterl12:07:59

Haven't used it myself, but had https://github.com/carbon-app/carbon bookmarked.

orestis12:07:12

Trying on mobile :)

orestis12:07:15

Not bad, thanks

borkdude13:07:02

I've always wondered how people did this. I always made a screenshot in emacs myself 😉

orestis13:07:38

I just want to do some twitter rambling from my phone 😄 Not nearly time enough to write proper blog posts any more, but I have a phone in my hands most of the time these days…

Aron14:07:07

making pictures is one thing, but writing functions while walking would be a life-saver function for me

orestis14:07:08

For sure. Replete has a REPL but I don’t think that typing code in a mobile keyboard can ever be ergonomic.

Aron15:07:39

No, I don't think so, if anything will work it will be something that fully uses the phone's capabilities (such as touch on the whole screen, motion sensors etc.). Just trying to take a dev env from desktop is obviously futile

seancorfield18:07:10

@U7PBP4UVA If you're on either a Windows or macOS system (rather than your phone), both O/S's have a built-in way to grab a rectangular section of the screen, which is what I use for posting code fragments (I use Atom as my editor so it's already color-coded against a dark background). Carbon looks very nice, as a consistent way to create/publish such things -- I'll have to bookmark that!

walterl10:07:54

Flameshot (https://flameshot.js.org/) works great on Linux

3
dpsutton15:07:55

i've been a big fan of the contrib libs moving to a 1.0.0 release number. Thanks for those who decided to do that and got it done

👍 12
andy.fingerhut16:07:18

I believe Alex Miller did most of the work on that, and probably had a big hand in the decision, too

dpsutton17:07:01

Yeah. Didn’t want to ping and disturb him. Figured he’d see it though. I still have no idea about mention etiquette on slack :)

sveri18:07:58

Better be on the safe side and always mention all, even for a simple smiley 😄 /s

Alex Miller (Clojure team)19:07:17

Feel free to mention, it won’t bother me

👍 9
sveri21:07:44

I just had a short "discussion" on reddit about future planning. It seems like I was the only one who thinks its normal to have a vague plan about your future 5 years, regarding your career, or from a business point of view, regarding your business. Am I somehow totally out of the loop here and missed something?

aaelony04:07:15

IMHO, I think it is normal to make (extensive/practical) plans among people that end up being successful.

borkdude21:07:47

"Where do you want to be in five years" is a pretty standard question in interviews at least in my country, and I never had a clear answer on that.

seancorfield21:07:29

@sveri When I was younger, I definitely had a "career plan" and worked toward it.

sveri21:07:41

It's one in my country too and I actually do think it's a reasonable question. I mean, it's obvious no one predicts the future, but having goals or at least thinking about them from time to time is a good thing.

seancorfield21:07:04

I wanted to be the senior architect in a software company and oversee all large projects... from back when I was really only a junior programmer.

seancorfield21:07:54

I achieved that at Macromedia (in 2000). Since then I've been able to really just follow my interests, wherever they lead me.

borkdude21:07:33

> Since then I've been able to really just follow my interests, wherever they lead me. I feel more aligned to that as well.

seancorfield21:07:36

(I was 38 in 2000, just as I joined Macromedia, to put that in context)

seancorfield21:07:09

Part of my "plan" from my mid-/late-20's onward was to move from the UK to the USA by the time I was 40, and that happened too (in 1999).

👍 6
ordnungswidrig12:07:55

In about 2000 I was still fully into Dreamweaver And Flash and that. Ooh the memories. This was the cambric explosion of Webdesign. Nowadays all is paper flat and so textual.

seancorfield17:07:03

I used DW a lot around that time but never got into Flash (although I did spend several months working with the Flash Player team on the compiler test suite for ActionScript, toward the end of my six years at Macromedia, due to my background in compiler design and ANSI Standards for C and C++).

ordnungswidrig18:07:06

That platform worked surprisingly well.

seancorfield18:07:29

After I left Adobe, I worked for a startup that built a really cool desktop collaboration app using Flex and Air, with file sharing, chat, and 1:1 video calls. It was ahead of its time I think and we couldn't convince many customers to sign up 😐 That was back in 2008 I think.

borkdude21:07:19

My goal somewhere at the start of this decade was to become a freelance Clojure developer, remote, which I've been doing for almost 4 years now, still enjoying it.

🎯 21
👍 6
babashka 6
sveri21:07:39

I mean, following your interests is a valid goal too in my opinion, but you still know what you want. I really don't want to argue about good / bad goals either, as I don't think such a connotation exists in regards to goals, as long as you don't want to become a serial killer.

sveri21:07:08

@borkdude Are you serious about your 6 weeks?

borkdude21:07:31

@sveri Yes and no. 5 years seems like an arbitrary timespan to me. I've never pursued goals by forcing it into a timespan, just following interest and passion, the rest kind of falls out of that.

borkdude21:07:06

It can be helpful to write your dreams down and then taking action. Like any project, planning the actions is probably only doable in terms of weeks, not years.

borkdude21:07:32

At least that's how it works for me, I can't speak for anyone else.

borkdude21:07:02

I recently listened to a podcast about Shape Up, a methodology they use at Basecamp. The Basecamp person was asked why they worked in chunks of 6 weeks. Because 2 weeks sprints were too short to get anything meaningful done. And 6 weeks was about as a far as they can plan ahead, further than that just doesn't seem to work for them.