• Activity
  • Votes
  • Comments
  • New
  • All activity
    1. Programming Challenge: Given a triangle of numbers, find the path from the top to the bottom of the triangle with the largest sum.

      This problem is based on the Project Euler problem here. Goal: Given some input describing a triangle of numbers, find the path starting from the top-most row of the triangle and ending at the...

      This problem is based on the Project Euler problem here.

      Goal: Given some input describing a triangle of numbers, find the path starting from the top-most row of the triangle and ending at the bottom-most row of the triangle that contains the largest sum of all of the numbers along the path. You may only move downward and you must select an adjacent position to move to. Efficiency is not a requirement for completion.

      Constraints:

      • The first line of input for a triangle will be a single integer telling you how many rows the triangle will have.
      • Each following line of input will be the next row of the number triangle, starting at the first row.
      • For each line describing the number triangle, the individual numbers will be separated by a single space.

      Note: The constraints above are to keep hard-coded triangles out of submitted solutions while also ensuring that all languages can equally handle this problem without annoying workarounds for lower-level languages. The consistency also makes it easier for beginners to review and understand someone else's code, and makes it easier to receive help if you get stuck. They're not necessarily required, but are highly encouraged.

      Example input:

      4
      1
      3 2
      4 5 6
      7 8 9 10
      

      Corresponding triangle:

         1
        3 2
       4 5 6
      7 8 9 10
      

      Expected result: 19 (1 + 2 + 6 + 10)

      Extra Credit: As noted on the Project Euler page, you can solve this using a brute force method, but it's incredibly inefficient. Specifically, a brute force solution would be O(2n) time (exponential). There exists a solution that can be solved in O(n2) time (quadratic). Find this solution.

      13 votes
    2. Angular with PureScript

      I have to do an assignment for university soon-ish, and it requires Angular. I'm not very fond of that framework specifically, but I would be interested in making it more interesting as a learning...

      I have to do an assignment for university soon-ish, and it requires Angular. I'm not very fond of that framework specifically, but I would be interested in making it more interesting as a learning project. I've also recently discovered PureScript, which I have no experience with right now.

      Searching online, I've purescript-angular, which hasn't been updated in years. I also couldn't find much else. Of course, I may be missing something simple (for instance, it's actually supported by default in Angular these days), so I wanted to ask if any of you know if this is possible, and if so, how?

      6 votes
    3. Searching entry-level linux laptop recommendation

      Hey there! I'm planning on going full linux again (last time was 5-6 years ago). The only problem is: i've lost track of the community and especially what hardware is currently best to run,...

      Hey there!

      I'm planning on going full linux again (last time was 5-6 years ago). The only problem is: i've lost track of the community and especially what hardware is currently best to run, especially tech that was really giving me headaches back then (GPU - remember the omega drivers?).

      But searching for linux compatible laptops without purchasing a machine from some dedicated vendor is quite hard.

      Any recommendations?

      17 votes
    4. Components involved for flashing a custom Android ROM. Am I understanding things correctly?

      I'm going to be flashing a custom ROM on my Nexus 5X device, and I was just curious if I'm understanding all the components involved. I currently have CopperheadOS on my device, but that ROM may...

      I'm going to be flashing a custom ROM on my Nexus 5X device, and I was just curious if I'm understanding all the components involved. I currently have CopperheadOS on my device, but that ROM may be dead based on current events. I'm not switching because of this news, but mainly because I just want to try something else for the hell of it. I think I'm going to make the switch to Lineage, but there are way more options involved versus flashing CopperheadOS.

      It seems the main components to consider when flashing are the following:

      • The ROM itself (CopperheadOS, Lineage, PureNexus, etc.)
      • The custom recovery (TWRP, etc.)
      • The kernel (ElementalX, Franco, etc.)
      • root (magisk, etc.)
      • Play Services (OpenGApps, etc.)

      CopperheadOS was kind of it's own package, so I didn't have to consider all of these other options.

      My understanding is the minimum decisions I need to make if I want a custom ROM, is picking the ROM itself, and a custom recovery. In my case I'm going for LineageOS and TWRP.

      Choosing a custom kernel seems to be optional. I think I might go with Franco on this one based on the little research I've done. But to flash a custom kernel, I think I need root, right? So now I'll need to get root access which requires another tool. I was going to go with Magisk based on not much. Just seems to be common. So that's 4 main things there. The ROM (LineageOS), the recovery (TWRP), the kernel (Franco), and root (Magisk). I personally don't want any Google services on my device, so I'm fine with skipping that part. I currently don't have any installed, and I'm doing fine without them.

      So does my view on this seem correct? Are all the things I mentioned necessary for what I want to do? If I want LineageOS then I need a custom recovery right? If I want a custom kernel, then I need root which requires a separate tool, right? Just making sure I'm not doing more than I need to if I decided to go through with this. As a side convo, please recommend whatever ROMs, kernels, or root tools that you want. I have a Nexus 5X, and I'm hoping it doesn't bootloop after I'm done doing all this flashing =)

      9 votes
    5. Bitcoin Phishing Attack

      Got this phishing SMSmessage today. I spun up a VM and investigated the domain provided in the message. Found the provider and reported it to them. The phishing page is a replica Coinbase login...

      Got this phishing SMSmessage today. I spun up a VM and investigated the domain provided in the message. Found the provider and reported it to them.

      The phishing page is a replica Coinbase login page.

      https://imgur.com/a/ZSzNKO7

      10 votes
    6. Why doesn't Common Lisp see more usage?

      Hey all, I've been studying Common Lisp recently, and as far as I can see, this is a pretty capable, mature language. Moreover, Lisp has been around since the 60s and it doesn't see much usage (as...

      Hey all,
      I've been studying Common Lisp recently, and as far as I can see, this is a pretty capable, mature language. Moreover, Lisp has been around since the 60s and it doesn't see much usage (as far as I'm aware) outside of Emacs Lisp and AutoLISP. What gives?

      17 votes
    7. Feedback wanted on website/dev project

      Hello ~comp, I've been learning web development in my spare time with the hopes of one day becoming a professional web developer. This is my latest project:...

      Hello ~comp,

      I've been learning web development in my spare time with the hopes of one day becoming a professional web developer.

      This is my latest project: https://github.com/farleykreynolds/toptenify. It's a small static site that pulls your listening data from the Spotify API.

      I welcome any feedback on the design, code, or any other aspect of the project. Thank you!

      6 votes
    8. Are Python virtual environments comparable to Docker containers?

      I've been trying to understand Docker and while also learning Python it occurred to me that virtual environments seem to be the same thing. They're probably not, but can anyone shed some light on...

      I've been trying to understand Docker and while also learning Python it occurred to me that virtual environments seem to be the same thing. They're probably not, but can anyone shed some light on this?

      6 votes
    9. Best for Privacy: Local Recursive DNS vs Cloudflare's DNS over HTTPS

      I'm trying to decide what option I prefer here in terms of privacy. I'm curious of other's opinions on the issue, and if anyone has a better solution to offer more privacy. Option 1: Hosting a...

      I'm trying to decide what option I prefer here in terms of privacy. I'm curious of other's opinions on the issue, and if anyone has a better solution to offer more privacy.


      Option 1: Hosting a local recursive DNS


      I currently have a device running Pi-hole on my local network. I recently set it up as a recursive DNS server using unbound. This allows me to no longer rely on a public DNS such as GoogleDNS, OpenDNS, Cloudflare, etc. for my queries, and just point straight to the root servers.

      Pro: I removed a "pair of eyes" (Public DNS) out of the equation

      Con: All my queries are not encrypted so my ISP (and potentially others) can still see my DNS queries


      Option 2: Using DNS over HTTPS (DoH) using Cloudflare's client


      With this option I would use Cloudflare's cloudflared daemon they provide on their website. This would allow all my queries to be encrypted when sending them to Cloudflare.

      Pro: Encrypted DNS queries from my local network -> Cloudflare's servers. My ISP can no longer see my DNS queries

      Security Pro: Helps prevent MitM attacks

      Con: I now have a Public DNS back in the equation, which I have to put some trust into. Also, my queries are most likely only encrypted from my local network -> Cloudflare's network. When Cloudflare has to do the recursion, those queries may be not encrypted (my assumption is they will most likely be not encrypted)

      Possible Con: Does Server Name Indication (SNI) "leaking" apply to DNS queries at all? If so, then my query is revealed anyways right?

      As a note, I am nowhere near an expert on the specifics of DNS, so some of my assumptions on how things work may be super wrong!

      6 votes
    10. On the topic of technological tribalism

      One of the things I absolutely loved about Hacker News was the technical, and generally high quality discussions about technology. That is something I also really appreciate about Tildes right...

      One of the things I absolutely loved about Hacker News was the technical, and generally high quality discussions about technology. That is something I also really appreciate about Tildes right now. But as the years progressed I went to HN less and less because I found just about any topic related to PHP, JS and Node were filled with toxic low effort comment/jokes about the language.

      I don't feel it is constructive to replay the exact same tired jokes about the exact same warts everyone has known to exist and avoided/worked around for years now. It's okay to not like these languages or technologies, but can we try to be better and a little more inclusive and constructive in our community? I feel like it's going to be a losing battle as the site grows if we're already stooping to these levels.

      7 votes
    11. Quickest way to learn C# before placement begins

      I am a university student who has just finished (survived is probably a more accurate word) third year and am going to begin a placement year at a programming company at the very start of July. I...

      I am a university student who has just finished (survived is probably a more accurate word) third year and am going to begin a placement year at a programming company at the very start of July. I have been told that I will primarily be coding in C#, and that they will also teach me coding on the job, however I would like to get some form of a head start prior. I've already done some basic C++ beforehand, but I know that C# is slightly different and was wondering if anyone could suggest some resources that would not only teach me C# properly but also quickly. Like I mentioned previously, the place I am working at does not require me to know how to code properly, but it would be nice to have some footing before the placement starts. Additionally, I am also hoping that it will impress them so that my chances of landing a graduate job with them after my fourth year are increased!

      5 votes
    12. News Desk Updated!

      A few weeks ago I posted a project I was working on to read news from the command line. I incorporated the suggestions given in that thread (license, requirements.txt, etc), incorporated...

      A few weeks ago I posted a project I was working on to read news from the command line. I incorporated the suggestions given in that thread (license, requirements.txt, etc), incorporated suggestions I've received elsewhere, and added a few features.

      Here's the updated link: News Desk

      Any feedback would be much appreciated!

      Edit: And a specific point for feedback. I store the user's API key in ~/.nd_config/key which I think is a step up from requiring the user to set their key as an environment variable (which is how I had it originally). Still though, is there some way I can not store the key in plaintext and still have it in a format that is readable by the computer and can be used to verify API access?

      7 votes