• Activity
  • Votes
  • Comments
  • New
  • All activity
    1. 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?
      
      4 votes
    2. 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?

      6 votes
    3. 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?
      
      3 votes
    4. 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?
      
      5 votes
    5. Interest in a 0-downtime managed Postgres migration tool?

      I recently discovered how much of a hassle it is to migrate off of Heroku Postgres. Both to keep the user from screwing themselves and as a vendor lock-in mechanism there's no possibility of...

      I recently discovered how much of a hassle it is to migrate off of Heroku Postgres. Both to keep the user from screwing themselves and as a vendor lock-in mechanism there's no possibility of running an external replica for your Heroku Postgres database. Unless I'm missing something (after a bunch of Googling) it seems like there is a market gap for a tool that allows for a seamless migration away from a Postgres DB that won't allow for replicas.

      I imagine that, given some constraints on what queries you allow on your database, you could proxy connections to a managed Postgres database while feeding them simultaneously to a new database. Starting from a snapshot of the old database one could catch the new database up to a live state of the old database and then swap over all connections to the new one.

      Does such a proxy already exist? I'd love to know as I could use it. If not it might be fun to build and a good side-project.

      4 votes
    6. 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?

      5 votes
    7. 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?

      10 votes
    8. Trying to become a junior developer in Brazil is an uphill battle

      They ask for years of experience, skills that no Jr would know since, well, it is a Jr and the process to apply for jobs are surreal. Thousands of tests, interviews that goes nowhere and lots of...

      They ask for years of experience, skills that no Jr would know since, well, it is a Jr and the process to apply for jobs are surreal. Thousands of tests, interviews that goes nowhere and lots of ghosting. And the pay is not that good. No wonder after 2 or 3 years of experience a lot of develpers starts working for companies outside of Brazil.

      Last one to contact me sent me a test to do it in 1 week. I went above and beyond and learned a lot of things. Before this, i had some small projects in Go and Python. Now i needed to learn Docker, tests, github actions, Postgresql and other things. Not everything was mandatory, but i did my best and did it all. I finished in 5 days since i have a day job.

      Here is the result: https://github.com/crdpa/conservice

      Showing the data in the browser was not necessary, but i think it was a nice touch and well made. If this does not land me a job as a junior developer i don't know what else could.

      I'm glad i already have a job in another area, but me and my SO are separated by a 4 hour drive and i'm tired. I want to work from home to be near her and our dog. Paying rent in two places is becoming a burden.

      I would be happy if you guys could test the application i made. It only needs docker.

      And do you guys have any tips from now on?

      7 votes
    9. The SerenityOS browser now passes the Acid3 test

      @Andreas Kling: The SerenityOS Browser now passes the Acid3 test! 🥳🐞🌍AFAIK we're the first new open source browser to reach this milestone since the test originally came out.This has been a team effort over the last couple of weeks, and I'm so proud of everyone who contributed! 🤓❤️ pic.twitter.com/Vw8GkHWSaj

      8 votes
    10. 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?

      6 votes
    11. When should you really use a NoSQL database?

      I've always used Postgres. For a medium-sized app that I work on right now it's running great. Were I to seriously need more throughput I'd either shard (no small task I know) or use CockroachDB...

      I've always used Postgres. For a medium-sized app that I work on right now it's running great. Were I to seriously need more throughput I'd either shard (no small task I know) or use CockroachDB (which to my understanding is basically Postgres with built-in sharding and no extension support). Throwing away relationships, constraints, unique compound indices and all of the tools I love that Postgres provides just to get schemaless JSON with high write throughput out of the box doesn't sound like a good deal. But so many people have made the decision to go NoSQL so there must be something I'm missing.

      8 votes
    12. 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?

      6 votes
    13. Do data storage providers 'share' identical data among clients?

      What I mean is, if two clients of a provider upload the same data, do the hosts identify the match and create only references to the identical data for the multiple clients, or do they simply have...

      What I mean is, if two clients of a provider upload the same data, do the hosts identify the match and create only references to the identical data for the multiple clients, or do they simply have two copies of the same data on their server?

      Caveat: I am merely geeky.

      What prompted the thought was an article maybe on /. that Russia might run out of data storage, and this would impact entertainment providers. Seems a good way to save space if that's an issue.

      I would guess not, as storage is pretty cheap these days (or was at least in the before times), and it would raise privacy and possibly copyright issues. But a semi-scrupulous and miserly provider might consider it I suppose. Anyone here have any insights or knowledges?

      9 votes
    14. 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?
      
      2 votes
    15. Why store code as text files?

      Code is usually version controlled nowadays in git or some other VCS. These typically operate on text files and record the changes applied to the files over their history. One drawback from this...

      Code is usually version controlled nowadays in git or some other VCS. These typically operate on text files and record the changes applied to the files over their history. One drawback from this is that formatting of the code can introduce changesbto the files that make no semantic difference, e.g. newlines are added/removed, indentation is altered etc.

      Consistent formatting makes the code easier to read, but the style used is an aesthetic preference. There might be objective reasons for readability in at least the extreme cases, but in many cases the formatting is purely a preferred style.

      If we instead version controlled code in the form of an abstract syntax tree (AST) (possibly even as just a series of transformations on that tree), we could have any formatting we'd like! When editing the code we would just be changing a projection of the AST and when we've made our changes the transformations could be made to the stored AST. If two languages shared the same AST the choice of language even becomes a choice for the programmer. Sadly this has some limitations since ASTs are usually language specific... But we could possibly take this a step further.

      Could we take a compiled binary and use that as the basis for generating an AST? This is essentially what decompilers do. For heavily optimized code this is severely limited, but for debug builds a lot of extra information is retained in the binary that can be utilized to construct a sensible representation. This way of storing code the language used becomes a style preference! Code compiled from one language might become alien when viewed in another language (thinking of lazy Haskell code viewed in C), but maybe that is a corner case?

      There are issues when considering binaries for different platforms. A binary for the JVM isn't the same as one for ARM64 or one compiled to run on an x86. So there are some limitations there...

      One (very) good thing about storing code as text files is the ubiquity of software capable of viewing and editing text. It would however be cool if we could make programming language a stylistic preference that is compatible with other languages! At least the AST part should be perfectly achievable.

      16 votes
    16. 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?

      7 votes
    17. Quick question after a kernel update, mostly fear-based

      As some are aware, my NAS hates me. Anyway, I ran an update just now and it spat out the following: Setting up linux-firmware (1.187.27) ... update-initramfs: Generating...

      As some are aware, my NAS hates me. Anyway, I ran an update just now and it spat out the following:

      Setting up linux-firmware (1.187.27) ...
      update-initramfs: Generating /boot/initrd.img-5.13.0-30-generic
      I: The initramfs will attempt to resume from /dev/sdb2
      I: (UUID=e6480da4-95f0-4cf3-a047-a43ef09f978f)
      I: Set the RESUME variable to override this.
      update-initramfs: Generating /boot/initrd.img-5.11.0-27-generic
      I: The initramfs will attempt to resume from /dev/sdb2
      I: (UUID=e6480da4-95f0-4cf3-a047-a43ef09f978f)
      

      UUID=e6480da4-95f0-4cf3-a047-a43ef09f978f is /swap.

      /dev/sdb2: UUID="e6480da4-95f0-4cf3-a047-a43ef09f978f" TYPE="swap" PARTUUID="329487d0-88c7-4d47-ab82-dc4b80bd3bfe"
      

      The full log is below. If I reboot this thing, will it tell me that it cannot find GRUB like the previous installation that shit the bed?

      My assumption is that its simply telling me that it's enabled some sort of hibernation and will use the /swap for that.. but I'm totally on edge with this thing. I don't have a lot to set up with the system-side of things, so I put off trying to fix the old installation from the previous post until later.

      Anyway, does anything here seem fishy?

      Full output The following packages will be upgraded: linux-firmware 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Need to get 115 MB of archives. After this operation, 2,980 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://ca.archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-firmware all 1.187.27 [115 MB] Fetched 115 MB in 5s (24.0 MB/s) (Reading database ... 201924 files and directories currently installed.) Preparing to unpack .../linux-firmware_1.187.27_all.deb ... Unpacking linux-firmware (1.187.27) over (1.187.26) ... Setting up linux-firmware (1.187.27) ... update-initramfs: Generating /boot/initrd.img-5.13.0-30-generic I: The initramfs will attempt to resume from /dev/sdb2 I: (UUID=e6480da4-95f0-4cf3-a047-a43ef09f978f) I: Set the RESUME variable to override this. update-initramfs: Generating /boot/initrd.img-5.11.0-27-generic I: The initramfs will attempt to resume from /dev/sdb2 I: (UUID=e6480da4-95f0-4cf3-a047-a43ef09f978f) I: Set the RESUME variable to override this.

      ➜ ~ sudo blkid
      /dev/sdb2: UUID="e6480da4-95f0-4cf3-a047-a43ef09f978f" TYPE="swap" PARTUUID="329487d0-88c7-4d47-ab82-dc4b80bd3bfe"
      /dev/sdb5: UUID="842ddd01-963f-4cea-b04f-a52b6b719a16" TYPE="ext4" PARTUUID="21a6f4e9-9893-423a-a30d-5981ac30b02b"
      /dev/loop0: TYPE="squashfs"
      /dev/loop1: TYPE="squashfs"
      /dev/loop2: TYPE="squashfs"
      /dev/loop3: TYPE="squashfs"
      /dev/loop4: TYPE="squashfs"
      /dev/loop5: TYPE="squashfs"
      /dev/loop6: TYPE="squashfs"
      /dev/loop7: TYPE="squashfs"
      /dev/sda1: LABEL="Ext-4tb" UUID="6024-5AA9" TYPE="exfat" PARTLABEL="My Passport" PARTUUID="0b02c637-1696-4e38-85a1-9bb43103e675"
      /dev/sdb1: UUID="5cfbef39-3eb7-41e6-8223-e6881b4f3286" TYPE="ext4" PARTUUID="7df42fb5-0531-457c-92b5-fbf1878b043f"
      /dev/sdb3: UUID="4f30a4a2-9f28-4831-a22c-dc5b969c4f17" TYPE="ext4" PARTUUID="77f89dbc-f0d7-40d5-9174-ac03a786502e"
      /dev/sdb4: PARTUUID="93457ed0-e4ee-439f-9f41-5c106fb531e6"
      /dev/sdc1: PARTUUID="59c46c38-983b-41a1-9b01-17932ce1408c"
      /dev/sdc2: UUID="5A80-D8B1" TYPE="vfat" PARTUUID="dc39bca7-9d28-45df-9474-ae879b51304e"
      /dev/sdc3: UUID="5c159f93-0d79-46ca-81bc-862f9703c439" TYPE="ext4" PARTUUID="db95b761-edd1-423e-8f23-748bc3e24fbc"
      /dev/loop8: TYPE="squashfs"
      /dev/loop9: TYPE="squashfs"
      /dev/loop10: TYPE="squashfs"
      /dev/loop11: TYPE="squashfs"

      ➜ ~ du -h /boot
      2.5M /boot/grub/i386-pc
      2.3M /boot/grub/fonts
      7.1M /boot/grub
      du: cannot read directory '/boot/lost+found': Permission denied
      16K /boot/lost+found
      147M /boot

      edit:

      here's my fstab
      UUID=842ddd01-963f-4cea-b04f-a52b6b719a16 /          ext4  errors=remount-ro 0   1
      # /boot was on /dev/sdb1 during installation
      UUID=5cfbef39-3eb7-41e6-8223-e6881b4f3286 /boot      ext4  defaults          0   2
      # /home was on /dev/sdb3 during installation
      UUID=4f30a4a2-9f28-4831-a22c-dc5b969c4f17 /home      ext4  defaults          0   2
      # swap was on /dev/sdb2 during installation
      UUID=e6480da4-95f0-4cf3-a047-a43ef09f978f none       swap  tf                0   0
      
      3 votes
    18. 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?
      
      6 votes
    19. Looking for a good map of the internet

      I did some cursory Googling but found stuff that I'm not looking for (maps of the web and traceroutes hooked up to GeoIP lookups). Is there a resource that will show me the internet as a series of...

      I did some cursory Googling but found stuff that I'm not looking for (maps of the web and traceroutes hooked up to GeoIP lookups). Is there a resource that will show me the internet as a series of interconnected hops? Preferably with information on the connections between nodes that indicates the amount of traffic. I'm interested in the topography of the internet itself - not physically where hops are located.

      7 votes
    20. Fixing GRUB / Bad Kernels

      A few months ago I got a new to me HP Proliant ML310e Gen8. For the most part it works well, but I went to add some drives to it yesterday and grub / whateverthefuck doesn't like the one and only...

      A few months ago I got a new to me HP Proliant ML310e Gen8. For the most part it works well, but I went to add some drives to it yesterday and grub / whateverthefuck doesn't like the one and only kernel that is installed.

      I'm running Ubuntu 20.04. I looked around saw guides like this. this, and this -- but I'm not sure if this will fix the issue.

      After grub I get the ol'

      ---[end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
      

      I think I need to run something with initramfs or something, but I just want to be sure before I go messing around.

      The bad kernel listed is 5.11.0-27-generic. I'm a little out of my element with this part of things.

      2 votes
    21. Experience with Crystal programming language?

      I have heard just a little bit about the language Crystal every so often, probably since it was first mentioned on /r/programming. From what I know, it's Ruby-like syntax but with a static type...

      I have heard just a little bit about the language Crystal every so often, probably since it was first mentioned on /r/programming. From what I know, it's Ruby-like syntax but with a static type system, which seems like a big benefit to me.

      I written just a little bit of Ruby, so the syntax isn't very familiar to me, and I haven't bothered trying Crystal out, but I'm curious to know what kinds of things people do with it.

      So, my questions are: Do you have any experience with Crystal? If so, what have you used it for? Was it a professional or recreational project? How did you like it? What about it stood out to you compared to your experiences with other languages?

      Thanks!

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

      8 votes
    23. If I wanted to make a game like Wordle, where would I start?

      A lot of game engines are geared towards making full-fat games with 3D graphics and animations and sound effects and all that jazz. What if, instead, I want to make something dead simple,...

      A lot of game engines are geared towards making full-fat games with 3D graphics and animations and sound effects and all that jazz. What if, instead, I want to make something dead simple, graphics-less, and minimalistic -- like Wordle? What's the best way to get to something like that (almost more of a digital toy than a full-fledged game)?

      It doesn't have to be web-based at all (though it can be if that's easier? I'm genuinely not sure). My preference would be for open-source engines/tools, but that's not a necessity.

      12 votes
    24. Looking for recommendations for self-hostable static blog software

      I used to use a random FOSS Python program to manage my blog. The software honestly wasn't the best (partially my own fault for not setting it up super well) and I stopped using it, lost my blog's...

      I used to use a random FOSS Python program to manage my blog. The software honestly wasn't the best (partially my own fault for not setting it up super well) and I stopped using it, lost my blog's source code, and haven't updated the blog in a long time because of that. So I'm looking for a static site generator that is simple, well maintained, and no-frills.

      14 votes
    25. 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?

      5 votes
    26. 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?
      
      3 votes