Skip to content

Instantly share code, notes, and snippets.

View danicheman's full-sized avatar

Nick danicheman

  • Santa Cruz, CA
  • 01:34 (UTC -08:00)
View GitHub Profile
@danicheman
danicheman / Array CheatSheet.md
Created April 4, 2025 16:08 — forked from ajeetkumarrauniyar/Array CheatSheet.md
Cheat sheet of Array methods in JavaScript

Array Methods Cheat Sheet

1. push()

  • Definition: Adds one or more elements to the end of an array and returns the new length of the array.
  • Syntax: array.push(element1[, ...[, elementN]])
  • Example:
    let arr = [1, 2, 3];
    arr.push(4, 5);

console.log(arr); // Output: [1, 2, 3, 4, 5]

title year length budget rating votes r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 mpaa Action Animation Comedy Drama Documentary Romance Short
1 $ 1971 121 NA 6.4 348 4.5 4.5 4.5 4.5 14.5 24.5 24.5 14.5 4.5 4.5 0 0 1 1 0 0 0
2 $1000 a Touchdown 1939 71 NA 6 20 0 14.5 4.5 24.5 14.5 14.5 14.5 4.5 4.5 14.5 0 0 1 0 0 0 0
3 $21 a Day Once a Month 1941 7 NA 8.2 5 0 0 0 0 0 24.5 0 44.5 24.5 24.5 0 1 0 0 0 0 1
4 $40,000 1996 70 NA 8.2 6 14.5 0 0 0 0 0 0 0 34.5 45.5 0 0 1 0 0 0 0
5 $50,000 Climax Show, The 1975 71 NA 3.4 17 24.5 4.5 0 14.5 14.5 4.5 0 0 0 24.5 0 0 0 0 0 0 0
6 $pent 2000 91 NA 4.3 45 4.5 4.5 4.5 14.5 14.5 14.5 4.5 4.5 14.5 14.5 0 0 0 1 0 0 0
7 $windle 2002 93 NA 5.3 200 4.5 0 4.5 4.5 24.5 24.5 14.5 4.5 4.5 14.5 R 1 0 0 1 0 0 0
8 '15' 2002 25 NA 6.7 24 4.5 4.5 4.5 4.5 4.5 14.5 14.5 14.5 4.5 14.5 0 0 0 0 1 0 1
9 '38 1987 97 NA 6.6 18 4.5 4.5 4.5 0 0 0 34.5 14.5 4.5 24.5 0 0 0 1 0 0 0
@danicheman
danicheman / Airplane.java
Created February 11, 2016 19:02
Topcoder.com Airplane Easy question
public class Airways {
public double distance(int n, int east, int north) {
double distance = 0;
double angleInterval = 360 / n;
//form a triangle using the angles before and after the east/north position angle
int quadrantOffset = quadrantOffset(east, north);
double offset = Math.atan2(Math.abs(east), Math.abs(north));
double totalOffset = offset + quadrantOffset;
double beforeAngle = 0;
@danicheman
danicheman / MyTest.java
Created January 21, 2016 23:12
Java implimentations of search algos
import java.util.Arrays;
import java.util.ArrayList;
class MyTest {
void MyTest(int[] toSort) {
System.out.println("Original: " + Arrays.toString(bSorted));
int[] bSorted = bubbleSort(toSort);
System.out.println("BS: " + Arrays.toString(bSorted));