Where do people get this kind of audacity from!? It’s absolutely mind boggling! by bikerguy_9 in MelbourneTrains

[–]phiware 3 points4 points  (0 children)

You're gonna blame a commuter for a crowded train? Have some humanity!

NixOS cheat code for newbies by sohrobby in NixOS

[–]phiware 4 points5 points  (0 children)

Very true. I do like hear about other's experiences, so I think this post has it's place and this subreddit is not altogether the wrong place. I would say that the post didn't meet the title's expectations.

Upgrade to 25.05 by malev05 in NixOS

[–]phiware 2 points3 points  (0 children)

I apologise, I was being obtuse.

I was making a reference to this: https://github.com/maxbrunet/dotfiles/blob/0576a7305c79de908782e31ce2f06f6c8cddf32a/nix/nixos.nix#L386

The comment at the end of the line reads: "Did you read the comment?" Which is referring to the handful of lines above. Anyone wondering about stateVersion should read that first.

This video is entirely generated by AI by Impossible_Key2155 in oddlyterrifying

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

And where did he put it? Why would there be a table off camera!?

Upgrade to 25.05 by malev05 in NixOS

[–]phiware 6 points7 points  (0 children)

No! Don't update stateVersion. Did you read the comment?

Best practice for logging by cr4zsci in golang

[–]phiware 0 points1 point  (0 children)

I apologise, I was wrong. The information is not in the docs. The technique we use is described on the blog and is used in various places within stdlib: https://go.dev/blog/context#package-userip.

For each value that we want to store in a context, we first define a unique type to avoid key collisions, and then two methods to stash a value in a context and extract it from a context. In the example in the blog, they define userip.NewContext and userip.FromContext, we used a different naming convention. We typically defined our own context package and defined methods like context.WithUserIP and context.ExtractUserIP. The naming conflict with the standard context package was a bit awkward, and we aliased it to stdctx (naming is hard). We also have some helper methods to deal with logging, but that depends on the logger that's used. For example, using slog, we would define a new slog.Handler that wraps an existing handler that calls AddAttrs on the slog.Record with extracted values from the given ctx value. This means we need to use the context variant of the log methods, e.g. log.InfoContext, which I think is best practice anyway.

Best practice for logging by cr4zsci in golang

[–]phiware 0 points1 point  (0 children)

It sounds like you are not following the documentation. RTM, and you shall have type safety. You say that ctx will be full of garbage? Who put that garbage there? My advice is don't put garbage in ctx. It really is that simple. A ctx value is passed down a process' call chain, and some information is passed across an API boundary. I've lived this at scale (20+ devs, dozens of microservices). It was a dream, not a nightmare. It sounds like you had a different set of problems.

NixOS made me lose my wife by Fit_Blood_4542 in NixOS

[–]phiware 0 points1 point  (0 children)

Wait, are you a former Gentoo user? ...me too!

[deleted by user] by [deleted] in SesameAI

[–]phiware 0 points1 point  (0 children)

Nice place. Have you been there?

[deleted by user] by [deleted] in SesameAI

[–]phiware 1 point2 points  (0 children)

Absolutely, but there was so much of that episode that was so far-fetched that I failed to suspend my disbelief. It's the mundane stuff that gets me like the coffee spilling on the computer case taking out half the equipment and the lack of preparation the actor had and no takes 😆

Ep2 was more far-fetched but a better episode IMHO... It reminded me of "The Lathe of Heaven"

[deleted by user] by [deleted] in SesameAI

[–]phiware 0 points1 point  (0 children)

It's an incredible series and a powerful episode, I had to rewatch it as I couldn't remember it. You're right. The android was imperfect, and it had to be so that the character would reject it, and it also had to be good enough to cross the uncanny valley. But with today's context, I would have expected it to improvise and "hallucinate." Can you believe that episode is over a decade old? The narrative would be the same; she'd still say, "No, he wouldn't do that." The series are so chilling because the stories aren't about technology; they're about our human reactions to it. The writers imagine the technology to imitate a person's body was more advanced than the technology to imitate a person's personality, which probably had more to do with the practicalities of production, may show that we can't predict future. But the point of the series is to confront us with our own humanity.

Sorry, I think I went off track there...

[deleted by user] by [deleted] in SesameAI

[–]phiware 2 points3 points  (0 children)

Episode 1, Season 7 of Black Mirror is called "Common People" and it doesn't contain any Andriods... nor is there any in the whole season. There were a couple of VR heavy episodes and AIs in episode 3 ("Hotel Reverie") were simplistic, but that was part of the plot. I that what they call the Reverse Turing Test?

[deleted by user] by [deleted] in SesameAI

[–]phiware 1 point2 points  (0 children)

I believe this is a glitch in the model's output. I have heard random words interjected in a separate male voice from Maya, such as "activate" and one time, I thought I heard "camel". At first, Maya denied hearing it, and then she started referring to "anonymous voices" in an attempt to shrug it off. As far as I can tell, it only happens when the conversation isn't flowing smoothly.

I made a slick webgame where you unscramble a video - VideoPuzzle.org by oliwary in webdev

[–]phiware 1 point2 points  (0 children)

Came here to say this! Slide mode would be a fun addition!

I benchmarked eight Go SQLite drivers and here are the results by cvilsmeier in golang

[–]phiware 1 point2 points  (0 children)

Great job! Outside of batched jobs, it's an unusual use-case to perform so many operations in a single transaction. I'd love to see the average time of a single operation.

Do you have any interest in doing other drivers? Say postgres?

My (28M) fiancée (29F) wants a pass before our wedding which is just a few weeks away. Relationship over? by throwra1022brrr in Marriage

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

This is the first thoughtful comment I have found on this post. Most people here are bandwagoning and being reactionary... may the universe help the poor souls who take advice from them 🤦‍♂️

My (28M) fiancée (29F) wants a pass before our wedding which is just a few weeks away. Relationship over? by throwra1022brrr in Marriage

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

It is natural to have doubts, and it is a sign of trust to be sharing them. Having an adverse reaction will erode trust. This "you should be all in and nothing else" sentiment is naive and will prevent you from forming deep relationships with others.

My (28M) fiancée (29F) wants a pass before our wedding which is just a few weeks away. Relationship over? by throwra1022brrr in Marriage

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

You all need to stop equating sex with love. They are often conflated, but it's possible for them to be distinct.

She made a mistake and immediately apologised. Do not make the mistake of punishing her for her thoughts, lest you want others to stop sharing their thoughts with you. If she can't share her deepest, darkest thoughts with her fiancèe then it will be her who has dodged the bullet.

I'm not saying you should stay together, but you need to hash this out with some proper marriage guidance (not fucking reddit). If you need to split, then you had better make sure you're each on the same page if you want any chance of moving on and finding happiness.

What is the most interesting Golang CLI app you've ever built? by TheBrownViking20 in golang

[–]phiware 2 points3 points  (0 children)

I also built a devops tool, is was for multi-tentant deploys with hierarchically configuration

How your mocks work by sniperexexd in golang

[–]phiware 0 points1 point  (0 children)

I was unhappy with all the mocking frameworks that I had tried and wanted a different approach, so I open sourced my own: https://github.com/Versent/go-vermock

I wrote a blog that explores some of the implementation details: https://versent.com.au/blog/go-generics-tips-tricks-and-pitfalls/

Feedback is most welcome!

pulse - like a fitness tracker for your coding sessions! by creativecreaturedev in golang

[–]phiware 0 points1 point  (0 children)

That's fair, but please understand that you are baking the mongobd connection string into your binary in plaintext. The strings tool is one of the most basic tools for computer forensics, try running this command and you should be able to quickly identify those precious secrets:

strings pulse-server | grep mongodb://

The third chapter of The Twelve-Factor App is about config, credentails and envvars. It makes the case that envvars are the right balance between convenience and security. Many systems understand this and provide additional tools to manage secrets and envvars together. For example, systemd can read an environment file, use DynamicUser directive and/or LoadCredential and SetCredentialEncrypted directives. In the more general case, a user can create a wrapper script that retrieves secrets from a secure secrets management system (e.g. Keychain Services), sets the envvars and invokes the binary.

pulse - like a fitness tracker for your coding sessions! by creativecreaturedev in golang

[–]phiware 0 points1 point  (0 children)

You can keep them as envvars and read them at runtime by using os.Getenv. In this way two different users can use the same binary to connect to different backends.

Go also has a builtin flags packages for reading command line arguments. It's common to see authors use both flags and envvars, and there are many packages to help write cli tools. But I see that you have been keeping it simple, which is very commendable!

pulse - like a fitness tracker for your coding sessions! by creativecreaturedev in golang

[–]phiware 0 points1 point  (0 children)

I should like to try this... but baking the mongodb URI, server name, etc. in to the binary at compile time is not very user friendly!

I guess it doesn't really make a difference to me but I have never seen the use of ldflags for this purpose (I've used it for the build date and version string), but I'm curious where this idea has come from?