InertiaRSS Track and read blogs, news, and tech you care about
Read Original Open in InertiaRSS

Recommended Feeds

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

阮一峰的网络日志

科技爱好者周刊(第 396 期):互联网通信的替代方案 科技爱好者周刊(第 396 期):互联网通信的替代方案 - 阮一峰的网络日志 科技爱好者周刊(第 395 期):软件开发的第三种方式 科技爱好者周刊(第 395 期):软件开发的第三种方式 - 阮一峰的网络日志 科技爱好者周刊(第 393 期):脑腐状态 科技爱好者周刊(第 392 期):axios 投毒与好莱坞式骗术 科技爱好者周刊(第 391 期):AI 的贫富分化 科技爱好者周刊(第 390 期):没有语料,大模型就是智障 套壳中国大模型撑起500亿美元估值?扒一扒 Cursor 的"套壳"疑云 科技爱好者周刊(第 389 期):未来如何招聘程序员 科技爱好者周刊(第 388 期):测试是新的护城河 零安装的"云养虾":ArkClaw 使用指南 科技爱好者周刊(第 387 期):你是领先的 科技爱好者周刊(第 386 期):当外卖员接入 AI 字节全家桶 Seed 2.0 + TRAE 玩转 Skill 科技爱好者周刊(第 385 期):马斯克害怕中国车企吗? 智谱旗舰 GLM-5 实测:对比 Opus 4.6 和 GPT-5.3-Codex 科技爱好者周刊(第 384 期):为什么软件股下跌 科技爱好者周刊(第 383 期):你是第几级 AI 编程 Kimi 的一体化,Manus 的分层 科技爱好者周刊(第 382 期):独立软件的黄昏 AI native Workspace 也许是智能体的下一阶段 科技爱好者周刊(第 381 期):中国 AI 大模型领导者在想什么 科技爱好者周刊(第 380 期):为什么人们拥抱"不对称收益" 科技爱好者周刊(第 379 期):《硅谷钢铁侠》摘录 我如何用 AI 处理历史遗留代码:MiniMax M2.1 升级体验 科技爱好者周刊(第 378 期):预测是新的互联网热点 科技爱好者周刊(第 377 期):14万美元的贫困线 科技爱好者周刊(第 376 期):太空数据中心的争议 科技爱好者周刊(第 375 期):一扇门的 Bug 终于有人做了 Subagent,TRAE 国内版 SOLO 模式来了 科技爱好者周刊(第 374 期):6GHz 的问题 VS Code 使用国产大模型 MiniMax M2 教程 科技爱好者周刊(第 373 期):数据模型是新产品的核心 国产大模型接入 Claude Code 教程:以 Doubao-Seed-Code 为例 科技爱好者周刊(第 372 期):软件界面如何设计 大模型比拼:MiniMax M2 vs GLM 4.6 vs Claude Sonnet 4.5 科技爱好者周刊(第 371 期):一个乐观主义者的专访 科技爱好者周刊(第 370 期):正确的代码高亮 错误处理:异常好于状态码 科技爱好者周刊(第 369 期):Tim 与罗永浩的对谈 科技爱好者周刊(第 368 期):不要这样管理软件团队 一天之内,智谱和 Anthropic 都发了最强编程模型 科技爱好者周刊(第 367 期):Nano Banana 的几个妙用 科技爱好者周刊(第 366 期):旧金山疯狂的 AI 广告 科技爱好者周刊(第 365 期):流量变现正在崩塌 科技爱好者周刊(第 364 期):最难还原的魔方 科技爱好者周刊(第 363 期):最好懂的神经网络解释 科技爱好者周刊(第 362 期):GitHub 工程师谈系统设计 科技爱好者周刊(第 361 期):暗网 Tor 安全吗?
Tech Enthusiast Weekly (Issue 305): Random numbers, this is a problem
阮一峰 · 2024-06-21 · via 阮一峰的网络日志

This records the weekly technology content worth sharing, released every Friday.

This magazine is open source , and we welcome submissions . There is also the service "Who is Hiring" , which posts programmer job listings. For collaborations, please contact us via email [email protected]).

Cover image

at the bus stop "Yuetai Jiangwan" in Chongqing, composed of several large stones, symbolizing the pebbles by the local river.via)

random number, this is an issue

we'll discuss today, how to generate true random numbers.

This problem is extremely difficult, but there's some interesting content.

First, the random numbers provided by programming languages are pseudo-random numbers.

The V8 engine's official website has an article (below), which specifically reminds everyone of this point. The built-in random number in it is not a true random number but a pseudo-random number.

A pseudo-random number is not truly random but is generated by an algorithm. As long as the initial seed value is the same, the algorithm will produce the same result.

JavaScript and many other languages have this issue. Therefore, in situations where randomness is particularly emphasized, built-in language random number generators should not be used.

True random numbers need to meet three conditions.

(1) Unpredictable. The random number cannot be guessed, so it must be very large, otherwise it will be brute-forced.

(2) Non-repetitive. Each generated random number must be different.

(3) Uniformly distributed. The random number must be evenly distributed across all intervals, not concentrated in certain intervals.

Generally speaking, true random numbers can only be obtained through hardware , simple software algorithms cannot achieve this.

Scientists have exhausted their efforts, coming up with various methods to generate random numbers through hardware.

The famous Random.org is a website dedicated to generating random numbers.

It has deployed multiple radio receivers worldwide, specifically to listen to atmospheric radio waves (i.e., atmospheric noise, which can be understood as atmospheric Brownian motion), generating random numbers through random radio signals. The image below shows its early hardware equipment.

Due to hardware expenses, using its random numbers requires payment. Therefore, as you can see, true random numbers come at a cost and cannot simply be generated by running a program.

Cloudflare, the world's largest CDN provider, has gone even further to obtain true random numbers.

Its three offices each have different random number generation devices.

(1) San Francisco headquarters . As soon as you enter, there is a wall filled with dozens of lava lamps.

The inside of the lava lamp is molten wax, constantly changing shape.

When a random number is needed, take a photo of this wall. Each photo is different, then calculate the hash of the photo and use it as a seed value to generate a random number.

(2) London office. There is a "pendulum wall" there, filled with various pendulum devices.

The pendulums and their shadows are always swinging. The hash of each photo is also different, which can be used as a seed value for the random number.

(3) Austin office. The ceiling there hangs many colorful reflective sheets.

These reflective sheets are very sensitive to air flow; opening or closing doors, air conditioning, temperature, and humidity will all make them rotate, reflecting different colored lights. Therefore, they can also be used as seed values for random numbers.

This Friday, the Rare Earth Developers Conference.

Over the past month, the weekly has been building anticipation for this year's "Rare Earth Developers Conference."

Its opening time is next Friday (June 28th).

As this year's major event, all the schedule arrangements are now available. Below is the list of more than 70 speech topics for the main forum and 10 sub-forums . .

Click to see the full image , covering technical hotspots and cutting-edge fields. The speakers are technology experts and frontline engineers from around the world.

Additionally, the conference features an outdoor AI event with a total of 4 themed exhibition areas, where you can visit booths from top domestic AI companies, participate in various interactive games, and win souvenirs. This part is free of charge.

For more details about the event, you can click on this link. or scan the QR code on the poster above to purchase indoor speaker tickets, or pick up free outdoor tickets, and book a live stream.

Technology News

1, Starliner spacecraft

NASA recently encountered an embarrassing situation.

Boeing's Starliner spacecraft (below), after sending two astronauts to the International Space Station, couldn't return.

After launch, there were helium leaks and thruster malfunctions. Unable to find the cause, NASA was reluctant to use it to bring the astronauts back.

The mission was originally scheduled for 8 days, but it has now been 20 days. The return is currently scheduled for June 26, but it may be postponed again.

Fortunately, the International Space Station has a 4-month food supply, so there won't be a shortage of supplies.

This flight was the first mission for the Starliner spacecraft, and it ended up like this. If it doesn't work out, we can only send another spacecraft to pick up the people.

2、 Australian Giant Goose

Australia is isolated from other continents, with many unique animals.

Scientists have known for a long time that Australia once had a giant goose (rightmost in the image below), similar in size to an ostrich, standing over 2 meters tall, weighing 240 kilograms, but it went extinct 45,000 years ago.

That was exactly when the first humans arrived in Australia, so scientists suspect its extinction is related to humans. Humans may have hunted this goose on a large scale, after all, it couldn't fly and was slow-moving.

Previously, only scattered fossils of this goose had been unearthed, but recently, the first complete skull was found.

Scientists have drawn a reconstruction of it. Everyone take a look, what this giant goose from Earth looked like.

3、Eye Tracking

A foreign netizen posted an image on Twitter.

He was watching a YouTube video on his phone when this prompt popped up.

It means the system detected that his eyes were not focused on the ad, so it replayed the ad.

This image is likely fake, but the technology is quite simple. Just activate the camera while playing the ad to identify if there's a person in the frame and where their eyes are looking.

I suspect this scenario will become reality. In the future, paid users will use it normally, while free users will have to undergo eye tracking to ensure they are watching the ad.

4、Online Basket

Due to the war, internet services have been completely cut off in the Gaza Strip.

An international organization came up with a solution to help the people there get online.

They first purchased a batch of eSIM cards in other countries and transmitted the parameters to the locals. Since eSIM is a virtual card, as long as the parameters are entered, it can be activated, relatively easily.

Then, the locals connected their phones to a power bank, placed them in a basket, and took them to the border area, hanging them at a high place.

Through the eSIM card, the phone can connect to the 4G network of the neighboring country. At this point, if the phone hotspot is turned on, then the people under the basket can all go online.

Article

1、The future of AI chips may not be GPUs (Chinese)

This article argues that accelerated computing may not only be achieved through GPUs; FPGA or ASIC might be better underlying computing devices.

2、I Developed My Own Blog Engine for 10 Years(英文)

The author developed a blog engine for himself and stuck with it for 10 years. He shares what he learned and experienced in the process.

3、3D Folding Effect of CSS(英文)

This article introduces how to use CSS to achieve a 3D page folding animation effect (see the image above).

4、Algorithm for Random Playlists(英文)

This article explains Spotify's algorithm for generating random playlists, which requires that songs by the same artist are not played consecutively.

5、Visit to the Headquarters of ASML(English)

The author visits the headquarters of ASML in the suburbs of Eindhoven, where he shares his observations.

6、Implementing Virtual DOM with 200 Lines of JavaScript Code(English)

Virtual DOM is the foundation of many JavaScript frameworks. This article demonstrates how to implement it from scratch.

Tools

1、Postgres.js

PostgreSQL client for Node.js and Deno, similar software includesShoes

2、OpenccLint

An OpenCC-based Simplified and Traditional Chinese conversion tool, supporting editor and command line interface.(@hddhyq Submitted)

3、BiliVideoDown

A Flutter-based desktop Bilibili video downloader, open source code.(@kangpeiqin Submitted)

4、AQChat

an anonymous online chat software where users can freely log in, create rooms, have conversations, and transfer files, experiencing demo. The link is the backend code, with additional Web and mobile versions. (@howcodes submission)

5、Voicer

a Chrome browser extension for reading web page text aloud. (@wang-jianliang) Submitted)

6、 Easy Barcodes

an online barcode generator. (Submitted by @FZliweiliang)

7、ScienHub

LaTex Online Editor, offering many practical templates. (Submitted by @tc1989tc)

8、trash.sh

a simple alternative to the rm command, providing a recycle bin for deleting files.@qqAys Submission)

9、My Font

An online tool for creating personal handwritten fonts. ( @harbor2009 Submission)

10、lingo link

An open-source browser extension that supports word translation, AI translation, and new word marking. ( @chengfengfengwang Submission)

AI Related

1、Luma AI Video Generator

Luma AI Video Generator is available for free online use. (Submitted by @sunnyjingliu)

2、Stable Diffusion 3 AI Image Generator

Available for free use of Stable Diffusion 3, generate images from text without registration. (Submitted by @ddewfrefref)

3、Generative Voice AI

A text-to-speech service that supports Chinese, with free accounts allowing 10,000 characters per month (approximately 10 minutes of audio).

4、BrainyAI

An open-source Chrome extension that loads AI models into the sidebar, serving as a free alternative to similar products like Sider AI, Monica, Merlin, and MaxAI。(@luyu0279 Submission)

5、Rock AI

This website hosts some open-source AI models that can be called for free. (Submitted by @hellokidder)

6、Chrome AI

A local chat tool built using the built-in AI model in Chrome. (Submitted by @zengkan0703)

7、Local text summarization for Mac computers (English)

This article introduces how to set up a local Ollama model on a Mac computer, use it to create a shortcut, and automatically summarize the content of open web pages.

Resources

1、Unicode Knowledge Developers Must Understand(2023 Edition)

This long article covers the latest Unicode knowledge.

2、loadership

This website allows you to customize pure CSS page loading animations (loaders).

3、Modern C++ Programming(Modern C++ Programming)

An open-source English tutorial for C++.

Image

1、A peculiar roundabout

In the UK, there is a peculiar roundabout divided into an inner and an outer circle, with five smaller roundabouts scattered between them.

The inner circle is counterclockwise, while the outer circle is clockwise.

To enter the inner circle from the outer circle, or vice versa, one must pass through the five smaller roundabouts.

The following image shows the local traffic sign.

This roundabout was built in 1972 and has not experienced any major traffic accidents for many years.

2、Elbe Tunnel )

The Elbe River flows through the center of Hamburg, Germany.

In 1911, the Hamburg city government dug a 426-meter tunnel beneath the river to facilitate traffic between the two banks.

The unique feature of this tunnel is that it has no access ramps. Pedestrians and vehicles must use elevators to enter and exit the tunnel. The yellow vertical passages on both sides of the image below are the elevators.

The image below shows the entrance to the vehicle elevator.

This tunnel is still in use today and has even hosted concerts inside. The image below shows a view from the bottom of the elevator looking up at the exit.

Excerpt

1. How big should a programming language be?

Programming languages vary in size.

Some languages provide only the most core functionalities, while others are comprehensive.

There are also some languages that started small and gradually added features, becoming larger and even so large that they become difficult to use.

The initial version of the Python language was small, and the first few versions deliberately maintained this characteristic, with suggestions to add features being explicitly rejected on the grounds that they would make the language too large.

At some point (perhaps between Python 1.6 and Python 2.0), things changed: feature proposals would not be rejected because they made the language bigger, only if they didn't solve important problems.

From then on, Python embarked on the path of becoming a major programming language.

In my opinion, once the designers of a language no longer worry about its size, the unlimited growth of this language is inevitable.

Many languages are like this. Although Java has never been a small language, its changes were quite small before generics were added to Java 1.5. Generics seem to be the starting point of Java's journey as a large language.

JavaScript was originally designed as a small language for weekends, but it has now become a rather large language.

Rust is already a very large language, but it is considering adding more features to become even larger.

Why do so many languages take the path of becoming larger?

My view is that no programming language is perfect, and there are always use cases that it doesn't support well. In many cases, adding new features helps better support these use cases.

Since potential use cases are infinite, we always add new designs to make the language "better," the side effect being that the language becomes a little larger each time.

言论

1、

Las Vegas is holding its annual Excel World Championship for spreadsheets, and it has a feature that no other competition has—boredom.

--《Excel World Championship》

2、

Hubble Telescope confirms, the accurate age of the universe is 13.8 billion years. That is the origin of our world, what came before that, no one knows.

--《New Clues from the James Webb Telescope》

3、

Farming is too busy.

-- @dylanaraps, founder of Kiss Linux, only left this sentence on his GitHub profile, the project hasn't been updated in over two years.

4、

I don't remember the books I've read, just like I don't remember the meals I've eaten; despite that, they still shaped me.

-- Emerson

5、

In the early days, the cockpit of commercial aircraft had up to five crew members. Due to the automation of navigation and communication, navigators and radio operators were the first to be eliminated. Then, flight engineers were also phased out, leaving only two pilots.

As pilot costs soared, airlines began to demand single-pilot narrow-body aircraft, and the elimination of co-pilots was only a matter of time.

Ultimately, the last remaining pilot would also be eliminated, with future aircraft relying mainly on autonomous driving, supplemented by a ground operator capable of limited aircraft control.

-- "The Last Pilot"

Yearly Review

2023:Carmack's Cats

2022: Issues with the Promotion System

2021: Devaluation of Content Channels

2020: Guerrilla Warfare and Surprise Attacks

(End)