Import needed libraries:
from gcloud import storage
Define needed variables:
Client: Bundles the configuration needed for API requests
client = storage.Client()
Optional params for Client():
project: the project which the client acts on behalf of. Will be passed when creating a topic. If...
Reading the specification for the document formats in OpenXML can be a time consuming process. Sometimes you just want to see how to produce a certain feature in a word-document.
The Open XML SDK 2.5 Productivity Tool for Microsoft Office (OpenXmlSdkTool.exe) does just that. Its main features are:
...
This example uses the asyncio SSE library: https://github.com/brutasse/asyncio-sse
import asyncio
import sse
class Handler(sse.Handler):
@asyncio.coroutine
def handle_request(self):
yield from asyncio.sleep(2)
self.send('foo')
yield from asyncio.sleep(2)
...
To add additional restriction to the poReceiptLinesSelection data view, you should invoke Select method on base view and inspect each item in returned PXResultSet independently to decide if it complies with additional restriction(s):
public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEn...
Accessed through including <stdio.h>, the function printf() is the primary tool used for printing text to the console in C.
printf("Hello world!");
// Hello world!
Normal, unformatted character arrays can be printed by themselves by placing them directly in between the parenthes...
Use Enum.chunk/2 to group elements into sub-lists, and Map.new/2 to convert it into a Map:
[1, 2, 3, 4, 5, 6]
|> Enum.chunk(2)
|> Map.new(fn [k, v] -> {k, v} end)
Would give:
%{1 => 2, 3 => 4, 5 => 6}
Individual pixel access in OpenCV Mat structure can be achieved in multiple ways. To understand how to access, it is better to learn the data types first.
Basic Structures explains the basic datatypes. Shortly, CV_<bit-depth>{U|S|F}C(<number_of_channels>) is the basic structure of a typ...
In OpenCV, images can be RGB/BGR, HSV, grayscaled, black-white and so on. It is crucial to know the data type before dealing with images.
The image data types are mainly CV_8UC3 (Matrix of uchar with 3 channels) and CV_8U (Matrix of uchar with 1 channel), however, the conversion to other types such...
Activate Developer Mode:
Login to odoo application.
After login user may see several odoo menu's. Click on setting menu.
Click on 'Activate the developer mode' which is located at right-bottom corner of settings page.
Developer mode now activated.
Android now supports devices with 512MB of RAM. This documentation is intended to help OEMs optimize and configure Android 4.4 for low-memory devices. Several of these optimizations are generic enough that they can be applied to previous releases as well.
Enable Low Ram Device flag
We are introduc...
The CPU governor itself is just 1 C file, which is located in kernel_source/drivers/cpufreq/, for example: cpufreq_smartass2.c. You are responsible yourself for find the governor (look in an existing kernel repo for your device)
But in order to successfully call and compile this file into your ke...
There are two main functions in Redis (HSET and HMSET) for adding fields to a hash key. Both functions are available in redis-py.
Using HSET:
import redis
r = redis.StrictRedis(host='myserver', port=6379, db=0)
r.hset('my_key', 'field0', 'value0')
Using HMSET:
import redis
r = redis.St...
Swift 3
Serial Queue
func serialQueues () {
let serialQueue = DispatchQueue(label: "com.example.serial") //default queue type is a serial queue
let start = Date ()
for i in 0...3 { //launch a bunch of tasks
serialQueue.a...
This example echoes the special character ! into a file. This would only work when DelayedExpansion is disabled. When delayed expansion in enabled, you will need to use three carets and an exclamation mark like this:
@echo off
setlocal enabledelayedexpansion
echo ^^^!>file
echo ^>>&...
Redis allows you to add items to either the right or the left of a list.
If I was working with a list, my_list and I wanted to prepend 3 to the list, I could do that using the Redis LPUSH command:
LPUSH my_list 3
If I wanted to append 3 to my_list, I would instead use the RPUSH command:
RPUSH ...