Tutorial by Examples

// Working with Sublists in Dynamic Mode in SuiteScript 2.0... require(["N/record"], function (r) { var rec = r.create({ "type": r.Type.SALES_ORDER, "isDynamic": true }); // Set relevant body fields ... // Add line item 456 w...
// Finding a specific line item in SuiteScript 2.0... require(["N/record"], function (r) { var rec = r.load({ "type": r.Type.SALES_ORDER, "id": 123 }); // Find the line that contains item 777 var index = rec.findSublistLineWith...
The primitive types in OpenCV are unsigned char, bool, signed char, unsigned short, signed short, int, float, double. Any data type in OpenCV is defined as CV_<bit-depth>{U|S|F}C(<number_of_channels>) where U: unsigned, S:signed and F:floating point. For example, CV_32FC2 is a 32-bit, ...

Mat

Mat (Matrix) is an n-dimensional array that can be used to store various type of data, such as RGB, HSV or grayscale images, vectors with real or complex values, other matrices etc. A Mat contains the following information: width, height, type, channels, data, flags, datastart, dataend and so on. ...
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: ...
@route("/stream") def stream(): def event_stream(): while True: if message_to_send: yield "data: {}\n\n".format(message_to_send)" return Response(event_stream(), mimetype="text/event-stream&qu...
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) ...
Objective-C example of swizzling UIView's initWithFrame: method static IMP original_initWithFrame; + (void)swizzleMethods { static BOOL swizzled = NO; if (!swizzled) { swizzled = YES; Method initWithFrameMethod = class_getInstanceMethod([UIView class], ...
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...
Assume we need to add an NSString object to SomeClass (we cant subclass). In this example we not only create an associated object but also wrap it in a computed property in a category for extra neatness #import <objc/runtime.h> @interface SomeClass (MyCategory) // This is the property wr...
import redis r = redis.StrictRedis(host='localhost', port=6379, db=0) r.lpush('myqueue','myelement')
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...
To receive messages, use a service that extends FirebaseMessagingService and override the onMessageReceived method. public class MyFcmListenerService extends FirebaseMessagingService { /** * Called when message is received. * * @param remoteMessage Object representing t...
Client apps can subscribe to any existing topic, or they can create a new topic. When a client app subscribes to a new topic name, a new topic of that name is created in FCM and any client can subsequently subscribe to it. To subscribe to a topic use the subscribeToTopic() method specifying the top...
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...
Cargo.toml: [package] name = "customderive" version = "0.1.1" [lib] proc-macro=true [dependencies] quote="^0.3.12" syn="^0.11.4" src/lib.rs: #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; exte...
Cargo.toml: [package] name = "customderive" version = "0.1.0" [lib] proc-macro=true src/lib.rs: #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; #[proc_macro_derive(Dummy)] pub fn qqq(input: TokenStream) -> TokenStrea...
Cargo.toml: [package] name = "gettersetter" version = "0.1.0" [lib] proc-macro=true [dependencies] quote="^0.3.12" syn="^0.11.4" src/lib.rs: #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; extern c...

Page 1144 of 1336