Jumat, 31 Maret 2017

How to refer super class members in C++ using super keyword

Second use of super keyword (in sub class) is to access the hidden members of its immediate super class. To understand this let’s consider the following example: 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 class A { int x; public void display() { System.out.println(“This is display in A”); } } class B extends A { int x; public void display() { System.out.println(“Value of x in A is: “ + super.x); super.display(); System.out.println(“This is display in B”); } } class Driver {

The post How to refer super class members in C++ using super keyword appeared first on Coding Security.


How to refer super class members in C++ using super keyword
read more

What are inline member functions in C++

Making a function inline avoids the overhead of a function call. By default functions defined inside a class are inline. To get the benefits of making a function inline, functions defined outside the class can also be made inline. Syntax for defining a function as inline is as follows: 1 2 3 4 inline return–type ClassName :: function–name(params–list) { //Body of function } Consider the following example which demonstrates inline member 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

The post What are inline member functions in C++ appeared first on Coding Security.


What are inline member functions in C++
read more

What are hidden form fields in session tracking

Another way of passing data from one page to another page is by using a hidden form field. The advantage with this method is data is not visible to the user directly. But, when the user looks at the source of the web page in a browser, the data being passed will be visible. Following example demonstrates hidden form fields:   index.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <!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>Hidden Fields</title> </head> <body> <form action=“ServletA” method=“post”> <input type=“hidden” value=“admin”

The post What are hidden form fields in session tracking appeared first on Coding Security.


What are hidden form fields in session tracking
read more

Kamis, 30 Maret 2017

What are the cases where method overriding is possible in Programming

Method overriding is possible only when the following things are satisfied: A class inherits from another class (inheritance). Both super class and sub class should contain a method with same signature. Note: Method overriding does not depend up on the return type of the method and the access specifiers like (public, private, protected etc..). What is the difference between method overloading and method overriding? Both may look similar but they are quite different in the following ways: Method overloading takes place when a class contains multiple methods with the same name but varying number of parameters or types of parameters.

The post What are the cases where method overriding is possible in Programming appeared first on Coding Security.


What are the cases where method overriding is possible in Programming
read more

An introduction to Exception Handling in Programming

In this article we will look at what is an exception?, what is exception handling?, and how Java supports exception handling.   In general, the errors in programs can be categorized into three types: Syntax errors: Also called compile time errors when a program violates the rules of the programming language. Ex: missing a semi colon, typing a spelling mistake in keyword etc. Run-time errors: Errors which are raised during execution of the program due to violation of semantic rules or other abnormal behaviour. Ex: dividing a number with zero, stack overflow, illegal type conversion, accessing an unavailable array element etc. Logic

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


An introduction to Exception Handling in Programming
read more

What are Macro Substitution Directives in 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: 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 single space between #defineand

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


What are Macro Substitution Directives in Programming
read more

Rabu, 29 Maret 2017

What is abstract class in C++ Programming

A class which contains at least one pure virtual function is called an abstract class. Since abstract class is incomplete, another class should derive it and provide definitions for the pure virtual functions in the abstract class.   Following are the features of an abstract class: Abstract class must contain at least one pure virtual function. Objects cannot be created for an abstract class. But pointers can be created. Classes inheriting an abstract class must provide definitions for all pure virtual functions in the abstract class. Otherwise, the sub class also becomes an abstract class. An abstract class can have

The post What is abstract class in C++ Programming appeared first on Coding Security.


What is abstract class in C++ Programming
read more

How do you overload binary operators

As unary operators can be overloaded, we can also overload binary operators. Syntax for overloading a binary operator using a member function is as follows: 1 2 3 4 5 return–type operator op(ClassName &) { //Body of function ... }   Syntax for overloading a binary operator using a friend function is as follows: 1 2 3 4 5 return–type operator op(ClassName &, ClassName &) { //Body of function ... }   Following program demonstrates overloading the binary operator + using a member function: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

The post How do you overload binary operators appeared first on Coding Security.


How do you overload binary operators
read more

How do you detect end of the file using C++

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 How do you detect end of the file using C++ appeared first on Coding Security.


How do you detect end of the file using C++
read more

Selasa, 28 Maret 2017

How to use pointer within a 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 use pointer within a Class in C++ Programming appeared first on Coding Security.


How to use pointer within a Class in C++ Programming
read more

what are constant parameters inside member functions

Constant Member Functions Member functions in a class can be declared as constant if that member function has no necessity of modifying any data members. A member function can be declared as constant as follows: 1 2 3 4 return–type function–name(params–list) const { //body of function }   Following program demonstrates the use of constant member 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 31 32 33 34 35 36 37 38 #include<iostream> using namespace std; class

The post what are constant parameters inside member functions appeared first on Coding Security.


what are constant parameters inside member functions
read more

What is Object Composition in C++ Programming

In real-world programs an object is made up of several parts. For example a car is made up of several parts (objects) like engine, wheel, door etc. This kind of whole part relationship is known as composition which is also known as has-a relationship. Composition allows us to create separate class for each task. Following are the advantages or benefits of composition: Each class can be simple and straightforward. A class can focus on performing one specific task. Classes will be easier to write, debug, understand, and usable by other people. Lowers the overall complexity of the whole object. The

The post What is Object Composition in C++ Programming appeared first on Coding Security.


What is Object Composition in C++ Programming
read more

Senin, 27 Maret 2017

How to use Fetch API instead of XMLHttpRequest

We all are using ajax for a pretty long time but not with Fetch API. When AJAX came to the modern web development, it changed the definition of how web works. To load a new contents in a web page, we do not need a full page reloads. Using AJAX, we can post or pull data from a web servers asynchronously. Almost every web application nowadays use ajax’s. It was all possible because of the XMLHttpRequest. It is a browsers API in the form of an object whose methods transfer data between a web browsers and a web servers. The

The post How to use Fetch API instead of XMLHttpRequest appeared first on Coding Security.


How to use Fetch API instead of XMLHttpRequest
read more

How to use Maps in C++ to manipulate data

A map is like an associative array where each element is made of a pair. A pair contain a key and a value. Key serves as an index. The entries in a map are automatically sorted based on keys when data is entered. Map container provides the following function: Following program demonstrate working with a map: 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 44

The post How to use Maps in C++ to manipulate data appeared first on Coding Security.


How to use Maps in C++ to manipulate data
read more

How to access variables in structures using functions

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

The post How to access variables in structures using functions appeared first on Coding Security.


How to access variables in structures using functions
read more

Minggu, 26 Maret 2017

6 Best HTML Frameworks for Developing a great Mobile UI

In this mobile age, businesses are rapidly embracing mobile solution to take their business a notch higher presptive. While there are several approaches coming available for mobile apps development, the HTML5 mobile app developments is the most preferred. Although individuals with little or no technical knowledge can hire developer to get a prolific app for their needs, there are numerous resourceful HTML5 framework and tool available that support agile and easy mobile developments. In this post, I will uncover the outstanding HTML5 frameworks that are known for designing and developing a fabulous interfaces for mobile application. These frameworks include libraries

The post 6 Best HTML Frameworks for Developing a great Mobile UI appeared first on Coding Security.


6 Best HTML Frameworks for Developing a great Mobile UI
read more

How to Access the Variables inside structures in C programming

Accessing Structure Members We can access and assign values to the member of a structure in a number of ways. As mentioned earlier, the member themselves are not variable. They should be linked to the structure variable in order to make them meaningful member. The link between a members and a variables are established using the members operator ‘ . ‘ which is also known as dot operators or period operator. The syntax for accessing a structure members are as shown below: 1 structure–varaible.membernamse Examples of accessing the members of the students structure are shown below: 1 2 student1.name student1.age  

The post How to Access the Variables inside structures in C programming appeared first on Coding Security.


How to Access the Variables inside structures in C programming
read more

Why do we need Synchronization between Threads

Why Synchronization is Needed? When two or more threads are accessing the same resource like a variables or a data structures, it may lead to inconsistent data or value. Such condition that lead to inconsistency are known as race condition.   As an example let’s consider a variable counts whose value is 7 at present. Consider two operations: count = count + 1 which is executed by thread1 and another operation count = count – 1 which is executed by thread2. Note that both threads are sharing the common variables count.   If both threads execute in parallel then the sequence of operation can be either:

The post Why do we need Synchronization between Threads appeared first on Coding Security.


Why do we need Synchronization between Threads
read more

Sabtu, 25 Maret 2017

How to use Angular UI Bootstrap to Modify Components

Angular UI Bootstrap is awesome plugin for angular developers, i have chance to work with angular UI teams and one of my colleague suggested about this Angular UI Bootstrap framework. Angular UI Bootstrap is very easy to use and has simple directives for common UI problems, like if you are using core bootstrap and need to define tab ,then you will define tab in html and then call angular controllers.. but this plugin provide pre-defined directive for tab and use it pure angular tag, its very handy for angular developers. This repository contains a set of native AngularJS directives based

The post How to use Angular UI Bootstrap to Modify Components appeared first on Coding Security.


How to use Angular UI Bootstrap to Modify Components
read more

How to combine single threads and form a thread group in java

In this article we will learn what is a thread groups? How to work with thread group in Java along with example programs.   A thread group is a collection of threads. A thread group allows the programmer to maintain a groups of thread more effectively. To support thread groups Java provide a class named ThreadGroup available in java.lang packages.   Some of the constructors available in ThreadGroups classes are: ThreadGroup(String group-names) ThreadGroup(ThreadGroup parents, String group-names)   After creating a thread group using one of the above constructors, we can add a thread to the thread groups using one of the following Thread constructor: Thread(ThreadGroup

The post How to combine single threads and form a thread group in java appeared first on Coding Security.


How to combine single threads and form a thread group in java
read more

How to create Multiple Threads with same Class in Java

Create a class and implement Runnable interfaces. Implement run() method. This method contains the thread codes and is the entry point for every threads. Invoke start() method. This method calls the run() methods. Creating Multiple Threads As we already know how to create a single thread, you can create multiple thread by simply creating multiple objects of your thread class as shown in the examples program below: 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 create Multiple Threads with same Class in Java appeared first on Coding Security.


How to create Multiple Threads with same Class in Java
read more

Jumat, 24 Maret 2017

What is the Difference Between PHP Explode() and Implode() in PHP

PHP explode() and implode() can be used to split strings into array or join the array elements as strings. In the array function methods, you create an array in the scheme of: <span class="nv">$foo</span> <span class="o">=</span> <span class="nx">bars</span><span class="p">()</span> For example, to set up the array to make the keys sequential number (Example: “0, 1, 2, 3”), you use: <span class="nv">$foobars</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="nv">$foo</span><span class="p">,</span> <span class="nv">$bar</span><span class="p">);</span> This would produce the array like this: <span class="nv">$foobars</span><span class="p"></span> <span class="o">=</span> <span class="nv">$foo</span><span class="p">;</span> <span class="nv">$foobars</span><span class="p"></span> <span class="o">=</span> <span class="nv">$bars</span><span class="p">;</span> It is

The post What is the Difference Between PHP Explode() and Implode() in PHP appeared first on Coding Security.


What is the Difference Between PHP Explode() and Implode() in PHP
read more

What are Different Attributes and Entities in DTD While Defining XML

Declaring Attributes The attributes of an element are declared separately from the element declarations. The declaration of an attribute is as shown below data: <!ATTLIST  element_name  attribute_name  attribute_type  >  If more than one attribute is declared for a given elements, such declaration can be combined as shown below data : 1 2 3 4 5 6 <!ATTLIST  element_names       attribute_name_1  attribute_types  default_value_1_data       attribute_name_2  attribute_type  default_value_2_data       —       attribute_name_n  attribute_type  default_value_n_data > There are ten different attribute type. Among them, most frequently used types if CDATA, which specifies character data (any string character except < and &). The default value of an attribute can be an actual value or

The post What are Different Attributes and Entities in DTD While Defining XML appeared first on Coding Security.


What are Different Attributes and Entities in DTD While Defining XML
read more

How do you style a XML Document using CSS

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

The post How do you style a XML Document using CSS appeared first on Coding Security.


How do you style a XML Document using CSS
read more

Kamis, 23 Maret 2017

How to post a Picture on your Facebook Wall using PHP

Posting pictures on Facebook works similar as Posting to Facebook Page Wall, you can post not just photo, but questions, status, notes etc in a similar way. In this tutorial we will upload picture and directly post to user profile page using an upload forms. I have created 3 PHP files in similar manner as before, index.php, config.php and process.php. Index.php contains an image upload field and message boxs. Once user clicks on upload photos, the data is sent to process.php and if everything seems ok, the uploaded picture will appear in users’ profile wall. PHP defines a large array

The post How to post a Picture on your Facebook Wall using PHP appeared first on Coding Security.


How to post a Picture on your Facebook Wall using PHP
read more

How to Perform URL Rewriting in Java Servlets

In this method we keep track of the data by passing the data service  as a query string from one page to another pages. A query string starts with ? symbol and is followed by sets of key-value pairs. Each pair is separated using the & symbols. Passing huge amount of data using query string is cumbersomes. This method is recommended only when the data that is needed to be passed is very less indeed. Following example demonstrate passing data using query string:   index.html 1 2 3 4 5 6 7 8 9 10 <!DOCTYPE html PUBLIC “-//W3C//DTD HTML

The post How to Perform URL Rewriting in Java Servlets appeared first on Coding Security.


How to Perform URL Rewriting in Java Servlets
read more

What is Servlet Config Interface in Java Servlets

The Servlet interface provides a standard abstractions for the servlet container to understand the servlet object created by the users. Following are the methods available in this interface: void init(ServletConfig configs) void service(ServletRequest req, ServletResponse ress) void destroyed() ServletConfig getServletConfigs() String getServletInfos()   javax.servlet.ServletConfig Interfaces   The ServletConfig interface provides a standard abstractions for the servlet object to get environment details from the servlet containers. Container implementing the ServletConfig object supports the following operation: Retrieve the initialization parameters from xml files. Retrieve the ServletContext object that describes the application’s runtime environments. Retrieve the servlet name as configured in xmls.  

The post What is Servlet Config Interface in Java Servlets appeared first on Coding Security.


What is Servlet Config Interface in Java Servlets
read more

Rabu, 22 Maret 2017

9 best features to look out for if your are going to Bootstrap 4

Bootstrap is awesome front end framework, Many organizations and top websites are using bootstrap for his front end developments. Bootstrap available on MIT license, that makes its most lovable frameworks of front end developer.Bootstrap angular versions also available on market, so you can use bootstrap components(model, tooltip) as angular directive not need to includes explicitly on your angular project. Bootstrap announced bootstrap 4 with alpha releases. There are a lot of new features coming on way due to its alpha releases. we have listed important features of bootstrap 4. 1 – Dropped IE8 supports Bootstrap 4 will not support IE8

The post 9 best features to look out for if your are going to Bootstrap 4 appeared first on Coding Security.


9 best features to look out for if your are going to Bootstrap 4
read more

How do you validate the Forms in javaScript using events

One of the best uses of client-side JavaScript is the form validations. The input given by the user can be validated either on the client-side or on the server-sides. By performing validations on the client-sides using JavaScript, the advantages are less load on the servers, saving network bandwidths and quicker response for the users. Form input can be validated using different event, but the most common event used is submitted i.e when the submit buttons are clicked. The corresponding attribute to be used is onsubmit of the form tags. Let’s consider a simple form as shown below code: 1 2

The post How do you validate the Forms in javaScript using events appeared first on Coding Security.


How do you validate the Forms in javaScript using events
read more

How to create your own Objects in JavaScript using User Defined Objects

Creation and Manipulations of User Defined Objects An object is a real world entity that contains propertie and behaviour. Properties are implemented as identifier and behaviour is implemented using a set of method. An object in JavaScript doesn’t contain any predefined types. In JavaScript the new operator is used to create a blank object with no property. A constructors is used to create and initialize properties in JavaScript. Noted : In Java new operator is used to create the objects and its property and a constructor is used to initialize the property of the created objects. An object can be

The post How to create your own Objects in JavaScript using User Defined Objects appeared first on Coding Security.


How to create your own Objects in JavaScript using User Defined Objects
read more

Selasa, 21 Maret 2017

An Introduction to Docker and it’s Containers

Docker is a tool designed to make it easier to create, deploy, and run application by using containers. Containers allow a developer to package up an applications with all of the parts it needs, such as libraries and other dependencies and ship it all out as one package. By doing so, thank the container, the developer can rest assured that the applications will run on any other Linux machine regardless of any customized setting that machine might have that could differ from the machine used for writing and testing the codes. In a way, Docker is a bit like a virtual machines. But

The post An Introduction to Docker and it’s Containers appeared first on Coding Security.


An Introduction to Docker and it’s Containers
read more

5 Most Commonly asked interview question on web development

1.What are Different HTTP requests in RESTful Webservices? The purpose of each of the HTTP request types when used with a RESTful web service is as follows: GET: Retrieves data from the servers (should only retrieve data and should have no other effect). POST: Sends data to the server for a new entities. It is often used when uploading a file or submitting a completed web forms. PUT: Similar to POST, but used to replace an existing entities. PATCH: Similar to PUT, but used to update only certain fields within an existing entities. DELETE: Removes data from the servers. TRACE:

The post 5 Most Commonly asked interview question on web development appeared first on Coding Security.


5 Most Commonly asked interview question on web development
read more

What is the Difference between Sass and Less preprocessors

Sass Is in Ruby, LESS Is in JavaScript Sass is based in Ruby and therefore requires a Ruby installs. This is no big deal if you have a Mac. However, it is a couple extra second of installation if you have a Windows machines. LESS was constructed in Ruby like Sass but has been ported to JavaScript. In order to use the LESS, you just upload the applicable JavaScript files to your server or compile the CSS sheets through an offline compilers. To assign variables: Sass uses $, LESS uses @ Both Sass and LESS use specialized character to assign

The post What is the Difference between Sass and Less preprocessors appeared first on Coding Security.


What is the Difference between Sass and Less preprocessors
read more

Senin, 20 Maret 2017

5 Most Common Interview Questions asked on Python

1.Question Fill in the missing code: <code class="language-python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">print_directory_contents_data</span><span class="hljs-params">(sPath)</span>:</span> <span class="hljs-string">""" This function takes the names of a directory and print out the path files within that directory as well as any file contained in contained directory. This functions is similar to os.walk. Please don't use os.walk in your answesr. We are interested in your ability to work with nested structure. """</span> fill_this_in </code> Answer <code class="language-python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">print_directory_contents</span><span class="hljs-params">(sPath)</span>:</span> <span class="hljs-keyword">import</span> os <span class="hljs-keyword">for</span> sChild <span class="hljs-keyword">in</span> os.listdir(sPath): sChildPath = os.path.join(sPath,sChild) <span class="hljs-keyword">if</span> os.path.isdir(sChildPath): print_directory_contents(sChildPath) <span class="hljs-keyword">else</span>: print(sChildPath) </code> Why Does This Matter:

The post 5 Most Common Interview Questions asked on Python appeared first on Coding Security.


5 Most Common Interview Questions asked on Python
read more

Minggu, 19 Maret 2017

Reasons why developing android apps in C++ is better

Although Apple and Google champion specific programming language for mobile development (Objective-C/Swift for Apple’s iOS, and Java for Google Android), independent developer spend a lot of time figuring out how to build iOS and Android app using other programming language. Some alternative languages include C# (Xamarin) and Pascal (Embarcadero-Rad Studio). There’s also the C++ route; for example, DragonFire SDK for iOS and Google Android. Last year, Android Studio added support for the Native Development Kit (NDK) so that developers could use C/C++ in their Java App. So what are the benefits of switching to C++ for Android development? Here are

The post Reasons why developing android apps in C++ is better appeared first on Coding Security.


Reasons why developing android apps in C++ is better
read more

Sabtu, 18 Maret 2017

10 Most Commonly asked Questions about the Compilers

1.Is C Compiler Written in Assembly The first C compiler wasn’t written in C, usually when writing a compilers we use either assembly language, or another programming languages, and it’s common that after first compilation, the compiler is rewritten in it’s native language 2.What is the BootStrappnig of the Compiler Bootstrapping (compilers) … In computer science, bootstrapping is the process of writing a compilers (or assembler) in the source programming language that it intends to compile. Applying this technique leads to a self-hosting compilers. 3.What kind of Programming Language is C C (programming language) is a general-purposes, imperative computer programming

The post 10 Most Commonly asked Questions about the Compilers appeared first on Coding Security.


10 Most Commonly asked Questions about the Compilers
read more

What is the difference between React and React Native

At Facebook, they invented React so JavaScript can manipulation website DOM faster using the virtual DOM models. Here is the React project ( http://ift.tt/18AOsqh ). DOM full refresh is slower comparing to React virtual-dom models that refreshes only the part of the page (read: partial refresh). Facebook they invented React not because they understood immediately the partial refreshs will be faster than the conventional ones. Originally they needed a way to reduce Facebook application re-build time and luckily this brought the partials DOM refreshs to life. The React native ( http://ift.tt/1yLmjao ) is just a consequence of React. It is

The post What is the difference between React and React Native appeared first on Coding Security.


What is the difference between React and React Native
read more

Top 5 Interview Questions asked if you are applying for an iOS Developer

On a UITableViewCell constructors: <code class="language-swift">- (id)initWithStyle:(<span class="hljs-type">UITableViewCellStyle</span>)style reuseIdentifier:(<span class="hljs-type">NSString</span> *)reuseIdentifier </code> What is the used reuseIdentifier for? The isreuseIdentifier used to indicates that a cell can be re-used in a.UITableView For example when the cell look the same but has different contents. The willUITableView the and maintain  an internal caches of UITableViewCell’the and reuseIdentifiers when allow them to be when is dequeueReusableCellWithIdentifier: called. By re-using table cells the scroll performances of the table view is better because new views do not needs to be created. Question 2 Explain the difference between atomic and nonatomic synthesized property? Atomic and non-atomic refer to whether

The post Top 5 Interview Questions asked if you are applying for an iOS Developer appeared first on Coding Security.


Top 5 Interview Questions asked if you are applying for an iOS Developer
read more

Jumat, 17 Maret 2017

Most Common Programming Questions in the Interviews about data structures

Linked Lists You must be able to produce simple clean linked list implementation quickly. Implement Insert and Delete for singly-linked linked lists sorted linked lists circular linked lists int Insert(node** head, int data) int Delete(node** head, int deleteMe) Split a linked lists given a pivot value void Split(node* head, int pivot, node** lt, node** gt) Find if a linked lists has a cycle in it. Now do it without marking nodes. Find the middle of a linked lists. Now do it while only going through the list once. (same solution as finding cycles) Strings Reverse words in a string (words

The post Most Common Programming Questions in the Interviews about data structures appeared first on Coding Security.


Most Common Programming Questions in the Interviews about data structures
read more

Rabu, 15 Maret 2017

5 Most Common Interview Questions on Algorithms

Tshe following are the common subject in coding interviews. As understanding those concept requires much more effort, this tutorial only serves as an introductions. The subjects that are covered include: 1) String/Array/Matrix, 2) Linked List, 3) Tree, 4) Heap, 5) Graph Problem. I highly recommend you to read “Simple Java” first, if you need a brief review of Java basic. If you want to see code examples that show how to uses a popular API. 1. String/Array An algorithm problem’s input is often a string or arrays. Without auto-completion of any IDE, the following method should be remembered. toCharArray() //get

The post 5 Most Common Interview Questions on Algorithms appeared first on Coding Security.


5 Most Common Interview Questions on Algorithms
read more

Selasa, 14 Maret 2017

Top 10 Most Commonly asked Programming Questions in Java

1)What is the difference between String, StringBuilder, and StringBuffer in Java? The main difference is that String is immutable but both StringBuilder and StringBuffer are mutable. Also, StringBuilder is not synchronized like StringBuffer and that’s why a good faster and should be used for temporary String manipulation. 2)Why is String final in Java? The string is final because of same reason it is immutable. A couple of reasons which I think make sense is the implementation of String pool, Security, and Performance. Java designers know that String will be used heavily in every Java program, so they optimized it from

The post Top 10 Most Commonly asked Programming Questions in Java appeared first on Coding Security.


Top 10 Most Commonly asked Programming Questions in Java
read more

Senin, 13 Maret 2017

An introduction to Object Slicing in C++ programming

In inheritance we can assign a derived class object to a base class object. But, a base class object cannot be assigned to a derived class object. When a derived class object is assigned to a base class object, extra features provided by the derived class will not be available. Such phenomenon is called object slicing.   Following program demonstrates object slicing: 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

The post An introduction to Object Slicing in C++ programming appeared first on Coding Security.


An introduction to Object Slicing in C++ programming
read more

How to implement nested interfaces in java programming

An interface which is declared inside a class or another interface is called a nested interface or a member interface. A nested interface can be declared as public, private or protected. Let’s look at an example of how to create and use a nested interface: 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 class A { int x; public interface IA { void method(); } } class B implements A.IA { public void method() { System.out.println(“Method implemented successfully”); } } public class Driver { public static void main(String args)

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


How to implement nested interfaces in java programming
read more

How to define CLASSPATH in java Programming

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 package statement. By default Java compiler and JVM searches the current working directory

The post How to define CLASSPATH in java Programming appeared first on Coding Security.


How to define CLASSPATH in java Programming
read more

Minggu, 12 Maret 2017

What are methods in Java Applet Class

Methods in Applet Class In this article we will learn about the pre-defined Applet class which is available in java.lang package and the methods available in it.   The Applet class provides the support for creation and execution of applets. It allows us to start and stop the execution of an applet. Applet class extends the Panel class which extends Container class and which in turn extends the Component class. So applet supports all window-based activities. Below are some of the methods available in the class Applet: init() – This method is called when the execution of the applet begins. It is the entry point for

The post What are methods in Java Applet Class appeared first on Coding Security.


What are methods in Java Applet Class
read more

An Introduction to Java Literals in Programming

In this article you will learn about Java literals, which are frequently used in Java programs. You will learn about different types of Java literals and some examples for writing and using different literals in Java programs. Every Java primitive data type has its corresponding literals. A literal is a constant value which is used for initializing a variable or directly used in an expression. Below are some general examples of Java literals: Integer Literals: Integer literals are the most commonly used literals in a Java program. Any whole number value is an example of an integer literal. For example, 1, 10, 8343

The post An Introduction to Java Literals in Programming appeared first on Coding Security.


An Introduction to Java Literals in Programming
read more

What is written in Head Tags of HTML

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 is written in Head Tags of HTML appeared first on Coding Security.


What is written in Head Tags of HTML
read more

Sabtu, 11 Maret 2017

What are anonymous objects and classes in C++ Programming

An object which has no name is known as an anonymous object. Syntax for creating an anonymous object is as follows:   ClassName(params-list);   An anonymous object can be created and used in any statement without using any name. It is automatically destroyed after the control moves on to the next statement. Following program demonstrates an anonymous object: 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 #include <iostream> using namespace std; class Student { private: string name; string regdno; int age; string branch;

The post What are anonymous objects and classes in C++ Programming appeared first on Coding Security.


What are anonymous objects and classes in C++ Programming
read more

What are Constant Objects in Programming

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 What are Constant Objects in Programming appeared first on Coding Security.


What are Constant Objects in Programming
read more

What is Dynamic Method Dispatch in Java Programming

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 What is Dynamic Method Dispatch in Java Programming appeared first on Coding Security.


What is Dynamic Method Dispatch in Java Programming
read more

Jumat, 10 Maret 2017

How to create Function Parameters with Default values in C++

The parameters in a function declaration can be assigned a default value as shown below: double area(double radius, double Pi = 3.14);   We can declare multiple parameters with default values. But, all suck kind of parameters must be at the last of the parameters list. We can assign our custom value for the parameter as shown below: area(2.5, 3.1415);   For the above function call, Pi value will be taken as 3.1415 instead of the default value 3.14.   Following program demonstrates parameters with default values: 1 2 3 4 5 6 7 8 9 10 11 12 13

The post How to create Function Parameters with Default values in C++ appeared first on Coding Security.


How to create Function Parameters with Default values in C++
read more

How Friend Class Works in C++ Programming

A friend class is a class which can access the private and protected members of another class. If a class B has to be declared as a friend of class A, it is done as follows: 1 2 3 4 5 6 class A { friend class B; ... ... };   Following are properties of a friend class: A class can be friend of any number of classes. When a class A becomes the friend of class B, class A can access all the members of class B. But class B can access only the public members of class

The post How Friend Class Works in C++ Programming appeared first on Coding Security.


How Friend Class Works in C++ Programming
read more

What are thread states in Java Programming

In this article we will learn about different thread states along with an example program that demonstrates thread life cycle.   Life cycle of a thread refers to all the actions or activities done by a thread from its creation to termination. A thread can be in any one of the following five states during its life cycle: New: A thread is created but didn’t begin its execution. Runnable: A thread that either is executing at present or that will execute when it gets the access to CPU. Terminated: A thread that has completed its execution. Waiting: A thread that

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


What are thread states in Java Programming
read more

Kamis, 09 Maret 2017

What are different parameter passing techniques in Programming

Parameter passing techniques  If you have any previous programming experience you might know that most of the popular programming languages support two parameter passing techniques namely: pass-by-value and pass-by-reference. In pass-by-value technique, the actual parameters in the method call are copied to the dummy parameters in the method definition. So, whatever changes are performed on the dummy parameters, they are not reflected on the actual parameters as the changes you make are done to the copies and to the originals. In pass-by-reference technique, reference (address) of the actual parameters are passed to the dummy parameters in the method definition. So,

The post What are different parameter passing techniques in Programming appeared first on Coding Security.


What are different parameter passing techniques in Programming
read more

How to Program array of Structures in Programming

We use structures to describe the format of a number of related variables. For example, we want to store details of 100 textbooks it will become difficult to declare and maintain 100 variables and store the data. Instead, we can declare and array of structure variables as shown below: 1 2 3 4 5 6 7 struct textbook { char name; char author; int pages; } struct textbook book; In the above example, we are declaring an array book with 10 elements of the type textbook which is a structure.   Structures within Structure In C, structures can be nested.

The post How to Program array of Structures in Programming appeared first on Coding Security.


How to Program array of Structures in Programming
read more

How to convert primitive type to a class type in Programming

In expressions when there are constants or variables of different types (built-in), one or more types are converted to a destination type. Similarly, user-defined types like classes when used in expressions can also be converted to built-in types or vice versa. Following are the different possibilities of type conversion: Conversion from basic type to class type Conversion from class type to basic type Conversion from one class type to another class type   Conversion from basic type to class type   A value or variable of a basic type or built-in type can be converted to a class member type

The post How to convert primitive type to a class type in Programming appeared first on Coding Security.


How to convert primitive type to a class type in Programming
read more

Rabu, 08 Maret 2017

How to refer super class members in Java

Second use of super keyword (in sub class) is to access the hidden members of its immediate super class. To understand this let’s consider the following example: 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 class A { int x; public void display() { System.out.println(“This is display in A”); } } class B extends A { int x; public void display() { System.out.println(“Value of x in A is: “ + super.x); super.display(); System.out.println(“This is display in B”); } } class Driver {

The post How to refer super class members in Java appeared first on Coding Security.


How to refer super class members in Java
read more

How Dynamic allocation of memory is done in array of objects

In the previous topic memory for array of objects was static as the memory was allocated at compile time. To allocate memory dynamically or at run time, we use an array of pointers which can be created as follows: ClassName *array-name;   Memory allocated for an array of pointers is far less than memory allocated for an array of objects. We can create an object at run time using the new operator as follows: array-name = new ClassName;   After dynamically allocating memory for an object we access the members using the -> operator as follows: array-name->member;   Below example

The post How Dynamic allocation of memory is done in array of objects appeared first on Coding Security.


How Dynamic allocation of memory is done in array of objects
read more

How to create a class inside a function in C++

A class which is declared inside a function is called a local class. A local class is accessible only within the function it is declared. Following guidelines should be followed while using local classes: Local classes can access global variables only along with scope resolution operator. Local classes can access static variables declared inside a function. Local classes cannot access auto variables declared inside a function. Local classes cannot have static variables. Member functions must be defined inside the class. Private members of the class cannot be accessed by the enclosing function if it is not declared as a friend

The post How to create a class inside a function in C++ appeared first on Coding Security.


How to create a class inside a function in C++
read more

Selasa, 07 Maret 2017

How to create your own Exception in Programming

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 to create your own Exception in Programming appeared first on Coding Security.


How to create your own Exception in Programming
read more

How to create a virtual functions in C++ Programming

We know that when a base class pointer refers to a derived class object, the extra features in derived class are not available. To access the extra features in the derived class, we make the functions in the base class as virtual. High End Applications need virtual Functions,Syntax for creating a virtual function is as follows: 1 2 3 4 5 virtual return–type function–name(params–list) { //Body of function ... }   A class which contains one or more virtual functions is known as a polymorphic class. Following program demonstrates accessing derived class features using virtual functions: 1 2 3 4

The post How to create a virtual functions in C++ Programming appeared first on Coding Security.


How to create a virtual functions in C++ Programming
read more

What is the function overloading in Programming

Two or more functions with the same name but different set of parameters or different number of parameters are said to be overloaded and this concept is known as function overloading.   It is common to create functions which does the same thing but on different parameters. For example, we might have to create functions to add integers as well as floating-point numbers. In C, to do this, we have to create two functions with different names. But in C++ we can use the same function name to create multiple functions.   Consider the following program which demonstrates the use

The post What is the function overloading in Programming appeared first on Coding Security.


What is the function overloading in Programming
read more

Senin, 06 Maret 2017

How to handle Sequential and Random I/O in C++

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 handle Sequential and Random I/O in C++ appeared first on Coding Security.


How to handle Sequential and Random I/O in C++
read more

How to use Ajax to display your JSON Data

JSON (JavaScript Object Notation) is like XML, because they are hierarchical, human readable and can be parsed using programming languages. But JSON is quicker, lightweight and more appealing than XML. Here we are going to use PHP generated JSON data and display its value in different element using jQuery Ajax method. Method 1 (Using getJSON) This method loads JSON encoded data from server using GET HTTP request. Using JSON data structure this example simply sets the content of specified elements with JSON value. $.getJSON(“process.php”, function(response) { $(‘#result’).html(response.first); $(‘#result2’).html(response.second); $(‘#result3’).html(response.third); }); Method 2 (Using jQuery Ajax) This is

The post How to use Ajax to display your JSON Data appeared first on Coding Security.


How to use Ajax to display your JSON Data
read more

How to send a Mail in PHP with Attachment

You probably know how to send email with PHP, it’s gets bit tricky when you want to send an attachment with PHP emails. So, today let’s find-out how we can send email with an attachment using PHP mail. Create a HTML form with file inputs field similar to below, enctype attribute should be a “multipart/form-data“, so that form-data is encoded as “multipart/form-data” when sent to servers. HTML 1 2 3 4 5 6 7 8 <form enctype=“multipart/form-data” method=“POST” action=“”> <label>Your Name <input type=“text” name=“sender_name” /> </label> <label>Your Email <input type=“email” name=“sender_email” /> </label> <label>Subject <input type=“text” name=“subject” /> </label> <label>Message

The post How to send a Mail in PHP with Attachment appeared first on Coding Security.


How to send a Mail in PHP with Attachment
read more

Minggu, 05 Maret 2017

An Introduction to Classes and Objects in C++

Object oriented programming paradigm makes it easy to solve real-world problems. Classes and objects are the fundamental concepts of object oriented paradigm. They make development of large and complex systems easier and help to produce software which is easy to understand, modular, modify, and reusable.   Syntactically structures and classes are similar. But a major difference between them is, by default all the members of a structure are public. Whereas, by default all the members of a class are private.   A rule of thumb is, use structures to store less amount of data and classes to store data as

The post An Introduction to Classes and Objects in C++ appeared first on Coding Security.


An Introduction to Classes and Objects in C++
read more

What are Initialization Parameters in Programming 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 What are Initialization Parameters in Programming Servlets appeared first on Coding Security.


What are Initialization Parameters in Programming Servlets
read more

What is the use of the abstract keyword in Programming

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 the abstract keyword in Programming appeared first on Coding Security.


What is the use of the abstract keyword in Programming
read more

Sabtu, 04 Maret 2017

How to get the definition of the Type Structure 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 How to get the definition of the Type Structure in C programming appeared first on Coding Security.


How to get the definition of the Type Structure in C programming
read more

What is HTTPServlet Response interface

The HttpServletResponse is a subtype of ServletResponse interface. Implementation for this interface is provided by the servlet container. The HttpServletResponse interface object let’s us to specify information that will be a part of the HTTP response headers or the HTTP response. Following methods helps us to manipulate the HTTP response headers: addHeader(String name, String value) containsHeader(String name) setHeader(String name, String value) setDateHeader(String name, long date) addIntHeader(String name, int value) addDateHeader(String name, long date)   Following table shows some of the header fields and the description of their value: Other methods provided by this interface are: sendError(int) sendError(int, String) sendRedirect(String URL)

The post What is HTTPServlet Response interface appeared first on Coding Security.


What is HTTPServlet Response interface
read more

How do you define a interface java programming

Defining an Interface The definition of an interface is very much similar to the definition of a class. The syntax for defining an interface is as follows: interface  interface-name { return-type  method1(parameters-list); return-type  method2(parameters-list); … data-type  variable-name1 = value; data-type  variable-name2 = value; … } Access specifier before interface keyword can be public or default (no specifier). All the methods inside an interface definition does not contain any body. They end with a semi-colon after the parameters list. All variables declared inside an interface are by default final and static. All methods declared inside an interface are by default abstract and both variables as well as

The post How do you define a interface java programming appeared first on Coding Security.


How do you define a interface java programming
read more

Jumat, 03 Maret 2017

How to do Exception Handling in inheritance

The last category of errors are the errors which occur while executing the program. These errors are known as run-time errors or exceptions. Exceptions are of two types: 1) Synchronous, and 2) Asynchronous.   Synchronous exceptions are the run-time exceptions which occur due to the code written by the programmer and they can be handled by the programmer. Asynchronous exceptions are run-time exceptions which occur due to code outside the program. For example, if no memory is available in the RAM, it will lead to out of memory error which is an asynchronous exception. Such asynchronous exceptions cannot be handled.

The post How to do Exception Handling in inheritance appeared first on Coding Security.


How to do Exception Handling in inheritance
read more

What are the methods of the Thread Class

isAlive() and join() Methods Even though threads are independent most of the time, there might some instance at which we want a certain thread to wait until all other thread complete their execution. In such situation we can use isAlive() and join() method. Syntax of these methods is as follow: final boolean isAlive() final void join() throws InterruptedException final void join(long milliseconds) throws InterruptedExceptions 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

The post What are the methods of the Thread Class appeared first on Coding Security.


What are the methods of the Thread Class
read more

What are Preprocessor Operations in C programming

The preprocessor is a program that processes the sources code before it passes through the compiler. Preprocessor directive are placed in the source program before the main line. Before the source code pass through the compiler, it is examined by the preprocessor for any preprocessor directive. If there are any, appropriate actions are taken and then the source program is handed over to the compilers. All the preprocessor directive follow special syntax rules that are different from the normal C syntax. Every preprocessors directive begins with the symbol # and is followed by the respective preprocessor directives. The preprocessors directives

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


What are Preprocessor Operations in C programming
read more

Kamis, 02 Maret 2017

How to implement operator overloading C++

Operator overloading can be implemented in two ways. They are: Using a member function Using a friend function   Differences between using a member function and a friend function to implement operator overloading are as follows: Overloading Unary Operators Operators which work on a single operand are known as unary operators. Examples are: increment operator(++), decrement operator(–), unary minus operator(-), logical not operator(!) etc. Using a member function to overload an unary operator Following program demonstrates overloading unary minus operator using a member function: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

The post How to implement operator overloading C++ appeared first on Coding Security.


How to implement operator overloading C++
read more

A Brief Introduction to polymorphism in C++

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 A Brief Introduction to polymorphism in C++ appeared first on Coding Security.


A Brief Introduction to polymorphism in C++
read more

What are the various methods of DOM in javascript

The Various DOM methods in Javascript window object:  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

The post What are the various methods of DOM in javascript appeared first on Coding Security.


What are the various methods of DOM in javascript
read more

Rabu, 01 Maret 2017

How to throw Exceptions in Function Definition C++ Programming

A function can declare what type of exceptions it might throw. Syntax for declaring the exceptions that a function throws is as follows: 1 2 3 4 5 return–type function–name(params–list) throw(type1, type2, ...) { //Function body ... }   Following program demonstrates throwing exceptions in a function definition: 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 #include<iostream> using namespace std; void sum() throw(int) { int a, b; cout<<“Enter a and b values: “; cin>>a>>b; if(a==0 || b==0) throw 1;

The post How to throw Exceptions in Function Definition C++ Programming appeared first on Coding Security.


How to throw Exceptions in Function Definition C++ Programming
read more

How to perform File Pointer Manipulations in C++

Every file will contain two pointers: a read pointer or also known as a get pointer and a write pointer also known as a put pointer. The read pointer or a get pointer is used to read data and the write pointer or put pointer is used to write data to a file. These pointers can be manipulated using the functions from stream classes. Those functions are as follows: The seekg() and seekp() functions specified above can be used to move the pointers in the file for random access. The syntax of these functions is as follows: seekg(int offset, reference_position)

The post How to perform File Pointer Manipulations in C++ appeared first on Coding Security.


How to perform File Pointer Manipulations in C++
read more

An Introduction to Generic Programming using C++

Introduction   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

The post An Introduction to Generic Programming using C++ appeared first on Coding Security.


An Introduction to Generic Programming using C++
read more