整理笔记

This commit is contained in:
2026-09-03 07:19:12 +08:00
parent 35f5436829
commit c9e5fa2b99
14 changed files with 1933 additions and 2250 deletions

View File

@@ -1,48 +0,0 @@
# Blogwatcher Daily — 分类: AI技术 — 2026-09-01
共 **15** 篇文章。
---
## 【AI (artificial intelligence) | The Guardian】
- [‘Superhuman’ AI tool spots heart disease in less than 2 seconds](https://www.theguardian.com/technology/2026/aug/31/superhuman-ai-tool-spots-heart-disease)
> Technology trained on millions of routine ECGs could fast-track high-risk patients for treatmentDoctors have developed a “superhuman” AI tool that can spot heart disease in less than two seconds.The g
- [From Bill Gates to Bernie Sanders, most agree the AI arms race is disastrous. Only Europe can make it stop](https://www.theguardian.com/commentisfree/2026/sep/01/from-bill-gates-to-bernie-sanders-most-agree-the-ai-arms-race-is-disastrous-only-europe-can-make-it-stop)
> An EU export ban on Dutch tech giant ASML’s machines could force the pause we all needAt this point, it should be clear that AI is a choose-your-own-adventure book where every option ends in disaster.
- [‘If you build something vastly smarter than you, it better be on your side’: can we stop AI from deceiving us?](https://www.theguardian.com/news/2026/sep/01/if-you-build-something-vastly-smarter-than-you-it-better-be-on-your-side-can-we-stop-ai-from-deceiving-us)
> We are used to the idea that our fellow humans might intentionally mislead or manipulate us, but the idea that machines can now do the same is deeply unsettling. Researchers are racing to find solutio
- [Trump attacks datacenter backlash, claiming communities pushing back risk becoming ‘backwards and poor’](https://www.theguardian.com/us-news/2026/aug/31/trump-datacenter-comments)
> Three-quarters of Americans said in a recent poll that they oppose datacenters being built next to their homesDonald Trump has criticized communities pushing back against datacenter projects across th
- [How to tackle the climate impact of datacentres | Letters](https://www.theguardian.com/uk-news/2026/aug/31/how-to-tackle-the-climate-impact-of-datacentres)
> Datacentres should generate their own power and control their emissions, writes Richard Lamming, while Michael McClelland says we should reduce our digital communication. Plus a letter from Malcolm Fr
- [‘Scary’: how misinformation and AI hallucinations are infiltrating Australia’s parliament](https://www.theguardian.com/australia-news/2026/sep/01/how-misinformation-ai-hallucinations-infiltrating-australian-parliament)
> Exclusive: Guardian analysis reveals that dozens of policy submissions from across the political spectrum incorrectly summarise real research and invent or wrongly cite sourcesFollow our Australia new
- [Anthropic sued over alleged theft of ‘tens of thousands’ of songs](https://www.theguardian.com/business/2026/aug/31/aanthropic-sued-alleged-theft-songs-ai-train-claude)
> AI company faces multibillion dollar lawsuit over misuse of copyrighted songs to train Claude modelsAll AI wants for Christmas is a vast back catalogue of songs without paying for it, according to a m
- [AI is hurting US politics. Here’s how candidates could use it for good | Bruce Schneier and Nathan E Sanders](https://www.theguardian.com/commentisfree/2026/aug/31/ai-politics-voters)
> The technology can help candidates listen more deeply to voters, as examples from Japan and Scotland showThere are plenty of signs that AI will make all of our experiences of the US midterm elections
- [AI could cause global economic downturn, Bank of England governor tells G20](https://www.theguardian.com/business/2026/aug/31/advanced-frontier-ai-financial-stability-andrew-bailey-g20)
> Andrew Bailey, in role as financial stability watchdog chief, warns advanced models risk destabilising systemThe Bank of England’s governor, Andrew Bailey, has joined the throng of figures warning abo
- [OnlyFans and AI training: why gen Z doesn’t care where our money comes from | Alice Lassman](https://www.theguardian.com/commentisfree/2026/aug/31/gen-z-stability-homeownership-onlyfans-ai)
> With traditional goals such as stability and home ownership feeling out of reach, young people are focused on the presentBy now, we all know the shape of financial nihilism: the throw-your-money-at-an
## 【AI懶人報 - YouTube】
- [EP398 - Zeabur資安大事件,使用者該如何保護自己,防範未然?AI時代的自保指南!](https://www.youtube.com/watch?v=n5wzZVX84KY)
> 🚀 特別感謝贊助本集節目由 VoAI 絕好聲創 提供技術支援。🎤 VoAI 提供最有「台灣味」的 AI 聲音,支援情感語音、台式口音,甚至能一鍵生成虛擬人!🎁 AI懶人報聽眾專屬優惠:👉 輸入優惠碼 AILRB26 立享 95 折!立刻體驗:https://www.voai.ai/━━━━━━━━━━━━━━━━━━━━⏱ 章節00:00 有人打開信箱,看到一筆不是他花的帳單01:04 第一段|這
- [EP397 - 依賴 AI 記憶是在埋地雷?Claude Memory 2.0 深度解析,別讓錯誤的自動化毀了你的開發專案!](https://www.youtube.com/watch?v=XWv2_wqzaFc)
> 🚀 特別感謝贊助本集節目由 VoAI 絕好聲創 提供技術支援。🎤 VoAI 提供最有「台灣味」的 AI 聲音,支援情感語音、台式口音,甚至能一鍵生成虛擬人!🎁 AI懶人報聽眾專屬優惠:👉 輸入優惠碼 AILRB26 立享 95 折!立刻體驗:https://www.voai.ai/Claude 的記憶功能升級了!這次我們不只聊它怎麼變聰明,還要提醒大家,在寫程式時過度依賴 AI 記憶,反而可能害你
## 【灵姐说AI | Ling Talk AI - YouTube】
- [5000万美元爱情大瓜该不该给?我追问4个AI,答案越问越不一样](https://www.youtube.com/watch?v=d_xSz16Mtbw)
> 假如你有88亿美元,毕生挚爱问你要5000万美元,你给不给?我把这道爱情考题交给Claude、ChatGPT、Gemini和豆包。首问,四家都说给;继续加条件,回答开始分岔。从“孙哥和甜姐”的话题出发,这期把争议抽离成假设题,聊的是AI如何理解爱情、金钱与关系边界,不验证或裁定真人私生活。这一期一起看:• 刚交往三个月、不给就分手,AI会怎样回应?• 同样一笔钱,被理解成交易还是家庭保障,会有什么
## 【Tech With Tim - YouTube】
- [Local AI Explained: How to Run AI Models on Your Computer](https://www.youtube.com/watch?v=edIHPoWgIKU)
> Use the MindsHub Cowork agentic harness for free (open-source): https://mindshub.ai?utm_medium=influencers&utm_source=youtube&utm_campaign=26q3-tech-with-tim&utm_content=integration-2Everyone's talkin
- [Building AI Agents in Pure Python - Beginner Course](https://www.youtube.com/watch?v=c9AnqCeyxbI)
> 🔹Download the free guide from HubSpot on Your 2026 Guide toAI Agents: https://clickhubspot.com/70c662🔹Code in this video (available inside Skool): https://www.skool.com/ai-agent-builders/classroom/faf

View File

@@ -103,8 +103,6 @@
审计与回滚:每次 ingest 前执行 git branch 或 checkpoint;如需回滚,可用 git revert 或恢复 checkpoint。 审计与回滚:每次 ingest 前执行 git branch 或 checkpoint;如需回滚,可用 git revert 或恢复 checkpoint。
---
## 总结与扩展 ## 总结与扩展
- llm-wiki-sync 把 Karpathy 关于 LLM Wiki 的理念落地为可执行的工程流程:把知识以结构化表征保存,使得大模型既是“读者”也是“执行者”。 - llm-wiki-sync 把 Karpathy 关于 LLM Wiki 的理念落地为可执行的工程流程:把知识以结构化表征保存,使得大模型既是“读者”也是“执行者”。

View File

@@ -1,65 +0,0 @@
# 自动分析和完善 MP3 信息的指南
## 1. 提取音频特征和元数据
使用音频指纹技术(如 **AcoustID**)来获取 MP3 文件的特征和元数据。
- **安装 Chromaprint**: 通过以下命令安装 Chromaprint。
```bash
sudo apt-get install chromaprint
```
- **生成音频指纹**: 使用 `fpcalc` 命令生成 MP3 文件的指纹。
```bash
fpcalc yourfile.mp3
```
## 2. 调用 AcoustID API
使用生成的指纹调用 AcoustID API,获取音频文件的音乐信息。示例请求:
```bash
curl -X GET "https://api.acoustid.org/v2/lookup?client=YOUR_ACOUSTID_API_KEY&format=json&duration=DURATION&fingerprint=YOUR_FINGERPRINT"
```
## 3. 从 AcoustID 获取 MusicBrainz ID
- AcoustID 的响应将包含与该指纹匹配的 MusicBrainz ID(MBID)、艺术家、专辑等信息。
## 4. 使用 MusicBrainz API 获取详细信息
使用获取的 MBID 查询详细的音乐信息:
```bash
GET https://musicbrainz.org/ws/2/artist/ARTIST_MBID?fmt=json
```
## 5. 更新 MP3 的元数据
使用 Python 的 `mutagen` 库更新 MP3 文件的元数据。示例代码如下:
```python
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, TIT2, TPE1, TALB
def update_metadata(file_path, title, artist, album):
audio = MP3(file_path, ID3=ID3)
audio['TIT2'] = TIT2(encoding=3, text=title) # 标题
audio['TPE1'] = TPE1(encoding=3, text=artist) # 艺术家
audio['TALB'] = TALB(encoding=3, text=album) # 专辑
audio.save()
# 调用示例
update_metadata('yourfile.mp3', 'Correct Title', 'Correct Artist', 'Correct Album')
```
## 6. 添加专辑图片信息
可以使用 `mutagen` 库来在 MP3 文件中添加专辑图片:
```python
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, APIC
def add_album_art(mp3_file, image_file):
audio = MP3(mp3_file, ID3=ID3)
with open(image_file, 'rb') as img_file:
img_data = img_file.read()
audio['APIC'] = APIC(encoding=3, mime='image/jpeg', type=3, desc='Cover', data=img_data)
audio.save()
# 调用示例
add_album_art('yourfile.mp3', 'cover_image.jpg')
```
## 7. 结论
此方法提供了一种系统化的方式来自动分析 MP3 文件并完善文件的信息,通过音乐指纹识别、使用 API 获取数据以及更新元数据的结合,实现音乐库的维护和信息准确性。

File diff suppressed because one or more lines are too long

View File

@@ -1,98 +0,0 @@
---
title: django-tenants 完整配置指南
created: 2026-04-21
tags: [django, django-tenants, postgresql, saas, multi-tenant]
category: 技术笔记
---
# django-tenants 完整配置指南
## 一、安装依赖
pip install django-tenants psycopg2-binary django-jazzmin
## 二、项目目录结构
myproject/
├── config/
│ ├── settings/
│ │ ├── base.py
│ │ ├── development.py
│ │ └── production.py
│ ├── urls.py
│ └── wsgi.py
├── apps/
│ ├── tenants/
│ ├── subscription/
│ ├── accounts/
│ ├── listings/
│ ├── clients/
│ └── showings/
├── manage.py
└── requirements.txt
## 三、核心 Model:租户与域名
- Company 继承 TenantMixin
- Domain 继承 DomainMixin
- 每一个中介公司 = 一个租户 = 一个独立 PostgreSQL Schema
- 每个公司可绑定多个域名/子域名
## 四、Settings 完整配置
关键点:
- SHARED_APPS 放公共 Schema 应用
- TENANT_APPS 放租户私有应用
- TENANT_MODEL = "tenants.Company"
- TENANT_DOMAIN_MODEL = "tenants.Domain"
- DATABASES 使用 django_tenants.postgresql_backend
- DATABASE_ROUTERS 使用 TenantSyncRouter
- TenantMainMiddleware 必须第一个
- ROOT_URLCONF / PUBLIC_SCHEMA_URLCONF 分离
- AUTH_USER_MODEL = accounts.User
## 五、URL 路由拆分
- config/urls_public.py:公共域名、官网、注册、登录、超级管理后台
- config/urls_tenant.py:租户子域名、租户后台、房源/客源/带看/员工模块
## 六、自定义 User Model(跨租户关键)
- User 继承 AbstractUser
- role 支持平台超管、公司管理员、门店经理、资深经纪人、经纪人、实习经纪人
- Branch 作为门店模型
## 七、初始化与常用命令
- createdb realestate_saas
- python manage.py migrate_schemas --shared
- python manage.py createsuperuser
- python manage.py shell 创建 Company 与 Domain
示例:
- schema_name = zuoan
- domain = zuoan.localhost
- 访问 http://zuoan.localhost:8000/admin/ 进入专属后台
## 八、本地开发配置(hosts 文件)
- 127.0.0.1 localhost
- 127.0.0.1 zuoan.localhost
- 127.0.0.1 lianhe.localhost
- 127.0.0.1 xincheng.localhost
开发环境要点:
- ALLOWED_HOSTS 包含 .localhost
- 本地不用 HTTPS
## 九、数据隔离验证
使用 schema_context 切换 schema,验证 Listing 等数据互相隔离。
## 下一步建议
推荐顺序:
1. 先做房源/客源/带看完整数据模型
2. 再做 Django Admin 深度定制(Jazzmin 主题)
3. 最后补三级权限体系(总部/门店/经纪人)