BytePower 技术周刊 - 030

2023/2/26

# BytePower 技术周刊 - 030

# 📘 封面


NGC 1433 棒旋星系

NASA 公布一张 JWST 太空望远镜拍摄的时钟座「NGC 1433」棒旋星系照片。该星系距离地球约 4600 万光年,拥有明亮活跃的星系核,螺旋臂呈现独特的双环结构。这张照片由 JWST 望远镜的中红外相机(MIRI)拍摄,显示出 NGC 1433 星系内的宇宙尘埃较少,推测其近期发生过一次星系合并或碰撞。摄影师:NASA

# 📖 文章

# Go Style (opens new window)(英文)

  1. The Style Guide outlines the foundation of Go style at Google. This document is definitive and is used as the basis for the recommendations in Style Decisions and Best Practices.

  2. Style Decisions is a more verbose document that summarizes decisions on specific style points and discusses the reasoning behind the decisions where appropriate.

These decisions may occasionally change based on new data, new language features, new libraries, or emerging patterns, but it is not expected that individual Go programmers at Google should keep up-to-date with this document.

  1. Best Practices documents some of the patterns that have evolved over time that solve common problems, read well, and are robust to code maintenance needs.

These best practices are not canonical, but Go programmers at Google are encouraged to use them where possible to keep the codebase uniform and consistent.

每种编程语言除了固定的语法之外,都会有属于自己的地道的(idiomatic)写法。本文档的目的向开发者传授如何写出更地道、更高效、可读性更好的代码。

# YOU MIGHT NOT NEED JAVASCRIPT (opens new window)(英文)

JavaScript is great, and by all means use it, while also being aware that you can build so many functional UI components without the additional dependancy.

Maybe you can include a few lines of utility code, or a mixin, and forgo the requirement. If you're only targeting more modern browsers, you might not need anything more than what the browser ships with.

# Fallacies of Distributed Systems (opens new window)(英文)

Fallacies of distributed systems are a set of assertions made by L Peter Deutsch and others at Sun Microsystems describing false assumptions that programmers new to distributed applications invariably make.

# 全球最轻最小的 VR 头显 Bigscreen Beyond 发布 (opens new window)(中文)

Bigscreen 推出了号称是全球最轻最小的 VR 头显 —— Bigscreen Beyond,仅重 127 克。

该头显采用独特的外形设计,最薄处不到 1 英寸,仅重 127 克,号称比 VR 设备竞品轻了 6 倍。

# 🧰 工具

# Codesandbox (opens new window)

CodeSandbox 是一个在线的代码编辑器,主要聚焦于创建 Web 应用项目。

支持主流的前端相关文件的编辑:JavaScript、TypeScript、CSS、Less、Sass、Scss、HTML、PNG 等。支持自动代码提示。

# ASTER (opens new window)

一个 Windows 的工具,可以让一台电脑同时供两个人使用。

# Localsend (opens new window)

一个跨平台的设备间传输文件的工具。

# Linux 系统压力测试工具 stress (opens new window)

linux 系统下,可以使用 stress 命令主要用来模拟系统负载较高时的场景,本文介绍其基本用法。文中 demo 的演示环境为 ubuntu 18.04。

# HiDock (opens new window)

一个 Mac 上定制 Dock 的工具。

# 👩🏻‍🎓 小知识

# 全称量词,存在量词

谓词逻辑中有量词(限量词、数量词)这类特殊的谓词。我们可以用它们来表达一些这样的命题:“所有的 x 都满足条件 P”或者“存在(至少一个)满足条件 P 的 x”。前者称为“全称量词”,后者称为“存在量词”,分别记作 ∀、∃。这两个符号看起来很奇怪。其实,全称量词的符号其实是将字母 A 上下颠倒而形成的,存在量词则是将字母 E 左右颠倒而形成的。“对于所有的 x, ……”的英语是“for All x, …”,而“存在满足……的 x”的英语是“there Exists x that…”,这就是这两个符号的由来。

# SQL 求中位数

-- 在HAVING子句中使用非等值自连接

SELECT AVG(DISTINCT income)
    FROM (SELECT T1.income
            FROM Graduates T1, Graduates T2
        GROUP BY T1.income

        --S1的条件
    HAVING SUM(CASE WHEN T2.income >= T1.income THEN 1 ELSE 0 END)
            >= COUNT() / 2
        --S2的条件
    AND SUM(CASE WHEN T2.income <= T1.income THEN 1 ELSE 0 END)
            >= COUNT() / 2 ) TMP;

# 🐠 有趣的东西

# Traceroute Haiku’s (opens new window)

介绍了一个将简历放在互联网上的新方法。

# Mac 30th Anniversary Icons (opens new window)

历代苹果电脑的图标。

上次更新: 2023/2/27 11:29:53