Archive of

网友语录 - 第46期 - 论听力的重要性:婴儿都是先练一年听力,才开口叫妈妈的,是不是这个情况?

这里记录我的一周分享,通常在周六或周日发布。


小青 香油问,看动画片学外语不就没法练口语了吗。我:婴儿都是先练一年听力,才开口叫妈妈的,是不是这个情况?


历史就是一个莫名其妙的人决定了一件莫名其妙的事,然后所有人的命运都改变了。

是啊,

即使这样也还是要认真生活啊!所以才有了那句话,知道生活的真相依然热爱生活,不然呢?没有意义和一片虚无,更需要我们去赋予它意义,不是为了任何人,只是告诉自己,这世界我来过!


自从人类发明了机器,人类就成了机器的奴隶。


王海鹏Seal: 学习能力是唯一的能力。//@lvxinke: @putao_dodo 有兴趣可以看看这本不厚的书,英文叫《the art of learning》.


云五 今天和象友吃饭的主题之一是勇敢做自己、不要总是怕把场面搞僵而不敢表达自己的意见,本宝宝分享了一个小故事,觉得值得在这里也分享一下!

有一份工工到一半时空降了一个PM,特别积极想要建设团队,于是………………在 sprint retro form 里加了一个问题:这个sprint 你有感觉为在这个组工作感到自豪吗😎

本来那个 form 只是填很常规的工作事项,blocker、需要改进的工作流程、对同事的夸夸这些,突然来了这个问题我白眼就翻到头顶了,我就没填(或者填了一个neutral?)于是在 retro 会上这一项就不是100%反馈了或者不是100%自豪😎吧,PM就很贴心地问,这个是谁呀可不可以分享一下原因呀

我:作为一个从民族主义狂热的国家移民来的人,我对这类问题有心理阴影。人当然都愿意热爱自己生活的地方、公司,但是如果一个地方天天追着问我自不自豪,我会觉得这个地方有点问题

PM尬住了说确实没有考虑过这个情况……这个问题只存在了这一次,也没有再出现过其他令人翻白眼的问题;同事也积极来和我一起吐槽这个PM,我收获了一些可以聊闲天的同事;PM和我客套工作往来相安无事。

(本宝宝富有此类不怕把场面搞僵的经验,可以从五岁开始讲起,经验总结就是只要你不怕场面搞僵,怕把场面搞僵的就会换成别人……那些让你感到不舒服的人,一旦你把这个不舒服表达出来了,他们就要自己把场子圆回去,大概率以后都会对你敬而远之) #不是鸡汤是驴杂汤


AI 不会减少你掌握新技能所需要付出的努力,只会让你产生不必学习就已经学会的错觉


宇宙为什么有趣?也许就在于不论你怎么思考,都无法得到答案


世上有很多好用的东西因为只有很少的人知道,从而只有很少的人用。这能怪谁?(这说明酒香也怕巷子深

网友语录 - 第45期 - 不要因为事与愿违而感到惊讶,因为这个宇宙比你大的多

这里记录我的一周分享,通常在周六或周日发布。


世界上最古老的首饰是由挪威卑尔根大学研究者在南非布隆波斯洞穴中发现的一组史前贝壳制品。该首饰由41枚穿有小孔的淡水贝壳组成,经测定为7万5千年前的物品,将人类首饰起源时间提前约3万年


他相信:“自由并不是在一条道路尽头等待我们的花园,自由只能是这条道路本身。言论即是自由。自由不是一个结果,它是动态的存在,是你的抗争本身。”


有人说 “不要因为事与愿违而感到惊讶,因为这个宇宙比你大的多。”

这句话的意思是:不要对现实与期望不符感到意外,因为这个世界并不按照你的意愿运转。

从哲学角度看,它强调了一种谦卑的世界观——你只是宇宙中的一粒沙,世界自有世界的运行法则。因此,当事情不如人意时,接受它、适应它,而不是困惑或怨恨,因为那样不但于事无补,还会把自己的心情弄得更糟


猪小宝 美帝的全国公路至少有两个系统,一个是二战以前的编号,比如着名的贯穿东西的 66 号公路,另一个二战后艾森豪威尔主政时期开始的洲际高速公路系统,沿用至今。这两个系统的线路并不重合,所以造成了很多依托原来公路的繁荣小镇逐渐衰败,因为新的交通动脉洲际公路改线了,不再经过这儿了。

天朝的小六朝古都邺城也是个类似的例子。从曹魏开始,直到高欢高洋的东魏北齐,割据北方东边这一部分的政权全部定都邺城,因为邺城是河北水网的交通总枢纽,而且各个政权不断的加强改善都城周边的水利工程,正向反馈,让邺城的地位更加牢固。两晋南北朝时期多次出镜的战略重地枋头,就是曹操打入方形木桩改造水网形成的重要水运枢纽。

后来因为尉迟迥依托邺城反叛杨坚,隋朝的大运河就没经过邺城,这一下就给邺城判了死刑。邺城也像那些美帝小镇一样,消亡在历史里了,现在都不存在这个地方了。


哲人:就是直面“人生课题”。也就是不回避工作、交友、爱之类的人际关系课题,要积极主动地去面对。如果你认为自己就是世界的中心,那就丝毫不会主动融入共同体中,因为一切他人都是“为我服务的人”,根本没必要由自己采取行动。

但是,无论是你还是我,我们都不是世界的中心,必须用自己的脚主动迈出一步去面对人际关系课题;不是考虑“这个人会给我什么”,而是要必须思考一下“我能给这个人什么”。这就是对共同体的参与和融入


卡妮娅洼

👮‍♀️:你比如说柴静,她就跑国外去了。 我:那她说什么了到底? 👮‍♀️:就是穹顶之下那个,说了很多不恰当的话。 我:那她说的是事实吗

我感觉我今天胆子也是很肥了🥲


天仙子『爱在黎明破晓前』,完全由对话撑起来的一部电影,聊穿整场。剧情是虚构的,爱情是虚构的,但是对话是真的,虽然没有进行过这样漫长的对话,但我能想象出来这样的对话会在不同的场景在不同的刚刚相遇的情侣之间发生很多次。里面有一段拍摄餐厅里不同客人的交谈的片段,看完后觉得,原来谈话是这样无趣的事,哪怕讲话当时在场的人觉得是真诚的,但从更遥远的尺度来看,都只是特定场合下的处于特定心理动机的陈词滥调而已。那么,爱,究竟从何而来、如何发生呢。谈话究竟是调味剂,还是关系本身呢。

这部片最吸引我的倒不是他们讲了什么,因为我脑子比较小,等他们讲完我也基本忘了,但是那种不断地讲话、不断地四处游荡至天亮的行为确实很吸引我。我甚至在看电影的时候就在想象自己也可以这样穿过大街小巷消磨时间至通宵,甚至都不用说跟谁在一起,哪怕只是自己一个人这样做,也会很有意思。日子与日子是相似的,但是可能就在某一天,故事机器启动,我们就走进了世界的另一面。或许爱情之所以吸引人,就在于它能让人摆脱令人厌烦的自我,走进另一个世界。等到某一天,我们意识到所谓另一个世界也是一样的无聊,他人的自我也令人厌烦,或许爱情就不再存在了。

一些别的想法。说起来,这个火车上搭讪的行为还是挺令人震撼的。长的帅确实可以任性一点,但这种搭讪行为是不是有点超规格了。而且女主为什么白的发光,为什么。

https://movie.douban.com/subject/1296339/

(据说这是一部很好的英语教学片,一个豆瓣网友评论道:当年抱着打不开字幕的盗版碟一句一句听写下来台词,一遍一遍读得爱不释手以至烂熟于心,然后我裸考雅思就7分了。。。)


尿能憋没嘛?

小青 Nascondino | Bing Italiano - YouTube这一集讲的是小兔为了在捉迷藏比赛中赢过所有小朋友,憋尿憋到了最后,结果实在忍不住就尿裤子了。哈哈这让我想起昨天学到的战胜拖延小咒语:尿能憋没吗?

如果早晚都得做,早做早舒坦的事情,就立刻去做掉算了。憋越久越难受,迟早还是得做的。为什么我会憋尿呢?有时候是因为怕打断自己专注的心流状态、舒适的睡眠状态,有时候是习得性无助或是木僵状态。憋着尿,心流和睡眠很快还是会被打断的。如果是因为身体惯性,那意识到了,就赶紧去尿,并且在洗手间洗把脸、照照镜子,问问自己正在体会什么情绪,情绪从哪里来的,是否需要休息和帮助。

.NET Deployment Issue: Ghost Dependency

Symptom

  • .NET 8 app with Polly fails on deploy: Could not load file or assembly 'Microsoft.Extensions.Http, Version=9.0.0.0'

Checks

  1. Dependencies

    • No preview packages in .csproj
    • Locked Microsoft.Extensions.Http to 8.0.0
    • Local build clean → Not a package issue
  2. Environment

    • CI/CD fixed to .NET 8 SDK
    • Cleared ~/.dotnet and ~/.nuget
    • Removed caches → Environment clean

Root Cause

  • Deploy script only overwrote files, never cleaned target dir
  • Old HappyNotes.Api.deps.json misled runtime to request v9.0.0.0

Lesson Always wipe target dir before publish:

rm -rf /your/target/directory/*

Desktop Mouse Swipe Delete Troubleshooting

Problem

Mouse left swipe to delete notes was not working on desktop platforms (Windows, macOS, Linux, Web browsers).

Root Cause Analysis

  1. Flutter Dismissible Limitations: Dismissible widget is optimized for touch interactions, not mouse gestures
  2. SelectionArea Gesture Conflict: SelectionArea intercepted mouse drag events for text selection, blocking Dismissible swipe gestures

Solution

Initial Approach (Failed)

Attempted platform-specific custom GestureDetector implementation:

  • Added desktop platform detection logic
  • Implemented custom mouse drag threshold calculations
  • Issue: GestureDetector only detects gestures but provides no visual feedback

Final Solution (Working)

Two-part fix for Dismissible widget:

  1. Immediate Mouse Response
Dismissible(
  dragStartBehavior: DragStartBehavior.down, // Key fix
  // ... other properties
)
  1. Gesture Conflict Resolution
// Before: SelectionArea wrapping entire content
SelectionArea(
  child: GestureDetector(...) // Blocked swipe gestures
)

// After: SelectionArea only around text content
GestureDetector(
  child: Column([
    metadata,
    SelectionArea(child: noteContent), // Limited scope
    footer,
  ])
)

Technical Details

dragStartBehavior Impact

  • DragStartBehavior.start (default): Waits for drag distance threshold
  • DragStartBehavior.down: Starts drag immediately on mouse down
  • Desktop users expect immediate response to mouse actions

SelectionArea Scope Reduction

  • Problem: Full-content SelectionArea captured all mouse events
  • Solution: Limit SelectionArea to text content only
  • Result: Swipe gestures work on margins, text selection works on content

Testing Strategy

Created comprehensive test suite covering:

  • Dismissible configuration validation
  • Platform-specific behavior
  • Gesture conflict scenarios
  • Integration with existing callbacks

Key Learnings

  1. Flutter's Dismissible supports desktop with proper configuration
  2. Widget event hierarchies can cause unexpected gesture conflicts
  3. Scope reduction often beats complex custom implementations
  4. Platform-specific UX requires careful gesture management

Code Impact

  • Files Modified: note_list_item.dart
  • Tests Added: note_list_item_test.dart
  • Lines Changed: 30 additions, 15 deletions
  • Breaking Changes: None

Verification

  • All tests pass
  • Code analysis clean
  • Desktop mouse swipe delete functional
  • Text selection preserved

GitHub CLI Multi-Account Auto-Switcher: Zero-Config Solution

If you juggle work and personal GitHub accounts like I do, constantly checking which account is active before running gh pr create gets old fast. Here's a perfect solution that completely eliminates this friction.

The Problem

Working with multiple GitHub accounts means:

  • Forgetting which account is currently active
  • Getting "No default remote repository" errors
  • Manually running gh auth switch and gh repo set-default
  • Accidentally creating PRs with the wrong account

The Solution

Create a gh wrapper script that automatically detects the current repository's owner, switches to the correct GitHub account, and sets the default repository before executing any command.

Implementation

#!/bin/bash

# Path to original gh binary
ORIGINAL_GH="/usr/local/bin/gh"  # Adjust for your system

# Get current repository's remote URL
remote_url=$(git remote get-url origin 2>/dev/null)

# If not in a git repo, pass through to original gh
if [ $? -ne 0 ]; then
    exec "$ORIGINAL_GH" "$@"
fi

# Extract full repository name (owner/repo) - remove .git suffix
if [[ $remote_url =~ github\.com[:/]([^/]+/[^/]+) ]]; then
    repo_full_name="${BASH_REMATCH[1]}"
    repo_full_name="${repo_full_name%.git}"
    repo_owner=$(echo "$repo_full_name" | cut -d'/' -f1)
else
    exec "$ORIGINAL_GH" "$@"
fi

# Get current active GitHub account
current_user=$("$ORIGINAL_GH" api user --jq '.login' 2>/dev/null)

if [ $? -ne 0 ]; then
    exec "$ORIGINAL_GH" "$@"
fi

# Switch account if needed
if [ "$repo_owner" != "$current_user" ]; then
    echo "→ Repository belongs to $repo_owner, switching from $current_user..." >&2
    "$ORIGINAL_GH" auth switch >/dev/null 2>&1
fi

# Set default repository to avoid "No default remote repository" errors
"$ORIGINAL_GH" repo set-default "$repo_full_name" >/dev/null 2>&1

# Execute original command
exec "$ORIGINAL_GH" "$@"

Setup

  1. Find your original gh path:
which gh
# Use this path in the ORIGINAL_GH variable
  1. Create the wrapper script:
# Save script as ~/.local/bin/gh
chmod +x ~/.local/bin/gh
  1. Adjust PATH priority:
# Add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"
  1. Verify setup:
source ~/.bashrc
which gh  # Should show ~/.local/bin/gh

Usage

All GitHub CLI commands now automatically use the correct account:

# In personal repository
gh pr create  # Uses personal account, sets correct default repo

# In work repository  
gh pr create  # Uses work account, sets correct default repo

# All other commands work transparently
gh issue list
gh pr view
gh repo clone username/repo

Advanced: Working with Forks

For forked repositories where you want to view PRs in the upstream repo:

# View your PRs in the upstream repository
gh pr list --author @me --repo upstream-owner/repo-name

# Or temporarily switch to upstream
gh repo set-default upstream-owner/repo-name
gh pr view [PR_NUMBER]

How It Works

  • Extracts repository owner from the current directory's origin remote URL
  • Compares repository owner with currently active GitHub account
  • Automatically runs gh auth switch if accounts don't match
  • Always sets the correct default repository to prevent CLI errors
  • Transparently proxies all other gh commands

Benefits

  • Zero configuration required - works out of the box
  • Zero habit changes needed - still use gh commands normally
  • Eliminates common errors - no more "No default remote repository" messages
  • Multi-account friction eliminated - never think about which account is active again

Perfect for developers who work across multiple GitHub organizations or maintain both work and personal projects.