home.social

Search

1000 results for “bitman”

  1. Re-reading old code and I’m reminded of this old trick for doing bit-manipulation:

    I was trying to shift right an u8 by a value between 1 and 8 bits:

    myu8 >> (8 - shift)

    If shift equals 0, this would be an 8 bits shift, I wanted the result to be zero (all bits shifted), but that's not how (some) CPUs work; so it's undefined behaviour, and in Rust, the compiler will throw a compile error (if it's a const shift), or panic at runtime in debug mode.

    One could test if shift is 8, and adjust code accordingly, but this adds branches and even more code.

    So the trick to work around that is simply... to shift twice ! One time for the first bit, and another for the last (potential 7):

    (myu8 >> 1) >> (8 - shift - 1)

    And that's how one can do this operation fully branchless.

    (another version of this post appeared on a now-defunct instance)

    #RustLang #bitmap #BitManip

  2. Будни ретрогеймера: а я сказал — BITMAN

    Ретрогейминг — довольно популярное сейчас увлечение старыми компьютерными и видеоиграми, от истоков индустрии и до того момента, в который актуальное нынешнее превращается в пыльное ретро. На данный момент эта условная граница пролегает где-то между поколениями PlayStation 2 и 3, в начале 2000-х годов. Это явление включает в себя любопытные девиации в виде коллекционирования всех сортов, цифровой археологии, киберспорта и компьютерного творчества, но в основе его всё же находится вполне банальная игра в игры прошлых лет. Некоторым даже искренне нравится это занятие — ведь раньше было лучше, и в этом утверждении вполне можно отыскать крупицу истины. В современном мире вовсе не обязательно использовать реальные игровые устройства, картриджи и диски, но именно они являются краеугольным камнем ретрогейминга, источником всех этих старых игр. И если возжелать обратиться к этому подлиннику, обнаружится проблема: в 21-ом веке эти артефакты требуют обслуживания, мелкого ремонта и восстановления, а зачастую ещё и адаптации под современные реалии. Хотя в своих публикациях я обычно касаюсь более хардкорных граней ретрокомпьютинга, я тоже частенько ковыряюсь в старых приставках. Особенно кучно они пошли в этом году, и это навело на мысль посвятить этому занятию статью. Простая возня со старым железом, без мучительных копаний в википедийных фактах и прочей истории, околотехническое творчество и решение разнообразных проблем подручными средствами. Приступаем!

    habr.com/ru/companies/ruvds/ar

    #ruvds_статьи #ретрогейминг #консоль #игровая_приставка #sega #sega_megadrive #sega_mega_drive #sega_genesis #bitman #16bit #16bit_games #моддинг #pal #ntsc

  3. Будни ретрогеймера: а я сказал — BITMAN

    Ретрогейминг — довольно популярное сейчас увлечение старыми компьютерными и видеоиграми, от истоков индустрии и до того момента, в который актуальное нынешнее превращается в пыльное ретро. На данный момент эта условная граница пролегает где-то между поколениями PlayStation 2 и 3, в начале 2000-х годов. Это явление включает в себя любопытные девиации в виде коллекционирования всех сортов, цифровой археологии, киберспорта и компьютерного творчества, но в основе его всё же находится вполне банальная игра в игры прошлых лет. Некоторым даже искренне нравится это занятие — ведь раньше было лучше, и в этом утверждении вполне можно отыскать крупицу истины. В современном мире вовсе не обязательно использовать реальные игровые устройства, картриджи и диски, но именно они являются краеугольным камнем ретрогейминга, источником всех этих старых игр. И если возжелать обратиться к этому подлиннику, обнаружится проблема: в 21-ом веке эти артефакты требуют обслуживания, мелкого ремонта и восстановления, а зачастую ещё и адаптации под современные реалии. Хотя в своих публикациях я обычно касаюсь более хардкорных граней ретрокомпьютинга, я тоже частенько ковыряюсь в старых приставках. Особенно кучно они пошли в этом году, и это навело на мысль посвятить этому занятию статью. Простая возня со старым железом, без мучительных копаний в википедийных фактах и прочей истории, околотехническое творчество и решение разнообразных проблем подручными средствами. Приступаем!

    habr.com/ru/companies/ruvds/ar

    #ruvds_статьи #ретрогейминг #консоль #игровая_приставка #sega #sega_megadrive #sega_mega_drive #sega_genesis #bitman #16bit #16bit_games #моддинг #pal #ntsc

  4. Будни ретрогеймера: а я сказал — BITMAN

    Ретрогейминг — довольно популярное сейчас увлечение старыми компьютерными и видеоиграми, от истоков индустрии и до того момента, в который актуальное нынешнее превращается в пыльное ретро. На данный момент эта условная граница пролегает где-то между поколениями PlayStation 2 и 3, в начале 2000-х годов. Это явление включает в себя любопытные девиации в виде коллекционирования всех сортов, цифровой археологии, киберспорта и компьютерного творчества, но в основе его всё же находится вполне банальная игра в игры прошлых лет. Некоторым даже искренне нравится это занятие — ведь раньше было лучше, и в этом утверждении вполне можно отыскать крупицу истины. В современном мире вовсе не обязательно использовать реальные игровые устройства, картриджи и диски, но именно они являются краеугольным камнем ретрогейминга, источником всех этих старых игр. И если возжелать обратиться к этому подлиннику, обнаружится проблема: в 21-ом веке эти артефакты требуют обслуживания, мелкого ремонта и восстановления, а зачастую ещё и адаптации под современные реалии. Хотя в своих публикациях я обычно касаюсь более хардкорных граней ретрокомпьютинга, я тоже частенько ковыряюсь в старых приставках. Особенно кучно они пошли в этом году, и это навело на мысль посвятить этому занятию статью. Простая возня со старым железом, без мучительных копаний в википедийных фактах и прочей истории, околотехническое творчество и решение разнообразных проблем подручными средствами. Приступаем!

    habr.com/ru/companies/ruvds/ar

    #ruvds_статьи #ретрогейминг #консоль #игровая_приставка #sega #sega_megadrive #sega_mega_drive #sega_genesis #bitman #16bit #16bit_games #моддинг #pal #ntsc

  5. Re-reading old code and I’m reminded of this old trick for doing bit-manipulation:

    I was trying to shift right an u8 by a value between 1 and 8 bits:

    myu8 >> (8 - shift)

    If shift equals 0, this would be an 8 bits shift, I wanted the result to be zero (all bits shifted), but that's not how (some) CPUs work; so it's undefined behaviour, and in Rust, the compiler will throw a compile error (if it's a const shift), or panic at runtime in debug mode.

    One could test if shift is 8, and adjust code accordingly, but this adds branches and even more code.

    So the trick to work around that is simply... to shift twice ! One time for the first bit, and another for the last (potential 7):

    (myu8 >> 1) >> (8 - shift - 1)

    And that's how one can do this operation fully branchless.

    (another version of this post appeared on a now-defunct instance)

    #RustLang #bitmap #BitManip

  6. Re-reading old code and I’m reminded of this old trick for doing bit-manipulation:

    I was trying to shift right an u8 by a value between 1 and 8 bits:

    myu8 >> (8 - shift)

    If shift equals 0, this would be an 8 bits shift, I wanted the result to be zero (all bits shifted), but that's not how (some) CPUs work; so it's undefined behaviour, and in Rust, the compiler will throw a compile error (if it's a const shift), or panic at runtime in debug mode.

    One could test if shift is 8, and adjust code accordingly, but this adds branches and even more code.

    So the trick to work around that is simply... to shift twice ! One time for the first bit, and another for the last (potential 7):

    (myu8 >> 1) >> (8 - shift - 1)

    And that's how one can do this operation fully branchless.

    (another version of this post appeared on a now-defunct instance)

    #RustLang #bitmap #BitManip

  7. Re-reading old code and I’m reminded of this old trick for doing bit-manipulation:

    I was trying to shift right an u8 by a value between 1 and 8 bits:

    myu8 >> (8 - shift)

    If shift equals 0, this would be an 8 bits shift, I wanted the result to be zero (all bits shifted), but that's not how (some) CPUs work; so it's undefined behaviour, and in Rust, the compiler will throw a compile error (if it's a const shift), or panic at runtime in debug mode.

    One could test if shift is 8, and adjust code accordingly, but this adds branches and even more code.

    So the trick to work around that is simply... to shift twice ! One time for the first bit, and another for the last (potential 7):

    (myu8 >> 1) >> (8 - shift - 1)

    And that's how one can do this operation fully branchless.

    (another version of this post appeared on a now-defunct instance)

    #RustLang #bitmap #BitManip

  8. Re-reading old code and I’m reminded of this old trick for doing bit-manipulation:

    I was trying to shift right an u8 by a value between 1 and 8 bits:

    myu8 >> (8 - shift)

    If shift equals 0, this would be an 8 bits shift, I wanted the result to be zero (all bits shifted), but that's not how (some) CPUs work; so it's undefined behaviour, and in Rust, the compiler will throw a compile error (if it's a const shift), or panic at runtime in debug mode.

    One could test if shift is 8, and adjust code accordingly, but this adds branches and even more code.

    So the trick to work around that is simply... to shift twice ! One time for the first bit, and another for the last (potential 7):

    (myu8 >> 1) >> (8 - shift - 1)

    And that's how one can do this operation fully branchless.

    (another version of this post appeared on a now-defunct instance)

    #RustLang #bitmap #BitManip

  9. Gestern ist das Buch mit den Bitzaubersprüchen angekommen. Da muss man als Softwareentwickler einfach mal drin schmökern. Bevor es verboten wird, weil derartiges Wissen nur noch der KI vorbehalten ist.🤣

    Da stehen ohne Ende so Sachen drin wie:

    "Use the following formula to turn off the rightmost 1-bit in a word, producing 0 if none (e.g., 01011000 01010000):
    x & (x – 1)"

    Wobei x ein 32Bit-Wert ist.

    #hacker #hackersDelight #programming #bitmanipulation

  10. ☑️ Day 40/100: #Leetcode daily question

    🟨 Question: 2275. Largest Combination With Bitwise AND Greater Than Zero

    This was an easy one for medium and I solved it using index bit count.

    🐈‍⬛ Check out my #GitHub where I post all the daily streak 🔥 questions and #LeetcodeContest 🏆 solutions

    🔗 Solution Link: github.com/akshatsingh1718/lee

    🔗 My Leetcode Github: github.com/akshatsingh1718/lee

    #Algorithms #coding #python #bitmanipulation

  11. ☑️ Day 39/100: #Leetcode daily question

    🟨 Question: 3011. Find if Array Can Be Sorted

    This was an easy one for medium and I solved it using bubble sort.

    🐈‍⬛ Check out my #GitHub where I post all the daily streak 🔥 questions and #LeetcodeContest 🏆 solutions

    🔗 Solution Link: github.com/akshatsingh1718/lee

    🔗 My Leetcode Github: github.com/akshatsingh1718/lee

    #python #Algorithms #coding #sorting #bitmanipulation

  12. 🧑‍🎓Learning new things on
    #leetcode is essential! 🚀 Today, from #Leetcode2220, I discovered Brian Kernighan’s Algorithm, which efficiently counts #setbits (bits set to 1) in nearly O(1) 🔥 time ⌛. Super handy for #bitmanipulation! 💡 #LeetCode #Coding #Algorithms #python

  13. Little Hex Tricks Make Little Displays a Little Easier - Depending on the device in hand and one’s temperament, bringing up a new part can be a frolic throug... more: hackaday.com/2020/01/24/little #microcontrollers #bitmanipulation #computerhacks #bittwiddling #spreadsheet #registers #7segment #how-to #excel #issi #led #c

  14. These Bit Twiddling Tricks Will Make Your Coworkers Hate You - In the embedded world, twiddling a few bits is expected behavior. Firmware is far enough down the st... more: hackaday.com/2020/01/16/these- #bitmanipulation #softwarehacks #classichacks #bittwiddling #registers #bitmath #shift #bits #mask

  15. Abusing A CPU’s Adders To Optimize Bit Counting - If you like nitpicking around C code and generated assembly language — and we’ll admit that we do ... more: hackaday.com/2019/06/19/abusin #bitmanipulation #briankernighan #softwarehacks #bitarithmetic #bitcounting

  16. The concept is straightforward: subscribe to relevant events (e.g., system startup, screen unlock) to reapply, reset, or reconnect critical system settings and ensure everything runs smoothly. When my laptop comes back from sleep the VPN connection is lost, it can't reconnect. Detecting when it comes back, killing VPN and restarting it solves the problem

    The next script is generated by Tape That Moth (TTM) to solve the issue

    #!/usr/bin/env bash
    while read -r line; do
    case "$line" in
    *"{'Active': <true>}"*) /some/path/to/proton-vpn-restart ;;
    esac
    done < <(gdbus monitor -y -d org.freedesktop.login1)

    Where /some/path/to/proton-vpn-restart, not generated by TTM, kills VPN and starts a new one

    #!/usr/bin/env bash
    pkill -9 -f protonvpn-app
    python3 /usr/bin/protonvpn-app >/dev/null 2>&1 &

    This approach may not adhere to traditional coding best practices, but it's a pragmatic solution that yields results

    #Linux #FOSS #OpenSource #UX #SystemFixes #TapeThatMoth #DesktopTools #BugWorkarounds

  17. The concept is straightforward: subscribe to relevant events (e.g., system startup, screen unlock) to reapply, reset, or reconnect critical system settings and ensure everything runs smoothly. When my laptop comes back from sleep the VPN connection is lost, it can't reconnect. Detecting when it comes back, killing VPN and restarting it solves the problem

    The next script is generated by Tape That Moth (TTM) to solve the issue

    #!/usr/bin/env bash
    while read -r line; do
    case "$line" in
    *"{'Active': <true>}"*) /some/path/to/proton-vpn-restart ;;
    esac
    done < <(gdbus monitor -y -d org.freedesktop.login1)

    Where /some/path/to/proton-vpn-restart, not generated by TTM, kills VPN and starts a new one

    #!/usr/bin/env bash
    pkill -9 -f protonvpn-app
    python3 /usr/bin/protonvpn-app >/dev/null 2>&1 &

    This approach may not adhere to traditional coding best practices, but it's a pragmatic solution that yields results

    #Linux #FOSS #OpenSource #UX #SystemFixes #TapeThatMoth #DesktopTools #BugWorkarounds

  18. The concept is straightforward: subscribe to relevant events (e.g., system startup, screen unlock) to reapply, reset, or reconnect critical system settings and ensure everything runs smoothly. When my laptop comes back from sleep the VPN connection is lost, it can't reconnect. Detecting when it comes back, killing VPN and restarting it solves the problem

    The next script is generated by Tape That Moth (TTM) to solve the issue

    #!/usr/bin/env bash
    while read -r line; do
    case "$line" in
    *"{'Active': <true>}"*) /some/path/to/proton-vpn-restart ;;
    esac
    done < <(gdbus monitor -y -d org.freedesktop.login1)

    Where /some/path/to/proton-vpn-restart, not generated by TTM, kills VPN and starts a new one

    #!/usr/bin/env bash
    pkill -9 -f protonvpn-app
    python3 /usr/bin/protonvpn-app >/dev/null 2>&1 &

    This approach may not adhere to traditional coding best practices, but it's a pragmatic solution that yields results

  19. Hey fellow Mastodons!

    I'm working on a project called Tape That Moth, which helps mask software issues that drive us crazy. You know, things like keyboard layouts changing unexpectedly or VPNs dropping out after laptop suspend.

    My goal is to make it easy to use and get back to what matters most – coding, designing, or just getting stuff done!

    Here's the thing: I'd love your feedback on how to make Tape That Moth more user-friendly. Should it be point-and-click? Should I prioritize certain features? Is it of interest for other one that me?

    I'm looking for advice from people who actually use software and have experienced these kinds of issues firsthand. Your input would mean a lot!

    gitlab.com/bit-man/tape-that-m

    #Linux #FOSS #OpenSource #UX #SystemFixes #TapeThatMoth #DesktopTools #BugWorkarounds

  20. Hey fellow Mastodons!

    I'm working on a project called Tape That Moth, which helps mask software issues that drive us crazy. You know, things like keyboard layouts changing unexpectedly or VPNs dropping out after laptop suspend.

    My goal is to make it easy to use and get back to what matters most – coding, designing, or just getting stuff done!

    Here's the thing: I'd love your feedback on how to make Tape That Moth more user-friendly. Should it be point-and-click? Should I prioritize certain features? Is it of interest for other one that me?

    I'm looking for advice from people who actually use software and have experienced these kinds of issues firsthand. Your input would mean a lot!

    gitlab.com/bit-man/tape-that-m

    #Linux #FOSS #OpenSource #UX #SystemFixes #TapeThatMoth #DesktopTools #BugWorkarounds

  21. Hey fellow Mastodons!

    I'm working on a project called Tape That Moth, which helps mask software issues that drive us crazy. You know, things like keyboard layouts changing unexpectedly or VPNs dropping out after laptop suspend.

    My goal is to make it easy to use and get back to what matters most – coding, designing, or just getting stuff done!

    Here's the thing: I'd love your feedback on how to make Tape That Moth more user-friendly. Should it be point-and-click? Should I prioritize certain features? Is it of interest for other one that me?

    I'm looking for advice from people who actually use software and have experienced these kinds of issues firsthand. Your input would mean a lot!

    gitlab.com/bit-man/tape-that-m

  22. Batman/Superman: World's Finest #51 preview. The World's Finest team enters the lost world of Skartaris — home of Travis Morgan, the Warlord! #comics #comicbooks

    graphicpolicy.com/2026/05/16/p

  23. You realize "no ethical billionaires" includes Bruce Wayne, right?
    #EatTheRich #Batman