You upvote because you are horny, I upvote because there is a funny joke. We are not the same.
- 1 Post
- 121 Comments
This one, I believe.
Metal piercing has much lower resistance than skin. The less resistance the path is, the more current will flow on that path. So, even if you spit on the piercing and lick it to your heart’s content, the path of least resistance between two battery contacts will still be that metal rod instead of your skin. In other words, the probablility of a miniature skewer cosplay happening is much higher than that of an electrocution.
TwilightKiddy@programming.devto Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.com•How did you learn languages to navigate this world, pirates ?English7·12 days agoThat’s exactly why you want to do this. When people speak casually or are making jokes, nobody speaks with grammar in mind. Gathering this intuition for the language is exactly what I’m looking for when learning.
TwilightKiddy@programming.devto Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.com•How did you learn languages to navigate this world, pirates ?English6·12 days agoYou just look for people who are interested to learn your language, any place where people communicate can work. Maybe hit some groups for learning the language you know and try to find people who speak the language you want there.
I personally play VRChat, there are a number of language learning groups there. Though, the culture of the place is certainly not for everyone.
TwilightKiddy@programming.devto Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.com•How did you learn languages to navigate this world, pirates ?English361·13 days agoNot really about piracy, but doing language exchanges is a great way to learn a language. You teach someone your language, they teach you theirs. It’s free and it gives you more knowledge than any book. Natural languages don’t work with strict rules usually, natives speak by feel, the only way to learn that feel is by interacting with people.
TwilightKiddy@programming.devto Fuck AI@lemmy.world•I support AI slop and I support pedophilesEnglish1·1 month agoI don’t like the last part.
TwilightKiddy@programming.devto Linux@programming.dev•CachyOS July 2025 Update Finally Lets Users Choose the Shell During InstallationEnglish3·1 month agoWhile I see the analogy, saying “CachyOS to Arch is like Ubuntu to Debian” with a straight face is not something I can do. If you try to interact with an Ubuntu install like it’s Debian, you’ll get very frustrated very quickly. If you try to interact with a CachyOS install like it’s Arch, you probably won’t even notice you are not on Arch, besides a couple of different package names.
TwilightKiddy@programming.devto Linux@programming.dev•CachyOS July 2025 Update Finally Lets Users Choose the Shell During InstallationEnglish2·1 month agoThey use their own repos, but they don’t hold back the packages. The reason for having separate repos is recompiling packages for newer architectures. It gives a little performance boost for most of them. AUR works totally fine.
Install Gentoo.
TwilightKiddy@programming.devto Anime@lemmy.ml•RWBY Fan Character - Nathaniel Silver-RoseEnglish2·2 months agoRWBY is the name of the show. Though, it’s not an anime in the strict sense of the word, was made by RoosterTeeth and almost completely CGI, as far as I’m aware.
It’s a decent show, mostly because they used their CGI stuff to incorporate pretty choreography into battles and their sound design is cool, but with RoosterTeeth now practically dead, I doubt we’ll ever get to see the end of it, sadly.
TwilightKiddy@programming.devto Linux@programming.dev•Share a script/alias you use a lotEnglish6·2 months agoWouldn’t say I use it often, but this thing resolves a domain name to an IP address:
function resolve() { case $1 in -4) getent ahostsv4 $2 | grep STREAM | head -n 1 | cut -d ' ' -f 1 ;; -6) getent ahostsv6 $2 | grep STREAM | head -n 1 | cut -d ' ' -f 1 ;; -p) getent hosts $2 | head -n 1 | cut -d ' ' -f 1 ;; *) getent ahosts $1 | grep STREAM | cut -d ' ' -f 1 | sort -u ;; esac }
All my aliases are just default arguments for programs or shorthands for my other scripts, most of which are specific for my setup.
This is a very good argument for
ffmpeg
andffprobe
, by the way:alias ffmpeg="ffmpeg -hide_banner" alias ffprobe="ffprobe -hide_banner"
TwilightKiddy@programming.devto Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.com•Resurrecting a dead torrent tracker and finding 3 million peersEnglish21·2 months agoBitTorrent breaks your data in blocks, each block is hashed, their sizes are known. Assuming you got your
.torrent
file from a legitimate source, it’s practically impossible to receive something else, as long as your client does all the checks properly.In theory, it is possible to write malware that will collide hashes with some other content, but considering you are restricted to the size of the actual content, it’s extremely unlikely that out of all the millions of
.torrent
s we created so far we can find even one for which it is possible.And even if you win this absolutely bizzare lottery, you’ll be competing with legitimate peers for serving the blocks. If at least one block that you care about is not served by you, the recepient will just get corrupted content that won’t be dangerous in any way. In other words, you need to have so much bandwidth, that you serve everything before anyone else can serve even one significant block. At which point you will probably have to spend a lot more money on that than you’ll ever get from whatever malware you are trying to serve.
.for_each(|((_, _, t), (_, _, b))| { ... }
This is actually fairly similar to what C# has.
This is a closure syntax:
| arguments | { calls }
In C#, the closest is lambda expressions, declared like this:
( arguments ) => { calls }
Parentheses are tuple deconstructors. In C# you have exactly the same thing. Imagine you have a method that returns a two element tuple. If you do this:
var (one, two) = MethodThatReturnsATuple();
You’ll get your tuple broken down automatically and variables
one
andtwo
declared for you.First of all, I’m using
.zip()
to pair the rows of the picture by two, that returns a tuple, so, I have to deconstruct that. That’s what the outer parentheses are for. The pixel enumeration stuff I’m using returns a tuple(u32, u32, &Rgba<u8>)
first two values are x and y of the pixel, the third one is a reference to a structure with color data. I deconstruct those and just discard the position of the pixel, you do that with an underscore, same as C#.I’m not that far into learning myself, but I’m not a textbook learner at all. Poking around opensource projects and wrestling with the compiler prooved to educate me a lot more.
As an extra optimization, if top and bottom colors of a pixel match, you can just output space and only set background color. Implemented correctly, this can save a lot of memory. Didn’t want to make the code more complex in fear of people being scared of running it.
I gladly present you this jank.
You might need these to compile:
cargo add image cargo add clap --features derive
And the jank itself:
Some Rust code
use std::path::PathBuf; use clap::Parser; use image::{ imageops::{self, FilterType}, ImageReader }; #[derive(Parser)] struct Cli { path: PathBuf, #[arg(short = 'H', long, default_value_t = 30)] height: u32, #[arg(short, long, default_value_t = 0.4)] ratio: f32, #[arg(short, long, default_value_t, value_enum)] filter: Filter, } #[derive(clap::ValueEnum, Clone, Default)] enum Filter { Nearest, Triangle, Gaussian, CatmullRom, #[default] Lanczos3, } fn main() -> Result<(), Box<dyn std::error::Error>> { let args = Cli::parse(); let filter = match args.filter { Filter::Nearest => { FilterType::Nearest }, Filter::Triangle => { FilterType::Triangle }, Filter::CatmullRom => { FilterType::CatmullRom }, Filter::Gaussian => { FilterType::Gaussian }, Filter::Lanczos3 => { FilterType::Lanczos3 }, }; let img = ImageReader::open(args.path)?.decode()?; let original_ratio = img.width() as f32 / img.height() as f32; let width = ( args.height as f32 / args.ratio ) * original_ratio; let out = imageops::resize(&img, width as u32, args.height * 2, filter); let mut iter = out.enumerate_rows(); while let Some((_, top)) = iter.next() { let (_, bottom) = iter.next().unwrap(); top.zip(bottom) .for_each(|((_, _, t), (_, _, b))| { print!("\x1B[38;2;{};{};{};48;2;{};{};{}m\u{2584}", b[0], b[1], b[2], t[0], t[1], t[2]) }); println!("\x1B[0m"); } Ok(()) }
TwilightKiddy@programming.devto linuxmemes@lemmy.world•What's your favourite OS that does not use systemd?English5·2 months agoI use Gentoo. I install systemd willingly. We are not the same.
Assuming you made a bit of a typo with your regexp, any of these should work as you want:
grep -oE '/dev/loop[0-9]+' awk 'match($0, /\/dev\/loop[0-9]+/) { print substr($0, RSTART, RLENGTH) }' sed -r 's%.*(/dev/loop[0-9]+).*%\1%'
AWK one is a bit cursed as you can see. Such ways of manipulating text is not exactly it’s strong suite.
なぜ英語のない文に英語札を付いたの?