Skip to content

Instantly share code, notes, and snippets.

View brijesh-deb's full-sized avatar

Brijesh Deb brijesh-deb

View GitHub Profile
@brijesh-deb
brijesh-deb / MySQL_handson.md
Last active November 4, 2018 06:27
#MySQL #HandsOn

Basic Commands

  • Find existing databases: show databases;
  • Create a database: Create database [myDB]
  • Select a database to use: Use [myDB]
  • Show tables in current database: Show tables;
  • Create a table: Create table student(id varchar(10), name varchar(50), age INT)
  • Show details of a table: Describe [tablename]
  • Show current user detial: Select current_user()
@brijesh-deb
brijesh-deb / Java8Note.md
Last active July 22, 2018 06:26
#Java8 #Notes

Lambda Expressions

  • Lambda expressions are anonymous method(methods without names) that implement abstract function of functional interfaces.
  • An interface with single abstract method is called functional interface. Example: Runnable interface with run() method.
  • Arraow Operator
    • Arrow operator divides lambda expression into 2 parts
    • (n) -> n*n;
    • The left side specifies the parameters required by the expression, which could also be empty if no parameters are required.
    • The right side is the lambda body which specifies the actions of the lambda expression. It might be helpful to think about this operator as “becomes”. For example, “n becomes n*n”, or “n becomes n squared”.
          interface NumericTest {
    
@brijesh-deb
brijesh-deb / NodeJS_CheatSheet.md
Last active October 11, 2018 09:49
#CheatSheet #NodeJS
  • Check nodejs version
    • Node -v
  • Running npm behind corporate proxy
  • Running js file from command prompt using node
    • Create a js file(test.js)
    • Add content: console.log('Hello')
    • Run from command prompt
  • Node test.js
@brijesh-deb
brijesh-deb / AWS_ElasticBeanstalk.md
Last active June 17, 2018 01:42
#AWS #ElasticBeanStalk

Using Elastic Beanstalk

  • Pre-requisite
    • Default VPC
  • Steps
    • Create the project jar file [mvn clean install]
    • Go to AWS Beanstalk
    • Click "Get Started"
    • Enter
      • Application Name: [Name]
  • Platform: Java
@brijesh-deb
brijesh-deb / Database_Index_Note.md
Last active June 1, 2018 05:38
#Database #Index #Notes

Why use index ?

  • The whole point of having an index is to speed up search queries by essentially cutting down the number of records/rows in a table that need to be examined.
    • SELECT * FROM Employee WHERE Employee_Name = 'Jesus'
  • In absence of index, for searching column value, all rows in the database table has to be scanned. This is called full table scan.

What is an index?

  • An index is a data structure (most commonly a B- tree) that stores the values for a specific column in a table. An index is created on a column of a table. So, the key points to remember are that an index consists of column values from one table, and that those values are stored in a data structure. The index is a data structure – remember that.

What kind of data structure is an index?

  • B- trees are the most commonly used data structures for indexes. The reason B- trees are the most popular data structure for indexes is due to the fact that they are time efficient – because look-ups, deletions, and insertions can all
@brijesh-deb
brijesh-deb / DatabaseNotes.md
Last active June 1, 2018 05:11
#Database #basics

Shadow information

  • Shadow information is any data that objects need to maintain, above and beyond their normal domain data, to persist themselves.  This typically includes primary key information, particularly when the primary key is a surrogate key that has no business meaning, concurrency control markings such as timestamps or incremental counters, and versioning numbers.

Scaffolding

  • Scaffolding is a technique supported by some model-view-controller frameworks, in which the programmer may write a specification that describes how the application database may be used. The compiler uses this specification to generate code that the application can use to create, read, update and delete database entries, effectively treating the template as a "scaffold" on which to build a more powerful application.

Mapping Inheritance structure to database

  • Scenario: Person is the parent class of Customer and Employee. Further Executive is the child class of Employee.
  • ***Map entire class hierarchy to a single

RabbitMQ Setup

  • Erlang
    • Uninstall old installation (optional)
    • Install otp_win64_20.3.exe (as administrator)
    • Add environment variable ERLANG_HOME=C:\rabbitmq\erl9.3
  • RabbitMQ
    • Install rabbitmq-server-3.7.4.exe in C:\rabbitmq\rabbitmq_server-3.7.4 (as administrator)
    • Add environment variable RABBITMQ_BASE= C:\rabbitmq\rabbitmq_server-3.7.4
    • Copy .erlang.cookie from C:\Windows to C:\Users[User Name]
    • Start command prompt (Run as Administrator)
@brijesh-deb
brijesh-deb / Predix_HandsOn.md
Last active November 4, 2018 06:25
#Predix #HandsOn