Posts

API TERMINOLOGY : Part-1

API TERMINOLOGY Q1: What is a Resource? Resource is a physical or virtual component, which supports/extends/represents/constructs a system. Consider a real time example of a Vehicle . Wheels, brakes, headlight, fuel tank etc all are resources of a Vehicle  . All resources have names, location and identifiers. Take another example of Google. Now append “/gmail” in the last of the base url “https://www.google.com/” as "https://www.google.com/gmail".  Google will launch Gmail Page:    https://www.google.com Base URL:  https://www.google.com    Resource: /gmail/about/#  Q2: What are Collections? Collections are simply groups of resources. You’ll find that we don’t mention any collections in the API documentation. That is because we offer singleton resources, which are independent and exist outside of any collections Q3: What is Endpoints/BaseUrl? API endpoint is the point of entry in a communication channel when two systems are interacting....

Converting Pdf Text in to Audio Files

Image
 Converting Pdf Text in to Audio Files: Libraries:- PyPDF , is a library in python that is used to read text from a pdf file. PyPDF2 · PyPI Pyttsx3 , is a text-to-speech convert library. pyttsx3 · PyPI Here we are using PyPDF library to read text from the pdf file and then we are converting the text into speech and save it as an audio file. Program: import pyttsx3 , PyPDF2 pdfrReader=PyPDF2.PdfFileReader( open ( 'File_1.pdf' , 'rb' )) audio=pyttsx3.init() for page_num in range (pdfrReader.numPages): text=pdfrReader.getPage(page_num).extractText() cleanText=text.strip().replace( ' \n ' , ' ' ) print (cleanText) audio.say(cleanText) audio.save_to_file(cleanText , 'File_1.mp3' ) audio.runAndWait() audio.stop() THANKS!!

How will you check if a class is a child of another class?

Image
- This is done by using a method called issubclass() provided by python. The method tells us if any class is a child of another class by returning true or false accordingly. - We can check if an object is an instance of a class by making use of isinstance() method: Example: class Parent (): pass class b (Parent): pass print ( issubclass (b , Parent)) #true print ( issubclass (Parent , b)) #False obj1=b() obj2=Parent() print ( "=======" ) print ( isinstance (obj2 , b)) #False print ( isinstance (obj2 , Parent)) #True THANKS!!

Introduction of Python

Image
            Introduction of Python           What is Python?    Python is a popular programming language. It was created by Guido van Rossum,    and released in 1991. It is used for:    web development (server-side),software development, mathematics, system scripting. What can Python do?    Python can be used on a server to create web applications.    Python can connect to database systems. It can also read and modify files.    Python can be used to handle big data and perform complex mathematics.    Python can be used for rapid prototyping, or for production-ready software development. Why Python?    Python is a high-level, interpreted, interactive and object-oriented scripting language.    Python is designed to be highly readable.    It uses English keywords frequently where as ...

GIT BRANCH DETAILS

Image
  GIT BRANCH COMMANDS: =======================  git checkout branch_name  git branch  branch_name  git checkout branch_name   git checkout -b branch_name    git branch --list  git branch  git branch -r   git push origin -delete branch_name  git checkout -  git branch -m B1 TestB1  git branch -d branch_name OR git branch -D branch_name  git push origin --delete branch_name  

Python self Variable

Python self Variable Python self variable is used to bind the instance of the class to the instance method. We have to explicitly declare it as the first method argument to access the instance variables and methods. This variable is used only with the instance methods. In most of the Object-Oriented programming languages, you can access the current object in a method without the need for explicitly having it as a method parameter. For example, we can use “this” keyword to access the current object in Java program. But, in Python we have to explicitly declare the object instance as “self” variable Example1: class Emp : def __init__ ( self , name , empid ): self .name = name self .empid = empid print ( id ( self )) def e1 ( self ): print ( "Name of Emp: " , self .name) print ( "Emp id is : " , self .empid) e = Emp( 'VDS' , 100 ) print ( id (e)) e.e1() POINTS TO REMEMBER: Python self variable is not a reserved key...

JavaScriptExecutor : Part-1

JavaScriptExecutor Before we discuss on JavaScriptExecutor, We will discuss what is JavaScript actually? So, What is JavaScript ? Java Script is an object-oriented programming language commonly used to create interactive effects within the web browser to Handle WebElements within Web Page. It is used by Selenium WebDriver to do handle WebElements. Now lets us discuss, What is JavaScriptExecutor? The JavaScriptExecutor is an interface that provides mechanisms to execute javascript through the Selenium Driver. To run JavaScript in the context of the currently selected frame or window, it provides two methods i.e. "executescript" and "executeAsyncScript" The basic advantage of JavaScriptExecutor is that Selenium provides a way to run Java Script in webdriver. Sometimes the locator can not work, in that case the JavaScriptExecutor will help interact with web elements on a particular webpage. The reason behind this is, even Selenium webdriver convert the bindings ...

Python Docstrings

Python Docstrings Python documentation strings (or docstrings) provide a convenient way of associating documentation with Python modules, functions, classes, and methods. It’s specified in source code that is used, like a comment, to document a specific segment of code. Unlike conventional source code comments, the docstring should describe what the function does, not how. How docstring look like? The doc string line should begin with a capital letter and end with a period. The first line should be a short description. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. Doc String can be one liner or multiliner based on requirements with proper indentation . Declaring Docstrings: The docstrings are declared using ”’triple single quotes”’ or “””triple double quotes””” j...

range() vs xrange() in Python:

 range() vs xrange() in Python: The range() and xrange() are two functions that could be used to iterate a certain number of times in for loops in Python.  In Python 3, there is no xrange , but the range function behaves like xrange in Python 2. If you want to write code that will run on both Python 2 and Python 3, you should use range(). range() – This returns a range object (a type of iterable). xrange() – This function returns the generator object that can be used to display numbers only by looping. The only particular range is displayed on demand and hence called "lazy evaluation". The points of comparison are:  Return Type: range() returns –  range  object.  xrange() returns –  xrange()  object. Example: a=range(5) print(type(a)) # O/P:  <type 'list'> x=xrange(6) print(type(x)) #O/P:  <type 'xrange'> Operation Usage: range() returns the list, all the operations that  can  be applied on the list can be used on i...

*args and **kwargs in Python

  What do you mean by *args and **kwargs in Python function? *args: *args is a special syntax used in the function definition to pass variable-length arguments. “*” means variable length and “args” is the name used by convention. You can use any other. **kwargs: **kwargs is a special syntax used in the function definition to pass variable-length keyworded arguments. Here, also, “kwargs” is used just by convention. You can use any other name. Keyworded argument means a variable that has a name when passed to a function. It is actually a dictionary of the variable names and its value. ========================================================================= Important Points related to *args & **kwargs: *args and **kwargs are special keyword which allows function to take variable length argument. *args passes variable number of non-keyworded arguments list and on which operation of the list can be performed. **kwargs passes variable number of keyword arguments dictionary to functi...

Python namespaces & LEGB rule in Python

Image
What are Python namespaces? What is the LEGB rule in Python? A namespace in Python ensures that object names in a program are unique and can be used without any conflict. Python implements these namespaces as dictionaries with 'name as key' mapped to a corresponding 'object as value'. This allows for multiple namespaces to use the same name and map it to a separate object. A few examples of namespaces are as follows: Local Namespace  includes local names inside a function. the namespace is temporarily created for a function call and gets cleared when the function returns. Global Namespace  includes names from various imported packages/ modules that are being used in the current project. This namespace is created when the package is imported in the script and lasts until the execution of the script. Built-in Namespace  includes built-in functions of core Python and built-in names for various types of exceptions. The  lifecycle of a namespace  depends upon the sco...

Dynamically typed language

What is a dynamically typed language? Before we understand a dynamically typed language, we should learn about what typing is. Typing refers to type-checking in programming languages.  In a strongly-typed language, such as Python, "3" + 2 will result in a type error since these languages don't allow for implicit conversion of data types.  On the other hand, a weakly-typed language like Java, C++, will simply output "32" as result. Type-checking can be done at two stages  Static - Data Types are checked before execution.  Dynamic - Data Types are checked during execution.  Python is an interpreted language, executes each statement line by line and thus type-checking is done on the fly, during execution. Hence, Python is a Dynamically Typed Language. Thanks for reading!!

About Git log

  Git log-Details  ❖ Git log is a utility tool to review and read a history of everything that happens to a repository. Multiple options can be used with a git log to make history more specific.  ❖ Generally, the git log is a record of commits. A git log contains the following data:  ➢ commit hash number which is a 40 character checksum data generated by the SHA (Secure Hash Algorithm) algorithm. It is a unique number.  ➢ Commit Author metadata: The information of authors such as author name and email.  ➢ Commit Date metadata: It's a date timestamp for the time of the commit.  ➢ Commit title/message: It is the overview of the commit given in the commit message. Different Commands of Git log: ➔ git log  ◆ Whenever you need to check the history, you have to use the git log command. The basic git log command will display the most recent commits and the status of the head.  ➔ git log --oneline  ◆ the --oneline git log to display:  ...

Tableau Interview Question /Answer Part-4

Q1: What are the different ways to use parameters in Tableau? Ans: 1. Filters 2. calculated fields 3. Actions 4. Measure-swaps 5. changing views 6. auto updates Q2: Are there any limitations of parameters in Tableau? If yes, give details. Ans: Tableau dashboard allows the representation of parameters in four ways only. They don’t allow any multiple values like a filter can do. They only allow a single value. Q3: Explain when would you use Joins vs. Blending in Tableau? Ans: If data resides in a single source, it is always desirable to use Joins. When your data is not in one place blending is the most suitable way to create a left join like the connection between your primary and secondary data sources. Q4: What is the benefit of Tableau extract file over the live connection? Ans: Extract file can be used without any connections and you can build your own visualisation without connecting to the database. Q5: If I delete a workbook from tableau public and there ar...

Tableau Interview Question/Answer Part-3

Q1: Which one is better? Extract or Live connection?  Ans: ​Extract connection is better than live connection because extract connection can be used from anywhere, anytime without connecting to database. We can construct our own visualizations on it irrespective of database connection.  Q2: What is the difference between bar chart and column chart in Tableau?  Ans:​ Both are used to compare two or more values. However, their difference lies in their orientation. A Bar chart is oriented horizontally whereas the Column chart is oriented vertically. Both the Bar and the Column charts display data using rectangular bars where the length of the bar is proportional to the data value.  Q3: What is a Stacked Bar chart and Stacked Column Chart?  Ans:   Stacked Bar Chart​ composed of multiple bars stacked horizontally, one below the other. The length of the bar depends on the value in the data point. Stacked bar chart make the work easier, they will help us...

Tableau Interview Question/Answer Part-2

Q1: What are different Joins in Tableau ? Ans: Tableau works the same as SQL. So, it supports all joins possible in SQL ➢ Left Outer Join ➢ Right Outer Join ➢ Full Outer Join ➢ Inner Join Q2: Define LOD Expression? Ans: LOD Expression stands for Level of Detail Expression, and it is used to run the complex queries involving many dimensions at data sourcing level. Q3: What is a parameter Tableau? And how it works? Ans: Parameters are dynamic values, we can replace the constant values in calculations. Q4: How many maximum tables can you join in Tableau? Ans: You can join a maximum of 32 tables in Tableau. Q5: What is the difference between Traditional BI Tools and Tableau? Q6: What are the different filters in Tableau and how are they different from each other? Ans: In Tableau, filters are used to restrict the data from database. The different filters in Tableau are: ➢ Quick , ➢ Context ➢ Normal/Traditional filter are: Normal Filter is used to restrict...