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?

21 comments

  1. [4]
    sokkies
    Link
    I saw an article the other day of someone who uses a dot matrix printer to get their daily news, so Im stealing that idea. I found a (40ish year old)printer for really cheap and got it to talk to...

    I saw an article the other day of someone who uses a dot matrix printer to get their daily news, so Im stealing that idea.

    I found a (40ish year old)printer for really cheap and got it to talk to my computer.. Now I just need to source paper that costs 500% more than the printer in my area, and then Im going to try and write a program that does a few things:

    • check if I slept over at my home the night
    • if I did give me a quick weather overview
    • give me a markets overview
    • remind me of any important dates via google calendar or a separate calendar if thats too much effort
    • give me an article that I sent via a telegram bot to read with my coffee
    • format and print everything around 8am when I wake if Im at home

    Im going to try and write everything in Rust because its the higher level language im best at, I hope Ill get somewhere with this project over the next weekend or so.

    7 votes
    1. [3]
      tauon
      Link Parent
      That sounds cool. Quite interested, do you think you could find the original article again?

      That sounds cool. Quite interested, do you think you could find the original article again?

      1. [2]
        kari
        Link Parent
        Not OP but I think this blog post is what they were talking about :)

        Not OP but I think this blog post is what they were talking about :)

        3 votes
  2. ogre
    Link
    I made it about halfway through the book Zero to Production in Rust and I’m giving up. The book is excellent- it’s Rust that I’m burnt out on. In an effort to naturalize Rust’s syntax in my brain...

    I made it about halfway through the book Zero to Production in Rust and I’m giving up. The book is excellent- it’s Rust that I’m burnt out on. In an effort to naturalize Rust’s syntax in my brain I’ve been coding it for a couple hours nearly every day for a while now. I think I’ve reached the level of understanding I was aiming for but it came at the cost of enjoying the language. Rust has its purposes but I’d rather pick another language when programming for fun.

    Since then I’ve picked up Zig and I’m almost done making a neofetch clone. It was trickier than I expected because Zig’s standard library isn’t fully baked, but it offers interfaces for syscalls and I’m able to grab most of the data from there. The hardest part was defining the first external struct to match the shape of the data written by the syscalls. Once I got that first struct working the rest were trivial. I like the speed of my fetcher compared to neofetch, I like Zig, and I don’t like the man pages very much. The only thing left to do now is make some cool ascii art to print out with my system’s info and post a screenshot of my semi-transparent terminal and unriced DE

    7 votes
  3. [3]
    kari
    Link
    I've been writing a little digital clock overlay for Wayland (it should work on any compositor that supports the wlr layer shell protocol) called beanclock. Partly to learn some more about Zig and...

    I've been writing a little digital clock overlay for Wayland (it should work on any compositor that supports the wlr layer shell protocol) called beanclock. Partly to learn some more about Zig and writing Wayland software (I had already written a wallpaper program, also using the wlr layer shell protocol), and partly because I recently stopped using a bar with river but I still want to be able to see the time.

    There are still some things I'd like to add but it's at a point where I use it and don't have any issues anymore.

    I've really enjoyed writing Zig and am definitely intereste in using it for more projects, though I wish this PR to Gentoo's main repo would get merged soon so I could use an official eclass to package Zig projects for myself.

    As far as Wayland goes, I think it's cool writing software for it but I still have a lot to learn. River, the compositor I use, is going to release a "window manager" protocol at some point in a year or so which will basically mean river is just the compositor and all window management is left to a separate program, so I hope to be able to write myself a wm when that time comes.

    6 votes
    1. [2]
      tea_spirit
      Link Parent
      Sounds like a neat little project! Always nice to have proper motivation to build something new. I don’t see a lot of River users around, but I’ve been giving it a shot on my dev machine for the...

      Sounds like a neat little project! Always nice to have proper motivation to build something new.

      I don’t see a lot of River users around, but I’ve been giving it a shot on my dev machine for the last few months. Which layout generator do you use? rivertile hasn’t been ideal for me, but I haven’t gotten around to testing some of the other community layouts quite yet.

      1 vote
      1. kari
        Link Parent
        I've been using riverguile which lets you write your own layouts in Guile Scheme, but admittedly I'm more-or-less using the default rivertile layout, just re-created in riverguile because I...

        I've been using riverguile which lets you write your own layouts in Guile Scheme, but admittedly I'm more-or-less using the default rivertile layout, just re-created in riverguile because I thought writing my config in Scheme sounded fun :P

        There's also #river on Libera.Chat that's pretty active and I'm sure some of the other layout generators get used, though a lot of the focus seems to be shifting to designing WMs for the WM protocol despite it being a year or more out.

        1 vote
  4. honzabe
    (edited )
    Link
    About a year ago I discovered the Flask Python framework, and I liked it so much that I started using it for all my pet projects. First, I rewrote an app I made for myself to help me learn...

    About a year ago I discovered the Flask Python framework, and I liked it so much that I started using it for all my pet projects.

    First, I rewrote an app I made for myself to help me learn languages - the original one was a "quick and dirty" thing that only worked locally, with no database, no user accounts, and data stored in localStorage. Now it's a decent app that I keep improving.

    Another app came about sort of by accident. It started here on Tildes, during last year's TiMaSoMo - I wanted to make an app for training data analysis. The part that handles data from .fit files turned out to be more complex than I expected... but to my surprise, I found that what was originally supposed to be just the core of the app is useful on its own - a journal with a few simple tools for data analysis. When I write my #weight = 160 lbs, the journal looks at older entries and makes a nice graph of my weight over time.

    I'm a bit of a data nerd. When I start doing pushups, I make a chart and see if the progress is steeper with two days of rest instead of one. And when I start getting recurring headaches, for example, I'll write down everything that might be related - how long I slept, how many coffees I had, whether I ate sweets or not... - and look for patterns.
    Even the simplified version of the app is still rough around the edges, but I find it useful for understanding how things in my life are related.  BTW, interesting fact - tinnitus, at least in my case, signals the onset of overtraining before anything else.

    I have other projects too, but this is already too long. And they are all written with Flask.

    4 votes
  5. skybrian
    Link
    I'm still doing heavy internal refactoring on repeat-test. There's a Script class that divides building a value into multiple steps and the shrinker understands the step-based format when mutating...

    I'm still doing heavy internal refactoring on repeat-test. There's a Script class that divides building a value into multiple steps and the shrinker understands the step-based format when mutating values. I have ideas for changing the edit format to be a bit more high-level, treating strings (for example) as atomic values in the build log, rather than breaking everything down into a sequence of picks.

    I should probably release what I have, though. The public API changed a little and in the unlikely event that anyone else starts using it, I'd rather they used the newest version.

    4 votes
  6. goose
    Link
    I'm only skilled in shell script (bash). There's a particular rock/hip-hop mash up duo I've been following for years who post their stuff to Soundcloud. The episodes are around 90 minutes long, so...

    I'm only skilled in shell script (bash). There's a particular rock/hip-hop mash up duo I've been following for years who post their stuff to Soundcloud. The episodes are around 90 minutes long, so not exactly condusive to traditional music media players which expect tracks more in the 3-5 minute range, and no need to save playback progress.

    I wrote a bash script to use yt-dlp to grab the media, and then parse it for various data and properties, which it then stores in an sqlite database alongside the media files themselves.

    Then, I spent a few hours going back and forth with ChatGPT to generate a PHP page to parse the data from the sqlite database, and generate an XML RSS feed that I can load in to my podcast client as a private podcast. As a result, cron keeps files regularly updated and downloaded, and that PHP page will dynamically update accordingly. My podcast client periodically checks for new episodes, and saves my progress along the way if I have to turn it off part way through.

    Small thing, but given that I know very little PHP, I'm pretty happy with it!

    3 votes
  7. shinigami
    Link
    Not working on directly, but maybe posting here will keep me more accountable to myself... I bricked my very old Kindle4 while messing around with it. Ended up getting it stuck in fastboot mode,...

    Not working on directly, but maybe posting here will keep me more accountable to myself...

    I bricked my very old Kindle4 while messing around with it. Ended up getting it stuck in fastboot mode, with no to restart it without getting the drive mounted to a machine.

    I've been able to find the drive when I plug it in, but actually mounting it so I can manipulate it has eluded me thus far.

    2 votes
  8. [8]
    winterstillness
    Link
    Nothing grandiose as a project, but a little problem. I have a plain HTML search page with a GET form. Complication is the pagination. GET results, then use the returned token to "load more"...

    Nothing grandiose as a project, but a little problem.

    I have a plain HTML search page with a GET form. Complication is the pagination. GET results, then use the returned token to "load more" results. There's no "GET me page #".

    Normally you'd use JS to GET and append results to the table. Keeping "state" on the front-end. But I really want to keep JS out of this. Which means I need to keep "state" on the back-end. Something like a "view" scoped controller.

    I'm using Spring MVC, and I combined it with Web Flow for this. I have my "view" scope, but the search is now a POST. This means I can't bookmark or copy/paste the URL to share searches.

    Every avenue I explore has something that I need to give up.

    1 vote
    1. [4]
      skybrian
      Link Parent
      How about a hidden form field with the page number? After submitting, it will become part of the URL like the other fields.

      How about a hidden form field with the page number? After submitting, it will become part of the URL like the other fields.

      2 votes
      1. [3]
        winterstillness
        Link Parent
        The API doesn't support the concept of a page #. To load more results you pass a token (that was returned in the previous result). This means you can't load "previous" results if you load the next...

        The API doesn't support the concept of a page #. To load more results you pass a token (that was returned in the previous result). This means you can't load "previous" results if you load the next result set. So if you want to keep displaying what you loaded previously, then you need to keep that state on your end.

        1 vote
        1. [2]
          skybrian
          Link Parent
          I see. It seems like the problem might be more fundamental then? If someone bookmarks page 3, how long can you expect the API to work using that token? If it expires, do you need to restart the...

          I see. It seems like the problem might be more fundamental then? If someone bookmarks page 3, how long can you expect the API to work using that token? If it expires, do you need to restart the query from page 1 and iterate to get back again?

          If the page isn’t really bookmarkable, it might be better to switch to POST.

          1 vote
          1. winterstillness
            Link Parent
            It really is a fundamental problem. The more I explore, the more I'm convinced there's no "no JS" approach to this. Back-end state management complexities are negated by introducing JS and keeping...

            It really is a fundamental problem. The more I explore, the more I'm convinced there's no "no JS" approach to this. Back-end state management complexities are negated by introducing JS and keeping the "state" there. What I end up with is a hybrid of GET the initial request, thus preserving the criteria in the URL, whilst using JS to load additional results.

            2 votes
    2. [3]
      ogre
      Link Parent
      Can you just include the amount you want to load in the search? e.g. example.com/search?q=dojacat for the initial search, and when the user clicks the load more button another request is sent for...

      Can you just include the amount you want to load in the search? e.g. example.com/search?q=dojacat for the initial search, and when the user clicks the load more button another request is sent for example.com/search?q=dojacat&amt=100. I'm not sure how your return token fits into this model though.

      1 vote
      1. [2]
        winterstillness
        Link Parent
        The core problem is once I request the second set of results, then the previous results are lost from the view. I'm essentially trying to keep state in a stateless flow. <form action="/results"...

        The core problem is once I request the second set of results, then the previous results are lost from the view.

        I'm essentially trying to keep state in a stateless flow.

        <form action="/results" method="get">
          <input type="text" name="year"/>
        </form>
        
        <table></table>
        
        <form action="/results" method="post">
          <input type="hidden" name="paginationToken" value=""/>
          <input type="hidden" name="year" value=""/>
        </form>
        

        Pagination works via POST redirect GET on /results when paginating, thus preserving the criteria as request params. But previous results are lost because there's no "state" outside of request params. I could offload previous results in the session, but then I'd have to wrestle with "conversation" management. For example, what happens when you open more than one tab in the same session?

        1 vote
        1. skybrian
          Link Parent
          How about including both the pagination token and the page number in the request and the URL? If the pagination token doesn't work anymore, at least there's enough info to figure out what ought to...

          How about including both the pagination token and the page number in the request and the URL? If the pagination token doesn't work anymore, at least there's enough info to figure out what ought to be there.

          1 vote
  9. xk3
    Link
    Filling out a CBP 3299 almost feels like a programming project. At first glance it seems like a simple two-page form but given close examination there are so many weird eye-brow raising...

    Filling out a CBP 3299 almost feels like a programming project. At first glance it seems like a simple two-page form but given close examination there are so many weird eye-brow raising inconsistencies. It is simultaneously perfectly reasonable and completely insane. A bit like javascript. It was probably designed via committee with each person focused on the thing they cared about the most... each part is reasonable in isolation but together: confusing. disjointed. not whole.

    1 vote