Feeds:
Posts
Comments

Remembering log4j levels

A simple sentence to remember log4j levels in the descending order of severity.

On Friday Eve We Invited Doctor Toni.

O – Off

F – Fatal

E – Error

W – Warn

I -Info

D – Debug

T -Trace

Though I have been using log4j for years, most of the time confused with the order, this simple sentence helps me a lot.

While writing sql query, I frequently get confused whether to add the keyword ‘table’ to the query or not.

Sometime I write the update query as ‘UPDATE TABLE EMPLOYEE….’, only after the sql exception I will realize that ‘TABLE’ keyword should not be added and now I found the pattern and never repeated such mistakes.

You too can correct that. As you know we have DDL and DML commands. The ‘TABLE’ keyword comes only for DDL commands.

DDL commands:

  • create
  • alter
  • truncate
  • drop
  • comment
  • rename

DML commands:

  • select
  • insert
  • update
  • delete
  • merge

You may follow this link to know the complete list of ddl and dml commands.

By default, NSIS files will open in notepad when double clicked and opened. Out of curiosity I changed that to notepad++, and from then I don’t see “compile NSIS script” option on right click of NSIS files. To bring that option back, I googled, tried several registry changes, stood upside down :( but no success. Finally, changed the file property(right click any NSIS file->Properties->General->Opens with->Change->Notepad) to open in notepad and it fixed and brought back the “compile NSIS script” option :).

 

  • Encapsulate what varies
  • Favor composition over inheritance
  • Program to interfaces, not to implementations
  • Strive for loosely coupled design between objects that interact
  • Depend upon abstractions. Do not depend upon concrete classes

Hiding : Happens during inheritance (between superclass and subclass).

Shadowing : Happens within a class (between a member variable and local variable).

Examples :

Hiding :

class Parent {

String city = “Dallas”;

}

class Child extends Parent {

String city =”Zurich”;

}

“city” in Child hides the one in Parent.

Shadowing :

class Main {

String city = “Dallas”;

void method() {

String city = “Zurich”;

}

}

“city”, local variable shadows the member variable.

Stack and heap memory

What is stored where?

Stack :

- local variables

Heap :

- instance variables

- static variables

- objects

Following  snippet will help to understand better.

stack_heap image

MS word, Outlook, Spreadsheet, Browsers are some of the examples of heavy weight programs.

Multitasking:
Running the above programs concurrently.

Multithreading :
Let’s take Outlook. At the same time it allows to compose a mail, send/receives new mail while typing, prints some mail while typing and send/receiving the mail, this concept is called multithreading.

Reference link which explains with pictures.

Follow

Get every new post delivered to your Inbox.