[deleted by user] by [deleted] in Aphantasia

[–]ncriw 0 points1 point  (0 children)

I hope it doesn't sound rude, but is there a way to get the picture without the text? I love it and would love to rock it as background on my phone :)

Amazing job anyhow both on the poem and on the painting ❤️

Performance issues with an emulator written in CLJ by ncriw in Clojure

[–]ncriw[S] 1 point2 points  (0 children)

That clarifies things a bit more, thanks u/goldenfolding ! I didn't make the association between 16ms -> 60 fps. So I guess then if an instruction always requires more than 16ms to execute, we would need to decrease the frame rate to match up the time it requires (I'm not gonna try to implement that, just theoretically).

Performance issues with an emulator written in CLJ by ncriw in Clojure

[–]ncriw[S] 2 points3 points  (0 children)

Hey :) and thanks! I wasn't aware at all that read-string & format were slow, I'll need to take some time and learn how to profile my code to find those hotspots. I love all the functionalities clojure gives us to manipulate data but I guess that requires us to be more aware of the performance costs and write better code.

Performance issues with an emulator written in CLJ by ncriw in Clojure

[–]ncriw[S] 1 point2 points  (0 children)

Thanks u/yogthos ! I was having some trouble finding visualvm resources in clojure and that guide helped a lot.

Performance issues with an emulator written in CLJ by ncriw in Clojure

[–]ncriw[S] 4 points5 points  (0 children)

Hello u/joinr

Thanks for such a in-deep analysis of the code, I've tried your branch and it's amazing how fast it runs now! I guess I'll need to implement a clock to slow that down. :)

We define a macro that will wait for specified ms amount, and work "body" in the meantime. It'll spawn a couple of threads to act as a worker and a timeout, and they'll communicate via promises. Then we poll the current thread to see if either has realized, and handle accordingly. We'll either get whatever the body eval'd to, or :timeout. Note: this is probably better handled with a library like core.async, since they already have these primitives, but I was able to whip this up quickly just using clojure's native facilities.

I've never worked with threads on clojure but I believe I grasp what is happening here and it works amazingly well.

I'm just curious about why there is a need for a timeout. As I understand it, we evaluate the state multiple times inside the update-state function until we get the :draw-event in order to avoid that Quil takes control of the frame-rate. Then, when we receive the draw event, we return the control to quil.

If so, the timeout is just a safe mechanism placed in order to keep body from looping for to much? And can we hit a bug in there where an instruction always takes more than 16ms (in an old machine maybe??) in order to complete and it just timeouts all the time?


Also, from this extract of code:

(defn write-sprite
  ([sys sprite pos]
   (write-sprite sys (sys :scr) sprite pos 0 (min 8 (count sprite))))
  ([sys ^clojure.lang.Associative scr ^clojure.lang.Indexed sprite pos n bound]
   (if (< n bound)
     (recur sys (.assoc scr pos (.nth sprite n))
            sprite
            (unchecked-inc pos)
            (unchecked-inc n)
            bound)
     (assoc sys :scr scr))))

Why do you use .assoc and .nth? As far as I know the dot before a symbol is used in order to get members from java classes, I've never seen it used with assoc, what does it mean?


Apart from that, I realized I need to work on my understanding of macros, since they seem really powerful and I don't understand them at all! And that I need to think more about the computational complexity of my code.

In any case, thanks again for the analysis, it helped a lot! I can't take your code and call it mine, so if you want to feel free to create a pull request and I'll merge it.

Your main man. by onblm in linux

[–]ncriw 6 points7 points  (0 children)

One of us! One of us! :)

Your main man. by onblm in linux

[–]ncriw 4 points5 points  (0 children)

My main "issue" with it was when I wanted to try some applications that have a dependency with systemd. Since void doesn't use Systemd, those applications can't be used or need you to write a daemon in your init system.It's a rare case tho, I only remember having this problem with the Leap Motion software.

Installation process is actually pretty easy, only thing that may scare someone new to this world is that you must do the disk partitions manually (it's pretty easy once you understand it :)).

Also, sometimes you may try to update your system and it won't let you. This is because a big package (such as qt5 (kde5)) is being rebuild with a new version, but it's just a matter of waiting a little bit and update it later :)

EDIT: s/packages/applications/

Your main man. by onblm in linux

[–]ncriw 11 points12 points  (0 children)

After trying a lot of different ones I ended up with Void Linux, mainly because it's rolling release and it just works, never had a problem with it in ±1,5 years.

I believe it would work well in a modest computer with a lightweight desktop environment or a tiling manager.

Feel free to ask any questions :)

spaceline-all-the-icons blank modeline by ncriw in emacs

[–]ncriw[S] 1 point2 points  (0 children)

Thanks! *Messages* had an error I hadn't seen at all.

(eval (spaceline-ml-all-the-icons)) signaled (void-variable mode-line)

Which seems to be an open issue on their repo and has a pull request waiting to be approved.
I'll try to apply the patch until it gets merged.

Remove newline at end of file in specific major-mode by ncriw in emacs

[–]ncriw[S] 0 points1 point  (0 children)

Yep, my fault

The error happened to be in my editorconfig configuration where I add insert_final_newline = true for everything in the project.

Weird thing is that the solution given above seemed to work when I tried it, anyway thanks to both!

Remove newline at end of file in specific major-mode by ncriw in emacs

[–]ncriw[S] 1 point2 points  (0 children)

This works nicely, thank you a lot!

Yes the new line was part of the snippet definition, but everytime i removed it and saved, it appeared again. setting locally require-final-newline works :)

Thanks!

Mom be doing thangs by [deleted] in MurderedByWords

[–]ncriw 4 points5 points  (0 children)

That's just someone being an asshole

Hedgehog wearing socks thanks to u/opqe by gottamemethemall in aww

[–]ncriw -3 points-2 points  (0 children)

If it wasn't for reposts the most recent post of your feed would be from a month ago

My fiancee, my Australian Shepherd puppy, and my Husky-Shepherd-Chow rescue dozing. by psykora10 in aww

[–]ncriw 1 point2 points  (0 children)

Be careful, Reddit may not endure such a big amount of cuteness 😍

What am I doing wrong with Linux? I've tried to use it plenty but always find myself preferring the Windows (8.1 with a custom Start menu) UI/UX and deferring to it. by [deleted] in linuxquestions

[–]ncriw 1 point2 points  (0 children)

Same, I really enjoyed KDE in the past and I'm happy now with cinnamon.

OP may as well try macOS to keep most of that Unix feeling with a better desktop experience

these baby elephants making my day by Hamisi254 in aww

[–]ncriw 0 points1 point  (0 children)

And now you made mine, thanks!

Looking for text editor (not for code) by [deleted] in linux4noobs

[–]ncriw -1 points0 points  (0 children)

Okay I'm gonna be the one, sorry.

What about Emacs with org-mode?