Wednesday, May 31, 2023

What is Vedanta ?

Vedanta, also known as Uttara Mimamsa, is one of the six major philosophical schools of Hinduism. It is based on the teachings and interpretations of the Vedas, which are ancient Hindu scriptures. Vedanta is considered the culmination and essence of Vedic wisdom.

The word "Vedanta" is derived from two Sanskrit words: "Veda" (knowledge) and "anta" (end or culmination). Hence, Vedanta can be understood as the end or culmination of knowledge as presented in the Vedas. It is a philosophical system that explores the nature of reality, the self (Atman), and the ultimate truth (Brahman).

What is Vedanta ?

Vedanta philosophy encompasses various texts, the most important being the Upanishads, which are considered the culmination of the Vedas. The Upanishads explore profound metaphysical and spiritual concepts and are the primary source of Vedanta teachings. Other important texts in Vedanta include the Brahma Sutras (also known as the Vedanta Sutras) and the Bhagavad Gita.

Vedanta philosophy emphasizes the concept of non-duality (Advaita) and the identity of the individual self (Atman) with the ultimate reality (Brahman). It teaches that the ultimate goal of human life is to realize this non-dual nature and attain liberation (Moksha) from the cycle of birth and death.

What is Vedanta ?

Different sub-schools or interpretations of Vedanta have emerged over time, including Advaita Vedanta, Vishishtadvaita Vedanta, and Dvaita Vedanta. Each of these sub-schools presents its own understanding and philosophical perspectives within the broader framework of Vedanta.

Vedanta has had a profound influence on Indian philosophy, spirituality, and culture. It continues to be studied, practiced, and taught by scholars, spiritual seekers, and philosophers worldwide. The teachings of Vedanta have also inspired various spiritual leaders and have been incorporated into other religious and philosophical traditions.


1. Prerequisites for studying Vedanta:
   Vedanta is considered to be an advanced philosophical system that requires a strong foundation in the study of the Vedas, including the rituals and practices prescribed in the earlier portions of the Vedas known as the Karma Kanda. The study of Vedanta is typically undertaken by those who have already fulfilled their worldly duties and are ready to engage in deep spiritual inquiry.

2. Three pillars of Vedanta:
   Vedanta philosophy is often summarized by three fundamental principles:
   - Brahma Satyam: Brahman, the ultimate reality, is the only truth. The material world is temporary and illusionary.
   - Jagan Mithya: The world we perceive is a product of Maya (illusion) and is not ultimately real.
   - Jivo Brahmaiva Napara: The individual self (Jiva) and Brahman (ultimate reality) are not separate entities but are ultimately one.

3. Methods of knowledge in Vedanta:
   Vedanta recognizes three primary means of acquiring knowledge (Pramanas):
   - Pratyaksha (Direct perception): Knowledge gained through direct sensory perception.
   - Anumana (Inference): Knowledge obtained through logical reasoning and inference.
   - Shruti (Scriptural testimony): Knowledge transmitted through sacred texts like the Upanishads, which are considered the ultimate authority in Vedanta.

4. Paths of realization:
   Vedanta recognizes three main paths (Yogas) to realize the truth and attain liberation (Moksha):
   - Jnana Yoga: The path of knowledge and wisdom, which involves intellectual inquiry, self-reflection, and the direct realization of one's true nature.
   - Bhakti Yoga: The path of devotion and surrender to a personal deity, emphasizing love, devotion, and worship as a means to unite with the divine.
   - Karma Yoga: The path of selfless action, emphasizing performing one's duties without attachment to the results, cultivating a sense of detachment and selflessness.

5. Key figures in Vedanta:
   Vedanta has been expounded by numerous philosophers and spiritual teachers throughout history. Some prominent figures include:
   - Adi Shankaracharya: An influential philosopher who revived Advaita Vedanta in the 8th century CE and wrote commentaries on the Upanishads, Bhagavad Gita, and Brahmasutras.
   - Ramanuja: A 12th-century philosopher who advocated Vishishtadvaita Vedanta, emphasizing the individual soul's eternal relationship with Brahman.
   - Madhva: A 13th-century philosopher who founded Dvaita Vedanta, emphasizing the eternal distinction between the individual soul and Brahman.


1. Maya:
   Maya is a central concept in Vedanta. It refers to the power of Brahman that creates the illusion of the material world and veils the true nature of reality. Maya makes the finite world appear real, despite being ultimately illusory. Understanding and transcending Maya is an important aspect of spiritual realization in Vedanta.

2. Five Sheaths (Pancha Koshas):
   According to Vedanta, the human being is composed of five layers or sheaths that encase the true self (Atman). These sheaths are:
   - Annamaya Kosha: The physical sheath consisting of the body and senses.
   - Pranamaya Kosha: The vital energy sheath governing life functions and breath.
   - Manomaya Kosha: The mental sheath associated with thoughts, emotions, and desires.
   - Vijnanamaya Kosha: The intellectual sheath involved in discernment and higher knowledge.
   - Anandamaya Kosha: The bliss sheath representing the deepest level of happiness and spiritual experience.

3. Neti-Neti:
   Neti-Neti is a method of negation used in Vedanta. It means "not this, not this" and is employed to guide the seeker to realize the ultimate truth by negating the identification with the temporary and changing aspects of existence. By negating what is not the true self, one arrives at the realization of the eternal and unchanging nature of Brahman.

4. Concept of Gunas:
   Vedanta acknowledges the three Gunas (qualities) that are present in the material world. These Gunas are:
   - Sattva: The quality of purity, knowledge, and harmony.
   - Rajas: The quality of passion, activity, and restlessness.
   - Tamas: The quality of darkness, inertia, and ignorance.

   Vedanta explains that these Gunas influence the individual's thoughts, actions, and perceptions and that transcending the Gunas is essential for spiritual growth and realization.

5. Advaita Vedanta and Dvaita Vedanta:
   Advaita Vedanta, founded by Adi Shankaracharya, asserts the non-dual nature of reality, emphasizing that the individual self (Atman) is identical to the ultimate reality (Brahman). Dvaita Vedanta, founded by Madhva, upholds the philosophy of dualism, emphasizing the eternal distinction between the individual soul and God (Vishnu).

These are further insights into the concepts and aspects of Vedanta. The philosophy of Vedanta provides a comprehensive framework for understanding the nature of reality, the self, and the path to spiritual liberation. It continues to be studied, contemplated, and practiced by seekers and scholars worldwide.

Top Brands

Tuesday, May 30, 2023

Top Facts About Mount Everest.

Top Facts About Mount Everest | KumarSuresh Blogs


Mount Everest, also known as Sagarmatha in Nepali and Chomolungma in Tibetan, is the highest mountain in the world. It is located in the Himalayas on the border between Nepal and Tibet (China). Here are some key details about Mount Everest:

1. Height: Mount Everest stands at an elevation of 8,848.86 meters (29,031.7 feet) above sea level, making it the tallest peak on Earth.

2. First Ascent: The first successful ascent of Mount Everest was accomplished by Sir Edmund Hillary of New Zealand and Tenzing Norgay, a Sherpa of Nepal, on May 29, 1953. Their expedition was led by Sir John Hunt.

3. Routes: There are several routes to reach the summit of Mount Everest, but the two most popular ones are the South Col route from Nepal and the North Col route from Tibet. The South Col route via the Southeast Ridge is the more frequently used path.

4. Challenges: Climbing Mount Everest is a formidable and dangerous undertaking due to extreme altitude, unpredictable weather, high winds, low oxygen levels, and difficult terrain. Many climbers have lost their lives while attempting to summit the mountain.

5. Sherpas: The indigenous Sherpa people of Nepal are renowned for their mountaineering skills and have played a crucial role in supporting Everest expeditions. They serve as guides, porters, and climbers, assisting climbers with equipment, establishing camps, and ensuring their safety.

6. Commercial Expeditions: Over the years, climbing Mount Everest has become a popular adventure tourism activity. Numerous commercial expeditions are organized by experienced mountaineering companies that provide logistical support to climbers, including Sherpa guides, equipment, and permits.
Top Facts About Mount Everest | KumarSuresh Blogs


7. Environmental Concerns: Mount Everest faces environmental challenges, such as overcrowding, waste management, and the impact of climate change. Efforts are being made to regulate climbing permits, clean up the mountain, and raise awareness about responsible mountaineering.

8 Location: Mount Everest is situated in the Mahalangur Range of the Himalayas, specifically in the Khumbu region of Nepal and the Tingri County of Tibet (China). The mountain's precise coordinates are approximately 27.9881° N latitude and 86.9253° E longitude.

9. Formation and Geology: Mount Everest is part of the Himalayan mountain range, which was formed by the collision of the Indian and Eurasian tectonic plates. The mountain is primarily composed of sedimentary and metamorphic rocks, including limestone, shale, and schist. It features distinct layers of rock, tilted at an angle due to tectonic forces.

9. Three Main Peaks: Mount Everest has three main peaks: the South Summit, the Central Summit (the highest point), and the North Summit. The South Summit is slightly lower than the Central Summit and serves as the last obstacle before reaching the true summit.

10. Height Variations: Over the years, the official height of Mount Everest has varied due to different measurement methods and advancements in technology. The current accepted height, 8,848.86 meters (29,031.7 feet), was determined by the Survey of India in 2020 using global navigation satellite systems and gravity data.
Top Facts About Mount Everest | KumarSuresh Blogs


11. Climbing Season: The primary climbing season for Mount Everest is during the spring (April-May) and autumn (September-October). These periods offer relatively stable weather conditions and a higher chance of success in reaching the summit. However, some climbers also attempt ascents during other times of the year.

12. Mountaineering Routes:
   - South Col Route (Southeast Ridge): This is the most popular and frequently used route to the summit. It begins in Nepal's Khumbu Valley and involves passing through famous landmarks like Base Camp, the Khumbu Icefall, the Western Cwm, the Lhotse Face, the South Col, and the Hillary Step.
   - North Col Route (Northeast Ridge): This route starts from Tibet's Rongbuk Glacier and passes through the North Col, the Northeast Ridge, the Three Steps, and the Hillary Step. It is considered more challenging than the South Col Route.

13. Climbing Difficulty: Mount Everest is considered one of the most challenging mountains to climb due to its extreme altitude and harsh weather conditions. Climbers face significant risks, including altitude sickness, avalanches, crevasses, storms, and frostbite. Proper acclimatization, physical fitness, and mountaineering experience are crucial for a safe and successful ascent.


14. Records and Achievements:
   - Youngest Climber: In 2010, Jordan Romero from the United States became the youngest person to reach the summit of Mount Everest at the age of 13.
   - Fastest Ascent: In 2019, Kami Rita Sherpa set a record by reaching the summit for the 24th time, the most ascents by any individual.
   - Without Supplemental Oxygen: Several climbers have successfully reached the summit without the use of supplemental oxygen, including Reinhold Messner and Peter Habeler in 1978, and more recently, Kilian Jornet in 2017.

Remember that climbing Mount Everest is an extremely challenging and risky endeavor, requiring proper training, experience, and preparation. It's essential to respect the mountain and prioritize safety when attempting to summit.

Reaching the summit of Mount Everest is an extraordinary feat that requires extensive preparation, physical fitness, mountaineering experience, and careful planning. Here are the general steps involved in climbing Mount Everest:

Top Facts About Mount Everest | KumarSuresh Blogs

1. Physical Conditioning: Mountaineering at extreme altitudes demands excellent physical fitness. Engage in a long-term training program that includes cardiovascular exercises, strength training, endurance activities, and high-altitude acclimatization.

2. Research and Planning: Gather as much information as possible about the mountain, its routes, weather patterns, permits, and logistics. Research reputable mountaineering companies or expeditions that organize trips to Everest and provide necessary support and guidance.

3. Choose a Route and Team: Decide on the route you want to take based on your experience and goals. The South Col Route from Nepal is the most popular choice. Find a reliable expedition team with experienced guides, Sherpa support, and a proven safety record.

4. Obtain Permits: Acquire the necessary permits and permissions from the respective government authorities. In Nepal, you'll need a climbing permit issued by the Department of Tourism, and in Tibet (China), you'll require permission from the Chinese Mountaineering Association.

5. Training and Acclimatization: Participate in pre-expedition training and acclimatization programs organized by your chosen expedition team. These programs usually take place in the Everest region, allowing you to adapt to higher altitudes and practice climbing techniques.

6. Base Camp: Begin the expedition by trekking to Everest Base Camp (5,364 meters/17,598 feet) in Nepal or the equivalent in Tibet. Set up a base camp to serve as a staging area for further acclimatization and preparation.

7. Camps and Climbing: Establish a series of camps at various altitudes, typically Camp 1 (6,065 meters/19,900 feet), Camp 2 (6,500 meters/21,325 feet), Camp 3 (7,200 meters/23,620 feet), and Camp 4 (7,950 meters/26,085 feet). Ascend and descend the mountain in stages, allowing your body to adjust to the increasing altitude and reduced oxygen levels.

8. Summit Push: Plan a strategic summit push based on favorable weather conditions and your physical readiness. Typically, climbers aim to reach the summit from Camp 4, passing through the South Col, the Balcony, the Hillary Step, and the final ridge to the summit. Summit attempts are often made during early morning hours to maximize safety and reduce exposure to changing weather conditions.

9. Safety and Decision-making: Always prioritize safety during the climb. Listen to your guides, pay attention to your body's signals, and be prepared to turn back if conditions become hazardous or if you experience altitude sickness or other health issues.

10. Summit Success and Descent: If you successfully reach the summit, take a moment to appreciate the accomplishment. However, remember that reaching the summit is only halfway done. Descending safely is equally crucial, as the majority of accidents and fatalities occur during the descent.

It's important to note that climbing Mount Everest is an extremely challenging and dangerous endeavor, and it should not be taken lightly. Consider seeking professional guidance, joining an organized expedition, and ensuring you have adequate experience and skills before attempting to summit the mountain.

Top Brands

Sunday, May 28, 2023

The Impact of Artificial Intelligence - Widespread Job Losses In India..


 

Technological advancements and automation have been key drivers of job disruption in recent years. As automation technologies improve and become more affordable, they have the potential to replace human workers in various industries, particularly in repetitive or routine tasks. This can lead to job losses and require workers to acquire new skills or transition into different occupations.

The advent of artificial intelligence (AI), robotics, and machine learning has also contributed to job disruption. These technologies have the ability to perform complex tasks and decision-making processes, which were traditionally done by humans. While they bring efficiency and productivity gains, they can also lead to the displacement of certain job roles.

Other factors contributing to job disruption include economic changes, such as shifts in consumer demand, globalization, and industry restructuring. For example, advancements in e-commerce have impacted traditional retail jobs, while globalization and outsourcing have affected employment in certain manufacturing sectors.

Massive job disruption poses challenges for affected individuals and communities, as it can lead to unemployment, income inequality, and social and economic instability. However, it can also create new opportunities and job prospects in emerging industries and sectors.

To mitigate the negative impacts of job disruption, it is important for governments, businesses, and individuals to proactively address the issue. This includes investing in education and skill development programs to enable workers to adapt to changing job requirements, fostering entrepreneurship and innovation, and implementing supportive policies and safety nets to assist displaced workers during the transition.


AI, or artificial intelligence, is one of the key factors contributing to job disruption in various industries. Here are some ways in which AI can impact jobs:

1. Automation: AI technologies enable automation of tasks that were previously performed by humans. With advancements in machine learning and robotics, AI systems can now handle repetitive, routine, and even complex tasks with a high degree of accuracy and efficiency. This automation can lead to the displacement of human workers in roles such as manufacturing, customer service, data entry, and more.

2. Intelligent algorithms: AI-powered algorithms can analyze vast amounts of data and make informed decisions or predictions. This capability affects jobs that involve data analysis, market research, financial analysis, and even certain medical diagnoses. AI algorithms can process and interpret data faster and more accurately than humans, potentially reducing the need for human involvement in such tasks.

3. Chatbots and virtual assistants: AI-powered chatbots and virtual assistants are increasingly being used to handle customer inquiries, provide support, and perform basic tasks. They can handle a large volume of customer interactions simultaneously and are available 24/7. This can impact jobs in call centers and customer support roles.

4. Transportation and logistics: AI is disrupting jobs in the transportation and logistics industry. Self-driving vehicles and drones are being developed and tested for tasks such as delivery services, trucking, and transportation of goods. If successfully implemented, these technologies could potentially reduce the need for human drivers and logistics personnel.

5. Creative industries: AI technologies are also making inroads into creative fields such as content generation, music composition, and graphic design. AI algorithms can generate content or produce creative outputs based on patterns and preferences, potentially impacting jobs in these creative sectors.

While AI can lead to job disruption, it's important to note that it also creates new job opportunities. AI technologies require development, implementation, monitoring, and maintenance, which can create jobs in AI research, programming, data analysis, and more. Additionally, AI can augment human capabilities and enhance productivity in various industries.

To navigate the impact of AI on jobs, reskilling and upskilling programs become crucial. It is important for individuals and organizations to adapt to the changing job landscape, acquire new skills, and focus on areas where human creativity, critical thinking, emotional intelligence, and problem-solving abilities continue to have an advantage over AI systems.


Top Brands

Thursday, May 25, 2023

 



Gautam Adani, the founder and chairman of the Adani Group. Gautam Adani is an Indian billionaire entrepreneur and industrialist. He was born on June 24, 1962, in Ahmedabad, Gujarat, India.

Gautam Adani started his entrepreneurial journey in 1988 when he established Adani Enterprises, which was initially involved in commodity trading. Under his leadership, the Adani Group expanded into various sectors, including infrastructure, energy, ports, logistics, and mining.


Gautam Adani has played a significant role in the growth and expansion of the Adani Group, turning it into one of India's largest business conglomerates. He has been instrumental in the development of major infrastructure projects in India and has been involved in international ventures as well.

Over the years, Gautam Adani has amassed considerable wealth, making him one of the wealthiest individuals in India and globally. His business ventures and contributions to the industrial sector have earned him recognition and accolades in the business community.

Adani Group, an Indian multinational conglomerate company headquartered in Ahmedabad, Gujarat. The Adani Group was founded by Gautam Adani in 1988 and has since grown to become one of India's largest business conglomerates with diverse interests in sectors such as infrastructure, energy, ports, logistics, mining, and agribusiness.

The group's businesses include Adani Ports and Special Economic Zone Ltd (APSEZ), which is the largest port developer and operator in India, with operations at several ports across the country. Adani Power is another major subsidiary, involved in the generation and distribution of electricity. They also have interests in the renewable energy sector, with Adani Green Energy being one of the largest renewable power producers in India.

Apart from infrastructure and energy, the Adani Group has expanded into areas like agribusiness with Adani Wilmar, a leading edible oil producer, and Adani Enterprises, which operates in various sectors such as coal mining, trading, and logistics.

In recent years, the Adani Group has attracted attention for its involvement in major infrastructure projects, including the development of airports, roads, and the controversial Carmichael coal mine project in Australia.


Top Brands

Tuesday, February 21, 2023

Python Scripts to Delete the Files Regularly

Python Scripts to Delete the Files Regularly

python framework

 

Cleaning file system regularly manually is not good. Automate them!

Deleting files and folders manually is not an exciting task, as one may think. It makes sense to automate them.

Here comes Python to make our lives easier. Python is an excellent programming language for scripting. We are going to take advantage of Python to finish our task without any obstacle. First, you should know why Python is a good choice.

  • Python is an all-time favorite language for automating tasks
  • Less code compared to other programming languages
  • Python is compatible with all the operating systems. You can run the same code in Windows, Linux, and Mac.
  • Python has a module called os that helps us to interact with the operating system. We are going to use this module to complete our automation of deleting the files.

We can replace any annoying or repetitive system tasks using Python. Writing scripts for completing a specific system task is a cupcake if you know Python. Let’s look at the following use case.

Note: the following are tested on Python 3.6+

Removing files/folders older than X days

Often you don’t need old logs, and you regularly need to clean them to make storage available. It could be anything and not just logs.

We have a method called stat in the os module that gives details of last access (st_atime), modification (st_mtime), and metadata modification (st_ctime) time. All the methods return time in seconds since the epoch. You can find more details about the epoch here.

We will use a method called os.walk(path) for traversing through the subfolders of a folder.

Follow the below steps to write code for the deletion files/folders based on the number of days.

  • Import the modules time, os, shutil
  • Set the path and days to the variables
  • Convert the number of days into seconds using time.time() method
  • Check whether the path exists or not using the os.path.exists(path) module
  • If the path exists, then get the list of files and folders present in the path, including subfolders. Use the method os.walk(path), and it will return a generator containing folders, files, and subfolders
  • Get the path of the file or folder by joining both the current path and file/folder name using the method os.path.join()
  • Get the ctime from the os.stat(path) method using the attribute st_ctime
  • Compare the ctime with the time we have calculated previously
  • If the result is greater than the desired days of the user, then check whether it is a file or folder. If it is a file, use the os.remove(path) else use the shutil.rmtree() method
  • If the path doesn’t exist, print not found message

Let’s see the code in detail.

# importing the required modules
import os
import shutil
import time

# main function
def main():

	# initializing the count
	deleted_folders_count = 0
	deleted_files_count = 0

	# specify the path
	path = "/PATH_TO_DELETE"

	# specify the days
	days = 30

	# converting days to seconds
	# time.time() returns current time in seconds
	seconds = time.time() - (days * 24 * 60 * 60)

	# checking whether the file is present in path or not
	if os.path.exists(path):
		
		# iterating over each and every folder and file in the path
		for root_folder, folders, files in os.walk(path):

			# comparing the days
			if seconds >= get_file_or_folder_age(root_folder):

				# removing the folder
				remove_folder(root_folder)
				deleted_folders_count += 1 # incrementing count

				# breaking after removing the root_folder
				break

			else:

				# checking folder from the root_folder
				for folder in folders:

					# folder path
					folder_path = os.path.join(root_folder, folder)

					# comparing with the days
					if seconds >= get_file_or_folder_age(folder_path):

						# invoking the remove_folder function
						remove_folder(folder_path)
						deleted_folders_count += 1 # incrementing count


				# checking the current directory files
				for file in files:

					# file path
					file_path = os.path.join(root_folder, file)

					# comparing the days
					if seconds >= get_file_or_folder_age(file_path):

						# invoking the remove_file function
						remove_file(file_path)
						deleted_files_count += 1 # incrementing count

		else:

			# if the path is not a directory
			# comparing with the days
			if seconds >= get_file_or_folder_age(path):

				# invoking the file
				remove_file(path)
				deleted_files_count += 1 # incrementing count

	else:

		# file/folder is not found
		print(f'"{path}" is not found')
		deleted_files_count += 1 # incrementing count

	print(f"Total folders deleted: {deleted_folders_count}")
	print(f"Total files deleted: {deleted_files_count}")


def remove_folder(path):

	# removing the folder
	if not shutil.rmtree(path):

		# success message
		print(f"{path} is removed successfully")

	else:

		# failure message
		print(f"Unable to delete the {path}")



def remove_file(path):

	# removing the file
	if not os.remove(path):

		# success message
		print(f"{path} is removed successfully")

	else:

		# failure message
		print(f"Unable to delete the {path}")


def get_file_or_folder_age(path):

	# getting ctime of the file/folder
	# time will be in seconds
	ctime = os.stat(path).st_ctime

	# returning the time
	return ctime


if __name__ == '__main__':
	main()

You need to adjust the following two variables in the above code based on the requirement.

days = 30 
path = "/PATH_TO_DELETE"

Removing files larger than X GB

Let’s search for the files that are larger than a particular size and delete them. It is similar to the above script. In the previous script, we have taken age as a parameter, and now we will take size as a parameter for the deletion.

# importing the os module
import os

# function that returns size of a file
def get_file_size(path):

	# getting file size in bytes
	size = os.path.getsize(path)

	# returning the size of the file
	return size


# function to delete a file
def remove_file(path):

	# deleting the file
	if not os.remove(path):

		# success
		print(f"{path} is deleted successfully")

	else:

		# error
		print(f"Unable to delete the {path}")


def main():
	# specify the path
	path = "ENTER_PATH_HERE"

	# put max size of file in MBs
	size = 500

	# checking whether the path exists or not
	if os.path.exists(path):

		# converting size to bytes
		size = size * 1024 * 1024

		# traversing through the subfolders
		for root_folder, folders, files in os.walk(path):

			# iterating over the files list
			for file in files:
				
				# getting file path
				file_path = os.path.join(root_folder, file)

				# checking the file size
				if get_file_size(file_path) >= size:
					# invoking the remove_file function
					remove_file(file_path)
			
		else:

			# checking only if the path is file
			if os.path.isfile(path):
				# path is not a dir
				# checking the file directly
				if get_file_size(path) >= size:
					# invoking the remove_file function
					remove_file(path)


	else:

		# path doesn't exist
		print(f"{path} doesn't exist")

if __name__ == '__main__':
	main()

Adjust the following two variables.

path = "ENTER_PATH_HERE" 
size = 500

Removing files with a specific extension

There might be a scenario where you want to delete files by their extension types. Let’s say .log file. We can find the extension of a file using the os.path.splitext(path) method. It returns a tuple containing the path and the extension of the file.

# importing os module
import os

# main function
def main():
    
    # specify the path
    path = "PATH_TO_LOOK_FOR"
    
    # specify the extension
    extension = ".log"
    
    # checking whether the path exist or not
    if os.path.exists(path):
        
        # check whether the path is directory or not
        if os.path.isdir(path):
        
            # iterating through the subfolders
            for root_folder, folders, files in os.walk(path):
                
                # checking of the files
                for file in files:

                    # file path
                    file_path = os.path.join(root_folder, file)

                    # extracting the extension from the filename
                    file_extension = os.path.splitext(file_path)[1]

                    # checking the file_extension
                    if extension == file_extension:
                        
                        # deleting the file
                        if not os.remove(file_path):
                            
                            # success message
                            print(f"{file_path} deleted successfully")
                            
                        else:
                            
                            # failure message
                            print(f"Unable to delete the {file_path}")
        
        else:
            
            # path is not a directory
            print(f"{path} is not a directory")
    
    else:
        
        # path doen't exist
        print(f"{path} doesn't exist")

if __name__ == '__main__':
    # invoking main function
    main()

Don’t forget to update the path and extension variable in the above code to meet your requirements 


Top Brands

Tuesday, January 3, 2023

How Progressive Web Apps can drive business success

 Progressive Web Apps are on a lot of companies' roadmap to modernize their websites and adapt to users' new expectations. As with many technologies, PWAs raise questions: is it what my customers want, how much will it grow my business, what is technically feasible?

Identify your stakeholders.
Identify your stakeholders.

To shape your digital strategy, several stakeholders are often involved: the product manager and chief marketing officer are co-owners of the business impact of each feature, the chief technology officer assesses the feasibility and reliability of a technology, the user experience researchers validate that a feature answers a real customer issue.

This article aims to help you answer those three questions and shape your PWA project. You will start from your customer needs, translate this into PWA features, and focus on measuring the business impact of each.

PWAs solve customer needs ##

One rule we love to follow at Google when making products is "focus on the user and all else will follow". Think user-first: what are my customers' needs, and how does a PWA provide them?

Identify customer needs.
Identify customer needs.

When doing user research, we find some interesting patterns:

According to those observations, we found out that customers prefer experiences that are fast, installable, reliable, and engaging (F.I.R.E.).

PWAs leverage modern web capabilities #

PWAs provide a set of best practices and modern web APIs that are aimed at meeting your customers' needs by making your site fast, installable, reliable, and engaging.

For example, using a service worker to cache your resources and doing predictive prefetching makes your site faster, and more reliable. Making your site Installable provides an easy way for your customers to access it directly from their home screen or app launcher. And APIs such as Web Push Notifications make it easier to re-engage your users with personalized content to generate loyalty.

Improving the user experience with web capabilities.
Improving the user experience with web capabilities.

Understand the business impact #

The business success definition can be many things depending on your activity:

  • Users spending more time on your service
  • Reduced bounce rates for your leads
  • Improved conversion rates
  • More returning visitors

Most PWA projects result in a higher mobile conversion rate. You can learn more from the numerous PWA case studies. Depending on your objectives, you may want to prioritize the aspects of PWAs that make more sense for your business, and it's completely OK. PWA features can be cherry-picked and launched separately.

Let's measure the business impact of each of these great F.I.R.E features.

The business impact of a fast website ##

A recent study from Deloitte Digital shows that page speed has a significant impact on business metrics.

There's much you can do to optimize the speed of your site to improve critical user journeys for all of your users. If you don't know where to start, take a look at our Fast section, and use Lighthouse to prioritize the most important things to fix.

When working on your speed optimizations, start measuring your site speed frequently with appropriate tools and metrics to monitor your progress. For example, measure your metrics with Lighthouse, fix clear targets like having "Good" Core Web Vitals scores, and incorporate a performance budget into your build process. Thanks to your daily measurements and the "value of speed" methodology, you can isolate the impact of your incremental speed changes and calculate how much extra revenue your work has generated.

Measure the value of speed and correlate it with conversions.
Measure the value of speed and correlate it with conversions.

Ebay made speed a company objective for 2019. They used techniques such as performance budget, critical path optimization, and predictive prefetching. They concluded that for every 100 millisecond improvement in search page loading time, add-to-card count increased by 0.5%.

A 100ms improvement in load time resulted in a 0.5% increase in add to cart count for eBay.
A 100ms improvement in load time resulted in a 0.5% increase in add to cart count for eBay.

The business impact of an installable website #

Why would you want a user to install your PWA? To make it easier to come back to your site. Where an Android app installation would add at least three steps (redirection to Play Store, downloading the app, launching the app), PWA installation is done seamlessly in one click without taking the user away from the current conversion funnel.

The install experience should be seamless.
The install experience should be seamless.

Once an app is installed, users can launch it in one click using the icon on their home screen, see it in their app tray when they are switching between apps, or find it via an app search result. We call this dynamic Discover-Launch-Switch, and making your PWA installable is the key to unlocking access.

In addition to being accessible from familiar discovery and launch surfaces on their device, a PWA launches exactly like a platform-specific app: in a standalone experience, separate from the browser. Additionally, it benefits from OS-level device services such as the app switcher and settings.

Users who install your PWA are likely your most engaged users, with better engagement metrics than casual visitors, including more repeat visits, longer time on site and higher conversion rates, often at parity with platform-specific app users on mobile devices.

To make your PWA installable, it needs to meet the base criteria. Once it meets those criteria, you can promote the installation within your user experience on desktop and mobile, including iOS.

PWAs are installable everywhere.
PWAs are installable everywhere.

Once you've begun promoting the installation of your PWA, you should measure how many users are installing your PWA, and how they use your PWA.

To maximize the number of users installing your site, you may want to test different promotion messages ("install in one second", or "add our shortcut to follow your order" for example), different placements (header banner, in-feed), and try proposing it at different steps of the installation funnel (on the second page visited, or after a booking).

To understand where your users are leaving and how to improve retention, the installation funnel can be measured in four ways:

  • Number of users eligible to install
  • Number of users who clicked on the install prompt
  • Number of users who both accepted and declined the install prompt
  • Number of users who successfully installed

You can promote your PWA installation to all your users or take a more cautious approach by experimenting with a small group of users.

A few days or weeks should give you enough data to measure the impact on your business. What is the behavior of people coming from the installed shortcut? Do they engage more, do they convert more?

To segment users who installed your PWA, track the appinstalled event, and use JavaScript to check if users are in standalone mode, which indicates use of the installed PWA. Then use these as variables or dimensions for your analytics tracking.

Measure the value of installation.
Measure the value of installation.

The case study of Weekendesk is interesting; to increase the chance a user would install their PWA, they promote installation on the second page visited. Users who launched the PWA from their home screen were more than twice as likely to book a stay through their PWA!

Installed users had a 2.5 times higher conversion rate.
Installed users had a 2.5 times higher conversion rate.

Installation is a great way to encourage people return to your site and improve your customer loyalty. You can also think of personalizing the experience for premium users.

Even if you have a platform-specific app, users may feel they don't want to, or don't need to install it. These semi-engaged users may feel a PWA is right for them as it is often perceived as lighter, and can be installed with less friction.

PWAs can reach semi-engaged users.
PWAs can reach semi-engaged users.

The business impact of a reliable website #

The Chrome Dino game, offered when a user is offline, is played more than 270 million times a month. This impressive number shows that network reliability is a considerable opportunity for PWA use, especially in markets with unreliable networks or expensive mobile data such as India, Brazil, Mexico, or Indonesia.

When an app installed from an app store is launched, users expect it to open regardless of whether they're connected to the internet. Progressive Web Apps should be no different.

At a minimum, a simple offline page that tells the user the app isn't available without a network connection should be served. Then, consider taking the experience a step further by providing functionality that makes sense while offline. For example, you could provide access to tickets or boarding passes, offline wish lists, call center contact information, articles or recipes that the user has recently viewed, etc.

Be helpful, even when offline.
Be helpful, even when offline.

Once you've implemented a reliable user experience, you may want to measure it; how many users are going offline, in which geographies, and do they stay on the website when the network is back? Analytics can tell you when users go generally go offline and online. This tells you how many users continue browsing on your website after the network comes back.

Trivago saw a 67% increase in users who came back online and continue browsing.
Trivago saw a 67% increase in users who came back online continue browsing.

The Trivago case study illustrates how this can impact your business objectives. For users whose sessions were interrupted by an offline period (around three percent of users), 67% of those who come back online continued browsing the site.

The business impact of an engaging website #

Web push notifications allow users to opt-in to timely updates from sites they need or care about and allow you to effectively re-engage them with customized, relevant content.

Be careful, though. Asking users to sign up for web notifications when they first arrive and without exposing the benefits can be perceived as spammy and negatively affect your experience. Make sure to follow best practices when prompting for notifications and inspire acceptance through relevant usages like train delays, price tracking, out of stock products, etc.

Technically, push notifications on the web run in the background thanks to a service worker and are often sent by a system built for managing campaigns (e.g. Firebase). This feature brings great business value for mobile (Android) and desktop users. It increases repeated visits and consequently sales and conversions.

To measure the effectiveness of your push campaigns, you need to measure the whole funnel including:

  • Number of users eligible for push notifications
  • Number of users who click a custom notification UI prompt
  • Number of users who grant push notification permission
  • Number of users who receive push notifications
  • Number of users who engage with notifications
  • Conversion and engagement of users coming from a notification
Measure the value of web push notifications.
Measure the value of web push notifications.

There are a lot of great case studies on web push notifications, such as the one with Carrefour who multiplied their conversion rate by 4.5 by re-engaging users with abandoned carts.

The P in PWA: a progressive launch, feature by feature #

PWAs are modern websites that combine the massive reach of the web, combined with all the user-friendly features that users expect in Android, iOS, or desktop apps. They use a set of best practices and modern web APIs that can be implemented independently depending on your business specificities and priorities.

Progressively launch your PWA.
Progressively launch your PWA.

To accelerate the modernization of your website and make it a real PWA, we encourage you to be agile: launch feature by feature. First, research with your users what features would bring them the most value, then deliver them with your designers and developers, and finally do not forget to measure precisely how much extra money your PWA generated.


Top Brands