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> | |
#include <iostream> | |
#include <chrono> | |
//Speculative execution using std::future<> wait_for() | |
int quick_but_gestimation() | |
{ | |
for (int i=0; i < 2; 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
#include <condition_variable> | |
#include <mutex> | |
#include <future> | |
#include <iostream> | |
#include <chrono> | |
#include <queue> | |
bool isReady; | |
std::mutex mutex; | |
std::condition_variable condvar; |
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 <iostream> | |
#include <array> | |
int main(){ | |
//multi-dimensional array with newly introducted in C++11 | |
// a hundred array of 10 element array | |
const size_t i = 100; | |
std::array<std::array<size_t, 10>, i> myarr; |
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> | |
#include <iostream> | |
#include <vector> | |
int main() | |
{ | |
std::cout << "Task parallerism using C++11 async() and future<>" << std::endl; | |
std::cout << "Main thread id: " << std::this_thread::get_id() |
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> | |
#include <iostream> | |
void print2Screen(char c) | |
{ | |
for(int i = 0; i < 50; i++) | |
{ | |
std::cout.put(c).flush(); | |
_sleep(100); //sleep 100 millisec |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Geolocation API in HTML5</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"> | |
</script> | |
</head> | |
<body> | |
<p>Geolocation API in HTML5</p> | |
<button id="btnGeo">Show where i am</button> |
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
<html> | |
<head> | |
<title> | |
JohnL javascript practice | |
</title> | |
<script type="text/javascript"> | |
var titleOfApplication = "JohnL application"; | |
window.titleOfApplication; |
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
''' | |
C:\temp\sqlite> sqlite3 test.db "create table location (lid integer primary key, lname text);" | |
C:\temp\sqlite> sqlite3 test.db "insert into location (lid, lname) values (0, "Waitara, NSW");" | |
Software\sqlite3.exe: Error: too many options: "Waitara" | |
-help for a list of options. | |
C:\temp\sqlite> sqlite3 test.db "insert into location (lid, lname) values (0, 'Waitara, NSW');" | |
C:\temp\sqlite> sqlite3 test.db "insert into location (lid, lname) values (1, 'Hornsby, NSW');" | |
C:\temp\sqlite> sqlite3 test.db "insert into location (lid, lname) values (2, 'Rhodes, NSW');" | |
C:\temp\sqlite> sqlite3 test.db "insert into location (lid, lname) values (3, 'Strathfield, NSW');" | |
C:\temp\sqlite> |
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
//Preference > Setting-user 로 이동하여 다음 내용 입력 | |
{ | |
"color_scheme":"Packages/color scheme - Default/Twilight.tmTheme", | |
"font_size": 12, | |
"font_face": "Malgun Gothic" | |
} |
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
/* | |
* Uniform Initialization: C++11 | |
* compiled under g++4.7.2 | |
* */ | |
#include <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <string> |
NewerOlder