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 <unistd.h> | |
#include <iostream> | |
#include <map> | |
#include <set> | |
#include <vector> | |
#include <pthread.h> | |
class Base{ | |
public: | |
int x; |
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 <cassert> | |
#include <sstream> | |
#include <iomanip> | |
#include <iostream> | |
#include <map> | |
#include <set> | |
#include <vector> | |
#include <gcrypt.h> | |
#include <string> |
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 javax.crypto.spec.SecretKeySpec; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import java.util.Base64; | |
public class Test{ | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) throws Exception{ |
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
class A( object ): | |
def __init__( self ): | |
print("A") | |
super( A, self ).__init__() | |
class B( object ): | |
def __init__( self ): | |
print("B") | |
super( B, self ).__init__() |
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 "template.h" | |
#include <vector> | |
#include <iostream> | |
int main(){ | |
std::vector<int> V{1, 2, 3, 4, 5}; | |
std::vector<int> filtered = filter( [](int i){return i %2 == 0;}, V); | |
for( auto f : filtered ){ | |
std::cout << f << std::endl; | |
} |
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 <pthread.h> | |
#include <iostream> | |
class A | |
{ | |
public: | |
A( int _i, int *_p ) : i( _i ), p( _p ){} | |
int i; | |
int *p; | |
void squareMyPtr() | |
{ |
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 <iomanip> | |
typedef char myArr[12]; | |
void printInfo( myArr &arr, myArr arr2, myArr* arr3 ) | |
{ | |
std::cout << std::setw(10) << "arr: " << std::setw(20) << arr << std::setw(10) << " arr2: " << std::setw(20) << arr2 << std::setw(10) << " arr3: " << std::setw(20) << arr3 << std::endl; | |
std::cout << std::setw(10) << "&arr: " << std::setw(20) << &arr << std::setw(10) << " &arr2: " << std::setw(20) << &arr2 << std::setw(10) << " &arr3: " << std::setw(20) << &arr3 << std::endl; | |
std::cout << std::setw(10) << "arr[0]: " << std::setw(20) << arr[0] << std::setw(10) << " arr2[0]: " << std::setw(20) << arr2[0] << std::setw(10) << " arr3[0]: " << std::setw(20) << arr3[0] << std::endl; | |
std::cout << std::setw(10) << "&arr[0]: " << std::setw(20) << &arr[0] << std::setw(10) << " &arr2[0]: " << std::setw(20) << &arr2[0] << std::setw(10) << " &arr3[0]: " << std::setw(20) << &arr3[0] << std::endl; |
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
/* | |
** client.c -- a stream socket client demo | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <netdb.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
import dbus | |
import dbus.mainloop.glib | |
import time | |
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | |
bus=dbus.SessionBus() | |
obj = bus.get_object("org.mpris.MediaPlayer2.vlc", | |
"/org/mpris/MediaPlayer2") | |
print(dir(obj)) |
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
/* | |
g++ cppdbus.cpp -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -lglib-2.0 -lgio-2.0 -lgobject-2.0 | |
*/ | |
#include <iostream> | |
#include <gio/gio.h> | |
int main() | |
{ | |
GDBusConnection* conn = NULL; | |
GError* error = NULL; |