• Activity
  • Votes
  • Comments
  • New
  • All activity
    1. Creating an Android app - Help refer a book or guide?

      For most of my life, I've been a hobbyist programmer. From Qbasic to Python and JavaScript. I've always wanted to create an Android app, really just for me, just to do it. It's a bucket list...

      For most of my life, I've been a hobbyist programmer. From Qbasic to Python and JavaScript. I've always wanted to create an Android app, really just for me, just to do it. It's a bucket list thing.

      Can you give me a book or a website guide that is up to date and complete but not 100,000 pages long that could help me get it done? A book would be preferred! I just want to cross this off my list!

      13 votes
    2. What is the most advanced or creative program you can create using the LOX programming language?

      Lox is a toy programming language that is designed in Java and C at craftinginterpreters.com. My challenge to you is: given the constraints of the Lox language, what are some creative or advanced...

      Lox is a toy programming language that is designed in Java and C at craftinginterpreters.com.

      My challenge to you is: given the constraints of the Lox language, what are some creative or advanced programs you can create?

      This page provides a rundown of the design of Lox.

      To kick it off, here's a simple function that estimates the value of pi:

      fun estimatePi(rounds) {
      	var pi = 0;
      	var alt = 1;
      	for (var i = 0; i < rounds; i = i + 1) {
      		pi = pi + alt * 4/(2 * i + 1);
      		alt = -alt;
      	}
      	return pi;
      }
      
      print "The value of pi is:";
      print getPi(100000);
      
      3 votes
    3. Local DNS resolution for server?

      I have to preface this question with a disclaimer that I am an eager learner of Linux and servers in general, but I'm still a beginner and often run into roadblocks. Current setup: Raspberry Pi 3...

      I have to preface this question with a disclaimer that I am an eager learner of Linux and servers in general, but I'm still a beginner and often run into roadblocks.

      Current setup:


      • Raspberry Pi 3 with Adguard Home acting as primary DNS
      • unRAID server with Adguard Home acting as secondary DNS
      • About a dozen other containers running on same server
      • DHCP is handled by my router

      Goal:


      • provide local DNS names for the containers running in unRAID so I don't have to enter IP:Port (e.g, calibre.local) which also has the side benefit saving the various username/password combos into Bitwarden with an actual domain attached to it instead of 14 occurrences of 192.168.x.x

      Additional info:


      I had PiHole running on the Pi before as the primary and only DNS previously. And I seem to recall you could put IP:Port as a custom DNS and have it resolve. AGH does have a feature for DNS Rewrites but it does not allow for port numbers, IPs only. I switched to AGH because it seems to be more effective at blocking ads, which is likely more a function of the provided DNS blocklists out of the box as opposed to what I was doing in Pihole. I would prefer to stick with AGH for adblocking/DNS if possible.

      I looked into just modifying host files on the main computers I touch these apps from, but again, can't include port. What is a good solution for this? Preferably something approachable for a newb like me.

      11 votes
    4. What are your favorite Postgres features?

      You could use any SQL database to create a few tables, insert some data, and do queries, while ignoring anything vendor-specific. But Postgres has a lot of other features and many extensions. What...

      You could use any SQL database to create a few tables, insert some data, and do queries, while ignoring anything vendor-specific. But Postgres has a lot of other features and many extensions. What do you recommend checking out beyond the basics?

      I've used a lot of databases, but it's been many years, so I assume things have changed quite a bit. I skimmed a few PostgreSQL release notes and learned that there's now a MERGE statement that looks pretty handy. (It's standard SQL.) And from Neon's list of supported extensions, the plv8 extension caught my eye. It would let me write stored procedures in JavaScript. Does anyone use that? Do you use stored procedures at all?

      I wonder what Tildes uses?

      (To keep discussion organized, please write about one feature per top-level comment.)

      17 votes
    5. Best word processor for Ubuntu?

      Hey folks, looking for recommendations. What's your go to word processor on Ubuntu? (EDIT: For regular writing, not a text editor for coding.) I haven't been the biggest fan of Libre office tbh...

      Hey folks, looking for recommendations. What's your go to word processor on Ubuntu? (EDIT: For regular writing, not a text editor for coding.) I haven't been the biggest fan of Libre office tbh (please don't hate me...) There were just several bugs in Writer that made it unusable for me. I'm curious about alternatives. I read that WPS office is on ubuntu, but I've always found it to run kind of slow (however, my experience was on Windows.).

      I don't need a lot of fancy utilities, but would enjoy something a little more beautiful than notepad++ :) My biggest concern is just that it's a stable software. I'm OK with glitches or UI bugs, just nothing that's going to crash and burn and corrupt my work. (I mention this because there are several newer word processors made by single developers, and I'm a little weary to use them because I don't genuinely know how stable the software is.) I'm also not a fan of software that saves in some special format where you rely on that software to open it (or have to go through hoops to convert it.)

      Any recommends?

      EDIT: I'm new to Ubuntu, in case it makes a difference.

      31 votes
    6. Best, favorite, and/or interestingly-different resources to learn (or re-learn) Git?

      Pretty much, the title. I have been coding professionally for over 2 decades, been using Git for almost as long ... and to this day, it still feels alien and uncomfortable to use. I keep feeling...

      Pretty much, the title.

      I have been coding professionally for over 2 decades, been using Git for almost as long ... and to this day, it still feels alien and uncomfortable to use. I keep feeling like I am relearning it all over again. I would really like to find some kind of different resource that helps me to make Git "stick" in my brain, and become more intuitive. Maybe that's just not possible, but I keep hoping.

      Meanwhile, my roommate is just starting her journey into programming, and her class just started teaching Git ... and I'm eavesdropping a bit, and they're teaching it okay, but I'm sure there are better tutorials out there for a newcomer.

      I am aware of -- and currently reading my way through -- both this recent tildes post and the various tutorials mentioned in it. But I am looking for other recommendations, as well ... and I bet I'm not the only one.

      Thanx in advance.

      19 votes
    7. Organizing self-hosted classical music collection

      I'm currently using Navidrome to self-host my music collection, while using DSub to listen on-the-go. This works very well for most genres, except for the bulk of my music which is classical...

      I'm currently using Navidrome to self-host my music collection, while using DSub to listen on-the-go.

      This works very well for most genres, except for the bulk of my music which is classical music. This presents its own host of problems pertaining to cataloguing and using metadata, since there are often multiple recordings of the same musical composition, recorded by multiple conductors with different orchestras and/or soloists. There may also be different instrumental arrangements of the same musical piece. Merely sorting by "Artist" is therefore quite unsatisfactory in this scenario.

      Some streaming services have come up with quite satisfying solutions in my experience (notably Apple Music Classical and Idagio), but I am not sure how to go about listening to my own self-hosted classical music.

      Is anybody here on Tildes familiar with this organizational problem? I would be very eager to hear how you have tackled this. Is there any self-hosted software more suitable to cataloguing musical collections with extensive metadata?

      13 votes
    8. Do C programmers usually create and curate a personal library for their own use?

      I've been using mostly C at my current job for about half a year now, and I find myself reusing some little function that I've written for another code base in current projects. I'm relatively new...

      I've been using mostly C at my current job for about half a year now, and I find myself reusing some little function that I've written for another code base in current projects. I'm relatively new to this, so I'm wondering if it makes sense to have a repertoire of general purpose utility functions and whatnot for future use.

      I mean, the language's pretty established and whatever I think of must have been written by somebody else already, so is there even a need for what I'm talking about? Are there well-known open source libraries that resemble what I am talking about? Should I just include them instead of writing my own?

      Sorry if this is a bit vague. General purpose as in string manipulation, debug output, buffer operations, implementations of data types not in C, etc., just to name a few examples.

      32 votes
    9. How to clean up the space taken by old Snap and flatpak files

      When Snap and\or flatpak install or update packages they do not always do so cleanly Snap for example can keep up to 3 previous versions on updating and if you are struggling for space then this...

      When Snap and\or flatpak install or update packages they do not always do so cleanly

      Snap for example can keep up to 3 previous versions on updating and if you are struggling for space then this can be a Bad Thingtm

      These couple of pages show a good reliable way to tidy up and get back some disk space
      Snap

      Flatpak

      Please note, I am not the author. The articles are on a website called debugpoint.com and does not carry a credit

      4 votes
    10. Fixing overscan on an uncooperative TV-monitor

      This is mainly so I can find this again and not have to rediscover this for the third time after I forget. I can't find this exact solution anywhere else so I figured I should put it somewhere. I...

      This is mainly so I can find this again and not have to rediscover this for the third time after I forget. I can't find this exact solution anywhere else so I figured I should put it somewhere.

      I have a terrible Insignia tv that locks the overscan option so you can't even turn it off, and linux mint for whatever reason doesn't recognize it as a TV so I can't use their automatic TV adjustments. This is just for x11 afaik.

      So in the end, I used the underscan to defeat the overscan and it works great:

      xrandr to get the output name the TV is using, then

      xrandr --output <name-of-tv-output> --set underscan on --set "underscan hborder" <0-128> --set "underscan vborder" <0-128>

      to enable underscan and tweak the border values which squash the edges of the screen, undoing the effects of the overscan.

      for me the optimal values are 128h 40v but you can just experiment by typing the command into the console before you make it permanent.

      8 votes
    11. What's a simple, cheap way to run a database-backed website as a hobbyist?

      I use Github and Netlify to run some simple websites for free. It works well. However, I've been thinking of experimenting with a database-backed website for fun and Netlify doesn't have any...

      I use Github and Netlify to run some simple websites for free. It works well. However, I've been thinking of experimenting with a database-backed website for fun and Netlify doesn't have any persistence.

      What's a good way to do this that scales to zero when nobody's using it? I want to be able to forget about it entirely for months or years at a time. When someone visits, it should start up and run on demand without costing me $20 a month on standby.

      Back in the day, I used Google App Engine for this. I learned a lot of datastore tricks to get around its poor latency, but I'm lazy and don't want to do that anymore. I'm pretty sure I want a SQL database and full text search. Either sqlite or Postgres would do, but I doubt there's a cheap enough way to run Postgres.

      Litestream looks interesting and so does LiteFS, except that it's pre-1.0 and I don't know what changes fly.io will make that I have to keep up with. If I used Litestream, I'd have to figure out how to run it and where to store the replication logs.

      Edit: one nice-to-have is being able to easily dump the database and run it locally or on another cloud provider. (I don't anticipate it getting so big that it's impractical.)

      47 votes
    12. Fortnightly Programming Q&A Thread

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads. Don't forget to format your code using the triple...

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      
      11 votes
    13. 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...

      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?

      46 votes
    14. Dealing with databases, inserts, updates, etc. in Python

      Current Library: built in sqlite Current db: sqlite (but will have access to Snowflake soon for option 1 below) Wondering if anyone here has some advise or a good place to learn about dealing with...

      Current Library: built in sqlite
      Current db: sqlite (but will have access to Snowflake soon for option 1 below)

      Wondering if anyone here has some advise or a good place to learn about dealing with databases with Python. I know SQL fairly well for pulling data and simple updates, but running into potential performance issues the way I've been doing it. Here are 2 examples.

      1. Dealing with Pandas dataframes. I'm doing some reconciliation between a couple of different datasources. I do not have a primary key to work with. I have some very specific matching criteria to determine a match (5 columns specifically - customer, date, contract, product, quantity). The matching process is all built within Python. Is there a good way to do the database commits with updates/inserts en masse vs. line by line? I've looked into upsert (or inserts with clause to update with existing data), but pretty much all examples I've seen rely on primary keys (which I don't have since the data has 5 columns I'm matching on).

      2. Dealing with JSON files which have multiple layers of related data. My database is built in such a way that I have a table for header information, line level detail, then third level with specific references assigned to the line level detail. As with a lot of transactional type databases there can be multiple references per line, multiple lines per header. I'm currently looping through the JSON file starting with the header information to create the primary key, then going to the line level detail to create a primary key for the line, but also include the foreign key for the header and also with the reference data. Before inserting I'm doing a lookup to see if the data already exists and then updating if it does or inserting a new record if it doesn't. This works fine, but is slow taking several seconds for maybe 100 inserts in total. While not a big deal since it's for a low volume of sales. I'd rather learn best practice and do this properly with commits/transactions vs inserting an updating each record individually within the ability to rollback should an error occur.

      11 votes
    15. Is there a good microprocessor with 24-bit addressing?

      The original IBM 360 had a 24-bit address space. https://en.wikipedia.org/wiki/IBM_System/360 Microprocessors of the golden age of home computing (Apple ][, TRS-80, Commodore 64, CP/M machines...

      The original IBM 360 had a 24-bit address space.

      https://en.wikipedia.org/wiki/IBM_System/360

      Microprocessors of the golden age of home computing (Apple ][, TRS-80, Commodore 64, CP/M machines based on the 8080 and Z80) usually had a 16-bit address space, the 8086/8088 was a bit of an exception because it had a segmentation scheme to access 1 MB. (People thought it was awkward but I liked programming it in assembly language and Turbo Pascal) I remember the PDP-11 minicomputer having a 16-bit address space for user programs as well, the machine as a whole could be a lot bigger but an individual logged into it had access to a virtual "home computer" that ran BASIC and all.

      24-bit was a natural evolution and by the late 1980s you started to see 24-bit chips like the 80286 (PC AT) the 65C816 (Apple IIgs, Ninteno SNES), the eZ80 and such. Even the bigger AVR8 processors (I love AVR8 assembly) can have more than 64kb of program memory (flash, read-only in operation) so they use 24-bit addresses for program memory.

      In my mind we never saw a product of this generation that really took advantage of the address space, the 80286 in particular was called "brain damaged" by Bill Gates and operating systems struggled to exploit it. My take is that most of the chips of that generation were flawed in one way or another and were pretty quickly washed away by 32-bit machines when they became affordable in the early 1990s.

      For an example of the difficulties, there is this project to make a retrocomputer that is a bit better than anything we had in the 1980s,

      https://www.youtube.com/watch?v=0oYcu43N-lw

      they are using the 65C816 but not taking advantage of the 24-bit nature. Instead there is a simple bank switching scheme which I think they thought would be easier to program and probably faster. The 65C816 just doesn't have enough registers and addressing modes for it to be really easy to work with far pointers.

      So my question is, if I am a hobbyist who wants to revive the 24-bit generation and I want to have easy access to a 16MB address space, is there some CPU better that doesn't suck? I'd be happy with a CPU that doesn't have virtual memory or other facilities for an advanced operating system (write everything in "real mode") but something that supports an OS would be interesting too. Any ideas?

      7 votes
    16. COM+ alternatives in 2023?

      We are small company and have utilized COM+ on the server for the last 20 years. Strictly Windows and all LAN based communication. We are rewriting in c#. What are some alternatives that I can...

      We are small company and have utilized COM+ on the server for the last 20 years. Strictly Windows and all LAN based communication. We are rewriting in c#. What are some alternatives that I can look in to that may be better in terms of speed or management for COM+?

      7 votes
    17. Looking for resources about AI development

      Hello, I'm looking for resources on how to develop AI, aimed at people who already have experience with programming. They don't have to be free, I would just like to aggregate different type of...

      Hello,
      I'm looking for resources on how to develop AI, aimed at people who already have experience with programming.

      They don't have to be free, I would just like to aggregate different type of resources to pick from.

      Thanks!

      14 votes
    18. How to go about mirroring a repo to separate real identity from online identity?

      I struggled to word this question. Let's say that I wish to work on a project to benefit Tildes (I don't currently have an idea, but just for example). Anything I did, I would like to keep...

      I struggled to word this question.

      Let's say that I wish to work on a project to benefit Tildes (I don't currently have an idea, but just for example). Anything I did, I would like to keep opensource and would encourage other users to contribute. But I would like to keep everything linked to my pseudonym as not to dox myself.

      However, I would like to have a copy of everything on my personal GitHub as well, because I am a professional programmer and that is effectively my CV.

      Is there a good way to mirror a repo in a way that any git history contributed by me, "John Smith", is changed to "bugsmith" on the mirrored repo? (or vice versa).

      6 votes
    19. What does your self-hosted server setup look like?

      Hoping we can get some discussion on self hosting setups throughout the community and help anyone who may be interested with common setups and finding interesting software. Hardware Currently...

      Hoping we can get some discussion on self hosting setups throughout the community and help anyone who may be interested with common setups and finding interesting software.

      Hardware
      Currently running everything on a Dell 7050 SFF (intel i5-7500 and 16GB RAM) which suits my needs perfectly. Had used an older SFF before (i forget which) and a cheap older model mac mini (2012 I think) for self hosting before, but those were not the right choice as I didn't properly understand what hardware encoding was at the time. The i5-7500 handles all the media I have when transcoding is needed. Only thing it can't do is AV1, but my setup avoids those anyway.

      Operating System
      Distro Hopping habits are hard to break and that "itch" unfortunately carry over to the server. Currently running Ubuntu 22.04 LTS for a few months now, but feeling like a change is needed soon. I've used Ubuntu, Debian, and Fedora for servers before and they each have their own little problems that make me eventually switch. I am considering maybe doing a Proxmox setup so I can spin up a VM whenever that itch comes, but not sure if they added complexity is worth it in the long run.

      Software
      Yay, the best part! My self hosting stack has changed a ton over the years. Everything in my stack is in a docker container through a set of badly written compose files (planning on redoing things, cleaning things up, making things consistent, etc.). I'll just do a rundown of everything with a brief description of what it is:

      • Plex Gives me a Netflix like streaming experience at home. Currently working on shifting things over to JellyFin as Plex is starting to grow increasingly buggy for me.
      • Sonarr Automatically tracks and downloads all my shows. I have two instances of this running, one for normal tv shows and another for anime
      • Radarr Automatically tracks and downloads all my movies.
      • Prowlarr Sowers the high seas for what Sonarr and Radarr are looking for and gives them the "linux iso".
      • rdt-client Probably different to most peoples setups. I use a debrid service (not sure why people call them that), to download my "linux iso's" for me and I do a direct download from them. Much quicker and no torrenting traffic on my end. Also it's also cheaper than paying for a VPN usually.
      • File Browser A good web ui for managing files
      • Nginx Proxy Manager Is a reverse proxy for all of my services and gives me HTTPS for everything. Gets rid of the annoying browser warnings.
      • Tailscale The most recent addition to my setup. Allows me to access my network anywhere. Similar to a VPN (I know it uses wireguard under the hood), but does a lot of magic for you and just makes everything work and connect together, its really cool.
      • Adguard Home Gives me a local DNS server that does DNS level ad blocking. Never given me problems and it works well, but I am thinking of reducing the complexity of my setup and removing it. There tons of DNS servers out there that can do the same thing and I don't mind trusting a few of them (like quad9 or mullvad dns).
      • Watchtower It monitors all my docker containers and keeps them up-to-date. If a new version is out, it will automatically download the latest version and restart the container and delete the old container version. I know its not the best idea, but its only cause a break 1 time with 1 container in the couple years I've run this setup.
      • Homepage Literally the homepage for all my services. I've tried a lot of different ones and Homepage is easily the best. Simple, but powerful to configure.

      Keen eyes may have noticed the lack of backup software. I'll get around to that, eventually.

      47 votes
    20. Looking for a remote storage provider to use for storing backups

      I'm looking for mountable remote storage that I can use for my backup solution at home. I'm trying to get set up with backuppc and need to be able to mount a large remote filesystem to store my...

      I'm looking for mountable remote storage that I can use for my backup solution at home. I'm trying to get set up with backuppc and need to be able to mount a large remote filesystem to store my archives. I've tried renting a 1TB storage box from Hetzner, but my account was rejected (I assume because of a recent legal name change). Can anybody recommend a similar provider of remote storage that I can rent and mount onto my server?

      27 votes
    21. 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...

      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?

      30 votes
    22. 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...

      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?

      27 votes
    23. Firefox refuses to use fonts in ~user/.config/fontconfig/fonts.conf

      I have the following on my fonts.conf <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <alias> <family>system-ui</family> <prefer> <family>FreeSans</family> </prefer>...

      I have the following on my fonts.conf

      <?xml version="1.0"?>
      <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
      <fontconfig>
        <alias>
          <family>system-ui</family>
          <prefer>
            <family>FreeSans</family>
          </prefer>
        </alias>
      </fontconfig>
      

      But when websites use font-family: system-ui firefox just ignores this and uses Cantarell anyway, which I don't even know where it is getting it from. (Not Firefox font preferences).

      Any idea how to make firefox respect my fonts.conf?

      This is Linux with i3.

      11 votes
    24. Is it normal to stress about your codebase becoming bad?

      Lately, I've been working on a game in Godot. I've having a lot of fun, but I keep stressing out about my codebase becoming bad. I'm worrying about amassing technical debt, and having to rewrite...

      Lately, I've been working on a game in Godot. I've having a lot of fun, but I keep stressing out about my codebase becoming bad. I'm worrying about amassing technical debt, and having to rewrite huge amounts of code because of bad practices.

      I've been reading best practices documentation for Godot, and learning about game programming patterns, but it's still a worry for me.

      I'm wondering if this is a normal feeling, and how more experienced developers manage it.

      24 votes