Nishtha Thakur

Nishtha Thakur

398 Articles Published

Articles by Nishtha Thakur

Page 19 of 40

How to get current thread is interrupted in android?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 342 Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate How to get current thread is interrupted 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 textview. It contains information about the current thread is interrupted.package com.example.myapplication; import android.annotation.SuppressLint; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; ...

Read More

How to run .SQL script using JDBC?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 17K+ Views

A database script file is a file that contains multiple SQL quries separated from each other. Usually, these files have the .sql extention.Running .sql script files in JavaYou can execute .sql script files in Java using the runScript() method of the ScriptRunner class of Apache iBatis. To this method you need to pass a connection object.Therefore to run a script file −Register the MySQL JDBC Driver using the registerDriver() method of the DriverManager class.Create a connection object to establish connection with the MySQL database using the getConnection() method.Initialize the ScriptRunner class of the package org.apache.ibatis.jdbc.Create a Reader object to read ...

Read More

How to get current thread count in android?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jun-2020 1K+ Views

Before getting into example, we should know what thread is. A thread is a lightweight sub-process, it going to do back ground operations without interrupt to ui. This example demonstrate about How to get current thread count 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 textview. It contains information about the current thread count.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; ...

Read More

How to exit iPhone application gracefully?

Nishtha Thakur
Nishtha Thakur
Updated on 27-Jun-2020 591 Views

There are times we would like to close our application due to some reason, for example if there is no internet connection and you’d like to kill the app, or any other reason according to the application. Though apple prefers not quitting the application, hence it is not supported in any of the applications.The only way to logically kill an iOS application is by pressing the home button. As soon as the home button is pressed, and the application exits the memory is freed up and cleaned.Still there are other ways to quit an application.exit − this command may be ...

Read More

How to disable the network in iOS Simulator?

Nishtha Thakur
Nishtha Thakur
Updated on 27-Jun-2020 9K+ Views

Sometimes while testing our app on simulator we need to test for case where no internet is available. This can be achieved in multiple ways.Below are some of the possible ways to do itEasiest but not the most correct way is to disconnect your mac from the LAN Cable is you are on a LAN, or turn off the wifi if you are connected on a wifi network. But that will definitely turn off internet for your whole device, not just simulator. So, there are some more ways to do itDownload Hardware IO tools for Xcode.Go to Xcode menu, select ...

Read More

How to hide Back Button on navigation bar on iPhone/iPad?

Nishtha Thakur
Nishtha Thakur
Updated on 27-Jun-2020 5K+ Views

To hide the back button on navigation bar we’ll have to either set the navigation button as nil and then hide it or hide it directly.Let’s create a project, add 2 view controller and Embed them in navigation controller. Let’s see how this project looks when run without any code to remove the navigation bar.This code set’s the navigation bar’s back button as hidden.self.navigationController?.navigationItem.hidesBackButton = trueThis code set’s the navigation bar’s back button as nilself.navigationItem.leftBarButtonItem = nil;A combination of these to approaches would be a better solution and works even if you have set a custom navigation bar.self.navigationItem.leftBarButtonItem = nil ...

Read More

What is bit stuffing in computer networks?

Nishtha Thakur
Nishtha Thakur
Updated on 27-Jun-2020 26K+ Views

DefinitionBit stuffing is the mechanism of inserting one or more non-information bits into a message to be transmitted, to break up the message sequence, for synchronization purpose.Purpose of Bit StuffingIn Data Link layer, the stream of bits from the physical layer is divided into data frames. The data frames can be of fixed length or variable length. In variable - length framing, the size of each frame to be transmitted may be different. So, a pattern of bits is used as a delimiter to mark the end of one frame and the beginning of the next frame. However, if the ...

Read More

Forward Error Correction (FEC)

Nishtha Thakur
Nishtha Thakur
Updated on 27-Jun-2020 19K+ Views

Forward error correction (FEC) is an error correction technique to detect and correct a limited number of errors in transmitted data without the need for retransmission.In this method, the sender sends a redundant error-correcting code along with the data frame. The receiver performs necessary checks based upon the additional redundant bits. If it finds that the data is free from errors, it executes error-correcting code that generates the actual frame. It then removes the redundant bits before passing the message to the upper layers.Advantages and DisadvantagesBecause FEC does not require handshaking between the source and the destination, it can be ...

Read More

How to explain Android Shared preferences with example?

Nishtha Thakur
Nishtha Thakur
Updated on 27-Jun-2020 580 Views

Using share preference, we can store or retrieve values as key and value pair. There are five different methods are available in share preference as shown below −Edit() − It going to edit shared preference valuescommit() − it going to commit shared preference values in xml fileapply() − It going to commit back changes from editor to shared preference.remove(String key) − It going to remove key and vales from shared preference use key.Put() − It going to put key and values to shared preference xml.A sample example syntax of shared preference as shown below −final SharedPreferences sharedPreferences = getSharedPreferences("USER", MODE_PRIVATE);In ...

Read More

Where can I find the current C or C++ standard documents?

Nishtha Thakur
Nishtha Thakur
Updated on 23-Jun-2020 175 Views

You can find the current C standard documents on ANSI web store. https://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2FISO%2FIEC+9899-2012You can find the current C++ standard documents on the ISO C++ website for buying −  https://www.iso.org/standard/68564.htmlThe working draft of the ISO C++ standard is also available on  https://isocpp.org/std/the-standard

Read More
Showing 181–190 of 398 articles
« Prev 1 17 18 19 20 21 40 Next »
Advertisements