Sabtu, 31 Desember 2016

What are compiler control directives in C programming

Following are the compiler control directives: These compiler control directives are used in different situations. They are: Situation 1 You have included a file containing some macro definitions. It is not known whether a certain macro has been defined in that header file. However, you want to be certain that the macro is defined. This situation refers to the conditional definition of a macro. We want to ensure that the macro TEST is always defined, irrespective of whether it has been defined in the header file or not. This can be achieved as follows: 1 2 3 4 #include”DEFINE.H” #ifndef

The post What are compiler control directives in C programming appeared first on Coding Security.


What are compiler control directives in C programming
read more

How to use nested functions in C Programming

A function calling another function within its function definition is known as a nested function. So, far we are declaring a main function and calling other user-defined functions and predefined functions like printf, scanf, gets, putsetc., So, main function can be treated as a nested function. Let’s see the following example: In the above example, the main function is calling three functions namely: clrscr, func1 and getch. So, main is a nested function. Also, in the definition of func1, it is calling another function func2. So, func1 is also a nested function. Note: In programs containing nested functions, the enclosing

The post How to use nested functions in C Programming appeared first on Coding Security.


How to use nested functions in C Programming
read more

How to handle immutable strings in java

A string is a collection of characters. In Java, strings can be created using three predefined classes namely String, StringBuffer and StringBuilderwhich are available in java.lang package. Why did Java designers provide three classes for creating strings?   Each of the above three string classes has their own advantages and disadvantages. If you want to create an immutable (whose content cannot be changed once created) string, String class is the best choice. Strings created using StringBuffer and StringBuilder classes are mutable (content can be changed after they are created).   Among StringBuffer and StringBuilder classes, strings created using StringBuffer are thread safe whereas strings

The post How to handle immutable strings in java appeared first on Coding Security.


How to handle immutable strings in java
read more

Jumat, 30 Desember 2016

How to install a package manager in Windows 10

What is a Package Manager? If you’re familiar with linux, you probably know what package managers are and how they work. However, if you’ve never used any linux distribution aka distro, this term may be new for you. Anyway, we’re going to explain it. As a Windows user, you typically install software by downloading an .exe or .msi file from the internet and executing that file. However, on linux, things are dramatically different. On linux, you use special software typically referred to as the Package Manager. Different linux distros have different package managers. The Package Manager lets the user download

The post How to install a package manager in Windows 10 appeared first on Coding Security.


How to install a package manager in Windows 10
read more

What is the difference between array notation and address

In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements , each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula. The simplest type of data structure is a linear array, also called one-dimensional array. For example, an array of 10 32-bit integer variables, with indices 0 through 9, may be stored as 10 words at memory addresses 2000, 2004, 2008, … 2036, so that the element

The post What is the difference between array notation and address appeared first on Coding Security.


What is the difference between array notation and address
read more

How to create a job Queue in Laravel Framework

In computer science, a queue  is a particular kind of abstract data type or collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position, known as enqueue, and removal of entities from the front terminal position, known as dequeue. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new element

The post How to create a job Queue in Laravel Framework appeared first on Coding Security.


How to create a job Queue in Laravel Framework
read more

Kamis, 29 Desember 2016

What is Servlet Application Programming Interface

Servlet API is a set of classes and interfaces that specify a contract between a servlet class and a servlet container. Some examples of servers that provide servlet containers are: Apache Tomcat, Oracle’s WebLogic, IBM’s Websphere, JBoss etc. All the API classes and interfaces are grouped into following packages: javax.servlet javax.servlet.http   javax.servlet Package   Provides a set of classes and interfaces that describe and defined the contract between the servlet class and the runtime environment provided by the servlet container. Following are the interfaces available in this package: Following are the classes available in this package: Following are the

The post What is Servlet Application Programming Interface appeared first on Coding Security.


What is Servlet Application Programming Interface
read more

What is Argumented Macro Substitution in C++ Programming

The preprocessor allows us to define more complex and more useful form of substitutions. The Argumented macro substitution takes the following form: Care should be taken that there is no space between the identifier and the left parentheses. The identifiers arg1, arg2, …. , argn are the formal macro arguments that are analogous to the formal arguments in a function definition. In the program, the occurrence of a macro with arguments is known as a macrocall. When a macro is called, the preprocessor substitutes the string, replacing the formal parameters with actual parameters. For example, if the Argumented macro is declared

The post What is Argumented Macro Substitution in C++ Programming appeared first on Coding Security.


What is Argumented Macro Substitution in C++ Programming
read more

How to style Hyperlinks in CSS

Different pseudo classes can be used for styling the hyperlinks in a web document. The pseudo classes that can be used are: link, visited, hover and active. The pseudo class link represents all fresh hyperlinks, visited represents all visited hyperlinks, hover represents a hyperlink on which the mouse pointer is hovered and active represents a focused hyperlink. Below example demonstrates styling hyperlinks, the order of pseudo classes must be preserved: /* unvisited link */ a:link { color: #FF0000; } /* visited link */ a:visited { color: #00FF00; } /* mouse over link */ a:hover { color: #FF00FF; } /* selected

The post How to style Hyperlinks in CSS appeared first on Coding Security.


How to style Hyperlinks in CSS
read more

Rabu, 28 Desember 2016

How to initialize a argument in Java servlets

Most of the time, data (Ex: admin email, database username and password, user roles etc…) need to be provided in the production mode (client choice). Initialization parameters can reduce the complexity and maintenance. Initialization parameters are specified in the web.xml file as follows: 1 2 3 4 5 6 7 8 <servlet> <servlet-name>Name of servlet</servlet-name> <servlet-class>Servlet class</servlet-class> <init-param> <param-name>Mail</param-name> <param-value>admin@company.com</param-value> </init-param> </servlet>   Initialization parameters are stored as key value pairs. They are included in web.xml file inside init-param tags. The key is specified using the param-name tags and value is specified using the param-value tags.   Servlet initialization parameters

The post How to initialize a argument in Java servlets appeared first on Coding Security.


How to initialize a argument in Java servlets
read more

How to define XML schema Instance

A XML document which adheres to the schema is known as a schema instance. An instance of a schema must include specifications of the namespaces it uses. These are given as attribute assignments in the tag for its root element. First attribute, xmlns defines the default namespace to be the one defined in its schema as shown below: <students  xmlns = “http://ift.tt/2iEaDq2 Second attribute, specifies the standard namespace for instances, which is XMLSchema-instance as shown below: xmlns:xsi = “http://ift.tt/2i7d47y Third attribute, schemaLocation specifies the location of the default namespace as shown below: xsi: schemaLocation = “http://ift.tt/2iE4cDs students.xsd”  An example for

The post How to define XML schema Instance appeared first on Coding Security.


How to define XML schema Instance
read more

How to generate HTML using Javascript

Dynamic HTML is not a new markup language. It is a collection of technologies (generally HTML, CSS and JavaScript) which changes the document content once it is loaded into a web browser. Some examples for dynamism in a web document are given below: Changes to document content on user interactions or after a specified time interval or on specific browser events. Moving elements to new positions. Making elements disappear and reappear. Changing the colour of the background and foreground. Changing the font properties of elements. Changing the content of the elements. Overlapping elements in stack order. Allow dragging and dropping

The post How to generate HTML using Javascript appeared first on Coding Security.


How to generate HTML using Javascript
read more

Selasa, 27 Desember 2016

How to perform bubble sort using Templates in C++ Programming

Following are the uses of templates in programming:   Templates are widely used to implement the Standard Template Library (STL). Templates are used to create Abstract Data Types (ADTs) and classify algorithms and data structures. Class templates are generally used to implement containers. Function Templates   A function template is a function which contains generic code to operate on different types of data. This enables a programmer to write functions without having to specify the exact type of parameters. Syntax for defining a template function is as follows: 1 2 3 4 5 template<class Type, ...> return–type function–name(Type arg1, ...)

The post How to perform bubble sort using Templates in C++ Programming appeared first on Coding Security.


How to perform bubble sort using Templates in C++ Programming
read more

What are the generic Datatypes in C++ programming

Every template data type (or generic data type) should be used as types in the function template definition as type of parameters. If not used, it will result in an error. Consider the following example which leads to an error: 1 2 3 4 5 template<class Type> void summ(int x, int y) //Error since Type is not used for arguments x and y { cout<<“Sum is: “<<x+y<<endl; }   Also using some of the template data types is also wrong. Consider the following example which leads to an error: 1 2 3 4 5 template<class Type1, class Type2> void summ(Type1

The post What are the generic Datatypes in C++ programming appeared first on Coding Security.


What are the generic Datatypes in C++ programming
read more

How to handle exceptions in Constructors and Destructors

It is possible that exceptions might raise in a constructor or destructors. If an exception is raised in a constructor, memory might be allocated to some data members and might not be allocated for others. This might lead to memory leakage problem as the program stops and the memory for data members stays alive in the RAM.   Similarly, when an exception is raised in a destructor, memory might not be deallocated which may again lead to memory leakage problem. So, it is better to provide exception handling within the constructor and destructor to avoid such problems. Following program demonstrates

The post How to handle exceptions in Constructors and Destructors appeared first on Coding Security.


How to handle exceptions in Constructors and Destructors
read more

Senin, 26 Desember 2016

What are the properties of the Window object in Programming

Properties on window object are: Property Description closed Is a read-only Boolean property which returns true if the window opened using window.open() is closed and returns false otherwise defaultStatus Specifies the default message to be displayed on the window’s status bar when the webpage is loaded name A unique name used to reference the window document An object that contains information about the webpage loaded in the window history An object that contains the URLs visited by the user in the window location Object that contains information about the current URL event An object that contains information about the event

The post What are the properties of the Window object in Programming appeared first on Coding Security.


What are the properties of the Window object in Programming
read more

How to use vectors in Standard Template Library in C++ Programming

A vector is like a dynamic array where all the elements are stored contiguously. Elements can be added or removed at run-time as and when needed. Vector provides the following functions for working with the data stored in it: Containers are similar to data structures and are implemented using templates. So, a container can store data of different types. Examples of containers are: Vector, List, Dequeue, Set, MultiSet, Map, MultiMap, Stack, Queue, PriorityQueue etc. The Standard Template Library (STL) is a collection of components to implement data structures and frequently used operations on data. Three major components in STL are:

The post How to use vectors in Standard Template Library in C++ Programming appeared first on Coding Security.


How to use vectors in Standard Template Library in C++ Programming
read more

What is the use of this keyword in programming

In this article, we will look at the uses of this keyword in Java programs along with example Java code.   this Keyword  this keyword in Java is used to refer current object on which a method is invoked. Using such property, we can refer the fields and other methods inside the class of that object. The this keyword has two main uses which are listed below: It is used to eliminate ambiguity between fields and method parameters having the same name. It is used for chaining constructors. To explain the first use, let’s consider the following program, which creates a

The post What is the use of this keyword in programming appeared first on Coding Security.


What is the use of this keyword in programming
read more

Minggu, 25 Desember 2016

How to work with Maps in Standard Template Library

A map is like an associative array where each element is made of a pair. A pair contains a key and a value. Key serves as an index. The entries in a map are automatically sorted based on key when data is entered. Map container provides the following functions: Following program demonstrates working with a map: Data is stored in a linear fashion. Each element is related to other elements by its position. Elements can be accessed using an iterator. Examples of sequence containers are: Vector, List, and Dequeue.   Vector: Dynamic array that allows insertion and deletion of elements

The post How to work with Maps in Standard Template Library appeared first on Coding Security.


How to work with Maps in Standard Template Library
read more

How to provide inheritance in Class Templates

A template class can be used in inheritance in the following ways: Deriving a class template from base class. Deriving a class template from a base class which also a class template and adding more template members to it. Deriving a class template from a base class which is a template class but disallowing the derived class and its derivatives to have template features. Deriving a non-template base class and adding some template members to it.   The syntax for declaring a derived class from base class which is a template class is as follows: 1 2 3 4 5

The post How to provide inheritance in Class Templates appeared first on Coding Security.


How to provide inheritance in Class Templates
read more

What are function templates with user defined types

We can also pass user-defined types like class, structure, union as arguments to a function template. Consider the following function template which demonstrates passing a class as an argument: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #include <iostream> using namespace std; class Student { public: int age; string name; Student(int age, string name) { this->age = age; this->name = name; } }; template<class Type> void display(Type &obj) { cout<<“Name is: “<<obj.name<<endl; cout<<“Age is: “<<obj.age<<endl; } int main()

The post What are function templates with user defined types appeared first on Coding Security.


What are function templates with user defined types
read more

Sabtu, 24 Desember 2016

How to add reference to function object in Javascript

In JavaScript functions are objects. So, variables that reference them can be treated as object references. Example for function definition and function call is given below: 1 2 3 4 5 6 7 8 9 10 //Function Definition function  add(x, y) {     return x+y; } //Function Call addref = add;  //Here addref is a reference to the add(function) object add(10, 20); addref(20, 30);  //This is also valid In JavaScript, a function definition must occur before a function call. So, it is wise to define a function in the head section of the page. The scope of a variable denotes the

The post How to add reference to function object in Javascript appeared first on Coding Security.


How to add reference to function object in Javascript
read more

How to overload function templates in C++ programming

As normal functions can be overloaded, template functions can also be overloaded. They will have the same name but different number of or type of parameters. Consider the following example which demonstrates template function overloading: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 #include <iostream> using namespace std; void summ(int x, int y) { cout<<“Normal Function: “<<endl; cout<<“Sum is: “<<x+y<<endl; } template<class Type1, class Type2> void summ(Type1 x, Type2 y) { cout<<“Template Function: “<<endl; cout<<“Sum is: “<<x+y<<endl; } int main()

The post How to overload function templates in C++ programming appeared first on Coding Security.


How to overload function templates in C++ programming
read more

What are associative containers in C++ Programming

There is no sequential ordering of elements. Data is sorted while giving input. Supports direct access of elements using keys. Data is stored as a tree. They facilitate fast searching, insertion, and deletion. Not efficient for sorting and random access. Examples of associative containers are: Set, multiset, Map, and multimap. Set and multiset: Store multiple elements and provide functions to manipulate them using their keys. A set does not allow duplicate elements. But a multiset allows duplicate elements. They are defined in the header file . Map and multimap: Stores the elements as pair of key and value. Key is

The post What are associative containers in C++ Programming appeared first on Coding Security.


What are associative containers in C++ Programming
read more

Jumat, 23 Desember 2016

What is constructor invocation in Java Programming

Constructor Invocation: A constructor is invoked (called) automatically whenever an object is created using the new keyword. For example, in the above example, new TicTacToe() calls the constructor of TicTacToe class. If no constructor has been defined, Java automatically invokes the default constructor which initializes all the fields to their default values.   Types of Constructor: Based on the number of parameters and type of parameters, constructors are of three types: Parameter less constructor or zero parameter constructor Parameterized constructor Copy constructor Parameter less constructor: As the name implies a zero parameter constructor or parameter less constructor doesn’t have any

The post What is constructor invocation in Java Programming appeared first on Coding Security.


What is constructor invocation in Java Programming
read more

How garbage collector works in JVM

In this article we will learn about garbage collection, which is a mechanism for freeing the memory occupied by objects which are no longer used in a program.   Garbage Collection  In most of the object oriented programming languages, memory management (allocating and deallocating memory) is left to the user and it is generally error prone (user might forget to free the memory occupied by an object). Objects are allocated memory in the heap memory which grows and shrinks dynamically. Java provides automatic memory management through a mechanism known as garbage collection. Unused objects are collected for garbage collection by

The post How garbage collector works in JVM appeared first on Coding Security.


How garbage collector works in JVM
read more

How constructor overloading is performed in java

One of the way through which Java supports polymorphism is overloading. It can be defined as creating two or more methods in the same class sharing a common name but different number of parameters or different types of parameters. You should remember that overloading doesn’t depend upon the return type of the method. Since method binding is resolved at compile-time based on the number of parameters or type of parameters, overloading is also called as compile-time polymorphism or static binding or early binding.   Why overloading? In Java, overloading provides the ability to define two or more methods with the

The post How constructor overloading is performed in java appeared first on Coding Security.


How constructor overloading is performed in java
read more

Kamis, 22 Desember 2016

How to establish pointers within class in C++ Programming

Pointers can be used inside a class for the following reasons: Pointers save memory consumed by objects of a class. Pointers can be used to allocate memory dynamically i.e., at run time.   Following program demonstrates the use of pointers within a class: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 #include<iostream> using namespace std; class Student { private: string name; string regdno; int age;

The post How to establish pointers within class in C++ Programming appeared first on Coding Security.


How to establish pointers within class in C++ Programming
read more

How to allocate memory to objects in C++ Programming

Class is not allocated any memory. This is partially true. The functions in a class are allocated memory which are shared by all the objects of a class. Only the data in a class is allocated memory when an object is created. Every object has its own memory for data (variables). For example consider the following Student class and its functions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 class Student { private: string name; string regdno; string

The post How to allocate memory to objects in C++ Programming appeared first on Coding Security.


How to allocate memory to objects in C++ Programming
read more

What is calling and called function in C programming

The point at which the function is being invoked or called is known as the calling function. The function which is being executed due to the function call is known as the called function. Example for both calling function and the called function is given in the above example. Formal Parameters and Actual Parameters A parameter or argument is data which is taken as input or considered as additional information by the function for further processing. There are two types of parameters or arguments. The parameters which are passed in the function call are known as actual parameters or actual

The post What is calling and called function in C programming appeared first on Coding Security.


What is calling and called function in C programming
read more

Rabu, 21 Desember 2016

What is SAX approach in XML Processors

The SAX standard, released in May 1998, was developed by an XML user group, XML-DEV. SAX has been widely accepted as a de facto standard and is widely supported by XML processors. The SAX approach to processing is known as event processing. The processor scans the document from beginning to end sequentially. Every time a syntactic structure like opening tag, attributes, text or a closing tag is recognized, the processor signals an event to the application by calling an event handler for the particular structure that was found. The interfaces that describe the event handlers form the SAX API. Below

The post What is SAX approach in XML Processors appeared first on Coding Security.


What is SAX approach in XML Processors
read more

What is operator precedence and associativity

Every C operator has a precedence (priority) associated with it. This precedence is used to determine how an expression involving more than one operator is evaluated. There are different levels of operator precedence and an operator may belong to one of these levels. The operators at the higher level of precedence are evaluated first. The operators in the same level of precedence are evaluated from left to right or from right to left, based on the associativity property of an operator. In the below table we can look at the precedence levels of operators and also the associativity of the

The post What is operator precedence and associativity appeared first on Coding Security.


What is operator precedence and associativity
read more

What are preprocessor operations in C programming

ANSI C provides an operator # called stringizing operator to be used in the definition of macro functions. This operator converts a formal argument into a string. For example, if the macro is defined as follows: 1 #define     sum(xy)     printf(#xy  “ = %f \n”, xy) and somewhere in the program the statement is written as: sum(a+b); then the preprocessor converts this line as shown below: 1 printf(“a+b”  “ = %f \n”, a+b); Token Pasting Operator ## The token pasting operator ## defined by ANSI enables us to combine two tokens within a macro definition to form a single token. #pragma  Directive The

The post What are preprocessor operations in C programming appeared first on Coding Security.


What are preprocessor operations in C programming
read more

Selasa, 20 Desember 2016

How does a union work in C programming

We know that arrays can be used to represent a collection of elements of the same data type like int, float etc. They cannot be used to hold a collection of different types of elements. C supports a structured data type known as a structure, a way for packing data of different data types. A structure is a convenient tool for handling a group of logically related data items. For example, it can be used to represent the details of a student or the details of a text book etc. Unions have the same syntax as that of a structure

The post How does a union work in C programming appeared first on Coding Security.


How does a union work in C programming
read more

How to put a structure within a structure in C programming

In C, structures can be nested. A structure can be defined within in another structure. The members of the inner structure can be accessed using the variable of the outer structure as shown below: 1 outer–struct–variable.inner–struct–variable.membername An example for a nested structure is shown below: 1 2 3 4 5 6 7 8 9 10 11 12 struct student { struct { char fname; char mname; char lname; }name; char grade; }; struct student s1; strcpy(s1.name.fname, “satish”); In the above example, student is the outer structure and the inner structure name consists of three members: fname, mname and lname.  

The post How to put a structure within a structure in C programming appeared first on Coding Security.


How to put a structure within a structure in C programming
read more

What are type defined structures in C programming

We can use the keyword typedef to define a structure as follows: 1 2 3 4 5 6 7 typedef  struct { char name; char rollno; int age; char grade; }student; The name student represents the structure definition associated with it and therefore can be used to declare structure variables as shown below: 1 student student1, student2, student3;   Accessing Structure Members We can access and assign values to the members of a structure in a number of ways. As mentioned earlier, the members themselves are not variables. They should be linked to the structure variables in order to make them

The post What are type defined structures in C programming appeared first on Coding Security.


What are type defined structures in C programming
read more

Senin, 19 Desember 2016

How to use Pointers in Arrays (C programming language)

When an array is declared in a program, the compiler allocates a base address and sufficient amount of storage to contain all the elements of the array in contiguous (continuous) memory locations. The base address is the location of the first element (index 0) of the array. The compiler also defines the array name as a constant pointer to the first element. Suppose array x is declared as shown below: 1 int x = {1,2,3,4,5}; Suppose the array is allocated memory as shown below:. The name x is defined as a constant pointer pointing to the first element, xand therefore

The post How to use Pointers in Arrays (C programming language) appeared first on Coding Security.


How to use Pointers in Arrays (C programming language)
read more

What are the principles of Object Orientation

In this article we will look at the key object orientation principles also known as OOP principles. Although some people or textbooks mention three OOP principles, I would say there are four key principles namely abstraction, encapsulation, inheritance and polymorphism. Note: OOP refers to Object Oriented Programming.   Abstraction Abstraction is first of the object orientation principles. It is defined as hiding the complex details and presenting only with the relevant or necessary details. Abstraction is used to manage complexity while writing programs. Encapsulation and inheritance are used to implement abstraction while writing programs. Abstraction represents the external behavior of the object (what

The post What are the principles of Object Orientation appeared first on Coding Security.


What are the principles of Object Orientation
read more

What are assertions in Java Programming

In this article we will learn what are assertions. How to create and use assertions in Java programs and how to enable and disable assertions while running a Java program.   Assertions in Java   Definition: An assertion is a condition that should be true during the program execution. They are generally used to detect errors (testing) during development of software. They have no use after the code is released to the users. They encourage defensive programming.   Creating and Using Assertions: Assertions can be created using the assert keyword. The general form of using assert keyword is as follows: assert condition; When the given condition becomes false, AssertionError

The post What are assertions in Java Programming appeared first on Coding Security.


What are assertions in Java Programming
read more

Minggu, 18 Desember 2016

An introduction to servlet configuration interface

The ServletConfig interface provides a standard abstraction for the servlet object to get environment details from the servlet container. Container implementing the ServletConfig object supports the following operations: Retrieve the initialization parameters from xml file. Retrieve the ServletContext object that describes the application’s runtime environment. Retrieve the servlet name as configured in xml.   HttpServletRequest Interface   The HttpServletRequest interface is a subtype of ServletRequest interface. Implementation for this interface is provided by the servlet container. The HttpServletRequest interface object allows us to access the data available in the HTTP headers and HTTP requests. Following methods helps us to access

The post An introduction to servlet configuration interface appeared first on Coding Security.


An introduction to servlet configuration interface
read more

How to style xml documents using CSS

This article explains styling xml documents using CSS and XSLT. Styling information can be specified for an XML document in one of the two ways. First is by using CSS (Cascading Style Sheets) and the second is by using XSLT (eXtensible Stylesheet Language Transformations) which was developed by W3C. Although using CSS is effective, XSLT is more powerful.   Cascading Style Sheets CSS can be specified in a separate file and linked with an XML document by using the xml-stylesheet processing instruction as shown below: <?xml-stylesheet  type=”text/css”  href=”style.css” ?>  As an example consider the following XML document: 1 2 3

The post How to style xml documents using CSS appeared first on Coding Security.


How to style xml documents using CSS
read more

What are the Preprocessor Directives in C programming

The ANSI committee has added some more preprocessor directives to the existing list. They are: #elif   Directive The #elif directive enables us to establish an “if…else…if” sequence for testing multiple conditions. The syntax is as shown below: 1 2 3 4 5 6 7 #if expr1 Stmts; #elif  expr2 Stmts; #elif  expr3 Stmts; #endif #pragma  Directive The #pragma directive is an implementation oriented directive that allows the user to specify various instructions to be given to the compiler. Syntax is as follows: 1 #pragma name Where name is the name of the pragma we want. For example, under Microsoft C, #pragma loop_opt(on)

The post What are the Preprocessor Directives in C programming appeared first on Coding Security.


What are the Preprocessor Directives in C programming
read more

Sabtu, 17 Desember 2016

How to select specific text in CSS using Selectors

The fundamental elements in the style rules are selectors. The selectors determine on which elements the styling must be applied. The HTML elements selected by selectors are called the subjects of the selectors. A selector may be a simple selector if the selector contains only the name of an element or a selector may be a complex selector if the selector is made up of one or more simple selectors separated by combinators such as a white space, “>” or “+”. Grouping Elements having common styling can be grouped together by separating each selector with a comma (,). Consider the

The post How to select specific text in CSS using Selectors appeared first on Coding Security.


How to select specific text in CSS using Selectors
read more

How to work with XML to represent data

This article is an introduction to XML. Here we will learn what is XML? Why XML was developed when there is HTML? and some brief history about XML. SGML is a meta-markup language which is a language for defining other markup languages. SGML was the basis for the development of HTML in 1990. In 1996 W3C started work on developing another meta-markup language called XML (eXtensible Markup Language). The motivation for developing XML was due to the deficiencies in HTML. One deficiency is, HTML is a markup language for describing the general form layout of information in a web document.

The post How to work with XML to represent data appeared first on Coding Security.


How to work with XML to represent data
read more

What is a Standard Template Library for Beginners

  The Standard Template Library (STL) is a collection of components to implement data structures and frequently used operations on data. Three major components in STL are: Containers Algorithms Iterators   Containers   A container is an object that can: Store data. Define how the data can be stored and manipulated using operations.   Containers are similar to data structures and are implemented using templates. So, a container can store data of different types. Examples of containers are Vector, List, Dequeue, Set, MultiSet, Map, MultiMap, Stack, Queue, PriorityQueue etc.   Containers are of three types: Sequence Containers Associative Containers Derived

The post What is a Standard Template Library for Beginners appeared first on Coding Security.


What is a Standard Template Library for Beginners
read more

Jumat, 16 Desember 2016

A Basic understanding to Programming languages

To communicate with a computer, we use computer languages or also known as programming languages. To write a program, we must use the computer languages. A computer language is a set of predefined words that are combined into a program according to predefined rules (syntax). Over the years, computer languages had evolved from machine language to high-level languages. There are generally three types of computer languages. They are: 1) Machine Language, 2) Assembly Language and 3) High-level languages. Machine Language In the earliest days of computers, the only programming languages available were machine languages. Each computer has its own machine

The post A Basic understanding to Programming languages appeared first on Coding Security.


A Basic understanding to Programming languages
read more

How to perform type casting and type conversion in java programming

In this article you will learn about Java type conversion and casting with appropriate examples. Converting a value from one type to another type (data type) is known as type conversion. Type conversion is of types based on how the conversion is performed: 1) Implicit conversion (also known as automatic conversion or coercion), 2) Explicit conversion (also known as type casting). Implicit Conversion or Coercion This type of conversion is performed automatically by Java due to performance reasons. Implicit conversion is not performed at all times. There are two rules to be satisfied for the conversion to take place. They

The post How to perform type casting and type conversion in java programming appeared first on Coding Security.


How to perform type casting and type conversion in java programming
read more

What is the basic values and units of HTML

The HTML markup instructions are delimited with angle brackets (< >) also known as less than and greater than symbols. The markup instructions are made of angular brackets and a keyword. These markup instructions are known as tags. In HTML there are opening tags and closing tags. An opening tag specifies the beginning of formatting and an end tag specifies the end of formatting. For example to underline text in a web page we should use <u> and </u> tags. All the closing tags begin with a / followed by the keyword. The basic syntactic units in any HTML document

The post What is the basic values and units of HTML appeared first on Coding Security.


What is the basic values and units of HTML
read more

Kamis, 15 Desember 2016

What is the use of break and continue in C programming

C provides two unconditional branching statements which are extensively used inside the looping statements. They are: break continue break Statement The break statement is used inside the looping statements to break the execution of the loop. When the break statement is encountered inside the loop, the execution of the body of the loop stops and the control is given to the next instruction after the body of the loop. The syntax of the break statement is as shown below: continue Statement The continue statement is used inside the looping statements to skip the execution of a set of instructions and

The post What is the use of break and continue in C programming appeared first on Coding Security.


What is the use of break and continue in C programming
read more

An introduction to constants in C programming

Integer Constants An integer constant refers to a sequence of digits. Generally in programs, the number systems used are: decimal, octal and hexadecimal. Decimal integers consists of umbers from 0 to 9, preceded by an optional + or – sign. Some valid examples of decimal integer constants are: 133, +45, -15, 0, 342332 etc. Embedded spaces and non-digit characters are cannot be used between digits. An octal integer consists of numbers from 0 to 7. Octal integer numbers are always preceded by a zero. For example if we have to represent 35 in octal system, we must write it as

The post An introduction to constants in C programming appeared first on Coding Security.


An introduction to constants in C programming
read more

How to work with framesets in HTML

Frames are popular in the olden days. There are used in almost all the web pages. The frameset structure provides an easy way to create multiple, separate scrolling areas in a user agent window and a flexible mechanism to modify the contents of a frame. However, there are some disadvantages of using frames. Due to this frames are deprecated. Although frames are supported in HTML 4.01, they are deprecated in HTML 5. Frames are replaced with the more powerful and flexible CSS formatting methods. Following are some of the disadvantages of frames: Frames are not search engine friendly. Frames are

The post How to work with framesets in HTML appeared first on Coding Security.


How to work with framesets in HTML
read more

Rabu, 14 Desember 2016

What is the usage of the final keyword in programming

Following are the uses of final keyword in Java: To declare constant values To make a method non-overridable To make a class non-inheritable The second and third uses of final are applicable only in the context of inheritance. Let’s look at each of the uses of final keyword in detail.   Declaring constant values The first use of final is to declare constant values in Java programs. Syntax for declaring a constant is shown below: final data-type variable-name = value; An example for declaring constants is given below: final float PI = 3.1415; In Java, you have to assign the value for the constant in the

The post What is the usage of the final keyword in programming appeared first on Coding Security.


What is the usage of the final keyword in programming
read more

How to create constant objects in C++ Programming Language

When there is a need to create a read-only object, the object can be declared as a constant object using the const keyword. Syntax for creating a constant object is as follows:   ClassName const object_name(params-list);   Following are the characteristics of a constant object: Constant object can be initialized only through a constructor. Data members of a constant object cannot be modified by any member function. Constant object are read-only objects. Constant objects should be accessed only through constant member functions.   Following program demonstrates a constant object: 1 2 3 4 5 6 7 8 9 10 11

The post How to create constant objects in C++ Programming Language appeared first on Coding Security.


How to create constant objects in C++ Programming Language
read more

How to access the Random I/O in C++ Programming

C++ allows data to be read or written from a file in sequential or random fashion. Reading data character by character or record by record is called sequential access. Reading data in any order is known as random access.   The fstream class provides functions like get(), read() for reading data and put(), write() for writing data to a file. The functions get() and put() are character-oriented functions. Syntax of these functions is as follows: get(char) put(char)   Following program demonstrates get() and put() functions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

The post How to access the Random I/O in C++ Programming appeared first on Coding Security.


How to access the Random I/O in C++ Programming
read more

Selasa, 13 Desember 2016

How functions are classified in C programming

Based on the parameters and return values, functions can be categorized into four types. They are: Function without arguments and without return value. Function without arguments and with return value. Function with arguments and with return value. Function with arguments and without return value. Function without arguments and without return value In this type of functions there are no parameters/arguments in the function definition and the function does not return any value back to the calling function. Generally, these types of functions are used to perform housekeeping tasks such as printing some characters etc. Example: 1 2 3 4 5

The post How functions are classified in C programming appeared first on Coding Security.


How functions are classified in C programming
read more

How to work with Preprocessor Directives in C Programming

C provides many features like structures, unions and pointers. Another unique feature of the C language is the preprocessor. The C preprocessor provides several tools that are not present in other high-level languages. The programmer can use these tools to make his program easy to read, easy to modify, portable and more efficient. The preprocessor is a program that processes the source code before it passes through the compiler. Preprocessor directives are placed in the source program before the main line. Before the source code passes through the compiler, it is examined by the preprocessor for any preprocessor directives. If

The post How to work with Preprocessor Directives in C Programming appeared first on Coding Security.


How to work with Preprocessor Directives in C Programming
read more

How to work with strings in C programming

A string is a collection of characters which is treated as a single data item. A group of characters enclosed in double quotes is known as a string constant. Some of the examples of string constants are: “hai” “hello world” “My name is suresh” In C programming, there is no predefined data type to declare and use strings. So, we use character arrays to declare strings in C programs. The common operations that can be performed on a string are: Reading and writing strings Combining strings together Copying one string to another Comparing strings for equality Extracting a portion of

The post How to work with strings in C programming appeared first on Coding Security.


How to work with strings in C programming
read more

Senin, 12 Desember 2016

What are the key differences between python 2 and python 3

Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java. The language provides constructs intended to enable writing clear programs on both a small and large scale. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library. Python interpreters are available for many operating systems, allowing Python code to run on

The post What are the key differences between python 2 and python 3 appeared first on Coding Security.


What are the key differences between python 2 and python 3
read more

How to use Symfony 2 Framework on PHP7

This script was tested on Debian 8. It compiles PHP7 with all options Debian (and Dotdeb) usually do. You probably don’t use many of these options, but now you can easily strip down your configure string and re-run the shell script. It activates opcache, has the MySQL extensions and compiles PHP CLI and PHP-FPM. RUN SYMFONY 2 ON PHP 7   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

The post How to use Symfony 2 Framework on PHP7 appeared first on Coding Security.


How to use Symfony 2 Framework on PHP7
read more

What is an object oriented paradigm in programming

This world is made up off several objects and objects communicate with each other. Similar objects can be grouped together. For example, take a college. It can have two working sections like teaching and non-teaching. These two groups can be further sub divided.   We can also group the people in a college into several departments. Generally a college will have several lecturers in each department. A college can have one or more laboratories and there might be separate lab technicians to assist in conducting practical. A college will have a Principal for managing the entire college. Each department might

The post What is an object oriented paradigm in programming appeared first on Coding Security.


What is an object oriented paradigm in programming
read more

Minggu, 11 Desember 2016

How to implement multithreading in java programming

In this article we will look at creating threads, a single thread and multiple threads using Thread class and Runnable interface along with sample programs. We can create a thread in a Java program in two ways, either by: Extending Thread class or Implementing Runnable interface   Creating a Single Thread   Implementing Runnable Interface Following are the steps that must be performed for creating a thread using Runnable interface. Create a class and implement Runnable interface. Implement run() method. This method contains the thread code and is the entry point for every thread. Invoke start() method. This method calls the run() method. Below is a program which creates a single thread

The post How to implement multithreading in java programming appeared first on Coding Security.


How to implement multithreading in java programming
read more

How to do generic programming in C++

To generate short, simple code and to avoid duplication of code, C++ provides templates to define the same piece of code for multiple data types. With templates, programmers can define a family of functions or classes that can perform operations on different types of data.   Templates comes under the category of meta-programming and auto code generation, where the generated code is not visible in general. Through templates, C++ supports generic programming.   Generic programming is a type of programming where the programmer specifies a general code first. That code is instantiated based on the type of parameters that are

The post How to do generic programming in C++ appeared first on Coding Security.


How to do generic programming in C++
read more

What is standard template library in C programming

The Standard Template Library (STL) is a collection of components to implement data structures and frequently used operations on data. Three major components in STL are: Containers Algorithms Iterators   Containers   Container is an object that can: Store data. Define how the data can be stored and manipulated using operations.   Containers are similar to data structures and are implemented using templates. So, a container can store data of different types. Examples of containers are: Vector, List, Dequeue, Set, MultiSet, Map, MultiMap, Stack, Queue, PriorityQueue etc.   Containers are of three types: Sequence Containers Associative Containers Derived Containers  

The post What is standard template library in C programming appeared first on Coding Security.


What is standard template library in C programming
read more

Sabtu, 10 Desember 2016

How to change HTML based on user actions

Dynamic HTML is not a new markup language. It is a collection of technologies (generally HTML, CSS and JavaScript) which changes the document content once it is loaded into a web browser. Some examples for dynamism in a web document are given below: Changes to document content on user interactions or after a specified time interval or on specific browser events. Moving elements to new positions. Making elements disappear and reappear. Changing the colour of the background and foreground. Changing the font properties of elements. Changing the content of the elements. Overlapping elements in stack order. Allow dragging and dropping

The post How to change HTML based on user actions appeared first on Coding Security.


How to change HTML based on user actions
read more

How an event can be handled in javascript

The programming which allows computations based on the activities in a browser or by the activities performed by the user on the elements in a document is known as event-driven programming. An event is the specification (essentially an object created by the browser and JavaScript) of something significant has occurred. Examples of events are click, submit, keyup etc. In JavaScript all the event names are specified in lowercase. An event handler (essentially a function) is a set of statements (code) that handles the event. Below table lists most commonly used events and their associated tag attributes: Event Tag Attribute blur

The post How an event can be handled in javascript appeared first on Coding Security.


How an event can be handled in javascript
read more

How to code multiple catch statements in C++

A try block can be associated with more than one catch block. Multiple catch statements can follow a try block to handle multiple exceptions. The first catch block that matches the exception type will execute and the control shifts to next statement after all the available catch blocks.   A try block should be followed by at least one catch block. If non catch block matches with the exception, then terminate() function will execute. Following program demonstrates handling multiple exceptions using multiple catch statements: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

The post How to code multiple catch statements in C++ appeared first on Coding Security.


How to code multiple catch statements in C++
read more

Jumat, 09 Desember 2016

An introduction to event handling in Java Programming

In this article we will learn what is event handling and how to handle events in Java programs using the delegation event model.   Definition: The process of handling events is known as event handling. Java uses “delegation event model” to process the events raised in a GUI program.   Delegation Event Model The delegation event model provides a consistent way of generating and processing events. In this model a source generates an event and sends it to one or more listeners. A listener waits until it receives an event and once it receives an event, processes the event and returns. The advantage

The post An introduction to event handling in Java Programming appeared first on Coding Security.


An introduction to event handling in Java Programming
read more

An introduction to Strings in C programming

A string is a collection of characters which is treated as a single data item. A group of characters enclosed in double quotes is known as a string constant. Some of the examples of string constants are: “hai” “hello world” “My name is suresh” In C programming, there is no predefined data type to declare and use strings. So, we use character arrays to declare strings in C programs. The common operations that can be performed on a string are: Reading and writing strings Combining strings together Copying one string to another Comparing strings for equality Extracting a portion of

The post An introduction to Strings in C programming appeared first on Coding Security.


An introduction to Strings in C programming
read more

What are the basic operators in C programming

An operator is a symbol that tells a computer to perform certain mathematical or logical operations. Operators are used in programs to manipulate data and variables. Operators are usually a part of the mathematical or logical expressions. Generally the usage of an operator is as shown below: In the above format, operand1 and operand2 can be either data or variables or expressions. Op is the operator. In C, based on the number of operands on which an operator can operate, the operators are divided into three types namely: unary, binary and ternary. Unary operators work on single operand, binary operators

The post What are the basic operators in C programming appeared first on Coding Security.


What are the basic operators in C programming
read more

Kamis, 08 Desember 2016

How to handle errors in I/O operations in C programming

While writing programs which involve accessing files, certain errors might occur while performing I/O operations on a file. Some of the error situations include the following: Trying to read beyond the end-of-file mark. Device overflow. Trying to use a file that has not been opened. Trying to perform an operation on a file, when the file is being use by another application. Opening a file with invalid name. Attempting to write to write-protected file. If such errors are unchecked, it may lead to abnormal termination of the program or may lead to incorrect output. C library provides two functions namely

The post How to handle errors in I/O operations in C programming appeared first on Coding Security.


How to handle errors in I/O operations in C programming
read more

How to access the address of a variable in C programming

The actual location of a variable in memory is system dependent. A programmer cannot know the address of a variable immediately. We can retrieve the address of a variable by using the address of (&) operator. Let’s look at the following example: 1 2 3 int a = 10; int *p; p = &a; In the above example, let the variable a is stored at memory address 5000. This can be retrieved by using the address of operator as &a. So the value stored in variable p is 5000 which is the memory address of variable a. So, both the

The post How to access the address of a variable in C programming appeared first on Coding Security.


How to access the address of a variable in C programming
read more

How do you generate a Exception in java

In this article we will learn how to create user defined exceptions (own exceptions) and how to use them in Java programs. Although Java provides several pre-defined exception classes, sometimes we might need to create our own exceptions which are also called as user-defined exceptions. Steps for creating a user-defined exception: Create a class with your own class name (this acts the exception name) Extend the pre-defined class Exception Throw an object of the newly create exception As an example for user-defined exception, I will create my own exception named NegativeException as follows: 1 2 3 4 5 6 7 8 9

The post How do you generate a Exception in java appeared first on Coding Security.


How do you generate a Exception in java
read more

Rabu, 07 Desember 2016

What are the literals and datatypes in javascript

JavaScript provides five scalar primitive types: Number, Boolean, String, Undefined, Null and two compound primitive types Array and Object. Even though JavaScript supports object-orientation features, it still supports these scalar primitive data types simply because of performance reasons. Maintenance of primitive values is much faster than objects. JavaScript also provides object versions known as wrapper objects for the primitive types Number, Boolean and String namely, Number, Boolean and String. All primitive values are stored on stack whereas objects are stored in heap.   String Data Type A string literal is a string value enclosed in either double quotes or single

The post What are the literals and datatypes in javascript appeared first on Coding Security.


What are the literals and datatypes in javascript
read more

How control statements works in javascript

Statements that are used to control the flow of execution in a script are known as control statements. Control statements are used along with compound statements (a set of statements enclosed in braces). Local variables are not allowed in a control construct (control statement + single/compound statement). Even though a variable is declared within a control construct, it is treated as a global variable.   Control Expressions The expressions upon which the flow of control depends are known as control expressions. These include primitive values, relational expressions and compound expressions. The result of evaluating a control expression is always a

The post How control statements works in javascript appeared first on Coding Security.


How control statements works in javascript
read more

How to perform input validation in javascript

One of the best uses of client-side JavaScript is the form validation. The input given by the user can be validated either on the client-side or on the server-side. By performing validation on the client-side using JavaScript, the advantages are less load on the server, saving network bandwidth and quicker response for the users. Form input can be validated using different events, but the most common event used is submit i.e when the submit button is clicked. Corresponding attribute to be used is onsubmit of the form tag. Let’s consider a simple form as shown below: 1 2 3 4

The post How to perform input validation in javascript appeared first on Coding Security.


How to perform input validation in javascript
read more

Selasa, 06 Desember 2016

An introduction to Basic security concepts

Security in the web relate to protecting your sensitive data (like passwords, credit card numbers, PINs etc) from being accessed or manipulated by the people whom you think are not deemed to do so. Most of the security concerns arise due to the vulnerabilities in the Internet and related technologies. To understand what are the security issues, consider an example of a transaction where you send your username and password to login to a website. Security issues for this transaction are as follows: Privacy – It should not be possible for a third-party to steal your data while it is

The post An introduction to Basic security concepts appeared first on Coding Security.


An introduction to Basic security concepts
read more

How to perform type conversion and type casting in C programming

Converting a data type of an expression to another data type is known as type conversion. Here expression refers to either a variable or value or sub expression. There are two types of conversions. They are: Implicit conversion or Coercion Explicit conversion or Casting   Implicit Conversion While evaluating expressions, it is common to have operands of different data types. C automatically converts the data type of operands or any intermediate values to the proper type so that expression can be evaluated without losing any significance. This automatic conversion performed by C is known as implicit conversion. In C, the

The post How to perform type conversion and type casting in C programming appeared first on Coding Security.


How to perform type conversion and type casting in C programming
read more

A brief introduction to javascript for beginners

The World Wide Web (WWW) was introduced in the early 1990s. It was followed by the development of HTML which was used to create web pages. As HTML is only used to describe the content in a web page, developers were only able to create static web pages. Users were not able to interact with the web pages. So, a programming language was necessary. One of the scripting languages thus developed to create dynamic webpages that can respond to user events on a webpage is JavaScript.   History of JavaScript  The first scripting language was introduced by Brendan Eich, a

The post A brief introduction to javascript for beginners appeared first on Coding Security.


A brief introduction to javascript for beginners
read more

Senin, 05 Desember 2016

How many ways we can write CSS to style webpage

There are different ways to specify style information for the HTML elements in a web page. Each method has its own advantages and disadvantages over the other methods. The different ways in which we can specify the style information are: Inline CSS Embedded CSS (Document Level CSS) Imported CSS External CSS Inline CSS In Inline CSS, the style information is specified inline i.e., within the HTML tag. We will use the style attribute of a HTML tag to specify the style information using Inline CSS. The syntax for Inline CSS is as shown below: <tagname  style=“property-name:value”>Content</tagname> An example for specifying

The post How many ways we can write CSS to style webpage appeared first on Coding Security.


How many ways we can write CSS to style webpage
read more

Difference between 1D and 2D arrays in C Programming

In all the programs we have done until now, to store and operate on values we have used variables. But at a point in time, a variable can hold only a single value. For example, in the following syntax: int a = 10; we are able to store only 10 in the variable a, which is a single value. It is normal in programming to work with a list of values or a group of values at once. For such purposes, variables cannot be used. So, C language provides the construct array for holding multiple values at once. Definition: “An

The post Difference between 1D and 2D arrays in C Programming appeared first on Coding Security.


Difference between 1D and 2D arrays in C Programming
read more

How to use functions in C Programming

Until now, in all the C programs that we have written, the program consists of a main function and inside that we are writing the logic of the program. The disadvantage of this method is, if the logic/code in the main function becomes huge or complex, it will become difficult to debug the program or test the program or maintain the program. So, generally while writing the programs, the entire logic is divided into smaller parts and each part is treated as a function. This type of approach for solving the given problems is known as Top Down approach. The

The post How to use functions in C Programming appeared first on Coding Security.


How to use functions in C Programming
read more

Minggu, 04 Desember 2016

How to use the inner classes in event handling

In this article we will learn about inner classes and how can they be used to simplify event handling process along with sample Java programs.   An inner class is a class which is defined inside another class. The inner class can access all the members of an outer class, but vice-versa is not true. The mouse event handling program which was simplified using adapter classes can further be simplified using inner classes. Following is a Java program which handles the mouse click event using inner class and adapter class: 1 2 3 4 5 6 7 8 9 10

The post How to use the inner classes in event handling appeared first on Coding Security.


How to use the inner classes in event handling
read more

What are some built on Objects datatypes in javascript

To solve different kinds of problems, JavaScript provides various built-in objects. Each object contains properties and methods. Some of the built-in objects in Javascript are: Array Date Math String Number Array object:  The properties available on Array object are: Property Description length Returns the number of elements in the array constructor Returns the function that created the array object prototype Allows us to add properties and methods to an array object Methods available on Array object are: Method Description reverse() Reverses the array elements concat() Joins two or more arrays sort() Sort the elements of an array push() Appends one

The post What are some built on Objects datatypes in javascript appeared first on Coding Security.


What are some built on Objects datatypes in javascript
read more

What are the basic AWT controls in java

In this article we will look at how to create and work with various AWT controls available in the java.awt package along with sample code.   We can add and remove controls to a Container like Applet and Frame using the following methods available in the Container class: Component add(Component ref) Component remove(Component ref)   Label A label is a GUI control which can be used to display static text. Label can be created using the Label class and its constructors which are listed below: Label() Label(String str) Label(String str, int how) The parameter how specifies the text alignment. Valid values are

The post What are the basic AWT controls in java appeared first on Coding Security.


What are the basic AWT controls in java
read more

Sabtu, 03 Desember 2016

The Classification of storage in C programming

The storage classes specify the scope and lifetime of a variable in a C program. The scope (active) specifies in which parts of the program is the variable accessible and the lifetime (alive) specifies how long a variable is available in the memory so that the program will be able to access that variable. There are four storage classes in C. They are: auto register extern static The storage classes’ auto, register and static can be applied to local variables and the storage classes’ extern and static can be applied to global variables. auto When a variable is declared with

The post The Classification of storage in C programming appeared first on Coding Security.


The Classification of storage in C programming
read more

What are the formal and actual parameters in C programming

  A parameter or argument is data which is taken as input or considered as additional information by the function for further processing. There are two types of parameters or arguments. The parameters which are passed in the function call are known as actual parameters or actual arguments. The parameters which are received by the called function are known as formal parameters or formal arguments. Example is shown below: In the above example, x and y are known as actual parameters and a and bare known as formal parameters. In the above code, we can see that the return type

The post What are the formal and actual parameters in C programming appeared first on Coding Security.


What are the formal and actual parameters in C programming
read more

What is the use of the static keyword in java

In this article we will look at static keyword which can be used to share data among multiple objects.   static Keyword In Java programs, static keyword can be used to create the following: Class variables Class methods Static blocks   Class Variables: The static keyword is used to create one of the three types of variables called as class variables. A class variable is a variable declared inside a class and outside all the methods and is marked as static. Syntax for declaring a class variable or a static variable is shown below: static data-type variable-name; Example for declaring a class

The post What is the use of the static keyword in java appeared first on Coding Security.


What is the use of the static keyword in java
read more

Jumat, 02 Desember 2016

How to get Random Access to Files in C programming

All the functions that we have seen so far are useful for reading and writing data sequentially to and from a file. Sometimes the user might want to access data at random locations from a file. For this purpose, C library provides functions namely: ftell, fseek and rewind. The ftell function lets the user to know the current location of the file pointer. It takes a file-pointer as a parameter and returns a long integer that corresponds to the current position of the pointer. Syntax is a shown below: 1 long ftell(file–pointer) The rewind function lets the user to move

The post How to get Random Access to Files in C programming appeared first on Coding Security.


How to get Random Access to Files in C programming
read more

What are Macro Substitution Directives in C programming

Macro substitution is a process where an identifier in a program is replaced by a predefined string composed of one or more tokens. The preprocessor accomplishes this task under the direction of #define statement. This statement, usually known as a macro definition takes the following form:   #define identifier string If this statement is included in the program at the beginning, then the preprocessor replaces every occurrence of the identifier in the source code by the string. Note: Care should be taken that there is no space between the # and the word define. Also there should be atleast a

The post What are Macro Substitution Directives in C programming appeared first on Coding Security.


What are Macro Substitution Directives in C programming
read more

What are getc() and putc() functions in C Programming

getc and putc Functions The simplest I/O functions are getc and putc. These are analogous to getchar and putchar functions and handle one character at a time. The putcfunction writes a character to the file associated with a file pointer. The syntax is as shown below: 1 putc(ch, file–pointer); Similarly the function getc is used to read a character from a file associated with a file-pointer. The syntax is as shown below: 1 getc(file–pointer) The file pointer moves by one character position for every operation of getcor putc. The getc will return an end-of-file marker EOF, when end of the

The post What are getc() and putc() functions in C Programming appeared first on Coding Security.


What are getc() and putc() functions in C Programming
read more

Kamis, 01 Desember 2016

How to format text in HTML

The web is used to transfer information in various formats, but text is still the main form of communication across the internet and even on the multimedia rich World Wide Web. In this section we will see formatting of text supported by HTML at paragraph level. Formatting Paragraphs The most basic form to place text within a web page is in a paragraph. HTML provides a specific tag (<p>) to format text as paragraphs. The paragraph tags, <p> and </p> provides the most basic block formatting for web page text. Their use is straightforward. Place the opening tag (<p>) at

The post How to format text in HTML appeared first on Coding Security.


How to format text in HTML
read more

How to perform type conversion in javascript

The mechanism of converting a value or variable from one type to another type is known as type conversion. There two types of type conversion: implicit type conversion and explicit type conversion.   Implicit Type Conversion: Type conversion which is performed automatically by the JavaScript interpreter is known as implicit type conversion or coercion. Implicit type conversion may take place when the expected type is different from the actual type of the value given from the user or read from a file etc. For example, consider the following expression: “John” + 123  It can be observed that in the above

The post How to perform type conversion in javascript appeared first on Coding Security.


How to perform type conversion in javascript
read more

What are the contents to be specified in HTML head section

Now, let’s see what elements fit into the head section of a HTML document (web page). <title> Tag The <head> element of a HTML document contains various other elements. Among them the title tag (<title>) is used to assign a title to the HTML document (web page). For example, to display the title of the web page as Homepage, the title tags are used as follows: <title>Homepage</title>  The title of the web page is displayed on the titlebar of a browser. The title of a web page is also used in various other places like: it is used as the

The post What are the contents to be specified in HTML head section appeared first on Coding Security.


What are the contents to be specified in HTML head section
read more