Tutorial by Examples

Let f(n) and g(n) be two functions defined on the set of the positive real numbers, c, c1, c2, n0 are positive real constants. Notationf(n) = O(g(n))f(n) = Ω(g(n))f(n) = Θ(g(n))f(n) = o(g(n))f(n) = ω(g(n))Formal definition∃ c > 0, ∃ n0 > 0 : ∀ n ≥ n0, 0 ≤ f(n) ≤ c g(n)∃ c > 0, ∃ n0 > 0 ...
The PHP community has a lot of developers creating lots of code. This means that one library’s PHP code may use the same class name as another library. When both libraries are used in the same namespace, they collide and cause trouble. Namespaces solve this problem. As described in the PHP referenc...
Python changed it's sorting methods to accept a key function. Those functions take a value and return a key which is used to sort the arrays. Old comparison functions used to take two values and return -1, 0 or +1 if the first argument is small, equal or greater than the second argument respectivel...
realloc is conceptually equivalent to malloc + memcpy + free on the other pointer. If the size of the space requested is zero, the behavior of realloc is implementation-defined. This is similar for all memory allocation functions that receive a size parameter of value 0. Such functions may in fact ...
The following MATLAB script shows how to define and call a basic function: myFun.m: function [out1] = myFun(arg0, arg1) out1 = arg0 + arg1; end terminal: >> res = myFun(10, 20) res = 30
The following MATLAB script shows how to return multiple outputs in a single function: myFun.m: function [out1, out2, out3] = myFun(arg0, arg1) out1 = arg0 + arg1; out2 = arg0 * arg1; out3 = arg0 - arg1; end terminal: >> [res1, res2, res3] = myFun(...
Expression trees represent code in a tree-like data structure, where each node is an expression Expression Trees enables dynamic modification of executable code, the execution of LINQ queries in various databases, and the creation of dynamic queries. You can compile and run code represented by expr...
Several 'insert' functions can "burn" ids. Here is an example, using InnoDB (other Engines may work differently): CREATE TABLE Burn ( id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL, name VARCHAR(99) NOT NULL, PRIMARY KEY(id), UNIQUE(name) ) ENGINE=InnoDB; IN...
to check if the given path exists path = '/home/john/temp' os.path.exists(path) #this returns false if path doesn't exist or if the path is a broken symbolic link
to check if the given path is a directory dirname = '/home/john/python' os.path.isdir(dirname) to check if the given path is a file filename = dirname + 'main.py' os.path.isfile(filename) to check if the given path is symbolic link symlink = dirname + 'some_sym_link' os.path.islink(symli...
A class or struct can have member functions as well as member variables. These functions have syntax mostly similar to standalone functions, and can be defined either inside or outside the class definition; if defined outside the class definition, the function's name is prefixed with the class' nam...
A common use of member functions is for encapsulation, using an accessor (commonly known as a getter) and a mutator (commonly known as a setter) instead of accessing fields directly. class Encapsulator { int encapsulated; public: int get_encapsulated() const { return encapsulated; }...
When a base class provides a set of overloaded functions, and a derived class adds another overload to the set, this hides all of the overloads provided by the base class. struct HiddenBase { void f(int) { std::cout << "int" << std::endl; } void f(bool) { std::cout &...
Member functions can also be declared virtual. In this case, if called on a pointer or reference to an instance, they will not be accessed directly; rather, they will look up the function in the virtual function table (a list of pointers-to-member-functions for virtual functions, more commonly know...
All non-static member functions have a hidden parameter, a pointer to an instance of the class, named this; this parameter is silently inserted at the beginning of the parameter list, and handled entirely by the compiler. When a member of the class is accessed inside a member function, it is silent...
One of the primary uses for this cv-qualifiers is const correctness. This is the practice of guaranteeing that only accesses that need to modify an object are able to modify the object, and that any (member or non-member) function that doesn't need to modify an object doesn't have write access to t...
configuration EnableIISFeature { node localhost { WindowsFeature IIS { Ensure = “Present” Name = “Web-Server” } } } If you run this configuration in Powershell (EnableIISFeature), it will produce a localho...
Starting a DSC on a remote machine is almost just as simple. Assuming you've already set up Powershell remoting (or enabled WSMAN). $remoteComputer = "myserver.somedomain.com" $cred = (Get-Credential) Start-DSCConfiguration -ServerName $remoteComputer -Credential $cred -Verbose Nb: A...
Sometimes it can be useful to test your Powershell data files and iterate through the nodes and servers. Powershell 5 (WMF5) added this neat little feature for doing this called Import-PowerShellDataFile . Example: $data = Import-PowerShellDataFile -path .\MydataFile.psd1 $data.AllNodes
To list available DSC resources on your authoring node: Get-DscResource This will list all resources for all installed modules (that are in your PSModulePath) on your authoring node. To list all available DSC resources that can be found in the online sources (PSGallery ++) on WMF 5 : Find-DS...

Page 790 of 1336