Project Setup Use the command subst to create an alias to the working directory:
subst w: C:\Users\lv\work
Our project is actually created inside the work directory like this: \work\handmadehero.
Inside handmadehero, create two folders misc and code.
Inside code, create file win32_handmade.cpp.
Windows Entry Point All windows program has a entry point as follows, just put it in our code.
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { return 0; } How to Build We build our project from command line.
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
A Table to the Rescue In previous article, we see that it becomes quite annoying that each and every one of the generic selectors of the complex number has to do a cond on the types.
Me: Why I have put the observeOn(AndroidSchedulars.mainThread()) but still onNext() is NOT called in android main thread?!
Rx Master: Show me your code.
Me: Here you are my master. I just want to wait for 5 seconds then call an api:
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) fun networkObservable(): Observable<String> { return Observable.just("test").subscribeOn(Schedulers.io()) } Observable.timer(5, TimeUnit.SECONDS) .observeOn(AndroidSchedulers.mainThread()) .flatMap { _ -> networkObservable() } .subscribe(Consumer { Log.d("testtest", it) Log.d("testtest", Thread.currentThread().name) }) } } Rx Master: … Read the Doc of observeOn:
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Tagged Data At the end of previous post, we identified one problem of our current complex number system, which is given a complex number, there is no way to tell whether it is implemented in rectangular form or polar form.
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
When I first read about data directed programming in the book, I was surprised.