Tutorial by Examples: a

Scala packages should follow the Java package naming conventions. Package names are written in all lower case to avoid conflict with the names of classes or interfaces. Companies use their reversed Internet domain name to begin their package names—for example, io.super.math
Detailed instructions on getting nutch set up or installed.
// How many Items does a Sales Order have... // ... if we're in the context of a Sales Order record var itemCount = nlapiGetLineItemCount("item"); // ... or if we've loaded the Sales Order var order = nlapiLoadRecord("salesorder", 123); var itemCount = order.getLineItemC...
// Working with Sublists in Standard mode ... // ... if the record is in context: // Add item 456 with quantity 10 at the end of the item sublist var nextIndex = nlapiGetLineItemCount("item") + 1; nlapiSetLineItemValue("item", "item", nextIndex, 456); nlapiSetL...
// Adding a line item to the end of a sublist in Dynamic Mode... // ... if the record is in context: nlapiSelectNewLineItem("item"); nlapiSetCurrentLineItemValue("item", "item", 456); nlapiSetCurrentLineItemValue("item", "quantity", 10); nlapi...
// Which line has item 456 on it... // ... if we're in the context of a record var index = nlapiFindLineItemValue("item", "item", 456); if (index > -1) { // we found it... } else { // item 456 is not in the list } // ... or if we have a reference to the rec...
// How many lines in a sublist in SuiteScript 2.0... require(["N/record"], function (r) { var rec = r.load({ "type": r.Type.SALES_ORDER, "id": 123 }); // How many lines are on the Items sublist? var itemCount = rec.getLineCount...
// Working with a sublist in Standard Mode in SuiteScript 2.0... require(["N/record"], function (r) { var rec = r.create({ "type": r.Type.SALES_ORDER, "isDynamic": false }); // Set relevant body fields ... // Add line item 45...
// 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...
@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')
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...

Page 937 of 1099