Tutorial by Examples: ce

object CommonUtils { var anyname: String ="Hello" fun dispMsg(message: String) { println(message) } } From any other class, just invoke the variable and functions in this way: CommonUtils.anyname CommonUtils.dispMsg("like static call")
The function Emitter.listenerCount(eventName) will return the number of listeners that are currently listening for the event provided as argument const EventEmitter = require("events"); class MyEmitter extends EventEmitter{} var emitter = new MyEmitter(); emitter .on("data&quot...
The typical scenario for your memory usage is to store the source data and the processed data in the global memory. When a threadblock starts, it first copies all relevant parts into the shared memory before getting their parts into the registers. Memory access latency also depends on your memory s...
OpenCL Kernels can be either executed on the GPU or the CPU. This allows for fallback solutions, where the customer may have a very outdated system. The programmer can also choose to limit their functionality to either the CPU or GPU. To get started using OpenCL, you'll need a 'Context' and a 'Devi...
To make your APK file as small as possible, you should enable shrinking to remove unused code and resources in your release build. This page describes how to do that and how to specify what code and resources to keep or discard during the build. Code shrinking is available with ProGuard, which dete...
An inner class which is visible to any outside class can be created from this class as well. The inner class depends on the outside class and requires a reference to an instance of it. To create an instance of the inner class, the new operator only needs to be called on an instance of the outer cla...
To discovery all the available print services, we can use the PrintServiceLookup class. Let's see how: import javax.print.PrintService; import javax.print.PrintServiceLookup; public class DiscoveringAvailablePrintServices { public static void main(String[] args) { discoverPrintS...
To discovery the default print service, we can use the PrintServiceLookup class. Let's see how:: import javax.print.PrintService; import javax.print.PrintServiceLookup; public class DiscoveringDefaultPrintService { public static void main(String[] args) { discoverDefaultPrintSer...
A print job is a request of printing something in a specific print service. It consists, basically, by: the data that will be printed (see Building the Doc that will be printed) a set of attributes After picking-up the right print service instance, we can request the creation of a print job...
The problem statement is like if we are given two string str1 and str2 then how many minimum number of operations can be performed on the str1 that it gets converted to str2. Implementation in Java public class EditDistance { public static void main(String[] args) { // TODO Auto-generated ...
If we are given with the two strings we have to find the longest common sub-sequence present in both of them. Example LCS for input Sequences “ABCDGH” and “AEDFHR” is “ADH” of length 3. LCS for input Sequences “AGGTAB” and “GXTXAYB” is “GTAB” of length 4. Implementation in Java public class LC...
The recommended way is to write a component, and attach it to the scene element. The scene and its children will be initialized before this component. AFRAME.registerComponent('do-something', { init: function () { var sceneEl = this.el; } }); <a-scene do-something></a-scene...
$logger = $container->get('logger'); This will fetch the service with the service ID "logger" from the container, an object that implements Psr\Log\LoggerInterface.
To use Processing in Eclipse, start by creating a new Java project. Then, select File > Import and then choose General > File System to locate the core.jar file. It can be found in PATH_TO_PROCESSING/core/library/ for Windows or /Applications/Processing 3.app/Contents/Java/core/library/ for Ma...
##= # The variable $Bit will hold either 64 or 32 depending on system architecture # This is used with all the ${Service::} macros # Use this in the beginning of your code. # This snippet should only be used once. # Var Bit System::Call "kernel32::GetCurrentProcess()i.s" System::C...
##= #= Service::QueryConfig # # USAGE: # ${Service::QueryConfig} "NAME" /DISABLEFSR $0 $1 # # ::QueryConfig = The service's binary path is returned. # NAME = The Service name # /DISABLEFSR = Disables redirection if x64. Use "" to skip. # $0 ...
##= #= Service::State # # USAGE: # ${Service::State} "NAME" /DISABLEFSR $0 $1 # # ::State = The service's status is returned. # NAME = The Service name # /DISABLEFSR = Disables redirection if x64. Use "" to skip. # $0 = Return after call...
##= #= Service::Start # # USAGE: # ${Service::Start} "NAME" /DISABLEFSR $0 $1 # # ::Start = Start a service. # NAME = The Service name # /DISABLEFSR = Disables redirection if x64. Use "" to skip. # $0 = Return after call # $1 ...
##= #= Service::Stop # # USAGE: # ${Service::Stop} "NAME" /DISABLEFSR $0 $1 # # ::Stop = Sends a STOP control request to a service. # NAME = The Service name # /DISABLEFSR = Disables redirection if x64. Use "" to skip. # $0 = Return aft...
##= #= Service::Remove # # USAGE: # ${Service::Remove} "NAME" /DISABLEFSR $0 $1 # # ::Remove = Deletes a service entry from the registry. # NAME = The Service name # /DISABLEFSR = Disables redirection if x64. Use "" to skip. # $0 = Return...

Page 127 of 134