2025-04-17

43 篇热帖

2. TikTok is harming children at an industrial scale (www.afterbabel.com)

Recently revealed text in legal briefs tells a damning story about the company, in its employees’ own words

3. An intro to DeepSeek's distributed file system (maknee.github.io)

Personal website for some random tidbits I work on

4. Zoom outage caused by accidental 'shutting down' of the zoom.us domain (status.zoom.us)

Zoom's Status Page - Issue with multiple Zoom Services.

6. US Government threatens Harvard with foreign student ban (www.bbc.com)

Homeland Security Secretary Kristi Noem accused the institution of "threatening national security".

7. OpenAI Codex CLI: Lightweight coding agent that runs in your terminal (github.com)

Lightweight coding agent that runs in your terminal - openai/codex

8. Man who built ISP instead of paying Comcast expands to hundreds of homes (2022) (arstechnica.com)

Jared Mauch gets $2.6 million from gov't to expand fiber ISP in rural Michigan.

9. “Most promising signs yet” of alien life on a planet beyond our Solar System (www.skyatnightmagazine.com)

Astronomers find most promising signs yet of biosignature on exoplanet K2-18b, dimethyl sulfide, which could indicate life on its surface.

10. Which year: guess which year each photo was taken (whichyr.com)

Guess the year real-world photos were taken. Test your history knowledge with a daily challenge featuring a new set of photos each day.

11. This 'College Protester' Isn't Real. It's an AI-Powered Undercover Bot for Cops (www.wired.com)

Massive Blue is helping cops deploy AI-powered social media bots to talk to people they suspect are anything from violent sex criminals all the way to vaguely defined “protesters.”

12. Encryption Is Not a Crime (www.privacyguides.org)

Encryption is not a crime, encryption protects us all. Encryption, and especially end-to-end encryption, is an essential tool to protect everyone online. Attempts to undermine encryption are an attack to our fundamental right to privacy and an attack to our inherent right to security and safety.

14. First baby born in UK to woman with transplanted womb (www.bbc.com)

Grace Davidson gave birth to a baby girl two years after her sister's womb was transplanted into her body.

15. Healthy soil is the hidden ingredient (www.nature.com)

Around 60% of the European Union’s soils are considered unhealthy, but geographer Jesús Rodrigo Comino is determined to help change that in his native Spain. Around 60% of the European Union’s soils are considered unhealthy, but geographer Jesús Rodrigo Comino is determined to help change that in his native Spain.

16. Show HN: Plandex v2 – open source AI coding agent for large projects and tasks (github.com)

Open source AI coding agent. Designed for large projects and real world tasks. - plandex-ai/plandex

17. Seth Rogen Speaks Truth to Billionaires, Gets Censored for It (kottke.org)

For the past 11 years, the Breakthrough Prize awards have “celebrated outstanding scientific achievements, honoring scientists driving remarkable discove

18. Everyone knows your location, Part 2: try it yourself and share the results (timsh.org)

Learn how to record and analyse your mobile device traffic, take an app from the list of "shady" apps and share the results.

20. Damn Vulnerable MCP Server (github.com)

Damn Vulnerable MCP Server. Contribute to harishsg993010/damn-vulnerable-MCP-server development by creating an account on GitHub.

22. US judge finds administration wilfully defied court order in deportation flights (www.abc.net.au)

Officials in Donald Trump's administration could face criminal prosecution, a US judge says, because they have shown "wilful disregard" for a bar on deporting alleged gang members to El Salvador.

24. Peru's ancient irrigation systems turned deserts into farms because of culture (theconversation.com)

Ancient practices hold important lessons for farmers facing drying lands, but they were often more complex than modern societies realize. Glacier loss adds to the challenge today.

25. Crows can recognize geometric regularity (phys.org)

A trio of animal physiologists at the University of Tübingen, in Germany, has found that at least one species of crow has the ability to recognize geometric regularity. In their study published in the journal Science Advances, Philipp Schmidbauer, Madita Hahn and Andreas Nieder conducted several experiments that involved testing crows on their ability to recognize geometric shapes.

27. Discord's face scanning age checks 'start of a bigger shift' (www.bbc.com)

The social platform is testing age checks using facial scanning for access to sensitive content.

28. Microsoft researchers developed a hyper-efficient AI model that can run on CPUs (techcrunch.com)

Microsoft researchers have developed — and released — a hyper-efficient AI model that can run on CPUs, including Apple's M2.

30. Cutting down Rust compile times from 30 to 2 minutes with one thousand crates (www.feldera.com)

We'll explore how we can leverage all cores on a machine with rustc using many crates to speed up compilation.

31. Kaggle and the Wikimedia Foundation are partnering on open data (blog.google)

Kaggle is hosting Wikimedia Enterprise's beta release of structured data in both French and English. Kaggle is home to a vast trove of open and accessible data, with mor…

32. Advanced Shell Scripting with Bash (2006) [pdf] (uniforumchicago.org)

高级Bash脚本编程摘要

本文档总结了2006年由Michael Potter在UniForum Chicago所做的关于Bash 3.x高级脚本的演示内容,核心目标是展示如何编写更健壮、可维护的Bash脚本。

核心安全脚本 (stringent.sh)

演示的核心是一个推荐的脚本框架 stringent.sh,它通过设置一系列Shell选项来增强脚本的可靠性和错误报告:

  • set -o errexit:遇到错误时立即退出。
  • set -o noclobber:防止意外覆盖文件。
  • set -o nounset:引用未设置的变量时报错。
  • set -o pipefail:使管道命令中任意部分失败都会导致整个管道失败。
  • 结合 trapBASH_SOURCEBASH_LINENO 等变量,在 ERR 信号时输出详细的错误位置信息。

变量处理

  • 整数变量:使用 declare -i 声明,可提前捕获非整数值赋值错误。注意八进制和十六进制前缀(如012, 0x12)会导致赋值结果不同。
  • 作用域:函数内使用 declarelocal 声明的变量是局部的,仅在函数及其调用的子函数内可见。普通变量作用域是全局的。
  • 只读变量:使用 declare -rreadonly 创建,一旦设置不可更改。
  • 未设置变量处理:使用参数展开语法 ${var:-default} (提供默认值)、${var:=default} (赋值并使用默认值)等,可避免因变量未定义导致的错误。
  • 字符串操作
    • 子串提取${var:position:length},支持负数从末尾计数。
    • 模式匹配删除
      • #:从左侧匹配删除最短模式。
      • ##:从左侧匹配删除最长模式。
      • %:从右侧匹配删除最短模式。
      • %%:从右侧匹配删除最长模式。常用于提取文件名或路径部分。
    • 搜索替换${var/pattern/replacement},双斜杠 // 表示替换所有匹配。

条件判断与测试

  • 多种 if 语法if commandif (( )) (整数算术测试)、if [ ] / if test (传统测试)、if [[ ]] (增强测试)。
  • 关键区别
    • [ ] 与外部命令 test 相同,对变量和通配符处理较为原始,需注意引号。
    • [[ ]] 是Bash内置关键字,支持更安全的字符串比较(如通配符匹配)和正则表达式匹配(=~),并能避免单词分割和文件名扩展的问题。
    • (( )) 专门用于整数算术计算。
  • 建议规则:使用 [ ] 进行文件名 glob 匹配;使用 (( )) 进行数学运算;其他情况推荐使用 [[ ]]
  • 正则表达式:在 [[ ]] 中可使用 =~ 进行扩展正则表达式匹配,匹配结果存储在 BASH_REMATCH 数组中。

管道与子Shell陷阱

  • 当使用 command | while read 结构时,while 循环会在一个子Shell中执行,导致循环内对变量的修改不会影响父Shell。
  • 解决方案:使用输入重定向 (done < file) 或进程替换 (done < <(command)) 来避免创建子Shell,确保变量修改可见。

引用与特殊变量

  • 引用变量:始终用双引号括起变量 ("$var"),可防止因变量值包含空格或特殊字符导致的错误。在 [[ ]] 内和整数上下文中可安全省略引号。
  • 特殊变量
    • $?:上一条命令的退出状态。
    • $PIPESTATUS:一个数组,包含管道中每个命令的退出状态。
    • $LINENO:当前执行的脚本行号。
    • $BASH_COMMAND:当前正在执行或即将执行的命令。
    • $FUNCNAME, $BASH_SOURCE, $BASH_LINENO:提供调用栈信息,用于调试。

学习资源

演示最后推荐了进一步学习的资料,包括 man bash、O'Reilly的《Learning the Bash shell》以及相关在线文档。

33. Jellyfin as a Spotify alternative (coppolaemilio.com)

When I stopped using Spotify I tried a few different solutions until I found the perfect replacement for me. If you want the tl;dr: I now use Jellyfin. But if you want to know how I got here, follow me through each step of the way.

34. Passing planes and other whoosh sounds (www.windytan.com)

A blog about signals, programming, music, and other stuff.

35. A 1980s toy robot arm inspired modern robotics (www.technologyreview.com)

The tasks taken on by the Armatron aren’t so different than the ones AI is tackling today.

37. Elon Musk shut down internal Tesla analysis showing Robotaxi would lose money (electrek.co)

According to a credible new report, Elon Musk has reportedly shut down an internal analysis from Tesla executives that showed...

38. OpenAI looked at buying Cursor creator before turning to Windsurf (www.cnbc.com)

Cursor gained popularity last year after embedding Anthropic's Claude Sonnet artificial intelligence model in its tool to automate programming.

40. AI-Designed Antivenoms: New Proteins to Block Deadly Snake Toxins (plentyofroom.beehiiv.com)

AI-powered protein design creates promising antivenoms, blocking toxic snake venom using advanced generative AI techniques and molecular engineering.

41. The Halting Problem is a terrible example of NP-Harder (buttondown.com)

It's a justifiable copout, but it's still a copout.

42. BitNet b1.58 2B4T Technical Report (arxiv.org)

Abstract page for arXiv paper 2504.12285: BitNet b1.58 2B4T Technical Report

43. Stainless steel strengthened: Twisting creates submicron 'anti-crash wall' (techxplore.com)

A combined team of metallurgists, materials scientists and engineers from the Chinese Academy of Sciences, Shandong University and the Georgia Institute of Technology has developed a way to make stainless steel more resistant ...