• Activity
  • Votes
  • Comments
  • New
  • All activity
    1. Programming Challenge: Implementing bitwise operators.

      Background: Bitwise operators are operators that perform conditional operations at the binary level. These operators are bitwise AND &, bitwise OR |, bitwise XOR ^, and bitwise NOT ~, not to be...

      Background: Bitwise operators are operators that perform conditional operations at the binary level. These operators are bitwise AND &, bitwise OR |, bitwise XOR ^, and bitwise NOT ~, not to be confused with their logical operator counterparts, i.e. &&, ||, !=, and ! respectively.

      Specifically, these operations take the binary values of the left- and right-hand terms and perform the conditional operation on each matching bit position between both values.

      For instance, 3 | 4 takes the binary value 010 from 2 and 100 from 4. From left to right, we compare 0 || 1, 1 || 0, and 0 || 0 to get 110 as the resulting binary. This produces the integer value 6.

      Goal: Your challenge is to implement one or more of these bitwise operators without using the native operators provided to you by your language of choice. Logical operators are allowed, however. These operators should work on integer values. These operators will likely take on the form of a function or method that accepts two arguments.

      Bonus challenges:

      • Implement all of the operators.
      • Don't use any native binary conversion utilities.
      • Whether or not you implement all operators, write your code in such a way that allows for good code reusability.
      • For statically typed languages, handle integers of different types (e.g. int vs. uint).

      Edit: Minor correction for the sake of accuracy, courtesy of @teaearlgraycold.

      12 votes
    2. Is OpenBSD worth investing in?

      From what I can tell, this is a pretty hot debate in the open-source world. I've spent the last ~5 years or so investing into learning UNIX systems, particularly Linux. I just came across an...

      From what I can tell, this is a pretty hot debate in the open-source world. I've spent the last ~5 years or so investing into learning UNIX systems, particularly Linux. I just came across an article expounding the glories of OpenBSD as a system, and it made some valid points. Generally though, I don't want to dive deeper than I have to into learning new platforms for the sake of it. I do want to arrive at the simplest possible configuration for a digital system, and that involves choosing the best possible foundation. It should be noted that I am looking for a system that is effective as a personal computer / internet browser as well as a general purpose server.


      For users of OpenBSD - What's your usecase? why did you switch? What did you miss? What did you appreciate?

      For users of Linux who have tried other kernels - what was your experience? Was it worth trying? Why did you switch back?

      28 votes
    3. What is Usenet?

      I tried to use Gnus to set up some rss feeds about a year ago, and I became more than frustrated: I was actually confused. So here are a couple questions I don't even understand where to ask or...

      I tried to use Gnus to set up some rss feeds about a year ago, and I became more than frustrated: I was actually confused.

      So here are a couple questions I don't even understand where to ask or whether they're relevant or being asked in the right way:

      Are most newsgroups mirrored? And along those lines, is there one particular newsgroup server that would be sufficient for most users?

      Can I post to a newsgroup in the same way I would post to a mailing list: send an email somewhere? Where do I send that?

      What even is NNTP? Someone literally sent me the spec for the protocol, but I don't think they actually wanted to be helpful: I felt like they were putting me down and intentionally not answering while giving the appearance of being helpful. Is it actually something I need to understand to use Gnus effectively?

      If you're familiar with newsgroups, I would surely appreciate your knowledge.

      14 votes
    4. AI, Stable Diffusion, Models and Prompts

      Howdy Tildes wizards. I decided to have a looksy at Stable Diffusion on my local computer (Manjaro, AMD 7500x CPU, 32GB) using Easy Diffusion. I've gotten my head around the basics and grabbed...

      Howdy Tildes wizards.

      I decided to have a looksy at Stable Diffusion on my local computer (Manjaro, AMD 7500x CPU, 32GB) using Easy Diffusion. I've gotten my head around the basics and grabbed MidJourney V4 LLM, and now I'm learning how to prompt.

      So far I've generated some cool cyberpunk cyborg things, landscapes, etc. One of the things I wanted to use Stable Diffusion for is generating silhouettes. Sounds weird, I know, but they're great to use with decal and vinyl printing for my wife's business.

      Any ideas on ways to do silhouette generation?

      Next is, what's good to read to learn about model types and what all of the settings really do?

      I'm ordering a GPU (3060) to improve the horrendous render times, so don't worry about the under powered rig, I'm still in toy mode.

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

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

      12 votes
    7. How do I get started in self hosting?

      I'm curious on how to get started in self hosting. I have computer experience, being an Android Developer, but I hardly have experience in Linux and backend/networking work. I've been wanting to...

      I'm curious on how to get started in self hosting. I have computer experience, being an Android Developer, but I hardly have experience in Linux and backend/networking work.

      I've been wanting to start up a Plex/Jellyfin server for a while, and I have an old system sitting around with a Ryzen 1700 with a graphics card in there as well that's been begging for attention, and maybe I can throw on a Minecraft server in there as well. Since I travel a bunch, it would be nice too to be able to access my media for when I'm traveling, or to let my parents or friends access some shows if they so desire!

      What I'm worried about is exposing my network to the internet basically. I used to run a Minecraft server with port forwarding and such on a personal computer but now I'm realizing that that's probably a bit unsafe lol.

      Basically, are there any guides that I can look at, or any of your own experiences that could potentially help me or anyone who's interested?

      28 votes
    8. First time building a PC, need some advice

      I'm looking at starting to do a PC build and I'm a bit lost on which way to go CPU wise. Proposed use case: linux, some gaming (usually older games), possibly trying to learn home lab/self hosting...

      I'm looking at starting to do a PC build and I'm a bit lost on which way to go CPU wise.

      Proposed use case: linux, some gaming (usually older games), possibly trying to learn home lab/self hosting types of things probably in a VM but nothing really heavy. I do want to run Starfield when it comes out and maybe be able to try VR some time in the future.

      I'd like to have a bit of a future proof system while getting value for my money, as in I'd like to spend less but I will spend more if it matters. This is where I'm sort of getting lost.

      I tend to lean towards Intel because VM's and multitasking should work better (I think) but people seem to believe that AMD is better bang for the buck?

      I feel like I'm likely not going to swap CPU's, but RAM, GPU, and storage are easy to swap so I'm not to worried.

      25 votes
    9. How to get full-text RSS feed from medium.com ?

      I know medium has an RSS feed that can be accessed by adding /feed/ before the username/publication name but it's truncated if the publication has a paywall. I've been looking for a way to get the...

      I know medium has an RSS feed that can be accessed by adding /feed/ before the username/publication name but it's truncated if the publication has a paywall. I've been looking for a way to get the full-text feed but could not find a solution, it looks like it adds a parameter to the link in the rss feed, similar to ?source=rss-d00bc5bb7954------2 but I can't figure out how to remove it. any ideas ?

      7 votes
    10. How safe am I? (self hosting)

      I have a server running Unraid at home. I have ~20 docker containers running at the moment with almost all of them only available within my local network. I just stood up an instance of Seafile on...

      I have a server running Unraid at home. I have ~20 docker containers running at the moment with almost all of them only available within my local network. I just stood up an instance of Seafile on the server to act as a google drive replacement. Still in the early test phase before I commit to throwing important stuff on there. I have my domain proxied through Cloudflare so none of my local ports are exposed to the internet. Seafille has complicated passwords set for admin and user accounts (generated with Bitwarden, hot damn I love that app). I also enabled 2FA on each account. I know that I can further clamp it down using some of Cloudflare's extra access controls but in my admittedly limited experience, those all cause issues getting an app to authenticate with the service. Web apps don't have this issue of course.

      So am I ok with this setup? I can encrypt the data before uploading easily as it's a built in feature of Seafile. Or would it be better to just run with local only and run a VPN to access when I'm outside?

      I figure just about any effort along these lines I trust more than Google with my data. But I may be overconfident in that perhaps. I'm still learning the ropes with Linux and self-hosting in general.

      17 votes
    11. What's the easiest way to queue downloads to my PC?

      I mean this in the sense of "I find a file on a website that I want to have download directly to my laptop without having to download to my phone and then transfer from my phone to my laptop?"...

      I mean this in the sense of "I find a file on a website that I want to have download directly to my laptop without having to download to my phone and then transfer from my phone to my laptop?"

      Something I can use in the case "ope that's an interesting file that I'll forget about before I'm at my laptop"

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

      12 votes
    14. I want to learn more about linux

      I know the basics commands, command substitution, redirection, pipelines, and I know about .bashrc, .vimrc etc. but I feel like I still don't know a lot and I feel a bit lost as to where to learn...

      I know the basics commands, command substitution, redirection, pipelines, and I know about .bashrc, .vimrc etc. but I feel like I still don't know a lot and I feel a bit lost as to where to learn more. I know I'm being a bit vague, but that's on purpose, I don't really know what's possible. feel free to suggest any book or resource that you think would help me learn more about linux (I also haven't been keeping up with it lately, so any new stuff like what's NixOS would help)

      41 votes
    15. Show ~/project: A thread to share your finished projects

      Many of you are probably familiar with Show HNs from HackerNews. Perhaps we are not yet big enough to share those as regular top-level posts, and it is also hard to distinguish between plain...

      Many of you are probably familiar with Show HNs from HackerNews. Perhaps we are not yet big enough to share those as regular top-level posts, and it is also hard to distinguish between plain self-promotions — it might thus suit us better to have these in a more controlled way.

      If you are interested in sharing your project, please send a top-level comment as a reply. Probably sticking to HN’s relevant ruling will be a good starting point, paraphrasing the especially important parts:

      [Show ~] is for something you've made that other people can play with. [Tildes] users can try it out, give you feedback, and ask questions in the thread. The project must be something you've worked on personally and which you're around to discuss.

      A [Show ~] needn't be complicated or look slick. The community is comfortable with work that's at an early stage.

      Please make it easy for users to try your thing out, ideally without barriers such as signups or emails. You'll get more feedback that way.

      If your work isn't ready for users to try out, please don't do a [Show ~]

      38 votes
    16. Thoughts on Notes/Blog/Personal Website Directory Structure

      :wave: everyone, I've been thinking about where to put non-technical blog posts and what to call them since, so far, I have bookmark/, cheatsheet/, howto/, note/, snippet/ and tutorial/ folders...

      :wave: everyone, I've been thinking about where to put non-technical blog posts and what to call them since, so far, I have bookmark/, cheatsheet/, howto/, note/, snippet/ and tutorial/ folders already[1].

      I think those cover most of the things I like writing about and I intend to share, but I also enjoy poetry, analyzing movies, political commentary and writing an essay here and there.

      Following from that, I kept essay/, poem/ and commentary/ around for whenever I felt like sharing some of my non-technical writings, but I don't like those folders :smile:. They seem way too granular, more akin to tags than categories, both of which are contained in each file's metadata.

      Tags, however, don't feel like a "pillar"/category of a Zettelkasten/ramblings/thoughts crate. They're empty at the moment and in draft/, so it's the perfect chance to do some re-structuring and avoid the issues I faced when I ditched blog/category and chose the current structure.

      In case you're asking yourself why I didn't put everything in the same folder, as they reflect categories and each .md file has category metadata already, it's because the drafts in draft/ became unmanageable (+120). So, in an effort to give myself an easier way to navigate and edit, I decided /folders were going to reflect the categories that existed. I'm aware it can be that after note #50 or something I have the same problem, and thus it wouldn't have made a difference whether notes were together with tutorials or not. I've decided to deal with that problem when it arises :)

      I'd be very interested in hearing your thoughts! Would you keep essay/, poem/ and commentary/ or merge them into something else? note/ are short and wouldn't feel right for longer ramblings. I am not a big fan of writings/ as everything is a "writing", prose/ also doesn't quite fit and so far the only one I've sort of liked is reflection/ since essays, poems, and comments on happenings are the result of reflecting.

      /rant over, I know, I'm overthinking it. Let those not guilty throw the first stone :)

      [1] I've removed quite a bit of the irrelevant stuff but kept what I believe is relevant, but feel free to ask away in case something necessary is missing.

      .
      ├── bookmark/
      │   └── sample.md
      ├── cheatsheet/
      │   ├── sample.md
      │   └── sample.md-data
      ├── commentary/
      ├── draft/
      │   ├── bookmark/
      │   │   └── sample.md
      │   ├── cheatsheet/
      │   │   └── sample.md
      │   └── ...
      ├── essay/
      ├── extra/
      │   ├── archive/
      │   ├── blob/
      │   └── robots.txt
      ├── howto/
      │   └── sample.md
      ├── note/
      │   └── sample.md
      ├── poem
      ├── private/
      │   └── sample.md
      ├── snippet/
      │   └── sample.md
      └── tutorial/
          ├── sample.md
          └── sample.md-data/
              ├── sample.png
              └── ...
      
      10 votes
    17. Graphics glitch on new install of Ubuntu

      So I have an old MacBook Pro (mid-2014) Core i5 which I've just installed Ubuntu 22.04.2 on. Most things are working fine but the screen randomly flickers and then goes black and then after...

      So I have an old MacBook Pro (mid-2014) Core i5 which I've just installed Ubuntu 22.04.2 on. Most things are working fine but the screen randomly flickers and then goes black and then after varying lengths of time will pop back on again. I've been googling around and found lots of instances of similar graphics glitches but can't quite find a solution.

      Any suggestions?

      7 votes
    18. Any BBS sysops here from back in the day?

      As a not quite "old man" I was wondering how many former BBS sysops are here? In the early-mid 90s, I used to run a single line PCBoard powered hobby BBS and dabble in making PPEs (PCBoards...

      As a not quite "old man" I was wondering how many former BBS sysops are here?

      In the early-mid 90s, I used to run a single line PCBoard powered hobby BBS and dabble in making PPEs (PCBoards programming language for plug ins/mods). I also help friends set up SpitFire, Searchlight, Synchronet, WWIV and Aftershock (total PITAs from what I remember)--basically anything free, crackable or unlimited trial.

      Since I was the only sysop that ran PCBoard I was invited to become an officer in our local User Group to run their whopping 3 line BBS and give classes (that was quite the technological achievement back then). That is something I truly do miss. I was, by far, the youngest member of the User Group (your average member probably had grandkids my age) but it was a meritocracy.

      People seemed eager to learn and share information as they found it. Before computers, 3d cards and the internet was ubiquitous, you were automatically accepted into a knowing crowd if you put in the effort/time to join a BBS, forum or (early) MMO. Exclusion brought inclusion, if that makes sense. If you torched your reputation by acting like a jackass it was difficult to move on like a locust to another area.

      So many stories. So many high jinks that would be deemed illegal today, lol.

      Everything that is old, is new again.

      I'm getting a lot of BBS vibes in the aftermath of Rexxit. The slower pace of Tildes reminds me so much of the BBS forums (while I know Tildes isn't new, it is growing in popularity in the aftermath.) Even the Fediverse harkens back to the days of early BBS synch nets.

      Now if only I could find a modern remake of Tradwars 2002.

      51 votes
    19. 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?
      
      15 votes
    20. 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?

      20 votes