As we discussed through Part I, co_wait keyword requires sort of "resumable thing". So what if we want to use co_await with time delta? For example, you can see the code which the co_await takes std::chrono::duration in order to suspend for the specified time from here: https://github.com/Microsoft/cppwinrt/blob/master/10.0.14393.0/Samples/JustCoroutines/Main.cpp#L31 The answer is the fact that vc++ compiler … Continue reading Beginning the coroutine with Visual Studio 2015 Update 3 Part 2
Slack provides an official python client module which you can easily work with. It's simple and easy to use. For example, sending a text line to a specific channel is simple enough to call through just one API - api_call("chat.postMessage", channel=channel, text=msg, attachments=attachment, as_user=True) You can also upload a file to a channel. However, when I … Continue reading How to upload a file from slack using SlackClient?
The cppwinrt project focused to consume Microsoft provided OS winrt components and it doesn't support building a winrt component(yet) although they mentioned it will be supported later. Even though it's not technically supported yet, we still can create a winrt component with WRL(pure C++ and non C++/CX) and still can get some benefits from using … Continue reading Building WinRT component with WRL(non C++/CX) and cppwinrt
I recently started using the cppwinrt library which brought chances dealing with the new C++ standard(yet) coroutine. The cppwinrt recommends using C++ coroutines instead of PPL while handling async operations. Refer to the following github issues for more information: https://github.com/Microsoft/cppwinrt/issues/54 https://github.com/Microsoft/cppwinrt/issues/46 Although the coroutine concept itself might feel coming familiar because we're already exposed async … Continue reading Beginning the coroutine with Visual Studio 2015 Update 3 Part 1
Windows Runtime provides the HttpClient class along with async APIs. For example, you can send a GET request through the GetAsync(Uri) method. GetAsync() method is an awaitable API so that it returns IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress>^. You will get the HttpResponseMessage by specifying the IAsyncOperationWithProgress to Concurrency::create_task(). However, how can I get the progress? There's no direct … Continue reading [C++/Cx] How can I get the AsyncOperationWithProgress progress?
Sometimes it's needed or you may require to see the assembly output listing of a C++ snippet code just for the testing purpose. Testing yourself with Jason Turner's session might be the example. If you're using a msvc with Windows environment, then it's quite easy by running the simple command line argument: Let's say we have … Continue reading Generating assembly output from msvc and CMake
Now it’s time to build our own clang standalone tool. The official LibTooling document provides an example code so that I was able to begin with it. How to write CMakeLists.txt for the standalone clang tool? Of course using the cmake is not required, but I wanted to go with it. At first … Continue reading Build your own clang example outside of the llvm source tree