Function Overloading and Return Type in C++

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

2K+ Views

You can have multiple definitions for the same function name in the same scope. The definition of the function must differ from each other by the types and/or the number of arguments in the argument list. You cannot overload function declarations that differ only by return type.The function overloading is basically the compile time polymorphism. It checks the function signature. If the signatures are not same, then they can be overloaded. The return type of a function does not create any effect on function overloading. Same function signature with different return type will not be overloaded.Following is the example where ... Read More

Scan WiFi Networks Programmatically in Android

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

2K+ Views

This example demonstrate about How to scan wifi networks programmatically.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.Manifest; import android.content.Context; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.net.wifi.WifiManager; import android.os.Build; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    private ListView wifiList; ... Read More

How to Trade Your Cryptocurrency

Prasanna Kotamraju
Updated on 30-Jul-2019 22:30:25

181 Views

When you talk about trading of Cryptocurrency, the following transactions will come under that category.Buying new cryptocurrency using your fiat currencySelling your cryptocurrency for fiat currencyExchanging one type of cryptocurrency for another digital currencyTo make these transactions, there are Cryptocurrency Exchanges.If you just want to make the occasional, straightforward trade, there are also platforms that you can use that do not require an account.Cryptocurrency ExchangeThese are the websites which allow you to buy, sell or exchange the digital currency. All you have to do is to choose an exchange, create an account and get your id verified, and you are ... Read More

Display All Records Except One in MySQL

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

575 Views

You can use IN() to display all records except one in MySQL. Let us first create a table −mysql> create table DemoTable (    Id int,    FirstName varchar(20) ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Larry'); Query OK, 1 row affected (0.31 sec) mysql> insert into DemoTable values(10, 'Chris'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values(110, 'Robert'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(90, 'David'); Query OK, 1 row affected (0.20 sec)Following is the query ... Read More

8085 Program to Perform Bubble Sort Based on Choice

Chandu yadav
Updated on 30-Jul-2019 22:30:25

772 Views

Now let us see a program of Intel 8085 Microprocessor. In this program we will see how to perform bubble sort in based on choice.Problem Statement:Write 8085 Assembly language program to perform bubble sorting operation on a set of data, and arrange them into ascending or descending order based on choice.Discussion:In this program we are arranging some numbers into ascending or descending order based on some choice. We are storing the choice at location A000H. If the choice value is 00H, then data will be sorted in ascending order, otherwise it will be sorted in descending order. The 8000H is ... Read More

Implementing Web Scraping Using lxml in Python

Nitya Raut
Updated on 30-Jul-2019 22:30:25

675 Views

Web scraping not only excite the data science enthusiasts but to the students or a learner, who wants to dig deeper into websites. Python provides many webscraping libraries including, ScrapyUrllibBeautifulSoupSeleniumPython RequestsLXMLWe’ll discuss the lxml library of python to scrape data from a webpage, which is built on top of the libxml2 XML parsing library written in C, which helps make it faster than Beautiful Soup but also harder to install on some computers, specifically Windows.Installing and importing lxmllxml can be installed from command line using pip, pip install lxmlorconda install -c anaconda lxmlOnce lxml installation is complete, import the html ... Read More

Copy Elision and Return Value Optimization in C++

George John
Updated on 30-Jul-2019 22:30:25

367 Views

The Copy Elision is also known as the Copy Omission. This is one of the compiler optimization technique. It avoids the unnecessary copying of objects. Almost any current compiler uses this Copy Elision technique.Let us see how it works by the help of one example code.Example Code#include using namespace std; class MyClass { public: MyClass(const char* str = "\0") { //default constructor cout

Sort ListView in Android

Nitya Raut
Updated on 30-Jul-2019 22:30:25

2K+ Views

This example demonstrate about How to sort Listview in Android using collections.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                     In the above code, we have taken name and record number as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to ... Read More

What is Statement in JDBC

Nancy Den
Updated on 30-Jul-2019 22:30:25

956 Views

The Statement interface represents the static SQL statement, it is used to create and execute general purpose SQL statements using Java programs.Creating a statementYou can create an object of this interface using the createStatement() method of the connection interface. Create a statement by invoking this method as shown below.Statement stmt = null; try {    stmt = conn.createStatement( );    . . . } catch (SQLException e) {    . . . } finally {    . . . }Executing the Statement objectOnce you have created the statement object you can execute it using one of the execute methods namely, ... Read More

Implement Click Event on Toolbar Icon

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrates How to implement click event on toolbar icon.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken text view to action bar icon status.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.annotation.SuppressLint; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; import android.view.View; ... Read More

Advertisements