Professional Documents
Culture Documents
Open Source Software Question Bank Anna University Coimbatore PDF
Open Source Software Question Bank Anna University Coimbatore PDF
No initial cost
No licensing issues
Openness and Transparency
Speed of Access
Freedom of movement
Portable
Reliable
Stable
Security
3. What are the four important factors that led to the development of open source software?
The following are the four important factors that lead to the development of Open Source
Software:
1. To diminish the high monopoly value of the Proprietary Software
2. To avoid discrimination among persons like developers of the product and users of the
product
3. To enable the user finding and fixing the bugs themselves
4. To allow customers to have control over the products they use and to redistribute the same
with or without modifications.
4. What are the advantages of open source system?
Finance
Educational
Data Storage and Management
Games
Media
Networking and Internet
Graphics
Low-Cost
Runs on old Hardware
Choice
Installation and GUI
Security
Open source
Learning
Lack of equivalent programs
More technical ability needed
Not all hardware compatible
Single task system: Only one program may be run at a time, and therefore only one person
may work on a machine at one time. However, the process may make use of the whole of
the resources and power of the machine
Multi task system: Several Processes can be executed in parallel. Operating time is cut up
into small intervals and each process is executed during these short periods.
Virtual Machine:
Sharing the Processor:
Memory Management:
Resource management:
Communication hub of the machine:
The kernel is a privileged mode, in which no restriction is imposed on the kernel of the
system. The kernel may use all the instructions of the processor, manipulate the whole of
the memory, and talk directly to the peripheral controllers.
The user mode is the normal execution mode for a process. In this mode, the process has no
privilege.
Its state
Its identification
The values of the registers, including the program counter
The user identity whose name the process is executing
The information used by the kernel to establish the schedule of the processes
Information concerning the address space of the process
Information concerning the inputs/outputs carried out by the process
Compatibility information summarizing the resources used by the process
System calls: Linux uses software interrupts to change into kernel mode, whilst other UNIX
system use an inter- segment jump.
Message number specified by processes: When a process specifies a message number, for
example in calling the primitive sigaction or kill, the message number is converted by means
of look-up-table
Number of messages sent to processes: when a message is to be sent to a process, the
message number is converted by means of look-up-table
The parameter fn is the pointer from the child process to the function to be executed.
The parameter child stack is the pointer to the zone of memory allocated for the stack of
child process. The parameter Flags defines method for cloning.
The parameter nargs defines the number of arguments to be passed to the function pointed
by fn and is followed by these arguments
The signal is the result of particular physical circumstance: When a process writes to a non
allocated zone of memory, there is an invalid access to a page of memory, which raise a flag.
This flag is recognized in the kernel, which generates a SIGSEGV signal which in turn is sent
to the process at fault.
It is the result of terminal user typing CTRL-C. This generates the signal SIGINT for which the
default action is to terminate the process in the session foreground.
It is the result of system call kill or of command of the same name which allows the signal to
be sent to a selected process.
It is the result of event under the control of the kernel.
27. What are the various actions a process may take upon receiving a signal?
There are various actions a process may take upon receiving a signal, and three different defaults:
31. What are the formats supported in Linux for executable programs
Linux supports two formats for executable programs
a.out-binary format
ELF dynamic libraries
Static : during link editing, the library code is integrated with the executable code
Dynamic: the library code is loaded when program is executed
Highly efficient
Open source
Highly secured since All password traffic is encrypted connecting to a server.
Offers a high scalability in terms of size and connectivity.
3. What is "mysqld"?
mysqld is a daemon server program typically used to start and stop mysql server. It runs in
the background
4. How can you connect to the MySQL Server?
In order to connect to the MySQL server, it is required to give the username and password. So
this can be done with the following
7. Explain the tools that are available for managing MySQL Server.
Following are the tools to manage MySQL server:
Connecting to the MySQL server; selecting a database; disconnecting from the server.
Checking for errors.
Issuing queries and retrieving results.
Using prepared statements and placeholders in queries.
Including special characters and NULL values in queries.
Handling NULL values in result sets.
9. What are the three fundamental operations that are common to MySQL Programs?
First, to prevent an individual function call from producing an error message, put the @
warning suppression operator in front of its name.
Disable these warnings globally by using the error_reporting( ) function to set the PHP error
level to zero: error_reporting(0)
Statements that do not return a result set. This statement category includes INSERT, DELETE,
and UPDATE.
Statements that return a result set, such as SELECT, SHOW, EXPLAIN, and DESCRIBE.
9
differences
between
MySQL_fetch_array(),
MySQL_fetch_object(),
Mysql_fetch_object returns the result from the database as objects while mysql_fetch_array
returns result as an array. This will allow access to the data by the field names.
E.g. using mysql_fetch_object field can be accessed as $result->name and using
mysql_fetch_array field can be accessed as $result->[name].
mysql_fetch_row($result):- where $result is the result resource returned from a successful
query executed using the mysql_query() function.
Example:
$result = mysql_query(SELECT * from students);
while($row = mysql_fetch_row($result))
{
Some statement;
14. What are the two types of methods for retrieving rows in Python?
17. What are the various ways in which SELECT statement can be used for record selection
Technology?
SELECT gives you control over several aspects of record retrieval:
10
18. What is the keyword which can be used to combine column values? Give Example
Column values may be combined to produce composite output values using the CONCAT() Keyword.
Example:
19. How can you map NULL values to other values while display?
IF( ) and IFNULL( ) keywords are used to do so. They are especially useful for catching divideby-zero operations and mapping them onto something else.
20. When the LIMIT clause will be used?
LIMIT is used for the following kinds of problems:
1) Answering questions about first or last, largest or smallest
2) Splitting a result set into sections so that you can process it one piece at a time.
21. What are the advantages of copying records from one table to another?
When an algorithm that modifies a table is used then it is safer to work with the copy
When the original table is large then it takes large time to work with so it is better to work
with the which takes less time
The data-loading operations that may be malformed when used with original table can go
with the copy to ensure safety
The summary operations when repeatedly done over the original table are expensive so
copy can be used to print the summary which is not expensive as original table
22. What is the use of creating such tables? How can you create temporary tables?
When you need a table only for a short time, then you want it to disappear automatically
you can go to create a temporary table. This is extremely useful behavior because you need not
remember to remove the table The Temporary tables can be created using the keyword CREATE
TEMPORARY TABLE
11
If you've already created a temporary table with a given name, attempting to create a
second one with that name results in an error.
persistent connections may tend not to drop the temporary table because the connection
is let open for the use of next script
If a client program automatically reconnects after a dropped connection, you'll be modifying
the original table after the reconnect
Strings can be case sensitive (or not), which can affect the outcome of string operations.
You can compare entire strings, or just parts of them by extracting substrings.
You can apply pattern-matching operations to look for strings that have a certain structure.
A binary string in MySQL is one that MySQL treats as case sensitive in comparisons.
A non binary string in MySQL is one that MySQL does not treats as case sensitive in
comparisons.
For binary strings, the characters A and a are considered different. For non-binary strings,
they're considered the same.
26. Does the MID() acts the same way as SUBSTRING() ? Justify
MID() acts the same way as the SUBSTRING() if the third argument of the MID() is omitted.
27. What are the ways provided by MySQL for Pattern Matching?
1) One is based on SQL patterns
2) Regular expressions.
28. What are the data types supported by MySQL for Date and Time formats?
MySQL supports a number of date and time column formats: Some of them are
DATE
DATETIME
TIMESTAMP
2008-10-23 10:37:22
20081023103722
2008/10/23 10.37.22
2008*10*23*10*37*22
12
Information about the result of queries: This includes number of records effected by any
SELECT, UPDATE or DELETE statement.
Information about tables and databases: This includes information pertaining to the
structure of tables and databases.
Information about the MySQL server: This includes current status of database server,
version number etc
13
PHP is appropriate whenever you want your pages to be created dynamically when the
browser requests the page. For example, you can display date, time, and other information
in different ways. PHP will make your website more dynamic in content and a heck of a lot
easier to update.
PHP makes it easy to customize a Web page to make it more useful for individual users.
With PHP you can set cookies, manage authentication, and redirect users.
One of PHP most powerful features is database access. With PHP it is possible to access over
19 different types of databases and manipulate data within those databases based on input
from the user via a web page.
PHP makes it easy to send e-mail, work with newsgroups, and actually open a connection to
another web site -- and get or send data with it. If you are already familiar with ASP
development, PHP can also communicate with other server side languages such as Java and
use COM interfaces.
3. Define Variable.
A variable is a holder for a type of data. So, based on its type, a variable can hold numbers,
strings, Booleans, objects, resources or it can be NULL.
In PHP all the variables begin with a dollar sign "$" and the value can be assigns using the "="
operator.
The dollar sign is not technically part of the variable name, but it is required as the first
character for the PHP parser to recognize the variable as such.
6. Define constant and what is the main difference between the variable and the constant
An expression is a bit of PHP that can be evaluated to produce a value. The simplest
expressions are literal values and variables.
A literal value evaluates to itself, while a variable evaluates to the value stored in the
variable. More complex expressions can be formed using simple expressions and operators.
An operator takes some values (the operands) and does something (for instance, adds them
together).
15
9. What are the different types of Operators based on the number of operands it takes?
Most operators in PHP are binary operators; they combine two operands (or expressions)
into a single, more complex expression.
PHP also supports a number of unary operators, which convert a single expression into a
more complex expression.
Finally, PHP supports a single ternary operator that combines three expressions into a single
expression.
The order in which operators in an expression are evaluated depends on their relative
precedence.
Associativity defines the order in which operators with the same order of precedence are
evaluated.
The conversion of a value from one type to another is called casting.
Arithmetic Operators
String Concatenation Operator
Auto increment and Auto decrement Operators
Comparison Operators
Bitwise Operators
Logical Operators
Casting Operators
Assignment Operators and some miscellaneous Operators
When a parameter is passed by value, the compiler passes the actual value to the called
procedure. When a parameter is passed by value, the called program or procedure can
change the value of the parameter, but the caller will never see the changed value
Passing parameters by reference to a procedure allows the called to modify the field passed.
An array is a special variable, which can store multiple values in one single variable.
Arrays can be used in many ways to store and organize data quickly and efficiently. It is one
of the more useful data types available to any programming language.
Arrays can most easily be described as an ordered list of elements.
17
The asort() function orders the array according to the value of each element in ascending
order.
We use ksort() function to sort an associative array according to the key in ascending order.
Rsort() function sorts one-dimensional numerically indexed array by the values in reverse
order.
Arsort() function sorts one-dimensional associative array by the values in reverse order.
Krsort() function sorts one-dimensional associative array by the keys in reverse order.
Public: means that a class member is visible and usable / modifiable by everyone
Private: means that a class member is only usable / modifiable by the class itself
Protected: means that a class member is only usable / modifiable by the class itself and
eventual sub-classes
18
strtoupper
strtolower and
ucwords.
29. Define Regular Expression and what are the regular expressions supported by PHP
A regular expression is a string that represents a pattern. The regular expression functions
compare that pattern to another string and see if any of the string matches the pattern. PHP
provides support for two different types of regular expressions:
POSIX
Perl compatible.
19
31. What are the three basic types of abstract patterns in a regular expression?
A set of acceptable characters that can appear in the string (e.g., alphabetic characters,
numeric characters, specific punctuation characters)
A set of alternatives for the string (e.g., "com", "edu", "net", or "org")
A repeating sequence in the string (e.g., at least one but no more than five numeric
characters)
A set of acceptable characters that can appear in the string (e.g., alphabetic characters,
numeric characters, specific punctuation characters)
A set of alternatives for the string (e.g., "com", "edu", "net", or "org")
A repeating sequence in the string (e.g., at least one but no more than five numeric
characters)
An anchor limits a match to a particular location in the string (anchors do not match actual
characters in the target string).
The quantifier goes after the pattern thats repeated and says how many times to repeat
that pattern.
When faced with a quantifier, the engine matches as much as it can while still satisfying the
rest of the pattern - Greedy
Quantifiers that match as few times as possible to satisfy the rest of the pattern - Non
Greedy
20
43. What are the functions available to copy , rename and delete a file?
44. What are the functions available to determine the attributes of a file?
45. What are the three places where the data can be stored in PHP?
flat file
session variables
Cookies.
46. Define flat files and mention its advantages over databases
Flat files are text files stored in the computer file system. Humans can read flat files by using
the operating system commands that display files, such as cat in Linux and UNIX.
Flat files have some advantages over databases:
Available and versatile: You can create and save data in any operating system's file system.
You don't need to install any extra software. Additionally, text data stored in flat files can be
read by a variety of software programs, such as word processors or spreadsheets.
Easy to use: You don't need to do any extra preparation, such as install database software,
design a database, create a database, and so on. Just create the file and store the data with
statements in your PHP script.
Smaller: Flat files store data by using less disk space than databases.
LDAP data organization, defines how the data is formatted while in storage and exchange
with respect to the communicating LDAP entities, that is, client-server and server-server
LDAP server is the server that LDAP clients interact with to obtain directory information.
LDAP protocol, is the common language spoken by clients and servers when the clients
access the directory
LDAP clients implemented using different vendor APIs and tools on different platforms are
able to connect to the LDAP server, as long as they speak the LDAP protocol and handle data
in the particular format required by LDAP.
Information model
Naming model
Functional model
Security model
22
Register Global
SQL Injection
Cross Site Scripting
User login systems
23
Value
Data item that is represented by an object.
24
Type
Null object(None)
File
Set/Frozen set
Function/Method
Module
Class
Code
Frame
Traceback
Slice
Ellipsis
Xrange
"plain" integers,
long integers,
floating point real numbers, and
complex numbers.
25
anInt = 1
aLong = -9999999999999999L
aFloat = 3.1415926535897932384626433832795
aComplex = 1.23 + 4.56J
anInt = anInt + 1
aFloat = 2.718281828
del anInt
del aLong, aFloat, aComplex
27
To clear or remove a string, you assign an empty string or use the del statement, respectively:
>>> aString = ''
>>> aString
''
>>> del aString
In most applications, strings do not need to be explicitly deleted. Rather, the code defining the string
eventually terminates, and the string is automatically garbage collected.
17. Define raw string operator
The purpose of raw strings, introduced to Python in version 1.5, is to counteract the
behavior of the special escape characters that occur in strings. In raw strings, all characters are taken
verbatim with no translation to special or non-printed characters. This feature makes raw strings
absolutely convenient when such behavior is desired, such as when composing regular expressions
18. How to Create and Assign Lists
Creating lists is as simple as assigning a value to a variable. You handcraft a list (empty or with
elements) and perform the assignment. Lists are delimited by surrounding square brackets ( [ ] ).
>>> aList = [123, 'abc', 4.56, ['inner', 'list'], 7-9j]
>>> print aList
[123, 'abc', 4.56, ['inner', 'list'], (7-9j)]
19. How to Access Values in Lists
Slicing works similar to strings; use the square bracket slice operator ( [ ] ) along with the index or
indices.
>>> aList[0]
123
>>> aList[:3]
[123, 'abc', 4.56]
>>> aList[3][1]
'list'
28
29
30
31
input
output
movement within a file("intra-file motion") and
miscellaneous
32
try-except
try-finally.
Functions are often compared to procedures. Both are entities which can be invoked, but
the traditional function or "black box," perhaps taking some or no input parameters,
performs some amount of processing and concludes by sending back a return value to the
caller. Some functions are Boolean in nature, returning a "yes" or "no" answer, or, more
appropriately, a non-zero or zero value, respectively.
Procedures, often compared to functions, are simply special cases, functions which do not
return a value. Python procedures are implied functions because the interpreter implicitly
returns a default value of None.
33
41. How function Declaration and Definition are different from other programming languages
Some programming languages differentiate between function declarations and function
definitions. A function declaration consists of providing the parser with the function name, and the
names (and traditionally the types) of its arguments, without necessarily giving any lines of code for
the function, which is usually referred to as the function definition. In languages where there is a
distinction, it is usually because the function definition may belong in a physically different location
in the code from the function declaration. Python does not make a distinction between the two, as a
function clause is made up of a declarative header line which is immediately followed by its defining
suite
42. Define Recursion
A function is recursive if it contains a call to itself. A procedure is recursive if a new activation
can begin before an earlier activation of the same procedure has ended. In other words, a new
invocation of the same function occurs within that function before it finished. Recursion is used
extensively in language recognition as well as in mathematical applications that use recursive
functions.
43. Define Module
A Module allows you to logically organize your python code. When code gets to be large the
tendency is to break it up into organized pieces that can still interact with one another at a
functioning level
44. Define importing
The process of associating attributes from other modules with your module is called
importing
45. Define namespace
A namespace is a mapping of names to objects. The process of adding a name to a
namespace consists of binding the identifier to the object.
46. Define Rebinding and Unbinding
The process of changing the mapping of a name is called rebinding and the process of
removing a name is called unbinding
47. What is name look up
When accessing an attribute, the interpreter must find it in any one of the three
namespaces(local, global and built in). This is called name look up.
48. What are the features of module import?
Modules executed not loaded Importing versus loading Names imported into current
namespace Names imported into importers scope
34
49. What are the built in functions present in python for modules
_import_( )
Globals and locals
Reload_( )