Write a polite but firm email to a landlord who has not fixed the heating for three weeks. I want the repair, not a fight.
Claude Sonnet 5.5
Subject: Heating repair needed at [Address/Unit #]: follow-up and request for a date
Dear [Landlord's name],
I hope you're well. I'm writing about the heating in my unit at [address], which has not been working since [date]. I first reported it on [date of first report, and how: call, text, email], and it has now been about three weeks without a repair.
With temperatures [currently around X° / dropping], this has become a real problem. The apartment is consistently cold, and I'd like to get it resolved quickly for both comfort and safety.
I'd appreciate it if you could:
Confirm by [date, ideally 2 business days out] when a technician will visit.
Have the repair completed by [date, ideally within 5-7 days], or let me know if parts or other issues are causing a delay.
I'm happy to be flexible about access. I can be home [days/times], or I can arrange for entry if that's easier. Please let me know what works best.
I value being a tenant here and would like to sort this out cooperatively. If I don't hear back by [date], I may need to look into my options under [state/local] tenant rules, but I'd much prefer to avoid that and simply get the heat working.
Thank you for your attention to this. I look forward to hearing from you soon.
Best regards, [Your name] [Unit/address] [Phone number]
Tips for making it more effective:
Send it in writing, even if you've already called or texted. Email creates a record.
Fill in the dates. Specific deadlines are harder to ignore than "soon."
Keep copies of earlier messages, photos of a thermostat reading, and notes on any temperature readings.
Check local rules. Many places treat heat as an "essential service" with legal repair timelines, and some allow rent withholding or repair-and-deduct. Look up your area's rules before mentioning specific remedies. A local tenant union or housing agency can help.
If you don't get a response, send a short follow-up and consider certified mail or a call to your local housing or code enforcement office.
If you tell me your location and what you've done so far, I can tailor the wording and point out relevant tenant protections.
Asked Nov 1, 2026. Unedited.
Write a React hook that debounces a value and cancels on unmount. Include the TypeScript types.
Claude Sonnet 5.5
useDebounce hook
// useDebounce.ts
import { useEffect, useState } from "react";
/**
* Returns a debounced copy of `value` that only updates after `delay` ms
* have passed without `value` changing.
*
* The pending timer is cleared when `value` or `delay` changes,
* and when the component unmounts.
*/
export function useDebounce<T>(value: T, delay: number = 300): T {
const [debouncedValue, setDebouncedValue] = useState<T>(value);
useEffect(() => {
const timeoutId: ReturnType<typeof setTimeout> = setTimeout(() => {
setDebouncedValue(value);
}, delay);
// Runs before the next effect and on unmount
return () => clearTimeout(timeoutId);
}, [value, delay]);
return debouncedValue;
}Usage
import { useEffect, useState } from "react";
import { useDebounce } from "./useDebounce";
export function Search() {
const [query, setQuery] = useState("");
const debouncedQuery = useDebounce(query, 500);
useEffect(() => {
if (!debouncedQuery) return;
const controller = new AbortController();
fetch(`/api/search?q=${encodeURIComponent(debouncedQuery)}`, {
signal: controller.signal,
}).catch(() => {});
return () => controller.abort();
}, [debouncedQuery]);
return (
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Search…"
/>
);
}Why this cancels correctly
The effect's cleanup function calls
clearTimeout. React runs it before re-running the effect (so each new value restarts the timer) and on unmount (sosetDebouncedValuenever fires on an unmounted component).ReturnType<typeof setTimeout>keeps the timer type correct in both browser (number) and Node (NodeJS.Timeout) typings.
Optional: version with cancel and flush
If you need manual control (e.g. flush on Enter, cancel on Escape):
// useDebouncedValue.ts
import { useCallback, useEffect, useRef, useState } from "react";
export interface DebounceControls {
/** Cancel the pending update, if any. */
cancel: () => void;
/** Apply the latest value immediately and cancel the pending timer. */
flush: () => void;
}
export function useDebouncedValue<T>(
value: T,
delay: number = 300
): [T, DebounceControls] {
const [debounced, setDebounced] = useState<T>(value);
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const latestValue = useRef<T>(value);
latestValue.current = value;
const cancel = useCallback(() => {
if (timerRef.current !== null) {
clearTimeout(timerRef.current);
timerRef.current = null;
}
}, []);
const flush = useCallback(() => {
cancel();
setDebounced(latestValue.current);
}, [cancel]);
useEffect(() => {
cancel();
timerRef.current = setTimeout(() => {
timerRef.current = null;
setDebounced(latestValue.current);
}, delay);
return cancel; // cancels on change and on unmount
}, [value, delay, cancel]);
return [debounced, { cancel, flush }];
}const [debounced, { flush, cancel }] = useDebouncedValue(query, 500);
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter") flush();
if (e.key === "Escape") cancel();
}}
/>Asked Nov 1, 2026. Unedited.
A drug test is 99% accurate, and 0.5% of people use the drug. Someone tests positive. What is the probability they use it, and why does the answer surprise people?
Claude Sonnet 5.5
Answer: about 33%, not 99%.
Assumptions
"99% accurate" is interpreted as both:
Sensitivity of 99%: 99% of users test positive
Specificity of 99%: 99% of non-users test negative (a 1% false-positive rate)
Calculation (Bayes' theorem)
Imagine 100,000 people:
| Group | Count | Test positive |
|---|---|---|
| Users (0.5%) | 500 | 99% × 500 = 495 (true positives) |
| Non-users (99.5%) | 99,500 | 1% × 99,500 = 995 (false positives) |
Total positives = 495 + 995 = 1,490
$$P(\text{user} \mid +) = \frac{495}{1{,}490} \approx 0.332$$
Or in formula form:
$$P(U|+) = \frac{0.99 \times 0.005}{0.99 \times 0.005 + 0.01 \times 0.995} \approx 33.2\%$$
Why it surprises people
1. Base rate neglect. People focus on the test's accuracy and ignore how rare the drug use is. Because users are so scarce (0.5%), even a small false-positive rate applied to the huge non-user population produces more false positives than the true positives from the small user group.
2. Confusing two different conditional probabilities.
P(positive | user) = 99%, which is what the test's accuracy tells you
P(user | positive) ≈ 33%, which is what you actually want to know
These are not the same, and intuition tends to treat them as if they were.
3. Percentages hide the counts. A 1% error rate sounds tiny, but 1% of 99,500 people is 995, which is about double the 495 true users who test positive.
Key takeaways
The meaning of a positive result depends heavily on who is being tested. If the test were given to a group where 50% use the drug, a positive would be right about 99% of the time.
This is why screening for rare conditions (diseases, drugs, terrorism, etc.) typically requires confirmatory testing.
A helpful mental trick is to use natural frequencies ("495 out of 1,490") instead of probabilities. People reason about these far more accurately.
Asked Nov 1, 2026. Unedited.
What it’s good at
Ranked against 42 models, from public leaderboards and our own blind tests where we have them. How we rank
- #4of 42 for coding
- #4of 42 for writing
- #4of 42 for math
The facts
Claude Sonnet 5.5 is Anthropic’s mid-sized model, built to balance quality, speed and price. It reads images and PDFs as well as text.
Scores from artificialanalysis.ai and lmarena.ai (its “xhigh” setting).
- Made by
- Anthropic
- API price, per 1M tokens
- $2 in, $10 out
- Speed
- 138 tokens a second
- Artificial Analysis Index
- 56.0
- LMArena text
- 1,473
- LMArena coding
- 1,510
- Updated
- Oct 26, 2026