Tutorial by Examples: al

Standard Allocation The C dynamic memory allocation functions are defined in the <stdlib.h> header. If one wishes to allocate memory space for an object dynamically, the following code can be used: int *p = malloc(10 * sizeof *p); if (p == NULL) { perror("malloc() failed");...
In PHP, a fatal error is a kind of error that cannot be caught, that is, after experiencing a fatal error a program does not resume. However, to log this error or somehow handle the crash you can use register_shutdown_function to register shutdown handler. function fatalErrorHandler() { // Let...
If the variable contains a value of an immutable type (e.g. a string) then it is okay to assign a default value like this class Rectangle(object): def __init__(self, width, height, color='blue'): self.width = width self.height = height self.color = color d...
XSLT is a special-purpose programming language; it is widely used for transforming XML documents either into a different XML format, into HTML, or into text-based formats. There are two main versions of XSLT in use: XSLT 1.0 and XSLT 2.0. XSLT 1.0 is more widely implemented but has many restriction...
Visit https://download.racket-lang.org and choose between the two available distributions: Racket is the main distribution, it comes with several additional packages like math/number-theory as well as the DrRacket IDE. Minimal Racket is far smaller and comes only with the needed packages. Ins...
Ansible maintains a PPA repository that can be used to install the Ansible binaries: sudo apt-add-repository ppa:ansible/ansible -y sudo apt-get update && sudo apt-get install ansible -y To install a specific version, use pip. The PPA may be out of date.
There are two main ways way to install Ansible on OS X, either using the Homebrew or Pip package manager. If you have homebrew, the latest Ansible can be installed using the following command: brew install ansible To install Ansible 1.9.X branch use following command: brew install homebrew/ver...
The virtualenvwrapper utility simplifies working with virtual environments and is especially useful if you are dealing with many virtual environments/projects. Instead of having to deal with the virtual environment directories yourself, virtualenvwrapper manages them for you, by storing all virtual...
The OR (||) operator returns true if one of its two operands evaluates to true, otherwise it returns false. For example, the following code evaluates to true because at least one of the expressions either side of the OR operator is true: if (10 < 20) || (20 < 10) { print("Expression...
MKLocalSearch allows users to search for location using natural language strings like "gym". Once the search get completed, the class returns a list of locations within a specified region that match the search string. Search results are in form of MKMapItem within MKLocalSearchResponse ob...
The following is the original "Hello, World!" program from the book The C Programming Language by Brian Kernighan and Dennis Ritchie (Ritchie was the original developer of the C programming language at Bell Labs), referred to as "K&R": K&R #include <stdio.h> ma...
Python 3.x3.3 Use yield from if you want to yield all values from another iterable: def foob(x): yield from range(x * 2) yield from range(2) list(foob(5)) # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1] This works with generators as well. def fibto(n): a, b = 1, 1 while True: ...
Given this setup code: var dict = new Dictionary<int, string>() { { 1, "First" }, { 2, "Second" }, { 3, "Third" } }; You may want to read the value for the entry with key 1. If key doesn't exist getting a value will throw KeyNotFoundException,...
The following code is for iOS 8 and lower for creating a login alert. // Create the UIAlertView var loginAlertView = new UIAlertView(title, message, null, cancelTitle, okTitle); // Setting the AlertViewStyle to UIAlertViewStyle.LoginAndPasswordInput loginAlertView.AlertViewStyle = UIAlertViewS...
To install Eclipse, go to the Eclipse Downloads Web page where there is usually a direct link to download the latest version of Eclipse. Starting Eclipse Mars (version 4.5), an installer can be downloaded which guides you through the installation procedure, as opposed to downloading the whole instal...
Option Explicit Sub LoopAllSheets() Dim sht As Excel.Worksheet ' declare an array of type String without committing to maximum number of members Dim sht_Name() As String Dim i As Integer ' get the number of worksheets in Active Workbook , and put it as the maximum number of members in t...
MSBuild 2015 On Windows there are three choices to get MSBuild: Install Visual Studio 2015 Download Microsoft Build Tools which includes VB and C# compilers. Build from Source On Linux Build from Source using this guide
1) scikit learn scikit-learn is a Python module for machine learning built on top of SciPy and distributed under the 3-Clause BSD license. It features various classification, regression and clustering algorithms including support vector machines, random forests, gradient boosting, k-means and DBSCA...
Key Value Coding is integrated into NSObject using NSKeyValueCoding protocol. What this means? It means that any id object is capable of calling valueForKey method and its various variants like valueForKeyPath etc. ' It also means that any id object can invoke setValue method and its various vari...
Google Apps Script does not require setup or installation. The only requirement is a Google Account. A Gmail account works as well as a Google Apps for Work/Education/Government account. You can create a new Google account by going to accounts.google.com Start your first script by going to script.g...

Page 29 of 269