Tutorial by Examples: c

If your page is for displaying or editing information about a particular type of record, it may be helpful to use a standard controller to reduce the amount of boilerplate code you need to write. By using a standard controller, your page will be displayed with an ?id=SALESFORCE_ID parameter, and yo...
It is a good practice to encrypt your Web.config file if you have sensitive information there, for example a connection string with password. With the ASP.NET IIS Registration tool (Aspnet_regiis.exe) you can easily encrypt specific sections of Web.config file. A command with elevated privileges is...
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); }
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
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 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...
You will have to import UserNotifications @import UserNotifications; 2.Request authorization for localNotification let center = UNUserNotificationCenter.current() center.requestAuthorization([.alert, .sound]) { (granted, error) in // Enable or disable features based on authorizat...
A book explaining how Vimscript works, full of examples. It can be found on http://learnvimscriptthehardway.stevelosh.com/
For this the best solution is using actions. To add a new action to an actors in Scene2D just call: Action action = Actions.moveTo(x,y,duration); actorObject.addAction(action); Where x and y is the target location and duration is the speed of this movement in seconds(float). If you want to sto...
Start from a Cython program with a entrypoint: def do_stuff(): cdef int a,b,c a = 1 b = 2 c = 3 print("Hello World!") print([a,b,c]) input("Press Enter to continue.") Create a setup.py file in the same folder: from distutils.core import set...
Represents the definition of a single approval process. Use this object to read the description of an approval process. The definition is read-only. We can not modify the record created in ProcessDefinition Object. But we can describe, query, search and retrieve the approval processes information. ...

Page 543 of 826