Tutorial by Examples: c

There are only 4 character operators, in their order of precedence: OperatorDescription()Parentheses for grouping. Note: VFP documentation, that I have, misses this one. Without this, - operator is almost always useless.+Concatenates (joins) strings side by side.-Concatenates strings by moving the ...
In this example, we trying to create a gui with only through code rather than using any ui file. Its a very basic example you need to extend based on your need." from PyQt4 import QtCore, QtGui import maya.OpenMayaUI as mui import sip class Ui_MainWindow(QtGui.QMainWindow): def __ini...
Many widgets include events which can fire callback functions when the user interacts with the widget. For example when a button is pressed, a checkbox checked, or a dropdown chosen you can fire a function. The exact flag which is associated with these event depends on the widget, but a typical cal...
Sub DisplayExcelVersions() MsgBox "The version of Excel is " & Application.Version MsgBox "The version of the VBE is " & Application.VBE.Version End Sub The use of the Application.Version property is useful for ensuring code only operates on a compatible...
If you want to provide Custom Error Messages you would do it like this: public class LoginViewModel { [Required(ErrorMessage = "Please specify an Email Address")] [EmailAddress(ErrorMessage = "Please specify a valid Email Address")] public string Email { get; set...
This small example shows how you can lose backward compatibility in your programs if you do not take care in advance about this. And ways to get more control of serialization process At first, we will write an example of the first version of the program: Version 1 [Serializable] class Data { ...
Since ConstraintLayout alpha 9, Chains are available. A Chain is a set of views inside a ConstraintLayout that are connected in a bi-directional way between them, i.e A connected to B with a constraint, and B connected to A with another constraint. Example: <android.support.constraint.Constrain...
To encrypt data with a public key: final Cipher rsa = Cipher.getInstance("RSA"); rsa.init(Cipher.ENCRYPT_MODE, keyPair.getPublic()); rsa.update(message.getBytes()); final byte[] result = rsa.doFinal(); System.out.println("Message: " + message); System.out.println("...
import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.util.HashMap; import java.util.Map; import java.util.Objects; @Path("/alphabet/{letter}") public class AlphabetResource { private final Map<String, String> alphabet; public AlphabetResource(...
When adding custom fields to a Lucene index you can add new fields into the index using the following configuration: <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration"> <indexAllfields>false</indexAllfields> <fieldNames hint=...
Encog is an easy to use java neural network engine public static double XOR_INPUT[][] = { { 0.0, 0.0 }, { 1.0, 0.0 }, { 0.0, 1.0 }, { 1.0, 1.0 } }; public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 1.0 }, { 0.0 } }; public static void main(final String args[]) { /...
First step : PCL part using Xamarin.Forms; namespace ProjectNamespace { public class ExtendedFrame : Frame { /// <summary> /// The corner radius property. /// </summary> public static readonly BindableProperty CornerRadiusProperty = ...
You can enable/disable ajax and client validations in active form. $form = ActiveForm::begin([ 'id' => 'signup-form', 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'validationUrl' => Url::to('signup'), ]); enableClientValidation is by defaul...
Swift Import the Core Motion library: import CoreMotion Next, we need to create a CMAltimeter object, but a common pitfall is to create it in the viewDidLoad(). If done that way, the altimeter won’t be accessible when we need to call a method on it. Nevertheless, go ahead and create your CMAlti...
Sources and sinks are objects that know how to open streams. BytesCharsReadingByteSourceCharSourceWritingByteSinkCharSink Creating sources and sinks Note: for all examples, consider UTF_8 as if the following import is set: import static java.nio.charset.StandardCharsets.UTF_8; Reading from a ...
Sometimes you have sensitive information in your VBA (e.g., passwords) that you don't want users to have access to. You can achieve basic security on this information by password-protecting your VBA project. Follow these steps: Open your Visual Basic Editor (Alt + F11) Navigate to Tools -> V...
Of course, just like most things in browser JavaScript, you just can't count on the fact that everything will be the same everywhere. In this case, requestAnimationFrame might have a prefix on some platforms and are named differently, such as webkitRequestAnimationFrame. Fortunately, there's a reall...
In many situations, a composite index performs better than an index with a single column. To build an optimal composite index, populate it with columns in this order. = column(s) from the WHERE clause first. (eg, INDEX(a,b,...) for WHERE a=12 AND b='xyz' ...) IN column(s); the optimizer may be...
call :FunctionX rem More code... :FunctionX rem Some code here. goto :eof This is a very simple function. Functions are in-program commands that do multiple commands at a time. Functions are made by creating a label and putting code in it, and once it is done, you add a goto :eof or exit ...
call :tohex 14 result rem More code... :tohex <innum> <outvar> set dec=%1 set outvar=%~2 rem %n and %~n are functionally identical, but %~n is slightly safer. goto :eof This takes the additional parameters from the call as if the function was a separate Batch file. Note: the ...

Page 627 of 826