Tutorial by Examples: is

bcadd vs float+float var_dump('10' + '-9.99'); // float(0.0099999999999998) var_dump(10 + -9.99); // float(0.0099999999999998) var_dump(10.00 + -9.99); // float(0.0099999999999998) var_dump(bcadd('10', '-9.99', 20)); // string(22) "0.01000000000000000000&q...
Web Forms: Complex Page Life Cycle, whenever a Request is made to the server there are at least 5 methods to execute previous to the event handler. Dificult to work with Client-Side frameworks like JQuery or Angular. Hard to work with Asyncronous Javascript and XML (AJAX) Viewstate handling T...
public class Main extends JavaPlugin { @Override public void onEnable() { Bukkit.getPluginManager().registerEvents(this, this); } @EventHandler public void yourEvent(Event e) { //... } }
Data in R are stored in vectors. A typical vector is a sequence of values all having the same storage mode (e.g., characters vectors, numeric vectors). See ?atomic for details on the atomic implicit classes and their corresponding storage modes: "logical", "integer", "numeri...
Data types to string formatting Data types like int, float, double, long, boolean can be formatted to string using String.valueOf(). String.valueOf(1); //Output -> "1" String.valueOf(1.0); //Output -> "1.0" String.valueOf(1.2345); //Output -> "1.2345" Stri...
This linked list example implements Set abstract data type operations. SinglyLinkedNode class Option Explicit Private Value As Variant Private NextNode As SinglyLinkedNode '"Next" is a keyword in VBA and therefore is not a valid variable name LinkedList class Option Explicit P...
When you want for example enforce the use of the parameter Password if the parameter User is provided. (and vise versa) Function Do-Something { Param ( [Parameter(Mandatory=$true)] [String]$SomeThingToDo, [Parameter(ParameterSetName="Credentials", man...
A synchronous producer-consumer solution ensures that the consumer reads every data item written by the producer exactly one time. Asynchronous solutions allow the consumer to sample the output of the producer. Either the consumer consumes the data faster than it is produced, or the consumer consume...
Some applications may want to create so-called "Fire & Forget" tasks which can be periodically triggered and do not need to return any type of value returned upon completion of the assigned task (for example, purging old temp files, rotating logs, autosaving state). In this example, w...
Here are the steps to generate test skeleton for existing code: Open Eclipse, and choose the project you want to create test cases for In the Package Explorer, select the java class you want to generate the Junit test for Go to File -> New -> Junit Test Cases Change the Source folder to ...
It is often necessary to execute a long-running task and use the result of that task once it has completed. In this example, we will create two classes: One which implements the Callable<T> interface (where T is the type we wish to return), and one which contains a main() method. AsyncValueT...
To leverage distributed cache, you'll have to reference one of the available implementations : Redis Sql server For instance you'll register Redis implemention as follows : public void ConfigureServices(IServiceCollection services) { services.AddDistributedRedisCache(options => ...
At the very core, your entity main DAC must have GUID column (NoteID) to reference CSAnswers table and must have field that identify the class of the Entity. We will make use of Order Type to define list of attributes to gather particular order type-specific information. Create a Graph Extension f...
While using Image/Colour as an background in a CardView, You might end up with slight white paddings (If default Card colour is white) on the edges. This occurs due to the default rounded corners in the Card View. Here is how to avoid those margins in Pre-lollipop devices. We need to use an attribu...
You now need to register the Expander, in order for it to be used by the Razor View Engine. Just add this in the ConfigureServices of your Startup class. public void ConfigureServices(IServiceCollection services) { services.Configure<RazorViewEngineOptions>(options => { opti...
Atom is a hackable text editor created by GitHub and developed on top of the Electron desktop application platform. This means it can be used as a text editor for basic programming up to a full-sized IDE. It is also extremely customisable, it provides thousands of community-made packages (syntax hi...
If exist "C:\Foo\Bar.baz" ( Echo File exist ) This checks if the file C:\Foo\Bar.baz's existence. If this exist, it echos File exist The Not operator can also be added.
If Defined Foo ( Echo Foo is defined ) This would check if a variable is defined or not. Again, the Not operator can be used.
If you create files for exporting via USB cable to desktop using MTP protocol, may be a problem that newly created files are not immediately visible in the file explorer running on the connected desktop PC. To to make new files visible, you need to call MediaScannerConnection: File file = new File(...

Page 87 of 109