Kotlin Flow (data flow) on Android, from shallow to deep

In coroutines, Flow is a type that emits multiple values sequentially, rather than a suspending function that returns a single value. For example, you can use Flow to receive real-time updates from a database. Dataflows are built on top of coroutines and can provide multiple values. Flow is conceptually a data flow that can be […]

C51 single-chip microcomputer development heart-shaped lamp water lamp (C language)

Using the Keil uVision4 programming program, create a simulation circuit in Proteus 8 Professional Simulation circuit Hexadecimal style pattern int a[][8] = { 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80, 0x03,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80, 0x07,0x0e,0x1c,0x38,0x70,0xe0,0xc0,0x80, 0x0f, 0x1e, 0x3c, 0x78, 0xf0, 0xe0, 0xc0, 0x80, 0xfc,0xf9,0xf3,0xe7,0xcf,0x9f,0x3f,0x7f, }; Delay function void delay(unsigned int x) { while(x–); } Loop call function led1() refers to operate the P0 port, […]

Unity cutout shader

// Created by Oliver Davies. Enjoy. // oliver@psyfer.io Shader “Unlit/ChromaKey” { Properties { _MainTex(“Texture”, 2D) = “white” {} _KeyColor(“KeyColor”, Color) = (0,1,0,0) _TintColor(“TintColor”, Color) = (1,1,1,1) _ColorCutoff(“Cutoff”, Range(0, 1)) = 0.2 _ColorFeathering(“ColorFeathering”, Range(0, 1)) = 0.33 _MaskFeathering(“MaskFeathering”, Range(0, 1)) = 1 _Sharpening(“Sharpening”, Range(0, 1)) = 0.5 _Despill(“DespillStrength”, Range(0, 1)) = 1 _DespillLuminanceAdd(“DespillLuminanceAdd”, Range(0, 1)) = […]

numpy@shallow copy and deep copy

Article directory Copies and Views No Copy at All View or Shallow Copy Deep Copy Tips for Conserving Memory supplementary test Slicing an array returns a view of it: Deep Copy Copies and Views When operating and manipulating arrays, their data is sometimes copied into a new array and sometimes not. This is often a […]

DMA-shadow register transfer mode (shadow register)

Programming Flow for Shadow-Register-Based Multi-Block Transfer Software reads the DMAC channel enable register (DMAC_ChEnReg) to select an available (unused) channel. Software programs the CHx_CFG register with appropriate values for the DMA transfer. The SRC_MLTBLK_TYPE and/or DST_MLTBLK_TYPE bits must be set to 2’b10. Note: The CHx_CFG register must be programmed before programming the CHx_SAR, CHx_DAR, CHx_BLOCK_TS, […]

three.js parallel light and shadow and related properties

Basic articles: basic knowledge and simple application of three.js Texture map: the use of three.js texture map Advanced Texture Mapping: Three.js Texture Mapping Advanced 1. The relationship and setting of light and shadow — five steps are indispensable (points, parties will repeat again) Goal: Lights and Shadows Ambient light without shadows Parallel light (sun light), […]

shared_ptr step-by-step implementation (C++)

shard_ptr step-by-step implementation (C++) shared_ptr step-by-step implementation (C++) Step1 define a class Step2 define member variables Step3 constructor Step4 copy constructor Step5 Destructor Step6 assignment operator Step7 dereference operator Step8 Implement `use_count()` Step 9 Implement `reset()` Thread Safety and Testing testing thread safe code shared_ptr step-by-step implementation (C++) There are several kinds of smart pointers […]

The immutability of the JUC concurrent programming sharing model (6)

6.1 Problems with date conversion SimpleDateFormat is not thread-safe @Slf4j public class SimpleDateFormatTest {<!– –> public static void main(String[] args) {<!– –> SimpleDateFormat sdf = new SimpleDateFormat(“yyyy-MM-dd”); for (int i = 0; i < 10; i ++ ) {<!– –> new Thread(() -> {<!– –> try {<!– –> log.debug(“{}”, sdf.parse(“1951-04-21”)); } catch (Exception e) {<!– […]

vxe-table + ant design implements adding, deleting, modifying, moving rows up and down in tree-shaped tables.

Table of Contents 1. Function Description 1. Rendering 2. Description Two, realize 3. Import 1. Function description 1. Rendering image 2. Description Added: Add table parent row Added: Add table sub-rows delete: delete the parent row More dropdown menu (move up): Move parent row/child row up More Dropdown (Move Down): Move Parent/Child Rows Down EDIT: […]