If you try to add a UIRefreshControl to a UIViewController, youโ€™ll get an error.

UIRefreshControl can only be managed by a UITableViewController.

So, hereโ€™s a trick.

Read more »

Analysis of the Delegate principle

In class B, a method needs to pass a value to A and perform certain actions.

How can this be implemented?

First, B needs to know who to pass the value to and then call A.aFunc().

I understand that you want to know the principle without looking at the code, so Iโ€™ll simplify it as much as possible.

Read more »

Sinatra VS. Martini

There are already many comparison data available online, but nothing is as reliable as doing it yourself. So, I set up two โ€œHello Worldโ€ applications, one using Sinatra and the other using Martini, on a VPS. I used Siege, a testing tool for Linux, to compare their performance.

Read more »

Considering that Iโ€™ve read nearly five hundred books, Iโ€™ve always wanted to use a few paragraphs to introduce the concept of speed reading.

But then this series was delayed and never happenedโ€ฆ

I guess itโ€™s because of my limited skills that I canโ€™t write itโ€ฆ

Better do something else first.

Read more »

With the increasing complexity of modern magic spells, a successful project often needs to be calculated in months. Those experienced wizards who understand this concept are respected as the โ€œmyth of man-monthsโ€.

In this environment, mental strength is precious and important for magicians.

Speaking of mental strength, it is actually pronounced as โ€œWillPowerโ€ in the elven kingdom. However, after being translated to the celestial empire by unknowing Muggles, it has been translated as โ€œself-controlโ€ or โ€œwillpowerโ€.

It sounds mysterious and grand, but it can be understood by focusing on two characteristics:

  1. Battery
  • Magicians use mental strength to control magic elements.
  • Early morning > evening.
  • Sleep/meditation can recharge mental strength.
  • Different magic spells have different power consumption.
  1. Muscles
  • Total capacity is variable.
  • Can be expanded through specific exercises.
Read more »

The last sentence blew my mind.

This reminds me of a humorous response by Zhang Xiaolong on Zhihu to the question โ€œIf the world were just a piece of code, what bugs have you discovered so far?โ€

It is unrealistic to expect a variable in the code to check for bugs in the code.

Read more »

All along, Iโ€™ve been curious.

In the eyes of the public, programmers are generally seen as dull and logical, immersed in their own world, silent, high IQ but low EQ, constantly debating which programming language or framework is better than another.

Oh, and thereโ€™s another important point: no girls.

This has always confused me, and for a while I sincerely disagreed with this label.

Because when looking at some foreign elites, they not only have exquisite coding skills, but also write blogs, publish books, do marketing, start companies, raise funding, go diving, climb mountains, travelโ€ฆ

And itโ€™s not just a passing interest, it can only be described as extraordinary.

Are they still programmers?

I only understood this after reading this book, these people are called: Hackers.

Read more »

How to Read Cookbook

Oh my god, I finally finished reading it, more than 1000 pages!!!

I manually typed about 80% of the code and found two bugs in the code.

If there are any mistakes, you can submit a Pull Request on oreillymedia/iOS7_Programming_Cookbook on Github.

Read more »

While reading iOS 7 Programming Cookbook, I suddenly wondered how many lines of Obj-c code I wrote.

Before, when I was still using the Windows operating system, I used SourceCounter to do this.

However, SourceCounter doesnโ€™t support Mac OS X.

So, I found an interesting command line:

1
find . -name "*.m" -or -name "*.h" | xargs grep -v "^$" | wc -l
Read more »

What methods can make living in a small space in a strange city more interesting?

What are some expensive but worthwhile products to buy?

What are some things that, once bought, make people feel like they should have bought them earlier due to the improvement in quality of life and happiness?

What are some good products or brands that are not well known among the general public?

Read more »
0%