Rabu, 30 November 2016

What are the manipulators in C++

Manipulators are helper functions which can be used for formatting input and output data. The ios class and iomanip.h header file has several pre-defined manipulators.   Below table lists out several pre-defined manipulators. The manipulators hex, oct, dec, ws, endl, and flush are defined in iostream.h. The manipulators setbase(), width(), fill(), etc., that require an argument are defined in iomanip.h. Sometimes, to satisfy custom requirements, we have to create our own manipulator. Such manipulators which are created by the programmer or user are known as user-defined manipulators.   Syntax for creating a user-defined manipulator is as follows:   ostream &

The post What are the manipulators in C++ appeared first on Coding Security.


What are the manipulators in C++
read more

How to implement nested classes in C++

C++ allows programmers to declare one class inside another class. Such classes are called nested classes. When a class B is declared inside class A, class B cannot access the members of class A. But class A can access the members of class B through an object of class B. Following are the properties of a nested class: A nested class is declared inside another class. The scope of inner class is restricted by the outer class. While declaring an object of inner class, the name of the inner class must be preceded by the outer class name and scope

The post How to implement nested classes in C++ appeared first on Coding Security.


How to implement nested classes in C++
read more

How do you allocate memory for an object

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 do you allocate memory for an object appeared first on Coding Security.


How do you allocate memory for an object
read more

Selasa, 29 November 2016

How can we implement nested classes in java

In this article we will look at what is a nested class and how to define a nested class and access the nested class members in a Java program.   Java 1.1 added support for nested classes. A class defined as a member of another class definition is known as a nested class. A nested class can be either static or non-static. The non-static nested class is known as an inner class.   The enclosing class of an inner class can be called as an outer class. An inner class can access all the members of an outer class. But

The post How can we implement nested classes in java appeared first on Coding Security.


How can we implement nested classes in java
read more

what is the use of abstract keyword in java

In this article we will look at abstract keyword in Java. We will learn what is the use of abstract keyword and how to use it in Java programs.   Uses of abstract keyword Following are the uses of abstract keyword in Java: Used to create abstract methods Used to create abstract classes   Creating abstract methods Sometimes while creating hierarchies, a method inside a super class might not be suitable to have any kind of implementation. Such methods can be declared as abstract using the abstract keyword. Syntax for creating an abstract method is as follows: abstract return-type method-name(parameters-list); As candidate example for abstract

The post what is the use of abstract keyword in java appeared first on Coding Security.


what is the use of abstract keyword in java
read more

what are the adapter classes in java

In this article we will learn about adapter classes which are used to simplify the event handling process. Sample Java programs are also provided.   Adapter classes are a set of classes which can be used to simplify the event handling process. As we can see in the mouse event handling program here, even though we want to handle only one or two mouse events, we have to define all other remaining methods available in the listener interface(s). To remove the aforementioned disadvantage, we can use adapter classes and define only the required event handling method(s). Some of the adapter

The post what are the adapter classes in java appeared first on Coding Security.


what are the adapter classes in java
read more

Senin, 28 November 2016

what are bit field classes in c++

A field or member inside a class which allows programmers to save memory are known as bit fields. As we know a integer variable occupies 32 bits (on a 32-bit machine). If we only want to store two values like 0 and 1, only one bit is sufficient. Remaining 31-bits are wasted. In order to reduce such wastage of memory, we can use bit fields. Syntax of a bit field is as follows: type-specifier declarator: width;   In the above syntax declarator is an identifier (bit-field name), type-specifier is the data type of the declarator and width is the size

The post what are bit field classes in c++ appeared first on Coding Security.


what are bit field classes in c++
read more

How to access the command line arguments in C++

The data or parameters provided while invoking the program are known as command-line parameters or arguments. Command-line arguments can be accessed using the variables declared in the signature of main() function as shown below: int main(int argc, char *argv)   In the above syntax, first parameter argc holds the count of command-line arguments and the second parameter, an array of character pointers holds the actual command-line arguments.   Note: Remember that the first element in the array, i.e., argv holds the filename. First command-line parameter will be available in argv, second parameter in argv and so on.   Following program

The post How to access the command line arguments in C++ appeared first on Coding Security.


How to access the command line arguments in C++
read more

what are the different file modes in C++

Until now when using the constructor or open() function for reading or writing data to a file, we are passing only one argument i.e., the file name. We can also pass a second argument which specifies the file mode. The mode parameter specifies the mode in which the file has to be opened. We can specify one of the following modes available in ios file: A programmer can open a file in append mode by writing as follows: fstream object-name(“filename”, ios::app);   A programmer can combine multiple modes using the | symbol as follows: fstream object-name(“filename”, ios::out | ios::nocreate);  

The post what are the different file modes in C++ appeared first on Coding Security.


what are the different file modes in C++
read more

Minggu, 27 November 2016

what is the use of method overriding in java

In this article we will look at method overriding which is similar to method overloading. Method overriding is a mechanism which supports polymorphism in Java. What is method overriding? In the context of inheritance, suppose a base class A contains a method display with zero parameters and sub class B also contains a method display with zero parameters, what happens when we create an object for class B and call the display method using that object? The method that will execute is the display method in the sub class B. Then what happened to the display method in super class A? It was hidden. This process of

The post what is the use of method overriding in java appeared first on Coding Security.


what is the use of method overriding in java
read more

what is the use of super keyword in java

In this article we will look at super keyword. The super keyword is useful only in the context of inheritance. Let’s see what are the uses of this superkeyword in Java.   Uses of super keyword Following are the uses of super keyword: To refer the immediate super class constructor To refer the immediate super class members   Refer super class constructor: The super keyword can be used to invoke the constructor of its immediate super class and pass data to it. Syntax for doing so is given below: super(parameters-list); When writing the above statement inside the constructor of the derived class, it must be

The post what is the use of super keyword in java appeared first on Coding Security.


what is the use of super keyword in java
read more

How to work with methods in java

In this article you will learn about Java methods. You will look at what is a method, how to create methods in a Java class, how to call a method, how to return a value from a method and more. Method: A method is a piece of code to solve a particular task. A method is analogous to functions in C and C++. Methods are defined inside a class. The syntax for creating a method is as shown below: The return_type specifies the type of value that will be returned by the method. The name of the method is specified by method_name. Every

The post How to work with methods in java appeared first on Coding Security.


How to work with methods in java
read more

Sabtu, 26 November 2016

what is this the use of & and * operators in C++

A pointer (will be explained in detail later)  is a memory address. A pointer variable is a variable which is capable of holding the address of another memory location. We use two operators along with pointers. They are address (&) operator and dereferencing (*) operator.   The syntax for declaring a pointer is a follows: data-type  *pointer-name;   So, while declaring a pointer variable we have to use *. Let’s declare an integer pointer. int *p;   In the above example p is a pointer of the type int. It is capable of storing the address of a memory location

The post what is this the use of & and * operators in C++ appeared first on Coding Security.


what is this the use of & and * operators in C++
read more

what are different constants in C++

While programming you might need to store certain values which do not change throughout the program. For example, in mathematical formulae for calculating the area and perimeter of a circle we need the value of PI to be same. Such values are maintained as constants.   A constant is similar to a variable in the sense it is a placeholder in memory. Only difference is value of a constant cannot be changed once initialized. Constants in C++ can be: Literal constants (ex: 2, 5.6, ‘a’, “hi” etc.) Declared constants (using const keyword) Constant expressions (using constexpr keyword) Enumerated constants (using

The post what are different constants in C++ appeared first on Coding Security.


what are different constants in C++
read more

What are the datatypes in C++

A data type specifies the type of data that we can work with. As C++ is a strongly typed (not truly) language (type is specified before use), type of a variable must be specified before it is used. C++ provides several pre-defined data types. They are as shown in the following table: Character data type The char data type is used to work with single characters. An example of storing a character into a variable is as follows: char ch = ‘s’;   In the above statement, ‘s’ is a character constant. Size of char type is 1 byte which

The post What are the datatypes in C++ appeared first on Coding Security.


What are the datatypes in C++
read more

Jumat, 25 November 2016

How to perform a simple query in MySQL using PHP

This article explains how to connect to a database and display the data in a table. MYSQL is used as the DBMS and the PHP script connects through mysqli functions to display data. Relational databases are the primary choice for data storage in the Web. A DBMS provides a database along with a set of tools to manage the data in the database. One example for DBMS is MYSQL. More than half of the websites in the Internet are created using PHP and the data store as MYSQL. The steps required to access data from a table in a database

The post How to perform a simple query in MySQL using PHP appeared first on Coding Security.


How to perform a simple query in MySQL using PHP
read more

what is the model box of CSS

Every HTML element have an imaginary border around its content. The internal space between the content and the border of the element is known as padding and the external space between the border and another adjacent element is known as margin. This is known as the Box Model which is illustrated in the below figure: Padding: Padding of an element can be specified using the shorthand property padding as shown below: p { padding: 10px; }  Above CSS rule specifies a padding of 10 pixels on all sides of the element. To specify padding only on individual sides we have

The post what is the model box of CSS appeared first on Coding Security.


what is the model box of CSS
read more

What is the usage of HTML lists

HTML was primarily created to reproduce academic and research text. For this reason, particular care was taken to ensure that specific elements, such as lists and tables, were implemented and robust enough to handle the tasks for which they serve. Lists HTML are used to display a list of items either in an ordered or unordered fashion. In the case of lists, HTML defines three different types of lists: ordered lists (numbered), unordered lists (bulleted) and definition lists (term and definition pairs). All HTML lists whether ordered, unordered or definition, share the same elements. Each HTML list has the following

The post What is the usage of HTML lists appeared first on Coding Security.


What is the usage of HTML lists
read more

Kamis, 24 November 2016

A brief introduction on java virtual machine

JDK provides programmers with a set of tools (like javac, debugger, javap, appletviewer etc..) for developing Java programs. JDK includes JRE. JRE provides the run-time engine JVM along with the class libraries which contains the predefined functionality. Using JDK programmers can create and run Java programs. But with JRE alone, programmers or users can only run already compiled Java programs. We cannot create Java programs using only JRE. Java Virtual Machine (JVM) is an abstract computing machine that allows a computer to run programs written in Java. There are three concepts related to JVM: Specification Implementation Instance The JVM specification

The post A brief introduction on java virtual machine appeared first on Coding Security.


A brief introduction on java virtual machine
read more

what is the class of the string in java

A string can be created in Java using the following alternatives:   1 2 String s1 = “This is string s1.”; String s2 = new String(“This is string s2.”);   In line 2, we are using a String constructor along with the new operator to create the string explicitly. In line 1, the whole process (creation of string) is done implicitly by JVM.   If the content of the newly created string matches with the existing string (already available in memory), then a reference to the existing string in the memory is returned instead of allocating new memory. Since strings created

The post what is the class of the string in java appeared first on Coding Security.


what is the class of the string in java
read more

What are the different thread methods in java

Even though threads are independent most of the time, there might some instances at which we want a certain thread to wait until all other threads complete their execution. In such situations we can use isAlive() and join()methods. Syntax of these methods is as follows: final boolean isAlive() final void join() throws InterruptedException final void join(long milliseconds) throws InterruptedException The isAlive() method can be used to find whether the thread is still running or not. If the thread is still running, it will return true. Otherwise, it will return false. The join() method makes the thread to wait until the invoking thread terminates. Below program

The post What are the different thread methods in java appeared first on Coding Security.


What are the different thread methods in java
read more

Rabu, 23 November 2016

How to work with sub classes in java

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 11 12 13 14 15 16 17 18 19 20 21 22 23 import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MyApplet extends JApplet { JLabel

The post How to work with sub classes in java appeared first on Coding Security.


How to work with sub classes in java
read more

what is the working of Threads in java

In this article we will learn how to work with thread priorities when there are several threads competing for CPU time. Example code is also provided.   In a uni-processor system, when several threads are competing for the CPU, you might want a certain thread to get more CPU time (burst time) over the remaining threads. We can use thread priorities in such situation.   The thread class provides three final static variables (constants) namely: MIN_PRIORITY, NORM_PRIORITY, and MAX_PRIORITY whose values are 1, 5 and 10 respectively. Priority values can be in the range 1 to 10. 1 denotes minimum priority

The post what is the working of Threads in java appeared first on Coding Security.


what is the working of Threads in java
read more

What is the classPATH in java Packages

It is not mandatory that the driver program (main program) and the package(s) to be at the same location. So how does JVM know the path to the package(s)? There are three options: Placing the package in the current working directory. Specifying the package(s) path using CLASSPATH environment variable. Using the -classpath or -cp options with javac and java commands. If no package is specified, by default all the classes are placed in a default package. That is why no errors are shown even if we don’t use a packagestatement. By default Java compiler and JVM searches the current working directory (option

The post What is the classPATH in java Packages appeared first on Coding Security.


What is the classPATH in java Packages
read more

Selasa, 22 November 2016

How to implement a function dynamically in Java

In this article we will look at dynamic method dispatch in Java which is a way to provide run-time polymorphism. What is dynamic method dispatch? Dynamic method dispatch is a mechanism which resolves the call to a overridden method at run-time based on the type of object being referred. When is dynamic method dispatch possible? It is possible only when the following are satisfied: A class inherits from another class (inheritance) Super class variable refers a sub class object A overridden method is invoked using the super class reference Why dynamic method dispatch? Dynamic method dispatch is the way to

The post How to implement a function dynamically in Java appeared first on Coding Security.


How to implement a function dynamically in Java
read more

How to implement interfaces in Java

The methods declared in an interface definition must be implemented by the class which inherits that interface. This process of a class implementing the methods in an interface is known as implementing interfaces. It is mandatory for a class to implement (provide body) all the methods available in an interface. Otherwise, if a class provides implementation for only some methods (partial implementation) then the class should be made abstract. The methods of the interface must be declared as public in the class. Syntax for implementing an interface is as follows: class ClassName implements InterfaceName { //Implementations of methods in the interface }

The post How to implement interfaces in Java appeared first on Coding Security.


How to implement interfaces in Java
read more

How to group threads in Java Programming

In this article we will learn what is a thread group? How to work with thread groups in Java along with example program.   A thread group is a collection of threads. A thread group allows the programmer to maintain a group of threads more effectively. To support thread groups Java provides a class named ThreadGroup available in java.lang package.   Some of the constructors available in ThreadGroup class are: ThreadGroup(String group-name) ThreadGroup(ThreadGroup parent, String group-name)   After creating a thread group using one of the above constructors, we can add a thread to the thread group using one of the following Threadconstructors: Thread(ThreadGroup ref,

The post How to group threads in Java Programming appeared first on Coding Security.


How to group threads in Java Programming
read more

Senin, 21 November 2016

How to use Tables while writing HTML

Tables are a powerful HTML tool with many uses. They are developed primarily to communicate tabular data (for academic and research purpose). Tables are now used for many purposes like simply holding tabular data to the layout of entire pages. A table in HTML is delimited using the table tag (<table>). A table contains rows and cells. To create a row, we use the table row tag (<tr>) and to create a cell we use the table data tag (<td>). These three tags (<table>, <tr> and <td>) are the basic tags required to create a table. The table in HTML

The post How to use Tables while writing HTML appeared first on Coding Security.


How to use Tables while writing HTML
read more

what are the different types of Events in AWT

The java.awt.event package contains many event classes which can be used for event handling. Root class for all the event classes in Java is EventObject which is available in java.util package. Root class for all AWT event classes is AWTEvent which is available in java.awt package and is a sub class of EventObject class. Some of the frequently used event classes available in java.awt.eventpackage are listed below: Various constructors and methods available in the above listed event classes are as follows:   ActionEvent An action event is generated when a button is clicked, or a list item is double-clicked, or a menu item is selected. ActionEvent class contains the following

The post what are the different types of Events in AWT appeared first on Coding Security.


what are the different types of Events in AWT
read more

Advantages of using pointers in C programming

Advantages of Pointers Pointers are used frequently in C, as they offer a number of benefits to the programmers. They include the following: Pointers are more efficient in handling arrays and data tables. Pointers can be used to return multiple values from a function via function arguments. Pointers allow passing a function as argument to other functions. The use of pointer arrays to character strings results in saving of data storage space in memory. Pointers allow C to support dynamic memory management. Pointers provide an efficient way for manipulating dynamic data structures such as structures, linked lists, queues, stacks and

The post Advantages of using pointers in C programming appeared first on Coding Security.


Advantages of using pointers in C programming
read more

Minggu, 20 November 2016

An introduction to constructors in Programming

Until now in our C++ programs, we are initializing the data members of a class by creating one or more member functions and passing values as parameters to those functions. We know that C++ considers user-defined types on par with pre-defined types. We can initialize a pre-defined type at the time of declaration itself as shown below:   int x = 20;   Similarly, to initialize the data members when an object is created, C++ provides a special member function called a constructor and to de-initialize an object, another special member function called a destructor is used.   Constructor  

The post An introduction to constructors in Programming appeared first on Coding Security.


An introduction to constructors in Programming
read more

what are Different Control Statements in PHP

Control statements in PHP are used to control the flow of execution in a script. There are three categories of control statements in PHP: selection statements, iteration / loop statements and jump statements.   Selection statements The selection statements in PHP allows the PHP processor to select a set of statements based on the truth value of a condition or Boolean expression. Selection statements in PHP are if, if-else, elseif ladder and switch statement. Syntax of if is given below: 1 2 3 4 if(condition / expression) {    statements(s); } Syntax of if-else is given below: 1 2 3

The post what are Different Control Statements in PHP appeared first on Coding Security.


what are Different Control Statements in PHP
read more

What is the grammar for the HTML syntax

HTML is a mark up language used to describe the content in a web document. HTML (HyperText Markup Language) was defined using SGML (Standard Generalized Markup Language) which is an ISO (International Organization for Standardization) standard for describing text-formatting languages. One must remember that HTML is not a programming language. A file with HTML code is saved with .html extension. A web page (web document) is a document which contains many elements like text, audio, video, images, flash animations etc. The web pages are generally stored on a server and a user requests these web pages by using a web

The post What is the grammar for the HTML syntax appeared first on Coding Security.


What is the grammar for the HTML syntax
read more

Sabtu, 19 November 2016

How to define and open a file in C programming

If the user wants to store data or read data from a file in the secondary memory, the user must specify certain things about the file to the operating system. They are: Filename Data Structure Purpose Filename is the name of the file. It is a collection of characters that make up a valid filename for the operating system. It may contain two parts: a primary name and optional period with the etxtension. Some valid file names are: abc.txt prog.c sample.java store Data Structure of a file is defined a FILE in the C library. Therefore, all files should be

The post How to define and open a file in C programming appeared first on Coding Security.


How to define and open a file in C programming
read more

What is the use of UNION keyword in C programming

Unions have the same syntax as that of a structure since both of them are similar. However, there is a major difference between them in terms of memory allocation. A structure is allocated memory for all the members of the structure whereas a union is allocated memory only for largest member of the union. This implies that, although a union may contain many members of different types, it can handle only one member at a time. Like structure, a union can be declared using the union keyword as shown below: 1 2 3 4 5 6 union student { char

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


What is the use of UNION keyword in C programming
read more

What are the contents of a HTML page

HTML has come a long way right from its initial version HTML. However, despite the fact that you can use HTML for much more than serving up static text documents, the basic organization and structure of the HTML document remains the same. Before we dive into the specifics of various elements of HTML, it is important to summarize what each element is, what is it used for, and how it affects other elements in the document? A high-level overview of the standard HTML document and its elements is given below. Specifying Document Type The <!DOCTYPE> tag in a HTML document

The post What are the contents of a HTML page appeared first on Coding Security.


What are the contents of a HTML page
read more

Jumat, 18 November 2016

What is the anatomy of CSS

A style sheet contains several rules (CSS rules). A CSS rule is made of two elements: a selector and one or more declarations enclosed in braces ({}). The syntax for a CSS rule is shown below: Separation of formatting and content makes it possible to present the same markup page in different styles for different rendering methods, such as on-screen, in print, by voice (via speech-based browser or screen reader), and on Braille-based tactile devices. It can also display the web page differently depending on the screen size or viewing device. Readers can also specify a different style sheet, such

The post What is the anatomy of CSS appeared first on Coding Security.


What is the anatomy of CSS
read more

What is the architecture of the Web

A typical web application contains four tiers as depicted in the diagram below. Web browsers on the client side render documents marked up in HTML. A web server for processing and sending the data to the web browsers. An application server that computes business logic and a database server program to store and retrieve data in a database. These three types of server programs (web server, application server and database server) may run on different servers or on the same server (machine). Web browsers can run on most of the operating systems with limited hardware or software requirements. They provide

The post What is the architecture of the Web appeared first on Coding Security.


What is the architecture of the Web
read more

What is HTTP(Hyper Text Transfer Protocol) for beginner

All web communications use the same protocol HTTP. Latest version of HTTP is 1.1 released in 1999. A HTTP communication consists of two phases: a request (from client to server) and a response (from server to client). In both the request and response phases, the unit of communication contains two parts: one is the header and the other is the body part. The format for a HTTP request is shown below: HTTP-request-method  Resource-path  HTTP-version Header fields Blank line Body of the request According to HTTP 1.1 there are several request methods, among which some important methods are listed below: Among

The post What is HTTP(Hyper Text Transfer Protocol) for beginner appeared first on Coding Security.


What is HTTP(Hyper Text Transfer Protocol) for beginner
read more

Kamis, 17 November 2016

How the variable scope works in PHP

Scope refers to the visibility of a variable in the PHP script. A variable defined inside a function will have local scope i.e., within the function. A variable outside the function can have the same name as a local variable in a function, where the local variable has higher precedence over the outer variable. In some cases, a function might need access to a variable declared outside the function definition. In such cases, global declaration can be used before the variable name which allows the accessibility of the variable that is declared outside the function definition. Below example demonstrates local

The post How the variable scope works in PHP appeared first on Coding Security.


How the variable scope works in PHP
read more

What are different datatypes in PHP

PHP provides four scalar types namely Boolean, integer, double and stringand two compound types namely array and object and two special types namely resource and NULL. PHP has a single integer type, named integer. This type is same as long type in C. The size of an integer type is generally the size of word in the machine. In most of the machines that size will be 32 bits. PHP’s double type corresponds to the double type in C and its successors. Double literals can contain a decimal point, an exponent or both. An exponent is represented using E or

The post What are different datatypes in PHP appeared first on Coding Security.


What are different datatypes in PHP
read more

What are the essentials of the Text Formatting 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 What are the essentials of the Text Formatting in HTML appeared first on Coding Security.


What are the essentials of the Text Formatting in HTML
read more

Rabu, 16 November 2016

What are attribute based events 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 What are attribute based events in javascript appeared first on Coding Security.


What are attribute based events in javascript
read more

What is number object in java Script

The number object contains a collection of useful properties and methods to work with Numbers. The properties include: MAX_VALUE (represents largest number that is available), MIN_VALUE (represents smallest number that is available), NaN (represents Not a Number), POSITIVE_INFINITY (special value to represent infinity), NEGATIVE_INFINITY (special value to represent negative infinity) and PI (represents value of π. To test whether the value in a variable is NaN or not, there is a method isNaN( var ), which returns true if the value in the specified variable is NaN and falseotherwise. To convert a Number to a String, use the method toString(

The post What is number object in java Script appeared first on Coding Security.


What is number object in java Script
read more

11 Programming languages to learn for landing a good job

A programming language is a notation for writing programs, which are specifications of a computation or algorithm. Some, but not all, authors restrict the term “programming language” to those languages that can express all possible algorithms.Traits often considered important for what constitutes a programming language include: Function and target A computer programming language is a language used to write computer programs, which involve a computer performing some kind of computation or algorithm and possibly control external devices such as printers, disk drives, robots,and so on. For example, PostScript programs are frequently created by another program to control a computer printer or display.

The post 11 Programming languages to learn for landing a good job appeared first on Coding Security.


11 Programming languages to learn for landing a good job
read more

Selasa, 15 November 2016

How can we retrieve parameters in Java Servelets

It is common in web applications to pass data or parameters from one to another page. To retrieve the values of various elements in a HTML form or from another page, we can use the following methods which are available in HttpServletRequest object: String getParameter(String  name) Enumeration getParameterNames() String getParamterValues(String  name)   Following example demonstrates retrieving data from a login page to a servlet: login.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://ift.tt/2ewFFOU; <html> <head> <meta http-equiv=“Content-Type” content=“text/html; charset=ISO-8859-1”> <title>Login</title> </head> <body> <form action=“auth.html” method=“get”>

The post How can we retrieve parameters in Java Servelets appeared first on Coding Security.


How can we retrieve parameters in Java Servelets
read more

What is DOM in javascript and HTML

DHTML (Dynamic HTML) is not a new language. It is a combination of existing technologies like HTML, CSS, Javascript and DOM. Document Object Model (DOM) is a platform independent and language independent mechanism or API which allows the developer to implement dynamism into the web pages. DOM represents the web page as a hierarchy of objects. The root object in the hierarchy is window. Using DOM, developers can add new elements, delete existing elements or modify the existing elements dynamically. The DOM hierarchy is as shown below: Accessing Elements in a Document Different elements in a web document are treated

The post What is DOM in javascript and HTML appeared first on Coding Security.


What is DOM in javascript and HTML
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, visitedrepresents 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 link

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


How to style hyperlinks in CSS
read more

Senin, 14 November 2016

What is the cascading rule of CSS

As there are multiple ways to specify style information, if more than one rule is specified for the same element in the same document or in multiple documents, the conflicting rules will be resolved based on the rules specified below. More specific rules get preference over less specific rules. For example, consider the below style rules: p b {color:green} b {color:red} Now, consider the below HTML code: <b>Hello</b><p><b>Welcome to CSS</b></p> In the above example, the word Hello will appear in red color and the text Welcome to CSS will appear in green color as the style information for <b> tag

The post What is the cascading rule of CSS appeared first on Coding Security.


What is the cascading rule of CSS
read more

A cheatsheet for Google’s Programming language Go

Go (often referred to as golang) is a free and open source programming language created at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. It is a compiled, statically typed language in the tradition of Algol and C, with garbage collection, limited structural typing,memory safety features and CSP-style concurrent programming features added. The language was announced in November 2009; it is used in some of Google’s production systems, as well as by other firms. Two major implementations exist: Google’s Go compiler, “gc”, is developed as open source software and targets various platforms including Linux, OS X, Windows, various BSD and Unix

The post A cheatsheet for Google’s Programming language Go appeared first on Coding Security.


A cheatsheet for Google’s Programming language Go
read more

10 most important Linux Basic commands

If you want to become a power user in linux these are the some of the most basic commands you have to learn to use the linux Terminal Efficiently, There are a ton of other commands – more sophisticated commands – which you will one day learn. But for now, like learning to add before you learn to multiply, this list will provide you with your Linux CLI command foundation. At the end of the list, some vital information you need to use the Linux CLI. 1. ls The ls command – the list command – functions in the Linux terminal

The post 10 most important Linux Basic commands appeared first on Coding Security.


10 most important Linux Basic commands
read more

Minggu, 13 November 2016

What are the different types of storage classes 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 What are the different types of storage classes in C programming appeared first on Coding Security.


What are the different types of storage classes in C programming
read more

What are the different steps of Programming

A computer program is a set of formal instructions, which the computer executes in order to carry out some designated task. Whether that task is as simple as adding two numbers together or as complex as maintaining a large inventory for a multi-national corporation, there is a common element involved. They are both achieved by the computer executing a series of instructions – the computer program. Programming can be defined as the development of a solution to an identified problem. There are six basic steps in the development of a program: Define the problem This step (often overlooked) involves the

The post What are the different steps of Programming appeared first on Coding Security.


What are the different steps of Programming
read more

How to work with struct and functions in C programming

We know that the functions are the basic building blocks of a C program. So, it is natural for C language to support passing structures as parameters in functions. We pass a copy of the entire structure to the called function. Since the function is working on a copy of the structure, any changes to structure members within the function are not reflected in the original structure. The syntax for passing the structure variable as a parameter is shown below: 1 2 3 4 5 6 7 return–type function–name(struct structname var) { —— —— —— return expression; }   We

The post How to work with struct and functions in C programming appeared first on Coding Security.


How to work with struct and functions in C programming
read more

Sabtu, 12 November 2016

How security works in web pages

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 How security works in web pages appeared first on Coding Security.


How security works in web pages
read more

How to manage session data while programming webpages

Most web applications or websites require a user to interact with it multiple times to complete a business transaction. For example, when a user shops in Amazon or Flipkart, the user will select one item at a time by clicking on buttons or hyperlinks and filling some text fields to specify the payment details. The server will process this data and may show another page. A sequence of related HTTP requests between a web browser and a web application for accomplishing a single business transaction is called a session. All data specified by the user in a session is known

The post How to manage session data while programming webpages appeared first on Coding Security.


How to manage session data while programming webpages
read more

How to validate input using 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 validate input using javascript appeared first on Coding Security.


How to validate input using javascript
read more

Jumat, 11 November 2016

what is End of the File? How to detect End of the File in C programming

While reading data from a file, if the file contains multiple rows, it is necessary to detect the end of file. This can be done using the eof() function of ios class. It returns 0 when there is data to be read and a non-zero value if there is no data. Following program demonstrates writing and reading multiple rows of data into the file: 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

The post what is End of the File? How to detect End of the File in C programming appeared first on Coding Security.


what is End of the File? How to detect End of the File in C programming
read more

What is Bootplus Framework for beginners

Bootplus is a front-end framework which is built on top of Twitter Bootstrap. Bootplus is customized to reproduce the look and feel of Google+. Almost everything available in Bootstrap is also present in Bootplus. Bootplus utilizes LESS CSS, is compiled via Node, and is managed through GitHub. Note: Using Bootplus requires prior knowledge in HTML, CSS, JavaScript, and jQuery. To get started with Bootplus, go to official page and click the “Download package” button to get the “bootplus.zip” file on to your system. Next, extract the zip file which creates “bootstrap” folder which contains a bunch of files arranged as shown

The post What is Bootplus Framework for beginners appeared first on Coding Security.


What is Bootplus Framework for beginners
read more

How to perform Object Copy in C++ Programming

Frequently while programming there will be need to create a copy of an existing object. This can be done in three ways:   Shallow Copy   In this method the copy (object) only copies the addresses (for dynamic memory) of the source object’s members. This is similar with the semantics of static data members. A same copy is shared among several objects. Similarly, in shallow copy method, both the source and copied objects share the same memory location.   Deep Copy   In this method the copied object maintains a copy of the value of each source object’s data members.

The post How to perform Object Copy in C++ Programming appeared first on Coding Security.


How to perform Object Copy in C++ Programming
read more

Kamis, 10 November 2016

which programming languages can be used to code android apps

Android apps can be develop as Native application and Hybrid application. Native apps are written to work on a specific android platform only on the other hand Hybrid application combines elements of both native and Web applications so it is support by multiple platform i.e. Android, IOS, Windows etc. Google suggest JAVA and XML for developing native android application using Android studio. But if you are web developer and want to create a native application then you can also go through following cross-platform IDE’s: Titanium : Titanium is a SDK that forms a bridge between JavaScript and the native language

The post which programming languages can be used to code android apps appeared first on Coding Security.


which programming languages can be used to code android apps
read more

How to create a keylogger that runs in background using python

In this tutorial we are going to help you create a simple python keylogger by using simple programming techniques . Keystroke logging, often referred to as keylogging or keyboard capturing, is the action of recording (logging) the keys struck on a keyboard, typically covertly, so that the person using the keyboard is unaware that their actions are being monitored. Keylogging can also be used to study human–computer interaction. Numerous keylogging methods exist: they range from hardware and software-based approaches to acoustic analysis. STEP 1: From the start menu select,” Python 2.7 > IDLE(Python GUI)” STEP 2:  Click “File > New window” STEP

The post How to create a keylogger that runs in background using python appeared first on Coding Security.


How to create a keylogger that runs in background using python
read more

5 Best Programming languages to begin with if you are a beginner

For the beginners who have started to code, most of the people start with C programming since and we want you to start with C programming. It is Good programming language if you want to know the of how to code. But if you want to catch up and you are in the need of an immediate application so these programming languages will help you get there. If you want to learn the actual parts of programming from Scratch we recommend you to start with C programming.   JavaScript JavaScript is another language which is in high demand at the

The post 5 Best Programming languages to begin with if you are a beginner appeared first on Coding Security.


5 Best Programming languages to begin with if you are a beginner
read more

Rabu, 09 November 2016

How to generate exceptions in virtual constructors

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 generate exceptions in virtual constructors appeared first on Coding Security.


How to generate exceptions in virtual constructors
read more

How to work with virtual constructors and destructors in C++

C++ allows programmers to create virtual destructors. But, it doesn’t allow virtual constructors to be created because of various reasons. To know why a virtual destructor is needed, consider the following program: 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 #include <iostream> using namespace std; class A { public: A() { cout<<“A’s constructor”<<endl; } ~A() { cout<<“A’s destructor”<<endl; } }; class B : public A { public: B() { cout<<“B’s

The post How to work with virtual constructors and destructors in C++ appeared first on Coding Security.


How to work with virtual constructors and destructors in C++
read more

How to work with formatted console I/O in C++ Programming

Any program in a given programming language needs significant amount of input from the user and also needs to display to the output several times. To support such I/O operations, C++ provides a library which contains several classes and functions. Streams in C++   In C++, standard library maintains input and output as streams. A stream is a flow of data, measured in bytes, in sequence. If data is received from input devices, it is called a source stream and if the data is to be sent to output devices, it is called a destination stream.   The data in

The post How to work with formatted console I/O in C++ Programming appeared first on Coding Security.


How to work with formatted console I/O in C++ Programming
read more

Selasa, 08 November 2016

What the economics of the cloud computing to be followed

There are three particularly compelling use cases for utility computing over conventional computing : When the demand varies over time. For example in conventional computing the organization has to invest (to meet demand) in capital expenditure prior to starting its operations and there is no guarantee that demand will always be below the expected margin. Utility computing (cloud) can scale the resources as per demand and the customer pays for only what they use. When demand is unknown in advance. For example a web start up will need to support a spike in demand when it becomes popular, followed by

The post What the economics of the cloud computing to be followed appeared first on Coding Security.


What the economics of the cloud computing to be followed
read more

How to display file information in applet

A Java applet is a small application which is written in Java or another programming language that compiles to Java bytecode and delivered to users in the form of that bytecode. The user launches the Java applet from a web page, and the applet is then executed within a Java Virtual Machine (JVM) in a process separate from the web browser itself. A Java applet can appear in a frame of the web page, a new application window, Sun’s AppletViewer, or a stand-alone tool for testing applets. Java applets were introduced in the first version of the Java language, which

The post How to display file information in applet appeared first on Coding Security.


How to display file information in applet
read more

How do apply polymorphism in C++ programming

Introduction Polymorphism is one of the key features of object orientation. It means many forms or single interface multiple implementations. Polymorphism is of two types: 1) Compile-time polymorphism and 2) Run-time polymorphism as illustrated in the following figure: Function Overriding When a base class and sub class contains a function with the same signature, and the function is called with base class object, then the function in derived class executes and the function in base class is said to be overridden. This is known as function overriding. Following program demonstrates function overriding: 1 2 3 4 5 6 7 8

The post How do apply polymorphism in C++ programming appeared first on Coding Security.


How do apply polymorphism in C++ programming
read more

Senin, 07 November 2016

How to use arrays in PHP

Array is a collection of heterogeneous elements. There are two types of arrays in PHP. First type of array is a normal one that contains integer keys (indexes) which can be found in any typical programming languages. The second type of arrays is an associative array, where the keys are strings. Associative arrays are also known as hashes.   Array Creation Arrays in PHP are dynamic. There is no need to specify the size of an array. A normal array can be created by using the integer index and the assignment operator as shown below: $array1 = 10;  If no

The post How to use arrays in PHP appeared first on Coding Security.


How to use arrays in PHP
read more

What are the basic properties of CSS

To give various styles to HTML elements, CSS provides various properties. Related properties are grouped as: font properties, text properties, background properties, List properties etc. Font Properties The primary content in any web document is text. To apply different styles to the font of the text, we can use font properties. Font Families:  The shape and space between the characters depends upon the font family. A font family can be set using the CSS font property font-family. It is common to specify multiple font names separated by commas as a value to this property as shown below: p { font-family

The post What are the basic properties of CSS appeared first on Coding Security.


What are the basic properties of CSS
read more

What is the structure of XML document

This article explains about XML Document Structure. We will learn what does an XML document contain and some information about entities in XML documents. An XML document often uses two supplementary files. One file specifies the syntactic rules and the other file specifies the presentation details about how the content of the document is displayed. An XML document contains one or more entities that are logically related collections of information, ranging in size from a single character to a book chapter. One of these entities, called the document entity, is always physically in the file that represents the document. A

The post What is the structure of XML document appeared first on Coding Security.


What is the structure of XML document
read more

Minggu, 06 November 2016

What is cloud simulation using simulators

Although cloud computing‘s inception spans over a decade, still there are many challenging issueswhich requires a significant amount of research to be done. It is impractical for medium to small sized educational institutions and other organizations to establish a physical cloud for conducting research on cloud computing. It is not possible to perform benchmarking experiments in repeatable, dependable, and scalable environments using real-world cloud environments. A solution for this is to use simulators (virtual reality) which can simulate a real cloud environment. A cloud simulator helps to model various kinds of cloud applications by creating data centers, virtual machines and

The post What is cloud simulation using simulators appeared first on Coding Security.


What is cloud simulation using simulators
read more

How to overload the binary operators in C++

Operator overloading is syntactic sugar, and is used because it allows programming using notation nearer to the target domain and allows user-defined types a similar level of syntactic support as types built into a language. It is common, for example, in scientific computing, where it allows computing representations of mathematical objects to be manipulated with the same syntax as on paper. Operator overloading does not change the expressive power of a language (with functions), as it can be emulated using function calls. For example, consider variables a, b, c of some user-defined type, such as matrices: a + b *

The post How to overload the binary operators in C++ appeared first on Coding Security.


How to overload the binary operators in C++
read more

How to create and delete multiple threads in java

In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. The implementation of threads and processes differs between operating systems, but in most cases a thread is a component of a process. Multiple threads can exist within one process, executing concurrently and sharing resources such as memory, while different processes do not share these resources. In particular, the threads of a process share its executable code and the values of its variables at any given time. Systems with a single

The post How to create and delete multiple threads in java appeared first on Coding Security.


How to create and delete multiple threads in java
read more

Sabtu, 05 November 2016

How to crack password of zip files using python

The time to crack a password is related to bit strength (see password strength), which is a measure of the password’s entropy, and the details of how the password is stored. Most methods of password cracking require the computer to produce many candidate passwords, each of which is checked. One example is brute-force cracking, in which a computer tries every possible key or password until it succeeds. More common methods of password cracking, such as dictionary attacks, pattern checking, word list substitution, etc. attempt to reduce the number of trials required and will usually be attempted before brute force. Higher

The post How to crack password of zip files using python appeared first on Coding Security.


How to crack password of zip files using python
read more

What are the some of the best programming tips and tricks

Readability is the path to more interesting projects within a career. Readability is the path to knowing what you wrote 5 years ago, and makes code reuse actually viable Readability is the path to acquiring protégées that can learn from your style. Readability that is understandable by others allows people to appreciate your code at a level of architecture, not just functional. Readability is the path of lease resistance when you have a bug in your code. Readability is the how you put ideas into understandable text and syntax, much like writing a paragraph in natural language. Readability is somehow

The post What are the some of the best programming tips and tricks appeared first on Coding Security.


What are the some of the best programming tips and tricks
read more

Top 7 Programming languages to learn in 2017

A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms. The earliest known programmable machine preceded the invention of the digital computer and is the automatic flute player described in the 9th century by the brothers Musa in Baghdad, “during the Islamic Golden Age”. rom the early 1800s, “programs” were used to direct the behavior of machines such as Jacquard looms and player pianos. Thousands of different programming languages have been created,

The post Top 7 Programming languages to learn in 2017 appeared first on Coding Security.


Top 7 Programming languages to learn in 2017
read more

Jumat, 04 November 2016

What are Tokens in C programming

A programming language is designed to help process certain kinds of data consisting of numbers, characters and strings and to provide useful output known as information. The task of processing data is achieved by writing instructions. These set of instructions is known as a program. Programs are written using words and symbols according to the rigid rules of the programming language known as syntax.   Character Set The characters that can be used to form words, numbers and expressions depend upon the computer on which the program is run. The characters in C, are grouped into the following four categories:

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


What are Tokens in C programming
read more

What are the different types of variables in C programming

A variable is a memory location inside memory which is referred using a name. The value inside a variable changes throughout the execution of the program. Based on where the variable is declared in the program, variables can be divided into two types. They are: Local Variables Global Variables   Local Variables A variable is said to be a local variable if it is declared inside a function or inside a block. The scope of the local variable is within the function or block in which it was declared. A local variable remains in memory until the execution of the

The post What are the different types of variables in C programming appeared first on Coding Security.


What are the different types of variables in C programming
read more

What are different ways of I/O in C programming

Reading Input from Keyboard Another way of assigning values to variables besides directly assigning the value is reading values from the keyboard. C provides scanf function in the stdio.h header file. Using this function we can read values from the keyboard and assign the values to variables. The syntax of scanf function is as shown below: The control string specifies the type of value to read from the keyboard and the ampersand symbol & is an operator to specify the address the variable(s). Example usage of scanf function is shown below: Printing onto Screen To print or output text onto the

The post What are different ways of I/O in C programming appeared first on Coding Security.


What are different ways of I/O in C programming
read more

Kamis, 03 November 2016

What are the contents of a HTML webpage

HTML has come a long way right from its initial version HTML. However, despite the fact that you can use HTML for much more than serving up static text documents, the basic organization and structure of the HTML document remains the same. Before we dive into the specifics of various elements of HTML, it is important to summarize what each element is, what is it used for, and how it affects other elements in the document? A high-level overview of the standard HTML document and its elements is given below. Specifying Document Type The <!DOCTYPE> tag in a HTML document

The post What are the contents of a HTML webpage appeared first on Coding Security.


What are the contents of a HTML webpage
read more

What is variable length arguments in java

In this article we will look at what is variable length arguments or varargs is and how to use variable length arguments in methods to solve the complexity of a Java program.   There might be some situations while creating methods, where the programmer might not know how many arguments are needed in the method definition or how many arguments are going to be passed at run-time by the user. Prior to Java 5, there were a couple of workarounds for this problem but was often complex or error prone.   With Java 5, a new feature called varargs was

The post What is variable length arguments in java appeared first on Coding Security.


What is variable length arguments in java
read more

What is the difference between C++ and java Programming languages

Both Java and C++ support object oriented programming, yet there are differences between them. To begin with, Java is a pure object oriented programming language; therefore, everything is an object in Java (single root hierarchy as everything gets derived from java.lang.Object). On the contrary, in C++ there is no such root hierarchy. C++ supports both procedural and object oriented programming; therefore, it is called a hybrid language. Java C++ Java does not support pointers, templates, unions, operator overloading, structures etc. The Java language promoters initially said “No pointers!”, but when many programmers questioned how you can work without pointers, the

The post What is the difference between C++ and java Programming languages appeared first on Coding Security.


What is the difference between C++ and java Programming languages
read more

Rabu, 02 November 2016

10 Best Keyboard shortcuts that everybody should use

When you lift the hand off your keyboard and going for the mouse you are wasting precious of seconds of your time in workflow, This is the reason you need to use the keyboard shortcuts to work and moreover they are accurate than mouse. Example : Selecting Cells in a Excelsheet   One of the most basic keyboard shortcut is Ctrl + C (copy) , Ctrl + X (cut)and Ctrl +V but we are not here to talk about that we are here to talk about the keyboard shortcuts that will make your life more productive. Windows Key + Arrow:

The post 10 Best Keyboard shortcuts that everybody should use appeared first on Coding Security.


10 Best Keyboard shortcuts that everybody should use
read more

A quick start in Larvel 5 PHP Framework

Via Laravel Installer First, download the Laravel installer using Composer. <code class=" language-php">composer <span class="token keyword">global</span> <span class="token keyword">require</span> <span class="token string">"laravel/installer=~1.1"</span></code> Make sure to place the ~/.composer/vendor/bin directory in your PATH (or C:\%HOMEPATH%\AppData\Roaming\Composer\vendor\bin if working with Windows) so the laravelexecutable is found when you run the laravel command in your terminal. Once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog would create a directory named blogcontaining a fresh Laravel installation with all dependencies installed. This method of installation is much faster than installing via Composer.

The post A quick start in Larvel 5 PHP Framework appeared first on Coding Security.


A quick start in Larvel 5 PHP Framework
read more

How to make a simple computer virus in Python

A computer virus is a type of malicious software program (“malware”) that, when executed, replicates by reproducing itself (copying its own source code) or infecting other computer programs by modifying them.Infecting computer programs can include as well, data files, or the “boot” sector of the hard drive. When this replication succeeds, the affected areas are then said to be “infected” with a computer virus.The term “virus” is also commonly, but erroneously, used to refer to other types of malware. “Malware” encompasses computer viruses along with many other forms of malicious software, such as computer “worms”, ransomware, trojan horses, keyloggers, rootkits,

The post How to make a simple computer virus in Python appeared first on Coding Security.


How to make a simple computer virus in Python
read more

Selasa, 01 November 2016

A brief introduction to servlets

Servlets is a Java based technology for server side processing. Other languages or technologies for server side processing are PHP, JSP, node.js, Perl etc.   Definition of a Servlet   A servlet is a special Java class which is dynamically loaded on the server and used to generate dynamic content.   Following are the general steps that happen when a client requests a servlet: Client sends a HTTP request from web browser containing a URL with servlet. Web server receives the request and forwards the request to application server. Using information available in xml (deployment descriptor) the servlet container loads

The post A brief introduction to servlets appeared first on Coding Security.


A brief introduction to servlets
read more

How retrieving parameters is done in servlets

It is common in web applications to pass data or parameters from one to another page. To retrieve the values of various elements in a HTML form or from another page, we can use the following methods which are available in HttpServletRequest object: String getParameter(String  name) Enumeration getParameterNames() String getParamterValues(String  name)   Following example demonstrates retrieving data from a login page to a servlet: login.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://ift.tt/2ewFFOU; <html> <head> <meta http-equiv=“Content-Type” content=“text/html; charset=ISO-8859-1”> <title>Login</title> </head> <body> <form action=“auth.html” method=“get”>

The post How retrieving parameters is done in servlets appeared first on Coding Security.


How retrieving parameters is done in servlets
read more

How to Initialization Parameters of parameters in done in 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 Initialization Parameters of parameters in done in servlets appeared first on Coding Security.


How to Initialization Parameters of parameters in done in servlets
read more