[js] 自动渲染目录中包含数据库的页面以及被数据库记录关联的页面

作用:习惯将数据库关联的页面作为子页面,为了直观管理形成了这段代码
逻辑
1、遍历笔记所有数据库,修改目录中包含数据库的页面的图标和标题颜色
2、遍历每个数据库关联的页面,修改页面的图标和标题颜色
限制:暂时没考虑新增数据库以及新关联页面

PixPin20250916093112.gif

// 配置选项
const CONFIG = {
    styles: {
        database: {
            color: '#ff4757',
            fontWeight: 'bold',
            icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWRhdGFiYXNlLWljb24gbHVjaWRlLWRhdGFiYXNlIj48ZWxsaXBzZSBjeD0iMTIiIGN5PSI1IiByeD0iOSIgcnk9IjMiLz48cGF0aCBkPSJNMyA1VjE5QTkgMyAwIDAgMCAyMSAxOVY1Ii8+PHBhdGggZD0iTTMgMTJBOSAzIDAgMCAwIDIxIDEyIi8+PC9zdmc+',
            iconType: 'svg'
        },
        referenced: {
            color: '#3742fa',
            icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWxpbmstaWNvbiBsdWNpZGUtbGluayI+PHBhdGggZD0iTTEwIDEzYTUgNSAwIDAgMCA3LjU0LjU0bDMtM2E1IDUgMCAwIDAtNy4wNy03LjA3bC0xLjcyIDEuNzEiLz48cGF0aCBkPSJNMTQgMTFhNSA1IDAgMCAwLTcuNTQtLjU0bC0zIDNhNSA1IDAgMCAwIDcuMDcgNy4wN2wxLjcxLTEuNzEiLz48L3N2Zz4=',
            iconType: 'svg'
        }
    },
    showIcon: true,
    debug: true,
    enableReferencedPages: true,
    enableEventListeners: true, // 启用事件监听
    pagination: {
        pageSize: 64,
        maxRetries: 3,
        retryDelay: 100
    },
    rendering: {
        initialRetries: 3,
        retryInterval: 1000,
        batchSize: 100,
        eventDebounceDelay: 300 // 事件防抖延迟
    }
};

// SQL 常量
const SQL = {
    DB_COUNT: `SELECT COUNT(DISTINCT root_id) FROM blocks WHERE type = 'av'`,
    DB_PAGE: `SELECT DISTINCT root_id FROM blocks WHERE type = 'av'`,
    REF_COUNT: `SELECT count(DISTINCT root_id) FROM attributes WHERE box IN (SELECT box FROM blocks WHERE type = 'av') AND name = 'custom-avs'`,
    REF_PAGE: `SELECT DISTINCT root_id FROM attributes WHERE box IN (SELECT box FROM blocks WHERE type = 'av') AND name = 'custom-avs'`
};

// 工具延迟
class DelayUtil {
    static async delay(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
}

class EnhancedDatabaseDocumentChecker {
    constructor(config = CONFIG) {
        this.config = config;
        this.databaseDocumentIds = new Set();
        this.referencedDocumentIds = new Set();
        this.renderedElements = new WeakSet();
        this.renderQueue = new Set();
        this.isRendering = false;
        this.renderTimeout = null;
        this.eventListeners = []; // 存储事件监听器
        this.eventDebounceTimer = null; // 事件防抖定时器
    }
  
    log(...args) {
        if (this.config.debug) console.log('[DB检查器]', ...args);
    }

    // SQL 查询
    async executeSingleSQL(sql, description = '') {
        try {
            this.log(`执行SQL查询${description}:`, sql);
            const response = await fetch('/api/query/sql', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({ stmt: sql })
            });
            if (!response.ok) throw new Error(`HTTP错误: ${response.status}`);
            const result = await response.json();
            if (result.code !== 0) throw new Error(`查询失败: ${result.msg || '未知错误'}`);
            return result.data || [];
        } catch (error) {
            this.log(`SQL查询失败${description}:`, error);
            throw error;
        }
    }

    async getTotalCount(countSql, description = '') {
        const result = await this.executeSingleSQL(countSql, `${description}-计数`);
        return result.length ? (parseInt(Object.values(result[0])[0]) || 0) : 0;
    }

    // 精确分页查询
    async executePrecisePaginatedSQL(baseSql, countSql, description = '') {
        const { pageSize, maxRetries, retryDelay } = this.config.pagination;
        const totalCount = await this.getTotalCount(countSql, description);
        if (!totalCount) return [];
        const totalPages = Math.ceil(totalCount / pageSize);
        let allResults = [];
        for (let page = 0; page < totalPages; page++) {
            const offset = page * pageSize;
            const paginatedSql = `${baseSql} LIMIT ${pageSize} OFFSET ${offset}`;
            let batchResults = [];
            for (let retry = 0; retry < maxRetries; retry++) {
                try {
                    batchResults = await this.executeSingleSQL(paginatedSql, `${description}-第${page + 1}/${totalPages}页`);
                    break;
                } catch (error) {
                    if (retry === maxRetries - 1) this.log(`第${page + 1}页查询失败:`, error.message);
                    await DelayUtil.delay(retryDelay);
                }
            }
            if (batchResults.length) allResults.push(...batchResults);
            if (page < totalPages - 1) await DelayUtil.delay(retryDelay / 2);
        }
        if (allResults.length < totalCount) this.log(`${description} 数据可能不完整: 预期${totalCount}条,实际${allResults.length}条`);
        return allResults;
    }

    // 传统分页(降级)
    async executeLegacyPaginatedSQL(baseSql, description = '') {
        const { pageSize, maxRetries, retryDelay } = this.config.pagination;
        let allResults = [], offset = 0, batch = 0;
        while (true) {
            const paginatedSql = `${baseSql} LIMIT ${pageSize} OFFSET ${offset}`;
            let batchResults = [];
            for (let retry = 0; retry < maxRetries; retry++) {
                try {
                    batchResults = await this.executeSingleSQL(paginatedSql, `${description}-第${batch + 1}批`);
                    break;
                } catch (error) {
                    if (retry === maxRetries - 1) throw error;
                    await DelayUtil.delay(retryDelay);
                }
            }
            if (batchResults.length < pageSize) break;
            allResults.push(...batchResults);
            offset += pageSize;
            batch++;
            if (batch > 100) break;
            await DelayUtil.delay(retryDelay / 2);
        }
        return allResults;
    }

    // 查询数据库页面
    async queryDatabaseDocuments() {
        const data = await this.executeSingleSQL(SQL.DB_PAGE, '(数据库页面)');
        this.databaseDocumentIds = new Set(data.map(row => row.root_id));
        this.log('数据库页面查询完成:', data.length);
        return !!data.length;
    }

    // 查询被引用页面
    async queryReferencedDocuments() {
        if (!this.config.enableReferencedPages) return true;
        try {
            const data = await this.executePrecisePaginatedSQL(SQL.REF_PAGE, SQL.REF_COUNT, '(关联页面)');
            this.referencedDocumentIds = new Set(data.map(row => row.root_id));
            this.log('关联页面查询完成:', data.length);
            return !!data.length;
        } catch (error) {
            this.log('精确分页失败,降级到传统分页:', error);
            return await this.queryReferencedDocumentsFallback();
        }
    }

    async queryReferencedDocumentsFallback() {
        try {
            const data = await this.executeLegacyPaginatedSQL(SQL.REF_PAGE, '(关联页面-降级)');
            this.referencedDocumentIds = new Set(data.map(row => row.root_id));
            this.log('关联页面降级查询完成:', data.length);
            return !!data.length;
        } catch (error) {
            this.log('降级查询也失败了:', error);
            return false;
        }
    }

    // 验证查询结果
    async validateResults() {
        try {
            const dbCount = await this.getTotalCount(SQL.DB_COUNT, '(验证-数据库页面)');
            const refCount = await this.getTotalCount(SQL.REF_COUNT, '(验证-关联页面)');
            this.log(`验证结果: 数据库页面 预期${dbCount}, 实际${this.databaseDocumentIds.size}`);
            this.log(`验证结果: 关联页面 预期${refCount}, 实际${this.referencedDocumentIds.size}`);
            return this.databaseDocumentIds.size === dbCount && this.referencedDocumentIds.size === refCount;
        } catch (error) {
            this.log('验证查询失败:', error);
            return false;
        }
    }

    // 测试分页查询
    async testPaginatedQuery() {
        this.log('开始测试分页查询');
        try {
            const totalCount = await this.getTotalCount(SQL.REF_COUNT, '(测试)');
            const results = await this.executePrecisePaginatedSQL(SQL.REF_PAGE, SQL.REF_COUNT, '(测试分页)');
            const isValid = results.length === totalCount;
            this.log(`测试分页查询 - 总数: ${totalCount}, 实际获取: ${results.length}, 结果验证: ${isValid ? '通过' : '失败'}`);
            return { totalCount, actualCount: results.length, isValid };
        } catch (error) {
            this.log('测试分页查询失败:', error);
            return null;
        }
    }

    // 查找DOM元素
    findFileTreeElements() {
        const selectors = [
            '.file-tree [data-node-id]',
            '.sy__file [data-node-id]',
            '.b3-list-item[data-node-id]',
            '.protyle-breadcrumb [data-node-id]',
            '.layout-tab-bar [data-node-id]',
            '.layout-tab-bar__text[data-node-id]',
            '.sy__outline [data-node-id]',
            '.outline [data-node-id]',
            '.backlink [data-node-id]',
            '.protyle-attr [data-node-id]',
            '.search__item [data-node-id]',
            '.b3-list [data-node-id]',
            '[data-node-id]' // 兜底
        ];
        const allElements = new Set();
        selectors.forEach(selector => {
            document.querySelectorAll(selector).forEach(el => {
                if (el.getAttribute('data-node-id')) allElements.add(el);
            });
        });
        this.log(`找到 ${allElements.size} 个DOM元素`);
        return Array.from(allElements);
    }

    // 初始渲染
    async renderOnce() {
        const { initialRetries, retryInterval, batchSize } = this.config.rendering;
        let attempt = 0, bestResult = 0;
        this.log('开始渲染');
        while (attempt < initialRetries) {
            attempt++;
            const elements = this.findFileTreeElements();
            if (!elements.length) {
                this.log(`第${attempt}次尝试: 未找到DOM元素,${retryInterval}ms后重试`);
                await DelayUtil.delay(retryInterval);
                continue;
            }
            let updatedCount = 0;
            for (let i = 0; i < elements.length; i += batchSize) {
                elements.slice(i, i + batchSize).forEach(element => {
                    if (this.updateItemStyle(element)) updatedCount++;
                });
                await DelayUtil.delay(10);
            }
            bestResult = Math.max(bestResult, updatedCount);
            this.log(`第${attempt}次尝试完成: 更新了${updatedCount}个元素`);
            const expectedCount = this.databaseDocumentIds.size + this.referencedDocumentIds.size;
            if (updatedCount >= expectedCount * 0.8 || updatedCount >= 10) break;
            await DelayUtil.delay(retryInterval);
        }
        this.log(`渲染完成: 最终更新了${bestResult}个元素`);
        return bestResult;
    }

    // 更新样式
    updateItemStyle(item) {
        if (!item || !item.getAttribute) return false;
        const nodeId = item.getAttribute('data-node-id');
        if (!nodeId) return false;
        // 查找标题元素
        const textSelectors = [
            '.b3-list-item__text', '.item__text', '.layout-tab-bar__text',
            '.file-tree__text', '.sy__file-text', '.outline__text',
            '.search__text', 'span:not([class])', '.ariaLabel'
        ];
        let titleElement = null;
        for (const selector of textSelectors) {
            titleElement = item.querySelector(selector);
            if (titleElement) break;
        }
        if (!titleElement && item.textContent && item.textContent.trim()) titleElement = item;
        if (!titleElement) return false;
        let applied = false;
        if (this.databaseDocumentIds.has(nodeId)) {
            this.applyDatabaseStyles(titleElement);
            applied = true;
        } else if (this.referencedDocumentIds.has(nodeId)) {
            this.applyReferencedStyles(titleElement);
            applied = true;
        }
        if (applied) this.renderedElements.add(item);
        return applied;
    }

    // 数据库样式
    applyDatabaseStyles(element) {
        const { styles, showIcon } = this.config;
        const dbStyles = styles.database;
        element.style.color = dbStyles.color;
        element.style.fontWeight = dbStyles.fontWeight;
        element.classList.add('database-document');
  
        if (showIcon) {
            const existingIcon = element.parentElement?.querySelector('.b3-list-item__icon, .file-tree__icon, .sy__file-icon, .item__icon, [data-type="icon"]');
            if (existingIcon && dbStyles.iconType === 'svg') {
                existingIcon.innerHTML = '';
                const img = document.createElement('img');
                img.src = dbStyles.icon;
                img.style.width = '16px';
                img.style.height = '16px';
                img.style.display = 'block';
                img.title = '数据库页面';
                existingIcon.appendChild(img);
                existingIcon.classList.add('db-icon-replaced');
            }
        }
    }

    // 引用样式
    applyReferencedStyles(element) {
        const { styles, showIcon } = this.config;
        const refStyles = styles.referenced;
        element.style.color = refStyles.color;
        element.style.fontWeight = refStyles.fontWeight;
        element.classList.add('referenced-document');
  
        if (showIcon) {
            const existingIcon = element.parentElement?.querySelector('.b3-list-item__icon, .file-tree__icon, .sy__file-icon, .item__icon, [data-type="icon"]');
            if (existingIcon && refStyles.iconType === 'svg') {
                existingIcon.innerHTML = '';
                const img = document.createElement('img');
                img.src = refStyles.icon;
                img.style.width = '16px';
                img.style.height = '16px';
                img.style.display = 'block';
                img.title = '数据库关联页面';
                existingIcon.appendChild(img);
                existingIcon.classList.add('ref-icon-replaced');
            }
        }
    }

    // 样式插入(只插入一次)
    addStyles() {
        if (document.querySelector('#database-doc-checker-styles')) return;
        const { styles } = this.config;
        const dbStyles = styles.database;
        const refStyles = styles.referenced;
        const css = `
            .database-document {
                color: ${dbStyles.color} !important;
                font-weight: ${dbStyles.fontWeight} !important;
            }
            .referenced-document {
                color: ${refStyles.color} !important;
                font-weight: ${refStyles.fontWeight} !important;
            }
            .db-icon-replaced img {
                display: block !important;
                width: 16px !important;
                height: 16px !important;
                filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
            }
            .ref-icon-replaced img {
                display: block !important;
                width: 16px !important;
                height: 16px !important;
                filter: brightness(0) saturate(100%) invert(27%) sepia(93%) saturate(2878%) hue-rotate(226deg) brightness(104%) contrast(97%);
            }
            .b3-theme-dark .db-icon-replaced img {
                filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1352%) hue-rotate(87deg) brightness(119%) contrast(119%);
            }
            .b3-theme-dark .ref-icon-replaced img {
                filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1352%) hue-rotate(200deg) brightness(119%) contrast(119%);
            }
        `;
        const styleElement = document.createElement('style');
        styleElement.id = 'database-doc-checker-styles';
        styleElement.textContent = css;
        document.head.appendChild(styleElement);
        this.log('CSS样式已添加(图标替换模式)');
    }

    // 事件防抖处理
    handleEventDebounce() {
        clearTimeout(this.eventDebounceTimer);
        this.eventDebounceTimer = setTimeout(async () => {
            this.log('事件触发,开始重新渲染');
            await this.forceRerender();
        }, this.config.rendering.eventDebounceDelay);
    }

    // 设置事件监听器
    setupEventListeners() {
        if (!this.config.enableEventListeners) return;
  
        // 清除旧的监听器
        this.removeEventListeners();
  
        // 点击事件(目录展开/收缩)
        const clickHandler = (event) => {
            const target = event.target;
            // 检查是否是文件树相关的点击
            if (target.closest('.file-tree') || 
                target.closest('.sy__file') || 
                target.closest('.b3-list-item') ||
                target.classList.contains('b3-list-item__arrow') ||
                target.classList.contains('file-tree__arrow')) {
                this.log('检测到文件树点击事件');
                this.handleEventDebounce();
            }
        };
  
        // 键盘事件(方向键导航等)
        const keyHandler = (event) => {
            if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Enter', 'Space'].includes(event.key)) {
                const target = event.target;
                if (target.closest('.file-tree') || target.closest('.sy__file')) {
                    this.log('检测到文件树键盘事件');
                    this.handleEventDebounce();
                }
            }
        };
  
        // 添加事件监听器
        document.addEventListener('click', clickHandler, true);
        document.addEventListener('keydown', keyHandler, true);
  
        // 存储监听器引用以便后续清理
        this.eventListeners = [
            { element: document, event: 'click', handler: clickHandler, options: true },
            { element: document, event: 'keydown', handler: keyHandler, options: true }
        ];
  
        this.log('事件监听器已设置');
    }

    // 移除事件监听器
    removeEventListeners() {
        this.eventListeners.forEach(({ element, event, handler, options }) => {
            element.removeEventListener(event, handler, options);
        });
        this.eventListeners = [];
        clearTimeout(this.eventDebounceTimer);
        this.log('事件监听器已移除');
    }

    // 统计信息
    getStats() {
        const overlappingPages = Array.from(this.databaseDocumentIds).filter(id => this.referencedDocumentIds.has(id));
        return {
            databaseDocumentCount: this.databaseDocumentIds.size,
            referencedDocumentCount: this.referencedDocumentIds.size,
            overlappingCount: overlappingPages.length,
            uniqueTotal: new Set([...this.databaseDocumentIds, ...this.referencedDocumentIds]).size,
            renderQueueSize: this.renderQueue.size,
            eventListenersActive: this.eventListeners.length > 0
        };
    }

    // 刷新
    async refresh() {
        this.log('手动刷新开始');
        this.removeEventListeners();
        this.databaseDocumentIds.clear();
        this.referencedDocumentIds.clear();
        this.renderQueue.clear();
        this.renderedElements = new WeakSet();
        this.isRendering = false;
        clearTimeout(this.renderTimeout);
        await this.init();
        this.log('手动刷新完成');
    }

    // 强制重新渲染
    async forceRerender() {
        this.log('开始强制重新渲染');
        this.renderedElements = new WeakSet();
        const updated = await this.renderOnce();
        this.log(`强制重新渲染完成: ${updated} 个元素`);
        return updated;
    }

    // 清理资源
    cleanup() {
        this.removeEventListeners();
        clearTimeout(this.renderTimeout);
        clearTimeout(this.eventDebounceTimer);
        this.log('资源已清理');
    }

    // 初始化
    async init() {
        this.log('初始化开始');
        this.addStyles();
        try {
            await this.queryDatabaseDocuments();
            await this.queryReferencedDocuments();
            const isValid = await this.validateResults();
            if (!isValid) this.log('查询结果验证失败,但继续执行渲染');
            const updated = await this.renderOnce();
  
            // 设置事件监听器
            this.setupEventListeners();
  
            const stats = this.getStats();
            console.log(`数据库文档检查完成:`);
            console.log(`- ${stats.databaseDocumentCount} 个数据库页面`);
            console.log(`- ${stats.referencedDocumentCount} 个关联页面`);
            console.log(`- ${stats.overlappingCount} 个重叠页面`);
            console.log(`- 初始渲染 ${updated} 个元素`);
            console.log(`- 事件监听器: ${stats.eventListenersActive ? '已启动' : '未启动'}`);
            this.log('初始化完成');
            return true;
        } catch (error) {
            this.log('初始化失败:', error);
            return false;
        }
    }
}

// 全局实例
let dbDocChecker = null;

// 初始化函数
async function initEnhancedDatabaseDocumentChecker() {
    if (dbDocChecker) {
        await dbDocChecker.refresh();
        return;
    }
    dbDocChecker = new EnhancedDatabaseDocumentChecker(CONFIG);
    await dbDocChecker.init();
    window.dbDocChecker = dbDocChecker;
    console.log('增强数据库文档检查器已启动(事件驱动模式)');
    console.log('调试命令:');
    console.log('- window.dbDocChecker.refresh() - 手动刷新');
    console.log('- window.dbDocChecker.forceRerender() - 强制重新渲染');
    console.log('- window.dbDocChecker.getStats() - 获取统计信息');
    console.log('- window.dbDocChecker.validateResults() - 验证查询结果');
    console.log('- window.dbDocChecker.testPaginatedQuery() - 测试分页查询');
    console.log('- window.dbDocChecker.cleanup() - 清理资源');
}

// 等待页面加载完成后初始化
function waitForPageLoad() {
    return new Promise((resolve) => {
        if (document.readyState === 'complete') {
            setTimeout(resolve, 2000);
        } else {
            window.addEventListener('load', () => {
                setTimeout(resolve, 2000);
            });
        }
    });
}

// 页面卸载时清理资源
window.addEventListener('beforeunload', () => {
    if (dbDocChecker) {
        dbDocChecker.cleanup();
    }
});

// 启动
waitForPageLoad().then(() => {
    initEnhancedDatabaseDocumentChecker();
});

window.initEnhancedDatabaseDocumentChecker = initEnhancedDatabaseDocumentChecker;

  • 思源笔记

    思源笔记是一款隐私优先的个人知识管理系统,支持完全离线使用,同时也支持端到端加密同步。

    融合块、大纲和双向链接,重构你的思维。

    28446 引用 • 119789 回帖
  • 代码片段

    代码片段分为 CSS 与 JS 两种代码,添加在 [设置 - 外观 - 代码片段] 中,这些代码会在思源笔记加载时自动执行,用于改善笔记的样式或功能。

    用户在该标签下分享代码片段时需在帖子标题前添加 [css] [js] 用于区分代码片段类型。

    285 引用 • 1988 回帖
4 操作
JeffreyChen 在 2025-09-16 14:03:01 更新了该帖
shangzw 在 2025-09-16 10:44:47 更新了该帖
shangzw 在 2025-09-16 10:43:17 更新了该帖
shangzw 在 2025-09-16 10:01:18 更新了该帖

相关帖子

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...

推荐标签 标签

  • Vim

    Vim 是类 UNIX 系统文本编辑器 Vi 的加强版本,加入了更多特性来帮助编辑源代码。Vim 的部分增强功能包括文件比较(vimdiff)、语法高亮、全面的帮助系统、本地脚本(Vimscript)和便于选择的可视化模式。

    29 引用 • 66 回帖
  • GitBook

    GitBook 使您的团队可以轻松编写和维护高质量的文档。 分享知识,提高团队的工作效率,让用户满意。

    3 引用 • 8 回帖
  • 电影

    这是一个不能说的秘密。

    125 引用 • 610 回帖
  • OAuth

    OAuth 协议为用户资源的授权提供了一个安全的、开放而又简易的标准。与以往的授权方式不同之处是 oAuth 的授权不会使第三方触及到用户的帐号信息(如用户名与密码),即第三方无需使用用户的用户名与密码就可以申请获得该用户资源的授权,因此 oAuth 是安全的。oAuth 是 Open Authorization 的简写。

    36 引用 • 103 回帖 • 44 关注
  • 持续集成

    持续集成(Continuous Integration)是一种软件开发实践,即团队开发成员经常集成他们的工作,通过每个成员每天至少集成一次,也就意味着每天可能会发生多次集成。每次集成都通过自动化的构建(包括编译,发布,自动化测试)来验证,从而尽早地发现集成错误。

    15 引用 • 7 回帖
  • 又拍云

    又拍云是国内领先的 CDN 服务提供商,国家工信部认证通过的“可信云”,乌云众测平台认证的“安全云”,为移动时代的创业者提供新一代的 CDN 加速服务。

    20 引用 • 37 回帖 • 577 关注
  • Office

    Office 现已更名为 Microsoft 365. Microsoft 365 将高级 Office 应用(如 Word、Excel 和 PowerPoint)与 1 TB 的 OneDrive 云存储空间、高级安全性等结合在一起,可帮助你在任何设备上完成操作。

    6 引用 • 35 回帖
  • 一些有用的避坑指南。

    69 引用 • 93 回帖
  • IDEA

    IDEA 全称 IntelliJ IDEA,是一款 Java 语言开发的集成环境,在业界被公认为最好的 Java 开发工具之一。IDEA 是 JetBrains 公司的产品,这家公司总部位于捷克共和国的首都布拉格,开发人员以严谨著称的东欧程序员为主。

    182 引用 • 400 回帖 • 1 关注
  • B3log

    B3log 是一个开源组织,名字来源于“Bulletin Board Blog”缩写,目标是将独立博客与论坛结合,形成一种新的网络社区体验,详细请看 B3log 构思。目前 B3log 已经开源了多款产品:SymSoloVditor思源笔记

    1062 引用 • 3456 回帖 • 124 关注
  • C++

    C++ 是在 C 语言的基础上开发的一种通用编程语言,应用广泛。C++ 支持多种编程范式,面向对象编程、泛型编程和过程化编程。

    110 引用 • 153 回帖
  • Flutter

    Flutter 是谷歌的移动 UI 框架,可以快速在 iOS 和 Android 上构建高质量的原生用户界面。 Flutter 可以与现有的代码一起工作,它正在被越来越多的开发者和组织使用,并且 Flutter 是完全免费、开源的。

    39 引用 • 92 回帖 • 16 关注
  • OpenCV
    15 引用 • 36 回帖 • 1 关注
  • OpenStack

    OpenStack 是一个云操作系统,通过数据中心可控制大型的计算、存储、网络等资源池。所有的管理通过前端界面管理员就可以完成,同样也可以通过 Web 接口让最终用户部署资源。

    10 引用 • 8 关注
  • PHP

    PHP(Hypertext Preprocessor)是一种开源脚本语言。语法吸收了 C 语言、 Java 和 Perl 的特点,主要适用于 Web 开发领域,据说是世界上最好的编程语言。

    167 引用 • 408 回帖 • 494 关注
  • Markdown

    Markdown 是一种轻量级标记语言,用户可使用纯文本编辑器来排版文档,最终通过 Markdown 引擎将文档转换为所需格式(比如 HTML、PDF 等)。

    173 引用 • 1559 回帖
  • 大数据

    大数据(big data)是指无法在一定时间范围内用常规软件工具进行捕捉、管理和处理的数据集合,是需要新处理模式才能具有更强的决策力、洞察发现力和流程优化能力的海量、高增长率和多样化的信息资产。

    91 引用 • 113 回帖
  • 笔记

    好记性不如烂笔头。

    315 引用 • 790 回帖
  • golang

    Go 语言是 Google 推出的一种全新的编程语言,可以在不损失应用程序性能的情况下降低代码的复杂性。谷歌首席软件工程师罗布派克(Rob Pike)说:我们之所以开发 Go,是因为过去 10 多年间软件开发的难度令人沮丧。Go 是谷歌 2009 发布的第二款编程语言。

    502 引用 • 1397 回帖 • 241 关注
  • OneDrive
    2 引用 • 2 关注
  • 深度学习

    深度学习(Deep Learning)是机器学习的分支,是一种试图使用包含复杂结构或由多重非线性变换构成的多个处理层对数据进行高层抽象的算法。

    45 引用 • 44 回帖 • 2 关注
  • Sillot

    Insights(注意当前设置 master 为默认分支)

    汐洛彖夲肜矩阵(Sillot T☳Converbenk Matrix),致力于服务智慧新彖乄,具有彖乄驱动、极致优雅、开发者友好的特点。其中汐洛绞架(Sillot-Gibbet)基于自思源笔记(siyuan-note),前身是思源笔记汐洛版(更早是思源笔记汐洛分支),是智慧新录乄终端(多端融合,移动端优先)。

    主仓库地址:Hi-Windom/Sillot

    文档地址:sillot.db.sc.cn

    注意事项:

    1. ⚠️ 汐洛仍在早期开发阶段,尚不稳定
    2. ⚠️ 汐洛并非面向普通用户设计,使用前请了解风险
    3. ⚠️ 汐洛绞架基于思源笔记,开发者尽最大努力与思源笔记保持兼容,但无法实现 100% 兼容
    29 引用 • 25 回帖 • 152 关注
  • Spark

    Spark 是 UC Berkeley AMP lab 所开源的类 Hadoop MapReduce 的通用并行框架。Spark 拥有 Hadoop MapReduce 所具有的优点;但不同于 MapReduce 的是 Job 中间输出结果可以保存在内存中,从而不再需要读写 HDFS,因此 Spark 能更好地适用于数据挖掘与机器学习等需要迭代的 MapReduce 的算法。

    74 引用 • 46 回帖 • 563 关注
  • Word
    13 引用 • 41 回帖 • 1 关注
  • Java

    Java 是一种可以撰写跨平台应用软件的面向对象的程序设计语言,是由 Sun Microsystems 公司于 1995 年 5 月推出的。Java 技术具有卓越的通用性、高效性、平台移植性和安全性。

    3206 引用 • 8217 回帖
  • CAP

    CAP 指的是在一个分布式系统中, Consistency(一致性)、 Availability(可用性)、Partition tolerance(分区容错性),三者不可兼得。

    12 引用 • 5 回帖 • 660 关注
  • 资讯

    资讯是用户因为及时地获得它并利用它而能够在相对短的时间内给自己带来价值的信息,资讯有时效性和地域性。

    56 引用 • 85 回帖 • 1 关注