i18n-ai-translate開源程序,可以使用DeepSeek等模型將您的 i18nJSON翻譯成任何語言

一、軟件介紹

文末提供程序和源碼下載

? ? ? ?i18n-ai-translate開源程序使用 DeepSeek等模型可以將您的 i18n JSON 翻譯成任何語言。?無縫翻譯本地化文件。支持嵌套翻譯文件的目錄。需要i18next樣式的JSON 文件(文末一并提供下載)。

二、模式

CSV 模式

三個提示鏈接在一起,以確保每個翻譯格式正確。

  1. 翻譯提示嘗試翻譯
  2. 翻譯驗證提示使用單獨的上下文來驗證翻譯
  3. 樣式驗證提示使用另一個上下文來驗證翻譯的格式是否與源一致

JSON 模式

?翻譯和驗證分兩個單獨的步驟完成。

  1. 翻譯提示嘗試翻譯整個文件
  2. 翻譯驗證提示會驗證/修復并再次驗證每一行。
  3. 在兩次調用之間保留歷史記錄,以確保翻譯整個文件時的一致性。

?三、Usage??用法

Quick-start??快速啟動

GitHub Actions ?GitHub 作
使用 GitHub Action 將其合并到您的 CI 中,以將每個拉取請求的密鑰自動轉換為新提交。所有可配置選項均以 action.yml 形式提供。

下面翻譯了?i18n/en.json?被修改的每個 PR:

name: i18n-ai-translateon:pull_request:# Only trigger when en.json has been modifiedpaths:- "i18n/en.json"jobs:build:runs-on: ubuntu-lateststeps:- name: i18n-ai-translateuses: taahamahdi/i18n-ai-translate@masterwith:json-file-path: i18n/en.jsonapi-key: ${{ secrets.OPENAI_API_KEY }}

四、Running directly 直接運行

git clone git@github.com:taahamahdi/i18n-ai-translate.git
cd i18n-ai-translate
yarn
cp /home/en.json jsons/# Generate French translations
npm run i18n-ai-translate -- translate -i en.json -o fr.json --engine chatgpt --model gpt-4o --api-key <openai_key>

Running as a script in your own project在您自己的項目中作為腳本運行

yarn add i18n-ai-translate# Generate French translations
npx i18n-ai-translate translate -i en.json -o fr.json --engine gemini --model gemini-2.0-flash-exp --api-key <gemini_key># Or, assuming you already have other translations in the current directory
npx i18n-ai-translate diff --before en-before.json --after en.json --input-language English --engine claude --model claude-3-5-sonnet-latest --api-key <anthropic_key>

Running as a library??作為庫運行

import { translate } from "i18n-ai-translate";
...
const englishJSON = {"welcomeMessage": "Welcome, {{name}}!","messages": {"notifications_one": "You have one notification","notifications_other": "You have {{count}} notifications","delete": "Would you like to delete the \"{{name}}\" category?"}
};const frenchTranslation = await translate({inputJSON: englishJSON,inputLanguage: "English",outputLanguage: "French",...
});console.log(frenchTranslation);
{"welcomeMessage": "Bienvenue, {{name}} !","messages": {"notifications_one": "Vous avez une notification","notifications_other": "Vous avez {{count}} notifications","delete": "Voulez-vous supprimer la catégorie ? {{name}} ? ?"}
}

Script??腳本

Use?i18n-ai-translate translate?to convert a local i18n JSON file to any language. Relative paths begin from the?jsons/?directory.
使用?i18n-ai-translate translate 將本地 i18n JSON 文件轉換為任何語言。相對路徑從?jsons/?目錄開始。

Use?i18n-ai-translate diff?to find the differences between two versions of a source language file, and apply them to all language files in the same directory.
使用?i18n-ai-translate diff?查找源語言文件的兩個版本之間的差異,并將它們應用于同一目錄中的所有語言文件。

Create a?.env?file with an entry for your API key, or pass the?--api-key?flag.
創建一個包含 API 密鑰條目的?.env?文件,或傳遞?--api-key?標志。

  • GEMINI_API_KEY=<your Gemini API key>
  • OPENAI_API_KEY=<your OpenAI API key>
  • ANTHROPIC_API_KEY=<your Anthropic API key>

For Ollama, create an entry for your host, use the?--host?flag to set a custom host and path (Defaults to?localhost:11434).
對于 Ollama,為您的主機創建一個條目,使用?--host?標志設置自定義主機和路徑(默認為?localhost:11434)。

  • OLLAMA_HOSTNAME=<the server and port number running Ollama>
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>Usage: i18n-ai-translate [options] [command]Use ChatGPT or Gemini to translate your i18n JSON to any languageOptions:-V, --version        output the version number-h, --help           display help for commandCommands:translate [options]diff [options]help [command]       display help for command
</code></span></span></span></span>
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>Usage: i18n-ai-translate translate [options]Options:-i, --input <input>                         Source i18n file or path of source language, in the jsons/ directory if a relative path is given-o, --output-languages [language codes...]  A list of languages to translate to-e, --engine <engine>                       Engine to use (chatgpt, gemini, ollama, or claude)-m, --model <model>                         Model to use (e.g. gpt-4o, gemini-2.0-flash-exp, llama3.3, claude-3-5-sonnet-latest)-r, --rate-limit-ms <rateLimitMs>           How many milliseconds between requests (defaults to 1s for Gemini, 120ms (at 500RPM) for ChatGPT, 1200msfor Claude)-f, --force-language-name <language name>   Force output language name-A, --all-languages                         Translate to all supported languages-p, --templated-string-prefix <prefix>      Prefix for templated strings (default: "{{")-s, --templated-string-suffix <suffix>      Suffix for templated strings (default: "}}")-k, --api-key <API key>                     API key-h, --host <hostIP:port>                    The host and port number serving Ollama. 11434 is the default port number.--ensure-changed-translation                Each generated translation key must differ from the input (for keys longer than 4) (default: false)-n, --batch-size <batchSize>                How many keys to process at a time (default: "32")--skip-translation-verification             Skip validating the resulting translation through another query (default: false)--skip-styling-verification                 Skip validating the resulting translation's formatting through another query (default: false)--override-prompt <path to JSON file>       Use the prompts from the given JSON file, containing keys for at least one of generationPrompt,translationVerificationPrompt, stylingVerificationPrompt--prompt-mode <prompt-mode>                 Chose between 'csv' mode for better performance and 'json' mode for better compatibility,--batch-max-tokens <batch-max-tokens>       For json mode only, maximum size of a single request in tokens--verbose                                   Print logs about progress (default: false)--help                                      display help for command
</code></span></span></span></span>
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>Usage: i18n-ai-translate diff [options]Options:-b, --before <fileOrDirectoryBefore>      Source i18n file or directory before changes, in the jsons/ directory if a relative path is given-a, --after <fileOrDirectoryAfter>        Source i18n file or directory after changes, in the jsons/ directory if a relative path is given-l, --input-language <inputLanguageCode>  The input language's code, in ISO6391 (e.g. en, fr)-e, --engine <engine>                     Engine to use (chatgpt, gemini, ollama, or claude)-m, --model <model>                       Model to use (e.g. gpt-4o, gemini-2.0-flash-exp, llama3.3, claude-3-5-sonnet-latest)-r, --rate-limit-ms <rateLimitMs>         How many milliseconds between requests (defaults to 1s for Gemini, 120ms (at 500RPM) for ChatGPT, 1200ms forClaude)-k, --api-key <API key>                   API key-h, --host <hostIP:port>                  The host and port number serving Ollama. 11434 is the default port number.--ensure-changed-translation              Each generated translation key must differ from the input (for keys longer than 4) (default: false)-p, --templated-string-prefix <prefix>    Prefix for templated strings (default: "{{")-s, --templated-string-suffix <suffix>    Suffix for templated strings (default: "}}")-n, --batch-size <batchSize>              How many keys to process at a time (default: "32")--skip-translation-verification           Skip validating the resulting translation through another query (default: false)--skip-styling-verification               Skip validating the resulting translation's formatting through another query (default: false)--override-prompt <path to JSON file>     Use the prompts from the given JSON file, containing keys for at least one of generationPrompt,translationVerificationPrompt, stylingVerificationPrompt--prompt-mode <prompt-mode>               Chose between 'csv' mode for better performance and 'json' mode for better compatibility,--batch-max-tokens <batch-max-tokens>     For json mode only, maximum size of a single request in tokens--verbose                                 Print logs about progress (default: false)--help                                    display help for command
</code></span></span></span></span>

Example usage??用法示例

npx i18n-ai-translate translate -i en.json -o fr

  • Translate the?en.json?file in?jsons/?to French, and save the output in?fr.json
    將?jsons/?中的?en.json?文件翻譯成法語,并將輸出保存在?fr.json?中

npx i18n-ai-translate translate -i en.json -o es de nl --engine gemini

  • Translate the?en.json?file in?jsons/?to Spanish, German, and Dutch, and save each file in?jsons/, using Google Gemini
    使用 Google Gemini 將?jsons/?中的?en.json?文件翻譯成西班牙語、德語和荷蘭語,并將每個文件保存在?jsons/?中

npx i18n-ai-translate diff -b en.json -a en-after.json -l English --verbose --engine ollama --host my-olllama-server.com:12345

  • Translate the keys that have changed between?en.json?and?en-after.json?for all files in the?en.json?directory, with logging enabled using Ollama running on?my-ollama-server.com:12345
    轉換?en.json?目錄中所有文件的?en.json?和?en-after.json?之間更改的鍵,并使用在?my-ollama-server.com:12345?上運行的 Ollama 啟用日志記錄

npx i18n-ai-translate translate -i en.json -A --engine chatgpt --model gpt-4-turbo --api-key <my_key> --rate-limit-ms 150 -n 64

  • Translate the?en.json?file in?jsons/?to 200+ languages, save each file in?jsons/, using the GPT-4 Turbo model of ChatGPT, with the given key, a rate limit of 150ms between requests, and 64 keys sent in each batch
    將?jsons/?的?en.json?文件翻譯成 200+ 種語言,使用 ChatGPT 的 GPT-4?Turbo 模型,使用給定的 key,請求之間的限速為 150ms,每批發送 64 個 key

npx i18n-ai-translate diff -b en -a en-after --engine claude

  • Translate the keys that have changed between?en/?and?en-after/?for all JSON files in both directories using Claude
    使用 Claude 翻譯兩個目錄中所有 JSON 文件的?en/?和?en-after/?之間更改的鍵

五、As a library??作為庫

或者,導入此項目并使用它通過?translate()?即時轉換 JSON,或者在源 i18n 文件發生更改時使用?translateDiff()?獲取已修改鍵的更新。

import { translate, translateDiff } from "i18n-ai-translate";...const translation = await translate({apiKey, // OpenAI/Gemini/Anthropic API keybatchMaxTokens, // Maximum amount of tokens for one requestbatchSize, // How many keys to process at a timechatParams, // Additional configuration to pass to the modelengine, // ChatGPT, Gemini, Ollama, or ClaudeensureChangedTranslation, // Every key longer than 4 characters must be different than the inputhost, // The host and port number running OllamainputJSON, // JSON to translateinputLanguage, // Language of inputJSONmodel, // Model to use (e.g. gpt-4o, gemini-2.0-flash-exp, llama3.3, claude-3-5-sonnet-latest)outputLanguage, // Targeted language (e.g. French, Spanish, etc.)overridePrompt, // Set custom prompts for generation or verificationpromptMode, // Chose between 'csv' mode and 'json' moderateLimitMs, // How many milliseconds between requestsskipStylingVerification, // Whether to skip an additional query to see whether the text formatting remained consistentskipTranslationVerification, // Whether to skip an additional query to see whether the resultant translation makes sensetemplatedStringPrefix, // The start of inline variables; defaults to "{{"templatedStringSuffix, // The end of inline variables; defaults to "}}"verbose, // Print status of conversion to stdout/stderr});const translations = await translateDiff({apiKey, // OpenAI/Gemini/Anthropic API keybatchMaxTokens, // Maximum amount of tokens for one requestbatchSize, // How many keys to process at a timechatParams, // Additional configuration to pass to the modelengine, // ChatGPT, Gemini, Ollama, or ClaudeensureChangedTranslation, // Every key longer than 4 characters must be different than the inputhost, // The host and port number running OllamainputJSONAfter, // The source translation after a changeinputJSONBefore, // The source translation before a changeinputLanguage, // Language of inputJSONBefore/Aftermodel, // Model to use (e.g. gpt-4o, gemini-2.0-flash-exp, llama3.3, claude-3-5-sonnet-latest)overridePrompt, // Set custom prompts for generation or verificationpromptMode, // Chose between 'csv' mode and 'json' moderateLimitMs, // How many milliseconds between requestsskipStylingVerification, // Whether to skip an additional query to see whether the text formatting remained consistentskipTranslationVerification, // Whether to skip an additional query to see whether the resultant translation makes sensetemplatedStringPrefix, // The start of inline variables; defaults to "{{"templatedStringSuffix, // The end of inline variables; defaults to "}}"toUpdateJSONs, // An object of language codes to their translationsverbose, // Print status of conversion to stdout/stderr
});

六、CSV Mode??CSV 模式

Translation prompt??翻譯提示

Batches of the i18n input are passed in. Each call is checked to ensure no keys are lost, all templated strings are retained, and no translations were skipped.
傳入 i18n 輸入的批次。檢查每個調用以確保沒有鍵丟失,所有模板化字符串都被保留,并且沒有跳過任何翻譯。

<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>You are a professional translator.Translate each line from ${inputLanguage} to ${outputLanguage}.Return translations in the same text formatting.Maintain case sensitivity and whitespacing.Output only the translations.All lines should start and end with an ASCII quotation mark (").${input}
</code></span></span></span></span>

Translation verification prompt
翻譯驗證提示

The output of the translation is sent back to ensure the model is okay with the translation. If this fails, the translation is re-generated.
將翻譯的輸出發回以確保模型對翻譯沒有問題。如果失敗,則會重新生成轉換。

<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>Given a translation from ${inputLanguage} to ${outputLanguage} in CSV form, reply with NAK if _any_ of the translations are poorly translated.Otherwise, reply with ACK.Only reply with ACK/NAK.
</code></span></span></span></span>

Styling verification prompt
樣式驗證提示

Formatting from the input should be retained where possible. If punctuation, capitalization, or whitespaces differ between the source and the translation, the translation is re-generated.
應盡可能保留輸入中的格式。如果源和翻譯之間的標點符號、大小寫或空格不同,則會重新生成翻譯。

<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>Given text from ${inputLanguage} to ${outputLanguage} in CSV form, reply with NAK if _any_ of the translations do not match the formatting of the original.Check for differing capitalization, punctuation, or whitespaces.Otherwise, reply with ACK.Only reply with ACK/NAK.
</code></span></span></span></span>

JSON Mode??JSON 模式

Translation prompt json??翻譯提示 json

Batches of the i18n input are passed in. Each call is checked to ensure no keys are lost, all templated strings are retained, and no translations are skipped.
傳入 i18n 輸入的批次。檢查每個調用以確保沒有鍵丟失,保留所有模板化字符串,并且不會跳過任何翻譯。

<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>You are a professional translator.Translate from ${inputLanguage} to ${outputLanguage}.- Translate each object in the array.
- 'original' is the text to be translated.
- 'translated' must not be empty.
- 'context' is additional info if needed.
- 'failure' explains why the previous translation failed.
- Preserve text formatting, case sensitivity, and whitespace.Special Instructions:
- Treat anything in the format {{variableName}} as a placeholder. Never translate or modify its content.
- Do not add your own variables
- The number of variables like {{timeLeft}} must be the same in the translated text.
- Do not convert {{NEWLINE}} to \\n.Return the translation as JSON.
\`\`\`json
${input}
\`\`\`
</code></span></span></span></span>

Translation verification prompt json
翻譯驗證提示 json

The output of the translation is sent back to ensure the model is okay with the translation/formatting. If this fails, the translation is re-generated.
將翻譯的輸出發回,以確保模型對翻譯/格式設置沒有問題。如果失敗,則會重新生成轉換。

<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>You are a professional translator.Check translations from ${inputLanguage} to ${outputLanguage}.- Verify each object in the array.
- 'original' is the text to be translated.
- 'translated' is the translated text.
- 'context' is additional info if needed.
- 'failure' explains why the previous translation failed.
- check for Accuracy (meaning, tone, grammar), Formatting (case, whitespace, punctuation).If correct, return 'valid' as 'true' and leave 'fixedTranslation' and 'issue' empty.
If incorrect, return 'valid' as 'false' and put the fixed translation in 'fixedTranslation' and explain what is 'issue'.Special Instructions:
- Treat anything in the format {{variableName}} as a placeholder. Never translate or modify its content.
- Do not add your own variables
- The number of variables like {{timeLeft}} must be the same in the translated text.
- Do not convert {{NEWLINE}} to \\n.Allow minor grammar, phrasing, and formatting differences if meaning is clear.
Flag only significant issues affecting accuracy or readability.Return the verified as JSON.
\`\`\`json
${input}
\`\`\`
</code></span></span></span></span>

Prompt overriding??提示覆蓋

Replace the aforementioned prompts with your own by creating a JSON file containing keys of at least one of?generationPrompt,?translationVerificationPrompt, or?stylingVerificationPrompt. Then, pass it as an argument with?--override-prompt <path to file>. Be sure to include templated arguments like?${inputLanguage}?as part of the prompt.
通過創建一個 JSON 文件,將上述提示替換為您自己的提示,該文件至少包含?generationPrompttranslationVerificationPrompt?或?stylingVerificationPrompt?中的至少一個鍵。然后,將其作為參數傳遞。?--override-prompt <path to file>?請務必在提示符中包含模板化參數,例如?${inputLanguage}

軟件下載

夸克網盤分享

本文信息來源于GitHub作者地址:https://github.com/taahamahdi/i18n-ai-translate

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/pingmian/78515.shtml
繁體地址,請注明出處:http://hk.pswp.cn/pingmian/78515.shtml
英文地址,請注明出處:http://en.pswp.cn/pingmian/78515.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Flask + ajax上傳文件(一)--單文件上傳

一、概述 本教程將教你如何使用Flask后端和AJAX前端實現文件上傳功能,包含完整的代碼實現和詳細解釋。 二、環境準備 1. 所需工具和庫 Python 3.xFlask框架jQuery庫Bootstrap(可選,用于美化界面)2. 安裝Flask pip install flask三、項目結構 upload_project/ ├── a…

如何在 Postman 中,自動獲取 Token 并將其賦值到環境變量

在 Postman 中&#xff0c;你可以通過 預請求腳本&#xff08;Pre-request Script&#xff09; 和 測試腳本&#xff08;Tests&#xff09; 實現自動獲取 Token 并將其賦值到環境變量&#xff0c;下面是完整的操作步驟&#xff1a; ? 一、創建獲取 Token 的請求 通常這個請求…

北斗導航 | 基于Transformer+LSTM+激光雷達的接收機自主完好性監測算法研究

基于Transformer+LSTM+激光雷達的接收機自主完好性監測算法研究 接收機自主完好性監測(RAIM)是保障全球導航衛星系統(GNSS)定位可靠性的核心技術。傳統RAIM算法依賴最小二乘殘差法,存在故障漏檢、對復雜環境適應性差等問題。結合Transformer、LSTM與激光雷達的多模態融合…

基于Python爬蟲的豆瓣電影信息爬取(可以根據選擇電影編號得到需要的電影信息)

# 豆瓣電影信息爬蟲(展示效果如下圖所示:) 這是一個功能強大的豆瓣電影信息爬蟲程序,可以獲取豆瓣電影 Top 250 的詳細信息。 ## 功能特點 - 自動爬取豆瓣電影 Top 250 的所有電影信息 - 支持分頁獲取,每頁 25 部電影,共 10 頁 - 獲取每部電影的詳細信息,包括: - 標題…

Ubuntu22.04/24.04 P104-100 安裝驅動和 CUDA Toolkit

硬件環境 使用一塊技嘉 B85m-DS3H 安裝 P104-100, CPU是帶集成顯卡的i5-4690. 先在BIOS中設置好顯示設備優先使用集成顯卡(IGX). 然后安裝P104-100開機. 登入Ubuntu 后查看硬件信息, 檢查P104-100是否已經被檢測到 # PCI設備 lspci -v | grep -i nvidia lspci | grep NVIDIA …

東南亞與中東小游戲市場出海調研報告

東南亞與中東小游戲市場出海調研報告 目標市場篩選與概況 (The Gaming Market in Southeast Asia (SEA) | Allcorrect)圖:2018–2027年東南亞主要國家游戲市場收入(億美元)趨勢。到2024年東南亞游戲市場規模預計將接近300億美元 (2024年東南亞手游市場怎么樣? - 快出海問…

力扣4-最長公共前綴

一.題目 編寫一個函數來查找字符串數組中的最長公共前綴。 如果不存在公共前綴&#xff0c;返回空字符串 ""。 示例 1&#xff1a; 輸入&#xff1a;strs ["flower","flow","flight"] 輸出&#xff1a;"fl"示例 2&…

設計模式和單一原則筆記

單一原則&#xff1a;方法 對象 策略模式&#xff1a;方法實現 // 策略接口&#xff08;單一職責&#xff1a;定義計算規范&#xff09; public interface PriceStrategy {boolean match(String type); // 職責1&#xff1a;判斷是否適用該策略double calculate(double pric…

常見正則表達式整理與Java使用正則表達式的例子

一、常見正則表達式整理 1. 基礎驗證類 郵箱地址 ^[a-zA-Z0-9._%-][a-zA-Z0-9.-]\\.[a-zA-Z]{2,}$ &#xff08;匹配如 userexample.com&#xff09;手機號 ^1[3-9]\\\\d{9}$ &#xff08;匹配國內11位手機號&#xff0c;如 13812345678&#xff09;中文字符 ^[\u4e00-\u9fa5…

vue2 項目的 vscode 插件整理

Folder Selector 當項目文件很多時&#xff0c;查找一個文件&#xff0c;可能需要在資源管理器中不斷的滾動再打開文件夾查找文件&#xff0c;很麻煩&#xff0c;這個可以增加一個面板通過右鍵文件夾選擇 然后在面板中查看文件 Reveal Button 文件中跳轉到另一個文件時&#…

使用 Node、Express 和 MongoDB 構建一個項目工程

本文將詳細介紹如何使用 Node.js Express MongoDB 構建一個完整的 RESTful API 后端項目&#xff0c;涵蓋&#xff1a; 項目初始化 Express 服務器搭建 MongoDB 數據庫連接 REST API 設計&#xff08;CRUD 操作&#xff09; 錯誤處理與中間件 源碼結構與完整代碼 部署建…

如何實現Spring Boot應用程序的安全性:全面指南

在現代 Web 開發中&#xff0c;安全性是 Spring Boot 應用程序的核心需求&#xff0c;尤其是在微服務、云原生和公開 API 場景中。Spring Boot 結合 Spring Security 提供了一套強大的工具&#xff0c;用于保護應用程序免受常見威脅&#xff0c;如未經授權的訪問、數據泄露、跨…

無人機避障——Mid360+Fast-lio感知建圖+Ego-planner運動規劃(胎教級教程)

電腦配置:Xavier-nx、ubuntu 18.04、ros melodic 激光雷達:Livox_Mid-360 結果展示:左邊Mid360+Fast-lio感知建圖,右邊Ego-planner運動規劃 1、讀取雷達數據并顯示 無人機避障——感知篇(采用Livox-Mid360激光雷達獲取點云數據顯示)-CSDN博客 看看雷達數據話題imu以及…

數據庫證書可以選OCP認證嗎?

直接回答&#xff1a;國內OCP認證持有者的年薪普遍在15萬到40萬元之間&#xff0c;具體收入與經驗、地區和行業強相關。OCP認證能大幅提升求職競爭力&#xff0c;但薪資天花板仍由個人能力決定。 一、薪資范圍和核心影響因素 OCP認證是Oracle數據庫領域的中高級“技術通行證”…

MySQL 從入門到精通:第二篇 - 數據類型、約束與索引

1. MySQL數據類型詳解 數值類型 整數類型 -- 常用整數類型及范圍 CREATE TABLE integer_types (tiny_col TINYINT, -- 1字節,有符號(-128~127),無符號(0~255)small_col SMALLINT, -- 2字節,有符號(-32768~32767),無符號(0~65535)medium_col MEDIUMINT,

Arduino 入門學習筆記(二):開發環境搭建

Arduino 入門學習筆記&#xff08;二&#xff09;&#xff1a;開發環境搭建 B站學習鏈接&#xff1a;link 1. Arduino IDE2軟件介紹 Arduino IDE&#xff0c;Arduino Integrated Development Environment&#xff0c;即Arduino集成開發環境。 Arduino IDE具有程序編輯、調試…

ChatGPT、deepseek、豆包、Kimi、通義千問、騰訊元寶、文心一言、智譜清言代碼能力對比

均使用測試時的最強模型 均是一次對話,對話內容一樣 均開啟深度思考 能聯網的都聯網了&#xff0c;但是作用不大&#xff0c;因為藍橋杯剛考完&#xff0c;洛谷題目剛上傳沒多久 問題一測試了兩遍 從問題三開始不再測試智譜清言&#xff08;它思考時間太長了&#xff0c;前兩個…

OCR之身份證識別

前言 OCR身份證識別是光學字符識別技術在身份證領域的應用。通過掃描或拍照獲取身份證圖像&#xff0c;利用圖像處理、深度學習等技術&#xff0c;自動提取姓名、性別、民族、出生日期、地址、身份證號等信息&#xff0c;可大幅提升信息錄入效率&#xff0c;廣泛應用于政務、金…

線性代數—向量與矩陣的范數(Norm)

參考鏈接&#xff1a; 范數&#xff08;Norm&#xff09;——定義、原理、分類、作用與應用 - 知乎 帶你秒懂向量與矩陣的范數(Norm)_矩陣norm-CSDN博客 什么是范數&#xff08;norm&#xff09;&#xff1f;以及L1,L2范數的簡單介紹_l1 norm-CSDN博客 范數&#xff08;Norm…

Java高頻面試之并發編程-08

hello啊&#xff0c;各位觀眾姥爺們&#xff01;&#xff01;&#xff01;本baby今天來報道了&#xff01;哈哈哈哈哈嗝&#x1f436; 面試官&#xff1a;說說sleep和wait的區別&#xff1f; 1. 核心區別總結 特性sleep()wait()所屬類Thread 類的靜態方法Object 類的實例方法…