Tutorial by Examples: ti

PL/SQL Function: CREATE OR REPLACE FUNCTION split_String( i_str IN VARCHAR2, i_delim IN VARCHAR2 DEFAULT ',' ) RETURN SYS.ODCIVARCHAR2LIST DETERMINISTIC AS p_result SYS.ODCIVARCHAR2LIST := SYS.ODCIVARCHAR2LIST(); p_start NUMBER(5) := 1; p_end NUMBER(5); ...
Sample Data: CREATE TABLE table_name ( id, list ) AS SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list SELECT 3, NULL FROM DUAL UNION ALL -- NULL list SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
Sample Data: CREATE TABLE table_name ( id, list ) AS SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list SELECT 3, NULL FROM DUAL UNION ALL -- NULL list SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
var dict = ["name": "John", "surname": "Doe"] // Set the element with key: 'name' to 'Jane' dict["name"] = "Jane" print(dict)
using System.Net; using System.IO; ... string requestUrl = "https://www.example.com/submit.html"; HttpWebRequest request = HttpWebRequest.CreateHttp(requestUrl); request.Method = "POST"; // Optionally, set properties of the HttpWebRequest, such as: request.AutomaticD...
using System.Net; using System.IO; ... string requestUrl = "https://www.example.com/page.html"; HttpWebRequest request = HttpWebRequest.CreateHttp(requestUrl); // Optionally, set properties of the HttpWebRequest, such as: request.AutomaticDecompression = DecompressionMethods.GZ...
let myAllKeys = ["name" : "Kirit" , "surname" : "Modi"] let allKeys = Array(myAllKeys.keys) print(allKeys)
Generate a random number between minValue and maxValue - 1. Random rnd = new Random(); var randomBetween10And20 = rnd.Next(10, 20);
When creating Random instances with the same seed, the same numbers will be generated. int seed = 5; for (int i = 0; i < 2; i++) { Console.WriteLine("Random instance " + i); Random rnd = new Random(seed); for (int j = 0; j < 5; j++) { Console.Write(rnd.Next(...
Two Random class created at the same time will have the same seed value. Using System.Guid.NewGuid().GetHashCode() can get a different seed even in the same time. Random rnd1 = new Random(); Random rnd2 = new Random(); Console.WriteLine("First 5 random number in rnd1"); for (int i = 0...
Average The AVG() aggregate function will return the average of values selected. SELECT AVG(Salary) FROM Employees Aggregate functions can also be combined with the where clause. SELECT AVG(Salary) FROM Employees where DepartmentId = 1 Aggregate functions can also be combined with group by ...
Include a row number according to the order specified. SELECT ROW_NUMBER() OVER(ORDER BY Fname ASC) AS RowNumber, Fname, LName FROM Employees
Uses a partition criteria to group the row numbering according to it. SELECT ROW_NUMBER() OVER(PARTITION BY DepartmentId ORDER BY DepartmentId ASC) AS RowNumber, DepartmentId, Fname, LName FROM Employees
Jasmine can spy on an existing function using the spyOn function. let calculator = { multiply: function(a, b) { return a * b; }, square: function(a) { return this.multiply(a, a); } } describe('calculator', function() { it('squares numbers by multiplying them by the...
We can use jasmine.createSpy() to create a standalone spy. This is often useful if we need to pass a function as a callback to another function and want to test how it is used. // source code function each(arr, fn) { arr.forEach(fn); } // test code describe('each', function() { let m...
The NSDate class provides methods for creating NSDate objects corresponding to a given date and time. An NSDate can be initialized using the designated initializer, which: Returns an NSDate object initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds. NSDate *date...
Moment is a javascript library that was designed to make working with dates and times less time-consuming and more intuitive. You can easily start using this library by installing it in you web-app by using one of the following guides. Browser You can either download the JS file from the official...
If you're ever dealing with C Binary API's from Perl Code, via the syscall, ioctl, or fcntl functions, you need to know how to construct memory in a C Compatible way. For instance, if you were ever dealing with some function that expected a timespec, you'd look into /usr/include/time.h and find: s...
String literals imply no escaping or interpolation ( with the exception of quoting string terminators ) print 'This is a string literal\n'; # emits a literal \ and n to terminal print 'This literal contains a \'postraphe '; # emits the ' but not its preceding \ You can use alternative quoting...
Double-quoted strings use interpolation and escaping – unlike single-quoted strings. To double-quote a string, use either double quotes " or the qq operator. my $greeting = "Hello!\n"; print $greeting; # => Hello! (followed by a linefeed) my $bush = "They misunderestimat...

Page 95 of 505