Tutorial by Examples

With regards to reserved words there is a small distinctions between the "Identifiers" used for the likes of variable or function names and the "Identifier Names" allowed as properties of composite data types. For example the following will result in an illegal syntax error: va...
In order to play a sound using the SoundEffect type, create a variable to hold the loaded sound. Typically this would be an instance variable in the Game class: private SoundEffect mySound; Then, in the LoadContent() method of the Game class: protected override void LoadContent() { // l...
In order to generate an RSA key, an EVP_PKEY must first be allocated with EVP_PKEY_new: EVP_PKEY *pkey; pkey = EVP_PKEY_new(); An exponent for the key is also needed, which will require allocating a BIGNUM with BN_new and then assigning with BN_set_word: BIGNUM *bn; bn = BN_new(); BN_set_wor...
An EVP_PKEY can be saved directly to disk in a several formats. PEM_write_PrivateKey is used to save EVP_PKEY in a PEM format: FILE *f; f = fopen("key.pem", "wb"); PEM_write_PrivateKey( f, /* use the FILE* that was opened */ pkey, /* EV...
To load a private key directly from disk, use the PEM_read_PrivateKey function: FILE *f; EVP_PKEY *pkey; f = fopen("key.pem", "rb"); PEM_read_PrivateKey( f, /* use the FILE* that was opened */ &pkey, /* pointer to EVP_PKEY structure */ NULL, /* passwor...
In most cases all data that is accessed by several threads should be initialized before the threads are created. This ensures that all threads start with a clear state and no race condition occurs. If this is not possible once_flag and call_once can be used #include <threads.h> #include &lt...
Function composition allows for two functions to operate and be viewed as a single function. Expressed in mathematical terms, given a function f(x) and a function g(x), the function h(x) = f(g(x)). When a function is compiled, it is compiled to a type related to Function1. Scala provides two method...
Basic Text Email <?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->Subject = "Subject Text"; $mail->Body ...
<?php $to = '[email protected]'; $subject = 'Email Subject'; $message = 'This is the email message body'; $attachment = '/path/to/your/file.pdf'; $content = file_get_contents($attachment); /* Attachment content transferred in Base64 encoding MUST be split into chunk...
<?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->addAddress("[email protected]", "Recepient Name&quot...
<?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->Subject = "Subject Text"; $mail->Body = "This is...
Basic Text Email <?php $sendgrid = new SendGrid("YOUR_SENDGRID_API_KEY"); $email = new SendGrid\Email(); $email->addTo("[email protected]") ->setFrom("[email protected]") ->setSubject("Subject Text") ->setTex...
<?php $sendgrid = new SendGrid("YOUR_SENDGRID_API_KEY"); $email = new SendGrid\Email(); $email->addTo("[email protected]") ->setFrom("[email protected]") ->setSubject("Subject Text") ->setText("This is a ...
Scope testing & output of model <div ng-app="demoApp" ng-controller="mainController as ctrl"> {{$id}} <ul> <li ng-repeat="item in ctrl.items"> {{$id}}<br/> {{item.text}} </li> ...
Packages in PLSQL are a collection of procedures, functions, variables, exceptions, constants, and data structures. Generally the resources in a package are related to each other and accomplish similar tasks. Why Use Packages Modularity Better Performance/ Funtionality Parts of a Package S...
In JavaScript, the JSON object is used to parse a JSON string. This method is only available in modern browsers (IE8+, Firefox 3.5+, etc). When a valid JSON string is parsed, the result is a JavaScript object, array or other value. JSON.parse('"bar of foo"') // "bar of foo" (t...
Probably the two most popular free implementations of Common Lisp are Clozure Common Lisp (CCL) and Steel Bank Common Lisp (SBCL). They are both available for a variety of platforms including Linux on x86-64 and Linux on ARM. CCL: http://ccl.clozure.com/download.html SBCL: http://www.sbcl.org/gett...
A BlockingQueue is an interface, which is a queue that blocks when you try to dequeue from it and the queue is empty, or if you try to enqueue items to it and the queue is already full. A thread trying to dequeue from an empty queue is blocked until some other thread inserts an item into the queue. ...
Constraint created as NSLayoutConstraint(item: myView, attribute: NSLayoutAttribute.Leading, relatedBy: NSLayoutRelation.Equal, toItem: view, attribute: NSLayoutAttribute.LeadingMargin, multiplier: 1.0, constant: 20.0) or, from math point of view: view.attribute * multiplier + constant ...
The following function finds the maximal element in an array: int find_max(const int *array, size_t len) { int max = INT_MIN; for (size_t i = 0; i < len; i++) { if (max < array[i]) { max = array[i]; } } return max; } The input size is the...

Page 649 of 1336