Table of Contents:
- Auto-rotation: the process where the platform will read sensor data about the physical screen orientation and apply that to the screen properties, so that eg. a screen in a physical landscape orientation will have an observable width > height.
- Orientation-lock: More or less granular configuration of which orientations the platform is allowed to auto-rotate into
QScreen::nativeOrienation
: the fixed standard-orientation of the physical screen, eg the orienation where the logo makes sense. Typically landscape for desktop screens. Never changes.
// SimpleStringList.h | |
#ifndef _SIMPLEMODEL_H_ | |
#define _SIMPLEMODEL_H_ | |
#include <QtCore> | |
class SimpleStringModel : public QAbstractListModel | |
{ |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
import unittest | |
import asyncio | |
import inspect | |
def async_test(f): | |
def wrapper(*args, **kwargs): | |
if inspect.iscoroutinefunction(f): | |
future = f(*args, **kwargs) | |
else: |
# install CUDA | |
sudo apt-get update | |
wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb" | |
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb | |
sudo apt-get update | |
sudo apt-get install cuda -y | |
export PATH=/usr/local/cuda-7.5/bin:$PATH | |
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH | |
# install MPI (optional, for some samples) |
Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.
The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.
Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.
Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a
/** | |
* OpenCV video streaming over TCP/IP | |
* Client: Receives video from server and display it | |
* by Steve Tuenkam | |
*/ | |
#include "opencv2/opencv.hpp" | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <unistd.h> |