Tutorial by Examples: du

Node js code Sample to start this topic is Node.js server communicating with Arduino via serialport. npm install express --save npm install serialport --save Sample app.js: const express = require('express'); const app = express(); var SerialPort = require("serialport"); var po...
As already mentioned you can declare an unordered map of any type. Let's have a unordered map named first with string and integer type. unordered_map<string, int> first; //declaration of the map first["One"] = 1; // [] operator used to insert the value first["Two"] = 2...
Declaring a DLL procedure to work with different VBA versions: Option Explicit #If Win64 Then Private Declare PtrSafe Sub xLib "Kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) #ElseIf Win32 Then Private Declare Sub apiSleep Lib "Kernel32" Ali...
Option Explicit #If Win64 Then 'Win64 = True, Win32 = False, Win16 = False Private Declare PtrSafe Sub apiCopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (MyDest As Any, MySource As Any, ByVal MySize As Long) Private Declare PtrSafe Sub apiExitProcess Lib "Kern...
#ElseIf Win32 Then 'Win32 = True, Win16 = False Private Declare Sub apiCopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (MyDest As Any, MySource As Any, ByVal MySize As Long) Private Declare Sub apiExitProcess Lib "Kernel32" Alias "ExitProcess" (ByVa...
/** * Apply a radial mask (vignette, i.e. fading to black at the borders) to a bitmap * @param imageToApplyMaskTo Bitmap to modify */ public static void radialMask(final Bitmap imageToApplyMaskTo) { Canvas canvas = new Canvas(imageToApplyMaskTo); final float centerX = imageToApply...
A simple OGL 4.0 GLSL shader program that shows how to map a 2D texture on a mesh. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. The texture matrix defines how the texture is mapped on the mesh. By manipulating the texture matrix, the textu...
A simple OGL 4.0 GLSL shader program that shows the use of a interface block and a uniform block on a Cook-Torrance microfacet light model implementation. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. An Interface Block is a group of GLSL in...
This is an example of a basic GUI with two buttons that change a value stored in the GUI's handles structure. function gui_passing_data() % A basic GUI with two buttons to show a simple use of the 'handles' % structure in GUI building % Create a new figure. f = figure(); ...
app.store.ts import {InjectionToken} from '@angular/core'; import {createStore, Store, compose, StoreEnhancer} from 'redux'; import {AppState, default as reducer} from "../app.reducer"; export const AppStore = new InjectionToken('App.store'); const devtools: ...
In practice, shiny Apps are often very complicated and full of features that have been developed over time. More often than not, those additional details are not necessary to reproduce your issue. It is best if you skip such details when writing MCVE's. WRONG Why is my plot not showing? libra...
Blogger is a blog-publishing service by Google.
For really huge search results, you can use dedicated Map/Reduce script. It is much more inconvenient, but sometimes unavoidable. And sometimes could be very handy. The trick here is, that in Get Input Data stage, you can provide to the NS engine not the actual data (i.e. script result), but just t...
File structure / -src/ awesome.service.ts another-awesome.service.ts awesome.module.ts -index.ts -tsconfig.json -package.json -rollup.config.js -.npmignore Service and module Place your awesome work here. src/awesome.service.ts: export ...
DynamoDB is a Distributed NoSQL database, based on key-value architecture, fully managed by Amazon Web Services. It was designed to provide scalability, redundancy and failover in predictable performance.
Here we can find some useful method using PackageManager, Below method will help to get the app name using package name private String getAppNameFromPackage(String packageName, Context context) { Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATE...
public static void main( String[] args ) throws IOException { // good idea to print the version number, 1.2.0 as of this writing System.out.println(TensorFlow.version()); final int NUM_PREDICTIONS = 1; // load the model Bundle try (SavedModelBundle b = SavedModelB...
For creating custom annotations we need to decide Target - on which these annotations will work on like field level, method level, type level etc. Retention - to what level annotation will be available. For this, we have built in custom annotations. Check out these mostly used ones: @Target...
Two main techniques allow passing data between GUI functions and Callbacks: setappdata/getappdata and guidata (read more about it). The former should be used for larger variables as it is more time efficient. The following example tests the two methods' efficiency. A GUI with a simple button is cre...
Keypoint :- SortedMap interface extends Map. entries are maintained in an ascending key order. Methods of sorted Map : Comparator comparator( ). Object firstKey( ). SortedMap headMap(Object end). Object lastKey( ). SortedMap subMap(Object start, Object end). SortedMap tailMap(Object s...

Page 45 of 47