Category: Computer Science


1. CTRL+C (Copy)
2. CTRL+X (Cut)
3. CTRL+V (Paste)
4. CTRL+Z (Undo)
5. DELETE (Delete)
6. SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
7. CTRL while dragging an item (Copy the selected item)
8. CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
9. F2 key (Rename the selected item)
10. CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
11. CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
12. CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
13. CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
14. CTRL+SHIFT with any of the arrow keys (Highlight a block of text) SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
15. CTRL+A (Select all)
16. F3 key (Search for a file or a folder)
17. ALT+ENTER (View the properties for the selected item)
18. ALT+F4 (Close the active item, or quit the active program)
19. ALT+ENTER (Display the properties of the selected object)
20. ALT+SPACEBAR (Open the shortcut menu for the active window)
21. CTRL+F4 (Close the active document in programs that enable you to have multiple documents opensimultaneou sly)
22. ALT+TAB (Switch between the open items)
23. ALT+ESC (Cycle through items in the order that they had been opened)
24. F6 key (Cycle through the screen elements in a window or on the desktop)
25. F4 key (Display the Address bar list in My Computer or Windows Explorer)
26. SHIFT+F10 (Display the shortcut menu for the selected item) 27. ALT+SPACEBAR (Display the System menu for the active window)
28. CTRL+ESC (Display the Start menu)
29. ALT+Underlined letter in a menu name (Display the corresponding menu) Underlined letter in a command name on an open menu (Perform the corresponding command)
30. F10 key (Activate the menu bar in the active program)
31. RIGHT ARROW (Open the next menu to the right, or open a submenu)
32. LEFT ARROW (Open the next menu to the left, or close a submenu)
33. F5 key (Update the active window)
34. BACKSPACE (View the folder onelevel up in My Computer or Windows Explorer)
35. ESC (Cancel the current task)
36. SHIFT when you insert a CD- ROMinto the CD-ROM drive (Prevent the CD-ROM from automatically playing)

Dialog Box – Keyboard Shortcuts
1. CTRL+TAB (Move forward through the tabs)
2. CTRL+SHIFT+TAB (Move backward through the tabs)
3. TAB (Move forward through the options)
4. SHIFT+TAB (Move backward through the options)
5. ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
6. ENTER (Perform the command for the active option or button)
7. SPACEBAR (Select or clear the check box if the active option is a check box)
8. Arrow keys (Select a button if the active option is a group of option buttons)
9. F1 key (Display Help)
10. F4 key (Display the items in the active list)
11. BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)
Continue reading

Oracle SQL Codes

oraSqlD01

The whole SQL collection: SQL Codes

select <column_name> from <table_name> where <condition >

insert into <table_name> (<column_name1>,<column_name2>,<column_name3>, . . . ) values (<value1>,<value2>,<value3>,. . .)

create table <table_name>
(column_1    column_dataType,
 column_2    column_dataType,
     …    
 column_n    column_dataType
);

alter table <table name>
add <column_name> <column_dataType>;

ALTER TABLE table_name
ADD (column_1    column_dataType,
     column_2    column_dataType,
     …    
     column_n    column_dataType);

alter table <table name>
drop column <column_name>;

ALTER TABLE <table_name>
 MODIFY <column_name> <column_dataType>;

ALTER TABLE table_name
MODIFY (column_1    column_type,
     column_2    column_type,
     …    
     column_n    column_type );

ALTER TABLE <table_name>
 RENAME COLUMN <old_name> to <new_name>;

ALTER TABLE <table_name>
 RENAME TO <new_table_name>;

ALTER TABLE <table_name>
ALTER COLUMN <column_name> <column_type>;

UPDATE table_name
SET column1=value, column2=value2,…
WHERE some_column=some_value.

rename <old table name > to <new table name>

truncate table < table name>

delete from < table name>

Sample C++ Programs

The Whole File:- Sample C++

  • average.C
  • mult.C (multiplication using addition)
  • fastmult.C (better algorithm for multiplication)
  • more.C (count number of characters and lines in a file)
  • merge.C (merge sort)
  • grade.C
  • grade2.C
  • gcd.C (Euclid’s algorithm)
  • fib.C (Fibonacci numbers)
  • fact.C (factorial)
  • exp.C (exponentiation using multiplication)
  • commute.C (weird behavior from C++ compiler)
  • cin.C (more weird C++)
  • temp.C (convert temperatures)
  • sqrt.C (compute square roots using Newton’s method)
  • sphere.C (compute distance between cities)
  • prime.C (check if a number is prime)
  • prime2.C (faster but probabilistic way)
  • prime3.C (avoid stupid C++ behavior in case of overflow)
  • pp.C (understanding call-by-value and call-by-reference)
  • pp2.C (evaluating expressions with side-effects)
  • ref.C (example of pass-by-reference)
  • oddeven.C (lots of functions)
  • void.C (converting value-returning functions to void functions)
  • side.C (bad style, side-effects, value-returning)
  • sc.C (understanding scope)
  • life.C (understanding life time and scope)
  • object.C (understanding the concept of objects)

Design Patterns in Java

Whole File:- Java Design Pattern

Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time.

Design Pattern Overview

Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time.

What is Gang of Four (GOF)?

In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson und John Vlissides published a book titled Design Patterns – Elements of Reusable Object-Oriented Software which initiated the concept of Design Pattern in Software development.

These authors are collectively known as Gang of Four (GOF). According to these authors design patterns are primarily based on the following principles of object orientated design.

  • Program to an interface not an implementation
  • Favor object composition over inheritance

Usage of Design Pattern

Design Patterns have two main usages in software development.

Common platform for developers

Design patterns provide a standard terminology and are specific to particular scenario. For example, a singleton design pattern signifies use of single object so all developers familiar with single design pattern will make use of single object and they can tell each other that program is following a singleton pattern.

Best Practices

Design patterns have been evolved over a long period of time and they provide best solutions to certain problems faced during software development. Learning these patterns helps un-experienced developers to learn software design in an easy and faster way.

Types of Design Pattern

As per the design pattern reference book Design Patterns – Elements of Reusable Object-Oriented Software , there are 23 design patterns. These patterns can be classified in three categories: Creational, Structural and behavioral patterns. We’ll also discuss another category of design patterns: J2EE design patterns.

S.N.

Pattern & Description

1 Creational Patterns                             
These design patterns provides way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator. This gives program more flexibility in deciding which objects need to be created for a given use case.
2 Structural Patterns
These design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
3 Behavioral Patterns
These design patterns are specifically concerned with communication between objects.
4 J2EE Patterns
These design patterns are specifically concerned with the presentation tier. These patterns are identified by Sun Java Center.

****MANY MORE******

java interview with sbdsisaikat

The Whole File:- java interview with sbdsisaikat

Dear readers, these Java Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Java Programming Language. As per my experience good interviewers hardly planned to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer:

Q: What are the supported platform by Java Programming Language?

A: Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX/Linux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS etc.

Q: List any five features of Java?

A: Some features include Object Oriented, Platform Independent, Robust, Interpreted, Multi-threaded

Q: Why is Java Architectural Neutral?

A: It’s compiler generates an architecture-neutral object file format which makes the compiled code to be executable on many processors, with the presence Java runtime system.

Q: How Java enabled High Performance?

A: Java uses Just-In-Time compiler to enable high performance. Just-In-Time compiler is a program that turns Java bytecode which is a program that contains instructions that must be interpreted into instructions that can be sent directly to the processor.

Q: Why Java is considered dynamic?

A: It is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run-time.

Q: What is Java Virtual Machine and how it is considered in context of Java’s platform independent feature?

A: When Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is distributed over the web and interpreted by virtual Machine (JVM) on whichever platform it is being run.

Q: List two Java IDE’s?

A: Netbeans, Eclipse etc

Q: List some Java keywords(unlike C, C++ keywords)?

A: Some Java keywords are import, super, finally etc

Q: What do you mean by Object?

A: Object is a runtime entity and it’s state is stored in fields and behavior is shown via methods. Methods operate on an object’s internal state and serve as the primary mechanism for object-to-object communication.

Q: Define class?

A: A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.

Q: What kind of variables a class can consist of?

A: A class consist of Local variable, instance variables and class variables.

****many more****

The Whole File:-Java Programming Examples

Find the best practical and ready to use Java Programming Examples.
Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
These examples would be very useful for your projects and learning.

  • Example – Home
  • Example – Environment
  • Example – Strings
  • Example – Arrays
  • Example – Date & Time
  • Example – Methods
  • Example – Files
  • Example – Directories
  • Example – Exceptions
  • Example – Data Structure
  • Example – Collections
  • Example – Networking
  • Example – Threading
  • Example – Applets
  • Example – Simple GUI
  • Example – JDBC
  • Example – Regular Exp

The Whole File:- Networking Interview Questions and Answers

What is an Object server?
With an object server, the Client/Server application is written as a set of communicating objects. Client object communicate with server objects using an Object Request Broker (ORB). The client invokes a method on a remote object. The ORB locates an instance of that object server class, invokes the requested method and returns the results to the client object. Server objects must provide support for concurrency and sharing. The ORB brings it all together.

What is a Transaction server?
With a transaction server, the client invokes remote procedures that reside on the server with an SQL database engine. These remote procedures on the server execute a group of SQL statements. The network exchange consists of a single request/reply message. The SQL statements either all succeed or fail as a unit.

What is a Database Server?
With a database server, the client passes SQL requests as messages to the database server. The results of each SQL command are returned over the network. The server uses its own processing power to find the request data instead of passing all the records back to the client and then getting it find its own data. The result is a much more efficient use of distributed processing power. It is also known as SQL engine.

What are the most typical functional units of the Client/Server applications?
User interface
Business Logic and
Shared data.

What are all the Extended services provided by the OS?

Ubiquitous communications
Network OS extension
Binary large objects (BLOBs)
Global directories and Network yellow pages
Authentication and Authorization services
System management
Network time
Database and transaction services
Internet services
Object- oriented services

What are Triggers and Rules?
Triggers are special user defined actions usually in the form of stored procedures, that are automatically invoked by the server based on data related events. It can perform complex actions and can use the full power of procedural languages.
A rule is a special type of trigger that is used to perform simple checks on data.

What is meant by Transparency?
Transparency really means hiding the network and its servers from the users and even the application programmers.

What are TP-Lite and TP-Heavy Monitors?
TP-Lite is simply the integration of TP Monitor functions in the database engines. TP-Heavy are TP Monitors which supports the Client/Server architecture and allow PC to initiate some very complex multiserver transaction from the desktop.

What are the two types of OLTP?
TP lite, based on stored procedures. TP heavy, based on the TP monitors.

What is a Web server?
This new model of Client/Server consists of thin, protable, “universal” clients that talk to superfat servers. In the simplet form, a web server returns documents when clients ask for them by name. The clients and server communicate using an RPC-like protocol called HTTP.

****many more****

The Whole File:- J2EE Interview Questions and Answers

What is J2EE?
J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitier, web-based applications.

What is the J2EE module?
A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type.

What are the components of J2EE application?
A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:
Application clients and applets are client components.
Java Servlet and JavaServer PagesTM (JSPTM) technology components are web components.
Enterprise JavaBeansTM (EJBTM) components (enterprise beans) are business components.
Resource adapter components provided by EIS and tool vendors.

What are the four types of J2EE modules?
1. Application client module
2. Web module
3. Enterprise JavaBeans module
4. Resource adapter module

What does application client module contain?
The application client module contains:
–class files,
–an application client deployment descriptor.
Application client modules are packaged as JAR files with a .jar extension.

What does web module contain?
The web module contains:
–JSP files,
–class files for servlets,
–GIF and HTML files, and
–a Web deployment descriptor.
Web modules are packaged as JAR files with a .war (Web ARchive) extension.

What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?

There are no structural differences between the files; they are all archived using zip-jar compression. However, they are intended for different purposes.
–Jar files (files with a .jar extension) are intended to hold generic libraries of Java classes, resources, auxiliary files, etc.
–War files (files with a .war extension) are intended to contain complete Web applications. In this context, a Web application is defined as a single group of files, classes, resources, .jar files that can be packaged and accessed as one servlet context.
–Ear files (files with a .ear extension) are intended to contain complete enterprise applications. In this context, an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications.
Each type of file (.jar, .war, .ear) is processed uniquely by application servers, servlet containers, EJB containers, etc.

What is the difference between Session bean and Entity bean ?
The Session bean and Entity bean are two main parts of EJB container.
Session Bean
–represents a workflow on behalf of a client
–one-to-one logical mapping to a client.
–created and destroyed by a client
–not permanent objects
–lives its EJB container(generally) does not survive system shut down
–two types: stateless and stateful beans
Entity Bean
–represents persistent data and behavior of this data
–can be shared among multiple clients
–persists across multiple invocations
–findable permanent objects
–outlives its EJB container, survives system shutdown
–two types: container managed persistence(CMP) and bean managed persistence(BMP)

What is “applet”  ?
A J2EE component that typically executes in a Web browser but can execute in a variety of other applications or devices that support the applet programming model.

****many more****

The Whole File:- Sql Interview Questions and Answers

What is the use of CASCADE CONSTRAINTS?
When this clause is used with the DROP command, a parent table can be dropped even when a child table exists.


Why does the following command give a compilation error?

DROP TABLE &TABLE_NAME; Variable names should start with an alphabet. Here the table name starts with an ‘&’ symbol.

Which system tables contain information on privileges granted and privileges obtained?
USER_TAB_PRIVS_MADE, USER_TAB_PRIVS_RECD

Which system table contains information on constraints on all the tables created?obtained?
USER_CONSTRAINTS.


What is the difference between TRUNCATE and DELETE commands?

True

State true or false. !=, <>, ^= all denote the same operation?
True.

State true or false. EXISTS, SOME, ANY are operators in SQL?
True.

What will be the output of the following query?
SELECT REPLACE(TRANSLATE(LTRIM(RTRIM(‘!! ATHEN !!’,’!’), ‘!’), ‘AN’, ‘**’),’*’,’TROUBLE’) FROM DUAL;?
TROUBLETHETROUBLE. p>

What does the following query do?
SELECT SAL + NVL(COMM,0) FROM EMP;?
This displays the total salary of all employees. The null values in the commission column will be replaced by 0 and added to salary.

What is the advantage of specifying WITH GRANT OPTION in the GRANT command?
The privilege receiver can further grant the privileges he/she has obtained from the owner to any other user.

Which command executes the contents of a specified file?
START or @.

What is the value of comm and sal after executing the following query if the initial value of ‘sal’ is 10000 UPDATE EMP SET SAL = SAL + 1000, COMM = SAL*0.1;?
sal = 11000, comm = 1000.

Which command displays the SQL command in the SQL buffer, and then executes it?
RUN.

What command is used to get back the privileges offered by the GRANT command?
REVOKE.

What will be the output of the following query?
SELECT DECODE(TRANSLATE(‘A’,’1234567890′,’1111111111′), ‘1’,’YES’, ‘NO’ );?
NO.

Explanation : The query checks whether a given string is a numerical digit.

Which date function is used to find the difference between two dates?
MONTHS_BETWEEN.

What operator performs pattern matching?
LIKE operator.

What is the use of the DROP option in the ALTER TABLE command?
It is used to drop constraints specified on the table.

What operator tests column for the absence of data?
IS NULL operator.

What are the privileges that can be granted on a table by a user to others?
Insert, update, delete, select, references, index, execute, alter, all.

Which function is used to find the largest integer less than or equal to a specific value?
FLOOR.

Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Data Definition Language (DDL).

****many more****

The Whole File:- Servlet Interview Questions and Answers

What is Servlet?
A servlet is a Java technology-based Web component, managed by a container called servlet container or servlet engine, that generates dynamic content and interacts with web clients via a request\/response paradigm.

Why is Servlet so popular?
Because servlets are platform-independent Java classes that are compiled to platform-neutral byte code that can be loaded dynamically into and run by a Java technology-enabled Web server.

What is servlet container?
The servlet container is a part of a Web server or application server that provides the network services over which requests and responses are sent, decodes MIME-based requests, and formats MIME-based responses. A servlet container also contains and manages servlets through their lifecycle.

When a client request is sent to the servlet container, how does the container choose which servlet to invoke?
The servlet container determines which servlet to invoke based on the configuration of its servlets, and calls it with objects representing the request and response.

If a servlet is not properly initialized, what exception may be thrown?
During initialization or service of a request, the servlet instance can throw an UnavailableException or a ServletException.

Given the request path below, which are context path, servlet path and path info?
/bookstore/education/index.html

context path: /bookstore
servlet path: /education
path info: /index.html

What is filter? Can filter be used as request or response?
A filter is a reusable piece of code that can transform the content of HTTP requests,responses, and header information. Filters do not generally create a response or respond to a request as servlets do, rather they modify or adapt the requests for a resource, and modify or adapt responses from a resource.

When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

I know all major browsers ignore it even though the HTML 3.2 and 4.0 specifications require it. But building a DOCTYPE line tells HTML validators which version of HTML you are using so they know which specification to check your document against. These validators are valuable debugging services, helping you catch HTML syntax errors.

What is new in ServletRequest interface ? (Servlet 2.4)
The following methods have been added to ServletRequest 2.4 version:
public int getRemotePort()
public java.lang.String getLocalName()
public java.lang.String getLocalAddr()
public int getLocalPort()

Request parameter How to find whether a parameter exists in the request object?
1.boolean hasFoo = !(request.getParameter(“foo”) == null || request.getParameter(“foo”).equals(“”));
2. boolean hasParameter = request.getParameterMap().contains(theParameter);
(which works in Servlet 2.3+)

How can I send user authentication information while making URL Connection?
You’ll want to use HttpURLConnection.setRequestProperty and set all the appropriate headers to HTTP authorization.

Can we use the constructor, instead of init(), to initialize servlet?
Yes , of course you can use the constructor instead of init(). There’s nothing to stop you. But you shouldn’t. The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with arguments, so there was no way to give the constructur a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won’t have access to a ServletConfig or ServletContext.

****many more****