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.
MiniMax M3
Here's a polished email you can adapt:
Subject: Request for Heating Repair — [Your Address, Unit #]
Dear [Landlord's Name],
I'm writing to request immediate attention to the heating issue in my unit at [address]. Despite [number] previous notifications on [dates of prior contact, if any], the heating system has not been functioning properly since [date it stopped working] — now three weeks without adequate heat.
I understand repairs can take time, but at this point the delay is causing real hardship. The temperature in the unit has been [describe conditions — e.g., "dropping below 60°F during the day," "unsafe for [child/elderly family member/pet]" as relevant]. As you know, providing heat is part of your obligation to keep the unit habitable, and I'm sure you want to resolve this promptly as well.
Could you please confirm by [specific date, give 3–5 business days] the following:
The date a qualified technician will assess and repair the heating system.
The expected timeline for completion.
Whether any alternative heating will be provided in the interim if my unit remains unrepaired.
I'm happy to coordinate access to the unit at your convenience. Please reply in writing so we both have a clear record.
If the repair isn't completed within a reasonable timeframe, I may need to explore further options, including contacting the local housing authority or arranging repairs myself and deducting the cost from rent, in accordance with [your state/region's] landlord-tenant law. I would much prefer to resolve this directly with you.
Thank you for your prompt attention to this matter.
Best regards, [Your Name] [Phone number] [Email]
A few tips:
Send it in writing (email is fine, but keep a copy) so you have a paper trail.
Note every prior contact — dates of calls, texts, or earlier emails strengthen your position.
Check your local rules. Many jurisdictions set specific temperature standards (often 65–68°F minimum) and define repair timelines. Citing your local ordinance adds weight.
Don't pay for repairs yourself without proper legal notice unless your area's "repair-and-deduct" rules clearly allow it — talk to a tenant rights group first.
If there's no response to the email, follow up with a certified letter and consider contacting your local housing code enforcement office.
Would you like me to adjust the tone, shorten it, or tailor it to a specific state or situation (e.g., with young children, an elderly relative, or a roommate)?
Asked Nov 1, 2026. Unedited.
Write a React hook that debounces a value and cancels on unmount. Include the TypeScript types.
MiniMax M3
useDebouncedValue Hook
This hook returns a value that only updates after the specified delay has elapsed without the input changing. It also cancels any pending update when the component unmounts.
import { useState, useEffect, useRef } from 'react';
/**
* Returns a debounced version of `value` that only updates after `delay` ms
* of inactivity. Cancels any pending update when the component unmounts or
* when `value`/`delay` change before the timeout fires.
*/
export function useDebouncedValue<T>(value: T, delay: number): T {
const [debouncedValue, setDebouncedValue] = useState<T>(value);
// Holds the active timer so we can cancel it on unmount or re-run.
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
useEffect(() => {
// Cancel any in-flight timer from a previous render.
if (timerRef.current !== null) {
clearTimeout(timerRef.current);
}
timerRef.current = setTimeout(() => {
setDebouncedValue(value);
timerRef.current = null;
}, delay);
// Cleanup runs on unmount AND before each subsequent effect.
return () => {
if (timerRef.current !== null) {
clearTimeout(timerRef.current);
timerRef.current = null;
}
};
}, [value, delay]);
return debouncedValue;
}How the cancellation works
The cleanup function returned from
useEffectruns on unmount, clearing any pending timeout. This is the "cancels on unmount" behavior.It also runs before the next effect re-runs, so rapid changes to
valuecancel the previous timer instead of stacking.timerRefoutlives each render, so the cleanup function always sees the most recent timer ID.
Usage
function SearchInput() {
const [query, setQuery] = useState('');
const debouncedQuery = useDebouncedValue(query, 300);
useEffect(() => {
if (debouncedQuery) {
// Only fires 300ms after the user stops typing.
fetchResults(debouncedQuery);
}
}, [debouncedQuery]);
return <input value={query} onChange={(e) => setQuery(e.target.value)} />;
}Bonus: callback variant
If you need to debounce a function (e.g. an API call) instead of a value, here's the companion:
import { useCallback, useEffect, useRef } from 'react';
/**
* Returns a debounced version of `callback` that delays invocation by `delay` ms.
* Cancels pending invocations on unmount.
*/
export function useDebouncedCallback<TArgs extends unknown[]>(
callback: (...args: TArgs) => void,
delay: number,
): (...args: TArgs) => void {
const callbackRef = useRef(callback);
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
// Keep the latest callback without re-creating the debounced function.
useEffect(() => {
callbackRef.current = callback;
}, [callback]);
useEffect(() => {
return () => {
if (timerRef.current !== null) {
clearTimeout(timerRef.current);
}
};
}, []);
return useCallback((...args: TArgs) => {
if (timerRef.current !== null) {
clearTimeout(timerRef.current);
}
timerRef.current = setTimeout(() => {
callbackRef.current(...args);
timerRef.current = null;
}, delay);
}, [delay]);
}Usage:
const debouncedSave = useDebouncedCallback((draft: string) => {
api.save(draft);
}, 500);
<input onChange={(e) => debouncedSave(e.target.value)} />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?
MiniMax M3
The Classic Bayes' Theorem Puzzle
Answer: about 33% (roughly 1 in 3).
The calculation
Let D = "uses the drug" and + = "tests positive."
P(D) = 0.005 (base rate)
P(+ | D) = 0.99 (true positive rate)
P(+ | ¬D) = 0.01 (false positive rate)
By Bayes' theorem:
$$P(D \mid +) = \frac{P(+ \mid D)\,P(D)}{P(+ \mid D)\,P(D) + P(+ \mid \neg D)\,P(\neg D)}$$
$$= \frac{0.99 \times 0.005}{0.99 \times 0.005 + 0.01 \times 0.995} = \frac{0.00495}{0.0149} \approx 0.332$$
Why this surprises people
Most people's gut reaction is "the test is 99% accurate, so a positive result means I'm 99% likely to be a user." That intuition ignores the base rate.
The intuition-pump: think in whole numbers
Imagine 10,000 people:
| Group | Count | Test positive |
|---|---|---|
| Users (0.5%) | 50 | ~49.5 true positives |
| Non-users (99.5%) | 9,950 | ~99.5 false positives |
| Total positives | ~149 |
So out of everyone who tests positive, only ~49.5 are real users → 33%, not 99%.
What's actually going on
Because users are so rare, the pool of non-users is huge (9,950 vs. 50). Even with a tiny 1% false-positive rate, that enormous pool produces twice as many false positives as the small user pool produces true positives:
True positives: 0.005 × 0.99 ≈ 0.495%
False positives: 0.995 × 0.01 ≈ 0.995%
The takeaway
This is the base rate fallacy (or base rate neglect). A test's raw accuracy tells you how well it discriminates in isolation, but the meaning of a positive result depends critically on how common the condition is. The rarer the condition, the more a positive result will be a false alarm — no matter how good the test is, unless it's extremely close to 100%.
This same shape of reasoning explains why a positive result on a screening test for a rare disease still usually needs a confirming, more specific test.
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
- #29of 42 for coding
- #31of 42 for research
- #33of 42 for everyday chat
The facts
MiniMax M3 is MiniMax’s main model, with open weights. It reads images and PDFs as well as text.
Scores from artificialanalysis.ai and lmarena.ai.
- Made by
- MiniMax
- API price, per 1M tokens
- $0.30 in, $1.20 out
- Speed
- 105 tokens a second
- Artificial Analysis Index
- 29.2
- LMArena text
- 1,432
- LMArena coding
- 1,470
- Updated
- Oct 26, 2026