Monday, July 31, 2023

Unreal Engine's DrawDebugCone

There are two versions of implementation of DrawDebugCone.

One it takes two angles in radians and other one takes degrees. OTL

Tuesday, July 11, 2023

Order of mov (assembler)

mov ax, 3


which mean move a number 3 into ax register. This is an intel assembler order.


Other assembler use opposite order for instance


mov 3, ax


which is exactly same meanning like shown above.


Monday, July 10, 2023

three types of locks

 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

Wednesday, July 5, 2023

Thursday, June 29, 2023

implement add with + operator with racket

 #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.

racket basic

 #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)


Task in UnrealEngine

 https://www.youtube.com/watch?v=1lBadANnJaw