Tutorial by Examples

<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.dropboxapi.com/2/files/list_folder"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CAINFO, "cacert.pem"); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOP...
var foo = new uint8[12]; var bar = (owned) foo; assert (foo == null); The bar variable will own the value previously owned by foo.
public class Foo : Object { public string prop { construct; get; } } It is meant for interospectable API using GObject Introspection. This is the recommended way for declaring classes.
public class Foo { public string prop { construct; get; } } Pure-Vala and lightweight class. This is useful if you need a compromise between efficiency of a struct and the feature of a full blown GObject class.
[Compact] public class Foo { public string prop; } It is mainly used for writing bindings with specific memory management.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Keys.html#Keys 3 Keys Some Emacs commands are invoked by just one input event; for example, C-f moves forward one character in the buffer. Other commands take two or more input events to invoke, such as C-x C-f and C-x 4 C-f. A key sequenc...
In PostgreSQL you can create Arrays of any built-in, user-defined or enum type. In default there is no limit to an Array, but you can specify it. Declaring an Array SELECT integer[]; SELECT integer[3]; SELECT integer[][]; SELECT integer[3][3]; SELECT integer ARRAY; SELECT integer ARRAY[3]; ...
Say "Hello", Rails To get Rails saying "Hello", you need to create at minimum a controller and a view. A controller's purpose is to receive specific requests for the application. Routing decides which controller receives which requests. Often, there is more than one route t...
As edgeapi suggests, it provides an interface for protecting attributes from end-user assignment. This makes Action Controller parameters forbidden to be used in Active Model mass assignment until they have been whitelisted. In addition, parameters can be marked as required and flow through a prede...
import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Module public class VehicleModule { @Provides @Singleton Motor provideMotor(){ return new Motor(); } @Provides @Singleton Vehicle provideVehicle(){ return new Vehicle(...
Now that you have the providers for your different models, you need to request them. Just as Vehicle needs Motor, you have to add the @Inject annotation in the Vehicle constructor as follows: @Inject public Vehicle(Motor motor){ this.motor = motor; } You can use the @Inject annotation to ...
The connection between the provider of dependencies, @Module, and the classes requesting them through @Inject is made using @Component, which is an interface: import javax.inject.Singleton; import dagger.Component; @Singleton @Component(modules = {VehicleModule.class}) public interface Vehicl...
Now that you have every connection ready, you have to obtain an instance of this interface and invoke its methods to obtain the object you need: VehicleComponent component = Dagger_VehicleComponent.builder().vehicleModule(new VehicleModule()).build(); vehicle = component.provideVehicle(); Toast.m...
Arrays can be passed to proceedures by putting () after the name of the array variable. Function countElements(ByRef arr() As Double) As Long countElements = UBound(arr) - LBound(arr) + 1 End Function Arrays must be passed by reference. If no passing mechanism is specified, e.g. myFunction...
# Getting started First, let’s generate a new Ruby on Rails application: rails new ModularTodo The next step is to generate an engine! cd ModularTodo && rails plugin new todo --mountable We will also create an ‘engines’ folder to store the engines (even if we just have one!). mk...
/** * A SuiteScript 1.0 example of using nlapiSubmitField to update a single field on a related record */ // From a Sales Order, get the Customer ID var customerId = nlapiGetFieldValue("entity"); // Set a comment on the Customer record nlapiSubmitField("customer", c...
/** * A SuiteScript 1.0 example of using nlapiSubmitField to update multiple fields on a related record */ // From a Sales Order, get the Customer ID var customerId = nlapiGetFieldValue("entity"); // Set a Comment and update the Budget Approved field on the Customer record nlap...
/** * A SuiteScript 2.0 example of using N/record#submitFields to update a single field on a related record */ require(["N/record", "N/currentRecord"], function (r, cr) { // From a Sales Order, get the Customer ID var customerId = cr.get().getValue({"field...
/** * A SuiteScript 2.0 example of using N/record#submitFields to update multiple fields on a related record */ require(["N/record", "N/currentRecord"], function (r, cr) { // From a Sales Order, get the Customer ID var customerId = cr.get().getValue({"fiel...
Given a normalized phone number like +178612345678 we will get a formatted number with the provided pattern. private String getFormattedNumber(String phoneNumber) { PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance(); Phonemetadata.NumberFormat numberFormat = new P...

Page 1141 of 1336