Thursday, July 6, 2023

Did you know there’s a planet largely made of diamonds?

  The Diamond planet

 

Did you know there’s a planet largely made of diamonds?

An exoplanet named 55 CANCRI E, the constellation cancer is confirmed to be largely made of diamonds. It is one of the largest planets in the universe and has a mass eight times that of the Earth.

The temperature of the surface of CANCRI is estimated to range between 2,150 and 4,400 degrees Celsius. The main components of its dense atmosphere are hydrogen and helium.  

55 CANCRI is largely made up of carbon and has a density twice of the earth with high pressure.

The CANCRI  system has 5 planets, and may possibly have more planets.  55 CANCRI E or planet  Janssen orbits a star known as Copernicus only 41 light years away from us.  It was discovered in 2004 around a nearby star in our galaxy. This alien star is also known as a “super–Earth “.

It’s a G-type star just like the sun. Its mass is  0.08 Earths.  It takes 0.7 days to complete its one orbit. The radius of CANCRI  is 1.875 xEARTH. The mass of CANCRI E is 7.99 Earth. It has a surface temperature of nearly 4,900 degrees Fahrenheit. 

Because of its high radius, it is believed that it is must close to its parent plane. researchers observed this planet with the Hubble telescope, and the result was published in 2013. According to some theories its surface includes volcanoes or running lava. 

 



Cancrie is made up of carbon, silicon carbide, and iron. Carbon is present in excess more than on Earth. Some researchers say it is possible it has an atmosphere made up of oxygen or nitrogen, or a very thin atmosphere of mineral vapor.

 


Some theories say that if cancer e is fully locked, the lit-facing surface may be permanently molted or in case it is experiencing day and night then hopefully due to high temperature in the day the surface must be heating up during and get solid during night cause of cool temperature.

Tuesday, July 4, 2023

Unlocking the Power of the Universe: The Ultimate Guide to Dyson Spheres


Unlocking the Power of the Universe: The Ultimate Guide to Dyson Spheres

 

Have you ever heard about Dyson  Sphere ???

No, yes ??

In this scientific era every day new discoveries happening  .people are so interested in having deep knowledge about things around them. One famous and interesting topic of discussion is space science.

So what is a Dyson Sphere  ??

 It is a   hypothetical superstar built near or around the Sun that would be able to capture the sun’s energy and divert it back to Earth. Which is made up of more than a single structure, a dense system of satellites dedicated to the conversion of solar energy, connected to each other.  This would harvest so much energy that human beings could manipulate and control all natural forces. The idea of the Dyson sphere was first explored by physicist and astronomer Freeman J. Dyson in a 1960 study called “Search for stellar sources of infrared radiation”.

Theoretically, if we built a Dyson sphere, we’d have access to a colossal 400 septillion watts of solar energy which is a trillion times more power our entire civilization consumes today. Dyson sphere could produce a big amount of power which is 3,827.10*26 j per second.

 

So now the question is will the Dyson sphere ever be possible in real life  ???

So the answer is no for right now Dyson sphere is only theoretically possible, it requires a huge amount of metal and circuits building this much megastructure around the sun is far beyond humanity’s engineering capacity.

 

To create a Dyson sphere everything we need for the Dyson sphere can be launched from mercury. it is the closest planet to the sun, has low gravity, no atmosphere, and is very rich in metals like iron. For this purpose we need so big rockets .to power this giant rocket we need a Dyson Swarm, a quintillion mirror –satellites that collect the Sun’s energy and reflect it back, focusing it like a magnifying glass. Also, we need tons of billion of metal that doesn’t melt near the sun. This heats up small regions of its surface, lifting billion tons of mass of the sun.




 The Dyson sphere can only build by type 2 civilizations.

What are the types of civilization?

Kardashev scale gave the concept of different types of civilization

Type 1  civilization:-capable of controlling the entire energy of its planet.

Type 2 civilization:-capable of controlling the entire energy of its host star and travels through the solar system.

Type 3 civilization:- capable of controlling the energy at the scale of its entire host galaxy.

 Type 4 civilization:-Capable of controlling the energy at the scale of its entire host universe.

Type 5 civilization:- Capable of using energy at the scale of the multiverse (travel to parallel universes and simulate universes)

Type 6. Civilization that exists beyond time and space, or in higher dimensions. (Creates and destroys multiverses)

 So we can say it is not possible to create a big mega Dyson sphere for right now.

Debunking the Myth: Does Water Really Have a Memory?

 Debunking the Myth: The Science Behind 'Water Has a Memory

                                              

Sounds crazy right?  Actually, that’s true but not many peoples are aware of it.

So welcome to the world of water. we are surrounded by water around 70 % of the earth consists of water. we use water in our daily life to calm our thrust. we drink water, and we use water for cleaning our homes, clothes, and dishes. we use water to grow grains foods vegetables, and we bathe in water. The human body contains approx 60% water. we drink it we use it, we waste it but we never think about it. we do not realize that water is so much more than just water.

 A groundbreaking discovery has been made with the most basic resources.     some scientists claim that water molecules can retain memory it is similar to how memory work in the brain.

during the 1990’sa Japanese Dr. Masaru  Emoto performed a series of experiments to observe the effect of prayers and music, words, and environment on the crystalline structure of water.

 What is water memory ??

Water has the ability to retain memory –called water memory. Emoto through his work has proved that water has a memory he just simply performs a number of words with different variables and freezes so that water molecules form crystalline structures.

As we know human body contains 60% water. This water carries our energy, some unexpressed feelings, and negative and positive emotions stored in the different parts of our body most powerful emotions such as anger, fear are stored in our back and most negative emotions are stored along with spine Most of our powerful emotions such as anger and fear are stored in our back. So we can say if we are in a bad mood we carry bad emotions at this time if we are holding a glass in a container it also carries bad energy .and if we are in a good mood the water also carries good energy. Water is the source of life still we are not aware of it.

Dr. Emoto said water reacts according to the word we use and we carry good emotions water crystals create either beautiful or harmonious shapes or ugly or irregular ones.

 For a long period of time, all religious places like temples church devotees are blessed with a little water to drink and sprinkle on them. the water in religious places is programmed with positive thoughts and blessings.

We can use water for affirmation of love success, and relationships. 

Some of the photos capture water crystalline structure using different words

 




Always remember Our thoughts and emotions can change the molecular structure of water. our bodies are 70% water. "By holding the intentions of peace towards the water by thinking, speaking and acting the intentions of peace towards the water, water can and will bring peace to our bodies and to the world "

We should pay respect to water, feel love and gratitude, and receive vibrations with a positive attitude. Then water changes, and you change and I change because both you and I are the water.
          

So Stay Happy, and Drink a Lot of Water.

Sunday, June 19, 2022

How to use React createRef in material Table

React provides a feature known just as refs that object over there allow for dom access from components. The reader attaches a ref to an element in an object belonging to you, that object being your application to provide access to the element’s dom from anywhere within an object belonging to you, that object being your component.

Refs currently are able to also exists used to provide direct access to react elements in addition to not just dom nodes. Here now lives whatever the react documentation says concerning refs:

create ref



Creating refs in React
React provides three major ways of creating refs. Here currently exists a list of the different methods starting from the oldest of them:
  1. String refs (legacy method)
  2. Callback refs
  3. createRef Hook
  4. The useRef Hook 

String refs in React
The legacy way of creating refs in a react application currently exists using string refs. This object over here currently exists as the oldest method in addition to currently existing considered legacy or deprecated owing to the fact that it will exist removed in future releases of react.

String refs currently are simply created by adding a ref prop to the desired element, passing a string name for the ref just as its value. Here currently exists a simple example:

HTML:
 <input type="text" ref="inputField" />

 

JS:
 const value = this.refs.inputField.value;

 

we can update this value using Java Script:
this.refs.inputField.value =
      isUpper
        ? value.toLowerCase()
        : value.toUpperCase();

Using callback refs in React

Callback refs use a callback function for creating refs instead of passing the name of the ref just as a string. If the reader currently are using versions of react earlier than version 16.3, then this object over here should exist an object belonging to you, that object being your preferred method of creating refs.

The callback function receives the React component instance or HTML DOM element as its argument, which can be stored and accessed elsewhere. Using a callback ref, our previous code snippet will become the following.

HTML:
 <input type="text" ref={elem => this.inputField = elem} />

JS:
 const value = this.refs.inputField.value;
we can update this value using Java Script:
this.refs.inputField.value =
      isUpper
        ? value.toLowerCase()

Here we have made two major changes. First we defined the ref using a callback function and storing it in this.inputField as follows:

<input type="text" ref={elem => this.inputField = elem} />

Then, in the event handler, we access the ref using this.inputField instead of this.refs.inputField.

Callback refs use a callback function for creating refs instead of passing the name of the ref as a string. If you are using versions of React earlier than version 16.3, then this should be your preferred method of creating refs.

Using the React useRef Hook

With its release in react v16, the hooks api has become the de facto means of abstracting in addition to reusing code in react applications. One such hook currently exists useref, which allows us to create in addition to use refs in functional components.

Note that object over there even with the useref hook the reader still, by default, cannot use the ref attribute on functional components owing to the fact that all of us cannot create instances of functions. All of us will discuss how to get around this object over here with ref forwarding later on in this object over here article.

Note that even with the useRef Hook you still, by default, cannot use the ref attribute on functional components because we cannot create instances of functions. We will discuss how to get around this with ref forwarding later on in this article.

Using React.createRef

Starting from react 16.3, the react api included a createref() method that object over there currently am able to exists used for creating refs in much the same way just as all of us did using the callback function. The reader simply create a ref by calling react.createref() in addition to assign the resulting ref to an element.

Now we discuss Topic createRef with meterial Table createRef

1. How to import:

import { createRef, useEffect, useState } from "react"; //import
...
const tableRef = createRef();  //call and store in a variable

How to implement


2. How to attach with meterial table:

 <MaterialTable
        ref={ref}
        icons={tableIcons}
        tableRef={ref}
        title={props.title}
        columns={props.columns}
        data={props.data}
        options={props.options}
        onSearchChange={(ele) => {
          console.log("In table : ", ele);
        }}
      />

Material table


3. How to get value from ref object:

let localData = type === "all" ? completeData : ref.current.state.data;
 
4. How to implement global search in table:

 const handleUpdate = (type) => {
    console.log(ref.current.state.data);
    console.log(type, { completeData });
    let localData = type === "all" ? completeData : ref.current.state.data;
    setTableData(
      localData.filter((ele) => {
        return (
          `${ele.id}`.toLowerCase().includes(value.toLowerCase()) ||
          `${ele.first_name}`.toLowerCase().includes(value.toLowerCase()) ||
          `${ele.gender}`.toLowerCase().includes(value.toLowerCase()) ||
          `${ele.last_name}`.toLowerCase().includes(value.toLowerCase()) ||
          `${ele.shares}`.toLowerCase().includes(value.toLowerCase()) ||
          `${ele.ip_address}`.toLowerCase().includes(value.toLowerCase())
        );
      })
    );
    setAnchorEl(null);
    setValue("");
  };

5. How to download CSV file of table data:

 const handleDownload = (type) => {
    let localData = type === "all" ? completeData : ref.current.state.data;
    console.log(localData);
    let newData = localData.map((ele) => {
      return `${ele.id},${ele.first_name},${ele.last_name},${ele.email},${ele.gender},
${ele.ip_address},${ele.shares}`;
    });
    let finalData = [
      `"Member ID","First Name","Last Name","Member Email","Member Gender",
"Member ip_address","Shares"`,
      ...newData,
    ].join("\n");
    let hiddenElement = document.createElement("a");
    hiddenElement.href =
      "data:text/csv;charset=utf-8," + encodeURIComponent(finalData);
    hiddenElement.target = "_blank";
    hiddenElement.download = `ss_${type}_data.csv`;
    hiddenElement.click();
}; 



Tuesday, June 1, 2021

leetcode Max Area of Island Solution (Max Area of Island) (leetcode june 2021 challenge)

Max Area of Island



You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.

The area of an island is the number of cells with a value 1 in the island.

Return the maximum area of an island in grid. If there is no island, return 0.

 

Example 1:





 

Example 1:

Input: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,1,1,0,1,0,0,0,0,0,0,0,0],[0,1,0,0,1,1,0,0,1,0,1,0,0],[0,1,0,0,1,1,0,0,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,0,0,1,1,0,0,0,0]]

Output: 6

Explanation: The answer is not 11, because the island must be connected 4-directionally.

 

Example 2:

Input: grid = [[0,1,1,1,0,0,0,0]]

Output: 3

Constraints:

·         m == grid.length

·         n == grid[i].length

·         1 <= m, n <= 50

·         grid[i][j] is either 0 or 1.

 

Solution 1:

public class maxAreaOfIsland {

    public static int length(int[][] gridint iint j) {

        if (i >= grid.length || j >= grid[0].length || i < 0 || j < 0 || grid[i][j] != 1)
            return 0;
        int ans = 0;
        grid[i][j] = 2;
        if (j + 1 < grid[0].length && grid[i][j + 1] == 1)
            ans = ans + 1 + length(gridij + 1);
        if (i + 1 < grid.length && grid[i + 1][j] == 1)
            ans = ans + 1 + length(gridi + 1j);
        if (j - 1 >= 0 && grid[i][j - 1] == 1)
            ans = ans + 1 + length(gridij - 1);
        if (i - 1 >= 0 && grid[i - 1][j] == 1)
            ans = ans + 1 + length(gridi - 1j);
        return ans;
    }

    public static int Solution(int[][] grid) {
        int ans = 0;
        for (int i = 0i < grid.lengthi++) {
            for (int j = 0j < grid[0].lengthj++) {
                if (grid[i][j] == 1)
                    ans = Math.max(anslength(gridij) + 1);
            }
        }

        return ans;
    }


Monday, May 31, 2021

codeforces 45A Solution A. Codecraft lll (codeforces 45A) (rank 900*)

 45A. Codecraft lll


Problem Link: https://codeforces.com/problemset/problem/45/A


Solution 1:


import java.util.Scanner;

public class A45 {

    public static Scanner scn = new Scanner(System.in);

    public static String[] str = { "January""February""March""April""May""June""July""August",
            "September""October""November""December" };

    public static int nextIdx(int currIdxint change) {
        return (currIdx + change) % 12;
    }

    public static int currIdx(String myStr) {
        for (int i = 0i < str.lengthi++) {
            if (myStr.equals(str[i]))
                return i;
        }
        return -1;
    }

    public static void main(String[] argv) {

        String str2 = scn.next();
        int change = scn.nextInt();
        int idx = currIdx(str2);
        System.out.println(str[nextIdx(idxchange)]);
    }
}

Sunday, May 30, 2021

codeforces 282A Solution A. Bit++ (codeforces 282A) (rank 800*)

 282A. Bit++


Problem Link: https://codeforces.com/problemset/problem/282/A


Solution 1:

import java.util.*;

public class A282 {
    public static Scanner scn = new Scanner(System.in);

    public static int finalAns(int n){
        String str = "";
        int ans = 0;
        for(int i=0;i<n;i++){
            str=scn.next();

            if(str.charAt(0)=='+' || str.charAt(2)=='+'ans++;
            else ans--;
        }

        return ans;
    }

    public static void main(String[] argv){
        int n = scn.nextInt();
        System.out.println(finalAns(n));
    }
}

Climate Crisis and Innovation: Navigating Earth's Future

Climate Change: Recent Events and Technological Solutions 1. The Escalating Climate Crisis The climate crisis has intensified in recent year...