Tutorial by Examples: c

Introduction The PXSelectorAttribute attribute (also referred to as the selector), while vital and frequently used, has however two major drawbacks: It gives an uninformative message "<object_name> cannot be found in the system" if no items are found to satisfy the selector condi...
An anonymous function can be defined without a name through a Lambda Expression. For defining these type of functions, the keyword lambda is used instead of the keyword defun. The following lines are all equivalent and define anonymous functions which output the sum of two numbers: (lambda (x y) (...
# Print the working directory import os print os.getcwd() # C:\Python27\Scripts # Set the working directory os.chdir('C:/Users/general1/Documents/simple Python files') print os.getcwd() # C:\Users\general1\Documents\simple Python files # load pandas import pandas as pd # read a csv d...
/* This function returns TRUE if input is the letter "b" and false otherwise */ FUNCTION isTheLetterB RETURNS LOGICAL (INPUT pcString AS CHARACTER): IF pcString = "B" THEN RETURN TRUE. ELSE RETURN FALSE. END FUNCTION. /* Calling the function with "b&qu...
A function can be forward declared, this is similar to specifications in a C header file. That way the compiler knows that a function will be made available later on. Without forward declarations the function MUST be declared before it's called in the code. The forward declaration consists of the...
For syncing all folders in both direction, insert this into your Vagrantfile config.vm.synced_folder "my-project1", "/home/vagrant/my-project1"
For syncing all folders in both direction, insert this into your Vagrantfile: config.vm.synced_folder "my-project1", "/home/vagrant/my-project1", type: "rsync", :rsync__exclude => ['my-project1/mini_project2/target,my-project1/mini_project2/target,my-project1/mini...
<%@ WebService Language="C#" Class="Util" %> using System; using System.Web.Services; public class Util: WebService { [WebMethod] public int CalculatorAdd(int operandA, int operandB) { return operandA + operandB; } [WebMethod] ...
const timeFormat = "15 Monday January 2006" func ParseDate(s string) (time.Time, error) { t, err := time.Parse(timeFormat, s) if err != nil { // time.Time{} returns January 1, year 1, 00:00:00.000000000 UTC // which according to the source code is the zero va...
TTL value can be used to decide for how long the document needs to be there in the bucket. By default TTL value is 0, which means it will be there for indefinite time period. String bucketName = "bucket"; List<String> nodes = Arrays.asList("node1","node2"); // I...
function getCombinations(params, combinationsResults){ if(params.length == 0) return combinationsResults; var head = params[0]; var tail = params.slice(1); var combinationsResultsCurrent = []; if(Array.isArray(head)){ _.uniq(head).forEach(function(item){ ...
To generate characters, you can utilize the thread-local random number generator function, random. fn main() { let tuple = rand::random::<(f64, char)>(); println!("{:?}", tuple) } For occasional or singular requests, such as the one above, this is a reasonable efficien...
The procedures Create, Put_Line, Close from the package Ada.Text_IO is used to create and write to the file file.txt. with Ada.Text_IO; procedure Main is use Ada.Text_IO; F : File_Type; begin Create (F, Out_File, "file.txt"); Put_Line (F, "This string will be writ...
To mock a protected member you must first include the following at the top of your test fixture: using Moq.Protected; You then call Protected() on your mock, after which you can use the generic Setup<> with the return type of your method. var mock = new Mock<MyClass>(); mock.Protec...
/* In all versions of Progress ABL you can write multi line comments */ /* They can also span a single line */ //Starting with version 11.6 you can also write single line comments //Can you nest single line comments? //Yes you can string = "HELLO". //A single line comme...
See recursion A function can call itself and thereby recurse. FUNCTION factorial INTEGER (num AS INTEGER). IF num = 1 THEN RETURN 1. ELSE RETURN num * factorial(num - 1). END FUNCTION. DISPLAY factorial(5). With standard settings (startup parameter) the Pro...
A keyword is "MONARCHY" then the matrix will look like The matrix is constructed by filling in the letters of the keyword (minus duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix with the remaining letters in alphabetic order. Plai...
Let's say we have a model called product. class Product(models.Model): name = models.CharField(max_length=100) price = models.IntegerField() Now we are going to declare a model serializers for this model. from rest_framework.serializers import ModelSerializer class ProductSerialize...
Using the + operator you can easily concatenate two or more strings. DEFINE VARIABLE cString AS CHARACTER NO-UNDO. cString = "HELLO". cString = cString + " " + "GOODBYE". DISPLAY cString FORMAT "X(20)".
How to reference any accessible folder. How to get the full name of a referenced folder. A pair of routines that together will list every folder within every accessible store. A routine to move a folder from one parent folder to another.

Page 692 of 826