Tag:Return value

  • Introduction to OpenCV image

    Time:2021-3-4

    Introduction to image processing An image is made up of pixelsImage classification: binary image, gray image, RGB imageChannel order in opencv: B, G, R Read pixel Return value = image (position parameter)Gray image, return gray valueBGR image, the return value is the value of B, G, R # eg: p = img[88, 142] print(p) Returns […]

  • React native: communication with Android module

    Time:2021-3-2

    useToastAs an example. The function can be written in JavaScriptToastAndroid.show(‘Awesome’, ToastAndroid.SHORT)To display a toast notification. code:https://github.com/future-cha… Create a native module Create a class, inheritReactContextBaseJavaModule。 public class ToastModule extends ReactContextBaseJavaModule { private static final String DURATION_SHORT_KEY = “SHORT”; private static final String DURATION_LONG_KEY = “LONG”; public ToastModule(ReactApplicationContext reactContext) { super(reactContext); } } Then you need to […]

  • Analysis of promise in angular with $Q example

    Time:2021-3-1

    I believe those who have some development experience should know that promise is very important for JavaScript and can always be used in development. Therefore, it is a must to master it. I wrote an article before,Work summary: deferred object of jQuery advanced application, introduce promise in jQuery, so the basic introduction of promise will […]

  • Windows screen resolution acquisition methods

    Time:2021-2-27

    Method 1: monitorfromwindow //Get the resolution of the display where the program is currently located, which can dynamically get the resolution of the display where the program is located SIZE GetScreenResolution(HWND hWnd) { SIZE size; if(!hWnd) return size; //MONITOR_ The default one arest return value is the screen handle closest to that point //MONITOR_ The […]

  • Tips for using promise

    Time:2021-2-26

    1、 About promise Promise is a solution of asynchronous programmingIt is more reasonable and powerful than traditional solutions (callback functions and events). It was first proposed and implemented by the community. ES6 has written it into the language standard, unified the usage, and provided the native languagePromiseObject. so-calledPromiseIn short, it is a container that holds […]

  • Python object oriented magic method

    Time:2021-2-24

    Magic Methods View the magic method of class class A: pass Dir (a) # can get all the public members of the class The output is as follows [‘__class__’, ‘__delattr__’, ‘__dict__’, ‘__dir__’, ‘__doc__’, ‘__eq__’, ‘__format__’, ‘__ge__’, ‘__getattribute__’, ‘__gt__’, ‘__hash__’, ‘__init__’, ‘__le__’, ‘__lt__’, ‘__module__’, ‘__ne__’, ‘__new__’, ‘__reduce__’, ‘__reduce_ex__’, ‘__repr__’, ‘__setattr__’, ‘__sizeof__’, ‘__str__’, ‘__subclasshook__’, ‘__weakref__’] In Python,All […]

  • Flow (2) — simple syntax usage

    Time:2021-2-22

    catalog Flow type inference Where flow type annotations are used Flow Type Annotations Type reference website Primitive type Array type Tuple types object type General writing Add optional properties Map class Mixed use Function type Function parameters Optional function parameters Rest parameter Function return Special types Literal type May type Mixed and any Mixed Any […]

  • Flink learning — Flink SQL window function

    Time:2021-2-20

    The Flink window function includes scrolling window, sliding window, session window and over window scroll window Tumble assigns each element to a window of a specified size. Generally, scrolling windows have a fixed size and do not overlap. For example, if a 5-minute scrolling window is specified, the data of the infinite stream will be […]

  • Write the promise library according to promise / a specification

    Time:2021-2-20

    I tried to write about it, tested it, and didn’t test it with professional testing tools I feel that the code is easy to understand, and I am poor. If there are problems in the test, please replyAddress:https://github.com/julyL/Code… (function(global) { function isFunction(val) { return typeof val == ‘function’; } function isObject(val) { return typeof val […]

  • Unified encapsulation of response results

    Time:2021-2-20

    package com.fansunion.cloud.luckids.controller; import com.fansunion.cloud.commons.RestResult; import com.fansunion.cloud.luckids.support.RestWrapper; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.MethodParameter; import org.springframework.core.io.Resource; import org.springframework.http.MediaType; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; @ControllerAdvice public class JSONResponseWrapper implements ResponseBodyAdvice { @Autowired ObjectMapper objectMapper; @Override public boolean supports(MethodParameter methodParameter, Class aClass) { return true; } @Override public Object beforeBodyWrite(Object returnValue, MethodParameter returnType, MediaType mediaType, Class […]

  • JUC’s lock

    Time:2021-2-17

    Synchronized Concept:Heavyweight lock, reentry lock and JVM level lockUse: Method: acc_ Synchronized, code block monitorenter / monitorexitJVM monitor Scope: methods and code blocks (object and class locks): For normal synchronization methods, the lock is the current instance object. For static synchronization methods, the lock is the class object of the current class. For synchronous method […]

  • 006 rust asynchronous programming, stream introduction

    Time:2021-2-12

    Introduction to stream StreamandFutureSimilar, butFutureCorresponding to aitemChanges in the state of, andStreamIt is similar toiteratorTo get multiple values before the end. Or we can simply understand it as,StreamIt’s made up of a series ofFutureWe can start fromStreamRead eachFutureUntilStreamend. Stream trait definition The definition is as follows: trait Stream { type Item; fn poll_next(self: Pin<&mut Self>, […]