This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resumable-idea.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
using namespace std; | |
using namespace std::experimental; | |
struct resumable_thing | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resumable-idea.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
using namespace std; | |
struct resumable_thing | |
{ | |
void resume() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class _Ty> | |
bool await_ready(future<_Ty>& _Fut) | |
{ | |
return (_Fut._Is_ready()); | |
} | |
template<class _Ty> | |
void await_suspend(future<_Ty>& _Fut, | |
experimental::coroutine_handle<> _ResumeCb) | |
{ // change to .then when future gets .then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: reference additional headers your program requires here | |
#include <windows.h> | |
#include <future> | |
#include <iostream> | |
#ifdef _RESUMABLE_FUNCTIONS_SUPPORTED | |
#include <experimental/resumable> | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <future> | |
std::future<int> compute_value() | |
{ | |
int result = co_await std::async([] | |
{ | |
return 30; | |
}); | |
co_return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void WebCrawlerSample::MainPage::button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) | |
{ | |
HttpClient^ client = ref new HttpClient(); | |
Uri^ addr = ref new Uri("https://heejune.me"); | |
auto asyncOp = client->GetAsync(addr); | |
// create and set Progress handler | |
asyncOp->Progress = ref new AsyncOperationProgressHandler<HttpResponseMessage^, HttpProgress>( | |
[=](IAsyncOperationWithProgress<HttpResponseMessage^, HttpProgress>^ pretask, HttpProgress progressInfo) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## http://qiita.com/Chironian/items/8770c8ab833086fb51a9 | |
############################################################ | |
# base | |
############################################################ | |
cmake_minimum_required(VERSION 2.8.8) | |
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE) | |
set(CMAKE_SUPPRESS_REGENERATION TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import asyncio | |
import telepot | |
from telepot.aio.delegate import per_chat_id, create_open | |
import picam | |
""" | |
$ python3.5 countera.py <token> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/heejune/WinForm-PDFjs/blob/master/WinFormPDFViewer/pdfjs-1.4.20-dist/web/viewer.js | |
// PDFViewerApplication.open wrapper for base64 param | |
window.openPdfAsBase64 = function (base64) { | |
var binary_string = window.atob(base64); | |
var len = binary_string.length; | |
var bytes = new Uint8Array(len); | |
for (var i = 0; i < len; i++) { | |
bytes[i] = binary_string.charCodeAt(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (locateText.Text.EndsWith("pdf", true, null) == true && | |
File.Exists(locateText.Text) == true) | |
{ | |
var buffer = File.ReadAllBytes(locateText.Text); | |
// Document.InvokeScript seems not understanding the Blob type | |
//object[] args = { fileBytes }; | |
//webBrowser1.Document.InvokeScript("PDFViewerApplication.open", args); | |
// so convert it to base64 and pass it |