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
/* | |
* V4L2 video capture example | |
* | |
* This program can be used and distributed without restrictions. | |
* | |
* This program is provided with the V4L2 API | |
* see http://linuxtv.org/docs.php for more information | |
*/ | |
#include <stdio.h> |
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 rethrow_cpp_exception_as_java_exception() | |
{ | |
try | |
{ | |
throw; | |
} | |
catch (const package::Exception& e) | |
{ | |
jclass jc = env->FindClass("group/package/Exception"); | |
if(jc) env->ThrowNew (jc, e.what()); |
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 <functional> | |
#include <iostream> | |
// using a lambda in a C callback | |
extern "C" void | |
register_callback (void (*callback)(void *), void * context) | |
{ | |
// for simplicity we just call it | |
callback (context); |
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
// credit to http://stackoverflow.com/a/14665230/339222 | |
#include <functional> | |
#include <chrono> | |
#include <future> | |
#include <iostream> | |
class later | |
{ | |
public: |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import gtk | |
import webkit | |
def entry_activated_cb(entry, embed): | |
embed.load_uri(entry.get_text()) | |
# Widgets and signals |
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
Flickable { | |
id: rec | |
height: 19 | |
width : 80 | |
contentWidth: width; contentHeight: height | |
clip: true | |
Text { | |
id: xmovingBox | |
anchors.left: parent.left | |
opacity: 1 |
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://lists.boost.org/Archives/boost/2014/06/214213.php | |
// http://stackoverflow.com/questions/25338795/is-there-a-name-for-this-tuple-creation-idiom | |
#include <iostream> | |
#include <string> | |
#include <functional> | |
auto list = [](auto ...xs) { | |
return [=](auto access) { return access(xs...); }; | |
}; |
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
// | |
// This server will start a bash shell and expose it | |
// over socket.io to a browser. See ./term.html for the | |
// client side. | |
// | |
// You should probably: | |
// | |
// npm install socket.io | |
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js | |
// |
OlderNewer