Java Programming Cheatsheet

Here is the quick reference for Java Programming I found on the web. It summarizes common features and usage in shortest and easiest way possible. 

This is just a blog post taking useful content from Princeton University’s site. For the good intend to share the knowledge with other users and programmers. No intention of modifying or removing credits. Just thought to share this awesome resource with everyone. For more in depth reference, above link to university’s website is advised. It is well documented with excellent documentation and programming examples. 

Hello, World.

Hello, World in Java

Editing, compiling, and executing.

Compiling Hello, World in Java

Built-in data types.

Built-in types of data

Declaration and assignment statements.

Assignment statements

Integers.

int data type

Integer expressions

Floating-point numbers.

double data type

double expressions

Booleans.

boolean data type

Boolean operators

Comparison operators.

Comparison operators

Comparison examples

Printing.

System.out.print()

Parsing command-line arguments.

parsing Command-line arguments

Math library.

Math library API

Java library calls.

Expressions that use Java library methods

Type conversion.

Type conversion

Anatomy of an if statement.

anatomy of an if statement

If and if-else statements.

If-else statements

Nested if-else statement.

Nested if-else statements in Java

Anatomy of a while loop.

While loop

Anatomy of a for loop.

For loop

Loops.

While and for loops in Java

Break statement.

Break statement in Java

Do-while loop.

Do-while loop in Java

Switch statement.

Switch statement in Java

Arrays.

An array

Inline array initialization.

Inline initialization of arrays

Typical array-processing code

Two-dimensional arrays.

2D array

2D array inline initialization

standard output library.

Standard output API

Anatomy of printf

Formatting codes for printf

standard input library.

Standard input API

standard drawing library.

Standard drawing API

standard audio library.

Standard audio API

Command line.

command line

Redirection and piping.

Redirecting standard output                Redirecting standard input

Piping

Functions.

Anatomy of a function

Example functions

Libraries of functions.

Library abstraction

standard random library.

Standard random

standard statistics library.

Standard statistics

Using an object.

Using an object

Instance variables.

Anatomy of instance variables

Constructors.

Anatomy of a constructor

Instance methods.

Anatomy of an instance method

Classes.

Anatomy of a class

Object-oriented libraries.

Object-oriented library abstraction

Java’s String data type.

String library API

String operations

Java’s Color data type.

Color library API

input library.

Input API

output library.

Output API

picture library.

Picture API

stack data type.

Stack API

queue data type.

Queue API

Iterable.

Anatomy of an iterable

symbol table data type.

Symbol Table API

set data type.

Set API

graph data type.

Graph API

 

 

Pass it on and help others learn if you have too.

Python Programming Cheatsheet

Here is the quick reference for Python Programming I found on the web. It summarizes common features and usage in shortest and easiest way possible.

There are also some Princeton University developed modules which are very useful. I have also included them with direct links to it’s corresponding webpage on University’s website.

This is just a blog post taking useful content from Princeton University’s site. For the good intend to share the knowledge with other users and programmers. No intention of modifying or removing credits. Just thought to share this awesome resource with everyone. For more in depth reference, above link to university’s website is advised. It is well documented with excellent documentation and programming examples.

So, here it goes –

 

Hello, World.

import stdio

# Write 'Hello, World' to standard output.
stdio.writeln('Hello, World')

Editing, compiling, and interpreting.

Editing, compiling, and interpreting Hello, World in Python

Built-in data types.

Built-in types of data

Assignment statements and traces.

Assignment statements trace Assignment statements formal trace

Strings.

Str data type

Integers.

Int data type

Floating-point numbers.

Float data type

Booleans.

Bool data type Boolean operators operators

Comparison operators.

Comparison operators

Common functions.

Common Python functions

Type conversion.

Type conversion API

if and if-else statements.

If-else statements

if-elif-else statements.

if   income < 0:      rate = 0.00
elif income < 8925:   rate = 0.10
elif income < 36250:  rate = 0.15
elif income < 87850:  rate = 0.23
elif income < 183250: rate = 0.28
elif income < 398350: rate = 0.33
elif income < 400000: rate = 0.35
else:                 rate = 0.396

while and for statements.

While and for loops

break statements.

while True:
    x = 1.0 + 2.0*random.random()
    y = 1.0 + 2.0*random.random()
    if x*x + y*y <= 1.0:
        break

Arrays.

suits = ['Clubs', 'Diamonds', 'Hearts', 'Spades']

An array

a = stdarray.create1D(n)
...
for i in range(n):
    stdout.writeln(a[i])
... 
for element in a:
    stdout.writeln(element)

Array operations.

Array operations

Array aliasing and copying.

Array aliasing Array copying

Two-dimensional arrays.

2D array 2D array initialization
a = stdarray.create2D(rowCount, colCount)
...
for i in range(rowCount):
    for j in range(colCount)):
        stdio.writeln(a[i][j])
...     
for row in a:
    for element in row:
        stdio.writeln(element)

 

Redirection and piping.

Redirecting standard input Redirecting standard output

Piping

Functions.

Anatomy of a function

Example functions

Modules.

Module abstraction

Module control flow

The str data type.

The str module

Defining a class.

Charge API

Charge class

Creating an object.

Creating an object

Using an object.

p = c1.potentialAt(.20, .50)

Special methods.

Special methods: arithmetic

Special methods: comparison

Special methods: functions

 

stdio module: writing functions.

Standard output API

Anatomy of printf

Formatting codes for writef

 

stdio module: reading functions.

Standard input API

stddraw module.

Stddraw drawing functions

Stddraw control functions

Stddraw shape functions

Stddraw text and color functions

Stddraw animation functions

stdaudio module.

Standard audio API

stdrandom module.

Standard random module

stdarray module.

Standard array module

stdstats module.

Standard stats module

Color data type.

Color API

Picture data type.

Picture API

InStream data type.

InStream API

OutStream data type.

OutStream API

 

 

Pass it on and help others learn if you have too.

JavaScript Language in a Single Image

Moving on from my previous post, I discovered that Yusheng has also created a similar info graphic that brilliantly encapsulates the entire JavaScript on a single canvas.

This mind map also contains code examples and it covers ES5.

Find the image on this link or visit his GitHub repo.

Below is the reference image to have a quick look to brush up your memory –

infographic-the-entire-javascript-language-in-one-single-image-491250-2

 

 

Pass it on and let others know too.

Python Language in a Single Image

While exploring GitHub repositories, I came across one repository that stood out for Python programmers.

A China-based developer, Yusheng, has created a brilliant info graphic that encapsulates the entire Python 3 programming language in a single image. He has done this through a popular mind mapping software. Python is one of the most popular programming languages and it’s a skill every programmer must possess.

Yusheng’s mind map is in easily understandable format that can help programmers in a quick lookup during intense coding sessions or help a newbie for reference.

Find the image on this link or visit his GitHub repo.

Below is the reference image –

python-3-in-one-pic

 

 

Pass it on and let others know too.

Linux Kernel in a Single Map

Internet runs on Linux, everybody knows this fact. The Linux kernel is one of the most complex and popular open source projects. There is tons of material available online. Still, the core of the Linux kernel is a subject difficult to understand. It consists of multiple layers, modules, functionalities, calls and functions.

Today, I found a great micro website that tries to explain the whole Linux Kernel in a single image put as an interactive map. It has helped me so far greatly whenever I wanted to dig deeper on Linux core architecture.

This Linux kernel map helps greatly to understand complex interconnections between subsystems of the kernel while navigating through its source code. A very helpful resource while designing drivers and system level applications without getting irritated trying to figure out what invokes what, which calls to make and using what parameters.

This is also very helpful to understand the subsystems. On the map, there are more than 400 prominent functions and functions are divided into major subsystems. The relationships are shown by the lines and by clicking on any function, you’ll reach to its Linux source code and documentation.

Browse the entire interactive map here on MakeLinux.
Below is the image of the map for quick reference –

linux-kernel-map

 

Pass it on and let others know too.  Thanks.