mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.2K
active users

#programming

525 posts356 participants58 posts today

What if there was a widely agreed upon programming language specifically designed for use in law? Like, imagine a language that makes understanding legal documents easier, even if you aren't a programmer. Maybe something similar like Python, Nix, or Lua. One added bonus is you could have a program that steps through a programmed legal document, and you can declare variables also in the programmed legal document and see where the different conditionals lead to so that you get a definitive outcome.

Hello, I’m a #newbiehere and I’m posting because I’d like to share something.

As an old IT guy, I want to share a script that makes life easier for (home) admins when a “curl” or “wget” fails during certificate (#SSL / #TLS) verification.
This doesn’t happen very often, so I always forgot what to do, when it did happen.

The script checks which certificates are missing and downloads them, so you can add them to your list of CAs (certification authorities) if needed. How to do this is explained in my accompanying documentation.

Maybe just take a look and see if it’s useful to you.

Of course it’s #opensource, described at github.com/himbeer-toni/UserSc, where you’ll also find a download link.

I’d be glad if it helps someone!

#opensource #programming #debian #linux #RasPi #sysAdmin #git #github #selfhost #selfhosted #selfhosting
#opensource #foss #homelab #homeserver #software #raspi #RasPi #sysAdmin #TLS #SSL #certificates
@digitalcourage
@linuxnews

Using local Ai to write Rust code, to delete all serde_json null value keys

beehaw.org/post/21284053

beehaw.orgUsing local Ai to write Rust code, to delete all serde_json null value keys - BeehawSo here is the thing: I am normally against using Ai tools in programming in generative manner. But I asked an agent to write one for me, because I could not solve it myself and could not find a solution looking in the internet. I disclosed in the comments for this function that it is “written” by an ai. But I don’t know how I can take that code and license it on my own terms, if I am not the copyright holder. Its a small hobby CLI app for extreme niche use case. The tool itself is written in Rust and has yet to be finished and uploaded. Its working with a specific Json based data format. The problem was, I needed a functionality to delete a specific named key from a list of serde_json::Value. And the simplest idea and solution I got was to first set each of these values for the source key to Value::Null and then delete each key/value pair with a null value. My code: rust pub fn remove_source_from_items(&mut self) { for item in self.data["items"].as_array_mut().unwrap() { item["source"] = Value::Null; } match &mut self.data["items"] { Value::Object(map) => { // Collect keys to remove first to avoid borrowing issues let keys_to_remove: Vec<String> = map .iter() .filter_map(|(k, v)| if v.is_null() { Some(k.clone()) } else { None }) .collect(); for key in keys_to_remove { map.remove(&key); } // Recursively process remaining values for value in map.values_mut() { remove_null_values(value); } } Value::Array(arr) => { for item in arr.iter_mut() { remove_null_values(item); } } _ => {} } } remove_null_values(): However I could not figure out how to delete them in bulk and finally asked the Ai model to solve this for me. This is what it wrote and it does what it should do and it is performant too. It even set a few comments (but the top header comment is from me off course): rust // Generated by local Ai: // Devstral Small 2507 // 24B, Q6_K // July, 2025 fn remove_null_values(value: &mut Value) { match value { Value::Object(map) => { // Collect keys to remove first to avoid borrowing issues let keys_to_remove: Vec<String> = map .iter() .filter_map(|(k, v)| if v.is_null() { Some(k.clone()) } else { None }) .collect(); for key in keys_to_remove { map.remove(&key); } // Recursively process remaining values for value in map.values_mut() { remove_null_values(value); } } Value::Array(arr) => { for item in arr.iter_mut() { remove_null_values(item); } } _ => {} } } Overall this answer was done in a few minutes on my Linux PC with RX 7600 8GB, by the model disclosed in the comment. BTW, when I experimented I was close to this solution as well! But just could not figure it out. If anyone has a better solution, I am open for it. But this is going a bit over my head. This is my second attempt in using an Ai model and I feel ashamed of it. Because I should have spent the time to learn and do it myself instead. But here we are.

Optical Character Recognition, OCR: This should be easy in 2025, in particular with a software supposedly workable already in 1996 and developed since then.

I am using the tesseract command line (version 4.1.1) as it is readily available on my Ubuntu. I tried a variety of command line flags. The best output I got so far is:

OPEEEOD

where you must squint hard on the image to see the resemblance.

Any hint appreciated on how to tweak the command line.