智能助手网
标签聚合 类似

/tag/类似

linux.do · 2026-04-18 13:52:29+08:00 · tech

虽然目前有一个 zenobi-us/pi-dcp ,但是已经两个月没更新了。 之前用opencode的时候感觉 Opencode-DCP/opencode-dynamic-context-pruning 很好用,可以不声不响地把context 保持在一个很低的水平。 换到pi-agent后,context动不动就飙升到40-50%。试了一下 mksglu/context-mode 和 MasuRii/pi-rtk-optimizer ,效果都不明显。用pi-agent的佬们,有没有什么好的管理办法? 1 个帖子 - 1 位参与者 阅读完整话题

linux.do · 2026-04-17 21:25:57+08:00 · tech

https://www.nature.com/articles/s41564-026-02316-4 [!abstract]+ 细菌利用免疫系统来检测和防御包括噬菌体在内的可移动遗传元件。基因转移因子(GTA)是驯化的原噬菌体,具有噬菌体样特性,包括诱导宿主细胞裂解以进行基因转移的能力。GTA 是否会诱导或逃避细菌免疫系统尚不清楚。本研究利用转座子诱变和深度测序筛选新月柄杆菌(Caulobacter crescentus),鉴定出一个三元系统 LypABC,该系统对于 GTA 介导的细胞裂解和基因转移至关重要。LypABC 类似于 caspase 募集结构域-核苷酸结合富亮氨酸重复序列(CARD-NLR)抗噬菌体防御系统。LypABC 对于 DNA 包装成 GTA 颗粒并非必需,但对于宿主细胞裂解是必需的,该过程涉及 LypA 和 LypC 的肽酶结构域以及 LypB 的 ATPase 结构域。由于 LypABC 过量表达具有毒性,因此需要通过转录抑制因子 CdxB 进行严格调控。 CdxB 与 lypABC 和必需的 GTA 激活基因的启动子结合,将 GTA 激活与宿主细胞裂解偶联起来。我们的研究结果表明,细菌免疫系统可以被 GTA 所利用,从而支持水平基因转移。 2 个帖子 - 2 位参与者 阅读完整话题

linux.do · 2026-04-17 11:31:58+08:00 · tech

从 有没有什么办法能让AI读本站文章 继续讨论: 最近在看一些帖子也有类似需求,方便跟AI 讨论,就顺手让Claude 撸了一个。用的是Discourse 自带的功能: 有没有什么办法能让AI读本站文章 开发调优 Discourse 的话,可以通过替换链接拿到markdown 格式的内容,直接复制给AI 会更好 比如这个帖子的链接是:https://linux.do/t/topic/1984943,把t/topic/替换成raw/ : https://linux.do/raw/1984943 需要分页加:?page=1 脚本会在主贴和最后的回复出新增一个 按钮,点击导出成markdown 格式的文件。 性能开销应该比较小,不会对网站造成什么负担 [1] ,当然你也可以用的时候再收到打开脚本。 篡改猴: // ==UserScript== // @name Linux.do 导出 Markdown // @namespace https://linux.do/ // @version 0.0.4 // @description 在 linux.do 帖子页面所有 topic-map 处新增「导出 MD」按钮,将帖子内容导出为 Markdown 文件 // @author hwang // @match https://linux.do/t/topic/* // @grant GM_xmlhttpRequest // @connect linux.do // @run-at document-idle // ==/UserScript== (function () { 'use strict'; // ── 工具函数 ────────────────────────────────────────────────── function getTopicId() { const m = location.pathname.match(/\/t\/[^/]+\/(\d+)/); return m ? m[1] : null; } function getCurrentPage() { const p = new URLSearchParams(location.search).get('page'); return p ? parseInt(p, 10) : 1; } function getTopicTitle() { const el = document.querySelector('h1.fancy-title, h1[data-topic-id], .topic-title h1, .fancy-title'); return el ? el.textContent.trim() : `topic-${getTopicId()}`; } function safeFilename(name) { return name.replace(/[\\/:*?"<>|]/g, '_').replace(/\s+/g, '_').slice(0, 100); } function fetchRaw(topicId, page) { return new Promise((resolve, reject) => { let url = `https://linux.do/raw/${topicId}`; if (page && page > 1) url += `?page=${page}`; GM_xmlhttpRequest({ method: 'GET', url, onload(res) { if (res.status === 200) resolve(res.responseText); else reject(new Error(`HTTP ${res.status}: ${url}`)); }, onerror(err) { reject(new Error('网络错误: ' + JSON.stringify(err))); }, }); }); } function downloadText(filename, content) { const blob = new Blob([content], { type: 'text/markdown;charset=utf-8' }); const url = URL.createObjectURL(blob); const a = Object.assign(document.createElement('a'), { href: url, download: filename }); document.body.appendChild(a); a.click(); setTimeout(() => { URL.revokeObjectURL(url); a.remove(); }, 1000); } // ── 弹窗 UI ─────────────────────────────────────────────────── function createModal() { const overlay = document.createElement('div'); Object.assign(overlay.style, { position: 'fixed', inset: '0', background: 'rgba(0,0,0,.55)', zIndex: '99998', display: 'flex', alignItems: 'center', justifyContent: 'center', }); const box = document.createElement('div'); Object.assign(box.style, { background: '#1e2229', color: '#d4d7dc', borderRadius: '10px', padding: '28px 32px', width: '360px', boxShadow: '0 8px 32px rgba(0,0,0,.6)', fontFamily: 'inherit', position: 'relative', zIndex: '99999', }); box.innerHTML = ` <h3 style="margin:0 0 18px;font-size:16px;color:#fff;">📥 导出 Markdown</h3> <label style="display:block;margin-bottom:10px;font-size:13px;"> 导出范围 <select id="ld-export-mode" style="display:block;width:100%;margin-top:6px;padding:7px 10px; background:#2c3038;border:1px solid #404552;border-radius:6px;color:#d4d7dc;font-size:13px;cursor:pointer;"> <option value="first">仅第 1 页(默认)</option> <option value="current">当前页</option> <option value="custom">指定页码</option> <option value="all">全部页(逐页合并)</option> </select> </label> <div id="ld-custom-wrap" style="display:none;margin-bottom:10px;"> <label style="font-size:13px;">页码 <input id="ld-custom-page" type="number" min="1" value="1" style="display:block;width:100%; margin-top:6px;padding:7px 10px;background:#2c3038;border:1px solid #404552; border-radius:6px;color:#d4d7dc;font-size:13px;box-sizing:border-box;" /> </label> </div> <div id="ld-status" style="font-size:12px;color:#9ba0ab;min-height:20px;margin-bottom:14px;"></div> <div style="display:flex;gap:10px;justify-content:flex-end;"> <button id="ld-cancel-btn" style="padding:8px 18px;border-radius:6px;border:1px solid #404552; background:transparent;color:#9ba0ab;cursor:pointer;font-size:13px;">取消</button> <button id="ld-export-btn" style="padding:8px 18px;border-radius:6px;border:none; background:#0088cc;color:#fff;cursor:pointer;font-size:13px;font-weight:600;">导出</button> </div> `; overlay.appendChild(box); document.body.appendChild(overlay); const modeSelect = box.querySelector('#ld-export-mode'); const customWrap = box.querySelector('#ld-custom-wrap'); const customInput = box.querySelector('#ld-custom-page'); const statusEl = box.querySelector('#ld-status'); const exportBtn = box.querySelector('#ld-export-btn'); const cancelBtn = box.querySelector('#ld-cancel-btn'); modeSelect.addEventListener('change', () => { customWrap.style.display = modeSelect.value === 'custom' ? 'block' : 'none'; if (modeSelect.value === 'current') customInput.value = getCurrentPage(); }); const closeModal = () => overlay.remove(); cancelBtn.addEventListener('click', closeModal); overlay.addEventListener('click', e => { if (e.target === overlay) closeModal(); }); exportBtn.addEventListener('click', async () => { const topicId = getTopicId(); if (!topicId) { statusEl.textContent = '❌ 无法解析 Topic ID'; return; } exportBtn.disabled = true; exportBtn.textContent = '导出中…'; statusEl.textContent = ''; try { const mode = modeSelect.value; const title = getTopicTitle(); let content = ''; if (mode === 'first') { statusEl.textContent = '正在拉取第 1 页…'; content = await fetchRaw(topicId, 1); } else if (mode === 'current') { const p = getCurrentPage(); statusEl.textContent = `正在拉取第 ${p} 页…`; content = await fetchRaw(topicId, p); } else if (mode === 'custom') { const p = parseInt(customInput.value, 10) || 1; statusEl.textContent = `正在拉取第 ${p} 页…`; content = await fetchRaw(topicId, p); } else if (mode === 'all') { const parts = []; let page = 1; while (true) { statusEl.textContent = `正在拉取第 ${page} 页…`; let text; try { text = await fetchRaw(topicId, page); } catch (e) { break; } if (!text || text.trim() === '') break; parts.push(`<!-- Page ${page} -->\n${text}`); if (page > 1 && parts[page - 1].trim() === parts[page - 2].trim()) { parts.pop(); break; } page++; await new Promise(r => setTimeout(r, 300)); } content = parts.join('\n\n---\n\n'); } if (!content) { statusEl.textContent = '⚠️ 未获取到内容,请确认页码是否有效'; return; } const filename = `${safeFilename(title)}.md`; downloadText(filename, content); statusEl.style.color = '#4caf50'; statusEl.textContent = `✅ 已下载:${filename}`; setTimeout(closeModal, 1500); } catch (err) { statusEl.style.color = '#f44336'; statusEl.textContent = '❌ ' + err.message; } finally { exportBtn.disabled = false; exportBtn.textContent = '导出'; } }); } // ── 注入按钮 ────────────────────────────────────────────────── function findButtonContainer(topicMap) { for (const sel of ['.topic-map__buttons', '.topic-footer-main-controls', '.buttons']) { const el = topicMap.querySelector(sel); if (el) return el; } const summarizeBtn = topicMap.querySelector( '.summarize-topic, button.create-summary, button.topic-map__summarize-btn, button' ); if (summarizeBtn) return summarizeBtn.parentElement; const children = [...topicMap.children].filter( el => el.tagName === 'DIV' || el.tagName === 'SECTION' ); return children.length ? children[children.length - 1] : null; } function createButton() { const btn = document.createElement('button'); btn.className = 'ld-export-md-btn'; btn.textContent = '⬇ 导出 MD'; // 获取参考样式(只在创建时获取一次) const refBtn = document.querySelector('.topic-map button'); const refStyle = refBtn ? getComputedStyle(refBtn) : null; Object.assign(btn.style, { padding: '6px 14px', borderRadius: refStyle ? refStyle.borderRadius : '6px', border: '1px solid #404552', background: '#2c3038', color: refStyle ? refStyle.color : '#d4d7dc', cursor: 'pointer', fontSize: refStyle ? refStyle.fontSize : '13px', fontWeight: '600', marginRight: '8px', verticalAlign: 'middle', transition: 'background .2s', flexShrink: '0', }); btn.addEventListener('mouseover', () => btn.style.background = '#3a3f4b'); btn.addEventListener('mouseout', () => btn.style.background = '#2c3038'); return btn; } function injectButton(topicMap) { if (topicMap.querySelector('.ld-export-md-btn')) return false; const container = findButtonContainer(topicMap); if (!container) return false; const btn = createButton(); container.insertBefore(btn, container.firstChild); return true; } // ── 性能优化核心:Intersection Observer + 事件委托 ────────── const injectedMaps = new WeakSet(); // 使用事件委托,只绑定一次 document.body.addEventListener('click', (e) => { if (e.target.classList.contains('ld-export-md-btn')) { e.preventDefault(); e.stopPropagation(); createModal(); } }); // Intersection Observer:只在元素可见时注入 const intersectionObserver = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting && !injectedMaps.has(entry.target)) { if (injectButton(entry.target)) { injectedMaps.add(entry.target); // 注入成功后停止观察该元素 intersectionObserver.unobserve(entry.target); } } }); }, { threshold: 0.1, rootMargin: '50px' // 提前 50px 开始加载 }); // MutationObserver:只监听主内容区域,不监听整个 body let mutationTimer = null; const contentArea = document.querySelector('#main-outlet, #topic, .container.posts') || document.body; const mutationObserver = new MutationObserver(() => { if (mutationTimer) return; mutationTimer = setTimeout(() => { mutationTimer = null; // 只查找新出现的 topic-map const maps = contentArea.querySelectorAll('.topic-map'); maps.forEach(map => { if (!injectedMaps.has(map)) { intersectionObserver.observe(map); } }); }, 800); // 较长的防抖时间 }); mutationObserver.observe(contentArea, { childList: true, subtree: true }); // 初始化:立即处理已存在的元素 document.querySelectorAll('.topic-map').forEach(map => { intersectionObserver.observe(map); }); // ── 路由跳转处理 ────────────────────────────────────────────── function cleanup() { intersectionObserver.disconnect(); mutationObserver.disconnect(); } function reinit() { cleanup(); // 重新初始化 const newContentArea = document.querySelector('#main-outlet, #topic, .container.posts') || document.body; mutationObserver.observe(newContentArea, { childList: true, subtree: true }); document.querySelectorAll('.topic-map').forEach(map => { if (!injectedMaps.has(map)) { intersectionObserver.observe(map); } }); } window.addEventListener('popstate', reinit); const _pushState = history.pushState.bind(history); history.pushState = function (...args) { _pushState(...args); setTimeout(reinit, 100); // 延迟等待 DOM 更新 }; })(); 仅对前端页面修改,也不会对服务器造成压力 ↩︎ 1 个帖子 - 1 位参与者 阅读完整话题

linux.do · 2026-04-17 08:16:13+08:00 · tech

news.cn 我国科学家在世界首次人工制造出类似自然界的“球状闪电”-新华网 我国科学家在世界首次人工制造出类似自然界的“球状闪电”-球状闪电,俗称“滚地雷”,是自然界最神秘的电磁现象之一。许多人曾目击到这种悬浮于空气中的发光球体,心中充满了好奇和追问。科学家们也提出过多种理论假说,但始终缺乏可重复、可精确诊断的实验加以验证。 [!quote]+ 在深厚技术积累基础上,中国科学院上海光学精密机械研究所的研究团队,首次在世界上用人工方式,成功激发并捕获了一种在形状、状态和发光特性与自然界球状闪电高度相似的球形发光体,从而揭示并证实球状闪电的本质为“电磁孤子”。16日,国际权威学术期刊《自然·光子学》发表了相关论文。 “它飘了进来,一个篮球大小的蓝色火球。它像一个蓝色的幽灵,一个凝固的闪电,在客厅里飘行,发出的光芒柔和冰凉。它没有声音,也没有轨迹,就那么无声地、空灵地飘着,像在空气中游泳。”这是科幻作家刘慈欣在《球状闪电》一书中描写的球状闪电。 news.sciencenet.cn 科学网—用羲和激光装置造出“球状闪电” Ball-lightning-like relativistic terahertz solitons | Nature Photonics 6 个帖子 - 4 位参与者 阅读完整话题

linux.do · 2026-04-16 11:33:22+08:00 · tech

目前接到一个类似于沉浸式翻译的需求,这个需求也需要支持富文本。如果只是单纯支持富文本,那么我想到的就是按富文本解析把文本按段落拆分,让AI分段落翻译就好。 但是除此以外还有个要求,就是某些文本是要求不可翻译的,例如「你好,{用户名}」这种,用户名就不可翻译。如果我按照前面那种方式去做,先把一个句子拆分成「可翻译」和「不可翻译」,等AI翻译后再把「不可翻译」的内容回填,就会出现这样一个问题:不同语言的语序是不一样的,可能中文是 A B 这样的语序,翻译成日语就变成了 B A,所以如果这时候按照原文的语序回填「不可翻译」的内容就会造成翻译后的内容语序错误。 问了问AI也没什么好的解决方法,所以想和各位佬友一起探讨一下这种情况一般是怎么做的? 1 个帖子 - 1 位参与者 阅读完整话题

linux.do · 2026-04-15 18:37:51+08:00 · tech

本帖使用社区开源推广,符合推广要求。我申明并遵循社区要求的以下内容: 我的帖子已经打上 开源推广 标签: 是 我的开源项目完整开源,无未开源部分: 是 我的开源项目已链接认可 LINUX DO 社区: 是 我帖子内的项目介绍,AI生成、润色内容部分已截图发出: 是 以上选择我承诺是永久有效的,接受社区和佬友监督: 是 以下为项目介绍正文内容,AI生成、润色内容已使用截图方式发出 我是完全不会开发游戏的,但是我现在突然就可以开发各种各样游戏了,因为我搞到一个绝世好SKILL, 分享给佬友: liang’s Godogen: 使用 Claude Code 构建完整 Godot 4 项目的技能 github地址: GitHub - liangdabiao/Godogen: liang's Godogen: 使用 Claude Code 构建完整 Godot 4 项目的技能集,你描述你想要的内容。AI pipeline 会设计架构、生成美术资源、编写每一行代码、从运行的游戏引擎中截取截图,并修复看起来不对的地方。输出是一个真正的 Godot 4 项目,包含组织良好的场景、可读的脚本和正确的游戏架构。 · GitHub 核心3点: 1, vibe coding 与AI助手协同创作 2, 可视化逻辑编辑, 直接在godot可以编辑 3, AI美术资源生成 一句话,开发游戏: ❯ 开发新游戏: 真人快打模式,以林冲为主角,背景为风雪山林 然后,AI连续工作半小时,生成如下游戏(简单游戏情况): 所有设计架构-生成美术资源-编码-测试-运行-交付 ,全部都是AI. 复杂游戏也可以: 为什么AI可以运用 godot 4 主流游戏引擎创建游戏,核心就是: “驾驭工程”(harness engineering):工程团队的首要工作不再是编写代码,而是让智能体能够有效工作。当出现问题时,解决方案从不是"再努力一把",而是:缺少什么能力?如何让智能体能够理解并执行。 制作plan, 记录在文档,一步一步完成,测试,检查,修复,下一步: AI自动验证: 我们人类要给AI一个可以harness的环境和工具资源: 302.ai api 各种能力给ai, 自动检查,自动运行游戏截图检查, 自动玩游戏, 积累经验反馈。 要告诉 godot在哪里: “D:/Godot_v4.6.2-stable_win64.exe” 对话式 开发和修改游戏: AI给方案,然后工作: Ai自己按 人物状态利用nano banana 生成对应 美术资源动画: 总结 本项目是继承自一个开源项目:htdt/godogen 我大量修改和优化,更适合国内使用,更方便: GitHub - liangdabiao/Godogen: liang's Godogen: 使用 Claude Code 构建完整 Godot 4 项目的技能集,你描述你想要的内容。AI pipeline 会设计架构、生成美术资源、编写每一行代码、从运行的游戏引擎中截取截图,并修复看起来不对的地方。输出是一个真正的 Godot 4 项目,包含组织良好的场景、可读的脚本和正确的游戏架构。 · GitHub 总体测试开发了多个各种各样游戏,我觉得基本上用它开发游戏是可行的,目前第一版发布,有佬喜欢,我会继续开发吧,感谢佬友支持。 1 个帖子 - 1 位参与者 阅读完整话题