Saturday, March 13, 2021

Git Clone Errors: unable to access & The requested URL returned error: 403

If you facing these issues while connecting to the Git or Codecommit, follow the below steps:



Error:
fatal: unable to access 'https://git-codecommit.ap-south-1.amazonaws.com/v1/repos/MyRepo/': The requested URL returned error: 403


Follow the below steps to resolve the above issue:

  1. Open Control Panel from the Start menu
  2. Select User Accounts
  3. Select “Manage your credentials” in the left-hand menu
  4. Delete any credentials related to Git or GitHub

Once I did this, it started working again.

Monday, July 6, 2020

HTTP Status 404 – Not Found Docker Tomcat Image

How to fix the HTTP Status 404 - Not Found Error for the Docker Tomcat image? 

While trying to pull Tomcat image from Docker Hub to install Tomcat server on Amazon EC2 Linux virtual machine by executing the below commands in the terminal:

docker pull tomcat 

docker run --name tomcat-server -p 8080:8080 tomcat:latest

 
And when you open the browser by visiting http://container-ip:8080, you might have noticed the HTTP Status 404 – Not Found. 

HTTP Status 404 – Not Found


Type Status Report

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.


Apache Tomcat/9.0.36

You might have started thinking that you have done some mistakes while installing the Docker image. If you are thinking in those lines, then you are wrong. This is no error and it was designed to behave like this due to security concerns raised by the Docker community.  You can find this information on security on the Tomcat image official documentation in DockerHub


The information which is provided on Tomcat image official documentation in DockerHub isn't helpful for the people who have the beginner level knowledge of Docker.  

Based on the community request, Webapps folder is moved to the webapps.dist folder, which means webapps folder is empty and there are no files to serve on the browser. That is when you saw the error message The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

To re-enable the webapps, we need to move the files from webapps.dist to webapps. Here are the steps to run to make sure that the tomcat server is up and running without any issues. Please run the below commands step by step: 

docker pull tomcat:latest
 
docker run -d --name mytomcat -p 8080:8080 tomcat:latest
 
docker exec -it mytomcat /bin/bash
 
mv webapps webapps2
 
mv webapps.dist/ webapps
 
exit

Hope this information helps!

Saturday, June 6, 2020

How to pull the hashtags from the RSS Feed URL

This article is about automating the manual process of copying the hashtags from a given RSS feed URL and pasting on social media such as Facebook. This article is divided into three parts:
In this article, we will learn how to pull the hashtags from FeedBurner, In order to get started with it, we need to install Feedparser python library. To install the Feedparser libraries, use below commands in the command prompt


pip install feedparser

Once you have installed feedparser, you can use the below code which extracts the title, link, hashtags using the following script. Copy the below code and save it with .py extension, execute in command prompt
import feedparser
import re
NewsFeed = feedparser.parse("http://feeds.feedburner.com/Especiallysports")
for item in NewsFeed.entries:
    print('Post Title :',item.title)
    print('Post Link :',item.feedburner_origlink)
    result = re.findall(r"#(\w+)", item.summary)
    aces = ["#" + suit for suit in result]
    hashtags = ' '.join(aces)
    print('Post hashtags :',hashtags)
   
The output should like this:

By default, the above script will throw 25 posts, to display only first 3 articles, you can use the below script
import feedparser
import re
count=0
NewsFeed = feedparser.parse("http://feeds.feedburner.com/Especiallysports")
for item in NewsFeed.entries:
    print('Post Title :',item.title)
    print('Post Link :',item.feedburner_origlink)
    result = re.findall(r"#(\w+)", item.summary)
    aces = ["#" + suit for suit in result]
    hashtags = ' '.join(aces)
    print('Post hashtags :',hashtags)
    print('')
    count=count+1
    if count>2:
        break
Output:

We have successfully able to pull the required data from the Feedburner to post it on the Facebook page. Let's move on and see how we can post on the Facebook page. In the next post, you will learn How to get the Access Token for Facebook Graph API?

How to get the Access Token for Facebook Graph API?

In this How to pull the hashtags from the FeedBurner post, we have extracted the hashtags that we are going to post on the Facebook page, and in this post, we need to generate an access token for Facebook Graph API. Please follow the instructions to get started with it:

How to get the Access Token for Facebook Graph API?

  1. Go to Facebook Graph API Explorer and Click on Login  
  2. Create a new app or continue with the already created app. 
  3. On the right side, you should see the newly created Facebook App, if you want to work with a different app, you can switch the apps by choosing from the dropdown list. In my case, I want to work with Especiallysports app.  
  4. Next to Facebook App, you can find an option that says, User or Page, this option lets us choose whether we want to work with User profile, page profile, particular App. Please note, the tokens are issues at different levels, user level, page level, app level.  In my case, I would like to work with pages, I'll choose the Get Page Access Token. When you select the above option, a dialog box appears asking for the consent. Just click on the continue and provide the necessary page access and required permissions for that. 
  5. Once step 4 is completed, you'll find the pages in the dropdown list where you can able to choose the page that you want to work with. In my case, I want to work with Especiallysports page, therefore, I have chosen that. 
  6. Just below User or Page option, you can find add permissions option, which lets you can add additional permissions.  
  7. Click on Generate Access Token and copy the token 
Now, its time to test if we have access to our Facebook data. On the left side, you see an option where you can see and perform operations such as GET, POST, DELETE. Let's get started with getting the data. 

When you click on the submit button, you should see the id and name of the page. 
Testing Facebook Graph API

To retrieve the page posts, you can change URL to me/posts

To retrieve a specific page post, you can change URL to /Postid, as shown in the below URL.


To publish a post on the Facebook page, you can use below, A Facebook page post will be created on the Facebook page. You can refer to the below screenshot:


Here is the screenshot of the Facebook page post.


To delete this post, you can use DELETE operations when the post is deleted, it returns success message as shown in the below screenshot.

In the next article, you can learn how to connect programmatically and perform various operations such as retrieving, publishing, and deleting the posts using Python script. 

How to publish the posts on Facebook page via Python Script

In this How to pull the hashtags from the FeedBurner post, we have extracted the hashtags that we are going to post on the Facebook page, and in this post, you have learned How to get the Access Token for Facebook Graph API? we have generated the access token to publish the post on the Facebook page. 



In this article, you will learn how to retrieve, publish, and delete the posts from the Facebook page.

In order to perform various actions on Facebook, there is a popular unofficial Python 3rd party library called Facebook-SDK which is a prerequisite for connecting to Facebook. To install the Facebook-SDK python library, use below commands in the command prompt as shown in 
pip install facebook-sdk
Since the Facebook-SDK library is already installed on my computer, therefore, I'm seeing the requirement already satisfied, In your case, you should see the installation complete and success message. 

Copy the below code and save it with .py extension and replace the access token with your token. 

How to connect to Facebook via Python script?

import feedparser
import re
import facebook
count=0
graph = facebook.GraphAPI(access_token="EAAqj5wU098QBAK0qbdFe8lDhf1eBBRKI2zxqiqzCkFEMVZCh5bECvPZCUNitH6jLHuodbGyHZBFp1ZBDCT2KRVTPDRg461xH3tek8E61M8XhPq4npuV8nVVNkrqIACW0aMrNNrjOBoIdP777Y4QjpWIVDIYZCZBVdCgp3m4FyimmeWq6DP2qVf3E7R7JV7bOaK06o4NmrT1bJw1F8GgVNARGOIDANt6WQEJUNNtmCyMQZDZD")
posts = graph.request('/me')
postslist = posts['name']
print(postslist)

NewsFeed = feedparser.parse("http://feeds.feedburner.com/Especiallysports")
for item in NewsFeed.entries:
    print('Post Title :',item.title)
    print('Post Link :',item.feedburner_origlink)
    result = re.findall(r"#(\w+)", item.summary)
    aces = ["#" + suit for suit in result]
    hashtags = ' '.join(aces)
    print('Post hashtags :',hashtags)
    print('')
    count=count+1
    if count>2:
        break
The output looks like this:

If you replace /me with your Facebook page ID, then it will display page name:
posts = graph.request('/Facebook-Page-ID')

How to retreive the Facebook page posts via Python script?

import feedparser import re import facebook count=0 #Faceook connection graph = facebook.GraphAPI(access_token="EAAqj5wU098QBAK0qbdFe8lDhf1eBBRKI2zxqiqzCkFEMVZCh5bECvPZCUNitH6jLHuodbGyHZBFp1ZBDCT2KRVTPDRg461xH3tek8E61M8XhPq4npuV8nVVNkrqIACW0aMrNNrjOBoIdP777Y4QjpWIVDIYZCZBVdCgp3m4FyimmeWq6DP2qVf3E7R7JV7bOaK06o4NmrT1bJw1F8GgVNARGOIDANt6WQEJUNNtmCyMQZDZD") posts = graph.request('/me') postslist = posts['name'] print(postslist) #retreiving hashtags from the feedburner and display recent 3 posts tile, link and hastags NewsFeed = feedparser.parse("http://feeds.feedburner.com/Especiallysports") for item in NewsFeed.entries: print('Post Title :',item.title) print('Post Link :',item.feedburner_origlink) result = re.findall(r"#(\w+)", item.summary) aces = ["#" + suit for suit in result] hashtags = ' '.join(aces) print('Post hashtags :',hashtags) print('') count=count+1 if count>2: break #getting all the posts from Facebook page feed = graph.get_connections("101913231469038", "feed") post = feed["data"] for item in post: print("item id is",item['id'], "item message", item['message'])
Output:

By default, the above script will throw 10 posts, to show only first 3 articles, you can use the below script

import feedparser
import re
import facebook
count=0
count1=0
#Faceook connection
graph = facebook.GraphAPI(access_token="EAAqj5wU098QBAK0qbdFe8lDhf1eBBRKI2zxqiqzCkFEMVZCh5bECvPZCUNitH6jLHuodbGyHZBFp1ZBDCT2KRVTPDRg461xH3tek8E61M8XhPq4npuV8nVVNkrqIACW0aMrNNrjOBoIdP777Y4QjpWIVDIYZCZBVdCgp3m4FyimmeWq6DP2qVf3E7R7JV7bOaK06o4NmrT1bJw1F8GgVNARGOIDANt6WQEJUNNtmCyMQZDZD")
posts = graph.request('/me')
postslist = posts['name']
print(postslist)

#retreiving hashtags from the feedburner and display recent 3 posts tile, link and hastags
NewsFeed = feedparser.parse("http://feeds.feedburner.com/Especiallysports")
for item in NewsFeed.entries:
    print('Post Title :',item.title)
    print('Post Link :',item.feedburner_origlink)
    result = re.findall(r"#(\w+)", item.summary)
    aces = ["#" + suit for suit in result]
    hashtags = ' '.join(aces)
    print('Post hashtags :',hashtags)
    print('')
    count=count+1
    if count>2:
        break
#getting all the posts from Facebook page     
feed = graph.get_connections("101913231469038", "feed")
post = feed["data"]
for item in post:
    print("item id is",item['id'], "item message", item['message'])
    count1=count1+1
    if count1>2:
        break
Output: will show only 3 posts

How to publish the posts on the Facebook page via Python Script?

import feedparser
import re
import facebook
count=0
count1=0
#Faceook connection
graph = facebook.GraphAPI(access_token="EAAqj5wU098QBAPXWzeZC9qFpA3meIwRcxYjHS3NMUddsMKL9F4ULjmI90eqblfuPz0ZB2ZCupob1hWBvy0ZAAoaP7ZAG2q7rDxxrXNVxZCMjrsVkZAKvvGGGZAyHRjKplh5OL5JBwkbpPHAim1TN9W1x8hIOgULjWtOiCO5dSZCS6ZAZA8vxSOLzGNQSqbnD1lLBOIDROUwZCwcZAngZDZD")
posts = graph.request('/101913231469038')
postslist = posts['name']
print(postslist)
#retreiving hashtags from the feedburner and display recent 3 posts tile, link and hastags
NewsFeed = feedparser.parse("http://feeds.feedburner.com/Especiallysports")
for item in NewsFeed.entries:
    print('Post Title :',item.title)
    print('Post Link :',item.feedburner_origlink)
    result = re.findall(r"#(\w+)", item.summary)
    aces = ["#" + suit for suit in result]
    hashtags = ' '.join(aces)
    print('Post hashtags :',hashtags)
    #publishing posts on Facebook page
    newpost=graph.put_object("101913231469038", "feed", message=hashtags,link=item.feedburner_origlink)
    print(newpost['id'])

    print('')
    count=count+1
    if count>2:
        break
#getting all the posts from Facebook page     
feed = graph.get_connections("101913231469038", "feed")
post = feed["data"]
for item in post:
    print("item id is",item['id'], "item message", item['message'])
    count1=count1+1
    if count1>2:
        break


Output:

Below are new posts are that are published on the Facebook page. 

How to delete the posts on the Facebook page via Python Script?

import feedparser
import re
import facebook
count=0
count1=0
#Faceook connection
graph = facebook.GraphAPI(access_token="EAAqj5wU098QBAPXWzeZC9qFpA3meIwRcxYjHS3NMUddsMKL9F4ULjmI90eqblfuPz0ZB2ZCupob1hWBvy0ZAAoaP7ZAG2q7rDxxrXNVxZCMjrsVkZAKvvGGGZAyHRjKplh5OL5JBwkbpPHAim1TN9W1x8hIOgULjWtOiCO5dSZCS6ZAZA8vxSOLzGNQSqbnD1lLBOIDROUwZCwcZAngZDZD")
posts = graph.request('/101913231469038')
postslist = posts['name']
print(postslist)
#retreiving hashtags from the feedburner and display recent 3 posts tile, link and hastags
NewsFeed = feedparser.parse("http://feeds.feedburner.com/Especiallysports")
for item in NewsFeed.entries:
    print('Post Title :',item.title)
    print('Post Link :',item.feedburner_origlink)
    result = re.findall(r"#(\w+)", item.summary)
    aces = ["#" + suit for suit in result]
    hashtags = ' '.join(aces)
    print('Post hashtags :',hashtags)
    #publishing posts on Facebook page
    newpost=graph.put_object("101913231469038", "feed", message=hashtags,link=item.feedburner_origlink)
    print(newpost['id'])
    print('')
    count=count+1
    if count>2:
        break
#getting all the posts from Facebook page     
feed = graph.get_connections("101913231469038", "feed")
post = feed["data"]
for item in post:
    print("item id is",item['id'], "item message", item['message'])
    count1=count1+1
    if count1>3:
        break
    #delete the required post with user input
    userinput= input("do you want to delete the post")
    if userinput=='yes':
        if graph.delete_object(item['id']):
            print("successfully deleted")

Hope this article is helpful 

Happy Learning :)

Monday, May 25, 2020

Working with Blogger API v3 using python for beginners via Oauth 2.0

Hi Guys,

I’m going to show you how to connect Google blogger API using python. I had a requirement of creating more than 100 plus blog pages by duplicating the existing blog page. Below is the below breakdown:
  1. Retrieving the blog page from blogger
  2. Extract and copy the content from the blog page
  3. Create a new blog page and insert the extracted content


The main reason for posting this article, I couldn't find the right tutorial that can help in understanding the code in one go and it took a lot of time to accomplish this task. I hope this tutorial will help you.

There are two ways, you can interact with your blog using python:
  • Oauth 2.0
  • API key
In this blog, I will show how we can interact with blogger API using python with Oauth 2.0. It is a recommended way to interact with your Google API resources. The first step will be creating project and credentials

In order to access your enabled APIs(i.e, Blogger API in our case), we need to create credentials, these credentials must be kept in secret and otherwise, someone may steal your keys, you will end up paying for Google once the quota is exceeded. Please follow the below steps to create credentials for your project. Steps are in the below, video you can use it for creating client_secret.json file.
  1. Open the Google API Console Credentials page.
  2. Click Select a project, then NEW PROJECT, and enter a name for the project, and optionally, edit the provided Project ID. Click Create.
  3. On the Credentials page, select Create credentials, then OAuth client ID.
  4. You may be prompted to set a product name on the Consent screen; if so, click Configure consent screen, supply the requested information, and click Save to return to the Credentials screen.
  5. Select Web Application for the Application Type. Follow the instructions to enter JavaScript origins, redirect URIs, or both.
  6. Click Create.
  7. On the page that appears, copy the client ID and client secret to your clipboard, as you will need them when you configure your client library. 


After creating the project, you need to enable the Blogger API v3 in the Google API console. Please follow the below steps:
  1. Navigate to APIs & Services
  2. Search for Blogger API
  3. Enable it


Your client-secrets should look like below:
{"web":{"client_id":"814572920180-5lua2cehvonjidhjck5sql4gf2roavu5.apps.googleusercontent.com","project_id":"wordpress-learning-203906","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"R0B_Ayy6A-PBhRIJ5nhUmFOe","redirect_uris":["http://localhost:8090/"]} 

Note, after downloading the client_secret.json file, make sure to change the name. The name should be renamed as client_secret.json and place it in the folder wherever your current project is. My project folder is "E:\blogger api\python-blogger"


Open the command prompt and run as an administrator, navigate to the project folder, mine is "E:\blogger api\python-blogger" and install below libraries:
  • pip install --upgrade google-api-python-client
  • pip install httplib2
  • pip install oauth2client


After installing libraries, copy the below the code and save it in your project folder and save the file with .py extension,

import httplib2
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run_flow
from googleapiclient import discovery
CLIENT_SECRET = 'client_secret.json'
SCOPE = 'https://www.googleapis.com/auth/blogger'
STORAGE = Storage('credentials.storage')
# Start the OAuth flow to retrieve credentials
def authorize_credentials():
# Fetch credentials from storage
    credentials = STORAGE.get()
# If the credentials doesn't exist in the storage location then run the flow
    if credentials is None or credentials.invalid:
        flow = flow_from_clientsecrets(CLIENT_SECRET, scope=SCOPE)
        http = httplib2.Http()
        credentials = run_flow(flow, STORAGE, http=http)
    return credentials
credentials = authorize_credentials()
print(credentials)

*Note: please take care of the indentation, if you have issues copying from here, you can check using here
https://github.com/ImRaj90/Python-blogger-api-oauth2/blob/master/python-blogger-testting.py

After saving it, run the python program, then you will see a browser will ask to login into your Google account and request to grant the permission. Once you have accepted it. You should see the message authentication successful, message on the command prompt

Once the authentication is successful, credentials.storage file will be created in the project folder, please refer to the below screenshot.


Credentials.storage file contains all information required for authentication, which prevents the program from authenticating again every time we are running the program. This is one time set up.

Then, create a function as below:
def get_pages_from_jobs(blogId):
    credentials = authorize_credentials()
    http = credentials.authorize(httplib2.Http())
    discoveryUrl = ('https://www.googleapis.com/blogger/')
    service = discovery.build('blogger', 'v3', http=http, discoveryServiceUrl=discoveryUrl) 
*Note: please take care of the indentation, if you have issues copying from here, you can check using here

At the end of the program, we need to call the above function(below highlighted in red). After the function, the code should look like this:

import httplib2
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run_flow
from googleapiclient import discovery
CLIENT_SECRET = 'client_secret.json'
SCOPE = 'https://www.googleapis.com/auth/blogger'
STORAGE = Storage('credentials.storage')
# Start the OAuth flow to retrieve credentials
def authorize_credentials():
# Fetch credentials from storage
    credentials = STORAGE.get()
# If the credentials doesn't exist in the storage location then run the flow
    if credentials is None or credentials.invalid:
        flow = flow_from_clientsecrets(CLIENT_SECRET, scope=SCOPE)
        http = httplib2.Http()
        credentials = run_flow(flow, STORAGE, http=http)
    return credentials
credentials = authorize_credentials()
print(credentials)
def get_pages_from_jobs(blogId):
    credentials = authorize_credentials()
    http = credentials.authorize(httplib2.Http())
    discoveryUrl = ('https://www.googleapis.com/blogger/')
    service = discovery.build('blogger', 'v3', http=http, discoveryServiceUrl=discoveryUrl)
    
get_pages_from_jobs(xxxxxxx)

*Note: please take care of the indentation, if you have issues copying from here, you can check using here

After that, you can copy the below code, you can copy the respective code for corresponding actions:

1. For users

Add the below code(highlighted in yellow) just below  service = discovery.build('blogger', 'v3', http=http, discoveryServiceUrl=discoveryUrl)
users = service.users()
# Retrieve this user's profile information
thisuser = users.get(userId='self').execute()
print('This user\'s display name is: %s' % thisuser['displayName'])
*Note: please take care of the indentation, if you have issues copying from here, you can check using here

2. For Listing for blogs

For listing the blogs, we need to add the below code(highlighted in yellow) along with the above 1st action, just below print('This user\'s display name is: %s' % thisuser['displayName'])
blogs = service.blogs()
# Retrieve the list of Blogs this user has write privileges on
thisusersblogs = blogs.listByUser(userId='self').execute()
for blog in thisusersblogs['items']:
print('The blog named \'%s\' is at: %s' % (blog['name'], blog['url']))
*Note: please take care of the indentation, if you have issues copying from here, you can check using here
https://github.com/ImRaj90/Python-blogger-api-oauth2/blob/master/python-blogger-testting.py

3. For posts associated with specific users

For listing the blogs, we need to add the below code(highlighted in yellow) along with the above 1st, 2nd action, Add the below code(highlighted in yellow) just below  print('The blog named \'%s\' is at: %s' % (blog['name'], blog['url']))
posts = service.posts()
# List the posts for each blog this user has
for blog in thisusersblogs['items']:
print('The posts for %s:' % blog['name'])
request = posts.list(blogId=blog['id'])
while request != None:
posts_doc = request.execute()
if 'items' in posts_doc and not (posts_doc['items'] is None):
for post in posts_doc['items']:
print(' %s (%s)' % (post['title'], post['url']))
request = posts.list_next(request, posts_doc)
*Note: please take care of the indentation, if you have issues copying from here, you can check using here

4. For getting a specific page using ID

This code independent of the above 1,2,3 actions, you can just the below code(highlighted in yellow) directly just below the  service = discovery.build('blogger', 'v3', http=http, discoveryServiceUrl=discoveryUrl)
page=service.pages()
onepage=page.get(blogId=’xxxxx’,pageId=’xxxxx’).execute()
print("this will show specific onepage", onepage)
*Note: please take care of the indentation, if you have issues copying from here, you can check using here

5.For creating multiple posts/pages(in drafts)

This code independent of the above 1,2,3 actions, you can just the below code(highlighted in yellow) directly just below the  service = discovery.build('blogger', 'v3', http=http, discoveryServiceUrl=discoveryUrl)
cities=['canada','singapore','germany','italy']
for item in cities:
title="title something"+item
payload={
"content": "<div dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\">\nEspeciallySports is a sports news portal aims at bringing the latest sports news for the fans that cover MMA, WWE, UFC, Cricket, Football, etc&nbsp;</div>\n",
"title": title
}
respost=page.insert(blogId='xxxx',body=payload,isDraft=True).execute() #publishing the new post
print("printing the page id:",respost['id'])
*Note: please take care of the indentation, if you have issues copying from here, you can check using here

6. For updating the existing post with ID

This code independent of the above 1,2,3 actions, you can just the below code(highlighted in yellow) directly just below the  service = discovery.build('blogger', 'v3', http=http, discoveryServiceUrl=discoveryUrl)
payload={
"content": "<div dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\">\nEspeciallySports is a sports news portal aims at bringing the latest sports news for the fans that cover MMA, WWE, UFC, Cricket, Football, etc&nbsp;</div>\n",
"title": title
}
respost=page.update(blogId=’xxxxxx’, pageId=’xxxxx’, body=payload, publish=True).execute() #updating the existing post/page
*Note: please take care of the indentation, if you have issues copying from here, you can check using here

I hope this post is useful! 

Thursday, April 30, 2020

Javascript quiz with questions and answers

JavaScript is a web technology that adds the dynamic nature to the HTML web page. We can build applications from simple apps such as Calculator, Simple Quiz to complex applications such as Gmail, Google Analytics, Google Maps.

There are hundreds of frameworks have been derived from JavaScript and few popularly derived frameworks are NodeJSAngularJSReactJS, Vue JS Meteora JS, Backbone JS, etc. To understand these frameworks.

Take a quiz and assess your level of experience with Javascript tool, if you can score more than 6, then you can start directly with intermediate-level courses by brushing up basics, if your score is below 6, you can start taking a beginners level course, you can refer to the courses.
Javascript quiz with questions and answers
Javascript quiz with questions and answers


Question 1. Choose the correct answers from the below?

A. Javascript is an extension of the Java programming language
B. Javascript is a scripting language but not an object-oriented language
C. Javascript is used for manipulating the DOM(Document Object Model) elements of the HTML WebPage
D. Javascript is used for form validation only on client-side web applications and it cannot be used on server side


Answer: Option C
HTML is used for defining the DOM elements of a webpage and JavaScript is used for accessing and modifying all the elements of an HTML


 Question 2. What is the HTML tag under which one can write the JavaScript code?

A. <javascript> ... </javascript>
B. <scripted> ... </scripted>
C. <script>...  </script>
D. <js> ... </js>


Answer: Option C
Example:
<script> tag is used for defining for the javascript in the HTML web page and you can write the scripts/functions inside the script tags.

Question 3. Javascript is _ language?

Dynamic computer programming language
Javascript is an object-oriented programming language
Javascript is a Scripting language
All the Above


Answer: Option D
Python is a high-level programming language which means humans can easily understand the code. Low-level languages are machine level languages that can be understood by machines. Python is called scripting language because it was an interpreter to translate its source code. It is called a general-purpose programming language because it can be used to build any real-world applications


 Question 4. Predict the output of the following JavaScript code.

<script type="text/javascript" language="javascript"> 
var a = "Topzenith";  
var result = a.substring(4, 5); 
document.write(result);  
</script> 
A. e
B. en
C. n
D. ni

Answer: Option A
Explanation: The substring command selects the substring starting from 4 to 5, excluding the 5th index. The indexing starts from 0. So, the output here is just “s” rather than sf.

Question 5. what is the correct file extension for Javascript files?

A .java
js
C .javascript
D .script


Answer: Option B
All the files should save as .js file extension, in order to run the Javascript scripts.


 Question 6. Which of the following is the correct syntax to display “Topzenith.com” in an alert box using JavaScript?

A. alertbox(“topzenith.com”);
B. 
C. alert(“Topzenith.com”);
D. msg(“topzenith.com”);


Answer : Option C
Explanation: To display any text in the alert box, you need to write it as alert(“topzenith.com”);


 Question 7. What is the difference between "==" and "==="?


B. Both operators are same
C.==" checks only for equality in value whereas "===" is a stricter equality test
D. None of the above

Answer: Option C
==" checks only for equality in value whereas "===" is a stricter equality test and returns false if either the value or the type of the two variables are different. So, the second option needs both the value and the type to be the same for the operands.

 Question 8. What is the output of below? 33 == 33.0

A. False
B. 33
C. True
D. None of the above


Answer: Option C
Explanation
A comparison operator evaluates true and false. 


 Question 9. JavaScript is ________ language?

A. 
B. 
C. Translated
D. None of the above


Answer: Option A
Javascript uses an interpreter to translate and execute the code. The main difference is that the interpreter translates and executes code at once whereas the compiler translates the code into machine level language and then executes the programs. The best examples of the compiler are C, Java. Examples of the interpreter are Javascript, Python, Ruby, Perl programming examples

 Question 10. What will this code print?
>>> a=10
>>> alert(a+10)

A. This code will raise an exception
B. a+10
C. None of these
D. 20


Answer: Option D



Based on your score, if you can score more than 6, then you can start directly with intermediate-level courses by brushing up basics, if your score is below 6, you can start taking a beginners level course, you can refer to the courses. you can refer to the top 10 best Javascript courses online and take the courses accordingly. 

Thursday, April 23, 2020

Python quiz with questions and answers

Python is popular because it is a general-purpose programming language used in any building any programs, it can be used in building almost any real-world applications. Examples of web applications include Quora, YouTube, Dropbox Pinterest, etc,. Examples of Standalone applications such as sublime text, NetBeans, Koding, BitTorrent, etc,. Raspberry PI is also developed using Python programming language.

Not only building the Softwares but also it is widely used in DevOps environments for continuous integration and continuous deployment

Take a quiz and assess your level of experience with Python tool, if you can score more than 6, then you can start directly with intermediate-level courses by brushing up basics, if your score is below 6, you can start taking a beginners level course, you can refer to the courses.
Python quiz with questions and answers


Question 1. What is the correct syntax to output "Hello World" in Python?

A. p("Hello World")
B. echo "Hello World"
C. Print("Hello World");
D. echo("Hello World")


Answer: Option C


 Question 2. How do you insert COMMENTS in Python code?

A. //This is a comment
B. /*This is a comment*/
C. #This is a comment
D. /#This is a comment


Answer: Option C
Example:
print("This will run.")  #This won't run
Print function will output "this will run" and letter after # won't run, python interpreter will ignore the letter after # in that particular line

Question 3. Python is _ programming language?

High-level programming language
General-purpose programming language
Scripting language
All the Above


Answer: Option D
Python is a high-level programming language which means humans can easily understand the code. Low-level languages are machine level languages that can be understood by machines. Python is called scripting language because it was an interpreter to translate its source code. It is called a general-purpose programming language because it can be used to build any real-world applications


 Question 4. Python executes source code using

A. Interpreter
B. Translator
C. Compiler
D. All the above

Answer: Option A
As mentioned in the previous question, python uses an interpreter to translate and execute the code. The main difference is that the interpreter translates and executes code at once whereas the compiler translates the code into machine level language and then executes the programs. The best examples of the compiler are C, Java. Examples of the interpreter are, Python, Ruby, Perl programming examples


Question 5. In order to run Python programs, what is the correct file extension for Python files?

A .pyth

C .pt
D .pyt


Answer: Option B
All the files should save as .py file extension, in order to run the python scripts.


 Question 6. What is the correct way to create a function in Python?

A. function myfunction():
B. 
C. 
D. Fn function()


Answer : Option C 


 Question 7. What is the output of the following code?
eval(''1 + 3 * 2'')


B. 
C.
D. ‘1+3*2’

Answer: Option C
Eval is a method used to evaluate the values entered in the braces


 Question 8. What is the output of below? 33 == 33.0

A. False
B. 33
C. True
D. None of the above


Answer: Option C
Explanation

comparison operator evaluates true and false. And in python, we need not specify whether the number is int or float.


 Question 9. What is the difference between a class and an object in Python?

A. 
B. 
C. 
D. 

Answer: Option A


 Question 10. What will this code print?
>>> a=10
>>>   print(a+10)

A. 
B. a+10
C. None of these
D. 

Answer: Option D
This code will raise an exception because you cannot put whitespace before a statement. It raises a SyntaxError for unexpected indent.



Based on your score, if you can score more than 6, then you can start directly with intermediate-level courses by brushing up basics, if your score is below 6, you can start taking a beginners level course, you can refer to the courses. you can refer to the top 10 best python courses online and take the courses accordingly. 

Wednesday, April 22, 2020

Best Alternatives for Zoom Video Conferencing App

These days many of the people are working from home, due to the recent Corona Virus outbreak. The demand for Video conferencing apps has been increased.

These days, the Zoom Video Conferencing app has become popular. But as Zoom has recently made headlines for its privacy and security vulnerabilities. Here are the Best alternatives for Zoom Video Conferencing apps. Let us take a look at the Best alternative for Zoom.
Best Alternatives for Zoom Video Conferencing App
Best Alternatives for Zoom Video Conferencing App


Microsoft Teams: 

Microsoft Teams is a video conferencing app in Office 365. It does not offer standalone pricing and no free tier offer to use the application. It allows up to 250 users at a time to video chat. In this, meetings can also be scheduled using Outlook similar to Google Meets. Security is one of the core capabilities of the Microsoft Teams and it provides advanced security features that are in compliance with global standards including SOC 1, SOC 2, EU Model Clauses, ISO27001, HIPAA. This tool best suitable for large enterprise businesses.

GoToMeeting:

LogMeIn provides the web conferencing service called GoToMeeting. Its features include video and audio sessions, screen sharing, and a mobile app for iOS and Android. The standard version allows up to 150 team members and is available from $14/month or $12/month annually. Medium-sized businesses have to pay $19/month for the business plan tier. This expands the range to 250 users. Large businesses have to select the Enterprise plan which connects up to 3,000 users. This video conferencing tool is best suitable for live online courses such as webinars. GoToMeeting uses end-to-end encryption methods & authentication security is provided by a Secure Sockets Layer (SSL) site with end-to-end 128-bit Advanced Encryption Standard (AES) encryption and optional passwords.

Cisco Webex:

Cisco Webex is another popular Video conferencing app and it is the safest tool when compared to the other tools in the market as it runs Cisco's proprietary protocol standards. The free version offers a certain amount of up to 100 users for an unlimited amount of time. Its features are screen-sharing, HD video, and recording options. The paid versions consist of the Starter at $13.50/host for a month with 50 users, $17.95/month with 100 users, and for business at $26.95/month and five-license minimum up to 200 users.

Google Meet:

The business version of the regular hangouts allows for video meetings for G Suite subscribers. Even external users can still able to connect. G Suite Basic supports up to 100 participants for Basic, 150 participants for Business, and 250 for Enterprise. G Suite Enterprise is necessary if you want to Livestream with 100,000 audience members and record or save a meeting to your drive. In regards to security, Google Meet offers the best security to the users and all the data is encrypted in transit by default between the client and Google for video meetings across all devices such as web browser, on the Android and iOS apps

Skype Meet Now

Skype is also a product of Microsoft, it is popularly known for video chat experience. It supports up to 50 users for unlimited time for free, which is very useful for smaller companies. It also has a call recording feature. This feature can be used by any member and can save and share the recording for up to a month. Users should have the Skype app Downloaded. Skype owned by Microsoft and there is no chance at any privacy on that system

Jitsi Meet

Jitsi is an open-source platform that enables you to create and perform secure video conferencing solutions. It is a self-hosted platform, which means you need to install and configure the software on your servers in order to use it. Using this up to 75 users can meet virtually. It also integrates with Google Calendar, Slack, and Office 365. The best thing about this Jitsi is that it allows multiple users to screen share simultaneously. In regards to security, Jitsi doesn't offer end to end encryption and their GitHub pages have clearly mentioned this point.

Starleaf

Starleaf creates fast and easy video meetings or point-to-point video calls. It allows a maximum of 20 users at one time for video-chat. At present, it is providing its basic video and messaging product for free of cost. Starleaf provides robust security measures that are in compliance with ISO/IEC 27001 certification.

FaceTime:

FaceTime is best if every member of the team is using Apple devices. Apple says that FaceTime makes use of end-to-end encryption.

Whereby:

Whereby is considered as flexible as it provides video meeting in the browser. So, there is no need for downloading and logging in for guest users. It allows up to 50 people per call.

BlueJeans:

Bluejeans is a small, cloud-based video conferencing service. It provides high-quality streaming for small teams. There are three service options like Me, MyTeam, and MyCompany. Prices and range vary for these three options.


These are the Best alternatives for the Zoom Video Conferencing app. 

Wednesday, April 15, 2020

Best online courses Ivy League free

Over 500+ free online courses are offered by Ivy League which is a group of 8 prestigious universities in the United States and all these courses are free, you can sit back at home and leverage these online free courses helps to enhance your technical skills for your career growth. A wide range of courses are covered by Ivy League in different categories such as Computer Science, Data Science, Programming, Humanities, Business, Art & Design, Science, Social Sciences, Health & Medicine, Engineering, Mathematics, Education & Teaching, Personal Development, etc,. and all these courses are published across multiple e-learning platforms such as EDX, Coursera, Canvas Network, etc.

Best online courses Ivy League free 

It will be a great pain to find our desired courses on these multiple e-learning platforms. Instead of going to each and every learning platform to find your desired course, you can check all the course collections and apply filters on the ClassCentral website, you can refer to the below to check your desired courses.

Most of the courses are self-paced or while few others require enrollment. Checkout the ClassCentral website to find the available dates for enrolling. You're free to watch and learn the course without any payment methods, but if you're looking for course completion certification, then you may need to pay an additional amount.

Best courses in Computer Science

There are 50 courses available under this category, here are the best courses and worth to enroll for these courses. 

CS50's Introduction to Computer Science

This course is suitable for the students who are new to programming and in this course, all the major underlying concepts of popular programming languages like C, Python, SQL, and JavaScript plus CSS and HTML are covered and topics include abstraction, algorithms, data structures, encapsulation, resource management, security, software engineering, and web development. This course was offered by Harvard University and it is available on the edX learning platform with 10-20 hours a week and course duration is 12 weeks long.

Algorithms, Part I

This course is not for beginners, you should have strong technical skills to understand what the instructor is saying. I don't recommend this course for beginners. This course was offered by Princeton University and it is available on the Coursera learning platform with 6-12 hours and course duration is 6 weeks long.

Best courses in Data Science

Learn Data Science under the guidance of Harvard Unversity. In order to seek this video tutorial, you should have knowledge of Python programming and rudimentary knowledge. I recommend going through all Data science courses.

Trending Courses in Programming

Here, you can refer to the C programming with Linux and CS50's Web Programming with Python and JavaScript courses. 

Trending courses in Humanities

There are over 100 courses on the Humanities category, out of all those courses, you can refer to the below HOPE: Human Odyssey to Political Existentialism by Princeton University and Modern & Contemporary American Poetry (“ModPo”) by the University of Pennsylvania. These two are popular courses.

Trending courses in Business

There are over 110 courses on the Business category, out of all those courses, you can refer to the below high rated courses such as Introduction to Financial Accounting and Introduction to Marketing
by University of Pennsylvania, Wharton School of the University of Pennsylvania

Trending courses in Art & Design

In the Art & Design category, you can refer to Gamification, Introduction to Classical music, Creation of artifacts in society.

Trending courses in Science

In the Science category, you can refer to Vital Signs: Understanding What the Body Is Telling Us by the University of Pennsylvania and Best Practices for Biomedical Research Data Management (HE)
Canvas Network by Harvard Medical School, Harvard University

Trending courses in Social Sciences

In the Social Sciences category, you can refer to HOPE: Human Odyssey to Political Existentialism
by Princeton University and Justice by Harvard University.

Trending courses in Health & Medicine

In the Health & Medicine category, you can refer to Buddhism and Modern Psychology which all time 100 course by Princeton University via Coursera

Trending courses in Engineering

In the Engineering category, you can refer to The Art of Structural Engineering: Vaults by Princeton University and Robotics: Aerial Robotics by University of Pennsylvania

Trending courses in Mathematics

In the Mathematics category, you can refer to Introduction to Linear Models and Matrix Algebra by Harvard University

Trending courses in Personal Development

In the Personal Development category, you can refer to Improving Communication Skills by University of Pennsylvania 

Trending courses in Education & Teaching

In the Education & Teaching category, you can refer to Leaders of Learning by Harvard University and Applying to U.S. Universities University of Pennsylvania


From every video tutorial, you will learn something new, so I believe that the more you explore, the more you learn

Keep Learning :)

Monday, April 6, 2020

Face recognition roll out and smart newspaper test out in 2021

Technology is growing day by day. If you are adjusted to today then you are outdated tomorrow, this is the trend in the technology field. In the last century computers, mobiles were miracles, but today it's our part. Even a person with no eyes will be happier than a person without mobiles today. Charles Darwin in the theory of survival said that the person who is adaptive to change is the one who survives. This worked out today. New, innovative, creative inventions are invented every day.



5G is out and you can have access to it next year. In every field, technology is used as a tool to develop the results. From smartphones to smart heaters, from wire to wireless everything has changed. The transportation industry is using mobile apps to improve sales. These tollgate guys are using the fast tag to make it fast. VISA is using the swipe and pay option to reduce the queue line. Payments became online, sales became online and what can we expect next?

Face recognition


Face recognition means digital beings recognizing our faces. You already know that this feature is on your mobile right? (Not in all mobiles). But face recognition means not this one. It's like a mobile thing but more advanced. This is the testing stage and you can expect this feature to roll out at the beginning of 2021.

How can this feature help us? Are you always tired of showing your ID Card to the timekeeper or Are you tired of checking in those biometric machines? This helps out here. You can just walk into your office without those nuisance. Only this? Na Na. Still more, you can have advanced security to your digital world. Fingerprints may go and face check may come in 2021. You can just go to the store and get all the stuff you need without paying, the amount will be deducted by your bank after recognizing your face with bankers data.



Smart newspaper

Harry Potter, a well-known name to us. If you are a Harry Potter fan, you must have watched the Harry Potter prisoner of Azkaban. In the movie, you can see characters, text, pictures rolling out in the newspaper. In the Harry Potter world, it's fantasy and in the real world, it's a smart newspaper. Yes, you heard right, a smart newspaper.


It's different from the e-newspaper. If you read a newspaper on an electronic gadget like laptops and mobile, then it's an e-newspaper and if the newspaper itself is a gadget, then it is a smart newspaper. What's the advantage of it? You can gain a lot. You can get updated news within a short span. You can get a video played in a smart newspaper unlike pictures in traditional newspapers. It gives a lot of comfort to your eyes which reduces the chance of myopia. You can check your favorite news easily. The main advantage is it's eco-friendly. You can save a lot of paper and can control global warming because of it. You can even hear the news from it. We can expect this feature to be tested at the end of 2021. The main question is whether it's online or offline?