16 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

29 comments

  1. [5]
    spidercat
    Link
    been learning electronics fundamentals! I've always been a computer nerd, but I'm 100% self-taught. it's been a near-lifelong frustration of mine that I can't 100% conceptualize how a computer...

    been learning electronics fundamentals! I've always been a computer nerd, but I'm 100% self-taught. it's been a near-lifelong frustration of mine that I can't 100% conceptualize how a computer works... like, on the physical, electron level. how, to HUGELY simplify, a series of billions of "yes/no" options can have complicated logic applied to it to eventually give us what we see in front of us on this website. it's a "black box" of magic and mystery but I NEED TO KNOW.

    over the years the "black box" grows smaller and less scary as I have passively and casually learned more, and after a recent impromptu lesson from my partner (who has a PhD in this stuff - lucky me!), I think I'm starting to finally "get it" and I am determined to demystify the magic at long last. my partner had a bit of a lightbulb moment in my gaps of understanding, and we built a simple flip-flop together. it's a concept I hadn't encountered before in my endeavors to teach myself how all this stuff works and it really opened my mind and is helping to make much more sense out of everything.

    11 votes
    1. [2]
      eledrave
      Link Parent
      You've probably seen this, but for anyone else: https://www.nand2tetris.org/ It takes you from the simple logic gate through a simple computer. I haven't tried it but I've heard good things.

      You've probably seen this, but for anyone else: https://www.nand2tetris.org/

      It takes you from the simple logic gate through a simple computer. I haven't tried it but I've heard good things.

      8 votes
      1. spidercat
        Link Parent
        I had seen it, years ago, but forgot all about it - thank you for the reminder!!

        I had seen it, years ago, but forgot all about it - thank you for the reminder!!

        1 vote
    2. tibpoe
      Link Parent
      Watching my partner work on building a LC-3 CPU from scratch visually through this course has similarly been enlightening for me, even after spending a long time working at both the higher & lower...

      Watching my partner work on building a LC-3 CPU from scratch visually through this course has similarly been enlightening for me, even after spending a long time working at both the higher & lower levels of abstraction

      I don't think I'd be willing to personally work through this course myself, but all the materials are there, and I found the simulator used there much easier to understand than that one time I tried doing HDL.

      3 votes
    3. jbinto
      Link Parent
      I have also recently dove into "fundamental electronics", I've worked in software for almost 2 decades now but electronics wise I barely knew anything past those alligator clip/incandescent...

      I have also recently dove into "fundamental electronics", I've worked in software for almost 2 decades now but electronics wise I barely knew anything past those alligator clip/incandescent bulb/9V battery circuits we built in grade 7.

      What got me really going is Ben Eater's Youtube videos. He has a series on basic digital electronics I was able to really pick up and understand - it helped to prototype the circuits on a breadboard as I went. I enjoyed it so much I picked up his "build a 6502 computer on a breadboard" kit and have been slowly plodding away at that in my free time for the past ~year. The videos for the 6502 project are probably the most information dense on Youtube (each 30 minute video takes me a couple weeks to get through) but it is some of the most clear and rewarding technical instruction I've ever consumed.

      edit: The playlist above is good but they weren't the videos I was thinking of, it was these buried in his 8-bit computer playlist: SR latch, D latch, D flip-flop - grokking these really levelled me up.

      1 vote
  2. [5]
    Gummy
    Link
    I've been learning to reverse engineer games with ghidra. I feel like I have a pretty good grasp on it with older pc games. Though I have hit a wall now, attempting to reverse a ps2 game. I just...

    I've been learning to reverse engineer games with ghidra. I feel like I have a pretty good grasp on it with older pc games. Though I have hit a wall now, attempting to reverse a ps2 game. I just can't find a good way to debug pcsx2 games. At least not in a way that can be easily translated back to the decompiled code in ghidra. The romhacking forum posts I've found just amount to "use cheat engine and ghidra" with no further explanation. If anybody has any knowledge on reverse engineering ps2 stuff I'd appreciate it.
    Otherwise I will continue to bash my head against it until something starts to work :)

    9 votes
    1. [2]
      tibpoe
      Link Parent
      I'm not familiar at all with PS2 games but have just a tiny bit of familiarity with Ghidra. Is the problem here that the PS2 ISA is not supported in Ghidra? My understanding, from working a little...

      I'm not familiar at all with PS2 games but have just a tiny bit of familiarity with Ghidra. Is the problem here that the PS2 ISA is not supported in Ghidra?

      My understanding, from working a little bit with the Xtensa ISA in Ghidra, is that Ghidra is designed so that you can make a plugin for a new ISA and it should Just Work with the rest of the system & decompiler.

      2 votes
      1. Gummy
        Link Parent
        I have a ghidra extension that supports the MIPS instruction set on the ps2. That's all working fine. I'm just limited in what I can do with it if I can't attach a debugger to the game with the...

        I have a ghidra extension that supports the MIPS instruction set on the ps2. That's all working fine. I'm just limited in what I can do with it if I can't attach a debugger to the game with the original memory addresses accessible. The emulator remaps all the memory and I think I'm just misunderstanding how to debug emulated games.

        I know people have used cheat engine to access the emulated memory, but I can't figure that out apparently.

        1 vote
    2. [2]
      jbinto
      Link Parent
      cool! I've always wanted to learn some reverse engineering, but it really does feel like a scratch-your-own-itch kind of thing - if you don't have a burning need to crack that 24 year old...

      cool! I've always wanted to learn some reverse engineering, but it really does feel like a scratch-your-own-itch kind of thing - if you don't have a burning need to crack that 24 year old abandonware it can be hard to know where to begin. Any recommendations on how to get started?

      1 vote
      1. Gummy
        Link Parent
        I started by following along with a YouTube tutorial on reversing roller coaster tycoon. I already have a lot experience with high level languages and at least a surface understanding of assembly...

        I started by following along with a YouTube tutorial on reversing roller coaster tycoon. I already have a lot experience with high level languages and at least a surface understanding of assembly languages. After a couple hours of tutorials on specific software it gave me enough tools to go off on my own. It's definitely a slow and tedious process and I have pretty good motivation pushing me through it.

  3. DataWraith
    Link
    I've been tinkering with my StarCraft 2 bot. At this point I've pretty much given up hope of ever creating something competitive for the SC2AI ladder, but it is a fun vehicle for playing with...

    I've been tinkering with my StarCraft 2 bot. At this point I've pretty much given up hope of ever creating something competitive for the SC2AI ladder, but it is a fun vehicle for playing with interesting algorithms under real-time constraints.
    This week I've implemented a method that enables the bot to select its actions using a neural network evolved by Grammatical Evolution, a variant of genetic programming that employs a pre-defined grammar to evolve whatever the grammar describes.
    For example, you could have it evolve valid JSON documents or even Python programs if you specified a grammar complex enough for that. It's a very flexible method.

    In my case the grammar prescribes a simple expression language that, when evaluated, results in a neural network.

    The evolved output of the grammar looks like this:

    OUTPUT(333,RELU6(((INPUT(977)*(-0.659))+0.882)))

    This represents a single neuron using a single input connection. The indices 977 and 333 are taken modulo the actual number of inputs/outputs, and RELU6 is the RELU6 activation function, max(min(6, x), 0).
    The expression is converted into Reverse Polish notation using the Shunting yard algorithm:

    333 977 Input 0.659 Negate Multiply 0.882 Plus Relu6 Output

    Having it in RPN means that the expression is very easy to evaluate from left to right using just a stack.

    Multiple neurons are evolved and combined into a neural network. The network runs every three seconds of in-game time and scores each possible option the bot can take (e.g. build another barracks, research a weapon upgrade, do nothing, etc.).

    The genetic algorithm driving the process aims to minimize or maximize randomized goals using a method called Lexicase selection. The goals I use are selected from the set of all possible objectives of the form "make as many/few units of type X as possible while still winning against the built-in AI".

    This method results in a diverse population (which is crucial, because I need to use small populations -- playing a single game takes a few minutes) and is supposed to also do well on the actual objective (i.e. winning the game).

    I probably should teach the bot to use other units than the basic Terran infantry, but that's for another week...

    7 votes
  4. [5]
    brogeroni
    Link
    A no markup (or extremely small markup) domain registrar, with a large portion of the profits going to a charity of your choice. Is anybody here interested in that?

    A no markup (or extremely small markup) domain registrar, with a large portion of the profits going to a charity of your choice.

    Is anybody here interested in that?

    5 votes
    1. [2]
      Jakobeha
      Link Parent
      Don’t you need to be in a sort of in-group to have a domain registrar? Like be registered with ICAAN? Or just pay another registrar for domains and add some markup. I think that’s a great idea,...

      Don’t you need to be in a sort of in-group to have a domain registrar? Like be registered with ICAAN? Or just pay another registrar for domains and add some markup.

      I think that’s a great idea, but I don’t see how you’d achieve it (and I’m not talking about implementation).

      5 votes
      1. brogeroni
        Link Parent
        I found a website which gives registrar prices + 5%, given you have a subscription. So I think the key is making sure to sell like >100 domains a year, just a quantity game in the end.

        I found a website which gives registrar prices + 5%, given you have a subscription. So I think the key is making sure to sell like >100 domains a year, just a quantity game in the end.

        1 vote
    2. [2]
      paradoxfox
      Link Parent
      I just bought a domain for my personal page. I like the idea and I'd support it. How would it work without turning in profits though?

      I just bought a domain for my personal page.

      I like the idea and I'd support it. How would it work without turning in profits though?

      2 votes
      1. brogeroni
        Link Parent
        Profits are important (I like being able to eat), but I feel like as long as upkeep is paid for, is be happy (especially with the positive impact this would have). What do you think a decent...

        Profits are important (I like being able to eat), but I feel like as long as upkeep is paid for, is be happy (especially with the positive impact this would have).

        What do you think a decent pricing model would be?

        1 vote
  5. Pioneer
    Link
    Nothing too technical. Wrapping my head around Azure really. Fundamentally different to AWS, but feels much more like the grown up in the cloud game. Despite its drawbacks.

    Nothing too technical.

    Wrapping my head around Azure really. Fundamentally different to AWS, but feels much more like the grown up in the cloud game. Despite its drawbacks.

    4 votes
  6. [3]
    drapermache
    Link
    I’ve been studying and designing how to set up a reverse proxy with let’s encrypt ssl certs so I can expose a lot of my self-hosted services. I’m currently using cloudflare tunnels, but with Plex...

    I’ve been studying and designing how to set up a reverse proxy with let’s encrypt ssl certs so I can expose a lot of my self-hosted services. I’m currently using cloudflare tunnels, but with Plex breaking the terms of service, I’d rather have Cloudflare just handle my DNS, and I handle the rest. The problem is that I’m super afraid to even set it up because of my flat network in my house. I have no segregation of any type and just a few different wireless networks for IoT devices who can’t connect to 5 GHz. It seems like if I open up ports I’ll need to do a ground-up overhaul of how my network and infrastructure is set up.

    3 votes
    1. [2]
      Protected
      Link Parent
      When you say reverse proxy, shall I assume you have a remote server as well?

      When you say reverse proxy, shall I assume you have a remote server as well?

      1. drapermache
        Link Parent
        Nope, no remote server just hardware at home. The end goal is that I want to have a nice home lab that I can access with little to no ports being opened up.

        Nope, no remote server just hardware at home. The end goal is that I want to have a nice home lab that I can access with little to no ports being opened up.

        1 vote
  7. joshbuddy
    Link
    I've been working on a new boardgame project with my brother at new.boardzilla.io. There is something kind deeply fulfilling about working on a passion project with a family member. I recently...

    I've been working on a new boardgame project with my brother at new.boardzilla.io. There is something kind deeply fulfilling about working on a passion project with a family member. I recently watch The Sparks Brothers (great film btw) and thinking about the sorts of deep artistic relationships you can have with someone over time. I guess this is a bit of an outpouring from that.

    3 votes
  8. Rudism
    Link
    I'm slowly teaching myself Rust by writing a game that runs on a Raspberry Pi Zero with an Adafruit OLED bonnet for I/O and a PiSugar 3 battery. My idea (right now, it's changed a few times...

    I'm slowly teaching myself Rust by writing a game that runs on a Raspberry Pi Zero with an Adafruit OLED bonnet for I/O and a PiSugar 3 battery. My idea (right now, it's changed a few times already though) is an idle-type thing where a you help guide a pocket-pet space captain to explore a seed-generated galaxy, fight pirates, find profitable trade routes, and other various tasks (think if Tamagotchi and EVE Online had a baby).

    Still very early stages, and no real end (or beginning, really) in sight, but I have vague lofty ambitions such as using the RTC on the PiSugar to support offline progression, and shared galaxies with a server component that would allow pets to influence and interact with one another in some way. I also want to design a simple 3D-printable enclosure for the Pi/OLED/battery combo, probably using OpenSCAD.

    It's highly likely that I'll abandon this before it ever gets anywhere interesting, and even if it does get somewhere interesting I wouldn't expect anyone to play it other than me, but so far learning Rust is quite neat and I'm having fun which is my main goal for now.

    3 votes
  9. [3]
    xk3
    (edited )
    Link
    I've been overhauling my media library software to use natsort instead of a very badly performing implementation which would keep querying a SQLITE table and cut off small sections of the end the...

    I've been overhauling my media library software to use natsort instead of a very badly performing implementation which would keep querying a SQLITE table and cut off small sections of the end the file path until it had multiple matches... as you can probably imagine there were many problems with this

    I also discovered a very good MCDA python library and I used it to add a feature to do automatic MCDA analysis and sorting based on multiple-criteria.

    For example (the CLI output is markdown):

    $ library mcda --clean --minimize Year https://en.wikipedia.org/wiki/List_of_Academy_Award-winning_films
    

    Shape

    (1360, 4)

    Goals

    Maximize

    • Nominations
    • Awards

    Minimize

    • Year
    Film Year Awards Nominations TOPSIS MABAC SPOTIS BORDA
    365 Titanic 1997 11 14 0.999993 1.38038 4.82027e-06 4077.62
    855 Ben-Hur 1959 11 12 0.902148 1.30895 0.0714303 4077.72
    283 The Lord of the Rings: The Return of the King 2003 11 11 0.8558 1.27324 0.107147 4077.76
    1328 West Side Story 1961 10 11 0.837716 1.22779 0.152599 4077.78
    376 The English Patient 1996 9 12 0.836725 1.21804 0.162341 4077.78
    994 Gone with the Wind 1939 8 13 0.807086 1.20831 0.172078 4077.81
    977 From Here to Eternity 1953 8 13 0.807086 1.20831 0.172079 4077.81
    1154 On the Waterfront 1954 8 12 0.785 1.17259 0.207793 4077.83
    1132 My Fair Lady 1964 8 12 0.785 1.17259 0.207793 4077.83
    578 Gandhi 1982 8 11 0.755312 1.13688 0.243509 4077.86
    553 Amadeus 1984 8 11 0.755312 1.13688 0.243509 4077.86
    353 Shakespeare in Love 1998 7 13 0.75233 1.16285 0.217536 4077.87
    464 Dances with Wolves 1990 7 12 0.73208 1.12713 0.253249 4077.89
    424 Schindler's List 1993 7 12 0.73208 1.12713 0.25325 4077.89
    985 Gigi 1958 9 9 0.721942 1.1109 0.269481 4077.9
    509 The Last Emperor 1987 9 9 0.721942 1.1109 0.269483 4077.9
    ...
    2 votes
    1. [2]
      tibpoe
      Link Parent
      yes... that you weren't using binary search instead 😱 but really, I'm curious about how you incorporated natsort. I didn't know about that library, but it seems very useful. When I use it, I get...

      which would keep querying a SQLITE table and cut off small sections of the end the file path until it had multiple matches... as you can probably imagine there were many problems with this

      yes... that you weren't using binary search instead 😱

      but really, I'm curious about how you incorporated natsort. I didn't know about that library, but it seems very useful. When I use it, I get

      >>> keygen = natsort.natsort_keygen()
      >>> keygen('asd1 asd')
      ('asd', 1, ' asd')
      

      which is a great way of doing this key (and not what I expected), but at the same time I don't see how this can be indexed given SQLite's limitations. sqlite3_create_collation? But I don't think Python supports this.

      2 votes
      1. xk3
        (edited )
        Link Parent
        Sure, here is the relevant code. I don't use natsort with SQLITE indexes directly but I use natsort after fetching some data. The previous function get_ordinal_media would also query the database...

        Sure, here is the relevant code. I don't use natsort with SQLITE indexes directly but I use natsort after fetching some data.

        The previous function get_ordinal_media would also query the database for more data. This is useful when using --random which will initially only select a random subset of the table based on rowid. Last night, I replicated the fetching functionality of get_ordinal_media in the get_sibling_media function.

        So now I can do library watch --random --fetch-siblings each and it will get a random list of files and then get the first result from each parent path substring search. There are probably better ways of doing this, like with a correlated subquery but it feels more flexible as-is.

        Here is the relevant documentation:

        Play media in order (similarly named episodes):

        • library watch --play-in-order
        • library watch -O # equivalent

        The default sort value is 'natural_ps' which means media will be sorted by parent path
        and then stem in a natural way (using the integer values within the path). But there are many other options:

        Options:

        • reverse: reverse the sort order
        • compat: treat characters like '⑦' as '7'

        Algorithms:

        Values:

        • path
        • parent
        • stem
        • title (or any other column value)
        • ps: parent, stem
        • pts: parent, title, stem

        Use this format: algorithm, value, algorithm_value, or option_algorithm_value.
        For example:

        • library watch -O human

        • library watch -O title

        • library watch -O human_title

        • library watch -O reverse_compat_human_title

        • library watch -O path # path algorithm and parent, stem values (path_ps)

        • library watch -O path_path # path algorithm and path values

        Also, if you are using --random you need to fetch sibling media to play the media in order:

        • library watch --random --fetch-siblings always -O
        • library watch --random --fetch-siblings if-audiobook -O

        If searching by a specific subpath it may be preferable to just sort by path instead

        • library watch d/planet.earth.2024/ -u path

        • library watch --related # Similar to -O but uses fts to find similar content

        • library watch -R # equivalent

        • library watch -RR # above, plus ignores most filters

        • library watch --cluster # cluster-sort to put similar-named paths closer together

        • library watch -C # equivalent

        • library watch --big-dirs # Recommended to use with --duration or --depth filters; see lb big-dirs -h for more info

        • library watch -B # equivalent

        All of these options can be used together but it will be a bit slow and the results might be mid-tier
        as multiple different algorithms create a muddied signal (too many cooks in the kitchen):

        • library watch -RRCO

        You can even sort the items within each cluster by auto-MCDA ~LOL~

        • library watch -B --sort-by 'mcda median_size,-deleted'
        • library watch -C --sort-by 'mcda median_size,-deleted'

        https://github.com/chapmanjacobd/library#media-database-subcommands

        1 vote
  10. ssk
    Link
    I created a wishlist website using Flask! Super proud of it. Was able to lean hard on ChatGPT4 and had no hallucinations or fake libraries and what followed best practice advice.

    I created a wishlist website using Flask! Super proud of it. Was able to lean hard on ChatGPT4 and had no hallucinations or fake libraries and what followed best practice advice.

    1 vote
  11. Protected
    Link
    I wrote a whole bunch of documentation for my (never finished, but fully functioning) self-hosted Discord bot. It only took 7 years...

    I wrote a whole bunch of documentation for my (never finished, but fully functioning) self-hosted Discord bot. It only took 7 years...

    1 vote
  12. archevel
    Link
    Been tinkering with the rust crate lopdf to construct a very basics pdf file with just a png image and some non-ascii encoded text. Super fun to get just a basic page with some content on, looking...

    Been tinkering with the rust crate lopdf to construct a very basics pdf file with just a png image and some non-ascii encoded text. Super fun to get just a basic page with some content on, looking at the raw file in vim to verify the representation is as expected. I want to build on this to make a basic library for creating pdfs compact pdfs based on some structured layout/content data.

  13. arqalite
    (edited )
    Link
    I've challenged myself to use Samsung DeX (on my Fold 4, with a Dell portable monitor and a Logitech Bluetooth keyboard) for the entire month of December as my only computing device. So far, I...

    I've challenged myself to use Samsung DeX (on my Fold 4, with a Dell portable monitor and a Logitech Bluetooth keyboard) for the entire month of December as my only computing device.

    So far, I kinda like it. Termux has been great, Python and Rust are natively supported so I've set up VS Code Server as my IDE (sadly I can't get all the extensions I use on PC, but it's fine), and by using PRoot I've set up a Debian instance so I can run Ardour and REAPER. I theoretically can even kinda run Windows stuff using Winlator, but I haven't tried it yet and I expect there to be crashes, and lots of them.

    It doesn't seem like there's a huge roadblock that would prevent me from using this forever, but we'll see how the month progresses.

    I just wish NexDock made a lapdock with a better touchpad, so I would just have to carry the it and the phone instead of 3, potentially 4 (if I also bring a Bluetooth mouse) devices with me. I might still end up buying the NexDock 360 Wireless as a Christmas gift for myself, though, if I do decide to stay on DeX.