Tutorial by Examples

In the above example, if we want to send out HTML content as message in the email, then create a HTML file by going to File -> New -> HTML file Now you can see a HTML file besides your gs file as follows : Now, update the getMessage() method from above example as follows : function getMes...
A simple PL/pgSQL function: CREATE FUNCTION active_subscribers() RETURNS bigint AS $$ DECLARE -- variable for the following BEGIN ... END block subscribers integer; BEGIN -- SELECT must always be used with INTO SELECT COUNT(user_id) INTO subscribers FROM users WHERE subscribed...
You can iterate over the contents of a dictionary with dict for, which is similar to foreach: set theDict {abcd {ab cd} bcde {ef gh} cdef {ij kl}} dict for {theKey theValue} $theDict { puts "$theKey -> $theValue" } This produces this output: abcd -> ab cd bcde -> ef gh c...
Sometimes you need to match a literal (sub-)string with a regular expression despite that substring containing RE metacharacters. While yes, it's possible to write code to insert appropriate backslashes to make that work (using string map) it is easiest to just prefix the pattern with ***=, which ma...
MSDN: Determines whether a sequence contains a specified element by using a specified IEqualityComparer<T> List<int> numbers = new List<int> { 1, 2, 3, 4, 5 }; var result1 = numbers.Contains(4); // true var result2 = numbers.Contains(8); // false List<int> secondN...
Design (layout XML): <AutoCompleteTextView android:id="@+id/autoCompleteTextView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true&...
Marshal class contains a function named PtrToStructure, this function gives us the ability of reading structures by an unmanaged pointer. PtrToStructure function got many overloads, but they all have the same intention. Generic PtrToStructure: public static T PtrToStructure<T>(IntPtr ptr); ...
DECLARE CURSOR c_emp_to_be_raised(p_sal emp.sal%TYPE) IS SELECT * FROM emp WHERE sal < p_sal; BEGIN FOR cRowEmp IN c_emp_to_be_raised(1000) LOOP dbms_Output.Put_Line(cRowEmp .eName ||' ' ||cRowEmp.sal||'... should be raised ;)'); END LOOP; END; /
BEGIN FOR x IN (SELECT * FROM emp WHERE sal < 100) LOOP dbms_Output.Put_Line(x.eName ||' '||x.sal||'... should REALLY be raised :D'); END LOOP; END; / First advantage is there is no tedious declaration to do (think of this horrible "CURSOR" thing you had in previous ve...
SYS_REFCURSOR can be used as a return type when you need to easily handle a list returned not from a table, but more specifically from a function: function returning a cursor CREATE OR REPLACE FUNCTION list_of (required_type_in IN VARCHAR2) RETURN SYS_REFCURSOR IS v_ SYS_REFCURSOR; BEGIN...
Declare the cursor to scan a list of records Open it Fetch current record into variables (this increments position) Use %notfound to detect end of list Don't forget to close the cursor to limit resources consumption in current context -- DECLARE CURSOR curCols IS -- select column name a...
This is a minimal possible XSLT transformation. It produces the string value of the source XML document. The output format is text. Source XML document: <t>Hello, World!</t> XSLT transformation: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/T...
If you don't have Visual Studio 2015, go to https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx and select Visual Studio Community. It is a free version that have all the required capabilities to develop Windows 10 application. You can install the Enterprise Edition if you ha...
You can override the default vmoptions with your own personal settings by choosing Help > Edit Custom VM Options from the toolbar. This will create a local copy of the file which you are free to edit. For example, if you double the value set for Xmx, the maximum size of the memory allocation poo...
This example shows the base of almost any XSLT transformation and the most fundamental XSLT design pattern. Producing as output an XML document that is identical to the source XML document. Source XML document: <t>Hello, World!</t> XSLT transformation: <xsl:stylesheet version=&q...
qplot is intended to be similar to base r plot() function, trying to always plot out your data without requiring too much specifications. basic qplot qplot(x = disp, y = mpg, data = mtcars) adding colors qplot(x = disp, y = mpg, colour = cyl,data = mtcars) adding a smoother qplot(x = d...
C++11 During exception handling there is a common use case when you catch a generic exception from a low-level function (such as a filesystem error or data transfer error) and throw a more specific high-level exception which indicates that some high-level operation could not be performed (such as b...
A downcast can be used to make use of a subclass's code and data inside of a function taking a parameter of its superclass. class Rat { var color = "white" } class PetRat: Rat { var name = "Spot" } func nameOfRat(🐭: Rat) -> String { guard let petRat = ...
In the following code let us assume for simplicity that float and uint32_t have the same size. void fun(uint32_t* u, float* f) { float a = *f *u = 22; float b = *f; print("%g should equal %g\n", a, b); } u and f have different base type, and thus the compiler can a...
Detailed instructions on getting seaborn set up or installed.

Page 737 of 1336