Tutorial by Examples: l

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...
Ways to create a file with the echo command: echo. > example.bat (creates an empty file called "example.bat") echo message > example.bat (creates example.bat containing "message") echo message >> example.bat (adds "message" to a new line in example.bat)...
Ways to create a file with the echo command: ECHO. > example.bat (creates an empty file called "example.bat") ECHO message > example.bat (creates example.bat containing "message") ECHO message >> example.bat (adds "message" to a new line in example.bat)...
In OpenCV, images can be RGB/BGR, HSV, grayscaled, black-white and so on. It is crucial to know the data type before dealing with images. The image data types are mainly CV_8UC3 (Matrix of uchar with 3 channels) and CV_8U (Matrix of uchar with 1 channel), however, the conversion to other types such...
Activate Developer Mode: Login to odoo application. After login user may see several odoo menu's. Click on setting menu. Click on 'Activate the developer mode' which is located at right-bottom corner of settings page. Developer mode now activated.
Teacher Class: class Teacher { private String name; private double salary; private String subject; public Teacher (String tname) { name = tname; } public String getName() { return name; } private double getSal...
Android now supports devices with 512MB of RAM. This documentation is intended to help OEMs optimize and configure Android 4.4 for low-memory devices. Several of these optimizations are generic enough that they can be applied to previous releases as well. Enable Low Ram Device flag We are introduc...
There are two main functions in Redis (HSET and HMSET) for adding fields to a hash key. Both functions are available in redis-py. Using HSET: import redis r = redis.StrictRedis(host='myserver', port=6379, db=0) r.hset('my_key', 'field0', 'value0') Using HMSET: import redis r = redis.St...
Swift 3 Serial Queue func serialQueues () { let serialQueue = DispatchQueue(label: "com.example.serial") //default queue type is a serial queue let start = Date () for i in 0...3 { //launch a bunch of tasks serialQueue.a...
This example echoes the special character ! into a file. This would only work when DelayedExpansion is disabled. When delayed expansion in enabled, you will need to use three carets and an exclamation mark like this: @echo off setlocal enabledelayedexpansion echo ^^^!>file echo ^>>&...
Redis allows you to add items to either the right or the left of a list. If I was working with a list, my_list and I wanted to prepend 3 to the list, I could do that using the Redis LPUSH command: LPUSH my_list 3 If I wanted to append 3 to my_list, I would instead use the RPUSH command: RPUSH ...
Redis provides the LPOP and RPOP commands as a counterpart to the LPUSH and RPUSH commands for fetching data items. If I was working with a list my_list that had several data items in it already, I can get the first item in the list using the LPOP command: LPOP my_list The result of this comman...
Openfire it's available to download at Ignite Realtime website It's also possible to download relative source codeenter link description here Windows installer: Just execute the exe and follow basic instructions as any program (installation directory, shortcut etc.). Unix-Linux-Mac install:...
You can enhance your kernel by adding new I/O schedulers if needed. Globally, governors and schedulers are the same; they both provide a way how the system should work. However, for the schedulers it is all about the input/output datastream except for the CPU settings. I/O schedulers decide how an u...
The size of a Redis list can be deterimed using the LLEN command. If I have a four element list stored at the key my_list, I can get the size using: LLEN my_list which will return 4. If a user specifies a key that doesn't exist to LLEN, it will return a zero, but if a key is used that points t...
/** * Resizes an image using a Graphics2D object backed by a BufferedImage. * @param srcImg - source image to scale * @param w - desired width * @param h - desired height * @return - the new resized image */ private BufferedImage getScaledImage(Image srcImg, int w, int h){ //Cre...
Be aware that the WebBrowser control is not sympathetic to your XAML definition, and renders itself over the top of other things. For example, if you put it inside a BusyIndicator that has been marked as being busy, it will still render itself over the top of that control. The solution is to bind th...
Selection sort is noted for its simplicity. It starts with the first element in the array, saving it's value as a minimum value (or maximum, depending on sorting order). It then itterates through the array, and replaces the min value with any other value lesser then min it finds on the way. That min...
Since we have many different algorithms to choose from, when we want to sort an array, we need to know which one will do it's job. So we need some method of measuring algoritm's speed and reliability. That's where Asymptotic analysis kicks in. Asymptotic analysis is the process of describing the ef...

Page 733 of 861