Wednesday 4 September 2019

Default and Named exports in ReactJs



There are two ways you can import your classes it based on how you will do the exports.

import React from 'react'  // Default Export
import {Component} from 'react' // Named Export

Here you can see the import is with bracket and another one is without bracket.

As I told in the first line export are two type:
1. Default Export
2. Named Export

Any of the components can have one default export and can have 0 or more than 1 named export.

Example of Named export as like.
export const Greet = () => <h1> Hello Satya</h1>

Than it will be import to the another component as like
import {Greet} from './myComponentes/Greets' // named export

import {Greet as SomeName} from './myComponentes/Greets';

If you will see the above Greet is in side of curly bracket.

Example of default export
Exporting a function values like below.
function Greet()
{
    return <h1> Hello Satya</h1>
}

//export const Greet = () => <h1> Hello Satya</h1>

export default Greet;

Now you can import it to the other component as like
import Greet from './myComponentes/Greets'


Monday 4 March 2019

selenium basics for beginners


 Selenium Introduction

 l  Selenium is an open source tool (no cost involved – free to download from Seleniumhq) “https://docs.seleniumhq.org/download/”
l  Selenium supports language like HTML, Java, PHP, purl, Python, Ruby and C# .
l  Selenium supports multiple web browsers like, IE, Firefox, Chrome, Opera
l  Selenium supports multiple Operating systems like Windows, Linux, Mac
l  Selenium Components


Saturday 9 February 2019

Call python code in C# using IronPython


Why it’s required?

Python has lots of  useful library that we can utilise in our application and get that functionality in our webapplication. So just trying how to get the python features in MVC applications.

Using the Ironpython  to call the python code in C# code.  Follow the steps and use the below code to call the python code.

1.       Taking the reference of IronPython  using the Nuget Package as like below.


Print value of textarea using javascript



We are facing the problem to print the full textarea text when using the default browser print. It will print the full content of the pages which will print only that text which is visible to the textarea.


Content which is not displaying or go out of page due to overflow. Please use below code to see that.

We are having the Textarea and div control and when we click on the print then it will hide the text area and put the Textarea text to div

Monday 14 January 2019

C# Interview Questions

It is C# basic interview question for beginners level.


1.       What is Class?
Ans: Collection of objects is called class. It is a logical entity.
A class can also be defined as a blueprint from which you can create an individual object. Class doesn't consume any space.

2.       Difference between Class and Objects?
Ans: Any entity that has state and behavior is known as an object. An Object can be defined as an instance of a class. An object contains an address and takes up some space in memory.

3.       What is Oops concept?
a.       What is inheritance?
Ans: When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism.

b.       What is Encapsulation?
Ans: Binding (or wrapping) code and data together into a single unit are known as encapsulation.

c.       What is Polymorphism?
Ans: If one task is performed by different ways, it is known as polymorphism.

d.       What is Abstract?
Ans: Hiding internal details and showing functionality is known as abstraction

Sunday 13 January 2019

Generate the Signed key for apache cordova


You can generate the sign key for your apache application by the given procedure.

1.       Open the command promt, it is windows command prompt.

2.       Get the  Keystore path
C:\Program Files\Java\jdk1.8.0_111\bin\keystore
Go to that above path in the command window.

3.       Give the Below command

keytool -genkey -v -keystore NAME-mobileapps.keystore -alias NAMEmobileapps -keyalg RSA -keysize 2048 -validity 10000


Tuesday 8 January 2019

compilesdkversion 'android-26' requires jdk 1.8 or later to compile visual studio


You are getting the build error in the Android Apache Cordova.

>compilesdkversion 'android-26' requires jdk 1.8 or later to compile visual studio

You  are getting this error as your application is not pointing to the valid version of the  java SDK (JDK) 

You need to set the JAVA SDK version from below screen in visual Studio.

Tools > Option > Tools for Apache Cordova  > Environment Variable Override

failed to find target with hash string 'android-26' in: C:\ProgramData\Microsoft\AndroidSDK\25



You are getting the below issue, which is build error from android cordova application

* What went wrong:
> failed to find target with hash string 'android-26' in: C:\ProgramData\Microsoft\AndroidSDK\25


It is happening as you have not installed the particular image which your application is pointing to. You are missing the image where your android SDK is present as 

C:\ProgramData\Microsoft\AndroidSDK\25
You are having the android SDK version mentioned in Build.Gradle as like below.
ext {
    apply from: 'cordova.gradle'
    cdvCompileSdkVersion = 26 //privateHelpers.getProjectTarget()
    cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
}

Read PDF Table texts in Python



It will read the text from PDF in python.  Read Tables of PDF and place the data to XLSX file and read the XLSX file to one by one.

Suppose you are having the PDF file like below.

It’s a PDF file for Home loan, using the pdftables_api it will use to convert the PDF File into the form of xlsx file.


Now it will convert the PDF file into XSLX.