Hegwin.Me

In silence I feel full; With speech I sense emptiness.

Excerpt from Home Deus A Brier Histroy of Tomorrow

读《未来简史》以及摘抄

I finally finished reading the book "A Brief History of Tomorrow" today. I did not see or buy this book in a bookstore. Coincidentally, I had some expiring points from China Unicom and I had to spend them on exchanging something before they were no longer valid. Inadvertently I got the electronic edition of this book with those points. Although...

Improve Memory for Your Rails App

Rails 应用的内存优化

I was in Zhengzhou today for the two-day Ruby Summit China 2018; the Summit was held at the "Big Corn" in Zhengzhou. I didn't expect that a city like Zhengzhou, where the density of Internet companies is not that high, could host an Internet conference of this scale (Ruby Summit was just one of the sessions). What was even more...

Soft Girl Gone Determined - Excerpt from Moon and Sixpense and Gone with The Wind

小女孩总会长大的 - 《月亮和六便士》《飘》摘抄

To improve my English, I read English novels. I recently read Maugham's The Moon and Sixpense, and Margaret Mitchell's Gone with the Wind. The result is that although I felt their fine diction and subtlety of expression, I didn't actually learn much English expression, rather my emotions followed the ebb and flow of the novel's plot. Especially the growth and...

Notes of CPR from a First Aid Training

成人心肺复苏(CPR)学习笔记

I attended a two-day first aid training last weekend. I am quite interested in saving the injured and giving help; Even in the game World of Warcraft, I play a healing class in - Priest. The first aid training actually covered a lot of topics, including the general management of burns, cuts, and choking, but more important to me was...

Ruby 2.5 allows rescue/ensure inside do/end blocks

Ruby 2.5 允许在do/end代码块中使用rescue

This article introduces a new feature of Ruby 2.5: in previous versions of Ruby if you needed to use rescue to catch and handle exceptions, you had to put the `rescue` in to the codes that might throw an exception in the "begin end" block. Since Ruby 2.5, you can use rescue in a normal "do end" block. Note that...

Deduction vs. Induction vs. Abduction - Different Ways to Reason and Draw Conclusions

三种推理方式:演绎,归纳和溯因

I've been reading the Sherlock Holmes series of novels for a while now. Whether it's "A Study in Scarlet Letter" or "The Four Signatures", there is a chapter titled "The Science of Deduction" (The Science of Deduction). This aroused my curiosity - what exactly is deductive reasoning? We know there are other modes of reasoning, such as inductive reasoning and...

Takeaways from Google Developer Days 2017: PWA Progressive Web App

谷歌开发者大会2017心得:PWA 渐进式网页应用

This is the second post in the Google Developer Days 2017 Take Ways series. Progressive Web App (PWA) was a recurring technology at this year's GDG, and I participated in at least two talks on the topic of PWA. The main problem that PWA is trying to solve is the ability to make a Web App nearly as efficient as...

Takeaways from Google Developer Days 2017: Firebase and Serverless

谷歌开发者大会2017心得:Firebase 和 Serverless

Today was the first day of the Google Developer Days (GDG) in Shanghai. Since GDG is held on a weekday, I had to take a leave of absence from work to attend. There were a lot of exciting topics at GDG. I'm going to write a few posts about what I got out of GDG 2017 (and if I get...

Tools to Help to Improve SQL in Rails

Rails优化SQL可能用到的工具

Have you ever encountered a Rails app that is slow in rendering pages? Are you trying to find out what's causing it to be "slow"? Where is the performance bottleneck? Is it the slow execution of SQL queries (maybe N+1, or not having the right indexes), or is it something else, like the view being too big? Performance optimization has...

Install Extensions for Self-compiled PostgresQL

为PostgresQL安装扩展程序

If when installing Postgres, you choose to download the source code to compile and install it, and you didn't run `make world` when you do the `make`, you will get an installed pg without some extensions, such as `pg_stat_statements`. So, this article will try to solve this problem: how to install extensions for pg after compiling and installing. Let's take...