• Data Structure - Tutorials

    Queue – Data Structure

    A queue is a simple data structure that allows elements to be inserted from one end, called the rear (also called tail), and deleted from the other end, called the front (also called head).This behavior is called FIFO (First in First Out). TerminologyThe process of adding new elements into the queue is called enqueue.The process of removal of an element from the queue is called dequeue. ApplicationsQueues are used whenever we need to manage objects in order starting with the first one in.Scenarios include printing documents on a printer, call center systems answering people on hold people, and so on.…

  • Data Structure - Tutorials

    Stack – Data Structure

    A stack is a simple data structure that adds and removes elements in a particular order.Every time an element is added, it goes on the “top” of the stack. Only an element at the top of the stack can be removed, just like a stack of plates. This behavior is called LIFO (Last In, First Out). TerminologyAdding a new element onto the stack is called push.Removing an element from the stack is called pop. ApplicationsStacks can be used to create undo-redo functionalities, parsing expressions (infix to postfix/prefix conversion), and much more. A stack can be implemented using an array or…

  • Android With Java - Tutorials

    Android Beginners 2: Explore And Code The App

    Android Studio’s Project and editor windows I introduced Android Studio’s main window at the end of Part 1. This window is divided into several areas, including a Project window where you identify an app’s resource files, and various editor windows where you’ll write the code and specify resources for mobile apps in Android Studio. The Project window and an editor window are shown in Figure 1.   The Project window highlights W2A, which is the name of the app’s W2A.java source file (although the .java file extension isn’t shown). Corresponding to W2A is an editor window, reached by double-clicking W2A in the Project window. The editor window reveals the…

  • Android With Java - Tutorials

    Android Beginners Part 1: Installation and setup

    Installing Android Studio on 64-bit Windows 10 I launched android-studio-ide-181.5056338-windows.exe to start the installation process. The installer responded by presenting the Android Studio Setup dialog box shown in Figure 1. Clicking Next took me to the following panel, which provides the option to decline installing an Android Virtual Device (AVD). I chose to keep the default settings. After clicking Next, I was taken to the Configuration Settings panel, where I was asked to choose where to install Android Studio. I kept the default installation location and clicked Next, and was greeted with the Choose Start Menu Folder panel. I kept the default setting and clicked Install. The following Installing panel appeared: Clicking Show details causes the names…

  • Python - Tutorials

    Python Interview Question Section 1

    Q1. What is the difference between list and tuples in Python? LIST vs TUPLES LIST TUPLES Lists are mutable i.e they can be edited. Tuples are immutable (tuples are lists which can’t be edited). Lists are slower than tuples. Tuples are faster than list. Syntax: list_1 = [10, ‘Chelsea’, 20] Syntax: tup_1 = (10, ‘Chelsea’ , 20) Q2. What are the key features of Python? Python is an interpreted language. That means that, unlike languages like C and its variants, Python does not need to be compiled before it is run. Other interpreted languages include PHP and Ruby. Python is dynamically typed, this means that you don’t need…

  • Javascript - Tutorials

    JavaScript Output

    JavaScript Display Possibilities JavaScript can “display” data in different ways: Writing into an HTML element, using innerHTML. Writing into the HTML output using document.write(). Writing into an alert box, using window.alert(). Writing into the browser console, using console.log(). Using innerHTML To access an HTML element, JavaScript can use the document.getElementById(id) method. The id attribute defines the HTML element. The innerHTML property defines the HTML content: Example <!DOCTYPE html> <html> <body> <h1>My First Web Page</h1> <p>My First Paragraph</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = 5 + 6; </script> </body> </html> Using document.write() For testing purposes, it is convenient to use document.write(): Example <!DOCTYPE html> <html> <body> <h1>My First Web Page</h1> <p>My first paragraph.</p>…

  • Android With Kotlin - Tutorials

    How Cool is Kotlin?

    Before you dive deeper into Kotlin’s features, go back to DetailActivityKotlin.kt and replace the contents of the file with the following: package com.tejsumeru.android.omgandroid import android.content.Intent import android.os.Bundle import android.support.v4.view.MenuItemCompat import android.support.v7.app.AppCompatActivity import android.view.Menu import android.widget.ImageView import android.support.v7.widget.ShareActionProvider import com.squareup.picasso.Picasso class DetailActivityKotlin : AppCompatActivity() { private val imageUrlBase = "http://covers.openlibrary.org/b/id/" private var imageURL = "" private var shareActionProvider: ShareActionProvider? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_detail) actionBar?.setDisplayHomeAsUpEnabled(true) val imageView = findViewById<ImageView>(R.id.img_cover) val coverId = this.intent.extras.getString("coverID") val len = coverId?.length ?: 0 if (len > 0) { imageURL = imageUrlBase + coverId + "-L.jpg" Picasso.with(this).load(imageURL).placeholder(R.drawable.img_books_loading).into(imageView) } } private fun setShareIntent() { val…

  • Android With Kotlin - Tutorials

    Android Animations in Kotlin

    Animation is a method in which a collection of images are combined in a sepecific way and processed then they appear as moving images. Building animations make on-screen objects seems to be alive. Android has quite a few tools to help you create animations with relative ease. so in this article we will learn to create animations using Kotlin. below are some attributes which we are using while writing the code in xml. Table of Attributes : XML ATTRIBUTES DESCRIPTION android:duration It is used to specify the duration of animation to run android:fromAlpha It is the starting alpha value for…

  • Android With Java - Android With Kotlin - Tutorials

    Difference between Java and Kotlin in Android with Examples

    Kotlin KOTLIN is a cross platform, statically types, general purpose programming language with type inference. KOTLIN is designed to interoperate fully with java but type inference allows its syntax to be more concise.KOTLIN is sponsored by JetBrains and Google through the Kotlin Foundation. Java JAVA is an Object Oriented Programming Language developed by JAMES GOSLING and colleagues at SUN MICRO SYSTEMS in 1991.The language was initially called OAK. It was developed as a full fledged programming language in which one can accomplish the same sorts of tasks and solve the similar problems that one can do in other programming languages such as BASIC,C++ etc. Using Kotlin…