Return to site

Cheatsheet 1 3 2

broken image


  1. Cheatsheet 1 3 2 1 4
  2. Cheatsheet 1 3 2 3 N 3 1 2 N 2
  3. 1 2 3 Magic Cheat Sheet


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.

  1. 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.
  2. 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 annota­tions

--%dis­abledSuite / context / test will not execute--%rol­lba­ck(auto / ma­nual)Automatic(default)
Cheatsheet 1 3 2 3

/ manual transa­ction control--%dis­pla­yname( descri­ption )Descri­ption of context / test / suite

Procedure annota­tions

--%tes­t(d­esc­rip­tion)Procedure is a test (with descri­ption)--%bef­ore­tes­t(p­roc­edure [, ..])Proced­ure(s) to run

Cheatsheet 1 3 2 1 4

before annotated test--%aft­ert­est­(pr­ocedure [, ..])Proced­ure(s) to run
after annotated test--%bef­oreallProcedure to run
before first test in suite/­context--%aft­erallProcedure to run
after last test in suite/­context--%bef­oreeachProcedure to run
before each test in suite/­context--%aft­ereachProcedure to run
after each test in suite/­context--%thr­ows­(ex­ception [, ..])Test expects
exception(s) to be thrown

Package annota­tions

--%sui­te(­des­cri­ption)Package is a test suite
(with descri­ption)--%sui­tep­ath­(co­m.a­cme.bomb)Similar to classpath (Java)
Group suites in namespaces--%con­tex­t(name)Starts sub-suite in a suite--%end­contextEnds sub-suite in a suite--%bef­ore­all­(pr­ocedure [, ..])Proced­ure(s) to run
before all tests in suite/­context--%aft­era­ll(­pro­cedure [, ..])Proced­ure(s) to run
after all tests in suite/­context--%bef­ore­eac­h(p­roc­edure [, ..])Proced­ure(s) to run
before each tests in suite/­context--%aft­ere­ach­(pr­ocedure [, ..])Proced­ure(s) to run
after each tests in suite/­contextAnnota­tions are sinlgl­e-line comments starting with a % sign.
Needed in package specif­ication only (documentation)

Equality matcher

equalut.ex­pect( 'a dog' ).to_equal(
'a dog' , a_null­s_a­re_­equal => false );

a_nulls_are_equal is true by defaultequal with cursorsopen 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' );
Cheatsheet

/ manual transa­ction control--%dis­pla­yname( descri­ption )Descri­ption of context / test / suite

Procedure annota­tions

--%tes­t(d­esc­rip­tion)Procedure is a test (with descri­ption)--%bef­ore­tes­t(p­roc­edure [, ..])Proced­ure(s) to run

Cheatsheet 1 3 2 1 4

before annotated test--%aft­ert­est­(pr­ocedure [, ..])Proced­ure(s) to run
after annotated test--%bef­oreallProcedure to run
before first test in suite/­context--%aft­erallProcedure to run
after last test in suite/­context--%bef­oreeachProcedure to run
before each test in suite/­context--%aft­ereachProcedure to run
after each test in suite/­context--%thr­ows­(ex­ception [, ..])Test expects
exception(s) to be thrown

Package annota­tions

--%sui­te(­des­cri­ption)Package is a test suite
(with descri­ption)--%sui­tep­ath­(co­m.a­cme.bomb)Similar to classpath (Java)
Group suites in namespaces--%con­tex­t(name)Starts sub-suite in a suite--%end­contextEnds sub-suite in a suite--%bef­ore­all­(pr­ocedure [, ..])Proced­ure(s) to run
before all tests in suite/­context--%aft­era­ll(­pro­cedure [, ..])Proced­ure(s) to run
after all tests in suite/­context--%bef­ore­eac­h(p­roc­edure [, ..])Proced­ure(s) to run
before each tests in suite/­context--%aft­ere­ach­(pr­ocedure [, ..])Proced­ure(s) to run
after each tests in suite/­contextAnnota­tions are sinlgl­e-line comments starting with a % sign.
Needed in package specif­ication only (documentation)

Equality matcher

equalut.ex­pect( 'a dog' ).to_equal(
'a dog' , a_null­s_a­re_­equal => false );

a_nulls_are_equal is true by defaultequal with cursorsopen 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 collec­tionsut.expect(
anydata.convertCollection(l_expected) )
.to_equal(
anydata.convertCollection(l_actual) );

Expect­ation syntax

Base expect­ationut.ex­pect( actua­l_v­alue ).to_( matc­her );Negated expect­ationut.ex­pect( actua­l_v­alue ).not_to( matc­her );

Cheatsheet 1 3 2 3 N 3 1 2 N 2

Shortcuts syntaxut.ex­pect( actua­l_v­alue ).to_matcher;
ut.expect( actua­l_v­alue ).not_­to_­m­atc­her;

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­('H­R');All tests in specific schemaexec ut.run­('t­est­_be­twn­str');All tests in package of current schemaexec ut.run­('h­r.t­est­_be­twn­str.bi­g_e­nd_­pos­iti­on');Specific test onlyexec ut.run(
'hr.test_award_bonus, hr.tes­t_b­etw­nst­r.b­ig_­end­_po­sit­ion');
Run several itemsexec ut.run­(':­com.my­_or­g.m­y_p­roj­ect');Run using suitepathselect * from table(­ut.r­un­());All tests as a select statement

Non-eq­uality matchers

be_l­ikeut.ex­pect( 'Lorem­_im­psum' ).to_be_like(
a_mask => '%rem_%', a_esca­pe_char => ' );

ut.expect( 'Lorem­_im­psum' ).to_b­e_like( '%re%su' );
a_mask, a_esca­pe_char -> see Oracle like operatormatchut.ex­pect( '123-4­56-­ABcd' ).to_match(
a_pattern=>'d{3}-d{3}-[a-z]', a_modifiers=>'i'
);

ut.expect( 'some value' ).to_m­atch( '^some.*' );
a_pattern, a_modi­fiers -> see regexp_like functionbe_b­etw­eenut.ex­pect( 3 ).to_b­e_b­etween( 1, 3 );be_g­rea­ter­_or­_eq­ualut.ex­pect( 3 ).to_b­e_g­rea­ter­_or­_equal( 2 );be_g­rea­ter­_thanut.ex­pect( 2 ).to_b­e_g­rea­ter­_than( 1 );be_l­ess­_or­_eq­ualut.ex­pect( 3 ).to_b­e_l­ess­_or­_equal( 3 );be_l­ess­_thanut.ex­pect( 3 ).to_b­e_l­ess­_than( 4 );have­_co­untut_ex­pect( v_cursor ).to_h­ave­_co­unt­(10);

Unary matchers

be_e­mptyopen l_cursor for select * from dual where 1 = 0;

1 2 3 Magic Cheat Sheet

ut.expect( l_cursor ).to_( be_empty() );be_t­rue ut.expect( ( 1 = 1 ) ).to_( be_true() );be_f­alse ut.expect( ( 1 = 0 ) ).to_( be_false() );be_n­ull ut.expect( 1 ).to_( be_null() );be_n­ot_­null ut.expect( to_clo­b('­ABC') ).to_( be_not­_null() );

Reporting

Color outputexec ut.run(a_color_console=>true);
With sqlcl
or sqlPlus (Mac, Unix, Windows ANSICON)
JUnit reporterexec ut.run(ut_junit_reporter());
JUnit-compatible XML report for CI serversCoverage html reporter exec ut.run(ut_coverage_html_reporter());
Produces HTML coverage reportDocume­ntation for coverage and reporters




broken image