14 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?

12 comments

  1. ShroudedScribe
    Link
    At work, I have to build / help companies build applications in a "low-code / no-code" platform. As you might be able to guess, there are scenarios where code is required to get the final desired...

    At work, I have to build / help companies build applications in a "low-code / no-code" platform. As you might be able to guess, there are scenarios where code is required to get the final desired result.

    So I have to inject CSS and JavaScript into the front end to move things around and set up additional styling. But what I've done this time is something I'm very happy with. I was able to make an interface that's nearly identical to mockups the customer provided.

    It's still the type of thing I'd rather not be working with. But I'll take what few victories I can get.

    8 votes
  2. menturi
    Link
    I have always been interested in learning chording as another way to interface with the computer as a means for text input. I never took the project of learning too seriously because it required...

    I have always been interested in learning chording as another way to interface with the computer as a means for text input. I never took the project of learning too seriously because it required memorization to such a significant degree that it seemed too daunting with unknown actual benefits, and that process didn't seem that fun to be honest. But alas, I did briefly try at one point a couple years ago. Not too far in, I realized it didn't seem that ergonomic of a method as it caused some degree of discomfort in some of my fingers. I went searching for alternatives, for the life of me, I could not find a variant of chording that had explicit design goals that are related to ergonomics, kind of like the Dvorak keyboard layout does.

    I recently have been toying with AutoHotkey to help me type phrases I happen to find myself typing repeatedly to LLM-based chat bots, things like "Respond with a bullet point list". I set it up in a way to be chorded on the keyboard with multiple letters at the same time to avoid conflicts with key binds in software. This is when I realized I was implementing a system that is very similar to existing chording methods but instead of chords for entering words it is chords for entering phrases. So I then expanded my use case to general language input for entering text on the computer for everyday phrases. I looked the most common 1000 sequences of three words (3-grams) in English as the starting point to see if this is worthwhile. I wanted to make memorization easier so I decided to define the chord keys as the first letters of the three words. But there are many 3-grams where the words start with the same set of three letters, so I had to find a way to rank them. The 3-grams list I had already included frequency so I can use that. But I also wanted to prioritize longer phrases over shorter ones to reduce total number of key strokes necessary to enter text, so I scored each 3-gram as a combination of phrase length and frequency. For every triplet of unique letters, I defined the chord as the best ranked phrase using this score. The result is about 200 chords for common phrases that ultimately require fewer key presses to enter. All I have to do is type the three letters at the same time and it'll enter one of these common phrases. For example, pressing the I+O+W keys at the same time will enter the text "in other words"; or F+A+M for "for a moment"; or T+N+O for "the number of".

    I practiced a bit on Typemonkey a bit am able to reach similar typing rate as normal keyboard typing at 110 words per minute. I bet with practice, one could type faster, despite not being an explicit design goal, I was mostly interested in reducing number of keystrokes, which I suppose implicitly means it'll be quicker to type. Though I noticed the source seems to use a fair amount of legal text, and I'm pretty sure looking at the top 1000 is not enough with my scoring method to get longer phrases. I found Google Ngram Exports so am in the process of a whole data analysis project to try to identify which chords are the best to use. There's like 3 TB of data, I've not worked with something so large before, this'll be an adventure.

    8 votes
  3. [4]
    goose
    Link
    I wrote a script to convert a YouTube feed to a podcast feed. A YouTuber I follow through podcast recently started injecting ads in to the podcast feed (that aren't present in the YouTube feed). I...

    I wrote a script to convert a YouTube feed to a podcast feed. A YouTuber I follow through podcast recently started injecting ads in to the podcast feed (that aren't present in the YouTube feed). I didn't realize this at the time, I thought the feed was a third party who was monetizing content that wasn't theirs. So I made this script which is powered by yt-dlp, and because of that, it also has SponsorBlock support. So I went from sponsor messages, to ads + sponsor messages, to neither.

    6 votes
    1. [2]
      jonah
      Link Parent
      I pay for premium so I don’t have to deal with ads anymore (especially on iOS and TVs), but man I miss Sponsor Block. How does that integrate with yt-dlp? Is it native, or do you do something...

      I pay for premium so I don’t have to deal with ads anymore (especially on iOS and TVs), but man I miss Sponsor Block. How does that integrate with yt-dlp? Is it native, or do you do something else? I’m interested in finding ways to integrate something like that with my home video consumption.

    2. slade
      Link Parent
      I always have complicated feelings about things like this. On one hand, in our current paradigm, I want creators to be compensated with money for their work. On the other hand, the current...

      I always have complicated feelings about things like this. On one hand, in our current paradigm, I want creators to be compensated with money for their work. On the other hand, the current paradigm takes a willing producer and a willing consumer and injects a third party in the middle that nobody actually wants, and I'd like to see that torn down. And on one foot, while I want to reward creators, I'm grossed out that I have to do that by rewarding YouTube and trusting them to fairly pass along the value to the creator.

      I've always thought that a public video hosting platform, with X bytes of content per citizen, would do much to upend the algorithm chasing YouTube brings about. If it's not out to make money, then there's no misanthropic "algorithm" that optimizes profit, just simple search. And it would only really incentive creators that do it for passion. I'd be giddy to only consume content from people who aren't trying to make money off of it.

      Let's bring back public access for the internet age!

      This is me musing about my own values and goofy ideas, so please don't take any of it as judgement against your project. What you did sounds like a really cool project.

  4. bo0tzz
    Link
    I'm low key obsessed with 3D printing and am hoping to convert my printer to a toolchanger sometime soon. My holy grail is full-colour printing, but no consumer/FDM process is capable of that yet....

    I'm low key obsessed with 3D printing and am hoping to convert my printer to a toolchanger sometime soon. My holy grail is full-colour printing, but no consumer/FDM process is capable of that yet. At the start of this week I ran into a paper (https://www.sciencedirect.com/science/article/abs/pii/S0097849318300578) that lays out how to apply halftoning (or dithering) to FDM printing, which seems to me like it's incredibly promising. Two examples from the one person I can find that's already pulled it off: grayscale and 4 colours.

    So now I'm down a rabbit hole using https://github.com/FullControlXYZ/fullcontrol and generating gcode based off of images, with the eventual goal of building a proof-of-concept of the techniques laid out in that paper and hopefully convincing one of the existing big slicers to implement this approach.

    4 votes
  5. xk3
    Link
    I bought two Host-Managed SMR disks recently and spent a few hours total over the past week learning new things about how they behave. zoned btrfs is definitely a life-saver in this situation but...

    I bought two Host-Managed SMR disks recently and spent a few hours total over the past week learning new things about how they behave. zoned btrfs is definitely a life-saver in this situation but overall it's not worth learning about unless your IO workload matches what HM-SMR is good for: unchanging files. The hardware support for these types of drives is not a guarantee; eg. you can't use them in HBA pass-through.

    As far as I know btrfs is the only filesystem that works on this type of drive--even f2fs requires the drive to have a conventional zone to save fs metadata. These types of drives aren't super common to find either so I've added a filter to my diskprices site to always filter out these drives--it's just not worth it for >90% of users.

    The biggest annoyance that I've encountered so far with these drives is that btrfs will remount into read-only mode if it runs out of metadata overhead (ENOSPC). It's hard to predict when this will happen because it is different from the normal btrfs data/metadata blocks:

    This process may take some time depending on other background work or amount of new data written. It is possible to hit an intermittent ENOSPC. Some devices also limit number of active zones.

    https://btrfs.readthedocs.io/en/latest/Zoned-mode.html#zone-reclaim-garbage-collection

    One thing that has helped eliminate this read-only remounting is that mergerfs has an option to skip creating new files on devices but still have them writable (mv, rm, etc):

    sudo mergerfs.ctl -m /mnt/d set branches /mnt/d1=RW:/mnt/d2=NC:/mnt/d3=NC
    

    And then I just write directly to the drives (ie. in /mnt/d2/ instead of /mnt/d/) when I have something specific to save there. I've been weening myself off mergerfs but it's still really useful in a few contexts...

    eza --git causes sshfs to hang which made me think that sshfs was really slow for the longest time but now I'm using sshfs a lot more and using eza --git a lot less...

    3 votes
  6. IsildursBane
    (edited )
    Link
    For my DIY MP3 player, I have ordered most of the hardware needed, an am now just in the process of getting it all to work. The first step is to get my 2" Waveshare screen to work. Last night I...

    For my DIY MP3 player, I have ordered most of the hardware needed, an am now just in the process of getting it all to work. The first step is to get my 2" Waveshare screen to work. Last night I started working on setting it up in FBCP porting, but I either missed a step or the documentation is missing something. Overall Waveshare's documentation is way better than the first screen I ordered, but as someone who has not played around with these types of screens before, I find Waveshare's documentation to be lacking a bit of information to make it a bit easier to understand

    Edit: I got the screen working using FBCP now. Part of the issue was my error in setting up FBCP, although the script they provide does not work, although they do provide documentation on how to do it manually. Now that the screen is working, I can start figuring out how to wire in my rotary encoder and other parts of the software stack

    2 votes
  7. V17
    Link
    Update on my audio declipper, already mentioned here (contains a link to a video demonstrantion) and here. The declipping itself works well enough. I spent some time looking through ways to make...

    Update on my audio declipper, already mentioned here (contains a link to a video demonstrantion) and here.

    The declipping itself works well enough. I spent some time looking through ways to make it much faster if I decide to make a paid "pro" version (the basic version will be slow and open-source), then I started working on a GUI.

    Surely blocking out a GUI in Qt Creator a putting it together using one of the Qt libraries for Python is going to be simple enough. It's a simple app - load a file, set some numerical parameters, display the waveform of the loaded sound file, save the file after it's processed. A weekend job.

    Finding a fast library to display a large sound waveform was reasonably quick. PyQtGraph works, it has some bugs, but it mostly works and things that I needed are very simple to do.

    Everything worked fine, except the GUI and the computation ran in the same thread, so as soon as it started actually declipping, the whole application froze until it was done (which commonly takes minutes). Obviously that is unacceptable and I knew I'd have to push the computation in a separate thread.

    Luckily Qt has a standard and easy method of doing that.

    So I did it, moved the computation to a separate object, connected the object to a different thread and Qt took care of the rest.

    As a result, a message box that pops up after the computation is done and waits for the user to click "OK" now just flashes for a single frame and vanishes, sometimes it's not even visible.

    I painstakingly tried various changes to the code, added some safety here and there to make sure it's running it the GUI thread and not the one that's shut down, tried completely removing some potentially problematic libraries here and there, consulted with ChatGPT o1 and o3-mini and I'm happy to say it had an effect: the message box still just flashes and vanishes, but now my main app window also jumps into the background behind other active windows and immediately freezes without writing out any error.

    Great success.

    I am starting to get really frustrated but I don't think I can do anything else but just remove all features one by one, gradually moving towards a very minimal example (a very simple window with one button that emits a message box through a separate worker thread, that one works) till it stops happening to find out what's causing it. Pain.

    1 vote
  8. winther
    Link
    I like playing around with static site generators and thought they could be useful in giving me a personal "backup" of content that I put on other platforms. In my case, all my reviews on...

    I like playing around with static site generators and thought they could be useful in giving me a personal "backup" of content that I put on other platforms. In my case, all my reviews on Letterboxd. I would like to have proper ownership of that. Thankfully it was pretty simple taking their export function, parsing the CSV file into Markdown files that I could pretty easily make a quick and dirty site using jekyll. I wrote a bit about the process here

    1 vote
  9. F13
    Link
    Finally got around to automating the build of my custom containers (and their delivery to Gitea) so that I can use Watchtower to keep my fully containerized lab up to date!

    Finally got around to automating the build of my custom containers (and their delivery to Gitea) so that I can use Watchtower to keep my fully containerized lab up to date!

    1 vote