Talkshow programming builder mode

Builder Pattern The construction process of complex objects is separated, so that different implementation methods of this abstract process can construct different objects (properties). motivation The builder pattern can separate a part from its assembly process and create a complex object step by step. Users only need to specify the type of ...

Posted by duncanwil on Sun, 31 May 2020 00:47:12 -0700

Talk programming - responsibility chain mode

Chain of Responsibility Pattern It gives multiple objects the opportunity to process the request, thus avoiding the coupling between the sender and the receiver of the request. Connect these objects into a chain, and pass the request along the chain until there is an object to handle it. motivation Each processing object determines which com ...

Posted by leo.bonnafe on Sun, 31 May 2020 00:40:36 -0700

JS - closure, callback, immediate execution function expression simple implementation

Concept review Closures: any internal function can always use the parameters and variables defined by its external function, even if the external function has successfully returned the end. Callback: a callback function is a parameter (function pointer), which is passed to another function as a parameter, and only when the function is ...

Posted by plisken on Sun, 31 May 2020 00:06:52 -0700

Torture primary school students with programming

My brother was just in grade one when he went home in summer vacation. My mother asked me to work out some math problems to write for my brother, and also asked me to copy them. How could I be so lazy. I want to torture the current primary school students, so I wrote a small program with C, and randomly generated 1000 ...

Posted by zipdisk on Sun, 31 May 2020 00:06:15 -0700

ElasticSearch7.x Series IV: actual combat

catalog preface ES series installation Data synchronization How to search ES in. net code Single Index and multiple Index Single field search and full text retrieval Multiple conditions, time range + paging + highlighting end preface The first three series understand the installation and s ...

Posted by MarcAndreTalbot on Sat, 30 May 2020 23:57:21 -0700

How to get the content height of webView from iOS

In order to obtain the height of WebView, a scheme has been written before -- to update the height in real time by monitoring the changes of scrollView of WebView Attach the link: iOS [ultimate solution] accurately obtains the content height and adaptive height of webView This paper gives a second solution to the inaccuracy of content Height ...

Posted by Eddie Fisher on Sat, 30 May 2020 23:34:13 -0700

Glide (II) Request queue management

entrance The first part summarizes the life cycle management of Glide by using fm and an empty Fragment. Here we continue to see load & into. Don't talk about it // The first part analyzes with and continues to see load & into Glide.with(this).load("url").into(...); 1.1 load public RequestBuilder<Drawa ...

Posted by madolia on Sat, 30 May 2020 23:09:19 -0700

Recycle view's checkBox reuse disorder solution

Solution to the problem of recycle view reuse disorder Achieving results Single item selection with checkBox After killing the application in the background, enter the application again to display the options when killing the application in the background Problem description Because recyclerView adopts the reuse strategy, when refreshi ...

Posted by BinaryBird on Sat, 30 May 2020 23:01:19 -0700

The problem of playing audio array in Unity3D

There is a problem in today's work. An audio array audioclip [] is loaded in unity3d. How to play this audio array in turn? At present, three schemes are proposed. Write them down and see if there are any shortcomings. Please point out and improve them The source code is as follows: using System; using System.Collec ...

Posted by LordTyphon on Sat, 30 May 2020 22:45:04 -0700

Ubuntu installation configuration jdk

Install with paa source 1. Install paa sudo add-apt-repository ppa:webupd8team/java sudo apt-get update 2. Install Oracle Java installer jdk7 sudo apt-get install oracle-java7-installer jdk8 sudo apt-get install oracle-java8-installer The installer will prompt you to agree to oracle's terms of service and ...

Posted by Fixxer on Sat, 30 May 2020 22:05:00 -0700