
Ephemeral Testing
Daniel Lemire, "Ephemeral testing," in Daniel Lemire's blog, October 5, 2026, https://lemire.me/blog/2026/10/05/ephemeral-testing/.
以下正文同步自 Hacker News,版权归原站所有,已转换为易读排版。
Daniel Lemire, "Ephemeral testing," in Daniel Lemire's blog, October 5, 2026, https://lemire.me/blog/2026/10/05/ephemeral-testing/.
https://lemire.me/blog/2026/10/05/ephemeral-testing/'> [BibTeX]
Copy
`;
modal.addEventListener('click', function(e) { if (e.target === modal) modal.close(); });
modal.querySelector('#bibtex-copy-btn').addEventListener('click', function() { const text = modal.querySelector('#bibtex-target').textContent; navigator.clipboard.writeText(text).then(() => { const origText = this.innerText; this.innerText = "Copied!"; setTimeout(() => this.innerText = origText, 1500); }); });
document.body.appendChild(modal);
const style = document.createElement('style');
style.innerHTML = dialog::backdrop { background: rgba(0, 0, 0, 0.5); };
document.head.appendChild(style);
}
// 1. Extract the URL
const fullLinkHtml = el.dataset.fullLink;
const tempDiv = document.createElement('div');
tempDiv.innerHTML = fullLinkHtml;
const linkElement = tempDiv.querySelector('a');
const rawUrl = linkElement ? linkElement.href : '';
// 2. Compute the current access date
const accessedDate = this.getCurrentAccessedDate();
// 3. --- NEW LOGIC: Extract ONLY the year (YYYY) --- // Gets the full date string, e.g., "November 23, 2025" const fullDateString = el.dataset.year; // Use regex to find the four-digit year at the end of the string const match = fullDateString.match(/(\d{4})$/); const publicationYear = match ? match[0] : '????'; // e.g., '2025' // 4. Generate BibTeX Data with the corrected year const safeTitle = el.dataset.title.replace(/[^a-zA-Z0-9]/g, '').substring(0, 15); // Use the clean year for the BibKey const bibKey = (publicationYear + safeTitle);
const content = @misc{${bibKey}, author = {${el.dataset.author}}, title = {{${el.dataset.title}}}, year = {${publicationYear}}, howpublished = {\\url{${rawUrl}}}, note = {Accessed: ${accessedDate}} };
// 5. Show Modal
document.getElementById('bibtex-target').textContent = content;
modal.showModal();
}
};
})();
Published by
Daniel Lemire
A computer science professor at the University of Quebec (TELUQ). View all posts by Daniel Lemire
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。