1. Try lock
try it only once
2. Spin lock
try forever until it acquires the lock
3. Timeout lock
try it for up to some period of time
1. Try lock
try it only once
2. Spin lock
try forever until it acquires the lock
3. Timeout lock
try it for up to some period of time
UGameplayStatics, Static class with useful gameplay utility functions
https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/AssetNaming/
#lang racket
; implement add without + operator
(define add
(λ (n m)
(cond
((zero? m) n)
(else (add1
(add n (sub1
m)))))))
One thing I want to notice is that add1 and sub1 are not what I defined myself.
#lang racket
; define a constant
(define myval 3.14)
; function without param
(define myfunc
(λ ()
(+ 3 4)))
; call function
(myfunc)
; function with param(which is one formal)
(define myfunc-mul-two
(λ (x)
(* 2 x)))
(myfunc-mul-two 4)
; outer function calls inner function
(define double-result-of-f
(λ (f)
(λ (z)
(* 2 (f z)))))
(define add3
(λ (x)
(+ 3 x)))
((double-result-of-f add3) 4)
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int array[] = { 1,3,3,4,5,5,6,9,10,12,12,15 };
int n = sizeof(array) / sizeof(int);
int k = 0;
int x = 3;
for (int b = n / 2; b >= 1; b /= 2)
{
while (k + b < n && array[k + b] <= x)
{
k += b;
}
}
if (array[k] == x)
{
int a = 10;
}
}
#lang racket
(define remainder
(λ (x y)
(cond
((< x y) x)
(else (remainder (- x y) y)))))
https://www.youtube.com/watch?v=1lBadANnJaw