Skip Navigation
Stay safe out there.
  • I get it, but what is the rope for?

  • Languages
  • I mean c'mon, every pc that can compile rust in a reasonable time has at least 20gb of storage

  • What is a small gadget under $10-20 that you absolutely LOVE?
  • I 3d printed one for a few cents

  • Languages
  • that's because Rust is more modern and in modern days we don't rly have hard disk limitation, also it's probably because the compiler tells you the solution to most problems

  • What is your favorite movie of all time?
  • My all time favourite is god bless america, it's kind of relatable

  • The recent events will probably be the first time that Gen Z and Gen alpha are hearing about 'Pagers'.
  • I burn them mostly myself, but I got every star trek show on dvd

  • The recent events will probably be the first time that Gen Z and Gen alpha are hearing about 'Pagers'.
  • maybe they don't read articles, but news gets out way faster than it used to (including fake news). the avrg 12 yo probably didn't read it, but saw it on instagram or something

  • The recent events will probably be the first time that Gen Z and Gen alpha are hearing about 'Pagers'.
  • nope, I heard about it before in:

    • school

    • steins:gate

    • and from richard stallman himself

    + I kinda knew what they were from idk where

    but regarding gen alpha, you're probably right

  • The winner of every difficulty comparison
  • Why can't a turtle swimm?

  • What a stupid guy
  • why? sending a http request to /home/user/x sounds like a good idea

  • Me working with the OS
  • I did, don't worry

  • What a stupid guy
  • Hey, I set up this new database, wanna see it, here is the link

    edit: this is a joke, because sending a http request to postgres is stupid, haha

  • Me working with the OS
  • thx, btw I figured it out:

    I forgot to trimm the string, so it had a line break in it which lead to grep showing the processes from the term I put in + all processes that contain a space/linebreak and appearently all processes shown by ps aux contain some kind of space (makes sense, since there are spaces between the user, pid, etc) so yeah, I ended up trying to kill every process on the system, but it only killed the user processes, since I ran everything without sudo

  • Me working with the OS
  • probably the later, but idk how, all I did was insert a string in the following command like this:

    Command::new("bash") .arg("-c") .arg(format!("ps -aux | grep -i \"{}\" | awk '{{print $2}}' | xagrs kill -9", input) .output() .expect("error");

    I've tested the command and it worked flawlessly in the terminal, but I have no idea what I'm doing, since I'm new to rust and never worked with this library

  • Me working with the OS
  • it didn't crash the kernel, it just killed every process that isn't run by the root user, which kind of feels like a crash

  • Me working with the OS
  • Do you know the definition of insanity?

    do you know software developers?

  • Me working with the OS

    This happend to me right noww as I tried to write a gui task manager for the GNU/Linux OS

    28
    I hope tgis is a troll, but it probably isn't
    lemmy.world Least authoritarian stateist - Lemmy.World

    also he thought that the CCP wasn’t even suppressing free speech, guess who just got banned from a certain tankie cercle jerk instance

    Least authoritarian stateist - Lemmy.World
    3
    My boss gifted me an old thinkpad x31

    ofc I imediatly upgraded it from winxp to gnu/linux

    114
    got a new Laptop

    also ik, I still use neofetch instead of hyfetch

    0
    Even if god exists religion can't possibly be the way to god

    So I thought about this in the shower amd it makes sense to me, like praying and stuff never worked for most people I know, so a direkt link to god gotta be unlikely. That made me conclude that religion is probably fake, no matter if there's a god or not. Also people speaking to the same god being given a different set of rules sounds stupid, so at least most religions must be fake.

    175
    Engine placement in cars

    Why do some cars have their engines in the front and some in the back, what are the advantages and disadvantages of the two builds. And why doesn't every car have full wheel drive?

    20
    Need help writing a sprite update with bevy

    So I want to update the sprite so my character looks in a different direction each time the player presses left/right, how could I do this? I can't do it in the setup fn, since it's a startup system, appreciate any help

    EDIT: changed formating

    here is my code:

    ``` use bevy::prelude::*;

    `fn main() { App::new() .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) // prevents blurry sprites .add_systems(Startup, setup) .add_systems(Update, animate_sprite) .add_systems(Update, player_movement_system) .run(); }

    const BOUNDS: Vec2 = Vec2::new(1200.0, 640.0); static mut FLIP_BOOLEAN: bool = false;

    fn set_flip_boolean(boolean: bool) { unsafe { FLIP_BOOLEAN = boolean; } }

    fn get_flip_boolean() -> bool{ unsafe { FLIP_BOOLEAN } }

    #[derive(Component)] struct Player { movement_speed: f32, }

    #[derive(Component)] struct AnimationIndices { first: usize, last: usize, }

    #[derive(Component, Deref, DerefMut)] struct AnimationTimer(Timer);

    fn animate_sprite( time: Res<Time>, mut query: Query<(&AnimationIndices, &mut AnimationTimer, &mut TextureAtlas)>, ) { for (indices, mut timer, mut atlas) in &mut query { timer.tick(time.delta()); if timer.just_finished() { atlas.index = if atlas.index == indices.last { indices.first } else { atlas.index + 1 }; } } }

    fn setup( mut commands: Commands, asset_server: Res<AssetServer>, mut texture_atlas_layouts: ResMut<Assets<TextureAtlasLayout>>, ) { let texture = asset_server.load("sprites/Idle01.png"); let layout = TextureAtlasLayout::from_grid(Vec2::new(64.0, 40.0), 5, 1, None, None); let texture_atlas_layout = texture_atlas_layouts.add(layout); let animation_indices = AnimationIndices { first: 0, last: 4 }; let boolean = get_flip_boolean(); commands.spawn(Camera2dBundle::default()); commands.spawn(( SpriteSheetBundle { texture, atlas: TextureAtlas { layout: texture_atlas_layout, index: animation_indices.first, },

    ..default() }, Player { movement_speed: 500.0, }, animation_indices, AnimationTimer(Timer::from_seconds(0.1, TimerMode::Repeating)), )); }

    fn player_movement_system( time: Res<Time>, keyboard_input: Res<ButtonInput<KeyCode>>, mut query: Query<(&Player, &mut Transform)>, ) { let (guy, mut transform) = query.single_mut();

    let mut movement_factor = 0.0;

    let mut movement_direction = Vec3::X;

    if keyboard_input.pressed(KeyCode::ArrowLeft) { movement_factor -= 1.0; movement_direction = Vec3::X; set_flip_boolean(true); }

    if keyboard_input.pressed(KeyCode::ArrowRight) { movement_factor += 1.0; movement_direction = Vec3::X; set_flip_boolean(false); }

    if keyboard_input.pressed(KeyCode::ArrowUp) { movement_factor += 1.0; movement_direction = Vec3::Y; }

    if keyboard_input.pressed(KeyCode::ArrowDown) { movement_factor -= 1.0; movement_direction = Vec3::Y; }

    let movement_distance = movement_factor * guy.movement_speed * time.delta_seconds(); let translation_delta = movement_direction * movement_distance; transform.translation += translation_delta;

    let extents = Vec3::from((BOUNDS / 2.0, 0.0)); transform.translation = transform.translation.min(extents).max(-extents); } ```

    1
    Why are people against gun rights? (besides shootings)

    I hope this isn't out of context, also I don't want to "own the libs" or something here, I'm actually interested.

    72
    Made this for my mum's birthday (we're both trekkies)

    tbh I did a horrible paint job, but she still liked it

    EDIT: the parts are 3d printed (not my model tho)

    14
    Unixporn @lemmy.ml bi_tux @lemmy.world
    avrg Arch btw user (I still use kde on my laptop, I'm to lazy to change it)
    12
    bi_tux bi_tux @lemmy.world
    Posts 58
    Comments 497