Select Page

python introduction

Download any version of Python3.x(eg.=3.2,3.7)

python 2.x is syntactically different from 3.xbut we will use python 3.x because it is better performance the 2.x

smiliar the Anoconda is framework which is give us set of tools and those tools are used in many ways  such as project etc.

now in which first talking about of Anaconda navigator and anaconda powershell

In anaconda powershell is a tool by which we install python package.

 

 

 

 

Android Intent Code

package com.indeedinspiring.androidworkshop_practice;

import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import static android.Manifest.permission.CALL_PHONE;
import static android.Manifest.permission.CAMERA;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

Button openbrower, opencall, opencontact, openCamera;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
initListeners();

}

private void initListeners() {
openbrower.setOnClickListener(this);
opencall.setOnClickListener(this);
openCamera.setOnClickListener(this);
opencontact.setOnClickListener(this);
}

private void initView() {
openbrower = findViewById(R.id.openbrower);
opencall = findViewById(R.id.opencall);
openCamera = findViewById(R.id.opencamera);
opencontact = findViewById(R.id.opencontact);
}

@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onClick(View view) {

switch (view.getId()) {

case R.id.openbrower:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(“https://google.com”));
startActivity(intent);
break;

case R.id.opencall:
Intent i = new Intent(Intent.ACTION_CALL);
i.setData(Uri.parse(“tel:0612312312”));
if (ContextCompat.checkSelfPermission(getApplicationContext(), CALL_PHONE) == PackageManager.PERMISSION_GRANTED) {
startActivity(i);
} else {
requestPermissions(new String[]{CALL_PHONE}, 1);
}
break;

case R.id.opencontact:
Intent i1 = new Intent(Intent.ACTION_VIEW);
i1.setData(Uri.parse(“content://contacts/people/”));
startActivity(i1);
break;

case R.id.opencamera:
Intent intent1 = new Intent(“android.media.action.IMAGE_CAPTURE”);

if (ContextCompat.checkSelfPermission(getApplicationContext(), CAMERA) == PackageManager.PERMISSION_GRANTED) {
startActivity(intent1);
} else {
requestPermissions(new String[]{CAMERA}, 1);
}
startActivity(intent1);
break;

}
}
}

<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”http://schemas.android.com/apk/res/android”
package=”com.indeedinspiring.androidworkshop_practice”>

 

<uses-permission android:name=”android.permission.INTERNET”/>
<uses-permission android:name=”android.permission.CALL_PHONE”/>
<uses-permission android:name=”android.permission.CAMERA”/>

<application
android:allowBackup=”true”
android:icon=”@mipmap/ic_launcher”
android:label=”@string/app_name”
android:roundIcon=”@mipmap/ic_launcher_round”
android:supportsRtl=”true”
android:theme=”@style/AppTheme”>
<activity android:name=”.MainActivity”>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<action android:name=”android.intent.action.VIEW”/>
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
</activity>
</application>

</manifest>

<?xml version=”1.0″ encoding=”utf-8″?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:app=”http://schemas.android.com/apk/res-auto”
xmlns:tools=”http://schemas.android.com/tools”
android:id=”@+id/linearLayout”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
tools:context=”.MainActivity”>

 

<Button
android:id=”@+id/openbrower”
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_marginStart=”16dp”
android:layout_marginLeft=”16dp”
android:layout_marginEnd=”16dp”
android:layout_marginRight=”16dp”
android:text=”open Web”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintHorizontal_bias=”0.0″
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent”
app:layout_constraintVertical_bias=”0.077″ />

<Button
android:id=”@+id/opencall”
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_marginStart=”16dp”
android:layout_marginLeft=”16dp”
android:layout_marginEnd=”16dp”
android:layout_marginRight=”16dp”
android:text=”open Call”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintHorizontal_bias=”0.0″
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent”
app:layout_constraintVertical_bias=”0.172″ />

<Button
android:id=”@+id/opencontact”
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_marginStart=”16dp”
android:layout_marginLeft=”16dp”
android:layout_marginEnd=”16dp”
android:layout_marginRight=”16dp”
android:text=”Open Contact”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintHorizontal_bias=”0.0″
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent”
app:layout_constraintVertical_bias=”0.278″ />

<Button
android:id=”@+id/opencamera”
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_marginStart=”16dp”
android:layout_marginLeft=”16dp”
android:layout_marginEnd=”16dp”
android:layout_marginRight=”16dp”
android:text=”Open Camera”
app:layout_constraintBottom_toBottomOf=”parent”
app:layout_constraintEnd_toEndOf=”parent”
app:layout_constraintHorizontal_bias=”0.0″
app:layout_constraintStart_toStartOf=”parent”
app:layout_constraintTop_toTopOf=”parent”
app:layout_constraintVertical_bias=”0.393″ />

 

</androidx.constraintlayout.widget.ConstraintLayout>

Click here for code files: https://drive.google.com/open?id=1m9cBwe9iFSpI47WL9KAuOfhCLEVJEJQI

Java QUiz

Welcome to your Java Test

Name
E mail
1.What is Inheritance? Give example also.(2 marks)
2.Write sample code to show method overloading and method overriding. Explain the difference between the two.(4 marks)
3.What are the different types of access specifiers? Explain the difference between them.(4 marks)
4.Write the output of below program (2 marks):

class Test  



    public static void main (String args[])   { 


        System.out.println(10 + 20 + "Indeed");  


        System.out.println("Prushal" + 10 + 20); 


    } 


5.What is constructor? (2 marks)
6.Write the output of below program (2 marks):

class Test  



    int _a, _b; 


    Test(int a, int b)  


    { 


    _a = a;  


    _b = b;  


    } 


    public static void main (String args[])    { 


        Test test = new Test();  


        System.out.println(test._a+" "+test._b); 


    } 


7.What is the difference between static (class) method and instance method? Give example. (4 marks)
8.What are the differences between this and super keyword? (2 marks)
9.Write the output of below program (2 marks):

class Person  



    public Person()   { 


        System.out.println("Person class constructor called"); 


    } 



public class Employee extends Person  



    public Employee()   { 


        System.out.println("Employee class constructor called"); 


    } 


    public static void main (String args[])  { 


        Employee e = new Employee(); 


    } 


10.What is difference between list and vector? (4 marks)
11.Write a Java program to find the minimum value in a given array. (4 marks)

Selenium Test

Welcome to your selenium Test

Name
E mail
Que 1 - Which one of below is not the locators in Selenium?
Que 2 - Syntax to print get the text in Selenium -
Que 3 - Write the code for taking the screenshot in Selenium-
Que 4 - Explain the difference between single and double slash in X-path?
Que 5 - What is the difference between verify and assert commands?
Que 6 - What are the annotations used in TestNG?
Que 7 - What are the different types of waits in Selenium?
Que 8 - Explain about the ImplicitWait & ExplicitWait!
Que 9 - What is the difference between static & dynamic waits?
Que 10 - Perform a test to login on Amazon site and then print the MRP and SP(Price after discount of below product in console. Please validate the MRP of 799.

Quiz-Python miscellaneous

Welcome to your Python miscellaneous Quiz

Name
E mail
1.What is the output of the following program :
print "Hello World"[::-1]
2.Given a function that does not return any value, what value is shown when executed at the shell?
3.Which module in Python supports regular expressions?
4.What is the output of the following program :
print 0.1 + 0.2 == 0.3
5.Which of the following is not a complex number?
6.What does ~~~~~~5 evaluate to?
7.Given a string s = “Welcome”, which of the following code is incorrect?
8.________ is a simple but incomplete version of a function.
9.To start Python from the command prompt, use the command ______
10.Which of the following is correct about Python?