Tutorial by Examples

After you have set up Firebase to your IOS Project following the documentation for setting up firebase for IOS in other firebase related documentation you can get going with firebase. If you haven't already added the database pod to your Podfile do so now by adding pod Firebase/Database in ...
D is a system programming language and thus allows you to manually manage and mess up your memory. Nevertheless, D uses a garbage collector per default to free unused memory. D provides pointer types T* like in C: void main() { int a; int* b = &a; // b contains address of a aut...
A new memory block on the heap is allocated using the new expression, which returns a pointer to the managed memory: void main() { int* a = new int; *a = 42; // dereferencing import std.stdio : writeln; writeln("a: ", *a); }
As soon as the memory referenced by a isn't referenced anymore through any variable in the program, the garbage collector will free its memory. D also allows pointer arithmetic, except in code that is marked as @safe. void safeFun() @safe { writeln("Hello World"); // allocatin...
add_action('init', 'process_post_data'); function process_post_data() { if( isset( $_POST ) ) { // process $_POST data here } }
add_action('init', 'process_get_data'); function process_get_data() { if( isset( $_GET ) ) { // process $_GET data here } }
add_action( 'init', function() { register_post_type( 'event', array( 'public' => true, 'label' => 'Events' ); ); }); Registers a new custom post type with a label Events and a slug event
An example how to run stripe out of the box with wsgi from a single file. At first, please install the python stripe API, i.e. with pip: pip install --user stripe Create payment.py which creates a WSGI webserver at port 8000 out of the box html = """ <html> <body> ...
You will need the guice-bridge in your project. @ApplicationPath("api") public class ApiRest extends ResourceConfig { @Inject public ApiRest(ServiceLocator serviceLocator, ServletContext servletContext) { packages("net.sargue.app.api"); GuiceBrid...
Please note that this example uses OpenCV 3.1. import org.opencv.core.Mat; import org.opencv.core.MatOfRect; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; import org.opencv.o...
This example introduces the VideoCapture class, where we use it to take an image from a webcam and save it to an image. import org.opencv.core.Mat; import org.opencv.core.MatOfRect; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.imgc...
This example by Daniel Baggio was taken directly from this StackExchange answer, but has been reposted for visibility. This class takes an Mat object and returns the BufferedImage object used by the javax.swing libraries. This can be used by a Graphics object to draw the image. private BufferedIma...
This example uses Dice and the black spots on the dice (the pips) as our object. As the example is quite long, first explaining some key concepts is critical to understanding the example. Understanding the first example, "Getting a static image, detecting items on it, and outputting the result...
//Create a layout var tableLayout = new sap.ui.commons.layout.MatrixLayout({ layoutFixed : false, columns : 2, width : "100%", height : "100%", widths : [ "20%","80%"] }).addStyleClass('dsAvailLayout'); sap.ui.table.Table.extend(...
To submit form via Ajax with Jquery : <div id="yourPanel" th:fragment="yourFragment"> <form id="yourForm" method="POST" th:action="@{/actions/postForm}" th:object="${yourFormBean}">...
You can use the raw interpolator if you want a String to be printed as is and without any escaping of literals. println(raw"Hello World In English And French\nEnglish:\tHello World\nFrench:\t\tBonjour Le Monde") With the use of the raw interpolator, you should see the following printed in the ...
Zero values or zero initialization are simple to implement. Coming from languages like Java it may seem complicated that some values can be nil while others are not. In summary from Zero Value: The Go Programming Language Specification: Pointers, functions, interfaces, slices, channels, and maps ...
To implement the create functionality we need two actions: GET and POST. The GET action used to return view which will show a form allowing user to input data using HTML elements. If there are some default values to be inserted before user adding any data, it should be assigned to the view mode...
@model ContosoUniversity.Models.Student //The Html.BeginForm helper Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. @using (Html.BeginForm()) { //Generates a hidden form field (anti-for...
By the url ~/Student/Details/5 being: (~: site root, Student: Controller, Details: Action, 5: student id), it is possible to retrieve the student by its id. // GET: Student/Details/5 public ActionResult Details(int? id) { // it good practice to consider that things could go wrong...

Page 875 of 1336