Hacker Newsnew | past | comments | ask | show | jobs | submit | joevandyk's commentslogin

I finally started getting stronger in the gym when I stopped going to failure on everything. I got in the best endurance shape by going on a steady comfortable pace for progressively longer periods of time.

Harder is not always better.


One of my favorite styles of weight training is volume based. The premise starts with something like I need 10 reps of a certain weight, but it doesn't matter how many sets it takes to get there. Each set ends if I cannot do another perfect rep. If I can't do a single perfect rep, then the exercise ends and I move on to the next thing. By requiring the rep to be perfect, it naturally keeps you from going to failure and lowers chance of injury.

There's more to it like how to pick the weight, etc... but the perfect rep piece I really enjoyed.


I noticed the same.

Also late to the party, but creatine is the body and more importantly the brains friend too.


it gets more complicated when you need to also display something like "last comment: <author> <3 days ago>" for each post, or if the comment counts need to be filtered by various flags/states/etc.

of course, it's all possible with custom SQL but it gets complicated quick.


That's like saying it gets more complicated when you have to use loops with break statements in programming. It's just what programming is.

The filtering you describe is trivial with COUNT(flag IN (...) AND state=...) etc.

If you want to retrieve data on the last comment, as opposed to an aggregate function of all comments, you can do that with window functions (or with JOIN LATERAL for something idiomatic specifically to Postgres).

Learning how to do JOIN's in SQL is like learning pointers in C -- in that it's a basic building block of the language. Learning window functions is like learning loops. These are just programming basics.


Yes, all that’s possible. But it’s not straightforward in the majority of ORMs.


Almost sounds like ORMs are a bad idea


Right, and ORMs are the main cause of the N+1 problem, and atrocious database performance in general.

For anything that isn't just a basic row lookup from a single table, you should really just be writing the SQL yourself.


I'm exactly the target market for this, I've been looking at using Frigate for the past month, and I've done a ton of research.

I did not know what "NVR" meant prior to reading the OP.


Same!

With the author's blessing, I took the doc's content and converted into into a more usable website: https://lastofus.posix.love

Would love to hear feedback if anyone has any!


The Phoenix.new environment includes a headless Chrome browser that our agent knows how to drive. Prompt it to add a front-end feature to your application, and it won’t just sketch the code out and make sure it compiles and lints. It’ll pull the app up itself and poke at the UI, simultaneously looking at the page content, JavaScript state, and server-side logs.

Is it possible to get that headless Chrome browser + agent working locally? With something like Cursor?


Playwright has an MCP server which I believe should be able to give you this.


When Roo Code uses Claude, it does this while developing. It renders in the sidebar and you can watch it navigate around. Incredibly slow, but that’s only a matter of time.


Does it work with VSCode GitHub Copilot LLM provider? They have Claude in there


From https://rubyllm.com/#have-great-conversations

    # Stream responses in real-time
    chat.ask "Tell me a story about a Ruby programmer" do |chunk|
      print chunk.content
    end


This will synchronously block until ‘chat.ask’ returns though. Be prepared to be paying for the memory of your whole app tens/low hundreds of MB of memory being held alive doing nothing (other than handling new chunks) until whatever streaming API this is using under the hood is finished streaming.


Threads?


Rails is a hot ball of global mutable state. Good luck with threads.


The default rails application server is puma and it uses threads


Yes, it does. Ruby has a global interpreter lock (GIL) that prevents multiple threads to be executed by the interpreter at the same time, so Puma does have threads, they just can’t run Ruby code at the same time. They can hide IO though.


The GIL is released during common IO operations like the HTTP requests that power LLM communication


The Rails documentation has lots of info about this: https://guides.rubyonrails.org/tuning_performance_for_deploy...

Concurrency support is missing from the language syntax and this particular library as a concept. This is by design, to not distract from beautiful code. Your request will make zero progress and take up memory while waiting for the LLM answer. Other threads might make progress on other requests, but in real world deployments this will be a handful (<10). This server will get 10s of requests per second when something written in JS or Go will get many 1000s.

It’s amazing how the Ruby community argues against their own docs and doesn’t acknowledge the design choices their language creators have made.


That looks good, I didn't see that earlier.


It would be amazing to be able to use an API key to submit prompts that use our Project Knowledge. That doesn't seem to be currently possible, right?


The blog post says they use plaintext (asciidoc)?


I hope this is an appropriate place to ask.

Say I am eating well, exercising consistently, getting enough sleep.

For a male in his 40s, what are the best bang-for-the-buck ways to detect cancer before it becomes life-threatening?


Whole body MRI is fairly available in major metro areas, though not cheap and not very sensitive or specific.

The Galleri blood test screens for a range of cancers (sensitivity varies by cancer) and is ~$900, although you need a doctor to order it. You also may not technically be within the intended use population unless you have some risk factors (e.g. you are older than 50, or have family history of cancer).

Colonoscopy is a good idea, given the rising rates of colon cancer among younger adults.


The actual stats on the efficacy of early detection are extremely surprising. This [1] is a random study, among many, about breast cancer screening. Breast cancer mortality rates have been trending downward sharply, and this correlated with a sharp rise in screening. People naturally assumed this was causal, but oddly enough the exact same reduction in mortality has also been observed in people who have not participated in early screening at all. So it seems that generally better treatments are the main reason.

The 'paradox' of genuinely higher survival rates with early detection is explained by the fact that the survival rates are measured from the time of diagnosis. If a person with undiagnosed cancer is diagnosed after 7 years with said cancer, and then dies the following year, then he is considered to have had 1 year of survival. By contrast if somebody is diagnosed at year 1 and then dies 7 years later from the cancer, then they are considered to have 7 years of survival. They lived exactly the same length with cancer, but the survival times after diagnoses are markedly different.

This applies for most cancers. In my prior readings on this topic, the one screening that had a statistically significant effect on life expectancy was a certain type of colonoscopy, but even in that case the effect was quite small, something like 3 months IIRC. I think the overall take away is that outside of healthy living, do what makes you feel most comfortable. Even if they may not be highly effective, screenings would provide some people significant mental comfort. If you're one of them, more power to you. If you're fine without, then that's also great.

[1] - https://www.sciencedaily.com/releases/2018/09/180912133536.h...


Don't ignore weird lumps and bumps, but the #1 bang for your buck is getting a colonoscopy


Find a primary doctor you like and stick with them. Do your check ups, talk with them, communicate anything odd.

Go to a dermatologist and get a mole map. Get your tests done on schedule when you should be.

Don’t smoke cigarettes, or work in a high risk job around carcinogens.


Talk to your doctor, and ask to be screened for all common cancers. A colonoscopy is in your future (I just had one). Also ask for a Prostate-Specific Antigen (PSA) Test. Also look into the HPV vaccine.


Don't do this. Nearly all cancer tests are overly sensitive, and not great at detecting the cancers you care about (the ones that will progress).

If you run out and get a bunch of random cancer tests, you are basically ensuring that you will get unnecessary and painful treatment for a finding that probably wouldn't have harmed you in the first place.

It's not a satisfying answer, but it's true. The reason most cancers are found late is because there's no effective alternative.


Yes. You are correct. Patent is providing bad advice about PSA

https://www.bmj.com/content/362/bmj.k3519

Colo , when appropriate , is good but not as a general interest test:

https://jamanetwork.com/journals/jama/fullarticle/2529486



HPV vaccine has to be the biggest bang for buck. To anyone reading this, you should get it at any age because you likely haven't been exposed to all the strains that e.g. Gardasil-9 protects you from. You should also get it if you're male despite it being initially known as the cervical cancer vaccine because HPV causes oral cancers and you also don't want to potentially be a carrier.


or pattern match it:

   defmodule Guess do
      def guess_message(candidate, _count=0) do
        "There are no #{candidate}s"
      end

      def guess_message(candidate, _count=1) do
        "There is 1 #{candidate}"
      end

      def guess_message(candidate, count) do
        "There are #{count} #{candidate}s"
      end
    end


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: