Derbyshire 288 (Madsen 70, Milnes 53) and 2 for 0 lead Glamorgan 237 (Selman 50, Palladino 4-36) by 53 runs
Hamidullah Qadri, Derbyshire's 16-year-old debutant, returned the superb figures of 15-8-16-1 in his maiden spell of County Championship offspin, to help his county enjoy the better of the second day against Glamorgan at Cardiff.
Qadri, who yesterday became the first county cricketer to have been born in the 21st Century, was economical from the outset, and did not concede a single boundary until his 12th over, two balls after he had claimed his maiden first-class wicket via an arm ball that had taken the edge of Andrew Salter's bat to be caught at slip for 9.
Bowling in tandem with Jeevan Mendis, the Sri Lanka legspinner, Qadri put the squeeze on Glamorgan's middle order, after Tony Palladino had made the initial breakthroughs by taking the first three wickets at a personal cost of three runs.
Mendis and Palladino shared seven wickets between them, but Qadri's performance vindicated Head Coach Kim Barnett's decision to include him in the first team at such an early age.
Earlier Jacques Rudolph and nightwatchman Timm Van Der Gugten had given Glamorgan a solid start, putting on 49 for the first wicket, before they were both out in successive overs.
When Owen Morgan departed without scoring and Colin Ingram was out in the final over before tea, the home team had slipped to 87 for 4. They recovered after Nick Selman and Aneurin Donald had put on 64 for the fifth wicket, with Donald scoring 38, before he was undone by Luis Reece's left-arm seamers.
Selman, who scored a century against Durham last week, went on to make 50 before he was leg before to Mendis, who took his third wicket when Chris Cooke was caught at backward point. At 198 for 8, Glamorgan were 90 runs adrift, but Graham Wagg and Marchant De Lange settled into a productive partnership for the ninth wicket that added 39, which enabled Glamorgan to gain a batting point.
After fielding with the pink ball on the first day, and then batting on the second, Glamorgan's Aneurin Donald said: "It was a little different, but not particularly difficult".