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 Haiku 4.5
Email to Landlord About Heating Repair
Subject: Urgent: Heating System Repair Needed – [Your Address]
Dear [Landlord's Name],
I am writing to request immediate repair of the heating system at [your address]. The heating has been non-functional for three weeks, as of [date], making the unit uninhabitable during winter conditions.
As you know, landlords are required by law to maintain heating systems in habitable condition. I would appreciate your prompt attention to this matter.
Could you please confirm:
What date the repair will be completed?
Which contractor will be handling the work?
What times work best for access to the unit?
I am flexible with my schedule and happy to accommodate the repair at your earliest convenience. Please let me know the details within 48 hours so we can move forward quickly.
I value our landlord-tenant relationship and am confident we can resolve this promptly. If I don't hear from you by [specific date], I will need to explore additional remedies available under local tenant laws.
Thank you for your immediate attention to this essential repair.
Best regards, [Your Name] [Phone Number] [Email Address]
Tip: Keep a copy of this email and document the heating failure with photos or temperature readings if possible. This creates a clear record if you need it later.
Asked Nov 1, 2026. Unedited.
Write a React hook that debounces a value and cancels on unmount. Include the TypeScript types.
Claude Haiku 4.5
React Debounce Hook with Unmount Cleanup
import { useState, useEffect, useRef } from 'react';
/**
* Hook that debounces a value and cancels the debounce timer on unmount
* @param value - The value to debounce
* @param delay - Delay in milliseconds (default: 500ms)
* @returns The debounced value
*/
function useDebounce<T>(value: T, delay: number = 500): T {
const [debouncedValue, setDebouncedValue] = useState<T>(value);
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
useEffect(() => {
// Clear any existing timeout
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
// Set a new timeout
timeoutRef.current = setTimeout(() => {
setDebouncedValue(value);
}, delay);
// Cleanup function: cancel the timeout on unmount or when dependencies change
return () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
};
}, [value, delay]);
return debouncedValue;
}
export default useDebounce;Usage Example
import { useState } from 'react';
import useDebounce from './useDebounce';
function SearchComponent() {
const [searchTerm, setSearchTerm] = useState<string>('');
const debouncedSearchTerm = useDebounce<string>(searchTerm, 300);
const handleSearch = async () => {
if (debouncedSearchTerm) {
const results = await fetch(
`/api/search?q=${debouncedSearchTerm}`
).then(res => res.json());
console.log('Search results:', results);
}
};
// Use effect to trigger search when debounced value changes
useEffect(() => {
handleSearch();
}, [debouncedSearchTerm]);
return (
<input
type="text"
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
placeholder="Search..."
/>
);
}Key Features
Generic Type Support: Works with any value type via
<T>Cleanup on Unmount: Automatically cancels pending debounce timers when the component unmounts
Automatic Re-debounce: Cancels previous timeouts when the value or delay changes
TypeScript Typed: Full type safety with proper generics
Simple API: Just pass a value and optional delay
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 Haiku 4.5
Bayes' Theorem in Action
The Answer
Using Bayes' theorem, the probability is about 33% (or roughly 1 in 3), not 99%.
Why This Surprises People
The intuition fails because people focus on the test's accuracy while ignoring the base rate (0.5% prevalence). Here's what happens:
The Math
Imagine 100,000 people:
500 actually use the drug
495 test positive (99% accuracy)
5 test negative (1% miss rate)
99,500 don't use the drug
~1,000 test positive (1% false positive rate)
98,500 test negative (99% accuracy)
Total positive tests: ~1,495
Of these, only 495 actually use the drug.
$$P(\text{user | positive}) = \frac{495}{1,495} \approx 33\%$$
Why Intuition Fails
People think: "The test is 99% accurate, so a positive result means 99% chance I'm a user"
But they're missing:
False positives are common when the condition is rare
Base rate neglect — we ignore that 99.5% of people don't use
The 1% false positive rate hits a much larger group (99,500 non-users) than the 1% miss rate hits a small group (500 users)
This is why medical screening seems paradoxical: even accurate tests can produce mostly false positives for rare conditions.
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
- #41of 42 for coding
- #41of 42 for writing
- #41of 42 for math
The facts
Claude Haiku 4.5 is the small model of Anthropic’s Claude 4.5 generation. It reads images and PDFs as well as text.
Scores from artificialanalysis.ai and lmarena.ai.
- Made by
- Anthropic
- API price, per 1M tokens
- $1 in, $5 out
- Speed
- No public score
- Artificial Analysis Index
- No public score
- LMArena text
- No public score
- LMArena coding
- No public score
- Updated
- Oct 26, 2026