HackerURLs

一次又一次被重新发现的经典。

同一个链接,相隔一年以上,一次又一次被人重新发现、再次冲上 Hacker News 首页。能经受住这种时间检验的,大多是值得一读再读的文章。每篇附中文标题,讨论最热的那些再加上中文导读和高赞评论翻译。

从名人堂开始
  • 4,700+篇经过时间检验的经典

Hall of fame

名人堂

在经典库里看全部精选

上首页次数最多、而且有中文导读的 30 篇。时间轴上每个黑点是一次上首页,空心点是一次没冲上去的投稿。

  1. 正在载入经典…

Archive

经典库

按第一次上首页的年份分布,点柱子筛选。

排序

    About

    这些经典是怎么挑出来的

    1. 01

      合并同一个链接

      读取 Hacker News 自 2006 年以来的全部链接投稿,把 http/https、www、跟踪参数等写法不同的同一篇文章合并成一条。

    2. 02

      只留经得起时间的

      同一链接至少两次拿到 50 分以上(约等于上首页),而且两次相隔一年以上;再由 AI 剔除状态页、产品首页和新闻事件。

    3. 03

      写导读、译评论

      上首页次数最多的 2,000 篇配上中文导读、"为什么经久不衰",并精选翻译 HN 高赞评论。导读由 AI 生成,可能有误。

    工具与资源github.com

    TextQL:用 SQL 查询 CSV/TSV 文件

    TextQL: Execute SQL Against CSV or TSV

    2次上首页
    4年跨度
    788累计得分
    182条评论

    2014 — 2018,它一次次回到首页

    黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。

    导读

    TextQL 是一个命令行小工具,可以直接对 CSV 或 TSV 文件执行 SQL 查询,原理是把数据导入 SQLite 后运行查询。它让不写脚本也能快速筛选、分析表格数据变得非常简单。

    为什么经久不衰:用 SQL 查询 CSV 是数据处理中反复出现的刚需,这类工具(TextQL、q、xsv 等)多年来持续被讨论,说明这个需求经久不衰,今天依然实用。

    关键词 命令行工具SQLCSVSQLite

    HN 评论精选

    推荐同类工具 xsv 作为补充。

    如果你经常处理 CSV,还可以看看 xsv——一个用于索引、切片、分析、拆分和连接 CSV 文件的命令行程序,作者是 Andrew Gallant(Go 和 Rust 社区知名的 burntsushi)。

    kibwen查看英文原文

    If you work with CSV a lot, then also check out xsv, "a command line program for indexing, slicing, analyzing, splitting and joining CSV files", from Andrew Gallant (burntsushi of Go and Rust fame): https://github.com/BurntSushi/xsv

    指出更早的同类工具 q,功能几乎相同。

    它看起来和 q 非常相似。q 已经存在很多年,社区很大,是一个可以直接对 CSV/TSV(以及任何表格文本文件)执行类 SQL 查询的命令行工具。

    ravinizme查看英文原文

    Seem very similar to q q is out there for years, with a very large community. q is a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files). http://harelba.github.io/q/

    询问与 CSVKit 的差异,并给出 csvsql 的用法示例。

    这个看起来非常简单易用。它和 CSVKit 有什么区别吗?CSVKit 里有个叫 csvsql 的工具,用法示例:csvsql --query "select name from data where age > 30" data.csv > new.csv。

    ConceitedCode查看英文原文

    This looks very simple and easy to use. Are there any differences with using this instead of CSVKit? https://csvkit.readthedocs.io/en/1.0.3/ It includes a tool called csvsql. Example usage - csvsql --query "select name from data where age > 30" data.csv > new.csv

    指出 TextQL 缺少类型检测,并介绍 SQLite 虚拟表和 apsw 的自动导入方案。

    它是把数据导入 SQLite 再在那里执行查询,我没看到任何类型检测的尝试。SQLite 有虚拟表功能,应用提供的代码可以提供底层数据,然后就能用 SQL 查询,这是处理外部数据格式最简单的方式。我是 SQLite 的 Python 封装 apsw 的作者,它提供了一个与官方兼容的命令行 shell,其中的 autoimport 命令可以自动推断分隔符和数据类型来导入 CSV 类数据。

    rogerbinns查看英文原文

    It is importing the data into SQLite and running the query there. I don't see any attempt at type detection. SQLite has virtual tables where app provided code can provide the underlying data and you can then use SQL queries against it. This is by far the easiest approach for foreign data formats. http://www.sqlite.org/vtab.html I'm the author of a Python wrapper for SQLite. It provides a shell compatible with the main SQLite one invocable from the command line (ie you don't need to go anywhere near Python) - http://rogerbinns.github.io/apsw/shell.html That shell has an autoimport command which automatically figures things out for csv like data (separators, data types etc) sqlite> .help autoimport .autoimport FILENAME ?TABLE? Imports filename creating a table and automatically working out separators and data types (alternative to .import command) The import command requires that you precisely pre-setup the table and schema, and set the data separators (eg commas or tabs). In many cases this information can be automatically deduced from the file contents which is what this command does. There must be at least two columns and two rows. If the table is not specified then the basename of the file will be used. Additionally the type of the contents of each column is also deduced - for example if it is a number or date. Empty values are turned into nulls. Dates are normalized into YYYY-MM-DD format and DateTime are normalized into ISO8601 format to allow easy sorting and searching. 4 digit years must be used to detect dates. US (swapped day and month) versus rest of the world is also detected providing there is at least one value that resolves the ambiguity. Care is taken to ensure that columns looking like numbers are only treated as numbers if they do not have unnecessary leading zeroes or plus signs. This is to avoid treating phone numbers and similar number like strings as integers. This command can take quite some time on large files as they are effectively imported twice. The first time is to determine the format and the types for each column while the second pass actually imports the data.

    历次讨论

    同类还值得读

    1. 直接在浏览器中启动 Linux 内核

      Boot a linux kernel right inside your browser.

      Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。

      工具与资源上首页 5 次 · 2011–2025bellard.org
    2. Hacker News 未公开功能与行为清单(2018)

      A List of Hacker News's Undocumented Features and Behaviors (2018)

      数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。

      工具与资源上首页 5 次 · 2019–2025github.com
    3. MapSCII:在终端中用盲文和 ASCII 渲染地图

      MapSCII – Braille and ASCII map renderer for the console

      MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。

      工具与资源上首页 5 次 · 2017–2025github.com
    4. 顶尖大学的免费在线课程

      Free Online Courses from Top Universities

      Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。

      工具与资源上首页 5 次 · 2010–2022openculture.com
    5. 淘气字符串:容易引发用户输入问题的字符串清单

      Naughty Strings: A list of strings likely to cause issues as user-input data

      一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。

      工具与资源上首页 4 次 · 2015–2020github.com

    打赏支持

    打赏二维码

    觉得有用,请作者喝杯咖啡。

    WeChat

    关注向阳乔木

    微信公众号「向阳乔木推荐看」

    微信公众号「向阳乔木推荐看」二维码

    微信扫一扫;在微信里打开本页时,长按二维码识别。