1
167
submitted 11 months ago by [email protected] to c/[email protected]

Hi all, I'm relatively new to this instance but reading through the instance docs I found:

Donations are currently made using snowe’s github sponsors page. If you get another place to donate that is not this it is fake and should be reported to us.

Going to the sponsor page we see the following goal:

@snowe2010's goal is to earn $200 per month

pay for our 📫 SendGrid Account: $20 a month 💻 Vultr VPS for prod and beta sites: Prod is $115-130 a month, beta is $6-10 a month 👩🏼 Paying our admins and devops any amount ◀️ Upgrade tailscale membership: $6-? dollars a month (depends on number of users) Add in better server infrastructure including paid account for Pulsetic and Graphana. Add in better server backups, and be able to expand the team so that it's not so small.

Currently only 30% of the goal to break-even is being met. Please consider setting up a sponsorship, even if it just $1. Decentralized platforms are great but they still have real costs behind the scenes.

Note: I'm not affiliated with the admin team, just sharing something I noticed.

2
44
submitted 5 hours ago by [email protected] to c/[email protected]
3
29
submitted 15 hours ago by [email protected] to c/[email protected]
4
15
submitted 1 day ago* (last edited 1 day ago) by [email protected] to c/[email protected]
5
8
submitted 1 day ago by [email protected] to c/[email protected]

If you were designing a standard library of a high level language (like Rust, C++, etc.) what would it do if while getting the current time of day (e.g. SystemTime::now()) it encountered a failed kernel system call (e.g. to clock_gettime) and why?

What do you think the existing implementations do?

  • Return error or raise exception
  • Return 0
  • Return undefined values (like stack garbage)
  • Panic/crash/segfault
6
383
submitted 3 days ago by [email protected] to c/[email protected]
7
80
submitted 2 days ago* (last edited 2 days ago) by [email protected] to c/[email protected]

I want clean history, but that really means (a) clean and (b) history.

People can (and probably should) rebase their private trees (their own work). That's a cleanup. But never other peoples code. That's a "destroy history"

So the history part is fairly easy. There's only one major rule, and one minor clarification:

  • You must never EVER destroy other peoples history. You must not rebase commits other people did.

[...]

If you are working with git together with other people, it's worth a read.

8
10
Constant Entropy RNG (programming.dev)
submitted 2 days ago by [email protected] to c/[email protected]

I've been trying to make an RNG that outputs data in a way that has an entropy that approaches a user defined value as the output gets arbitrarily long. I've been struggling at a certain point that I'll detail later, but the main motivation for this project is just trying to practice on a problem like this. Here's my repo.

In this post, we'll be talking about Shannon entropy. Here's a good refresher for it. If you scroll down there's examples and the equation.

Looking at the equation, when developing this algorithm we have two different input values for it: the target entropy and the number of outcomes, n. From there, we can create a probability vector of length n whose entropy is equal to the target entropy, then we can map objects to elements of the probability vector and sample indices from the vector by using the alias sampling method. From there, we have a nice algorithm for creating sequences of any type that have the target entropy.

So where's the problem? It's in actually generating the probability vector. In order to get to a V0, I implemented two functions: helpers::compute_probabilities and helpers::find_lambda. compute_probabilities creates the probability vector that has the target entropy by sampling from the exponential distribution. find_lambda repeatedly calls compute_probabilities using binary search to converge on a lambda that produces a probability vector with the target entropy. The problem line is right here:

    pub fn compute_probabilities(num_outcomes: usize, lambda: f64) -> Vec<f64> {
        let unnormalized: Vec<f64> = (1..=num_outcomes)
            .map(|i| (-lambda * i as f64).exp())
            .collect();

When calculating the actual probability values, they get exponentially smaller as the probability vector gets bigger. This works. Technically. But in the worst way. When sampling using vectors generated using this function, they realistically only sample the first few elements. That's the problem. I want to more equally distribute the probability in such a way that doesn't make the tenth value arbitrarily small but the first value really large in comparison. For reference, using this function and lambda=1, the tenth element in the vector is 5x10^-5 but the first value .37.

I figured I'd post this before I start throwing a bunch of different distributions at this function to see if anyone sees any inherent flaws with my process.

9
16
submitted 2 days ago by [email protected] to c/[email protected]
10
14
submitted 2 days ago by [email protected] to c/[email protected]
11
257
submitted 3 days ago by [email protected] to c/[email protected]
12
24
submitted 2 days ago by [email protected] to c/[email protected]

I think it's very interesting, and something i've been looking for for a very long time. Finally a programming language focused on efficiency

13
110
submitted 3 days ago by [email protected] to c/[email protected]

Well, I hope you don't have any important, sensitive personal information in the cloud?

14
42
submitted 3 days ago by [email protected] to c/[email protected]

However, there are some important features that WinSock just doesn’t expose. […]

Rust’s current async ecosystem is built atop a particularly cursed concept. It’s an unstable, undocumented Windows feature. It’s the lynchpin of not only the Rust ecosystem, but the JavaScript one as well. It’s controversial. It’s efficient. […] Without it, it’s unlikely that the async ecosystem would exist in its current form. It’s called \Device\Afd, and I’m tired of no one talking about it.

15
32
submitted 3 days ago* (last edited 3 days ago) by [email protected] to c/[email protected]

“Jujutsu (jj) is a version control system with a significantly simplified mental model and command-line interface compared to Git, without sacrificing expressibility or power (in fact, you could argue Jujutsu is more powerful). Stacked-diff workflows, seamless rebases, and ephemeral revisions are all natural with jj [...]”

Part 2 of the series is out and is here.

16
98
submitted 4 days ago by [email protected] to c/[email protected]
17
32
submitted 4 days ago by [email protected] to c/[email protected]
18
71
submitted 4 days ago by [email protected] to c/[email protected]
19
113
submitted 5 days ago by [email protected] to c/[email protected]
20
28
submitted 4 days ago by [email protected] to c/[email protected]
21
24
submitted 4 days ago by [email protected] to c/[email protected]

Today I published an update to my remote-docker project.

The purpose of this project is to run Docker on a remote computer while providing container access to specific parts of your local filesystem with X11 support.

For example, you can use this to run your browser inside a container and only give it access to your ~/Downloads folder.

Access is over SSH (and SSHFS) and Docker is not installed on your workstation, just a few bash scripts.

Feedback (and patches .. Ha!) welcome.

Have fun!

O

22
14
submitted 4 days ago by [email protected] to c/[email protected]
23
40
submitted 5 days ago by [email protected] to c/[email protected]

I am a senior java developer in the cloud/distributed arch/ microservice area.

I've touched on golang in the past, but not learnt it in any formal/extensive way.

I see it cropping up in many java/microservice positions, and I'm curious if this is at some point going to overtake java in my area.

The current benchmarks seem to suggest that if autoscaling is key to your services, golang is the way to, well, go.

I looked at the job market and it doesn't yet seem to have taken over, but I'm curious how this is likely to play out over the next decade and if quakus for example is likely to become more competitive against golang. Interestingly, golang specific roles on average pay less than java ones in my area.

Let me know your thoughts or if you have any good articles / content on the subject.

24
0
submitted 2 days ago by [email protected] to c/[email protected]

@programming Unpopular opinion: 95% percent of all modern programming langueges are either bloated/proprietary/unneccesarily complex. pretty sure C & assembly can do it all (even for web development, just compile c to WebAssembly)

25
13
submitted 5 days ago by [email protected] to c/[email protected]
view more: next ›

Programming

21981 readers
127 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS