We summarize the most commonly used Java language features and APIs in the textbook.
View CHEAT SHEET.docx from BUSINESS 1321 at Red Land Shs. Ordinary dividend disbursement in the amount of $1.50 per share. Estimate growth at 4% annually. Font awesome Cheat sheet. Fontawesome Cheatsheet. This is a font awesome cheatsheet. I made this because I found myself misclicking alot and not finding what I want on the original cheatsheet.
- This GSAP 3 cheat sheet is an invaluable quick-reference guide to the API with links to more in-depth documentation for the properties and methods.
- Online Interactive JavaScript (JS) Cheat Sheet. JavaScript Cheat Seet contains useful code examples on a single page. This is not just a PDF page, it's interactive! Find code for JS loops, variables, objects, data types, strings, events and many other categories. Popy-paste the code you need or just quickly check the JS syntax for your projects.
Hello, World.
Editing, compiling, and executing.
Built-in data types.
Declaration and assignment statements.
Integers.
Floating-point numbers.
Booleans.
Comparison operators.
Printing.
Parsing command-line arguments.
Math library.
The full java.lang.Math API.Java library calls.
Type conversion.
Anatomy of an if statement.
If and if-else statements.
Nested if-else statement.
Anatomy of a while loop.
Anatomy of a for loop.
Loops.
Break statement.
Do-while loop.
Switch statement.
Arrays.
Inline array initialization.
Typical array-processing code.Two-dimensional arrays.
Inline initialization.Our standard output library.
The full StdOut API.Our standard input library.
The full StdIn API.Our standard drawing library.
The full StdDraw API.Our standard audio library.
The full StdAudio API.Command line.
Redirection and piping.
Paste 2 5 6 x 8.
Functions.
Libraries of functions.
Our standard random library.
Our standard statistics library.
Using an object.
Instance variables.
Constructors.
Instance methods.
Classes.
Object-oriented libraries.
Java's String data type.
The full java.lang.String API.Java's Color data type.
The full java.awt.Color API.Our input library.
The full In API.Our output library.
The full Out API.Our picture library.
The full Picture API.Our stack data type.
The full Stack API.Our queue data type.
The full Queue API.Iterable.
Our symbol table data type.
The full ST API.Our set data type.
The full SET API.Our graph data type.
The full Graph API.Compile-time and run-time errors.
Here's a list of errors compiled byMordechai Ben-Ari.It includes a list of common error message and typical mistakes thatgive rise to them.Last modified on October 30, 2019.
Copyright © 2000–2019Robert SedgewickandKevin Wayne.All rights reserved.
Common annotations
--%disabledSuite / context / test will not execute--%rollback(auto / manual)Automatic(default)/ manual transaction control--%displayname( description )Description of context / test / suite
Procedure annotations
--%test(description)Procedure is a test (with description)--%beforetest(procedure [, ..])Procedure(s) to runCheatsheet 1 3 2 1 4
before annotated test--%aftertest(procedure [, ..])Procedure(s) to runafter annotated test--%beforeallProcedure to run
before first test in suite/context--%afterallProcedure to run
after last test in suite/context--%beforeeachProcedure to run
before each test in suite/context--%aftereachProcedure to run
after each test in suite/context--%throws(exception [, ..])Test expects
exception(s) to be thrown
Package annotations
--%suite(description)Package is a test suite(with description)--%suitepath(com.acme.bomb)Similar to classpath (Java)
Group suites in namespaces--%context(name)Starts sub-suite in a suite--%endcontextEnds sub-suite in a suite--%beforeall(procedure [, ..])Procedure(s) to run
before all tests in suite/context--%afterall(procedure [, ..])Procedure(s) to run
after all tests in suite/context--%beforeeach(procedure [, ..])Procedure(s) to run
before each tests in suite/context--%aftereach(procedure [, ..])Procedure(s) to run
after each tests in suite/contextAnnotations are sinlgle-line comments starting with a % sign.
Needed in package specification only (documentation)
Equality matcher
equalut.expect( 'a dog' ).to_equal(
'a dog' , a_nulls_are_equal => false );
a_nulls_are_equal is true by defaultequal with cursors
open l_expected for select * from all_objects;
open l_actual for select * from all_objects;
ut.expect( l_expected )
.to_equal( l_actual )
.exclude( 'owner' )
.join_by( 'name' );
/ manual transaction control--%displayname( description )Description of context / test / suite
Procedure annotations
--%test(description)Procedure is a test (with description)--%beforetest(procedure [, ..])Procedure(s) to runCheatsheet 1 3 2 1 4
before annotated test--%aftertest(procedure [, ..])Procedure(s) to runafter annotated test--%beforeallProcedure to run
before first test in suite/context--%afterallProcedure to run
after last test in suite/context--%beforeeachProcedure to run
before each test in suite/context--%aftereachProcedure to run
after each test in suite/context--%throws(exception [, ..])Test expects
exception(s) to be thrown
Package annotations
--%suite(description)Package is a test suite(with description)--%suitepath(com.acme.bomb)Similar to classpath (Java)
Group suites in namespaces--%context(name)Starts sub-suite in a suite--%endcontextEnds sub-suite in a suite--%beforeall(procedure [, ..])Procedure(s) to run
before all tests in suite/context--%afterall(procedure [, ..])Procedure(s) to run
after all tests in suite/context--%beforeeach(procedure [, ..])Procedure(s) to run
before each tests in suite/context--%aftereach(procedure [, ..])Procedure(s) to run
after each tests in suite/contextAnnotations are sinlgle-line comments starting with a % sign.
Needed in package specification only (documentation)
Equality matcher
equalut.expect( 'a dog' ).to_equal(
'a dog' , a_nulls_are_equal => false );
a_nulls_are_equal is true by defaultequal with cursors
open l_expected for select * from all_objects;
open l_actual for select * from all_objects;
ut.expect( l_expected )
.to_equal( l_actual )
.exclude( 'owner' )
.join_by( 'name' );
equal on objectsut.expect(
anydata.convertObject(l_expected) )
.to_equal(
anydata.convertObject(l_actual) );
equal on collectionsut.expect(
anydata.convertCollection(l_expected) )
.to_equal(
anydata.convertCollection(l_actual) );
Expectation syntax
Base expectationut.expect( actual_value ).to_( matcher );
Negated expectationut.expect( actual_value ).not_to( matcher );
Cheatsheet 1 3 2 3 N 3 1 2 N 2
Shortcuts syntaxut.expect( actual_value ).to_matcher;
ut.expect( actual_value ).not_to_matcher;
Executing tests
exec ut.run();
All tests in my current schemaalter session set current_schema='HR';
exec ut.run();
All tests in current schema after it was changed to HRexec ut.run('HR');
All tests in specific schemaexec ut.run('test_betwnstr');
All tests in package of current schemaexec ut.run('hr.test_betwnstr.big_end_position');
Specific test onlyexec ut.run(
'hr.test_award_bonus, hr.test_betwnstr.big_end_position');
Run several itemsexec ut.run(':com.my_org.my_project');
Run using suitepathselect * from table(ut.run());
All tests as a select statementNon-equality matchers
be_likeut.expect( 'Lorem_impsum' ).to_be_like(
a_mask => '%rem_%', a_escape_char => ' );
ut.expect( 'Lorem_impsum' ).to_be_like( '%re%su' );
a_mask, a_escape_char -> see Oracle like operatormatch
ut.expect( '123-456-ABcd' ).to_match(
a_pattern=>'d{3}-d{3}-[a-z]', a_modifiers=>'i'
);
ut.expect( 'some value' ).to_match( '^some.*' );
a_pattern, a_modifiers -> see regexp_like functionbe_between
ut.expect( 3 ).to_be_between( 1, 3 );
be_greater_or_equalut.expect( 3 ).to_be_greater_or_equal( 2 );
be_greater_thanut.expect( 2 ).to_be_greater_than( 1 );
be_less_or_equalut.expect( 3 ).to_be_less_or_equal( 3 );
be_less_thanut.expect( 3 ).to_be_less_than( 4 );
have_countut_expect( v_cursor ).to_have_count(10);
Unary matchers
be_emptyopen l_cursor for select * from dual where 1 = 0;
1 2 3 Magic Cheat Sheet
ut.expect( l_cursor ).to_( be_empty() );
be_true ut.expect( ( 1 = 1 ) ).to_( be_true() );
be_false ut.expect( ( 1 = 0 ) ).to_( be_false() );
be_null ut.expect( 1 ).to_( be_null() );
be_not_null ut.expect( to_clob('ABC') ).to_( be_not_null() );
Reporting
Color outputexec ut.run(a_color_console=>true);
With sqlcl
or sqlPlus (Mac, Unix, Windows ANSICON)
JUnit reporter
exec ut.run(ut_junit_reporter());
JUnit-compatible XML report for CI serversCoverage html reporter
exec ut.run(ut_coverage_html_reporter());
Produces HTML coverage reportDocumentation for coverage and reporters