Tutorial by Examples: l

The data type auto keyword is a convenient way for programmers to declare lambda functions. It helps by shortening the amount of text programmers need to type to declare a function pointer. auto DoThis = [](int a, int b) { return a + b; }; // Do this is of type (int)(*DoThis)(int, int) // e...
This example shows how auto can be used to shorten type declaration for for loops std::map<int, std::string> Map; for (auto pair : Map) // pair = std::pair<int, std::string> for (const auto pair : Map) // pair = const std::pair<int, std::string> for (c...
Declare two receivers in a manifest file: <receiver android:name=".UVMateWidget" android:label="UVMate Widget 1x1"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter...
In object-oriented design, the chain-of-responsibility pattern is a design pattern consisting of a source of command objects and a series of processing objects. Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next proce...
There are a lot of good video tutorials for the AngularJS framework on egghead.io https://egghead.io/courses/angularjs-app-from-scratch-getting-started https://egghead.io/courses/angularjs-application-architecture https://egghead.io/courses/angular-material-introduction https://egghead.io/co...
ASPX <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt...
Create a sample table on a sample database CREATE TABLE [dbo].[Table_1]( [Id] [int] IDENTITY(1,1) NOT NULL, [title] [varchar](50) NULL, CONSTRAINT [PK_Table_1] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_...
<script language="VB" runat="server"> Sub SubmitBtn_Click(sender As Object, e As EventArgs) Label1.Text = "Text1.Text = " & Text1.Text End Sub </script> <h3><font face="Verdana">TextBox Sample</...
Basic KatanaConsole Application namespace KatanaConsole { // use an alias for the OWIN AppFunc: using AppFunc = Func<IDictionary<string, object>, Task>; class Program { static void Main(string[] args) { WebApp.Start<Startup>(&...
The HyperLink control is used to navigate from the client to another page. <html> <script language="VB" runat="server"> Sub Page_Load(sender As Object, e As EventArgs) ' Set hyperlink to "~", which indicates application root. Hyper...
If you have more than 1 task to execute repeatedly in different intervals, use this example as a starting point: unsigned long intervals[] = {250,2000}; //this defines the interval for each task in milliseconds unsigned long last[] = {0,0}; //this records the last executed time for each ...
Some times you see a signal is emitted in sender thread but connected slot doesn't called (in other words it doesn't receive signal), you have asked about it and finaly got that the connection type Qt::DirectConnection would fix it, so the problem found and everything is ok. But generaly this is ba...
Native implementations The <template> element is implemented in every modern browsers: Chrome, Edge, Firefox, Opera, Safari, ... Custom Elements customElements.define(), Shadow DOM attachShadow() and HTML Imports <link rel="import"> are implemented in the latest ver...
Show or hide invisible characters To show invisible characters: :set list To hide invisible characters: :set nolist To toggle between showing and hiding invisible characters: :set list! Default symbol characters SymbolCharacter^ITab$New Line Customize symbols To set the tab characte...
Swift does not support multiple inheritance. That is, you cannot inherit from more than one class. class Animal { ... } class Pet { ... } class Dog: Animal, Pet { ... } // This will result in a compiler error. Instead you are encouraged to use composition when creating your types. This can b...
import org.apache.spark.sql.functions._ // Create a function that uses the content of the column inside the dataframe val code = (param: String) => if (param == "myCode") 1 else 0 // With that function, create the udf function val myUDF = udf(code) // Apply the udf to a column in...
set oDic = CreateObject("Scripting.Dictionary") oDic.add "USA", "United States of America" oDic.add "UK", "United Kingdom" oDic.add "CAN", "Canada" For Each obj in oDic.Items Msgbox obj Next Set oDic = Nothing *Out...
set oDic = CreateObject("Scripting.Dictionary") oDic.add "USA", "United States of America" oDic.add "UK", "United Kingdom" oDic.add "CAN", "Canada" For Each obj in oDic.keys Msgbox "Key: " & obj & &quo...
set oDic = CreateObject("Scripting.Dictionary") oDic.add "USA", "United States of America" oDic.add "UK", "United Kingdom" oDic.add "CAN", "Canada" ' Delete only if Key exists If oDic.Exists("UK") Then oDic.R...
UseExceptionHandler can be used to handle exceptions globally. You can get all the details of exception object like Stack Trace, Inner exception and others. And then you can show them on screen. You can easily implement like this. app.UseExceptionHandler( options => { options.Run( as...

Page 677 of 861