python3 setup.py build
- From current directory,
cd build/lib.linux-x86_64-3.6
(tested on Ubuntu 18.04 with python 3.6.7). python3
to enter interactive modeimport spam
spam.system('ls -la')
then it should print the current directory listing as output
This file contains hidden or 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
amdgpu amdgpu-core amdgpu-dkms amdgpu-lib amdgpu-lib32 amdgpu-pro amdgpu-pro-core amdgpu-pro-lib32 clinfo-amdgpu-pro glamor-amdgpu gst-omx-amdgpu libdrm-amdgpu-amdgpu1 libdrm-amdgpu-amdgpu1:i386 libdrm-amdgpu-common libdrm2-amdgpu libdrm2-amdgpu:i386 libegl1-amdgpu-mesa libegl1-amdgpu-mesa:i386 libegl1-amdgpu-mesa-drivers libegl1-amdgpu-mesa-drivers:i386 libegl1-amdgpu-pro libegl1-amdgpu-pro:i386 libgbm1-amdgpu libgbm1-amdgpu:i386 libgl1-amdgpu-mesa-dri libgl1-amdgpu-mesa-dri:i386 libgl1-amdgpu-mesa-glx libgl1-amdgpu-mesa-glx:i386 libgl1-amdgpu-pro-appprofiles libgl1-amdgpu-pro-dri libgl1-amdgpu-pro-dri:i386 libgl1-amdgpu-pro-ext libgl1-amdgpu-pro-glx libgl1-amdgpu-pro-glx:i386 libglapi-amdgpu-mesa libglapi-amdgpu-mesa:i386 libglapi1-amdgpu-pro libglapi1-amdgpu-pro:i386 libgles1-amdgpu-mesa libgles1-amdgpu-mesa:i386 libgles2-amdgpu-mesa libgles2-amdgpu-mesa:i386 libgles2-amdgpu-pro libgles2-amdgpu-pro:i386 libllvm9.0-amdgpu libllvm9.0-amdgpu:i386 libomxil-bellagio-bin libomxil-bellagio0 libopencl1-amdgpu-pro |
This file contains hidden or 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
#ifdef _WIN32 | |
#include <malloc.h> | |
#endif | |
#include <cstdint> | |
#include <vector> | |
#include <iostream> | |
/** | |
* Allocator for aligned data. |
This file contains hidden or 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
/** | |
* Input: n - number of random numbers to generate | |
* Output: n random numbers printed onto standard output separated by a space. | |
*/ | |
#include <iostream> | |
#include <cstdlib> | |
#include <ctime> | |
int main() |
This file contains hidden or 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
/** | |
* Generation of UVa's progress in markdown file. | |
* | |
* Input: | |
* A problem set number separated by a new line, each set will contains 100 problems with number running | |
* from it to a hundred. Terminate with 0 at the last line. | |
* | |
* 1 | |
* 19 | |
* 201 |
This file contains hidden or 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 __cplusplus >= 201103L | |
private: | |
// Constant-time move assignment when source object's memory can be | |
// moved, either because the source's allocator will move too | |
// or because the allocators are equal. | |
void | |
_M_move_assign(vector&& __x, std::true_type) noexcept | |
{ | |
vector __tmp(get_allocator()); | |
this->_M_impl._M_swap_data(__tmp._M_impl); |
This file contains hidden or 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
//@{ | |
/** | |
* @brief String inserters | |
* @param __out An output stream. | |
* @param __s A character string. | |
* @return out | |
* @pre @p __s must be a non-NULL pointer | |
* | |
* Behaves like one of the formatted arithmetic inserters described in | |
* std::basic_ostream. After constructing a sentry object with good |
This file contains hidden or 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 <string> | |
struct PublicData | |
{ | |
int a; | |
float b; | |
// private data | |
// this is a technique to hide the struct information thus users won't be able to know its layout |
This file contains hidden or 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 "Dialog.h" | |
#include "ui_Dialog.h" | |
Dialog::Dialog(QWidget *parent) : | |
QDialog(parent), | |
ui(new Ui::Dialog) | |
{ | |
ui->setupUi(this); | |
} |
This file contains hidden or 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
/** Downloader app following https://www.youtube.com/watch?v=_z-RS0rXg9s but | |
* use libcurl (C API) with some adjusted API usage. | |
* | |
* Compile with | |
* g++ -std=c++11 -DNO_PROXY SimpleDownloader.cpp -lpthread -lcurl | |
* */ | |
#include <iostream> | |
#include <fstream> | |
#include <string> |