C#.Rihter. How to stop thread work ? Cancellation token

how do i exit from thread

static void Main(string[] args) { var tokenSource = new CancellationTokenSource(); ThreadPool.QueueUserWorkItem(o => ThreadWorker(tokenSource.Token, 1000)); Console.WriteLine(«Press <Enter> to cancel

Читать на сайте автора.

C#. Rihter. Use Thread from the thread pool

static void Main(string[] args) { Console.WriteLine(«this is main thread»); ThreadPool.QueueUserWorkItem(ThreadWorker, 123); Thread.Sleep(3000); } private static void ThreadWorker(object obj) { Thread.Sleep(1000); Console.WriteLine(«hi from thread pool

Читать на сайте автора.

С#. Foreground and Background threads

Foreground and background threads.

If background thread then application will not wait until it is over, in other case it will.

static void

Читать на сайте автора.

C#. Threads simple example

static void Main(string[] args) { Console.WriteLine(«inside thread id » + Thread.CurrentThread.ManagedThreadId); var otherThread = new Thread(ThreadWork); otherThread.Priority = ThreadPriority.Normal; otherThread.Start(5); otherThread.Join(); // wait for

Читать на сайте автора.

JS. Reject vs throw and catch vs rejectHandler

Both, reject and throw can be handled with catch

reject inside promise will be handled by 2-d argument of then, and if it is

Читать на сайте автора.

js. es6 some features

const

const Pi = 3.14;

SCOPING

block-scoped variables

// es 6 for (let i = 0; i < 10; i ++) { let x =

Читать на сайте автора.

Algo. Mult – Sum

Given an integer number n, return the difference between the product of its digits and the sum of its digits. Example 1: Input: n =

Читать на сайте автора.

Algo. Running sum

Task

Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1:

Читать на сайте автора.

Css. Block model

margin

border

padding

content

margins by horizontal added, by vertical joined

Читать на сайте автора.

Сss. BEM (Block Element Modificator)

BLOCK AND ELEMENT

Blocks can be inside blocks infinite times

<div class = «block»> <div class = «block__element»> </div> <div class = «anotherBlockInside»> <div class

Читать на сайте автора.