| command | description |
|---|---|
| mongo | connect to the mongo database |
| use 'db_name' | connect to a particular database |
| db.auth('admin_name', 'password') | authorize to interact with a particular database |
|command |example |description |
| public class E53MaximumSubArray { | |
| public int optimizedBruteForce(int[] nums) { | |
| var max = Integer.MIN_VALUE; | |
| for (var i = 0; i < nums.length; i++) { | |
| var current = 0; | |
| for (var j = i; j < nums.length; j++) { | |
| current += nums[j]; | |
| max = Math.max(max, current); | |
| } |
| /** | |
| * 238. Product of Array Except Self | |
| * @author Ivan Asonov | |
| * * Date: June 13, 2021 | |
| * * @see <a href="https://leetcode.com/problems/product-of-array-except-self/">238. Product of Array Except Self</a> | |
| */ | |
| public class M238ProductOfArrayExceptSelf { | |
| public int[] productExceptSelf(int[] nums) { | |
| var result = new int[nums.length]; |
| syntax on | |
| set nocompatible " be iMproved, required | |
| filetype off " required | |
| " set the runtime path to include Vundle and initialize | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| " alternatively, pass a path where Vundle should install plugins | |
| "call vundle#begin('~/some/path/here') | |
| " let Vundle manage Vundle, required | |
| Plugin 'VundleVim/Vundle.vim' |
| command | description |
|---|---|
| sudo apt-get purge --auto-remove packagename | remove specified package |
| sudo dpkg --get-selections | list of all installed packages |
| sudo dpkg --get-selections | grep packagename | find all packages which contains specified string in its name |
|command |description |
| package me.slashfix.angular.rest; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Set; | |
| import javax.persistence.EntityManager; | |
| import javax.persistence.NoResultException; | |
| import javax.persistence.Query; | |
| /** |