Intersection of 3 circles with lat long center and meter radius

I have a question related to the intersection of circle.
I’ve spent some time on Google already but none of the solution seems to work for now.

I need to get the intersection of three circle. Each of them has a center given in latitude and longitude, and their radius in Meter.

The thing is for now every conversion I’ve done were not working.

Does anyone have an idea what should I do ?

Integración de avatar realista a mi app creada en android studio [closed]

Tienes idea de cómo fue desarrollado esa animación y aparentar que deadpool pudo manipular la tienes, ejemplos más detallado, a la hora de estar en la tienda de fortnite aparece deadpool saludando en una esquina y aparenta tocar la pantalla y desaparece luego sale en en la tienda y la empuja, como si la vieja…. Esa clase de animación la puedo realizar en mi app, y como, tengo una app simple crea que solo tiene un inicio de usuario, como puedo crear una animación así y integrarla a mi app para que haga esa clase de movimientos y no solo eso manipule mi entorno, tengo ya ideas en la mente pero no tan detalladas del como lograrlo,

Quiero que mi avatar creador con movimiento ya definido en unity o blender salte, a hora quiero que esa animación pueda importalos a mi app de android studio, pero quiero que a la hora de saltar golpeó con un botón y el botón se mueva.. Se qke el avatar no vera el botón ni nada pero ese movimiento del botón será una funcionalidad aparte, en android studio..

Slide is skiping in swiper with loop: true or without it

I don’t understand what’s wrong here.
but when I want to make the next slide active, this slide is skipped
loop: true is also not working correctly
Also, I want to add the ability to click on a slide and make it active

new Swiper(".mySwiperPhotos", {
    grabCursor: true,

    mousewheel: true,
    keyboard: true,

    centeredSlides: true,
    slidesPerView: 'auto',
    slidesPerGroup: 1,
    spaceBetween: 16,
    initialSlide: 1,

    loop: true,

    breakpoints: {
    600: {
        slidesPerView: 2,
        slidesPerGroup: 2,
        spaceBetween: 37,
    },
    },
});

I tried to do this, but it didn’t work out

let mySwiperPhotos = new Swiper(".mySwiperPhotos", {
    grabCursor: true,
    mousewheel: true,
    keyboard: true,
    centeredSlides: true,
    slidesPerView: 'auto',
    slidesPerGroup: 1,
    spaceBetween: 16,
    initialSlide: 1,
    loop: true,
    loopAdditionalSlides: 1,

    breakpoints: {
      600: {
        slidesPerView: 2,
        slidesPerGroup: 2,
        spaceBetween: 37,
      },
    },
  });

mySwiperPhotos.on('click', function() {
    var activeSlideIndex = mySwiperPhotos.clickedIndex;
    if (activeSlideIndex !== mySwiperPhotos.activeIndex) {
        mySwiperPhotos.slideToLoop(activeSlideIndex);
    }
});

Why is my model getting stuck at the PPO(‘MultiInputPolicy’) line when testing my javascript version of JumpKing using stable-baselines3 and PyTorch?

In the code below, I am trying to test my model for a javascript version of JumpKing, and its getting stuck on the line model = PPO(“MultiInputPolicy”, env, verbose=1)
basically, when I use the debugger and try to step over that line, I get this in the output, and it just gets stuck:
Using cuda device
Wrapping the env with a Monitor wrapper
Wrapping the env in a DummyVecEnv.

import numpy as np
import os

from stable_baselines3.common.env_checker import check_env
from stable_baselines3 import PPO

import asyncio

from env import JumpKingEnv
from game import Game
import time




models_dir = f"models/{int(time.time())}"
logdir = f"logs/{int(time.time())}"

if not os.path.exists(models_dir):
    os.makedirs(models_dir)
if not os.path.exists(logdir):
    os.makedirs(logdir)

game = Game()
asyncio.get_event_loop().run_until_complete(game.startGame(True))

env = JumpKingEnv(game)
obs = env.reset()

model = PPO("MultiInputPolicy", env, verbose=1)
TIMESTEPS = 20000
model.learn(total_timesteps=TIMESTEPS, reset_num_timesteps=False, tb_log_name="PPO", tensorboardlog = logdir)
print("done learning")
#model.save(f"{models_dir}/{TIMESTEPS*i}")
    #model.save("ppo_jumpking")
time.sleep(3)

for i in range(1000):
    action, _states = model.predict(obs, deterministic=True)
    obs, reward, done, info = env.step(action)
    env.render()
#obs = env.reset()
asyncio.get_event_loop().run_until_complete(game.terminate())

I used some test code earlier, and didn’t have any problem with it:

from stable_baselines3.common.env_checker import check_env
from env import JumpKingEnv
from game import Game
import asyncio

game = Game()
asyncio.get_event_loop().run_until_complete(game.startGame(True))

env = JumpKingEnv(game)
check_env(env)
asyncio.get_event_loop().run_until_complete(game.terminate())

I looked through the constructor for the model, but I couldn’t find any reason why it would get stuck like that.

Azure Data factory Pipeline faliure integration with service now incident

I want to integrate my azure data factory having multiple pipelines if any pipeline fails it should create the service now incident

What I have tried is

  • I created one action group with having a webhook pointed to scripted rest api URL created in service now.

But above way is not working, incident is getting created but I am getting empty json so not having data to use and request.body is empty

Tell me where I am missing or give me rest api Java script code

Discord bot not opening

My discord bot does not open when I press f5 in visual studio code, can someone help me?
When I press f5, the blue bar below turns orange for a few seconds and turns blue again.
My discord.js version is 13.16.0
I’d be glad if anyone could help me out on this subject.

url not being redirected to when starts with www

In my application I’ve got a method for redirecting to a url like so:

openURL() {
  window.open(this.url, '_blank').focus();
}

This will work fine if the URL starts with a http, so for example, if this.url is set to: https://www.example.com/...
this will work fine.

However if it does not have the https:// and just wwww.example.com/....., then what happens is that when it opens the new tab, the url becomes http://localhost:4200/...

I’m just not sure why the www is being replaced with http://localhost:4200/, what could be causing this?

How can I get the time difference in hh:mm:ss format between two Date objects in JavaScript? [duplicate]

I have two date object and am trying to get the time difference in hh:mm:ss format. Everything I have seen trying to look it up only shows getting it in seconds like below. Is it possible to get it in the format that I want?

var test = new Date('2023-05-22 03:08:00')
var test1 = new Date('2023-05-22 01:00:00')

var result = (test.getTime() - test1.getTime()) / 1000

Annyang.js works when run in localhost but unable to access it from the application

I have a very simple speech recognition code. When I run it in https://localhost:8080/demo.html the speech recognition works fine. But when Im trying to access the same in my Tableau extension api, the microphone prompt itself is not showing.

I enabled chrome flags Allow invalid certificates for resources loaded from localhost and Insecure origins treated as secure. Even then its not working from application. Any thing I’m missing ?

<!DOCTYPE html>
<html lang="en">
<head>
<script src="annyang.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
    if (annyang) {
  var commands = {

'Hi': function() { alert('HI'); }
 };

  annyang.addCommands(commands);
  annyang.setLanguage('en');
  annyang.start();
</script>
</body>
</html>

Regards,
Arsha

Use Sinon to stub simple-git

I am struggling to stub methods coming from the simple-git library using Sinon. Here is my attempt:

sandbox.stub(git(), 'push').callsFake(() => Promise.resolve('pushed was called'));

But it got completely ignored. What am I missing here?

How do i convert jpeg photo into svg with two layers? [closed]

How do i convert jpeg photo into svg? I have a jpeg photo of bedroom and i need some parts of bed to change colors,but i dont know how to create custom path.

I tried few svg converters and thats not what i need,it creates to mush pathes. What i expect is bed with two pathes on for pillow and one for blanket,that’s all i need but it is so hard to find any useful information.
!important!
Photo is detailed that’s why generators create to much layers but i need only two.jpeg
I have figma,photoshop and corelDRAW any other vector editors gonna be a big problem for me.

Why am I getting a ‘Failed to load config react-app’ error when using ESLint with Webpack and vanilla JavaScript?

I use Webpack and Eslint in my project without using React just vanilla JS and I keep getting this problem:

ERROR in [eslint] Failed to load config "react-app" to extend from.
Referenced from: C:UsersDownloadspackage.json

my WEBPACK:

const path = require('path');
const HTMLWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const ESLintPlugin = require('eslint-webpack-plugin');

module.exports = {
  mode: 'development',
  context: path.resolve(__dirname, 'src'),
  entry: ['@babel/polyfill', './js/index.js'],
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
  },
  devServer: {
    port: 3000,
  },
  plugins: [
    new HTMLWebpackPlugin({
      template: './index.html',
    }),
    new CleanWebpackPlugin(),
    new ESLintPlugin({
      fix: true,
    }),
  ],
  module: {
    rules: [
      {
        test: /.css$/,
        use: ['style-loader', 'css-loader'],
      },
      {
        test: /.js$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
          },
        },
      },
    ],
  },
};

my ESLINT CONFIG:

{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": ["airbnb-base", "prettier"],
  "plugins": ["prettier"],
  "parserOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module"
  },
  "parser": "@babel/eslint-parser",
  "rules": {
    "prettier/prettier": ["error"]
  }
}

Also I use Prettier:

{
  "singleQuote": true,
  "printWidth": 120,
  "trailingComma": "es5",
  "tabWidth": 2,
  "semi": true
  }

The problem was gone when I deleted eslint-webpack-plugin. But I suppose that I need it bc it helps Eslint to work with Webpack

Please help me! And also I’d be happy if you explained to me what eslint plugins I need with Webpack

Is there a way to merge two cells in column using google appscript in Google Docs?

I was searching for a way to provide merge of two cells in a column. There is a way to merge it in a row with cell object and merge method, something like this:

var cells = [
   [
      'Row 1, Cell 1',
      'Row 1, Cell 2',
   ],
   [
      'Row 2, Cell 1',
      'Row 2, Cell 2'
   ]
];

// Build a table from the array.
var table = body.appendTable(cells);
var row = table.getRow(0);
var cell = row.getCell(1);
cell.merge();

So this is the result of the code above:
enter image description here

However what I want to achieve is this kind of merge:

enter image description here

Is it possible? There is such in functionality in UI, but can’t find it in API.

How to convert two arrays into a key-value pair in ReactJS and show highest running times as percentage?

I have two arrays

const process = [
  "Code",
  "TextInputHost",
  "chrome",
  "MongoDBCompass",
  "ProductivePeak",
  "slack",
  "CalculatorApp",
  "ApplicationFrameHost",
  "PostmanCanary"
];

const runningTimes = [
  "3:30:13.215083",
  "10:02:54.742036",
  "199:05:16.214286",
  "233:50:56.012267",
  "175:53:23.705989",
  "124:36:21.385961",
  "103:10:26.574467",
  "231:39:22.576285",
  "1:32:4.394013"
];

I want to convert it into key-value pair in react js. I need the combinedObject to result as the 5 processes with the highest runningTime to be shown as the first five key value pair of combinedobject and remaining process should be shown in as the others key in the object with the value of all the remaining runningTime. and the resulting combinedobject should have the runningtime in percentage.

something the combinedobject should look like this:-
//here the highest runningTime of the process is MongodbCompass with 233 hours and applicationframeHost has second hightest of 231 hours which needs to be shown like this:-

{
  MongoDBCompass: 20%,
  ApplicationFrameHost: 19%,
  chrome: 15%,
  ProductivePeak: 9%,
  CalculatorApp: 5%,
  others: 32% 
} 

//Here all the remaining runningTimes are added and converted to percentage in the others

I tried a lot but couldn’t find the solution…
The code which I tried is

const calculateProcessPercentages = (processes, runningTimes) => {
   console.log(processes, runningTimes)
    const processData = {};
    let totalRunningTime = 0;

    // Step 1: Populate the object with process names and running times
    for (let i = 0; i < processes.length; i++) {
      const process = processes[i];
      const runningTime = runningTimes[i];

      processData[process] = parseTime(runningTime);
      totalRunningTime += parseTime(runningTime);
    }

    // Step 2: Sort the processes based on running time in descending order
    const sortedProcesses = processes.sort(
      (a, b) => {
          // console.log(processData[a], a, processData[b], b)
        return processData[b] - processData[a]}
    );

    // console.log(sortedProcesses);

    const result = {};

    // Step 3: Calculate percentages for the top 5 processes or applications
    let totalApplications = 0;
    let othersRunningTime = 0;

    for (let i = 0; i < sortedProcesses.length; i++) {
      const process = sortedProcesses[i];
      const runningTime = processData[process];

      if (totalApplications < 5) {
        const percentage = ((runningTime / totalRunningTime) * 100).toFixed(2);
        result[process] = `${percentage}`;
        totalApplications++;
      } else {
        othersRunningTime += runningTime;
      }
    }

    // Step 4: Calculate percentage for the "others" category
    if (othersRunningTime > 0) {
      const othersPercentage = (
        (othersRunningTime / totalRunningTime) *
        100
      ).toFixed(2);
      result["others"] = `${othersPercentage}`;
    }

    return result;
  };

  // Helper function to parse time in HH:MM:SS format and convert it to seconds
  const parseTime = (time) => {
    const [hours, minutes, seconds] = time.split(":");
    return (
      parseInt(hours) * 3600 + parseInt(minutes) * 60 + parseFloat(seconds)
    );
  };

It didn’t help me out….
Can someone help me out to solve this problem here……..
And the another problem with this here is with the sorting which is not working properly.
When I console log the combined object The sorting of the object goes wrong.

Advice on why my HTML file is not showing any visualisation written in JS

Ok, I am a complete noob in HTML and Javascript. I asked a question months ago and got great advice, but somehow my HTML file with JS in it is still not running. I double click on the HTML file but the browser is empty with no visualisations from the JS. I really don’t know what is missing. Any help is appreciated.

I tried everything I knew but the HTML file is not showing the visualisation code written in JS. Please look at the HTML code below and kindly let me know why it is not showing anything in browser:

<!DOCTYPE html> 
<html>
    <head>
        <title>Programming Assignment 1 Visualization</title>
    </head>
    <body>
        <svg width="1000" height="1000"></svg>
            <script src="https://d3js.org/d3.v4.min.js">
            var wealthdataBY = 'year,percentile,avg_welfare,welfare_sharen' +
            '2014,1,2.706183088,4.13E-04n' +
            '2014,2,11.03834646,0.001695224n' +
            '2014,3,15.21296516,0.002312137n' +
            '2014,4,17.78666642,0.00269041n' +
            '2014,5,19.65899193,0.002956128n' +
            '2014,6,21.23338101,0.003339948n' +
            '2014,7,22.71642933,0.003516624n' +
            '2014,8,23.88424149,0.003658528n' +
            '2014,9,24.95633096,0.003753631n' +
            '2014,10,25.78625374,0.003982182n' +
            '2014,11,26.61719414,0.004056163n' +
            '2014,12,27.43463276,0.004242275n' +
            '2014,13,28.31720791,0.004356616n' +
            '2014,14,29.23106771,0.004430671n' +
            '2014,16,30.55067193,0.004615256n' +
            '2014,15,29.89843511,0.004622624n' +
            '2014,17,31.20316268,0.004788713n' +
            '2014,19,32.38771182,0.004905248n' +
            '2014,18,31.82871304,0.004935677n' +
            '2014,20,32.95847038,0.005040114n' +
            '2014,21,33.6474718,0.00517809n' +
            '2014,22,34.33875307,0.005287092n' +
            '2014,23,35.01464846,0.005318556n' +
            '2014,24,35.63748207,0.005509578n' +
            '2014,26,37.03581494,0.005533916n' +
            '2014,25,36.26642742,0.005552525n' +
            '2014,28,38.23585461,0.00585185n' +
            '2014,29,38.94099912,0.005912125n' +
            '2014,27,37.61468566,0.005914599n' +
            '2014,30,39.66490264,0.006131417n' +
            '2014,31,40.37644593,0.006135434n' +
            '2014,32,41.02135057,0.006275446n' +
            '2014,34,42.01105027,0.006279145n' +
            '2014,33,41.62407432,0.006398975n' +
            '2014,36,43.03352375,0.006620354n' +
            '2014,37,43.59007717,0.00664285n' +
            '2014,35,42.4723306,0.006659414n' + 
            '2014,38,44.05401838,0.006730177n' +
            '2014,39,44.59078719,0.006884592n' +
            '2014,40,45.22011959,0.006932515n' +
            '2014,41,45.78335857,0.006968054n' +
            '2014,42,46.49121536,0.007163011n' +
            '2014,44,47.72893726,0.007204686n' +
            '2014,43,47.10222632,0.007217617n' +
            '2014,46,48.96673209,0.007339635n' +
            '2014,45,48.31298287,0.007502717n' +
            '2014,47,49.62708527,0.007647174n' +
            '2014,49,51.09694646,0.00770794n' +
            '2014,48,50.38862979,0.007832711n' +
            '2014,50,51.83564211,0.008013788n' +
            '2014,51,52.57598103,0.008077265n' +
            '2014,52,53.44639201,0.00821346n' +
            '2014,53,54.36172111,0.008213976n' +
            '2014,54,55.3113642,0.008569552n' +
            '2014,55,56.25654416,0.008582421n' +
            '2014,56,57.0291785,0.008727159n' +
            '2014,57,57.94137541,0.008731472n' +
            '2014,58,58.59715086,0.008899733n' +
            '2014,60,60.15320318,0.00925621n' +
            '2014,59,59.28244241,0.009315586n' +
            '2014,61,61.24756855,0.009366636n' +
            '2014,62,62.45605758,0.0095675n' +
            '2014,63,63.53518536,0.009744829n' +
            '2014,64,64.52243794,0.009799718n' +
            '2014,66,66.6700305,0.009982036n' +
            '2014,65,65.58589209,0.010123451n' +
            '2014,68,68.73954583,0.010530309n' +
            '2014,67,67.67139554,0.01057591n' +
            '2014,69,69.68166938,0.010629437n' +
            '2014,70,70.78054852,0.01072159n' +
            '2014,72,73.10381941,0.011181249n' +
            '2014,71,71.82035176,0.011192657n' +
            '2014,73,74.50528527,0.011430376n' +
            '2014,74,75.81199845,0.011560037n' +
            '2014,75,77.04250182,0.011850264n' +
            '2014,76,78.565506,0.011979398n' +
            '2014,77,80.40478014,0.012287298n' +
            '2014,78,82.12333785,0.012632993n' +
            '2014,79,83.79248925,0.012819295n' +
            '2014,80,85.55768023,0.013092763n' +
            '2014,81,87.47915,0.013450056n' +
            '2014,82,89.38254022,0.013670864n' +
            '2014,83,91.63481485,0.013968713n' +
            '2014,84,93.91744067,0.01438506n' +
            '2014,85,96.41946083,0.014842324n' +
            '2014,86,99.54540544,0.015127246n' +
            '2014,87,102.9654549,0.015866659n' +
            '2014,88,105.971401,0.016271822n' +
            '2014,89,109.1419537,0.016551497n' +
            '2014,90,112.514213,0.017172604n' +
            '2014,91,116.3289357,0.017953955n' +
            '2014,92,120.6459775,0.018589704n' +
            '2014,93,125.5685177,0.019149158n' +
            '2014,94,131.9060045,0.020295548n' +
            '2014,95,139.9451658,0.021426068n' +
            '2014,96,148.6943539,0.022718048n' +
            '2014,97,161.3097917,0.024702846n' +
            '2014,98,181.7236599,0.027893949n' +
            '2014,99,217.7250904,0.033325498n' +
            '2014,100,419.3771126,0.064326418n' +
            '2016,1,2.921344881,4.53E-04n' +
            '2016,2,10.86946963,0.001684881n' +
            '2016,3,14.96556705,0.002398038n' +
            '2016,4,17.41174479,0.00271892n' +
            '2016,5,18.84613732,0.002939701n' +
            '2016,6,20.38088749,0.00321461n' +
            '2016,7,21.94488945,0.003436429n' +
            '2016,8,22.9706105,0.003609283n' +
            '2016,10,25.00293992,0.003666766n' +
            '2016,9,24.0096397,0.003762455n' +
            '2016,12,26.62725434,0.004162499n' +
            '2016,13,27.3528324,0.00430229n' +
            '2016,11,25.76408298,0.004302817n' +
            '2016,14,28.17373116,0.004405307n' +
            '2016,15,29.05679359,0.004495961n' +
            '2016,16,29.93744756,0.004766551n' +
            '2016,17,30.59293397,0.004801197n' +
            '2016,18,31.20220578,0.004892761n' +
            '2016,19,31.63021913,0.00495556n' +
            '2016,20,32.32867948,0.005069283n' +
            '2016,21,33.06058859,0.005186136n' +
            '2016,22,33.67194926,0.005241962n' +
            '2016,23,34.30940692,0.005419199n' +
            '2016,24,34.84748724,0.005423279n' +
            '2016,25,35.29368138,0.005502028n' +
            '2016,27,36.74800232,0.005605163n' +
            '2016,26,35.97401424,0.005691627n' +
            '2016,29,38.19577669,0.005925406n' +
            '2016,28,37.45386648,0.006052079n' +
            '2016,30,38.83223624,0.006153488n' +
            '2016,31,39.40745425,0.006166312n' +
            '2016,32,40.10945618,0.006278238n' +
            '2016,33,40.78564161,0.006367587n' +
            '2016,35,41.63865286,0.006526088n' +
            '2016,34,41.39825541,0.006538671n' +
            '2016,36,42.02093891,0.006569307n' +
            '2016,37,42.62393647,0.006699819n' +
            '2016,38,43.26897405,0.006773034n' +
            '2016,39,43.95228489,0.006872902n' +
            '2016,40,44.61490953,0.007022959n' +
            '2016,41,45.37646989,0.007088749n' +
            '2016,42,45.97395005,0.007232068n' +
            '2016,43,46.65105029,0.007290975n' +
            '2016,46,48.73932332,0.007300295n' +
            '2016,44,47.42866471,0.007458578n' +
            '2016,45,48.02211222,0.007513438n' +
            '2016,48,50.01934665,0.007831224n' +
            '2016,49,50.72917496,0.007959869n' +
            '2016,50,51.46537181,0.008071582n' +
            '2016,47,49.36311865,0.008099774n' +
            '2016,51,52.29708356,0.008170414n' +
            '2016,52,53.21992628,0.008297732n' +
            '2016,53,53.94076603,0.008481017n' +
            '2016,54,54.73058001,0.008643675n' +
            '2016,55,55.66432548,0.008725626n' +
            '2016,56,56.71593196,0.008889835n' +
            '2016,58,58.50555862,0.009011461n' +
            '2016,57,57.57195448,0.009021138n' +
            '2016,59,59.45792769,0.009451049n' +
            '2016,60,60.62677419,0.009512204n' +
            '2016,61,61.80787097,0.009620924n' +
            '2016,63,63.43629548,0.009820255n' +
            '2016,62,62.54525396,0.009896081n' +
            '2016,64,64.60173999,0.010270281n' +
            '2016,65,65.60493276,0.010276948n' +
            '2016,66,66.72095274,0.010468074n' +
            '2016,67,67.93312637,0.010622405n' +
            '2016,68,69.29769991,0.010813991n' +
            '2016,69,70.61850675,0.011145732n' +
            '2016,70,71.88259924,0.01127333n' +
            '2016,71,73.1759581,0.011361353n' +
            '2016,73,75.68829689,0.011694438n' +
            '2016,72,74.49065685,0.01179722n' +
            '2016,74,76.93036571,0.012007578n' +
            '2016,77,81.22701085,0.012240199n' +
            '2016,75,78.2816762,0.012464801n' +
            '2016,76,79.70407585,0.012522958n' +
            '2016,79,84.38656413,0.012934814n' +
            '2016,78,82.90435259,0.013208984n' +
            '2016,81,88.14204825,0.013654787n' +
            '2016,80,85.99034668,0.014054405n' +
            '2016,82,89.83042069,0.014108856n' +
            '2016,83,91.3544176,0.014365632n' +
            '2016,84,93.16756247,0.014753267n' +
            '2016,85,95.15888443,0.014820436n' +
            '2016,86,97.77003411,0.015420118n' +
            '2016,87,100.7484106,0.015748813n' +
            '2016,88,103.3231109,0.016264921n' +
            '2016,89,106.4835939,0.016690661n' +
            '2016,90,109.9008807,0.017132083n' +
            '2016,91,113.327115,0.01787625n' +
            '2016,92,117.2869678,0.01826497n' +
            '2016,93,121.4394061,0.019009422n' +
            '2016,94,126.5037933,0.019946163n' +
            '2016,95,133.7253411,0.020994106n' +
            '2016,96,142.5918642,0.022307768n' +
            '2016,97,153.5144822,0.023903829n' +
            '2016,98,170.2017432,0.026910549n' +
            '2016,99,208.2369816,0.032649976n' +
            '2016,100,360.2167398,0.056578312n' +
            '2018,1,2.595366313,3.95E-04n' +
            '2018,2,9.823911429,0.001540855n' +
            '2018,3,14.02903825,0.002175663n' +
            '2018,4,16.20475069,0.00250699n' +
            '2018,5,18.10915852,0.002798445n' +
            '2018,6,19.9508763,0.003068916n' +
            '2018,7,21.28037443,0.003195158n' +
            '2018,8,22.46745331,0.003566674n' +
            '2018,9,23.58626711,0.003666627n' +
            '2018,10,24.56020059,0.00371711n' +
            '2018,11,25.42979959,0.004015785n' +
            '2018,12,26.33331407,0.004093118n' +
            '2018,13,27.40014618,0.004243794n' +
            '2018,14,28.52270694,0.004393375n' +
            '2018,15,29.52728239,0.004571767n' +
            '2018,16,30.26886102,0.004657272n' +
            '2018,17,31.05298971,0.004865824n' +
            '2018,18,31.98053166,0.004964377n' +
            '2018,20,33.22802717,0.00503854n' +
            '2018,19,32.66549084,0.005051914n' +
            '2018,21,33.63693313,0.005208151n' +
            '2018,25,36.01406074,0.005317198n' +
            '2018,22,34.17025041,0.005357988n' +
            '2018,23,34.82676969,0.00542482n' +
            '2018,24,35.36869964,0.005481393n' +
            '2018,27,37.20731631,0.005655879n' +
            '2018,33,40.87633985,0.005827474n' +
            '2018,26,36.50531459,0.005907469n' +
            '2018,28,37.85771532,0.005966155n' +
            '2018,29,38.61389827,0.00597805n' +
            '2018,30,39.23941491,0.006050637n' +
            '2018,31,39.93717676,0.006195243n' +
            '2018,32,40.47103984,0.006251838n' +
            '2018,36,42.40615011,0.006434481n' +
            '2018,35,41.79732628,0.006571216n' +
            '2018,39,44.29336043,0.006636372n' +
            '2018,38,43.63415757,0.006779719n' +
            '2018,37,43.06505422,0.00678214n' +
            '2018,34,41.19537868,0.006785617n' +
            '2018,41,45.31986066,0.006989558n' +
            '2018,40,44.78770392,0.007085128n' +
            '2018,42,45.98918996,0.007211575n' +
            '2018,43,46.75184156,0.007221388n' +
            '2018,44,47.49359156,0.007336236n' +
            '2018,45,48.33259569,0.007517106n' +
            '2018,46,49.07601632,0.007534337n' +
            '2018,47,49.90985642,0.007748932n' +
            '2018,48,50.82979576,0.007873654n' +
            '2018,49,51.65939593,0.007970316n' +
            '2018,50,52.49251803,0.008042053n' +
            '2018,52,53.87597193,0.008324013n' +
            '2018,51,53.27500401,0.008349236n' +
            '2018,53,54.62220616,0.008350397n' +
            '2018,54,55.47221646,0.008394207n' +
            '2018,55,56.23253556,0.008910815n' +
            '2018,56,57.24371642,0.008936035n' +
            '2018,58,59.10520774,0.008996649n' +
            '2018,57,58.16688376,0.009049385n' +
            '2018,60,60.91533476,0.009310841n' +
            '2018,59,59.90437715,0.009441931n' +
            '2018,61,61.75432927,0.009518217n' +
            '2018,62,62.61595691,0.009826817n' +
            '2018,63,63.64261438,0.009890097n' +
            '2018,64,64.68995889,0.01000389n' +
            '2018,65,65.87401702,0.010148557n' +
            '2018,68,68.91650916,0.0103611n' +
            '2018,66,66.8617044,0.010409445n' +
            '2018,67,67.79991077,0.010475027n' +
            '2018,70,70.96026521,0.010882762n' +
            '2018,69,70.000275,0.011094225n' +
            '2018,71,72.26105558,0.011189831n' +
            '2018,72,73.60416061,0.011515003n' +
            '2018,73,74.84108522,0.011616578n' +
            '2018,74,76.30553539,0.011778189n' +
            '2018,75,77.63277599,0.011960288n' +
            '2018,76,78.97379055,0.012308445n' +
            '2018,77,80.61337965,0.012447268n' +
            '2018,78,82.35020384,0.012784779n' +
            '2018,79,83.8521037,0.012905229n' +
            '2018,80,85.3092945,0.013206379n' +
            '2018,81,86.82983593,0.013417528n' +
            '2018,82,88.95395683,0.013731487n' +
            '2018,83,90.96324283,0.014032905n' +
            '2018,84,93.16888148,0.01456131n';
            
            var margin = {top: 100, right: 30, bottom: 80, left: 80}
            var svg = d3.select("svg")
            
            var width = parseInt(svg.attr('width'));
            svg.attr("width", width + margin.left + margin.right);
            
            var height = parseInt(svg.attr("height"));
            svg.attr('height', height + margin.top + margin.bottom);

            var g = svg.append("g")

            var data = d3.csvParse(wealthdataBY);
            data.forEach(function (d) {
                d.year = +d.year
                d.percentile = +d.percentile
                d.avg_welfare = +d.avg_welfare
                d.welfare_share = +d.welfare_share
            })
            
            var years = [...new Set(data.map(function (d) {
                return d.year;
            }))];
            
            var xScaleYears = d3.scaleBand()
            .domain(years)
            .range([margin.left, width])
            .padding(0.0);
            
            var percentiles = [...new Set(data.map(function (d) {
                return d.percentile;
            }))].sort(function (left, right) {
                return left - right;
            });

            const xSegmentWidth = (width - margin.left) / 3;

            var xScalePercentile = d3.scaleBand()
            .domain(percentiles)
            .range([0, xSegmentWidth])
            .padding(0.0);

            var yScaleAverageWelfare = d3.scaleLinear()
            .domain([0, d3.max(data, function (d) {
                  return d.avg_welfare
                })])
            .range([margin.top + 0 * height / 3, margin.top + 1 * height / 3]);

            var yScaleWelfareShare = d3.scaleLinear()
            .domain([0, d3.max(data, function (d) {
                return d.welfare_share
            })])
            .range([margin.top + 2 * height / 3, margin.top + 3 * height / 3]);

            g.append("g")
             .attr("transform", "translate(0, " + (height + margin.top + 0) + ")")
             .call(d3.axisBottom(xScaleYears));
             
            var percentileAxisTickValues = percentiles.filter(function (percentile) {
                return percentile % 20 == 0
            });
            
            var percentileAxis = d3.axisBottom(xScalePercentile)
                                   .tickValues(percentileAxisTickValues);

            var groupWithPercentileAxes = g.append('g').attr('class', 'percentile-axes');
            groupWithPercentileAxes.selectAll('g.percentile-axis')
                       .data(xScaleYears.domain())
                       .enter()
                       .append('g')
                       .attr('class', 'percentile-axes')
                       .attr('transform', function (year) {
                           var yearStartX = xScaleYears(year);
                           var percentilAxisYPosition = height + margin.top + 20
                           return 'translate(' + yearStartX + ' ' + percentilAxisYPosition + ')';
                         })
                       .call(percentileAxis);
            
            g.append("g")
             .attr('transform', 'translate(' + margin.left + ' 0)')
             .call(d3.axisLeft(yScaleAverageWelfare))
                     
            g.append("g")
             .attr('transform', 'translate(' + margin.left + ' 0)')
             .call(d3.axisLeft(yScaleWelfareShare));
             
            var dotGroup = g.append('g')
                            .attr('class', 'dot-group');
                            
            dotGroup.selectAll("dot")
                    .data(data)
                    .enter()
                    .append("circle")
                    .attr("cx", function (d) {
                        return xScaleYears(d.year) + xScalePercentile(d.percentile);
                    })
                    .attr("cy", function (d) {
                        return yScaleAverageWelfare(d.avg_welfare);
                    })
                    .attr("r", 5)
                    .style("fill", "green")
                    
            dotGroup.selectAll("dot")
                    .data(data)
                    .enter()
                    .append("circle")
                    .attr("cx", function (d) {
                        return xScaleYears(d.year) + xScalePercentile(d.percentile);
                    })
                    .attr("cy", function (d) {
                        return yScaleWelfareShare(d.welfare_share);
                    })
                    .attr("r", 5)
                    .style("fill", "blue")
                    
            svg.append("text")
               .attr("transform", "translate(250,0)")
               .attr("x", 50)
               .attr("y", 50)
               .attr("font-size", "20px")
               .attr("text-anchor", "middle")
               .text("Distribution of wealth from 2014-2018");
            
            g.append("g")
             .attr("transform", "translate(0, " + (height + margin.top) + ")")
             .append("text")
             .attr("y", 10)
             .attr("x", width + 10)
             .attr("text-anchor", "beginning")
             .attr("stroke", "black")
             .text("Year");
             
            g.append("g")
             .attr("transform", "translate(0, " + (height + margin.top + 20) + ")")
             .append("text")
             .attr("y", 10)
             .attr("x", width + 10)
             .attr("text-anchor", "beginning")
             .attr("stroke", "black")
             .text("Percentile");
             
            g.append("g")
             .attr('transform', 'translate(' + margin.left + ', ' + (margin.top + 0 * height / 3) + ')')
             .append("text")
             .attr("transform", "rotate(-90)")
             .attr("y", 30)
             .attr("dy", "-5.1em")
             .attr("text-anchor", "end")
             .attr("stroke", "black")
             .text("Average Wealth");
             
            g.append("g")
             .attr('transform', 'translate(' + margin.left + ', ' + (margin.top + 1 * height / 3) + ')')
             .append("text")
             .attr("transform", "rotate(-90)")
             .attr("y", 30)
             .attr("dy", "-5.1em")
             .attr("text-anchor", "end")
             .attr("stroke", "black")
             .text("Share of Wealth");

            </script>
    </body>
</html>