12
submitted 9 months ago by aloso@programming.dev to c/rust@programming.dev

l just released a new version of to-html. I created to-html a few years ago for my blog. It is very easy to use: When you want to include the output of a command on a website, run it with to-html:

to-html "cargo clippy"

Then copy and paste the output into your website. to-html comes with some options to customize its output. Starting with this release, you can create a configuration file, so you don't need to repeat the same CLI arguments every time you use to-html. This release also adds shell completions, a way to customize terminal colors via CSS, and a flag to not print the shell prompt. A big thank you to the contributors who implemented these features!

21
submitted 10 months ago by aloso@programming.dev to c/rust@programming.dev

Author of Pomsky here. Feel free to ask me anything!

[-] aloso@programming.dev 7 points 11 months ago* (last edited 11 months ago)

If all you do in the Err(e) => ... match arm is returning the error, then you absolutely should use the ? operator instead.

If the match arm also converts the error type into another error type, implement the From trait for the conversion, then you can use ? as well.

If you want to add more information to the error, you can use .map_err(...)?. Or, if you're using the anyhow crate, .with_context(...)?.

[-] aloso@programming.dev 7 points 1 year ago

"secure" is relative. They may not be e2e encrypted, but they are still encrypted via TLS, like any HTTPS traffic. It's the same encryption used for online banking. If you care about your instance admin being able to read your messages, you should use Signal or a Matrix client though.

But remember that only a few years ago, almost nobody used e2e encryption, and it wasn't much of an issue.

[-] aloso@programming.dev 10 points 1 year ago* (last edited 1 year ago)

The name "pull request" is actually more accurate, because you ask the upstream repository to git pull the changes from the downstream repo.

[-] aloso@programming.dev 9 points 1 year ago

It is so frustrating when a conspiracy narrative is mixed with valid criticism, which ultimately only taints the criticism by association with the "conspiracy."

[-] aloso@programming.dev 9 points 1 year ago

I guess it cannot be done if their IT infrastructure was not designed with that use case in mind. Although I'm not familiar with human resource management software, I don't find this hard to believe at all.

Also, you'll understand what Biron Tchaikovsky meant with "Please believe me" when you look at their email address. They already tried to do it, and probably complained many times before giving up.

[-] aloso@programming.dev 89 points 1 year ago

Oh, didn't the domain somesoftwarecorp.com give it away?

[-] aloso@programming.dev 6 points 1 year ago

Lemmy is like Reddit, which is used a lot to ask questions and get help. But StackOverflow fills a different niche, it's meant to be useful to as many people as possible and stay up to date. This is why

  • there's a distinction between "comments" and "answers" (comments can be used to request additional information, and for meta discussion)
  • both questions and answers can be modified by other users, for example to
    • add more information, or remove unnecessary details
    • correct outdated information
    • fix typos and formatting
    • rephrase sentences that are confusing
  • a question can be closed as duplicate, so people always find the oldest thread of the question with the best/most detailed answers
  • before submitting a question, you get a list of related questions to avoid creating a duplicate question
  • questions have tags, making them easier to search for
[-] aloso@programming.dev 12 points 1 year ago* (last edited 1 year ago)

Iframes cannot access the main frame's DOM if the iframe is from a different origin than the main frame, and they never share the same JavaScript execution context, so an iframe can't access the main frame's variables etc.

It's not required that iframes run in a different process, but I think they do at least in Chrome and Firefox if they're from a different origin. Also, iframes with the sandbox attribute have a number of additional restrictions, which can be individually disabled when needed.

[-] aloso@programming.dev 13 points 1 year ago

They still have their place; for example to embed Google Maps or a YouTube video. Generally, whenever you want to embed something from a different website you have no control over, that shouldn't inherit your style sheets, and should be sandboxed to prevent cross site scripting attacks.

[-] aloso@programming.dev 18 points 1 year ago* (last edited 1 year ago)

I do not use AI to solve programming problems.

First, LLMs like ChatGPT often produce incorrect answers to particularly difficult questions, but still seem completely confident in their answer. I don't trust software that would rather make something up than admit that it doesn't know the answer. People can make mistakes, too, but StackOverflow usually pushes the correct answer to the top through community upvotes.

Second, I rarely ask questions on StackOverflow. Most of the time, if I search for a few related keywords, Google will find an SO thread with the answer. This is much faster than writing a SO question and waiting for people to answer it; and it is also faster than explaining the question to ChatGPT.

Third, I'm familiar enough with the languages I use that I don't need help with simple questions anymore, like "how to iterate over a hashmap" or "how to randomly shuffle an array". The situations where I could use help are often so complicated that an LLM would probably be useless. Especially for large code bases, where the relevant code is spread across many files or even multiple repositories (e.g. a backend and a frontend), debugging the problem myself is more efficient than asking for help, be it an online community or a language model.

[-] aloso@programming.dev 6 points 1 year ago

We have pointers in Rust, too :) see documentation

view more: next ›

aloso

joined 1 year ago