Tutorial by Examples

Sometimes your webpage needs a automatic redirect. For example, to redirect to example.com after 5 seconds: <meta http-equiv="refresh" content="5;url=https://www.example.com/" /> This is line will send you to the designated website (in this case example.com after 5 sec...
One of the more annoying things that programmers can do is to scatter calls to printStackTrace() throughout their code. The problem is that the printStackTrace() is going to write the stacktrace to standard output. For an application that is intended for end-users who are not Java programmers,...
Union types are used in several languages, like C-language, to contain several different types which can "overlap". In other words, they might contain different fields all of which start at the same memory offset, even when they might have different lengths and types. This has the benef...
setuptools_scm is an officially-blessed package that can use Git or Mercurial metadata to determine the version number of your package, and find Python packages and package data to include in it. from setuptools import setup, find_packages setup( setup_requires=['setuptools_scm'], use_...
PostScript is a Turing-complete general programming language, designed and developed by Adobe Systems. Many of the ideas which blossomed in PostScript had been cultivated in projects for Xerox and Evans & Sutherland. Its main real-world application historically is as a page description language...
var List: TList<TDateTime>; ... List.Sort( TComparer<TDateTime>.Construct( function(const A, B: TDateTime): Integer begin Result := CompareDateTime(A, B); end ) );
IProgress<T> can be used to report progress of some procedure to another procedure. This example shows how you can create a basic method that reports its progress. void Main() { IProgress<int> p = new Progress<int>(progress => { Console.WriteLine("Runni...
It's important to note that the System.Progress<T> class does not have the Report() method available on it. This method was implemented explicitly from the IProgress<T> interface, and therefore must be called on a Progress<T> when it's cast to an IProgress<T>. var p1 = new P...
def hello_world(greeting: str = 'Hello'): print(greeting + ' world!') Note the spaces around the equal sign as opposed to how keyword arguments are usually styled.
CREATE TABLE menagerie.bird ( bird_id INT NOT NULL AUTO_INCREMENT, species VARCHAR(300) DEFAULT NULL COMMENT 'You can include genus, but never subspecies.', INDEX idx_species (species) COMMENT 'We must search on species often.', PRIMARY KEY (bird_id) ) ENGINE=InnoDB COMMENT 'Thi...
Bit-fields give an ability to declare structure fields that are smaller than the character width. Bit-fields are implemented with byte-level or word-level mask. The following example results in a structure of 8 bytes. struct C { short s; /* 2 bytes */ char c; /* 1 ...
Emacs' documentation uses a consistent notation for all key bindings, which is explained here: Key chords A "key chord" is obtained by pressing two or more keys simultaneously. Key chords are denoted by separating all keys by dashes (-). They usually involve modifier keys, which are put ...
Create example table Employee: CREATE TABLE Employee ( Id INT, EmpName VARCHAR(25), EmpGender VARCHAR(6), EmpDeptId INT ) Creates stored procedure that checks whether the values passed in stored procedure are not null or non empty and perform insert operation in Employee ta...
A subquery is a query within another SQL query. A subquery is also called inner query or inner select and the statement containing a subquery is called an outer query or outer select. Note Subqueries must be enclosed within parenthesis, An ORDER BY cannot be used in a subquery. The image type ...
Uname is the short name for unix name. Just type uname in console to get information about your operating system. uname [OPTION] If no OPTION is specified, uname assumes the -s option. -a or --all - Prints all information, omitting -p and -i if the information is unknown. Example: > unam...
Open a Command Prompt window and run the following commands: adb kill-server set ADB_TRACE=sockets adb nodaemon server 2>&1 | for /f "usebackq tokens=7*" %a in (`findstr /c:"): '"`) do @echo %a %b >> %USERPROFILE%\Desktop\adb_host_log.txt Now you can run your A...
To run the unit tests for a package, use the Pkg.test function. For a package named MyPackage, the command would be julia> Pkg.test("MyPackage") An expected output would be similar to INFO: Computing test dependencies for MyPackage... INFO: Installing BaseTestNext v0.2.2 INFO: Te...
Unit tests are declared in the test/runtests.jl file in a package. Typically, this file begins using MyModule using Base.Test The basic unit of testing is the @test macro. This macro is like an assertion of sorts. Any boolean expression can be tested in the @test macro: @test 1 + 1 == 2 @test...
0.5.0 In version v0.5, test sets are built into the standard library Base.Test module, and you don't have to do anything special (besides using Base.Test) to use them. 0.4.0 Test sets are not part of Julia v0.4's Base.Test library. Instead, you have to REQUIRE the BaseTestNext module, and add u...
Exceptions encountered while running a test will fail the test, and if the test is not in a test set, terminate the test engine. Usually, this is a good thing, because in most situations exceptions are not the desired result. But sometimes, one wants to test specifically that a certain exception is ...

Page 785 of 1336