{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\n```\n\n\nI have also taken two screen shots, one of IE 7 and one of IE 8, IE 7 and IE 6 agree on this styling so I have not bothered to take a screen shot of IE 6.\n\nIE [6|7]: \n![enter image description here](https://i.stack.imgur.com/5Zkud.png)\n\nIE 8: \n\n![enter image description here](https://i.stack.imgur.com/0FHSK.png)\n\nHas anyone seen this bug before? Where did I go wrong? What do I have to remove to make it work in IE 6/7 without having extra lines going through my input boxes. The extra lines are removed when the border-top is gone on the fieldset, but that is not a solution since doing so removes the whole visual separation.\n\n\n---\n\n\n\nIt is fixed. the margin-bottom on the textarea and input[type=\"text\"] was causing IE 6/7 to have a rendering bug. Removed those and all is well. I guess I can deal with the extra space between the elements on the page!\n"},"Title":{"kind":"string","value":"CSS Styling Forms -- IE 6/7 bug"},"ContentLicense":{"kind":"string","value":"CC BY-SA 3.0"},"FavoriteCount":{"kind":"null"},"CreationDate":{"kind":"string","value":"2009-05-06T18:10:31.277"},"LastActivityDate":{"kind":"string","value":"2013-04-18T08:21:53.593"},"LastEditDate":{"kind":"string","value":"2013-04-18T08:21:53.593"},"LastEditorUserId":{"kind":"number","value":664177,"string":"664,177"},"OwnerUserId":{"kind":"number","value":13986,"string":"13,986"},"Tags":{"kind":"list like","value":["css","xhtml","internet-explorer-7","rendering","internet-explorer-6"],"string":"[\n \"css\",\n \"xhtml\",\n \"internet-explorer-7\",\n \"rendering\",\n \"internet-explorer-6\"\n]"}}},{"rowIdx":430,"cells":{"Id":{"kind":"number","value":837351,"string":"837,351"},"PostTypeId":{"kind":"number","value":1,"string":"1"},"AcceptedAnswerId":{"kind":"number","value":838298,"string":"838,298"},"ParentId":{"kind":"null"},"Score":{"kind":"number","value":5,"string":"5"},"ViewCount":{"kind":"number","value":15664,"string":"15,664"},"Body":{"kind":"string","value":"I'm getting this error when I run or debug my GA/AI from MyEclipse:\n\nException in thread \"main\" java.lang.OutOfMemoryError: Java heap space\n\neclipse.ini looks like this:\n\n```\n-showsplash com.genuitec.myeclipse.product\n--launcher.XXMaxPermSize 256m\n-vmargs\n-Xms128m\n-Xmx512m\n-Duser.language=en \n-XX:PermSize=128M \n-XX:MaxPermSize=256M\n```\n\n\nMyEclipse is called like this:\n\n```\n\"C:\\Program Files\\MyEclipse 6.0\\eclipse\\eclipse.exe\" -vm \"C:\\Program Files\\MyEclipse 6.0\\jre\\bin\\javaw.exe\" -vmargs -Xms1448M -Xmx1448M\n```\n\n\nbumping the vm settings up from this:\n\n```\n\"C:\\Program Files\\MyEclipse 6.0\\eclipse\\eclipse.exe\" -vm \"C:\\Program Files\\MyEclipse 6.0\\jre\\bin\\javaw.exe\" -vmargs -Xms80M -Xmx1024M\n```\n\n\nhas had no effect. So I'm trying to get it to dump the heap to a file, but placing these:\n\n```\n-XX:+HeapDumpOnCtrlBreak\n-XX:+HeapDumpOnOutOfMemoryError\n```\n\n\nin the Program arguments has had no effect. How do I get something to work with more memory usage analysis? jstack, for instance, is not currently available on Windows platforms. And using SendSignal has no effect that I can see.\n\n![a screen shot](https://imgur.com/KV4d.jpg)\n"},"Title":{"kind":"string","value":"How do I Save the Heap (Dump to a File) in Eclipse?"},"ContentLicense":{"kind":"string","value":"CC BY-SA 2.5"},"FavoriteCount":{"kind":"number","value":0,"string":"0"},"CreationDate":{"kind":"string","value":"2009-05-07T22:17:19.550"},"LastActivityDate":{"kind":"string","value":"2021-09-26T18:25:05.210"},"LastEditDate":{"kind":"string","value":"2021-09-26T18:25:05.210"},"LastEditorUserId":{"kind":"number","value":5459839,"string":"5,459,839"},"OwnerUserId":{"kind":"number","value":43199,"string":"43,199"},"Tags":{"kind":"list like","value":["java","memory-leaks","heap-memory"],"string":"[\n \"java\",\n \"memory-leaks\",\n \"heap-memory\"\n]"}}},{"rowIdx":431,"cells":{"Id":{"kind":"number","value":837454,"string":"837,454"},"PostTypeId":{"kind":"number","value":1,"string":"1"},"AcceptedAnswerId":{"kind":"null"},"ParentId":{"kind":"null"},"Score":{"kind":"number","value":0,"string":"0"},"ViewCount":{"kind":"number","value":2489,"string":"2,489"},"Body":{"kind":"string","value":"I'm writing a console program that can accept 1 to 3 files. I'm using `OpenFileDialog` three times to accept the files, but the second and third time the file dialog is behind the console window, making it hard to notice. Any way to get it to appear above?\n\nAn image of the problem:\n\n![enter image description here](https://i.stack.imgur.com/PiqmW.png)\n\nThe relevant code is:\n\n```\nstatic bool loadFile(ref List ls)\n{\n OpenFileDialog f = new OpenFileDialog();\n if (f.ShowDialog() == DialogResult.OK)\n {\n Console.WriteLine(\"Loaded file {0}\", f.FileName);\n ls.Add(f.FileName);\n return true;\n }\n else\n {\n return false;\n }\n}\n\n[STAThread]\nstatic void Main(string[] args)\n{\n // sanity check\n if (args.Length > 3)\n {\n Console.WriteLine(\"Sorry, this program currently supports a maximum of three different reports to analyze at a time.\");\n return;\n }\n else if (args.Length == 0) \n {\n List fL = new List();\n\n for (int k = 0; k < 3; k++)\n {\n if (!loadFile(ref fL)) break;\n }\n\n if (fL.Count == 0)\n {\n InfoDisplay.HelpMessage();\n return;\n }\n else\n {\n args = fL.ToArray();\n }\n }\n\n // main program\n ...\n}\n```\n\n"},"Title":{"kind":"string","value":"Making the second and third OpenFileDialog appear above the console in .NET/C#?"},"ContentLicense":{"kind":"string","value":"CC BY-SA 3.0"},"FavoriteCount":{"kind":"null"},"CreationDate":{"kind":"string","value":"2009-05-07T22:46:31.057"},"LastActivityDate":{"kind":"string","value":"2012-01-09T10:12:02.793"},"LastEditDate":{"kind":"string","value":"2011-12-18T19:44:35.717"},"LastEditorUserId":{"kind":"number","value":214668,"string":"214,668"},"OwnerUserId":{"kind":"number","value":103168,"string":"103,168"},"Tags":{"kind":"list like","value":["c#",".net","winforms","console","openfiledialog"],"string":"[\n \"c#\",\n \".net\",\n \"winforms\",\n \"console\",\n \"openfiledialog\"\n]"}}},{"rowIdx":432,"cells":{"Id":{"kind":"number","value":838265,"string":"838,265"},"PostTypeId":{"kind":"number","value":1,"string":"1"},"AcceptedAnswerId":{"kind":"number","value":839906,"string":"839,906"},"ParentId":{"kind":"null"},"Score":{"kind":"number","value":2,"string":"2"},"ViewCount":{"kind":"number","value":5417,"string":"5,417"},"Body":{"kind":"string","value":"I want to make voronoi treemaps for statistics data, like\n![alt text](https://codezine.jp/static/images/article/3516/09.png)\n[newsgraphy](http://newsgraphy.com/)\n\nDo you know how I can do that in Perl, PHP, Ruby, or Python?\n"},"Title":{"kind":"string","value":"How can I make voronoi treemaps?"},"ContentLicense":{"kind":"string","value":"CC BY-SA 2.5"},"FavoriteCount":{"kind":"number","value":0,"string":"0"},"CreationDate":{"kind":"string","value":"2009-05-08T04:38:48.963"},"LastActivityDate":{"kind":"string","value":"2014-08-16T13:07:13.537"},"LastEditDate":{"kind":"string","value":"2017-02-08T14:11:55.177"},"LastEditorUserId":{"kind":"number","value":-1,"string":"-1"},"OwnerUserId":{"kind":"number","value":76509,"string":"76,509"},"Tags":{"kind":"list like","value":["statistics","voronoi","treemaps"],"string":"[\n \"statistics\",\n \"voronoi\",\n \"treemaps\"\n]"}}},{"rowIdx":433,"cells":{"Id":{"kind":"number","value":839085,"string":"839,085"},"PostTypeId":{"kind":"number","value":1,"string":"1"},"AcceptedAnswerId":{"kind":"number","value":839187,"string":"839,187"},"ParentId":{"kind":"null"},"Score":{"kind":"number","value":4,"string":"4"},"ViewCount":{"kind":"number","value":17316,"string":"17,316"},"Body":{"kind":"string","value":"I have a problem about div position relative alignment.\n\nI want the second div to be fixed in position even if I remove the first div.\nThe problem is that the second div adjusts its position when the first div is removed.\n\nMy question is how can I retain the position of the second div even if I remove the first div? Thanks :)\n\nThis code:\n\n```\n
\n\n
div-1
\n\n
div-2
\n
\n```\n\n\nWill output:\n\n![alt text](https://farm4.static.flickr.com/3660/3512692766_539e6b4f8d_o.jpg)\n\nThen if the first div is removed, the second div adjusts its position.\nThis code:\n\n```\n
\n\n
div-2
\n
\n```\n\n\nWill output:\n![alt text](https://farm4.static.flickr.com/3645/3512692796_2e0a7afb1d_o.jpg)\n"},"Title":{"kind":"string","value":"CSS: Div position:relative alignment problem"},"ContentLicense":{"kind":"string","value":"CC BY-SA 2.5"},"FavoriteCount":{"kind":"number","value":0,"string":"0"},"CreationDate":{"kind":"string","value":"2009-05-08T09:53:41.170"},"LastActivityDate":{"kind":"string","value":"2014-06-26T21:09:37.763"},"LastEditDate":{"kind":"string","value":"2017-02-08T14:11:55.850"},"LastEditorUserId":{"kind":"number","value":-1,"string":"-1"},"OwnerUserId":{"kind":"number","value":95322,"string":"95,322"},"Tags":{"kind":"list like","value":["html","css"],"string":"[\n \"html\",\n \"css\"\n]"}}},{"rowIdx":434,"cells":{"Id":{"kind":"number","value":841206,"string":"841,206"},"PostTypeId":{"kind":"number","value":1,"string":"1"},"AcceptedAnswerId":{"kind":"number","value":1719307,"string":"1,719,307"},"ParentId":{"kind":"null"},"Score":{"kind":"number","value":2,"string":"2"},"ViewCount":{"kind":"number","value":14479,"string":"14,479"},"Body":{"kind":"string","value":"I'm want to create a CRM app for me just for fun and to learn more about Cocoa, because CRM application evolve based on a Calendar, I wonder where can I get that cool Calendar control that iCal has in the iPhone.\n\nI can't see it in my Library and I'm using SDK 3.0 beta 5.\n\nAnd by the way, where can I get a free/paid controls collection like there are so many for the .NET world?\n\n![alt text](https://i.stack.imgur.com/pINrH.png)\n"},"Title":{"kind":"string","value":"Calendar control for cocoa touch"},"ContentLicense":{"kind":"string","value":"CC BY-SA 3.0"},"FavoriteCount":{"kind":"null"},"CreationDate":{"kind":"string","value":"2009-05-08T18:36:05.493"},"LastActivityDate":{"kind":"string","value":"2015-06-19T21:50:42.020"},"LastEditDate":{"kind":"string","value":"2015-06-19T21:50:42.020"},"LastEditorUserId":{"kind":"number","value":1159643,"string":"1,159,643"},"OwnerUserId":{"kind":"number","value":28004,"string":"28,004"},"Tags":{"kind":"list like","value":["iphone","cocoa-touch","controls","calendar"],"string":"[\n \"iphone\",\n \"cocoa-touch\",\n \"controls\",\n \"calendar\"\n]"}}},{"rowIdx":435,"cells":{"Id":{"kind":"number","value":843016,"string":"843,016"},"PostTypeId":{"kind":"number","value":1,"string":"1"},"AcceptedAnswerId":{"kind":"number","value":843027,"string":"843,027"},"ParentId":{"kind":"null"},"Score":{"kind":"number","value":2,"string":"2"},"ViewCount":{"kind":"number","value":2526,"string":"2,526"},"Body":{"kind":"string","value":"I have a site that lists several upcoming events, and each event has a comment button to leave comments. It looks like this (it's in swedish, but I think you can figure out the structure):\n\n![](https://i.stack.imgur.com/trals.png)[shipit.se](http://www.shipit.se/dump/event.png)\n\nThe div containing the textarea for writing the comment is initially hidden, and when clicking the 'comment'-icon it is displayed using the following javascript:\n\n```\n