Switch Case Statement in C

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

1K+ Views

A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.The syntax for a switch statement in C programming language is as follows −switch(expression) {    case constant-expression :       statement(s);       break; /* optional */    case constant-expression :       statement(s);       break; /* optional */       /* you can have any number of case statements */    default : /* Optional */       ... Read More

Use putLast in Android LinkedBlockingDeque

Samual Sam
Updated on 30-Jul-2019 22:30:25

131 Views

Before getting into example, we should know what LinkedBlockingDeque is. It is implemented by Collection interface and the AbstractQueue class. It provides optional boundaries based on linked nodes.It going to pass memory size to constructor and helps to provide memory wastage in android.This example demonstrate about How to use putLast () in android LinkedBlockingDequeStep 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 ... Read More

HTML Parser: Simple HTML and XHTML Parser in Python

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

2K+ Views

The HTMLParser class defined in this module provides functionality to parse HTML and XHMTL documents. This class contains handler methods that can identify tags, data, comments and other HTML elements.We have to define a new class that inherits HTMLParser class and submit HTML text using feed() method.from html.parser import HTMLParser class parser(HTMLParser): pass p = parser() p.feed('')We have to override its following methodshandle_starttag(tag, attrs):HTML tags normally are in pairs of starting tag and end tag. For example and . This method is called to handle the start of a tag.Name of the tag converted to lower case. The attrs ... Read More

What is Whale Island in Washington

Pratibha A
Updated on 30-Jul-2019 22:30:25

609 Views

The San Juan Islands, located to the north of Seattle is the Whale Island in Washington. The best season to watch whales is from April through September.A wide variety of Whales, Sea lions, and Seals lure tourists all over the world to watch some of the breathtaking Pacific Northwest marine wildlife.

Implementation of Moving Display Using 8085 Microprocessor

Ankith Reddy
Updated on 30-Jul-2019 22:30:25

766 Views

Intel 8279 is a specially designed Input Output port chip which performs two major functions. It scans a matrix keyboard, as well as it displays a multiplexed display such that the processor gets relieved from the extreme tasks and let it performs systematically. We had given a brief description about the working of 8279 as we have indicated in the following paragraphs.We continuously scan an 8279 matrix keyboard. During the scanning process, if a key gets pressed on the keyboard a scanning is performed again about 10 μs, resulting bouncing of the key to die down. If it is found ... Read More

Implement Bin Packing Algorithm in C++

Daniol Thomas
Updated on 30-Jul-2019 22:30:25

1K+ Views

The bin packing problem is a special type of cutting stock problem. In the bin packing problem, objects of different volumes must be packed into a finite number of containers or bins each of volume V in a way that minimizes the number of bins used. In computational complexity theory, it is a combinational NP-hard problem.When the number of bins is restricted to 1 and each item is characterized by both a volume and a value, the problem of maximizing the value of items that can fit in the bin is known as the knapsack problem.AlgorithmBegin    Binpacking(pointer, size, no ... Read More

Enable App Cache for WebView in Android

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

4K+ Views

This example demonstrate about How to enable app cache for webview in android.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 web view to show tutorialspoint.com.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ProgressDialog; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.widget.EditText; public class MainActivity extends AppCompatActivity {    @RequiresApi(api = Build.VERSION_CODES.P) ... Read More

Use Volley String Request in Android

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

3K+ Views

This example demonstrate about How to use simple volley request in android.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 show response.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.TextView; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; public class MainActivity extends AppCompatActivity ... Read More

LocalDate isLeapYear Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

113 Views

It can be checked if the LocalDate is in a leap year or not using the isLeapYear() method in the LocalDate class in Java. This method requires no parameters. It returns true if the LocalDate is in a leap year and false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Main {    public static void main(String[] args) {       LocalDate ld = LocalDate.parse("2012-10-12");       System.out.println("The LocalDate is: " + ld);       boolean flag = ld.isLeapYear();       if(flag)          System.out.println("This is a leap ... Read More

Print a String Without Any Quote in C Program

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

784 Views

This is another tricky problem. In this program, we will see how to print a string using C where no quotation marks are used.Here we are using macro function. We are defining a macro function like#define getString(x) #xThe getString() is a macro function. It returns x by converting it into a string. The # before x is denoting that the function will convert x into a string.Input: Take one string without quote Output: Print that string into consoleAlgorithmStep 1:Take a string without quote Step 2: Use macro function to print it into a string Step 3: EndExample Code Live Demo#include #define ... Read More

Advertisements