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.
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.
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.
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?
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.
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.
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.
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.
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.
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.
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.
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
Harder is not always better.