Tutorial by Examples

The following query returns the documents which have an element named "company" - cts:element-value-query( xs:QName('company'), '*', ("wildcarded"))) The following query returns the documents which have an element named "company" with an attribute named "name&...
The :last-of-type selects the element that is the last child, of a particular type, of its parent. In the example below, the css selects the last paragraph and the last heading h1. p:last-of-type { background: #C5CAE9; } h1:last-of-type { background: #CDDC39; } <div class="c...
For example, please consider the following URI: http://stackoverflow.com/questions/some-number/how-can-i-do-this/others Segment allows to retrieve a specific segment form URI string where n is a segment number. Segments are numbered from left to right. For example, the following code: $this-&gt...
The example is for illustration purpose of using libraries and helpers and not a valid code. Do not copy / paste it on your projects. HELPER helpers/sendEmail_helper.php if ( ! function_exists('sendEmail')) { function sendEmail($email, $subject, $message, $lang, $cc = null, $file = null) { ...
First you need to load the email library. Do this either in the controller file that will be sending the email: $this->load->library('email'); Or load it globally in the autoload.php file in the config folder: $autoload['libraries'] = array('email'); While you're there, you may want t...
Create a new file in the application/config folder named email.php Set the parameters for sending email. These will load when you send your email. $config['newline'] = "\r\n"; //You must use double quotes on this one $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmai...
$this->email->from('[email protected]', 'Tom Webmaster'); $this->email->to('[email protected]', 'Freddie Fakeperson'); $this->email->subject('Your Account Is Active'); $this->email->message('Welcome to our new site!'); In the 'from' method, the first parameter is the...
$sent = $this->email->send(); //This is optional - but good when you're in a testing environment. if(isset($sent)){ echo "It sent!"; }else{ echo "It did not send."; }
But you don't just want a plain text email. You want a pretty html email. Set your config file as html: $config['mailtype'] = 'html'; If you want to pass data (like a username for example) to the html email, put them in an array: $data = array('name' => $name, 'email' => ...
Error handling in AppleScript uses try on error. The code which may throw an error goes in the try block and any error handling code is in the on error block. The on error block is closed using end try. foo is not defined, so throws an error. When an error occurs, the dialog is displayed. try ...
There’s no API that can rename the blob file on Azure. This code snippet demonstrates how to rename a blob file in Microsoft Azure Blob Storage. StorageCredentials cred = new StorageCredentials("[Your storage account name]", "[Your storage account key]"); CloudBlobContainer c...
using System; using System.Collections.Generic; using System.Linq; using System.Numerics; // also add reference to System.Numberics namespace ConsoleApplication33 { class Program { private static IEnumerable<BigInteger> Fibonacci() { BigInteger p...
This example shows how to update a UI component from a background thread by using a SynchronizationContext void Button_Click(object sender, EventArgs args) { SynchronizationContext context = SynchronizationContext.Current; Task.Run(() => { for(int i = 0; i < 10; i++) ...
To Illustrate the MERGE Statement, consider the following two tables - dbo.Product : This table contains information about the product that company is currently selling dbo.ProductNew: This table contains information about the product that the company will sell in the future. The foll...
Use EXCEPT to prevent updates to unchanged records MERGE TargetTable targ USING SourceTable AS src ON src.id = targ.id WHEN MATCHED AND EXISTS ( SELECT src.field EXCEPT SELECT targ.field ) THEN UPDATE SET field = src.field WHEN...
Tuples can be used to return multiple values from a method without using out parameters. In the following example AddMultiply is used to return two values (sum, product). void Write() { var result = AddMultiply(25, 28); Console.WriteLine(result.Item1); Console.WriteLine(result.Item2...
Feather is an implementation of Apache Arrow designed to store data frames in a language agnostic manner while maintaining metadata (e.g. date classes), increasing interoperability between Python and R. Reading a feather file will produce a tibble, not a standard data.frame. library(feather) pat...
If you want to parse more complex command-line arguments, e.g. with optional parameters, than the best is to use google's GWT approach. All classes are public available at: https://gwt.googlesource.com/gwt/+/2.8.0-beta1/dev/core/src/com/google/gwt/util/tools/ToolBase.java An example for handling ...
The power of AppleScript lies in being able to automate many Mac applications. To find out what you can automate, you need to read an app's scripting dictionary. To do so, launch Script Editor, and select File > Open Dictionary… Once you choose an app, its dictionary will open up in a new win...
C++14 It is often useful to define classes or structures that have a variable number and type of data members which are defined at compile time. The canonical example is std::tuple, but sometimes is it is necessary to define your own custom structures. Here is an example that defines the structure ...

Page 754 of 1336