Tutorial by Examples

// 1.0 function beforeLoad(type, form, request) { nlapiLogExecution("DEBUG", "Before Load", "type=" + type); } // 2.0 /** * @NApiVersion 2.x * @NScriptType UserEventScript * @NModuleScope SameAccount */ define(["N/log"], function (log) { ...
public void Screenshot() throws Throwable{ final byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES); scenario.embed(screenshot, "image/png"); // ... and embed it in the report. Thread.sleep(1000); } Alternately public static void captureSc...
It's not the best way of iterating through the pixels; however, it's better than cv::Mat::at<T>. Let's assume you have a color image in your folder and you want to iterate each pixels of this image and erase green and red channels(Note that this is an example, you can do this in more optimize...
Range.CurrentRegion is a rectangular range area surrounded by empty cells. Blank cells with formulas such as ="" or ' are not considered blank (even by the ISBLANK Excel function). Dim rng As Range, lastCell As Range Set rng = Range("C3").CurrentRegion ' or Set rng = Shee...
#include <iostream> #include <map> #include <string> using namespace std; class A { public: map<string, string> * mapOfStrings; public: A() { mapOfStrings = new map<string, string>(); } void insertEntry(string const & key, st...
Frontend Interface /** * Entity attribute frontend interface * * Frontend is providing the user interface for the attribute * */ interface Mage_Eav_Model_Entity_Attribute_Frontend_Interface { } Source Interface /** * Entity attribute select source interface * * Source is providing ...
In this example we have a file called file.js. Let's assume that you have to parse an URL using JavaScript and NodeJS querystring module. To accomplish this all you have to do is to insert the following statement in your file: const querystring = require('querystring'); var ref = querystring.pa...
For Visual Studio [NuGet]: The easiest way of installing PhantomJS is by using a NuGet Package Manager. In your project, right click "References", and click on "Manage NuGet Packages" as shown: Then, type "PhantomJS" to the search bar, select it and install it as s...
This is literally the only thing you need to start using RxJava on Android. Include RxJava and RxAndroid in your gradle dependencies: // use the last version compile 'io.reactivex.rxjava2:rxjava:2.1.1' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' RxAndroid main addition to RxJava is a Sche...
The RxLifecycle library makes it easier binding observable subscriptions to Android activities and fragment lifecycle. Keep in mind that forgetting to unsubscribe an Observable can cause memory leaks and keeping your activity / fragment alive event after it has been destroyed by the system. Add th...
var page = require('webpage').create(); page.open('http://www.google.com', function(status) { console.log("Status: " + status); var title = page.evaluate(function() { return document.title; }); console.log("Loaded page: " + title); phantom.exit(); });
CREATE PROCEDURE SprocWithSimpleLoop ( @SayThis VARCHAR(30), @ThisManyTimes INT ) AS BEGIN WHILE @ThisManyTimes > 0 BEGIN PRINT @SayThis; SET @ThisManyTimes = @ThisManyTimes - 1; END RETURN; END GO
Decision boundary when we classify using logistic regression- Decision boundary when we classify using SVM- As it can be observed, SVM tries to maintain a 'gap' on either side of the decision boundary. This proves helpful when we encounter new data. With new data- Logistic regression perform...
This example shows how to validate forms in Spring MVC using Bean Validation API using Java Annotations, without any xml. User will be proposed to input their registration data and validator will check it for validity. Add Dependencies First of all add the following dependencies in your project: ...
Observers are used for listening to livecycle callbacks of a certain model in Laravel. These listeners may listen to any of the following actions: creating created updating updated saving saved deleting deleted restoring restored Here is an example of an observer. UserObserver &l...
Assuming we have the following function: function foo(tab) return tab.a end -- Script execution errors out w/ a stacktrace when tab is not a table Let's improve it a bit function foo(tab) if type(tab) ~= "table" then error("Argument 1 is not a table!", 2) end ...
The standard library comes with a rich collection of lazy iterables (and libraries such as Iterators.jl provide even more). Lazy iterables can be composed to create more powerful iterables in constant time. The most important lazy iterables are take and drop, from which many other functions can be c...
Format: [command] [> | >>] [filename] > saves the output of [command] into [filename]. >> appends the output of [command] into [filename]. Examples: echo Hello World > myfile.txt saves "Hello World" into myfile.txt echo your name is %name% >> myfi...
Set this attribute in your manifest's or element to enable or disable multi-window display: android:resizeableActivity=["true" | "false"] If this attribute is set to true, the activity can be launched in split-screen and freeform modes. If the attribute is set to false, the...
While launching an application firstly main thread is executed. This Main thread handles all the UI concept of application. If we want to run long the task in which we don't need the UI then we use thread for running that task in background. Here is the example of Thread which describes blow: new ...

Page 957 of 1336