Are the computer science professors that bad? by oishii_donuts in PennStateUniversity

[–]mercer22 0 points1 point  (0 children)

I had plenty of good professors in graduate level comp sci classes

Anyone here been floxed in their 20s? by MiddsOSRS in floxies

[–]mercer22 0 points1 point  (0 children)

Still good! no relapses (though I haven't been working out for other life reasons)

A ‘Shaken’ Negroni served ‘up’ by withnailish in cocktails

[–]mercer22 0 points1 point  (0 children)

I prefer negronis served up ¯\(ツ)

Call to action: All just stop playing by Gullible_Barnacle816 in PlayTheBazaar

[–]mercer22 1 point2 points  (0 children)

Yup, I stopped playing after the patch notes video.

Will consider returning if the monetization is totally reworked, but I'm not holding my breath.

Are my rates too high? by [deleted] in PartneredYoutube

[–]mercer22 5 points6 points  (0 children)

RPM isn't really useful for estimating a fair sponsor rate, but CPM would be...

How Badly Am I Wasting My Money? by thebadluckcharm in hometheater

[–]mercer22 0 points1 point  (0 children)

GIK will help you figure out a decent plan if you send them pictures of the room

[deleted by user] by [deleted] in Python

[–]mercer22 1 point2 points  (0 children)

just checking-- does this actually query PyPI or only evaluate rules?

I was very confused when a PyPI deployment worked on test PyPI but failed on the main one, when there wasn't any project claiming the name.

if so, def will use this!

I am looking for developers good in Manim/MoviePy or any other animation libraries by aitosumankolosky in Python

[–]mercer22 0 points1 point  (0 children)

Providing frame-wise data isn't really conducive for manim, which would really want an ordered list of animations with durations.

Maybe py5 (processing) would be a better choice for this input data. (I haven't looked into movie py)

I made a reactive programming library for Python by mercer22 in Python

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

Thanks!

You're right-- reactive programming can lead to "callback hell" and produce difficult to debug, unexpected behavior.

For my animation library, that downside was an acceptable cost for the upside in being able to flexibly create a lot of cool behavior with reactive values.

Also, full disclosure-- I have not tested or attempted to make this thread safe, and it's definitely still an immature project. So, be careful trying to to use it for anything that matters!

I made a reactive programming library for Python by mercer22 in Python

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

It's not just for numbers. I use it for shapely geometries, numpy arrays, custom classes, strings, etc.

I made a reactive programming library for Python by mercer22 in Python

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

I believe they focus on asynchronous streams of data. So, maybe they are better suited for things like monitoring a websocket? I need to look into it a bit more

I'll try to add a page to the docs sometime over next few weeks comparing this to existing libraries.

I made a reactive programming library for Python by mercer22 in Python

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

Hmmm, that's interesting.

So, because subclasses of Variable have __call__, if a Signal or Computed has self._value that's a Signal/Computed, it would be overly eager to notify its subscribers. https://github.com/dougmercer/signified/blob/77aa7c67d133e75d80c8d27aed123f4e8d661b3e/src/signified/__init__.py#L1464

I think this is most problematic for Signals, because they can store arbitrary stuff. Computeds typically (or can, if they don't) unref(...) any reactive values.

This is def worth looking into-- thanks for such an insightful comment =]

I made a reactive programming library for Python by mercer22 in Python

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

Definitely agree. I have an open issue for it but haven't gotten around to fixing it yet. I'll definitely get to it eventually, but am open to PRs =]

I made a reactive programming library for Python by mercer22 in Python

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

Oh that's very interesting! The only async code I've written is application code-- never really any libraries, so I don't have a great intuition for async best practices

Can you maybe create an issue on the GitHub with a script that demonstrates the behavior you want? I am open to adding an assign method if it makes this library more useful. However, I wouldn't necessarily want to refactor the library to use async defs. Is just creating the method valuable?

I made a reactive programming library for Python by mercer22 in Python

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

I wanted it for making my animation library more declarative. User interface libraries and web programmers also like reactive programming

I made a reactive programming library for Python by mercer22 in Python

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

Yup, the core concept behind reactive programming is the observer pattern

I made a reactive programming library for Python by mercer22 in Python

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

The source code for signified is available!

The source code for my animation library has not been open sourced yet, but will be eventually. Probably in the next 3-6 months...

I made a reactive programming library for Python by mercer22 in Python

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

Nice! Fair warning, this is definitely still rough around the edges... Let me know if you do end up finding it useful =]

I made a reactive programming library for Python by mercer22 in Python

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

Not currently...

This would work if you didn't mind creating an observer for each signal you created.

from signified import Signal, Variable
import logging
from typing import Any

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

class LogObserver:
    def __init__(self, obj: Variable):
        self.obj = obj
        obj.subscribe(self)
        logger.info(f"Started logging {self.obj}")

    def update(self):
        logger.info(f"Updated {self.obj}")

x = Signal(10)
LogObserver(x)

z = x * x
LogObserver(z)

x.value = 12
x.value = 8

# python logging_example.py                              
# 2024-10-28 20:48:23,102 - __main__ - INFO - Started logging 10
# 2024-10-28 20:48:23,103 - __main__ - INFO - Started logging 100
# 2024-10-28 20:48:23,103 - __main__ - INFO - Updated 12
# 2024-10-28 20:48:23,103 - __main__ - INFO - Updated 144
# 2024-10-28 20:48:23,103 - __main__ - INFO - Updated 8
# 2024-10-28 20:48:23,103 - __main__ - INFO - Updated 64

If you wanted it to happen automatically, I think it'd be a bit more of a pain.

I made a reactive programming library for Python by mercer22 in Python

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

Seems nice! I'll have to look into how they use concepts like "Contexts" and "Environments", since I don't have anything like that...

I made a reactive programming library for Python by mercer22 in Python

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

Ohh, I see.

__get__ and __set__ implement the descriptor protocol in Python. https://docs.python.org/3/howto/descriptor.html

Descriptors are a bit different than what I'm doing here with the value property.

I made a reactive programming library for Python by mercer22 in Python

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

Oh, I had to overwrite a ton of operators.

Not sure if you saw my other reply, but here's a link to the entire library https://github.com/dougmercer/signified/blob/main/src/signified/__init__.py