Tutorial by Examples: st

To start with multi-threading, you would need the pthreads-ext for php, which can be installed by $ pecl install pthreads and adding the entry to php.ini. A simple example: <?php // NOTE: Code uses PHP7 semantics. class MyThread extends Thread { /** * @var string * Variab...
Any class can configure its own string formatting syntax through the __format__ method. A type in the standard Python library that makes handy use of this is the datetime type, where one can use strftime-like formatting codes directly within str.format: >>> from datetime import datetime &...
Ansible can be installed on CentOS or other Red Hat based systems. Firstly you should install the prerequisites: sudo yum -y update sudo yum -y install gcc libffi-devel openssl-devel python-pip python-devel then install Ansible with pip: sudo pip install ansible I can recommend for you to u...
WITH CTE (StudentId, Fname, LName, DOB, RowCnt) as ( SELECT StudentId, FirstName, LastName, DateOfBirth as DOB, SUM(1) OVER (Partition By FirstName, LastName, DateOfBirth) as RowCnt FROM tblStudent ) SELECT * from CTE where RowCnt > 1 ORDER BY DOB, LName This example uses a Common Table ...
Once the instance of the BackgroundWorker has been declared, it must be given properties and event handlers for the tasks it performs. /* This is the backgroundworker's "DoWork" event handler. This method is what will contain all the work you wish to have your progra...
This allows the BackgroundWorker to be cancelled in between tasks bgWorker.WorkerSupportsCancellation = true; This allows the worker to report progress between completion of tasks... bgWorker.WorkerReportsProgress = true; //this must also be used in conjunction with the ProgressChanged event...
A BackgroundWorker is commonly used to perform tasks, sometimes time consuming, without blocking the UI thread. // BackgroundWorker is part of the ComponentModel namespace. using System.ComponentModel; namespace BGWorkerExample { public partial class ExampleForm : Form { ...
Python supports a translate method on the str type which allows you to specify the translation table (used for replacements) as well as any characters which should be deleted in the process. str.translate(table[, deletechars]) ParameterDescriptiontableIt is a lookup table that defines the mappin...
Installing linq-to-sql: Right-click the App_Code folder and then click Add New Item. The Add New Item dialog box is displayed. Under Visual Studio installed templates, select the LINQ to SQL Classes template and rename the file Tasks.dbml. Click Add. OR: Under VS2102, in your solution explorer, r...
Imports System.Reflection Public Class PropertyExample Public Function GetMyProperties() As PropertyInfo() Dim objProperties As PropertyInfo() objProperties = Me.GetType.GetProperties(BindingFlags.Public Or BindingFlags.Instance) Return objProperties End Fun...
Swift NSNotificationCenter.defaultCenter().postNotificationName("TestNotification", object: self) Objective-C [[NSNotificationCenter defaultCenter] postNotificationName:@"TestNotification" object:nil];
Swift let userInfo: [String: AnyObject] = ["someKey": myObject] NSNotificationCenter.defaultCenter().postNotificationName("TestNotification", object: self, userInfo: userInfo) Objective-C NSDictionary *userInfo = [NSDictionary dictionaryWithObject:myObject forKey:@"som...
A standard toast notification appears at the bottom of the screen aligned in horizontal centre. You can change this position with the setGravity(int, int, int). This accepts three parameters: a Gravity constant, an x-position offset, and a y-position offset. For example, if you decide that the toas...
g$ The above matches one letter (the letter g) at the end of a string in most regex engines (not in Oniguruma, where the $ anchor matches the end of a line by default, and the m (MULTILINE) modifier is used to make a . match any characters including line break characters, as a DOTALL modifier in ...
Elixir doesn't have loops. Instead of them for lists there are great Enum and List modules, but there are also List Comprehensions. List Comprehensions can be useful to: create new lists iex(1)> for value <- [1, 2, 3], do: value + 1 [2, 3, 4] filtering lists, using guard expressi...
a = [1, 2, 3, true] Note that these are stored in memory as linked lists. Id est this is a series of cons cells where the head (List.hd/1) is the value of first item of the list and the tail (List.tail/1) is the value of the rest of the list. List.hd(a) = 1 List.tl(a) = [2, 3, true]
CHICKEN is a Scheme interpreter and compiler with its own extension module system called "eggs". It is capable of compiling Scheme to native code by first compiling Scheme to C. Installing Debian or Ubuntu or other derived distros: sudo apt-get install chicken-bin Fedora / RHEL / Ce...
Express JS is the goto framework for developing Web Applications, APIs and almost any kind of Backend using Node. To install express, all you have to do is run the npm command npm install express --save And you're done. To create and run a new express server create a file app.js and add this ...
Detailed instructions on getting mapbox set up or installed.
The static modifier is used to declare a static member, which does not need to be instantiated in order to be accessed, but instead is accessed simply through its name, i.e. DateTime.Now. static can be used with classes, fields, methods, properties, operators, events, and constructors. While an in...

Page 53 of 369