Chromium 中chrome.fontSettings扩展接口定义c++
一、chrome.fontSettings
使用 chrome.fontSettings API 管理 Chrome 的字体设置。
权限
fontSettings
要使用 Font Settings API,您必须在扩展程序中声明 "fontSettings" 权限 清单。例如:
{"name": "My Font Settings Extension","description": "Customize your fonts","version": "0.2","permissions": ["fontSettings"],...
}
概念和用法
Chrome 允许某些字体设置取决于特定的常规字体系列和语言 脚本。例如, sans-serif 简体中文使用的字体可能与该字体不同 用于 serif 日语。
Chrome 支持的通用字体系列基于 CSS 通用字体系列, GenericReference下列出。当网页指定了通用字体系列时,Chrome 会选择 根据相应设置调整字体。如果未指定通用字体系列,则 Chrome 会使用 “包量”规则的通用字体系列。
当网页指定了语言时,Chrome 会根据 相应的语言脚本。如果未指定语言,则 Chrome 会使用默认设置 或全局、脚本。
支持的语言脚本由 ISO 15924 脚本代码指定,并列在下方 ScriptCode。从技术上讲,Chrome 设置并不是严格按脚本进行设置,还取决于 语言。例如,当 网页指定了俄语,并且该字体不仅用于西里尔文字, 字体覆盖的所有内容(如拉丁文)。
示例
以下代码可获取阿拉伯语标准字体。
chrome.fontSettings.getFont({ genericFamily: 'standard', script: 'Arab' },function(details) { console.log(details.fontId); }
);
下一个代码段用于设置日语的 sans-serif 字体。
chrome.fontSettings.setFont({ genericFamily: 'sansserif', script: 'Jpan', fontId: 'MS PGothic' }
);
若要试用此 API,请安装 chrome-extension-samples 中的 fontSettings API 示例 存储库
更多参考:chrome.fontSettings | API | Chrome for Developers
二、chrome.fontSettings c++接口定义:
1、font_settings.json 接口描述文件:
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.[{"namespace": "fontSettings","description": "Use the <code>chrome.fontSettings</code> API to manage Chrome's font settings.","types": [{"id": "FontName","type": "object","description": "Represents a font name.","properties": {"fontId": {"type": "string","description": "The font ID."},"displayName": {"type": "string","description": "The display name of the font."}}},{"id": "ScriptCode","type": "string","enum": [ "Afak", "Arab", "Armi", "Armn", "Avst", "Bali", "Bamu", "Bass", "Batk","Beng", "Blis", "Bopo", "Brah", "Brai", "Bugi", "Buhd", "Cakm", "Cans","Cari", "Cham", "Cher", "Cirt", "Copt", "Cprt", "Cyrl", "Cyrs", "Deva","Dsrt", "Dupl", "Egyd", "Egyh", "Egyp", "Elba", "Ethi", "Geor", "Geok","Glag", "Goth", "Gran", "Grek", "Gujr", "Guru", "Hang", "Hani", "Hano","Hans", "Hant", "Hebr", "Hluw", "Hmng", "Hung", "Inds", "Ital", "Java","Jpan", "Jurc", "Kali", "Khar", "Khmr", "Khoj", "Knda", "Kpel", "Kthi","Lana", "Laoo", "Latf", "Latg", "Latn", "Lepc", "Limb", "Lina", "Linb","Lisu", "Loma", "Lyci", "Lydi", "Mand", "Mani", "Maya", "Mend", "Merc","Mero", "Mlym", "Moon", "Mong", "Mroo", "Mtei", "Mymr", "Narb", "Nbat","Nkgb", "Nkoo", "Nshu", "Ogam", "Olck", "Orkh", "Orya", "Osma", "Palm","Perm", "Phag", "Phli", "Phlp", "Phlv", "Phnx", "Plrd", "Prti", "Rjng","Roro", "Runr", "Samr", "Sara", "Sarb", "Saur", "Sgnw", "Shaw", "Shrd","Sind", "Sinh", "Sora", "Sund", "Sylo", "Syrc", "Syre", "Syrj", "Syrn","Tagb", "Takr", "Tale", "Talu", "Taml", "Tang", "Tavt", "Telu", "Teng","Tfng", "Tglg", "Thaa", "Thai", "Tibt", "Tirh", "Ugar", "Vaii", "Visp","Wara", "Wole", "Xpeo", "Xsux", "Yiii", "Zmth", "Zsym", "Zyyy" ],"description": "An ISO 15924 script code. The default, or global, script is represented by script code \"Zyyy\"."},{"id": "GenericFamily","type": "string","enum": ["standard", "sansserif", "serif", "fixed", "cursive", "fantasy", "math"],"description": "A CSS generic font family."},{"id": "LevelOfControl","description": "One of<br><var>not_controllable</var>: cannot be controlled by any extension<br><var>controlled_by_other_extensions</var>: controlled by extensions with higher precedence<br><var>controllable_by_this_extension</var>: can be controlled by this extension<br><var>controlled_by_this_extension</var>: controlled by this extension","type": "string","enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"]}],"functions": [{"name": "clearFont","description": "Clears the font set by this extension, if any.","parameters": [{"name": "details","type": "object","properties": {"script": {"$ref": "ScriptCode","description": "The script for which the font should be cleared. If omitted, the global script font setting is cleared.","optional": true},"genericFamily": {"$ref": "GenericFamily","description": "The generic font family for which the font should be cleared."}}}],"returns_async": {"name": "callback","optional": true,"parameters": []}},{"name": "getFont","description": "Gets the font for a given script and generic font family.","parameters": [{"name": "details","type": "object","properties": {"script": {"$ref": "ScriptCode","description": "The script for which the font should be retrieved. If omitted, the font setting for the global script (script code \"Zyyy\") is retrieved.","optional": true},"genericFamily": {"$ref": "GenericFamily","description": "The generic font family for which the font should be retrieved."}}}],"returns_async": {"name": "callback","optional": true,"parameters": [{"name": "details","type": "object","properties": {"fontId": {"type": "string","description": "The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, <var>fontId</var> can differ from the font passed to <code>setFont</code>, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]}},{"name": "setFont","description": "Sets the font for a given script and generic font family.","parameters": [{"name": "details","type": "object","properties": {"script": {"$ref": "ScriptCode","description": "The script code which the font should be set. If omitted, the font setting for the global script (script code \"Zyyy\") is set.","optional": true},"genericFamily": {"$ref": "GenericFamily","description": "The generic font family for which the font should be set."},"fontId": {"type": "string","description": "The font ID. The empty string means to fallback to the global script font setting."}}}],"returns_async": {"name": "callback","optional": true,"parameters": []}},{"name": "getFontList","description": "Gets a list of fonts on the system.","parameters": [],"returns_async": {"name": "callback","parameters": [{"name": "results","type": "array","items": { "$ref": "FontName" }}]}},{"name": "clearDefaultFontSize","description": "Clears the default font size set by this extension, if any.","parameters": [{"name": "details","type": "object","optional": true,"description": "This parameter is currently unused.","properties": {}}],"returns_async": {"name": "callback","optional": true,"parameters": []}},{"name": "getDefaultFontSize","description": "Gets the default font size.","parameters": [{"name": "details","type": "object","optional": true,"description": "This parameter is currently unused.","properties": {}}],"returns_async": {"name": "callback","optional": true,"parameters": [{"name": "details","type": "object","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]}},{"name": "setDefaultFontSize","description": "Sets the default font size.","parameters": [{"name": "details","type": "object","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."}}}],"returns_async": {"name": "callback","optional": true,"parameters": []}},{"name": "clearDefaultFixedFontSize","description": "Clears the default fixed font size set by this extension, if any.","parameters": [{"name": "details","type": "object","optional": true,"description": "This parameter is currently unused.","properties": {}}],"returns_async": {"name": "callback","optional": true,"parameters": []}},{"name": "getDefaultFixedFontSize","description": "Gets the default size for fixed width fonts.","parameters": [{"name": "details","type": "object","optional": true,"description": "This parameter is currently unused.","properties": {}}],"returns_async": {"name": "callback","optional": true,"parameters": [{"name": "details","type": "object","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]}},{"name": "setDefaultFixedFontSize","description": "Sets the default size for fixed width fonts.","parameters": [{"name": "details","type": "object","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."}}}],"returns_async": {"name": "callback","optional": true,"parameters": []}},{"name": "clearMinimumFontSize","description": "Clears the minimum font size set by this extension, if any.","parameters": [{"name": "details","type": "object","optional": true,"description": "This parameter is currently unused.","properties": {}}],"returns_async": {"name": "callback","optional": true,"parameters": []}},{"name": "getMinimumFontSize","description": "Gets the minimum font size.","parameters": [{"name": "details","type": "object","optional": true,"description": "This parameter is currently unused.","properties": {}}],"returns_async": {"name": "callback","optional": true,"parameters": [{"name": "details","type": "object","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]}},{"name": "setMinimumFontSize","description": "Sets the minimum font size.","parameters": [{"name": "details","type": "object","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."}}}],"returns_async": {"name": "callback","optional": true,"parameters": []}}],"events": [{"name": "onFontChanged","description": "Fired when a font setting changes.","parameters": [{"type": "object","name": "details","properties": {"fontId": {"type": "string","description": "The font ID. See the description in <code>getFont</code>."},"script": {"$ref": "ScriptCode","description": "The script code for which the font setting has changed.","optional": true},"genericFamily": {"$ref": "GenericFamily","description": "The generic font family for which the font setting has changed."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]},{"name": "onDefaultFontSizeChanged","description": "Fired when the default font size setting changes.","parameters": [{"type": "object","name": "details","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]},{"name": "onDefaultFixedFontSizeChanged","description": "Fired when the default fixed font size setting changes.","parameters": [{"type": "object","name": "details","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]},{"name": "onMinimumFontSizeChanged","description": "Fired when the minimum font size setting changes.","parameters": [{"type": "object","name": "details","properties": {"pixelSize": {"type": "integer","description": "The font size in pixels."},"levelOfControl": {"$ref": "LevelOfControl","description": "The level of control this extension has over the setting."}}}]}]}
]
2、font_settings.json生成的c++文件:
out\Debug\gen\chrome\common\extensions\api\font_settings.h
out\Debug\gen\chrome\common\extensions\api\font_settings.cc
3、font_settings api接口定义文件:
chrome\browser\extensions\api\font_settings\font_settings_api.h
chrome\browser\extensions\api\font_settings\font_settings_api.cc
namespace content {
class BrowserContext;
}namespace extensions {class FontSettingsEventRouter;// The profile-keyed service that manages the font_settings extension API.
// This is not an EventRouter::Observer (and does not lazily initialize) because
// doing so caused a regression in perf tests. See crbug.com/163466.
class FontSettingsAPI : public BrowserContextKeyedAPI {public:explicit FontSettingsAPI(content::BrowserContext* context);~FontSettingsAPI() override;// BrowserContextKeyedAPI implementation.static BrowserContextKeyedAPIFactory<FontSettingsAPI>* GetFactoryInstance();private:friend class BrowserContextKeyedAPIFactory<FontSettingsAPI>;// BrowserContextKeyedAPI implementation.static const char* service_name() {return "FontSettingsAPI";}static const bool kServiceIsNULLWhileTesting = true;std::unique_ptr<FontSettingsEventRouter> font_settings_event_router_;
};// fontSettings.clearFont API function.
class FontSettingsClearFontFunction : public ExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.clearFont", FONTSETTINGS_CLEARFONT)protected:// RefCounted types have non-public destructors, as with all extension// functions in this file.~FontSettingsClearFontFunction() override {}// ExtensionFunction:ResponseAction Run() override;
};// fontSettings.getFont API function.
class FontSettingsGetFontFunction : public ExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.getFont", FONTSETTINGS_GETFONT)protected:~FontSettingsGetFontFunction() override {}// ExtensionFunction:ResponseAction Run() override;
};// fontSettings.setFont API function.
class FontSettingsSetFontFunction : public ExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.setFont", FONTSETTINGS_SETFONT)protected:~FontSettingsSetFontFunction() override {}// ExtensionFunction:ResponseAction Run() override;
};// fontSettings.getFontList API function.
class FontSettingsGetFontListFunction : public ExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.getFontList",FONTSETTINGS_GETFONTLIST)protected:~FontSettingsGetFontListFunction() override {}// ExtensionFunction:ResponseAction Run() override;private:void FontListHasLoaded(base::Value::List list);ResponseValue CopyFontsToResult(const base::Value::List& fonts);
};// Base class for extension API functions that clear a browser font pref.
class ClearFontPrefExtensionFunction : public ExtensionFunction {protected:~ClearFontPrefExtensionFunction() override {}// ExtensionFunction:ResponseAction Run() override;// Implementations should return the name of the preference to clear, like// "webkit.webprefs.default_font_size".virtual const char* GetPrefName() = 0;
};// Base class for extension API functions that get a browser font pref.
class GetFontPrefExtensionFunction : public ExtensionFunction {protected:~GetFontPrefExtensionFunction() override {}// ExtensionFunction:ResponseAction Run() override;// Implementations should return the name of the preference to get, like// "webkit.webprefs.default_font_size".virtual const char* GetPrefName() = 0;// Implementations should return the key for the value in the extension API,// like "pixelSize".virtual const char* GetKey() = 0;
};// Base class for extension API functions that set a browser font pref.
class SetFontPrefExtensionFunction : public ExtensionFunction {protected:~SetFontPrefExtensionFunction() override {}// ExtensionFunction:ResponseAction Run() override;// Implementations should return the name of the preference to set, like// "webkit.webprefs.default_font_size".virtual const char* GetPrefName() = 0;// Implementations should return the key for the value in the extension API,// like "pixelSize".virtual const char* GetKey() = 0;
};// The following are get/set/clear API functions that act on a browser font
// pref.class FontSettingsClearDefaultFontSizeFunction: public ClearFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.clearDefaultFontSize",FONTSETTINGS_CLEARDEFAULTFONTSIZE)protected:~FontSettingsClearDefaultFontSizeFunction() override {}// ClearFontPrefExtensionFunction:const char* GetPrefName() override;
};class FontSettingsGetDefaultFontSizeFunction: public GetFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.getDefaultFontSize",FONTSETTINGS_GETDEFAULTFONTSIZE)protected:~FontSettingsGetDefaultFontSizeFunction() override {}// GetFontPrefExtensionFunction:const char* GetPrefName() override;const char* GetKey() override;
};class FontSettingsSetDefaultFontSizeFunction: public SetFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.setDefaultFontSize",FONTSETTINGS_SETDEFAULTFONTSIZE)protected:~FontSettingsSetDefaultFontSizeFunction() override {}// SetFontPrefExtensionFunction:const char* GetPrefName() override;const char* GetKey() override;
};class FontSettingsClearDefaultFixedFontSizeFunction: public ClearFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.clearDefaultFixedFontSize",FONTSETTINGS_CLEARDEFAULTFIXEDFONTSIZE)protected:~FontSettingsClearDefaultFixedFontSizeFunction() override {}// ClearFontPrefExtensionFunction:const char* GetPrefName() override;
};class FontSettingsGetDefaultFixedFontSizeFunction: public GetFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.getDefaultFixedFontSize",FONTSETTINGS_GETDEFAULTFIXEDFONTSIZE)protected:~FontSettingsGetDefaultFixedFontSizeFunction() override {}// GetFontPrefExtensionFunction:const char* GetPrefName() override;const char* GetKey() override;
};class FontSettingsSetDefaultFixedFontSizeFunction: public SetFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.setDefaultFixedFontSize",FONTSETTINGS_SETDEFAULTFIXEDFONTSIZE)protected:~FontSettingsSetDefaultFixedFontSizeFunction() override {}// SetFontPrefExtensionFunction:const char* GetPrefName() override;const char* GetKey() override;
};class FontSettingsClearMinimumFontSizeFunction: public ClearFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.clearMinimumFontSize",FONTSETTINGS_CLEARMINIMUMFONTSIZE)protected:~FontSettingsClearMinimumFontSizeFunction() override {}// ClearFontPrefExtensionFunction:const char* GetPrefName() override;
};class FontSettingsGetMinimumFontSizeFunction: public GetFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.getMinimumFontSize",FONTSETTINGS_GETMINIMUMFONTSIZE)protected:~FontSettingsGetMinimumFontSizeFunction() override {}// GetFontPrefExtensionFunction:const char* GetPrefName() override;const char* GetKey() override;
};class FontSettingsSetMinimumFontSizeFunction: public SetFontPrefExtensionFunction {public:DECLARE_EXTENSION_FUNCTION("fontSettings.setMinimumFontSize",FONTSETTINGS_SETMINIMUMFONTSIZE)protected:~FontSettingsSetMinimumFontSizeFunction() override {}// SetFontPrefExtensionFunction:const char* GetPrefName() override;const char* GetKey() override;
};} // namespace extensions
三、总结:
相关文章:
Chromium 中chrome.fontSettings扩展接口定义c++
一、chrome.fontSettings 使用 chrome.fontSettings API 管理 Chrome 的字体设置。 权限 fontSettings 要使用 Font Settings API,您必须在扩展程序中声明 "fontSettings" 权限 清单。例如: {"name": "My Font Settings E…...
在Unity游戏开发在面试时会面试哪些内容?
1、请描述游戏动画有几种,以及其原理。 关键帧动画:每一帧动画序列当中包含了顶点的空间位置信息以及改变量,然后通过插值运算,得出动画效果。选中某一游戏对象,创建animation,添加属性Transform࿰…...
刘艳兵-DBA022-以下关于Oracle半连接的描述,哪些是正确的?
以下关于Oracle半连接的描述,哪些是正确的? A SQL中的NOT EXISTS子查询,通常会被转换为对应的半连接。 B SQL中的IN子查询,通常会被转换为对应的半连接。 C 半连接会去重 D SQL中的EXISTS子查询,通常会被转…...
人工智能与伦理:我们应该如何平衡科技与人性?
内容概要 在这个瞬息万变的时代,人工智能的迅猛发展让我们面对前所未有的伦理困境。科技进步带来了便利,但同时也亟需我们反思如何对待人性。尤其是在实现算法透明性时,我们要确保每一个决策背后都能被理解与追溯,这不仅是对技术…...
CRON组件一个复杂的一个简单的
CRON组件一个复杂的一个简单的 一个是复杂点的一个是简单点。 1.以简单的为例使用: 父组件 import CronSimple from "/views/xxx/components/cron-simple/index.vue";components: {CronSimple}<el-dialog title"调度CRON"v-if"cronV…...
自定义日志打成jar包引入项目后不生效
背景:写了一个请求响应日志包,打包后在另一个项目使用pom引入后不生效 package com.example.qqllog.aspect;import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean;…...
RK3568平台开发系列讲解(中断篇)延迟工作实验
🚀返回专栏总目录 文章目录 一、什么是延迟工作二、 struct delayed_work三、延迟工作相关接口函数3.1、初始化延迟工作函数3.2、调度/取消调度 延迟工作函数四、驱动程序编写沉淀、分享、成长,让自己和他人都能有所收获!😄 一、什么是延迟工作 延迟工作是一种将工作的执…...
RabbitMQ 的集群
大家好,我是锋哥。今天分享关于【RabbitMQ 的集群】面试题?希望对大家有帮助; RabbitMQ 的集群 RabbitMQ 是一种流行的开源消息代理,广泛用于构建分布式系统中的消息队列。随着应用程序规模的扩大,单一的 RabbitMQ 实…...
整车功能架构 --- 智能座舱
我是穿拖鞋的汉子,魔都中坚持长期主义的汽车电子工程师。 老规矩,分享一段喜欢的文字,避免自己成为高知识低文化的工程师: 所有人的看法和评价都是暂时的,只有自己的经历是伴随一生的,几乎所有的担忧和畏惧…...
java stream流的使用
Java中的Stream API是Java 8引入的一个重要特性,它提供了对集合对象进行各种非常便利、高效的聚合操作(aggregate operation)或大批量数据操作(bulk data operation)。Stream API借助于Lambda表达式,极大地…...
(JVM)带你一起研究JVM的语法糖功能 和 JVM的即时编译器
1. 语法糖 所谓的语法糖,其实就是指java编译器把*.java源码编译为*.class字节码的过程中,自动生成和转换的一些代码,主要是为了减轻程序员的负担,算是java编译器给我们第一个额外福利 以下代码的分析,借助了javap工具…...
【Linux】ClickHouse 部署
搭建Clickhouse集群时,需要使用Zookeeper去实现集群副本之间的同步,所以需要先搭建zookeeper集群 1、卸载 # 检查有哪些clickhouse依赖包: [rootlocalhost ~]# yum list installed | grep clickhouse# 移除依赖包: [rootlocalho…...
js的小知识
以下是一些 JavaScript 的小知识点,适合不同水平的开发者: 1. 变量声明 使用 let、const 和 var 声明变量。let 和 const 块级作用域,而 var 是函数作用域。const 声明的变量不可重新赋值,但对象的属性仍然可以修改。 2. 箭头函…...
一些swift问题
写得比较快,如果有问题请私信。 序列化和反序列化 反序列化的jsonString2只是给定的任意json字符串 private func p_testDecodeTable() {let arr ["recordID123456", "recordID2"]// 序列化[string] -> json datalet jsonData try? JSO…...
Nginx安装配置详解
Nginx Nginx官网 Tengine翻译的Nginx中文文档 轻量级的Web服务器,主要有反向代理、负载均衡的功能。 能够支撑5万的并发量,运行时内存和CPU占用低,配置简单,运行稳定。 写在前 uWSGI与Nginx的关系 1. 安装 Windows 官网 Stabl…...
汽车免拆诊断案例 | 2010款起亚赛拉图车发动机转速表指针不动
故障现象 一辆2010款起亚赛拉图车,搭载G4ED 发动机,累计行驶里程约为17.2万km。车主反映,车辆行驶正常,但组合仪表上的发动机转速表指针始终不动。 故障诊断 接车后进行路试,车速表、燃油存量表及发动机冷却温度…...
在ubuntu上安装最新版的clang
方法一: 执行如下的命令: # 下载安装脚本wget https://apt.llvm.org/llvm.sh chmod x llvm.sh # 开始下载, 输入需要安装的版本号。 sudo ./llvm.sh <version number>方法二 添加软件下载源。 请根据自己的Ubuntu系统版本添加&…...
使用Django REST framework构建RESTful API
使用Django REST framework构建RESTful API Django REST framework简介 安装Django REST framework 创建Django项目 创建Django应用 配置Django项目 创建模型 迁移数据库 创建序列化器 创建视图 配置URL 配置全局URL 配置认证和权限 测试API 使用Postman测试API 分页 过滤和排序…...
「Mac畅玩鸿蒙与硬件14」鸿蒙UI组件篇4 - Toggle 和 Checkbox 组件
在鸿蒙开发中,Toggle 和 Checkbox 是常用的交互组件,分别用于实现开关切换和多项选择。Toggle 提供多种类型以适应不同场景,而 Checkbox 支持自定义样式及事件回调。本篇将详细介绍这两个组件的基本用法,并通过实战展示它们的组合应用。 关键词 Toggle 组件Checkbox 组件开…...
Kotlin协程suspend的理解
suspend修饰符,它可以告诉编译器,该函数需要在协程中执行。作为开发者,您可以把挂起函数看作是普通函数,只不过它可能会在某些时刻挂起和恢复而已。协程的挂起就是退出方法,等到一定条件到来会重新执行这个方法&#x…...
Sora-FullStack全栈开发框架:构建AI视频生成应用的工程实践
1. 项目概述:一个全栈式Sora应用开发框架的诞生最近在AI视频生成领域,Sora的横空出世无疑点燃了无数开发者和创业者的热情。但兴奋过后,一个现实问题摆在眼前:如何将Sora这类前沿模型的能力,真正落地成一个稳定、可用、…...
AI大模型大数据隐私安全解决方案
随着人工智能技术飞速迭代,大模型训练、精调与推理愈发依赖海量数据,云上环境的便捷性也让数据隐私保护面临严峻挑战。AI大模型数据处理全流程包含大量敏感信息,一旦泄露、篡改或滥用,将损害用户权益、引发合规风险与信任危机。因…...
永强数据恢复硬盘设备加密数据专业解锁恢复服务
在当今数字化时代,数据的重要性不言而喻。无论是个人用户存储的珍贵照片、视频,还是企业存储的关键商业数据,一旦丢失,都可能带来巨大的损失。而硬盘设备加密数据的丢失或无法解锁,更是让人头疼不已。北京永强数据恢复…...
终极指南:在Windows上安装安卓应用的简单解决方案
终极指南:在Windows上安装安卓应用的简单解决方案 【免费下载链接】APK-Installer An Android Application Installer for Windows 项目地址: https://gitcode.com/GitHub_Trending/ap/APK-Installer 你是否曾经希望在Windows电脑上直接运行手机应用…...
基于LLM的代码仓库智能分析:RepoMap-AI实现架构可视化与认知图谱
1. 项目概述:当AI成为你的代码库“活地图”最近在折腾一个老旧的Java项目,里面模块套模块,依赖关系复杂得像一团乱麻。想找个特定的工具类,得在十几个包里翻来覆去地搜;想理清某个核心服务的调用链路,光靠I…...
091、力控制:阻抗控制与导纳控制
091 力控制:阻抗控制与导纳控制 从一次机器人撞坏夹具说起 去年调试一台六轴协作机器人,做精密装配。力控参数调了一周,结果在某个姿态下,机器人突然“发疯”,直接把气动夹具怼变形了。事后复盘,发现是阻抗控制里的刚度矩阵设错了——不是数值大小的问题,是坐标系搞反…...
aivectormemory:轻量级向量记忆库,为AI应用开发提供灵活存储方案
1. 项目概述:向量记忆库的“新玩家”最近在折腾AI应用开发,特别是涉及到需要让模型“记住”大量私有知识或者进行复杂对话的场景时,一个绕不开的核心组件就是向量数据库。大家熟知的Pinecone、Weaviate、Milvus这些方案固然强大,但…...
基于httpx的异步HTTP客户端xcapy:提升开发效率与代码健壮性
1. 项目概述:一个为现代网络应用量身定制的HTTP客户端库在开发网络应用时,HTTP客户端是我们与外部世界沟通的桥梁。从调用一个公开的API接口,到抓取网页数据,再到构建微服务间的通信,一个稳定、高效且易于使用的HTTP客…...
硬件入门 + 单片机基础(第14天)综合通信实训
ESP32 物联网结业项目:WiFi MQTT 继电器 温湿度 整合完整版 项目说明 这是物联网综合结业项目,整合了你学过的所有核心技术: WiFi 自动联网 断网重连MQTT 远程控制继电器(开关)DHT11 温湿度自动上报心跳包 消息…...
PostgreSQL 主从流复制完整部署指南:从零搭建到故障切换
文章目录每日一句正能量前言1.环境准备1.1 基础环境要求1.2 安装PostgreSQL2.1 修改PostgreSQL主配置文件2.2 修改客户端认证配置文件2.3 创建复制专用用户2.4 重启主库使配置生效2.5 备份主库数据(供从库初始化)3.从库配置3.1 停止从库PostgreSQL服务并…...
