Menu

update a JSON object using JavaScript

JSON objects are frequently used as a data format in the web world. Many times, we encounter situations where we need to update the JSON object or a part of the JSON object (JSON object property). In this blog, we will discuss how to update a part of a JSON object using JavaScript.

For example, we have a json object that have dimentions.

let dimensions = [

    {"height": 100, "width": 50},

    {"height": 200, "width": 150},

    {"height": 300, "width": 250},

    {"height": 400, "width": 350}

  ]

Supoose we now need to update the first width of the first diemension in the object. First check the current value with below statement.

dimensions[0].width

This will return 50. Since, the width of first diemnsion index is 50.  

Now update the value of width from index 0.

dimensions[0].width = '90'

For example, we have update the value with 90. Now, when you access the width value from index 0, it will return 90. Try accessing the first object from dimentions array object.

dimensions[0]

This will retun first object which is now updated width value. 

{

    "height": 100,

    "width": "90"

}

 

Below is the screenshot of the updating JSON object property use-case.

Update JSON object using JS
Update JSON object using JS


Asset Compute Service | Adobe Experience Cloud

The Asset Compute Service is a helpful tool in Adobe Experience Cloud that can handle digital files like images, videos, and documents. It can change these files into different versions, like making a small picture, creating rendition, pulling out text, or creating archives. Developers can also add their own custom tools to do specific jobs, like making special versions of files. These tools are made using Adobe Developer App Builder and run on Adobe I/O Runtime, which means they don't need their own servers to work.


Asset compute service architecture diagram
Asset compute architecture diagram | Adobe Experience League


Creating a custom worker

The Asset Compute worker is to create a more exciting version of the asset. This will show how powerful Asset Compute workers can be. Visit this page for develop a custom worker. https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/asset-compute/develop/worker.html?lang=en

Supported file formats

Almost all images and 3D image formats are supported in Asset compute. like JPEG, PNG, BMP etc. for more about the supported format please see the official page.   

The server's host key is not cached. You have no guarantee that the server is the computer you think it is.

If you are using ssh to login or recently updated your ssh keys but not updated in your application. Here we will see how we could fix this error in Sourcetree.

Steps to follow in Sourcetree

  1. Go to source tree
  2. Tool >> Options
  3. Update the SSH client and SSH Key
    How to update ssh keys in Sourcetree


  4. Save and retry your action

By updating known_host file

  1. We can find the known_host file at this location.
    • On Windows: The SSH known_hosts file is usually located at C:\Users\<Username>\.ssh\known_hosts.
    • On macOS/Linux: The file is typically located at ~/.ssh/known_hosts
  2. Open the file in edit mode and find the host or IP that you are trying to connect with.
  3. Copy the host key presented by the server and paste it into the known_hosts file, replacing the existing entry or adding a new one if it's not already there.

Contemporary Indian Metaphysics

Contemporary Indian metaphysics encompasses a diverse range of philosophical perspectives and schools of thought that have emerged in India in recent times. Here are some prominent contemporary Indian metaphysicists and their respective philosophical approaches: 

  1. Rabindranath Tagore: A poet, philosopher, and Nobel laureate, Tagore's philosophy emphasized the interconnectedness of all existence and the harmony between humanity and nature. He articulated the concept of "Vishva Dharma" (the universal religion) and advocated for cultural exchange and understanding.

  2. Mahatma Gandhi: While primarily known as a political and social leader, Gandhi's philosophy of Ahimsa (non-violence), Satyagraha (truth-force), and Sarvodaya (welfare of all) had profound metaphysical implications. He emphasized the unity of means and ends, the importance of selfless action, and the pursuit of truth and righteousness.

  3. Muhammad Iqbal: A philosopher, poet, and politician, Iqbal is known for his work in revitalizing Islamic thought and advocating for the revival of Muslim societies. He proposed the concept of "Khudi" (selfhood) and emphasized the importance of self-realization and spiritual awakening.

  4. Sarvepalli Radhakrishnan: A philosopher, statesman, and the second President of India, Radhakrishnan contributed to the interpretation and popularization of Indian philosophy in the West. He synthesized Eastern and Western thought and emphasized the importance of spiritual experience and intuition in understanding reality.
  5. Vijay Bharadwaj: A contemporary philosopher who has contributed to the study of Indian philosophy and its relevance in the modern world, Bharadwaj explores topics such as consciousness, ethics, and the nature of reality from a Vedantic perspective.

  6. Ramanuja Devanathan: A contemporary philosopher in the Advaita Vedanta tradition, Devanathan explores the concept of consciousness, self-awareness, and the relationship between the individual self (Atman) and the universal consciousness (Brahman).

  7. Krishna Chandra Bhattacharya: Known for his work in the Nyaya-Vaisesika tradition, Bhattacharya contributed to the revival of Nyaya philosophy in the 20th century and emphasized the study of logic, epistemology, and ontology.

  8. Sri Aurobindo: A spiritual leader and philosopher, Sri Aurobindo synthesized Eastern and Western thought in his Integral Yoga philosophy. He proposed the concept of the evolution of consciousness and the idea of the supermind as the next stage of human evolution.

  9. Jiddu Krishnamurti: Though not strictly an Indian philosopher, Krishnamurti's teachings on consciousness, meditation, and the nature of the self have had a significant influence in India and worldwide. He emphasized the importance of direct perception and awareness in understanding the nature of reality.

  10. Daya Krishna: A leading figure in contemporary Indian philosophy, Daya Krishna focused on the critique of Western philosophical concepts from an Indian perspective and advocated for a return to the classical Indian philosophical traditions.

  11. Nataraja Guru: A philosopher influenced by Vedanta and Advaita, Nataraja Guru founded the Narayana Gurukula system of education and promoted the integration of spirituality and philosophy in modern life.

  12. Swami Vivekananda: While primarily known as a spiritual leader, Vivekananda's teachings on Vedanta and the philosophy of yoga have had a significant impact on contemporary Indian metaphysics. He emphasized the harmony of religions and the unity of all existence.

  13. Raimon Panikkar: A Spanish-born philosopher and theologian of Indian and Spanish descent, Panikkar's work explored the intersection of Christianity, Hinduism, and Buddhism. He proposed a "cosmotheandric" perspective, which sees God, the cosmos, and humanity as interconnected and mutually influencing each other.


These additional figures have made significant contributions to contemporary Indian metaphysics, exploring a wide range of philosophical themes including spirituality, interconnectedness, non-violence, and the synthesis of Eastern and Western thought. Their ideas continue to inspire and influence philosophical discourse in India and beyond. These are just a few examples of contemporary Indian metaphysicists and their philosophical contributions. The field of contemporary Indian metaphysics is diverse and continues to evolve, with scholars and thinkers exploring a wide range of topics and perspectives within the rich philosophical heritage of India.

Aristotle - Unraveling the Genius Behind Western Thought

Aristotle Altemps Inv8575

Aristotle (384-322), the ancient Greek philosopher and polymath, was born in 384 BCE in Stagira, a Greek colony in Thrace. His father, Nicomachus, was the personal physician to King Amyntas III of Macedon. At the age of seventeen, Aristotle moved to Athens to study at Plato's Academy, where he became a student of Plato for nearly twenty years.


After Plato's death in 347 BCE, Aristotle left Athens and traveled extensively, conducting scientific research and studying natural phenomena. In 343 BCE, he was invited by King Philip II of Macedon to become the tutor to his son, Alexander the Great. Aristotle taught Alexander for several years before returning to Athens in 335 BCE, where he established his own school, the Lyceum, and began teaching and writing extensively.


Aristotle's influence extended across a wide range of disciplines, including philosophy, ethics, politics, metaphysics, biology, physics, astronomy, and logic. His contributions to these fields have had a profound and enduring impact on Western thought and scholarship.


Major Works of Aristotle

1. Nicomachean Ethics: One of Aristotle's most famous works, the "Nicomachean Ethics," explores the nature of happiness, virtue, and moral character. In this work, Aristotle discusses the concept of eudaimonia (human flourishing) and the role of virtue in achieving a good life.


2. Politics: In Politics, Aristotle examines the nature of the state and the principles of governance. He discusses various forms of government, including democracy, oligarchy, and monarchy, and evaluates their strengths and weaknesses.


3. Metaphysics: Aristotle's "Metaphysics" explores the fundamental principles and concepts that underlie reality. He discusses topics such as substance, causality, potentiality and actuality, and the nature of being.


4. Physics: In his work "Physics," Aristotle investigates the natural world and the principles of motion, change, and causality. He develops his theories on the four causes (material, formal, efficient, and final) and lays the groundwork for his scientific method.


5. De Anima (On the Soul): Aristotle's "De Anima" examines the nature of the soul and its relationship to the body. He discusses various aspects of the soul, including perception, thought, and emotion, and explores the concept of the intellect.


6. Poetics: In "Poetics," Aristotle analyzes the nature of poetry and drama, including the structure of tragedy and the role of plot, character, and spectacle in literary works.


7. Organon (The Logical Works): Aristotle's "Organon" is a collection of works on logic, including "Categories," "Prior Analytics," "Posterior Analytics," "Topics," and "On Interpretation." These works form the basis of Aristotelian logic and are foundational texts in the history of philosophy.


Aristotle's works have had a profound and lasting impact on Western thought, influencing thinkers across centuries and disciplines. His systematic approach to philosophy and his emphasis on empirical observation and logical analysis laid the groundwork for much of modern science and philosophy. Aristotle's legacy continues to be studied and revered by scholars and philosophers around the world.

General view and impression of death by philosophers

Death is the reality of life and every living thing have to taste the death. People can deny the God and no one can deny the death. In this post we will study different views of philosophers on death. 

  1. The Epicureans: The followers of the ancient Greek philosopher Epicurus. Death is nothing to Epicureans. According to them, we fear death because of the belief that the death is painful and that the soul may have to suffer in an afterlife, but both beliefs are not true. Death is not painful it is a painless loss of the consciousness it is just like the falling asleep and therefore nothing to be feared. 

  2. The Stoics: Seneca(4BCE-65CE), a Roman follower of Stoicism said that there is no need to fear death. To overcome this fear, we should think of it in a proper manner. Death reminds us that we are part of the nature and we must accept this truth.

     
  3. Prophet Muhammad: Islamic prophet Muhammad (peace be upon him)(570-632 CE) taught that death is a natural part of life, urging believers to prepare for the afterlife through righteous deeds and adherence to moral principles. He emphasized hope in God's mercy, encouraging remembrance of death as a means of spiritual reflection and motivation for leading a virtuous life. 

  4. Spinoza: A Dutch philosopher Benedict de Spinoza(1632-1677), wrote, a fearful an thinks of nothing less than of death, and his wisdom is not a meditation upon death but upon life.

What is processing profile in AEM

AEM cloud service supports processing profiles feature, using this we can create custom renditions for assets. This rendition could be the predefined as well as renditions craeted or generated by third party application or system.

To integrate the third party generated rendition we need to integrate with the AEM asset compute feature that is avaialble in Adobe I/O runtime and easily connect with AEM a a cloud serivce. 

Note: Processing profile option is not avaiable in local AEM cloud service SDK.

References:

  • https://experienceleague.adobe.com/docs/experience-manager-learn/assets/configuring/processing-profiles.html 
  • https://github.com/adobe/asset-compute-sdk
  • https://experienceleague.adobe.com/docs/asset-compute/using/home.html


let, var and const variables in JavaScript or ReactJS

In ReactJS, the differences between let, var, and const variables are the same as in JavaScript. Here's a brief explanation of each:  

   

1. let: The let keyword declares a block-scoped variable that can be reassigned. It allows you to define variables that are limited in scope to the block, statement, or expression in which they are used. For example, you can use let variables inside loops or conditional statements.  

   Examples:


let lx;

jsvariables(lx)

function jsvariables(lx) {
    
    console.log(lx)
}

console.log(lx);


//Output

undefined
undefined


let lx = 5;

jsvariables(lx)

function jsvariables(lx) {
    lx = 7;
    console.log(lx)
}

console.log(lx);


//Output

7
5


let lx = 5;

jsvariables(lx)

function jsvariables(lx) {
    let lx = 7;
    console.log(lx)
}

console.log(lx);


//Output

let lx = 7;
        ^

SyntaxError: Identifier 'lx' has already been declared


jsvariables()

function jsvariables() {
    let lx = 7;
    console.log(lx)
}

console.log(lx);


//Output

7

console.log(lx);
            ^

ReferenceError: lx is not defined

2. var: The var keyword declares a function-scoped variable that can be reassigned. It is the older way of declaring variables in JavaScript before the introduction of let and const. Unlike let, var declarations are not limited to the block scope but rather to the function scope. This means that var variables are accessible anywhere within the function in which they are declared.  

   Examples:

var vx =12;

jsvariables(vx)

function jsvariables(vx) {
    console.log(vx)
}

console.log(vx);


//Output

12
12


var vx = 12;

jsvariables(vx)

function jsvariables(vx) {
    var vx = 13;
    console.log(vx)
}

console.log(vx);


//Output

13
12


var vx = 12;

jsvariables(vx)

function jsvariables(vx) {
    vx = 13;
    console.log(vx)
}

console.log(vx);


//Output

13
12


var vx;

jsvariables(vx)

function jsvariables(vx) {
    var vy = 12;
    console.log(vy)
}

console.log(vx);


//Output

12
undefined


var vx;

jsvariables(vx)

function jsvariables(vx) {
    vx = 12;
    console.log(vx)
}

console.log(vx);


//Output

12
undefined


var vx;

jsvariables(vx)

function jsvariables(vx) {
    vx = 12;
    console.log(vx)
}
vx = 16;
console.log(vx);


//Output

12
16

3. const: The const keyword declares a block-scoped variable that cannot be reassigned. It is used to declare constants, which are variables that cannot be changed after they are declared. const variables must be initialized with a value at the time of declaration, and you cannot reassign them later.  

   Examples:

const cx = 12;

jsvariables(cx)

function jsvariables(cx) {
    console.log(cx)
}

console.log(cx);


//Output

12
12

const cx;

jsvariables(cx)

function jsvariables(cx) {
    console.log(cx)
}

console.log(cx);


//Output

const cx;
      ^^

SyntaxError: Missing initializer in const declaration


const cx;
cx = 12;
jsvariables(cx)

function jsvariables(cx) {
    
    console.log(cx)
}

console.log(cx);


//Output

const cx;
      ^^

SyntaxError: Missing initializer in const declaration

In general, it is recommended to use const for variables that will not be reassigned, let for variables that will be reassigned within their scope, and avoid using var as it has some potential issues related to scoping and hoisting. However, the choice between let and const ultimately depends on your specific use case and requirements.

TypeError: body used already for url

Error: TypeError: body used already for endpoint url

The reason of this issue is, uses of statement response (e.g. reposne.json()) more than once. If we already use response body statment for reading the response data and try to use again response.json() statement anywhere else or in then function.

Solution: Create a variable and assign the fetch response into that variable as a value to further use. This way we need to call the response.json() statment only once. 

Human Mind is Tabula Rasa | Aristotle

The Human Mind is Tabula Rasa.


The Human Mind is Tabula Rasa. - Aristotle 

nodejs kind is no longer supported

The 'nodejs:12' kind is no longer supported. You » may read, delete, and invoke but not create or update actions with this kind. Please update to a supported kind.

Resolution

Update the menifest file with the correct node version.

Term 'gpg' is not recognized

If someone trying to generate gpg keys and getting below error, then, user may need to try using the Unix or Git CLI. This error usually came when user try executing gpg commands on windows terminal and command prompt.

PS C:\Users\jorvee> gpg --generate-key
gpg : The term 'gpg' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ gpg --generate-key
+ ~~~
    + CategoryInfo          : ObjectNotFound: (gpg:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Modern world allowing women to be subjected | Rashid Jorvee

Modern world allowing women to be subjected to rape through the eyes, mind, hands and words of men.


Modern world allowing women to be subjected to rape through the eyes, mind, hands and words of men.

-- Rashid Jorvee

No Sound when external monitor connected with HDMI

Open the sound settings, here under playback tab, these two sound options Speaker and connected Monitor. Speaker that is Laptop speaker and other is monitor. 

Right click on the Speakers and set as default.


How to add custom clientLibs on component dialog in AEM

Adding custom clientLibs on component dialog in AEM.

  1. Add a categories property in clientLibs node. e.g. categories=wknd.hero
    AEM Dialog ClientLibs | AEM ClientLibs

  2. Add property extraClientlibs = wknd.hero on dialog node.
    AEM Dialog ClientLibs | AEM ClientLibs


  3. You have done with the adding the custom clientlibs to a component dialog in AEM.

A cute baby cat playing and mess with color, mud and water | Cat Story

Once upon a time in a cozy little garden, there lived a tiny kitten named Whiskers. Whiskers was a playful and curious little feline who loved exploring every nook and cranny of the garden.

One sunny afternoon, Whiskers stumbled upon a pile of colorful paints left out by the gardeners. Intrigued by the vibrant hues, Whiskers couldn't resist dipping her tiny paws into the pots of paint. With mischievous delight, she began to paint colorful paw prints all over the garden path.

Cute little cat playing with colors
This image was generated using Generative AI Adobe Firefly


Next, Whiskers discovered a muddy puddle near the edge of the garden. Unable to resist the temptation, she leaped into the puddle with a playful splash. Before long, she was rolling around in the mud, covering herself from head to toe in brown gooey goodness.

Cute little cat playing with mud
This image was generated using Generative AI Adobe Firefly


Not content with just paint and mud, Whiskers spotted a shimmering pond nearby. With a mischievous twinkle in her eye, she bounded towards the water, ready to make a splash. Jumping in with all her might, Whiskers sent water droplets flying in every direction as she frolicked in the cool, refreshing pond.

By the time Whiskers was done, she was a sight to behold – covered in colorful paint, muddy paw prints, and dripping wet from her aquatic adventure. But despite her messy appearance, Whiskers was the picture of happiness, her tiny tail wagging with joy as she basked in the glow of her playful escapade.

Cute little cat playing with water
This image was generated using Generative AI Adobe Firefly


As the sun began to set and the day drew to a close, Whiskers returned home to her cozy corner of the garden, leaving behind a trail of colorful paw prints and muddy footprints. And though she may have made a mess of things, Whiskers wouldn't have it any other way – for to her, every day was an adventure waiting to be explored, every moment a chance to play and make memories that would last a lifetime.


Birds playing with water and colors

Create your imagination with text using generative AI.












The Journey of Supreme Court of India | A Brief History and Timeline of the Establishment of the Supreme Court of India

Introduction

The establishment of the Supreme Court of India marks a significant milestone in the country's legal and judicial history. With a rich heritage and a journey spanning over centuries, the Supreme Court stands as the guardian of justice and the custodian of the Constitution. Let's delve into the fascinating history and timeline of its establishment.


Supreme court of India
  1. Ancient Roots:

       - Explore the ancient roots of judicial systems in India, dating back to the Vedic period.

       - Discuss the role of ancient texts such as Nyay Visesika and Arthashastra in shaping early legal principles.

  2. Colonial Era:

       - Trace the evolution of the Indian legal system during the colonial period under British rule.

       - Discuss the establishment of the Supreme Courts in Calcutta, Madras, and Bombay by the Regulating Act of 1773.

  3. Key Milestones and Landmarks:

       - Highlight key judgments and landmark cases that have shaped the jurisprudence of the Supreme Court.

       - Discuss the role of the Supreme Court in upholding the principles of justice, liberty, and equality.

  4. Establishment of the Federal Court:

       - Highlight the significance of the Government of India Act, 1935, which provided for the establishment of the Federal Court of India.

       - Discuss the jurisdiction and powers of the Federal Court in adjudicating constitutional matters.

  5. Recent Developments and Challenges:

       - Explore recent developments in the functioning of the Supreme Court, including the adoption of technology and e-filing systems.

       - Discuss contemporary challenges facing the judiciary and the role of the Supreme Court in addressing them.

  6. Birth of the Supreme Court of India:

       - Explore the historical context leading to the adoption of the Constitution of India in 1950.

       - Discuss the provisions related to the establishment of the Supreme Court under Part V of the Constitution.

  7. Evolution and Expansion:

       - Trace the evolution of the Supreme Court over the decades, including the expansion of its jurisdiction and powers.

       - Discuss the establishment of High Courts and the appellate jurisdiction of the Supreme Court.


75 years of Supreme Court

In year 2024 Supreme court of India has completed its 75 years of service to deliver the justice to the civilians and nation.

Conclusion

As we reflect on the journey of the Supreme Court of India, we are reminded of its pivotal role in upholding the rule of law and protecting the rights of citizens. From its ancient roots to its modern-day evolution, the Supreme Court continues to be a beacon of justice and a symbol of hope for the nation.

Supreme Court of India


How to use tail with cat(concatenate) in unix/linux

While reading a huge content file its difficult to find the thing in a file or load/show only the specific line of content on the screen. Here we will see how we could use trail with cat command. 


View last 10 lines of the file:

cat filename -n | tail -n 10

View line 31 to 50 of the file.

cat filename -n | head -n 50 | tail -n 20

Login into WinScp with sudo access

Open a new session. Put the IP and user ID.

Click on the Advance button below password field.

Advance button in WinScp to login as sudo su user


A new wizard will popup. Go to Environment >> Shell >> Change the shell field value to "sudo su -" by clicking on dropdown. Click on Ok to save.

WinScp Shell set to sudo su

This will close the current wizard and land to back on previous login screen. From here simply click on Login and put your password to login. 

Now you have successfully login to server with sudo access.