Usage and scenario of swift protocol

Protocol is an important part of swift, similar to the interface in Java, but not quite the same. Compared with OC, swift protocol is more flexible. It can be applied in many scenarios, making the framework structure of the whole project more extensible. I. What scenarios to use protocols Like classes, protocols can be inherited. After inher ...

Posted by fri3ndly on Tue, 18 Jun 2019 20:28:22 +0200

epoll for Linux programming

Now there's a scene like this: I'm a busy big boss. I have 100 mobile phones. When my mobile phone comes to information, my secretary will tell me, "Boss, your mobile phone is coming to information."I'm very angry. That's how my secretary does it. Every time a message comes from my mobile phone, only tell me it. The boss goes to see i ...

Posted by Yippee on Mon, 17 Jun 2019 18:47:40 +0200

[react]--Basic use of Hooks - [Alley]

1. react-hooks concept In React, everything is a component. Components in React are divided into class components and function components. In React, if you need to record the state of a component, it must be a class component.Can function components have the functionality of class components?At this point we need to use hooks.Hook s give ...

Posted by djpeterlewis on Sun, 16 Jun 2019 18:42:51 +0200

On encapsulation of three main characteristics of python object

We all have TV sets in our house, from power on, browsing programs, changing stations to power off. We don't need to know the details inside the TV. We just need to press the remote control to complete the operation when we are using it. This is the encapsulation of functions. When using Alipay to make payment, you only need to give the two-way ...

Posted by Sj0wKOoMel on Sun, 16 Jun 2019 00:06:34 +0200

Crawler processes and Python third-party library usage

Usages such as requests pymongo BS4 from future import print_functionPrit does not need parentheses in #python2.X, but it does in python3.X.Add this sentence at the beginning, even after python2.X, using print requires bracketing like python3.X import requests Import requests without requests at https://pip.pypa.io/en/s ...

Posted by cac_azure03 on Sat, 15 Jun 2019 18:38:15 +0200

UDP for socket programming of network socket

Summary I wrote about TCP in my last blog. Now that I have learned TCP, I have to mention UDP. TCP and UDP are like two inseparable partners, always mentioned and compared with each other. As for the advantages and disadvantages of the two protocols, I will not describe them here. Next, we mainly learn how to write UDP server communication. I ...

Posted by paulieo10 on Sat, 15 Jun 2019 04:33:07 +0200

A simple example of aop in spring

aop, or Face-Oriented Programming, aims at separating concerns. For example, a knight only needs to care for his safety or his expedition, and who records and celebrates his brilliant life? Of course, it is not himself. This can be fully celebrated by poets, such as when a knight is on the march, when a poet can send off, when a knight is brave ...

Posted by mahendrakalkura on Fri, 14 Jun 2019 20:03:37 +0200

Three Solutions of Fibonacci Sequence (Naive Recursion, Dynamic Programming, Mathematical Induction) and Algorithmic Analysis

Why can't 80% of yard farmers be architects? >    This paper is from Introduction to Algorithms of Netease Open Course, Lecture 3, ...

Posted by majik-sheff on Thu, 13 Jun 2019 02:33:16 +0200

python Foundation (5): Numbers and String Types

Today I'll summarize the number and string types in data types. Preview: # Write code,There are the following variables,Please implement each function as required (6 points, 0 for each sub-item).5 Points) name = " aleX" # 1) remove name Spaces on either side of the corresponding value of a variable,And output the processing results. # 2) ...

Posted by srikanth03565 on Wed, 12 Jun 2019 21:26:31 +0200

python base data type (2): list

As you all know, lists are the most important data type in Python, so there's a lot of content in this section. I've read this before, but I haven't started programming, so it's uncomfortable and strongly recommended << Python programming: From Getting Started to Practice>, this book is very systematic and suitable as an introductory b ...

Posted by carichod on Mon, 10 Jun 2019 18:11:56 +0200